cdc_ncm: fix bind failures for Icera devices
Neil Patel [Wed, 12 Dec 2012 20:00:48 +0000 (15:00 -0500)]
The Icera 5AN, 5AN BSD, and Nemo devices are composite devices that
include a NCM interface. Therefore, the NCM match flags should have
the VID, PID, Class, Subclass, and Protocol set to avoid bind()
failures for non-NCM interfaces.

Bug 1197415

Change-Id: If68a6ffaa4e1871c6a22ec8839806949804f502c
Signed-off-by: Neil Patel <neilp@nvidia.com>
Reviewed-on: http://git-master/r/170576
(cherry picked from commit 4688623777e523eacd29fdca8357c608963d26b6)
Reviewed-on: http://git-master/r/171965
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Steve Lin <stlin@nvidia.com>

drivers/net/usb/cdc_ncm.c

index b1e3909..0ac21a1 100644 (file)
@@ -153,23 +153,20 @@ static const struct usb_device_id cdc_devs[] = {
        },
        {
                /* Icera USB_PROFILE_IAD_5AN */
-               .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
-                       | USB_DEVICE_ID_MATCH_DEVICE,
-               USB_DEVICE(0x1983, 0x0427),
+               USB_DEVICE_AND_INTERFACE_INFO(0x1983, 0x0427, USB_CLASS_COMM,
+                               USB_CDC_SUBCLASS_NCM, USB_CDC_PROTO_NONE),
                .driver_info = (unsigned long)&cdc_mbm_info,
        },
        {
                /* Icera USB_PROFILE_IAD_5AN (BSD) */
-               .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
-                       | USB_DEVICE_ID_MATCH_DEVICE,
-               USB_DEVICE(0x1983, 0x1005),
+               USB_DEVICE_AND_INTERFACE_INFO(0x1983, 0x1005, USB_CLASS_COMM,
+                               USB_CDC_SUBCLASS_NCM, USB_CDC_PROTO_NONE),
                .driver_info = (unsigned long)&cdc_mbm_info,
        },
        {
                /* Icera Nemo */
-               .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
-                       | USB_DEVICE_ID_MATCH_DEVICE,
-               USB_DEVICE(0x1983, 0x1006),
+               USB_DEVICE_AND_INTERFACE_INFO(0x1983, 0x1006, USB_CLASS_COMM,
+                               USB_CDC_SUBCLASS_NCM, USB_CDC_PROTO_NONE),
                .driver_info = (unsigned long)&cdc_mbm_info,
        },
        {