Skip to contentSkip to conversation

stmmac: copy unicast mac address to MAC registers

PATCH Applied Bhadram Varka 2 participants 2 messages Oct 27, 2017 – Oct 28, 2017

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

PATCH 1/1 stmmac: copy unicast mac address to MAC registers

Currently stmmac driver not copying the valid ethernet MAC address to MAC registers. This patch takes care of updating the MAC register with MAC address.

---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +15 -1
index 0e1b0a3..e0e6348 100644
@@ -3748,6 +3748,20 @@ static int stmmac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 	return ret;
 }
 
+static int stmmac_set_mac_address(struct net_device *ndev, void *addr)
+{
+	struct stmmac_priv *priv = netdev_priv(ndev);
+	int ret = 0;
+
+	ret = eth_mac_addr(ndev, addr);
+	if (ret)
+		return ret;
+
+	priv->hw->mac->set_umac_addr(priv->hw, ndev->dev_addr, 0);
+
+	return ret;
+}
+
 #ifdef CONFIG_DEBUG_FS
 static struct dentry *stmmac_fs_dir;
 
@@ -3975,7 +3989,7 @@ static const struct net_device_ops stmmac_netdev_ops = {
 #ifdef CONFIG_NET_POLL_CONTROLLER
 	.ndo_poll_controller = stmmac_poll_controller,
 #endif
-	.ndo_set_mac_address = eth_mac_addr,
+	.ndo_set_mac_address = stmmac_set_mac_address,
 };
 
 /**
Signature · 1 line
2.7.4
Applied
#1 lore raw

From: Bhadram Varka <[email protected]>
Date: Fri, 27 Oct 2017 08:22:02 +0530

Quoted 5 lines

Currently stmmac driver not copying the valid ethernet MAC address to MAC registers. This patch takes care of updating the MAC register with MAC address.

Applied, thank you.