diff options
author | Jussi Kivilinna <jussi.kivilinna@mbnet.fi> | 2012-01-10 01:40:17 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-01-10 17:59:48 -0500 |
commit | 8ef66bdc4bda6aac2dae73b84d79dc8c2db33637 (patch) | |
tree | a4a78ce0bbf4e7a320d10f1c80b80e93fc08a1ec /drivers | |
parent | 2193ceabdcde1fca5e017acf1d0023285531748f (diff) |
asix: fix setting custom MAC address on Asix 88772 devices
In kernel v3.2 initialization sequence for Asix 88772 devices was changed so
that hardware is reseted on every time interface is brought up (ifconfig up),
instead just at USB probe time. This causes problem with setting custom MAC
address to device as ax88772_reset causes reload of MAC address from EEPROM.
This patch fixes the issue by rewriting MAC address at end of ax88772_reset.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Acked-by: Grant Grundler <grundler@chromium.org>
Cc: Allan Chou <allan@asix.com.tw>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/usb/asix.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c index d0937c4634c9..8414bdc21235 100644 --- a/drivers/net/usb/asix.c +++ b/drivers/net/usb/asix.c | |||
@@ -978,6 +978,7 @@ static int ax88772_link_reset(struct usbnet *dev) | |||
978 | 978 | ||
979 | static int ax88772_reset(struct usbnet *dev) | 979 | static int ax88772_reset(struct usbnet *dev) |
980 | { | 980 | { |
981 | struct asix_data *data = (struct asix_data *)&dev->data; | ||
981 | int ret, embd_phy; | 982 | int ret, embd_phy; |
982 | u16 rx_ctl; | 983 | u16 rx_ctl; |
983 | 984 | ||
@@ -1055,6 +1056,13 @@ static int ax88772_reset(struct usbnet *dev) | |||
1055 | goto out; | 1056 | goto out; |
1056 | } | 1057 | } |
1057 | 1058 | ||
1059 | /* Rewrite MAC address */ | ||
1060 | memcpy(data->mac_addr, dev->net->dev_addr, ETH_ALEN); | ||
1061 | ret = asix_write_cmd(dev, AX_CMD_WRITE_NODE_ID, 0, 0, ETH_ALEN, | ||
1062 | data->mac_addr); | ||
1063 | if (ret < 0) | ||
1064 | goto out; | ||
1065 | |||
1058 | /* Set RX_CTL to default values with 2k buffer, and enable cactus */ | 1066 | /* Set RX_CTL to default values with 2k buffer, and enable cactus */ |
1059 | ret = asix_write_rx_ctl(dev, AX_DEFAULT_RX_CTL); | 1067 | ret = asix_write_rx_ctl(dev, AX_DEFAULT_RX_CTL); |
1060 | if (ret < 0) | 1068 | if (ret < 0) |