Commit ad3620a0 authored by Ken Kawasaki's avatar Ken Kawasaki Committed by David S. Miller

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: default avatarKen Kawasaki <ken_kawasaki@spring.nifty.jp>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 57579f76
......@@ -339,7 +339,7 @@ static int axnet_config(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
axnet_dev_t *info = PRIV(dev);
int i, j, last_ret, last_fn;
int i, j, j2, last_ret, last_fn;
DEBUG(0, "axnet_config(0x%p)\n", link);
......@@ -388,6 +388,8 @@ static int axnet_config(struct pcmcia_device *link)
for (i = 0; i < 32; i++) {
j = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 1);
j2 = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 2);
if (j == j2) continue;
if ((j != 0) && (j != 0xffff)) break;
}
......@@ -398,6 +400,8 @@ static int axnet_config(struct pcmcia_device *link)
pcmcia_access_configuration_register(link, &reg);
for (i = 0; i < 32; i++) {
j = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 1);
j2 = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 2);
if (j == j2) continue;
if ((j != 0) && (j != 0xffff)) break;
}
}
......@@ -1767,6 +1771,9 @@ static void AX88190_init(struct net_device *dev, int startp)
ei_local->tx1 = ei_local->tx2 = 0;
ei_local->txing = 0;
if (info->flags & IS_AX88790) /* select Internal PHY */
outb(0x10, e8390_base + AXNET_GPIO);
if (startp)
{
outb_p(0xff, e8390_base + EN0_ISR);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment