Blob Blame History Raw
From 1635520aefc1056604ad60d042a64f43898c7108 Mon Sep 17 00:00:00 2001
From: Peter Fink <pfink@christ-es.de>
Date: Thu, 10 Oct 2019 15:00:22 +0200
Subject: [PATCH] net: usb: ax88179_178a: write mac to hardware in get_mac_addr
Git-commit: 1635520aefc1056604ad60d042a64f43898c7108
References: git-fixes
Patch-mainline: v5.5-rc1

When the MAC address is supplied via device tree or a random
MAC is generated it has to be written to the asix chip in
order to receive any data.

Previously in 9fb137aef34e ("net: usb: ax88179_178a: allow
optionally getting mac address from device tree") this line was
omitted because it seemed to work perfectly fine without it.

But it was simply not detected because the chip keeps the mac
stored even beyond a reset and it was tested on a hardware
with an integrated UPS where the asix chip was permanently
powered on even throughout power cycles.

Fixes: 9fb137aef34e ("net: usb: ax88179_178a: allow optionally getting mac address from device tree")
Signed-off-by: Peter Fink <pfink@christ-es.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/net/usb/ax88179_178a.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/net/usb/ax88179_178a.c
+++ b/drivers/net/usb/ax88179_178a.c
@@ -347,6 +347,9 @@ static void ax88179_status(struct usbnet
 		usbnet_link_change(dev, link, 1);
 		netdev_info(dev->net, "ax88179 - Link status is: %d\n", link);
 	}
+
+	ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_NODE_ID, ETH_ALEN, ETH_ALEN,
+			  dev->net->dev_addr);
 }
 
 static int ax88179_mdio_read(struct net_device *netdev, int phy_id, int loc)