Skip to contentSkip to conversation

net: write enetaddr down to hardware on env_callback

PATCH New Marek Vasut 3 participants 3 messages Nov 12, 2016 – Nov 15, 2016 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: write enetaddr down to hardware on env_callback

If mac-address is changed using "setenv ethaddr ...." command the new mac-adress also must be written into the responsible ethernet driver. This fixes the legacy ethernet handling.

Cc Hannes Schmelzer <[email protected]>
Cc Joe Hershberger <[email protected]>
Cc Tom Rini <[email protected]>
---
 net/eth_legacy.c | 1 +
 1 file changed, 1 insertion(+)
net/eth_legacy.c +1 -0
index d6d7cee..1354f49 100644
@@ -118,6 +118,7 @@ static int on_ethaddr(const char *name, const char *value, enum env_op op,
 			case env_op_create:
 			case env_op_overwrite:
 				eth_parse_enetaddr(value, dev->enetaddr);
+				eth_write_hwaddr(dev, "eth", dev->index);
 				break;
 			case env_op_delete:
 				memset(dev->enetaddr, 0, 6);
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/1 net: write enetaddr down to hardware on env_callback

Quoted 17 lines · Marek Vasut

If mac-address is changed using "setenv ethaddr ...." command the new mac-adress also must be written into the responsible ethernet driver. This fixes the legacy ethernet handling.

Cc Hannes Schmelzer <[email protected]>
Cc Joe Hershberger <[email protected]>
Cc Tom Rini <[email protected]>
---
  net/eth_legacy.c | 1 +
  1 file changed, 1 insertion(+)
net/eth_legacy.c +0 -0
index d6d7cee..1354f49 100644

net/eth_legacy.c static int on_ethaddr(const char *name, const char *value, enum env_op op, · line 124

Quoted 7 lines
net/eth_legacy.c +1 -0
@@ -118,6 +118,7 @@ static int on_ethaddr(const char *name, const char *value, enum env_op op,
  			case env_op_create:
  			case env_op_overwrite:
  				eth_parse_enetaddr(value, dev->enetaddr);
+				eth_write_hwaddr(dev, "eth", dev->index);
  				break;
  			case env_op_delete:
  				memset(dev->enetaddr, 0, 6);
#2 lore raw

PATCH 1/1 net: write enetaddr down to hardware on env_callback

In reply to Marek Vasut
Quoted 8 lines · Marek Vasut

If mac-address is changed using "setenv ethaddr ...." command the new mac-adress also must be written into the responsible ethernet driver. This fixes the legacy ethernet handling.

Cc Hannes Schmelzer <[email protected]>
Cc Joe Hershberger <[email protected]>
Cc Tom Rini <[email protected]>