summaryrefslogtreecommitdiff
blob: 65351a570750a5116353964cb7a56cbf0374006f (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
--- mii-diag.c-2.09	2003-09-19 23:06:24.000000000 -0400
+++ mii-diag.c	2003-09-19 23:05:34.000000000 -0400
@@ -37,45 +37,45 @@
 static const char usage_msg[] =
 "Usage: %s [--help] [-aDfrRvVw] [-AF <speed+duplex>] [--watch] <interface>.\n";
 static const char long_usage_msg[] =
-"Usage: %s [-aDfrRvVw] [-AF <speed+duplex>] [--watch] <interface>.
-
-  This program configures and monitors the transceiver management registers
-  for network interfaces.  It uses the Media Independent Interface (MII)
-  standard with additional Linux-specific controls to communicate with the
-  underlying device driver.  The MII registers control and report network
-  link settings and errors.  Examples are link speed, duplex, capabilities
-  advertised to the link partner, status LED indications and link error
-  counters.
-
-   The common usage is
-      mii-diag eth0
-
-   The default interface is \"eth0\".
- Frequently used options are
-   -A  --advertise <speed|setting>
-   -F  --fixed-speed <speed>
-	Speed is one of: 100baseT4, 100baseTx, 100baseTx-FD, 100baseTx-HD,
-	                 10baseT, 10baseT-FD, 10baseT-HD
-   -s  --status     Return exit status 2 if there is no link beat.
-
- Less frequently used options are
-   -a  --all-interfaces  Show the status all interfaces
-              (Not recommended with options that change settings.)
-   -D  --debug
-   -g  --read-parameters 	Get driver-specific parameters.
-   -G  --set-parameters PARMS	Set driver-specific parameters.
-       Parameters are comma separated, missing elements retain existing value.
-   -M  --msg-level LEVEL 	Set the driver message bit map.
-   -p  --phy ADDR		Set the PHY (MII address) to report.
-   -r  --restart	Restart the link autonegotiation.
-   -R  --reset		Reset the transceiver.
-   -v  --verbose	Report each action taken.
-   -V  --version	Emit version information.
-   -w  --watch		Continuously monitor the transceiver and report changes.
-
-   This command returns success (zero) if the interface information can be
-   read.  If the --status option is passed, a zero return means that the
-   interface has link beat.
+"Usage: %s [-aDfrRvVw] [-AF <speed+duplex>] [--watch] <interface>.\n\
+\n\
+  This program configures and monitors the transceiver management registers\n\
+  for network interfaces.  It uses the Media Independent Interface (MII)\n\
+  standard with additional Linux-specific controls to communicate with the\n\
+  underlying device driver.  The MII registers control and report network\n\
+  link settings and errors.  Examples are link speed, duplex, capabilities\n\
+  advertised to the link partner, status LED indications and link error\n\
+  counters.\n\
+\n\
+   The common usage is\n\
+      mii-diag eth0\n\
+\n\
+   The default interface is \"eth0\".\n\
+ Frequently used options are\n\
+   -A  --advertise <speed|setting>\n\
+   -F  --fixed-speed <speed>\n\
+	Speed is one of: 100baseT4, 100baseTx, 100baseTx-FD, 100baseTx-HD,\n\
+	                 10baseT, 10baseT-FD, 10baseT-HD\n\
+   -s  --status     Return exit status 2 if there is no link beat.\n\
+\n\
+ Less frequently used options are\n\
+   -a  --all-interfaces  Show the status all interfaces\n\
+              (Not recommended with options that change settings.)\n\
+   -D  --debug\n\
+   -g  --read-parameters 	Get driver-specific parameters.\n\
+   -G  --set-parameters PARMS	Set driver-specific parameters.\n\
+       Parameters are comma separated, missing elements retain existing value.\n\
+   -M  --msg-level LEVEL 	Set the driver message bit map.\n\
+   -p  --phy ADDR		Set the PHY (MII address) to report.\n\
+   -r  --restart	Restart the link autonegotiation.\n\
+   -R  --reset		Reset the transceiver.\n\
+   -v  --verbose	Report each action taken.\n\
+   -V  --version	Emit version information.\n\
+   -w  --watch		Continuously monitor the transceiver and report changes.\n\
+\n\
+   This command returns success (zero) if the interface information can be\n\
+   read.  If the --status option is passed, a zero return means that the\n\
+   interface has link beat.\n\
 ";
 
 #include <unistd.h>
@@ -608,33 +608,6 @@
 	}
 }
 
-/* These functions are not used if we are linked with libmii. */
-
-int  show_mii_details(long ioaddr, int phy_id) __attribute__((weak));
-void monitor_mii(long ioaddr, int phy_id) __attribute__((weak));
-
-int  show_mii_details(long ioaddr, int phy_id)
-{
-	int mii_reg, mii_val;
-	printf(" MII PHY #%d transceiver registers:", phy_id);
-	for (mii_reg = 0; mii_reg < 32; mii_reg++) {
-		mii_val = mdio_read(skfd, phy_id, mii_reg);
-		printf("%s %4.4x", (mii_reg % 8) == 0 ? "\n  " : "",
-			   mii_val);
-	}
-	printf("\nThis version of 'mii-diag' has not been linked with "
-			"the libmii.c library.\n"
-			"  That library provides extended transceiver status reports.\n");
-	return 0;
-}
-
-void monitor_mii(long ioaddr, int phy_id)
-{
-	fprintf(stderr, "\nThis version of 'mii-diag' has not been linked with "
-			"the libmii.c library \n"
-			"  required for the media monitor option.\n");
-}
-
 
 
 /*