diff options
author | Ken Kawasaki <ken_kawasaki@spring.nifty.jp> | 2009-04-04 10:49:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-06 20:07:54 -0400 |
commit | ad3620a072bc1ba93b0146f6f5467ae928b449a6 (patch) | |
tree | 4fcde271fe0a8c55d31ca2eacff822bfd88c3e7c /drivers/net | |
parent | 57579f7629a3d46c307405fbd2ea6bdb650d692f (diff) |
axnet_cs: fix phy_id detection for bogus Asix chip.
axnet_cs:
(1) Some Asix phy return bogus value except 0 or 0xffff.
Skip this phy_id.
(2) Some Asix chip need to set "select Internal PHY" bit
at AX88190_init.
Signed-off-by: Ken Kawasaki <ken_kawasaki@spring.nifty.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/pcmcia/axnet_cs.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 501a8d7ac2be..15b8fe61695b 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -339,7 +339,7 @@ static int axnet_config(struct pcmcia_device *link) | |||
339 | { | 339 | { |
340 | struct net_device *dev = link->priv; | 340 | struct net_device *dev = link->priv; |
341 | axnet_dev_t *info = PRIV(dev); | 341 | axnet_dev_t *info = PRIV(dev); |
342 | int i, j, last_ret, last_fn; | 342 | int i, j, j2, last_ret, last_fn; |
343 | 343 | ||
344 | DEBUG(0, "axnet_config(0x%p)\n", link); | 344 | DEBUG(0, "axnet_config(0x%p)\n", link); |
345 | 345 | ||
@@ -388,6 +388,8 @@ static int axnet_config(struct pcmcia_device *link) | |||
388 | 388 | ||
389 | for (i = 0; i < 32; i++) { | 389 | for (i = 0; i < 32; i++) { |
390 | j = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 1); | 390 | j = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 1); |
391 | j2 = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 2); | ||
392 | if (j == j2) continue; | ||
391 | if ((j != 0) && (j != 0xffff)) break; | 393 | if ((j != 0) && (j != 0xffff)) break; |
392 | } | 394 | } |
393 | 395 | ||
@@ -398,6 +400,8 @@ static int axnet_config(struct pcmcia_device *link) | |||
398 | pcmcia_access_configuration_register(link, ®); | 400 | pcmcia_access_configuration_register(link, ®); |
399 | for (i = 0; i < 32; i++) { | 401 | for (i = 0; i < 32; i++) { |
400 | j = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 1); | 402 | j = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 1); |
403 | j2 = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 2); | ||
404 | if (j == j2) continue; | ||
401 | if ((j != 0) && (j != 0xffff)) break; | 405 | if ((j != 0) && (j != 0xffff)) break; |
402 | } | 406 | } |
403 | } | 407 | } |
@@ -1767,6 +1771,9 @@ static void AX88190_init(struct net_device *dev, int startp) | |||
1767 | ei_local->tx1 = ei_local->tx2 = 0; | 1771 | ei_local->tx1 = ei_local->tx2 = 0; |
1768 | ei_local->txing = 0; | 1772 | ei_local->txing = 0; |
1769 | 1773 | ||
1774 | if (info->flags & IS_AX88790) /* select Internal PHY */ | ||
1775 | outb(0x10, e8390_base + AXNET_GPIO); | ||
1776 | |||
1770 | if (startp) | 1777 | if (startp) |
1771 | { | 1778 | { |
1772 | outb_p(0xff, e8390_base + EN0_ISR); | 1779 | outb_p(0xff, e8390_base + EN0_ISR); |