|
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 < [email protected]>"
|
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
|
@@ -450,6 +450,9 @@ enum rtl8152_flags {
|
450 | 450 | #define MCU_TYPE_PLA 0x0100
|
451 | 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 | + |
453 | 456 | struct rx_desc {
|
454 | 457 | __le32 opts1;
|
455 | 458 | #define RX_LEN_MASK 0x7fff
|
@@ -1100,40 +1103,28 @@ static void free_all_mem(struct r8152 *tp)
|
1100 | 1103 | int i;
|
1101 | 1104 |
|
1102 | 1105 | for (i = 0; i < RTL8152_MAX_RX; i++) {
|
1103 |
| - if (tp->rx_info[i].urb) { |
1104 |
| - usb_free_urb(tp->rx_info[i].urb); |
1105 |
| - tp->rx_info[i].urb = NULL; |
1106 |
| - } |
| 1106 | + usb_free_urb(tp->rx_info[i].urb); |
| 1107 | + tp->rx_info[i].urb = NULL; |
1107 | 1108 |
|
1108 |
| - if (tp->rx_info[i].buffer) { |
1109 |
| - kfree(tp->rx_info[i].buffer); |
1110 |
| - tp->rx_info[i].buffer = NULL; |
1111 |
| - tp->rx_info[i].head = NULL; |
1112 |
| - } |
| 1109 | + kfree(tp->rx_info[i].buffer); |
| 1110 | + tp->rx_info[i].buffer = NULL; |
| 1111 | + tp->rx_info[i].head = NULL; |
1113 | 1112 | }
|
1114 | 1113 |
|
1115 | 1114 | for (i = 0; i < RTL8152_MAX_TX; i++) {
|
1116 |
| - if (tp->tx_info[i].urb) { |
1117 |
| - usb_free_urb(tp->tx_info[i].urb); |
1118 |
| - tp->tx_info[i].urb = NULL; |
1119 |
| - } |
| 1115 | + usb_free_urb(tp->tx_info[i].urb); |
| 1116 | + tp->tx_info[i].urb = NULL; |
1120 | 1117 |
|
1121 |
| - if (tp->tx_info[i].buffer) { |
1122 |
| - kfree(tp->tx_info[i].buffer); |
1123 |
| - tp->tx_info[i].buffer = NULL; |
1124 |
| - tp->tx_info[i].head = NULL; |
1125 |
| - } |
| 1118 | + kfree(tp->tx_info[i].buffer); |
| 1119 | + tp->tx_info[i].buffer = NULL; |
| 1120 | + tp->tx_info[i].head = NULL; |
1126 | 1121 | }
|
1127 | 1122 |
|
1128 |
| - if (tp->intr_urb) { |
1129 |
| - usb_free_urb(tp->intr_urb); |
1130 |
| - tp->intr_urb = NULL; |
1131 |
| - } |
| 1123 | + usb_free_urb(tp->intr_urb); |
| 1124 | + tp->intr_urb = NULL; |
1132 | 1125 |
|
1133 |
| - if (tp->intr_buff) { |
1134 |
| - kfree(tp->intr_buff); |
1135 |
| - tp->intr_buff = NULL; |
1136 |
| - } |
| 1126 | + kfree(tp->intr_buff); |
| 1127 | + tp->intr_buff = NULL; |
1137 | 1128 | }
|
1138 | 1129 |
|
1139 | 1130 | static int alloc_all_mem(struct r8152 *tp)
|
@@ -2048,7 +2039,7 @@ static void r8153_first_init(struct r8152 *tp)
|
2048 | 2039 | /* TX share fifo free credit full threshold */
|
2049 | 2040 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_TXFIFO_CTRL, TXFIFO_THR_NORMAL2);
|
2050 | 2041 |
|
2051 |
| - // rx aggregation |
| 2042 | + /* rx aggregation */ |
2052 | 2043 | ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL);
|
2053 | 2044 | ocp_data &= ~RX_AGG_DISABLE;
|
2054 | 2045 | 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 | 2741 | struct net_device *netdev;
|
2751 | 2742 | int ret;
|
2752 | 2743 |
|
2753 |
| - if (udev->actconfig->desc.bConfigurationValue != 1) { |
2754 |
| - usb_driver_set_configuration(udev, 1); |
2755 |
| - return -ENODEV; |
2756 |
| - } |
2757 |
| - |
2758 | 2744 | netdev = alloc_etherdev(sizeof(struct r8152));
|
2759 | 2745 | if (!netdev) {
|
2760 | 2746 | dev_err(&intf->dev, "Out of memory\n");
|
@@ -2835,9 +2821,9 @@ static void rtl8152_disconnect(struct usb_interface *intf)
|
2835 | 2821 |
|
2836 | 2822 | /* table of devices that work with this driver */
|
2837 | 2823 | static struct usb_device_id rtl8152_table[] = {
|
2838 |
| - {USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8152)}, |
2839 |
| - {USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8153)}, |
2840 |
| - {USB_DEVICE(VENDOR_ID_SAMSUNG, PRODUCT_ID_SAMSUNG)}, |
| 2824 | + {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8152)}, |
| 2825 | + {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, PRODUCT_ID_RTL8153)}, |
| 2826 | + {REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, PRODUCT_ID_SAMSUNG)}, |
2841 | 2827 | {}
|
2842 | 2828 | };
|
2843 | 2829 |
|
|
0 commit comments