--- 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 ] [--watch] .\n"; static const char long_usage_msg[] = -"Usage: %s [-aDfrRvVw] [-AF ] [--watch] . - - 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 - -F --fixed-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 ] [--watch] .\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 \n\ + -F --fixed-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 @@ -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"); -} - /*