* [PATCH] mii-tool: make the 'No MII transceiver present!' message more clear
@ 2014-07-01 21:04 Antony Pavlov
2014-07-02 5:46 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Antony Pavlov @ 2014-07-01 21:04 UTC (permalink / raw)
To: barebox
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>
---
commands/miitool.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/commands/miitool.c b/commands/miitool.c
index 40e34e9..c62e758 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];
--
2.0.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mii-tool: make the 'No MII transceiver present!' message more clear
2014-07-01 21:04 [PATCH] mii-tool: make the 'No MII transceiver present!' message more clear Antony Pavlov
@ 2014-07-02 5:46 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2014-07-02 5:46 UTC (permalink / raw)
To: Antony Pavlov; +Cc: barebox
On Wed, Jul 02, 2014 at 01:04:25AM +0400, Antony Pavlov wrote:
> 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>
> ---
Applied, thanks
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-02 5:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-01 21:04 [PATCH] mii-tool: make the 'No MII transceiver present!' message more clear Antony Pavlov
2014-07-02 5:46 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox