[PATCH 2/3] mii-tool: Fix gigabit link test

Sascha Hauer s.hauer at pengutronix.de
Wed May 21 05:09:55 PDT 2014


media_list tests for gigabit phys like this:

if (mask & BMCR_SPEED1000)

mask does not contain the value of the BMCR register though, so the
test is completely bogus. Test for mask2 instead which is only
nonzero when the phy has gigabit capabilities.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 commands/miitool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commands/miitool.c b/commands/miitool.c
index 81b5a25..341506c 100644
--- a/commands/miitool.c
+++ b/commands/miitool.c
@@ -66,7 +66,7 @@ static const char *media_list(unsigned mask, unsigned mask2, int best)
 
 	*buf = '\0';
 
-	if (mask & BMCR_SPEED1000) {
+	if (mask2) {
 		if (mask2 & ADVERTISE_1000FULL) {
 			strcat(buf, " ");
 			strcat(buf, "1000baseT-FD");
-- 
2.0.0.rc0




More information about the barebox mailing list