Skip to content

Commit

Permalink
net: usb: ax88179_178a: avoid the interface always configured as rand…
Browse files Browse the repository at this point in the history
…om address

After the commit d2689b6 ("net: usb: ax88179_178a: avoid two
consecutive device resets"), reset is not executed from bind operation and
mac address is not read from the device registers or the devicetree at that
moment. Since the check to configure if the assigned mac address is random
or not for the interface, happens after the bind operation from
usbnet_probe, the interface keeps configured as random address, although the
address is correctly read and set during open operation (the only reset
now).

In order to keep only one reset for the device and to avoid the interface
always configured as random address, after reset, configure correctly the
suitable field from the driver, if the mac address is read successfully from
the device registers or the devicetree.

cc: [email protected] # 6.6+
Fixes: d2689b6 ("net: usb: ax88179_178a: avoid two consecutive device resets")
Reported-by: Dave Stevenson  <[email protected]>
Signed-off-by: Jose Ignacio Tornos Martinez <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Signed-off-by: NipaLocal <nipa@local>
  • Loading branch information
jtornosm authored and NipaLocal committed Apr 2, 2024
1 parent 772a21a commit d33518c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/usb/ax88179_178a.c
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,7 @@ static void ax88179_get_mac_addr(struct usbnet *dev)

if (is_valid_ether_addr(mac)) {
eth_hw_addr_set(dev->net, mac);
dev->net->addr_assign_type = NET_ADDR_PERM;
} else {
netdev_info(dev->net, "invalid MAC address, using random\n");
eth_hw_addr_random(dev->net);
Expand Down

0 comments on commit d33518c

Please sign in to comment.