diff options
author | Wolfgang Denk <wd@pollux.(none)> | 2005-09-24 21:54:50 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@pollux.(none)> | 2005-09-24 21:54:50 +0200 |
commit | 2b792afcc517dcca14c898d3ce444c2bbb7be31a (patch) | |
tree | c689842d41c91bff6054245e0211f18b5c095528 /common/cmd_mii.c | |
parent | 9ea4b5886a3aa18bae73d0b6b311f7b93e762faa (diff) | |
download | u-boot-imx-2b792afcc517dcca14c898d3ce444c2bbb7be31a.zip u-boot-imx-2b792afcc517dcca14c898d3ce444c2bbb7be31a.tar.gz u-boot-imx-2b792afcc517dcca14c898d3ce444c2bbb7be31a.tar.bz2 |
* Fix PHY address argument passing with mii info command
Patch by Andrew Dyer, 28 Dec 2004
* Cleanup: fix broken builds
Diffstat (limited to 'common/cmd_mii.c')
-rw-r--r-- | common/cmd_mii.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/common/cmd_mii.c b/common/cmd_mii.c index 3d260ab..722b9f0 100644 --- a/common/cmd_mii.c +++ b/common/cmd_mii.c @@ -414,7 +414,7 @@ int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) { char op; unsigned char addrlo, addrhi, reglo, reghi; - unsigned char addr = 0, reg = 0; + unsigned char addr, reg; unsigned short data; int rcode = 0; @@ -456,12 +456,12 @@ int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) * Look for any and all PHYs. Valid addresses are 0..31. */ if (argc >= 3) { - start = addr; end = addr + 1; + start = addrlo; end = addrhi; } else { - start = 0; end = 32; + start = 0; end = 31; } - for (j = start; j < end; j++) { + for (j = start; j <= end; j++) { if (miiphy_info (j, &oui, &model, &rev) == 0) { printf("PHY 0x%02X: " "OUI = 0x%04X, " @@ -482,8 +482,7 @@ int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) "Error reading from the PHY addr=%02x reg=%02x\n", addr, reg); rcode = 1; - } - else { + } else { if ((addrlo != addrhi) || (reglo != reghi)) printf("addr=%02x reg=%02x data=", (uint)addr, (uint)reg); |