Root/package/system/ep80579-drivers/patches/103-iegbe_convert_unicast_addr_list.patch

1--- a/Embedded/src/GbE/iegbe_main.c
2+++ b/Embedded/src/GbE/iegbe_main.c
3@@ -2161,7 +2161,8 @@ static void iegbe_set_rx_mode(struct net
4 {
5     struct iegbe_adapter *adapter = netdev_priv(netdev);
6     struct iegbe_hw *hw = &adapter->hw;
7- struct dev_addr_list *uc_ptr;
8+ struct netdev_hw_addr *ha;
9+ bool use_uc = false;
10     struct dev_addr_list *mc_ptr;
11     u32 rctl;
12     u32 hash_value;
13@@ -2187,12 +2188,11 @@ int mta_reg_count = E1000_NUM_MTA_REGIST
14         }
15     }
16 
17- uc_ptr = NULL;
18     if (netdev->uc_count > rar_entries - 1) {
19         rctl |= E1000_RCTL_UPE;
20     } else if (!(netdev->flags & IFF_PROMISC)) {
21         rctl &= ~E1000_RCTL_UPE;
22- uc_ptr = netdev->uc_list;
23+ use_uc = true;
24     }
25 
26     E1000_WRITE_REG(&adapter->hw, RCTL, rctl);
27@@ -2210,13 +2210,20 @@ int mta_reg_count = E1000_NUM_MTA_REGIST
28      * if there are not 14 addresses, go ahead and clear the filters
29      * -- with 82571 controllers only 0-13 entries are filled here
30      */
31+ i = 1;
32+ if (use_uc)
33+ list_for_each_entry(ha, &netdev->uc_list, list) {
34+ if (i == rar_entries)
35+ break;
36+ iegbe_rar_set(hw, ha->addr, i++);
37+ }
38+
39+ WARN_ON(i == rar_entries);
40+
41     mc_ptr = netdev->mc_list;
42 
43- for (i = 1; i < rar_entries; i++) {
44- if (uc_ptr) {
45- iegbe_rar_set(hw, uc_ptr->da_addr, i);
46- uc_ptr = uc_ptr->next;
47- } else if (mc_ptr) {
48+ for (; i < rar_entries; i++) {
49+ if (mc_ptr) {
50             iegbe_rar_set(hw, mc_ptr->da_addr, i);
51             mc_ptr = mc_ptr->next;
52         } else {
53@@ -2226,7 +2233,6 @@ int mta_reg_count = E1000_NUM_MTA_REGIST
54             E1000_WRITE_FLUSH(&adapter->hw);
55         }
56     }
57- WARN_ON(uc_ptr != NULL);
58 
59     /* clear the old settings from the multicast hash table */
60 
61

Archive Download this file



interactive