aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2010-04-01 17:22:57 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-03 17:22:15 -0400
commit22bedad3ce112d5ca1eaf043d4990fa2ed698c87 (patch)
treeb6fba5688d48b1396f01d13ee53610dea7749c15 /drivers/net/usb
parenta748ee2426817a95b1f03012d8f339c45c722ae1 (diff)
net: convert multicast list to list_head
Converts the list and the core manipulating with it to be the same as uc_list. +uses two functions for adding/removing mc address (normal and "global" variant) instead of a function parameter. +removes dev_mcast.c completely. +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for manipulation with lists on a sandbox (used in bonding and 80211 drivers) Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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
6 files changed, 21 insertions, 25 deletions
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index 9e05639435f2..763364f0972e 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -557,16 +557,14 @@ static void asix_set_multicast(struct net_device *net)
557 * for our 8 byte filter buffer 557 * for our 8 byte filter buffer
558 * to avoid allocating memory that 558 * to avoid allocating memory that
559 * is tricky to free later */ 559 * is tricky to free later */
560 struct dev_mc_list *mc_list; 560 struct netdev_hw_addr *ha;
561 u32 crc_bits; 561 u32 crc_bits;
562 562
563 memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE); 563 memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE);
564 564
565 /* Build the multicast hash filter. */ 565 /* Build the multicast hash filter. */
566 netdev_for_each_mc_addr(mc_list, net) { 566 netdev_for_each_mc_addr(ha, net) {
567 crc_bits = 567 crc_bits = ether_crc(ETH_ALEN, ha->addr) >> 26;
568 ether_crc(ETH_ALEN,
569 mc_list->dmi_addr) >> 26;
570 data->multi_filter[crc_bits >> 3] |= 568 data->multi_filter[crc_bits >> 3] |=
571 1 << (crc_bits & 7); 569 1 << (crc_bits & 7);
572 } 570 }
@@ -793,16 +791,14 @@ static void ax88172_set_multicast(struct net_device *net)
793 * for our 8 byte filter buffer 791 * for our 8 byte filter buffer
794 * to avoid allocating memory that 792 * to avoid allocating memory that
795 * is tricky to free later */ 793 * is tricky to free later */
796 struct dev_mc_list *mc_list; 794 struct netdev_hw_addr *ha;
797 u32 crc_bits; 795 u32 crc_bits;
798 796
799 memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE); 797 memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE);
800 798
801 /* Build the multicast hash filter. */ 799 /* Build the multicast hash filter. */
802 netdev_for_each_mc_addr(mc_list, net) { 800 netdev_for_each_mc_addr(ha, net) {
803 crc_bits = 801 crc_bits = ether_crc(ETH_ALEN, ha->addr) >> 26;
804 ether_crc(ETH_ALEN,
805 mc_list->dmi_addr) >> 26;
806 data->multi_filter[crc_bits >> 3] |= 802 data->multi_filter[crc_bits >> 3] |=
807 1 << (crc_bits & 7); 803 1 << (crc_bits & 7);
808 } 804 }
diff --git a/drivers/net/usb/catc.c b/drivers/net/usb/catc.c
index 96f1ebe0d348..0c48ff97f47c 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 269339769f47..4eb1fb31ff0b 100644
--- a/drivers/net/usb/dm9601.c
+++ b/drivers/net/usb/dm9601.c
@@ -386,10 +386,10 @@ static void dm9601_set_multicast(struct net_device *net)
386 netdev_mc_count(net) > DM_MAX_MCAST) { 386 netdev_mc_count(net) > DM_MAX_MCAST) {
387 rx_ctl |= 0x04; 387 rx_ctl |= 0x04;
388 } else if (!netdev_mc_empty(net)) { 388 } else if (!netdev_mc_empty(net)) {
389 struct dev_mc_list *mc_list; 389 struct netdev_hw_addr *ha;
390 390
391 netdev_for_each_mc_addr(mc_list, net) { 391 netdev_for_each_mc_addr(ha, net) {
392 u32 crc = ether_crc(ETH_ALEN, mc_list->dmi_addr) >> 26; 392 u32 crc = ether_crc(ETH_ALEN, ha->addr) >> 26;
393 hashes[crc >> 3] |= 1 << (crc & 0x7); 393 hashes[crc >> 3] |= 1 << (crc & 0x7);
394 } 394 }
395 } 395 }
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c
index 70978219e98a..0dc92c8ba4b2 100644
--- a/drivers/net/usb/mcs7830.c
+++ b/drivers/net/usb/mcs7830.c
@@ -452,12 +452,12 @@ static void mcs7830_data_set_multicast(struct net_device *net)
452 * for our 8 byte filter buffer 452 * for our 8 byte filter buffer
453 * to avoid allocating memory that 453 * to avoid allocating memory that
454 * is tricky to free later */ 454 * is tricky to free later */
455 struct dev_mc_list *mc_list; 455 struct netdev_hw_addr *ha;
456 u32 crc_bits; 456 u32 crc_bits;
457 457
458 /* Build the multicast hash filter. */ 458 /* Build the multicast hash filter. */
459 netdev_for_each_mc_addr(mc_list, net) { 459 netdev_for_each_mc_addr(ha, net) {
460 crc_bits = ether_crc(ETH_ALEN, mc_list->dmi_addr) >> 26; 460 crc_bits = ether_crc(ETH_ALEN, ha->addr) >> 26;
461 data->multi_filter[crc_bits >> 3] |= 1 << (crc_bits & 7); 461 data->multi_filter[crc_bits >> 3] |= 1 << (crc_bits & 7);
462 } 462 }
463 } 463 }
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index 300e3e764fa2..b8b00d06ea79 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -444,14 +444,14 @@ static void smsc75xx_set_multicast(struct net_device *netdev)
444 netif_dbg(dev, drv, dev->net, "receive all multicast enabled"); 444 netif_dbg(dev, drv, dev->net, "receive all multicast enabled");
445 pdata->rfe_ctl |= RFE_CTL_AM | RFE_CTL_DPF; 445 pdata->rfe_ctl |= RFE_CTL_AM | RFE_CTL_DPF;
446 } else if (!netdev_mc_empty(dev->net)) { 446 } else if (!netdev_mc_empty(dev->net)) {
447 struct dev_mc_list *mc_list; 447 struct netdev_hw_addr *ha;
448 448
449 netif_dbg(dev, drv, dev->net, "receive multicast hash filter"); 449 netif_dbg(dev, drv, dev->net, "receive multicast hash filter");
450 450
451 pdata->rfe_ctl |= RFE_CTL_MHF | RFE_CTL_DPF; 451 pdata->rfe_ctl |= RFE_CTL_MHF | RFE_CTL_DPF;
452 452
453 netdev_for_each_mc_addr(mc_list, netdev) { 453 netdev_for_each_mc_addr(ha, netdev) {
454 u32 bitnum = smsc75xx_hash(mc_list->dmi_addr); 454 u32 bitnum = smsc75xx_hash(ha->addr);
455 pdata->multicast_hash_table[bitnum / 32] |= 455 pdata->multicast_hash_table[bitnum / 32] |=
456 (1 << (bitnum % 32)); 456 (1 << (bitnum % 32));
457 } 457 }
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 73f9a31cf94d..ccd55ca3a06a 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -384,13 +384,13 @@ static void smsc95xx_set_multicast(struct net_device *netdev)
384 pdata->mac_cr |= MAC_CR_MCPAS_; 384 pdata->mac_cr |= MAC_CR_MCPAS_;
385 pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_HPFILT_); 385 pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_HPFILT_);
386 } else if (!netdev_mc_empty(dev->net)) { 386 } else if (!netdev_mc_empty(dev->net)) {
387 struct dev_mc_list *mc_list; 387 struct netdev_hw_addr *ha;
388 388
389 pdata->mac_cr |= MAC_CR_HPFILT_; 389 pdata->mac_cr |= MAC_CR_HPFILT_;
390 pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_MCPAS_); 390 pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_MCPAS_);
391 391
392 netdev_for_each_mc_addr(mc_list, netdev) { 392 netdev_for_each_mc_addr(ha, netdev) {
393 u32 bitnum = smsc95xx_hash(mc_list->dmi_addr); 393 u32 bitnum = smsc95xx_hash(ha->addr);
394 u32 mask = 0x01 << (bitnum & 0x1F); 394 u32 mask = 0x01 << (bitnum & 0x1F);
395 if (bitnum & 0x20) 395 if (bitnum & 0x20)
396 hash_hi |= mask; 396 hash_hi |= mask;