static int rtusb_probe (struct usb_interface *intf, const USB_DEVICE_ID *id) { VOID *pAd; struct usb_device *dev; int rv; dev = interface_to_usbdev(intf); dev = usb_get_dev(dev); rv = rt2870_probe(intf, dev, id, &pAd); if (rv != 0) { usb_put_dev(dev); } #ifdef IFUP_IN_PROBE else { if (VIRTUAL_IF_UP(pAd) != 0) { pAd = usb_get_intfdata(intf); usb_set_intfdata(intf, NULL); rt2870_disconnect(dev, pAd); rv = -ENOMEM; } } #endif /* IFUP_IN_PROBE */ return rv; }
static void rtusb_disconnect(struct usb_interface *intf) { struct usb_device *dev = interface_to_usbdev(intf); VOID *pAd; pAd = usb_get_intfdata(intf); #ifdef IFUP_IN_PROBE VIRTUAL_IF_DOWN(pAd); #endif /* IFUP_IN_PROBE */ usb_set_intfdata(intf, NULL); rt2870_disconnect(dev, pAd); #ifdef CONFIG_PM #ifdef USB_SUPPORT_SELECTIVE_SUSPEND printk("rtusb_disconnect usb_autopm_put_interface \n"); usb_autopm_put_interface(intf); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) printk("%s() => pm_usage_cnt %d \n", __FUNCTION__, atomic_read(&intf->pm_usage_cnt)); #else printk("%s() => pm_usage_cnt %d \n", __FUNCTION__, intf->pm_usage_cnt); #endif #endif /* USB_SUPPORT_SELECTIVE_SUSPEND */ #endif /* CONFIG_PM */ }
static void rtusb_disconnect(struct usb_interface *intf) { struct usb_device *dev = interface_to_usbdev(intf); struct rt_rtmp_adapter *pAd; pAd = usb_get_intfdata(intf); usb_set_intfdata(intf, NULL); rt2870_disconnect(dev, pAd); }
static void rtusb_disconnect(struct usb_interface *intf) { struct usb_device *dev = interface_to_usbdev(intf); PRTMP_ADAPTER pAd; pAd = usb_get_intfdata(intf); usb_set_intfdata(intf, NULL); rt2870_disconnect(dev, pAd); }
/*Disconnect function is called within exit routine */ static void rtusb_disconnect(struct usb_device *dev, void *ptr) { int lockResult; lockResult = down_trylock(&rtusb_module_mutex); if( (lockResult == 0) || (rtusb_disconnect_by_rmmod == 1)) { rt2870_disconnect(dev, ptr); if (lockResult == 0) up(&rtusb_module_mutex); } else { DBGPRINT(RT_DEBUG_WARN, ("%s():acquire module mutex failed\n", __FUNCTION__)); } }
static void rtusb_disconnect(struct usb_interface *intf) { struct usb_device *dev = interface_to_usbdev(intf); VOID *pAd; int lockResult; lockResult = down_trylock(&rtusb_module_mutex); if( (lockResult == 0) || (rtusb_disconnect_by_rmmod == 1)) { DBGPRINT(RT_DEBUG_WARN, ("%s():lockResult=%d, rmmod=%d!\n", __FUNCTION__, lockResult, rtusb_disconnect_by_rmmod)); pAd = usb_get_intfdata(intf); #ifdef IFUP_IN_PROBE VIRTUAL_IF_DOWN(pAd); #endif /* IFUP_IN_PROBE */ usb_set_intfdata(intf, NULL); rt2870_disconnect(dev, pAd); if (lockResult == 0) up(&rtusb_module_mutex); } else { DBGPRINT(RT_DEBUG_WARN, ("%s():acquire module mutex failed\n", __FUNCTION__)); } #ifdef CONFIG_PM #ifdef USB_SUPPORT_SELECTIVE_SUSPEND printk("rtusb_disconnect usb_autopm_put_interface \n"); usb_autopm_put_interface(intf); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) printk(" ^^rt2870_disconnect ====> pm_usage_cnt %d \n", atomic_read(&intf->pm_usage_cnt)); #else printk(" rt2870_disconnect ====> pm_usage_cnt %d \n", intf->pm_usage_cnt); #endif #endif /* USB_SUPPORT_SELECTIVE_SUSPEND */ #endif /* CONFIG_PM */ }
//Disconnect function is called within exit routine static void rtusb_disconnect(struct usb_device *dev, void *ptr) { rt2870_disconnect(dev, ((PRTMP_ADAPTER)ptr)); }
/*Disconnect function is called within exit routine */ static void rtusb_disconnect(struct usb_device *dev, void *ptr) { rt2870_disconnect(dev, ptr); }