ethtool.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. /*
  2. * ethtool.h: Defines for Linux ethtool.
  3. *
  4. * Copyright (C) 1998 David S. Miller (davem@redhat.com)
  5. * Copyright 2001 Jeff Garzik <jgarzik@pobox.com>
  6. * Portions Copyright 2001 Sun Microsystems (thockin@sun.com)
  7. * Portions Copyright 2002 Intel (eli.kupermann@intel.com,
  8. * christopher.leech@intel.com,
  9. * scott.feldman@intel.com)
  10. */
  11. #ifndef _LINUX_ETHTOOL_H
  12. #define _LINUX_ETHTOOL_H
  13. #include <linux/types.h>
  14. /* This should work for both 32 and 64 bit userland. */
  15. struct ethtool_cmd {
  16. __u32 cmd;
  17. __u32 supported; /* Features this interface supports */
  18. __u32 advertising; /* Features this interface advertises */
  19. __u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */
  20. __u8 duplex; /* Duplex, half or full */
  21. __u8 port; /* Which connector port */
  22. __u8 phy_address;
  23. __u8 transceiver; /* Which transceiver to use */
  24. __u8 autoneg; /* Enable or disable autonegotiation */
  25. __u32 maxtxpkt; /* Tx pkts before generating tx int */
  26. __u32 maxrxpkt; /* Rx pkts before generating rx int */
  27. __u32 reserved[4];
  28. };
  29. #define ETHTOOL_BUSINFO_LEN 32
  30. /* these strings are set to whatever the driver author decides... */
  31. struct ethtool_drvinfo {
  32. __u32 cmd;
  33. char driver[32]; /* driver short name, "tulip", "eepro100" */
  34. char version[32]; /* driver version string */
  35. char fw_version[32]; /* firmware version string, if applicable */
  36. char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */
  37. /* For PCI devices, use pci_name(pci_dev). */
  38. char reserved1[32];
  39. char reserved2[12];
  40. __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */
  41. __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */
  42. __u32 testinfo_len;
  43. __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */
  44. __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */
  45. };
  46. #define SOPASS_MAX 6
  47. /* wake-on-lan settings */
  48. struct ethtool_wolinfo {
  49. __u32 cmd;
  50. __u32 supported;
  51. __u32 wolopts;
  52. __u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */
  53. };
  54. /* for passing single values */
  55. struct ethtool_value {
  56. __u32 cmd;
  57. __u32 data;
  58. };
  59. /* for passing big chunks of data */
  60. struct ethtool_regs {
  61. __u32 cmd;
  62. __u32 version; /* driver-specific, indicates different chips/revs */
  63. __u32 len; /* bytes */
  64. __u8 data[0];
  65. };
  66. /* for passing EEPROM chunks */
  67. struct ethtool_eeprom {
  68. __u32 cmd;
  69. __u32 magic;
  70. __u32 offset; /* in bytes */
  71. __u32 len; /* in bytes */
  72. __u8 data[0];
  73. };
  74. /* for configuring coalescing parameters of chip */
  75. struct ethtool_coalesce {
  76. __u32 cmd; /* ETHTOOL_{G,S}COALESCE */
  77. /* How many usecs to delay an RX interrupt after
  78. * a packet arrives. If 0, only rx_max_coalesced_frames
  79. * is used.
  80. */
  81. __u32 rx_coalesce_usecs;
  82. /* How many packets to delay an RX interrupt after
  83. * a packet arrives. If 0, only rx_coalesce_usecs is
  84. * used. It is illegal to set both usecs and max frames
  85. * to zero as this would cause RX interrupts to never be
  86. * generated.
  87. */
  88. __u32 rx_max_coalesced_frames;
  89. /* Same as above two parameters, except that these values
  90. * apply while an IRQ is being serviced by the host. Not
  91. * all cards support this feature and the values are ignored
  92. * in that case.
  93. */
  94. __u32 rx_coalesce_usecs_irq;
  95. __u32 rx_max_coalesced_frames_irq;
  96. /* How many usecs to delay a TX interrupt after
  97. * a packet is sent. If 0, only tx_max_coalesced_frames
  98. * is used.
  99. */
  100. __u32 tx_coalesce_usecs;
  101. /* How many packets to delay a TX interrupt after
  102. * a packet is sent. If 0, only tx_coalesce_usecs is
  103. * used. It is illegal to set both usecs and max frames
  104. * to zero as this would cause TX interrupts to never be
  105. * generated.
  106. */
  107. __u32 tx_max_coalesced_frames;
  108. /* Same as above two parameters, except that these values
  109. * apply while an IRQ is being serviced by the host. Not
  110. * all cards support this feature and the values are ignored
  111. * in that case.
  112. */
  113. __u32 tx_coalesce_usecs_irq;
  114. __u32 tx_max_coalesced_frames_irq;
  115. /* How many usecs to delay in-memory statistics
  116. * block updates. Some drivers do not have an in-memory
  117. * statistic block, and in such cases this value is ignored.
  118. * This value must not be zero.
  119. */
  120. __u32 stats_block_coalesce_usecs;
  121. /* Adaptive RX/TX coalescing is an algorithm implemented by
  122. * some drivers to improve latency under low packet rates and
  123. * improve throughput under high packet rates. Some drivers
  124. * only implement one of RX or TX adaptive coalescing. Anything
  125. * not implemented by the driver causes these values to be
  126. * silently ignored.
  127. */
  128. __u32 use_adaptive_rx_coalesce;
  129. __u32 use_adaptive_tx_coalesce;
  130. /* When the packet rate (measured in packets per second)
  131. * is below pkt_rate_low, the {rx,tx}_*_low parameters are
  132. * used.
  133. */
  134. __u32 pkt_rate_low;
  135. __u32 rx_coalesce_usecs_low;
  136. __u32 rx_max_coalesced_frames_low;
  137. __u32 tx_coalesce_usecs_low;
  138. __u32 tx_max_coalesced_frames_low;
  139. /* When the packet rate is below pkt_rate_high but above
  140. * pkt_rate_low (both measured in packets per second) the
  141. * normal {rx,tx}_* coalescing parameters are used.
  142. */
  143. /* When the packet rate is (measured in packets per second)
  144. * is above pkt_rate_high, the {rx,tx}_*_high parameters are
  145. * used.
  146. */
  147. __u32 pkt_rate_high;
  148. __u32 rx_coalesce_usecs_high;
  149. __u32 rx_max_coalesced_frames_high;
  150. __u32 tx_coalesce_usecs_high;
  151. __u32 tx_max_coalesced_frames_high;
  152. /* How often to do adaptive coalescing packet rate sampling,
  153. * measured in seconds. Must not be zero.
  154. */
  155. __u32 rate_sample_interval;
  156. };
  157. /* for configuring RX/TX ring parameters */
  158. struct ethtool_ringparam {
  159. __u32 cmd; /* ETHTOOL_{G,S}RINGPARAM */
  160. /* Read only attributes. These indicate the maximum number
  161. * of pending RX/TX ring entries the driver will allow the
  162. * user to set.
  163. */
  164. __u32 rx_max_pending;
  165. __u32 rx_mini_max_pending;
  166. __u32 rx_jumbo_max_pending;
  167. __u32 tx_max_pending;
  168. /* Values changeable by the user. The valid values are
  169. * in the range 1 to the "*_max_pending" counterpart above.
  170. */
  171. __u32 rx_pending;
  172. __u32 rx_mini_pending;
  173. __u32 rx_jumbo_pending;
  174. __u32 tx_pending;
  175. };
  176. /* for configuring link flow control parameters */
  177. struct ethtool_pauseparam {
  178. __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */
  179. /* If the link is being auto-negotiated (via ethtool_cmd.autoneg
  180. * being true) the user may set 'autonet' here non-zero to have the
  181. * pause parameters be auto-negotiated too. In such a case, the
  182. * {rx,tx}_pause values below determine what capabilities are
  183. * advertised.
  184. *
  185. * If 'autoneg' is zero or the link is not being auto-negotiated,
  186. * then {rx,tx}_pause force the driver to use/not-use pause
  187. * flow control.
  188. */
  189. __u32 autoneg;
  190. __u32 rx_pause;
  191. __u32 tx_pause;
  192. };
  193. #define ETH_GSTRING_LEN 32
  194. enum ethtool_stringset {
  195. ETH_SS_TEST = 0,
  196. ETH_SS_STATS,
  197. ETH_SS_PRIV_FLAGS,
  198. };
  199. /* for passing string sets for data tagging */
  200. struct ethtool_gstrings {
  201. __u32 cmd; /* ETHTOOL_GSTRINGS */
  202. __u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/
  203. __u32 len; /* number of strings in the string set */
  204. __u8 data[0];
  205. };
  206. enum ethtool_test_flags {
  207. ETH_TEST_FL_OFFLINE = (1 << 0), /* online / offline */
  208. ETH_TEST_FL_FAILED = (1 << 1), /* test passed / failed */
  209. };
  210. /* for requesting NIC test and getting results*/
  211. struct ethtool_test {
  212. __u32 cmd; /* ETHTOOL_TEST */
  213. __u32 flags; /* ETH_TEST_FL_xxx */
  214. __u32 reserved;
  215. __u32 len; /* result length, in number of u64 elements */
  216. __u64 data[0];
  217. };
  218. /* for dumping NIC-specific statistics */
  219. struct ethtool_stats {
  220. __u32 cmd; /* ETHTOOL_GSTATS */
  221. __u32 n_stats; /* number of u64's being returned */
  222. __u64 data[0];
  223. };
  224. struct ethtool_perm_addr {
  225. __u32 cmd; /* ETHTOOL_GPERMADDR */
  226. __u32 size;
  227. __u8 data[0];
  228. };
  229. /* boolean flags controlling per-interface behavior characteristics.
  230. * When reading, the flag indicates whether or not a certain behavior
  231. * is enabled/present. When writing, the flag indicates whether
  232. * or not the driver should turn on (set) or off (clear) a behavior.
  233. *
  234. * Some behaviors may read-only (unconditionally absent or present).
  235. * If such is the case, return EINVAL in the set-flags operation if the
  236. * flag differs from the read-only value.
  237. */
  238. enum ethtool_flags {
  239. ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */
  240. };
  241. #ifdef __KERNEL__
  242. struct net_device;
  243. /* Some generic methods drivers may use in their ethtool_ops */
  244. u32 ethtool_op_get_link(struct net_device *dev);
  245. u32 ethtool_op_get_tx_csum(struct net_device *dev);
  246. int ethtool_op_set_tx_csum(struct net_device *dev, u32 data);
  247. int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data);
  248. int ethtool_op_set_tx_ipv6_csum(struct net_device *dev, u32 data);
  249. u32 ethtool_op_get_sg(struct net_device *dev);
  250. int ethtool_op_set_sg(struct net_device *dev, u32 data);
  251. u32 ethtool_op_get_tso(struct net_device *dev);
  252. int ethtool_op_set_tso(struct net_device *dev, u32 data);
  253. u32 ethtool_op_get_ufo(struct net_device *dev);
  254. int ethtool_op_set_ufo(struct net_device *dev, u32 data);
  255. u32 ethtool_op_get_flags(struct net_device *dev);
  256. int ethtool_op_set_flags(struct net_device *dev, u32 data);
  257. /**
  258. * &ethtool_ops - Alter and report network device settings
  259. * get_settings: Get device-specific settings
  260. * set_settings: Set device-specific settings
  261. * get_drvinfo: Report driver information
  262. * get_regs: Get device registers
  263. * get_wol: Report whether Wake-on-Lan is enabled
  264. * set_wol: Turn Wake-on-Lan on or off
  265. * get_msglevel: Report driver message level
  266. * set_msglevel: Set driver message level
  267. * nway_reset: Restart autonegotiation
  268. * get_link: Get link status
  269. * get_eeprom: Read data from the device EEPROM
  270. * set_eeprom: Write data to the device EEPROM
  271. * get_coalesce: Get interrupt coalescing parameters
  272. * set_coalesce: Set interrupt coalescing parameters
  273. * get_ringparam: Report ring sizes
  274. * set_ringparam: Set ring sizes
  275. * get_pauseparam: Report pause parameters
  276. * set_pauseparam: Set pause parameters
  277. * get_rx_csum: Report whether receive checksums are turned on or off
  278. * set_rx_csum: Turn receive checksum on or off
  279. * get_tx_csum: Report whether transmit checksums are turned on or off
  280. * set_tx_csum: Turn transmit checksums on or off
  281. * get_sg: Report whether scatter-gather is enabled
  282. * set_sg: Turn scatter-gather on or off
  283. * get_tso: Report whether TCP segmentation offload is enabled
  284. * set_tso: Turn TCP segmentation offload on or off
  285. * get_ufo: Report whether UDP fragmentation offload is enabled
  286. * set_ufo: Turn UDP fragmentation offload on or off
  287. * self_test: Run specified self-tests
  288. * get_strings: Return a set of strings that describe the requested objects
  289. * phys_id: Identify the device
  290. * get_stats: Return statistics about the device
  291. * get_flags: get 32-bit flags bitmap
  292. * set_flags: set 32-bit flags bitmap
  293. *
  294. * Description:
  295. *
  296. * get_settings:
  297. * @get_settings is passed an &ethtool_cmd to fill in. It returns
  298. * an negative errno or zero.
  299. *
  300. * set_settings:
  301. * @set_settings is passed an &ethtool_cmd and should attempt to set
  302. * all the settings this device supports. It may return an error value
  303. * if something goes wrong (otherwise 0).
  304. *
  305. * get_eeprom:
  306. * Should fill in the magic field. Don't need to check len for zero
  307. * or wraparound. Fill in the data argument with the eeprom values
  308. * from offset to offset + len. Update len to the amount read.
  309. * Returns an error or zero.
  310. *
  311. * set_eeprom:
  312. * Should validate the magic field. Don't need to check len for zero
  313. * or wraparound. Update len to the amount written. Returns an error
  314. * or zero.
  315. */
  316. struct ethtool_ops {
  317. int (*get_settings)(struct net_device *, struct ethtool_cmd *);
  318. int (*set_settings)(struct net_device *, struct ethtool_cmd *);
  319. void (*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *);
  320. int (*get_regs_len)(struct net_device *);
  321. void (*get_regs)(struct net_device *, struct ethtool_regs *, void *);
  322. void (*get_wol)(struct net_device *, struct ethtool_wolinfo *);
  323. int (*set_wol)(struct net_device *, struct ethtool_wolinfo *);
  324. u32 (*get_msglevel)(struct net_device *);
  325. void (*set_msglevel)(struct net_device *, u32);
  326. int (*nway_reset)(struct net_device *);
  327. u32 (*get_link)(struct net_device *);
  328. int (*get_eeprom_len)(struct net_device *);
  329. int (*get_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *);
  330. int (*set_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *);
  331. int (*get_coalesce)(struct net_device *, struct ethtool_coalesce *);
  332. int (*set_coalesce)(struct net_device *, struct ethtool_coalesce *);
  333. void (*get_ringparam)(struct net_device *, struct ethtool_ringparam *);
  334. int (*set_ringparam)(struct net_device *, struct ethtool_ringparam *);
  335. void (*get_pauseparam)(struct net_device *, struct ethtool_pauseparam*);
  336. int (*set_pauseparam)(struct net_device *, struct ethtool_pauseparam*);
  337. u32 (*get_rx_csum)(struct net_device *);
  338. int (*set_rx_csum)(struct net_device *, u32);
  339. u32 (*get_tx_csum)(struct net_device *);
  340. int (*set_tx_csum)(struct net_device *, u32);
  341. u32 (*get_sg)(struct net_device *);
  342. int (*set_sg)(struct net_device *, u32);
  343. u32 (*get_tso)(struct net_device *);
  344. int (*set_tso)(struct net_device *, u32);
  345. void (*self_test)(struct net_device *, struct ethtool_test *, u64 *);
  346. void (*get_strings)(struct net_device *, u32 stringset, u8 *);
  347. int (*phys_id)(struct net_device *, u32);
  348. void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *);
  349. int (*begin)(struct net_device *);
  350. void (*complete)(struct net_device *);
  351. u32 (*get_ufo)(struct net_device *);
  352. int (*set_ufo)(struct net_device *, u32);
  353. u32 (*get_flags)(struct net_device *);
  354. int (*set_flags)(struct net_device *, u32);
  355. u32 (*get_priv_flags)(struct net_device *);
  356. int (*set_priv_flags)(struct net_device *, u32);
  357. int (*get_sset_count)(struct net_device *, int);
  358. /* the following hooks are obsolete */
  359. int (*self_test_count)(struct net_device *);/* use get_sset_count */
  360. int (*get_stats_count)(struct net_device *);/* use get_sset_count */
  361. };
  362. #endif /* __KERNEL__ */
  363. /* CMDs currently supported */
  364. #define ETHTOOL_GSET 0x00000001 /* Get settings. */
  365. #define ETHTOOL_SSET 0x00000002 /* Set settings. */
  366. #define ETHTOOL_GDRVINFO 0x00000003 /* Get driver info. */
  367. #define ETHTOOL_GREGS 0x00000004 /* Get NIC registers. */
  368. #define ETHTOOL_GWOL 0x00000005 /* Get wake-on-lan options. */
  369. #define ETHTOOL_SWOL 0x00000006 /* Set wake-on-lan options. */
  370. #define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */
  371. #define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */
  372. #define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */
  373. #define ETHTOOL_GLINK 0x0000000a /* Get link status (ethtool_value) */
  374. #define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */
  375. #define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */
  376. #define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */
  377. #define ETHTOOL_SCOALESCE 0x0000000f /* Set coalesce config. */
  378. #define ETHTOOL_GRINGPARAM 0x00000010 /* Get ring parameters */
  379. #define ETHTOOL_SRINGPARAM 0x00000011 /* Set ring parameters. */
  380. #define ETHTOOL_GPAUSEPARAM 0x00000012 /* Get pause parameters */
  381. #define ETHTOOL_SPAUSEPARAM 0x00000013 /* Set pause parameters. */
  382. #define ETHTOOL_GRXCSUM 0x00000014 /* Get RX hw csum enable (ethtool_value) */
  383. #define ETHTOOL_SRXCSUM 0x00000015 /* Set RX hw csum enable (ethtool_value) */
  384. #define ETHTOOL_GTXCSUM 0x00000016 /* Get TX hw csum enable (ethtool_value) */
  385. #define ETHTOOL_STXCSUM 0x00000017 /* Set TX hw csum enable (ethtool_value) */
  386. #define ETHTOOL_GSG 0x00000018 /* Get scatter-gather enable
  387. * (ethtool_value) */
  388. #define ETHTOOL_SSG 0x00000019 /* Set scatter-gather enable
  389. * (ethtool_value). */
  390. #define ETHTOOL_TEST 0x0000001a /* execute NIC self-test. */
  391. #define ETHTOOL_GSTRINGS 0x0000001b /* get specified string set */
  392. #define ETHTOOL_PHYS_ID 0x0000001c /* identify the NIC */
  393. #define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */
  394. #define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */
  395. #define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */
  396. #define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */
  397. #define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */
  398. #define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */
  399. #define ETHTOOL_GGSO 0x00000023 /* Get GSO enable (ethtool_value) */
  400. #define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */
  401. #define ETHTOOL_GFLAGS 0x00000025 /* Get flags bitmap(ethtool_value) */
  402. #define ETHTOOL_SFLAGS 0x00000026 /* Set flags bitmap(ethtool_value) */
  403. #define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */
  404. #define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */
  405. /* compatibility with older code */
  406. #define SPARC_ETH_GSET ETHTOOL_GSET
  407. #define SPARC_ETH_SSET ETHTOOL_SSET
  408. /* Indicates what features are supported by the interface. */
  409. #define SUPPORTED_10baseT_Half (1 << 0)
  410. #define SUPPORTED_10baseT_Full (1 << 1)
  411. #define SUPPORTED_100baseT_Half (1 << 2)
  412. #define SUPPORTED_100baseT_Full (1 << 3)
  413. #define SUPPORTED_1000baseT_Half (1 << 4)
  414. #define SUPPORTED_1000baseT_Full (1 << 5)
  415. #define SUPPORTED_Autoneg (1 << 6)
  416. #define SUPPORTED_TP (1 << 7)
  417. #define SUPPORTED_AUI (1 << 8)
  418. #define SUPPORTED_MII (1 << 9)
  419. #define SUPPORTED_FIBRE (1 << 10)
  420. #define SUPPORTED_BNC (1 << 11)
  421. #define SUPPORTED_10000baseT_Full (1 << 12)
  422. #define SUPPORTED_Pause (1 << 13)
  423. #define SUPPORTED_Asym_Pause (1 << 14)
  424. #define SUPPORTED_2500baseX_Full (1 << 15)
  425. /* Indicates what features are advertised by the interface. */
  426. #define ADVERTISED_10baseT_Half (1 << 0)
  427. #define ADVERTISED_10baseT_Full (1 << 1)
  428. #define ADVERTISED_100baseT_Half (1 << 2)
  429. #define ADVERTISED_100baseT_Full (1 << 3)
  430. #define ADVERTISED_1000baseT_Half (1 << 4)
  431. #define ADVERTISED_1000baseT_Full (1 << 5)
  432. #define ADVERTISED_Autoneg (1 << 6)
  433. #define ADVERTISED_TP (1 << 7)
  434. #define ADVERTISED_AUI (1 << 8)
  435. #define ADVERTISED_MII (1 << 9)
  436. #define ADVERTISED_FIBRE (1 << 10)
  437. #define ADVERTISED_BNC (1 << 11)
  438. #define ADVERTISED_10000baseT_Full (1 << 12)
  439. #define ADVERTISED_Pause (1 << 13)
  440. #define ADVERTISED_Asym_Pause (1 << 14)
  441. #define ADVERTISED_2500baseX_Full (1 << 15)
  442. /* The following are all involved in forcing a particular link
  443. * mode for the device for setting things. When getting the
  444. * devices settings, these indicate the current mode and whether
  445. * it was foced up into this mode or autonegotiated.
  446. */
  447. /* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */
  448. #define SPEED_10 10
  449. #define SPEED_100 100
  450. #define SPEED_1000 1000
  451. #define SPEED_2500 2500
  452. #define SPEED_10000 10000
  453. /* Duplex, half or full. */
  454. #define DUPLEX_HALF 0x00
  455. #define DUPLEX_FULL 0x01
  456. /* Which connector port. */
  457. #define PORT_TP 0x00
  458. #define PORT_AUI 0x01
  459. #define PORT_MII 0x02
  460. #define PORT_FIBRE 0x03
  461. #define PORT_BNC 0x04
  462. /* Which transceiver to use. */
  463. #define XCVR_INTERNAL 0x00
  464. #define XCVR_EXTERNAL 0x01
  465. #define XCVR_DUMMY1 0x02
  466. #define XCVR_DUMMY2 0x03
  467. #define XCVR_DUMMY3 0x04
  468. /* Enable or disable autonegotiation. If this is set to enable,
  469. * the forced link modes above are completely ignored.
  470. */
  471. #define AUTONEG_DISABLE 0x00
  472. #define AUTONEG_ENABLE 0x01
  473. /* Wake-On-Lan options. */
  474. #define WAKE_PHY (1 << 0)
  475. #define WAKE_UCAST (1 << 1)
  476. #define WAKE_MCAST (1 << 2)
  477. #define WAKE_BCAST (1 << 3)
  478. #define WAKE_ARP (1 << 4)
  479. #define WAKE_MAGIC (1 << 5)
  480. #define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
  481. #endif /* _LINUX_ETHTOOL_H */