aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorhayeswang <hayeswang@realtek.com>2014-01-14 21:42:16 -0500
committerDavid S. Miller <davem@davemloft.net>2014-01-14 21:48:54 -0500
commitc7de7dec2ff2528ec630c55e68c25bd9d972b677 (patch)
tree3f1a03819a3effb74641ba8cd50c00002f5635f8 /drivers/net/usb
parent9629e3c037a1ede32b70d9ae2ab131cdfb872df8 (diff)
r8152: ecm and vendor modes coexist
Remove the limitation that the ecm and r8152 drivers couldn't coexist. - Remove the devices from the blacklist of relative drivers. - Remove usb_driver_set_configuration() from r8152 driver. - Modify the id_table of the r8152 driver for the vendor mode only. Signed-off-by: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/cdc_ether.c9
-rw-r--r--drivers/net/usb/r8152.c18
-rw-r--r--drivers/net/usb/r815x.c8
3 files changed, 8 insertions, 27 deletions
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index 640406ac4358..7d32be89e3ca 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -653,15 +653,6 @@ static const struct usb_device_id products[] = {
653 .driver_info = 0, 653 .driver_info = 0,
654}, 654},
655 655
656#if defined(CONFIG_USB_RTL8152) || defined(CONFIG_USB_RTL8152_MODULE)
657/* Samsung USB Ethernet Adapters */
658{
659 USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, 0xa101, USB_CLASS_COMM,
660 USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
661 .driver_info = 0,
662},
663#endif
664
665/* WHITELIST!!! 656/* WHITELIST!!!
666 * 657 *
667 * CDC Ether uses two interfaces, not necessarily consecutive. 658 * CDC Ether uses two interfaces, not necessarily consecutive.
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index eab078b6e603..31d13ca1a39e 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2013 Realtek Semiconductor Corp. All rights reserved. 2 * Copyright (c) 2014 Realtek Semiconductor Corp. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or 4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License 5 * modify it under the terms of the GNU General Public License
@@ -24,7 +24,7 @@
24#include <linux/ipv6.h> 24#include <linux/ipv6.h>
25 25
26/* Version Information */ 26/* Version Information */
27#define DRIVER_VERSION "v1.03.0 (2013/12/26)" 27#define DRIVER_VERSION "v1.04.0 (2014/01/15)"
28#define DRIVER_AUTHOR "Realtek linux nic maintainers <nic_swsd@realtek.com>" 28#define DRIVER_AUTHOR "Realtek linux nic maintainers <nic_swsd@realtek.com>"
29#define DRIVER_DESC "Realtek RTL8152/RTL8153 Based USB Ethernet Adapters" 29#define DRIVER_DESC "Realtek RTL8152/RTL8153 Based USB Ethernet Adapters"
30#define MODULENAME "r8152" 30#define MODULENAME "r8152"
@@ -450,6 +450,9 @@ enum rtl8152_flags {
450#define MCU_TYPE_PLA 0x0100 450#define MCU_TYPE_PLA 0x0100
451#define MCU_TYPE_USB 0x0000 451#define MCU_TYPE_USB 0x0000
452 452
453#define REALTEK_USB_DEVICE(vend, prod) \
454 USB_DEVICE_INTERFACE_CLASS(vend, prod, USB_CLASS_VENDOR_SPEC)
455
453struct rx_desc { 456struct rx_desc {
454 __le32 opts1; 457 __le32 opts1;
455#define RX_LEN_MASK 0x7fff 458#define RX_LEN_MASK 0x7fff
@@ -2738,11 +2741,6 @@ static int rtl8152_probe(struct usb_interface *intf,
2738 struct net_device *netdev; 2741 struct net_device *netdev;
2739 int ret; 2742 int ret;
2740 2743
2741 if (udev->actconfig->desc.bConfigurationValue != 1) {
2742 usb_driver_set_configuration(udev, 1);
2743 return -ENODEV;
2744 }
2745
2746 netdev = alloc_etherdev(sizeof(struct r8152)); 2744 netdev = alloc_etherdev(sizeof(struct r8152));
2747 if (!netdev) { 2745 if (!netdev) {
2748 dev_err(&intf->dev, "Out of memory\n"); 2746 dev_err(&intf->dev, "Out of memory\n");
@@ -2823,9 +2821,9 @@ static void rtl8152_disconnect(struct usb_interface *intf)
2823 2821
2824/* table of devices that work with this driver */ 2822/* table of devices that work with this driver */
2825static struct usb_device_id rtl8152_table[] = { 2823static struct usb_device_id rtl8152_table[] = {
2826 {USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8152)}, 2824 {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8152)},
2827 {USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8153)}, 2825 {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8153)},
2828 {USB_DEVICE(VENDOR_ID_SAMSUNG, PRODUCT_ID_SAMSUNG)}, 2826 {REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, PRODUCT_ID_SAMSUNG)},
2829 {} 2827 {}
2830}; 2828};
2831 2829
diff --git a/drivers/net/usb/r815x.c b/drivers/net/usb/r815x.c
index 5fd2ca61d1e2..f0a8791b7636 100644
--- a/drivers/net/usb/r815x.c
+++ b/drivers/net/usb/r815x.c
@@ -216,21 +216,13 @@ static const struct usb_device_id products[] = {
216{ 216{
217 USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8152, USB_CLASS_COMM, 217 USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8152, USB_CLASS_COMM,
218 USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), 218 USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
219#if defined(CONFIG_USB_RTL8152) || defined(CONFIG_USB_RTL8152_MODULE)
220 .driver_info = 0,
221#else
222 .driver_info = (unsigned long) &r8152_info, 219 .driver_info = (unsigned long) &r8152_info,
223#endif
224}, 220},
225 221
226{ 222{
227 USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8153, USB_CLASS_COMM, 223 USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8153, USB_CLASS_COMM,
228 USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), 224 USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
229#if defined(CONFIG_USB_RTL8152) || defined(CONFIG_USB_RTL8152_MODULE)
230 .driver_info = 0,
231#else
232 .driver_info = (unsigned long) &r8153_info, 225 .driver_info = (unsigned long) &r8153_info,
233#endif
234}, 226},
235 227
236 { }, /* END */ 228 { }, /* END */