ixgbe_82598.c 33 KB

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