diff options
Diffstat (limited to 'drivers/net/e1000/e1000_main.c')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 79fe1ee3da52..74667e521431 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -2330,7 +2330,8 @@ static void e1000_set_rx_mode(struct net_device *netdev) | |||
2330 | { | 2330 | { |
2331 | struct e1000_adapter *adapter = netdev_priv(netdev); | 2331 | struct e1000_adapter *adapter = netdev_priv(netdev); |
2332 | struct e1000_hw *hw = &adapter->hw; | 2332 | struct e1000_hw *hw = &adapter->hw; |
2333 | struct dev_addr_list *uc_ptr; | 2333 | struct netdev_hw_addr *ha; |
2334 | bool use_uc = false; | ||
2334 | struct dev_addr_list *mc_ptr; | 2335 | struct dev_addr_list *mc_ptr; |
2335 | u32 rctl; | 2336 | u32 rctl; |
2336 | u32 hash_value; | 2337 | u32 hash_value; |
@@ -2369,12 +2370,11 @@ static void e1000_set_rx_mode(struct net_device *netdev) | |||
2369 | rctl |= E1000_RCTL_VFE; | 2370 | rctl |= E1000_RCTL_VFE; |
2370 | } | 2371 | } |
2371 | 2372 | ||
2372 | uc_ptr = NULL; | ||
2373 | if (netdev->uc_count > rar_entries - 1) { | 2373 | if (netdev->uc_count > rar_entries - 1) { |
2374 | rctl |= E1000_RCTL_UPE; | 2374 | rctl |= E1000_RCTL_UPE; |
2375 | } else if (!(netdev->flags & IFF_PROMISC)) { | 2375 | } else if (!(netdev->flags & IFF_PROMISC)) { |
2376 | rctl &= ~E1000_RCTL_UPE; | 2376 | rctl &= ~E1000_RCTL_UPE; |
2377 | uc_ptr = netdev->uc_list; | 2377 | use_uc = true; |
2378 | } | 2378 | } |
2379 | 2379 | ||
2380 | ew32(RCTL, rctl); | 2380 | ew32(RCTL, rctl); |
@@ -2392,13 +2392,20 @@ static void e1000_set_rx_mode(struct net_device *netdev) | |||
2392 | * if there are not 14 addresses, go ahead and clear the filters | 2392 | * if there are not 14 addresses, go ahead and clear the filters |
2393 | * -- with 82571 controllers only 0-13 entries are filled here | 2393 | * -- with 82571 controllers only 0-13 entries are filled here |
2394 | */ | 2394 | */ |
2395 | i = 1; | ||
2396 | if (use_uc) | ||
2397 | list_for_each_entry(ha, &netdev->uc_list, list) { | ||
2398 | if (i == rar_entries) | ||
2399 | break; | ||
2400 | e1000_rar_set(hw, ha->addr, i++); | ||
2401 | } | ||
2402 | |||
2403 | WARN_ON(i == rar_entries); | ||
2404 | |||
2395 | mc_ptr = netdev->mc_list; | 2405 | mc_ptr = netdev->mc_list; |
2396 | 2406 | ||
2397 | for (i = 1; i < rar_entries; i++) { | 2407 | for (; i < rar_entries; i++) { |
2398 | if (uc_ptr) { | 2408 | if (mc_ptr) { |
2399 | e1000_rar_set(hw, uc_ptr->da_addr, i); | ||
2400 | uc_ptr = uc_ptr->next; | ||
2401 | } else if (mc_ptr) { | ||
2402 | e1000_rar_set(hw, mc_ptr->da_addr, i); | 2409 | e1000_rar_set(hw, mc_ptr->da_addr, i); |
2403 | mc_ptr = mc_ptr->next; | 2410 | mc_ptr = mc_ptr->next; |
2404 | } else { | 2411 | } else { |
@@ -2408,7 +2415,6 @@ static void e1000_set_rx_mode(struct net_device *netdev) | |||
2408 | E1000_WRITE_FLUSH(); | 2415 | E1000_WRITE_FLUSH(); |
2409 | } | 2416 | } |
2410 | } | 2417 | } |
2411 | WARN_ON(uc_ptr != NULL); | ||
2412 | 2418 | ||
2413 | /* load any remaining addresses into the hash table */ | 2419 | /* load any remaining addresses into the hash table */ |
2414 | 2420 | ||