- 论坛徽章:
- 0
|
int mii_link_ok (struct mii_if_info *mii)
{
/* first, a dummy read, needed to latch some MII phys */
mii->mdio_read(mii->dev, mii->phy_id, MII_BMSR);
if (mii->mdio_read(mii->dev, mii->phy_id, MII_BMSR) & BMSR_LSTATUS)
{
return 1;
pr_info("AAAAAA"); //自己添加的输出信息,为了检验程序是否运行到这里
}
return 0;
}
用ifconfig eth0 up命令时,并没有打印AAAAA的信息,所以mii_link_ok函数返回值为0,从而导致:
new_carrier = (unsigned int) mii_link_ok(mii);
/* no carrier, nothing much to do */
if (!new_carrier) {
netif_carrier_off(mii->dev);
if (ok_to_print)
printk(KERN_INFO "%s: link down\n", mii->dev->name);
return 0; /* duplex did not change */
}
打印信息:link down
开发板ping自己不通,ping主机也不通。
各路大侠,帮帮忙。 |
|