Loading drivers/staging/otus/zdusb.c +119 −132 Original line number Diff line number Diff line Loading @@ -96,8 +96,7 @@ static int zfLnxProbe(struct usb_interface *interface, #endif macp = kzalloc(sizeof(struct usbdrv_private), GFP_KERNEL); if (!macp) { if (!macp) { printk(KERN_ERR "out of memory allocating device structure\n"); result = -ENOMEM; goto fail; Loading @@ -105,8 +104,7 @@ static int zfLnxProbe(struct usb_interface *interface, net = alloc_etherdev(0); if (net == NULL) { if (net == NULL) { printk(KERN_ERR "zfLnxProbe: Not able to alloc etherdev struct\n"); result = -ENOMEM; goto fail1; Loading @@ -114,7 +112,7 @@ static int zfLnxProbe(struct usb_interface *interface, strcpy(net->name, "ath%d"); net->ml_priv = macp; //kernel 2.6 net->ml_priv = macp; /* kernel 2.6 */ macp->udev = dev; macp->device = net; Loading @@ -122,28 +120,23 @@ static int zfLnxProbe(struct usb_interface *interface, /* check out the endpoints */ macp->interface = interface; //init_waitqueue_head(&macp->regSet_wait); //init_waitqueue_head(&macp->iorwRsp_wait); //init_waitqueue_head(&macp->term_wait); /* init_waitqueue_head(&macp->regSet_wait); */ /* init_waitqueue_head(&macp->iorwRsp_wait); */ /* init_waitqueue_head(&macp->term_wait); */ if (!zfLnxAllocAllUrbs(macp)) { if (!zfLnxAllocAllUrbs(macp)) { result = -ENOMEM; goto fail2; } if (!zfLnxInitSetup(net, macp)) { if (!zfLnxInitSetup(net, macp)) { result = -EIO; goto fail3; } else { } else { usb_set_intfdata(interface, macp); SET_NETDEV_DEV(net, &interface->dev); if (register_netdev(net) != 0) { if (register_netdev(net) != 0) { usb_set_intfdata(interface, NULL); goto fail3; } Loading @@ -151,18 +144,15 @@ static int zfLnxProbe(struct usb_interface *interface, netif_carrier_off(net); goto done; fail3: zfLnxFreeAllUrbs(macp); fail2: free_netdev(net); //kernel 2.6 free_netdev(net); /* kernel 2.6 */ fail1: kfree(macp); fail: usb_put_dev(dev); macp = NULL; done: return result; } Loading @@ -173,23 +163,20 @@ static void zfLnxDisconnect(struct usb_interface *interface) printk(KERN_DEBUG "zfLnxDisconnect\n"); if (!macp) { if (!macp) { printk(KERN_ERR "unregistering non-existant device\n"); return; } if (macp->driver_isolated) { if (macp->device->flags & IFF_UP) usbdrv_close(macp->device); } #if 0 /* Close WDS */ //zfWdsClose(wds[0].dev); /* zfWdsClose(wds[0].dev); */ /* Unregister WDS */ //zfUnregisterWdsDev(macp->device, 0); /* zfUnregisterWdsDev(macp->device, 0); */ /* Close VAP */ zfLnxVapClose(vap[0].dev); Loading @@ -203,14 +190,14 @@ static void zfLnxDisconnect(struct usb_interface *interface) usb_put_dev(interface_to_usbdev(interface)); //printk(KERN_ERR "3. zfLnxUnlinkAllUrbs\n"); //zfLnxUnlinkAllUrbs(macp); /* printk(KERN_ERR "3. zfLnxUnlinkAllUrbs\n"); */ /* zfLnxUnlinkAllUrbs(macp); */ /* Free network interface */ free_netdev(macp->device); zfLnxFreeAllUrbs(macp); //zfLnxClearStructs(macp->device); /* zfLnxClearStructs(macp->device); */ kfree(macp); macp = NULL; Loading Loading
drivers/staging/otus/zdusb.c +119 −132 Original line number Diff line number Diff line Loading @@ -96,8 +96,7 @@ static int zfLnxProbe(struct usb_interface *interface, #endif macp = kzalloc(sizeof(struct usbdrv_private), GFP_KERNEL); if (!macp) { if (!macp) { printk(KERN_ERR "out of memory allocating device structure\n"); result = -ENOMEM; goto fail; Loading @@ -105,8 +104,7 @@ static int zfLnxProbe(struct usb_interface *interface, net = alloc_etherdev(0); if (net == NULL) { if (net == NULL) { printk(KERN_ERR "zfLnxProbe: Not able to alloc etherdev struct\n"); result = -ENOMEM; goto fail1; Loading @@ -114,7 +112,7 @@ static int zfLnxProbe(struct usb_interface *interface, strcpy(net->name, "ath%d"); net->ml_priv = macp; //kernel 2.6 net->ml_priv = macp; /* kernel 2.6 */ macp->udev = dev; macp->device = net; Loading @@ -122,28 +120,23 @@ static int zfLnxProbe(struct usb_interface *interface, /* check out the endpoints */ macp->interface = interface; //init_waitqueue_head(&macp->regSet_wait); //init_waitqueue_head(&macp->iorwRsp_wait); //init_waitqueue_head(&macp->term_wait); /* init_waitqueue_head(&macp->regSet_wait); */ /* init_waitqueue_head(&macp->iorwRsp_wait); */ /* init_waitqueue_head(&macp->term_wait); */ if (!zfLnxAllocAllUrbs(macp)) { if (!zfLnxAllocAllUrbs(macp)) { result = -ENOMEM; goto fail2; } if (!zfLnxInitSetup(net, macp)) { if (!zfLnxInitSetup(net, macp)) { result = -EIO; goto fail3; } else { } else { usb_set_intfdata(interface, macp); SET_NETDEV_DEV(net, &interface->dev); if (register_netdev(net) != 0) { if (register_netdev(net) != 0) { usb_set_intfdata(interface, NULL); goto fail3; } Loading @@ -151,18 +144,15 @@ static int zfLnxProbe(struct usb_interface *interface, netif_carrier_off(net); goto done; fail3: zfLnxFreeAllUrbs(macp); fail2: free_netdev(net); //kernel 2.6 free_netdev(net); /* kernel 2.6 */ fail1: kfree(macp); fail: usb_put_dev(dev); macp = NULL; done: return result; } Loading @@ -173,23 +163,20 @@ static void zfLnxDisconnect(struct usb_interface *interface) printk(KERN_DEBUG "zfLnxDisconnect\n"); if (!macp) { if (!macp) { printk(KERN_ERR "unregistering non-existant device\n"); return; } if (macp->driver_isolated) { if (macp->device->flags & IFF_UP) usbdrv_close(macp->device); } #if 0 /* Close WDS */ //zfWdsClose(wds[0].dev); /* zfWdsClose(wds[0].dev); */ /* Unregister WDS */ //zfUnregisterWdsDev(macp->device, 0); /* zfUnregisterWdsDev(macp->device, 0); */ /* Close VAP */ zfLnxVapClose(vap[0].dev); Loading @@ -203,14 +190,14 @@ static void zfLnxDisconnect(struct usb_interface *interface) usb_put_dev(interface_to_usbdev(interface)); //printk(KERN_ERR "3. zfLnxUnlinkAllUrbs\n"); //zfLnxUnlinkAllUrbs(macp); /* printk(KERN_ERR "3. zfLnxUnlinkAllUrbs\n"); */ /* zfLnxUnlinkAllUrbs(macp); */ /* Free network interface */ free_netdev(macp->device); zfLnxFreeAllUrbs(macp); //zfLnxClearStructs(macp->device); /* zfLnxClearStructs(macp->device); */ kfree(macp); macp = NULL; Loading