寻找网络链路速度确定算法[关闭](Looking for network link speed determination algorithm [closed])

编程入门 行业动态 更新时间:2024-10-22 23:29:55
寻找网络链路速度确定算法[关闭](Looking for network link speed determination algorithm [closed])

我正在寻找解释标准(以及标准)以太网PHY寄存器的最佳方式,以确定以太网链路实际运行的速度。 (例如10/100/1000和全/半双工)

我敢说,这是在像Linux这样的东西中找到的,我现在只是想看看那里,但如果任何人有一个很好的参考,我会感兴趣。

我感兴趣的是它是否真正联系起来以及联系什么,而不是每个端头一开始就宣传的巨大可能性。

I'm looking for the best way to interpret the standard (well, standardish) Ethernet PHY registers, to determine the speed that an Ethernet link is actually running at. (e.g. 10/100/1000 and full/half-duplex)

I daresay that this is to be found in the source of things like Linux, and I'm just off to look there now, but if anyone has a good reference I'd be interested.

What I'm interested in is if it actually linked and what it linked at, rather than the vast sea of possibilities that each end has advertised at the outset.

最满意答案

感谢你的回答。 它的目的是作为语言和平台不可知论的问题,因为几乎所有的MII / GMII以太网PHY都具有相同的基本寄存器。 我碰巧在一个嵌入式平台上。

但是通过查看各种Linux驱动程序源代码,我发现了一个适合我的受限应用程序的合理顺序 - 基本上是这样的:

检查基本状态(0x1)中的链接如果链接已通过,则检查协商 - 在基本状态(0x1)中完成如果协商已完成,则在1000M状态寄存器(0xa)中检查1G如果您尚未得到了1G,那么你有100M。 (这不是一般规则,但适用于此应用程序)

也许这真的是一个硬件问题,而不是软件问题......

Thanks for the answer. It's intended as a language and platform agnostic question, because pretty much all MII/GMII Ethernet PHYs have the same basic registers. I happen to be on an embedded platform.

But I found a sensible sequence which was good enough for my restricted application by looking at various bits of Linux driver source - it's basically:

Check for link-up in basic-status (0x1) If the link's up then check for negotiation-complete in basic status (0x1) If the negotiation's complete then check for 1G in the 1000M-status register (0xa) If you've not got 1G, then you've got 100M. (That's not a general rule, but it applies in this application)

Maybe this was really a hardware question rather than a software one...

更多推荐

本文发布于:2023-08-04 06:02:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1409376.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:算法   链路   速度   网络   network

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!