summaryrefslogtreecommitdiff
path: root/drivers/net/usb/asix_common.c
diff options
context:
space:
mode:
authorChristian Riesch <christian.riesch@omicron.at>2012-07-13 05:26:31 +0000
committerDavid S. Miller <davem@davemloft.net>2012-07-16 23:26:23 -0700
commit16626b0cc3d5afe250850f96759b241f8a403b52 (patch)
tree97cb3cc00d2cebc7d59d6a56d253538d08c8fb02 /drivers/net/usb/asix_common.c
parent607740bc1605395c96b09416cdcc5e77c8976eed (diff)
asix: Add a new driver for the AX88172A
The Asix AX88172A is a USB 2.0 Ethernet interface that supports both an internal PHY as well as an external PHY (connected via MII). This patch adds a driver for the AX88172A and provides support for both modes and the phylib. Signed-off-by: Christian Riesch <christian.riesch@omicron.at> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/asix_common.c')
-rw-r--r--drivers/net/usb/asix_common.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/usb/asix_common.c b/drivers/net/usb/asix_common.c
index 3c1429a25ca4..336f75567091 100644
--- a/drivers/net/usb/asix_common.c
+++ b/drivers/net/usb/asix_common.c
@@ -258,8 +258,9 @@ int asix_set_hw_mii(struct usbnet *dev)
return ret;
}
-int asix_get_phy_addr(struct usbnet *dev)
+int asix_read_phy_addr(struct usbnet *dev, int internal)
{
+ int offset = (internal ? 1 : 0);
u8 buf[2];
int ret = asix_read_cmd(dev, AX_CMD_READ_PHY_ID, 0, 0, 2, buf);
@@ -271,12 +272,19 @@ int asix_get_phy_addr(struct usbnet *dev)
}
netdev_dbg(dev->net, "asix_get_phy_addr() returning 0x%04x\n",
*((__le16 *)buf));
- ret = buf[1];
+ ret = buf[offset];
out:
return ret;
}
+int asix_get_phy_addr(struct usbnet *dev)
+{
+ /* return the address of the internal phy */
+ return asix_read_phy_addr(dev, 1);
+}
+
+
int asix_sw_reset(struct usbnet *dev, u8 flags)
{
int ret;