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 int rtusb_probe (struct usb_interface *intf, const USB_DEVICE_ID *id) { RTMP_ADAPTER *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); return rv; }
static int __devinit rtusb_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct rt_rtmp_adapter *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); return rv; }
static void *rtusb_probe(struct usb_device *dev, UINT inf, const USB_DEVICE_ID *id) { struct usb_interface *usb_if; VOID *pAd; int rv; /* get the active interface descriptor */ usb_if = &dev->actconfig->interface[inf]; /* call generic probe procedure. */ rv = rt2870_probe(usb_if, dev, id, &pAd); if (rv != 0) pAd = NULL; return (void *)pAd; }
static void *rtusb_probe(struct usb_device *dev, UINT interface, const USB_DEVICE_ID *id) { struct usb_interface *intf; RTMP_ADAPTER *pAd; int rv; /* get the active interface descriptor */ intf = &dev->actconfig->interface[interface]; // call generic probe procedure. rv = rt2870_probe(intf, dev, id, &pAd); if (rv != 0) pAd = NULL; return (void *)pAd; }
static void _dev_probe_entry(void *parameter) { wifi_usb_adapter_t *adapter = (wifi_usb_adapter_t *)&wifi_usb_adapter; USB_OTG_CORE_HANDLE *pdev = &USB_OTG_Core_dev; USBH_HOST *pphost = &USB_Host; DBGPRINT(WHED_DEBUG_TRACE, "%s: ---->\n", __FUNCTION__); DBGPRINT(WHED_DEBUG_TRACE, "VID:%x, PID:%x.\n",\ pphost->device_prop.Dev_Desc.idVendor, pphost->device_prop.Dev_Desc.idProduct); if (!adapter->device_matched) { DBGPRINT(WHED_DEBUG_ERROR, "Device is not supported.\n"); return; } /* Control channel */ adapter->usb_ctrl_req.ep0size = pphost->Control.ep0size; /* no use */ adapter->usb_ctrl_req.hc_num_in = pphost->Control.hc_num_in; adapter->usb_ctrl_req.hc_num_out = pphost->Control.hc_num_out; DBGPRINT(WHED_DEBUG_TRACE, "Control in pipe - 0x%x\n", adapter->usb_ctrl_req.hc_num_in); DBGPRINT(WHED_DEBUG_TRACE, "Control out pipe - 0x%x\n", adapter->usb_ctrl_req.hc_num_out); /* Data IN channel */ adapter->hc_num_in = USBH_Alloc_Channel(pdev, adapter->bulk_in_ep); USBH_Open_Channel(pdev, adapter->hc_num_in, pphost->device_prop.address, pphost->device_prop.speed, EP_TYPE_BULK, adapter->bulk_in_ep_size); DBGPRINT(WHED_DEBUG_TRACE, "Bulk in pipe - 0x%x\n", adapter->hc_num_in); /* Data OUT channel */ adapter->hc_num_out = USBH_Alloc_Channel(pdev, adapter->bulk_out_ep); USBH_Open_Channel(pdev, adapter->hc_num_out, pphost->device_prop.address, pphost->device_prop.speed, EP_TYPE_BULK, adapter->bulk_out_ep_size); DBGPRINT(WHED_DEBUG_TRACE, "Bulk out pipe - 0x%x\n", adapter->hc_num_out); /* Initialize the usb request state machine. */ adapter->usb_ctrl_req.state = CTRL_IDLE; adapter->usb_tx_req.state = USB_BULK_STATE_IDLE; adapter->usb_rx_req.state = USB_BULK_STATE_IDLE; adapter->usb_ctrl_req.retry = 3; adapter->usb_tx_req.retry = 3; adapter->usb_rx_req.retry = 3; /* Initialize the Wifi module, */ rt2870_probe(adapter, &adapter->pAdapter); /* Inform to the system */ sys_add_event_queue(&p_cms_envar->sys, SYS_MSG_INITED, 0, 0, 0); }