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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux