diff options
author | Christian Riesch <christian.riesch@omicron.at> | 2012-07-13 01:26:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-17 02:26:23 -0400 |
commit | 16626b0cc3d5afe250850f96759b241f8a403b52 (patch) | |
tree | 97cb3cc00d2cebc7d59d6a56d253538d08c8fb02 /drivers/net/usb/asix_common.c | |
parent | 607740bc1605395c96b09416cdcc5e77c8976eed (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.c | 12 |
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) | |||
258 | return ret; | 258 | return ret; |
259 | } | 259 | } |
260 | 260 | ||
261 | int asix_get_phy_addr(struct usbnet *dev) | 261 | int asix_read_phy_addr(struct usbnet *dev, int internal) |
262 | { | 262 | { |
263 | int offset = (internal ? 1 : 0); | ||
263 | u8 buf[2]; | 264 | u8 buf[2]; |
264 | int ret = asix_read_cmd(dev, AX_CMD_READ_PHY_ID, 0, 0, 2, buf); | 265 | int ret = asix_read_cmd(dev, AX_CMD_READ_PHY_ID, 0, 0, 2, buf); |
265 | 266 | ||
@@ -271,12 +272,19 @@ int asix_get_phy_addr(struct usbnet *dev) | |||
271 | } | 272 | } |
272 | netdev_dbg(dev->net, "asix_get_phy_addr() returning 0x%04x\n", | 273 | netdev_dbg(dev->net, "asix_get_phy_addr() returning 0x%04x\n", |
273 | *((__le16 *)buf)); | 274 | *((__le16 *)buf)); |
274 | ret = buf[1]; | 275 | ret = buf[offset]; |
275 | 276 | ||
276 | out: | 277 | out: |
277 | return ret; | 278 | return ret; |
278 | } | 279 | } |
279 | 280 | ||
281 | int asix_get_phy_addr(struct usbnet *dev) | ||
282 | { | ||
283 | /* return the address of the internal phy */ | ||
284 | return asix_read_phy_addr(dev, 1); | ||
285 | } | ||
286 | |||
287 | |||
280 | int asix_sw_reset(struct usbnet *dev, u8 flags) | 288 | int asix_sw_reset(struct usbnet *dev, u8 flags) |
281 | { | 289 | { |
282 | int ret; | 290 | int ret; |