Skip to content

Commit

Permalink
stmmac: correct mc_filter local variable in set_filter and set_mac_ad…
Browse files Browse the repository at this point in the history
…dr call

Testing revealed that the local variable mc_filter was dimensioned
incorrectly for all possible configurations and get_mac_addr should
have been set_mac_addr (a typo). Make sure mc_filter is dimensioned
to 8 32-bit unsigned longs - the largest size of the Synopsys
multicast filter register set.

Signed-off-by: Vince Bridgers <[email protected]>
Acked-by: Giuseppe Cavallaro <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Vince Bridgers authored and davem330 committed Oct 10, 2014
1 parent 3b3d136 commit 3dab99e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static void dwmac1000_set_filter(struct mac_device_info *hw,
void __iomem *ioaddr = (void __iomem *)dev->base_addr;
unsigned int value = 0;
unsigned int perfect_addr_number = hw->unicast_filter_entries;
u32 mc_filter[2];
u32 mc_filter[8];
int mcbitslog2 = hw->mcast_bits_log2;

pr_debug("%s: # mcasts %d, # unicast %d\n", __func__,
Expand Down Expand Up @@ -182,7 +182,7 @@ static void dwmac1000_set_filter(struct mac_device_info *hw,
struct netdev_hw_addr *ha;

netdev_for_each_uc_addr(ha, dev) {
stmmac_get_mac_addr(ioaddr, ha->addr,
stmmac_set_mac_addr(ioaddr, ha->addr,
GMAC_ADDR_HIGH(reg),
GMAC_ADDR_LOW(reg));
reg++;
Expand Down

0 comments on commit 3dab99e

Please sign in to comment.