Skip to contentSkip to conversation

stmmac: correct mc_filter local variable in set_filter and set_mac_addr call

PATCH Applied Vince Bridgers 3 participants 3 messages Oct 9, 2014 – Oct 10, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 stmmac: correct mc_filter local variable in set_filter and set_mac_addr 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.

---
 drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c +2 -2
index 5efe60e..0adcf73 100644
@@ -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__,
@@ -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++;
Signature · 1 line
1.9.1
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Vince Bridgers

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.

Quoted 27 lines
---
  drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c +2 -2
index 5efe60e..0adcf73 100644
@@ -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__,
@@ -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++;
maintainer Applied
#2 lore raw
In reply to Vince Bridgers

From: Vince Bridgers <[email protected]>
Date: Thu, 9 Oct 2014 10:10:36 -0500

Quoted 7 lines

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.

Applied, thanks vince.