Deleted Added
full compact
ixgbe_api.c (238149) ixgbe_api.c (247822)
1/******************************************************************************
2
1/******************************************************************************
2
3 Copyright (c) 2001-2012, Intel Corporation
3 Copyright (c) 2001-2013, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8
9 1. Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
11

--- 13 unchanged lines hidden (view full) ---

25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31
32******************************************************************************/
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8
9 1. Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
11

--- 13 unchanged lines hidden (view full) ---

25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31
32******************************************************************************/
33/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_api.c 238149 2012-07-05 20:51:44Z jfv $*/
33/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_api.c 247822 2013-03-04 23:07:40Z jfv $*/
34
35#include "ixgbe_api.h"
36#include "ixgbe_common.h"
37
38/**
39 * ixgbe_init_shared_code - Initialize the shared code
40 * @hw: pointer to hardware structure
41 *

--- 46 unchanged lines hidden (view full) ---

88 * vendor ID and device ID stored in the hw structure.
89 **/
90s32 ixgbe_set_mac_type(struct ixgbe_hw *hw)
91{
92 s32 ret_val = IXGBE_SUCCESS;
93
94 DEBUGFUNC("ixgbe_set_mac_type\n");
95
34
35#include "ixgbe_api.h"
36#include "ixgbe_common.h"
37
38/**
39 * ixgbe_init_shared_code - Initialize the shared code
40 * @hw: pointer to hardware structure
41 *

--- 46 unchanged lines hidden (view full) ---

88 * vendor ID and device ID stored in the hw structure.
89 **/
90s32 ixgbe_set_mac_type(struct ixgbe_hw *hw)
91{
92 s32 ret_val = IXGBE_SUCCESS;
93
94 DEBUGFUNC("ixgbe_set_mac_type\n");
95
96 if (hw->vendor_id == IXGBE_INTEL_VENDOR_ID) {
97 switch (hw->device_id) {
98 case IXGBE_DEV_ID_82598:
99 case IXGBE_DEV_ID_82598_BX:
100 case IXGBE_DEV_ID_82598AF_SINGLE_PORT:
101 case IXGBE_DEV_ID_82598AF_DUAL_PORT:
102 case IXGBE_DEV_ID_82598AT:
103 case IXGBE_DEV_ID_82598AT2:
104 case IXGBE_DEV_ID_82598EB_CX4:
105 case IXGBE_DEV_ID_82598_CX4_DUAL_PORT:
106 case IXGBE_DEV_ID_82598_DA_DUAL_PORT:
107 case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM:
108 case IXGBE_DEV_ID_82598EB_XF_LR:
109 case IXGBE_DEV_ID_82598EB_SFP_LOM:
110 hw->mac.type = ixgbe_mac_82598EB;
111 break;
112 case IXGBE_DEV_ID_82599_KX4:
113 case IXGBE_DEV_ID_82599_KX4_MEZZ:
114 case IXGBE_DEV_ID_82599_XAUI_LOM:
115 case IXGBE_DEV_ID_82599_COMBO_BACKPLANE:
116 case IXGBE_DEV_ID_82599_KR:
117 case IXGBE_DEV_ID_82599_SFP:
118 case IXGBE_DEV_ID_82599_BACKPLANE_FCOE:
119 case IXGBE_DEV_ID_82599_SFP_FCOE:
120 case IXGBE_DEV_ID_82599_SFP_EM:
121 case IXGBE_DEV_ID_82599_SFP_SF2:
122 case IXGBE_DEV_ID_82599EN_SFP:
123 case IXGBE_DEV_ID_82599_CX4:
124 case IXGBE_DEV_ID_82599_T3_LOM:
125 hw->mac.type = ixgbe_mac_82599EB;
126 break;
127 case IXGBE_DEV_ID_82599_VF:
128 hw->mac.type = ixgbe_mac_82599_vf;
129 break;
130 case IXGBE_DEV_ID_X540_VF:
131 hw->mac.type = ixgbe_mac_X540_vf;
132 break;
133 case IXGBE_DEV_ID_X540T:
134 case IXGBE_DEV_ID_X540T1:
135 hw->mac.type = ixgbe_mac_X540;
136 break;
137 default:
138 ret_val = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
139 break;
140 }
141 } else {
96 switch (hw->device_id) {
97 case IXGBE_DEV_ID_82598:
98 case IXGBE_DEV_ID_82598_BX:
99 case IXGBE_DEV_ID_82598AF_SINGLE_PORT:
100 case IXGBE_DEV_ID_82598AF_DUAL_PORT:
101 case IXGBE_DEV_ID_82598AT:
102 case IXGBE_DEV_ID_82598AT2:
103 case IXGBE_DEV_ID_82598EB_CX4:
104 case IXGBE_DEV_ID_82598_CX4_DUAL_PORT:
105 case IXGBE_DEV_ID_82598_DA_DUAL_PORT:
106 case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM:
107 case IXGBE_DEV_ID_82598EB_XF_LR:
108 case IXGBE_DEV_ID_82598EB_SFP_LOM:
109 hw->mac.type = ixgbe_mac_82598EB;
110 break;
111 case IXGBE_DEV_ID_82599_KX4:
112 case IXGBE_DEV_ID_82599_KX4_MEZZ:
113 case IXGBE_DEV_ID_82599_XAUI_LOM:
114 case IXGBE_DEV_ID_82599_COMBO_BACKPLANE:
115 case IXGBE_DEV_ID_82599_KR:
116 case IXGBE_DEV_ID_82599_SFP:
117 case IXGBE_DEV_ID_82599_BACKPLANE_FCOE:
118 case IXGBE_DEV_ID_82599_SFP_FCOE:
119 case IXGBE_DEV_ID_82599_SFP_EM:
120 case IXGBE_DEV_ID_82599_SFP_SF2:
121 case IXGBE_DEV_ID_82599_SFP_SF_QP:
122 case IXGBE_DEV_ID_82599EN_SFP:
123 case IXGBE_DEV_ID_82599_CX4:
124 case IXGBE_DEV_ID_82599_BYPASS:
125 case IXGBE_DEV_ID_82599_T3_LOM:
126 hw->mac.type = ixgbe_mac_82599EB;
127 break;
128 case IXGBE_DEV_ID_82599_VF:
129 case IXGBE_DEV_ID_82599_VF_HV:
130 hw->mac.type = ixgbe_mac_82599_vf;
131 break;
132 case IXGBE_DEV_ID_X540_VF:
133 case IXGBE_DEV_ID_X540_VF_HV:
134 hw->mac.type = ixgbe_mac_X540_vf;
135 break;
136 case IXGBE_DEV_ID_X540T:
137 case IXGBE_DEV_ID_X540_BYPASS:
138 hw->mac.type = ixgbe_mac_X540;
139 break;
140 default:
142 ret_val = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
141 ret_val = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
142 break;
143 }
144
145 DEBUGOUT2("ixgbe_set_mac_type found mac: %d, returns: %d\n",
146 hw->mac.type, ret_val);
147 return ret_val;
148}
149
150/**

--- 351 unchanged lines hidden (view full) ---

502 return ixgbe_call_func(hw, hw->phy.ops.check_link, (hw, speed,
503 link_up), IXGBE_NOT_IMPLEMENTED);
504}
505
506/**
507 * ixgbe_setup_phy_link_speed - Set auto advertise
508 * @hw: pointer to hardware structure
509 * @speed: new link speed
143 }
144
145 DEBUGOUT2("ixgbe_set_mac_type found mac: %d, returns: %d\n",
146 hw->mac.type, ret_val);
147 return ret_val;
148}
149
150/**

--- 351 unchanged lines hidden (view full) ---

502 return ixgbe_call_func(hw, hw->phy.ops.check_link, (hw, speed,
503 link_up), IXGBE_NOT_IMPLEMENTED);
504}
505
506/**
507 * ixgbe_setup_phy_link_speed - Set auto advertise
508 * @hw: pointer to hardware structure
509 * @speed: new link speed
510 * @autoneg: TRUE if autonegotiation enabled
511 *
512 * Sets the auto advertised capabilities
513 **/
514s32 ixgbe_setup_phy_link_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed,
510 *
511 * Sets the auto advertised capabilities
512 **/
513s32 ixgbe_setup_phy_link_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed,
515 bool autoneg,
516 bool autoneg_wait_to_complete)
517{
518 return ixgbe_call_func(hw, hw->phy.ops.setup_link_speed, (hw, speed,
514 bool autoneg_wait_to_complete)
515{
516 return ixgbe_call_func(hw, hw->phy.ops.setup_link_speed, (hw, speed,
519 autoneg, autoneg_wait_to_complete),
517 autoneg_wait_to_complete),
520 IXGBE_NOT_IMPLEMENTED);
521}
522
523/**
524 * ixgbe_check_link - Get link and speed status
525 * @hw: pointer to hardware structure
526 *
527 * Reads the links register to determine if link is up and the current speed

--- 43 unchanged lines hidden (view full) ---

571 if (hw->mac.ops.flap_tx_laser)
572 hw->mac.ops.flap_tx_laser(hw);
573}
574
575/**
576 * ixgbe_setup_link - Set link speed
577 * @hw: pointer to hardware structure
578 * @speed: new link speed
518 IXGBE_NOT_IMPLEMENTED);
519}
520
521/**
522 * ixgbe_check_link - Get link and speed status
523 * @hw: pointer to hardware structure
524 *
525 * Reads the links register to determine if link is up and the current speed

--- 43 unchanged lines hidden (view full) ---

569 if (hw->mac.ops.flap_tx_laser)
570 hw->mac.ops.flap_tx_laser(hw);
571}
572
573/**
574 * ixgbe_setup_link - Set link speed
575 * @hw: pointer to hardware structure
576 * @speed: new link speed
579 * @autoneg: TRUE if autonegotiation enabled
580 *
581 * Configures link settings. Restarts the link.
582 * Performs autonegotiation if needed.
583 **/
584s32 ixgbe_setup_link(struct ixgbe_hw *hw, ixgbe_link_speed speed,
577 *
578 * Configures link settings. Restarts the link.
579 * Performs autonegotiation if needed.
580 **/
581s32 ixgbe_setup_link(struct ixgbe_hw *hw, ixgbe_link_speed speed,
585 bool autoneg,
586 bool autoneg_wait_to_complete)
587{
588 return ixgbe_call_func(hw, hw->mac.ops.setup_link, (hw, speed,
582 bool autoneg_wait_to_complete)
583{
584 return ixgbe_call_func(hw, hw->mac.ops.setup_link, (hw, speed,
589 autoneg, autoneg_wait_to_complete),
585 autoneg_wait_to_complete),
590 IXGBE_NOT_IMPLEMENTED);
591}
592
593/**
594 * ixgbe_get_link_capabilities - Returns link capabilities
595 * @hw: pointer to hardware structure
596 *
597 * Determines the link capabilities of the current configuration.

--- 584 unchanged lines hidden ---
586 IXGBE_NOT_IMPLEMENTED);
587}
588
589/**
590 * ixgbe_get_link_capabilities - Returns link capabilities
591 * @hw: pointer to hardware structure
592 *
593 * Determines the link capabilities of the current configuration.

--- 584 unchanged lines hidden ---