diff options
author | Jiri Pirko <jpirko@redhat.com> | 2010-02-19 19:13:58 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-22 18:45:51 -0500 |
commit | 0ddf477b8a9b02412a6cabd51c486998811c7dd1 (patch) | |
tree | df82cf6637248439897153aca2f8fa6216003b61 /drivers/net/amd8111e.c | |
parent | 3b9a7728d878a3e7adc79fb89c3bb9ebc23760d7 (diff) |
net: convert multiple drivers to use netdev_for_each_mc_addr, part3
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/amd8111e.c')
-rw-r--r-- | drivers/net/amd8111e.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c index bdffdfb4c88b..b8a59d255b49 100644 --- a/drivers/net/amd8111e.c +++ b/drivers/net/amd8111e.c | |||
@@ -1377,10 +1377,11 @@ list to the device. | |||
1377 | */ | 1377 | */ |
1378 | static void amd8111e_set_multicast_list(struct net_device *dev) | 1378 | static void amd8111e_set_multicast_list(struct net_device *dev) |
1379 | { | 1379 | { |
1380 | struct dev_mc_list* mc_ptr; | 1380 | struct dev_mc_list *mc_ptr; |
1381 | struct amd8111e_priv *lp = netdev_priv(dev); | 1381 | struct amd8111e_priv *lp = netdev_priv(dev); |
1382 | u32 mc_filter[2] ; | 1382 | u32 mc_filter[2] ; |
1383 | int i,bit_num; | 1383 | int bit_num; |
1384 | |||
1384 | if(dev->flags & IFF_PROMISC){ | 1385 | if(dev->flags & IFF_PROMISC){ |
1385 | writel( VAL2 | PROM, lp->mmio + CMD2); | 1386 | writel( VAL2 | PROM, lp->mmio + CMD2); |
1386 | return; | 1387 | return; |
@@ -1391,7 +1392,6 @@ static void amd8111e_set_multicast_list(struct net_device *dev) | |||
1391 | netdev_mc_count(dev) > MAX_FILTER_SIZE) { | 1392 | netdev_mc_count(dev) > MAX_FILTER_SIZE) { |
1392 | /* get all multicast packet */ | 1393 | /* get all multicast packet */ |
1393 | mc_filter[1] = mc_filter[0] = 0xffffffff; | 1394 | mc_filter[1] = mc_filter[0] = 0xffffffff; |
1394 | lp->mc_list = dev->mc_list; | ||
1395 | lp->options |= OPTION_MULTICAST_ENABLE; | 1395 | lp->options |= OPTION_MULTICAST_ENABLE; |
1396 | amd8111e_writeq(*(u64*)mc_filter,lp->mmio + LADRF); | 1396 | amd8111e_writeq(*(u64*)mc_filter,lp->mmio + LADRF); |
1397 | return; | 1397 | return; |
@@ -1399,7 +1399,6 @@ static void amd8111e_set_multicast_list(struct net_device *dev) | |||
1399 | if (netdev_mc_empty(dev)) { | 1399 | if (netdev_mc_empty(dev)) { |
1400 | /* get only own packets */ | 1400 | /* get only own packets */ |
1401 | mc_filter[1] = mc_filter[0] = 0; | 1401 | mc_filter[1] = mc_filter[0] = 0; |
1402 | lp->mc_list = NULL; | ||
1403 | lp->options &= ~OPTION_MULTICAST_ENABLE; | 1402 | lp->options &= ~OPTION_MULTICAST_ENABLE; |
1404 | amd8111e_writeq(*(u64*)mc_filter,lp->mmio + LADRF); | 1403 | amd8111e_writeq(*(u64*)mc_filter,lp->mmio + LADRF); |
1405 | /* disable promiscous mode */ | 1404 | /* disable promiscous mode */ |
@@ -1408,10 +1407,8 @@ static void amd8111e_set_multicast_list(struct net_device *dev) | |||
1408 | } | 1407 | } |
1409 | /* load all the multicast addresses in the logic filter */ | 1408 | /* load all the multicast addresses in the logic filter */ |
1410 | lp->options |= OPTION_MULTICAST_ENABLE; | 1409 | lp->options |= OPTION_MULTICAST_ENABLE; |
1411 | lp->mc_list = dev->mc_list; | ||
1412 | mc_filter[1] = mc_filter[0] = 0; | 1410 | mc_filter[1] = mc_filter[0] = 0; |
1413 | for (i = 0, mc_ptr = dev->mc_list; mc_ptr && i < netdev_mc_count(dev); | 1411 | netdev_for_each_mc_addr(mc_ptr, dev) { |
1414 | i++, mc_ptr = mc_ptr->next) { | ||
1415 | bit_num = (ether_crc_le(ETH_ALEN, mc_ptr->dmi_addr) >> 26) & 0x3f; | 1412 | bit_num = (ether_crc_le(ETH_ALEN, mc_ptr->dmi_addr) >> 26) & 0x3f; |
1416 | mc_filter[bit_num >> 5] |= 1 << (bit_num & 31); | 1413 | mc_filter[bit_num >> 5] |= 1 << (bit_num & 31); |
1417 | } | 1414 | } |