static int CDCEther_close( struct net_device *net ) { ether_dev_t *ether_dev = net->priv; // We are no longer running. ether_dev->flags &= ~CDC_ETHER_RUNNING; // Tell the kernel to stop sending us stuff netif_stop_queue( net ); // If we are not already unplugged, turn off USB // traffic if ( !(ether_dev->flags & CDC_ETHER_UNPLUG) ) { disable_net_traffic( ether_dev ); } // We don't need the URBs anymore. usb_unlink_urb( ðer_dev->rx_urb ); usb_unlink_urb( ðer_dev->tx_urb ); usb_unlink_urb( ðer_dev->intr_urb ); // We are not being used now. MOD_DEC_USE_COUNT; // That's it. I'm done. return 0; }
static int rtl8150_close(struct net_device *netdev) { rtl8150_t *dev; int res = 0; dev = netdev->priv; if (!dev) return -ENODEV; down(&dev->sem); if (!test_bit(RTL8150_UNPLUG, &dev->flags)) disable_net_traffic(dev); unlink_all_urbs(dev); netif_stop_queue(netdev); up(&dev->sem); #ifdef CONFIG_RTL865XB_3G reCore_unregisterWANDevice(); if(0!=devglue_unregExtDevice(myLinkID2)) printk("XXX Can't unregister link ID %d for device ppp !!!\n",myLinkID2); else printk("Device ppp's main Link ID %d unregistered.\n",myLinkID2); myLinkID2=0; #endif return res; }
static int pegasus_close(struct net_device *net) { pegasus_t *pegasus = net->priv; pegasus->flags &= ~PEGASUS_RUNNING; netif_stop_queue(net); if (!(pegasus->flags & PEGASUS_UNPLUG)) disable_net_traffic(pegasus); tasklet_kill(&pegasus->rx_tl); unlink_all_urbs(pegasus); return 0; }
static int rtl8150_close(struct net_device *netdev) { rtl8150_t *dev; int res = 0; dev = netdev->priv; if (!dev) return -ENODEV; down(&dev->sem); if (!test_bit(RTL8150_UNPLUG, &dev->flags)) disable_net_traffic(dev); unlink_all_urbs(dev); netif_stop_queue(netdev); up(&dev->sem); return res; }