netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Fink <pedro@pixelbox.red>
To: netdev@vger.kernel.org
Cc: pfink@christ-es.de, davem@davemloft.net
Subject: [PATCH net-next] net: usb: ax88179_178a: write mac to hardware in get_mac_addr
Date: Wed,  9 Oct 2019 16:15:49 +0200	[thread overview]
Message-ID: <1570630549-23976-1-git-send-email-pedro@pixelbox.red> (raw)

From: Peter Fink <pfink@christ-es.de>

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.

In the previous commit (9fb137a) 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.

Signed-off-by: Peter Fink <pfink@christ-es.de>
---
 drivers/net/usb/ax88179_178a.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c
index 5a58766..c5a6e75 100644
--- a/drivers/net/usb/ax88179_178a.c
+++ b/drivers/net/usb/ax88179_178a.c
@@ -1235,6 +1235,9 @@ static void ax88179_get_mac_addr(struct usbnet *dev)
 		netdev_info(dev->net, "invalid MAC address, using random\n");
 		eth_hw_addr_random(dev->net);
 	}
+
+	ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_NODE_ID, ETH_ALEN, ETH_ALEN,
+			  dev->net->dev_addr);
 }
 
 static int ax88179_bind(struct usbnet *dev, struct usb_interface *intf)
-- 
2.7.4


             reply	other threads:[~2019-10-09 14:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-09 14:15 Peter Fink [this message]
2019-10-10 10:38 ` [PATCH net-next] net: usb: ax88179_178a: write mac to hardware in get_mac_addr Sergei Shtylyov
2019-10-10 12:11   ` Peter Fink

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1570630549-23976-1-git-send-email-pedro@pixelbox.red \
    --to=pedro@pixelbox.red \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=pfink@christ-es.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).