Red Point

十年饮冰 , 热血难凉 ; 山高万仞 , 只登一步

  博客园 :: 首页 :: 博问 :: 闪存 :: :: :: :: 管理 ::

https://gaomf.cn/2016/06/26/U-Boot%20DM9000%E7%BD%91%E5%8D%A1%E9%A9%B1%E5%8A%A8%E6%8F%90%E7%A4%BAcould%20not%20establish%20link%E7%9A%84%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95/

使用默认的DM9000网卡驱动进行网络操作时,好像都会提示”could not establish link”,而且感觉因此造成的延迟还很严重。在网上搜索了一下,解决方法是屏蔽dm9000x.c文件中下面这段代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
static int dm9000_init(struct eth_device *dev, bd_t *bd)
{
// 不做修改

#if 0
// 屏蔽掉这段代码
i = 0;
while (!(dm9000_phy_read(1) & 0x20)) { /* autonegation complete bit */
udelay(1000);
i++;
if (i == 10000) {
printf("could not establish link\n");
return 0;
}
}
#endif

// 不做修改
}

这样完全可以正常工作,不仅不会提示”could not establish link”,而且响应速度也得到了很大的提升。不过这段代码的作用究竟是什么还不清楚,将来有空了可以来仔细研究下。

posted on 2021-04-30 21:44  Red_Point  阅读(609)  评论(0)    收藏  举报