aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Morgan <imorgan@primordial.ca>2014-10-19 08:05:13 -0400
committerDavid S. Miller <davem@davemloft.net>2014-10-20 00:53:30 -0400
commit95ff88688781db2f64042e69bd499e518bbb36e5 (patch)
treeb132972a999b50609a5de26b6384891fb2e5d16b
parent61ed53deb1c6a4386d8710dbbfcee8779c381931 (diff)
ax88179_178a: fix bonding failure
The following patch fixes a bug which causes the ax88179_178a driver to be incapable of being added to a bond. When I brought up the issue with the bonding maintainers, they indicated that the real problem was with the NIC driver which must return zero for success (of setting the MAC address). I see that several other NIC drivers follow that pattern by either simply always returing zero, or by passing through a negative (error) result while rewriting any positive return code to zero. With that same philisophy applied to the ax88179_178a driver, it allows it to work correctly with the bonding driver. I believe this is suitable for queuing in -stable, as it's a small, simple, and obvious fix that corrects a defect with no other known workaround. This patch is against vanilla 3.17(.0). Signed-off-by: Ian Morgan <imorgan@primordial.ca> drivers/net/usb/ax88179_178a.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/usb/ax88179_178a.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c
index be4275721039..e6338c16081a 100644
--- a/drivers/net/usb/ax88179_178a.c
+++ b/drivers/net/usb/ax88179_178a.c
@@ -937,6 +937,7 @@ static int ax88179_set_mac_addr(struct net_device *net, void *p)
937{ 937{
938 struct usbnet *dev = netdev_priv(net); 938 struct usbnet *dev = netdev_priv(net);
939 struct sockaddr *addr = p; 939 struct sockaddr *addr = p;
940 int ret;
940 941
941 if (netif_running(net)) 942 if (netif_running(net))
942 return -EBUSY; 943 return -EBUSY;
@@ -946,8 +947,12 @@ static int ax88179_set_mac_addr(struct net_device *net, void *p)
946 memcpy(net->dev_addr, addr->sa_data, ETH_ALEN); 947 memcpy(net->dev_addr, addr->sa_data, ETH_ALEN);
947 948
948 /* Set the MAC address */ 949 /* Set the MAC address */
949 return ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_NODE_ID, ETH_ALEN, 950 ret = ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_NODE_ID, ETH_ALEN,
950 ETH_ALEN, net->dev_addr); 951 ETH_ALEN, net->dev_addr);
952 if (ret < 0)
953 return ret;
954
955 return 0;
951} 956}
952 957
953static const struct net_device_ops ax88179_netdev_ops = { 958static const struct net_device_ops ax88179_netdev_ops = {