Commit 0b0c2b31 authored by Emil Tantilov's avatar Emil Tantilov Committed by Jeff Kirsher

ixgbe: Enable flow control pause parameter auto-negotiation support

This patch enables flow control pause parameters auto-negotiation support
to 82599 based 10G Base-T, backplane devices and multi-speed fiber optics
modules at 1G speed
Signed-off-by: default avatarEmil Tantilov <emil.s.tantilov@intel.com>
Tested-by: default avatarStephen Ko <stephen.s.ko@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent a3aeea0e
...@@ -366,7 +366,7 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num) ...@@ -366,7 +366,7 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num)
/* Negotiate the fc mode to use */ /* Negotiate the fc mode to use */
ret_val = ixgbe_fc_autoneg(hw); ret_val = ixgbe_fc_autoneg(hw);
if (ret_val) if (ret_val == IXGBE_ERR_FLOW_CONTROL)
goto out; goto out;
/* Disable any previous flow control settings */ /* Disable any previous flow control settings */
...@@ -384,10 +384,10 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num) ...@@ -384,10 +384,10 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num)
* 2: Tx flow control is enabled (we can send pause frames but * 2: Tx flow control is enabled (we can send pause frames but
* we do not support receiving pause frames). * we do not support receiving pause frames).
* 3: Both Rx and Tx flow control (symmetric) are enabled. * 3: Both Rx and Tx flow control (symmetric) are enabled.
* other: Invalid.
#ifdef CONFIG_DCB #ifdef CONFIG_DCB
* 4: Priority Flow Control is enabled. * 4: Priority Flow Control is enabled.
#endif #endif
* other: Invalid.
*/ */
switch (hw->fc.current_mode) { switch (hw->fc.current_mode) {
case ixgbe_fc_none: case ixgbe_fc_none:
...@@ -444,9 +444,10 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num) ...@@ -444,9 +444,10 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num)
reg = (rx_pba_size - hw->fc.low_water) << 6; reg = (rx_pba_size - hw->fc.low_water) << 6;
if (hw->fc.send_xon) if (hw->fc.send_xon)
reg |= IXGBE_FCRTL_XONE; reg |= IXGBE_FCRTL_XONE;
IXGBE_WRITE_REG(hw, IXGBE_FCRTL(packetbuf_num), reg); IXGBE_WRITE_REG(hw, IXGBE_FCRTL(packetbuf_num), reg);
reg = (rx_pba_size - hw->fc.high_water) << 10; reg = (rx_pba_size - hw->fc.high_water) << 6;
reg |= IXGBE_FCRTH_FCEN; reg |= IXGBE_FCRTH_FCEN;
IXGBE_WRITE_REG(hw, IXGBE_FCRTH(packetbuf_num), reg); IXGBE_WRITE_REG(hw, IXGBE_FCRTH(packetbuf_num), reg);
......
...@@ -772,6 +772,9 @@ static s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw, ...@@ -772,6 +772,9 @@ static s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw,
/* Check to see if speed passed in is supported. */ /* Check to see if speed passed in is supported. */
hw->mac.ops.get_link_capabilities(hw, &link_capabilities, &autoneg); hw->mac.ops.get_link_capabilities(hw, &link_capabilities, &autoneg);
if (status != 0)
goto out;
speed &= link_capabilities; speed &= link_capabilities;
if (speed == IXGBE_LINK_SPEED_UNKNOWN) { if (speed == IXGBE_LINK_SPEED_UNKNOWN) {
......
This diff is collapsed.
...@@ -3775,7 +3775,8 @@ static int ixgbe_non_sfp_link_config(struct ixgbe_hw *hw) ...@@ -3775,7 +3775,8 @@ static int ixgbe_non_sfp_link_config(struct ixgbe_hw *hw)
if (ret) if (ret)
goto link_cfg_out; goto link_cfg_out;
if (hw->mac.ops.get_link_capabilities) autoneg = hw->phy.autoneg_advertised;
if ((!autoneg) && (hw->mac.ops.get_link_capabilities))
ret = hw->mac.ops.get_link_capabilities(hw, &autoneg, ret = hw->mac.ops.get_link_capabilities(hw, &autoneg,
&negotiation); &negotiation);
if (ret) if (ret)
......
...@@ -58,6 +58,10 @@ ...@@ -58,6 +58,10 @@
#define IXGBE_I2C_EEPROM_STATUS_FAIL 0x2 #define IXGBE_I2C_EEPROM_STATUS_FAIL 0x2
#define IXGBE_I2C_EEPROM_STATUS_IN_PROGRESS 0x3 #define IXGBE_I2C_EEPROM_STATUS_IN_PROGRESS 0x3
/* Flow control defines */
#define IXGBE_TAF_SYM_PAUSE 0x400
#define IXGBE_TAF_ASM_PAUSE 0x800
/* Bit-shift macros */ /* Bit-shift macros */
#define IXGBE_SFF_VENDOR_OUI_BYTE0_SHIFT 24 #define IXGBE_SFF_VENDOR_OUI_BYTE0_SHIFT 24
#define IXGBE_SFF_VENDOR_OUI_BYTE1_SHIFT 16 #define IXGBE_SFF_VENDOR_OUI_BYTE1_SHIFT 16
......
...@@ -2698,6 +2698,9 @@ struct ixgbe_info { ...@@ -2698,6 +2698,9 @@ struct ixgbe_info {
#define IXGBE_ERR_EEPROM_VERSION -24 #define IXGBE_ERR_EEPROM_VERSION -24
#define IXGBE_ERR_NO_SPACE -25 #define IXGBE_ERR_NO_SPACE -25
#define IXGBE_ERR_OVERTEMP -26 #define IXGBE_ERR_OVERTEMP -26
#define IXGBE_ERR_FC_NOT_NEGOTIATED -27
#define IXGBE_ERR_FC_NOT_SUPPORTED -28
#define IXGBE_ERR_FLOW_CONTROL -29
#define IXGBE_ERR_SFP_SETUP_NOT_COMPLETE -30 #define IXGBE_ERR_SFP_SETUP_NOT_COMPLETE -30
#define IXGBE_ERR_PBA_SECTION -31 #define IXGBE_ERR_PBA_SECTION -31
#define IXGBE_ERR_INVALID_ARGUMENT -32 #define IXGBE_ERR_INVALID_ARGUMENT -32
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment