ethtool.c 32 KB

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