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>
This commit is contained in:
Christian Riesch
2012-07-13 05:26:31 +00:00
committed by David S. Miller
parent 607740bc16
commit 16626b0cc3
5 changed files with 437 additions and 3 deletions

View File

@@ -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;