ethtool.c 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117
  1. /****************************************************************************
  2. * Driver for Solarflare network controllers and boards
  3. * Copyright 2005-2006 Fen Systems Ltd.
  4. * Copyright 2006-2013 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 <linux/in.h>
  14. #include "net_driver.h"
  15. #include "workarounds.h"
  16. #include "selftest.h"
  17. #include "efx.h"
  18. #include "filter.h"
  19. #include "nic.h"
  20. struct efx_sw_stat_desc {
  21. const char *name;
  22. enum {
  23. EFX_ETHTOOL_STAT_SOURCE_nic,
  24. EFX_ETHTOOL_STAT_SOURCE_channel,
  25. EFX_ETHTOOL_STAT_SOURCE_tx_queue
  26. } source;
  27. unsigned offset;
  28. u64(*get_stat) (void *field); /* Reader function */
  29. };
  30. /* Initialiser for a struct efx_sw_stat_desc with type-checking */
  31. #define EFX_ETHTOOL_STAT(stat_name, source_name, field, field_type, \
  32. get_stat_function) { \
  33. .name = #stat_name, \
  34. .source = EFX_ETHTOOL_STAT_SOURCE_##source_name, \
  35. .offset = ((((field_type *) 0) == \
  36. &((struct efx_##source_name *)0)->field) ? \
  37. offsetof(struct efx_##source_name, field) : \
  38. offsetof(struct efx_##source_name, field)), \
  39. .get_stat = get_stat_function, \
  40. }
  41. static u64 efx_get_uint_stat(void *field)
  42. {
  43. return *(unsigned int *)field;
  44. }
  45. static u64 efx_get_atomic_stat(void *field)
  46. {
  47. return atomic_read((atomic_t *) field);
  48. }
  49. #define EFX_ETHTOOL_ATOMIC_NIC_ERROR_STAT(field) \
  50. EFX_ETHTOOL_STAT(field, nic, field, \
  51. atomic_t, efx_get_atomic_stat)
  52. #define EFX_ETHTOOL_UINT_CHANNEL_STAT(field) \
  53. EFX_ETHTOOL_STAT(field, channel, n_##field, \
  54. unsigned int, efx_get_uint_stat)
  55. #define EFX_ETHTOOL_UINT_TXQ_STAT(field) \
  56. EFX_ETHTOOL_STAT(tx_##field, tx_queue, field, \
  57. unsigned int, efx_get_uint_stat)
  58. static const struct efx_sw_stat_desc efx_sw_stat_desc[] = {
  59. EFX_ETHTOOL_UINT_TXQ_STAT(merge_events),
  60. EFX_ETHTOOL_UINT_TXQ_STAT(tso_bursts),
  61. EFX_ETHTOOL_UINT_TXQ_STAT(tso_long_headers),
  62. EFX_ETHTOOL_UINT_TXQ_STAT(tso_packets),
  63. EFX_ETHTOOL_UINT_TXQ_STAT(pushes),
  64. EFX_ETHTOOL_ATOMIC_NIC_ERROR_STAT(rx_reset),
  65. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_tobe_disc),
  66. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_ip_hdr_chksum_err),
  67. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_tcp_udp_chksum_err),
  68. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_mcast_mismatch),
  69. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_frm_trunc),
  70. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_nodesc_trunc),
  71. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_merge_events),
  72. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_merge_packets),
  73. };
  74. #define EFX_ETHTOOL_SW_STAT_COUNT ARRAY_SIZE(efx_sw_stat_desc)
  75. #define EFX_ETHTOOL_EEPROM_MAGIC 0xEFAB
  76. /**************************************************************************
  77. *
  78. * Ethtool operations
  79. *
  80. **************************************************************************
  81. */
  82. /* Identify device by flashing LEDs */
  83. static int efx_ethtool_phys_id(struct net_device *net_dev,
  84. enum ethtool_phys_id_state state)
  85. {
  86. struct efx_nic *efx = netdev_priv(net_dev);
  87. enum efx_led_mode mode = EFX_LED_DEFAULT;
  88. switch (state) {
  89. case ETHTOOL_ID_ON:
  90. mode = EFX_LED_ON;
  91. break;
  92. case ETHTOOL_ID_OFF:
  93. mode = EFX_LED_OFF;
  94. break;
  95. case ETHTOOL_ID_INACTIVE:
  96. mode = EFX_LED_DEFAULT;
  97. break;
  98. case ETHTOOL_ID_ACTIVE:
  99. return 1; /* cycle on/off once per second */
  100. }
  101. efx->type->set_id_led(efx, mode);
  102. return 0;
  103. }
  104. /* This must be called with rtnl_lock held. */
  105. static int efx_ethtool_get_settings(struct net_device *net_dev,
  106. struct ethtool_cmd *ecmd)
  107. {
  108. struct efx_nic *efx = netdev_priv(net_dev);
  109. struct efx_link_state *link_state = &efx->link_state;
  110. mutex_lock(&efx->mac_lock);
  111. efx->phy_op->get_settings(efx, ecmd);
  112. mutex_unlock(&efx->mac_lock);
  113. /* Both MACs support pause frames (bidirectional and respond-only) */
  114. ecmd->supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
  115. if (LOOPBACK_INTERNAL(efx)) {
  116. ethtool_cmd_speed_set(ecmd, link_state->speed);
  117. ecmd->duplex = link_state->fd ? DUPLEX_FULL : DUPLEX_HALF;
  118. }
  119. return 0;
  120. }
  121. /* This must be called with rtnl_lock held. */
  122. static int efx_ethtool_set_settings(struct net_device *net_dev,
  123. struct ethtool_cmd *ecmd)
  124. {
  125. struct efx_nic *efx = netdev_priv(net_dev);
  126. int rc;
  127. /* GMAC does not support 1000Mbps HD */
  128. if ((ethtool_cmd_speed(ecmd) == SPEED_1000) &&
  129. (ecmd->duplex != DUPLEX_FULL)) {
  130. netif_dbg(efx, drv, efx->net_dev,
  131. "rejecting unsupported 1000Mbps HD setting\n");
  132. return -EINVAL;
  133. }
  134. mutex_lock(&efx->mac_lock);
  135. rc = efx->phy_op->set_settings(efx, ecmd);
  136. mutex_unlock(&efx->mac_lock);
  137. return rc;
  138. }
  139. static void efx_ethtool_get_drvinfo(struct net_device *net_dev,
  140. struct ethtool_drvinfo *info)
  141. {
  142. struct efx_nic *efx = netdev_priv(net_dev);
  143. strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
  144. strlcpy(info->version, EFX_DRIVER_VERSION, sizeof(info->version));
  145. if (efx_nic_rev(efx) >= EFX_REV_SIENA_A0)
  146. efx_mcdi_print_fwver(efx, info->fw_version,
  147. sizeof(info->fw_version));
  148. strlcpy(info->bus_info, pci_name(efx->pci_dev), sizeof(info->bus_info));
  149. }
  150. static int efx_ethtool_get_regs_len(struct net_device *net_dev)
  151. {
  152. return efx_nic_get_regs_len(netdev_priv(net_dev));
  153. }
  154. static void efx_ethtool_get_regs(struct net_device *net_dev,
  155. struct ethtool_regs *regs, void *buf)
  156. {
  157. struct efx_nic *efx = netdev_priv(net_dev);
  158. regs->version = efx->type->revision;
  159. efx_nic_get_regs(efx, buf);
  160. }
  161. static u32 efx_ethtool_get_msglevel(struct net_device *net_dev)
  162. {
  163. struct efx_nic *efx = netdev_priv(net_dev);
  164. return efx->msg_enable;
  165. }
  166. static void efx_ethtool_set_msglevel(struct net_device *net_dev, u32 msg_enable)
  167. {
  168. struct efx_nic *efx = netdev_priv(net_dev);
  169. efx->msg_enable = msg_enable;
  170. }
  171. /**
  172. * efx_fill_test - fill in an individual self-test entry
  173. * @test_index: Index of the test
  174. * @strings: Ethtool strings, or %NULL
  175. * @data: Ethtool test results, or %NULL
  176. * @test: Pointer to test result (used only if data != %NULL)
  177. * @unit_format: Unit name format (e.g. "chan\%d")
  178. * @unit_id: Unit id (e.g. 0 for "chan0")
  179. * @test_format: Test name format (e.g. "loopback.\%s.tx.sent")
  180. * @test_id: Test id (e.g. "PHYXS" for "loopback.PHYXS.tx_sent")
  181. *
  182. * Fill in an individual self-test entry.
  183. */
  184. static void efx_fill_test(unsigned int test_index, u8 *strings, u64 *data,
  185. int *test, const char *unit_format, int unit_id,
  186. const char *test_format, const char *test_id)
  187. {
  188. char unit_str[ETH_GSTRING_LEN], test_str[ETH_GSTRING_LEN];
  189. /* Fill data value, if applicable */
  190. if (data)
  191. data[test_index] = *test;
  192. /* Fill string, if applicable */
  193. if (strings) {
  194. if (strchr(unit_format, '%'))
  195. snprintf(unit_str, sizeof(unit_str),
  196. unit_format, unit_id);
  197. else
  198. strcpy(unit_str, unit_format);
  199. snprintf(test_str, sizeof(test_str), test_format, test_id);
  200. snprintf(strings + test_index * ETH_GSTRING_LEN,
  201. ETH_GSTRING_LEN,
  202. "%-6s %-24s", unit_str, test_str);
  203. }
  204. }
  205. #define EFX_CHANNEL_NAME(_channel) "chan%d", _channel->channel
  206. #define EFX_TX_QUEUE_NAME(_tx_queue) "txq%d", _tx_queue->queue
  207. #define EFX_RX_QUEUE_NAME(_rx_queue) "rxq%d", _rx_queue->queue
  208. #define EFX_LOOPBACK_NAME(_mode, _counter) \
  209. "loopback.%s." _counter, STRING_TABLE_LOOKUP(_mode, efx_loopback_mode)
  210. /**
  211. * efx_fill_loopback_test - fill in a block of loopback self-test entries
  212. * @efx: Efx NIC
  213. * @lb_tests: Efx loopback self-test results structure
  214. * @mode: Loopback test mode
  215. * @test_index: Starting index of the test
  216. * @strings: Ethtool strings, or %NULL
  217. * @data: Ethtool test results, or %NULL
  218. */
  219. static int efx_fill_loopback_test(struct efx_nic *efx,
  220. struct efx_loopback_self_tests *lb_tests,
  221. enum efx_loopback_mode mode,
  222. unsigned int test_index,
  223. u8 *strings, u64 *data)
  224. {
  225. struct efx_channel *channel =
  226. efx_get_channel(efx, efx->tx_channel_offset);
  227. struct efx_tx_queue *tx_queue;
  228. efx_for_each_channel_tx_queue(tx_queue, channel) {
  229. efx_fill_test(test_index++, strings, data,
  230. &lb_tests->tx_sent[tx_queue->queue],
  231. EFX_TX_QUEUE_NAME(tx_queue),
  232. EFX_LOOPBACK_NAME(mode, "tx_sent"));
  233. efx_fill_test(test_index++, strings, data,
  234. &lb_tests->tx_done[tx_queue->queue],
  235. EFX_TX_QUEUE_NAME(tx_queue),
  236. EFX_LOOPBACK_NAME(mode, "tx_done"));
  237. }
  238. efx_fill_test(test_index++, strings, data,
  239. &lb_tests->rx_good,
  240. "rx", 0,
  241. EFX_LOOPBACK_NAME(mode, "rx_good"));
  242. efx_fill_test(test_index++, strings, data,
  243. &lb_tests->rx_bad,
  244. "rx", 0,
  245. EFX_LOOPBACK_NAME(mode, "rx_bad"));
  246. return test_index;
  247. }
  248. /**
  249. * efx_ethtool_fill_self_tests - get self-test details
  250. * @efx: Efx NIC
  251. * @tests: Efx self-test results structure, or %NULL
  252. * @strings: Ethtool strings, or %NULL
  253. * @data: Ethtool test results, or %NULL
  254. */
  255. static int efx_ethtool_fill_self_tests(struct efx_nic *efx,
  256. struct efx_self_tests *tests,
  257. u8 *strings, u64 *data)
  258. {
  259. struct efx_channel *channel;
  260. unsigned int n = 0, i;
  261. enum efx_loopback_mode mode;
  262. efx_fill_test(n++, strings, data, &tests->phy_alive,
  263. "phy", 0, "alive", NULL);
  264. efx_fill_test(n++, strings, data, &tests->nvram,
  265. "core", 0, "nvram", NULL);
  266. efx_fill_test(n++, strings, data, &tests->interrupt,
  267. "core", 0, "interrupt", NULL);
  268. /* Event queues */
  269. efx_for_each_channel(channel, efx) {
  270. efx_fill_test(n++, strings, data,
  271. &tests->eventq_dma[channel->channel],
  272. EFX_CHANNEL_NAME(channel),
  273. "eventq.dma", NULL);
  274. efx_fill_test(n++, strings, data,
  275. &tests->eventq_int[channel->channel],
  276. EFX_CHANNEL_NAME(channel),
  277. "eventq.int", NULL);
  278. }
  279. efx_fill_test(n++, strings, data, &tests->registers,
  280. "core", 0, "registers", NULL);
  281. if (efx->phy_op->run_tests != NULL) {
  282. EFX_BUG_ON_PARANOID(efx->phy_op->test_name == NULL);
  283. for (i = 0; true; ++i) {
  284. const char *name;
  285. EFX_BUG_ON_PARANOID(i >= EFX_MAX_PHY_TESTS);
  286. name = efx->phy_op->test_name(efx, i);
  287. if (name == NULL)
  288. break;
  289. efx_fill_test(n++, strings, data, &tests->phy_ext[i],
  290. "phy", 0, name, NULL);
  291. }
  292. }
  293. /* Loopback tests */
  294. for (mode = LOOPBACK_NONE; mode <= LOOPBACK_TEST_MAX; mode++) {
  295. if (!(efx->loopback_modes & (1 << mode)))
  296. continue;
  297. n = efx_fill_loopback_test(efx,
  298. &tests->loopback[mode], mode, n,
  299. strings, data);
  300. }
  301. return n;
  302. }
  303. static int efx_ethtool_get_sset_count(struct net_device *net_dev,
  304. int string_set)
  305. {
  306. struct efx_nic *efx = netdev_priv(net_dev);
  307. switch (string_set) {
  308. case ETH_SS_STATS:
  309. return efx->type->describe_stats(efx, NULL) +
  310. EFX_ETHTOOL_SW_STAT_COUNT;
  311. case ETH_SS_TEST:
  312. return efx_ethtool_fill_self_tests(efx, NULL, NULL, NULL);
  313. default:
  314. return -EINVAL;
  315. }
  316. }
  317. static void efx_ethtool_get_strings(struct net_device *net_dev,
  318. u32 string_set, u8 *strings)
  319. {
  320. struct efx_nic *efx = netdev_priv(net_dev);
  321. int i;
  322. switch (string_set) {
  323. case ETH_SS_STATS:
  324. strings += (efx->type->describe_stats(efx, strings) *
  325. ETH_GSTRING_LEN);
  326. for (i = 0; i < EFX_ETHTOOL_SW_STAT_COUNT; i++)
  327. strlcpy(strings + i * ETH_GSTRING_LEN,
  328. efx_sw_stat_desc[i].name, ETH_GSTRING_LEN);
  329. break;
  330. case ETH_SS_TEST:
  331. efx_ethtool_fill_self_tests(efx, NULL, strings, NULL);
  332. break;
  333. default:
  334. /* No other string sets */
  335. break;
  336. }
  337. }
  338. static void efx_ethtool_get_stats(struct net_device *net_dev,
  339. struct ethtool_stats *stats,
  340. u64 *data)
  341. {
  342. struct efx_nic *efx = netdev_priv(net_dev);
  343. const struct efx_sw_stat_desc *stat;
  344. struct efx_channel *channel;
  345. struct efx_tx_queue *tx_queue;
  346. int i;
  347. spin_lock_bh(&efx->stats_lock);
  348. /* Get NIC statistics */
  349. data += efx->type->update_stats(efx, data, NULL);
  350. /* Get software statistics */
  351. for (i = 0; i < EFX_ETHTOOL_SW_STAT_COUNT; i++) {
  352. stat = &efx_sw_stat_desc[i];
  353. switch (stat->source) {
  354. case EFX_ETHTOOL_STAT_SOURCE_nic:
  355. data[i] = stat->get_stat((void *)efx + stat->offset);
  356. break;
  357. case EFX_ETHTOOL_STAT_SOURCE_channel:
  358. data[i] = 0;
  359. efx_for_each_channel(channel, efx)
  360. data[i] += stat->get_stat((void *)channel +
  361. stat->offset);
  362. break;
  363. case EFX_ETHTOOL_STAT_SOURCE_tx_queue:
  364. data[i] = 0;
  365. efx_for_each_channel(channel, efx) {
  366. efx_for_each_channel_tx_queue(tx_queue, channel)
  367. data[i] +=
  368. stat->get_stat((void *)tx_queue
  369. + stat->offset);
  370. }
  371. break;
  372. }
  373. }
  374. spin_unlock_bh(&efx->stats_lock);
  375. }
  376. static void efx_ethtool_self_test(struct net_device *net_dev,
  377. struct ethtool_test *test, u64 *data)
  378. {
  379. struct efx_nic *efx = netdev_priv(net_dev);
  380. struct efx_self_tests *efx_tests;
  381. int already_up;
  382. int rc = -ENOMEM;
  383. efx_tests = kzalloc(sizeof(*efx_tests), GFP_KERNEL);
  384. if (!efx_tests)
  385. goto fail;
  386. if (efx->state != STATE_READY) {
  387. rc = -EIO;
  388. goto fail1;
  389. }
  390. netif_info(efx, drv, efx->net_dev, "starting %sline testing\n",
  391. (test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on");
  392. /* We need rx buffers and interrupts. */
  393. already_up = (efx->net_dev->flags & IFF_UP);
  394. if (!already_up) {
  395. rc = dev_open(efx->net_dev);
  396. if (rc) {
  397. netif_err(efx, drv, efx->net_dev,
  398. "failed opening device.\n");
  399. goto fail1;
  400. }
  401. }
  402. rc = efx_selftest(efx, efx_tests, test->flags);
  403. if (!already_up)
  404. dev_close(efx->net_dev);
  405. netif_info(efx, drv, efx->net_dev, "%s %sline self-tests\n",
  406. rc == 0 ? "passed" : "failed",
  407. (test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on");
  408. fail1:
  409. /* Fill ethtool results structures */
  410. efx_ethtool_fill_self_tests(efx, efx_tests, NULL, data);
  411. kfree(efx_tests);
  412. fail:
  413. if (rc)
  414. test->flags |= ETH_TEST_FL_FAILED;
  415. }
  416. /* Restart autonegotiation */
  417. static int efx_ethtool_nway_reset(struct net_device *net_dev)
  418. {
  419. struct efx_nic *efx = netdev_priv(net_dev);
  420. return mdio45_nway_restart(&efx->mdio);
  421. }
  422. /*
  423. * Each channel has a single IRQ and moderation timer, started by any
  424. * completion (or other event). Unless the module parameter
  425. * separate_tx_channels is set, IRQs and moderation are therefore
  426. * shared between RX and TX completions. In this case, when RX IRQ
  427. * moderation is explicitly changed then TX IRQ moderation is
  428. * automatically changed too, but otherwise we fail if the two values
  429. * are requested to be different.
  430. *
  431. * The hardware does not support a limit on the number of completions
  432. * before an IRQ, so we do not use the max_frames fields. We should
  433. * report and require that max_frames == (usecs != 0), but this would
  434. * invalidate existing user documentation.
  435. *
  436. * The hardware does not have distinct settings for interrupt
  437. * moderation while the previous IRQ is being handled, so we should
  438. * not use the 'irq' fields. However, an earlier developer
  439. * misunderstood the meaning of the 'irq' fields and the driver did
  440. * not support the standard fields. To avoid invalidating existing
  441. * user documentation, we report and accept changes through either the
  442. * standard or 'irq' fields. If both are changed at the same time, we
  443. * prefer the standard field.
  444. *
  445. * We implement adaptive IRQ moderation, but use a different algorithm
  446. * from that assumed in the definition of struct ethtool_coalesce.
  447. * Therefore we do not use any of the adaptive moderation parameters
  448. * in it.
  449. */
  450. static int efx_ethtool_get_coalesce(struct net_device *net_dev,
  451. struct ethtool_coalesce *coalesce)
  452. {
  453. struct efx_nic *efx = netdev_priv(net_dev);
  454. unsigned int tx_usecs, rx_usecs;
  455. bool rx_adaptive;
  456. efx_get_irq_moderation(efx, &tx_usecs, &rx_usecs, &rx_adaptive);
  457. coalesce->tx_coalesce_usecs = tx_usecs;
  458. coalesce->tx_coalesce_usecs_irq = tx_usecs;
  459. coalesce->rx_coalesce_usecs = rx_usecs;
  460. coalesce->rx_coalesce_usecs_irq = rx_usecs;
  461. coalesce->use_adaptive_rx_coalesce = rx_adaptive;
  462. return 0;
  463. }
  464. static int efx_ethtool_set_coalesce(struct net_device *net_dev,
  465. struct ethtool_coalesce *coalesce)
  466. {
  467. struct efx_nic *efx = netdev_priv(net_dev);
  468. struct efx_channel *channel;
  469. unsigned int tx_usecs, rx_usecs;
  470. bool adaptive, rx_may_override_tx;
  471. int rc;
  472. if (coalesce->use_adaptive_tx_coalesce)
  473. return -EINVAL;
  474. efx_get_irq_moderation(efx, &tx_usecs, &rx_usecs, &adaptive);
  475. if (coalesce->rx_coalesce_usecs != rx_usecs)
  476. rx_usecs = coalesce->rx_coalesce_usecs;
  477. else
  478. rx_usecs = coalesce->rx_coalesce_usecs_irq;
  479. adaptive = coalesce->use_adaptive_rx_coalesce;
  480. /* If channels are shared, TX IRQ moderation can be quietly
  481. * overridden unless it is changed from its old value.
  482. */
  483. rx_may_override_tx = (coalesce->tx_coalesce_usecs == tx_usecs &&
  484. coalesce->tx_coalesce_usecs_irq == tx_usecs);
  485. if (coalesce->tx_coalesce_usecs != tx_usecs)
  486. tx_usecs = coalesce->tx_coalesce_usecs;
  487. else
  488. tx_usecs = coalesce->tx_coalesce_usecs_irq;
  489. rc = efx_init_irq_moderation(efx, tx_usecs, rx_usecs, adaptive,
  490. rx_may_override_tx);
  491. if (rc != 0)
  492. return rc;
  493. efx_for_each_channel(channel, efx)
  494. efx->type->push_irq_moderation(channel);
  495. return 0;
  496. }
  497. static void efx_ethtool_get_ringparam(struct net_device *net_dev,
  498. struct ethtool_ringparam *ring)
  499. {
  500. struct efx_nic *efx = netdev_priv(net_dev);
  501. ring->rx_max_pending = EFX_MAX_DMAQ_SIZE;
  502. ring->tx_max_pending = EFX_MAX_DMAQ_SIZE;
  503. ring->rx_pending = efx->rxq_entries;
  504. ring->tx_pending = efx->txq_entries;
  505. }
  506. static int efx_ethtool_set_ringparam(struct net_device *net_dev,
  507. struct ethtool_ringparam *ring)
  508. {
  509. struct efx_nic *efx = netdev_priv(net_dev);
  510. u32 txq_entries;
  511. if (ring->rx_mini_pending || ring->rx_jumbo_pending ||
  512. ring->rx_pending > EFX_MAX_DMAQ_SIZE ||
  513. ring->tx_pending > EFX_MAX_DMAQ_SIZE)
  514. return -EINVAL;
  515. if (ring->rx_pending < EFX_RXQ_MIN_ENT) {
  516. netif_err(efx, drv, efx->net_dev,
  517. "RX queues cannot be smaller than %u\n",
  518. EFX_RXQ_MIN_ENT);
  519. return -EINVAL;
  520. }
  521. txq_entries = max(ring->tx_pending, EFX_TXQ_MIN_ENT(efx));
  522. if (txq_entries != ring->tx_pending)
  523. netif_warn(efx, drv, efx->net_dev,
  524. "increasing TX queue size to minimum of %u\n",
  525. txq_entries);
  526. return efx_realloc_channels(efx, ring->rx_pending, txq_entries);
  527. }
  528. static int efx_ethtool_set_pauseparam(struct net_device *net_dev,
  529. struct ethtool_pauseparam *pause)
  530. {
  531. struct efx_nic *efx = netdev_priv(net_dev);
  532. u8 wanted_fc, old_fc;
  533. u32 old_adv;
  534. int rc = 0;
  535. mutex_lock(&efx->mac_lock);
  536. wanted_fc = ((pause->rx_pause ? EFX_FC_RX : 0) |
  537. (pause->tx_pause ? EFX_FC_TX : 0) |
  538. (pause->autoneg ? EFX_FC_AUTO : 0));
  539. if ((wanted_fc & EFX_FC_TX) && !(wanted_fc & EFX_FC_RX)) {
  540. netif_dbg(efx, drv, efx->net_dev,
  541. "Flow control unsupported: tx ON rx OFF\n");
  542. rc = -EINVAL;
  543. goto out;
  544. }
  545. if ((wanted_fc & EFX_FC_AUTO) && !efx->link_advertising) {
  546. netif_dbg(efx, drv, efx->net_dev,
  547. "Autonegotiation is disabled\n");
  548. rc = -EINVAL;
  549. goto out;
  550. }
  551. /* Hook for Falcon bug 11482 workaround */
  552. if (efx->type->prepare_enable_fc_tx &&
  553. (wanted_fc & EFX_FC_TX) && !(efx->wanted_fc & EFX_FC_TX))
  554. efx->type->prepare_enable_fc_tx(efx);
  555. old_adv = efx->link_advertising;
  556. old_fc = efx->wanted_fc;
  557. efx_link_set_wanted_fc(efx, wanted_fc);
  558. if (efx->link_advertising != old_adv ||
  559. (efx->wanted_fc ^ old_fc) & EFX_FC_AUTO) {
  560. rc = efx->phy_op->reconfigure(efx);
  561. if (rc) {
  562. netif_err(efx, drv, efx->net_dev,
  563. "Unable to advertise requested flow "
  564. "control setting\n");
  565. goto out;
  566. }
  567. }
  568. /* Reconfigure the MAC. The PHY *may* generate a link state change event
  569. * if the user just changed the advertised capabilities, but there's no
  570. * harm doing this twice */
  571. efx->type->reconfigure_mac(efx);
  572. out:
  573. mutex_unlock(&efx->mac_lock);
  574. return rc;
  575. }
  576. static void efx_ethtool_get_pauseparam(struct net_device *net_dev,
  577. struct ethtool_pauseparam *pause)
  578. {
  579. struct efx_nic *efx = netdev_priv(net_dev);
  580. pause->rx_pause = !!(efx->wanted_fc & EFX_FC_RX);
  581. pause->tx_pause = !!(efx->wanted_fc & EFX_FC_TX);
  582. pause->autoneg = !!(efx->wanted_fc & EFX_FC_AUTO);
  583. }
  584. static void efx_ethtool_get_wol(struct net_device *net_dev,
  585. struct ethtool_wolinfo *wol)
  586. {
  587. struct efx_nic *efx = netdev_priv(net_dev);
  588. return efx->type->get_wol(efx, wol);
  589. }
  590. static int efx_ethtool_set_wol(struct net_device *net_dev,
  591. struct ethtool_wolinfo *wol)
  592. {
  593. struct efx_nic *efx = netdev_priv(net_dev);
  594. return efx->type->set_wol(efx, wol->wolopts);
  595. }
  596. static int efx_ethtool_reset(struct net_device *net_dev, u32 *flags)
  597. {
  598. struct efx_nic *efx = netdev_priv(net_dev);
  599. int rc;
  600. rc = efx->type->map_reset_flags(flags);
  601. if (rc < 0)
  602. return rc;
  603. return efx_reset(efx, rc);
  604. }
  605. /* MAC address mask including only I/G bit */
  606. static const u8 mac_addr_ig_mask[ETH_ALEN] = { 0x01, 0, 0, 0, 0, 0 };
  607. #define IP4_ADDR_FULL_MASK ((__force __be32)~0)
  608. #define PORT_FULL_MASK ((__force __be16)~0)
  609. #define ETHER_TYPE_FULL_MASK ((__force __be16)~0)
  610. static int efx_ethtool_get_class_rule(struct efx_nic *efx,
  611. struct ethtool_rx_flow_spec *rule)
  612. {
  613. struct ethtool_tcpip4_spec *ip_entry = &rule->h_u.tcp_ip4_spec;
  614. struct ethtool_tcpip4_spec *ip_mask = &rule->m_u.tcp_ip4_spec;
  615. struct ethhdr *mac_entry = &rule->h_u.ether_spec;
  616. struct ethhdr *mac_mask = &rule->m_u.ether_spec;
  617. struct efx_filter_spec spec;
  618. int rc;
  619. rc = efx_filter_get_filter_safe(efx, EFX_FILTER_PRI_MANUAL,
  620. rule->location, &spec);
  621. if (rc)
  622. return rc;
  623. if (spec.dmaq_id == EFX_FILTER_RX_DMAQ_ID_DROP)
  624. rule->ring_cookie = RX_CLS_FLOW_DISC;
  625. else
  626. rule->ring_cookie = spec.dmaq_id;
  627. if ((spec.match_flags & EFX_FILTER_MATCH_ETHER_TYPE) &&
  628. spec.ether_type == htons(ETH_P_IP) &&
  629. (spec.match_flags & EFX_FILTER_MATCH_IP_PROTO) &&
  630. (spec.ip_proto == IPPROTO_TCP || spec.ip_proto == IPPROTO_UDP) &&
  631. !(spec.match_flags &
  632. ~(EFX_FILTER_MATCH_ETHER_TYPE | EFX_FILTER_MATCH_OUTER_VID |
  633. EFX_FILTER_MATCH_LOC_HOST | EFX_FILTER_MATCH_REM_HOST |
  634. EFX_FILTER_MATCH_IP_PROTO |
  635. EFX_FILTER_MATCH_LOC_PORT | EFX_FILTER_MATCH_REM_PORT))) {
  636. rule->flow_type = ((spec.ip_proto == IPPROTO_TCP) ?
  637. TCP_V4_FLOW : UDP_V4_FLOW);
  638. if (spec.match_flags & EFX_FILTER_MATCH_LOC_HOST) {
  639. ip_entry->ip4dst = spec.loc_host[0];
  640. ip_mask->ip4dst = IP4_ADDR_FULL_MASK;
  641. }
  642. if (spec.match_flags & EFX_FILTER_MATCH_REM_HOST) {
  643. ip_entry->ip4src = spec.rem_host[0];
  644. ip_mask->ip4src = IP4_ADDR_FULL_MASK;
  645. }
  646. if (spec.match_flags & EFX_FILTER_MATCH_LOC_PORT) {
  647. ip_entry->pdst = spec.loc_port;
  648. ip_mask->pdst = PORT_FULL_MASK;
  649. }
  650. if (spec.match_flags & EFX_FILTER_MATCH_REM_PORT) {
  651. ip_entry->psrc = spec.rem_port;
  652. ip_mask->psrc = PORT_FULL_MASK;
  653. }
  654. } else if (!(spec.match_flags &
  655. ~(EFX_FILTER_MATCH_LOC_MAC | EFX_FILTER_MATCH_LOC_MAC_IG |
  656. EFX_FILTER_MATCH_REM_MAC | EFX_FILTER_MATCH_ETHER_TYPE |
  657. EFX_FILTER_MATCH_OUTER_VID))) {
  658. rule->flow_type = ETHER_FLOW;
  659. if (spec.match_flags &
  660. (EFX_FILTER_MATCH_LOC_MAC | EFX_FILTER_MATCH_LOC_MAC_IG)) {
  661. memcpy(mac_entry->h_dest, spec.loc_mac, ETH_ALEN);
  662. if (spec.match_flags & EFX_FILTER_MATCH_LOC_MAC)
  663. memset(mac_mask->h_dest, ~0, ETH_ALEN);
  664. else
  665. memcpy(mac_mask->h_dest, mac_addr_ig_mask,
  666. ETH_ALEN);
  667. }
  668. if (spec.match_flags & EFX_FILTER_MATCH_REM_MAC) {
  669. memcpy(mac_entry->h_source, spec.rem_mac, ETH_ALEN);
  670. memset(mac_mask->h_source, ~0, ETH_ALEN);
  671. }
  672. if (spec.match_flags & EFX_FILTER_MATCH_ETHER_TYPE) {
  673. mac_entry->h_proto = spec.ether_type;
  674. mac_mask->h_proto = ETHER_TYPE_FULL_MASK;
  675. }
  676. } else {
  677. /* The above should handle all filters that we insert */
  678. WARN_ON(1);
  679. return -EINVAL;
  680. }
  681. if (spec.match_flags & EFX_FILTER_MATCH_OUTER_VID) {
  682. rule->flow_type |= FLOW_EXT;
  683. rule->h_ext.vlan_tci = spec.outer_vid;
  684. rule->m_ext.vlan_tci = htons(0xfff);
  685. }
  686. return rc;
  687. }
  688. static int
  689. efx_ethtool_get_rxnfc(struct net_device *net_dev,
  690. struct ethtool_rxnfc *info, u32 *rule_locs)
  691. {
  692. struct efx_nic *efx = netdev_priv(net_dev);
  693. switch (info->cmd) {
  694. case ETHTOOL_GRXRINGS:
  695. info->data = efx->n_rx_channels;
  696. return 0;
  697. case ETHTOOL_GRXFH: {
  698. unsigned min_revision = 0;
  699. info->data = 0;
  700. switch (info->flow_type) {
  701. case TCP_V4_FLOW:
  702. info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
  703. /* fall through */
  704. case UDP_V4_FLOW:
  705. case SCTP_V4_FLOW:
  706. case AH_ESP_V4_FLOW:
  707. case IPV4_FLOW:
  708. info->data |= RXH_IP_SRC | RXH_IP_DST;
  709. min_revision = EFX_REV_FALCON_B0;
  710. break;
  711. case TCP_V6_FLOW:
  712. info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
  713. /* fall through */
  714. case UDP_V6_FLOW:
  715. case SCTP_V6_FLOW:
  716. case AH_ESP_V6_FLOW:
  717. case IPV6_FLOW:
  718. info->data |= RXH_IP_SRC | RXH_IP_DST;
  719. min_revision = EFX_REV_SIENA_A0;
  720. break;
  721. default:
  722. break;
  723. }
  724. if (efx_nic_rev(efx) < min_revision)
  725. info->data = 0;
  726. return 0;
  727. }
  728. case ETHTOOL_GRXCLSRLCNT:
  729. info->data = efx_filter_get_rx_id_limit(efx);
  730. if (info->data == 0)
  731. return -EOPNOTSUPP;
  732. info->data |= RX_CLS_LOC_SPECIAL;
  733. info->rule_cnt =
  734. efx_filter_count_rx_used(efx, EFX_FILTER_PRI_MANUAL);
  735. return 0;
  736. case ETHTOOL_GRXCLSRULE:
  737. if (efx_filter_get_rx_id_limit(efx) == 0)
  738. return -EOPNOTSUPP;
  739. return efx_ethtool_get_class_rule(efx, &info->fs);
  740. case ETHTOOL_GRXCLSRLALL: {
  741. s32 rc;
  742. info->data = efx_filter_get_rx_id_limit(efx);
  743. if (info->data == 0)
  744. return -EOPNOTSUPP;
  745. rc = efx_filter_get_rx_ids(efx, EFX_FILTER_PRI_MANUAL,
  746. rule_locs, info->rule_cnt);
  747. if (rc < 0)
  748. return rc;
  749. info->rule_cnt = rc;
  750. return 0;
  751. }
  752. default:
  753. return -EOPNOTSUPP;
  754. }
  755. }
  756. static int efx_ethtool_set_class_rule(struct efx_nic *efx,
  757. struct ethtool_rx_flow_spec *rule)
  758. {
  759. struct ethtool_tcpip4_spec *ip_entry = &rule->h_u.tcp_ip4_spec;
  760. struct ethtool_tcpip4_spec *ip_mask = &rule->m_u.tcp_ip4_spec;
  761. struct ethhdr *mac_entry = &rule->h_u.ether_spec;
  762. struct ethhdr *mac_mask = &rule->m_u.ether_spec;
  763. struct efx_filter_spec spec;
  764. int rc;
  765. /* Check that user wants us to choose the location */
  766. if (rule->location != RX_CLS_LOC_ANY)
  767. return -EINVAL;
  768. /* Range-check ring_cookie */
  769. if (rule->ring_cookie >= efx->n_rx_channels &&
  770. rule->ring_cookie != RX_CLS_FLOW_DISC)
  771. return -EINVAL;
  772. /* Check for unsupported extensions */
  773. if ((rule->flow_type & FLOW_EXT) &&
  774. (rule->m_ext.vlan_etype || rule->m_ext.data[0] ||
  775. rule->m_ext.data[1]))
  776. return -EINVAL;
  777. efx_filter_init_rx(&spec, EFX_FILTER_PRI_MANUAL,
  778. efx->rx_scatter ? EFX_FILTER_FLAG_RX_SCATTER : 0,
  779. (rule->ring_cookie == RX_CLS_FLOW_DISC) ?
  780. EFX_FILTER_RX_DMAQ_ID_DROP : rule->ring_cookie);
  781. switch (rule->flow_type & ~FLOW_EXT) {
  782. case TCP_V4_FLOW:
  783. case UDP_V4_FLOW:
  784. spec.match_flags = (EFX_FILTER_MATCH_ETHER_TYPE |
  785. EFX_FILTER_MATCH_IP_PROTO);
  786. spec.ether_type = htons(ETH_P_IP);
  787. spec.ip_proto = ((rule->flow_type & ~FLOW_EXT) == TCP_V4_FLOW ?
  788. IPPROTO_TCP : IPPROTO_UDP);
  789. if (ip_mask->ip4dst) {
  790. if (ip_mask->ip4dst != IP4_ADDR_FULL_MASK)
  791. return -EINVAL;
  792. spec.match_flags |= EFX_FILTER_MATCH_LOC_HOST;
  793. spec.loc_host[0] = ip_entry->ip4dst;
  794. }
  795. if (ip_mask->ip4src) {
  796. if (ip_mask->ip4src != IP4_ADDR_FULL_MASK)
  797. return -EINVAL;
  798. spec.match_flags |= EFX_FILTER_MATCH_REM_HOST;
  799. spec.rem_host[0] = ip_entry->ip4src;
  800. }
  801. if (ip_mask->pdst) {
  802. if (ip_mask->pdst != PORT_FULL_MASK)
  803. return -EINVAL;
  804. spec.match_flags |= EFX_FILTER_MATCH_LOC_PORT;
  805. spec.loc_port = ip_entry->pdst;
  806. }
  807. if (ip_mask->psrc) {
  808. if (ip_mask->psrc != PORT_FULL_MASK)
  809. return -EINVAL;
  810. spec.match_flags |= EFX_FILTER_MATCH_REM_PORT;
  811. spec.rem_port = ip_entry->psrc;
  812. }
  813. if (ip_mask->tos)
  814. return -EINVAL;
  815. break;
  816. case ETHER_FLOW:
  817. if (!is_zero_ether_addr(mac_mask->h_dest)) {
  818. if (ether_addr_equal(mac_mask->h_dest,
  819. mac_addr_ig_mask))
  820. spec.match_flags |= EFX_FILTER_MATCH_LOC_MAC_IG;
  821. else if (is_broadcast_ether_addr(mac_mask->h_dest))
  822. spec.match_flags |= EFX_FILTER_MATCH_LOC_MAC;
  823. else
  824. return -EINVAL;
  825. memcpy(spec.loc_mac, mac_entry->h_dest, ETH_ALEN);
  826. }
  827. if (!is_zero_ether_addr(mac_mask->h_source)) {
  828. if (!is_broadcast_ether_addr(mac_mask->h_source))
  829. return -EINVAL;
  830. spec.match_flags |= EFX_FILTER_MATCH_REM_MAC;
  831. memcpy(spec.rem_mac, mac_entry->h_source, ETH_ALEN);
  832. }
  833. if (mac_mask->h_proto) {
  834. if (mac_mask->h_proto != ETHER_TYPE_FULL_MASK)
  835. return -EINVAL;
  836. spec.match_flags |= EFX_FILTER_MATCH_ETHER_TYPE;
  837. spec.ether_type = mac_entry->h_proto;
  838. }
  839. break;
  840. default:
  841. return -EINVAL;
  842. }
  843. if ((rule->flow_type & FLOW_EXT) && rule->m_ext.vlan_tci) {
  844. if (rule->m_ext.vlan_tci != htons(0xfff))
  845. return -EINVAL;
  846. spec.match_flags |= EFX_FILTER_MATCH_OUTER_VID;
  847. spec.outer_vid = rule->h_ext.vlan_tci;
  848. }
  849. rc = efx_filter_insert_filter(efx, &spec, true);
  850. if (rc < 0)
  851. return rc;
  852. rule->location = rc;
  853. return 0;
  854. }
  855. static int efx_ethtool_set_rxnfc(struct net_device *net_dev,
  856. struct ethtool_rxnfc *info)
  857. {
  858. struct efx_nic *efx = netdev_priv(net_dev);
  859. if (efx_filter_get_rx_id_limit(efx) == 0)
  860. return -EOPNOTSUPP;
  861. switch (info->cmd) {
  862. case ETHTOOL_SRXCLSRLINS:
  863. return efx_ethtool_set_class_rule(efx, &info->fs);
  864. case ETHTOOL_SRXCLSRLDEL:
  865. return efx_filter_remove_id_safe(efx, EFX_FILTER_PRI_MANUAL,
  866. info->fs.location);
  867. default:
  868. return -EOPNOTSUPP;
  869. }
  870. }
  871. static u32 efx_ethtool_get_rxfh_indir_size(struct net_device *net_dev)
  872. {
  873. struct efx_nic *efx = netdev_priv(net_dev);
  874. return ((efx_nic_rev(efx) < EFX_REV_FALCON_B0 ||
  875. efx->n_rx_channels == 1) ?
  876. 0 : ARRAY_SIZE(efx->rx_indir_table));
  877. }
  878. static int efx_ethtool_get_rxfh_indir(struct net_device *net_dev, u32 *indir)
  879. {
  880. struct efx_nic *efx = netdev_priv(net_dev);
  881. memcpy(indir, efx->rx_indir_table, sizeof(efx->rx_indir_table));
  882. return 0;
  883. }
  884. static int efx_ethtool_set_rxfh_indir(struct net_device *net_dev,
  885. const u32 *indir)
  886. {
  887. struct efx_nic *efx = netdev_priv(net_dev);
  888. memcpy(efx->rx_indir_table, indir, sizeof(efx->rx_indir_table));
  889. efx_nic_push_rx_indir_table(efx);
  890. return 0;
  891. }
  892. int efx_ethtool_get_ts_info(struct net_device *net_dev,
  893. struct ethtool_ts_info *ts_info)
  894. {
  895. struct efx_nic *efx = netdev_priv(net_dev);
  896. /* Software capabilities */
  897. ts_info->so_timestamping = (SOF_TIMESTAMPING_RX_SOFTWARE |
  898. SOF_TIMESTAMPING_SOFTWARE);
  899. ts_info->phc_index = -1;
  900. efx_ptp_get_ts_info(efx, ts_info);
  901. return 0;
  902. }
  903. static int efx_ethtool_get_module_eeprom(struct net_device *net_dev,
  904. struct ethtool_eeprom *ee,
  905. u8 *data)
  906. {
  907. struct efx_nic *efx = netdev_priv(net_dev);
  908. int ret;
  909. if (!efx->phy_op || !efx->phy_op->get_module_eeprom)
  910. return -EOPNOTSUPP;
  911. mutex_lock(&efx->mac_lock);
  912. ret = efx->phy_op->get_module_eeprom(efx, ee, data);
  913. mutex_unlock(&efx->mac_lock);
  914. return ret;
  915. }
  916. static int efx_ethtool_get_module_info(struct net_device *net_dev,
  917. struct ethtool_modinfo *modinfo)
  918. {
  919. struct efx_nic *efx = netdev_priv(net_dev);
  920. int ret;
  921. if (!efx->phy_op || !efx->phy_op->get_module_info)
  922. return -EOPNOTSUPP;
  923. mutex_lock(&efx->mac_lock);
  924. ret = efx->phy_op->get_module_info(efx, modinfo);
  925. mutex_unlock(&efx->mac_lock);
  926. return ret;
  927. }
  928. const struct ethtool_ops efx_ethtool_ops = {
  929. .get_settings = efx_ethtool_get_settings,
  930. .set_settings = efx_ethtool_set_settings,
  931. .get_drvinfo = efx_ethtool_get_drvinfo,
  932. .get_regs_len = efx_ethtool_get_regs_len,
  933. .get_regs = efx_ethtool_get_regs,
  934. .get_msglevel = efx_ethtool_get_msglevel,
  935. .set_msglevel = efx_ethtool_set_msglevel,
  936. .nway_reset = efx_ethtool_nway_reset,
  937. .get_link = ethtool_op_get_link,
  938. .get_coalesce = efx_ethtool_get_coalesce,
  939. .set_coalesce = efx_ethtool_set_coalesce,
  940. .get_ringparam = efx_ethtool_get_ringparam,
  941. .set_ringparam = efx_ethtool_set_ringparam,
  942. .get_pauseparam = efx_ethtool_get_pauseparam,
  943. .set_pauseparam = efx_ethtool_set_pauseparam,
  944. .get_sset_count = efx_ethtool_get_sset_count,
  945. .self_test = efx_ethtool_self_test,
  946. .get_strings = efx_ethtool_get_strings,
  947. .set_phys_id = efx_ethtool_phys_id,
  948. .get_ethtool_stats = efx_ethtool_get_stats,
  949. .get_wol = efx_ethtool_get_wol,
  950. .set_wol = efx_ethtool_set_wol,
  951. .reset = efx_ethtool_reset,
  952. .get_rxnfc = efx_ethtool_get_rxnfc,
  953. .set_rxnfc = efx_ethtool_set_rxnfc,
  954. .get_rxfh_indir_size = efx_ethtool_get_rxfh_indir_size,
  955. .get_rxfh_indir = efx_ethtool_get_rxfh_indir,
  956. .set_rxfh_indir = efx_ethtool_set_rxfh_indir,
  957. .get_ts_info = efx_ethtool_get_ts_info,
  958. .get_module_info = efx_ethtool_get_module_info,
  959. .get_module_eeprom = efx_ethtool_get_module_eeprom,
  960. };