ixgbe_82598.c 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117
  1. /*******************************************************************************
  2. Intel 10 Gigabit PCI Express Linux driver
  3. Copyright(c) 1999 - 2009 Intel Corporation.
  4. This program is free software; you can redistribute it and/or modify it
  5. under the terms and conditions of the GNU General Public License,
  6. version 2, as published by the Free Software Foundation.
  7. This program is distributed in the hope it will be useful, but WITHOUT
  8. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  9. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  10. more details.
  11. You should have received a copy of the GNU General Public License along with
  12. this program; if not, write to the Free Software Foundation, Inc.,
  13. 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  14. The full GNU General Public License is included in this distribution in
  15. the file called "COPYING".
  16. Contact Information:
  17. e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
  18. Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  19. *******************************************************************************/
  20. #include <linux/pci.h>
  21. #include <linux/delay.h>
  22. #include <linux/sched.h>
  23. #include "ixgbe.h"
  24. #include "ixgbe_phy.h"
  25. #define IXGBE_82598_MAX_TX_QUEUES 32
  26. #define IXGBE_82598_MAX_RX_QUEUES 64
  27. #define IXGBE_82598_RAR_ENTRIES 16
  28. #define IXGBE_82598_MC_TBL_SIZE 128
  29. #define IXGBE_82598_VFT_TBL_SIZE 128
  30. static s32 ixgbe_get_copper_link_capabilities_82598(struct ixgbe_hw *hw,
  31. ixgbe_link_speed *speed,
  32. bool *autoneg);
  33. static s32 ixgbe_setup_copper_link_82598(struct ixgbe_hw *hw);
  34. static s32 ixgbe_setup_copper_link_speed_82598(struct ixgbe_hw *hw,
  35. ixgbe_link_speed speed,
  36. bool autoneg,
  37. bool autoneg_wait_to_complete);
  38. static s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset,
  39. u8 *eeprom_data);
  40. /**
  41. * ixgbe_get_pcie_msix_count_82598 - Gets MSI-X vector count
  42. * @hw: pointer to hardware structure
  43. *
  44. * Read PCIe configuration space, and get the MSI-X vector count from
  45. * the capabilities table.
  46. **/
  47. static u16 ixgbe_get_pcie_msix_count_82598(struct ixgbe_hw *hw)
  48. {
  49. struct ixgbe_adapter *adapter = hw->back;
  50. u16 msix_count;
  51. pci_read_config_word(adapter->pdev, IXGBE_PCIE_MSIX_82598_CAPS,
  52. &msix_count);
  53. msix_count &= IXGBE_PCIE_MSIX_TBL_SZ_MASK;
  54. /* MSI-X count is zero-based in HW, so increment to give proper value */
  55. msix_count++;
  56. return msix_count;
  57. }
  58. /**
  59. */
  60. static s32 ixgbe_get_invariants_82598(struct ixgbe_hw *hw)
  61. {
  62. struct ixgbe_mac_info *mac = &hw->mac;
  63. struct ixgbe_phy_info *phy = &hw->phy;
  64. s32 ret_val = 0;
  65. u16 list_offset, data_offset;
  66. /* Set the bus information prior to PHY identification */
  67. mac->ops.get_bus_info(hw);
  68. /* Call PHY identify routine to get the phy type */
  69. ixgbe_identify_phy_generic(hw);
  70. /* PHY Init */
  71. switch (phy->type) {
  72. case ixgbe_phy_tn:
  73. phy->ops.check_link = &ixgbe_check_phy_link_tnx;
  74. phy->ops.get_firmware_version =
  75. &ixgbe_get_phy_firmware_version_tnx;
  76. break;
  77. case ixgbe_phy_nl:
  78. phy->ops.reset = &ixgbe_reset_phy_nl;
  79. /* Call SFP+ identify routine to get the SFP+ module type */
  80. ret_val = phy->ops.identify_sfp(hw);
  81. if (ret_val != 0)
  82. goto out;
  83. else if (hw->phy.sfp_type == ixgbe_sfp_type_unknown) {
  84. ret_val = IXGBE_ERR_SFP_NOT_SUPPORTED;
  85. goto out;
  86. }
  87. /* Check to see if SFP+ module is supported */
  88. ret_val = ixgbe_get_sfp_init_sequence_offsets(hw,
  89. &list_offset,
  90. &data_offset);
  91. if (ret_val != 0) {
  92. ret_val = IXGBE_ERR_SFP_NOT_SUPPORTED;
  93. goto out;
  94. }
  95. break;
  96. default:
  97. break;
  98. }
  99. if (mac->ops.get_media_type(hw) == ixgbe_media_type_copper) {
  100. mac->ops.setup_link = &ixgbe_setup_copper_link_82598;
  101. mac->ops.setup_link_speed =
  102. &ixgbe_setup_copper_link_speed_82598;
  103. mac->ops.get_link_capabilities =
  104. &ixgbe_get_copper_link_capabilities_82598;
  105. }
  106. mac->mcft_size = IXGBE_82598_MC_TBL_SIZE;
  107. mac->vft_size = IXGBE_82598_VFT_TBL_SIZE;
  108. mac->num_rar_entries = IXGBE_82598_RAR_ENTRIES;
  109. mac->max_rx_queues = IXGBE_82598_MAX_RX_QUEUES;
  110. mac->max_tx_queues = IXGBE_82598_MAX_TX_QUEUES;
  111. mac->max_msix_vectors = ixgbe_get_pcie_msix_count_82598(hw);
  112. out:
  113. return ret_val;
  114. }
  115. /**
  116. * ixgbe_get_link_capabilities_82598 - Determines link capabilities
  117. * @hw: pointer to hardware structure
  118. * @speed: pointer to link speed
  119. * @autoneg: boolean auto-negotiation value
  120. *
  121. * Determines the link capabilities by reading the AUTOC register.
  122. **/
  123. static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw,
  124. ixgbe_link_speed *speed,
  125. bool *autoneg)
  126. {
  127. s32 status = 0;
  128. /*
  129. * Determine link capabilities based on the stored value of AUTOC,
  130. * which represents EEPROM defaults.
  131. */
  132. switch (hw->mac.orig_autoc & IXGBE_AUTOC_LMS_MASK) {
  133. case IXGBE_AUTOC_LMS_1G_LINK_NO_AN:
  134. *speed = IXGBE_LINK_SPEED_1GB_FULL;
  135. *autoneg = false;
  136. break;
  137. case IXGBE_AUTOC_LMS_10G_LINK_NO_AN:
  138. *speed = IXGBE_LINK_SPEED_10GB_FULL;
  139. *autoneg = false;
  140. break;
  141. case IXGBE_AUTOC_LMS_1G_AN:
  142. *speed = IXGBE_LINK_SPEED_1GB_FULL;
  143. *autoneg = true;
  144. break;
  145. case IXGBE_AUTOC_LMS_KX4_AN:
  146. case IXGBE_AUTOC_LMS_KX4_AN_1G_AN:
  147. *speed = IXGBE_LINK_SPEED_UNKNOWN;
  148. if (hw->mac.orig_autoc & IXGBE_AUTOC_KX4_SUPP)
  149. *speed |= IXGBE_LINK_SPEED_10GB_FULL;
  150. if (hw->mac.orig_autoc & IXGBE_AUTOC_KX_SUPP)
  151. *speed |= IXGBE_LINK_SPEED_1GB_FULL;
  152. *autoneg = true;
  153. break;
  154. default:
  155. status = IXGBE_ERR_LINK_SETUP;
  156. break;
  157. }
  158. return status;
  159. }
  160. /**
  161. * ixgbe_get_copper_link_capabilities_82598 - Determines link capabilities
  162. * @hw: pointer to hardware structure
  163. * @speed: pointer to link speed
  164. * @autoneg: boolean auto-negotiation value
  165. *
  166. * Determines the link capabilities by reading the AUTOC register.
  167. **/
  168. static s32 ixgbe_get_copper_link_capabilities_82598(struct ixgbe_hw *hw,
  169. ixgbe_link_speed *speed,
  170. bool *autoneg)
  171. {
  172. s32 status = IXGBE_ERR_LINK_SETUP;
  173. u16 speed_ability;
  174. *speed = 0;
  175. *autoneg = true;
  176. status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_SPEED_ABILITY,
  177. IXGBE_MDIO_PMA_PMD_DEV_TYPE,
  178. &speed_ability);
  179. if (status == 0) {
  180. if (speed_ability & IXGBE_MDIO_PHY_SPEED_10G)
  181. *speed |= IXGBE_LINK_SPEED_10GB_FULL;
  182. if (speed_ability & IXGBE_MDIO_PHY_SPEED_1G)
  183. *speed |= IXGBE_LINK_SPEED_1GB_FULL;
  184. }
  185. return status;
  186. }
  187. /**
  188. * ixgbe_get_media_type_82598 - Determines media type
  189. * @hw: pointer to hardware structure
  190. *
  191. * Returns the media type (fiber, copper, backplane)
  192. **/
  193. static enum ixgbe_media_type ixgbe_get_media_type_82598(struct ixgbe_hw *hw)
  194. {
  195. enum ixgbe_media_type media_type;
  196. /* Media type for I82598 is based on device ID */
  197. switch (hw->device_id) {
  198. case IXGBE_DEV_ID_82598:
  199. case IXGBE_DEV_ID_82598_BX:
  200. media_type = ixgbe_media_type_backplane;
  201. break;
  202. case IXGBE_DEV_ID_82598AF_DUAL_PORT:
  203. case IXGBE_DEV_ID_82598AF_SINGLE_PORT:
  204. case IXGBE_DEV_ID_82598EB_CX4:
  205. case IXGBE_DEV_ID_82598_CX4_DUAL_PORT:
  206. case IXGBE_DEV_ID_82598_DA_DUAL_PORT:
  207. case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM:
  208. case IXGBE_DEV_ID_82598EB_XF_LR:
  209. case IXGBE_DEV_ID_82598EB_SFP_LOM:
  210. media_type = ixgbe_media_type_fiber;
  211. break;
  212. case IXGBE_DEV_ID_82598AT:
  213. media_type = ixgbe_media_type_copper;
  214. break;
  215. default:
  216. media_type = ixgbe_media_type_unknown;
  217. break;
  218. }
  219. return media_type;
  220. }
  221. /**
  222. * ixgbe_fc_enable_82598 - Enable flow control
  223. * @hw: pointer to hardware structure
  224. * @packetbuf_num: packet buffer number (0-7)
  225. *
  226. * Enable flow control according to the current settings.
  227. **/
  228. static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num)
  229. {
  230. s32 ret_val = 0;
  231. u32 fctrl_reg;
  232. u32 rmcs_reg;
  233. u32 reg;
  234. fctrl_reg = IXGBE_READ_REG(hw, IXGBE_FCTRL);
  235. fctrl_reg &= ~(IXGBE_FCTRL_RFCE | IXGBE_FCTRL_RPFCE);
  236. rmcs_reg = IXGBE_READ_REG(hw, IXGBE_RMCS);
  237. rmcs_reg &= ~(IXGBE_RMCS_TFCE_PRIORITY | IXGBE_RMCS_TFCE_802_3X);
  238. /*
  239. * The possible values of fc.current_mode are:
  240. * 0: Flow control is completely disabled
  241. * 1: Rx flow control is enabled (we can receive pause frames,
  242. * but not send pause frames).
  243. * 2: Tx flow control is enabled (we can send pause frames but
  244. * we do not support receiving pause frames).
  245. * 3: Both Rx and Tx flow control (symmetric) are enabled.
  246. * other: Invalid.
  247. */
  248. switch (hw->fc.current_mode) {
  249. case ixgbe_fc_none:
  250. /* Flow control completely disabled by software override. */
  251. break;
  252. case ixgbe_fc_rx_pause:
  253. /*
  254. * Rx Flow control is enabled and Tx Flow control is
  255. * disabled by software override. Since there really
  256. * isn't a way to advertise that we are capable of RX
  257. * Pause ONLY, we will advertise that we support both
  258. * symmetric and asymmetric Rx PAUSE. Later, we will
  259. * disable the adapter's ability to send PAUSE frames.
  260. */
  261. fctrl_reg |= IXGBE_FCTRL_RFCE;
  262. break;
  263. case ixgbe_fc_tx_pause:
  264. /*
  265. * Tx Flow control is enabled, and Rx Flow control is
  266. * disabled by software override.
  267. */
  268. rmcs_reg |= IXGBE_RMCS_TFCE_802_3X;
  269. break;
  270. case ixgbe_fc_full:
  271. /* Flow control (both Rx and Tx) is enabled by SW override. */
  272. fctrl_reg |= IXGBE_FCTRL_RFCE;
  273. rmcs_reg |= IXGBE_RMCS_TFCE_802_3X;
  274. break;
  275. default:
  276. hw_dbg(hw, "Flow control param set incorrectly\n");
  277. ret_val = -IXGBE_ERR_CONFIG;
  278. goto out;
  279. break;
  280. }
  281. /* Enable 802.3x based flow control settings. */
  282. IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl_reg);
  283. IXGBE_WRITE_REG(hw, IXGBE_RMCS, rmcs_reg);
  284. /* Set up and enable Rx high/low water mark thresholds, enable XON. */
  285. if (hw->fc.current_mode & ixgbe_fc_tx_pause) {
  286. if (hw->fc.send_xon) {
  287. IXGBE_WRITE_REG(hw, IXGBE_FCRTL(packetbuf_num),
  288. (hw->fc.low_water | IXGBE_FCRTL_XONE));
  289. } else {
  290. IXGBE_WRITE_REG(hw, IXGBE_FCRTL(packetbuf_num),
  291. hw->fc.low_water);
  292. }
  293. IXGBE_WRITE_REG(hw, IXGBE_FCRTH(packetbuf_num),
  294. (hw->fc.high_water | IXGBE_FCRTH_FCEN));
  295. }
  296. /* Configure pause time (2 TCs per register) */
  297. reg = IXGBE_READ_REG(hw, IXGBE_FCTTV(packetbuf_num));
  298. if ((packetbuf_num & 1) == 0)
  299. reg = (reg & 0xFFFF0000) | hw->fc.pause_time;
  300. else
  301. reg = (reg & 0x0000FFFF) | (hw->fc.pause_time << 16);
  302. IXGBE_WRITE_REG(hw, IXGBE_FCTTV(packetbuf_num / 2), reg);
  303. IXGBE_WRITE_REG(hw, IXGBE_FCRTV, (hw->fc.pause_time >> 1));
  304. out:
  305. return ret_val;
  306. }
  307. /**
  308. * ixgbe_setup_fc_82598 - Configure flow control settings
  309. * @hw: pointer to hardware structure
  310. * @packetbuf_num: packet buffer number (0-7)
  311. *
  312. * Configures the flow control settings based on SW configuration. This
  313. * function is used for 802.3x flow control configuration only.
  314. **/
  315. static s32 ixgbe_setup_fc_82598(struct ixgbe_hw *hw, s32 packetbuf_num)
  316. {
  317. s32 ret_val = 0;
  318. ixgbe_link_speed speed;
  319. bool link_up;
  320. /* Validate the packetbuf configuration */
  321. if (packetbuf_num < 0 || packetbuf_num > 7) {
  322. hw_dbg(hw, "Invalid packet buffer number [%d], expected range is"
  323. " 0-7\n", packetbuf_num);
  324. ret_val = IXGBE_ERR_INVALID_LINK_SETTINGS;
  325. goto out;
  326. }
  327. /*
  328. * Validate the water mark configuration. Zero water marks are invalid
  329. * because it causes the controller to just blast out fc packets.
  330. */
  331. if (!hw->fc.low_water || !hw->fc.high_water || !hw->fc.pause_time) {
  332. hw_dbg(hw, "Invalid water mark configuration\n");
  333. ret_val = IXGBE_ERR_INVALID_LINK_SETTINGS;
  334. goto out;
  335. }
  336. /*
  337. * Validate the requested mode. Strict IEEE mode does not allow
  338. * ixgbe_fc_rx_pause because it will cause testing anomalies.
  339. */
  340. if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
  341. hw_dbg(hw, "ixgbe_fc_rx_pause not valid in strict IEEE mode\n");
  342. ret_val = IXGBE_ERR_INVALID_LINK_SETTINGS;
  343. goto out;
  344. }
  345. /*
  346. * 10gig parts do not have a word in the EEPROM to determine the
  347. * default flow control setting, so we explicitly set it to full.
  348. */
  349. if (hw->fc.requested_mode == ixgbe_fc_default)
  350. hw->fc.requested_mode = ixgbe_fc_full;
  351. /*
  352. * Save off the requested flow control mode for use later. Depending
  353. * on the link partner's capabilities, we may or may not use this mode.
  354. */
  355. hw->fc.current_mode = hw->fc.requested_mode;
  356. /* Decide whether to use autoneg or not. */
  357. hw->mac.ops.check_link(hw, &speed, &link_up, false);
  358. if (!hw->fc.disable_fc_autoneg && hw->phy.multispeed_fiber &&
  359. (speed == IXGBE_LINK_SPEED_1GB_FULL))
  360. ret_val = ixgbe_fc_autoneg(hw);
  361. if (ret_val)
  362. goto out;
  363. ret_val = ixgbe_fc_enable_82598(hw, packetbuf_num);
  364. out:
  365. return ret_val;
  366. }
  367. /**
  368. * ixgbe_setup_mac_link_82598 - Configures MAC link settings
  369. * @hw: pointer to hardware structure
  370. *
  371. * Configures link settings based on values in the ixgbe_hw struct.
  372. * Restarts the link. Performs autonegotiation if needed.
  373. **/
  374. static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw)
  375. {
  376. u32 autoc_reg;
  377. u32 links_reg;
  378. u32 i;
  379. s32 status = 0;
  380. /* Restart link */
  381. autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC);
  382. autoc_reg |= IXGBE_AUTOC_AN_RESTART;
  383. IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg);
  384. /* Only poll for autoneg to complete if specified to do so */
  385. if (hw->phy.autoneg_wait_to_complete) {
  386. if ((autoc_reg & IXGBE_AUTOC_LMS_MASK) ==
  387. IXGBE_AUTOC_LMS_KX4_AN ||
  388. (autoc_reg & IXGBE_AUTOC_LMS_MASK) ==
  389. IXGBE_AUTOC_LMS_KX4_AN_1G_AN) {
  390. links_reg = 0; /* Just in case Autoneg time = 0 */
  391. for (i = 0; i < IXGBE_AUTO_NEG_TIME; i++) {
  392. links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS);
  393. if (links_reg & IXGBE_LINKS_KX_AN_COMP)
  394. break;
  395. msleep(100);
  396. }
  397. if (!(links_reg & IXGBE_LINKS_KX_AN_COMP)) {
  398. status = IXGBE_ERR_AUTONEG_NOT_COMPLETE;
  399. hw_dbg(hw, "Autonegotiation did not complete.\n");
  400. }
  401. }
  402. }
  403. /*
  404. * We want to save off the original Flow Control configuration just in
  405. * case we get disconnected and then reconnected into a different hub
  406. * or switch with different Flow Control capabilities.
  407. */
  408. ixgbe_setup_fc_82598(hw, 0);
  409. /* Add delay to filter out noises during initial link setup */
  410. msleep(50);
  411. return status;
  412. }
  413. /**
  414. * ixgbe_check_mac_link_82598 - Get link/speed status
  415. * @hw: pointer to hardware structure
  416. * @speed: pointer to link speed
  417. * @link_up: true is link is up, false otherwise
  418. * @link_up_wait_to_complete: bool used to wait for link up or not
  419. *
  420. * Reads the links register to determine if link is up and the current speed
  421. **/
  422. static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw,
  423. ixgbe_link_speed *speed, bool *link_up,
  424. bool link_up_wait_to_complete)
  425. {
  426. u32 links_reg;
  427. u32 i;
  428. u16 link_reg, adapt_comp_reg;
  429. /*
  430. * SERDES PHY requires us to read link status from register 0xC79F.
  431. * Bit 0 set indicates link is up/ready; clear indicates link down.
  432. * 0xC00C is read to check that the XAUI lanes are active. Bit 0
  433. * clear indicates active; set indicates inactive.
  434. */
  435. if (hw->phy.type == ixgbe_phy_nl) {
  436. hw->phy.ops.read_reg(hw, 0xC79F, IXGBE_TWINAX_DEV, &link_reg);
  437. hw->phy.ops.read_reg(hw, 0xC79F, IXGBE_TWINAX_DEV, &link_reg);
  438. hw->phy.ops.read_reg(hw, 0xC00C, IXGBE_TWINAX_DEV,
  439. &adapt_comp_reg);
  440. if (link_up_wait_to_complete) {
  441. for (i = 0; i < IXGBE_LINK_UP_TIME; i++) {
  442. if ((link_reg & 1) &&
  443. ((adapt_comp_reg & 1) == 0)) {
  444. *link_up = true;
  445. break;
  446. } else {
  447. *link_up = false;
  448. }
  449. msleep(100);
  450. hw->phy.ops.read_reg(hw, 0xC79F,
  451. IXGBE_TWINAX_DEV,
  452. &link_reg);
  453. hw->phy.ops.read_reg(hw, 0xC00C,
  454. IXGBE_TWINAX_DEV,
  455. &adapt_comp_reg);
  456. }
  457. } else {
  458. if ((link_reg & 1) && ((adapt_comp_reg & 1) == 0))
  459. *link_up = true;
  460. else
  461. *link_up = false;
  462. }
  463. if (*link_up == false)
  464. goto out;
  465. }
  466. links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS);
  467. if (link_up_wait_to_complete) {
  468. for (i = 0; i < IXGBE_LINK_UP_TIME; i++) {
  469. if (links_reg & IXGBE_LINKS_UP) {
  470. *link_up = true;
  471. break;
  472. } else {
  473. *link_up = false;
  474. }
  475. msleep(100);
  476. links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS);
  477. }
  478. } else {
  479. if (links_reg & IXGBE_LINKS_UP)
  480. *link_up = true;
  481. else
  482. *link_up = false;
  483. }
  484. if (links_reg & IXGBE_LINKS_SPEED)
  485. *speed = IXGBE_LINK_SPEED_10GB_FULL;
  486. else
  487. *speed = IXGBE_LINK_SPEED_1GB_FULL;
  488. out:
  489. return 0;
  490. }
  491. /**
  492. * ixgbe_setup_mac_link_speed_82598 - Set MAC link speed
  493. * @hw: pointer to hardware structure
  494. * @speed: new link speed
  495. * @autoneg: true if auto-negotiation enabled
  496. * @autoneg_wait_to_complete: true if waiting is needed to complete
  497. *
  498. * Set the link speed in the AUTOC register and restarts link.
  499. **/
  500. static s32 ixgbe_setup_mac_link_speed_82598(struct ixgbe_hw *hw,
  501. ixgbe_link_speed speed, bool autoneg,
  502. bool autoneg_wait_to_complete)
  503. {
  504. s32 status = 0;
  505. ixgbe_link_speed link_capabilities = IXGBE_LINK_SPEED_UNKNOWN;
  506. u32 curr_autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC);
  507. u32 autoc = curr_autoc;
  508. u32 link_mode = autoc & IXGBE_AUTOC_LMS_MASK;
  509. /* Check to see if speed passed in is supported. */
  510. ixgbe_get_link_capabilities_82598(hw, &link_capabilities, &autoneg);
  511. speed &= link_capabilities;
  512. if (speed == IXGBE_LINK_SPEED_UNKNOWN)
  513. status = IXGBE_ERR_LINK_SETUP;
  514. /* Set KX4/KX support according to speed requested */
  515. else if (link_mode == IXGBE_AUTOC_LMS_KX4_AN ||
  516. link_mode == IXGBE_AUTOC_LMS_KX4_AN_1G_AN) {
  517. autoc &= ~IXGBE_AUTOC_KX4_KX_SUPP_MASK;
  518. if (speed & IXGBE_LINK_SPEED_10GB_FULL)
  519. autoc |= IXGBE_AUTOC_KX4_SUPP;
  520. if (speed & IXGBE_LINK_SPEED_1GB_FULL)
  521. autoc |= IXGBE_AUTOC_KX_SUPP;
  522. if (autoc != curr_autoc)
  523. IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc);
  524. }
  525. if (status == 0) {
  526. hw->phy.autoneg_wait_to_complete = autoneg_wait_to_complete;
  527. /*
  528. * Setup and restart the link based on the new values in
  529. * ixgbe_hw This will write the AUTOC register based on the new
  530. * stored values
  531. */
  532. status = ixgbe_setup_mac_link_82598(hw);
  533. }
  534. return status;
  535. }
  536. /**
  537. * ixgbe_setup_copper_link_82598 - Setup copper link settings
  538. * @hw: pointer to hardware structure
  539. *
  540. * Configures link settings based on values in the ixgbe_hw struct.
  541. * Restarts the link. Performs autonegotiation if needed. Restart
  542. * phy and wait for autonegotiate to finish. Then synchronize the
  543. * MAC and PHY.
  544. **/
  545. static s32 ixgbe_setup_copper_link_82598(struct ixgbe_hw *hw)
  546. {
  547. s32 status;
  548. /* Restart autonegotiation on PHY */
  549. status = hw->phy.ops.setup_link(hw);
  550. /* Set up MAC */
  551. ixgbe_setup_mac_link_82598(hw);
  552. return status;
  553. }
  554. /**
  555. * ixgbe_setup_copper_link_speed_82598 - Set the PHY autoneg advertised field
  556. * @hw: pointer to hardware structure
  557. * @speed: new link speed
  558. * @autoneg: true if autonegotiation enabled
  559. * @autoneg_wait_to_complete: true if waiting is needed to complete
  560. *
  561. * Sets the link speed in the AUTOC register in the MAC and restarts link.
  562. **/
  563. static s32 ixgbe_setup_copper_link_speed_82598(struct ixgbe_hw *hw,
  564. ixgbe_link_speed speed,
  565. bool autoneg,
  566. bool autoneg_wait_to_complete)
  567. {
  568. s32 status;
  569. /* Setup the PHY according to input speed */
  570. status = hw->phy.ops.setup_link_speed(hw, speed, autoneg,
  571. autoneg_wait_to_complete);
  572. /* Set up MAC */
  573. ixgbe_setup_mac_link_82598(hw);
  574. return status;
  575. }
  576. /**
  577. * ixgbe_reset_hw_82598 - Performs hardware reset
  578. * @hw: pointer to hardware structure
  579. *
  580. * Resets the hardware by resetting the transmit and receive units, masks and
  581. * clears all interrupts, performing a PHY reset, and performing a link (MAC)
  582. * reset.
  583. **/
  584. static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw)
  585. {
  586. s32 status = 0;
  587. u32 ctrl;
  588. u32 gheccr;
  589. u32 i;
  590. u32 autoc;
  591. u8 analog_val;
  592. /* Call adapter stop to disable tx/rx and clear interrupts */
  593. hw->mac.ops.stop_adapter(hw);
  594. /*
  595. * Power up the Atlas Tx lanes if they are currently powered down.
  596. * Atlas Tx lanes are powered down for MAC loopback tests, but
  597. * they are not automatically restored on reset.
  598. */
  599. hw->mac.ops.read_analog_reg8(hw, IXGBE_ATLAS_PDN_LPBK, &analog_val);
  600. if (analog_val & IXGBE_ATLAS_PDN_TX_REG_EN) {
  601. /* Enable Tx Atlas so packets can be transmitted again */
  602. hw->mac.ops.read_analog_reg8(hw, IXGBE_ATLAS_PDN_LPBK,
  603. &analog_val);
  604. analog_val &= ~IXGBE_ATLAS_PDN_TX_REG_EN;
  605. hw->mac.ops.write_analog_reg8(hw, IXGBE_ATLAS_PDN_LPBK,
  606. analog_val);
  607. hw->mac.ops.read_analog_reg8(hw, IXGBE_ATLAS_PDN_10G,
  608. &analog_val);
  609. analog_val &= ~IXGBE_ATLAS_PDN_TX_10G_QL_ALL;
  610. hw->mac.ops.write_analog_reg8(hw, IXGBE_ATLAS_PDN_10G,
  611. analog_val);
  612. hw->mac.ops.read_analog_reg8(hw, IXGBE_ATLAS_PDN_1G,
  613. &analog_val);
  614. analog_val &= ~IXGBE_ATLAS_PDN_TX_1G_QL_ALL;
  615. hw->mac.ops.write_analog_reg8(hw, IXGBE_ATLAS_PDN_1G,
  616. analog_val);
  617. hw->mac.ops.read_analog_reg8(hw, IXGBE_ATLAS_PDN_AN,
  618. &analog_val);
  619. analog_val &= ~IXGBE_ATLAS_PDN_TX_AN_QL_ALL;
  620. hw->mac.ops.write_analog_reg8(hw, IXGBE_ATLAS_PDN_AN,
  621. analog_val);
  622. }
  623. /* Reset PHY */
  624. if (hw->phy.reset_disable == false)
  625. hw->phy.ops.reset(hw);
  626. /*
  627. * Prevent the PCI-E bus from from hanging by disabling PCI-E master
  628. * access and verify no pending requests before reset
  629. */
  630. if (ixgbe_disable_pcie_master(hw) != 0) {
  631. status = IXGBE_ERR_MASTER_REQUESTS_PENDING;
  632. hw_dbg(hw, "PCI-E Master disable polling has failed.\n");
  633. }
  634. /*
  635. * Issue global reset to the MAC. This needs to be a SW reset.
  636. * If link reset is used, it might reset the MAC when mng is using it
  637. */
  638. ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL);
  639. IXGBE_WRITE_REG(hw, IXGBE_CTRL, (ctrl | IXGBE_CTRL_RST));
  640. IXGBE_WRITE_FLUSH(hw);
  641. /* Poll for reset bit to self-clear indicating reset is complete */
  642. for (i = 0; i < 10; i++) {
  643. udelay(1);
  644. ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL);
  645. if (!(ctrl & IXGBE_CTRL_RST))
  646. break;
  647. }
  648. if (ctrl & IXGBE_CTRL_RST) {
  649. status = IXGBE_ERR_RESET_FAILED;
  650. hw_dbg(hw, "Reset polling failed to complete.\n");
  651. }
  652. msleep(50);
  653. gheccr = IXGBE_READ_REG(hw, IXGBE_GHECCR);
  654. gheccr &= ~((1 << 21) | (1 << 18) | (1 << 9) | (1 << 6));
  655. IXGBE_WRITE_REG(hw, IXGBE_GHECCR, gheccr);
  656. /*
  657. * Store the original AUTOC value if it has not been
  658. * stored off yet. Otherwise restore the stored original
  659. * AUTOC value since the reset operation sets back to deaults.
  660. */
  661. autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC);
  662. if (hw->mac.orig_link_settings_stored == false) {
  663. hw->mac.orig_autoc = autoc;
  664. hw->mac.orig_link_settings_stored = true;
  665. } else if (autoc != hw->mac.orig_autoc) {
  666. IXGBE_WRITE_REG(hw, IXGBE_AUTOC, hw->mac.orig_autoc);
  667. }
  668. /* Store the permanent mac address */
  669. hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr);
  670. return status;
  671. }
  672. /**
  673. * ixgbe_set_vmdq_82598 - Associate a VMDq set index with a rx address
  674. * @hw: pointer to hardware struct
  675. * @rar: receive address register index to associate with a VMDq index
  676. * @vmdq: VMDq set index
  677. **/
  678. static s32 ixgbe_set_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
  679. {
  680. u32 rar_high;
  681. rar_high = IXGBE_READ_REG(hw, IXGBE_RAH(rar));
  682. rar_high &= ~IXGBE_RAH_VIND_MASK;
  683. rar_high |= ((vmdq << IXGBE_RAH_VIND_SHIFT) & IXGBE_RAH_VIND_MASK);
  684. IXGBE_WRITE_REG(hw, IXGBE_RAH(rar), rar_high);
  685. return 0;
  686. }
  687. /**
  688. * ixgbe_clear_vmdq_82598 - Disassociate a VMDq set index from an rx address
  689. * @hw: pointer to hardware struct
  690. * @rar: receive address register index to associate with a VMDq index
  691. * @vmdq: VMDq clear index (not used in 82598, but elsewhere)
  692. **/
  693. static s32 ixgbe_clear_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
  694. {
  695. u32 rar_high;
  696. u32 rar_entries = hw->mac.num_rar_entries;
  697. if (rar < rar_entries) {
  698. rar_high = IXGBE_READ_REG(hw, IXGBE_RAH(rar));
  699. if (rar_high & IXGBE_RAH_VIND_MASK) {
  700. rar_high &= ~IXGBE_RAH_VIND_MASK;
  701. IXGBE_WRITE_REG(hw, IXGBE_RAH(rar), rar_high);
  702. }
  703. } else {
  704. hw_dbg(hw, "RAR index %d is out of range.\n", rar);
  705. }
  706. return 0;
  707. }
  708. /**
  709. * ixgbe_set_vfta_82598 - Set VLAN filter table
  710. * @hw: pointer to hardware structure
  711. * @vlan: VLAN id to write to VLAN filter
  712. * @vind: VMDq output index that maps queue to VLAN id in VFTA
  713. * @vlan_on: boolean flag to turn on/off VLAN in VFTA
  714. *
  715. * Turn on/off specified VLAN in the VLAN filter table.
  716. **/
  717. static s32 ixgbe_set_vfta_82598(struct ixgbe_hw *hw, u32 vlan, u32 vind,
  718. bool vlan_on)
  719. {
  720. u32 regindex;
  721. u32 bitindex;
  722. u32 bits;
  723. u32 vftabyte;
  724. if (vlan > 4095)
  725. return IXGBE_ERR_PARAM;
  726. /* Determine 32-bit word position in array */
  727. regindex = (vlan >> 5) & 0x7F; /* upper seven bits */
  728. /* Determine the location of the (VMD) queue index */
  729. vftabyte = ((vlan >> 3) & 0x03); /* bits (4:3) indicating byte array */
  730. bitindex = (vlan & 0x7) << 2; /* lower 3 bits indicate nibble */
  731. /* Set the nibble for VMD queue index */
  732. bits = IXGBE_READ_REG(hw, IXGBE_VFTAVIND(vftabyte, regindex));
  733. bits &= (~(0x0F << bitindex));
  734. bits |= (vind << bitindex);
  735. IXGBE_WRITE_REG(hw, IXGBE_VFTAVIND(vftabyte, regindex), bits);
  736. /* Determine the location of the bit for this VLAN id */
  737. bitindex = vlan & 0x1F; /* lower five bits */
  738. bits = IXGBE_READ_REG(hw, IXGBE_VFTA(regindex));
  739. if (vlan_on)
  740. /* Turn on this VLAN id */
  741. bits |= (1 << bitindex);
  742. else
  743. /* Turn off this VLAN id */
  744. bits &= ~(1 << bitindex);
  745. IXGBE_WRITE_REG(hw, IXGBE_VFTA(regindex), bits);
  746. return 0;
  747. }
  748. /**
  749. * ixgbe_clear_vfta_82598 - Clear VLAN filter table
  750. * @hw: pointer to hardware structure
  751. *
  752. * Clears the VLAN filer table, and the VMDq index associated with the filter
  753. **/
  754. static s32 ixgbe_clear_vfta_82598(struct ixgbe_hw *hw)
  755. {
  756. u32 offset;
  757. u32 vlanbyte;
  758. for (offset = 0; offset < hw->mac.vft_size; offset++)
  759. IXGBE_WRITE_REG(hw, IXGBE_VFTA(offset), 0);
  760. for (vlanbyte = 0; vlanbyte < 4; vlanbyte++)
  761. for (offset = 0; offset < hw->mac.vft_size; offset++)
  762. IXGBE_WRITE_REG(hw, IXGBE_VFTAVIND(vlanbyte, offset),
  763. 0);
  764. return 0;
  765. }
  766. /**
  767. * ixgbe_read_analog_reg8_82598 - Reads 8 bit Atlas analog register
  768. * @hw: pointer to hardware structure
  769. * @reg: analog register to read
  770. * @val: read value
  771. *
  772. * Performs read operation to Atlas analog register specified.
  773. **/
  774. static s32 ixgbe_read_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 *val)
  775. {
  776. u32 atlas_ctl;
  777. IXGBE_WRITE_REG(hw, IXGBE_ATLASCTL,
  778. IXGBE_ATLASCTL_WRITE_CMD | (reg << 8));
  779. IXGBE_WRITE_FLUSH(hw);
  780. udelay(10);
  781. atlas_ctl = IXGBE_READ_REG(hw, IXGBE_ATLASCTL);
  782. *val = (u8)atlas_ctl;
  783. return 0;
  784. }
  785. /**
  786. * ixgbe_write_analog_reg8_82598 - Writes 8 bit Atlas analog register
  787. * @hw: pointer to hardware structure
  788. * @reg: atlas register to write
  789. * @val: value to write
  790. *
  791. * Performs write operation to Atlas analog register specified.
  792. **/
  793. static s32 ixgbe_write_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 val)
  794. {
  795. u32 atlas_ctl;
  796. atlas_ctl = (reg << 8) | val;
  797. IXGBE_WRITE_REG(hw, IXGBE_ATLASCTL, atlas_ctl);
  798. IXGBE_WRITE_FLUSH(hw);
  799. udelay(10);
  800. return 0;
  801. }
  802. /**
  803. * ixgbe_read_i2c_eeprom_82598 - Read 8 bit EEPROM word of an SFP+ module
  804. * over I2C interface through an intermediate phy.
  805. * @hw: pointer to hardware structure
  806. * @byte_offset: EEPROM byte offset to read
  807. * @eeprom_data: value read
  808. *
  809. * Performs byte read operation to SFP module's EEPROM over I2C interface.
  810. **/
  811. static s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset,
  812. u8 *eeprom_data)
  813. {
  814. s32 status = 0;
  815. u16 sfp_addr = 0;
  816. u16 sfp_data = 0;
  817. u16 sfp_stat = 0;
  818. u32 i;
  819. if (hw->phy.type == ixgbe_phy_nl) {
  820. /*
  821. * phy SDA/SCL registers are at addresses 0xC30A to
  822. * 0xC30D. These registers are used to talk to the SFP+
  823. * module's EEPROM through the SDA/SCL (I2C) interface.
  824. */
  825. sfp_addr = (IXGBE_I2C_EEPROM_DEV_ADDR << 8) + byte_offset;
  826. sfp_addr = (sfp_addr | IXGBE_I2C_EEPROM_READ_MASK);
  827. hw->phy.ops.write_reg(hw,
  828. IXGBE_MDIO_PMA_PMD_SDA_SCL_ADDR,
  829. IXGBE_MDIO_PMA_PMD_DEV_TYPE,
  830. sfp_addr);
  831. /* Poll status */
  832. for (i = 0; i < 100; i++) {
  833. hw->phy.ops.read_reg(hw,
  834. IXGBE_MDIO_PMA_PMD_SDA_SCL_STAT,
  835. IXGBE_MDIO_PMA_PMD_DEV_TYPE,
  836. &sfp_stat);
  837. sfp_stat = sfp_stat & IXGBE_I2C_EEPROM_STATUS_MASK;
  838. if (sfp_stat != IXGBE_I2C_EEPROM_STATUS_IN_PROGRESS)
  839. break;
  840. msleep(10);
  841. }
  842. if (sfp_stat != IXGBE_I2C_EEPROM_STATUS_PASS) {
  843. hw_dbg(hw, "EEPROM read did not pass.\n");
  844. status = IXGBE_ERR_SFP_NOT_PRESENT;
  845. goto out;
  846. }
  847. /* Read data */
  848. hw->phy.ops.read_reg(hw, IXGBE_MDIO_PMA_PMD_SDA_SCL_DATA,
  849. IXGBE_MDIO_PMA_PMD_DEV_TYPE, &sfp_data);
  850. *eeprom_data = (u8)(sfp_data >> 8);
  851. } else {
  852. status = IXGBE_ERR_PHY;
  853. goto out;
  854. }
  855. out:
  856. return status;
  857. }
  858. /**
  859. * ixgbe_get_supported_physical_layer_82598 - Returns physical layer type
  860. * @hw: pointer to hardware structure
  861. *
  862. * Determines physical layer capabilities of the current configuration.
  863. **/
  864. static u32 ixgbe_get_supported_physical_layer_82598(struct ixgbe_hw *hw)
  865. {
  866. u32 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN;
  867. switch (hw->device_id) {
  868. case IXGBE_DEV_ID_82598:
  869. /* Default device ID is mezzanine card KX/KX4 */
  870. physical_layer = (IXGBE_PHYSICAL_LAYER_10GBASE_KX4 |
  871. IXGBE_PHYSICAL_LAYER_1000BASE_KX);
  872. break;
  873. case IXGBE_DEV_ID_82598_BX:
  874. physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_BX;
  875. case IXGBE_DEV_ID_82598EB_CX4:
  876. case IXGBE_DEV_ID_82598_CX4_DUAL_PORT:
  877. physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_CX4;
  878. break;
  879. case IXGBE_DEV_ID_82598_DA_DUAL_PORT:
  880. physical_layer = IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU;
  881. break;
  882. case IXGBE_DEV_ID_82598AF_DUAL_PORT:
  883. case IXGBE_DEV_ID_82598AF_SINGLE_PORT:
  884. case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM:
  885. physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_SR;
  886. break;
  887. case IXGBE_DEV_ID_82598EB_XF_LR:
  888. physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_LR;
  889. break;
  890. case IXGBE_DEV_ID_82598AT:
  891. physical_layer = (IXGBE_PHYSICAL_LAYER_10GBASE_T |
  892. IXGBE_PHYSICAL_LAYER_1000BASE_T);
  893. break;
  894. case IXGBE_DEV_ID_82598EB_SFP_LOM:
  895. hw->phy.ops.identify_sfp(hw);
  896. switch (hw->phy.sfp_type) {
  897. case ixgbe_sfp_type_da_cu:
  898. physical_layer = IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU;
  899. break;
  900. case ixgbe_sfp_type_sr:
  901. physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_SR;
  902. break;
  903. case ixgbe_sfp_type_lr:
  904. physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_LR;
  905. break;
  906. default:
  907. physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN;
  908. break;
  909. }
  910. break;
  911. default:
  912. physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN;
  913. break;
  914. }
  915. return physical_layer;
  916. }
  917. static struct ixgbe_mac_operations mac_ops_82598 = {
  918. .init_hw = &ixgbe_init_hw_generic,
  919. .reset_hw = &ixgbe_reset_hw_82598,
  920. .start_hw = &ixgbe_start_hw_generic,
  921. .clear_hw_cntrs = &ixgbe_clear_hw_cntrs_generic,
  922. .get_media_type = &ixgbe_get_media_type_82598,
  923. .get_supported_physical_layer = &ixgbe_get_supported_physical_layer_82598,
  924. .enable_rx_dma = &ixgbe_enable_rx_dma_generic,
  925. .get_mac_addr = &ixgbe_get_mac_addr_generic,
  926. .stop_adapter = &ixgbe_stop_adapter_generic,
  927. .get_bus_info = &ixgbe_get_bus_info_generic,
  928. .set_lan_id = &ixgbe_set_lan_id_multi_port_pcie,
  929. .read_analog_reg8 = &ixgbe_read_analog_reg8_82598,
  930. .write_analog_reg8 = &ixgbe_write_analog_reg8_82598,
  931. .setup_link = &ixgbe_setup_mac_link_82598,
  932. .setup_link_speed = &ixgbe_setup_mac_link_speed_82598,
  933. .check_link = &ixgbe_check_mac_link_82598,
  934. .get_link_capabilities = &ixgbe_get_link_capabilities_82598,
  935. .led_on = &ixgbe_led_on_generic,
  936. .led_off = &ixgbe_led_off_generic,
  937. .blink_led_start = &ixgbe_blink_led_start_generic,
  938. .blink_led_stop = &ixgbe_blink_led_stop_generic,
  939. .set_rar = &ixgbe_set_rar_generic,
  940. .clear_rar = &ixgbe_clear_rar_generic,
  941. .set_vmdq = &ixgbe_set_vmdq_82598,
  942. .clear_vmdq = &ixgbe_clear_vmdq_82598,
  943. .init_rx_addrs = &ixgbe_init_rx_addrs_generic,
  944. .update_uc_addr_list = &ixgbe_update_uc_addr_list_generic,
  945. .update_mc_addr_list = &ixgbe_update_mc_addr_list_generic,
  946. .enable_mc = &ixgbe_enable_mc_generic,
  947. .disable_mc = &ixgbe_disable_mc_generic,
  948. .clear_vfta = &ixgbe_clear_vfta_82598,
  949. .set_vfta = &ixgbe_set_vfta_82598,
  950. .setup_fc = &ixgbe_setup_fc_82598,
  951. };
  952. static struct ixgbe_eeprom_operations eeprom_ops_82598 = {
  953. .init_params = &ixgbe_init_eeprom_params_generic,
  954. .read = &ixgbe_read_eeprom_generic,
  955. .validate_checksum = &ixgbe_validate_eeprom_checksum_generic,
  956. .update_checksum = &ixgbe_update_eeprom_checksum_generic,
  957. };
  958. static struct ixgbe_phy_operations phy_ops_82598 = {
  959. .identify = &ixgbe_identify_phy_generic,
  960. .identify_sfp = &ixgbe_identify_sfp_module_generic,
  961. .reset = &ixgbe_reset_phy_generic,
  962. .read_reg = &ixgbe_read_phy_reg_generic,
  963. .write_reg = &ixgbe_write_phy_reg_generic,
  964. .setup_link = &ixgbe_setup_phy_link_generic,
  965. .setup_link_speed = &ixgbe_setup_phy_link_speed_generic,
  966. .read_i2c_eeprom = &ixgbe_read_i2c_eeprom_82598,
  967. };
  968. struct ixgbe_info ixgbe_82598_info = {
  969. .mac = ixgbe_mac_82598EB,
  970. .get_invariants = &ixgbe_get_invariants_82598,
  971. .mac_ops = &mac_ops_82598,
  972. .eeprom_ops = &eeprom_ops_82598,
  973. .phy_ops = &phy_ops_82598,
  974. };