From efa2dc5b0922f90cedae7dd7a0925cee8e4452d1 Mon Sep 17 00:00:00 2001 From: Ouyang Changchun Date: Tue, 7 Oct 2014 14:42:01 +0200 Subject: [PATCH] ixgbe/base: support EEE Signed-off-by: Changchun Ouyang [Thomas: split patch] --- lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.c | 15 +++++++++++++++ lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.h | 1 + lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h | 18 ++++++++++++++++-- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.c b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.c index 4feb2de4b3..7ad8eda27e 100644 --- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.c +++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.c @@ -1080,6 +1080,21 @@ s32 ixgbe_dmac_config_tcs(struct ixgbe_hw *hw) IXGBE_NOT_IMPLEMENTED); } +/** + * ixgbe_setup_eee - Enable/disable EEE support + * @hw: pointer to the HW structure + * @enable_eee: boolean flag to enable EEE + * + * Enable/disable EEE based on enable_ee flag. + * Auto-negotiation must be started after BASE-T EEE bits in PHY register 7.3C + * are modified. + * + **/ +s32 ixgbe_setup_eee(struct ixgbe_hw *hw, bool enable_eee) +{ + return ixgbe_call_func(hw, hw->mac.ops.setup_eee, (hw, enable_eee), + IXGBE_NOT_IMPLEMENTED); +} /** * ixgbe_read_analog_reg8 - Reads 8 bit analog register diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.h b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.h index 14c753d207..88a8ca04ff 100644 --- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.h +++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.h @@ -182,6 +182,7 @@ s32 ixgbe_get_fcoe_boot_status(struct ixgbe_hw *hw, u16 *bs); s32 ixgbe_dmac_config(struct ixgbe_hw *hw); s32 ixgbe_dmac_update_tcs(struct ixgbe_hw *hw); s32 ixgbe_dmac_config_tcs(struct ixgbe_hw *hw); +s32 ixgbe_setup_eee(struct ixgbe_hw *hw, bool enable_eee); void ixgbe_disable_rx(struct ixgbe_hw *hw); void ixgbe_enable_rx(struct ixgbe_hw *hw); diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h index 29a05a53ad..f30ce39fcd 100644 --- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h +++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h @@ -551,6 +551,21 @@ struct ixgbe_dmac_config { #define IXGBE_DMCTH_DMACRXT_MASK 0x000001FF /* Receive Threshold mask */ #define IXGBE_DMCTLX_TTLX_MASK 0x00000FFF /* Time to Lx request mask */ +/* EEE registers */ +#define IXGBE_EEER 0x043A0 /* EEE register */ +#define IXGBE_EEE_STAT 0x04398 /* EEE Status */ +#define IXGBE_EEE_SU 0x04380 /* EEE Set up */ +#define IXGBE_TLPIC 0x041F4 /* EEE Tx LPI count */ +#define IXGBE_RLPIC 0x041F8 /* EEE Rx LPI count */ + +/* EEE register fields */ +#define IXGBE_EEER_TX_LPI_EN 0x00010000 /* Enable EEE LPI TX path */ +#define IXGBE_EEER_RX_LPI_EN 0x00020000 /* Enable EEE LPI RX path */ +#define IXGBE_EEE_STAT_NEG 0x20000000 /* EEE support neg on link */ +#define IXGBE_EEE_RX_LPI_STATUS 0x40000000 /* RX Link in LPI status */ +#define IXGBE_EEE_TX_LPI_STATUS 0x80000000 /* TX Link in LPI status */ + + /* Security Control Registers */ #define IXGBE_SECTXCTRL 0x08800 @@ -3235,8 +3250,7 @@ struct ixgbe_mac_operations { s32 (*dmac_update_tcs)(struct ixgbe_hw *hw); s32 (*dmac_config_tcs)(struct ixgbe_hw *hw); void (*get_rtrup2tc)(struct ixgbe_hw *hw, u8 *map); - s32 (*set_eee)(struct ixgbe_hw *hw, bool enable_eee); - s32 (*eee_linkup)(struct ixgbe_hw *hw, bool eee_enabled); + s32 (*setup_eee)(struct ixgbe_hw *hw, bool enable_eee); void (*set_ethertype_anti_spoofing)(struct ixgbe_hw *, bool, int); void (*disable_rx)(struct ixgbe_hw *hw); void (*enable_rx)(struct ixgbe_hw *hw); -- 2.20.1