Lines Matching refs:softc

178 static int asix_init_device( asix_softc_t *softc )
185 usb_get_device_descriptor( softc->dev, &dev_desc, 0 );
193 softc->dev_id = ptr[2];
194 softc->ven_code = ptr[3];
205 asix_get_mac_addr( softc->dev, softc->mac_addr );
209 VENDOR_NAMES[softc->ven_code], softc->mac_addr);
216 asix_softc_t *softc = (asix_softc_t *) ctx;
218 hs_memcpy_to_hs( mac_addr, softc->mac_addr, 6 );
222 static void asix_queue_rx( asix_softc_t *softc )
224 softc->rx_ur = usb_make_request(softc->dev, softc->bulk_inpipe,
225 softc->rxbuf, sizeof(softc->rxbuf),
227 usb_queue_request(softc->rx_ur);
232 asix_softc_t *softc = (asix_softc_t *) ctx;
234 usb_poll(softc->dev->ud_bus);
235 return( !softc->rx_ur->ur_inprogress );
240 asix_softc_t *softc = (asix_softc_t *) ctx;
243 if( !softc->rx_ur->ur_inprogress ) {
244 len = softc->rx_ur->ur_xferred;
245 hs_memcpy_to_hs( buf, softc->rxbuf, len );
246 usb_free_request(softc->rx_ur);
247 asix_queue_rx( softc );
257 asix_softc_t *softc = (asix_softc_t *) ctx;
264 ur = usb_make_request(softc->dev, softc->bulk_outpipe,
273 static void asix_open_device( asix_softc_t *softc )
275 usbdev_t *dev = softc->dev;
304 asix_queue_rx( softc );
307 static void asix_close_device( asix_softc_t *softc )
310 asix_set_reg( softc->dev, ASIX_RXCTL_CMD, 0, 0, NULL, 0 );
323 * device and allocating our softc here.
342 asix_softc_t *softc;
347 softc = (asix_softc_t *) KMALLOC( sizeof(asix_softc_t), USB_MALLOC_VALUE );
348 if( softc == NULL ) {
349 xprintf( "Failed to allocate softc memory.\n" );
352 memset( softc, 0, sizeof(asix_softc_t) );
353 dev->ud_private = softc;
354 softc->dev = dev;
385 if (asix_init_device(softc) < 0)
389 softc->bulk_inpipe = usb_open_pipe(dev,indscr);
390 softc->bulk_outpipe = usb_open_pipe(dev,outdscr);
393 usbeth_register(&usbeth_asix, softc);
396 asix_open_device( softc );
418 asix_softc_t *softc = (asix_softc_t *) dev->ud_private;
420 if (softc != NULL) {
421 usbeth_unregister( softc );
422 asix_close_device( softc );
424 softc->dev = NULL;
425 KFREE(softc);