diff options
Diffstat (limited to 'drivers/net/bnx2.c')
-rw-r--r-- | drivers/net/bnx2.c | 13 |
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 | } |