不插网线终端缓慢的问题解决办法
- 2023-08-12 05:07:08
- 来源:互联网
- 在手机上看
扫一扫立即进入手机端
使用Smartarm3250 V1.00版源码,会出现不插入网线,终端会很缓慢的BUG,可以修改drivers/net/lpc32xx_mii.c文件的下面两个函数解决,将两个函数中的变量的lps的值改为5即可:
/*
* MAC<--->PHY support functions
*/
static int lpc32xx_mdio_read(struct mii_bus *bus, int phy_id, int phyreg)
{
struct netdata_local *pldat = bus->priv;
int lps;
u32 tmp;
__raw_writel(((phy_id << 8) | phyreg), ENET_MADR(pldat->net_base));
__raw_writel(MCMD_READ, ENET_MCMD(pldat->net_base));
/* Wait for unbusy status */
lps = 50; //改为5即可
tmp = __raw_readl(ENET_MIND(pldat->net_base));
while ((lps > 0) && (tmp & (MIND_BUSY | MIND_MII_LINK_FAIL)))
{
msleep(1);
tmp = __raw_readl(ENET_MIND(pldat->net_base));
lps--;
}
lps = (int) __raw_readl(ENET_MRDD(pldat->net_base));
__raw_writel(0, ENET_MCMD(pldat->net_base));
return lps;
}
static int lpc32xx_mdio_write(struct mii_bus *bus, int phy_id, int phyreg,
u16 phydata)
{
struct netdata_local *pldat = bus->priv;
int lps;
u32 tmp;
__raw_writel(((phy_id << 8) | phyreg), ENET_MADR(pldat->net_base));
__raw_writel(phydata, ENET_MWTD(pldat->net_base));
/* Wait for completion */
lps = 50; //改为5即可
tmp = __raw_readl(ENET_MIND(pldat->net_base));
while ((lps > 0) && (tmp & MIND_BUSY))
{
msleep(1);
tmp = __raw_readl(ENET_MIND(pldat->net_base));
lps--;
}
return 0;
}