1 /*******************************************************************************
3 Intel 10 Gigabit PCI Express Linux driver
4 Copyright(c) 1999 - 2009 Intel Corporation.
6 This program is free software; you can redistribute it and/or modify it
7 under the terms and conditions of the GNU General Public License,
8 version 2, as published by the Free Software Foundation.
10 This program is distributed in the hope it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 You should have received a copy of the GNU General Public License along with
16 this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
19 The full GNU General Public License is included in this distribution in
20 the file called "COPYING".
23 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
24 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26 *******************************************************************************/
28 #include <linux/pci.h>
29 #include <linux/delay.h>
30 #include <linux/sched.h>
33 #include "ixgbe_phy.h"
35 #define IXGBE_82599_MAX_TX_QUEUES 128
36 #define IXGBE_82599_MAX_RX_QUEUES 128
37 #define IXGBE_82599_RAR_ENTRIES 128
38 #define IXGBE_82599_MC_TBL_SIZE 128
39 #define IXGBE_82599_VFT_TBL_SIZE 128
41 s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
42 ixgbe_link_speed *speed,
44 enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw);
45 s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw);
46 s32 ixgbe_setup_mac_link_speed_multispeed_fiber(struct ixgbe_hw *hw,
47 ixgbe_link_speed speed, bool autoneg,
48 bool autoneg_wait_to_complete);
49 s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw);
50 s32 ixgbe_check_mac_link_82599(struct ixgbe_hw *hw,
51 ixgbe_link_speed *speed,
52 bool *link_up, bool link_up_wait_to_complete);
53 s32 ixgbe_setup_mac_link_speed_82599(struct ixgbe_hw *hw,
54 ixgbe_link_speed speed,
56 bool autoneg_wait_to_complete);
57 static s32 ixgbe_get_copper_link_capabilities_82599(struct ixgbe_hw *hw,
58 ixgbe_link_speed *speed,
60 static s32 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw);
61 static s32 ixgbe_setup_copper_link_speed_82599(struct ixgbe_hw *hw,
62 ixgbe_link_speed speed,
64 bool autoneg_wait_to_complete);
65 s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw);
66 s32 ixgbe_set_vmdq_82599(struct ixgbe_hw *hw, u32 rar, u32 vmdq);
67 s32 ixgbe_clear_vmdq_82599(struct ixgbe_hw *hw, u32 rar, u32 vmdq);
68 s32 ixgbe_set_vfta_82599(struct ixgbe_hw *hw, u32 vlan,
69 u32 vind, bool vlan_on);
70 s32 ixgbe_clear_vfta_82599(struct ixgbe_hw *hw);
71 s32 ixgbe_blink_led_stop_82599(struct ixgbe_hw *hw, u32 index);
72 s32 ixgbe_blink_led_start_82599(struct ixgbe_hw *hw, u32 index);
73 s32 ixgbe_init_uta_tables_82599(struct ixgbe_hw *hw);
74 s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val);
75 s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val);
76 s32 ixgbe_start_hw_rev_0_82599(struct ixgbe_hw *hw);
77 s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw);
78 s32 ixgbe_start_hw_82599(struct ixgbe_hw *hw);
79 u32 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw);
81 void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw)
83 struct ixgbe_mac_info *mac = &hw->mac;
84 if (hw->phy.multispeed_fiber) {
85 /* Set up dual speed SFP+ support */
87 &ixgbe_setup_mac_link_multispeed_fiber;
88 mac->ops.setup_link_speed =
89 &ixgbe_setup_mac_link_speed_multispeed_fiber;
92 &ixgbe_setup_mac_link_82599;
93 mac->ops.setup_link_speed =
94 &ixgbe_setup_mac_link_speed_82599;
98 s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw)
101 u16 list_offset, data_offset, data_value;
103 if (hw->phy.sfp_type != ixgbe_sfp_type_unknown) {
104 ixgbe_init_mac_link_ops_82599(hw);
106 hw->phy.ops.reset = NULL;
108 ret_val = ixgbe_get_sfp_init_sequence_offsets(hw, &list_offset,
114 hw->eeprom.ops.read(hw, ++data_offset, &data_value);
115 while (data_value != 0xffff) {
116 IXGBE_WRITE_REG(hw, IXGBE_CORECTL, data_value);
117 IXGBE_WRITE_FLUSH(hw);
118 hw->eeprom.ops.read(hw, ++data_offset, &data_value);
120 /* Now restart DSP */
121 IXGBE_WRITE_REG(hw, IXGBE_CORECTL, 0x00000102);
122 IXGBE_WRITE_REG(hw, IXGBE_CORECTL, 0x00000b1d);
123 IXGBE_WRITE_FLUSH(hw);
131 * ixgbe_get_pcie_msix_count_82599 - Gets MSI-X vector count
132 * @hw: pointer to hardware structure
134 * Read PCIe configuration space, and get the MSI-X vector count from
135 * the capabilities table.
137 u32 ixgbe_get_pcie_msix_count_82599(struct ixgbe_hw *hw)
139 struct ixgbe_adapter *adapter = hw->back;
141 pci_read_config_word(adapter->pdev, IXGBE_PCIE_MSIX_82599_CAPS,
143 msix_count &= IXGBE_PCIE_MSIX_TBL_SZ_MASK;
145 /* MSI-X count is zero-based in HW, so increment to give proper value */
151 static s32 ixgbe_get_invariants_82599(struct ixgbe_hw *hw)
153 struct ixgbe_mac_info *mac = &hw->mac;
155 ixgbe_init_mac_link_ops_82599(hw);
157 mac->mcft_size = IXGBE_82599_MC_TBL_SIZE;
158 mac->vft_size = IXGBE_82599_VFT_TBL_SIZE;
159 mac->num_rar_entries = IXGBE_82599_RAR_ENTRIES;
160 mac->max_rx_queues = IXGBE_82599_MAX_RX_QUEUES;
161 mac->max_tx_queues = IXGBE_82599_MAX_TX_QUEUES;
162 mac->max_msix_vectors = ixgbe_get_pcie_msix_count_82599(hw);
168 * ixgbe_init_phy_ops_82599 - PHY/SFP specific init
169 * @hw: pointer to hardware structure
171 * Initialize any function pointers that were not able to be
172 * set during get_invariants because the PHY/SFP type was
173 * not known. Perform the SFP init if necessary.
176 s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw)
178 struct ixgbe_mac_info *mac = &hw->mac;
179 struct ixgbe_phy_info *phy = &hw->phy;
182 /* Identify the PHY or SFP module */
183 ret_val = phy->ops.identify(hw);
185 /* Setup function pointers based on detected SFP module and speeds */
186 ixgbe_init_mac_link_ops_82599(hw);
188 /* If copper media, overwrite with copper function pointers */
189 if (mac->ops.get_media_type(hw) == ixgbe_media_type_copper) {
190 mac->ops.setup_link = &ixgbe_setup_copper_link_82599;
191 mac->ops.setup_link_speed =
192 &ixgbe_setup_copper_link_speed_82599;
193 mac->ops.get_link_capabilities =
194 &ixgbe_get_copper_link_capabilities_82599;
197 /* Set necessary function pointers based on phy type */
198 switch (hw->phy.type) {
200 phy->ops.check_link = &ixgbe_check_phy_link_tnx;
201 phy->ops.get_firmware_version =
202 &ixgbe_get_phy_firmware_version_tnx;
212 * ixgbe_get_link_capabilities_82599 - Determines link capabilities
213 * @hw: pointer to hardware structure
214 * @speed: pointer to link speed
215 * @negotiation: true when autoneg or autotry is enabled
217 * Determines the link capabilities by reading the AUTOC register.
219 s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
220 ixgbe_link_speed *speed,
225 switch (hw->mac.orig_autoc & IXGBE_AUTOC_LMS_MASK) {
226 case IXGBE_AUTOC_LMS_1G_LINK_NO_AN:
227 *speed = IXGBE_LINK_SPEED_1GB_FULL;
228 *negotiation = false;
231 case IXGBE_AUTOC_LMS_10G_LINK_NO_AN:
232 *speed = IXGBE_LINK_SPEED_10GB_FULL;
233 *negotiation = false;
236 case IXGBE_AUTOC_LMS_1G_AN:
237 *speed = IXGBE_LINK_SPEED_1GB_FULL;
241 case IXGBE_AUTOC_LMS_10G_SERIAL:
242 *speed = IXGBE_LINK_SPEED_10GB_FULL;
243 *negotiation = false;
246 case IXGBE_AUTOC_LMS_KX4_KX_KR:
247 case IXGBE_AUTOC_LMS_KX4_KX_KR_1G_AN:
248 *speed = IXGBE_LINK_SPEED_UNKNOWN;
249 if (hw->mac.orig_autoc & IXGBE_AUTOC_KR_SUPP)
250 *speed |= IXGBE_LINK_SPEED_10GB_FULL;
251 if (hw->mac.orig_autoc & IXGBE_AUTOC_KX4_SUPP)
252 *speed |= IXGBE_LINK_SPEED_10GB_FULL;
253 if (hw->mac.orig_autoc & IXGBE_AUTOC_KX_SUPP)
254 *speed |= IXGBE_LINK_SPEED_1GB_FULL;
258 case IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII:
259 *speed = IXGBE_LINK_SPEED_100_FULL;
260 if (hw->mac.orig_autoc & IXGBE_AUTOC_KR_SUPP)
261 *speed |= IXGBE_LINK_SPEED_10GB_FULL;
262 if (hw->mac.orig_autoc & IXGBE_AUTOC_KX4_SUPP)
263 *speed |= IXGBE_LINK_SPEED_10GB_FULL;
264 if (hw->mac.orig_autoc & IXGBE_AUTOC_KX_SUPP)
265 *speed |= IXGBE_LINK_SPEED_1GB_FULL;
269 case IXGBE_AUTOC_LMS_SGMII_1G_100M:
270 *speed = IXGBE_LINK_SPEED_1GB_FULL | IXGBE_LINK_SPEED_100_FULL;
271 *negotiation = false;
275 status = IXGBE_ERR_LINK_SETUP;
280 if (hw->phy.multispeed_fiber) {
281 *speed |= IXGBE_LINK_SPEED_10GB_FULL |
282 IXGBE_LINK_SPEED_1GB_FULL;
291 * ixgbe_get_copper_link_capabilities_82599 - Determines link capabilities
292 * @hw: pointer to hardware structure
293 * @speed: pointer to link speed
294 * @autoneg: boolean auto-negotiation value
296 * Determines the link capabilities by reading the AUTOC register.
298 static s32 ixgbe_get_copper_link_capabilities_82599(struct ixgbe_hw *hw,
299 ixgbe_link_speed *speed,
302 s32 status = IXGBE_ERR_LINK_SETUP;
308 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_SPEED_ABILITY,
309 IXGBE_MDIO_PMA_PMD_DEV_TYPE,
313 if (speed_ability & IXGBE_MDIO_PHY_SPEED_10G)
314 *speed |= IXGBE_LINK_SPEED_10GB_FULL;
315 if (speed_ability & IXGBE_MDIO_PHY_SPEED_1G)
316 *speed |= IXGBE_LINK_SPEED_1GB_FULL;
323 * ixgbe_get_media_type_82599 - Get media type
324 * @hw: pointer to hardware structure
326 * Returns the media type (fiber, copper, backplane)
328 enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw)
330 enum ixgbe_media_type media_type;
332 /* Detect if there is a copper PHY attached. */
333 if (hw->phy.type == ixgbe_phy_cu_unknown ||
334 hw->phy.type == ixgbe_phy_tn) {
335 media_type = ixgbe_media_type_copper;
339 switch (hw->device_id) {
340 case IXGBE_DEV_ID_82599:
341 case IXGBE_DEV_ID_82599_KX4:
342 /* Default device ID is mezzanine card KX/KX4 */
343 media_type = ixgbe_media_type_backplane;
345 case IXGBE_DEV_ID_82599_SFP:
346 media_type = ixgbe_media_type_fiber;
349 media_type = ixgbe_media_type_unknown;
357 * ixgbe_setup_mac_link_82599 - Setup MAC link settings
358 * @hw: pointer to hardware structure
360 * Configures link settings based on values in the ixgbe_hw struct.
361 * Restarts the link. Performs autonegotiation if needed.
363 s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw)
371 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC);
372 autoc_reg |= IXGBE_AUTOC_AN_RESTART;
373 IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg);
375 /* Only poll for autoneg to complete if specified to do so */
376 if (hw->phy.autoneg_wait_to_complete) {
377 if ((autoc_reg & IXGBE_AUTOC_LMS_MASK) ==
378 IXGBE_AUTOC_LMS_KX4_KX_KR ||
379 (autoc_reg & IXGBE_AUTOC_LMS_MASK) ==
380 IXGBE_AUTOC_LMS_KX4_KX_KR_1G_AN ||
381 (autoc_reg & IXGBE_AUTOC_LMS_MASK) ==
382 IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII) {
383 links_reg = 0; /* Just in case Autoneg time = 0 */
384 for (i = 0; i < IXGBE_AUTO_NEG_TIME; i++) {
385 links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS);
386 if (links_reg & IXGBE_LINKS_KX_AN_COMP)
390 if (!(links_reg & IXGBE_LINKS_KX_AN_COMP)) {
391 status = IXGBE_ERR_AUTONEG_NOT_COMPLETE;
392 hw_dbg(hw, "Autoneg did not complete.\n");
397 /* Set up flow control */
398 status = ixgbe_setup_fc_generic(hw, 0);
400 /* Add delay to filter out noises during initial link setup */
407 * ixgbe_setup_mac_link_multispeed_fiber - Setup MAC link settings
408 * @hw: pointer to hardware structure
410 * Configures link settings based on values in the ixgbe_hw struct.
411 * Restarts the link for multi-speed fiber at 1G speed, if link
413 * Performs autonegotiation if needed.
415 s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw)
418 ixgbe_link_speed link_speed = IXGBE_LINK_SPEED_82599_AUTONEG;
419 status = ixgbe_setup_mac_link_speed_multispeed_fiber(hw, link_speed,
425 * ixgbe_setup_mac_link_speed_multispeed_fiber - Set MAC link speed
426 * @hw: pointer to hardware structure
427 * @speed: new link speed
428 * @autoneg: true if autonegotiation enabled
429 * @autoneg_wait_to_complete: true when waiting for completion is needed
431 * Set the link speed in the AUTOC register and restarts link.
433 s32 ixgbe_setup_mac_link_speed_multispeed_fiber(struct ixgbe_hw *hw,
434 ixgbe_link_speed speed,
436 bool autoneg_wait_to_complete)
439 ixgbe_link_speed phy_link_speed;
440 ixgbe_link_speed highest_link_speed = IXGBE_LINK_SPEED_UNKNOWN;
442 u32 esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP);
443 bool link_up = false;
446 /* Mask off requested but non-supported speeds */
447 hw->mac.ops.get_link_capabilities(hw, &phy_link_speed, &negotiation);
448 speed &= phy_link_speed;
451 * Try each speed one by one, highest priority first. We do this in
452 * software because 10gb fiber doesn't support speed autonegotiation.
454 if (speed & IXGBE_LINK_SPEED_10GB_FULL) {
456 highest_link_speed = IXGBE_LINK_SPEED_10GB_FULL;
458 /* Set hardware SDP's */
459 esdp_reg |= (IXGBE_ESDP_SDP5_DIR | IXGBE_ESDP_SDP5);
460 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg);
462 ixgbe_setup_mac_link_speed_82599(hw,
463 IXGBE_LINK_SPEED_10GB_FULL,
465 autoneg_wait_to_complete);
469 /* If we have link, just jump out */
470 hw->mac.ops.check_link(hw, &phy_link_speed, &link_up, false);
475 if (speed & IXGBE_LINK_SPEED_1GB_FULL) {
477 if (highest_link_speed == IXGBE_LINK_SPEED_UNKNOWN)
478 highest_link_speed = IXGBE_LINK_SPEED_1GB_FULL;
480 /* Set hardware SDP's */
481 esdp_reg &= ~IXGBE_ESDP_SDP5;
482 esdp_reg |= IXGBE_ESDP_SDP5_DIR;
483 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg);
485 ixgbe_setup_mac_link_speed_82599(
486 hw, IXGBE_LINK_SPEED_1GB_FULL, autoneg,
487 autoneg_wait_to_complete);
491 /* If we have link, just jump out */
492 hw->mac.ops.check_link(hw, &phy_link_speed, &link_up, false);
498 * We didn't get link. Configure back to the highest speed we tried,
499 * (if there was more than one). We call ourselves back with just the
500 * single highest speed that the user requested.
503 status = ixgbe_setup_mac_link_speed_multispeed_fiber(hw,
506 autoneg_wait_to_complete);
513 * ixgbe_check_mac_link_82599 - Determine link and speed status
514 * @hw: pointer to hardware structure
515 * @speed: pointer to link speed
516 * @link_up: true when link is up
517 * @link_up_wait_to_complete: bool used to wait for link up or not
519 * Reads the links register to determine if link is up and the current speed
521 s32 ixgbe_check_mac_link_82599(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
522 bool *link_up, bool link_up_wait_to_complete)
527 links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS);
528 if (link_up_wait_to_complete) {
529 for (i = 0; i < IXGBE_LINK_UP_TIME; i++) {
530 if (links_reg & IXGBE_LINKS_UP) {
537 links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS);
540 if (links_reg & IXGBE_LINKS_UP)
546 if ((links_reg & IXGBE_LINKS_SPEED_82599) ==
547 IXGBE_LINKS_SPEED_10G_82599)
548 *speed = IXGBE_LINK_SPEED_10GB_FULL;
549 else if ((links_reg & IXGBE_LINKS_SPEED_82599) ==
550 IXGBE_LINKS_SPEED_1G_82599)
551 *speed = IXGBE_LINK_SPEED_1GB_FULL;
553 *speed = IXGBE_LINK_SPEED_100_FULL;
560 * ixgbe_setup_mac_link_speed_82599 - Set MAC link speed
561 * @hw: pointer to hardware structure
562 * @speed: new link speed
563 * @autoneg: true if autonegotiation enabled
564 * @autoneg_wait_to_complete: true when waiting for completion is needed
566 * Set the link speed in the AUTOC register and restarts link.
568 s32 ixgbe_setup_mac_link_speed_82599(struct ixgbe_hw *hw,
569 ixgbe_link_speed speed, bool autoneg,
570 bool autoneg_wait_to_complete)
573 u32 autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC);
574 u32 autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2);
575 u32 link_mode = autoc & IXGBE_AUTOC_LMS_MASK;
576 u32 pma_pmd_1g = autoc & IXGBE_AUTOC_1G_PMA_PMD_MASK;
577 u32 pma_pmd_10g_serial = autoc2 & IXGBE_AUTOC2_10G_SERIAL_PMA_PMD_MASK;
580 ixgbe_link_speed link_capabilities = IXGBE_LINK_SPEED_UNKNOWN;
582 /* Check to see if speed passed in is supported. */
583 hw->mac.ops.get_link_capabilities(hw, &link_capabilities, &autoneg);
584 speed &= link_capabilities;
586 if (speed == IXGBE_LINK_SPEED_UNKNOWN) {
587 status = IXGBE_ERR_LINK_SETUP;
588 } else if (link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR ||
589 link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_1G_AN ||
590 link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII) {
591 /* Set KX4/KX/KR support according to speed requested */
592 autoc &= ~(IXGBE_AUTOC_KX4_KX_SUPP_MASK | IXGBE_AUTOC_KR_SUPP);
593 if (speed & IXGBE_LINK_SPEED_10GB_FULL)
594 if (hw->mac.orig_autoc & IXGBE_AUTOC_KX4_SUPP)
595 autoc |= IXGBE_AUTOC_KX4_SUPP;
596 if (hw->mac.orig_autoc & IXGBE_AUTOC_KR_SUPP)
597 autoc |= IXGBE_AUTOC_KR_SUPP;
598 if (speed & IXGBE_LINK_SPEED_1GB_FULL)
599 autoc |= IXGBE_AUTOC_KX_SUPP;
600 } else if ((pma_pmd_1g == IXGBE_AUTOC_1G_SFI) &&
601 (link_mode == IXGBE_AUTOC_LMS_1G_LINK_NO_AN ||
602 link_mode == IXGBE_AUTOC_LMS_1G_AN)) {
603 /* Switch from 1G SFI to 10G SFI if requested */
604 if ((speed == IXGBE_LINK_SPEED_10GB_FULL) &&
605 (pma_pmd_10g_serial == IXGBE_AUTOC2_10G_SFI)) {
606 autoc &= ~IXGBE_AUTOC_LMS_MASK;
607 autoc |= IXGBE_AUTOC_LMS_10G_SERIAL;
609 } else if ((pma_pmd_10g_serial == IXGBE_AUTOC2_10G_SFI) &&
610 (link_mode == IXGBE_AUTOC_LMS_10G_SERIAL)) {
611 /* Switch from 10G SFI to 1G SFI if requested */
612 if ((speed == IXGBE_LINK_SPEED_1GB_FULL) &&
613 (pma_pmd_1g == IXGBE_AUTOC_1G_SFI)) {
614 autoc &= ~IXGBE_AUTOC_LMS_MASK;
616 autoc |= IXGBE_AUTOC_LMS_1G_AN;
618 autoc |= IXGBE_AUTOC_LMS_1G_LINK_NO_AN;
624 autoc |= IXGBE_AUTOC_AN_RESTART;
625 IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc);
627 /* Only poll for autoneg to complete if specified to do so */
628 if (autoneg_wait_to_complete) {
629 if (link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR ||
630 link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_1G_AN ||
631 link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII) {
632 links_reg = 0; /*Just in case Autoneg time=0*/
633 for (i = 0; i < IXGBE_AUTO_NEG_TIME; i++) {
635 IXGBE_READ_REG(hw, IXGBE_LINKS);
636 if (links_reg & IXGBE_LINKS_KX_AN_COMP)
640 if (!(links_reg & IXGBE_LINKS_KX_AN_COMP)) {
642 IXGBE_ERR_AUTONEG_NOT_COMPLETE;
643 hw_dbg(hw, "Autoneg did not "
649 /* Set up flow control */
650 status = ixgbe_setup_fc_generic(hw, 0);
652 /* Add delay to filter out noises during initial link setup */
660 * ixgbe_setup_copper_link_82599 - Setup copper link settings
661 * @hw: pointer to hardware structure
663 * Restarts the link on PHY and then MAC. Performs autonegotiation if needed.
665 static s32 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw)
669 /* Restart autonegotiation on PHY */
670 status = hw->phy.ops.setup_link(hw);
673 ixgbe_setup_mac_link_82599(hw);
679 * ixgbe_setup_copper_link_speed_82599 - Set the PHY autoneg advertised field
680 * @hw: pointer to hardware structure
681 * @speed: new link speed
682 * @autoneg: true if autonegotiation enabled
683 * @autoneg_wait_to_complete: true if waiting is needed to complete
685 * Restarts link on PHY and MAC based on settings passed in.
687 static s32 ixgbe_setup_copper_link_speed_82599(struct ixgbe_hw *hw,
688 ixgbe_link_speed speed,
690 bool autoneg_wait_to_complete)
694 /* Setup the PHY according to input speed */
695 status = hw->phy.ops.setup_link_speed(hw, speed, autoneg,
696 autoneg_wait_to_complete);
698 ixgbe_setup_mac_link_82599(hw);
704 * ixgbe_reset_hw_82599 - Perform hardware reset
705 * @hw: pointer to hardware structure
707 * Resets the hardware by resetting the transmit and receive units, masks
708 * and clears all interrupts, perform a PHY reset, and perform a link (MAC)
711 s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
719 /* Call adapter stop to disable tx/rx and clear interrupts */
720 hw->mac.ops.stop_adapter(hw);
722 /* PHY ops must be identified and initialized prior to reset */
724 /* Init PHY and function pointers, perform SFP setup */
725 status = hw->phy.ops.init(hw);
727 if (status == IXGBE_ERR_SFP_NOT_SUPPORTED)
730 /* Setup SFP module if there is one present. */
731 if (hw->phy.sfp_setup_needed) {
732 status = hw->mac.ops.setup_sfp(hw);
733 hw->phy.sfp_setup_needed = false;
737 if (hw->phy.reset_disable == false && hw->phy.ops.reset != NULL)
738 hw->phy.ops.reset(hw);
741 * Prevent the PCI-E bus from from hanging by disabling PCI-E master
742 * access and verify no pending requests before reset
744 status = ixgbe_disable_pcie_master(hw);
746 status = IXGBE_ERR_MASTER_REQUESTS_PENDING;
747 hw_dbg(hw, "PCI-E Master disable polling has failed.\n");
751 * Issue global reset to the MAC. This needs to be a SW reset.
752 * If link reset is used, it might reset the MAC when mng is using it
754 ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL);
755 IXGBE_WRITE_REG(hw, IXGBE_CTRL, (ctrl | IXGBE_CTRL_RST));
756 IXGBE_WRITE_FLUSH(hw);
758 /* Poll for reset bit to self-clear indicating reset is complete */
759 for (i = 0; i < 10; i++) {
761 ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL);
762 if (!(ctrl & IXGBE_CTRL_RST))
765 if (ctrl & IXGBE_CTRL_RST) {
766 status = IXGBE_ERR_RESET_FAILED;
767 hw_dbg(hw, "Reset polling failed to complete.\n");
769 /* Clear PF Reset Done bit so PF/VF Mail Ops can work */
770 ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT);
771 ctrl_ext |= IXGBE_CTRL_EXT_PFRSTD;
772 IXGBE_WRITE_REG(hw, IXGBE_CTRL_EXT, ctrl_ext);
779 * Store the original AUTOC/AUTOC2 values if they have not been
780 * stored off yet. Otherwise restore the stored original
781 * values since the reset operation sets back to defaults.
783 autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC);
784 autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2);
785 if (hw->mac.orig_link_settings_stored == false) {
786 hw->mac.orig_autoc = autoc;
787 hw->mac.orig_autoc2 = autoc2;
788 hw->mac.orig_link_settings_stored = true;
790 if (autoc != hw->mac.orig_autoc)
791 IXGBE_WRITE_REG(hw, IXGBE_AUTOC, (hw->mac.orig_autoc |
792 IXGBE_AUTOC_AN_RESTART));
794 if ((autoc2 & IXGBE_AUTOC2_UPPER_MASK) !=
795 (hw->mac.orig_autoc2 & IXGBE_AUTOC2_UPPER_MASK)) {
796 autoc2 &= ~IXGBE_AUTOC2_UPPER_MASK;
797 autoc2 |= (hw->mac.orig_autoc2 &
798 IXGBE_AUTOC2_UPPER_MASK);
799 IXGBE_WRITE_REG(hw, IXGBE_AUTOC2, autoc2);
803 /* Store the permanent mac address */
804 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr);
811 * ixgbe_clear_vmdq_82599 - Disassociate a VMDq pool index from a rx address
812 * @hw: pointer to hardware struct
813 * @rar: receive address register index to disassociate
814 * @vmdq: VMDq pool index to remove from the rar
816 s32 ixgbe_clear_vmdq_82599(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
818 u32 mpsar_lo, mpsar_hi;
819 u32 rar_entries = hw->mac.num_rar_entries;
821 if (rar < rar_entries) {
822 mpsar_lo = IXGBE_READ_REG(hw, IXGBE_MPSAR_LO(rar));
823 mpsar_hi = IXGBE_READ_REG(hw, IXGBE_MPSAR_HI(rar));
825 if (!mpsar_lo && !mpsar_hi)
828 if (vmdq == IXGBE_CLEAR_VMDQ_ALL) {
830 IXGBE_WRITE_REG(hw, IXGBE_MPSAR_LO(rar), 0);
834 IXGBE_WRITE_REG(hw, IXGBE_MPSAR_HI(rar), 0);
837 } else if (vmdq < 32) {
838 mpsar_lo &= ~(1 << vmdq);
839 IXGBE_WRITE_REG(hw, IXGBE_MPSAR_LO(rar), mpsar_lo);
841 mpsar_hi &= ~(1 << (vmdq - 32));
842 IXGBE_WRITE_REG(hw, IXGBE_MPSAR_HI(rar), mpsar_hi);
845 /* was that the last pool using this rar? */
846 if (mpsar_lo == 0 && mpsar_hi == 0 && rar != 0)
847 hw->mac.ops.clear_rar(hw, rar);
849 hw_dbg(hw, "RAR index %d is out of range.\n", rar);
857 * ixgbe_set_vmdq_82599 - Associate a VMDq pool index with a rx address
858 * @hw: pointer to hardware struct
859 * @rar: receive address register index to associate with a VMDq index
860 * @vmdq: VMDq pool index
862 s32 ixgbe_set_vmdq_82599(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
865 u32 rar_entries = hw->mac.num_rar_entries;
867 if (rar < rar_entries) {
869 mpsar = IXGBE_READ_REG(hw, IXGBE_MPSAR_LO(rar));
871 IXGBE_WRITE_REG(hw, IXGBE_MPSAR_LO(rar), mpsar);
873 mpsar = IXGBE_READ_REG(hw, IXGBE_MPSAR_HI(rar));
874 mpsar |= 1 << (vmdq - 32);
875 IXGBE_WRITE_REG(hw, IXGBE_MPSAR_HI(rar), mpsar);
878 hw_dbg(hw, "RAR index %d is out of range.\n", rar);
884 * ixgbe_set_vfta_82599 - Set VLAN filter table
885 * @hw: pointer to hardware structure
886 * @vlan: VLAN id to write to VLAN filter
887 * @vind: VMDq output index that maps queue to VLAN id in VFVFB
888 * @vlan_on: boolean flag to turn on/off VLAN in VFVF
890 * Turn on/off specified VLAN in the VLAN filter table.
892 s32 ixgbe_set_vfta_82599(struct ixgbe_hw *hw, u32 vlan, u32 vind,
898 u32 first_empty_slot;
901 return IXGBE_ERR_PARAM;
904 * this is a 2 part operation - first the VFTA, then the
905 * VLVF and VLVFB if vind is set
909 * The VFTA is a bitstring made up of 128 32-bit registers
910 * that enable the particular VLAN id, much like the MTA:
911 * bits[11-5]: which register
912 * bits[4-0]: which bit in the register
914 regindex = (vlan >> 5) & 0x7F;
915 bitindex = vlan & 0x1F;
916 bits = IXGBE_READ_REG(hw, IXGBE_VFTA(regindex));
918 bits |= (1 << bitindex);
920 bits &= ~(1 << bitindex);
921 IXGBE_WRITE_REG(hw, IXGBE_VFTA(regindex), bits);
927 * make sure the vlan is in VLVF
928 * set the vind bit in the matching VLVFB
930 * clear the pool bit and possibly the vind
933 /* find the vlanid or the first empty slot */
934 first_empty_slot = 0;
936 for (regindex = 1; regindex < IXGBE_VLVF_ENTRIES; regindex++) {
937 bits = IXGBE_READ_REG(hw, IXGBE_VLVF(regindex));
938 if (!bits && !first_empty_slot)
939 first_empty_slot = regindex;
940 else if ((bits & 0x0FFF) == vlan)
944 if (regindex >= IXGBE_VLVF_ENTRIES) {
945 if (first_empty_slot)
946 regindex = first_empty_slot;
948 hw_dbg(hw, "No space in VLVF.\n");
954 /* set the pool bit */
956 bits = IXGBE_READ_REG(hw,
957 IXGBE_VLVFB(regindex * 2));
960 IXGBE_VLVFB(regindex * 2), bits);
962 bits = IXGBE_READ_REG(hw,
963 IXGBE_VLVFB((regindex * 2) + 1));
966 IXGBE_VLVFB((regindex * 2) + 1), bits);
969 /* clear the pool bit */
971 bits = IXGBE_READ_REG(hw,
972 IXGBE_VLVFB(regindex * 2));
973 bits &= ~(1 << vind);
975 IXGBE_VLVFB(regindex * 2), bits);
976 bits |= IXGBE_READ_REG(hw,
977 IXGBE_VLVFB((regindex * 2) + 1));
979 bits = IXGBE_READ_REG(hw,
980 IXGBE_VLVFB((regindex * 2) + 1));
981 bits &= ~(1 << vind);
983 IXGBE_VLVFB((regindex * 2) + 1), bits);
984 bits |= IXGBE_READ_REG(hw,
985 IXGBE_VLVFB(regindex * 2));
990 IXGBE_WRITE_REG(hw, IXGBE_VLVF(regindex),
991 (IXGBE_VLVF_VIEN | vlan));
993 IXGBE_WRITE_REG(hw, IXGBE_VLVF(regindex), 0);
1001 * ixgbe_clear_vfta_82599 - Clear VLAN filter table
1002 * @hw: pointer to hardware structure
1004 * Clears the VLAN filer table, and the VMDq index associated with the filter
1006 s32 ixgbe_clear_vfta_82599(struct ixgbe_hw *hw)
1010 for (offset = 0; offset < hw->mac.vft_size; offset++)
1011 IXGBE_WRITE_REG(hw, IXGBE_VFTA(offset), 0);
1013 for (offset = 0; offset < IXGBE_VLVF_ENTRIES; offset++) {
1014 IXGBE_WRITE_REG(hw, IXGBE_VLVF(offset), 0);
1015 IXGBE_WRITE_REG(hw, IXGBE_VLVFB(offset * 2), 0);
1016 IXGBE_WRITE_REG(hw, IXGBE_VLVFB((offset * 2) + 1), 0);
1023 * ixgbe_blink_led_start_82599 - Blink LED based on index.
1024 * @hw: pointer to hardware structure
1025 * @index: led number to blink
1027 s32 ixgbe_blink_led_start_82599(struct ixgbe_hw *hw, u32 index)
1029 u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
1031 led_reg &= ~IXGBE_LED_MODE_MASK(index);
1032 led_reg |= IXGBE_LED_BLINK(index);
1033 IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, led_reg);
1034 IXGBE_WRITE_FLUSH(hw);
1040 * ixgbe_blink_led_stop_82599 - Stop blinking LED based on index.
1041 * @hw: pointer to hardware structure
1042 * @index: led number to stop blinking
1044 s32 ixgbe_blink_led_stop_82599(struct ixgbe_hw *hw, u32 index)
1046 u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
1048 led_reg &= ~IXGBE_LED_MODE_MASK(index);
1049 led_reg &= ~IXGBE_LED_BLINK(index);
1050 IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, led_reg);
1051 IXGBE_WRITE_FLUSH(hw);
1057 * ixgbe_init_uta_tables_82599 - Initialize the Unicast Table Array
1058 * @hw: pointer to hardware structure
1060 s32 ixgbe_init_uta_tables_82599(struct ixgbe_hw *hw)
1063 hw_dbg(hw, " Clearing UTA\n");
1065 for (i = 0; i < 128; i++)
1066 IXGBE_WRITE_REG(hw, IXGBE_UTA(i), 0);
1072 * ixgbe_read_analog_reg8_82599 - Reads 8 bit Omer analog register
1073 * @hw: pointer to hardware structure
1074 * @reg: analog register to read
1077 * Performs read operation to Omer analog register specified.
1079 s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val)
1083 IXGBE_WRITE_REG(hw, IXGBE_CORECTL, IXGBE_CORECTL_WRITE_CMD |
1085 IXGBE_WRITE_FLUSH(hw);
1087 core_ctl = IXGBE_READ_REG(hw, IXGBE_CORECTL);
1088 *val = (u8)core_ctl;
1094 * ixgbe_write_analog_reg8_82599 - Writes 8 bit Omer analog register
1095 * @hw: pointer to hardware structure
1096 * @reg: atlas register to write
1097 * @val: value to write
1099 * Performs write operation to Omer analog register specified.
1101 s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val)
1105 core_ctl = (reg << 8) | val;
1106 IXGBE_WRITE_REG(hw, IXGBE_CORECTL, core_ctl);
1107 IXGBE_WRITE_FLUSH(hw);
1114 * ixgbe_start_hw_82599 - Prepare hardware for Tx/Rx
1115 * @hw: pointer to hardware structure
1117 * Starts the hardware using the generic start_hw function.
1118 * Then performs device-specific:
1119 * Clears the rate limiter registers.
1121 s32 ixgbe_start_hw_82599(struct ixgbe_hw *hw)
1125 ixgbe_start_hw_generic(hw);
1127 /* Clear the rate limiters */
1128 for (q_num = 0; q_num < hw->mac.max_tx_queues; q_num++) {
1129 IXGBE_WRITE_REG(hw, IXGBE_RTTDQSEL, q_num);
1130 IXGBE_WRITE_REG(hw, IXGBE_RTTBCNRC, 0);
1132 IXGBE_WRITE_FLUSH(hw);
1138 * ixgbe_identify_phy_82599 - Get physical layer module
1139 * @hw: pointer to hardware structure
1141 * Determines the physical layer module found on the current adapter.
1143 s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw)
1145 s32 status = IXGBE_ERR_PHY_ADDR_INVALID;
1146 status = ixgbe_identify_phy_generic(hw);
1148 status = ixgbe_identify_sfp_module_generic(hw);
1153 * ixgbe_get_supported_physical_layer_82599 - Returns physical layer type
1154 * @hw: pointer to hardware structure
1156 * Determines physical layer capabilities of the current configuration.
1158 u32 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw)
1160 u32 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN;
1161 u8 comp_codes_10g = 0;
1163 switch (hw->device_id) {
1164 case IXGBE_DEV_ID_82599:
1165 case IXGBE_DEV_ID_82599_KX4:
1166 /* Default device ID is mezzanine card KX/KX4 */
1167 physical_layer = (IXGBE_PHYSICAL_LAYER_10GBASE_KX4 |
1168 IXGBE_PHYSICAL_LAYER_1000BASE_KX);
1170 case IXGBE_DEV_ID_82599_SFP:
1171 hw->phy.ops.identify_sfp(hw);
1173 switch (hw->phy.sfp_type) {
1174 case ixgbe_sfp_type_da_cu:
1175 case ixgbe_sfp_type_da_cu_core0:
1176 case ixgbe_sfp_type_da_cu_core1:
1177 physical_layer = IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU;
1179 case ixgbe_sfp_type_sr:
1180 physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_SR;
1182 case ixgbe_sfp_type_lr:
1183 physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_LR;
1185 case ixgbe_sfp_type_srlr_core0:
1186 case ixgbe_sfp_type_srlr_core1:
1187 hw->phy.ops.read_i2c_eeprom(hw,
1188 IXGBE_SFF_10GBE_COMP_CODES,
1190 if (comp_codes_10g & IXGBE_SFF_10GBASESR_CAPABLE)
1192 IXGBE_PHYSICAL_LAYER_10GBASE_SR;
1193 else if (comp_codes_10g & IXGBE_SFF_10GBASELR_CAPABLE)
1195 IXGBE_PHYSICAL_LAYER_10GBASE_LR;
1197 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN;
1199 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN;
1204 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN;
1208 return physical_layer;
1212 * ixgbe_enable_rx_dma_82599 - Enable the Rx DMA unit on 82599
1213 * @hw: pointer to hardware structure
1214 * @regval: register value to write to RXCTRL
1216 * Enables the Rx DMA unit for 82599
1218 s32 ixgbe_enable_rx_dma_82599(struct ixgbe_hw *hw, u32 regval)
1220 #define IXGBE_MAX_SECRX_POLL 30
1225 * Workaround for 82599 silicon errata when enabling the Rx datapath.
1226 * If traffic is incoming before we enable the Rx unit, it could hang
1227 * the Rx DMA unit. Therefore, make sure the security engine is
1228 * completely disabled prior to enabling the Rx unit.
1230 secrxreg = IXGBE_READ_REG(hw, IXGBE_SECRXCTRL);
1231 secrxreg |= IXGBE_SECRXCTRL_RX_DIS;
1232 IXGBE_WRITE_REG(hw, IXGBE_SECRXCTRL, secrxreg);
1233 for (i = 0; i < IXGBE_MAX_SECRX_POLL; i++) {
1234 secrxreg = IXGBE_READ_REG(hw, IXGBE_SECRXSTAT);
1235 if (secrxreg & IXGBE_SECRXSTAT_SECRX_RDY)
1241 /* For informational purposes only */
1242 if (i >= IXGBE_MAX_SECRX_POLL)
1243 hw_dbg(hw, "Rx unit being enabled before security "
1244 "path fully disabled. Continuing with init.\n");
1246 IXGBE_WRITE_REG(hw, IXGBE_RXCTRL, regval);
1247 secrxreg = IXGBE_READ_REG(hw, IXGBE_SECRXCTRL);
1248 secrxreg &= ~IXGBE_SECRXCTRL_RX_DIS;
1249 IXGBE_WRITE_REG(hw, IXGBE_SECRXCTRL, secrxreg);
1250 IXGBE_WRITE_FLUSH(hw);
1255 static struct ixgbe_mac_operations mac_ops_82599 = {
1256 .init_hw = &ixgbe_init_hw_generic,
1257 .reset_hw = &ixgbe_reset_hw_82599,
1258 .start_hw = &ixgbe_start_hw_82599,
1259 .clear_hw_cntrs = &ixgbe_clear_hw_cntrs_generic,
1260 .get_media_type = &ixgbe_get_media_type_82599,
1261 .get_supported_physical_layer = &ixgbe_get_supported_physical_layer_82599,
1262 .enable_rx_dma = &ixgbe_enable_rx_dma_82599,
1263 .get_mac_addr = &ixgbe_get_mac_addr_generic,
1264 .stop_adapter = &ixgbe_stop_adapter_generic,
1265 .get_bus_info = &ixgbe_get_bus_info_generic,
1266 .set_lan_id = &ixgbe_set_lan_id_multi_port_pcie,
1267 .read_analog_reg8 = &ixgbe_read_analog_reg8_82599,
1268 .write_analog_reg8 = &ixgbe_write_analog_reg8_82599,
1269 .setup_link = &ixgbe_setup_mac_link_82599,
1270 .setup_link_speed = &ixgbe_setup_mac_link_speed_82599,
1271 .check_link = &ixgbe_check_mac_link_82599,
1272 .get_link_capabilities = &ixgbe_get_link_capabilities_82599,
1273 .led_on = &ixgbe_led_on_generic,
1274 .led_off = &ixgbe_led_off_generic,
1275 .blink_led_start = &ixgbe_blink_led_start_82599,
1276 .blink_led_stop = &ixgbe_blink_led_stop_82599,
1277 .set_rar = &ixgbe_set_rar_generic,
1278 .clear_rar = &ixgbe_clear_rar_generic,
1279 .set_vmdq = &ixgbe_set_vmdq_82599,
1280 .clear_vmdq = &ixgbe_clear_vmdq_82599,
1281 .init_rx_addrs = &ixgbe_init_rx_addrs_generic,
1282 .update_uc_addr_list = &ixgbe_update_uc_addr_list_generic,
1283 .update_mc_addr_list = &ixgbe_update_mc_addr_list_generic,
1284 .enable_mc = &ixgbe_enable_mc_generic,
1285 .disable_mc = &ixgbe_disable_mc_generic,
1286 .clear_vfta = &ixgbe_clear_vfta_82599,
1287 .set_vfta = &ixgbe_set_vfta_82599,
1288 .setup_fc = &ixgbe_setup_fc_generic,
1289 .init_uta_tables = &ixgbe_init_uta_tables_82599,
1290 .setup_sfp = &ixgbe_setup_sfp_modules_82599,
1293 static struct ixgbe_eeprom_operations eeprom_ops_82599 = {
1294 .init_params = &ixgbe_init_eeprom_params_generic,
1295 .read = &ixgbe_read_eeprom_generic,
1296 .write = &ixgbe_write_eeprom_generic,
1297 .validate_checksum = &ixgbe_validate_eeprom_checksum_generic,
1298 .update_checksum = &ixgbe_update_eeprom_checksum_generic,
1301 static struct ixgbe_phy_operations phy_ops_82599 = {
1302 .identify = &ixgbe_identify_phy_82599,
1303 .identify_sfp = &ixgbe_identify_sfp_module_generic,
1304 .init = &ixgbe_init_phy_ops_82599,
1305 .reset = &ixgbe_reset_phy_generic,
1306 .read_reg = &ixgbe_read_phy_reg_generic,
1307 .write_reg = &ixgbe_write_phy_reg_generic,
1308 .setup_link = &ixgbe_setup_phy_link_generic,
1309 .setup_link_speed = &ixgbe_setup_phy_link_speed_generic,
1310 .read_i2c_byte = &ixgbe_read_i2c_byte_generic,
1311 .write_i2c_byte = &ixgbe_write_i2c_byte_generic,
1312 .read_i2c_eeprom = &ixgbe_read_i2c_eeprom_generic,
1313 .write_i2c_eeprom = &ixgbe_write_i2c_eeprom_generic,
1316 struct ixgbe_info ixgbe_82599_info = {
1317 .mac = ixgbe_mac_82599EB,
1318 .get_invariants = &ixgbe_get_invariants_82599,
1319 .mac_ops = &mac_ops_82599,
1320 .eeprom_ops = &eeprom_ops_82599,
1321 .phy_ops = &phy_ops_82599,