stmmac: convert unicast addr list to list_head
This patch converts unicast address list to standard list_head using previously introduced struct netdev_hw_addr. Note: this patch also removes a debug printk used for displaying the mac addresses. Indeed, it's is possible to dump the registers with ethtool. Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
109cdd6648
commit
609634799e
@@ -435,7 +435,7 @@ static void gmac_set_filter(struct net_device *dev)
|
|||||||
unsigned int value = 0;
|
unsigned int value = 0;
|
||||||
|
|
||||||
DBG(KERN_INFO "%s: # mcasts %d, # unicast %d\n",
|
DBG(KERN_INFO "%s: # mcasts %d, # unicast %d\n",
|
||||||
__func__, dev->mc_count, dev->uc_count);
|
__func__, dev->mc_count, dev->uc.count);
|
||||||
|
|
||||||
if (dev->flags & IFF_PROMISC)
|
if (dev->flags & IFF_PROMISC)
|
||||||
value = GMAC_FRAME_FILTER_PR;
|
value = GMAC_FRAME_FILTER_PR;
|
||||||
@@ -469,25 +469,17 @@ static void gmac_set_filter(struct net_device *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Handle multiple unicast addresses (perfect filtering)*/
|
/* Handle multiple unicast addresses (perfect filtering)*/
|
||||||
if (dev->uc_count > GMAC_MAX_UNICAST_ADDRESSES)
|
if (dev->uc.count > GMAC_MAX_UNICAST_ADDRESSES)
|
||||||
/* Switch to promiscuous mode is more than 16 addrs
|
/* Switch to promiscuous mode is more than 16 addrs
|
||||||
are required */
|
are required */
|
||||||
value |= GMAC_FRAME_FILTER_PR;
|
value |= GMAC_FRAME_FILTER_PR;
|
||||||
else {
|
else {
|
||||||
int i;
|
int reg = 1;
|
||||||
struct dev_addr_list *uc_ptr = dev->uc_list;
|
struct netdev_hw_addr *ha;
|
||||||
|
|
||||||
for (i = 0; i < dev->uc_count; i++) {
|
list_for_each_entry(ha, &dev->uc.list, list) {
|
||||||
gmac_set_umac_addr(ioaddr, uc_ptr->da_addr,
|
gmac_set_umac_addr(ioaddr, ha->addr, reg);
|
||||||
i + 1);
|
reg++;
|
||||||
|
|
||||||
DBG(KERN_INFO "\t%d "
|
|
||||||
"- Unicast addr %02x:%02x:%02x:%02x:%02x:"
|
|
||||||
"%02x\n", i + 1,
|
|
||||||
uc_ptr->da_addr[0], uc_ptr->da_addr[1],
|
|
||||||
uc_ptr->da_addr[2], uc_ptr->da_addr[3],
|
|
||||||
uc_ptr->da_addr[4], uc_ptr->da_addr[5]);
|
|
||||||
uc_ptr = uc_ptr->next;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user