@@ -315,6 +315,7 @@ static struct usb_device_id rtw_usb_id_tbl[] = {
315315 {USB_DEVICE_AND_INTERFACE_INFO (USB_VENDER_ID_REALTEK , 0xE822 , 0xff , 0xff , 0xff ), .driver_info = RTL8822E }, /* Default ID for USB multi-function */
316316 {USB_DEVICE_AND_INTERFACE_INFO (USB_VENDER_ID_REALTEK , 0xA82A , 0xff , 0xff , 0xff ), .driver_info = RTL8822E }, /* Default ID for USB multi-function */
317317 {USB_DEVICE_AND_INTERFACE_INFO (USB_VENDER_ID_REALTEK , 0xA81A , 0xff , 0xff , 0xff ), .driver_info = RTL8822E }, /* 8812EU */
318+ {USB_DEVICE (USB_VENDER_ID_REALTEK , 0xA81A ), .driver_info = RTL8822E }, /* Match even if interface descriptors are not vendor-specific */
318319#endif /* CONFIG_RTL8822E */
319320
320321
@@ -565,6 +566,11 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf, const s
565566 /* pdvobjpriv->nr_endpoint = 6; */
566567
567568 pdev_desc = & pusbd -> descriptor ;
569+ printk (KERN_INFO DRV_NAME ": usb_dvobj_init: dev=%u-%u vid=%04x pid=%04x bcd=%04x speed=%d configs=%u\n" ,
570+ pusbd -> bus -> busnum , pusbd -> devnum ,
571+ le16_to_cpu (pdev_desc -> idVendor ), le16_to_cpu (pdev_desc -> idProduct ),
572+ le16_to_cpu (pdev_desc -> bcdDevice ), pusbd -> speed ,
573+ pdev_desc -> bNumConfigurations );
568574
569575#if 0
570576 RTW_INFO ("\n8712_usb_device_descriptor:\n" );
@@ -592,6 +598,10 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf, const s
592598
593599 phost_iface = & usb_intf -> altsetting [0 ];
594600 piface_desc = & phost_iface -> desc ;
601+ printk (KERN_INFO DRV_NAME ": usb_dvobj_init: intf=%u alt=%u class=%02x subclass=%02x proto=%02x endpoints=%u\n" ,
602+ piface_desc -> bInterfaceNumber , piface_desc -> bAlternateSetting ,
603+ piface_desc -> bInterfaceClass , piface_desc -> bInterfaceSubClass ,
604+ piface_desc -> bInterfaceProtocol , piface_desc -> bNumEndpoints );
595605
596606 pdvobjpriv -> nr_endpoint = piface_desc -> bNumEndpoints ;
597607
@@ -601,6 +611,9 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf, const s
601611 phost_endp = phost_iface -> endpoint + i ;
602612 if (phost_endp ) {
603613 pendp_desc = & phost_endp -> desc ;
614+ printk (KERN_INFO DRV_NAME ": usb_dvobj_init: ep%d addr=0x%02x attr=0x%02x maxpkt=%u interval=%u\n" ,
615+ i , pendp_desc -> bEndpointAddress , pendp_desc -> bmAttributes ,
616+ le16_to_cpu (pendp_desc -> wMaxPacketSize ), pendp_desc -> bInterval );
604617
605618 RTW_INFO ("\nusb_endpoint_descriptor(%d):\n" , i );
606619 RTW_INFO ("bLength=%x\n" , pendp_desc -> bLength );
@@ -630,6 +643,9 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf, const s
630643 }
631644
632645 RTW_INFO ("nr_endpoint=%d, in_num=%d, out_num=%d\n\n" , pdvobjpriv -> nr_endpoint , pdvobjpriv -> RtNumInPipes , pdvobjpriv -> RtNumOutPipes );
646+ printk (KERN_INFO DRV_NAME ": usb_dvobj_init: pipes in=%u out=%u nr_endpoint=%u\n" ,
647+ pdvobjpriv -> RtNumInPipes , pdvobjpriv -> RtNumOutPipes ,
648+ pdvobjpriv -> nr_endpoint );
633649
634650 switch (pusbd -> speed ) {
635651 case USB_SPEED_LOW :
@@ -1310,29 +1326,42 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device
13101326 _adapter * padapter = NULL ;
13111327 int status = _FAIL ;
13121328 struct dvobj_priv * dvobj ;
1329+ struct usb_device * udev = interface_to_usbdev (pusb_intf );
1330+ struct usb_interface_descriptor * idesc = & pusb_intf -> cur_altsetting -> desc ;
13131331#ifdef CONFIG_CONCURRENT_MODE
13141332 int i ;
13151333#endif
13161334
13171335 /* RTW_INFO("+rtw_drv_init\n"); */
1336+ printk (KERN_INFO DRV_NAME ": probe start: dev=%u-%u vid=%04x pid=%04x intf=%u class=%02x subclass=%02x proto=%02x driver_info=0x%lx\n" ,
1337+ udev -> bus -> busnum , udev -> devnum ,
1338+ le16_to_cpu (udev -> descriptor .idVendor ),
1339+ le16_to_cpu (udev -> descriptor .idProduct ),
1340+ idesc -> bInterfaceNumber , idesc -> bInterfaceClass ,
1341+ idesc -> bInterfaceSubClass , idesc -> bInterfaceProtocol ,
1342+ (unsigned long )pdid -> driver_info );
13181343
13191344 /* step 0. */
13201345 process_spec_devid (pdid );
13211346
13221347 /* Initialize dvobj_priv */
13231348 dvobj = usb_dvobj_init (pusb_intf , pdid );
13241349 if (dvobj == NULL ) {
1350+ printk (KERN_ERR DRV_NAME ": probe failed: usb_dvobj_init returned NULL\n" );
13251351 goto exit ;
13261352 }
13271353
13281354 padapter = rtw_usb_primary_adapter_init (dvobj , pusb_intf );
13291355 if (padapter == NULL ) {
1356+ printk (KERN_ERR DRV_NAME ": probe failed: rtw_usb_primary_adapter_init returned NULL\n" );
13301357 RTW_INFO ("rtw_usb_primary_adapter_init Failed!\n" );
13311358 goto free_dvobj ;
13321359 }
13331360
1334- if (usb_reprobe_switch_usb_mode (padapter ) == _TRUE )
1361+ if (usb_reprobe_switch_usb_mode (padapter ) == _TRUE ) {
1362+ printk (KERN_INFO DRV_NAME ": probe stopped: usb_reprobe_switch_usb_mode requested reprobe\n" );
13351363 goto free_if_prim ;
1364+ }
13361365
13371366#ifdef CONFIG_CONCURRENT_MODE
13381367 if (padapter -> registrypriv .virtual_iface_num > (CONFIG_IFACE_NUMBER - 1 ))
@@ -1368,6 +1397,8 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device
13681397
13691398
13701399 status = _SUCCESS ;
1400+ printk (KERN_INFO DRV_NAME ": probe success: ifaces=%u mac=%pM\n" ,
1401+ dvobj -> iface_nums , adapter_mac_addr (padapter ));
13711402
13721403#if 0 /* not used now */
13731404os_ndevs_deinit :
@@ -1376,6 +1407,7 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device
13761407#endif
13771408free_if_vir :
13781409 if (status != _SUCCESS ) {
1410+ printk (KERN_ERR DRV_NAME ": probe cleanup: status failed after adapter init\n" );
13791411 #ifdef CONFIG_CONCURRENT_MODE
13801412 rtw_drv_stop_vir_ifaces (dvobj );
13811413 rtw_drv_free_vir_ifaces (dvobj );
@@ -1390,6 +1422,8 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device
13901422 if (status != _SUCCESS )
13911423 usb_dvobj_deinit (pusb_intf );
13921424exit :
1425+ if (status != _SUCCESS )
1426+ printk (KERN_ERR DRV_NAME ": probe end: returning -ENODEV\n" );
13931427 return status == _SUCCESS ? 0 : - ENODEV ;
13941428}
13951429
@@ -1468,6 +1502,7 @@ static int __init rtw_drv_entry(void)
14681502{
14691503 int ret = 0 ;
14701504
1505+ printk (KERN_INFO DRV_NAME ": module init start\n" );
14711506 RTW_PRINT ("module init start\n" );
14721507 dump_drv_version (RTW_DBGDUMP );
14731508#ifdef BTCOEXVERSION
@@ -1495,6 +1530,7 @@ static int __init rtw_drv_entry(void)
14951530 rtw_inetaddr_notifier_register ();
14961531
14971532 ret = usb_register (& usb_drv .usbdrv );
1533+ printk (KERN_INFO DRV_NAME ": usb_register ret=%d\n" , ret );
14981534
14991535 if (ret != 0 ) {
15001536 usb_drv .drv_registered = _FALSE ;
@@ -1510,6 +1546,7 @@ static int __init rtw_drv_entry(void)
15101546 }
15111547
15121548exit :
1549+ printk (KERN_INFO DRV_NAME ": module init ret=%d\n" , ret );
15131550 RTW_PRINT ("module init ret=%d\n" , ret );
15141551 return ret ;
15151552}
0 commit comments