diff options
author | hayeswang <hayeswang@realtek.com> | 2014-12-03 21:43:11 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-12-09 13:41:24 -0500 |
commit | d9a28c5b4c9a69f3036743bed36902b45dd39f1d (patch) | |
tree | c6057c2d03eb1e9d7f70a949d2b9d0894ecf7dbf | |
parent | 6ffe75eb53564953e75c051e1c28676e1e56f385 (diff) |
r8152: redefine REALTEK_USB_DEVICE
Redefine REALTEK_USB_DEVICE for the desired USB interface for probe().
There are three USB interfaces for the device. USB_CLASS_COMM and
USB_CLASS_CDC_DATA are for ECM mode (config #2). USB_CLASS_VENDOR_SPEC
is for the vendor mode (config #1). However, we are not interesting
in USB_CLASS_CDC_DATA for probe(), so redefine REALTEK_USB_DEVICE
to ignore the USB interface class of USB_CLASS_CDC_DATA.
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/usb/r8152.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 4a9ece01def6..2d1c77e81836 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <net/ip6_checksum.h> | 24 | #include <net/ip6_checksum.h> |
25 | #include <uapi/linux/mdio.h> | 25 | #include <uapi/linux/mdio.h> |
26 | #include <linux/mdio.h> | 26 | #include <linux/mdio.h> |
27 | #include <linux/usb/cdc.h> | ||
27 | 28 | ||
28 | /* Version Information */ | 29 | /* Version Information */ |
29 | #define DRIVER_VERSION "v1.07.0 (2014/10/09)" | 30 | #define DRIVER_VERSION "v1.07.0 (2014/10/09)" |
@@ -466,9 +467,6 @@ enum rtl8152_flags { | |||
466 | #define MCU_TYPE_PLA 0x0100 | 467 | #define MCU_TYPE_PLA 0x0100 |
467 | #define MCU_TYPE_USB 0x0000 | 468 | #define MCU_TYPE_USB 0x0000 |
468 | 469 | ||
469 | #define REALTEK_USB_DEVICE(vend, prod) \ | ||
470 | USB_DEVICE_INTERFACE_CLASS(vend, prod, USB_CLASS_VENDOR_SPEC) | ||
471 | |||
472 | struct tally_counter { | 470 | struct tally_counter { |
473 | __le64 tx_packets; | 471 | __le64 tx_packets; |
474 | __le64 rx_packets; | 472 | __le64 rx_packets; |
@@ -3915,11 +3913,27 @@ static void rtl8152_disconnect(struct usb_interface *intf) | |||
3915 | } | 3913 | } |
3916 | } | 3914 | } |
3917 | 3915 | ||
3916 | #define REALTEK_USB_DEVICE(vend, prod) \ | ||
3917 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \ | ||
3918 | USB_DEVICE_ID_MATCH_INT_CLASS, \ | ||
3919 | .idVendor = (vend), \ | ||
3920 | .idProduct = (prod), \ | ||
3921 | .bInterfaceClass = USB_CLASS_VENDOR_SPEC \ | ||
3922 | }, \ | ||
3923 | { \ | ||
3924 | .match_flags = USB_DEVICE_ID_MATCH_INT_INFO | \ | ||
3925 | USB_DEVICE_ID_MATCH_DEVICE, \ | ||
3926 | .idVendor = (vend), \ | ||
3927 | .idProduct = (prod), \ | ||
3928 | .bInterfaceClass = USB_CLASS_COMM, \ | ||
3929 | .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, \ | ||
3930 | .bInterfaceProtocol = USB_CDC_PROTO_NONE | ||
3931 | |||
3918 | /* table of devices that work with this driver */ | 3932 | /* table of devices that work with this driver */ |
3919 | static struct usb_device_id rtl8152_table[] = { | 3933 | static struct usb_device_id rtl8152_table[] = { |
3920 | {USB_DEVICE(VENDOR_ID_REALTEK, 0x8152)}, | 3934 | {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8152)}, |
3921 | {USB_DEVICE(VENDOR_ID_REALTEK, 0x8153)}, | 3935 | {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153)}, |
3922 | {USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101)}, | 3936 | {REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101)}, |
3923 | {} | 3937 | {} |
3924 | }; | 3938 | }; |
3925 | 3939 | ||