724487e
.\"                                      Hey, EMACS: -*- nroff -*-
724487e
.\" $Revision: 1.1 $ $Date: 2003/09/06 17:20:17 $
724487e
.\" First parameter, NAME, should be all caps
724487e
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
724487e
.\" other parameters are allowed: see man(7), man(1)
63250dc
.TH MII-DIAG 8 "September 9, 2003" "Scyld Beowulf\[tm]"
724487e
.\" Please adjust this date whenever revising the manpage.
724487e
.\"
724487e
.\" Some roff macros, for reference:
724487e
.\" .nh        disable hyphenation
724487e
.\" .hy        enable hyphenation
724487e
.\" .ad l      left justify
724487e
.\" .ad b      justify to both left and right margins
724487e
.\" .nf        disable filling
724487e
.\" .fi        enable filling
724487e
.\" .br        insert line break
724487e
.\" .sp <n>    insert n+1 empty lines
724487e
.\" for manpage-specific macros, see man(7)
724487e
.SH NAME
724487e
mii-diag \- Network adapter control and monitoring
724487e
.SH SYNOPSIS
724487e
.B mii-diag
724487e
.RI [ options ] <interface>
724487e
.SH DESCRIPTION
724487e
This manual page documents briefly the
724487e
.B mii-diag
724487e
network adapter control and monitoring command.
724487e
Addition documentation is available from http://scyld.com/diag/index.html.
724487e
724487e
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
724487e
.\" \fI<whatever>\fP escape sequences to invoke bold face and italics, 
724487e
.\" respectively.
724487e
.PP
724487e
This \fBmii-diag\fP command configures, controls and monitors the
724487e
transceiver management registers for network interfaces, and configures
724487e
driver operational parameters.  For transceiver control \fBmii-diag\fP
724487e
uses the Media Independent Interface (MII) standard (thus the command name).
724487e
It also has additional Linux-specific controls to communicate parameters
724487e
such as message enable settings and buffer sizes to the underlying device
724487e
driver.
724487e
.PP
724487e
The MII standard defines registers that control and report network
724487e
transceiver capabilities, link settings and errors.  Examples are link
724487e
speed, duplex, capabilities advertised to the link partner, status LED
724487e
indications and link error counters.
724487e
724487e
.SH OPTIONS
724487e
The \fBmii-diag\fP command supports both single character and long
724487e
option names.  Short options use a single dash (´-´) in front of the option
724487e
character.  For options without parameters, multiple options may be
724487e
concatenated after a single dash.  Long options are prefixed by two
724487e
dashes (´--´), and may be abbreviated with a unique prefix.
724487e
A long option may take a parameter of the form --arg=param or --arg param.
724487e
724487e
.PP
724487e
A summary of options is as follows.
724487e
724487e
.TP
724487e
.B \-A, --advertise <speed|setting>
724487e
.BR
724487e
.B \-F, --fixed-speed <speed|setting>
724487e
724487e
Speed is one of: 100baseT4, 100baseTx, 100baseTx-FD, 100baseTx-HD, 10baseT,
724487e
10baseT-FD, 10baseT-HD.  For more precise control an explicit numeric
724487e
register setting is also allowed.
724487e
724487e
724487e
.TP
724487e
.B \-a, \--all-interfaces
724487e
Show the status of all interfaces.  This option is not recommended with
724487e
any other option, especially ones that change settings.
724487e
724487e
.TP
724487e
.B \-s,\--status
724487e
Return exit status 2 if there is no link beat.
724487e
724487e
.TP
724487e
.B \-D
724487e
Increase the debugging level.  This may be used to understand the
724487e
actions the command is taking.
724487e
724487e
.TP
724487e
.B \-g, \--read-parameters
724487e
Show driver-specific parameters.
724487e
724487e
.TP
724487e
.B \-G, \--set-parameters value[,value...]
724487e
Set driver-specific parameters.
724487e
Set a adapter-specific parameters.
724487e
Parameters are comma separated, with missing elements retaining the
724487e
existing value.
724487e
724487e
.TP
724487e
.B \-v
724487e
Increase the verbosity level.  Additional "-v" options increase the
724487e
level further.
724487e
724487e
.TP
724487e
.B \-V
724487e
Show the program version information.
724487e
724487e
.TP
724487e
.B \-w, \--watch
724487e
Continuously monitor the transceiver and report changes.
724487e
724487e
.TP
724487e
.B \-?
724487e
Emit usage information.
724487e
724487e
.SH DESCRIPTION
724487e
724487e
.PP
63250dc
Calling the command with just the interface name
63250dc
produces extensive output describing the transceiver
724487e
capabilities, configuration and current status.
724487e
724487e
.PP
724487e
The '--monitor' option allows scripting link beat changes.
724487e
.PP
724487e
This option is similar to --watch, but with lower overhead and simplified
724487e
output.  It polls the interface only once a second and the output format
724487e
is a single line per link change with three fixed words
724487e
  <unknown|down||negotiating|up> <STATUS> <PARTNER-CAP>
724487e
.PP
724487e
Example output:  mii-diag --monitor eth0
724487e
   down         0x7809 0x0000
724487e
   negotiating  0x7829 0x45e1
724487e
   up           0x782d 0x45e1
724487e
   down         0x7809 0x0000
724487e
724487e
.PP
724487e
This may be used as
724487e
  mii-diag --monitor eth0 |
724487e
    while read linkstatus bmsr linkpar; do
724487e
     case $linkstatus in
724487e
        up)   ifup eth0 ;;
724487e
        down) ifdown eth0 ;;
724487e
     esac
724487e
    done
724487e
724487e
.PP
724487e
It may be useful to shorten the DHCP client daemon timeout if it does
724487e
not receive an address by adding the following setting to
724487e
/etc/sysconfig/network:
724487e
DHCPCDARGS="-t 3"
724487e
724487e
.SH SEE ALSO
724487e
.BR ether-wake (8), net-diag (8), mii-tool (8).
724487e
.br
724487e
Addition documentation is available from http://scyld.com/diag/index.html.
724487e
724487e
.SH KNOWN BUGS
724487e
The --all-interfaces option is quirky.  There are very few settings that
724487e
are usefully applied to all interfaces.
724487e
724487e
.SH AUTHOR
724487e
The manual pages, diagnostic commands, and many of the underlying Linux
724487e
network drivers were written by Donald Becker for the Scyld
724487e
Beowulf(\*(Tm) cluster system.
724487e