diff options
Diffstat (limited to 'include/uapi/linux/ethtool.h')
| -rw-r--r-- | include/uapi/linux/ethtool.h | 439 |
1 files changed, 326 insertions, 113 deletions
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h index 38dbafaa5341..fd161e91b6d7 100644 --- a/include/uapi/linux/ethtool.h +++ b/include/uapi/linux/ethtool.h | |||
| @@ -16,37 +16,97 @@ | |||
| 16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
| 17 | #include <linux/if_ether.h> | 17 | #include <linux/if_ether.h> |
| 18 | 18 | ||
| 19 | /* This should work for both 32 and 64 bit userland. */ | 19 | /* All structures exposed to userland should be defined such that they |
| 20 | * have the same layout for 32-bit and 64-bit userland. | ||
| 21 | */ | ||
| 22 | |||
| 23 | /** | ||
| 24 | * struct ethtool_cmd - link control and status | ||
| 25 | * @cmd: Command number = %ETHTOOL_GSET or %ETHTOOL_SSET | ||
| 26 | * @supported: Bitmask of %SUPPORTED_* flags for the link modes, | ||
| 27 | * physical connectors and other link features for which the | ||
| 28 | * interface supports autonegotiation or auto-detection. | ||
| 29 | * Read-only. | ||
| 30 | * @advertising: Bitmask of %ADVERTISED_* flags for the link modes, | ||
| 31 | * physical connectors and other link features that are | ||
| 32 | * advertised through autonegotiation or enabled for | ||
| 33 | * auto-detection. | ||
| 34 | * @speed: Low bits of the speed | ||
| 35 | * @duplex: Duplex mode; one of %DUPLEX_* | ||
| 36 | * @port: Physical connector type; one of %PORT_* | ||
| 37 | * @phy_address: MDIO address of PHY (transceiver); 0 or 255 if not | ||
| 38 | * applicable. For clause 45 PHYs this is the PRTAD. | ||
| 39 | * @transceiver: Historically used to distinguish different possible | ||
| 40 | * PHY types, but not in a consistent way. Deprecated. | ||
| 41 | * @autoneg: Enable/disable autonegotiation and auto-detection; | ||
| 42 | * either %AUTONEG_DISABLE or %AUTONEG_ENABLE | ||
| 43 | * @mdio_support: Bitmask of %ETH_MDIO_SUPPORTS_* flags for the MDIO | ||
| 44 | * protocols supported by the interface; 0 if unknown. | ||
| 45 | * Read-only. | ||
| 46 | * @maxtxpkt: Historically used to report TX IRQ coalescing; now | ||
| 47 | * obsoleted by &struct ethtool_coalesce. Read-only; deprecated. | ||
| 48 | * @maxrxpkt: Historically used to report RX IRQ coalescing; now | ||
| 49 | * obsoleted by &struct ethtool_coalesce. Read-only; deprecated. | ||
| 50 | * @speed_hi: High bits of the speed | ||
| 51 | * @eth_tp_mdix: Ethernet twisted-pair MDI(-X) status; one of | ||
| 52 | * %ETH_TP_MDI_*. If the status is unknown or not applicable, the | ||
| 53 | * value will be %ETH_TP_MDI_INVALID. Read-only. | ||
| 54 | * @eth_tp_mdix_ctrl: Ethernet twisted pair MDI(-X) control; one of | ||
| 55 | * %ETH_TP_MDI_*. If MDI(-X) control is not implemented, reads | ||
| 56 | * yield %ETH_TP_MDI_INVALID and writes may be ignored or rejected. | ||
| 57 | * When written successfully, the link should be renegotiated if | ||
| 58 | * necessary. | ||
| 59 | * @lp_advertising: Bitmask of %ADVERTISED_* flags for the link modes | ||
| 60 | * and other link features that the link partner advertised | ||
| 61 | * through autonegotiation; 0 if unknown or not applicable. | ||
| 62 | * Read-only. | ||
| 63 | * | ||
| 64 | * The link speed in Mbps is split between @speed and @speed_hi. Use | ||
| 65 | * the ethtool_cmd_speed() and ethtool_cmd_speed_set() functions to | ||
| 66 | * access it. | ||
| 67 | * | ||
| 68 | * If autonegotiation is disabled, the speed and @duplex represent the | ||
| 69 | * fixed link mode and are writable if the driver supports multiple | ||
| 70 | * link modes. If it is enabled then they are read-only; if the link | ||
| 71 | * is up they represent the negotiated link mode; if the link is down, | ||
| 72 | * the speed is 0, %SPEED_UNKNOWN or the highest enabled speed and | ||
| 73 | * @duplex is %DUPLEX_UNKNOWN or the best enabled duplex mode. | ||
| 74 | * | ||
| 75 | * Some hardware interfaces may have multiple PHYs and/or physical | ||
| 76 | * connectors fitted or do not allow the driver to detect which are | ||
| 77 | * fitted. For these interfaces @port and/or @phy_address may be | ||
| 78 | * writable, possibly dependent on @autoneg being %AUTONEG_DISABLE. | ||
| 79 | * Otherwise, attempts to write different values may be ignored or | ||
| 80 | * rejected. | ||
| 81 | * | ||
| 82 | * Users should assume that all fields not marked read-only are | ||
| 83 | * writable and subject to validation by the driver. They should use | ||
| 84 | * %ETHTOOL_GSET to get the current values before making specific | ||
| 85 | * changes and then applying them with %ETHTOOL_SSET. | ||
| 86 | * | ||
| 87 | * Drivers that implement set_settings() should validate all fields | ||
| 88 | * other than @cmd that are not described as read-only or deprecated, | ||
| 89 | * and must ignore all fields described as read-only. | ||
| 90 | * | ||
| 91 | * Deprecated fields should be ignored by both users and drivers. | ||
| 92 | */ | ||
| 20 | struct ethtool_cmd { | 93 | struct ethtool_cmd { |
| 21 | __u32 cmd; | 94 | __u32 cmd; |
| 22 | __u32 supported; /* Features this interface supports */ | 95 | __u32 supported; |
| 23 | __u32 advertising; /* Features this interface advertises */ | 96 | __u32 advertising; |
| 24 | __u16 speed; /* The forced speed (lower bits) in | 97 | __u16 speed; |
| 25 | * Mbps. Please use | 98 | __u8 duplex; |
| 26 | * ethtool_cmd_speed()/_set() to | 99 | __u8 port; |
| 27 | * access it */ | 100 | __u8 phy_address; |
| 28 | __u8 duplex; /* Duplex, half or full */ | 101 | __u8 transceiver; |
| 29 | __u8 port; /* Which connector port */ | 102 | __u8 autoneg; |
| 30 | __u8 phy_address; /* MDIO PHY address (PRTAD for clause 45). | 103 | __u8 mdio_support; |
| 31 | * May be read-only or read-write | 104 | __u32 maxtxpkt; |
| 32 | * depending on the driver. | 105 | __u32 maxrxpkt; |
| 33 | */ | 106 | __u16 speed_hi; |
| 34 | __u8 transceiver; /* Which transceiver to use */ | 107 | __u8 eth_tp_mdix; |
| 35 | __u8 autoneg; /* Enable or disable autonegotiation */ | 108 | __u8 eth_tp_mdix_ctrl; |
| 36 | __u8 mdio_support; /* MDIO protocols supported. Read-only. | 109 | __u32 lp_advertising; |
| 37 | * Not set by all drivers. | ||
| 38 | */ | ||
| 39 | __u32 maxtxpkt; /* Tx pkts before generating tx int */ | ||
| 40 | __u32 maxrxpkt; /* Rx pkts before generating rx int */ | ||
| 41 | __u16 speed_hi; /* The forced speed (upper | ||
| 42 | * bits) in Mbps. Please use | ||
| 43 | * ethtool_cmd_speed()/_set() to | ||
| 44 | * access it */ | ||
| 45 | __u8 eth_tp_mdix; /* twisted pair MDI-X status */ | ||
| 46 | __u8 eth_tp_mdix_ctrl; /* twisted pair MDI-X control, when set, | ||
| 47 | * link should be renegotiated if necessary | ||
| 48 | */ | ||
| 49 | __u32 lp_advertising; /* Features the link partner advertises */ | ||
| 50 | __u32 reserved[2]; | 110 | __u32 reserved[2]; |
| 51 | }; | 111 | }; |
| 52 | 112 | ||
| @@ -79,37 +139,68 @@ static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep) | |||
| 79 | 139 | ||
| 80 | #define ETHTOOL_FWVERS_LEN 32 | 140 | #define ETHTOOL_FWVERS_LEN 32 |
| 81 | #define ETHTOOL_BUSINFO_LEN 32 | 141 | #define ETHTOOL_BUSINFO_LEN 32 |
| 82 | /* these strings are set to whatever the driver author decides... */ | 142 | |
| 143 | /** | ||
| 144 | * struct ethtool_drvinfo - general driver and device information | ||
| 145 | * @cmd: Command number = %ETHTOOL_GDRVINFO | ||
| 146 | * @driver: Driver short name. This should normally match the name | ||
| 147 | * in its bus driver structure (e.g. pci_driver::name). Must | ||
| 148 | * not be an empty string. | ||
| 149 | * @version: Driver version string; may be an empty string | ||
| 150 | * @fw_version: Firmware version string; may be an empty string | ||
| 151 | * @bus_info: Device bus address. This should match the dev_name() | ||
| 152 | * string for the underlying bus device, if there is one. May be | ||
| 153 | * an empty string. | ||
| 154 | * @n_priv_flags: Number of flags valid for %ETHTOOL_GPFLAGS and | ||
| 155 | * %ETHTOOL_SPFLAGS commands; also the number of strings in the | ||
| 156 | * %ETH_SS_PRIV_FLAGS set | ||
| 157 | * @n_stats: Number of u64 statistics returned by the %ETHTOOL_GSTATS | ||
| 158 | * command; also the number of strings in the %ETH_SS_STATS set | ||
| 159 | * @testinfo_len: Number of results returned by the %ETHTOOL_TEST | ||
| 160 | * command; also the number of strings in the %ETH_SS_TEST set | ||
| 161 | * @eedump_len: Size of EEPROM accessible through the %ETHTOOL_GEEPROM | ||
| 162 | * and %ETHTOOL_SEEPROM commands, in bytes | ||
| 163 | * @regdump_len: Size of register dump returned by the %ETHTOOL_GREGS | ||
| 164 | * command, in bytes | ||
| 165 | * | ||
| 166 | * Users can use the %ETHTOOL_GSSET_INFO command to get the number of | ||
| 167 | * strings in any string set (from Linux 2.6.34). | ||
| 168 | * | ||
| 169 | * Drivers should set at most @driver, @version, @fw_version and | ||
| 170 | * @bus_info in their get_drvinfo() implementation. The ethtool | ||
| 171 | * core fills in the other fields using other driver operations. | ||
| 172 | */ | ||
| 83 | struct ethtool_drvinfo { | 173 | struct ethtool_drvinfo { |
| 84 | __u32 cmd; | 174 | __u32 cmd; |
| 85 | char driver[32]; /* driver short name, "tulip", "eepro100" */ | 175 | char driver[32]; |
| 86 | char version[32]; /* driver version string */ | 176 | char version[32]; |
| 87 | char fw_version[ETHTOOL_FWVERS_LEN]; /* firmware version string */ | 177 | char fw_version[ETHTOOL_FWVERS_LEN]; |
| 88 | char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */ | 178 | char bus_info[ETHTOOL_BUSINFO_LEN]; |
| 89 | /* For PCI devices, use pci_name(pci_dev). */ | ||
| 90 | char reserved1[32]; | 179 | char reserved1[32]; |
| 91 | char reserved2[12]; | 180 | char reserved2[12]; |
| 92 | /* | 181 | __u32 n_priv_flags; |
| 93 | * Some struct members below are filled in | 182 | __u32 n_stats; |
| 94 | * using ops->get_sset_count(). Obtaining | ||
| 95 | * this info from ethtool_drvinfo is now | ||
| 96 | * deprecated; Use ETHTOOL_GSSET_INFO | ||
| 97 | * instead. | ||
| 98 | */ | ||
| 99 | __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */ | ||
| 100 | __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */ | ||
| 101 | __u32 testinfo_len; | 183 | __u32 testinfo_len; |
| 102 | __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */ | 184 | __u32 eedump_len; |
| 103 | __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */ | 185 | __u32 regdump_len; |
| 104 | }; | 186 | }; |
| 105 | 187 | ||
| 106 | #define SOPASS_MAX 6 | 188 | #define SOPASS_MAX 6 |
| 107 | /* wake-on-lan settings */ | 189 | |
| 190 | /** | ||
| 191 | * struct ethtool_wolinfo - Wake-On-Lan configuration | ||
| 192 | * @cmd: Command number = %ETHTOOL_GWOL or %ETHTOOL_SWOL | ||
| 193 | * @supported: Bitmask of %WAKE_* flags for supported Wake-On-Lan modes. | ||
| 194 | * Read-only. | ||
| 195 | * @wolopts: Bitmask of %WAKE_* flags for enabled Wake-On-Lan modes. | ||
| 196 | * @sopass: SecureOn(tm) password; meaningful only if %WAKE_MAGICSECURE | ||
| 197 | * is set in @wolopts. | ||
| 198 | */ | ||
| 108 | struct ethtool_wolinfo { | 199 | struct ethtool_wolinfo { |
| 109 | __u32 cmd; | 200 | __u32 cmd; |
| 110 | __u32 supported; | 201 | __u32 supported; |
| 111 | __u32 wolopts; | 202 | __u32 wolopts; |
| 112 | __u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */ | 203 | __u8 sopass[SOPASS_MAX]; |
| 113 | }; | 204 | }; |
| 114 | 205 | ||
| 115 | /* for passing single values */ | 206 | /* for passing single values */ |
| @@ -118,20 +209,51 @@ struct ethtool_value { | |||
| 118 | __u32 data; | 209 | __u32 data; |
| 119 | }; | 210 | }; |
| 120 | 211 | ||
| 121 | /* for passing big chunks of data */ | 212 | /** |
| 213 | * struct ethtool_regs - hardware register dump | ||
| 214 | * @cmd: Command number = %ETHTOOL_GREGS | ||
| 215 | * @version: Dump format version. This is driver-specific and may | ||
| 216 | * distinguish different chips/revisions. Drivers must use new | ||
| 217 | * version numbers whenever the dump format changes in an | ||
| 218 | * incompatible way. | ||
| 219 | * @len: On entry, the real length of @data. On return, the number of | ||
| 220 | * bytes used. | ||
| 221 | * @data: Buffer for the register dump | ||
| 222 | * | ||
| 223 | * Users should use %ETHTOOL_GDRVINFO to find the maximum length of | ||
| 224 | * a register dump for the interface. They must allocate the buffer | ||
| 225 | * immediately following this structure. | ||
| 226 | */ | ||
| 122 | struct ethtool_regs { | 227 | struct ethtool_regs { |
| 123 | __u32 cmd; | 228 | __u32 cmd; |
| 124 | __u32 version; /* driver-specific, indicates different chips/revs */ | 229 | __u32 version; |
| 125 | __u32 len; /* bytes */ | 230 | __u32 len; |
| 126 | __u8 data[0]; | 231 | __u8 data[0]; |
| 127 | }; | 232 | }; |
| 128 | 233 | ||
| 129 | /* for passing EEPROM chunks */ | 234 | /** |
| 235 | * struct ethtool_eeprom - EEPROM dump | ||
| 236 | * @cmd: Command number = %ETHTOOL_GEEPROM, %ETHTOOL_GMODULEEEPROM or | ||
| 237 | * %ETHTOOL_SEEPROM | ||
| 238 | * @magic: A 'magic cookie' value to guard against accidental changes. | ||
| 239 | * The value passed in to %ETHTOOL_SEEPROM must match the value | ||
| 240 | * returned by %ETHTOOL_GEEPROM for the same device. This is | ||
| 241 | * unused when @cmd is %ETHTOOL_GMODULEEEPROM. | ||
| 242 | * @offset: Offset within the EEPROM to begin reading/writing, in bytes | ||
| 243 | * @len: On entry, number of bytes to read/write. On successful | ||
| 244 | * return, number of bytes actually read/written. In case of | ||
| 245 | * error, this may indicate at what point the error occurred. | ||
| 246 | * @data: Buffer to read/write from | ||
| 247 | * | ||
| 248 | * Users may use %ETHTOOL_GDRVINFO or %ETHTOOL_GMODULEINFO to find | ||
| 249 | * the length of an on-board or module EEPROM, respectively. They | ||
| 250 | * must allocate the buffer immediately following this structure. | ||
| 251 | */ | ||
| 130 | struct ethtool_eeprom { | 252 | struct ethtool_eeprom { |
| 131 | __u32 cmd; | 253 | __u32 cmd; |
| 132 | __u32 magic; | 254 | __u32 magic; |
| 133 | __u32 offset; /* in bytes */ | 255 | __u32 offset; |
| 134 | __u32 len; /* in bytes */ | 256 | __u32 len; |
| 135 | __u8 data[0]; | 257 | __u8 data[0]; |
| 136 | }; | 258 | }; |
| 137 | 259 | ||
| @@ -229,17 +351,18 @@ struct ethtool_modinfo { | |||
| 229 | * @rate_sample_interval: How often to do adaptive coalescing packet rate | 351 | * @rate_sample_interval: How often to do adaptive coalescing packet rate |
| 230 | * sampling, measured in seconds. Must not be zero. | 352 | * sampling, measured in seconds. Must not be zero. |
| 231 | * | 353 | * |
| 232 | * Each pair of (usecs, max_frames) fields specifies this exit | 354 | * Each pair of (usecs, max_frames) fields specifies that interrupts |
| 233 | * condition for interrupt coalescing: | 355 | * should be coalesced until |
| 234 | * (usecs > 0 && time_since_first_completion >= usecs) || | 356 | * (usecs > 0 && time_since_first_completion >= usecs) || |
| 235 | * (max_frames > 0 && completed_frames >= max_frames) | 357 | * (max_frames > 0 && completed_frames >= max_frames) |
| 358 | * | ||
| 236 | * It is illegal to set both usecs and max_frames to zero as this | 359 | * It is illegal to set both usecs and max_frames to zero as this |
| 237 | * would cause interrupts to never be generated. To disable | 360 | * would cause interrupts to never be generated. To disable |
| 238 | * coalescing, set usecs = 0 and max_frames = 1. | 361 | * coalescing, set usecs = 0 and max_frames = 1. |
| 239 | * | 362 | * |
| 240 | * Some implementations ignore the value of max_frames and use the | 363 | * Some implementations ignore the value of max_frames and use the |
| 241 | * condition: | 364 | * condition time_since_first_completion >= usecs |
| 242 | * time_since_first_completion >= usecs | 365 | * |
| 243 | * This is deprecated. Drivers for hardware that does not support | 366 | * This is deprecated. Drivers for hardware that does not support |
| 244 | * counting completions should validate that max_frames == !rx_usecs. | 367 | * counting completions should validate that max_frames == !rx_usecs. |
| 245 | * | 368 | * |
| @@ -279,22 +402,37 @@ struct ethtool_coalesce { | |||
| 279 | __u32 rate_sample_interval; | 402 | __u32 rate_sample_interval; |
| 280 | }; | 403 | }; |
| 281 | 404 | ||
| 282 | /* for configuring RX/TX ring parameters */ | 405 | /** |
| 406 | * struct ethtool_ringparam - RX/TX ring parameters | ||
| 407 | * @cmd: Command number = %ETHTOOL_GRINGPARAM or %ETHTOOL_SRINGPARAM | ||
| 408 | * @rx_max_pending: Maximum supported number of pending entries per | ||
| 409 | * RX ring. Read-only. | ||
| 410 | * @rx_mini_max_pending: Maximum supported number of pending entries | ||
| 411 | * per RX mini ring. Read-only. | ||
| 412 | * @rx_jumbo_max_pending: Maximum supported number of pending entries | ||
| 413 | * per RX jumbo ring. Read-only. | ||
| 414 | * @tx_max_pending: Maximum supported number of pending entries per | ||
| 415 | * TX ring. Read-only. | ||
| 416 | * @rx_pending: Current maximum number of pending entries per RX ring | ||
| 417 | * @rx_mini_pending: Current maximum number of pending entries per RX | ||
| 418 | * mini ring | ||
| 419 | * @rx_jumbo_pending: Current maximum number of pending entries per RX | ||
| 420 | * jumbo ring | ||
| 421 | * @tx_pending: Current maximum supported number of pending entries | ||
| 422 | * per TX ring | ||
| 423 | * | ||
| 424 | * If the interface does not have separate RX mini and/or jumbo rings, | ||
| 425 | * @rx_mini_max_pending and/or @rx_jumbo_max_pending will be 0. | ||
| 426 | * | ||
| 427 | * There may also be driver-dependent minimum values for the number | ||
| 428 | * of entries per ring. | ||
| 429 | */ | ||
| 283 | struct ethtool_ringparam { | 430 | struct ethtool_ringparam { |
| 284 | __u32 cmd; /* ETHTOOL_{G,S}RINGPARAM */ | 431 | __u32 cmd; |
| 285 | |||
| 286 | /* Read only attributes. These indicate the maximum number | ||
| 287 | * of pending RX/TX ring entries the driver will allow the | ||
| 288 | * user to set. | ||
| 289 | */ | ||
| 290 | __u32 rx_max_pending; | 432 | __u32 rx_max_pending; |
| 291 | __u32 rx_mini_max_pending; | 433 | __u32 rx_mini_max_pending; |
| 292 | __u32 rx_jumbo_max_pending; | 434 | __u32 rx_jumbo_max_pending; |
| 293 | __u32 tx_max_pending; | 435 | __u32 tx_max_pending; |
| 294 | |||
| 295 | /* Values changeable by the user. The valid values are | ||
| 296 | * in the range 1 to the "*_max_pending" counterpart above. | ||
| 297 | */ | ||
| 298 | __u32 rx_pending; | 436 | __u32 rx_pending; |
| 299 | __u32 rx_mini_pending; | 437 | __u32 rx_mini_pending; |
| 300 | __u32 rx_jumbo_pending; | 438 | __u32 rx_jumbo_pending; |
| @@ -329,51 +467,96 @@ struct ethtool_channels { | |||
| 329 | __u32 combined_count; | 467 | __u32 combined_count; |
| 330 | }; | 468 | }; |
| 331 | 469 | ||
| 332 | /* for configuring link flow control parameters */ | 470 | /** |
| 471 | * struct ethtool_pauseparam - Ethernet pause (flow control) parameters | ||
| 472 | * @cmd: Command number = %ETHTOOL_GPAUSEPARAM or %ETHTOOL_SPAUSEPARAM | ||
| 473 | * @autoneg: Flag to enable autonegotiation of pause frame use | ||
| 474 | * @rx_pause: Flag to enable reception of pause frames | ||
| 475 | * @tx_pause: Flag to enable transmission of pause frames | ||
| 476 | * | ||
| 477 | * Drivers should reject a non-zero setting of @autoneg when | ||
| 478 | * autoneogotiation is disabled (or not supported) for the link. | ||
| 479 | * | ||
| 480 | * If the link is autonegotiated, drivers should use | ||
| 481 | * mii_advertise_flowctrl() or similar code to set the advertised | ||
| 482 | * pause frame capabilities based on the @rx_pause and @tx_pause flags, | ||
| 483 | * even if @autoneg is zero. They should also allow the advertised | ||
| 484 | * pause frame capabilities to be controlled directly through the | ||
| 485 | * advertising field of &struct ethtool_cmd. | ||
| 486 | * | ||
| 487 | * If @autoneg is non-zero, the MAC is configured to send and/or | ||
| 488 | * receive pause frames according to the result of autonegotiation. | ||
| 489 | * Otherwise, it is configured directly based on the @rx_pause and | ||
| 490 | * @tx_pause flags. | ||
| 491 | */ | ||
| 333 | struct ethtool_pauseparam { | 492 | struct ethtool_pauseparam { |
| 334 | __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */ | 493 | __u32 cmd; |
| 335 | |||
| 336 | /* If the link is being auto-negotiated (via ethtool_cmd.autoneg | ||
| 337 | * being true) the user may set 'autoneg' here non-zero to have the | ||
| 338 | * pause parameters be auto-negotiated too. In such a case, the | ||
| 339 | * {rx,tx}_pause values below determine what capabilities are | ||
| 340 | * advertised. | ||
| 341 | * | ||
| 342 | * If 'autoneg' is zero or the link is not being auto-negotiated, | ||
| 343 | * then {rx,tx}_pause force the driver to use/not-use pause | ||
| 344 | * flow control. | ||
| 345 | */ | ||
| 346 | __u32 autoneg; | 494 | __u32 autoneg; |
| 347 | __u32 rx_pause; | 495 | __u32 rx_pause; |
| 348 | __u32 tx_pause; | 496 | __u32 tx_pause; |
| 349 | }; | 497 | }; |
| 350 | 498 | ||
| 351 | #define ETH_GSTRING_LEN 32 | 499 | #define ETH_GSTRING_LEN 32 |
| 500 | |||
| 501 | /** | ||
| 502 | * enum ethtool_stringset - string set ID | ||
| 503 | * @ETH_SS_TEST: Self-test result names, for use with %ETHTOOL_TEST | ||
| 504 | * @ETH_SS_STATS: Statistic names, for use with %ETHTOOL_GSTATS | ||
| 505 | * @ETH_SS_PRIV_FLAGS: Driver private flag names, for use with | ||
| 506 | * %ETHTOOL_GPFLAGS and %ETHTOOL_SPFLAGS | ||
| 507 | * @ETH_SS_NTUPLE_FILTERS: Previously used with %ETHTOOL_GRXNTUPLE; | ||
| 508 | * now deprecated | ||
| 509 | * @ETH_SS_FEATURES: Device feature names | ||
| 510 | */ | ||
| 352 | enum ethtool_stringset { | 511 | enum ethtool_stringset { |
| 353 | ETH_SS_TEST = 0, | 512 | ETH_SS_TEST = 0, |
| 354 | ETH_SS_STATS, | 513 | ETH_SS_STATS, |
| 355 | ETH_SS_PRIV_FLAGS, | 514 | ETH_SS_PRIV_FLAGS, |
| 356 | ETH_SS_NTUPLE_FILTERS, /* Do not use, GRXNTUPLE is now deprecated */ | 515 | ETH_SS_NTUPLE_FILTERS, |
| 357 | ETH_SS_FEATURES, | 516 | ETH_SS_FEATURES, |
| 358 | }; | 517 | }; |
| 359 | 518 | ||
| 360 | /* for passing string sets for data tagging */ | 519 | /** |
| 520 | * struct ethtool_gstrings - string set for data tagging | ||
| 521 | * @cmd: Command number = %ETHTOOL_GSTRINGS | ||
| 522 | * @string_set: String set ID; one of &enum ethtool_stringset | ||
| 523 | * @len: On return, the number of strings in the string set | ||
| 524 | * @data: Buffer for strings. Each string is null-padded to a size of | ||
| 525 | * %ETH_GSTRING_LEN. | ||
| 526 | * | ||
| 527 | * Users must use %ETHTOOL_GSSET_INFO to find the number of strings in | ||
| 528 | * the string set. They must allocate a buffer of the appropriate | ||
| 529 | * size immediately following this structure. | ||
| 530 | */ | ||
| 361 | struct ethtool_gstrings { | 531 | struct ethtool_gstrings { |
| 362 | __u32 cmd; /* ETHTOOL_GSTRINGS */ | 532 | __u32 cmd; |
| 363 | __u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/ | 533 | __u32 string_set; |
| 364 | __u32 len; /* number of strings in the string set */ | 534 | __u32 len; |
| 365 | __u8 data[0]; | 535 | __u8 data[0]; |
| 366 | }; | 536 | }; |
| 367 | 537 | ||
| 538 | /** | ||
| 539 | * struct ethtool_sset_info - string set information | ||
| 540 | * @cmd: Command number = %ETHTOOL_GSSET_INFO | ||
| 541 | * @sset_mask: On entry, a bitmask of string sets to query, with bits | ||
| 542 | * numbered according to &enum ethtool_stringset. On return, a | ||
| 543 | * bitmask of those string sets queried that are supported. | ||
| 544 | * @data: Buffer for string set sizes. On return, this contains the | ||
| 545 | * size of each string set that was queried and supported, in | ||
| 546 | * order of ID. | ||
| 547 | * | ||
| 548 | * Example: The user passes in @sset_mask = 0x7 (sets 0, 1, 2) and on | ||
| 549 | * return @sset_mask == 0x6 (sets 1, 2). Then @data[0] contains the | ||
| 550 | * size of set 1 and @data[1] contains the size of set 2. | ||
| 551 | * | ||
| 552 | * Users must allocate a buffer of the appropriate size (4 * number of | ||
| 553 | * sets queried) immediately following this structure. | ||
| 554 | */ | ||
| 368 | struct ethtool_sset_info { | 555 | struct ethtool_sset_info { |
| 369 | __u32 cmd; /* ETHTOOL_GSSET_INFO */ | 556 | __u32 cmd; |
| 370 | __u32 reserved; | 557 | __u32 reserved; |
| 371 | __u64 sset_mask; /* input: each bit selects an sset to query */ | 558 | __u64 sset_mask; |
| 372 | /* output: each bit a returned sset */ | 559 | __u32 data[0]; |
| 373 | __u32 data[0]; /* ETH_SS_xxx count, in order, based on bits | ||
| 374 | in sset_mask. One bit implies one | ||
| 375 | __u32, two bits implies two | ||
| 376 | __u32's, etc. */ | ||
| 377 | }; | 560 | }; |
| 378 | 561 | ||
| 379 | /** | 562 | /** |
| @@ -393,24 +576,58 @@ enum ethtool_test_flags { | |||
| 393 | ETH_TEST_FL_EXTERNAL_LB_DONE = (1 << 3), | 576 | ETH_TEST_FL_EXTERNAL_LB_DONE = (1 << 3), |
| 394 | }; | 577 | }; |
| 395 | 578 | ||
| 396 | /* for requesting NIC test and getting results*/ | 579 | /** |
| 580 | * struct ethtool_test - device self-test invocation | ||
| 581 | * @cmd: Command number = %ETHTOOL_TEST | ||
| 582 | * @flags: A bitmask of flags from &enum ethtool_test_flags. Some | ||
| 583 | * flags may be set by the user on entry; others may be set by | ||
| 584 | * the driver on return. | ||
| 585 | * @len: On return, the number of test results | ||
| 586 | * @data: Array of test results | ||
| 587 | * | ||
| 588 | * Users must use %ETHTOOL_GSSET_INFO or %ETHTOOL_GDRVINFO to find the | ||
| 589 | * number of test results that will be returned. They must allocate a | ||
| 590 | * buffer of the appropriate size (8 * number of results) immediately | ||
| 591 | * following this structure. | ||
| 592 | */ | ||
| 397 | struct ethtool_test { | 593 | struct ethtool_test { |
| 398 | __u32 cmd; /* ETHTOOL_TEST */ | 594 | __u32 cmd; |
| 399 | __u32 flags; /* ETH_TEST_FL_xxx */ | 595 | __u32 flags; |
| 400 | __u32 reserved; | 596 | __u32 reserved; |
| 401 | __u32 len; /* result length, in number of u64 elements */ | 597 | __u32 len; |
| 402 | __u64 data[0]; | 598 | __u64 data[0]; |
| 403 | }; | 599 | }; |
| 404 | 600 | ||
| 405 | /* for dumping NIC-specific statistics */ | 601 | /** |
| 602 | * struct ethtool_stats - device-specific statistics | ||
| 603 | * @cmd: Command number = %ETHTOOL_GSTATS | ||
| 604 | * @n_stats: On return, the number of statistics | ||
| 605 | * @data: Array of statistics | ||
| 606 | * | ||
| 607 | * Users must use %ETHTOOL_GSSET_INFO or %ETHTOOL_GDRVINFO to find the | ||
| 608 | * number of statistics that will be returned. They must allocate a | ||
| 609 | * buffer of the appropriate size (8 * number of statistics) | ||
| 610 | * immediately following this structure. | ||
| 611 | */ | ||
| 406 | struct ethtool_stats { | 612 | struct ethtool_stats { |
| 407 | __u32 cmd; /* ETHTOOL_GSTATS */ | 613 | __u32 cmd; |
| 408 | __u32 n_stats; /* number of u64's being returned */ | 614 | __u32 n_stats; |
| 409 | __u64 data[0]; | 615 | __u64 data[0]; |
| 410 | }; | 616 | }; |
| 411 | 617 | ||
| 618 | /** | ||
| 619 | * struct ethtool_perm_addr - permanent hardware address | ||
| 620 | * @cmd: Command number = %ETHTOOL_GPERMADDR | ||
| 621 | * @size: On entry, the size of the buffer. On return, the size of the | ||
| 622 | * address. The command fails if the buffer is too small. | ||
| 623 | * @data: Buffer for the address | ||
| 624 | * | ||
| 625 | * Users must allocate the buffer immediately following this structure. | ||
| 626 | * A buffer size of %MAX_ADDR_LEN should be sufficient for any address | ||
| 627 | * type. | ||
| 628 | */ | ||
| 412 | struct ethtool_perm_addr { | 629 | struct ethtool_perm_addr { |
| 413 | __u32 cmd; /* ETHTOOL_GPERMADDR */ | 630 | __u32 cmd; |
| 414 | __u32 size; | 631 | __u32 size; |
| 415 | __u8 data[0]; | 632 | __u8 data[0]; |
| 416 | }; | 633 | }; |
| @@ -593,7 +810,7 @@ struct ethtool_rx_flow_spec { | |||
| 593 | * %ETHTOOL_SRXCLSRLINS may add the rule at any suitable unused | 810 | * %ETHTOOL_SRXCLSRLINS may add the rule at any suitable unused |
| 594 | * location, and may remove a rule at a later location (lower | 811 | * location, and may remove a rule at a later location (lower |
| 595 | * priority) that matches exactly the same set of flows. The special | 812 | * priority) that matches exactly the same set of flows. The special |
| 596 | * values are: %RX_CLS_LOC_ANY, selecting any location; | 813 | * values are %RX_CLS_LOC_ANY, selecting any location; |
| 597 | * %RX_CLS_LOC_FIRST, selecting the first suitable location (maximum | 814 | * %RX_CLS_LOC_FIRST, selecting the first suitable location (maximum |
| 598 | * priority); and %RX_CLS_LOC_LAST, selecting the last suitable | 815 | * priority); and %RX_CLS_LOC_LAST, selecting the last suitable |
| 599 | * location (minimum priority). Additional special values may be | 816 | * location (minimum priority). Additional special values may be |
| @@ -704,9 +921,6 @@ struct ethtool_flash { | |||
| 704 | * for %ETHTOOL_GET_DUMP_FLAG command | 921 | * for %ETHTOOL_GET_DUMP_FLAG command |
| 705 | * @data: data collected for get dump data operation | 922 | * @data: data collected for get dump data operation |
| 706 | */ | 923 | */ |
| 707 | |||
| 708 | #define ETH_FW_DUMP_DISABLE 0 | ||
| 709 | |||
| 710 | struct ethtool_dump { | 924 | struct ethtool_dump { |
| 711 | __u32 cmd; | 925 | __u32 cmd; |
| 712 | __u32 version; | 926 | __u32 version; |
| @@ -715,6 +929,8 @@ struct ethtool_dump { | |||
| 715 | __u8 data[0]; | 929 | __u8 data[0]; |
| 716 | }; | 930 | }; |
| 717 | 931 | ||
| 932 | #define ETH_FW_DUMP_DISABLE 0 | ||
| 933 | |||
| 718 | /* for returning and changing feature sets */ | 934 | /* for returning and changing feature sets */ |
| 719 | 935 | ||
| 720 | /** | 936 | /** |
| @@ -734,8 +950,9 @@ struct ethtool_get_features_block { | |||
| 734 | /** | 950 | /** |
| 735 | * struct ethtool_gfeatures - command to get state of device's features | 951 | * struct ethtool_gfeatures - command to get state of device's features |
| 736 | * @cmd: command number = %ETHTOOL_GFEATURES | 952 | * @cmd: command number = %ETHTOOL_GFEATURES |
| 737 | * @size: in: number of elements in the features[] array; | 953 | * @size: On entry, the number of elements in the features[] array; |
| 738 | * out: number of elements in features[] needed to hold all features | 954 | * on return, the number of elements in features[] needed to hold |
| 955 | * all features | ||
| 739 | * @features: state of features | 956 | * @features: state of features |
| 740 | */ | 957 | */ |
| 741 | struct ethtool_gfeatures { | 958 | struct ethtool_gfeatures { |
| @@ -905,7 +1122,6 @@ enum ethtool_sfeatures_retval_bits { | |||
| 905 | #define SPARC_ETH_GSET ETHTOOL_GSET | 1122 | #define SPARC_ETH_GSET ETHTOOL_GSET |
| 906 | #define SPARC_ETH_SSET ETHTOOL_SSET | 1123 | #define SPARC_ETH_SSET ETHTOOL_SSET |
| 907 | 1124 | ||
| 908 | /* Indicates what features are supported by the interface. */ | ||
| 909 | #define SUPPORTED_10baseT_Half (1 << 0) | 1125 | #define SUPPORTED_10baseT_Half (1 << 0) |
| 910 | #define SUPPORTED_10baseT_Full (1 << 1) | 1126 | #define SUPPORTED_10baseT_Full (1 << 1) |
| 911 | #define SUPPORTED_100baseT_Half (1 << 2) | 1127 | #define SUPPORTED_100baseT_Half (1 << 2) |
| @@ -934,7 +1150,6 @@ enum ethtool_sfeatures_retval_bits { | |||
| 934 | #define SUPPORTED_40000baseSR4_Full (1 << 25) | 1150 | #define SUPPORTED_40000baseSR4_Full (1 << 25) |
| 935 | #define SUPPORTED_40000baseLR4_Full (1 << 26) | 1151 | #define SUPPORTED_40000baseLR4_Full (1 << 26) |
| 936 | 1152 | ||
| 937 | /* Indicates what features are advertised by the interface. */ | ||
| 938 | #define ADVERTISED_10baseT_Half (1 << 0) | 1153 | #define ADVERTISED_10baseT_Half (1 << 0) |
| 939 | #define ADVERTISED_10baseT_Full (1 << 1) | 1154 | #define ADVERTISED_10baseT_Full (1 << 1) |
| 940 | #define ADVERTISED_100baseT_Half (1 << 2) | 1155 | #define ADVERTISED_100baseT_Half (1 << 2) |
| @@ -999,9 +1214,7 @@ enum ethtool_sfeatures_retval_bits { | |||
| 999 | #define XCVR_DUMMY2 0x03 | 1214 | #define XCVR_DUMMY2 0x03 |
| 1000 | #define XCVR_DUMMY3 0x04 | 1215 | #define XCVR_DUMMY3 0x04 |
| 1001 | 1216 | ||
| 1002 | /* Enable or disable autonegotiation. If this is set to enable, | 1217 | /* Enable or disable autonegotiation. */ |
| 1003 | * the forced link modes above are completely ignored. | ||
| 1004 | */ | ||
| 1005 | #define AUTONEG_DISABLE 0x00 | 1218 | #define AUTONEG_DISABLE 0x00 |
| 1006 | #define AUTONEG_ENABLE 0x01 | 1219 | #define AUTONEG_ENABLE 0x01 |
| 1007 | 1220 | ||
