Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'r8152'

Hayes Wang says:

====================
r8152: remove limitation

Remove the limitation between ecm mode and vendor mode.

v2: replace the patch #3 with "ecm and vendor modes coexist".
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+27 -57
+3 -2
drivers/net/usb/Kconfig
··· 92 92 module will be called rtl8150. 93 93 94 94 config USB_RTL8152 95 - tristate "Realtek RTL8152 Based USB 2.0 Ethernet Adapters" 95 + tristate "Realtek RTL8152/RTL8153 Based USB Ethernet Adapters" 96 96 select MII 97 97 help 98 98 This option adds support for Realtek RTL8152 based USB 2.0 99 - 10/100 Ethernet adapters. 99 + 10/100 Ethernet adapters and RTL8153 based USB 3.0 10/100/1000 100 + Ethernet adapters. 100 101 101 102 To compile this driver as a module, choose M here: the 102 103 module will be called r8152.
-9
drivers/net/usb/cdc_ether.c
··· 653 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 656 /* WHITELIST!!! 666 657 * 667 658 * CDC Ether uses two interfaces, not necessarily consecutive.
+24 -38
drivers/net/usb/r8152.c
··· 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 4 * This program is free software; you can redistribute it and/or 5 5 * modify it under the terms of the GNU General Public License ··· 24 24 #include <linux/ipv6.h> 25 25 26 26 /* Version Information */ 27 - #define DRIVER_VERSION "v1.03.0 (2013/12/26)" 27 + #define DRIVER_VERSION "v1.04.0 (2014/01/15)" 28 28 #define DRIVER_AUTHOR "Realtek linux nic maintainers <nic_swsd@realtek.com>" 29 - #define DRIVER_DESC "Realtek RTL8152 Based USB 2.0 Ethernet Adapters" 29 + #define DRIVER_DESC "Realtek RTL8152/RTL8153 Based USB Ethernet Adapters" 30 30 #define MODULENAME "r8152" 31 31 32 32 #define R8152_PHY_ID 32 ··· 449 449 450 450 #define MCU_TYPE_PLA 0x0100 451 451 #define MCU_TYPE_USB 0x0000 452 + 453 + #define REALTEK_USB_DEVICE(vend, prod) \ 454 + USB_DEVICE_INTERFACE_CLASS(vend, prod, USB_CLASS_VENDOR_SPEC) 452 455 453 456 struct rx_desc { 454 457 __le32 opts1; ··· 1103 1100 int i; 1104 1101 1105 1102 for (i = 0; i < RTL8152_MAX_RX; i++) { 1106 - if (tp->rx_info[i].urb) { 1107 - usb_free_urb(tp->rx_info[i].urb); 1108 - tp->rx_info[i].urb = NULL; 1109 - } 1103 + usb_free_urb(tp->rx_info[i].urb); 1104 + tp->rx_info[i].urb = NULL; 1110 1105 1111 - if (tp->rx_info[i].buffer) { 1112 - kfree(tp->rx_info[i].buffer); 1113 - tp->rx_info[i].buffer = NULL; 1114 - tp->rx_info[i].head = NULL; 1115 - } 1106 + kfree(tp->rx_info[i].buffer); 1107 + tp->rx_info[i].buffer = NULL; 1108 + tp->rx_info[i].head = NULL; 1116 1109 } 1117 1110 1118 1111 for (i = 0; i < RTL8152_MAX_TX; i++) { 1119 - if (tp->tx_info[i].urb) { 1120 - usb_free_urb(tp->tx_info[i].urb); 1121 - tp->tx_info[i].urb = NULL; 1122 - } 1112 + usb_free_urb(tp->tx_info[i].urb); 1113 + tp->tx_info[i].urb = NULL; 1123 1114 1124 - if (tp->tx_info[i].buffer) { 1125 - kfree(tp->tx_info[i].buffer); 1126 - tp->tx_info[i].buffer = NULL; 1127 - tp->tx_info[i].head = NULL; 1128 - } 1115 + kfree(tp->tx_info[i].buffer); 1116 + tp->tx_info[i].buffer = NULL; 1117 + tp->tx_info[i].head = NULL; 1129 1118 } 1130 1119 1131 - if (tp->intr_urb) { 1132 - usb_free_urb(tp->intr_urb); 1133 - tp->intr_urb = NULL; 1134 - } 1120 + usb_free_urb(tp->intr_urb); 1121 + tp->intr_urb = NULL; 1135 1122 1136 - if (tp->intr_buff) { 1137 - kfree(tp->intr_buff); 1138 - tp->intr_buff = NULL; 1139 - } 1123 + kfree(tp->intr_buff); 1124 + tp->intr_buff = NULL; 1140 1125 } 1141 1126 1142 1127 static int alloc_all_mem(struct r8152 *tp) ··· 2039 2048 /* TX share fifo free credit full threshold */ 2040 2049 ocp_write_dword(tp, MCU_TYPE_PLA, PLA_TXFIFO_CTRL, TXFIFO_THR_NORMAL2); 2041 2050 2042 - // rx aggregation 2051 + /* rx aggregation */ 2043 2052 ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL); 2044 2053 ocp_data &= ~RX_AGG_DISABLE; 2045 2054 ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data); ··· 2741 2750 struct net_device *netdev; 2742 2751 int ret; 2743 2752 2744 - if (udev->actconfig->desc.bConfigurationValue != 1) { 2745 - usb_driver_set_configuration(udev, 1); 2746 - return -ENODEV; 2747 - } 2748 - 2749 2753 netdev = alloc_etherdev(sizeof(struct r8152)); 2750 2754 if (!netdev) { 2751 2755 dev_err(&intf->dev, "Out of memory\n"); ··· 2821 2835 2822 2836 /* table of devices that work with this driver */ 2823 2837 static struct usb_device_id rtl8152_table[] = { 2824 - {USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8152)}, 2825 - {USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8153)}, 2826 - {USB_DEVICE(VENDOR_ID_SAMSUNG, PRODUCT_ID_SAMSUNG)}, 2838 + {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8152)}, 2839 + {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8153)}, 2840 + {REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, PRODUCT_ID_SAMSUNG)}, 2827 2841 {} 2828 2842 }; 2829 2843
-8
drivers/net/usb/r815x.c
··· 216 216 { 217 217 USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8152, USB_CLASS_COMM, 218 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 219 .driver_info = (unsigned long) &r8152_info, 223 - #endif 224 220 }, 225 221 226 222 { 227 223 USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8153, USB_CLASS_COMM, 228 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 225 .driver_info = (unsigned long) &r8153_info, 233 - #endif 234 226 }, 235 227 236 228 { }, /* END */