1 --- a/drivers/net/ethernet/atheros/ar231x/ar231x.c
2 +++ b/drivers/net/ethernet/atheros/ar231x/ar231x.c
3 @@ -148,6 +148,7 @@ static int ar231x_mdiobus_write(struct m
4 static int ar231x_mdiobus_reset(struct mii_bus *bus);
5 static int ar231x_mdiobus_probe(struct net_device *dev);
6 static void ar231x_adjust_link(struct net_device *dev);
10 #define ERR(fmt, args...) printk("%s: " fmt, __func__, ##args)
11 @@ -180,6 +181,32 @@ static const struct net_device_ops ar231
15 +static int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id)
20 + * Grab the bits from PHYIR1, and put them
21 + * in the upper half.
23 + phy_reg = mdiobus_read(bus, addr, MII_PHYSID1);
28 + *phy_id = (phy_reg & 0xffff) << 16;
30 + /* Grab the bits from PHYIR2, and put them in the lower half */
31 + phy_reg = mdiobus_read(bus, addr, MII_PHYSID2);
36 + *phy_id |= (phy_reg & 0xffff);
41 int ar231x_probe(struct platform_device *pdev)
43 struct net_device *dev;
44 @@ -284,6 +311,23 @@ int ar231x_probe(struct platform_device
46 mdiobus_register(sp->mii_bus);
49 + * Workaround for Micrel switch, which is only available on
50 + * one PHY and cannot be configured through MDIO.
54 + get_phy_id(sp->mii_bus, 1, &phy_id);
55 + if (phy_id == 0x00221450)
60 + netif_carrier_on(dev);
65 if (ar231x_mdiobus_probe(dev) != 0) {
66 printk(KERN_ERR "%s: mdiobus_probe failed\n", dev->name);
67 rx_tasklet_cleanup(dev);
68 @@ -340,8 +384,10 @@ static int ar231x_remove(struct platform
69 rx_tasklet_cleanup(dev);
70 ar231x_init_cleanup(dev);
71 unregister_netdev(dev);
72 - mdiobus_unregister(sp->mii_bus);
73 - mdiobus_free(sp->mii_bus);
75 + mdiobus_unregister(sp->mii_bus);
76 + mdiobus_free(sp->mii_bus);
81 @@ -1100,6 +1146,9 @@ static int ar231x_ioctl(struct net_devic
82 struct ar231x_private *sp = netdev_priv(dev);
90 spin_lock_irq(&sp->lock);