aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/ax88179_178a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/usb/ax88179_178a.c')
-rw-r--r--drivers/net/usb/ax88179_178a.c46
1 files changed, 38 insertions, 8 deletions
diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c
index d6f64dad05bc..054e59ca6946 100644
--- a/drivers/net/usb/ax88179_178a.c
+++ b/drivers/net/usb/ax88179_178a.c
@@ -1029,20 +1029,12 @@ static int ax88179_bind(struct usbnet *dev, struct usb_interface *intf)
1029 dev->mii.phy_id = 0x03; 1029 dev->mii.phy_id = 0x03;
1030 dev->mii.supports_gmii = 1; 1030 dev->mii.supports_gmii = 1;
1031 1031
1032 if (usb_device_no_sg_constraint(dev->udev))
1033 dev->can_dma_sg = 1;
1034
1035 dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 1032 dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
1036 NETIF_F_RXCSUM; 1033 NETIF_F_RXCSUM;
1037 1034
1038 dev->net->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 1035 dev->net->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
1039 NETIF_F_RXCSUM; 1036 NETIF_F_RXCSUM;
1040 1037
1041 if (dev->can_dma_sg) {
1042 dev->net->features |= NETIF_F_SG | NETIF_F_TSO;
1043 dev->net->hw_features |= NETIF_F_SG | NETIF_F_TSO;
1044 }
1045
1046 /* Enable checksum offload */ 1038 /* Enable checksum offload */
1047 *tmp = AX_RXCOE_IP | AX_RXCOE_TCP | AX_RXCOE_UDP | 1039 *tmp = AX_RXCOE_IP | AX_RXCOE_TCP | AX_RXCOE_UDP |
1048 AX_RXCOE_TCPV6 | AX_RXCOE_UDPV6; 1040 AX_RXCOE_TCPV6 | AX_RXCOE_UDPV6;
@@ -1118,6 +1110,10 @@ static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
1118 u16 hdr_off; 1110 u16 hdr_off;
1119 u32 *pkt_hdr; 1111 u32 *pkt_hdr;
1120 1112
1113 /* This check is no longer done by usbnet */
1114 if (skb->len < dev->net->hard_header_len)
1115 return 0;
1116
1121 skb_trim(skb, skb->len - 4); 1117 skb_trim(skb, skb->len - 4);
1122 memcpy(&rx_hdr, skb_tail_pointer(skb), 4); 1118 memcpy(&rx_hdr, skb_tail_pointer(skb), 4);
1123 le32_to_cpus(&rx_hdr); 1119 le32_to_cpus(&rx_hdr);
@@ -1391,6 +1387,19 @@ static const struct driver_info ax88178a_info = {
1391 .tx_fixup = ax88179_tx_fixup, 1387 .tx_fixup = ax88179_tx_fixup,
1392}; 1388};
1393 1389
1390static const struct driver_info dlink_dub1312_info = {
1391 .description = "D-Link DUB-1312 USB 3.0 to Gigabit Ethernet Adapter",
1392 .bind = ax88179_bind,
1393 .unbind = ax88179_unbind,
1394 .status = ax88179_status,
1395 .link_reset = ax88179_link_reset,
1396 .reset = ax88179_reset,
1397 .stop = ax88179_stop,
1398 .flags = FLAG_ETHER | FLAG_FRAMING_AX,
1399 .rx_fixup = ax88179_rx_fixup,
1400 .tx_fixup = ax88179_tx_fixup,
1401};
1402
1394static const struct driver_info sitecom_info = { 1403static const struct driver_info sitecom_info = {
1395 .description = "Sitecom USB 3.0 to Gigabit Adapter", 1404 .description = "Sitecom USB 3.0 to Gigabit Adapter",
1396 .bind = ax88179_bind, 1405 .bind = ax88179_bind,
@@ -1417,6 +1426,19 @@ static const struct driver_info samsung_info = {
1417 .tx_fixup = ax88179_tx_fixup, 1426 .tx_fixup = ax88179_tx_fixup,
1418}; 1427};
1419 1428
1429static const struct driver_info lenovo_info = {
1430 .description = "Lenovo OneLinkDock Gigabit LAN",
1431 .bind = ax88179_bind,
1432 .unbind = ax88179_unbind,
1433 .status = ax88179_status,
1434 .link_reset = ax88179_link_reset,
1435 .reset = ax88179_reset,
1436 .stop = ax88179_stop,
1437 .flags = FLAG_ETHER | FLAG_FRAMING_AX,
1438 .rx_fixup = ax88179_rx_fixup,
1439 .tx_fixup = ax88179_tx_fixup,
1440};
1441
1420static const struct usb_device_id products[] = { 1442static const struct usb_device_id products[] = {
1421{ 1443{
1422 /* ASIX AX88179 10/100/1000 */ 1444 /* ASIX AX88179 10/100/1000 */
@@ -1427,6 +1449,10 @@ static const struct usb_device_id products[] = {
1427 USB_DEVICE(0x0b95, 0x178a), 1449 USB_DEVICE(0x0b95, 0x178a),
1428 .driver_info = (unsigned long)&ax88178a_info, 1450 .driver_info = (unsigned long)&ax88178a_info,
1429}, { 1451}, {
1452 /* D-Link DUB-1312 USB 3.0 to Gigabit Ethernet Adapter */
1453 USB_DEVICE(0x2001, 0x4a00),
1454 .driver_info = (unsigned long)&dlink_dub1312_info,
1455}, {
1430 /* Sitecom USB 3.0 to Gigabit Adapter */ 1456 /* Sitecom USB 3.0 to Gigabit Adapter */
1431 USB_DEVICE(0x0df6, 0x0072), 1457 USB_DEVICE(0x0df6, 0x0072),
1432 .driver_info = (unsigned long)&sitecom_info, 1458 .driver_info = (unsigned long)&sitecom_info,
@@ -1434,6 +1460,10 @@ static const struct usb_device_id products[] = {
1434 /* Samsung USB Ethernet Adapter */ 1460 /* Samsung USB Ethernet Adapter */
1435 USB_DEVICE(0x04e8, 0xa100), 1461 USB_DEVICE(0x04e8, 0xa100),
1436 .driver_info = (unsigned long)&samsung_info, 1462 .driver_info = (unsigned long)&samsung_info,
1463}, {
1464 /* Lenovo OneLinkDock Gigabit LAN */
1465 USB_DEVICE(0x17ef, 0x304b),
1466 .driver_info = (unsigned long)&lenovo_info,
1437}, 1467},
1438 { }, 1468 { },
1439}; 1469};