1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-08 03:41:57 +02:00

implement ar2313_adjust_link

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10374 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd 2008-02-03 18:00:46 +00:00
parent dc192be569
commit 97ac24ed4b
2 changed files with 27 additions and 13 deletions

View File

@ -1293,7 +1293,22 @@ static struct net_device_stats *ar2313_get_stats(struct net_device *dev)
static void ar2313_adjust_link(struct net_device *dev) static void ar2313_adjust_link(struct net_device *dev)
{ {
printk(KERN_ERR " ar2313_adjust_link implementation missing\n"); struct ar2313_private *sp = dev->priv;
unsigned int mc;
if (!sp->phy_dev->link)
return;
if (sp->phy_dev->duplex != sp->oldduplex) {
mc = readl(&sp->eth_regs->mac_control);
mc &= ~(MAC_CONTROL_F | MAC_CONTROL_DRO);
if (sp->phy_dev->duplex)
mc |= MAC_CONTROL_F;
else
mc |= MAC_CONTROL_DRO;
writel(mc, &sp->eth_regs->mac_control);
sp->oldduplex = sp->phy_dev->duplex;
}
} }
#define MII_ADDR(phy, reg) \ #define MII_ADDR(phy, reg) \
@ -1377,9 +1392,7 @@ static int mdiobus_probe (struct net_device *dev)
phydev->advertising = phydev->supported; phydev->advertising = phydev->supported;
//sp->old_link = 0; sp->oldduplex = -1;
//sp->old_speed = 0;
//sp->old_duplex = -1;
sp->phy_dev = phydev; sp->phy_dev = phydev;
printk(KERN_INFO "%s: attached PHY driver [%s] " printk(KERN_INFO "%s: attached PHY driver [%s] "

View File

@ -164,6 +164,7 @@ struct ar2313_private {
struct phy_device *phy_dev; struct phy_device *phy_dev;
struct mii_bus mii_bus; struct mii_bus mii_bus;
int oldduplex;
}; };