ethtool.c 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093
  1. /****************************************************************************
  2. * Driver for Solarflare Solarstorm network controllers and boards
  3. * Copyright 2005-2006 Fen Systems Ltd.
  4. * Copyright 2006-2009 Solarflare Communications Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License version 2 as published
  8. * by the Free Software Foundation, incorporated herein by reference.
  9. */
  10. #include <linux/netdevice.h>
  11. #include <linux/ethtool.h>
  12. #include <linux/rtnetlink.h>
  13. #include "net_driver.h"
  14. #include "workarounds.h"
  15. #include "selftest.h"
  16. #include "efx.h"
  17. #include "filter.h"
  18. #include "nic.h"
  19. #include "mdio_10g.h"
  20. struct ethtool_string {
  21. char name[ETH_GSTRING_LEN];
  22. };
  23. struct efx_ethtool_stat {
  24. const char *name;
  25. enum {
  26. EFX_ETHTOOL_STAT_SOURCE_mac_stats,
  27. EFX_ETHTOOL_STAT_SOURCE_nic,
  28. EFX_ETHTOOL_STAT_SOURCE_channel
  29. } source;
  30. unsigned offset;
  31. u64(*get_stat) (void *field); /* Reader function */
  32. };
  33. /* Initialiser for a struct #efx_ethtool_stat with type-checking */
  34. #define EFX_ETHTOOL_STAT(stat_name, source_name, field, field_type, \
  35. get_stat_function) { \
  36. .name = #stat_name, \
  37. .source = EFX_ETHTOOL_STAT_SOURCE_##source_name, \
  38. .offset = ((((field_type *) 0) == \
  39. &((struct efx_##source_name *)0)->field) ? \
  40. offsetof(struct efx_##source_name, field) : \
  41. offsetof(struct efx_##source_name, field)), \
  42. .get_stat = get_stat_function, \
  43. }
  44. static u64 efx_get_uint_stat(void *field)
  45. {
  46. return *(unsigned int *)field;
  47. }
  48. static u64 efx_get_ulong_stat(void *field)
  49. {
  50. return *(unsigned long *)field;
  51. }
  52. static u64 efx_get_u64_stat(void *field)
  53. {
  54. return *(u64 *) field;
  55. }
  56. static u64 efx_get_atomic_stat(void *field)
  57. {
  58. return atomic_read((atomic_t *) field);
  59. }
  60. #define EFX_ETHTOOL_ULONG_MAC_STAT(field) \
  61. EFX_ETHTOOL_STAT(field, mac_stats, field, \
  62. unsigned long, efx_get_ulong_stat)
  63. #define EFX_ETHTOOL_U64_MAC_STAT(field) \
  64. EFX_ETHTOOL_STAT(field, mac_stats, field, \
  65. u64, efx_get_u64_stat)
  66. #define EFX_ETHTOOL_UINT_NIC_STAT(name) \
  67. EFX_ETHTOOL_STAT(name, nic, n_##name, \
  68. unsigned int, efx_get_uint_stat)
  69. #define EFX_ETHTOOL_ATOMIC_NIC_ERROR_STAT(field) \
  70. EFX_ETHTOOL_STAT(field, nic, field, \
  71. atomic_t, efx_get_atomic_stat)
  72. #define EFX_ETHTOOL_UINT_CHANNEL_STAT(field) \
  73. EFX_ETHTOOL_STAT(field, channel, n_##field, \
  74. unsigned int, efx_get_uint_stat)
  75. static struct efx_ethtool_stat efx_ethtool_stats[] = {
  76. EFX_ETHTOOL_U64_MAC_STAT(tx_bytes),
  77. EFX_ETHTOOL_U64_MAC_STAT(tx_good_bytes),
  78. EFX_ETHTOOL_U64_MAC_STAT(tx_bad_bytes),
  79. EFX_ETHTOOL_ULONG_MAC_STAT(tx_packets),
  80. EFX_ETHTOOL_ULONG_MAC_STAT(tx_bad),
  81. EFX_ETHTOOL_ULONG_MAC_STAT(tx_pause),
  82. EFX_ETHTOOL_ULONG_MAC_STAT(tx_control),
  83. EFX_ETHTOOL_ULONG_MAC_STAT(tx_unicast),
  84. EFX_ETHTOOL_ULONG_MAC_STAT(tx_multicast),
  85. EFX_ETHTOOL_ULONG_MAC_STAT(tx_broadcast),
  86. EFX_ETHTOOL_ULONG_MAC_STAT(tx_lt64),
  87. EFX_ETHTOOL_ULONG_MAC_STAT(tx_64),
  88. EFX_ETHTOOL_ULONG_MAC_STAT(tx_65_to_127),
  89. EFX_ETHTOOL_ULONG_MAC_STAT(tx_128_to_255),
  90. EFX_ETHTOOL_ULONG_MAC_STAT(tx_256_to_511),
  91. EFX_ETHTOOL_ULONG_MAC_STAT(tx_512_to_1023),
  92. EFX_ETHTOOL_ULONG_MAC_STAT(tx_1024_to_15xx),
  93. EFX_ETHTOOL_ULONG_MAC_STAT(tx_15xx_to_jumbo),
  94. EFX_ETHTOOL_ULONG_MAC_STAT(tx_gtjumbo),
  95. EFX_ETHTOOL_ULONG_MAC_STAT(tx_collision),
  96. EFX_ETHTOOL_ULONG_MAC_STAT(tx_single_collision),
  97. EFX_ETHTOOL_ULONG_MAC_STAT(tx_multiple_collision),
  98. EFX_ETHTOOL_ULONG_MAC_STAT(tx_excessive_collision),
  99. EFX_ETHTOOL_ULONG_MAC_STAT(tx_deferred),
  100. EFX_ETHTOOL_ULONG_MAC_STAT(tx_late_collision),
  101. EFX_ETHTOOL_ULONG_MAC_STAT(tx_excessive_deferred),
  102. EFX_ETHTOOL_ULONG_MAC_STAT(tx_non_tcpudp),
  103. EFX_ETHTOOL_ULONG_MAC_STAT(tx_mac_src_error),
  104. EFX_ETHTOOL_ULONG_MAC_STAT(tx_ip_src_error),
  105. EFX_ETHTOOL_U64_MAC_STAT(rx_bytes),
  106. EFX_ETHTOOL_U64_MAC_STAT(rx_good_bytes),
  107. EFX_ETHTOOL_U64_MAC_STAT(rx_bad_bytes),
  108. EFX_ETHTOOL_ULONG_MAC_STAT(rx_packets),
  109. EFX_ETHTOOL_ULONG_MAC_STAT(rx_good),
  110. EFX_ETHTOOL_ULONG_MAC_STAT(rx_bad),
  111. EFX_ETHTOOL_ULONG_MAC_STAT(rx_pause),
  112. EFX_ETHTOOL_ULONG_MAC_STAT(rx_control),
  113. EFX_ETHTOOL_ULONG_MAC_STAT(rx_unicast),
  114. EFX_ETHTOOL_ULONG_MAC_STAT(rx_multicast),
  115. EFX_ETHTOOL_ULONG_MAC_STAT(rx_broadcast),
  116. EFX_ETHTOOL_ULONG_MAC_STAT(rx_lt64),
  117. EFX_ETHTOOL_ULONG_MAC_STAT(rx_64),
  118. EFX_ETHTOOL_ULONG_MAC_STAT(rx_65_to_127),
  119. EFX_ETHTOOL_ULONG_MAC_STAT(rx_128_to_255),
  120. EFX_ETHTOOL_ULONG_MAC_STAT(rx_256_to_511),
  121. EFX_ETHTOOL_ULONG_MAC_STAT(rx_512_to_1023),
  122. EFX_ETHTOOL_ULONG_MAC_STAT(rx_1024_to_15xx),
  123. EFX_ETHTOOL_ULONG_MAC_STAT(rx_15xx_to_jumbo),
  124. EFX_ETHTOOL_ULONG_MAC_STAT(rx_gtjumbo),
  125. EFX_ETHTOOL_ULONG_MAC_STAT(rx_bad_lt64),
  126. EFX_ETHTOOL_ULONG_MAC_STAT(rx_bad_64_to_15xx),
  127. EFX_ETHTOOL_ULONG_MAC_STAT(rx_bad_15xx_to_jumbo),
  128. EFX_ETHTOOL_ULONG_MAC_STAT(rx_bad_gtjumbo),
  129. EFX_ETHTOOL_ULONG_MAC_STAT(rx_overflow),
  130. EFX_ETHTOOL_ULONG_MAC_STAT(rx_missed),
  131. EFX_ETHTOOL_ULONG_MAC_STAT(rx_false_carrier),
  132. EFX_ETHTOOL_ULONG_MAC_STAT(rx_symbol_error),
  133. EFX_ETHTOOL_ULONG_MAC_STAT(rx_align_error),
  134. EFX_ETHTOOL_ULONG_MAC_STAT(rx_length_error),
  135. EFX_ETHTOOL_ULONG_MAC_STAT(rx_internal_error),
  136. EFX_ETHTOOL_UINT_NIC_STAT(rx_nodesc_drop_cnt),
  137. EFX_ETHTOOL_ATOMIC_NIC_ERROR_STAT(rx_reset),
  138. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_tobe_disc),
  139. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_ip_hdr_chksum_err),
  140. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_tcp_udp_chksum_err),
  141. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_mcast_mismatch),
  142. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_frm_trunc),
  143. };
  144. /* Number of ethtool statistics */
  145. #define EFX_ETHTOOL_NUM_STATS ARRAY_SIZE(efx_ethtool_stats)
  146. #define EFX_ETHTOOL_EEPROM_MAGIC 0xEFAB
  147. /**************************************************************************
  148. *
  149. * Ethtool operations
  150. *
  151. **************************************************************************
  152. */
  153. /* Identify device by flashing LEDs */
  154. static int efx_ethtool_phys_id(struct net_device *net_dev, u32 count)
  155. {
  156. struct efx_nic *efx = netdev_priv(net_dev);
  157. do {
  158. efx->type->set_id_led(efx, EFX_LED_ON);
  159. schedule_timeout_interruptible(HZ / 2);
  160. efx->type->set_id_led(efx, EFX_LED_OFF);
  161. schedule_timeout_interruptible(HZ / 2);
  162. } while (!signal_pending(current) && --count != 0);
  163. efx->type->set_id_led(efx, EFX_LED_DEFAULT);
  164. return 0;
  165. }
  166. /* This must be called with rtnl_lock held. */
  167. static int efx_ethtool_get_settings(struct net_device *net_dev,
  168. struct ethtool_cmd *ecmd)
  169. {
  170. struct efx_nic *efx = netdev_priv(net_dev);
  171. struct efx_link_state *link_state = &efx->link_state;
  172. mutex_lock(&efx->mac_lock);
  173. efx->phy_op->get_settings(efx, ecmd);
  174. mutex_unlock(&efx->mac_lock);
  175. /* GMAC does not support 1000Mbps HD */
  176. ecmd->supported &= ~SUPPORTED_1000baseT_Half;
  177. /* Both MACs support pause frames (bidirectional and respond-only) */
  178. ecmd->supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
  179. if (LOOPBACK_INTERNAL(efx)) {
  180. ecmd->speed = link_state->speed;
  181. ecmd->duplex = link_state->fd ? DUPLEX_FULL : DUPLEX_HALF;
  182. }
  183. return 0;
  184. }
  185. /* This must be called with rtnl_lock held. */
  186. static int efx_ethtool_set_settings(struct net_device *net_dev,
  187. struct ethtool_cmd *ecmd)
  188. {
  189. struct efx_nic *efx = netdev_priv(net_dev);
  190. int rc;
  191. /* GMAC does not support 1000Mbps HD */
  192. if (ecmd->speed == SPEED_1000 && ecmd->duplex != DUPLEX_FULL) {
  193. netif_dbg(efx, drv, efx->net_dev,
  194. "rejecting unsupported 1000Mbps HD setting\n");
  195. return -EINVAL;
  196. }
  197. mutex_lock(&efx->mac_lock);
  198. rc = efx->phy_op->set_settings(efx, ecmd);
  199. mutex_unlock(&efx->mac_lock);
  200. return rc;
  201. }
  202. static void efx_ethtool_get_drvinfo(struct net_device *net_dev,
  203. struct ethtool_drvinfo *info)
  204. {
  205. struct efx_nic *efx = netdev_priv(net_dev);
  206. strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
  207. strlcpy(info->version, EFX_DRIVER_VERSION, sizeof(info->version));
  208. if (efx_nic_rev(efx) >= EFX_REV_SIENA_A0)
  209. siena_print_fwver(efx, info->fw_version,
  210. sizeof(info->fw_version));
  211. strlcpy(info->bus_info, pci_name(efx->pci_dev), sizeof(info->bus_info));
  212. }
  213. static int efx_ethtool_get_regs_len(struct net_device *net_dev)
  214. {
  215. return efx_nic_get_regs_len(netdev_priv(net_dev));
  216. }
  217. static void efx_ethtool_get_regs(struct net_device *net_dev,
  218. struct ethtool_regs *regs, void *buf)
  219. {
  220. struct efx_nic *efx = netdev_priv(net_dev);
  221. regs->version = efx->type->revision;
  222. efx_nic_get_regs(efx, buf);
  223. }
  224. static u32 efx_ethtool_get_msglevel(struct net_device *net_dev)
  225. {
  226. struct efx_nic *efx = netdev_priv(net_dev);
  227. return efx->msg_enable;
  228. }
  229. static void efx_ethtool_set_msglevel(struct net_device *net_dev, u32 msg_enable)
  230. {
  231. struct efx_nic *efx = netdev_priv(net_dev);
  232. efx->msg_enable = msg_enable;
  233. }
  234. /**
  235. * efx_fill_test - fill in an individual self-test entry
  236. * @test_index: Index of the test
  237. * @strings: Ethtool strings, or %NULL
  238. * @data: Ethtool test results, or %NULL
  239. * @test: Pointer to test result (used only if data != %NULL)
  240. * @unit_format: Unit name format (e.g. "chan\%d")
  241. * @unit_id: Unit id (e.g. 0 for "chan0")
  242. * @test_format: Test name format (e.g. "loopback.\%s.tx.sent")
  243. * @test_id: Test id (e.g. "PHYXS" for "loopback.PHYXS.tx_sent")
  244. *
  245. * Fill in an individual self-test entry.
  246. */
  247. static void efx_fill_test(unsigned int test_index,
  248. struct ethtool_string *strings, u64 *data,
  249. int *test, const char *unit_format, int unit_id,
  250. const char *test_format, const char *test_id)
  251. {
  252. struct ethtool_string unit_str, test_str;
  253. /* Fill data value, if applicable */
  254. if (data)
  255. data[test_index] = *test;
  256. /* Fill string, if applicable */
  257. if (strings) {
  258. if (strchr(unit_format, '%'))
  259. snprintf(unit_str.name, sizeof(unit_str.name),
  260. unit_format, unit_id);
  261. else
  262. strcpy(unit_str.name, unit_format);
  263. snprintf(test_str.name, sizeof(test_str.name),
  264. test_format, test_id);
  265. snprintf(strings[test_index].name,
  266. sizeof(strings[test_index].name),
  267. "%-6s %-24s", unit_str.name, test_str.name);
  268. }
  269. }
  270. #define EFX_CHANNEL_NAME(_channel) "chan%d", _channel->channel
  271. #define EFX_TX_QUEUE_NAME(_tx_queue) "txq%d", _tx_queue->queue
  272. #define EFX_RX_QUEUE_NAME(_rx_queue) "rxq%d", _rx_queue->queue
  273. #define EFX_LOOPBACK_NAME(_mode, _counter) \
  274. "loopback.%s." _counter, STRING_TABLE_LOOKUP(_mode, efx_loopback_mode)
  275. /**
  276. * efx_fill_loopback_test - fill in a block of loopback self-test entries
  277. * @efx: Efx NIC
  278. * @lb_tests: Efx loopback self-test results structure
  279. * @mode: Loopback test mode
  280. * @test_index: Starting index of the test
  281. * @strings: Ethtool strings, or %NULL
  282. * @data: Ethtool test results, or %NULL
  283. */
  284. static int efx_fill_loopback_test(struct efx_nic *efx,
  285. struct efx_loopback_self_tests *lb_tests,
  286. enum efx_loopback_mode mode,
  287. unsigned int test_index,
  288. struct ethtool_string *strings, u64 *data)
  289. {
  290. struct efx_channel *channel = efx_get_channel(efx, 0);
  291. struct efx_tx_queue *tx_queue;
  292. efx_for_each_channel_tx_queue(tx_queue, channel) {
  293. efx_fill_test(test_index++, strings, data,
  294. &lb_tests->tx_sent[tx_queue->queue],
  295. EFX_TX_QUEUE_NAME(tx_queue),
  296. EFX_LOOPBACK_NAME(mode, "tx_sent"));
  297. efx_fill_test(test_index++, strings, data,
  298. &lb_tests->tx_done[tx_queue->queue],
  299. EFX_TX_QUEUE_NAME(tx_queue),
  300. EFX_LOOPBACK_NAME(mode, "tx_done"));
  301. }
  302. efx_fill_test(test_index++, strings, data,
  303. &lb_tests->rx_good,
  304. "rx", 0,
  305. EFX_LOOPBACK_NAME(mode, "rx_good"));
  306. efx_fill_test(test_index++, strings, data,
  307. &lb_tests->rx_bad,
  308. "rx", 0,
  309. EFX_LOOPBACK_NAME(mode, "rx_bad"));
  310. return test_index;
  311. }
  312. /**
  313. * efx_ethtool_fill_self_tests - get self-test details
  314. * @efx: Efx NIC
  315. * @tests: Efx self-test results structure, or %NULL
  316. * @strings: Ethtool strings, or %NULL
  317. * @data: Ethtool test results, or %NULL
  318. */
  319. static int efx_ethtool_fill_self_tests(struct efx_nic *efx,
  320. struct efx_self_tests *tests,
  321. struct ethtool_string *strings,
  322. u64 *data)
  323. {
  324. struct efx_channel *channel;
  325. unsigned int n = 0, i;
  326. enum efx_loopback_mode mode;
  327. efx_fill_test(n++, strings, data, &tests->phy_alive,
  328. "phy", 0, "alive", NULL);
  329. efx_fill_test(n++, strings, data, &tests->nvram,
  330. "core", 0, "nvram", NULL);
  331. efx_fill_test(n++, strings, data, &tests->interrupt,
  332. "core", 0, "interrupt", NULL);
  333. /* Event queues */
  334. efx_for_each_channel(channel, efx) {
  335. efx_fill_test(n++, strings, data,
  336. &tests->eventq_dma[channel->channel],
  337. EFX_CHANNEL_NAME(channel),
  338. "eventq.dma", NULL);
  339. efx_fill_test(n++, strings, data,
  340. &tests->eventq_int[channel->channel],
  341. EFX_CHANNEL_NAME(channel),
  342. "eventq.int", NULL);
  343. efx_fill_test(n++, strings, data,
  344. &tests->eventq_poll[channel->channel],
  345. EFX_CHANNEL_NAME(channel),
  346. "eventq.poll", NULL);
  347. }
  348. efx_fill_test(n++, strings, data, &tests->registers,
  349. "core", 0, "registers", NULL);
  350. if (efx->phy_op->run_tests != NULL) {
  351. EFX_BUG_ON_PARANOID(efx->phy_op->test_name == NULL);
  352. for (i = 0; true; ++i) {
  353. const char *name;
  354. EFX_BUG_ON_PARANOID(i >= EFX_MAX_PHY_TESTS);
  355. name = efx->phy_op->test_name(efx, i);
  356. if (name == NULL)
  357. break;
  358. efx_fill_test(n++, strings, data, &tests->phy_ext[i],
  359. "phy", 0, name, NULL);
  360. }
  361. }
  362. /* Loopback tests */
  363. for (mode = LOOPBACK_NONE; mode <= LOOPBACK_TEST_MAX; mode++) {
  364. if (!(efx->loopback_modes & (1 << mode)))
  365. continue;
  366. n = efx_fill_loopback_test(efx,
  367. &tests->loopback[mode], mode, n,
  368. strings, data);
  369. }
  370. return n;
  371. }
  372. static int efx_ethtool_get_sset_count(struct net_device *net_dev,
  373. int string_set)
  374. {
  375. switch (string_set) {
  376. case ETH_SS_STATS:
  377. return EFX_ETHTOOL_NUM_STATS;
  378. case ETH_SS_TEST:
  379. return efx_ethtool_fill_self_tests(netdev_priv(net_dev),
  380. NULL, NULL, NULL);
  381. default:
  382. return -EINVAL;
  383. }
  384. }
  385. static void efx_ethtool_get_strings(struct net_device *net_dev,
  386. u32 string_set, u8 *strings)
  387. {
  388. struct efx_nic *efx = netdev_priv(net_dev);
  389. struct ethtool_string *ethtool_strings =
  390. (struct ethtool_string *)strings;
  391. int i;
  392. switch (string_set) {
  393. case ETH_SS_STATS:
  394. for (i = 0; i < EFX_ETHTOOL_NUM_STATS; i++)
  395. strncpy(ethtool_strings[i].name,
  396. efx_ethtool_stats[i].name,
  397. sizeof(ethtool_strings[i].name));
  398. break;
  399. case ETH_SS_TEST:
  400. efx_ethtool_fill_self_tests(efx, NULL,
  401. ethtool_strings, NULL);
  402. break;
  403. default:
  404. /* No other string sets */
  405. break;
  406. }
  407. }
  408. static void efx_ethtool_get_stats(struct net_device *net_dev,
  409. struct ethtool_stats *stats,
  410. u64 *data)
  411. {
  412. struct efx_nic *efx = netdev_priv(net_dev);
  413. struct efx_mac_stats *mac_stats = &efx->mac_stats;
  414. struct efx_ethtool_stat *stat;
  415. struct efx_channel *channel;
  416. struct rtnl_link_stats64 temp;
  417. int i;
  418. EFX_BUG_ON_PARANOID(stats->n_stats != EFX_ETHTOOL_NUM_STATS);
  419. /* Update MAC and NIC statistics */
  420. dev_get_stats(net_dev, &temp);
  421. /* Fill detailed statistics buffer */
  422. for (i = 0; i < EFX_ETHTOOL_NUM_STATS; i++) {
  423. stat = &efx_ethtool_stats[i];
  424. switch (stat->source) {
  425. case EFX_ETHTOOL_STAT_SOURCE_mac_stats:
  426. data[i] = stat->get_stat((void *)mac_stats +
  427. stat->offset);
  428. break;
  429. case EFX_ETHTOOL_STAT_SOURCE_nic:
  430. data[i] = stat->get_stat((void *)efx + stat->offset);
  431. break;
  432. case EFX_ETHTOOL_STAT_SOURCE_channel:
  433. data[i] = 0;
  434. efx_for_each_channel(channel, efx)
  435. data[i] += stat->get_stat((void *)channel +
  436. stat->offset);
  437. break;
  438. }
  439. }
  440. }
  441. static int efx_ethtool_set_tso(struct net_device *net_dev, u32 enable)
  442. {
  443. struct efx_nic *efx __attribute__ ((unused)) = netdev_priv(net_dev);
  444. unsigned long features;
  445. features = NETIF_F_TSO;
  446. if (efx->type->offload_features & NETIF_F_V6_CSUM)
  447. features |= NETIF_F_TSO6;
  448. if (enable)
  449. net_dev->features |= features;
  450. else
  451. net_dev->features &= ~features;
  452. return 0;
  453. }
  454. static int efx_ethtool_set_tx_csum(struct net_device *net_dev, u32 enable)
  455. {
  456. struct efx_nic *efx = netdev_priv(net_dev);
  457. unsigned long features = efx->type->offload_features & NETIF_F_ALL_CSUM;
  458. if (enable)
  459. net_dev->features |= features;
  460. else
  461. net_dev->features &= ~features;
  462. return 0;
  463. }
  464. static int efx_ethtool_set_rx_csum(struct net_device *net_dev, u32 enable)
  465. {
  466. struct efx_nic *efx = netdev_priv(net_dev);
  467. /* No way to stop the hardware doing the checks; we just
  468. * ignore the result.
  469. */
  470. efx->rx_checksum_enabled = !!enable;
  471. return 0;
  472. }
  473. static u32 efx_ethtool_get_rx_csum(struct net_device *net_dev)
  474. {
  475. struct efx_nic *efx = netdev_priv(net_dev);
  476. return efx->rx_checksum_enabled;
  477. }
  478. static int efx_ethtool_set_flags(struct net_device *net_dev, u32 data)
  479. {
  480. struct efx_nic *efx = netdev_priv(net_dev);
  481. u32 supported = (efx->type->offload_features &
  482. (ETH_FLAG_RXHASH | ETH_FLAG_NTUPLE));
  483. int rc;
  484. rc = ethtool_op_set_flags(net_dev, data, supported);
  485. if (rc)
  486. return rc;
  487. if (!(data & ETH_FLAG_NTUPLE)) {
  488. efx_filter_table_clear(efx, EFX_FILTER_TABLE_RX_IP,
  489. EFX_FILTER_PRI_MANUAL);
  490. efx_filter_table_clear(efx, EFX_FILTER_TABLE_RX_MAC,
  491. EFX_FILTER_PRI_MANUAL);
  492. }
  493. return 0;
  494. }
  495. static void efx_ethtool_self_test(struct net_device *net_dev,
  496. struct ethtool_test *test, u64 *data)
  497. {
  498. struct efx_nic *efx = netdev_priv(net_dev);
  499. struct efx_self_tests efx_tests;
  500. int already_up;
  501. int rc;
  502. ASSERT_RTNL();
  503. if (efx->state != STATE_RUNNING) {
  504. rc = -EIO;
  505. goto fail1;
  506. }
  507. /* We need rx buffers and interrupts. */
  508. already_up = (efx->net_dev->flags & IFF_UP);
  509. if (!already_up) {
  510. rc = dev_open(efx->net_dev);
  511. if (rc) {
  512. netif_err(efx, drv, efx->net_dev,
  513. "failed opening device.\n");
  514. goto fail2;
  515. }
  516. }
  517. memset(&efx_tests, 0, sizeof(efx_tests));
  518. rc = efx_selftest(efx, &efx_tests, test->flags);
  519. if (!already_up)
  520. dev_close(efx->net_dev);
  521. netif_dbg(efx, drv, efx->net_dev, "%s %sline self-tests\n",
  522. rc == 0 ? "passed" : "failed",
  523. (test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on");
  524. fail2:
  525. fail1:
  526. /* Fill ethtool results structures */
  527. efx_ethtool_fill_self_tests(efx, &efx_tests, NULL, data);
  528. if (rc)
  529. test->flags |= ETH_TEST_FL_FAILED;
  530. }
  531. /* Restart autonegotiation */
  532. static int efx_ethtool_nway_reset(struct net_device *net_dev)
  533. {
  534. struct efx_nic *efx = netdev_priv(net_dev);
  535. return mdio45_nway_restart(&efx->mdio);
  536. }
  537. static u32 efx_ethtool_get_link(struct net_device *net_dev)
  538. {
  539. struct efx_nic *efx = netdev_priv(net_dev);
  540. return efx->link_state.up;
  541. }
  542. static int efx_ethtool_get_coalesce(struct net_device *net_dev,
  543. struct ethtool_coalesce *coalesce)
  544. {
  545. struct efx_nic *efx = netdev_priv(net_dev);
  546. struct efx_channel *channel;
  547. memset(coalesce, 0, sizeof(*coalesce));
  548. /* Find lowest IRQ moderation across all used TX queues */
  549. coalesce->tx_coalesce_usecs_irq = ~((u32) 0);
  550. efx_for_each_channel(channel, efx) {
  551. if (!efx_channel_get_tx_queue(channel, 0))
  552. continue;
  553. if (channel->irq_moderation < coalesce->tx_coalesce_usecs_irq) {
  554. if (channel->channel < efx->n_rx_channels)
  555. coalesce->tx_coalesce_usecs_irq =
  556. channel->irq_moderation;
  557. else
  558. coalesce->tx_coalesce_usecs_irq = 0;
  559. }
  560. }
  561. coalesce->use_adaptive_rx_coalesce = efx->irq_rx_adaptive;
  562. coalesce->rx_coalesce_usecs_irq = efx->irq_rx_moderation;
  563. coalesce->tx_coalesce_usecs_irq *= EFX_IRQ_MOD_RESOLUTION;
  564. coalesce->rx_coalesce_usecs_irq *= EFX_IRQ_MOD_RESOLUTION;
  565. return 0;
  566. }
  567. /* Set coalescing parameters
  568. * The difficulties occur for shared channels
  569. */
  570. static int efx_ethtool_set_coalesce(struct net_device *net_dev,
  571. struct ethtool_coalesce *coalesce)
  572. {
  573. struct efx_nic *efx = netdev_priv(net_dev);
  574. struct efx_channel *channel;
  575. unsigned tx_usecs, rx_usecs, adaptive;
  576. if (coalesce->use_adaptive_tx_coalesce)
  577. return -EOPNOTSUPP;
  578. if (coalesce->rx_coalesce_usecs || coalesce->tx_coalesce_usecs) {
  579. netif_err(efx, drv, efx->net_dev, "invalid coalescing setting. "
  580. "Only rx/tx_coalesce_usecs_irq are supported\n");
  581. return -EOPNOTSUPP;
  582. }
  583. rx_usecs = coalesce->rx_coalesce_usecs_irq;
  584. tx_usecs = coalesce->tx_coalesce_usecs_irq;
  585. adaptive = coalesce->use_adaptive_rx_coalesce;
  586. /* If the channel is shared only allow RX parameters to be set */
  587. efx_for_each_channel(channel, efx) {
  588. if (efx_channel_get_rx_queue(channel) &&
  589. efx_channel_get_tx_queue(channel, 0) &&
  590. tx_usecs) {
  591. netif_err(efx, drv, efx->net_dev, "Channel is shared. "
  592. "Only RX coalescing may be set\n");
  593. return -EOPNOTSUPP;
  594. }
  595. }
  596. efx_init_irq_moderation(efx, tx_usecs, rx_usecs, adaptive);
  597. efx_for_each_channel(channel, efx)
  598. efx->type->push_irq_moderation(channel);
  599. return 0;
  600. }
  601. static void efx_ethtool_get_ringparam(struct net_device *net_dev,
  602. struct ethtool_ringparam *ring)
  603. {
  604. struct efx_nic *efx = netdev_priv(net_dev);
  605. ring->rx_max_pending = EFX_MAX_DMAQ_SIZE;
  606. ring->tx_max_pending = EFX_MAX_DMAQ_SIZE;
  607. ring->rx_mini_max_pending = 0;
  608. ring->rx_jumbo_max_pending = 0;
  609. ring->rx_pending = efx->rxq_entries;
  610. ring->tx_pending = efx->txq_entries;
  611. ring->rx_mini_pending = 0;
  612. ring->rx_jumbo_pending = 0;
  613. }
  614. static int efx_ethtool_set_ringparam(struct net_device *net_dev,
  615. struct ethtool_ringparam *ring)
  616. {
  617. struct efx_nic *efx = netdev_priv(net_dev);
  618. if (ring->rx_mini_pending || ring->rx_jumbo_pending ||
  619. ring->rx_pending > EFX_MAX_DMAQ_SIZE ||
  620. ring->tx_pending > EFX_MAX_DMAQ_SIZE)
  621. return -EINVAL;
  622. if (ring->rx_pending < EFX_MIN_RING_SIZE ||
  623. ring->tx_pending < EFX_MIN_RING_SIZE) {
  624. netif_err(efx, drv, efx->net_dev,
  625. "TX and RX queues cannot be smaller than %ld\n",
  626. EFX_MIN_RING_SIZE);
  627. return -EINVAL;
  628. }
  629. return efx_realloc_channels(efx, ring->rx_pending, ring->tx_pending);
  630. }
  631. static int efx_ethtool_set_pauseparam(struct net_device *net_dev,
  632. struct ethtool_pauseparam *pause)
  633. {
  634. struct efx_nic *efx = netdev_priv(net_dev);
  635. enum efx_fc_type wanted_fc, old_fc;
  636. u32 old_adv;
  637. bool reset;
  638. int rc = 0;
  639. mutex_lock(&efx->mac_lock);
  640. wanted_fc = ((pause->rx_pause ? EFX_FC_RX : 0) |
  641. (pause->tx_pause ? EFX_FC_TX : 0) |
  642. (pause->autoneg ? EFX_FC_AUTO : 0));
  643. if ((wanted_fc & EFX_FC_TX) && !(wanted_fc & EFX_FC_RX)) {
  644. netif_dbg(efx, drv, efx->net_dev,
  645. "Flow control unsupported: tx ON rx OFF\n");
  646. rc = -EINVAL;
  647. goto out;
  648. }
  649. if ((wanted_fc & EFX_FC_AUTO) && !efx->link_advertising) {
  650. netif_dbg(efx, drv, efx->net_dev,
  651. "Autonegotiation is disabled\n");
  652. rc = -EINVAL;
  653. goto out;
  654. }
  655. /* TX flow control may automatically turn itself off if the
  656. * link partner (intermittently) stops responding to pause
  657. * frames. There isn't any indication that this has happened,
  658. * so the best we do is leave it up to the user to spot this
  659. * and fix it be cycling transmit flow control on this end. */
  660. reset = (wanted_fc & EFX_FC_TX) && !(efx->wanted_fc & EFX_FC_TX);
  661. if (EFX_WORKAROUND_11482(efx) && reset) {
  662. if (efx_nic_rev(efx) == EFX_REV_FALCON_B0) {
  663. /* Recover by resetting the EM block */
  664. falcon_stop_nic_stats(efx);
  665. falcon_drain_tx_fifo(efx);
  666. efx->mac_op->reconfigure(efx);
  667. falcon_start_nic_stats(efx);
  668. } else {
  669. /* Schedule a reset to recover */
  670. efx_schedule_reset(efx, RESET_TYPE_INVISIBLE);
  671. }
  672. }
  673. old_adv = efx->link_advertising;
  674. old_fc = efx->wanted_fc;
  675. efx_link_set_wanted_fc(efx, wanted_fc);
  676. if (efx->link_advertising != old_adv ||
  677. (efx->wanted_fc ^ old_fc) & EFX_FC_AUTO) {
  678. rc = efx->phy_op->reconfigure(efx);
  679. if (rc) {
  680. netif_err(efx, drv, efx->net_dev,
  681. "Unable to advertise requested flow "
  682. "control setting\n");
  683. goto out;
  684. }
  685. }
  686. /* Reconfigure the MAC. The PHY *may* generate a link state change event
  687. * if the user just changed the advertised capabilities, but there's no
  688. * harm doing this twice */
  689. efx->mac_op->reconfigure(efx);
  690. out:
  691. mutex_unlock(&efx->mac_lock);
  692. return rc;
  693. }
  694. static void efx_ethtool_get_pauseparam(struct net_device *net_dev,
  695. struct ethtool_pauseparam *pause)
  696. {
  697. struct efx_nic *efx = netdev_priv(net_dev);
  698. pause->rx_pause = !!(efx->wanted_fc & EFX_FC_RX);
  699. pause->tx_pause = !!(efx->wanted_fc & EFX_FC_TX);
  700. pause->autoneg = !!(efx->wanted_fc & EFX_FC_AUTO);
  701. }
  702. static void efx_ethtool_get_wol(struct net_device *net_dev,
  703. struct ethtool_wolinfo *wol)
  704. {
  705. struct efx_nic *efx = netdev_priv(net_dev);
  706. return efx->type->get_wol(efx, wol);
  707. }
  708. static int efx_ethtool_set_wol(struct net_device *net_dev,
  709. struct ethtool_wolinfo *wol)
  710. {
  711. struct efx_nic *efx = netdev_priv(net_dev);
  712. return efx->type->set_wol(efx, wol->wolopts);
  713. }
  714. static int efx_ethtool_reset(struct net_device *net_dev, u32 *flags)
  715. {
  716. struct efx_nic *efx = netdev_priv(net_dev);
  717. enum reset_type method;
  718. enum {
  719. ETH_RESET_EFX_INVISIBLE = (ETH_RESET_DMA | ETH_RESET_FILTER |
  720. ETH_RESET_OFFLOAD | ETH_RESET_MAC)
  721. };
  722. /* Check for minimal reset flags */
  723. if ((*flags & ETH_RESET_EFX_INVISIBLE) != ETH_RESET_EFX_INVISIBLE)
  724. return -EINVAL;
  725. *flags ^= ETH_RESET_EFX_INVISIBLE;
  726. method = RESET_TYPE_INVISIBLE;
  727. if (*flags & ETH_RESET_PHY) {
  728. *flags ^= ETH_RESET_PHY;
  729. method = RESET_TYPE_ALL;
  730. }
  731. if ((*flags & efx->type->reset_world_flags) ==
  732. efx->type->reset_world_flags) {
  733. *flags ^= efx->type->reset_world_flags;
  734. method = RESET_TYPE_WORLD;
  735. }
  736. return efx_reset(efx, method);
  737. }
  738. static int
  739. efx_ethtool_get_rxnfc(struct net_device *net_dev,
  740. struct ethtool_rxnfc *info, void *rules __always_unused)
  741. {
  742. struct efx_nic *efx = netdev_priv(net_dev);
  743. switch (info->cmd) {
  744. case ETHTOOL_GRXRINGS:
  745. info->data = efx->n_rx_channels;
  746. return 0;
  747. case ETHTOOL_GRXFH: {
  748. unsigned min_revision = 0;
  749. info->data = 0;
  750. switch (info->flow_type) {
  751. case TCP_V4_FLOW:
  752. info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
  753. /* fall through */
  754. case UDP_V4_FLOW:
  755. case SCTP_V4_FLOW:
  756. case AH_ESP_V4_FLOW:
  757. case IPV4_FLOW:
  758. info->data |= RXH_IP_SRC | RXH_IP_DST;
  759. min_revision = EFX_REV_FALCON_B0;
  760. break;
  761. case TCP_V6_FLOW:
  762. info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
  763. /* fall through */
  764. case UDP_V6_FLOW:
  765. case SCTP_V6_FLOW:
  766. case AH_ESP_V6_FLOW:
  767. case IPV6_FLOW:
  768. info->data |= RXH_IP_SRC | RXH_IP_DST;
  769. min_revision = EFX_REV_SIENA_A0;
  770. break;
  771. default:
  772. break;
  773. }
  774. if (efx_nic_rev(efx) < min_revision)
  775. info->data = 0;
  776. return 0;
  777. }
  778. default:
  779. return -EOPNOTSUPP;
  780. }
  781. }
  782. static int efx_ethtool_set_rx_ntuple(struct net_device *net_dev,
  783. struct ethtool_rx_ntuple *ntuple)
  784. {
  785. struct efx_nic *efx = netdev_priv(net_dev);
  786. struct ethtool_tcpip4_spec *ip_entry = &ntuple->fs.h_u.tcp_ip4_spec;
  787. struct ethtool_tcpip4_spec *ip_mask = &ntuple->fs.m_u.tcp_ip4_spec;
  788. struct ethhdr *mac_entry = &ntuple->fs.h_u.ether_spec;
  789. struct ethhdr *mac_mask = &ntuple->fs.m_u.ether_spec;
  790. struct efx_filter_spec filter;
  791. /* Range-check action */
  792. if (ntuple->fs.action < ETHTOOL_RXNTUPLE_ACTION_CLEAR ||
  793. ntuple->fs.action >= (s32)efx->n_rx_channels)
  794. return -EINVAL;
  795. if (~ntuple->fs.data_mask)
  796. return -EINVAL;
  797. switch (ntuple->fs.flow_type) {
  798. case TCP_V4_FLOW:
  799. case UDP_V4_FLOW:
  800. /* Must match all of destination, */
  801. if (ip_mask->ip4dst | ip_mask->pdst)
  802. return -EINVAL;
  803. /* all or none of source, */
  804. if ((ip_mask->ip4src | ip_mask->psrc) &&
  805. ((__force u32)~ip_mask->ip4src |
  806. (__force u16)~ip_mask->psrc))
  807. return -EINVAL;
  808. /* and nothing else */
  809. if ((u8)~ip_mask->tos | (u16)~ntuple->fs.vlan_tag_mask)
  810. return -EINVAL;
  811. break;
  812. case ETHER_FLOW:
  813. /* Must match all of destination, */
  814. if (!is_zero_ether_addr(mac_mask->h_dest))
  815. return -EINVAL;
  816. /* all or none of VID, */
  817. if (ntuple->fs.vlan_tag_mask != 0xf000 &&
  818. ntuple->fs.vlan_tag_mask != 0xffff)
  819. return -EINVAL;
  820. /* and nothing else */
  821. if (!is_broadcast_ether_addr(mac_mask->h_source) ||
  822. mac_mask->h_proto != htons(0xffff))
  823. return -EINVAL;
  824. break;
  825. default:
  826. return -EINVAL;
  827. }
  828. filter.priority = EFX_FILTER_PRI_MANUAL;
  829. filter.flags = 0;
  830. switch (ntuple->fs.flow_type) {
  831. case TCP_V4_FLOW:
  832. if (!ip_mask->ip4src)
  833. efx_filter_set_rx_tcp_full(&filter,
  834. htonl(ip_entry->ip4src),
  835. htons(ip_entry->psrc),
  836. htonl(ip_entry->ip4dst),
  837. htons(ip_entry->pdst));
  838. else
  839. efx_filter_set_rx_tcp_wild(&filter,
  840. htonl(ip_entry->ip4dst),
  841. htons(ip_entry->pdst));
  842. break;
  843. case UDP_V4_FLOW:
  844. if (!ip_mask->ip4src)
  845. efx_filter_set_rx_udp_full(&filter,
  846. htonl(ip_entry->ip4src),
  847. htons(ip_entry->psrc),
  848. htonl(ip_entry->ip4dst),
  849. htons(ip_entry->pdst));
  850. else
  851. efx_filter_set_rx_udp_wild(&filter,
  852. htonl(ip_entry->ip4dst),
  853. htons(ip_entry->pdst));
  854. break;
  855. case ETHER_FLOW:
  856. if (ntuple->fs.vlan_tag_mask == 0xf000)
  857. efx_filter_set_rx_mac_full(&filter,
  858. ntuple->fs.vlan_tag & 0xfff,
  859. mac_entry->h_dest);
  860. else
  861. efx_filter_set_rx_mac_wild(&filter, mac_entry->h_dest);
  862. break;
  863. }
  864. if (ntuple->fs.action == ETHTOOL_RXNTUPLE_ACTION_CLEAR) {
  865. return efx_filter_remove_filter(efx, &filter);
  866. } else {
  867. if (ntuple->fs.action == ETHTOOL_RXNTUPLE_ACTION_DROP)
  868. filter.dmaq_id = 0xfff;
  869. else
  870. filter.dmaq_id = ntuple->fs.action;
  871. return efx_filter_insert_filter(efx, &filter, true);
  872. }
  873. }
  874. static int efx_ethtool_get_rxfh_indir(struct net_device *net_dev,
  875. struct ethtool_rxfh_indir *indir)
  876. {
  877. struct efx_nic *efx = netdev_priv(net_dev);
  878. size_t copy_size =
  879. min_t(size_t, indir->size, ARRAY_SIZE(efx->rx_indir_table));
  880. if (efx_nic_rev(efx) < EFX_REV_FALCON_B0)
  881. return -EOPNOTSUPP;
  882. indir->size = ARRAY_SIZE(efx->rx_indir_table);
  883. memcpy(indir->ring_index, efx->rx_indir_table,
  884. copy_size * sizeof(indir->ring_index[0]));
  885. return 0;
  886. }
  887. static int efx_ethtool_set_rxfh_indir(struct net_device *net_dev,
  888. const struct ethtool_rxfh_indir *indir)
  889. {
  890. struct efx_nic *efx = netdev_priv(net_dev);
  891. size_t i;
  892. if (efx_nic_rev(efx) < EFX_REV_FALCON_B0)
  893. return -EOPNOTSUPP;
  894. /* Validate size and indices */
  895. if (indir->size != ARRAY_SIZE(efx->rx_indir_table))
  896. return -EINVAL;
  897. for (i = 0; i < ARRAY_SIZE(efx->rx_indir_table); i++)
  898. if (indir->ring_index[i] >= efx->n_rx_channels)
  899. return -EINVAL;
  900. memcpy(efx->rx_indir_table, indir->ring_index,
  901. sizeof(efx->rx_indir_table));
  902. efx_nic_push_rx_indir_table(efx);
  903. return 0;
  904. }
  905. const struct ethtool_ops efx_ethtool_ops = {
  906. .get_settings = efx_ethtool_get_settings,
  907. .set_settings = efx_ethtool_set_settings,
  908. .get_drvinfo = efx_ethtool_get_drvinfo,
  909. .get_regs_len = efx_ethtool_get_regs_len,
  910. .get_regs = efx_ethtool_get_regs,
  911. .get_msglevel = efx_ethtool_get_msglevel,
  912. .set_msglevel = efx_ethtool_set_msglevel,
  913. .nway_reset = efx_ethtool_nway_reset,
  914. .get_link = efx_ethtool_get_link,
  915. .get_coalesce = efx_ethtool_get_coalesce,
  916. .set_coalesce = efx_ethtool_set_coalesce,
  917. .get_ringparam = efx_ethtool_get_ringparam,
  918. .set_ringparam = efx_ethtool_set_ringparam,
  919. .get_pauseparam = efx_ethtool_get_pauseparam,
  920. .set_pauseparam = efx_ethtool_set_pauseparam,
  921. .get_rx_csum = efx_ethtool_get_rx_csum,
  922. .set_rx_csum = efx_ethtool_set_rx_csum,
  923. .get_tx_csum = ethtool_op_get_tx_csum,
  924. /* Need to enable/disable IPv6 too */
  925. .set_tx_csum = efx_ethtool_set_tx_csum,
  926. .get_sg = ethtool_op_get_sg,
  927. .set_sg = ethtool_op_set_sg,
  928. .get_tso = ethtool_op_get_tso,
  929. /* Need to enable/disable TSO-IPv6 too */
  930. .set_tso = efx_ethtool_set_tso,
  931. .get_flags = ethtool_op_get_flags,
  932. .set_flags = efx_ethtool_set_flags,
  933. .get_sset_count = efx_ethtool_get_sset_count,
  934. .self_test = efx_ethtool_self_test,
  935. .get_strings = efx_ethtool_get_strings,
  936. .phys_id = efx_ethtool_phys_id,
  937. .get_ethtool_stats = efx_ethtool_get_stats,
  938. .get_wol = efx_ethtool_get_wol,
  939. .set_wol = efx_ethtool_set_wol,
  940. .reset = efx_ethtool_reset,
  941. .get_rxnfc = efx_ethtool_get_rxnfc,
  942. .set_rx_ntuple = efx_ethtool_set_rx_ntuple,
  943. .get_rxfh_indir = efx_ethtool_get_rxfh_indir,
  944. .set_rxfh_indir = efx_ethtool_set_rxfh_indir,
  945. };