aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/ax88179_178a.c9
-rw-r--r--drivers/net/usb/r8152.c126
-rw-r--r--drivers/net/usb/r815x.c62
-rw-r--r--drivers/net/usb/smsc75xx.c12
4 files changed, 107 insertions, 102 deletions
diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c
index 1e3c302d94fe..2bc87e3a8141 100644
--- a/drivers/net/usb/ax88179_178a.c
+++ b/drivers/net/usb/ax88179_178a.c
@@ -1029,10 +1029,10 @@ static int ax88179_bind(struct usbnet *dev, struct usb_interface *intf)
1029 dev->mii.supports_gmii = 1; 1029 dev->mii.supports_gmii = 1;
1030 1030
1031 dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 1031 dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
1032 NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_TSO; 1032 NETIF_F_RXCSUM;
1033 1033
1034 dev->net->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 1034 dev->net->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
1035 NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_TSO; 1035 NETIF_F_RXCSUM;
1036 1036
1037 /* Enable checksum offload */ 1037 /* Enable checksum offload */
1038 *tmp = AX_RXCOE_IP | AX_RXCOE_TCP | AX_RXCOE_UDP | 1038 *tmp = AX_RXCOE_IP | AX_RXCOE_TCP | AX_RXCOE_UDP |
@@ -1173,7 +1173,6 @@ ax88179_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
1173 if (((skb->len + 8) % frame_size) == 0) 1173 if (((skb->len + 8) % frame_size) == 0)
1174 tx_hdr2 |= 0x80008000; /* Enable padding */ 1174 tx_hdr2 |= 0x80008000; /* Enable padding */
1175 1175
1176 skb_linearize(skb);
1177 headroom = skb_headroom(skb); 1176 headroom = skb_headroom(skb);
1178 tailroom = skb_tailroom(skb); 1177 tailroom = skb_tailroom(skb);
1179 1178
@@ -1317,10 +1316,10 @@ static int ax88179_reset(struct usbnet *dev)
1317 1, 1, tmp); 1316 1, 1, tmp);
1318 1317
1319 dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 1318 dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
1320 NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_TSO; 1319 NETIF_F_RXCSUM;
1321 1320
1322 dev->net->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 1321 dev->net->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
1323 NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_TSO; 1322 NETIF_F_RXCSUM;
1324 1323
1325 /* Enable checksum offload */ 1324 /* Enable checksum offload */
1326 *tmp = AX_RXCOE_IP | AX_RXCOE_TCP | AX_RXCOE_UDP | 1325 *tmp = AX_RXCOE_IP | AX_RXCOE_TCP | AX_RXCOE_UDP |
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index ee13f9eb740c..11c51f275366 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -344,17 +344,41 @@ static const int multicast_filter_limit = 32;
344static 344static
345int get_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data) 345int get_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data)
346{ 346{
347 return usb_control_msg(tp->udev, usb_rcvctrlpipe(tp->udev, 0), 347 int ret;
348 void *tmp;
349
350 tmp = kmalloc(size, GFP_KERNEL);
351 if (!tmp)
352 return -ENOMEM;
353
354 ret = usb_control_msg(tp->udev, usb_rcvctrlpipe(tp->udev, 0),
348 RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, 355 RTL8152_REQ_GET_REGS, RTL8152_REQT_READ,
349 value, index, data, size, 500); 356 value, index, tmp, size, 500);
357
358 memcpy(data, tmp, size);
359 kfree(tmp);
360
361 return ret;
350} 362}
351 363
352static 364static
353int set_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data) 365int set_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data)
354{ 366{
355 return usb_control_msg(tp->udev, usb_sndctrlpipe(tp->udev, 0), 367 int ret;
368 void *tmp;
369
370 tmp = kmalloc(size, GFP_KERNEL);
371 if (!tmp)
372 return -ENOMEM;
373
374 memcpy(tmp, data, size);
375
376 ret = usb_control_msg(tp->udev, usb_sndctrlpipe(tp->udev, 0),
356 RTL8152_REQ_SET_REGS, RTL8152_REQT_WRITE, 377 RTL8152_REQ_SET_REGS, RTL8152_REQT_WRITE,
357 value, index, data, size, 500); 378 value, index, tmp, size, 500);
379
380 kfree(tmp);
381 return ret;
358} 382}
359 383
360static int generic_ocp_read(struct r8152 *tp, u16 index, u16 size, 384static int generic_ocp_read(struct r8152 *tp, u16 index, u16 size,
@@ -490,37 +514,31 @@ int usb_ocp_write(struct r8152 *tp, u16 index, u16 byteen, u16 size, void *data)
490 514
491static u32 ocp_read_dword(struct r8152 *tp, u16 type, u16 index) 515static u32 ocp_read_dword(struct r8152 *tp, u16 type, u16 index)
492{ 516{
493 u32 data; 517 __le32 data;
494 518
495 if (type == MCU_TYPE_PLA) 519 generic_ocp_read(tp, index, sizeof(data), &data, type);
496 pla_ocp_read(tp, index, sizeof(data), &data);
497 else
498 usb_ocp_read(tp, index, sizeof(data), &data);
499 520
500 return __le32_to_cpu(data); 521 return __le32_to_cpu(data);
501} 522}
502 523
503static void ocp_write_dword(struct r8152 *tp, u16 type, u16 index, u32 data) 524static void ocp_write_dword(struct r8152 *tp, u16 type, u16 index, u32 data)
504{ 525{
505 if (type == MCU_TYPE_PLA) 526 __le32 tmp = __cpu_to_le32(data);
506 pla_ocp_write(tp, index, BYTE_EN_DWORD, sizeof(data), &data); 527
507 else 528 generic_ocp_write(tp, index, BYTE_EN_DWORD, sizeof(tmp), &tmp, type);
508 usb_ocp_write(tp, index, BYTE_EN_DWORD, sizeof(data), &data);
509} 529}
510 530
511static u16 ocp_read_word(struct r8152 *tp, u16 type, u16 index) 531static u16 ocp_read_word(struct r8152 *tp, u16 type, u16 index)
512{ 532{
513 u32 data; 533 u32 data;
534 __le32 tmp;
514 u8 shift = index & 2; 535 u8 shift = index & 2;
515 536
516 index &= ~3; 537 index &= ~3;
517 538
518 if (type == MCU_TYPE_PLA) 539 generic_ocp_read(tp, index, sizeof(tmp), &tmp, type);
519 pla_ocp_read(tp, index, sizeof(data), &data);
520 else
521 usb_ocp_read(tp, index, sizeof(data), &data);
522 540
523 data = __le32_to_cpu(data); 541 data = __le32_to_cpu(tmp);
524 data >>= (shift * 8); 542 data >>= (shift * 8);
525 data &= 0xffff; 543 data &= 0xffff;
526 544
@@ -529,7 +547,8 @@ static u16 ocp_read_word(struct r8152 *tp, u16 type, u16 index)
529 547
530static void ocp_write_word(struct r8152 *tp, u16 type, u16 index, u32 data) 548static void ocp_write_word(struct r8152 *tp, u16 type, u16 index, u32 data)
531{ 549{
532 u32 tmp, mask = 0xffff; 550 u32 mask = 0xffff;
551 __le32 tmp;
533 u16 byen = BYTE_EN_WORD; 552 u16 byen = BYTE_EN_WORD;
534 u8 shift = index & 2; 553 u8 shift = index & 2;
535 554
@@ -542,34 +561,25 @@ static void ocp_write_word(struct r8152 *tp, u16 type, u16 index, u32 data)
542 index &= ~3; 561 index &= ~3;
543 } 562 }
544 563
545 if (type == MCU_TYPE_PLA) 564 generic_ocp_read(tp, index, sizeof(tmp), &tmp, type);
546 pla_ocp_read(tp, index, sizeof(tmp), &tmp);
547 else
548 usb_ocp_read(tp, index, sizeof(tmp), &tmp);
549 565
550 tmp = __le32_to_cpu(tmp) & ~mask; 566 data |= __le32_to_cpu(tmp) & ~mask;
551 tmp |= data; 567 tmp = __cpu_to_le32(data);
552 tmp = __cpu_to_le32(tmp);
553 568
554 if (type == MCU_TYPE_PLA) 569 generic_ocp_write(tp, index, byen, sizeof(tmp), &tmp, type);
555 pla_ocp_write(tp, index, byen, sizeof(tmp), &tmp);
556 else
557 usb_ocp_write(tp, index, byen, sizeof(tmp), &tmp);
558} 570}
559 571
560static u8 ocp_read_byte(struct r8152 *tp, u16 type, u16 index) 572static u8 ocp_read_byte(struct r8152 *tp, u16 type, u16 index)
561{ 573{
562 u32 data; 574 u32 data;
575 __le32 tmp;
563 u8 shift = index & 3; 576 u8 shift = index & 3;
564 577
565 index &= ~3; 578 index &= ~3;
566 579
567 if (type == MCU_TYPE_PLA) 580 generic_ocp_read(tp, index, sizeof(tmp), &tmp, type);
568 pla_ocp_read(tp, index, sizeof(data), &data);
569 else
570 usb_ocp_read(tp, index, sizeof(data), &data);
571 581
572 data = __le32_to_cpu(data); 582 data = __le32_to_cpu(tmp);
573 data >>= (shift * 8); 583 data >>= (shift * 8);
574 data &= 0xff; 584 data &= 0xff;
575 585
@@ -578,7 +588,8 @@ static u8 ocp_read_byte(struct r8152 *tp, u16 type, u16 index)
578 588
579static void ocp_write_byte(struct r8152 *tp, u16 type, u16 index, u32 data) 589static void ocp_write_byte(struct r8152 *tp, u16 type, u16 index, u32 data)
580{ 590{
581 u32 tmp, mask = 0xff; 591 u32 mask = 0xff;
592 __le32 tmp;
582 u16 byen = BYTE_EN_BYTE; 593 u16 byen = BYTE_EN_BYTE;
583 u8 shift = index & 3; 594 u8 shift = index & 3;
584 595
@@ -591,19 +602,12 @@ static void ocp_write_byte(struct r8152 *tp, u16 type, u16 index, u32 data)
591 index &= ~3; 602 index &= ~3;
592 } 603 }
593 604
594 if (type == MCU_TYPE_PLA) 605 generic_ocp_read(tp, index, sizeof(tmp), &tmp, type);
595 pla_ocp_read(tp, index, sizeof(tmp), &tmp);
596 else
597 usb_ocp_read(tp, index, sizeof(tmp), &tmp);
598 606
599 tmp = __le32_to_cpu(tmp) & ~mask; 607 data |= __le32_to_cpu(tmp) & ~mask;
600 tmp |= data; 608 tmp = __cpu_to_le32(data);
601 tmp = __cpu_to_le32(tmp);
602 609
603 if (type == MCU_TYPE_PLA) 610 generic_ocp_write(tp, index, byen, sizeof(tmp), &tmp, type);
604 pla_ocp_write(tp, index, byen, sizeof(tmp), &tmp);
605 else
606 usb_ocp_write(tp, index, byen, sizeof(tmp), &tmp);
607} 611}
608 612
609static void r8152_mdio_write(struct r8152 *tp, u32 reg_addr, u32 value) 613static void r8152_mdio_write(struct r8152 *tp, u32 reg_addr, u32 value)
@@ -685,21 +689,14 @@ static void ocp_reg_write(struct r8152 *tp, u16 addr, u16 data)
685static inline void set_ethernet_addr(struct r8152 *tp) 689static inline void set_ethernet_addr(struct r8152 *tp)
686{ 690{
687 struct net_device *dev = tp->netdev; 691 struct net_device *dev = tp->netdev;
688 u8 *node_id; 692 u8 node_id[8] = {0};
689
690 node_id = kmalloc(sizeof(u8) * 8, GFP_KERNEL);
691 if (!node_id) {
692 netif_err(tp, probe, dev, "out of memory");
693 return;
694 }
695 693
696 if (pla_ocp_read(tp, PLA_IDR, sizeof(u8) * 8, node_id) < 0) 694 if (pla_ocp_read(tp, PLA_IDR, sizeof(node_id), node_id) < 0)
697 netif_notice(tp, probe, dev, "inet addr fail\n"); 695 netif_notice(tp, probe, dev, "inet addr fail\n");
698 else { 696 else {
699 memcpy(dev->dev_addr, node_id, dev->addr_len); 697 memcpy(dev->dev_addr, node_id, dev->addr_len);
700 memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); 698 memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
701 } 699 }
702 kfree(node_id);
703} 700}
704 701
705static int rtl8152_set_mac_address(struct net_device *netdev, void *p) 702static int rtl8152_set_mac_address(struct net_device *netdev, void *p)
@@ -882,15 +879,10 @@ static void rtl8152_set_rx_mode(struct net_device *netdev)
882static void _rtl8152_set_rx_mode(struct net_device *netdev) 879static void _rtl8152_set_rx_mode(struct net_device *netdev)
883{ 880{
884 struct r8152 *tp = netdev_priv(netdev); 881 struct r8152 *tp = netdev_priv(netdev);
885 u32 tmp, *mc_filter; /* Multicast hash filter */ 882 u32 mc_filter[2]; /* Multicast hash filter */
883 __le32 tmp[2];
886 u32 ocp_data; 884 u32 ocp_data;
887 885
888 mc_filter = kmalloc(sizeof(u32) * 2, GFP_KERNEL);
889 if (!mc_filter) {
890 netif_err(tp, link, netdev, "out of memory");
891 return;
892 }
893
894 clear_bit(RTL8152_SET_RX_MODE, &tp->flags); 886 clear_bit(RTL8152_SET_RX_MODE, &tp->flags);
895 netif_stop_queue(netdev); 887 netif_stop_queue(netdev);
896 ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_RCR); 888 ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_RCR);
@@ -918,14 +910,12 @@ static void _rtl8152_set_rx_mode(struct net_device *netdev)
918 } 910 }
919 } 911 }
920 912
921 tmp = mc_filter[0]; 913 tmp[0] = __cpu_to_le32(swab32(mc_filter[1]));
922 mc_filter[0] = __cpu_to_le32(swab32(mc_filter[1])); 914 tmp[1] = __cpu_to_le32(swab32(mc_filter[0]));
923 mc_filter[1] = __cpu_to_le32(swab32(tmp));
924 915
925 pla_ocp_write(tp, PLA_MAR, BYTE_EN_DWORD, sizeof(u32) * 2, mc_filter); 916 pla_ocp_write(tp, PLA_MAR, BYTE_EN_DWORD, sizeof(tmp), tmp);
926 ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, ocp_data); 917 ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, ocp_data);
927 netif_wake_queue(netdev); 918 netif_wake_queue(netdev);
928 kfree(mc_filter);
929} 919}
930 920
931static netdev_tx_t rtl8152_start_xmit(struct sk_buff *skb, 921static netdev_tx_t rtl8152_start_xmit(struct sk_buff *skb,
diff --git a/drivers/net/usb/r815x.c b/drivers/net/usb/r815x.c
index 852392269718..2df2f4fb42a7 100644
--- a/drivers/net/usb/r815x.c
+++ b/drivers/net/usb/r815x.c
@@ -24,34 +24,43 @@
24 24
25static int pla_read_word(struct usb_device *udev, u16 index) 25static int pla_read_word(struct usb_device *udev, u16 index)
26{ 26{
27 int data, ret; 27 int ret;
28 u8 shift = index & 2; 28 u8 shift = index & 2;
29 __le32 ocp_data; 29 __le32 *tmp;
30
31 tmp = kmalloc(sizeof(*tmp), GFP_KERNEL);
32 if (!tmp)
33 return -ENOMEM;
30 34
31 index &= ~3; 35 index &= ~3;
32 36
33 ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 37 ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
34 RTL815x_REQ_GET_REGS, RTL815x_REQT_READ, 38 RTL815x_REQ_GET_REGS, RTL815x_REQT_READ,
35 index, MCU_TYPE_PLA, &ocp_data, sizeof(ocp_data), 39 index, MCU_TYPE_PLA, tmp, sizeof(*tmp), 500);
36 500);
37 if (ret < 0) 40 if (ret < 0)
38 return ret; 41 goto out2;
39 42
40 data = __le32_to_cpu(ocp_data); 43 ret = __le32_to_cpu(*tmp);
41 data >>= (shift * 8); 44 ret >>= (shift * 8);
42 data &= 0xffff; 45 ret &= 0xffff;
43 46
44 return data; 47out2:
48 kfree(tmp);
49 return ret;
45} 50}
46 51
47static int pla_write_word(struct usb_device *udev, u16 index, u32 data) 52static int pla_write_word(struct usb_device *udev, u16 index, u32 data)
48{ 53{
49 __le32 ocp_data; 54 __le32 *tmp;
50 u32 mask = 0xffff; 55 u32 mask = 0xffff;
51 u16 byen = BYTE_EN_WORD; 56 u16 byen = BYTE_EN_WORD;
52 u8 shift = index & 2; 57 u8 shift = index & 2;
53 int ret; 58 int ret;
54 59
60 tmp = kmalloc(sizeof(*tmp), GFP_KERNEL);
61 if (!tmp)
62 return -ENOMEM;
63
55 data &= mask; 64 data &= mask;
56 65
57 if (shift) { 66 if (shift) {
@@ -63,19 +72,20 @@ static int pla_write_word(struct usb_device *udev, u16 index, u32 data)
63 72
64 ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 73 ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
65 RTL815x_REQ_GET_REGS, RTL815x_REQT_READ, 74 RTL815x_REQ_GET_REGS, RTL815x_REQT_READ,
66 index, MCU_TYPE_PLA, &ocp_data, sizeof(ocp_data), 75 index, MCU_TYPE_PLA, tmp, sizeof(*tmp), 500);
67 500);
68 if (ret < 0) 76 if (ret < 0)
69 return ret; 77 goto out3;
70 78
71 data |= __le32_to_cpu(ocp_data) & ~mask; 79 data |= __le32_to_cpu(*tmp) & ~mask;
72 ocp_data = __cpu_to_le32(data); 80 *tmp = __cpu_to_le32(data);
73 81
74 ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 82 ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
75 RTL815x_REQ_SET_REGS, RTL815x_REQT_WRITE, 83 RTL815x_REQ_SET_REGS, RTL815x_REQT_WRITE,
76 index, MCU_TYPE_PLA | byen, &ocp_data, 84 index, MCU_TYPE_PLA | byen, tmp, sizeof(*tmp),
77 sizeof(ocp_data), 500); 85 500);
78 86
87out3:
88 kfree(tmp);
79 return ret; 89 return ret;
80} 90}
81 91
@@ -116,11 +126,18 @@ out1:
116static int r815x_mdio_read(struct net_device *netdev, int phy_id, int reg) 126static int r815x_mdio_read(struct net_device *netdev, int phy_id, int reg)
117{ 127{
118 struct usbnet *dev = netdev_priv(netdev); 128 struct usbnet *dev = netdev_priv(netdev);
129 int ret;
119 130
120 if (phy_id != R815x_PHY_ID) 131 if (phy_id != R815x_PHY_ID)
121 return -EINVAL; 132 return -EINVAL;
122 133
123 return ocp_reg_read(dev, BASE_MII + reg * 2); 134 if (usb_autopm_get_interface(dev->intf) < 0)
135 return -ENODEV;
136
137 ret = ocp_reg_read(dev, BASE_MII + reg * 2);
138
139 usb_autopm_put_interface(dev->intf);
140 return ret;
124} 141}
125 142
126static 143static
@@ -131,7 +148,12 @@ void r815x_mdio_write(struct net_device *netdev, int phy_id, int reg, int val)
131 if (phy_id != R815x_PHY_ID) 148 if (phy_id != R815x_PHY_ID)
132 return; 149 return;
133 150
151 if (usb_autopm_get_interface(dev->intf) < 0)
152 return;
153
134 ocp_reg_write(dev, BASE_MII + reg * 2, val); 154 ocp_reg_write(dev, BASE_MII + reg * 2, val);
155
156 usb_autopm_put_interface(dev->intf);
135} 157}
136 158
137static int r8153_bind(struct usbnet *dev, struct usb_interface *intf) 159static int r8153_bind(struct usbnet *dev, struct usb_interface *intf)
@@ -150,7 +172,7 @@ static int r8153_bind(struct usbnet *dev, struct usb_interface *intf)
150 dev->mii.phy_id = R815x_PHY_ID; 172 dev->mii.phy_id = R815x_PHY_ID;
151 dev->mii.supports_gmii = 1; 173 dev->mii.supports_gmii = 1;
152 174
153 return 0; 175 return status;
154} 176}
155 177
156static int r8152_bind(struct usbnet *dev, struct usb_interface *intf) 178static int r8152_bind(struct usbnet *dev, struct usb_interface *intf)
@@ -169,7 +191,7 @@ static int r8152_bind(struct usbnet *dev, struct usb_interface *intf)
169 dev->mii.phy_id = R815x_PHY_ID; 191 dev->mii.phy_id = R815x_PHY_ID;
170 dev->mii.supports_gmii = 0; 192 dev->mii.supports_gmii = 0;
171 193
172 return 0; 194 return status;
173} 195}
174 196
175static const struct driver_info r8152_info = { 197static const struct driver_info r8152_info = {
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index 75409748c774..66ebbacf066f 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -45,7 +45,6 @@
45#define EEPROM_MAC_OFFSET (0x01) 45#define EEPROM_MAC_OFFSET (0x01)
46#define DEFAULT_TX_CSUM_ENABLE (true) 46#define DEFAULT_TX_CSUM_ENABLE (true)
47#define DEFAULT_RX_CSUM_ENABLE (true) 47#define DEFAULT_RX_CSUM_ENABLE (true)
48#define DEFAULT_TSO_ENABLE (true)
49#define SMSC75XX_INTERNAL_PHY_ID (1) 48#define SMSC75XX_INTERNAL_PHY_ID (1)
50#define SMSC75XX_TX_OVERHEAD (8) 49#define SMSC75XX_TX_OVERHEAD (8)
51#define MAX_RX_FIFO_SIZE (20 * 1024) 50#define MAX_RX_FIFO_SIZE (20 * 1024)
@@ -1410,17 +1409,14 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf)
1410 1409
1411 INIT_WORK(&pdata->set_multicast, smsc75xx_deferred_multicast_write); 1410 INIT_WORK(&pdata->set_multicast, smsc75xx_deferred_multicast_write);
1412 1411
1413 if (DEFAULT_TX_CSUM_ENABLE) { 1412 if (DEFAULT_TX_CSUM_ENABLE)
1414 dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; 1413 dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
1415 if (DEFAULT_TSO_ENABLE) 1414
1416 dev->net->features |= NETIF_F_SG |
1417 NETIF_F_TSO | NETIF_F_TSO6;
1418 }
1419 if (DEFAULT_RX_CSUM_ENABLE) 1415 if (DEFAULT_RX_CSUM_ENABLE)
1420 dev->net->features |= NETIF_F_RXCSUM; 1416 dev->net->features |= NETIF_F_RXCSUM;
1421 1417
1422 dev->net->hw_features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 1418 dev->net->hw_features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
1423 NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_RXCSUM; 1419 NETIF_F_RXCSUM;
1424 1420
1425 ret = smsc75xx_wait_ready(dev, 0); 1421 ret = smsc75xx_wait_ready(dev, 0);
1426 if (ret < 0) { 1422 if (ret < 0) {
@@ -2200,8 +2196,6 @@ static struct sk_buff *smsc75xx_tx_fixup(struct usbnet *dev,
2200{ 2196{
2201 u32 tx_cmd_a, tx_cmd_b; 2197 u32 tx_cmd_a, tx_cmd_b;
2202 2198
2203 skb_linearize(skb);
2204
2205 if (skb_headroom(skb) < SMSC75XX_TX_OVERHEAD) { 2199 if (skb_headroom(skb) < SMSC75XX_TX_OVERHEAD) {
2206 struct sk_buff *skb2 = 2200 struct sk_buff *skb2 =
2207 skb_copy_expand(skb, SMSC75XX_TX_OVERHEAD, 0, flags); 2201 skb_copy_expand(skb, SMSC75XX_TX_OVERHEAD, 0, flags);