|
|
3ecd878 |
diff -up net-tools-1.60/man/en_US/mii-tool.8.arbitrary-device-names net-tools-1.60/man/en_US/mii-tool.8
|
|
|
3ecd878 |
--- net-tools-1.60/man/en_US/mii-tool.8.arbitrary-device-names 2011-03-07 16:41:22.000000000 +0100
|
|
|
3ecd878 |
+++ net-tools-1.60/man/en_US/mii-tool.8 2011-03-07 16:41:22.000000000 +0100
|
|
|
3ecd878 |
@@ -16,7 +16,7 @@ mii-tool \- view, manipulate media-indep
|
|
|
3ecd878 |
[\fB\-l\fR, \fB\-\-log\fR]
|
|
|
3ecd878 |
[\fB\-A\fR, \fB\-\-advertise=\fImedia,...\fR]
|
|
|
3ecd878 |
[\fB\-F\fR, \fB\-\-force=\fImedia\fR]
|
|
|
3ecd878 |
-.RI [ "interface\ ..." ]
|
|
|
3ecd878 |
+.RI "interface\ ..."
|
|
|
3ecd878 |
|
|
|
3ecd878 |
.SH NOTE
|
|
|
3ecd878 |
.P
|
|
|
3ecd878 |
@@ -42,9 +42,7 @@ one mode, instead of autonegotiating. T
|
|
|
3ecd878 |
options are mutually exclusive.
|
|
|
3ecd878 |
.PP
|
|
|
3ecd878 |
The default short output reports the negotiated link speed and link
|
|
|
3ecd878 |
-status for each interface. If an interface or interfaces are not
|
|
|
3ecd878 |
-specified on the command line, then \fBmii-tool\fR will check any
|
|
|
3ecd878 |
-available interfaces from \fBeth0\fR through \fBeth7\fR.
|
|
|
3ecd878 |
+status for each interface.
|
|
|
3ecd878 |
.SH OPTIONS
|
|
|
3ecd878 |
.TP
|
|
|
3ecd878 |
\fB\-v\fR, \fB\-\-verbose\fR
|
|
|
3ecd878 |
diff -up net-tools-1.60/mii-tool.c.arbitrary-device-names net-tools-1.60/mii-tool.c
|
|
|
3ecd878 |
--- net-tools-1.60/mii-tool.c.arbitrary-device-names 2011-03-07 16:41:22.000000000 +0100
|
|
|
3ecd878 |
+++ net-tools-1.60/mii-tool.c 2011-03-07 16:44:52.000000000 +0100
|
|
|
3ecd878 |
@@ -419,7 +419,7 @@ static void watch_one_xcvr(int skfd, cha
|
|
|
3ecd878 |
/*--------------------------------------------------------------------*/
|
|
|
3ecd878 |
|
|
|
3ecd878 |
const char *usage = "\
|
|
|
3ecd878 |
-usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...]\n\
|
|
|
3ecd878 |
+usage: %s [-VvRrwl] [-A media,... | -F media] <interface> ...\n\
|
|
|
3ecd878 |
-V, --version display version information\n\
|
|
|
3ecd878 |
-v, --verbose more verbose output\n\
|
|
|
3ecd878 |
-R, --reset reset MII to poweron state\n\
|
|
|
3ecd878 |
@@ -474,13 +474,10 @@ int main(int argc, char **argv)
|
|
|
3ecd878 |
|
|
|
3ecd878 |
/* No remaining args means show all interfaces. */
|
|
|
3ecd878 |
if (optind == argc) {
|
|
|
3ecd878 |
- ret = 1;
|
|
|
3ecd878 |
- for (i = 0; i < MAX_ETH; i++) {
|
|
|
3ecd878 |
- sprintf(s, "eth%d", i);
|
|
|
3ecd878 |
- ret &= do_one_xcvr(skfd, s, 1);
|
|
|
3ecd878 |
- }
|
|
|
3ecd878 |
- if (ret)
|
|
|
3ecd878 |
- fprintf(stderr, "no MII interfaces found\n");
|
|
|
3ecd878 |
+ fprintf(stderr, "No interface specified\n");
|
|
|
3ecd878 |
+ fprintf(stderr, usage, argv[0]);
|
|
|
3ecd878 |
+ close(skfd);
|
|
|
3ecd878 |
+ return 2;
|
|
|
3ecd878 |
} else {
|
|
|
3ecd878 |
ret = 0;
|
|
|
3ecd878 |
for (i = optind; i < argc; i++) {
|
|
|
3ecd878 |
@@ -491,15 +488,8 @@ int main(int argc, char **argv)
|
|
|
3ecd878 |
if (opt_watch && (ret == 0)) {
|
|
|
3ecd878 |
while (1) {
|
|
|
3ecd878 |
sleep(1);
|
|
|
3ecd878 |
- if (optind == argc) {
|
|
|
3ecd878 |
- for (i = 0; i < MAX_ETH; i++) {
|
|
|
3ecd878 |
- sprintf(s, "eth%d", i);
|
|
|
3ecd878 |
- watch_one_xcvr(skfd, s, i);
|
|
|
3ecd878 |
- }
|
|
|
3ecd878 |
- } else {
|
|
|
3ecd878 |
- for (i = optind; i < argc; i++)
|
|
|
3ecd878 |
+ for (i = optind; i < argc; i++)
|
|
|
3ecd878 |
watch_one_xcvr(skfd, argv[i], i-optind);
|
|
|
3ecd878 |
- }
|
|
|
3ecd878 |
}
|
|
|
3ecd878 |
}
|
|
|
3ecd878 |
|