diff options
author | Antony Pavlov <antonynpavlov@gmail.com> | 2014-07-02 01:04:25 +0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-07-02 07:46:31 +0200 |
commit | 9b0c2e47ef551986b7b87b536d49bc866e88a570 (patch) | |
tree | efa9ece5d07ce171d8d17be6368024613018dfa8 | |
parent | 3746d5ebc625ff97940c6fdbb1f666a9d7b6c29a (diff) | |
download | barebox-9b0c2e47ef551986b7b87b536d49bc866e88a570.tar.gz barebox-9b0c2e47ef551986b7b87b536d49bc866e88a570.tar.xz |
mii-tool: make the 'No MII transceiver present!' message more clear
Suppose you have two network controllers.
The first one is ENC28J60 (it is in low power mode
after start) the second one is always-enabled eth1.
As ENC28J60 is in low power mode before enc28j60_eth_open()
is called. ENC28J60's mii traceiver is in low power mode too
so the mii traceiver's register are inaccessable.
Here is a sample log just after barebox start:
barebox:/ miitool
miibus0: registered phy as /dev/phy0
No MII transceiver present!.
miibus1: registered phy as /dev/phy1
phy1: eth1: negotiated 100baseTx-FD, link ok
barebox:/ miitool
No MII transceiver present!.
phy1: eth1: negotiated 100baseTx-FD, link ok
The 'No MII transceiver present!.' message is confusing here.
This patch fixes the problem so the miitool output
looks like this:
barebox:/ miitool
phy0: spieth0: No MII transceiver present!.
phy1: eth1: negotiated 100baseTx-FD, link ok
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | commands/miitool.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/commands/miitool.c b/commands/miitool.c index b08be9c683..3f205e93ea 100644 --- a/commands/miitool.c +++ b/commands/miitool.c @@ -115,14 +115,14 @@ static int show_basic_mii(struct mii_bus *mii, struct phy_device *phydev, for (i = 0; i < 32; i++) mii_val[i] = mii->read(mii, phydev->addr, i); + printf("%s: %s%d: ", phydev->cdev.name, + mii->parent->name, mii->parent->id); + if (mii_val[MII_BMCR] == 0xffff || mii_val[MII_BMSR] == 0x0000) { fprintf(stderr, " No MII transceiver present!.\n"); return -1; } - printf("%s: %s%d: ", phydev->cdev.name, - mii->parent->name, mii->parent->id); - /* Descriptive rename. */ bmcr = mii_val[MII_BMCR]; bmsr = mii_val[MII_BMSR]; |