be_ethtool.c 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173
  1. /*
  2. * Copyright (C) 2005 - 2013 Emulex
  3. * All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License version 2
  7. * as published by the Free Software Foundation. The full GNU General
  8. * Public License is included in this distribution in the file called COPYING.
  9. *
  10. * Contact Information:
  11. * linux-drivers@emulex.com
  12. *
  13. * Emulex
  14. * 3333 Susan Street
  15. * Costa Mesa, CA 92626
  16. */
  17. #include "be.h"
  18. #include "be_cmds.h"
  19. #include <linux/ethtool.h>
  20. struct be_ethtool_stat {
  21. char desc[ETH_GSTRING_LEN];
  22. int type;
  23. int size;
  24. int offset;
  25. };
  26. enum {DRVSTAT_TX, DRVSTAT_RX, DRVSTAT};
  27. #define FIELDINFO(_struct, field) FIELD_SIZEOF(_struct, field), \
  28. offsetof(_struct, field)
  29. #define DRVSTAT_TX_INFO(field) #field, DRVSTAT_TX,\
  30. FIELDINFO(struct be_tx_stats, field)
  31. #define DRVSTAT_RX_INFO(field) #field, DRVSTAT_RX,\
  32. FIELDINFO(struct be_rx_stats, field)
  33. #define DRVSTAT_INFO(field) #field, DRVSTAT,\
  34. FIELDINFO(struct be_drv_stats, field)
  35. static const struct be_ethtool_stat et_stats[] = {
  36. {DRVSTAT_INFO(rx_crc_errors)},
  37. {DRVSTAT_INFO(rx_alignment_symbol_errors)},
  38. {DRVSTAT_INFO(rx_pause_frames)},
  39. {DRVSTAT_INFO(rx_control_frames)},
  40. /* Received packets dropped when the Ethernet length field
  41. * is not equal to the actual Ethernet data length.
  42. */
  43. {DRVSTAT_INFO(rx_in_range_errors)},
  44. /* Received packets dropped when their length field is >= 1501 bytes
  45. * and <= 1535 bytes.
  46. */
  47. {DRVSTAT_INFO(rx_out_range_errors)},
  48. /* Received packets dropped when they are longer than 9216 bytes */
  49. {DRVSTAT_INFO(rx_frame_too_long)},
  50. /* Received packets dropped when they don't pass the unicast or
  51. * multicast address filtering.
  52. */
  53. {DRVSTAT_INFO(rx_address_filtered)},
  54. /* Received packets dropped when IP packet length field is less than
  55. * the IP header length field.
  56. */
  57. {DRVSTAT_INFO(rx_dropped_too_small)},
  58. /* Received packets dropped when IP length field is greater than
  59. * the actual packet length.
  60. */
  61. {DRVSTAT_INFO(rx_dropped_too_short)},
  62. /* Received packets dropped when the IP header length field is less
  63. * than 5.
  64. */
  65. {DRVSTAT_INFO(rx_dropped_header_too_small)},
  66. /* Received packets dropped when the TCP header length field is less
  67. * than 5 or the TCP header length + IP header length is more
  68. * than IP packet length.
  69. */
  70. {DRVSTAT_INFO(rx_dropped_tcp_length)},
  71. {DRVSTAT_INFO(rx_dropped_runt)},
  72. /* Number of received packets dropped when a fifo for descriptors going
  73. * into the packet demux block overflows. In normal operation, this
  74. * fifo must never overflow.
  75. */
  76. {DRVSTAT_INFO(rxpp_fifo_overflow_drop)},
  77. {DRVSTAT_INFO(rx_input_fifo_overflow_drop)},
  78. {DRVSTAT_INFO(rx_ip_checksum_errs)},
  79. {DRVSTAT_INFO(rx_tcp_checksum_errs)},
  80. {DRVSTAT_INFO(rx_udp_checksum_errs)},
  81. {DRVSTAT_INFO(tx_pauseframes)},
  82. {DRVSTAT_INFO(tx_controlframes)},
  83. {DRVSTAT_INFO(rx_priority_pause_frames)},
  84. {DRVSTAT_INFO(tx_priority_pauseframes)},
  85. /* Received packets dropped when an internal fifo going into
  86. * main packet buffer tank (PMEM) overflows.
  87. */
  88. {DRVSTAT_INFO(pmem_fifo_overflow_drop)},
  89. {DRVSTAT_INFO(jabber_events)},
  90. /* Received packets dropped due to lack of available HW packet buffers
  91. * used to temporarily hold the received packets.
  92. */
  93. {DRVSTAT_INFO(rx_drops_no_pbuf)},
  94. /* Received packets dropped due to input receive buffer
  95. * descriptor fifo overflowing.
  96. */
  97. {DRVSTAT_INFO(rx_drops_no_erx_descr)},
  98. /* Packets dropped because the internal FIFO to the offloaded TCP
  99. * receive processing block is full. This could happen only for
  100. * offloaded iSCSI or FCoE trarffic.
  101. */
  102. {DRVSTAT_INFO(rx_drops_no_tpre_descr)},
  103. /* Received packets dropped when they need more than 8
  104. * receive buffers. This cannot happen as the driver configures
  105. * 2048 byte receive buffers.
  106. */
  107. {DRVSTAT_INFO(rx_drops_too_many_frags)},
  108. {DRVSTAT_INFO(forwarded_packets)},
  109. /* Received packets dropped when the frame length
  110. * is more than 9018 bytes
  111. */
  112. {DRVSTAT_INFO(rx_drops_mtu)},
  113. /* Number of packets dropped due to random early drop function */
  114. {DRVSTAT_INFO(eth_red_drops)},
  115. {DRVSTAT_INFO(be_on_die_temperature)}
  116. };
  117. #define ETHTOOL_STATS_NUM ARRAY_SIZE(et_stats)
  118. /* Stats related to multi RX queues: get_stats routine assumes bytes, pkts
  119. * are first and second members respectively.
  120. */
  121. static const struct be_ethtool_stat et_rx_stats[] = {
  122. {DRVSTAT_RX_INFO(rx_bytes)},/* If moving this member see above note */
  123. {DRVSTAT_RX_INFO(rx_pkts)}, /* If moving this member see above note */
  124. {DRVSTAT_RX_INFO(rx_compl)},
  125. {DRVSTAT_RX_INFO(rx_mcast_pkts)},
  126. /* Number of page allocation failures while posting receive buffers
  127. * to HW.
  128. */
  129. {DRVSTAT_RX_INFO(rx_post_fail)},
  130. /* Recevied packets dropped due to skb allocation failure */
  131. {DRVSTAT_RX_INFO(rx_drops_no_skbs)},
  132. /* Received packets dropped due to lack of available fetched buffers
  133. * posted by the driver.
  134. */
  135. {DRVSTAT_RX_INFO(rx_drops_no_frags)}
  136. };
  137. #define ETHTOOL_RXSTATS_NUM (ARRAY_SIZE(et_rx_stats))
  138. /* Stats related to multi TX queues: get_stats routine assumes compl is the
  139. * first member
  140. */
  141. static const struct be_ethtool_stat et_tx_stats[] = {
  142. {DRVSTAT_TX_INFO(tx_compl)}, /* If moving this member see above note */
  143. {DRVSTAT_TX_INFO(tx_bytes)},
  144. {DRVSTAT_TX_INFO(tx_pkts)},
  145. /* Number of skbs queued for trasmission by the driver */
  146. {DRVSTAT_TX_INFO(tx_reqs)},
  147. /* Number of TX work request blocks DMAed to HW */
  148. {DRVSTAT_TX_INFO(tx_wrbs)},
  149. /* Number of times the TX queue was stopped due to lack
  150. * of spaces in the TXQ.
  151. */
  152. {DRVSTAT_TX_INFO(tx_stops)}
  153. };
  154. #define ETHTOOL_TXSTATS_NUM (ARRAY_SIZE(et_tx_stats))
  155. static const char et_self_tests[][ETH_GSTRING_LEN] = {
  156. "MAC Loopback test",
  157. "PHY Loopback test",
  158. "External Loopback test",
  159. "DDR DMA test",
  160. "Link test"
  161. };
  162. #define ETHTOOL_TESTS_NUM ARRAY_SIZE(et_self_tests)
  163. #define BE_MAC_LOOPBACK 0x0
  164. #define BE_PHY_LOOPBACK 0x1
  165. #define BE_ONE_PORT_EXT_LOOPBACK 0x2
  166. #define BE_NO_LOOPBACK 0xff
  167. static void be_get_drvinfo(struct net_device *netdev,
  168. struct ethtool_drvinfo *drvinfo)
  169. {
  170. struct be_adapter *adapter = netdev_priv(netdev);
  171. strlcpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver));
  172. strlcpy(drvinfo->version, DRV_VER, sizeof(drvinfo->version));
  173. if (!memcmp(adapter->fw_ver, adapter->fw_on_flash, FW_VER_LEN))
  174. strlcpy(drvinfo->fw_version, adapter->fw_ver,
  175. sizeof(drvinfo->fw_version));
  176. else
  177. snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
  178. "%s [%s]", adapter->fw_ver, adapter->fw_on_flash);
  179. strlcpy(drvinfo->bus_info, pci_name(adapter->pdev),
  180. sizeof(drvinfo->bus_info));
  181. drvinfo->testinfo_len = 0;
  182. drvinfo->regdump_len = 0;
  183. drvinfo->eedump_len = 0;
  184. }
  185. static u32
  186. lancer_cmd_get_file_len(struct be_adapter *adapter, u8 *file_name)
  187. {
  188. u32 data_read = 0, eof;
  189. u8 addn_status;
  190. struct be_dma_mem data_len_cmd;
  191. int status;
  192. memset(&data_len_cmd, 0, sizeof(data_len_cmd));
  193. /* data_offset and data_size should be 0 to get reg len */
  194. status = lancer_cmd_read_object(adapter, &data_len_cmd, 0, 0,
  195. file_name, &data_read, &eof, &addn_status);
  196. return data_read;
  197. }
  198. static int
  199. lancer_cmd_read_file(struct be_adapter *adapter, u8 *file_name,
  200. u32 buf_len, void *buf)
  201. {
  202. struct be_dma_mem read_cmd;
  203. u32 read_len = 0, total_read_len = 0, chunk_size;
  204. u32 eof = 0;
  205. u8 addn_status;
  206. int status = 0;
  207. read_cmd.size = LANCER_READ_FILE_CHUNK;
  208. read_cmd.va = pci_alloc_consistent(adapter->pdev, read_cmd.size,
  209. &read_cmd.dma);
  210. if (!read_cmd.va) {
  211. dev_err(&adapter->pdev->dev,
  212. "Memory allocation failure while reading dump\n");
  213. return -ENOMEM;
  214. }
  215. while ((total_read_len < buf_len) && !eof) {
  216. chunk_size = min_t(u32, (buf_len - total_read_len),
  217. LANCER_READ_FILE_CHUNK);
  218. chunk_size = ALIGN(chunk_size, 4);
  219. status = lancer_cmd_read_object(adapter, &read_cmd, chunk_size,
  220. total_read_len, file_name, &read_len,
  221. &eof, &addn_status);
  222. if (!status) {
  223. memcpy(buf + total_read_len, read_cmd.va, read_len);
  224. total_read_len += read_len;
  225. eof &= LANCER_READ_FILE_EOF_MASK;
  226. } else {
  227. status = -EIO;
  228. break;
  229. }
  230. }
  231. pci_free_consistent(adapter->pdev, read_cmd.size, read_cmd.va,
  232. read_cmd.dma);
  233. return status;
  234. }
  235. static int
  236. be_get_reg_len(struct net_device *netdev)
  237. {
  238. struct be_adapter *adapter = netdev_priv(netdev);
  239. u32 log_size = 0;
  240. if (!check_privilege(adapter, MAX_PRIVILEGES))
  241. return 0;
  242. if (be_physfn(adapter)) {
  243. if (lancer_chip(adapter))
  244. log_size = lancer_cmd_get_file_len(adapter,
  245. LANCER_FW_DUMP_FILE);
  246. else
  247. be_cmd_get_reg_len(adapter, &log_size);
  248. }
  249. return log_size;
  250. }
  251. static void
  252. be_get_regs(struct net_device *netdev, struct ethtool_regs *regs, void *buf)
  253. {
  254. struct be_adapter *adapter = netdev_priv(netdev);
  255. if (be_physfn(adapter)) {
  256. memset(buf, 0, regs->len);
  257. if (lancer_chip(adapter))
  258. lancer_cmd_read_file(adapter, LANCER_FW_DUMP_FILE,
  259. regs->len, buf);
  260. else
  261. be_cmd_get_regs(adapter, regs->len, buf);
  262. }
  263. }
  264. static int be_get_coalesce(struct net_device *netdev,
  265. struct ethtool_coalesce *et)
  266. {
  267. struct be_adapter *adapter = netdev_priv(netdev);
  268. struct be_eq_obj *eqo = &adapter->eq_obj[0];
  269. et->rx_coalesce_usecs = eqo->cur_eqd;
  270. et->rx_coalesce_usecs_high = eqo->max_eqd;
  271. et->rx_coalesce_usecs_low = eqo->min_eqd;
  272. et->tx_coalesce_usecs = eqo->cur_eqd;
  273. et->tx_coalesce_usecs_high = eqo->max_eqd;
  274. et->tx_coalesce_usecs_low = eqo->min_eqd;
  275. et->use_adaptive_rx_coalesce = eqo->enable_aic;
  276. et->use_adaptive_tx_coalesce = eqo->enable_aic;
  277. return 0;
  278. }
  279. /* TX attributes are ignored. Only RX attributes are considered
  280. * eqd cmd is issued in the worker thread.
  281. */
  282. static int be_set_coalesce(struct net_device *netdev,
  283. struct ethtool_coalesce *et)
  284. {
  285. struct be_adapter *adapter = netdev_priv(netdev);
  286. struct be_eq_obj *eqo;
  287. int i;
  288. for_all_evt_queues(adapter, eqo, i) {
  289. eqo->enable_aic = et->use_adaptive_rx_coalesce;
  290. eqo->max_eqd = min(et->rx_coalesce_usecs_high, BE_MAX_EQD);
  291. eqo->min_eqd = min(et->rx_coalesce_usecs_low, eqo->max_eqd);
  292. eqo->eqd = et->rx_coalesce_usecs;
  293. }
  294. return 0;
  295. }
  296. static void
  297. be_get_ethtool_stats(struct net_device *netdev,
  298. struct ethtool_stats *stats, uint64_t *data)
  299. {
  300. struct be_adapter *adapter = netdev_priv(netdev);
  301. struct be_rx_obj *rxo;
  302. struct be_tx_obj *txo;
  303. void *p;
  304. unsigned int i, j, base = 0, start;
  305. for (i = 0; i < ETHTOOL_STATS_NUM; i++) {
  306. p = (u8 *)&adapter->drv_stats + et_stats[i].offset;
  307. data[i] = *(u32 *)p;
  308. }
  309. base += ETHTOOL_STATS_NUM;
  310. for_all_rx_queues(adapter, rxo, j) {
  311. struct be_rx_stats *stats = rx_stats(rxo);
  312. do {
  313. start = u64_stats_fetch_begin_bh(&stats->sync);
  314. data[base] = stats->rx_bytes;
  315. data[base + 1] = stats->rx_pkts;
  316. } while (u64_stats_fetch_retry_bh(&stats->sync, start));
  317. for (i = 2; i < ETHTOOL_RXSTATS_NUM; i++) {
  318. p = (u8 *)stats + et_rx_stats[i].offset;
  319. data[base + i] = *(u32 *)p;
  320. }
  321. base += ETHTOOL_RXSTATS_NUM;
  322. }
  323. for_all_tx_queues(adapter, txo, j) {
  324. struct be_tx_stats *stats = tx_stats(txo);
  325. do {
  326. start = u64_stats_fetch_begin_bh(&stats->sync_compl);
  327. data[base] = stats->tx_compl;
  328. } while (u64_stats_fetch_retry_bh(&stats->sync_compl, start));
  329. do {
  330. start = u64_stats_fetch_begin_bh(&stats->sync);
  331. for (i = 1; i < ETHTOOL_TXSTATS_NUM; i++) {
  332. p = (u8 *)stats + et_tx_stats[i].offset;
  333. data[base + i] =
  334. (et_tx_stats[i].size == sizeof(u64)) ?
  335. *(u64 *)p : *(u32 *)p;
  336. }
  337. } while (u64_stats_fetch_retry_bh(&stats->sync, start));
  338. base += ETHTOOL_TXSTATS_NUM;
  339. }
  340. }
  341. static void
  342. be_get_stat_strings(struct net_device *netdev, uint32_t stringset,
  343. uint8_t *data)
  344. {
  345. struct be_adapter *adapter = netdev_priv(netdev);
  346. int i, j;
  347. switch (stringset) {
  348. case ETH_SS_STATS:
  349. for (i = 0; i < ETHTOOL_STATS_NUM; i++) {
  350. memcpy(data, et_stats[i].desc, ETH_GSTRING_LEN);
  351. data += ETH_GSTRING_LEN;
  352. }
  353. for (i = 0; i < adapter->num_rx_qs; i++) {
  354. for (j = 0; j < ETHTOOL_RXSTATS_NUM; j++) {
  355. sprintf(data, "rxq%d: %s", i,
  356. et_rx_stats[j].desc);
  357. data += ETH_GSTRING_LEN;
  358. }
  359. }
  360. for (i = 0; i < adapter->num_tx_qs; i++) {
  361. for (j = 0; j < ETHTOOL_TXSTATS_NUM; j++) {
  362. sprintf(data, "txq%d: %s", i,
  363. et_tx_stats[j].desc);
  364. data += ETH_GSTRING_LEN;
  365. }
  366. }
  367. break;
  368. case ETH_SS_TEST:
  369. for (i = 0; i < ETHTOOL_TESTS_NUM; i++) {
  370. memcpy(data, et_self_tests[i], ETH_GSTRING_LEN);
  371. data += ETH_GSTRING_LEN;
  372. }
  373. break;
  374. }
  375. }
  376. static int be_get_sset_count(struct net_device *netdev, int stringset)
  377. {
  378. struct be_adapter *adapter = netdev_priv(netdev);
  379. switch (stringset) {
  380. case ETH_SS_TEST:
  381. return ETHTOOL_TESTS_NUM;
  382. case ETH_SS_STATS:
  383. return ETHTOOL_STATS_NUM +
  384. adapter->num_rx_qs * ETHTOOL_RXSTATS_NUM +
  385. adapter->num_tx_qs * ETHTOOL_TXSTATS_NUM;
  386. default:
  387. return -EINVAL;
  388. }
  389. }
  390. static u32 be_get_port_type(u32 phy_type, u32 dac_cable_len)
  391. {
  392. u32 port;
  393. switch (phy_type) {
  394. case PHY_TYPE_BASET_1GB:
  395. case PHY_TYPE_BASEX_1GB:
  396. case PHY_TYPE_SGMII:
  397. port = PORT_TP;
  398. break;
  399. case PHY_TYPE_SFP_PLUS_10GB:
  400. port = dac_cable_len ? PORT_DA : PORT_FIBRE;
  401. break;
  402. case PHY_TYPE_XFP_10GB:
  403. case PHY_TYPE_SFP_1GB:
  404. port = PORT_FIBRE;
  405. break;
  406. case PHY_TYPE_BASET_10GB:
  407. port = PORT_TP;
  408. break;
  409. default:
  410. port = PORT_OTHER;
  411. }
  412. return port;
  413. }
  414. static u32 convert_to_et_setting(u32 if_type, u32 if_speeds)
  415. {
  416. u32 val = 0;
  417. switch (if_type) {
  418. case PHY_TYPE_BASET_1GB:
  419. case PHY_TYPE_BASEX_1GB:
  420. case PHY_TYPE_SGMII:
  421. val |= SUPPORTED_TP;
  422. if (if_speeds & BE_SUPPORTED_SPEED_1GBPS)
  423. val |= SUPPORTED_1000baseT_Full;
  424. if (if_speeds & BE_SUPPORTED_SPEED_100MBPS)
  425. val |= SUPPORTED_100baseT_Full;
  426. if (if_speeds & BE_SUPPORTED_SPEED_10MBPS)
  427. val |= SUPPORTED_10baseT_Full;
  428. break;
  429. case PHY_TYPE_KX4_10GB:
  430. val |= SUPPORTED_Backplane;
  431. if (if_speeds & BE_SUPPORTED_SPEED_1GBPS)
  432. val |= SUPPORTED_1000baseKX_Full;
  433. if (if_speeds & BE_SUPPORTED_SPEED_10GBPS)
  434. val |= SUPPORTED_10000baseKX4_Full;
  435. break;
  436. case PHY_TYPE_KR_10GB:
  437. val |= SUPPORTED_Backplane |
  438. SUPPORTED_10000baseKR_Full;
  439. break;
  440. case PHY_TYPE_SFP_PLUS_10GB:
  441. case PHY_TYPE_XFP_10GB:
  442. case PHY_TYPE_SFP_1GB:
  443. val |= SUPPORTED_FIBRE;
  444. if (if_speeds & BE_SUPPORTED_SPEED_10GBPS)
  445. val |= SUPPORTED_10000baseT_Full;
  446. if (if_speeds & BE_SUPPORTED_SPEED_1GBPS)
  447. val |= SUPPORTED_1000baseT_Full;
  448. break;
  449. case PHY_TYPE_BASET_10GB:
  450. val |= SUPPORTED_TP;
  451. if (if_speeds & BE_SUPPORTED_SPEED_10GBPS)
  452. val |= SUPPORTED_10000baseT_Full;
  453. if (if_speeds & BE_SUPPORTED_SPEED_1GBPS)
  454. val |= SUPPORTED_1000baseT_Full;
  455. if (if_speeds & BE_SUPPORTED_SPEED_100MBPS)
  456. val |= SUPPORTED_100baseT_Full;
  457. break;
  458. default:
  459. val |= SUPPORTED_TP;
  460. }
  461. return val;
  462. }
  463. bool be_pause_supported(struct be_adapter *adapter)
  464. {
  465. return (adapter->phy.interface_type == PHY_TYPE_SFP_PLUS_10GB ||
  466. adapter->phy.interface_type == PHY_TYPE_XFP_10GB) ?
  467. false : true;
  468. }
  469. static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
  470. {
  471. struct be_adapter *adapter = netdev_priv(netdev);
  472. u8 link_status;
  473. u16 link_speed = 0;
  474. int status;
  475. u32 auto_speeds;
  476. u32 fixed_speeds;
  477. u32 dac_cable_len;
  478. u16 interface_type;
  479. if (adapter->phy.link_speed < 0) {
  480. status = be_cmd_link_status_query(adapter, &link_speed,
  481. &link_status, 0);
  482. if (!status)
  483. be_link_status_update(adapter, link_status);
  484. ethtool_cmd_speed_set(ecmd, link_speed);
  485. status = be_cmd_get_phy_info(adapter);
  486. if (!status) {
  487. interface_type = adapter->phy.interface_type;
  488. auto_speeds = adapter->phy.auto_speeds_supported;
  489. fixed_speeds = adapter->phy.fixed_speeds_supported;
  490. dac_cable_len = adapter->phy.dac_cable_len;
  491. ecmd->supported =
  492. convert_to_et_setting(interface_type,
  493. auto_speeds |
  494. fixed_speeds);
  495. ecmd->advertising =
  496. convert_to_et_setting(interface_type,
  497. auto_speeds);
  498. ecmd->port = be_get_port_type(interface_type,
  499. dac_cable_len);
  500. if (adapter->phy.auto_speeds_supported) {
  501. ecmd->supported |= SUPPORTED_Autoneg;
  502. ecmd->autoneg = AUTONEG_ENABLE;
  503. ecmd->advertising |= ADVERTISED_Autoneg;
  504. }
  505. ecmd->supported |= SUPPORTED_Pause;
  506. if (be_pause_supported(adapter))
  507. ecmd->advertising |= ADVERTISED_Pause;
  508. switch (adapter->phy.interface_type) {
  509. case PHY_TYPE_KR_10GB:
  510. case PHY_TYPE_KX4_10GB:
  511. ecmd->transceiver = XCVR_INTERNAL;
  512. break;
  513. default:
  514. ecmd->transceiver = XCVR_EXTERNAL;
  515. break;
  516. }
  517. } else {
  518. ecmd->port = PORT_OTHER;
  519. ecmd->autoneg = AUTONEG_DISABLE;
  520. ecmd->transceiver = XCVR_DUMMY1;
  521. }
  522. /* Save for future use */
  523. adapter->phy.link_speed = ethtool_cmd_speed(ecmd);
  524. adapter->phy.port_type = ecmd->port;
  525. adapter->phy.transceiver = ecmd->transceiver;
  526. adapter->phy.autoneg = ecmd->autoneg;
  527. adapter->phy.advertising = ecmd->advertising;
  528. adapter->phy.supported = ecmd->supported;
  529. } else {
  530. ethtool_cmd_speed_set(ecmd, adapter->phy.link_speed);
  531. ecmd->port = adapter->phy.port_type;
  532. ecmd->transceiver = adapter->phy.transceiver;
  533. ecmd->autoneg = adapter->phy.autoneg;
  534. ecmd->advertising = adapter->phy.advertising;
  535. ecmd->supported = adapter->phy.supported;
  536. }
  537. ecmd->duplex = netif_carrier_ok(netdev) ? DUPLEX_FULL : DUPLEX_UNKNOWN;
  538. ecmd->phy_address = adapter->port_num;
  539. return 0;
  540. }
  541. static void be_get_ringparam(struct net_device *netdev,
  542. struct ethtool_ringparam *ring)
  543. {
  544. struct be_adapter *adapter = netdev_priv(netdev);
  545. ring->rx_max_pending = ring->rx_pending = adapter->rx_obj[0].q.len;
  546. ring->tx_max_pending = ring->tx_pending = adapter->tx_obj[0].q.len;
  547. }
  548. static void
  549. be_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
  550. {
  551. struct be_adapter *adapter = netdev_priv(netdev);
  552. be_cmd_get_flow_control(adapter, &ecmd->tx_pause, &ecmd->rx_pause);
  553. ecmd->autoneg = adapter->phy.fc_autoneg;
  554. }
  555. static int
  556. be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
  557. {
  558. struct be_adapter *adapter = netdev_priv(netdev);
  559. int status;
  560. if (ecmd->autoneg != adapter->phy.fc_autoneg)
  561. return -EINVAL;
  562. adapter->tx_fc = ecmd->tx_pause;
  563. adapter->rx_fc = ecmd->rx_pause;
  564. status = be_cmd_set_flow_control(adapter,
  565. adapter->tx_fc, adapter->rx_fc);
  566. if (status)
  567. dev_warn(&adapter->pdev->dev, "Pause param set failed.\n");
  568. return status;
  569. }
  570. static int
  571. be_set_phys_id(struct net_device *netdev,
  572. enum ethtool_phys_id_state state)
  573. {
  574. struct be_adapter *adapter = netdev_priv(netdev);
  575. switch (state) {
  576. case ETHTOOL_ID_ACTIVE:
  577. be_cmd_get_beacon_state(adapter, adapter->hba_port_num,
  578. &adapter->beacon_state);
  579. return 1; /* cycle on/off once per second */
  580. case ETHTOOL_ID_ON:
  581. be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0,
  582. BEACON_STATE_ENABLED);
  583. break;
  584. case ETHTOOL_ID_OFF:
  585. be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0,
  586. BEACON_STATE_DISABLED);
  587. break;
  588. case ETHTOOL_ID_INACTIVE:
  589. be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0,
  590. adapter->beacon_state);
  591. }
  592. return 0;
  593. }
  594. static int be_set_dump(struct net_device *netdev, struct ethtool_dump *dump)
  595. {
  596. struct be_adapter *adapter = netdev_priv(netdev);
  597. struct device *dev = &adapter->pdev->dev;
  598. int status;
  599. if (!lancer_chip(adapter)) {
  600. dev_err(dev, "FW dump not supported\n");
  601. return -EOPNOTSUPP;
  602. }
  603. if (dump_present(adapter)) {
  604. dev_err(dev, "Previous dump not cleared, not forcing dump\n");
  605. return 0;
  606. }
  607. switch (dump->flag) {
  608. case LANCER_INITIATE_FW_DUMP:
  609. status = lancer_initiate_dump(adapter);
  610. if (!status)
  611. dev_info(dev, "F/w dump initiated successfully\n");
  612. break;
  613. default:
  614. dev_err(dev, "Invalid dump level: 0x%x\n", dump->flag);
  615. return -EINVAL;
  616. }
  617. return status;
  618. }
  619. static void
  620. be_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
  621. {
  622. struct be_adapter *adapter = netdev_priv(netdev);
  623. if (be_is_wol_supported(adapter)) {
  624. wol->supported |= WAKE_MAGIC;
  625. if (adapter->wol)
  626. wol->wolopts |= WAKE_MAGIC;
  627. } else
  628. wol->wolopts = 0;
  629. memset(&wol->sopass, 0, sizeof(wol->sopass));
  630. }
  631. static int
  632. be_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
  633. {
  634. struct be_adapter *adapter = netdev_priv(netdev);
  635. if (wol->wolopts & ~WAKE_MAGIC)
  636. return -EOPNOTSUPP;
  637. if (!be_is_wol_supported(adapter)) {
  638. dev_warn(&adapter->pdev->dev, "WOL not supported\n");
  639. return -EOPNOTSUPP;
  640. }
  641. if (wol->wolopts & WAKE_MAGIC)
  642. adapter->wol = true;
  643. else
  644. adapter->wol = false;
  645. return 0;
  646. }
  647. static int
  648. be_test_ddr_dma(struct be_adapter *adapter)
  649. {
  650. int ret, i;
  651. struct be_dma_mem ddrdma_cmd;
  652. static const u64 pattern[2] = {
  653. 0x5a5a5a5a5a5a5a5aULL, 0xa5a5a5a5a5a5a5a5ULL
  654. };
  655. ddrdma_cmd.size = sizeof(struct be_cmd_req_ddrdma_test);
  656. ddrdma_cmd.va = dma_alloc_coherent(&adapter->pdev->dev, ddrdma_cmd.size,
  657. &ddrdma_cmd.dma, GFP_KERNEL);
  658. if (!ddrdma_cmd.va)
  659. return -ENOMEM;
  660. for (i = 0; i < 2; i++) {
  661. ret = be_cmd_ddr_dma_test(adapter, pattern[i],
  662. 4096, &ddrdma_cmd);
  663. if (ret != 0)
  664. goto err;
  665. }
  666. err:
  667. dma_free_coherent(&adapter->pdev->dev, ddrdma_cmd.size, ddrdma_cmd.va,
  668. ddrdma_cmd.dma);
  669. return ret;
  670. }
  671. static u64 be_loopback_test(struct be_adapter *adapter, u8 loopback_type,
  672. u64 *status)
  673. {
  674. be_cmd_set_loopback(adapter, adapter->hba_port_num,
  675. loopback_type, 1);
  676. *status = be_cmd_loopback_test(adapter, adapter->hba_port_num,
  677. loopback_type, 1500,
  678. 2, 0xabc);
  679. be_cmd_set_loopback(adapter, adapter->hba_port_num,
  680. BE_NO_LOOPBACK, 1);
  681. return *status;
  682. }
  683. static void
  684. be_self_test(struct net_device *netdev, struct ethtool_test *test, u64 *data)
  685. {
  686. struct be_adapter *adapter = netdev_priv(netdev);
  687. int status;
  688. u8 link_status = 0;
  689. if (adapter->function_caps & BE_FUNCTION_CAPS_SUPER_NIC) {
  690. dev_err(&adapter->pdev->dev, "Self test not supported\n");
  691. test->flags |= ETH_TEST_FL_FAILED;
  692. return;
  693. }
  694. memset(data, 0, sizeof(u64) * ETHTOOL_TESTS_NUM);
  695. if (test->flags & ETH_TEST_FL_OFFLINE) {
  696. if (be_loopback_test(adapter, BE_MAC_LOOPBACK,
  697. &data[0]) != 0) {
  698. test->flags |= ETH_TEST_FL_FAILED;
  699. }
  700. if (be_loopback_test(adapter, BE_PHY_LOOPBACK,
  701. &data[1]) != 0) {
  702. test->flags |= ETH_TEST_FL_FAILED;
  703. }
  704. if (be_loopback_test(adapter, BE_ONE_PORT_EXT_LOOPBACK,
  705. &data[2]) != 0) {
  706. test->flags |= ETH_TEST_FL_FAILED;
  707. }
  708. }
  709. if (!lancer_chip(adapter) && be_test_ddr_dma(adapter) != 0) {
  710. data[3] = 1;
  711. test->flags |= ETH_TEST_FL_FAILED;
  712. }
  713. status = be_cmd_link_status_query(adapter, NULL, &link_status, 0);
  714. if (status) {
  715. test->flags |= ETH_TEST_FL_FAILED;
  716. data[4] = -1;
  717. } else if (!link_status) {
  718. test->flags |= ETH_TEST_FL_FAILED;
  719. data[4] = 1;
  720. }
  721. }
  722. static int
  723. be_do_flash(struct net_device *netdev, struct ethtool_flash *efl)
  724. {
  725. struct be_adapter *adapter = netdev_priv(netdev);
  726. return be_load_fw(adapter, efl->data);
  727. }
  728. static int
  729. be_get_eeprom_len(struct net_device *netdev)
  730. {
  731. struct be_adapter *adapter = netdev_priv(netdev);
  732. if (!check_privilege(adapter, MAX_PRIVILEGES))
  733. return 0;
  734. if (lancer_chip(adapter)) {
  735. if (be_physfn(adapter))
  736. return lancer_cmd_get_file_len(adapter,
  737. LANCER_VPD_PF_FILE);
  738. else
  739. return lancer_cmd_get_file_len(adapter,
  740. LANCER_VPD_VF_FILE);
  741. } else {
  742. return BE_READ_SEEPROM_LEN;
  743. }
  744. }
  745. static int
  746. be_read_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom,
  747. uint8_t *data)
  748. {
  749. struct be_adapter *adapter = netdev_priv(netdev);
  750. struct be_dma_mem eeprom_cmd;
  751. struct be_cmd_resp_seeprom_read *resp;
  752. int status;
  753. if (!eeprom->len)
  754. return -EINVAL;
  755. if (lancer_chip(adapter)) {
  756. if (be_physfn(adapter))
  757. return lancer_cmd_read_file(adapter, LANCER_VPD_PF_FILE,
  758. eeprom->len, data);
  759. else
  760. return lancer_cmd_read_file(adapter, LANCER_VPD_VF_FILE,
  761. eeprom->len, data);
  762. }
  763. eeprom->magic = BE_VENDOR_ID | (adapter->pdev->device<<16);
  764. memset(&eeprom_cmd, 0, sizeof(struct be_dma_mem));
  765. eeprom_cmd.size = sizeof(struct be_cmd_req_seeprom_read);
  766. eeprom_cmd.va = dma_alloc_coherent(&adapter->pdev->dev, eeprom_cmd.size,
  767. &eeprom_cmd.dma, GFP_KERNEL);
  768. if (!eeprom_cmd.va)
  769. return -ENOMEM;
  770. status = be_cmd_get_seeprom_data(adapter, &eeprom_cmd);
  771. if (!status) {
  772. resp = eeprom_cmd.va;
  773. memcpy(data, resp->seeprom_data + eeprom->offset, eeprom->len);
  774. }
  775. dma_free_coherent(&adapter->pdev->dev, eeprom_cmd.size, eeprom_cmd.va,
  776. eeprom_cmd.dma);
  777. return status;
  778. }
  779. static u32 be_get_msg_level(struct net_device *netdev)
  780. {
  781. struct be_adapter *adapter = netdev_priv(netdev);
  782. if (lancer_chip(adapter)) {
  783. dev_err(&adapter->pdev->dev, "Operation not supported\n");
  784. return -EOPNOTSUPP;
  785. }
  786. return adapter->msg_enable;
  787. }
  788. static void be_set_fw_log_level(struct be_adapter *adapter, u32 level)
  789. {
  790. struct be_dma_mem extfat_cmd;
  791. struct be_fat_conf_params *cfgs;
  792. int status;
  793. int i, j;
  794. memset(&extfat_cmd, 0, sizeof(struct be_dma_mem));
  795. extfat_cmd.size = sizeof(struct be_cmd_resp_get_ext_fat_caps);
  796. extfat_cmd.va = pci_alloc_consistent(adapter->pdev, extfat_cmd.size,
  797. &extfat_cmd.dma);
  798. if (!extfat_cmd.va) {
  799. dev_err(&adapter->pdev->dev, "%s: Memory allocation failure\n",
  800. __func__);
  801. goto err;
  802. }
  803. status = be_cmd_get_ext_fat_capabilites(adapter, &extfat_cmd);
  804. if (!status) {
  805. cfgs = (struct be_fat_conf_params *)(extfat_cmd.va +
  806. sizeof(struct be_cmd_resp_hdr));
  807. for (i = 0; i < le32_to_cpu(cfgs->num_modules); i++) {
  808. u32 num_modes = le32_to_cpu(cfgs->module[i].num_modes);
  809. for (j = 0; j < num_modes; j++) {
  810. if (cfgs->module[i].trace_lvl[j].mode ==
  811. MODE_UART)
  812. cfgs->module[i].trace_lvl[j].dbg_lvl =
  813. cpu_to_le32(level);
  814. }
  815. }
  816. status = be_cmd_set_ext_fat_capabilites(adapter, &extfat_cmd,
  817. cfgs);
  818. if (status)
  819. dev_err(&adapter->pdev->dev,
  820. "Message level set failed\n");
  821. } else {
  822. dev_err(&adapter->pdev->dev, "Message level get failed\n");
  823. }
  824. pci_free_consistent(adapter->pdev, extfat_cmd.size, extfat_cmd.va,
  825. extfat_cmd.dma);
  826. err:
  827. return;
  828. }
  829. static void be_set_msg_level(struct net_device *netdev, u32 level)
  830. {
  831. struct be_adapter *adapter = netdev_priv(netdev);
  832. if (lancer_chip(adapter)) {
  833. dev_err(&adapter->pdev->dev, "Operation not supported\n");
  834. return;
  835. }
  836. if (adapter->msg_enable == level)
  837. return;
  838. if ((level & NETIF_MSG_HW) != (adapter->msg_enable & NETIF_MSG_HW))
  839. be_set_fw_log_level(adapter, level & NETIF_MSG_HW ?
  840. FW_LOG_LEVEL_DEFAULT : FW_LOG_LEVEL_FATAL);
  841. adapter->msg_enable = level;
  842. return;
  843. }
  844. static u64 be_get_rss_hash_opts(struct be_adapter *adapter, u64 flow_type)
  845. {
  846. u64 data = 0;
  847. switch (flow_type) {
  848. case TCP_V4_FLOW:
  849. if (adapter->rss_flags & RSS_ENABLE_IPV4)
  850. data |= RXH_IP_DST | RXH_IP_SRC;
  851. if (adapter->rss_flags & RSS_ENABLE_TCP_IPV4)
  852. data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
  853. break;
  854. case UDP_V4_FLOW:
  855. if (adapter->rss_flags & RSS_ENABLE_IPV4)
  856. data |= RXH_IP_DST | RXH_IP_SRC;
  857. if (adapter->rss_flags & RSS_ENABLE_UDP_IPV4)
  858. data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
  859. break;
  860. case TCP_V6_FLOW:
  861. if (adapter->rss_flags & RSS_ENABLE_IPV6)
  862. data |= RXH_IP_DST | RXH_IP_SRC;
  863. if (adapter->rss_flags & RSS_ENABLE_TCP_IPV6)
  864. data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
  865. break;
  866. case UDP_V6_FLOW:
  867. if (adapter->rss_flags & RSS_ENABLE_IPV6)
  868. data |= RXH_IP_DST | RXH_IP_SRC;
  869. if (adapter->rss_flags & RSS_ENABLE_UDP_IPV6)
  870. data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
  871. break;
  872. }
  873. return data;
  874. }
  875. static int be_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd,
  876. u32 *rule_locs)
  877. {
  878. struct be_adapter *adapter = netdev_priv(netdev);
  879. if (!be_multi_rxq(adapter)) {
  880. dev_info(&adapter->pdev->dev,
  881. "ethtool::get_rxnfc: RX flow hashing is disabled\n");
  882. return -EINVAL;
  883. }
  884. switch (cmd->cmd) {
  885. case ETHTOOL_GRXFH:
  886. cmd->data = be_get_rss_hash_opts(adapter, cmd->flow_type);
  887. break;
  888. case ETHTOOL_GRXRINGS:
  889. cmd->data = adapter->num_rx_qs - 1;
  890. break;
  891. default:
  892. return -EINVAL;
  893. }
  894. return 0;
  895. }
  896. static int be_set_rss_hash_opts(struct be_adapter *adapter,
  897. struct ethtool_rxnfc *cmd)
  898. {
  899. struct be_rx_obj *rxo;
  900. int status = 0, i, j;
  901. u8 rsstable[128];
  902. u32 rss_flags = adapter->rss_flags;
  903. if (cmd->data != L3_RSS_FLAGS &&
  904. cmd->data != (L3_RSS_FLAGS | L4_RSS_FLAGS))
  905. return -EINVAL;
  906. switch (cmd->flow_type) {
  907. case TCP_V4_FLOW:
  908. if (cmd->data == L3_RSS_FLAGS)
  909. rss_flags &= ~RSS_ENABLE_TCP_IPV4;
  910. else if (cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS))
  911. rss_flags |= RSS_ENABLE_IPV4 |
  912. RSS_ENABLE_TCP_IPV4;
  913. break;
  914. case TCP_V6_FLOW:
  915. if (cmd->data == L3_RSS_FLAGS)
  916. rss_flags &= ~RSS_ENABLE_TCP_IPV6;
  917. else if (cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS))
  918. rss_flags |= RSS_ENABLE_IPV6 |
  919. RSS_ENABLE_TCP_IPV6;
  920. break;
  921. case UDP_V4_FLOW:
  922. if ((cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS)) &&
  923. BEx_chip(adapter))
  924. return -EINVAL;
  925. if (cmd->data == L3_RSS_FLAGS)
  926. rss_flags &= ~RSS_ENABLE_UDP_IPV4;
  927. else if (cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS))
  928. rss_flags |= RSS_ENABLE_IPV4 |
  929. RSS_ENABLE_UDP_IPV4;
  930. break;
  931. case UDP_V6_FLOW:
  932. if ((cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS)) &&
  933. BEx_chip(adapter))
  934. return -EINVAL;
  935. if (cmd->data == L3_RSS_FLAGS)
  936. rss_flags &= ~RSS_ENABLE_UDP_IPV6;
  937. else if (cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS))
  938. rss_flags |= RSS_ENABLE_IPV6 |
  939. RSS_ENABLE_UDP_IPV6;
  940. break;
  941. default:
  942. return -EINVAL;
  943. }
  944. if (rss_flags == adapter->rss_flags)
  945. return status;
  946. if (be_multi_rxq(adapter)) {
  947. for (j = 0; j < 128; j += adapter->num_rx_qs - 1) {
  948. for_all_rss_queues(adapter, rxo, i) {
  949. if ((j + i) >= 128)
  950. break;
  951. rsstable[j + i] = rxo->rss_id;
  952. }
  953. }
  954. }
  955. status = be_cmd_rss_config(adapter, rsstable, rss_flags, 128);
  956. if (!status)
  957. adapter->rss_flags = rss_flags;
  958. return status;
  959. }
  960. static int be_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd)
  961. {
  962. struct be_adapter *adapter = netdev_priv(netdev);
  963. int status = 0;
  964. if (!be_multi_rxq(adapter)) {
  965. dev_err(&adapter->pdev->dev,
  966. "ethtool::set_rxnfc: RX flow hashing is disabled\n");
  967. return -EINVAL;
  968. }
  969. switch (cmd->cmd) {
  970. case ETHTOOL_SRXFH:
  971. status = be_set_rss_hash_opts(adapter, cmd);
  972. break;
  973. default:
  974. return -EINVAL;
  975. }
  976. return status;
  977. }
  978. static void be_get_channels(struct net_device *netdev,
  979. struct ethtool_channels *ch)
  980. {
  981. struct be_adapter *adapter = netdev_priv(netdev);
  982. ch->combined_count = adapter->num_evt_qs;
  983. ch->max_combined = be_max_qs(adapter);
  984. }
  985. static int be_set_channels(struct net_device *netdev,
  986. struct ethtool_channels *ch)
  987. {
  988. struct be_adapter *adapter = netdev_priv(netdev);
  989. if (ch->rx_count || ch->tx_count || ch->other_count ||
  990. !ch->combined_count || ch->combined_count > be_max_qs(adapter))
  991. return -EINVAL;
  992. adapter->cfg_num_qs = ch->combined_count;
  993. return be_update_queues(adapter);
  994. }
  995. const struct ethtool_ops be_ethtool_ops = {
  996. .get_settings = be_get_settings,
  997. .get_drvinfo = be_get_drvinfo,
  998. .get_wol = be_get_wol,
  999. .set_wol = be_set_wol,
  1000. .get_link = ethtool_op_get_link,
  1001. .get_eeprom_len = be_get_eeprom_len,
  1002. .get_eeprom = be_read_eeprom,
  1003. .get_coalesce = be_get_coalesce,
  1004. .set_coalesce = be_set_coalesce,
  1005. .get_ringparam = be_get_ringparam,
  1006. .get_pauseparam = be_get_pauseparam,
  1007. .set_pauseparam = be_set_pauseparam,
  1008. .get_strings = be_get_stat_strings,
  1009. .set_phys_id = be_set_phys_id,
  1010. .set_dump = be_set_dump,
  1011. .get_msglevel = be_get_msg_level,
  1012. .set_msglevel = be_set_msg_level,
  1013. .get_sset_count = be_get_sset_count,
  1014. .get_ethtool_stats = be_get_ethtool_stats,
  1015. .get_regs_len = be_get_reg_len,
  1016. .get_regs = be_get_regs,
  1017. .flash_device = be_do_flash,
  1018. .self_test = be_self_test,
  1019. .get_rxnfc = be_get_rxnfc,
  1020. .set_rxnfc = be_set_rxnfc,
  1021. .get_channels = be_get_channels,
  1022. .set_channels = be_set_channels
  1023. };