aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2.c
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2009-05-22 19:22:17 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-30 01:12:32 -0400
commitccffad25b5136958d4769ed6de5e87992dd9c65c (patch)
treecd5f36fe67f4deeae23d76436f7a032a201cba44 /drivers/net/bnx2.c
parentae63e808f508c38fe65e23a1480c85d5bd00ecbd (diff)
net: convert unicast addr list
This patch converts unicast address list to standard list_head using previously introduced struct netdev_hw_addr. It also relaxes the locking. Original spinlock (still used for multicast addresses) is not needed and is no longer used for a protection of this list. All reading and writing takes place under rtnl (with no changes). I also removed a possibility to specify the length of the address while adding or deleting unicast address. It's always dev->addr_len. The convertion touched especially e1000 and ixgbe codes when the change is not so trivial. Signed-off-by: Jiri Pirko <jpirko@redhat.com> drivers/net/bnx2.c | 13 +-- drivers/net/e1000/e1000_main.c | 24 +++-- drivers/net/ixgbe/ixgbe_common.c | 14 ++-- drivers/net/ixgbe/ixgbe_common.h | 4 +- drivers/net/ixgbe/ixgbe_main.c | 6 +- drivers/net/ixgbe/ixgbe_type.h | 4 +- drivers/net/macvlan.c | 11 +- drivers/net/mv643xx_eth.c | 11 +- drivers/net/niu.c | 7 +- drivers/net/virtio_net.c | 7 +- drivers/s390/net/qeth_l2_main.c | 6 +- drivers/scsi/fcoe/fcoe.c | 16 ++-- include/linux/netdevice.h | 18 ++-- net/8021q/vlan.c | 4 +- net/8021q/vlan_dev.c | 10 +- net/core/dev.c | 195 +++++++++++++++++++++++++++----------- net/dsa/slave.c | 10 +- net/packet/af_packet.c | 4 +- 18 files changed, 227 insertions(+), 137 deletions(-) Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2.c')
-rw-r--r--drivers/net/bnx2.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 83ee0f53f2d2..f53017250e09 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -48,6 +48,7 @@
48#include <linux/cache.h> 48#include <linux/cache.h>
49#include <linux/firmware.h> 49#include <linux/firmware.h>
50#include <linux/log2.h> 50#include <linux/log2.h>
51#include <linux/list.h>
51 52
52#include "bnx2.h" 53#include "bnx2.h"
53#include "bnx2_fw.h" 54#include "bnx2_fw.h"
@@ -3310,7 +3311,7 @@ bnx2_set_rx_mode(struct net_device *dev)
3310{ 3311{
3311 struct bnx2 *bp = netdev_priv(dev); 3312 struct bnx2 *bp = netdev_priv(dev);
3312 u32 rx_mode, sort_mode; 3313 u32 rx_mode, sort_mode;
3313 struct dev_addr_list *uc_ptr; 3314 struct netdev_hw_addr *ha;
3314 int i; 3315 int i;
3315 3316
3316 if (!netif_running(dev)) 3317 if (!netif_running(dev))
@@ -3369,21 +3370,19 @@ bnx2_set_rx_mode(struct net_device *dev)
3369 sort_mode |= BNX2_RPM_SORT_USER0_MC_HSH_EN; 3370 sort_mode |= BNX2_RPM_SORT_USER0_MC_HSH_EN;
3370 } 3371 }
3371 3372
3372 uc_ptr = NULL;
3373 if (dev->uc_count > BNX2_MAX_UNICAST_ADDRESSES) { 3373 if (dev->uc_count > BNX2_MAX_UNICAST_ADDRESSES) {
3374 rx_mode |= BNX2_EMAC_RX_MODE_PROMISCUOUS; 3374 rx_mode |= BNX2_EMAC_RX_MODE_PROMISCUOUS;
3375 sort_mode |= BNX2_RPM_SORT_USER0_PROM_EN | 3375 sort_mode |= BNX2_RPM_SORT_USER0_PROM_EN |
3376 BNX2_RPM_SORT_USER0_PROM_VLAN; 3376 BNX2_RPM_SORT_USER0_PROM_VLAN;
3377 } else if (!(dev->flags & IFF_PROMISC)) { 3377 } else if (!(dev->flags & IFF_PROMISC)) {
3378 uc_ptr = dev->uc_list;
3379
3380 /* Add all entries into to the match filter list */ 3378 /* Add all entries into to the match filter list */
3381 for (i = 0; i < dev->uc_count; i++) { 3379 i = 0;
3382 bnx2_set_mac_addr(bp, uc_ptr->da_addr, 3380 list_for_each_entry(ha, &dev->uc_list, list) {
3381 bnx2_set_mac_addr(bp, ha->addr,
3383 i + BNX2_START_UNICAST_ADDRESS_INDEX); 3382 i + BNX2_START_UNICAST_ADDRESS_INDEX);
3384 sort_mode |= (1 << 3383 sort_mode |= (1 <<
3385 (i + BNX2_START_UNICAST_ADDRESS_INDEX)); 3384 (i + BNX2_START_UNICAST_ADDRESS_INDEX));
3386 uc_ptr = uc_ptr->next; 3385 i++;
3387 } 3386 }
3388 3387
3389 } 3388 }