From 16626b0cc3d5afe250850f96759b241f8a403b52 Mon Sep 17 00:00:00 2001 From: Christian Riesch Date: Fri, 13 Jul 2012 05:26:31 +0000 Subject: 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 Signed-off-by: David S. Miller --- drivers/net/usb/asix_common.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'drivers/net/usb/asix_common.c') 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; -- cgit v1.2.1