aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/asix.c16
-rw-r--r--drivers/net/usb/catc.c6
-rw-r--r--drivers/net/usb/dm9601.c6
-rw-r--r--drivers/net/usb/mcs7830.c6
-rw-r--r--drivers/net/usb/smsc75xx.c6
-rw-r--r--drivers/net/usb/smsc95xx.c6
-rw-r--r--drivers/net/usb/usbnet.c15
7 files changed, 30 insertions, 31 deletions
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index 35f56fc82803..8e7d2374558b 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -558,16 +558,14 @@ static void asix_set_multicast(struct net_device *net)
558 * for our 8 byte filter buffer 558 * for our 8 byte filter buffer
559 * to avoid allocating memory that 559 * to avoid allocating memory that
560 * is tricky to free later */ 560 * is tricky to free later */
561 struct dev_mc_list *mc_list; 561 struct netdev_hw_addr *ha;
562 u32 crc_bits; 562 u32 crc_bits;
563 563
564 memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE); 564 memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE);
565 565
566 /* Build the multicast hash filter. */ 566 /* Build the multicast hash filter. */
567 netdev_for_each_mc_addr(mc_list, net) { 567 netdev_for_each_mc_addr(ha, net) {
568 crc_bits = 568 crc_bits = ether_crc(ETH_ALEN, ha->addr) >> 26;
569 ether_crc(ETH_ALEN,
570 mc_list->dmi_addr) >> 26;
571 data->multi_filter[crc_bits >> 3] |= 569 data->multi_filter[crc_bits >> 3] |=
572 1 << (crc_bits & 7); 570 1 << (crc_bits & 7);
573 } 571 }
@@ -794,16 +792,14 @@ static void ax88172_set_multicast(struct net_device *net)
794 * for our 8 byte filter buffer 792 * for our 8 byte filter buffer
795 * to avoid allocating memory that 793 * to avoid allocating memory that
796 * is tricky to free later */ 794 * is tricky to free later */
797 struct dev_mc_list *mc_list; 795 struct netdev_hw_addr *ha;
798 u32 crc_bits; 796 u32 crc_bits;
799 797
800 memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE); 798 memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE);
801 799
802 /* Build the multicast hash filter. */ 800 /* Build the multicast hash filter. */
803 netdev_for_each_mc_addr(mc_list, net) { 801 netdev_for_each_mc_addr(ha, net) {
804 crc_bits = 802 crc_bits = ether_crc(ETH_ALEN, ha->addr) >> 26;
805 ether_crc(ETH_ALEN,
806 mc_list->dmi_addr) >> 26;
807 data->multi_filter[crc_bits >> 3] |= 803 data->multi_filter[crc_bits >> 3] |=
808 1 << (crc_bits & 7); 804 1 << (crc_bits & 7);
809 } 805 }
diff --git a/drivers/net/usb/catc.c b/drivers/net/usb/catc.c
index 602e123b2741..97687d335903 100644
--- a/drivers/net/usb/catc.c
+++ b/drivers/net/usb/catc.c
@@ -629,7 +629,7 @@ static void catc_multicast(unsigned char *addr, u8 *multicast)
629static void catc_set_multicast_list(struct net_device *netdev) 629static void catc_set_multicast_list(struct net_device *netdev)
630{ 630{
631 struct catc *catc = netdev_priv(netdev); 631 struct catc *catc = netdev_priv(netdev);
632 struct dev_mc_list *mc; 632 struct netdev_hw_addr *ha;
633 u8 broadcast[6]; 633 u8 broadcast[6];
634 u8 rx = RxEnable | RxPolarity | RxMultiCast; 634 u8 rx = RxEnable | RxPolarity | RxMultiCast;
635 635
@@ -647,8 +647,8 @@ static void catc_set_multicast_list(struct net_device *netdev)
647 if (netdev->flags & IFF_ALLMULTI) { 647 if (netdev->flags & IFF_ALLMULTI) {
648 memset(catc->multicast, 0xff, 64); 648 memset(catc->multicast, 0xff, 64);
649 } else { 649 } else {
650 netdev_for_each_mc_addr(mc, netdev) { 650 netdev_for_each_mc_addr(ha, netdev) {
651 u32 crc = ether_crc_le(6, mc->dmi_addr); 651 u32 crc = ether_crc_le(6, ha->addr);
652 if (!catc->is_f5u011) { 652 if (!catc->is_f5u011) {
653 catc->multicast[(crc >> 3) & 0x3f] |= 1 << (crc & 7); 653 catc->multicast[(crc >> 3) & 0x3f] |= 1 << (crc & 7);
654 } else { 654 } else {
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c
index 04b281002a76..291add255246 100644
--- a/drivers/net/usb/dm9601.c
+++ b/drivers/net/usb/dm9601.c
@@ -387,10 +387,10 @@ static void dm9601_set_multicast(struct net_device *net)
387 netdev_mc_count(net) > DM_MAX_MCAST) { 387 netdev_mc_count(net) > DM_MAX_MCAST) {
388 rx_ctl |= 0x04; 388 rx_ctl |= 0x04;
389 } else if (!netdev_mc_empty(net)) { 389 } else if (!netdev_mc_empty(net)) {
390 struct dev_mc_list *mc_list; 390 struct netdev_hw_addr *ha;
391 391
392 netdev_for_each_mc_addr(mc_list, net) { 392 netdev_for_each_mc_addr(ha, net) {
393 u32 crc = ether_crc(ETH_ALEN, mc_list->dmi_addr) >> 26; 393 u32 crc = ether_crc(ETH_ALEN, ha->addr) >> 26;
394 hashes[crc >> 3] |= 1 << (crc & 0x7); 394 hashes[crc >> 3] |= 1 << (crc & 0x7);
395 } 395 }
396 } 396 }
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c
index 9f24e3f871e1..834d8cd3005d 100644
--- a/drivers/net/usb/mcs7830.c
+++ b/drivers/net/usb/mcs7830.c
@@ -453,12 +453,12 @@ static void mcs7830_data_set_multicast(struct net_device *net)
453 * for our 8 byte filter buffer 453 * for our 8 byte filter buffer
454 * to avoid allocating memory that 454 * to avoid allocating memory that
455 * is tricky to free later */ 455 * is tricky to free later */
456 struct dev_mc_list *mc_list; 456 struct netdev_hw_addr *ha;
457 u32 crc_bits; 457 u32 crc_bits;
458 458
459 /* Build the multicast hash filter. */ 459 /* Build the multicast hash filter. */
460 netdev_for_each_mc_addr(mc_list, net) { 460 netdev_for_each_mc_addr(ha, net) {
461 crc_bits = ether_crc(ETH_ALEN, mc_list->dmi_addr) >> 26; 461 crc_bits = ether_crc(ETH_ALEN, ha->addr) >> 26;
462 data->multi_filter[crc_bits >> 3] |= 1 << (crc_bits & 7); 462 data->multi_filter[crc_bits >> 3] |= 1 << (crc_bits & 7);
463 } 463 }
464 } 464 }
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index 35b98b1b79e4..753ee6eb7edd 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -445,14 +445,14 @@ static void smsc75xx_set_multicast(struct net_device *netdev)
445 netif_dbg(dev, drv, dev->net, "receive all multicast enabled"); 445 netif_dbg(dev, drv, dev->net, "receive all multicast enabled");
446 pdata->rfe_ctl |= RFE_CTL_AM | RFE_CTL_DPF; 446 pdata->rfe_ctl |= RFE_CTL_AM | RFE_CTL_DPF;
447 } else if (!netdev_mc_empty(dev->net)) { 447 } else if (!netdev_mc_empty(dev->net)) {
448 struct dev_mc_list *mc_list; 448 struct netdev_hw_addr *ha;
449 449
450 netif_dbg(dev, drv, dev->net, "receive multicast hash filter"); 450 netif_dbg(dev, drv, dev->net, "receive multicast hash filter");
451 451
452 pdata->rfe_ctl |= RFE_CTL_MHF | RFE_CTL_DPF; 452 pdata->rfe_ctl |= RFE_CTL_MHF | RFE_CTL_DPF;
453 453
454 netdev_for_each_mc_addr(mc_list, netdev) { 454 netdev_for_each_mc_addr(ha, netdev) {
455 u32 bitnum = smsc75xx_hash(mc_list->dmi_addr); 455 u32 bitnum = smsc75xx_hash(ha->addr);
456 pdata->multicast_hash_table[bitnum / 32] |= 456 pdata->multicast_hash_table[bitnum / 32] |=
457 (1 << (bitnum % 32)); 457 (1 << (bitnum % 32));
458 } 458 }
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 3135af63d378..12a3c88c5282 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -385,13 +385,13 @@ static void smsc95xx_set_multicast(struct net_device *netdev)
385 pdata->mac_cr |= MAC_CR_MCPAS_; 385 pdata->mac_cr |= MAC_CR_MCPAS_;
386 pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_HPFILT_); 386 pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_HPFILT_);
387 } else if (!netdev_mc_empty(dev->net)) { 387 } else if (!netdev_mc_empty(dev->net)) {
388 struct dev_mc_list *mc_list; 388 struct netdev_hw_addr *ha;
389 389
390 pdata->mac_cr |= MAC_CR_HPFILT_; 390 pdata->mac_cr |= MAC_CR_HPFILT_;
391 pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_MCPAS_); 391 pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_MCPAS_);
392 392
393 netdev_for_each_mc_addr(mc_list, netdev) { 393 netdev_for_each_mc_addr(ha, netdev) {
394 u32 bitnum = smsc95xx_hash(mc_list->dmi_addr); 394 u32 bitnum = smsc95xx_hash(ha->addr);
395 u32 mask = 0x01 << (bitnum & 0x1F); 395 u32 mask = 0x01 << (bitnum & 0x1F);
396 if (bitnum & 0x20) 396 if (bitnum & 0x20)
397 hash_hi |= mask; 397 hash_hi |= mask;
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 7177abc78dc6..a95c73de5824 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1069,12 +1069,15 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
1069 * NOTE: strictly conforming cdc-ether devices should expect 1069 * NOTE: strictly conforming cdc-ether devices should expect
1070 * the ZLP here, but ignore the one-byte packet. 1070 * the ZLP here, but ignore the one-byte packet.
1071 */ 1071 */
1072 if (!(info->flags & FLAG_SEND_ZLP) && (length % dev->maxpacket) == 0) { 1072 if (length % dev->maxpacket == 0) {
1073 urb->transfer_buffer_length++; 1073 if (!(info->flags & FLAG_SEND_ZLP)) {
1074 if (skb_tailroom(skb)) { 1074 urb->transfer_buffer_length++;
1075 skb->data[skb->len] = 0; 1075 if (skb_tailroom(skb)) {
1076 __skb_put(skb, 1); 1076 skb->data[skb->len] = 0;
1077 } 1077 __skb_put(skb, 1);
1078 }
1079 } else
1080 urb->transfer_flags |= URB_ZERO_PACKET;
1078 } 1081 }
1079 1082
1080 spin_lock_irqsave(&dev->txq.lock, flags); 1083 spin_lock_irqsave(&dev->txq.lock, flags);