Commit 85a5bac9 authored by David S. Miller's avatar David S. Miller

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 5571415c c7de7dec
...@@ -92,11 +92,12 @@ config USB_RTL8150 ...@@ -92,11 +92,12 @@ config USB_RTL8150
module will be called rtl8150. module will be called rtl8150.
config USB_RTL8152 config USB_RTL8152
tristate "Realtek RTL8152 Based USB 2.0 Ethernet Adapters" tristate "Realtek RTL8152/RTL8153 Based USB Ethernet Adapters"
select MII select MII
help help
This option adds support for Realtek RTL8152 based USB 2.0 This option adds support for Realtek RTL8152 based USB 2.0
10/100 Ethernet adapters. 10/100 Ethernet adapters and RTL8153 based USB 3.0 10/100/1000
Ethernet adapters.
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called r8152. module will be called r8152.
......
...@@ -653,15 +653,6 @@ static const struct usb_device_id products[] = { ...@@ -653,15 +653,6 @@ static const struct usb_device_id products[] = {
.driver_info = 0, .driver_info = 0,
}, },
#if defined(CONFIG_USB_RTL8152) || defined(CONFIG_USB_RTL8152_MODULE)
/* Samsung USB Ethernet Adapters */
{
USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, 0xa101, USB_CLASS_COMM,
USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
.driver_info = 0,
},
#endif
/* WHITELIST!!! /* WHITELIST!!!
* *
* CDC Ether uses two interfaces, not necessarily consecutive. * CDC Ether uses two interfaces, not necessarily consecutive.
......
/* /*
* Copyright (c) 2013 Realtek Semiconductor Corp. All rights reserved. * Copyright (c) 2014 Realtek Semiconductor Corp. All rights reserved.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -24,9 +24,9 @@ ...@@ -24,9 +24,9 @@
#include <linux/ipv6.h> #include <linux/ipv6.h>
/* Version Information */ /* Version Information */
#define DRIVER_VERSION "v1.03.0 (2013/12/26)" #define DRIVER_VERSION "v1.04.0 (2014/01/15)"
#define DRIVER_AUTHOR "Realtek linux nic maintainers <nic_swsd@realtek.com>" #define DRIVER_AUTHOR "Realtek linux nic maintainers <nic_swsd@realtek.com>"
#define DRIVER_DESC "Realtek RTL8152 Based USB 2.0 Ethernet Adapters" #define DRIVER_DESC "Realtek RTL8152/RTL8153 Based USB Ethernet Adapters"
#define MODULENAME "r8152" #define MODULENAME "r8152"
#define R8152_PHY_ID 32 #define R8152_PHY_ID 32
...@@ -450,6 +450,9 @@ enum rtl8152_flags { ...@@ -450,6 +450,9 @@ enum rtl8152_flags {
#define MCU_TYPE_PLA 0x0100 #define MCU_TYPE_PLA 0x0100
#define MCU_TYPE_USB 0x0000 #define MCU_TYPE_USB 0x0000
#define REALTEK_USB_DEVICE(vend, prod) \
USB_DEVICE_INTERFACE_CLASS(vend, prod, USB_CLASS_VENDOR_SPEC)
struct rx_desc { struct rx_desc {
__le32 opts1; __le32 opts1;
#define RX_LEN_MASK 0x7fff #define RX_LEN_MASK 0x7fff
...@@ -1100,40 +1103,28 @@ static void free_all_mem(struct r8152 *tp) ...@@ -1100,40 +1103,28 @@ static void free_all_mem(struct r8152 *tp)
int i; int i;
for (i = 0; i < RTL8152_MAX_RX; i++) { for (i = 0; i < RTL8152_MAX_RX; i++) {
if (tp->rx_info[i].urb) { usb_free_urb(tp->rx_info[i].urb);
usb_free_urb(tp->rx_info[i].urb); tp->rx_info[i].urb = NULL;
tp->rx_info[i].urb = NULL;
}
if (tp->rx_info[i].buffer) { kfree(tp->rx_info[i].buffer);
kfree(tp->rx_info[i].buffer); tp->rx_info[i].buffer = NULL;
tp->rx_info[i].buffer = NULL; tp->rx_info[i].head = NULL;
tp->rx_info[i].head = NULL;
}
} }
for (i = 0; i < RTL8152_MAX_TX; i++) { for (i = 0; i < RTL8152_MAX_TX; i++) {
if (tp->tx_info[i].urb) { usb_free_urb(tp->tx_info[i].urb);
usb_free_urb(tp->tx_info[i].urb); tp->tx_info[i].urb = NULL;
tp->tx_info[i].urb = NULL;
}
if (tp->tx_info[i].buffer) { kfree(tp->tx_info[i].buffer);
kfree(tp->tx_info[i].buffer); tp->tx_info[i].buffer = NULL;
tp->tx_info[i].buffer = NULL; tp->tx_info[i].head = NULL;
tp->tx_info[i].head = NULL;
}
} }
if (tp->intr_urb) { usb_free_urb(tp->intr_urb);
usb_free_urb(tp->intr_urb); tp->intr_urb = NULL;
tp->intr_urb = NULL;
}
if (tp->intr_buff) { kfree(tp->intr_buff);
kfree(tp->intr_buff); tp->intr_buff = NULL;
tp->intr_buff = NULL;
}
} }
static int alloc_all_mem(struct r8152 *tp) static int alloc_all_mem(struct r8152 *tp)
...@@ -2048,7 +2039,7 @@ static void r8153_first_init(struct r8152 *tp) ...@@ -2048,7 +2039,7 @@ static void r8153_first_init(struct r8152 *tp)
/* TX share fifo free credit full threshold */ /* TX share fifo free credit full threshold */
ocp_write_dword(tp, MCU_TYPE_PLA, PLA_TXFIFO_CTRL, TXFIFO_THR_NORMAL2); ocp_write_dword(tp, MCU_TYPE_PLA, PLA_TXFIFO_CTRL, TXFIFO_THR_NORMAL2);
// rx aggregation /* rx aggregation */
ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL); ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL);
ocp_data &= ~RX_AGG_DISABLE; ocp_data &= ~RX_AGG_DISABLE;
ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data); ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data);
...@@ -2750,11 +2741,6 @@ static int rtl8152_probe(struct usb_interface *intf, ...@@ -2750,11 +2741,6 @@ static int rtl8152_probe(struct usb_interface *intf,
struct net_device *netdev; struct net_device *netdev;
int ret; int ret;
if (udev->actconfig->desc.bConfigurationValue != 1) {
usb_driver_set_configuration(udev, 1);
return -ENODEV;
}
netdev = alloc_etherdev(sizeof(struct r8152)); netdev = alloc_etherdev(sizeof(struct r8152));
if (!netdev) { if (!netdev) {
dev_err(&intf->dev, "Out of memory\n"); dev_err(&intf->dev, "Out of memory\n");
...@@ -2835,9 +2821,9 @@ static void rtl8152_disconnect(struct usb_interface *intf) ...@@ -2835,9 +2821,9 @@ static void rtl8152_disconnect(struct usb_interface *intf)
/* table of devices that work with this driver */ /* table of devices that work with this driver */
static struct usb_device_id rtl8152_table[] = { static struct usb_device_id rtl8152_table[] = {
{USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8152)}, {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8152)},
{USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8153)}, {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8153)},
{USB_DEVICE(VENDOR_ID_SAMSUNG, PRODUCT_ID_SAMSUNG)}, {REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, PRODUCT_ID_SAMSUNG)},
{} {}
}; };
......
...@@ -216,21 +216,13 @@ static const struct usb_device_id products[] = { ...@@ -216,21 +216,13 @@ static const struct usb_device_id products[] = {
{ {
USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8152, USB_CLASS_COMM, USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8152, USB_CLASS_COMM,
USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
#if defined(CONFIG_USB_RTL8152) || defined(CONFIG_USB_RTL8152_MODULE)
.driver_info = 0,
#else
.driver_info = (unsigned long) &r8152_info, .driver_info = (unsigned long) &r8152_info,
#endif
}, },
{ {
USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8153, USB_CLASS_COMM, USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8153, USB_CLASS_COMM,
USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
#if defined(CONFIG_USB_RTL8152) || defined(CONFIG_USB_RTL8152_MODULE)
.driver_info = 0,
#else
.driver_info = (unsigned long) &r8153_info, .driver_info = (unsigned long) &r8153_info,
#endif
}, },
{ }, /* END */ { }, /* END */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment