ethtool.c 31 KB

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