[RFC v2] add 'miitool' command to view media-independent interface status

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Sun Oct 14 16:43:40 EDT 2012


On 21:12 Sun 14 Oct     , Antony Pavlov wrote:
>  On 14 October 2012 18:11, Jean-Christophe PLAGNIOL-VILLARD>
> <plagnioj at jcrosoft.com> wrote:
> >> On 18:09 Wed 10 Oct     , Antony Pavlov wrote:
> >> This command is based on "mii-diag" and "mii-tool" programs.
> >>
> >> TODO:
> >>  * add GbE support (see http://ftp.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz);
> >>  * add routines to manipulate media-independent interface state.
> >>
> >> EXAMPLES:
> >>
> >> barebox:/ miitool /dev/phy0
> >> negotiated 100baseTx-FD, link ok
> >>
> >> barebox:/ miitool -v /dev/phy0
> >> negotiated 100baseTx-FD, link ok
> >>   product info: Level One LXT971A rev 2
> >>   basic mode:   autonegotiation enabled
> >>   basic status: autonegotiation complete, link ok
> >>   capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
> >>   advertising:  100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
> >>   link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
> >>
> >> barebox:/ miitool -vv /dev/phy0
> >> negotiated 100baseTx-FD, link ok
> >>   registers for MII PHY:
> >>     3100 782d 0013 78e2 01e1 45e1 0007 2001
> >>     0000 ffff ffff ffff ffff ffff ffff ffff
> >>     0084 4780 0000 0000 0422 0000 0000 0000
> >>     0000 0000 0080 0000 ffff 0000 0000 3660
> >>   product info: Level One LXT971A rev 2
> >>   basic mode:   autonegotiation enabled
> >>   basic status: autonegotiation complete, link ok
> >>   capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
> >>   advertising:  100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
> >>   link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
> >>
> >> Signed-off-by: Antony Pavlov <antonynpavlov at gmail.com>
> >> ---
> >>  commands/Kconfig   |   11 +++
> >>  commands/Makefile  |    1 +
> >>  commands/miitool.c |  268 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> >>  3 files changed, 280 insertions(+)
> >>  create mode 100644 commands/miitool.c
> >>
> >> diff --git a/commands/Kconfig b/commands/Kconfig
> >> index e934f29..c8cdd54 100644
> >> --- a/commands/Kconfig
> >> +++ b/commands/Kconfig
> >> @@ -620,6 +620,17 @@ config CMD_USB
> >>       help
> >>         The usb command allows to rescan for USB devices.
> >>
> >> +config CMD_MIITOOL
> >> +     bool
> >> +     prompt "miitool command"
> >> +     depends on NET
> > phylib
> 
>  It seems that miitool does not depends on PHYLIB because it uses
>  abstract file access for reading thranceiver's registers. Moreover it
>  does not really depends on NET.
>  On the other hand the situation can be changed in the future.

the issue is that you expect a phy which as phylib only

Best Regards,
J.



More information about the barebox mailing list