ixgbe_82598.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. /*******************************************************************************
  2. Intel 10 Gigabit PCI Express Linux driver
  3. Copyright(c) 1999 - 2007 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. Linux NICS <linux.nics@intel.com>
  18. e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
  19. Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  20. *******************************************************************************/
  21. #include <linux/pci.h>
  22. #include <linux/delay.h>
  23. #include <linux/sched.h>
  24. #include "ixgbe.h"
  25. #include "ixgbe_phy.h"
  26. #define IXGBE_82598_MAX_TX_QUEUES 32
  27. #define IXGBE_82598_MAX_RX_QUEUES 64
  28. #define IXGBE_82598_RAR_ENTRIES 16
  29. #define IXGBE_82598_MC_TBL_SIZE 128
  30. #define IXGBE_82598_VFT_TBL_SIZE 128
  31. static s32 ixgbe_get_invariants_82598(struct ixgbe_hw *hw);
  32. static s32 ixgbe_get_link_settings_82598(struct ixgbe_hw *hw, u32 *speed,
  33. bool *autoneg);
  34. static s32 ixgbe_get_copper_link_settings_82598(struct ixgbe_hw *hw,
  35. u32 *speed, bool *autoneg);
  36. static enum ixgbe_media_type ixgbe_get_media_type_82598(struct ixgbe_hw *hw);
  37. static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw);
  38. static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, u32 *speed,
  39. bool *link_up,
  40. bool link_up_wait_to_complete);
  41. static s32 ixgbe_setup_mac_link_speed_82598(struct ixgbe_hw *hw, u32 speed,
  42. bool autoneg,
  43. bool autoneg_wait_to_complete);
  44. static s32 ixgbe_setup_copper_link_82598(struct ixgbe_hw *hw);
  45. static s32 ixgbe_setup_copper_link_speed_82598(struct ixgbe_hw *hw, u32 speed,
  46. bool autoneg,
  47. bool autoneg_wait_to_complete);
  48. static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw);
  49. static s32 ixgbe_get_invariants_82598(struct ixgbe_hw *hw)
  50. {
  51. hw->mac.num_rx_queues = IXGBE_82598_MAX_RX_QUEUES;
  52. hw->mac.num_tx_queues = IXGBE_82598_MAX_TX_QUEUES;
  53. hw->mac.mcft_size = IXGBE_82598_MC_TBL_SIZE;
  54. hw->mac.vft_size = IXGBE_82598_VFT_TBL_SIZE;
  55. hw->mac.num_rar_entries = IXGBE_82598_RAR_ENTRIES;
  56. /* PHY ops are filled in by default properly for Fiber only */
  57. if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_copper) {
  58. hw->mac.ops.setup_link = &ixgbe_setup_copper_link_82598;
  59. hw->mac.ops.setup_link_speed = &ixgbe_setup_copper_link_speed_82598;
  60. hw->mac.ops.get_link_settings =
  61. &ixgbe_get_copper_link_settings_82598;
  62. /* Call PHY identify routine to get the phy type */
  63. ixgbe_identify_phy(hw);
  64. switch (hw->phy.type) {
  65. case ixgbe_phy_tn:
  66. hw->phy.ops.setup_link = &ixgbe_setup_tnx_phy_link;
  67. hw->phy.ops.check_link = &ixgbe_check_tnx_phy_link;
  68. hw->phy.ops.setup_link_speed =
  69. &ixgbe_setup_tnx_phy_link_speed;
  70. break;
  71. default:
  72. break;
  73. }
  74. }
  75. return 0;
  76. }
  77. /**
  78. * ixgbe_get_link_settings_82598 - Determines default link settings
  79. * @hw: pointer to hardware structure
  80. * @speed: pointer to link speed
  81. * @autoneg: boolean auto-negotiation value
  82. *
  83. * Determines the default link settings by reading the AUTOC register.
  84. **/
  85. static s32 ixgbe_get_link_settings_82598(struct ixgbe_hw *hw, u32 *speed,
  86. bool *autoneg)
  87. {
  88. s32 status = 0;
  89. s32 autoc_reg;
  90. autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC);
  91. if (hw->mac.link_settings_loaded) {
  92. autoc_reg &= ~IXGBE_AUTOC_LMS_ATTACH_TYPE;
  93. autoc_reg &= ~IXGBE_AUTOC_LMS_MASK;
  94. autoc_reg |= hw->mac.link_attach_type;
  95. autoc_reg |= hw->mac.link_mode_select;
  96. }
  97. switch (autoc_reg & IXGBE_AUTOC_LMS_MASK) {
  98. case IXGBE_AUTOC_LMS_1G_LINK_NO_AN:
  99. *speed = IXGBE_LINK_SPEED_1GB_FULL;
  100. *autoneg = false;
  101. break;
  102. case IXGBE_AUTOC_LMS_10G_LINK_NO_AN:
  103. *speed = IXGBE_LINK_SPEED_10GB_FULL;
  104. *autoneg = false;
  105. break;
  106. case IXGBE_AUTOC_LMS_1G_AN:
  107. *speed = IXGBE_LINK_SPEED_1GB_FULL;
  108. *autoneg = true;
  109. break;
  110. case IXGBE_AUTOC_LMS_KX4_AN:
  111. case IXGBE_AUTOC_LMS_KX4_AN_1G_AN:
  112. *speed = IXGBE_LINK_SPEED_UNKNOWN;
  113. if (autoc_reg & IXGBE_AUTOC_KX4_SUPP)
  114. *speed |= IXGBE_LINK_SPEED_10GB_FULL;
  115. if (autoc_reg & IXGBE_AUTOC_KX_SUPP)
  116. *speed |= IXGBE_LINK_SPEED_1GB_FULL;
  117. *autoneg = true;
  118. break;
  119. default:
  120. status = IXGBE_ERR_LINK_SETUP;
  121. break;
  122. }
  123. return status;
  124. }
  125. /**
  126. * ixgbe_get_copper_link_settings_82598 - Determines default link settings
  127. * @hw: pointer to hardware structure
  128. * @speed: pointer to link speed
  129. * @autoneg: boolean auto-negotiation value
  130. *
  131. * Determines the default link settings by reading the AUTOC register.
  132. **/
  133. static s32 ixgbe_get_copper_link_settings_82598(struct ixgbe_hw *hw,
  134. u32 *speed, bool *autoneg)
  135. {
  136. s32 status = IXGBE_ERR_LINK_SETUP;
  137. u16 speed_ability;
  138. *speed = 0;
  139. *autoneg = true;
  140. status = ixgbe_read_phy_reg(hw, IXGBE_MDIO_PHY_SPEED_ABILITY,
  141. IXGBE_MDIO_PMA_PMD_DEV_TYPE,
  142. &speed_ability);
  143. if (status == 0) {
  144. if (speed_ability & IXGBE_MDIO_PHY_SPEED_10G)
  145. *speed |= IXGBE_LINK_SPEED_10GB_FULL;
  146. if (speed_ability & IXGBE_MDIO_PHY_SPEED_1G)
  147. *speed |= IXGBE_LINK_SPEED_1GB_FULL;
  148. }
  149. return status;
  150. }
  151. /**
  152. * ixgbe_get_media_type_82598 - Determines media type
  153. * @hw: pointer to hardware structure
  154. *
  155. * Returns the media type (fiber, copper, backplane)
  156. **/
  157. static enum ixgbe_media_type ixgbe_get_media_type_82598(struct ixgbe_hw *hw)
  158. {
  159. enum ixgbe_media_type media_type;
  160. /* Media type for I82598 is based on device ID */
  161. switch (hw->device_id) {
  162. case IXGBE_DEV_ID_82598AF_DUAL_PORT:
  163. case IXGBE_DEV_ID_82598AF_SINGLE_PORT:
  164. case IXGBE_DEV_ID_82598EB_CX4:
  165. case IXGBE_DEV_ID_82598_CX4_DUAL_PORT:
  166. case IXGBE_DEV_ID_82598EB_XF_LR:
  167. media_type = ixgbe_media_type_fiber;
  168. break;
  169. case IXGBE_DEV_ID_82598AT_DUAL_PORT:
  170. media_type = ixgbe_media_type_copper;
  171. break;
  172. default:
  173. media_type = ixgbe_media_type_unknown;
  174. break;
  175. }
  176. return media_type;
  177. }
  178. /**
  179. * ixgbe_setup_mac_link_82598 - Configures MAC link settings
  180. * @hw: pointer to hardware structure
  181. *
  182. * Configures link settings based on values in the ixgbe_hw struct.
  183. * Restarts the link. Performs autonegotiation if needed.
  184. **/
  185. static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw)
  186. {
  187. u32 autoc_reg;
  188. u32 links_reg;
  189. u32 i;
  190. s32 status = 0;
  191. autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC);
  192. if (hw->mac.link_settings_loaded) {
  193. autoc_reg &= ~IXGBE_AUTOC_LMS_ATTACH_TYPE;
  194. autoc_reg &= ~IXGBE_AUTOC_LMS_MASK;
  195. autoc_reg |= hw->mac.link_attach_type;
  196. autoc_reg |= hw->mac.link_mode_select;
  197. IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg);
  198. IXGBE_WRITE_FLUSH(hw);
  199. msleep(50);
  200. }
  201. /* Restart link */
  202. autoc_reg |= IXGBE_AUTOC_AN_RESTART;
  203. IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg);
  204. /* Only poll for autoneg to complete if specified to do so */
  205. if (hw->phy.autoneg_wait_to_complete) {
  206. if (hw->mac.link_mode_select == IXGBE_AUTOC_LMS_KX4_AN ||
  207. hw->mac.link_mode_select == IXGBE_AUTOC_LMS_KX4_AN_1G_AN) {
  208. links_reg = 0; /* Just in case Autoneg time = 0 */
  209. for (i = 0; i < IXGBE_AUTO_NEG_TIME; i++) {
  210. links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS);
  211. if (links_reg & IXGBE_LINKS_KX_AN_COMP)
  212. break;
  213. msleep(100);
  214. }
  215. if (!(links_reg & IXGBE_LINKS_KX_AN_COMP)) {
  216. status = IXGBE_ERR_AUTONEG_NOT_COMPLETE;
  217. hw_dbg(hw,
  218. "Autonegotiation did not complete.\n");
  219. }
  220. }
  221. }
  222. /*
  223. * We want to save off the original Flow Control configuration just in
  224. * case we get disconnected and then reconnected into a different hub
  225. * or switch with different Flow Control capabilities.
  226. */
  227. hw->fc.type = hw->fc.original_type;
  228. ixgbe_setup_fc(hw, 0);
  229. /* Add delay to filter out noises during initial link setup */
  230. msleep(50);
  231. return status;
  232. }
  233. /**
  234. * ixgbe_check_mac_link_82598 - Get link/speed status
  235. * @hw: pointer to hardware structure
  236. * @speed: pointer to link speed
  237. * @link_up: true is link is up, false otherwise
  238. * @link_up_wait_to_complete: bool used to wait for link up or not
  239. *
  240. * Reads the links register to determine if link is up and the current speed
  241. **/
  242. static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, u32 *speed,
  243. bool *link_up,
  244. bool link_up_wait_to_complete)
  245. {
  246. u32 links_reg;
  247. u32 i;
  248. links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS);
  249. if (link_up_wait_to_complete) {
  250. for (i = 0; i < IXGBE_LINK_UP_TIME; i++) {
  251. if (links_reg & IXGBE_LINKS_UP) {
  252. *link_up = true;
  253. break;
  254. } else {
  255. *link_up = false;
  256. }
  257. msleep(100);
  258. links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS);
  259. }
  260. } else {
  261. if (links_reg & IXGBE_LINKS_UP)
  262. *link_up = true;
  263. else
  264. *link_up = false;
  265. }
  266. if (links_reg & IXGBE_LINKS_SPEED)
  267. *speed = IXGBE_LINK_SPEED_10GB_FULL;
  268. else
  269. *speed = IXGBE_LINK_SPEED_1GB_FULL;
  270. return 0;
  271. }
  272. /**
  273. * ixgbe_setup_mac_link_speed_82598 - Set MAC link speed
  274. * @hw: pointer to hardware structure
  275. * @speed: new link speed
  276. * @autoneg: true if auto-negotiation enabled
  277. * @autoneg_wait_to_complete: true if waiting is needed to complete
  278. *
  279. * Set the link speed in the AUTOC register and restarts link.
  280. **/
  281. static s32 ixgbe_setup_mac_link_speed_82598(struct ixgbe_hw *hw,
  282. u32 speed, bool autoneg,
  283. bool autoneg_wait_to_complete)
  284. {
  285. s32 status = 0;
  286. /* If speed is 10G, then check for CX4 or XAUI. */
  287. if ((speed == IXGBE_LINK_SPEED_10GB_FULL) &&
  288. (!(hw->mac.link_attach_type & IXGBE_AUTOC_10G_KX4)))
  289. hw->mac.link_mode_select = IXGBE_AUTOC_LMS_10G_LINK_NO_AN;
  290. else if ((speed == IXGBE_LINK_SPEED_1GB_FULL) && (!autoneg))
  291. hw->mac.link_mode_select = IXGBE_AUTOC_LMS_1G_LINK_NO_AN;
  292. else if (autoneg) {
  293. /* BX mode - Autonegotiate 1G */
  294. if (!(hw->mac.link_attach_type & IXGBE_AUTOC_1G_PMA_PMD))
  295. hw->mac.link_mode_select = IXGBE_AUTOC_LMS_1G_AN;
  296. else /* KX/KX4 mode */
  297. hw->mac.link_mode_select = IXGBE_AUTOC_LMS_KX4_AN_1G_AN;
  298. } else {
  299. status = IXGBE_ERR_LINK_SETUP;
  300. }
  301. if (status == 0) {
  302. hw->phy.autoneg_wait_to_complete = autoneg_wait_to_complete;
  303. hw->mac.link_settings_loaded = true;
  304. /*
  305. * Setup and restart the link based on the new values in
  306. * ixgbe_hw This will write the AUTOC register based on the new
  307. * stored values
  308. */
  309. hw->mac.ops.setup_link(hw);
  310. }
  311. return status;
  312. }
  313. /**
  314. * ixgbe_setup_copper_link_82598 - Setup copper link settings
  315. * @hw: pointer to hardware structure
  316. *
  317. * Configures link settings based on values in the ixgbe_hw struct.
  318. * Restarts the link. Performs autonegotiation if needed. Restart
  319. * phy and wait for autonegotiate to finish. Then synchronize the
  320. * MAC and PHY.
  321. **/
  322. static s32 ixgbe_setup_copper_link_82598(struct ixgbe_hw *hw)
  323. {
  324. s32 status = 0;
  325. /* Restart autonegotiation on PHY */
  326. if (hw->phy.ops.setup_link)
  327. status = hw->phy.ops.setup_link(hw);
  328. /* Set MAC to KX/KX4 autoneg, which defaultis to Parallel detection */
  329. hw->mac.link_attach_type = (IXGBE_AUTOC_10G_KX4 | IXGBE_AUTOC_1G_KX);
  330. hw->mac.link_mode_select = IXGBE_AUTOC_LMS_KX4_AN;
  331. /* Set up MAC */
  332. hw->mac.ops.setup_link(hw);
  333. return status;
  334. }
  335. /**
  336. * ixgbe_setup_copper_link_speed_82598 - Set the PHY autoneg advertised field
  337. * @hw: pointer to hardware structure
  338. * @speed: new link speed
  339. * @autoneg: true if autonegotiation enabled
  340. * @autoneg_wait_to_complete: true if waiting is needed to complete
  341. *
  342. * Sets the link speed in the AUTOC register in the MAC and restarts link.
  343. **/
  344. static s32 ixgbe_setup_copper_link_speed_82598(struct ixgbe_hw *hw, u32 speed,
  345. bool autoneg,
  346. bool autoneg_wait_to_complete)
  347. {
  348. s32 status = 0;
  349. /* Setup the PHY according to input speed */
  350. if (hw->phy.ops.setup_link_speed)
  351. status = hw->phy.ops.setup_link_speed(hw, speed, autoneg,
  352. autoneg_wait_to_complete);
  353. /* Set MAC to KX/KX4 autoneg, which defaults to Parallel detection */
  354. hw->mac.link_attach_type = (IXGBE_AUTOC_10G_KX4 | IXGBE_AUTOC_1G_KX);
  355. hw->mac.link_mode_select = IXGBE_AUTOC_LMS_KX4_AN;
  356. /* Set up MAC */
  357. hw->mac.ops.setup_link(hw);
  358. return status;
  359. }
  360. /**
  361. * ixgbe_reset_hw_82598 - Performs hardware reset
  362. * @hw: pointer to hardware structure
  363. *
  364. * Resets the hardware by reseting the transmit and receive units, masks and
  365. * clears all interrupts, performing a PHY reset, and performing a link (MAC)
  366. * reset.
  367. **/
  368. static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw)
  369. {
  370. s32 status = 0;
  371. u32 ctrl;
  372. u32 gheccr;
  373. u32 i;
  374. u32 autoc;
  375. u8 analog_val;
  376. /* Call adapter stop to disable tx/rx and clear interrupts */
  377. ixgbe_stop_adapter(hw);
  378. /*
  379. * Power up the Atlas TX lanes if they are currently powered down.
  380. * Atlas TX lanes are powered down for MAC loopback tests, but
  381. * they are not automatically restored on reset.
  382. */
  383. ixgbe_read_analog_reg8(hw, IXGBE_ATLAS_PDN_LPBK, &analog_val);
  384. if (analog_val & IXGBE_ATLAS_PDN_TX_REG_EN) {
  385. /* Enable TX Atlas so packets can be transmitted again */
  386. ixgbe_read_analog_reg8(hw, IXGBE_ATLAS_PDN_LPBK, &analog_val);
  387. analog_val &= ~IXGBE_ATLAS_PDN_TX_REG_EN;
  388. ixgbe_write_analog_reg8(hw, IXGBE_ATLAS_PDN_LPBK, analog_val);
  389. ixgbe_read_analog_reg8(hw, IXGBE_ATLAS_PDN_10G, &analog_val);
  390. analog_val &= ~IXGBE_ATLAS_PDN_TX_10G_QL_ALL;
  391. ixgbe_write_analog_reg8(hw, IXGBE_ATLAS_PDN_10G, analog_val);
  392. ixgbe_read_analog_reg8(hw, IXGBE_ATLAS_PDN_1G, &analog_val);
  393. analog_val &= ~IXGBE_ATLAS_PDN_TX_1G_QL_ALL;
  394. ixgbe_write_analog_reg8(hw, IXGBE_ATLAS_PDN_1G, analog_val);
  395. ixgbe_read_analog_reg8(hw, IXGBE_ATLAS_PDN_AN, &analog_val);
  396. analog_val &= ~IXGBE_ATLAS_PDN_TX_AN_QL_ALL;
  397. ixgbe_write_analog_reg8(hw, IXGBE_ATLAS_PDN_AN, analog_val);
  398. }
  399. /* Reset PHY */
  400. ixgbe_reset_phy(hw);
  401. /*
  402. * Prevent the PCI-E bus from from hanging by disabling PCI-E master
  403. * access and verify no pending requests before reset
  404. */
  405. if (ixgbe_disable_pcie_master(hw) != 0) {
  406. status = IXGBE_ERR_MASTER_REQUESTS_PENDING;
  407. hw_dbg(hw, "PCI-E Master disable polling has failed.\n");
  408. }
  409. /*
  410. * Issue global reset to the MAC. This needs to be a SW reset.
  411. * If link reset is used, it might reset the MAC when mng is using it
  412. */
  413. ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL);
  414. IXGBE_WRITE_REG(hw, IXGBE_CTRL, (ctrl | IXGBE_CTRL_RST));
  415. IXGBE_WRITE_FLUSH(hw);
  416. /* Poll for reset bit to self-clear indicating reset is complete */
  417. for (i = 0; i < 10; i++) {
  418. udelay(1);
  419. ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL);
  420. if (!(ctrl & IXGBE_CTRL_RST))
  421. break;
  422. }
  423. if (ctrl & IXGBE_CTRL_RST) {
  424. status = IXGBE_ERR_RESET_FAILED;
  425. hw_dbg(hw, "Reset polling failed to complete.\n");
  426. }
  427. msleep(50);
  428. gheccr = IXGBE_READ_REG(hw, IXGBE_GHECCR);
  429. gheccr &= ~((1 << 21) | (1 << 18) | (1 << 9) | (1 << 6));
  430. IXGBE_WRITE_REG(hw, IXGBE_GHECCR, gheccr);
  431. /*
  432. * AUTOC register which stores link settings gets cleared
  433. * and reloaded from EEPROM after reset. We need to restore
  434. * our stored value from init in case SW changed the attach
  435. * type or speed. If this is the first time and link settings
  436. * have not been stored, store default settings from AUTOC.
  437. */
  438. autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC);
  439. if (hw->mac.link_settings_loaded) {
  440. autoc &= ~(IXGBE_AUTOC_LMS_ATTACH_TYPE);
  441. autoc &= ~(IXGBE_AUTOC_LMS_MASK);
  442. autoc |= hw->mac.link_attach_type;
  443. autoc |= hw->mac.link_mode_select;
  444. IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc);
  445. } else {
  446. hw->mac.link_attach_type =
  447. (autoc & IXGBE_AUTOC_LMS_ATTACH_TYPE);
  448. hw->mac.link_mode_select = (autoc & IXGBE_AUTOC_LMS_MASK);
  449. hw->mac.link_settings_loaded = true;
  450. }
  451. /* Store the permanent mac address */
  452. ixgbe_get_mac_addr(hw, hw->mac.perm_addr);
  453. return status;
  454. }
  455. static struct ixgbe_mac_operations mac_ops_82598 = {
  456. .reset = &ixgbe_reset_hw_82598,
  457. .get_media_type = &ixgbe_get_media_type_82598,
  458. .setup_link = &ixgbe_setup_mac_link_82598,
  459. .check_link = &ixgbe_check_mac_link_82598,
  460. .setup_link_speed = &ixgbe_setup_mac_link_speed_82598,
  461. .get_link_settings = &ixgbe_get_link_settings_82598,
  462. };
  463. struct ixgbe_info ixgbe_82598_info = {
  464. .mac = ixgbe_mac_82598EB,
  465. .get_invariants = &ixgbe_get_invariants_82598,
  466. .mac_ops = &mac_ops_82598,
  467. };