summaryrefslogtreecommitdiff
path: root/packages/net-tools/files/mii-diag.8
blob: aa0dc0be15f02bbae4435e317bd19031b14a86c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
.\"                                      Hey, EMACS: -*- nroff -*-
.\" $Revision: 1.1 $ $Date: 2003/09/06 17:20:17 $
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH MII-DIAG 8 "September 9, 2003" "Scyld Beowulf\*(Tm"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh        disable hyphenation
.\" .hy        enable hyphenation
.\" .ad l      left justify
.\" .ad b      justify to both left and right margins
.\" .nf        disable filling
.\" .fi        enable filling
.\" .br        insert line break
.\" .sp <n>    insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
mii-diag \- Network adapter control and monitoring
.SH SYNOPSIS
.B mii-diag
.RI [ options ] <interface>
.SH DESCRIPTION
This manual page documents briefly the
.B mii-diag
network adapter control and monitoring command.
Addition documentation is available from http://scyld.com/diag/index.html.

.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invoke bold face and italics, 
.\" respectively.
.PP
This \fBmii-diag\fP command configures, controls and monitors the
transceiver management registers for network interfaces, and configures
driver operational parameters.  For transceiver control \fBmii-diag\fP
uses the Media Independent Interface (MII) standard (thus the command name).
It also has additional Linux-specific controls to communicate parameters
such as message enable settings and buffer sizes to the underlying device
driver.
.PP
The MII standard defines registers that control and report network
transceiver capabilities, link settings and errors.  Examples are link
speed, duplex, capabilities advertised to the link partner, status LED
indications and link error counters.

.SH OPTIONS
The \fBmii-diag\fP command supports both single character and long
option names.  Short options use a single dash (´-´) in front of the option
character.  For options without parameters, multiple options may be
concatenated after a single dash.  Long options are prefixed by two
dashes (´--´), and may be abbreviated with a unique prefix.
A long option may take a parameter of the form --arg=param or --arg param.

.PP
A summary of options is as follows.

.TP
.B \-A, --advertise <speed|setting>
.BR
.B \-F, --fixed-speed <speed|setting>

Speed is one of: 100baseT4, 100baseTx, 100baseTx-FD, 100baseTx-HD, 10baseT,
10baseT-FD, 10baseT-HD.  For more precise control an explict numeric
register setting is also allowed.


.TP
.B \-a, \--all-interfaces
Show the status of all interfaces.  This option is not recommended with
any other option, especially ones that change settings.

.TP
.B \-s,\--status
Return exit status 2 if there is no link beat.

.TP
.B \-D
Increase the debugging level.  This may be used to understand the
actions the command is taking.

.TP
.B \-g, \--read-parameters
Show driver-specific parameters.

.TP
.B \-G, \--set-parameters value[,value...]
Set driver-specific parameters.
Set a adapter-specific parameters.
Parameters are comma separated, with missing elements retaining the
existing value.

.TP
.B \-v
Increase the verbosity level.  Additional "-v" options increase the
level further.

.TP
.B \-V
Show the program version information.

.TP
.B \-w, \--watch
Continuously monitor the transceiver and report changes.

.TP
.B \-?
Emit usage information.

.SH DESCRIPTION

.PP
Calling the command with just the interface name (which defaults to
'eth0' if missing) produces extensive output describing the transceiver
capabilities, configuration and current status.

.PP
The '--monitor' option allows scripting link beat changes.
.PP
This option is similar to --watch, but with lower overhead and simplifed
output.  It polls the interface only once a second and the output format
is a single line per link change with three fixed words
  <unknown|down||negotiating|up> <STATUS> <PARTNER-CAP>
.PP
Example output:  mii-diag --monitor eth0
   down         0x7809 0x0000
   negotiating  0x7829 0x45e1
   up           0x782d 0x45e1
   down         0x7809 0x0000

.PP
This may be used as
  mii-diag --monitor eth0 |
    while read linkstatus bmsr linkpar; do
     case $linkstatus in
        up)   ifup eth0 ;;
        down) ifdown eth0 ;;
     esac
    done

.PP
It may be useful to shorten the DHCP client daemon timeout if it does
not receive an address by adding the following setting to
/etc/sysconfig/network:
DHCPCDARGS="-t 3"

.SH SEE ALSO
.BR ether-wake (8), net-diag (8), mii-tool (8).
.br
Addition documentation is available from http://scyld.com/diag/index.html.

.SH KNOWN BUGS
The --all-interfaces option is quirky.  There are very few settings that
are usefully applied to all interfaces.

.SH AUTHOR
The manual pages, diagnostic commands, and many of the underlying Linux
network drivers were written by Donald Becker for the Scyld
Beowulf(\*(Tm) cluster system.