FreeBSD kernel CXGBE device code
|
#include <sys/cdefs.h>
#include "opt_inet.h"
#include <sys/param.h>
#include <sys/eventhandler.h>
#include "common.h"
#include "t4_regs.h"
#include "t4_regs_values.h"
#include "firmware/t4fw_interface.h"
Go to the source code of this file.
Data Structures | |
struct | port_tx_state |
struct | t4_vpd_hdr |
struct | t4_vpdr_hdr |
struct | intr_details |
struct | intr_action |
struct | intr_info |
struct | flash_desc |
struct | pci_expansion_rom_header |
struct | legacy_pci_expansion_rom_header |
struct | efi_pci_expansion_rom_header |
struct | pcir_data_structure |
Macros | |
#define | msleep(x) |
#define | X_CIM_PF_NOACCESS 0xeeeeeeee |
#define | MC_DATA(i) MC_BIST_STATUS_REG(mc_bist_status_rdata_reg, i) |
#define | EDC_STRIDE_T5 (EDC_T51_BASE_ADDR - EDC_T50_BASE_ADDR) |
#define | EDC_REG_T5(reg, idx) (reg + EDC_STRIDE_T5 * idx) |
#define | EDC_DATA(i) EDC_BIST_STATUS_REG(edc_bist_status_rdata_reg, i) |
#define | EEPROM_DELAY 10 /* 10us per poll spin */ |
#define | EEPROM_MAX_POLL 5000 /* x 5000 == 50ms */ |
#define | EEPROM_STAT_ADDR 0x7bfc |
#define | VPD_SIZE 0x800 |
#define | VPD_BASE 0x400 |
#define | VPD_BASE_OLD 0 |
#define | VPD_LEN 1024 |
#define | VPD_INFO_FLD_HDR_SIZE 3 |
#define | CHELSIO_VPD_UNIQUE_ID 0x82 |
#define | FIND_VPD_KW(var, name) |
#define | FIRST_RET(__getvinfo) |
#define | CAP16_TO_CAP32(__cap) |
#define | CAP32_TO_CAP16(__cap) |
#define | NONFATAL_IF_DISABLED 1 |
#define | T4_LE_FATAL_MASK (F_PARITYERR | F_UNKNOWNCMD | F_REQQPARERR) |
#define | T5_LE_FATAL_MASK (T4_LE_FATAL_MASK | F_VFPARERR) |
#define | T6_LE_PERRCRC_MASK |
#define | T6_LE_FATAL_MASK |
#define | PF_INTR_MASK (F_PFSW | F_PFCIM) |
#define | STAT_IDX(x) ((A_TP_MIB_TCP_##x) - A_TP_MIB_TCP_OUT_RST) |
#define | STAT(x) val[STAT_IDX(x)] |
#define | STAT64(x) (((u64)STAT(x##_HI) << 32) | STAT(x##_LO)) |
#define | CC_MIN_INCR 2U |
#define | GET_STAT(name) |
#define | GET_STAT_COM(name) t4_read_reg64(adap, A_MPS_STAT_##name##_L) |
#define | GET_STAT(name) |
#define | GET_STAT_COM(name) t4_read_reg64(adap, A_MPS_STAT_##name##_L) |
#define | EPIO_REG(name) |
#define | INIT_CMD(var, cmd, rd_wr) |
#define | TEST_SPEED_RETURN(__caps_speed, __speed) |
#define | TEST_SPEED_RETURN(__caps_speed, __speed) |
#define | TEST_SPEED_RETURN(__caps_speed) |
#define | SGE_IDMA_WARN_THRESH 1 |
#define | SGE_IDMA_WARN_REPEAT 300 |
Typedefs | |
typedef struct pci_expansion_rom_header | pci_exp_rom_header_t |
typedef struct legacy_pci_expansion_rom_header | legacy_pci_exp_rom_header_t |
typedef struct efi_pci_expansion_rom_header | efi_pci_exp_rom_header_t |
typedef struct pcir_data_structure | pcir_data_t |
Enumerations | |
enum | { SF_ATTEMPTS = 10 , SF_PROG_PAGE = 2 , SF_WR_DISABLE = 4 , SF_RD_STATUS = 5 , SF_WR_ENABLE = 6 , SF_RD_DATA_FAST = 0xb , SF_RD_ID = 0x9f , SF_ERASE_SECTOR = 0xd8 } |
enum | { CIM_QCTL_BASE = 0 , CIM_CTL_BASE = 0x2000 , CIM_PBT_ADDR_BASE = 0x2800 , CIM_PBT_LRF_BASE = 0x3000 , CIM_PBT_DATA_BASE = 0x3800 } |
enum | { BOOT_FLASH_BOOT_ADDR = 0x0 , BOOT_SIGNATURE = 0xaa55 , BOOT_SIZE_INC = 512 , BOOT_MIN_SIZE = sizeof(pci_exp_rom_header_t) , BOOT_MAX_SIZE = 1024*BOOT_SIZE_INC , VENDOR_ID = 0x1425 , PCIR_SIGNATURE = 0x52494350 } |
Functions | |
__FBSDID ("$FreeBSD$") | |
static int | t4_wait_op_done_val (struct adapter *adapter, int reg, u32 mask, int polarity, int attempts, int delay, u32 *valp) |
static int | t4_wait_op_done (struct adapter *adapter, int reg, u32 mask, int polarity, int attempts, int delay) |
void | t4_set_reg_field (struct adapter *adapter, unsigned int addr, u32 mask, u32 val) |
void | t4_read_indirect (struct adapter *adap, unsigned int addr_reg, unsigned int data_reg, u32 *vals, unsigned int nregs, unsigned int start_idx) |
void | t4_write_indirect (struct adapter *adap, unsigned int addr_reg, unsigned int data_reg, const u32 *vals, unsigned int nregs, unsigned int start_idx) |
u32 | t4_hw_pci_read_cfg4 (adapter_t *adap, int reg) |
void | t4_report_fw_error (struct adapter *adap) |
static void | get_mbox_rpl (struct adapter *adap, __be64 *rpl, int nflit, u32 mbox_addr) |
static void | fw_asrt (struct adapter *adap, struct fw_debug_cmd *asrt) |
static void | read_tx_state_one (struct adapter *sc, int i, struct port_tx_state *tx_state) |
static void | read_tx_state (struct adapter *sc, struct port_tx_state *tx_state) |
static void | check_tx_state (struct adapter *sc, struct port_tx_state *tx_state) |
int | t4_wr_mbox_meat_timeout (struct adapter *adap, int mbox, const void *cmd, int size, void *rpl, bool sleep_ok, int timeout) |
int | t4_wr_mbox_meat (struct adapter *adap, int mbox, const void *cmd, int size, void *rpl, bool sleep_ok) |
static int | t4_edc_err_read (struct adapter *adap, int idx) |
int | t4_mc_read (struct adapter *adap, int idx, u32 addr, __be32 *data, u64 *ecc) |
int | t4_edc_read (struct adapter *adap, int idx, u32 addr, __be32 *data, u64 *ecc) |
int | t4_mem_read (struct adapter *adap, int mtype, u32 addr, u32 len, __be32 *buf) |
u32 | t4_read_pcie_cfg4 (struct adapter *adap, int reg, int drv_fw_attach) |
unsigned int | t4_get_regs_len (struct adapter *adapter) |
void | t4_get_regs (struct adapter *adap, u8 *buf, size_t buf_size) |
static int | t4_seeprom_wait (struct adapter *adapter) |
int | t4_seeprom_read (struct adapter *adapter, u32 addr, u32 *data) |
int | t4_seeprom_write (struct adapter *adapter, u32 addr, u32 data) |
int | t4_eeprom_ptov (unsigned int phys_addr, unsigned int fn, unsigned int sz) |
int | t4_seeprom_wp (struct adapter *adapter, int enable) |
static int | get_vpd_keyword_val (const u8 *vpd, const char *kw, int region) |
static int | get_vpd_params (struct adapter *adapter, struct vpd_params *p, uint16_t device_id, u32 *buf) |
static int | sf1_read (struct adapter *adapter, unsigned int byte_cnt, int cont, int lock, u32 *valp) |
static int | sf1_write (struct adapter *adapter, unsigned int byte_cnt, int cont, int lock, u32 val) |
static int | flash_wait_op (struct adapter *adapter, int attempts, int delay) |
int | t4_read_flash (struct adapter *adapter, unsigned int addr, unsigned int nwords, u32 *data, int byte_oriented) |
int | t4_write_flash (struct adapter *adapter, unsigned int addr, unsigned int n, const u8 *data, int byte_oriented) |
int | t4_get_fw_version (struct adapter *adapter, u32 *vers) |
int | t4_get_fw_hdr (struct adapter *adapter, struct fw_hdr *hdr) |
int | t4_get_bs_version (struct adapter *adapter, u32 *vers) |
int | t4_get_tp_version (struct adapter *adapter, u32 *vers) |
int | t4_get_exprom_version (struct adapter *adapter, u32 *vers) |
int | t4_get_scfg_version (struct adapter *adapter, u32 *vers) |
int | t4_get_vpd_version (struct adapter *adapter, u32 *vers) |
int | t4_get_version_info (struct adapter *adapter) |
int | t4_flash_erase_sectors (struct adapter *adapter, int start, int end) |
int | t4_flash_cfg_addr (struct adapter *adapter) |
static int | t4_fw_matches_chip (struct adapter *adap, const struct fw_hdr *hdr) |
int | t4_load_fw (struct adapter *adap, const u8 *fw_data, unsigned int size) |
int | t4_fwcache (struct adapter *adap, enum fw_params_param_dev_fwcache op) |
void | t4_cim_read_pif_la (struct adapter *adap, u32 *pif_req, u32 *pif_rsp, unsigned int *pif_req_wrptr, unsigned int *pif_rsp_wrptr) |
void | t4_cim_read_ma_la (struct adapter *adap, u32 *ma_req, u32 *ma_rsp) |
void | t4_ulprx_read_la (struct adapter *adap, u32 *la_buf) |
static uint32_t | fwcaps16_to_caps32 (uint16_t caps16) |
static uint16_t | fwcaps32_to_caps16 (uint32_t caps32) |
static int8_t | fwcap_to_fec (uint32_t caps, bool unset_means_none) |
static uint32_t | fec_to_fwcap (int8_t fec) |
int | t4_link_l1cfg (struct adapter *adap, unsigned int mbox, unsigned int port, struct link_config *lc) |
int | t4_restart_aneg (struct adapter *adap, unsigned int mbox, unsigned int port) |
static char | intr_alert_char (u32 cause, u32 enable, u32 fatal) |
static void | t4_show_intr_info (struct adapter *adap, const struct intr_info *ii, u32 cause) |
static bool | t4_handle_intr (struct adapter *adap, const struct intr_info *ii, u32 additional_cause, bool verbose) |
static bool | pcie_intr_handler (struct adapter *adap, int arg, bool verbose) |
static bool | tp_intr_handler (struct adapter *adap, int arg, bool verbose) |
static bool | sge_intr_handler (struct adapter *adap, int arg, bool verbose) |
static bool | cim_intr_handler (struct adapter *adap, int arg, bool verbose) |
static bool | ulprx_intr_handler (struct adapter *adap, int arg, bool verbose) |
static bool | ulptx_intr_handler (struct adapter *adap, int arg, bool verbose) |
static bool | pmtx_dump_dbg_stats (struct adapter *adap, int arg, bool verbose) |
static bool | pmtx_intr_handler (struct adapter *adap, int arg, bool verbose) |
static bool | pmrx_intr_handler (struct adapter *adap, int arg, bool verbose) |
static bool | cplsw_intr_handler (struct adapter *adap, int arg, bool verbose) |
static bool | le_intr_handler (struct adapter *adap, int arg, bool verbose) |
static bool | mps_intr_handler (struct adapter *adap, int arg, bool verbose) |
static bool | mem_intr_handler (struct adapter *adap, int idx, bool verbose) |
static bool | ma_wrap_status (struct adapter *adap, int arg, bool verbose) |
static bool | ma_intr_handler (struct adapter *adap, int arg, bool verbose) |
static bool | smb_intr_handler (struct adapter *adap, int arg, bool verbose) |
static bool | ncsi_intr_handler (struct adapter *adap, int arg, bool verbose) |
static bool | mac_intr_handler (struct adapter *adap, int port, bool verbose) |
static bool | plpl_intr_handler (struct adapter *adap, int arg, bool verbose) |
bool | t4_slow_intr_handler (struct adapter *adap, bool verbose) |
void | t4_intr_enable (struct adapter *adap) |
void | t4_intr_disable (struct adapter *adap) |
void | t4_intr_clear (struct adapter *adap) |
static int | hash_mac_addr (const u8 *addr) |
int | t4_config_rss_range (struct adapter *adapter, int mbox, unsigned int viid, int start, int n, const u16 *rspq, unsigned int nrspq) |
int | t4_config_glbl_rss (struct adapter *adapter, int mbox, unsigned int mode, unsigned int flags) |
int | t4_config_vi_rss (struct adapter *adapter, int mbox, unsigned int viid, unsigned int flags, unsigned int defq, unsigned int skeyidx, unsigned int skey) |
static int | rd_rss_row (struct adapter *adap, int row, u32 *val) |
int | t4_read_rss (struct adapter *adapter, u16 *map) |
static int | t4_tp_fw_ldst_rw (struct adapter *adap, int cmd, u32 *vals, unsigned int nregs, unsigned int start_index, unsigned int rw, bool sleep_ok) |
static void | t4_tp_indirect_rw (struct adapter *adap, u32 reg_addr, u32 reg_data, u32 *buff, u32 nregs, u32 start_index, int rw, bool sleep_ok) |
void | t4_tp_pio_read (struct adapter *adap, u32 *buff, u32 nregs, u32 start_index, bool sleep_ok) |
void | t4_tp_pio_write (struct adapter *adap, const u32 *buff, u32 nregs, u32 start_index, bool sleep_ok) |
void | t4_tp_tm_pio_read (struct adapter *adap, u32 *buff, u32 nregs, u32 start_index, bool sleep_ok) |
void | t4_tp_mib_read (struct adapter *adap, u32 *buff, u32 nregs, u32 start_index, bool sleep_ok) |
void | t4_read_rss_key (struct adapter *adap, u32 *key, bool sleep_ok) |
void | t4_write_rss_key (struct adapter *adap, const u32 *key, int idx, bool sleep_ok) |
void | t4_read_rss_pf_config (struct adapter *adapter, unsigned int index, u32 *valp, bool sleep_ok) |
void | t4_write_rss_pf_config (struct adapter *adapter, unsigned int index, u32 val, bool sleep_ok) |
void | t4_read_rss_vf_config (struct adapter *adapter, unsigned int index, u32 *vfl, u32 *vfh, bool sleep_ok) |
void | t4_write_rss_vf_config (struct adapter *adapter, unsigned int index, u32 vfl, u32 vfh, bool sleep_ok) |
u32 | t4_read_rss_pf_map (struct adapter *adapter, bool sleep_ok) |
void | t4_write_rss_pf_map (struct adapter *adapter, u32 pfmap, bool sleep_ok) |
u32 | t4_read_rss_pf_mask (struct adapter *adapter, bool sleep_ok) |
void | t4_write_rss_pf_mask (struct adapter *adapter, u32 pfmask, bool sleep_ok) |
void | t4_tp_get_tcp_stats (struct adapter *adap, struct tp_tcp_stats *v4, struct tp_tcp_stats *v6, bool sleep_ok) |
void | t4_tp_get_err_stats (struct adapter *adap, struct tp_err_stats *st, bool sleep_ok) |
void | t4_tp_get_tnl_stats (struct adapter *adap, struct tp_tnl_stats *st, bool sleep_ok) |
void | t4_tp_get_proxy_stats (struct adapter *adap, struct tp_proxy_stats *st, bool sleep_ok) |
void | t4_tp_get_cpl_stats (struct adapter *adap, struct tp_cpl_stats *st, bool sleep_ok) |
void | t4_tp_get_rdma_stats (struct adapter *adap, struct tp_rdma_stats *st, bool sleep_ok) |
void | t4_get_fcoe_stats (struct adapter *adap, unsigned int idx, struct tp_fcoe_stats *st, bool sleep_ok) |
void | t4_get_usm_stats (struct adapter *adap, struct tp_usm_stats *st, bool sleep_ok) |
void | t4_tp_get_tid_stats (struct adapter *adap, struct tp_tid_stats *st, bool sleep_ok) |
void | t4_read_mtu_tbl (struct adapter *adap, u16 *mtus, u8 *mtu_log) |
void | t4_read_cong_tbl (struct adapter *adap, u16 incr[NMTUS][NCCTRL_WIN]) |
void | t4_tp_wr_bits_indirect (struct adapter *adap, unsigned int addr, unsigned int mask, unsigned int val) |
static void | init_cong_ctrl (unsigned short *a, unsigned short *b) |
void | t4_load_mtus (struct adapter *adap, const unsigned short *mtus, const unsigned short *alpha, const unsigned short *beta) |
int | t4_set_pace_tbl (struct adapter *adap, const unsigned int *pace_vals, unsigned int start, unsigned int n) |
int | t4_set_sched_bps (struct adapter *adap, int sched, unsigned int kbps) |
int | t4_set_sched_ipg (struct adapter *adap, int sched, unsigned int ipg) |
static u64 | chan_rate (struct adapter *adap, unsigned int bytes256) |
void | t4_get_chan_txrate (struct adapter *adap, u64 *nic_rate, u64 *ofld_rate) |
int | t4_set_trace_filter (struct adapter *adap, const struct trace_params *tp, int idx, int enable) |
void | t4_get_trace_filter (struct adapter *adap, struct trace_params *tp, int idx, int *enabled) |
void | t4_pmtx_get_stats (struct adapter *adap, u32 cnt[], u64 cycles[]) |
void | t4_pmrx_get_stats (struct adapter *adap, u32 cnt[], u64 cycles[]) |
static unsigned int | t4_get_mps_bg_map (struct adapter *adap, int idx) |
static unsigned int | t4_get_rx_e_chan_map (struct adapter *adap, int idx) |
static unsigned int | t4_get_rx_c_chan (struct adapter *adap, int idx) |
const char * | t4_get_port_type_description (enum fw_port_type port_type) |
void | t4_get_port_stats_offset (struct adapter *adap, int idx, struct port_stats *stats, struct port_stats *offset) |
void | t4_get_port_stats (struct adapter *adap, int idx, struct port_stats *p) |
void | t4_get_lb_stats (struct adapter *adap, int idx, struct lb_port_stats *p) |
void | t4_wol_magic_enable (struct adapter *adap, unsigned int port, const u8 *addr) |
int | t4_wol_pat_enable (struct adapter *adap, unsigned int port, unsigned int map, u64 mask0, u64 mask1, unsigned int crc, bool enable) |
void | t4_mk_filtdelwr (unsigned int ftid, struct fw_filter_wr *wr, int qid) |
int | t4_fwaddrspace_write (struct adapter *adap, unsigned int mbox, u32 addr, u32 val) |
int | t4_mdio_rd (struct adapter *adap, unsigned int mbox, unsigned int phy_addr, unsigned int mmd, unsigned int reg, unsigned int *valp) |
int | t4_mdio_wr (struct adapter *adap, unsigned int mbox, unsigned int phy_addr, unsigned int mmd, unsigned int reg, unsigned int val) |
void | t4_sge_decode_idma_state (struct adapter *adapter, int state) |
int | t4_sge_ctxt_flush (struct adapter *adap, unsigned int mbox, int ctxt_type) |
int | t4_fw_hello (struct adapter *adap, unsigned int mbox, unsigned int evt_mbox, enum dev_master master, enum dev_state *state) |
int | t4_fw_bye (struct adapter *adap, unsigned int mbox) |
int | t4_fw_reset (struct adapter *adap, unsigned int mbox, int reset) |
int | t4_fw_halt (struct adapter *adap, unsigned int mbox, int force) |
int | t4_fw_restart (struct adapter *adap, unsigned int mbox) |
int | t4_fw_upgrade (struct adapter *adap, unsigned int mbox, const u8 *fw_data, unsigned int size, int force) |
int | t4_fw_initialize (struct adapter *adap, unsigned int mbox) |
int | t4_query_params_rw (struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int nparams, const u32 *params, u32 *val, int rw) |
int | t4_query_params (struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int nparams, const u32 *params, u32 *val) |
int | t4_set_params_timeout (struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int nparams, const u32 *params, const u32 *val, int timeout) |
int | t4_set_params (struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int nparams, const u32 *params, const u32 *val) |
int | t4_cfg_pfvf (struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int txq, unsigned int txq_eth_ctrl, unsigned int rxqi, unsigned int rxq, unsigned int tc, unsigned int vi, unsigned int cmask, unsigned int pmask, unsigned int nexact, unsigned int rcaps, unsigned int wxcaps) |
int | t4_alloc_vi_func (struct adapter *adap, unsigned int mbox, unsigned int port, unsigned int pf, unsigned int vf, unsigned int nmac, u8 *mac, u16 *rss_size, uint8_t *vfvld, uint16_t *vin, unsigned int portfunc, unsigned int idstype) |
int | t4_alloc_vi (struct adapter *adap, unsigned int mbox, unsigned int port, unsigned int pf, unsigned int vf, unsigned int nmac, u8 *mac, u16 *rss_size, uint8_t *vfvld, uint16_t *vin) |
int | t4_free_vi (struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int viid) |
int | t4_set_rxmode (struct adapter *adap, unsigned int mbox, unsigned int viid, int mtu, int promisc, int all_multi, int bcast, int vlanex, bool sleep_ok) |
int | t4_alloc_encap_mac_filt (struct adapter *adap, unsigned int viid, const u8 *addr, const u8 *mask, unsigned int vni, unsigned int vni_mask, u8 dip_hit, u8 lookup_type, bool sleep_ok) |
int | t4_alloc_raw_mac_filt (struct adapter *adap, unsigned int viid, const u8 *addr, const u8 *mask, unsigned int idx, u8 lookup_type, u8 port_id, bool sleep_ok) |
int | t4_alloc_mac_filt (struct adapter *adap, unsigned int mbox, unsigned int viid, bool free, unsigned int naddr, const u8 **addr, u16 *idx, u64 *hash, bool sleep_ok) |
int | t4_free_encap_mac_filt (struct adapter *adap, unsigned int viid, int idx, bool sleep_ok) |
int | t4_free_raw_mac_filt (struct adapter *adap, unsigned int viid, const u8 *addr, const u8 *mask, unsigned int idx, u8 lookup_type, u8 port_id, bool sleep_ok) |
int | t4_free_mac_filt (struct adapter *adap, unsigned int mbox, unsigned int viid, unsigned int naddr, const u8 **addr, bool sleep_ok) |
int | t4_change_mac (struct adapter *adap, unsigned int mbox, unsigned int viid, int idx, const u8 *addr, bool persist, uint16_t *smt_idx) |
int | t4_set_addr_hash (struct adapter *adap, unsigned int mbox, unsigned int viid, bool ucast, u64 vec, bool sleep_ok) |
int | t4_enable_vi_params (struct adapter *adap, unsigned int mbox, unsigned int viid, bool rx_en, bool tx_en, bool dcb_en) |
int | t4_enable_vi (struct adapter *adap, unsigned int mbox, unsigned int viid, bool rx_en, bool tx_en) |
int | t4_identify_port (struct adapter *adap, unsigned int mbox, unsigned int viid, unsigned int nblinks) |
int | t4_iq_stop (struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int iqtype, unsigned int iqid, unsigned int fl0id, unsigned int fl1id) |
int | t4_iq_free (struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int iqtype, unsigned int iqid, unsigned int fl0id, unsigned int fl1id) |
int | t4_eth_eq_stop (struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int eqid) |
int | t4_eth_eq_free (struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int eqid) |
int | t4_ctrl_eq_free (struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int eqid) |
int | t4_ofld_eq_free (struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int eqid) |
const char * | t4_link_down_rc_str (unsigned char link_down_rc) |
unsigned int | fwcap_to_speed (uint32_t caps) |
uint32_t | speed_to_fwcap (unsigned int speed) |
uint32_t | fwcap_top_speed (uint32_t caps) |
static uint32_t | lstatus_to_fwcap (u32 lstatus) |
static void | handle_port_info (struct port_info *pi, const struct fw_port_cmd *p, enum fw_port_action action, bool *mod_changed, bool *link_changed) |
int | t4_update_port_info (struct port_info *pi) |
int | t4_handle_fw_rpl (struct adapter *adap, const __be64 *rpl) |
static void | get_pci_mode (struct adapter *adapter, struct pci_params *p) |
int | t4_get_flash_params (struct adapter *adapter) |
static void | set_pcie_completion_timeout (struct adapter *adapter, u8 range) |
const struct chip_params * | t4_get_chip_params (int chipid) |
int | t4_prep_adapter (struct adapter *adapter, u32 *buf) |
int | t4_shutdown_adapter (struct adapter *adapter) |
int | t4_bar2_sge_qregs (struct adapter *adapter, unsigned int qid, enum t4_bar2_qtype qtype, int user, u64 *pbar2_qoffset, unsigned int *pbar2_qid) |
int | t4_init_devlog_params (struct adapter *adap, int fw_attach) |
int | t4_init_sge_params (struct adapter *adapter) |
static uint16_t | hashmask_to_filtermask (uint64_t hashmask, uint16_t filter_mode) |
static void | read_filter_mode_and_ingress_config (struct adapter *adap) |
int | t4_init_tp_params (struct adapter *adap) |
int | t4_filter_field_shift (const struct adapter *adap, int filter_sel) |
int | t4_port_init (struct adapter *adap, int mbox, int pf, int vf, int port_id) |
void | t4_read_cimq_cfg (struct adapter *adap, u16 *base, u16 *size, u16 *thres) |
int | t4_read_cim_ibq (struct adapter *adap, unsigned int qid, u32 *data, size_t n) |
int | t4_read_cim_obq (struct adapter *adap, unsigned int qid, u32 *data, size_t n) |
int | t4_cim_read (struct adapter *adap, unsigned int addr, unsigned int n, unsigned int *valp) |
int | t4_cim_write (struct adapter *adap, unsigned int addr, unsigned int n, const unsigned int *valp) |
static int | t4_cim_write1 (struct adapter *adap, unsigned int addr, unsigned int val) |
int | t4_cim_ctl_read (struct adapter *adap, unsigned int addr, unsigned int n, unsigned int *valp) |
int | t4_cim_read_la (struct adapter *adap, u32 *la_buf, unsigned int *wrptr) |
void | t4_tp_read_la (struct adapter *adap, u64 *la_buf, unsigned int *wrptr) |
void | t4_idma_monitor_init (struct adapter *adapter, struct sge_idma_monitor_state *idma) |
void | t4_idma_monitor (struct adapter *adapter, struct sge_idma_monitor_state *idma, int hz, int ticks) |
int | t4_set_vf_mac (struct adapter *adapter, unsigned int pf, unsigned int vf, unsigned int naddr, u8 *addr) |
void | t4_read_pace_tbl (struct adapter *adap, unsigned int pace_vals[NTX_SCHED]) |
void | t4_get_tx_sched (struct adapter *adap, unsigned int sched, unsigned int *kbps, unsigned int *ipg, bool sleep_ok) |
int | t4_load_cfg (struct adapter *adap, const u8 *cfg_data, unsigned int size) |
int | t5_fw_init_extern_mem (struct adapter *adap) |
static void | modify_device_id (int device_id, u8 *boot_data) |
int | t4_load_boot (struct adapter *adap, u8 *boot_data, unsigned int boot_addr, unsigned int size) |
static int | t4_flash_bootcfg_addr (struct adapter *adapter) |
int | t4_load_bootcfg (struct adapter *adap, const u8 *cfg_data, unsigned int size) |
int | t4_set_filter_cfg (struct adapter *adap, int mode, int mask, int vnic_mode) |
void | t4_clr_port_stats (struct adapter *adap, int idx) |
int | t4_i2c_io (struct adapter *adap, unsigned int mbox, int port, unsigned int devid, unsigned int offset, unsigned int len, u8 *buf, bool write) |
int | t4_i2c_rd (struct adapter *adap, unsigned int mbox, int port, unsigned int devid, unsigned int offset, unsigned int len, u8 *buf) |
int | t4_i2c_wr (struct adapter *adap, unsigned int mbox, int port, unsigned int devid, unsigned int offset, unsigned int len, u8 *buf) |
int | t4_sge_ctxt_rd (struct adapter *adap, unsigned int mbox, unsigned int cid, enum ctxt_type ctype, u32 *data) |
int | t4_sge_ctxt_rd_bd (struct adapter *adap, unsigned int cid, enum ctxt_type ctype, u32 *data) |
int | t4_sched_config (struct adapter *adapter, int type, int minmaxen, int sleep_ok) |
int | t4_sched_params (struct adapter *adapter, int type, int level, int mode, int rateunit, int ratemode, int channel, int cl, int minrate, int maxrate, int weight, int pktsize, int burstsize, int sleep_ok) |
int | t4_sched_params_ch_rl (struct adapter *adapter, int channel, int ratemode, unsigned int maxrate, int sleep_ok) |
int | t4_sched_params_cl_wrr (struct adapter *adapter, int channel, int cl, int weight, int sleep_ok) |
int | t4_sched_params_cl_rl_kbps (struct adapter *adapter, int channel, int cl, int mode, unsigned int maxrate, int pktsize, int sleep_ok) |
int | t4_config_watchdog (struct adapter *adapter, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int timeout, unsigned int action) |
int | t4_get_devlog_level (struct adapter *adapter, unsigned int *level) |
int | t4_set_devlog_level (struct adapter *adapter, unsigned int level) |
int | t4_configure_add_smac (struct adapter *adap) |
int | t4_configure_ringbb (struct adapter *adap) |
int | t4_set_vlan_acl (struct adapter *adap, unsigned int mbox, unsigned int vf, u16 vlan) |
int | t4_del_mac (struct adapter *adap, unsigned int mbox, unsigned int viid, const u8 *addr, bool smac) |
int | t4_add_mac (struct adapter *adap, unsigned int mbox, unsigned int viid, int idx, const u8 *addr, bool persist, u8 *smt_idx, bool smac) |
#define CAP16_TO_CAP32 | ( | __cap | ) |
#define CAP32_TO_CAP16 | ( | __cap | ) |
#define EDC_DATA | ( | i | ) | EDC_BIST_STATUS_REG(edc_bist_status_rdata_reg, i) |
#define EDC_REG_T5 | ( | reg, | |
idx | |||
) | (reg + EDC_STRIDE_T5 * idx) |
#define EDC_STRIDE_T5 (EDC_T51_BASE_ADDR - EDC_T50_BASE_ADDR) |
#define EPIO_REG | ( | name | ) |
#define FIND_VPD_KW | ( | var, | |
name | |||
) |
#define FIRST_RET | ( | __getvinfo | ) |
#define GET_STAT | ( | name | ) |
#define GET_STAT | ( | name | ) |
#define GET_STAT_COM | ( | name | ) | t4_read_reg64(adap, A_MPS_STAT_##name##_L) |
#define GET_STAT_COM | ( | name | ) | t4_read_reg64(adap, A_MPS_STAT_##name##_L) |
#define INIT_CMD | ( | var, | |
cmd, | |||
rd_wr | |||
) |
#define MC_DATA | ( | i | ) | MC_BIST_STATUS_REG(mc_bist_status_rdata_reg, i) |
#define msleep | ( | x | ) |
#define STAT | ( | x | ) | val[STAT_IDX(x)] |
#define STAT_IDX | ( | x | ) | ((A_TP_MIB_TCP_##x) - A_TP_MIB_TCP_OUT_RST) |
#define T4_LE_FATAL_MASK (F_PARITYERR | F_UNKNOWNCMD | F_REQQPARERR) |
#define T5_LE_FATAL_MASK (T4_LE_FATAL_MASK | F_VFPARERR) |
#define T6_LE_FATAL_MASK |
#define T6_LE_PERRCRC_MASK |
#define TEST_SPEED_RETURN | ( | __caps_speed | ) |
#define TEST_SPEED_RETURN | ( | __caps_speed, | |
__speed | |||
) |
#define TEST_SPEED_RETURN | ( | __caps_speed, | |
__speed | |||
) |
typedef struct efi_pci_expansion_rom_header efi_pci_exp_rom_header_t |
typedef struct legacy_pci_expansion_rom_header legacy_pci_exp_rom_header_t |
typedef struct pci_expansion_rom_header pci_exp_rom_header_t |
typedef struct pcir_data_structure pcir_data_t |
anonymous enum |
anonymous enum |
anonymous enum |
__FBSDID | ( | "$FreeBSD$" | ) |
Definition at line 6590 of file t4_hw.c.
References vpd_params::cclk, adapter::params, and adapter_params::vpd.
Referenced by t4_get_chan_txrate().
|
static |
Definition at line 275 of file t4_hw.c.
References A_MPS_PORT_CTL, F_PORTTXEN, for_each_port, is_t4(), mdelay, PORT_REG, read_tx_state_one(), port_tx_state::rx_pause, t4_read_reg(), t4_set_reg_field(), T5_PORT_REG, and port_tx_state::tx_frames.
Referenced by t4_wr_mbox_meat_timeout().
Definition at line 4465 of file t4_hw.c.
References A_CIM_HOST_INT_CAUSE, A_CIM_HOST_INT_ENABLE, A_CIM_HOST_UPACC_INT_CAUSE, A_CIM_HOST_UPACC_INT_ENABLE, A_CIM_PF_HOST_INT_CAUSE, A_CIM_PF_HOST_INT_ENABLE, A_PCIE_FW, F_BLKRDBOOTINT, F_BLKRDCTLINT, F_BLKRDEEPROMINT, F_BLKRDFLASHINT, F_BLKRDPLINT, F_BLKWRBOOTINT, F_BLKWRCTLINT, F_BLKWREEPROMINT, F_BLKWRFLASHINT, F_BLKWRPLINT, F_EEPROMWRINT, F_IBQNCSIPARERR, F_IBQPCIEPARERR, F_IBQSGEHIPARERR, F_IBQSGELOPARERR, F_IBQTP0PARERR, F_IBQTP1PARERR, F_IBQULPPARERR, F_ILLRDBEINT, F_ILLRDINT, F_ILLTRANSINT, F_ILLWRBEINT, F_ILLWRINT, F_MA_CIM_INTFPERR, F_MBHOSTPARERR, F_MBUPPARERR, F_NCSI2CIMINTFPARERR, F_OBQNCSIPARERR, F_OBQSGEPARERR, F_OBQSGERX0PARERR, F_OBQSGERX1PARERR, F_OBQULP0PARERR, F_OBQULP1PARERR, F_OBQULP2PARERR, F_OBQULP3PARERR, F_PCIE2CIMINTFPARERR, F_PCIE_FW_ERR, F_PLCIM_MSTRSPDATAPARERR, F_PREFDROPINT, F_REQOVRLOOKUPINT, F_RSPOVRLOOKUPINT, F_RSVDSPACEINT, F_SGE2CIMINTFPARERR, F_SGLRDBOOTINT, F_SGLRDCTLINT, F_SGLRDEEPROMINT, F_SGLRDFLASHINT, F_SGLRDPLINT, F_SGLWRBOOTINT, F_SGLWRCTLINT, F_SGLWREEPROMINT, F_SGLWRFLASHINT, F_SGLWRPLINT, F_TIEQINPARERRINT, F_TIEQOUTPARERRINT, F_TIMEOUTINT, F_TIMEOUTMAINT, F_TIMER0INT, F_TIMER1INT, F_TP2CIMINTFPARERR, F_ULP2CIMINTFPARERR, intr_info::fatal, G_PCIE_FW_EVAL, MYPF_REG, intr_info::name, NONFATAL_IF_DISABLED, PCIE_FW_EVAL_CRASH, t4_handle_intr(), t4_os_cim_err(), t4_read_reg(), and t4_write_reg().
Referenced by t4_slow_intr_handler().
Definition at line 4779 of file t4_hw.c.
References A_CPL_INTR_CAUSE, A_CPL_INTR_ENABLE, F_CIM_FRAMING_ERROR, F_CIM_OP_MAP_PERR, F_CIM_OVFL_ERROR, F_PERR_CPL_128TO128_0, F_PERR_CPL_128TO128_1, F_SGE_FRAMING_ERROR, F_TP_FRAMING_ERROR, F_ZERO_SWITCH_ERROR, intr_info::name, NONFATAL_IF_DISABLED, and t4_handle_intr().
Referenced by t4_slow_intr_handler().
|
static |
Definition at line 3850 of file t4_hw.c.
References FEC_BASER_RS, FEC_NONE, FEC_RS, FW_PORT_CAP32_FEC_BASER_RS, FW_PORT_CAP32_FEC_NO_FEC, FW_PORT_CAP32_FEC_RS, and M_FW_PORT_CAP32_FEC.
Referenced by t4_link_l1cfg().
|
static |
flash_wait_op - wait for a flash operation to complete @adapter: the adapter @attempts: max number of polls of the status register @delay: delay between polls in ms
Wait for a flash operation to complete by polling the status register.
Definition at line 3167 of file t4_hw.c.
References msleep, sf1_read(), sf1_write(), and SF_RD_STATUS.
Referenced by t4_flash_erase_sectors(), and t4_write_flash().
|
static |
Definition at line 233 of file t4_hw.c.
References fw_debug_cmd::fw_debug::assert, be32_to_cpu, CH_ALERT, fw_debug_cmd::fw_debug::fw_debug_assert::filename_0_7, fw_debug_cmd::fw_debug::fw_debug_assert::line, fw_debug_cmd::u, fw_debug_cmd::fw_debug::fw_debug_assert::x, and fw_debug_cmd::fw_debug::fw_debug_assert::y.
Referenced by t4_wr_mbox_meat_timeout().
|
static |
Definition at line 3830 of file t4_hw.c.
References FEC_BASER_RS, FEC_NONE, FEC_RS, FW_PORT_CAP32_FEC_BASER_RS, FW_PORT_CAP32_FEC_NO_FEC, FW_PORT_CAP32_FEC_RS, M_FW_PORT_CAP32_FEC, and V_FW_PORT_CAP32_FEC.
Referenced by handle_port_info().
unsigned int fwcap_to_speed | ( | uint32_t | caps | ) |
Definition at line 8824 of file t4_hw.c.
References TEST_SPEED_RETURN.
Referenced by handle_port_info(), and port_top_speed().
uint32_t fwcap_top_speed | ( | uint32_t | caps | ) |
Definition at line 8876 of file t4_hw.c.
References TEST_SPEED_RETURN.
Referenced by t4_link_l1cfg().
|
static |
fwcaps16_to_caps32 - convert 16-bit Port Capabilities to 32-bits @caps16: a 16-bit Port Capabilities value
Returns the equivalent 32-bit Port Capabilities value.
Definition at line 3758 of file t4_hw.c.
References CAP16_TO_CAP32, FEC_BASER_RS, and FEC_RS.
Referenced by handle_port_info().
|
static |
fwcaps32_to_caps16 - convert 32-bit Port Capabilities to 16-bits @caps32: a 32-bit Port Capabilities value
Returns the equivalent 16-bit Port Capabilities value. Note that not all 32-bit Port Capabilities can be represented in the 16-bit Port Capabilities and some fields/values may not make it.
Definition at line 3798 of file t4_hw.c.
References CAP32_TO_CAP16, FEC_BASER_RS, and FEC_RS.
Referenced by t4_link_l1cfg().
Definition at line 223 of file t4_hw.c.
References cpu_to_be64, and t4_read_reg64().
Referenced by t4_wr_mbox_meat_timeout().
|
static |
get_pci_mode - determine a card's PCI mode @adapter: the adapter : where to store the PCI settings
Determines a card's PCI mode and associated parameters, such as speed and width.
Definition at line 9099 of file t4_hw.c.
References PCI_CAP_ID_EXP, PCI_EXP_LNKSTA, PCI_EXP_LNKSTA_CLS, PCI_EXP_LNKSTA_NLW, pci_params::speed, t4_os_find_pci_capability(), t4_os_pci_read_cfg2(), and pci_params::width.
Referenced by t4_prep_adapter().
|
static |
get_vpd_keyword_val - Locates an information field keyword in the VPD @vpd: Pointer to buffered vpd data structure @kw: The keyword to search for @region: VPD region to search (starting from 0)
Returns the value of the information field keyword or -ENOENT otherwise.
Definition at line 2963 of file t4_hw.c.
References region, tag, VPD_INFO_FLD_HDR_SIZE, VPD_LEN, t4_vpdr_hdr::vpdr_len, and t4_vpdr_hdr::vpdr_tag.
Referenced by get_vpd_params().
|
static |
get_vpd_params - read VPD parameters from VPD EEPROM @adapter: adapter to read : where to store the parameters @vpd: caller provided temporary space to read the VPD into
Reads card parameters stored in VPD EEPROM.
Definition at line 3007 of file t4_hw.c.
References CH_ERR, CHELSIO_VPD_UNIQUE_ID, vpd_params::ec, EC_LEN, FIND_VPD_KW, get_vpd_keyword_val(), vpd_params::id, ID_LEN, MACADDR_LEN, vpd_params::md, MD_LEN, vpd_params::na, vpd_params::pn, PN_LEN, SERNUM_LEN, vpd_params::sn, strstrip(), t4_seeprom_read(), VPD_BASE, VPD_BASE_OLD, VPD_INFO_FLD_HDR_SIZE, and VPD_LEN.
Referenced by t4_prep_adapter().
|
static |
Definition at line 8940 of file t4_hw.c.
References fw_port_cmd::fw_port::fw_port_info::acap, link_config::acaps, fw_port_cmd::fw_port::fw_port_info32::acaps32, port_info::adapter, be16_to_cpu, be32_to_cpu, CH_ERR, F_FW_PORT_CMD_LSTATUS, F_FW_PORT_CMD_LSTATUS32, F_FW_PORT_CMD_MDIOCAP, F_FW_PORT_CMD_MDIOCAP32, link_config::fc, link_config::fec, link_config::fec_hint, FW_PORT_ACTION_GET_PORT_INFO, FW_PORT_ACTION_GET_PORT_INFO32, FW_PORT_CAP32_FC_RX, FW_PORT_CAP32_FC_TX, FW_PORT_MOD_TYPE_NONE, fwcap_to_fec(), fwcap_to_speed(), fwcaps16_to_caps32(), G_FW_PORT_CMD_LINKDNRC, G_FW_PORT_CMD_LINKDNRC32, G_FW_PORT_CMD_MDIOADDR, G_FW_PORT_CMD_MDIOADDR32, G_FW_PORT_CMD_MODTYPE, G_FW_PORT_CMD_MODTYPE32, G_FW_PORT_CMD_PORTTYPE32, G_FW_PORT_CMD_PTYPE, fw_port_cmd::fw_port::info, fw_port_cmd::fw_port::info32, port_info::link_cfg, link_config::link_down_rc, link_config::link_ok, fw_port_cmd::fw_port::fw_port_info32::linkattr32, fw_port_cmd::fw_port::fw_port_info::lpacap, link_config::lpacaps, fw_port_cmd::fw_port::fw_port_info32::lpacaps32, fw_port_cmd::fw_port::fw_port_info32::lstatus32_to_cbllen32, lstatus_to_fwcap(), fw_port_cmd::fw_port::fw_port_info::lstatus_to_modtype, port_info::mdio_addr, port_info::mod_type, PAUSE_RX, PAUSE_TX, fw_port_cmd::fw_port::fw_port_info::pcap, link_config::pcaps, fw_port_cmd::fw_port::fw_port_info32::pcaps32, port_info::port_type, link_config::speed, and fw_port_cmd::u.
Referenced by t4_handle_fw_rpl(), and t4_update_port_info().
|
static |
hash_mac_addr - return the hash value of a MAC address @addr: the 48-bit Ethernet MAC address
Hashes a MAC address according to the hash function used by HW inexact (hash) address matching.
Definition at line 5538 of file t4_hw.c.
Referenced by t4_alloc_mac_filt().
|
inlinestatic |
Definition at line 9689 of file t4_hw.c.
References S_FCOE, and S_FRAGMENTATION.
Referenced by read_filter_mode_and_ingress_config().
|
static |
init_cong_ctrl - initialize congestion control parameters : the alpha values for congestion control : the beta values for congestion control
Initialize the congestion control parameters.
Definition at line 6392 of file t4_hw.c.
Referenced by t4_prep_adapter().
Definition at line 4060 of file t4_hw.c.
Referenced by t4_show_intr_info().
Definition at line 4821 of file t4_hw.c.
References A_LE_DB_INT_CAUSE, A_LE_DB_INT_ENABLE, CHELSIO_T5, chip_id(), intr_info::details, F_ACTRGNFULL, F_CLCAMFIFOERR, F_CLIPSUBERR, F_CMDPRSRINTERR, F_CMDTIDERR, F_CTCAMINVLDENT, F_HASHTBLACCFAIL, F_LIP0, F_LIPMISS, F_PARITYERR, F_REQQPARERR, F_T6_ACTCNTIPV4TZERO, F_T6_ACTCNTIPV4ZERO, F_T6_ACTCNTIPV6TZERO, F_T6_ACTCNTIPV6ZERO, F_T6_ACTRGNFULL, F_T6_LIP0, F_T6_LIPMISS, F_T6_UNKNOWNCMD, F_TCAMACCFAIL, F_TCAMINVLDENT, F_TOTCNTERR, F_UNKNOWNCMD, intr_info::fatal, intr_info::name, NONFATAL_IF_DISABLED, t4_handle_intr(), T5_LE_FATAL_MASK, T6_LE_FATAL_MASK, and T6_LE_PERRCRC_MASK.
Referenced by t4_slow_intr_handler().
|
static |
lstatus_to_fwcap - translate old lstatus to 32-bit Port Capabilities @lstatus: old FW_PORT_ACTION_GET_PORT_INFO lstatus value
Translates old FW_PORT_ACTION_GET_PORT_INFO lstatus field into new 32-bit Port Capabilities value.
Definition at line 8906 of file t4_hw.c.
References F_FW_PORT_CMD_RXPAUSE, F_FW_PORT_CMD_TXPAUSE, FW_PORT_CAP32_FC_RX, FW_PORT_CAP32_FC_TX, FW_PORT_CAP32_SPEED_100G, FW_PORT_CAP32_SPEED_100M, FW_PORT_CAP32_SPEED_10G, FW_PORT_CAP32_SPEED_1G, FW_PORT_CAP32_SPEED_25G, FW_PORT_CAP32_SPEED_40G, FW_PORT_CAP_SPEED_100G, FW_PORT_CAP_SPEED_100M, FW_PORT_CAP_SPEED_10G, FW_PORT_CAP_SPEED_1G, FW_PORT_CAP_SPEED_25G, FW_PORT_CAP_SPEED_40G, and V_FW_PORT_CMD_LSPEED.
Referenced by handle_port_info().
Definition at line 5110 of file t4_hw.c.
References A_MA_INT_CAUSE, A_MA_INT_ENABLE, A_MA_PARITY_ERROR_ENABLE1, A_MA_PARITY_ERROR_ENABLE2, A_MA_PARITY_ERROR_STATUS1, A_MA_PARITY_ERROR_STATUS2, CHELSIO_T4, chip_id(), F_MEM_PERR_INT_CAUSE, F_MEM_TO_INT_CAUSE, F_MEM_WRAP_INT_CAUSE, intr_info::fatal, ma_wrap_status(), intr_info::name, NONFATAL_IF_DISABLED, and t4_handle_intr().
Referenced by t4_slow_intr_handler().
Definition at line 5093 of file t4_hw.c.
References A_MA_INT_WRAP_STATUS, CH_ALERT, G_MEM_WRAP_ADDRESS, G_MEM_WRAP_CLIENT_NUM, t4_read_reg(), and t4_write_reg().
Referenced by ma_intr_handler().
Definition at line 5207 of file t4_hw.c.
References A_MAC_PORT_INT_CAUSE, A_MAC_PORT_INT_EN, A_MAC_PORT_PERR_INT_CAUSE, A_MAC_PORT_PERR_INT_CAUSE_100G, A_MAC_PORT_PERR_INT_EN, A_MAC_PORT_PERR_INT_EN_100G, A_XGMAC_PORT_INT_CAUSE, A_XGMAC_PORT_INT_EN, intr_info::actions, intr_info::cause_reg, CHELSIO_T5, CHELSIO_T6, chip_id(), intr_info::details, intr_info::enable_reg, F_RXFIFO_PRTY_ERR, F_TXFIFO_PRTY_ERR, intr_info::fatal, intr_info::flags, is_t4(), intr_info::name, port, PORT_REG, t4_handle_intr(), and T5_PORT_REG.
Referenced by t4_slow_intr_handler().
Definition at line 5020 of file t4_hw.c.
References A_EDC_ECC_STATUS, A_EDC_INT_CAUSE, A_EDC_INT_ENABLE, A_MC_ECC_STATUS, A_MC_INT_CAUSE, A_MC_INT_ENABLE, A_MC_P_ECC_STATUS, A_MC_P_INT_CAUSE, A_MC_P_INT_ENABLE, intr_info::cause_reg, CH_ALERT, CH_WARN_RATELIMIT, EDC_REG, intr_info::enable_reg, F_ECC_CE_INT_CAUSE, F_ECC_UE_INT_CAUSE, F_PERR_INT_CAUSE, intr_info::fatal, G_ECC_CECNT, G_ECC_UECNT, is_t4(), MC_REG, MEM_EDC0, MEM_EDC1, MEM_MC0, MEM_MC1, intr_info::name, t4_edc_err_read(), t4_handle_intr(), t4_read_reg(), and t4_write_reg().
Referenced by t4_slow_intr_handler().
|
static |
Definition at line 10623 of file t4_hw.c.
References legacy_pci_expansion_rom_header::cksum, pcir_data_structure::code_type, pcir_data_structure::device_id, pcir_data_structure::indicator, le16_to_cpu, legacy_pci_expansion_rom_header::pcir_offset, and legacy_pci_expansion_rom_header::size512.
Referenced by t4_load_boot().
Definition at line 4877 of file t4_hw.c.
References A_MPS_CLS_INT_CAUSE, A_MPS_CLS_INT_ENABLE, A_MPS_INT_CAUSE, A_MPS_RX_PERR_INT_CAUSE, A_MPS_RX_PERR_INT_ENABLE, A_MPS_STAT_PERR_INT_CAUSE_RX_FIFO, A_MPS_STAT_PERR_INT_CAUSE_SRAM, A_MPS_STAT_PERR_INT_CAUSE_SRAM1, A_MPS_STAT_PERR_INT_CAUSE_TX_FIFO, A_MPS_STAT_PERR_INT_ENABLE_RX_FIFO, A_MPS_STAT_PERR_INT_ENABLE_SRAM, A_MPS_STAT_PERR_INT_ENABLE_SRAM1, A_MPS_STAT_PERR_INT_ENABLE_TX_FIFO, A_MPS_TRC_INT_CAUSE, A_MPS_TRC_INT_ENABLE, A_MPS_TX_INT_CAUSE, A_MPS_TX_INT_ENABLE, CHELSIO_T4, chip_id(), F_BUBBLE, F_FRMERR, F_HASHSRAM, F_MATCHSRAM, F_MATCHTCAM, F_MISCPERR, F_NCSIFIFO, F_PORTERR, F_SECNTERR, intr_info::fatal, is_t4(), M_FILTMEM, M_PKTFIFO, M_TPFIFO, M_TXDATAFIFO, M_TXDESCFIFO, intr_info::name, NONFATAL_IF_DISABLED, t4_handle_intr(), t4_read_reg(), t4_write_reg(), V_FILTMEM, V_PKTFIFO, V_TPFIFO, V_TXDATAFIFO, and V_TXDESCFIFO.
Referenced by t4_slow_intr_handler().
Definition at line 5181 of file t4_hw.c.
References A_NCSI_INT_CAUSE, A_NCSI_INT_ENABLE, F_CIM_DM_PRTY_ERR, F_MPS_DM_PRTY_ERR, F_RXFIFO_PRTY_ERR, F_TXFIFO_PRTY_ERR, intr_info::name, and t4_handle_intr().
Referenced by t4_slow_intr_handler().
Definition at line 4145 of file t4_hw.c.
References A_PCIE_CORE_UTL_PCI_EXPRESS_PORT_INTERRUPT_ENABLE, A_PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS, A_PCIE_CORE_UTL_SYSTEM_BUS_AGENT_INTERRUPT_ENABLE, A_PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS, A_PCIE_INT_CAUSE, A_PCIE_INT_ENABLE, intr_info::details, F_CCNTPERR, F_CFGSNPPERR, F_CREQPERR, F_CREQRDPERR, F_CRSPPERR, F_DCNTPERR, F_DREQPERR, F_DREQRDPERR, F_DRSPPERR, F_FIDPERR, F_HCNTPERR, F_HREQPERR, F_HREQRDPERR, F_HREQWRPERR, F_HRSPPERR, F_INTXCLRPERR, F_IPGRPPERR, F_IPRETRYPERR, F_IPRXDATAGRPPERR, F_IPRXHDRGRPPERR, F_IPSOTPERR, F_MAGRPPERR, F_MATAGPERR, F_MSIADDRHPERR, F_MSIADDRLPERR, F_MSIDATAPERR, F_MSIXADDRHPERR, F_MSIXADDRLPERR, F_MSIXDATAPERR, F_MSIXDIPERR, F_MSIXSTIPERR, F_MSTGRPPERR, F_MSTTAGQPERR, F_MSTTIMEOUTPERR, F_NONFATALERR, F_OTDD, F_PCIEPINT, F_PCIESINT, F_PIOCPLGRPPERR, F_PIOCPLPERR, F_PIOREQGRPPERR, F_PIOREQPERR, F_PIOTAGPERR, F_PIOTAGQPERR, F_RCAP, F_RCCP, F_RCIP, F_RDPE, F_READRSPERR, F_RFTP, F_RNPP, F_RPCP, F_RPLPERR, F_RXCPLPERR, F_RXWRPERR, F_TARTAGPERR, F_TCAP, F_TCIP, F_TDUE, F_TFTP, F_TGTTAGQPERR, F_TNPP, F_TPCP, F_TRGT1GRPPERR, F_UNXSPLCPLERR, F_VFIDPERR, intr_info::fatal, is_t4(), intr_info::name, NONFATAL_IF_DISABLED, and t4_handle_intr().
Referenced by t4_slow_intr_handler().
Definition at line 5266 of file t4_hw.c.
References A_PL_PL_INT_CAUSE, A_PL_PL_INT_ENABLE, F_FATALPERR, F_PERRVFID, intr_info::name, NONFATAL_IF_DISABLED, and t4_handle_intr().
Referenced by t4_slow_intr_handler().
Definition at line 4739 of file t4_hw.c.
References A_PM_RX_INT_CAUSE, A_PM_RX_INT_ENABLE, F_BUNDLE_LEN_OVFL, F_BUNDLE_LEN_PARERR, F_DB_OPTIONS_PAR_ERROR, F_E_PCMD_PAR_ERROR, F_IESPI_PAR_ERROR, F_MA_INTF_SDC_ERR, F_OCSPI_PAR_ERROR, F_SDC_ERR, F_ZERO_E_CMD_ERROR, intr_info::name, NONFATAL_IF_DISABLED, and t4_handle_intr().
Referenced by t4_slow_intr_handler().
Definition at line 4682 of file t4_hw.c.
References A_PM_TX_DBG_CTRL, A_PM_TX_DBG_DATA, A_PM_TX_DBG_STAT0, ARRAY_SIZE, CH_ALERT, and t4_read_indirect().
Referenced by pmtx_intr_handler().
Definition at line 4700 of file t4_hw.c.
References A_PM_TX_INT_CAUSE, A_PM_TX_INT_ENABLE, F_C_PCMD_PAR_ERROR, F_DB_OPTIONS_PAR_ERROR, F_ICSPI_PAR_ERROR, F_OESPI_PAR_ERROR, F_PCMD_LEN_OVFL0, F_PCMD_LEN_OVFL1, F_PCMD_LEN_OVFL2, F_ZERO_C_CMD_ERROR, intr_info::name, pmtx_dump_dbg_stats(), and t4_handle_intr().
Referenced by t4_slow_intr_handler().
Definition at line 5707 of file t4_hw.c.
References A_TP_RSS_LKP_TABLE, F_LKPTBLROWVLD, t4_wait_op_done_val(), and t4_write_reg().
Referenced by t4_read_rss().
|
static |
Definition at line 9713 of file t4_hw.c.
References A_TP_INGRESS_CONFIG, A_TP_VLAN_PRI_MAP, CHELSIO_T4, chip_id(), tp_params::ethertype_shift, F_ETHERTYPE, F_FCOE, F_FRAGMENTATION, F_MACMATCH, F_MPSHITTYPE, F_PORT, F_PROTOCOL, F_TOS, F_VLAN, F_VNIC, F_VNIC_ID, tp_params::fcoe_shift, tp_params::filter_mask, tp_params::filter_mode, tp_params::frag_shift, FW_PARAM_DEV_FILTER_MODE_MASK, FW_PARAM_DEV_FILTER_VNIC_MODE, FW_PARAMS_MNEM_DEV, FW_PARAMS_PARAM_DEV_FILTER, FW_VNIC_MODE_OUTER_VLAN, FW_VNIC_MODE_PF_VF, G_FW_PARAMS_PARAM_FILTER_MASK, G_FW_PARAMS_PARAM_FILTER_MODE, hashmask_to_filtermask(), LE_HASH_MASK_GEN_IPV4T5, tp_params::macmatch_shift, tp_params::matchtype_shift, adapter::mbox, adapter::params, adapter::pf, tp_params::port_shift, tp_params::protocol_shift, t4_filter_field_shift(), t4_query_params(), t4_read_reg(), t4_tp_pio_read(), tp_params::tos_shift, adapter_params::tp, V_FW_PARAMS_MNEM, V_FW_PARAMS_PARAM_X, V_FW_PARAMS_PARAM_Y, tp_params::vlan_shift, tp_params::vnic_mode, and tp_params::vnic_shift.
Referenced by t4_init_tp_params(), and t4_set_filter_cfg().
|
static |
Definition at line 266 of file t4_hw.c.
References for_each_port, and read_tx_state_one().
Referenced by t4_wr_mbox_meat_timeout().
|
static |
Definition at line 249 of file t4_hw.c.
References A_MPS_PORT_STAT_RX_PORT_PAUSE_L, A_MPS_PORT_STAT_TX_PORT_FRAMES_L, is_t4(), PORT_REG, port_tx_state::rx_pause, t4_read_reg64(), T5_PORT_REG, and port_tx_state::tx_frames.
Referenced by check_tx_state(), and read_tx_state().
Definition at line 9256 of file t4_hw.c.
References PCI_CAP_ID_EXP, PCI_EXP_DEVCTL2, t4_os_find_pci_capability(), t4_os_pci_read_cfg2(), and t4_os_pci_write_cfg2().
Referenced by t4_prep_adapter().
|
static |
sf1_read - read data from the serial flash @adapter: the adapter @byte_cnt: number of bytes to read @cont: whether another operation will be chained @lock: whether to lock SF for PL access only @valp: where to store the read data
Reads up to 4 bytes of data from the serial flash. The location of the read needs to be specified prior to calling this by issuing the appropriate commands to the serial flash.
Definition at line 3117 of file t4_hw.c.
References A_SF_DATA, A_SF_OP, F_BUSY, SF_ATTEMPTS, t4_read_reg(), t4_wait_op_done(), t4_write_reg(), V_BYTECNT, V_CONT, and V_SF_LOCK.
Referenced by flash_wait_op(), t4_get_flash_params(), and t4_read_flash().
|
static |
sf1_write - write data to the serial flash @adapter: the adapter @byte_cnt: number of bytes to write @cont: whether another operation will be chained @lock: whether to lock SF for PL access only @val: value to write
Writes up to 4 bytes of data to the serial flash. The location of the write needs to be specified prior to calling this by issuing the appropriate commands to the serial flash.
Definition at line 3146 of file t4_hw.c.
References A_SF_DATA, A_SF_OP, F_BUSY, SF_ATTEMPTS, t4_read_reg(), t4_wait_op_done(), t4_write_reg(), V_BYTECNT, V_CONT, V_OP, and V_SF_LOCK.
Referenced by flash_wait_op(), t4_flash_erase_sectors(), t4_get_flash_params(), t4_read_flash(), and t4_write_flash().
Definition at line 4303 of file t4_hw.c.
References A_SGE_ERROR_STATS, A_SGE_INT_CAUSE1, A_SGE_INT_CAUSE2, A_SGE_INT_CAUSE3, A_SGE_INT_CAUSE4, A_SGE_INT_CAUSE5, A_SGE_INT_CAUSE6, A_SGE_INT_ENABLE1, A_SGE_INT_ENABLE2, A_SGE_INT_ENABLE3, A_SGE_INT_ENABLE4, A_SGE_INT_ENABLE5, A_SGE_INT_ENABLE6, CH_ERR, CHELSIO_T5, CHELSIO_T6, chip_id(), intr_info::details, F_DBFIFO_HP_INT, F_DBFIFO_LP_INT, F_DBP_TBUF_FULL, F_EGRESS_SIZE_ERR, F_ERR_BAD_DB_PIDX0, F_ERR_BAD_DB_PIDX1, F_ERR_BAD_DB_PIDX2, F_ERR_BAD_DB_PIDX3, F_ERR_CPL_EXCEED_IQE_SIZE, F_ERR_CPL_OPCODE_0, F_ERR_DATA_CPL_ON_HIGH_QID0, F_ERR_DATA_CPL_ON_HIGH_QID1, F_ERR_DROPPED_DB, F_ERR_EGR_CTXT_PRIO, F_ERR_FLM_DBP, F_ERR_FLM_HINT, F_ERR_FLM_IDMA0, F_ERR_FLM_IDMA1, F_ERR_ING_CTXT_PRIO, F_ERR_ING_PCIE_CHAN, F_ERR_INVALID_CIDX_INC, F_ERR_ITP_TIME_PAUSED, F_ERR_PCIE_ERROR0, F_ERR_PCIE_ERROR1, F_ERR_PCIE_ERROR2, F_ERR_PCIE_ERROR3, F_ERR_TIMER_ABOVE_MAX_QID, F_ERROR_QID_VALID, F_FATAL_WRE_LEN, F_INGRESS_SIZE_ERR, F_REG_ADDRESS_ERR, F_UNCAPTURED_ERROR, intr_info::fatal, G_ERROR_QID, intr_info::name, NONFATAL_IF_DISABLED, t4_handle_intr(), t4_read_reg(), and t4_write_reg().
Referenced by t4_slow_intr_handler().
Definition at line 5157 of file t4_hw.c.
References A_SMB_INT_CAUSE, A_SMB_INT_ENABLE, F_MSTRXFIFOPARINT, F_MSTTXFIFOPARINT, F_SLVFIFOPARINT, intr_info::name, and t4_handle_intr().
Referenced by t4_slow_intr_handler().
uint32_t speed_to_fwcap | ( | unsigned int | speed | ) |
Definition at line 8850 of file t4_hw.c.
References TEST_SPEED_RETURN.
Referenced by cxgbe_media_status(), fixup_link_config(), set_current_media(), and t4_link_l1cfg().
int t4_add_mac | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | viid, | ||
int | idx, | ||
const u8 * | addr, | ||
bool | persist, | ||
u8 * | smt_idx, | ||
bool | smac | ||
) |
t4_add_mac - Adds an exact-match filter for a MAC address @adap: the adapter @mbox: mailbox to use for the FW command @viid: the VI id @idx: index of existing filter for old value of MAC address, or -1 @addr: the new MAC address value @persist: whether a new MAC allocation should be persistent @add_smt: if true also add the address to the HW SMT @smac: if true, update only the smac region of MPS
Modifies an exact-match filter and sets it to the new MAC address if @idx >= 0, or adds the MAC address to a new filter if @idx < 0. In the latter case the address is added persistently if @persist is true.
Returns a negative error number or the index of the filter with the new MAC value. Note that this index may differ from @idx.
Definition at line 11539 of file t4_hw.c.
References be16_to_cpu, be32_to_cpu, CHELSIO_T5, chip_id(), adapter::chip_params, cpu_to_be16, cpu_to_be32, fw_vi_mac_cmd::fw_vi_mac::exact, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, F_FW_VI_MAC_CMD_IS_SMAC, F_FW_VI_MAC_CMD_VALID, fw_vi_mac_cmd::freemacs_to_len16, FW_VI_MAC_ADD_MAC, FW_VI_MAC_ADD_PERSIST_MAC, FW_VI_MAC_CMD, FW_VI_MAC_MPS_TCAM_ENTRY, FW_VI_MAC_SMT_AND_MPSTCAM, G_FW_VI_MAC_CMD_IDX, G_FW_VI_MAC_CMD_SMTID, M_FW_VIID_VIN, chip_params::mps_tcam_size, fw_vi_mac_cmd::op_to_viid, adapter::params, t4_wr_mbox(), fw_vi_mac_cmd::u, V_FW_CMD_LEN16, V_FW_CMD_OP, V_FW_VI_MAC_CMD_IDX, V_FW_VI_MAC_CMD_SMAC_RESULT, V_FW_VI_MAC_CMD_VIID, and adapter_params::viid_smt_extn_support.
int t4_alloc_encap_mac_filt | ( | struct adapter * | adap, |
unsigned int | viid, | ||
const u8 * | addr, | ||
const u8 * | mask, | ||
unsigned int | vni, | ||
unsigned int | vni_mask, | ||
u8 | dip_hit, | ||
u8 | lookup_type, | ||
bool | sleep_ok | ||
) |
t4_alloc_encap_mac_filt - Adds a mac entry in mps tcam with VNI support @adap: the adapter @viid: the VI id @mac: the MAC address @mask: the mask @vni: the VNI id for the tunnel protocol @vni_mask: mask for the VNI id @dip_hit: to enable DIP match for the MPS entry @lookup_type: MAC address for inner (1) or outer (0) header @sleep_ok: call is allowed to sleep
Allocates an MPS entry with specified MAC address and VNI value.
Returns a negative error number or the allocated index for this mac.
Definition at line 8128 of file t4_hw.c.
References be16_to_cpu, cpu_to_be16, cpu_to_be32, fw_vi_mac_cmd::fw_vi_mac::exact_vni, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, F_FW_VI_MAC_CMD_VALID, fw_vi_mac_cmd::freemacs_to_len16, FW_VI_MAC_ADD_MAC, FW_VI_MAC_CMD, FW_VI_MAC_TYPE_EXACTMAC_VNI, G_FW_VI_MAC_CMD_IDX, adapter::mbox, fw_vi_mac_cmd::op_to_viid, t4_wr_mbox_meat(), fw_vi_mac_cmd::u, V_FW_CMD_LEN16, V_FW_CMD_OP, V_FW_VI_MAC_CMD_DIP_HIT, V_FW_VI_MAC_CMD_ENTRY_TYPE, V_FW_VI_MAC_CMD_IDX, V_FW_VI_MAC_CMD_LOOKUP_TYPE, V_FW_VI_MAC_CMD_VIID, V_FW_VI_MAC_CMD_VNI, and V_FW_VI_MAC_CMD_VNI_MASK.
int t4_alloc_mac_filt | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | viid, | ||
bool | free, | ||
unsigned int | naddr, | ||
const u8 ** | addr, | ||
u16 * | idx, | ||
u64 * | hash, | ||
bool | sleep_ok | ||
) |
t4_alloc_mac_filt - allocates exact-match filters for MAC addresses @adap: the adapter @mbox: mailbox to use for the FW command @viid: the VI id @free: if true any existing filters for this VI id are first removed @naddr: the number of MAC addresses to allocate filters for (up to 7) @addr: the MAC address(es) @idx: where to store the index of each allocated filter @hash: pointer to hash address filter bitmap @sleep_ok: call is allowed to sleep
Allocates an exact-match filter for each of the supplied addresses and sets it to the corresponding address. If @idx is not NULL it should have at least @naddr entries, each of which will be set to the index of the filter allocated for the corresponding MAC address. If a filter could not be allocated for an address its index is set to 0xffff. If @hash is not NULL addresses that fail to allocate an exact filter are hashed and update the hash filter bitmap pointed at by @hash.
Returns a negative error number or the number of filters allocated.
Definition at line 8239 of file t4_hw.c.
References ARRAY_SIZE, be16_to_cpu, adapter::chip_params, cpu_to_be16, cpu_to_be32, DIV_ROUND_UP, fw_vi_mac_cmd::fw_vi_mac::exact, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, F_FW_VI_MAC_CMD_VALID, fw_vi_mac_cmd::freemacs_to_len16, FW_ENOMEM, FW_VI_MAC_ADD_MAC, FW_VI_MAC_CMD, G_FW_VI_MAC_CMD_IDX, hash_mac_addr(), chip_params::mps_tcam_size, fw_vi_mac_cmd::op_to_viid, t4_wr_mbox_meat(), fw_vi_mac_cmd::u, V_FW_CMD_EXEC, V_FW_CMD_LEN16, V_FW_CMD_OP, V_FW_VI_MAC_CMD_FREEMACS, V_FW_VI_MAC_CMD_IDX, and V_FW_VI_MAC_CMD_VIID.
Referenced by add_maddr(), and update_mac_settings().
int t4_alloc_raw_mac_filt | ( | struct adapter * | adap, |
unsigned int | viid, | ||
const u8 * | addr, | ||
const u8 * | mask, | ||
unsigned int | idx, | ||
u8 | lookup_type, | ||
u8 | port_id, | ||
bool | sleep_ok | ||
) |
t4_alloc_raw_mac_filt - Adds a mac entry in mps tcam @adap: the adapter @viid: the VI id @mac: the MAC address @mask: the mask @idx: index at which to add this entry @port_id: the port index @lookup_type: MAC address for inner (1) or outer (0) header @sleep_ok: call is allowed to sleep
Adds the mac entry at the specified index using raw mac interface.
Returns a negative error number or the allocated index for this mac.
Definition at line 8176 of file t4_hw.c.
References be32_to_cpu, cpu_to_be32, cpu_to_be64, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, fw_vi_mac_cmd::freemacs_to_len16, FW_VI_MAC_CMD, FW_VI_MAC_TYPE_RAW, G_FW_VI_MAC_CMD_RAW_IDX, M_DATALKPTYPE, M_DATAPORTNUM, adapter::mbox, fw_vi_mac_cmd::op_to_viid, fw_vi_mac_cmd::fw_vi_mac::raw, t4_wr_mbox_meat(), fw_vi_mac_cmd::u, V_DATALKPTYPE, V_DATAPORTNUM, V_FW_CMD_LEN16, V_FW_CMD_OP, V_FW_VI_MAC_CMD_ENTRY_TYPE, V_FW_VI_MAC_CMD_RAW_IDX, and V_FW_VI_MAC_CMD_VIID.
Referenced by enable_vxlan_rx(), and update_mac_settings().
int t4_alloc_vi | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | port, | ||
unsigned int | pf, | ||
unsigned int | vf, | ||
unsigned int | nmac, | ||
u8 * | mac, | ||
u16 * | rss_size, | ||
uint8_t * | vfvld, | ||
uint16_t * | vin | ||
) |
t4_alloc_vi - allocate an [Ethernet Function] virtual interface @adap: the adapter @mbox: mailbox to use for the FW command @port: physical port associated with the VI @pf: the PF owning the VI @vf: the VF owning the VI @nmac: number of MAC addresses needed (1 to 5) @mac: the MAC addresses of the VI @rss_size: size of RSS table slice associated with this VI
backwards compatible and convieniance routine to allocate a Virtual Interface with a Ethernet Port Application Function and Intrustion Detection System disabled.
Definition at line 8031 of file t4_hw.c.
References FW_VI_FUNC_ETH, fw_vi_cmd::mac, fw_vi_cmd::nmac, port, and t4_alloc_vi_func().
Referenced by t4_port_init().
int t4_alloc_vi_func | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | port, | ||
unsigned int | pf, | ||
unsigned int | vf, | ||
unsigned int | nmac, | ||
u8 * | mac, | ||
u16 * | rss_size, | ||
uint8_t * | vfvld, | ||
uint16_t * | vin, | ||
unsigned int | portfunc, | ||
unsigned int | idstype | ||
) |
t4_alloc_vi_func - allocate a virtual interface @adap: the adapter @mbox: mailbox to use for the FW command @port: physical port associated with the VI @pf: the PF owning the VI @vf: the VF owning the VI @nmac: number of MAC addresses needed (1 to 5) @mac: the MAC addresses of the VI @rss_size: size of RSS table slice associated with this VI @portfunc: which Port Application Function MAC Address is desired @idstype: Intrusion Detection Type
Allocates a virtual interface for the given physical port. If @mac is not NULL it contains the MAC addresses of the VI as assigned by FW. If @rss_size is NULL the VI is not assigned any RSS slice by FW. @mac should be large enough to hold @nmac Ethernet addresses, they are stored consecutively so the space needed is @nmac * 6 bytes. Returns a negative error number or the non-negative VI id.
Definition at line 7961 of file t4_hw.c.
References fw_vi_cmd::alloc_to_len16, be16_to_cpu, be32_to_cpu, cpu_to_be16, cpu_to_be32, F_FW_CMD_EXEC, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, F_FW_VI_CMD_ALLOC, F_FW_VI_CMD_NORSS, FW_LEN16, FW_VI_CMD, G_FW_VI_CMD_RSSSIZE, G_FW_VI_CMD_VFVLD, G_FW_VI_CMD_VIID, G_FW_VI_CMD_VIN, G_FW_VIID_VIN, G_FW_VIID_VIVLD, fw_vi_cmd::mac, fw_vi_cmd::nmac, fw_vi_cmd::nmac0, fw_vi_cmd::nmac1, fw_vi_cmd::nmac2, fw_vi_cmd::nmac3, fw_vi_cmd::norss_rsssize, fw_vi_cmd::op_to_vfn, adapter::params, port, fw_vi_cmd::portid_pkd, t4_wr_mbox(), fw_vi_cmd::type_to_viid, V_FW_CMD_OP, V_FW_VI_CMD_FUNC, V_FW_VI_CMD_PFN, V_FW_VI_CMD_PORTID, V_FW_VI_CMD_TYPE, V_FW_VI_CMD_VFN, and adapter_params::viid_smt_extn_support.
Referenced by alloc_extra_vi(), and t4_alloc_vi().
int t4_bar2_sge_qregs | ( | struct adapter * | adapter, |
unsigned int | qid, | ||
enum t4_bar2_qtype | qtype, | ||
int | user, | ||
u64 * | pbar2_qoffset, | ||
unsigned int * | pbar2_qid | ||
) |
t4_bar2_sge_qregs - return BAR2 SGE Queue register information @adapter: the adapter @qid: the Queue ID @qtype: the Ingress or Egress type for @qid @user: true if this request is for a user mode queue @pbar2_qoffset: BAR2 Queue Offset @pbar2_qid: BAR2 Queue ID or 0 for Queue ID inferred SGE Queues
Returns the BAR2 SGE Queue Registers information associated with the indicated Absolute Queue ID. These are passed back in return value pointers. @qtype should be T4_BAR2_QTYPE_EGRESS for Egress Queue and T4_BAR2_QTYPE_INGRESS for Ingress Queues.
This may return an error which indicates that BAR2 SGE Queue registers aren't available. If an error is not returned, then the following values are returned:
*@pbar2_qoffset: the BAR2 Offset of the @qid Registers *@pbar2_qid: the BAR2 SGE Queue ID or 0 of @qid
If the returned BAR2 Queue ID is 0, then BAR2 SGE registers which require the "Inferred Queue ID" ability may be used. E.g. the Write Combining Doorbell Buffer. If the BAR2 Queue ID is not 0, then these "Inferred Queue ID" register may not be used.
Definition at line 9464 of file t4_hw.c.
References sge_params::eq_s_qpp, sge_params::iq_s_qpp, is_t4(), sge_params::page_shift, adapter::params, adapter_params::sge, SGE_UDB_SIZE, and T4_BAR2_QTYPE_EGRESS.
int t4_cfg_pfvf | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | pf, | ||
unsigned int | vf, | ||
unsigned int | txq, | ||
unsigned int | txq_eth_ctrl, | ||
unsigned int | rxqi, | ||
unsigned int | rxq, | ||
unsigned int | tc, | ||
unsigned int | vi, | ||
unsigned int | cmask, | ||
unsigned int | pmask, | ||
unsigned int | nexact, | ||
unsigned int | rcaps, | ||
unsigned int | wxcaps | ||
) |
t4_cfg_pfvf - configure PF/VF resource limits @adap: the adapter @mbox: mailbox to use for the FW command @pf: the PF being configured @vf: the VF being configured @txq: the max number of egress queues @txq_eth_ctrl: the max number of egress Ethernet or control queues @rxqi: the max number of interrupt-capable ingress queues @rxq: the max number of interruptless ingress queues @tc: the PCI traffic class @vi: the max number of virtual interfaces @cmask: the channel access rights mask for the PF/VF @pmask: the port access rights mask for the PF/VF @nexact: the maximum number of exact MPS filters @rcaps: read capabilities @wxcaps: write/execute capabilities
Configures resource limits and capabilities for a physical or virtual function.
Definition at line 7914 of file t4_hw.c.
References cpu_to_be32, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, FW_LEN16, FW_PFVF_CMD, fw_pfvf_cmd::niqflint_niq, fw_pfvf_cmd::op_to_vfn, fw_pfvf_cmd::r_caps_to_nethctrl, fw_pfvf_cmd::retval_len16, rxq, t4_wr_mbox(), fw_pfvf_cmd::tc_to_nexactf, fw_pfvf_cmd::type_to_neq, V_FW_CMD_OP, V_FW_PFVF_CMD_CMASK, V_FW_PFVF_CMD_NEQ, V_FW_PFVF_CMD_NETHCTRL, V_FW_PFVF_CMD_NEXACTF, V_FW_PFVF_CMD_NIQ, V_FW_PFVF_CMD_NIQFLINT, V_FW_PFVF_CMD_NVI, V_FW_PFVF_CMD_PFN, V_FW_PFVF_CMD_PMASK, V_FW_PFVF_CMD_R_CAPS, V_FW_PFVF_CMD_TC, V_FW_PFVF_CMD_VFN, and V_FW_PFVF_CMD_WX_CAPS.
int t4_change_mac | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | viid, | ||
int | idx, | ||
const u8 * | addr, | ||
bool | persist, | ||
uint16_t * | smt_idx | ||
) |
t4_change_mac - modifies the exact-match filter for a MAC address @adap: the adapter @mbox: mailbox to use for the FW command @viid: the VI id @idx: index of existing filter for old value of MAC address, or -1 @addr: the new MAC address value @persist: whether a new MAC allocation should be persistent @smt_idx: add MAC to SMT and return its index, or NULL
Modifies an exact-match filter and sets it to the new MAC address if @idx >= 0, or adds the MAC address to a new filter if @idx < 0. In the latter case the address is added persistently if @persist is true.
Note that in general it is not possible to modify the value of a given filter so the generic way to modify an address filter is to free the one being used by the old address value and allocate a new filter for the new address value.
Returns a negative error number or the index of the filter with the new MAC value. Note that this index may differ from @idx.
Definition at line 8494 of file t4_hw.c.
References be16_to_cpu, be32_to_cpu, CHELSIO_T5, chip_id(), adapter::chip_params, cpu_to_be16, cpu_to_be32, fw_vi_mac_cmd::fw_vi_mac::exact, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, F_FW_VI_MAC_CMD_VALID, fw_vi_mac_cmd::freemacs_to_len16, FW_VI_MAC_ADD_MAC, FW_VI_MAC_ADD_PERSIST_MAC, FW_VI_MAC_CMD, FW_VI_MAC_MPS_TCAM_ENTRY, FW_VI_MAC_SMT_AND_MPSTCAM, G_FW_VI_MAC_CMD_IDX, G_FW_VI_MAC_CMD_SMTID, M_FW_VIID_VIN, chip_params::mps_tcam_size, fw_vi_mac_cmd::op_to_viid, adapter::params, t4_wr_mbox(), fw_vi_mac_cmd::u, V_FW_CMD_LEN16, V_FW_CMD_OP, V_FW_VI_MAC_CMD_IDX, V_FW_VI_MAC_CMD_SMAC_RESULT, V_FW_VI_MAC_CMD_VIID, and adapter_params::viid_smt_extn_support.
Referenced by update_mac_settings().
int t4_cim_ctl_read | ( | struct adapter * | adap, |
unsigned int | addr, | ||
unsigned int | n, | ||
unsigned int * | valp | ||
) |
t4_cim_ctl_read - read a block from CIM control region @adap: the adapter @addr: the start address within the CIM control region
: number of words to read @valp: where to store the result
Reads a block of 4-byte words from the CIM control region.
Definition at line 10115 of file t4_hw.c.
References CIM_CTL_BASE, and t4_cim_read().
int t4_cim_read | ( | struct adapter * | adap, |
unsigned int | addr, | ||
unsigned int | n, | ||
unsigned int * | valp | ||
) |
t4_cim_read - read a block from CIM internal address space @adap: the adapter @addr: the start address within the CIM address space
: number of words to read @valp: where to store the result
Reads a block of 4-byte words from the CIM intenal address space.
Definition at line 10056 of file t4_hw.c.
References A_CIM_HOST_ACC_CTRL, A_CIM_HOST_ACC_DATA, F_HOSTBUSY, t4_read_reg(), t4_wait_op_done(), and t4_write_reg().
Referenced by collect_cim_la(), collect_cim_qcfg(), sbuf_cim_la(), sysctl_cim_qcfg(), t4_cim_ctl_read(), and t4_cim_read_la().
t4_cim_read_la - read CIM LA capture buffer @adap: the adapter @la_buf: where to store the LA data @wrptr: the HW write pointer within the capture buffer
Reads the contents of the CIM LA buffer with the most recent entry at the end of the returned data and with the entry at @wrptr first. We try to leave the LA in the running state we find it in.
Definition at line 10131 of file t4_hw.c.
References A_UP_UP_DBG_LA_CFG, A_UP_UP_DBG_LA_DATA, adapter_params::cim_la_size, F_UPDBGLAEN, F_UPDBGLARDEN, G_UPDBGLAWRPTR, is_t6(), M_UPDBGLARDPTR, adapter::params, r, t4_cim_read(), t4_cim_write1(), and V_UPDBGLARDPTR.
Referenced by collect_cim_la(), and sbuf_cim_la().
Definition at line 3716 of file t4_hw.c.
References A_CIM_DEBUGCFG, A_CIM_PI_LA_MADEBUGDATA, A_CIM_PO_LA_MADEBUGDATA, CIM_MALA_SIZE, F_LADBGEN, t4_read_reg(), t4_write_reg(), V_PILADBGRDPTR, and V_POLADBGRDPTR.
Referenced by collect_cim_ma_la(), and sysctl_cim_ma_la().
void t4_cim_read_pif_la | ( | struct adapter * | adap, |
u32 * | pif_req, | ||
u32 * | pif_rsp, | ||
unsigned int * | pif_req_wrptr, | ||
unsigned int * | pif_rsp_wrptr | ||
) |
Definition at line 3682 of file t4_hw.c.
References A_CIM_DEBUGCFG, A_CIM_DEBUGSTS, A_CIM_PI_LA_DEBUGDATA, A_CIM_PO_LA_DEBUGDATA, CIM_PIFLA_SIZE, F_LADBGEN, G_PILADBGWRPTR, G_POLADBGWRPTR, M_PILADBGRDPTR, M_POLADBGRDPTR, t4_read_reg(), t4_write_reg(), V_PILADBGRDPTR, and V_POLADBGRDPTR.
Referenced by collect_cim_pif_la(), and sysctl_cim_pif_la().
int t4_cim_write | ( | struct adapter * | adap, |
unsigned int | addr, | ||
unsigned int | n, | ||
const unsigned int * | valp | ||
) |
t4_cim_write - write a block into CIM internal address space @adap: the adapter @addr: the start address within the CIM address space
: number of words to write @valp: set of values to write
Writes a block of 4-byte words into the CIM intenal address space.
Definition at line 10083 of file t4_hw.c.
References A_CIM_HOST_ACC_CTRL, A_CIM_HOST_ACC_DATA, F_HOSTBUSY, F_HOSTWRITE, t4_read_reg(), t4_wait_op_done(), and t4_write_reg().
Referenced by t4_cim_write1().
|
static |
Definition at line 10100 of file t4_hw.c.
References t4_cim_write().
Referenced by t4_cim_read_la().
void t4_clr_port_stats | ( | struct adapter * | adap, |
int | idx | ||
) |
t4_clr_port_stats - clear port statistics @adap: the adapter @idx: the port index
Clear HW statistics for the given port.
Definition at line 11004 of file t4_hw.c.
References A_MPS_PORT_STAT_RX_PORT_BYTES_L, A_MPS_PORT_STAT_RX_PORT_LESS_64B_H, A_MPS_PORT_STAT_TX_PORT_BYTES_L, A_MPS_PORT_STAT_TX_PORT_PPP7_H, A_MPS_STAT_RX_BG_0_MAC_DROP_FRAME_L, A_MPS_STAT_RX_BG_0_MAC_TRUNC_FRAME_L, adap2pinfo(), is_t4(), port_info::mps_bg_map, PORT_BASE, t4_write_reg(), and T5_PORT_BASE.
Referenced by clear_stats().
int t4_config_glbl_rss | ( | struct adapter * | adapter, |
int | mbox, | ||
unsigned int | mode, | ||
unsigned int | flags | ||
) |
t4_config_glbl_rss - configure the global RSS mode @adapter: the adapter @mbox: mbox to use for the FW command @mode: global RSS mode @flags: mode-specific flags
Sets the global RSS mode.
Definition at line 5653 of file t4_hw.c.
References fw_rss_glb_config_cmd::fw_rss_glb_config::basicvirtual, cpu_to_be32, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, FW_LEN16, FW_RSS_GLB_CONFIG_CMD, FW_RSS_GLB_CONFIG_CMD_MODE_BASICVIRTUAL, FW_RSS_GLB_CONFIG_CMD_MODE_MANUAL, fw_rss_glb_config_cmd::fw_rss_glb_config::manual, fw_rss_glb_config_cmd::fw_rss_glb_config::fw_rss_glb_config_basicvirtual::mode_keymode, fw_rss_glb_config_cmd::fw_rss_glb_config::fw_rss_glb_config_manual::mode_pkd, fw_rss_glb_config_cmd::op_to_write, fw_rss_glb_config_cmd::retval_len16, fw_rss_glb_config_cmd::fw_rss_glb_config::fw_rss_glb_config_basicvirtual::synmapen_to_hashtoeplitz, t4_wr_mbox(), fw_rss_glb_config_cmd::u, V_FW_CMD_OP, and V_FW_RSS_GLB_CONFIG_CMD_MODE.
int t4_config_rss_range | ( | struct adapter * | adapter, |
int | mbox, | ||
unsigned int | viid, | ||
int | start, | ||
int | n, | ||
const u16 * | rspq, | ||
unsigned int | nrspq | ||
) |
t4_config_rss_range - configure a portion of the RSS mapping table @adapter: the adapter @mbox: mbox to use for the FW command @viid: virtual interface whose RSS subtable is to be written @start: start entry in the table to write
: how many table entries to write @rspq: values for the "response queue" (Ingress Queue) lookup table @nrspq: number of values in @rspq
Programs the selected part of the VI's RSS mapping table with the provided values. If @nrspq <
the supplied values are used repeatedly until the full table range is populated.
The caller must ensure the values in @rspq are in the range allowed for @viid.
Definition at line 5565 of file t4_hw.c.
References cpu_to_be16, cpu_to_be32, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, FW_LEN16, FW_RSS_IND_TBL_CMD, fw_rss_ind_tbl_cmd::iq0_to_iq2, fw_rss_ind_tbl_cmd::niqid, fw_rss_ind_tbl_cmd::op_to_viid, fw_rss_ind_tbl_cmd::retval_len16, fw_rss_ind_tbl_cmd::startidx, t4_wr_mbox(), V_FW_CMD_OP, V_FW_RSS_IND_TBL_CMD_IQ0, V_FW_RSS_IND_TBL_CMD_IQ1, V_FW_RSS_IND_TBL_CMD_IQ2, and V_FW_RSS_IND_TBL_CMD_VIID.
Referenced by vi_full_init().
int t4_config_vi_rss | ( | struct adapter * | adapter, |
int | mbox, | ||
unsigned int | viid, | ||
unsigned int | flags, | ||
unsigned int | defq, | ||
unsigned int | skeyidx, | ||
unsigned int | skey | ||
) |
t4_config_vi_rss - configure per VI RSS settings @adapter: the adapter @mbox: mbox to use for the FW command @viid: the VI id @flags: RSS flags @defq: id of the default RSS queue for the VI. @skeyidx: RSS secret key table index for non-global mode @skey: RSS vf_scramble key for VI.
Configures VI-specific RSS properties.
Definition at line 5686 of file t4_hw.c.
References fw_rss_vi_config_cmd::fw_rss_vi_config::basicvirtual, cpu_to_be32, fw_rss_vi_config_cmd::fw_rss_vi_config::fw_rss_vi_config_basicvirtual::defaultq_to_udpen, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, FW_LEN16, FW_RSS_VI_CONFIG_CMD, fw_rss_vi_config_cmd::op_to_viid, fw_rss_vi_config_cmd::retval_len16, fw_rss_vi_config_cmd::fw_rss_vi_config::fw_rss_vi_config_basicvirtual::secretkeyidx_pkd, fw_rss_vi_config_cmd::fw_rss_vi_config::fw_rss_vi_config_basicvirtual::secretkeyxor, t4_wr_mbox(), fw_rss_vi_config_cmd::u, V_FW_CMD_OP, V_FW_RSS_VI_CONFIG_CMD_DEFAULTQ, V_FW_RSS_VI_CONFIG_CMD_SECRETKEYIDX, and V_FW_RSS_VI_CONFIG_CMD_VIID.
Referenced by vi_full_init().
int t4_config_watchdog | ( | struct adapter * | adapter, |
unsigned int | mbox, | ||
unsigned int | pf, | ||
unsigned int | vf, | ||
unsigned int | timeout, | ||
unsigned int | action | ||
) |
Definition at line 11311 of file t4_hw.c.
References fw_watchdog_cmd::action, cpu_to_be32, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, FW_LEN16, FW_WATCHDOG_CMD, fw_watchdog_cmd::op_to_vfn, fw_watchdog_cmd::retval_len16, t4_wr_mbox(), fw_watchdog_cmd::timeout, V_FW_CMD_OP, V_FW_PARAMS_CMD_PFN, and V_FW_PARAMS_CMD_VFN.
int t4_configure_add_smac | ( | struct adapter * | adap | ) |
Definition at line 11373 of file t4_hw.c.
References FW_PARAMS_MNEM_DEV, FW_PARAMS_PARAM_DEV_ADD_SMAC, adapter::mbox, adapter::params, adapter::pf, adapter_params::smac_add_support, t4_query_params(), t4_set_params(), V_FW_PARAMS_MNEM, and V_FW_PARAMS_PARAM_X.
int t4_configure_ringbb | ( | struct adapter * | adap | ) |
Definition at line 11404 of file t4_hw.c.
References CH_ERR, FW_PARAMS_MNEM_DEV, FW_PARAMS_PARAM_DEV_RING_BACKBONE, adapter::mbox, adapter::pf, t4_query_params(), t4_set_params(), V_FW_PARAMS_MNEM, and V_FW_PARAMS_PARAM_X.
int t4_ctrl_eq_free | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | pf, | ||
unsigned int | vf, | ||
unsigned int | eqid | ||
) |
t4_ctrl_eq_free - free a control egress queue @adap: the adapter @mbox: mailbox to use for the FW command @pf: the PF owning the queue @vf: the VF owning the queue @eqid: egress queue id
Frees a control egress queue.
Definition at line 8756 of file t4_hw.c.
References fw_eq_ctrl_cmd::alloc_to_len16, fw_eq_ctrl_cmd::cmpliqid_eqid, cpu_to_be32, F_FW_CMD_EXEC, F_FW_CMD_REQUEST, F_FW_EQ_CTRL_CMD_FREE, FW_EQ_CTRL_CMD, FW_LEN16, fw_eq_ctrl_cmd::op_to_vfn, t4_wr_mbox(), V_FW_CMD_OP, V_FW_EQ_CTRL_CMD_EQID, V_FW_EQ_CTRL_CMD_PFN, and V_FW_EQ_CTRL_CMD_VFN.
Referenced by free_eq_hwq().
int t4_del_mac | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | viid, | ||
const u8 * | addr, | ||
bool | smac | ||
) |
t4_del_mac - Removes the exact-match filter for a MAC address @adap: the adapter @mbox: mailbox to use for the FW command @viid: the VI id @addr: the MAC address value @smac: if true, delete from only the smac region of MPS
Modifies an exact-match filter and sets it to the new MAC address if @idx >= 0, or adds the MAC address to a new filter if @idx < 0. In the latter case the address is added persistently if @persist is true.
Returns a negative error number or the index of the filter with the new MAC value. Note that this index may differ from @idx.
Definition at line 11490 of file t4_hw.c.
References be16_to_cpu, adapter::chip_params, cpu_to_be16, cpu_to_be32, fw_vi_mac_cmd::fw_vi_mac::exact, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, F_FW_VI_MAC_CMD_IS_SMAC, F_FW_VI_MAC_CMD_VALID, fw_vi_mac_cmd::freemacs_to_len16, FW_VI_MAC_CMD, FW_VI_MAC_MAC_BASED_FREE, G_FW_VI_MAC_CMD_IDX, chip_params::mps_tcam_size, fw_vi_mac_cmd::op_to_viid, t4_wr_mbox(), fw_vi_mac_cmd::u, V_FW_CMD_LEN16, V_FW_CMD_OP, V_FW_VI_MAC_CMD_IDX, and V_FW_VI_MAC_CMD_VIID.
|
static |
Definition at line 518 of file t4_hw.c.
References A_EDC_H_BIST_STATUS_RDATA, A_EDC_H_ECC_ERR_ADDR, CH_WARN, EDC_T5_REG, is_t4(), MEM_EDC0, MEM_EDC1, t4_read_reg(), and t4_read_reg64().
Referenced by mem_intr_handler().
t4_edc_read - read from EDC through backdoor accesses @adap: the adapter @idx: which EDC to access @addr: address of first byte requested @data: 64 bytes of data containing the requested address @ecc: where to store the corresponding 64-bit ECC word
Read 64 bytes of data from EDC starting at a 64-byte-aligned address that covers the requested address @addr. If @parity is not NULL it is assigned the 64-bit ECC word for the read data.
Definition at line 622 of file t4_hw.c.
References A_EDC_BIST_CMD, A_EDC_BIST_CMD_ADDR, A_EDC_BIST_CMD_LEN, A_EDC_BIST_DATA_PATTERN, A_EDC_BIST_STATUS_RDATA, A_EDC_H_BIST_CMD, A_EDC_H_BIST_CMD_ADDR, A_EDC_H_BIST_CMD_LEN, A_EDC_H_BIST_DATA_PATTERN, A_EDC_H_BIST_STATUS_RDATA, EDC_DATA, EDC_REG, EDC_REG_T5, F_START_BIST, is_t4(), t4_read_reg(), t4_read_reg64(), t4_wait_op_done(), t4_write_reg(), V_BIST_CMD_GAP, and V_BIST_OPCODE.
Referenced by t4_mem_read().
int t4_eeprom_ptov | ( | unsigned int | phys_addr, |
unsigned int | fn, | ||
unsigned int | sz | ||
) |
Definition at line 2930 of file t4_hw.c.
References EEPROMSIZE.
int t4_enable_vi | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | viid, | ||
bool | rx_en, | ||
bool | tx_en | ||
) |
t4_enable_vi - enable/disable a virtual interface @adap: the adapter @mbox: mailbox to use for the FW command @viid: the VI id @rx_en: 1=enable Rx, 0=disable Rx @tx_en: 1=enable Tx, 0=disable Tx
Enables/disables a virtual interface. Note that setting DCB Enable only makes sense when enabling a Virtual Interface ...
Definition at line 8602 of file t4_hw.c.
References t4_enable_vi_params().
Referenced by cxgbe_init_synchronized(), cxgbe_uninit_synchronized(), and t4_resume().
int t4_enable_vi_params | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | viid, | ||
bool | rx_en, | ||
bool | tx_en, | ||
bool | dcb_en | ||
) |
t4_enable_vi_params - enable/disable a virtual interface @adap: the adapter @mbox: mailbox to use for the FW command @viid: the VI id @rx_en: 1=enable Rx, 0=disable Rx @tx_en: 1=enable Tx, 0=disable Tx @dcb_en: 1=enable delivery of Data Center Bridging messages.
Enables/disables a virtual interface. Note that setting DCB Enable only makes sense when enabling a Virtual Interface ...
Definition at line 8575 of file t4_hw.c.
References cpu_to_be32, F_FW_CMD_EXEC, F_FW_CMD_REQUEST, FW_LEN16, FW_VI_ENABLE_CMD, fw_vi_enable_cmd::ien_to_len16, fw_vi_enable_cmd::op_to_viid, t4_wr_mbox_ns(), V_FW_CMD_OP, V_FW_VI_ENABLE_CMD_DCB_INFO, V_FW_VI_ENABLE_CMD_EEN, V_FW_VI_ENABLE_CMD_IEN, and V_FW_VI_ENABLE_CMD_VIID.
Referenced by t4_enable_vi().
int t4_eth_eq_free | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | pf, | ||
unsigned int | vf, | ||
unsigned int | eqid | ||
) |
t4_eth_eq_free - free an Ethernet egress queue @adap: the adapter @mbox: mailbox to use for the FW command @pf: the PF owning the queue @vf: the VF owning the queue @eqid: egress queue id
Frees an Ethernet egress queue.
Definition at line 8731 of file t4_hw.c.
References fw_eq_eth_cmd::alloc_to_len16, cpu_to_be32, fw_eq_eth_cmd::eqid_pkd, F_FW_CMD_EXEC, F_FW_CMD_REQUEST, F_FW_EQ_ETH_CMD_FREE, FW_EQ_ETH_CMD, FW_LEN16, fw_eq_eth_cmd::op_to_vfn, t4_wr_mbox(), V_FW_CMD_OP, V_FW_EQ_ETH_CMD_EQID, V_FW_EQ_ETH_CMD_PFN, and V_FW_EQ_ETH_CMD_VFN.
Referenced by free_eq_hwq().
int t4_eth_eq_stop | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | pf, | ||
unsigned int | vf, | ||
unsigned int | eqid | ||
) |
t4_eth_eq_stop - stop an Ethernet egress queue @adap: the adapter @mbox: mailbox to use for the FW command @pf: the PF owning the queues @vf: the VF owning the queues @eqid: egress queue id
Stops an Ethernet egress queue. The queue can be reinitialized or freed but is not otherwise functional after this call.
Definition at line 8706 of file t4_hw.c.
References fw_eq_eth_cmd::alloc_to_len16, cpu_to_be32, fw_eq_eth_cmd::eqid_pkd, F_FW_CMD_EXEC, F_FW_CMD_REQUEST, F_FW_EQ_ETH_CMD_EQSTOP, FW_EQ_ETH_CMD, FW_LEN16, fw_eq_eth_cmd::op_to_vfn, t4_wr_mbox(), V_FW_CMD_OP, V_FW_EQ_ETH_CMD_EQID, V_FW_EQ_ETH_CMD_PFN, and V_FW_EQ_ETH_CMD_VFN.
int t4_filter_field_shift | ( | const struct adapter * | adap, |
int | filter_sel | ||
) |
t4_filter_field_shift - calculate filter field shift @adap: the adapter @filter_sel: the desired field (from TP_VLAN_PRI_MAP bits)
Return the shift position of a filter field within the Compressed Filter Tuple. The filter field is specified via its selection bit within TP_VLAN_PRI_MAL (filter mode). E.g. F_VLAN.
Definition at line 9828 of file t4_hw.c.
References F_ETHERTYPE, F_FCOE, F_FRAGMENTATION, F_MACMATCH, F_MPSHITTYPE, F_PORT, F_PROTOCOL, F_TOS, F_VLAN, F_VNIC_ID, tp_params::filter_mode, adapter::params, adapter_params::tp, W_FT_ETHERTYPE, W_FT_FCOE, W_FT_FRAGMENTATION, W_FT_MACMATCH, W_FT_MPSHITTYPE, W_FT_PORT, W_FT_PROTOCOL, W_FT_TOS, W_FT_VLAN, and W_FT_VNIC_ID.
Referenced by read_filter_mode_and_ingress_config().
|
static |
Definition at line 10835 of file t4_hw.c.
References FLASH_BOOTCFG_MAX_SIZE, FLASH_BOOTCFG_START, adapter::params, and adapter_params::sf_size.
Referenced by t4_load_bootcfg().
int t4_flash_cfg_addr | ( | struct adapter * | adapter | ) |
t4_flash_cfg_addr - return the address of the flash configuration file @adapter: the adapter
Return the address within the flash where the Firmware Configuration File is stored, or an error if the device FLASH is too small to contain a Firmware Configuration File.
Definition at line 3525 of file t4_hw.c.
References FLASH_CFG_MAX_SIZE, FLASH_CFG_START, adapter::params, and adapter_params::sf_size.
Referenced by apply_cfg_and_initialize(), and t4_load_cfg().
int t4_flash_erase_sectors | ( | struct adapter * | adapter, |
int | start, | ||
int | end | ||
) |
t4_flash_erase_sectors - erase a range of flash sectors @adapter: the adapter @start: the first sector to erase @end: the last sector to erase
Erases the sectors in the given inclusive range.
Definition at line 3494 of file t4_hw.c.
References A_SF_OP, CH_ERR, flash_wait_op(), adapter::params, sf1_write(), SF_ERASE_SECTOR, adapter_params::sf_nsec, SF_WR_ENABLE, and t4_write_reg().
Referenced by t4_load_boot(), t4_load_bootcfg(), t4_load_cfg(), t4_load_fw(), and write_flash().
t4_free_encap_mac_filt - frees MPS entry at given index @adap: the adapter @viid: the VI id @idx: index of MPS entry to be freed @sleep_ok: call is allowed to sleep
Frees the MPS entry at supplied index
Returns a negative error number or zero on success
Definition at line 8321 of file t4_hw.c.
References cpu_to_be16, cpu_to_be32, fw_vi_mac_cmd::fw_vi_mac::exact, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, F_FW_VI_MAC_CMD_VALID, fw_vi_mac_cmd::freemacs_to_len16, FW_VI_MAC_CMD, FW_VI_MAC_TYPE_EXACTMAC, adapter::mbox, fw_vi_mac_cmd::op_to_viid, t4_wr_mbox_meat(), fw_vi_mac_cmd::u, V_FW_CMD_EXEC, V_FW_CMD_LEN16, V_FW_CMD_OP, V_FW_VI_MAC_CMD_ENTRY_TYPE, V_FW_VI_MAC_CMD_FREEMACS, V_FW_VI_MAC_CMD_IDX, V_FW_VI_MAC_CMD_VIID, and fw_vi_mac_cmd::fw_vi_mac::fw_vi_mac_exact::valid_to_idx.
int t4_free_mac_filt | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | viid, | ||
unsigned int | naddr, | ||
const u8 ** | addr, | ||
bool | sleep_ok | ||
) |
t4_free_mac_filt - frees exact-match filters of given MAC addresses @adap: the adapter @mbox: mailbox to use for the FW command @viid: the VI id @naddr: the number of MAC addresses to allocate filters for (up to 7) @addr: the MAC address(es) @sleep_ok: call is allowed to sleep
Frees the exact-match filter for each of the supplied addresses
Returns a negative error number or the number of filters freed.
Definition at line 8412 of file t4_hw.c.
References ARRAY_SIZE, be16_to_cpu, adapter::chip_params, cpu_to_be16, cpu_to_be32, DIV_ROUND_UP, fw_vi_mac_cmd::fw_vi_mac::exact, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, F_FW_VI_MAC_CMD_VALID, fw_vi_mac_cmd::freemacs_to_len16, FW_VI_MAC_CMD, FW_VI_MAC_MAC_BASED_FREE, G_FW_VI_MAC_CMD_IDX, chip_params::mps_tcam_size, fw_vi_mac_cmd::op_to_viid, t4_wr_mbox_meat(), fw_vi_mac_cmd::u, V_FW_CMD_EXEC, V_FW_CMD_LEN16, V_FW_CMD_OP, V_FW_VI_MAC_CMD_FREEMACS, V_FW_VI_MAC_CMD_IDX, and V_FW_VI_MAC_CMD_VIID.
int t4_free_raw_mac_filt | ( | struct adapter * | adap, |
unsigned int | viid, | ||
const u8 * | addr, | ||
const u8 * | mask, | ||
unsigned int | idx, | ||
u8 | lookup_type, | ||
u8 | port_id, | ||
bool | sleep_ok | ||
) |
t4_free_raw_mac_filt - Frees a raw mac entry in mps tcam @adap: the adapter @viid: the VI id @addr: the MAC address @mask: the mask @idx: index of the entry in mps tcam @lookup_type: MAC address for inner (1) or outer (0) header @port_id: the port index @sleep_ok: call is allowed to sleep
Removes the mac entry at the specified index using raw mac interface.
Returns a negative error number on failure.
Definition at line 8364 of file t4_hw.c.
References cpu_to_be32, cpu_to_be64, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, fw_vi_mac_cmd::freemacs_to_len16, FW_VI_MAC_CMD, FW_VI_MAC_ID_BASED_FREE, FW_VI_MAC_TYPE_RAW, M_DATALKPTYPE, M_DATAPORTNUM, adapter::mbox, fw_vi_mac_cmd::op_to_viid, fw_vi_mac_cmd::fw_vi_mac::raw, t4_wr_mbox_meat(), fw_vi_mac_cmd::u, V_DATALKPTYPE, V_DATAPORTNUM, V_FW_CMD_EXEC, V_FW_CMD_LEN16, V_FW_CMD_OP, V_FW_VI_MAC_CMD_ENTRY_TYPE, V_FW_VI_MAC_CMD_FREEMACS, V_FW_VI_MAC_CMD_RAW_IDX, and V_FW_VI_MAC_CMD_VIID.
int t4_free_vi | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | pf, | ||
unsigned int | vf, | ||
unsigned int | viid | ||
) |
t4_free_vi - free a virtual interface @adap: the adapter @mbox: mailbox to use for the FW command @pf: the PF owning the VI @vf: the VF owning the VI @viid: virtual interface identifiler
Free a previously allocated virtual interface.
Definition at line 8049 of file t4_hw.c.
References fw_vi_cmd::alloc_to_len16, cpu_to_be16, cpu_to_be32, F_FW_CMD_EXEC, F_FW_CMD_REQUEST, F_FW_VI_CMD_FREE, FW_LEN16, FW_VI_CMD, fw_vi_cmd::op_to_vfn, t4_wr_mbox(), fw_vi_cmd::type_to_viid, V_FW_CMD_OP, V_FW_VI_CMD_PFN, V_FW_VI_CMD_VFN, and V_FW_VI_CMD_VIID.
Referenced by t4_detach_common(), vcxgbe_attach(), and vcxgbe_detach().
int t4_fw_bye | ( | struct adapter * | adap, |
unsigned int | mbox | ||
) |
t4_fw_bye - end communication with FW @adap: the adapter @mbox: mailbox to use for the FW command
Issues a command to terminate communication with FW.
Definition at line 7607 of file t4_hw.c.
References INIT_CMD, and t4_wr_mbox().
Referenced by contact_firmware(), and t4_detach_common().
int t4_fw_halt | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
int | force | ||
) |
t4_fw_halt - issue a reset/halt to FW and put uP into RESET @adap: the adapter @mbox: mailbox to use for the FW RESET command (if desired) @force: force uP into RESET even if FW RESET command fails
Issues a RESET command to firmware (if desired) with a HALT indication and then puts the microprocessor into RESET state. The RESET command will only be issued if a legitimate mailbox is provided (mbox <= M_PCIE_FW_MASTER).
This is generally used in order for the host to safely manipulate the adapter without fear of conflicting with whatever the firmware might be doing. The only way out of this state is to RESTART the firmware ...
Definition at line 7650 of file t4_hw.c.
References A_CIM_BOOT_CFG, A_PCIE_FW, cpu_to_be32, F_FW_RESET_CMD_HALT, F_PCIE_FW_HALT, F_PIORST, F_PIORSTMODE, F_UPCRST, adapter::flags, FW_OK, fw_reset_cmd::halt_pkd, INIT_CMD, M_PCIE_FW_MASTER, t4_set_reg_field(), t4_wr_mbox(), and fw_reset_cmd::val.
Referenced by t4_fw_upgrade().
int t4_fw_hello | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | evt_mbox, | ||
enum dev_master | master, | ||
enum dev_state * | state | ||
) |
t4_fw_hello - establish communication with FW @adap: the adapter @mbox: mailbox to use for the FW command @evt_mbox: mailbox to receive async FW events @master: specifies the caller's willingness to be the device master @state: returns the current device state (if non-NULL)
Issues a command to establish communication with FW. Returns either an error (negative integer) or the mailbox of the Master PF.
Definition at line 7483 of file t4_hw.c.
References A_PCIE_FW, be32_to_cpu, cpu_to_be32, DEV_STATE_ERR, DEV_STATE_INIT, DEV_STATE_UNINIT, fw_hello_cmd::err_to_clearinit, F_FW_HELLO_CMD_CLEARINIT, F_FW_HELLO_CMD_ERR, F_FW_HELLO_CMD_INIT, F_PCIE_FW_ERR, F_PCIE_FW_INIT, F_PCIE_FW_MASTER_VLD, FW_CMD_HELLO_RETRIES, FW_CMD_HELLO_TIMEOUT, FW_HELLO_CMD_STAGE_OS, FW_SUCCESS, G_FW_HELLO_CMD_MBMASTER, G_PCIE_FW_MASTER, INIT_CMD, M_FW_HELLO_CMD_MBMASTER, M_PCIE_FW_MASTER, MASTER_CANT, MASTER_MUST, msleep, t4_read_reg(), t4_wr_mbox(), V_FW_HELLO_CMD_MASTERDIS, V_FW_HELLO_CMD_MASTERFORCE, V_FW_HELLO_CMD_MBASYNCNOT, V_FW_HELLO_CMD_MBMASTER, and V_FW_HELLO_CMD_STAGE.
Referenced by contact_firmware().
int t4_fw_initialize | ( | struct adapter * | adap, |
unsigned int | mbox | ||
) |
t4_fw_initialize - ask FW to initialize the device @adap: the adapter @mbox: mailbox to use for the FW command
Issues a command to FW to partially initialize the device. This performs initialization that generally doesn't depend on user input.
Definition at line 7770 of file t4_hw.c.
References INIT_CMD, and t4_wr_mbox().
Referenced by apply_cfg_and_initialize().
Definition at line 3543 of file t4_hw.c.
References CH_ERR, fw_hdr::chip, chip_id(), FW_HDR_CHIP_T4, FW_HDR_CHIP_T5, FW_HDR_CHIP_T6, is_t4(), is_t5(), and is_t6().
Referenced by t4_fw_upgrade(), and t4_load_fw().
int t4_fw_reset | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
int | reset | ||
) |
t4_fw_reset - issue a reset to FW @adap: the adapter @mbox: mailbox to use for the FW command @reset: specifies the type of reset to perform
Issues a reset command of the specified type to FW.
Definition at line 7624 of file t4_hw.c.
References cpu_to_be32, INIT_CMD, t4_wr_mbox(), and fw_reset_cmd::val.
Referenced by apply_cfg_and_initialize().
int t4_fw_restart | ( | struct adapter * | adap, |
unsigned int | mbox | ||
) |
t4_fw_restart - restart the firmware by taking the uP out of RESET @adap: the adapter
Restart firmware previously halted by t4_fw_halt(). On successful return the previous PF Master remains as the new PF Master and there is no need to issue a new HELLO command, etc.
Definition at line 7702 of file t4_hw.c.
References A_CIM_BOOT_CFG, A_PCIE_FW, F_PCIE_FW_HALT, F_UPCRST, FW_CMD_MAX_TIMEOUT, FW_SUCCESS, msleep, t4_read_reg(), and t4_set_reg_field().
Referenced by t4_fw_upgrade().
int t4_fw_upgrade | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
const u8 * | fw_data, | ||
unsigned int | size, | ||
int | force | ||
) |
t4_fw_upgrade - perform all of the steps necessary to upgrade FW @adap: the adapter @mbox: mailbox to use for the FW RESET command (if desired) @fw_data: the firmware image to write @size: image size @force: force upgrade even if firmware doesn't cooperate
Perform all of the steps necessary for upgrading an adapter's firmware image. Normally this requires the cooperation of the existing firmware in order to halt all existing activities but if an invalid mailbox token is passed in we skip that step (though we'll still put the adapter microprocessor into RESET in that case).
On successful return the new firmware will have been loaded and the adapter will have been fully RESET losing all previous setup state. On unsuccessful return the adapter may be completely hosed ... positive errno indicates that the adapter is ~probably~ intact, a negative errno indicates that things are looking bad ...
Definition at line 7738 of file t4_hw.c.
References be32_to_cpu, FW_HDR_MAGIC_BOOTSTRAP, fw_hdr::magic, t4_fw_halt(), t4_fw_matches_chip(), t4_fw_restart(), and t4_load_fw().
Referenced by install_kld_firmware().
Definition at line 7203 of file t4_hw.c.
References fw_ldst_cmd::fw_ldst::fw_ldst_addrval::addr, fw_ldst_cmd::fw_ldst::addrval, cpu_to_be32, fw_ldst_cmd::cycles_to_len16, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, FW_LDST_ADDRSPC_FIRMWARE, FW_LDST_CMD, FW_LEN16, fw_ldst_cmd::op_to_addrspace, t4_wr_mbox(), fw_ldst_cmd::u, V_FW_CMD_OP, V_FW_LDST_CMD_ADDRSPACE, and fw_ldst_cmd::fw_ldst::fw_ldst_addrval::val.
int t4_fwcache | ( | struct adapter * | adap, |
enum fw_params_param_dev_fwcache | op | ||
) |
t4_fwcache - firmware cache operation @adap: the adapter @op : the operation (flush or flush and invalidate)
Definition at line 3663 of file t4_hw.c.
References __force, cpu_to_be32, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, FW_LEN16, FW_PARAMS_CMD, FW_PARAMS_MNEM_DEV, FW_PARAMS_PARAM_DEV_FWCACHE, adapter::mbox, fw_params_cmd::fw_params_param::mnem, fw_params_cmd::op_to_vfn, fw_params_cmd::param, adapter::pf, fw_params_cmd::retval_len16, t4_wr_mbox(), V_FW_CMD_OP, V_FW_PARAMS_CMD_PFN, V_FW_PARAMS_CMD_VFN, V_FW_PARAMS_MNEM, V_FW_PARAMS_PARAM_X, and fw_params_cmd::fw_params_param::val.
Referenced by cudbg_t4_fwcache().
t4_get_bs_version - read the firmware bootstrap version @adapter: the adapter @vers: where to place the version
Reads the FW Bootstrap version from flash.
Definition at line 3324 of file t4_hw.c.
References FLASH_FWBOOTSTRAP_START, and t4_read_flash().
Referenced by t4_get_version_info().
t4_get_chan_txrate - get the current per channel Tx rates @adap: the adapter @nic_rate: rates for NIC traffic @ofld_rate: rates for offloaded traffic
Return the current Tx rates in bytes/s for NIC and offloaded traffic for each channel.
Definition at line 6606 of file t4_hw.c.
References A_TP_TX_ORATE, A_TP_TX_TRATE, chan_rate(), adapter::chip_params, G_OFDRATE0, G_OFDRATE1, G_OFDRATE2, G_OFDRATE3, G_TNLRATE0, G_TNLRATE1, G_TNLRATE2, G_TNLRATE3, chip_params::nchan, and t4_read_reg().
Referenced by collect_tx_rate(), and sysctl_tx_rate().
const struct chip_params * t4_get_chip_params | ( | int | chipid | ) |
Definition at line 9271 of file t4_hw.c.
References ARRAY_SIZE, CHELSIO_T4, CIM_NUM_OBQ, CIM_NUM_OBQ_T5, F_DBPRIO, F_DBTYPE, FILTER_OPT_LEN, chip_params::nchan, NCHAN, NUM_MPS_CLS_SRAM_L_INSTANCES, NUM_MPS_T5_CLS_SRAM_L_INSTANCES, PM_NSTATS, RSS_NENTRIES, T5_FILTER_OPT_LEN, T6_NCHAN, T6_PM_NSTATS, and T6_RSS_NENTRIES.
Referenced by t4_prep_adapter(), and t4vf_prep_adapter().
int t4_get_devlog_level | ( | struct adapter * | adapter, |
unsigned int * | level | ||
) |
Definition at line 11341 of file t4_hw.c.
References cpu_to_be32, F_FW_CMD_READ, F_FW_CMD_REQUEST, FW_DEVLOG_CMD, FW_LEN16, fw_devlog_cmd::level, adapter::mbox, fw_devlog_cmd::op_to_write, fw_devlog_cmd::retval_len16, t4_wr_mbox(), and V_FW_CMD_OP.
t4_get_exprom_version - return the Expansion ROM version (if any) @adapter: the adapter @vers: where to place the version
Reads the Expansion ROM header from FLASH and returns the version number (if present) through the @vers return value pointer. We return this in the Firmware Version Format since it's convenient. Return 0 on success, -ENOENT if no Expansion ROM is present.
Definition at line 3355 of file t4_hw.c.
References ARRAY_SIZE, DIV_ROUND_UP, FLASH_EXP_ROM_START, t4_read_flash(), V_FW_HDR_FW_VER_BUILD, V_FW_HDR_FW_VER_MAJOR, V_FW_HDR_FW_VER_MICRO, and V_FW_HDR_FW_VER_MINOR.
Referenced by t4_get_version_info().
void t4_get_fcoe_stats | ( | struct adapter * | adap, |
unsigned int | idx, | ||
struct tp_fcoe_stats * | st, | ||
bool | sleep_ok | ||
) |
t4_get_fcoe_stats - read TP's FCoE MIB counters for a port @adap: the adapter @idx: the port index @st: holds the counter values @sleep_ok: if true we may sleep while awaiting command completion
Returns the values of TP's FCoE counters for the selected port.
Definition at line 6272 of file t4_hw.c.
References A_TP_MIB_FCOE_BYTE_0_HI, A_TP_MIB_FCOE_DDP_0, A_TP_MIB_FCOE_DROP_0, tp_fcoe_stats::frames_ddp, tp_fcoe_stats::frames_drop, tp_fcoe_stats::octets_ddp, and t4_tp_mib_read().
Referenced by collect_fcoe_stats(), and sysctl_fcoe_stats().
int t4_get_flash_params | ( | struct adapter * | adapter | ) |
Definition at line 9118 of file t4_hw.c.
References A_SF_OP, ARRAY_SIZE, CH_WARN, FLASH_MIN_SIZE, adapter::params, sf1_read(), sf1_write(), adapter_params::sf_nsec, SF_RD_ID, SF_SEC_SIZE, adapter_params::sf_size, flash_desc::size_mb, t4_write_reg(), and flash_desc::vendor_and_model_id.
Referenced by cudbg_collect(), cudbg_read_flash(), and t4_prep_adapter().
t4_get_fw_hdr - read the firmware header @adapter: the adapter @hdr: where to place the version
Reads the FW header from flash into caller provided buffer.
Definition at line 3311 of file t4_hw.c.
References FLASH_FW_START, and t4_read_flash().
Referenced by contact_firmware().
t4_get_fw_version - read the firmware version @adapter: the adapter @vers: where to place the version
Reads the FW version from flash.
Definition at line 3297 of file t4_hw.c.
References FLASH_FW_START, and t4_read_flash().
Referenced by collect_vpd_data(), and t4_get_version_info().
void t4_get_lb_stats | ( | struct adapter * | adap, |
int | idx, | ||
struct lb_port_stats * | p | ||
) |
t4_get_lb_stats - collect loopback port statistics @adap: the adapter @idx: the loopback port index : the stats structure to fill
Return HW statistics for the given loopback port.
Definition at line 7033 of file t4_hw.c.
References adap2pinfo(), BCAST, lb_port_stats::bcast_frames, lb_port_stats::drop, lb_port_stats::error_frames, lb_port_stats::frames, lb_port_stats::frames_1024_1518, lb_port_stats::frames_128_255, lb_port_stats::frames_1519_max, lb_port_stats::frames_256_511, lb_port_stats::frames_512_1023, lb_port_stats::frames_64, lb_port_stats::frames_65_127, GET_STAT, GET_STAT_COM, lb_port_stats::mcast_frames, port_info::mps_bg_map, lb_port_stats::octets, lb_port_stats::ovflow0, lb_port_stats::ovflow1, lb_port_stats::ovflow2, lb_port_stats::ovflow3, lb_port_stats::trunc0, lb_port_stats::trunc1, lb_port_stats::trunc2, lb_port_stats::trunc3, and lb_port_stats::ucast_frames.
Referenced by collect_lb_stats(), and sysctl_lb_stats().
|
static |
t4_get_mps_bg_map - return the buffer groups associated with a port @adap: the adapter @idx: the port index
Returns a bitmap indicating which MPS buffer groups are associated with the given port. Bit i is set if buffer group i is used by the port.
Definition at line 6815 of file t4_hw.c.
References A_MPS_CMN_CTL, CHELSIO_T5, chip_id(), G_NUMPORTS, adapter_params::mps_bg_map, adapter::params, and t4_read_reg().
Referenced by t4_port_init().
void t4_get_port_stats | ( | struct adapter * | adap, |
int | idx, | ||
struct port_stats * | p | ||
) |
t4_get_port_stats - collect port statistics @adap: the adapter @idx: the port index : the stats structure to fill
Collect statistics related to the given port from HW.
Definition at line 6928 of file t4_hw.c.
References A_MPS_STAT_CTL, CHELSIO_T5, chip_id(), F_COUNTPAUSEMCRX, F_COUNTPAUSEMCTX, F_COUNTPAUSESTATRX, F_COUNTPAUSESTATTX, port_info::fcs_base, port_info::fcs_reg, GET_STAT, GET_STAT_COM, port_info::mps_bg_map, adapter::port, port_stats::rx_bcast_frames, port_stats::rx_fcs_err, port_stats::rx_frames, port_stats::rx_frames_1024_1518, port_stats::rx_frames_128_255, port_stats::rx_frames_1519_max, port_stats::rx_frames_256_511, port_stats::rx_frames_512_1023, port_stats::rx_frames_64, port_stats::rx_frames_65_127, port_stats::rx_jabber, port_stats::rx_len_err, port_stats::rx_mcast_frames, port_stats::rx_octets, port_stats::rx_ovflow0, port_stats::rx_ovflow1, port_stats::rx_ovflow2, port_stats::rx_ovflow3, port_stats::rx_pause, port_stats::rx_ppp0, port_stats::rx_ppp1, port_stats::rx_ppp2, port_stats::rx_ppp3, port_stats::rx_ppp4, port_stats::rx_ppp5, port_stats::rx_ppp6, port_stats::rx_ppp7, port_stats::rx_runt, port_stats::rx_symbol_err, port_stats::rx_too_long, port_stats::rx_trunc0, port_stats::rx_trunc1, port_stats::rx_trunc2, port_stats::rx_trunc3, port_stats::rx_ucast_frames, t4_read_reg(), t4_read_reg64(), port_stats::tx_bcast_frames, port_stats::tx_drop, port_stats::tx_error_frames, port_stats::tx_frames, port_stats::tx_frames_1024_1518, port_stats::tx_frames_128_255, port_stats::tx_frames_1519_max, port_stats::tx_frames_256_511, port_stats::tx_frames_512_1023, port_stats::tx_frames_64, port_stats::tx_frames_65_127, port_stats::tx_mcast_frames, port_stats::tx_octets, port_stats::tx_pause, port_stats::tx_ppp0, port_stats::tx_ppp1, port_stats::tx_ppp2, port_stats::tx_ppp3, port_stats::tx_ppp4, port_stats::tx_ppp5, port_stats::tx_ppp6, port_stats::tx_ppp7, and port_stats::tx_ucast_frames.
Referenced by collect_macstats(), cxgbe_refresh_stats(), and t4_get_port_stats_offset().
void t4_get_port_stats_offset | ( | struct adapter * | adap, |
int | idx, | ||
struct port_stats * | stats, | ||
struct port_stats * | offset | ||
) |
t4_get_port_stats_offset - collect port stats relative to a previous snapshot @adap: The adapter @idx: The port @stats: Current stats to fill @offset: Previous stats snapshot
Definition at line 6906 of file t4_hw.c.
References t4_get_port_stats().
const char * t4_get_port_type_description | ( | enum fw_port_type | port_type | ) |
t4_get_port_type_description - return Port Type string description @port_type: firmware Port Type enumeration
Definition at line 6866 of file t4_hw.c.
References ARRAY_SIZE.
t4_get_regs - read chip registers into provided buffer @adap: the adapter @buf: register buffer @buf_size: size (in bytes) of register buffer
If the provided register buffer isn't large enough for the chip's full register range, the register dump will be truncated to the register buffer's size.
Definition at line 824 of file t4_hw.c.
References A_CIM_VF_EXT_MAILBOX_CTRL, A_CIM_VF_EXT_MAILBOX_STATUS, A_MPS_VF_CTL, A_MPS_VF_STAT_RX_VF_ERR_FRAMES_H, A_PL_VF_REVISION, A_PL_VF_WHOAMI, A_SGE_VF_GTS, A_SGE_VF_KDOORBELL, ARRAY_SIZE, CH_ERR, CHELSIO_T4, CHELSIO_T5, CHELSIO_T6, chip_id(), adapter::flags, FW_T4VF_MBDATA_BASE_ADDR, FW_T6VF_MBDATA_BASE_ADDR, IS_VF, NUM_CIM_PF_MAILBOX_DATA_INSTANCES, t4_read_reg(), VF_CIM_REG, VF_MPS_REG, VF_PL_REG, and VF_SGE_REG.
Referenced by collect_reg_dump(), and get_regs().
unsigned int t4_get_regs_len | ( | struct adapter * | adapter | ) |
t4_get_regs_len - return the size of the chips register set @adapter: the adapter
Returns the size of the chip's BAR0 register space.
Definition at line 792 of file t4_hw.c.
References CH_ERR, CHELSIO_T4, CHELSIO_T5, CHELSIO_T6, chip_id(), adapter::flags, FW_T4VF_REGMAP_SIZE, IS_VF, T4_REGMAP_SIZE, and T5_REGMAP_SIZE.
Referenced by t4_ioctl(), and t4vf_ioctl().
|
static |
Definition at line 6848 of file t4_hw.c.
References FW_PARAMS_MNEM_DEV, FW_PARAMS_PARAM_DEV_TPCHMAP, adapter::mbox, adapter::pf, t4_query_params(), V_FW_PARAMS_MNEM, and V_FW_PARAMS_PARAM_X.
Referenced by t4_port_init().
|
static |
Definition at line 6833 of file t4_hw.c.
References A_MPS_CMN_CTL, CHELSIO_T5, chip_id(), adapter::chip_params, G_NUMPORTS, chip_params::nchan, and t4_read_reg().
Referenced by t4_port_init().
t4_get_scfg_version - return the Serial Configuration version @adapter: the adapter @vers: where to place the version
Reads the Serial Configuration Version via the Firmware interface (thus this can only be called once we're ready to issue Firmware commands). The format of the Serial Configuration version is adapter specific. Returns 0 on success, an error on failure.
Note that early versions of the Firmware didn't include the ability to retrieve the Serial Configuration version, so we zero-out the return-value parameter in that case to avoid leaving it with garbage in it.
Also note that the Firmware will return its cached copy of the Serial Initialization Revision ID, not the actual Revision ID as written in the Serial EEPROM. This is only an issue if a new VPD has been written and the Firmware/Chip haven't yet gone through a RESET sequence. So it's best to defer calling this routine till after a FW_RESET_CMD has been issued if the Host Driver will be performing a full adapter initialization.
Definition at line 3405 of file t4_hw.c.
References FW_PARAMS_MNEM_DEV, FW_PARAMS_PARAM_DEV_SCFGREV, adapter::mbox, adapter::pf, t4_query_params(), V_FW_PARAMS_MNEM, and V_FW_PARAMS_PARAM_X.
Referenced by collect_vpd_data(), and t4_get_version_info().
t4_get_tp_version - read the TP microcode version @adapter: the adapter @vers: where to place the version
Reads the TP microcode version from flash.
Definition at line 3338 of file t4_hw.c.
References FLASH_FW_START, and t4_read_flash().
Referenced by t4_get_version_info().
void t4_get_trace_filter | ( | struct adapter * | adap, |
struct trace_params * | tp, | ||
int | idx, | ||
int * | enabled | ||
) |
t4_get_trace_filter - query one of the tracing filters @adap: the adapter @tp: the current trace filter parameters @idx: which trace filter to query @enabled: non-zero if the filter is enabled
Returns the current settings of one of the HW tracing filters.
Definition at line 6718 of file t4_hw.c.
References A_MPS_TRC_FILTER0_DONT_CARE, A_MPS_TRC_FILTER0_MATCH, A_MPS_TRC_FILTER1_MATCH, A_MPS_TRC_FILTER_MATCH_CTL_A, A_MPS_TRC_FILTER_MATCH_CTL_B, trace_params::data, F_T5_TFEN, F_T5_TFINVERTMATCH, F_TFEN, F_TFINVERTMATCH, G_T5_TFPORT, G_TFCAPTUREMAX, G_TFLENGTH, G_TFMINPKTSIZE, G_TFOFFSET, G_TFPORT, trace_params::invert, is_t4(), trace_params::mask, trace_params::min_len, trace_params::port, trace_params::skip_len, trace_params::skip_ofst, trace_params::snap_len, t4_read_reg(), and TRACE_LEN.
Referenced by t4_get_tracer().
void t4_get_tx_sched | ( | struct adapter * | adap, |
unsigned int | sched, | ||
unsigned int * | kbps, | ||
unsigned int * | ipg, | ||
bool | sleep_ok | ||
) |
t4_get_tx_sched - get the configuration of a Tx HW traffic scheduler @adap: the adapter @sched: the scheduler index @kbps: the byte rate in Kbps @ipg: the interpacket delay in tenths of nanoseconds
Return the current configuration of a HW Tx scheduler.
Definition at line 10433 of file t4_hw.c.
References A_TP_TX_MOD_Q1_Q0_RATE_LIMIT, A_TP_TX_MOD_Q1_Q0_TIMER_SEPARATOR, vpd_params::cclk, core_ticks_per_usec(), adapter::params, t4_tp_tm_pio_read(), and adapter_params::vpd.
Referenced by collect_hw_sched(), and sysctl_hw_sched().
void t4_get_usm_stats | ( | struct adapter * | adap, |
struct tp_usm_stats * | st, | ||
bool | sleep_ok | ||
) |
t4_get_usm_stats - read TP's non-TCP DDP MIB counters @adap: the adapter @st: holds the counter values @sleep_ok: if true we may sleep while awaiting command completion
Returns the values of TP's counters for non-TCP directly-placed packets.
Definition at line 6297 of file t4_hw.c.
References A_TP_MIB_USM_PKTS, tp_usm_stats::drops, tp_usm_stats::frames, tp_usm_stats::octets, and t4_tp_mib_read().
Referenced by collect_ddp_stats(), and sysctl_ddp_stats().
int t4_get_version_info | ( | struct adapter * | adapter | ) |
t4_get_version_info - extract various chip/firmware version information @adapter: the adapter
Reads various chip/firmware version numbers and stores them into the adapter Adapter Parameters structure. If any of the efforts fails the first failure will be returned, but all of the version numbers will be read.
Definition at line 3463 of file t4_hw.c.
References adapter_params::bs_vers, adapter_params::er_vers, FIRST_RET, adapter_params::fw_vers, adapter::params, adapter_params::scfg_vers, t4_get_bs_version(), t4_get_exprom_version(), t4_get_fw_version(), t4_get_scfg_version(), t4_get_tp_version(), t4_get_vpd_version(), adapter_params::tp_vers, and adapter_params::vpd_vers.
Referenced by get_params__pre_init().
t4_get_vpd_version - return the VPD version @adapter: the adapter @vers: where to place the version
Reads the VPD via the Firmware interface (thus this can only be called once we're ready to issue Firmware commands). The format of the VPD version is adapter specific. Returns 0 on success, an error on failure.
Note that early versions of the Firmware didn't include the ability to retrieve the VPD version, so we zero-out the return-value parameter in that case to avoid leaving it with garbage in it.
Also note that the Firmware will return its cached copy of the VPD Revision ID, not the actual Revision ID as written in the Serial EEPROM. This is only an issue if a new VPD has been written and the Firmware/Chip haven't yet gone through a RESET sequence. So it's best to defer calling this routine till after a FW_RESET_CMD has been issued if the Host Driver will be performing a full adapter initialization.
Definition at line 3440 of file t4_hw.c.
References FW_PARAMS_MNEM_DEV, FW_PARAMS_PARAM_DEV_VPDREV, adapter::mbox, adapter::pf, t4_query_params(), V_FW_PARAMS_MNEM, and V_FW_PARAMS_PARAM_X.
Referenced by collect_vpd_data(), and t4_get_version_info().
t4_handle_fw_rpl - process a FW reply message @adap: the adapter @rpl: start of the FW message
Processes a FW message, such as link state change messages.
Definition at line 9052 of file t4_hw.c.
References fw_port_cmd::action_to_len16, adap2pinfo(), be32_to_cpu, CH_WARN_RATELIMIT, for_each_port, FW_PORT_ACTION_GET_PORT_INFO, FW_PORT_ACTION_GET_PORT_INFO32, FW_PORT_CMD, G_FW_PORT_CMD_ACTION, G_FW_PORT_CMD_PORTID, handle_port_info(), fw_port_cmd::op_to_portid, PORT_LOCK, PORT_UNLOCK, t4_os_link_changed(), t4_os_portmod_changed(), and port_info::tx_chan.
Referenced by t4_sge_modload().
|
static |
Definition at line 4104 of file t4_hw.c.
References A_PL_INT_CAUSE, intr_action::action, intr_info::actions, intr_info::cause_reg, intr_info::enable_reg, intr_info::fatal, intr_info::flags, NONFATAL_IF_DISABLED, t4_read_reg(), t4_show_intr_info(), and t4_write_reg().
Referenced by cim_intr_handler(), cplsw_intr_handler(), le_intr_handler(), ma_intr_handler(), mac_intr_handler(), mem_intr_handler(), mps_intr_handler(), ncsi_intr_handler(), pcie_intr_handler(), plpl_intr_handler(), pmrx_intr_handler(), pmtx_intr_handler(), sge_intr_handler(), smb_intr_handler(), t4_slow_intr_handler(), tp_intr_handler(), ulprx_intr_handler(), and ulptx_intr_handler().
Definition at line 164 of file t4_hw.c.
References A_PCIE_CFG_SPACE_DATA, A_PCIE_CFG_SPACE_REQ, CHELSIO_T5, chip_id(), F_ENABLE, F_LOCALCFG, F_T6_ENABLE, is_t4(), adapter::pf, t4_read_reg(), t4_write_reg(), V_FUNCTION, and V_REGISTER.
Referenced by collect_pcie_config(), setup_memwin(), and t4_read_pcie_cfg4().
int t4_i2c_io | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
int | port, | ||
unsigned int | devid, | ||
unsigned int | offset, | ||
unsigned int | len, | ||
u8 * | buf, | ||
bool | write | ||
) |
t4_i2c_io - read/write I2C data from adapter @adap: the adapter @port: Port number if per-port device; <0 if not @devid: per-port device ID or absolute device ID @offset: byte offset into device I2C space @len: byte length of I2C space data @buf: buffer in which to return I2C data for read buffer which holds the I2C data for write @write: if true, do a write; else do a read Reads/Writes the I2C data from/to the indicated device and location.
Definition at line 11042 of file t4_hw.c.
References fw_ldst_cmd::fw_ldst::fw_ldst_i2c::blen, fw_ldst_cmd::fw_ldst::fw_ldst_i2c::boffset, cpu_to_be32, fw_ldst_cmd::cycles_to_len16, fw_ldst_cmd::fw_ldst::fw_ldst_i2c::data, fw_ldst_cmd::fw_ldst::fw_ldst_i2c::did, F_FW_CMD_READ, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, FW_LDST_ADDRSPC_I2C, FW_LDST_CMD, FW_LEN16, fw_ldst_cmd::fw_ldst::i2c, I2C_PAGE_SIZE, fw_ldst_cmd::op_to_addrspace, fw_ldst_cmd::fw_ldst::fw_ldst_i2c::pid, port, t4_wr_mbox(), fw_ldst_cmd::u, V_FW_CMD_OP, and V_FW_LDST_CMD_ADDRSPACE.
Referenced by t4_i2c_rd(), and t4_i2c_wr().
int t4_i2c_rd | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
int | port, | ||
unsigned int | devid, | ||
unsigned int | offset, | ||
unsigned int | len, | ||
u8 * | buf | ||
) |
Definition at line 11092 of file t4_hw.c.
References port, and t4_i2c_io().
Referenced by cxgbe_ioctl(), and read_i2c().
int t4_i2c_wr | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
int | port, | ||
unsigned int | devid, | ||
unsigned int | offset, | ||
unsigned int | len, | ||
u8 * | buf | ||
) |
Definition at line 11100 of file t4_hw.c.
References port, and t4_i2c_io().
int t4_identify_port | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | viid, | ||
unsigned int | nblinks | ||
) |
t4_identify_port - identify a VI's port by blinking its LED @adap: the adapter @mbox: mailbox to use for the FW command @viid: the VI id @nblinks: how many times to blink LED at 2.5 Hz
Identifies a VI's port by blinking its LED.
Definition at line 8617 of file t4_hw.c.
References fw_vi_enable_cmd::blinkdur, cpu_to_be16, cpu_to_be32, F_FW_CMD_EXEC, F_FW_CMD_REQUEST, F_FW_VI_ENABLE_CMD_LED, FW_LEN16, FW_VI_ENABLE_CMD, fw_vi_enable_cmd::ien_to_len16, fw_vi_enable_cmd::op_to_viid, t4_wr_mbox(), V_FW_CMD_OP, and V_FW_VI_ENABLE_CMD_VIID.
void t4_idma_monitor | ( | struct adapter * | adapter, |
struct sge_idma_monitor_state * | idma, | ||
int | hz, | ||
int | ticks | ||
) |
t4_idma_monitor - monitor SGE Ingress DMA state @adapter: the adapter @idma: the adapter IDMA Monitor state @hz: number of ticks/second @ticks: number of ticks since the last IDMA Monitor call
Definition at line 10281 of file t4_hw.c.
References A_SGE_DEBUG_DATA_HIGH, A_SGE_DEBUG_DATA_LOW, A_SGE_DEBUG_INDEX, CH_WARN, sge_idma_monitor_state::idma_1s_thresh, sge_idma_monitor_state::idma_qid, sge_idma_monitor_state::idma_stalled, sge_idma_monitor_state::idma_state, sge_idma_monitor_state::idma_warn, SGE_IDMA_WARN_REPEAT, SGE_IDMA_WARN_THRESH, t4_read_reg(), t4_sge_decode_idma_state(), and t4_write_reg().
void t4_idma_monitor_init | ( | struct adapter * | adapter, |
struct sge_idma_monitor_state * | idma | ||
) |
t4_idma_monitor_init - initialize SGE Ingress DMA Monitor @adapter: the adapter @idma: the adapter IDMA Monitor state
Initialize the state of an SGE Ingress DMA Monitor.
Definition at line 10255 of file t4_hw.c.
References core_ticks_per_usec(), sge_idma_monitor_state::idma_1s_thresh, and sge_idma_monitor_state::idma_stalled.
int t4_init_devlog_params | ( | struct adapter * | adap, |
int | fw_attach | ||
) |
t4_init_devlog_params - initialize adapter->params.devlog @adap: the adapter @fw_attach: whether we can talk to the firmware
Initialize various fields of the adapter's Firmware Device Log Parameters structure.
Definition at line 9538 of file t4_hw.c.
References A_PCIE_FW_PF, be32_to_cpu, cpu_to_be32, adapter_params::devlog, F_FW_CMD_READ, F_FW_CMD_REQUEST, FW_DEVLOG_CMD, FW_LEN16, G_FW_DEVLOG_CMD_MEMADDR16_DEVLOG, G_FW_DEVLOG_CMD_MEMTYPE_DEVLOG, G_PCIE_FW_PF_DEVLOG_ADDR16, G_PCIE_FW_PF_DEVLOG_MEMTYPE, G_PCIE_FW_PF_DEVLOG_NENTRIES128, adapter::mbox, fw_devlog_cmd::memsize_devlog, devlog_params::memtype, fw_devlog_cmd::memtype_devlog_memaddr16_devlog, fw_devlog_cmd::op_to_write, adapter::params, PCIE_FW_PF_DEVLOG, PCIE_FW_REG, fw_devlog_cmd::retval_len16, devlog_params::size, devlog_params::start, t4_read_reg(), t4_wr_mbox(), and V_FW_CMD_OP.
Referenced by collect_fw_devlog(), get_params__pre_init(), and t4_attach().
int t4_init_sge_params | ( | struct adapter * | adapter | ) |
t4_init_sge_params - initialize adap->params.sge @adapter: the adapter
Initialize various fields of the adapter's SGE Parameters structure.
Definition at line 9603 of file t4_hw.c.
References A_SGE_CONM_CTRL, A_SGE_CONTROL, A_SGE_CONTROL2, A_SGE_EGRESS_QUEUES_PER_PAGE_PF, A_SGE_HOST_PAGE_SIZE, A_SGE_INGRESS_QUEUES_PER_PAGE_PF, A_SGE_INGRESS_RX_THRESHOLD, A_SGE_ITP_CONTROL, A_SGE_TIMER_VALUE_0_AND_1, A_SGE_TIMER_VALUE_2_AND_3, A_SGE_TIMER_VALUE_4_AND_5, CHELSIO_T5, CHELSIO_T6, chip_id(), core_ticks_to_us(), sge_params::counter_val, sge_params::eq_s_qpp, F_EGRSTATUSPAGESIZE, sge_params::fl_pktshift, sge_params::fl_starve_threshold, sge_params::fl_starve_threshold2, G_EGRTHRESHOLD, G_EGRTHRESHOLDPACKING, G_INGPACKBOUNDARY, G_INGPADBOUNDARY, G_PKTSHIFT, G_T6_EGRTHRESHOLDPACKING, G_THRESHOLD_0, G_THRESHOLD_1, G_THRESHOLD_2, G_THRESHOLD_3, G_TIMERVALUE0, G_TIMERVALUE1, G_TIMERVALUE2, G_TIMERVALUE3, G_TIMERVALUE4, G_TIMERVALUE5, G_TSCALE, sge_params::iq_s_qpp, is_t4(), is_t5(), M_HOSTPAGESIZEPF0, M_QUEUESPERPAGEPF0, sge_params::pack_boundary, sge_params::pad_boundary, sge_params::page_shift, adapter::params, adapter::pf, r, S_HOSTPAGESIZEPF0, S_HOSTPAGESIZEPF1, S_QUEUESPERPAGEPF0, S_QUEUESPERPAGEPF1, adapter_params::sge, sge_params::sge_control, sge_params::spg_len, t4_read_reg(), sge_params::timer_val, tscale, X_INGPADBOUNDARY_SHIFT, and X_T6_INGPADBOUNDARY_SHIFT.
Referenced by get_params__post_init().
int t4_init_tp_params | ( | struct adapter * | adap | ) |
t4_init_tp_params - initialize adap->params.tp @adap: the adapter
Initialize various fields of the adapter's TP Parameters structure.
Definition at line 9779 of file t4_hw.c.
References A_TP_OUT_CONFIG, A_TP_PARA_REG2, A_TP_PARA_REG7, A_TP_PMM_RX_PAGE_SIZE, A_TP_PMM_TX_PAGE_SIZE, A_TP_TIMER_RESOLUTION, CHELSIO_T5, chip_id(), tp_params::dack_re, F_CRXPKTENC, G_DELAYEDACKRESOLUTION, G_MAXRXDATA, G_PMMAXXFERLEN0, G_PMMAXXFERLEN1, G_TIMERRESOLUTION, MAX_NCHAN, tp_params::max_rx_pdu, tp_params::max_tx_pdu, adapter::params, r, read_filter_mode_and_ingress_config(), tp_params::rx_pkt_encap, t4_read_reg(), adapter_params::tp, tp_params::tre, and tp_params::tx_modq.
Referenced by get_params__post_init().
void t4_intr_clear | ( | struct adapter * | adap | ) |
t4_intr_clear - clear all interrupts @adap: the adapter whose interrupts should be cleared
Clears all interrupts. The caller must be a PCI function managing global interrupts.
Definition at line 5445 of file t4_hw.c.
References A_CIM_HOST_INT_CAUSE, A_CIM_HOST_UPACC_INT_CAUSE, A_CIM_PF_HOST_INT_CAUSE, A_CPL_INTR_CAUSE, A_EDC_INT_CAUSE, A_LE_DB_INT_CAUSE, A_MA_INT_CAUSE, A_MA_INT_WRAP_STATUS, A_MA_PARITY_ERROR_STATUS1, A_MA_PARITY_ERROR_STATUS2, A_MAC_PORT_INT_CAUSE, A_MAC_PORT_PERR_INT_CAUSE, A_MAC_PORT_PERR_INT_CAUSE_100G, A_MC_INT_CAUSE, A_MC_P_INT_CAUSE, A_MPS_CLS_INT_CAUSE, A_MPS_INT_CAUSE, A_MPS_RX_PERR_INT_CAUSE, A_MPS_STAT_PERR_INT_CAUSE_RX_FIFO, A_MPS_STAT_PERR_INT_CAUSE_SRAM, A_MPS_STAT_PERR_INT_CAUSE_SRAM1, A_MPS_STAT_PERR_INT_CAUSE_TX_FIFO, A_MPS_TRC_INT_CAUSE, A_MPS_TX_INT_CAUSE, A_NCSI_INT_CAUSE, A_PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS, A_PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS, A_PCIE_INT_CAUSE, A_PCIE_NONFAT_ERR, A_PL_INT_CAUSE, A_PL_PERR_CAUSE, A_PL_PF_INT_CAUSE, A_PL_PL_INT_CAUSE, A_PM_RX_INT_CAUSE, A_PM_TX_INT_CAUSE, A_SGE_INT_CAUSE1, A_SGE_INT_CAUSE2, A_SGE_INT_CAUSE3, A_SGE_INT_CAUSE4, A_SGE_INT_CAUSE5, A_SGE_INT_CAUSE6, A_SMB_INT_CAUSE, A_TP_INT_CAUSE, A_ULP_RX_INT_CAUSE, A_ULP_RX_INT_CAUSE_2, A_ULP_TX_INT_CAUSE, A_ULP_TX_INT_CAUSE_2, A_XGMAC_PORT_INT_CAUSE, ARRAY_SIZE, intr_info::cause_reg, CHELSIO_T5, CHELSIO_T6, chip_id(), adapter::chip_params, EDC_REG, is_t4(), is_t5(), MC_REG, MYPF_REG, chip_params::nchan, PORT_REG, t4_read_reg(), t4_write_reg(), and T5_PORT_REG.
Referenced by t4_attach(), and t4_resume().
void t4_intr_disable | ( | struct adapter * | adap | ) |
t4_intr_disable - disable interrupts @adap: the adapter whose interrupts should be disabled
Disable interrupts. We only disable the top-level interrupt concentrators. The caller must be a PCI function managing global interrupts.
Definition at line 5431 of file t4_hw.c.
References A_PL_INT_MAP0, A_PL_PF_INT_ENABLE, MYPF_REG, adapter::pf, t4_set_reg_field(), and t4_write_reg().
Referenced by t4_detach_common(), and t4_shutdown_adapter().
void t4_intr_enable | ( | struct adapter * | adap | ) |
t4_intr_enable - enable interrupts @adapter: the adapter whose interrupts should be enabled
Enable PF-specific interrupts for the calling function and the top-level interrupt concentrator for global interrupts. Interrupts are already enabled at each module, here we just enable the roots of the interrupt hierarchies.
Note: this function should be called only when the driver manages non PF-specific interrupts from the various HW modules. Only one PCI function at a time should be doing this.
Definition at line 5403 of file t4_hw.c.
References A_PL_INT_ENABLE, A_PL_INT_MAP0, A_PL_PF_INT_ENABLE, A_SGE_INT_ENABLE3, CHELSIO_T5, chip_id(), F_DBFIFO_HP_INT, F_DBFIFO_LP_INT, F_EGRESS_SIZE_ERR, F_ERR_BAD_DB_PIDX0, F_ERR_BAD_DB_PIDX1, F_ERR_BAD_DB_PIDX2, F_ERR_BAD_DB_PIDX3, F_ERR_CPL_EXCEED_IQE_SIZE, F_ERR_CPL_OPCODE_0, F_ERR_DATA_CPL_ON_HIGH_QID0, F_ERR_DATA_CPL_ON_HIGH_QID1, F_ERR_DROPPED_DB, F_ERR_EGR_CTXT_PRIO, F_ERR_ING_CTXT_PRIO, F_ERR_INVALID_CIDX_INC, F_ERR_PCIE_ERROR0, F_ERR_PCIE_ERROR1, F_FATAL_WRE_LEN, F_I2CM, F_INGRESS_SIZE_ERR, F_SF, MYPF_REG, adapter::pf, PF_INTR_MASK, t4_set_reg_field(), and t4_write_reg().
Referenced by adapter_full_init().
int t4_iq_free | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | pf, | ||
unsigned int | vf, | ||
unsigned int | iqtype, | ||
unsigned int | iqid, | ||
unsigned int | fl0id, | ||
unsigned int | fl1id | ||
) |
t4_iq_free - free an ingress queue and its FLs @adap: the adapter @mbox: mailbox to use for the FW command @pf: the PF owning the queues @vf: the VF owning the queues @iqtype: the ingress queue type (FW_IQ_TYPE_FL_INT_CAP, etc.) @iqid: ingress queue id @fl0id: FL0 queue id or 0xffff if no attached FL0 @fl1id: FL1 queue id or 0xffff if no attached FL1
Frees an ingress queue and its associated FLs, if any.
Definition at line 8677 of file t4_hw.c.
References fw_iq_cmd::alloc_to_len16, cpu_to_be16, cpu_to_be32, F_FW_CMD_EXEC, F_FW_CMD_REQUEST, F_FW_IQ_CMD_FREE, fw_iq_cmd::fl0id, fw_iq_cmd::fl1id, FW_IQ_CMD, FW_LEN16, fw_iq_cmd::iqid, fw_iq_cmd::op_to_vfn, t4_wr_mbox(), fw_iq_cmd::type_to_iqandstindex, V_FW_CMD_OP, V_FW_IQ_CMD_PFN, V_FW_IQ_CMD_TYPE, and V_FW_IQ_CMD_VFN.
Referenced by free_iq_fl_hwq().
int t4_iq_stop | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | pf, | ||
unsigned int | vf, | ||
unsigned int | iqtype, | ||
unsigned int | iqid, | ||
unsigned int | fl0id, | ||
unsigned int | fl1id | ||
) |
t4_iq_stop - stop an ingress queue and its FLs @adap: the adapter @mbox: mailbox to use for the FW command @pf: the PF owning the queues @vf: the VF owning the queues @iqtype: the ingress queue type (FW_IQ_TYPE_FL_INT_CAP, etc.) @iqid: ingress queue id @fl0id: FL0 queue id or 0xffff if no attached FL0 @fl1id: FL1 queue id or 0xffff if no attached FL1
Stops an ingress queue and its associated FLs, if any. This causes any current or future data/messages destined for these queues to be tossed.
Definition at line 8646 of file t4_hw.c.
References fw_iq_cmd::alloc_to_len16, cpu_to_be16, cpu_to_be32, F_FW_CMD_EXEC, F_FW_CMD_REQUEST, F_FW_IQ_CMD_IQSTOP, fw_iq_cmd::fl0id, fw_iq_cmd::fl1id, FW_IQ_CMD, FW_LEN16, fw_iq_cmd::iqid, fw_iq_cmd::op_to_vfn, t4_wr_mbox(), fw_iq_cmd::type_to_iqandstindex, V_FW_CMD_OP, V_FW_IQ_CMD_PFN, V_FW_IQ_CMD_TYPE, and V_FW_IQ_CMD_VFN.
const char * t4_link_down_rc_str | ( | unsigned char | link_down_rc | ) |
t4_link_down_rc_str - return a string for a Link Down Reason Code @link_down_rc: Link Down Reason Code
Returns a string representation of the Link Down Reason Code.
Definition at line 8802 of file t4_hw.c.
References ARRAY_SIZE.
Referenced by sysctl_linkdnrc().
int t4_link_l1cfg | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | port, | ||
struct link_config * | lc | ||
) |
t4_link_l1cfg - apply link configuration to MAC/PHY @phy: the PHY to setup @mac: the MAC to setup @lc: the requested link configuration
Set up a port's MAC and PHY according to a desired link configuration.
Definition at line 3880 of file t4_hw.c.
References fw_port_cmd::action_to_len16, AUTONEG_DISABLE, AUTONEG_ENABLE, adapter::bt_map, CH_WARN, cpu_to_be32, F_FW_CMD_EXEC, F_FW_CMD_REQUEST, FEC_AUTO, link_config::fec_hint, FEC_MODULE, fec_supported(), fec_to_fwcap(), link_config::force_fec, FW_LEN16, FW_PORT_ACTION_L1_CFG, FW_PORT_ACTION_L1_CFG32, FW_PORT_CAP32_ANEG, FW_PORT_CAP32_FC_RX, FW_PORT_CAP32_FC_TX, FW_PORT_CAP32_FEC_BASER_RS, FW_PORT_CAP32_FEC_NO_FEC, FW_PORT_CAP32_FEC_RS, FW_PORT_CAP32_FORCE_FEC, FW_PORT_CAP32_FORCE_PAUSE, FW_PORT_CAP32_MDI_AUTO, FW_PORT_CAP32_SPEED_100G, FW_PORT_CAP32_SPEED_50G, FW_PORT_CMD, fwcap_top_speed(), fwcaps32_to_caps16(), fw_port_cmd::fw_port::l1cfg, fw_port_cmd::fw_port::l1cfg32, M_FW_PORT_CAP32_FEC, M_FW_PORT_CAP32_SPEED, fw_port_cmd::op_to_portid, adapter::params, PAUSE_AUTONEG, PAUSE_RX, PAUSE_TX, link_config::pcaps, port, adapter_params::port_caps32, fw_port_cmd::fw_port::fw_port_l1cfg::rcap, fw_port_cmd::fw_port::fw_port_l1cfg32::rcap32, link_config::requested_aneg, link_config::requested_caps, link_config::requested_fc, link_config::requested_fec, link_config::requested_speed, speed_to_fwcap(), t4_wr_mbox_ns(), fw_port_cmd::u, V_FW_CMD_OP, V_FW_PORT_CAP32_MDI, V_FW_PORT_CAP32_SPEED, V_FW_PORT_CMD_ACTION, and V_FW_PORT_CMD_PORTID.
Referenced by apply_link_config().
int t4_load_boot | ( | struct adapter * | adap, |
u8 * | boot_data, | ||
unsigned int | boot_addr, | ||
unsigned int | size | ||
) |
Definition at line 10706 of file t4_hw.c.
References BOOT_MAX_SIZE, BOOT_SIGNATURE, CH_ERR, pcir_data_structure::device_id, DIV_ROUND_UP, FLASH_FW_START, FLASH_FW_START_SEC, le16_to_cpu, le32_to_cpu, modify_device_id(), adapter::params, PCI_DEVICE_ID, pci_expansion_rom_header::pcir_offset, PCIR_SIGNATURE, adapter_params::sf_nsec, SF_PAGE_SIZE, adapter_params::sf_size, pci_expansion_rom_header::signature, pcir_data_structure::signature, t4_flash_erase_sectors(), t4_os_pci_read_cfg2(), t4_write_flash(), pcir_data_structure::vendor_id, and VENDOR_ID.
Referenced by load_boot().
Definition at line 10847 of file t4_hw.c.
References CH_ERR, DIV_ROUND_UP, FLASH_BOOTCFG_MAX_SIZE, adapter::params, adapter_params::sf_nsec, SF_PAGE_SIZE, SF_SEC_SIZE, adapter_params::sf_size, t4_flash_bootcfg_addr(), t4_flash_erase_sectors(), and t4_write_flash().
Referenced by load_bootcfg().
t4_load_cfg - download config file @adap: the adapter @cfg_data: the cfg text file to write @size: text file size
Write the supplied config text file to the card's serial flash.
Definition at line 10470 of file t4_hw.c.
References CH_ERR, DIV_ROUND_UP, FLASH_CFG_MAX_SIZE, adapter::params, adapter_params::sf_nsec, SF_PAGE_SIZE, SF_SEC_SIZE, adapter_params::sf_size, t4_flash_cfg_addr(), t4_flash_erase_sectors(), and t4_write_flash().
Referenced by load_cfg().
t4_load_fw - download firmware @adap: the adapter @fw_data: the firmware image to write @size: image size
Write the supplied firmware image to the card's serial flash.
Definition at line 3569 of file t4_hw.c.
References be16_to_cpu, be32_to_cpu, CH_ERR, cpu_to_be32, DIV_ROUND_UP, FLASH_FW_MAX_SIZE, FLASH_FW_START, FLASH_FW_START_SEC, FLASH_FWBOOTSTRAP_MAX_SIZE, FLASH_FWBOOTSTRAP_START, FLASH_FWBOOTSTRAP_START_SEC, FW_HDR_MAGIC_BOOTSTRAP, fw_hdr::fw_ver, fw_hdr::len512, fw_hdr::magic, adapter::params, adapter_params::sf_nsec, SF_PAGE_SIZE, adapter_params::sf_size, t4_flash_erase_sectors(), t4_fw_matches_chip(), and t4_write_flash().
Referenced by load_fw(), and t4_fw_upgrade().
void t4_load_mtus | ( | struct adapter * | adap, |
const unsigned short * | mtus, | ||
const unsigned short * | alpha, | ||
const unsigned short * | beta | ||
) |
t4_load_mtus - write the MTU and congestion control HW tables @adap: the adapter @mtus: the values for the MTU table @alpha: the values for the congestion control alpha parameter @beta: the values for the congestion control beta parameter
Write the HW MTU table with the supplied MTUs and the high-speed congestion control table with the supplied alpha, beta, and MTUs. We write the two tables together because the additive increments depend on the MTUs.
Definition at line 6444 of file t4_hw.c.
References A_TP_CCTRL_TABLE, A_TP_MTU_TABLE, CC_MIN_INCR, NCCTRL_WIN, NMTUS, t4_write_reg(), V_MTUINDEX, V_MTUVALUE, and V_MTUWIDTH.
Referenced by get_params__post_init().
t4_mc_read - read from MC through backdoor accesses @adap: the adapter @idx: which MC to access @addr: address of first byte requested @data: 64 bytes of data containing the requested address @ecc: where to store the corresponding 64-bit ECC word
Read 64 bytes of data from MC starting at a 64-byte-aligned address that covers the requested address @addr. If @parity is not NULL it is assigned the 64-bit ECC word for the read data.
Definition at line 567 of file t4_hw.c.
References A_MC_BIST_CMD, A_MC_BIST_CMD_ADDR, A_MC_BIST_CMD_LEN, A_MC_BIST_DATA_PATTERN, A_MC_BIST_STATUS_RDATA, A_MC_P_BIST_CMD, A_MC_P_BIST_CMD_ADDR, A_MC_P_BIST_CMD_LEN, A_MC_P_BIST_DATA_PATTERN, A_MC_P_BIST_STATUS_RDATA, F_START_BIST, is_t4(), MC_DATA, MC_REG, t4_read_reg(), t4_read_reg64(), t4_wait_op_done(), t4_write_reg(), V_BIST_CMD_GAP, and V_BIST_OPCODE.
Referenced by t4_mem_read().
int t4_mdio_rd | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | phy_addr, | ||
unsigned int | mmd, | ||
unsigned int | reg, | ||
unsigned int * | valp | ||
) |
t4_mdio_rd - read a PHY register through MDIO @adap: the adapter @mbox: mailbox to use for the FW command @phy_addr: the PHY address @mmd: the PHY MMD to access (0 for clause 22 PHYs) @reg: the register to read @valp: where to store the value
Issues a FW command through the given mailbox to read a PHY register.
Definition at line 7233 of file t4_hw.c.
References be16_to_cpu, cpu_to_be16, cpu_to_be32, fw_ldst_cmd::cycles_to_len16, F_FW_CMD_READ, F_FW_CMD_REQUEST, FW_LDST_ADDRSPC_MDIO, FW_LDST_CMD, FW_LEN16, fw_ldst_cmd::fw_ldst::mdio, fw_ldst_cmd::op_to_addrspace, fw_ldst_cmd::fw_ldst::fw_ldst_mdio::paddr_mmd, fw_ldst_cmd::fw_ldst::fw_ldst_mdio::raddr, fw_ldst_cmd::fw_ldst::fw_ldst_mdio::rval, t4_wr_mbox(), fw_ldst_cmd::u, V_FW_CMD_OP, V_FW_LDST_CMD_ADDRSPACE, V_FW_LDST_CMD_MMD, and V_FW_LDST_CMD_PADDR.
Referenced by sysctl_btphy().
int t4_mdio_wr | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | phy_addr, | ||
unsigned int | mmd, | ||
unsigned int | reg, | ||
unsigned int | val | ||
) |
t4_mdio_wr - write a PHY register through MDIO @adap: the adapter @mbox: mailbox to use for the FW command @phy_addr: the PHY address @mmd: the PHY MMD to access (0 for clause 22 PHYs) @reg: the register to write @valp: value to write
Issues a FW command through the given mailbox to write a PHY register.
Definition at line 7267 of file t4_hw.c.
References cpu_to_be16, cpu_to_be32, fw_ldst_cmd::cycles_to_len16, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, FW_LDST_ADDRSPC_MDIO, FW_LDST_CMD, FW_LEN16, fw_ldst_cmd::fw_ldst::mdio, fw_ldst_cmd::op_to_addrspace, fw_ldst_cmd::fw_ldst::fw_ldst_mdio::paddr_mmd, fw_ldst_cmd::fw_ldst::fw_ldst_mdio::raddr, fw_ldst_cmd::fw_ldst::fw_ldst_mdio::rval, t4_wr_mbox(), fw_ldst_cmd::u, V_FW_CMD_OP, V_FW_LDST_CMD_ADDRSPACE, V_FW_LDST_CMD_MMD, and V_FW_LDST_CMD_PADDR.
t4_mem_read - read EDC 0, EDC 1 or MC into buffer @adap: the adapter @mtype: memory type: MEM_EDC0, MEM_EDC1 or MEM_MC @addr: address within indicated memory type @len: amount of memory to read @buf: host memory buffer
Reads an [almost] arbitrary memory region in the firmware: the firmware memory address, length and host buffer must be aligned on 32-bit boudaries. The memory is returned as a raw byte sequence from the firmware's memory. If this memory contains data structures which contain multi-byte integers, it's the callers responsibility to perform appropriate byte order conversions.
Definition at line 690 of file t4_hw.c.
References MEM_MC, MEM_MC1, t4_edc_read(), and t4_mc_read().
void t4_mk_filtdelwr | ( | unsigned int | ftid, |
struct fw_filter_wr * | wr, | ||
int | qid | ||
) |
Definition at line 7183 of file t4_hw.c.
References cpu_to_be16, cpu_to_be32, fw_filter_wr::del_filter_to_l2tix, F_FW_FILTER_WR_DEL_FILTER, FW_FILTER_WR, fw_filter_wr::len16_pkd, fw_filter_wr::op_pkd, fw_filter_wr::rx_chan_rx_rpl_iq, fw_filter_wr::tid_to_iq, V_FW_FILTER_WR_NOREPLY, V_FW_FILTER_WR_RX_RPL_IQ, V_FW_FILTER_WR_TID, V_FW_WR_LEN16, and V_FW_WR_OP.
Referenced by del_tcamfilter().
int t4_ofld_eq_free | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | pf, | ||
unsigned int | vf, | ||
unsigned int | eqid | ||
) |
t4_ofld_eq_free - free an offload egress queue @adap: the adapter @mbox: mailbox to use for the FW command @pf: the PF owning the queue @vf: the VF owning the queue @eqid: egress queue id
Frees a control egress queue.
Definition at line 8781 of file t4_hw.c.
References fw_eq_ofld_cmd::alloc_to_len16, cpu_to_be32, fw_eq_ofld_cmd::eqid_pkd, F_FW_CMD_EXEC, F_FW_CMD_REQUEST, F_FW_EQ_OFLD_CMD_FREE, FW_EQ_OFLD_CMD, FW_LEN16, fw_eq_ofld_cmd::op_to_vfn, t4_wr_mbox(), V_FW_CMD_OP, V_FW_EQ_OFLD_CMD_EQID, V_FW_EQ_OFLD_CMD_PFN, and V_FW_EQ_OFLD_CMD_VFN.
Referenced by free_eq_hwq().
t4_pmrx_get_stats - returns the HW stats from PMRX @adap: the adapter @cnt: where to store the count statistics @cycles: where to store the cycle statistics
Returns performance statistics from PMRX.
Definition at line 6787 of file t4_hw.c.
References A_PM_RX_DBG_CTRL, A_PM_RX_DBG_DATA, A_PM_RX_DBG_STAT_MSB, A_PM_RX_STAT_CONFIG, A_PM_RX_STAT_COUNT, A_PM_RX_STAT_LSB, adapter::chip_params, is_t4(), chip_params::pm_stats_cnt, t4_read_indirect(), t4_read_reg(), t4_read_reg64(), and t4_write_reg().
Referenced by collect_pm_stats(), and sysctl_pm_stats().
t4_pmtx_get_stats - returns the HW stats from PMTX @adap: the adapter @cnt: where to store the count statistics @cycles: where to store the cycle statistics
Returns performance statistics from PMTX.
Definition at line 6760 of file t4_hw.c.
References A_PM_TX_DBG_CTRL, A_PM_TX_DBG_DATA, A_PM_TX_DBG_STAT_MSB, A_PM_TX_STAT_CONFIG, A_PM_TX_STAT_COUNT, A_PM_TX_STAT_LSB, adapter::chip_params, is_t4(), chip_params::pm_stats_cnt, t4_read_indirect(), t4_read_reg(), t4_read_reg64(), and t4_write_reg().
Referenced by collect_pm_stats(), and sysctl_pm_stats().
int t4_port_init | ( | struct adapter * | adap, |
int | mbox, | ||
int | pf, | ||
int | vf, | ||
int | port_id | ||
) |
Definition at line 9874 of file t4_hw.c.
References adap2pinfo(), adapter::flags, FW_CMD_CAP_PORT, FW_PARAMS_MNEM_DEV, FW_PARAMS_PARAM_DEV_RSSINFO, IS_VF, port_info::lport, port_info::mps_bg_map, adapter::params, port_info::port_id, adapter_params::portvec, vf_resources::r_caps, vi_info::rss_base, vi_info::rss_size, port_info::rx_c_chan, port_info::rx_e_chan_map, t4_alloc_vi(), t4_get_mps_bg_map(), t4_get_rx_c_chan(), t4_get_rx_e_chan_map(), t4_os_set_hw_addr(), t4_query_params(), t4_update_port_info(), port_info::tx_chan, V_FW_PARAMS_MNEM, V_FW_PARAMS_PARAM_X, V_FW_PARAMS_PARAM_YZ, adapter_params::vfres, vi_info::vfvld, port_info::vi, vi_info::viid, and vi_info::vin.
Referenced by t4_attach(), t4_resume(), and t4vf_attach().
t4_prep_adapter - prepare SW and HW for operation @adapter: the adapter @buf: temporary space of at least VPD_LEN size provided by the caller.
Initialize adapter SW state for the various HW modules, set initial values for some adapter tunables, take PHYs out of reset, and initialize the MDIO interface.
Definition at line 9334 of file t4_hw.c.
References A_PL_REV, adapter_params::a_wnd, adapter_params::b_wnd, vpd_params::cclk, CH_ALERT, CHELSIO_T4, chip_id(), adapter::chip_params, adapter_params::chipid, adapter_params::cim_la_size, CIMLA_SIZE, adapter_params::fpga, G_CHIPID, G_REV, get_pci_mode(), get_vpd_params(), init_cong_ctrl(), adapter_params::nports, adapter::params, adapter_params::pci, PCI_CAP_ID_VPD, PCI_DEVICE_ID, adapter_params::portvec, adapter_params::rev, set_pcie_completion_timeout(), t4_get_chip_params(), t4_get_flash_params(), t4_os_find_pci_capability(), t4_os_pci_read_cfg2(), t4_read_reg(), adapter_params::vpd, and pci_params::vpd_cap_addr.
Referenced by t4_attach().
int t4_query_params | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | pf, | ||
unsigned int | vf, | ||
unsigned int | nparams, | ||
const u32 * | params, | ||
u32 * | val | ||
) |
Definition at line 7825 of file t4_hw.c.
References t4_query_params_rw().
Referenced by alloc_extra_vi(), apply_cfg_and_initialize(), collect_tid(), get_params__post_init(), get_params__pre_init(), read_filter_mode_and_ingress_config(), sysctl_loadavg(), sysctl_temperature(), sysctl_vdd(), t4_configure_add_smac(), t4_configure_ringbb(), t4_get_rx_c_chan(), t4_get_scfg_version(), t4_get_vpd_version(), t4_port_init(), and t4vf_query_params().
int t4_query_params_rw | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | pf, | ||
unsigned int | vf, | ||
unsigned int | nparams, | ||
const u32 * | params, | ||
u32 * | val, | ||
int | rw | ||
) |
t4_query_params_rw - query FW or device parameters @adap: the adapter @mbox: mailbox to use for the FW command @pf: the PF @vf: the VF @nparams: the number of parameters @params: the parameter names @val: the parameter values @rw: Write and read flag
Reads the value of FW or device parameters. Up to 7 parameters can be queried at once.
Definition at line 7793 of file t4_hw.c.
References be32_to_cpu, cpu_to_be32, F_FW_CMD_READ, F_FW_CMD_REQUEST, FW_LEN16, FW_PARAMS_CMD, fw_params_cmd::fw_params_param::mnem, fw_params_cmd::op_to_vfn, fw_params_cmd::param, fw_params_cmd::retval_len16, t4_wr_mbox(), V_FW_CMD_OP, V_FW_PARAMS_CMD_PFN, V_FW_PARAMS_CMD_VFN, and fw_params_cmd::fw_params_param::val.
Referenced by t4_query_params().
t4_read_cim_ibq - read the contents of a CIM inbound queue @adap: the adapter @qid: the queue index @data: where to store the queue contents
: capacity of @data in 32-bit words
Reads the contents of the selected CIM queue starting at address 0 up to the capacity of @data.
must be a multiple of 4. Returns < 0 on error and the number of 32-bit words actually read on success.
Definition at line 9966 of file t4_hw.c.
References A_CIM_IBQ_DBG_CFG, A_CIM_IBQ_DBG_DATA, CIM_IBQ_SIZE, F_IBQDBGBUSY, F_IBQDBGEN, t4_read_reg(), t4_wait_op_done(), t4_write_reg(), and V_IBQDBGADDR.
Referenced by read_cim_ibq(), and sysctl_cim_ibq_obq().
t4_read_cim_obq - read the contents of a CIM outbound queue @adap: the adapter @qid: the queue index @data: where to store the queue contents
: capacity of @data in 32-bit words
Reads the contents of the selected CIM queue starting at address 0 up to the capacity of @data.
must be a multiple of 4. Returns < 0 on error and the number of 32-bit words actually read on success.
Definition at line 10008 of file t4_hw.c.
References A_CIM_OBQ_DBG_CFG, A_CIM_OBQ_DBG_DATA, A_CIM_QUEUE_CONFIG_CTRL, A_CIM_QUEUE_CONFIG_REF, adapter::chip_params, chip_params::cim_num_obq, F_OBQDBGBUSY, F_OBQDBGEN, F_OBQSELECT, G_CIMQBASE, G_CIMQSIZE, t4_read_reg(), t4_wait_op_done(), t4_write_reg(), V_OBQDBGADDR, and V_QUENUMSELECT.
Referenced by read_cim_obq(), and sysctl_cim_ibq_obq().
t4_read_cimq_cfg - read CIM queue configuration @adap: the adapter @base: holds the queue base addresses in bytes @size: holds the queue sizes in bytes @thres: holds the queue full thresholds in bytes
Returns the current configuration of the CIM queues, starting with the IBQs, then the OBQs.
Definition at line 9931 of file t4_hw.c.
References A_CIM_QUEUE_CONFIG_CTRL, A_CIM_QUEUE_CONFIG_REF, adapter::chip_params, CIM_NUM_IBQ, chip_params::cim_num_obq, F_IBQSELECT, F_OBQSELECT, G_CIMQBASE, G_CIMQSIZE, G_QUEFULLTHRSH, t4_read_reg(), t4_write_reg(), and V_QUENUMSELECT.
Referenced by collect_cim_qcfg(), and sysctl_cim_qcfg().
t4_read_cong_tbl - reads the congestion control table @adap: the adapter @incr: where to store the alpha values
Reads the additive increments programmed into the HW congestion control table.
Definition at line 6355 of file t4_hw.c.
References A_TP_CCTRL_TABLE, NCCTRL_WIN, NMTUS, t4_read_reg(), t4_write_reg(), and V_ROWINDEX.
Referenced by collect_cctrl(), and sysctl_cctrl().
int t4_read_flash | ( | struct adapter * | adapter, |
unsigned int | addr, | ||
unsigned int | nwords, | ||
u32 * | data, | ||
int | byte_oriented | ||
) |
t4_read_flash - read words from serial flash @adapter: the adapter @addr: the start address for the read @nwords: how many 32-bit words to read @data: where to store the read data @byte_oriented: whether to store data as bytes or as words
Read the specified number of 32-bit words from the serial flash. If @byte_oriented is set the read data is stored as a byte array (i.e., big-endian), otherwise as 32-bit words in the platform's natural endianness.
Definition at line 3198 of file t4_hw.c.
References __force, A_SF_OP, cpu_to_be32, adapter::params, sf1_read(), sf1_write(), SF_RD_DATA_FAST, adapter_params::sf_size, swab32, and t4_write_reg().
Referenced by read_flash(), t4_get_bs_version(), t4_get_exprom_version(), t4_get_fw_hdr(), t4_get_fw_version(), t4_get_tp_version(), and t4_write_flash().
void t4_read_indirect | ( | struct adapter * | adap, |
unsigned int | addr_reg, | ||
unsigned int | data_reg, | ||
u32 * | vals, | ||
unsigned int | nregs, | ||
unsigned int | start_idx | ||
) |
t4_read_indirect - read indirectly addressed registers @adap: the adapter @addr_reg: register holding the indirect address @data_reg: register holding the value of the indirect register @vals: where the read register values are stored @nregs: how many indirect registers to read @start_idx: index of first indirect register to read
Reads registers that are accessed indirectly through an address/data register pair.
Definition at line 121 of file t4_hw.c.
References t4_read_reg(), and t4_write_reg().
Referenced by collect_full(), collect_hma_indirect(), collect_ma_indirect(), collect_pcie_indirect(), collect_pm_indirect(), collect_sge_indirect(), cxgbe_refresh_stats(), pmtx_dump_dbg_stats(), t4_pmrx_get_stats(), t4_pmtx_get_stats(), and t4_tp_indirect_rw().
t4_read_mtu_tbl - returns the values in the HW path MTU table @adap: the adapter @mtus: where to store the MTU values @mtu_log: where to store the MTU base-2 log (may be NULL)
Reads the HW path MTU table.
Definition at line 6332 of file t4_hw.c.
References A_TP_MTU_TABLE, G_MTUVALUE, G_MTUWIDTH, NMTUS, t4_read_reg(), t4_write_reg(), V_MTUINDEX, and V_MTUVALUE.
Referenced by collect_path_mtu(), get_params__post_init(), and sysctl_path_mtus().
void t4_read_pace_tbl | ( | struct adapter * | adap, |
unsigned int | pace_vals[NTX_SCHED] | ||
) |
t4_read_pace_tbl - read the pace table @adap: the adapter @pace_vals: holds the returned values
Returns the values of TP's pace table in microseconds.
Definition at line 10413 of file t4_hw.c.
References A_TP_PACE_TABLE, dack_ticks_to_usec(), NTX_SCHED, t4_read_reg(), and t4_write_reg().
Referenced by collect_hw_sched(), and sysctl_hw_sched().
Definition at line 742 of file t4_hw.c.
References be32_to_cpu, CH_WARN, cpu_to_be32, fw_ldst_cmd::fw_ldst::fw_ldst_pcie::ctrl_to_fn, fw_ldst_cmd::cycles_to_len16, fw_ldst_cmd::fw_ldst::fw_ldst_pcie::data, F_FW_CMD_READ, F_FW_CMD_REQUEST, F_FW_LDST_CMD_LC, FW_LDST_ADDRSPC_FUNC_PCIE, FW_LDST_CMD, FW_LEN16, adapter::mbox, fw_ldst_cmd::op_to_addrspace, fw_ldst_cmd::fw_ldst::pcie, adapter::pf, fw_ldst_cmd::fw_ldst::fw_ldst_pcie::r, fw_ldst_cmd::fw_ldst::fw_ldst_pcie::select_naccess, t4_hw_pci_read_cfg4(), t4_wr_mbox(), fw_ldst_cmd::u, V_FW_CMD_OP, V_FW_LDST_CMD_ADDRSPACE, V_FW_LDST_CMD_FN, and V_FW_LDST_CMD_NACCESS.
t4_read_rss - read the contents of the RSS mapping table @adapter: the adapter @map: holds the contents of the RSS mapping table
Reads the contents of the RSS hash->queue mapping table.
Definition at line 5721 of file t4_hw.c.
References adapter::chip_params, G_LKPTBLQUEUE0, G_LKPTBLQUEUE1, rd_rss_row(), and chip_params::rss_nentries.
Referenced by collect_rss().
t4_read_rss_key - read the global RSS key @adap: the adapter @key: 10-entry array holding the 320-bit RSS key @sleep_ok: if true we may sleep while awaiting command completion
Reads the global 320-bit RSS key.
Definition at line 5906 of file t4_hw.c.
References A_TP_RSS_SECRET_KEY0, and t4_tp_pio_read().
Referenced by collect_rss_key().
void t4_read_rss_pf_config | ( | struct adapter * | adapter, |
unsigned int | index, | ||
u32 * | valp, | ||
bool | sleep_ok | ||
) |
t4_read_rss_pf_config - read PF RSS Configuration Table @adapter: the adapter @index: the entry in the PF RSS table to read @valp: where to store the returned value @sleep_ok: if true we may sleep while awaiting command completion
Reads the PF RSS Configuration Table at the specified index and returns the value found there.
Definition at line 5960 of file t4_hw.c.
References A_TP_RSS_PF0_CONFIG, and t4_tp_pio_read().
Referenced by collect_rss_pf_config().
t4_read_rss_pf_map - read PF RSS Map @adapter: the adapter @sleep_ok: if true we may sleep while awaiting command completion
Reads the PF RSS Map register and returns its value.
Definition at line 6067 of file t4_hw.c.
References A_TP_RSS_PF_MAP, and t4_tp_pio_read().
Referenced by collect_rss_pf_config().
t4_read_rss_pf_mask - read PF RSS Mask @adapter: the adapter @sleep_ok: if true we may sleep while awaiting command completion
Reads the PF RSS Mask register and returns its value.
Definition at line 6095 of file t4_hw.c.
References A_TP_RSS_PF_MSK, and t4_tp_pio_read().
Referenced by collect_rss_pf_config().
void t4_read_rss_vf_config | ( | struct adapter * | adapter, |
unsigned int | index, | ||
u32 * | vfl, | ||
u32 * | vfh, | ||
bool | sleep_ok | ||
) |
t4_read_rss_vf_config - read VF RSS Configuration Table @adapter: the adapter @index: the entry in the VF RSS table to read @vfl: where to store the returned VFL @vfh: where to store the returned VFH @sleep_ok: if true we may sleep while awaiting command completion
Reads the VF RSS Configuration Table at the specified index and returns the (VFL, VFH) values found there.
Definition at line 5994 of file t4_hw.c.
References A_TP_RSS_CONFIG_VRT, A_TP_RSS_VFH_CONFIG, A_TP_RSS_VFL_CONFIG, CHELSIO_T5, chip_id(), F_KEYWREN, F_VFRDEN, F_VFRDRG, F_VFWREN, M_T6_VFWRADDR, M_VFWRADDR, t4_read_reg(), t4_tp_pio_read(), t4_write_reg(), V_T6_VFWRADDR, and V_VFWRADDR.
Referenced by collect_rss_vf_config().
void t4_report_fw_error | ( | struct adapter * | adap | ) |
Definition at line 199 of file t4_hw.c.
References A_PCIE_FW, CH_ERR, F_PCIE_FW_ERR, G_PCIE_FW_EVAL, and t4_read_reg().
Referenced by t4_fatal_err().
int t4_restart_aneg | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | port | ||
) |
t4_restart_aneg - restart autonegotiation @adap: the adapter @mbox: mbox to use for the FW command @port: the port id
Restarts autonegotiation for the selected port.
Definition at line 4022 of file t4_hw.c.
References fw_port_cmd::action_to_len16, cpu_to_be32, F_FW_CMD_EXEC, F_FW_CMD_REQUEST, FW_LEN16, FW_PORT_ACTION_L1_CFG, FW_PORT_CAP_ANEG, FW_PORT_CMD, fw_port_cmd::fw_port::l1cfg, fw_port_cmd::op_to_portid, port, fw_port_cmd::fw_port::fw_port_l1cfg::rcap, t4_wr_mbox(), fw_port_cmd::u, V_FW_CMD_OP, V_FW_PORT_CMD_ACTION, and V_FW_PORT_CMD_PORTID.
int t4_sched_config | ( | struct adapter * | adapter, |
int | type, | ||
int | minmaxen, | ||
int | sleep_ok | ||
) |
Definition at line 11175 of file t4_hw.c.
References fw_sched_cmd::fw_sched::config, cpu_to_be32, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, FW_LEN16, FW_SCHED_CMD, FW_SCHED_SC_CONFIG, adapter::mbox, fw_sched_cmd::fw_sched::fw_sched_config::minmaxen, fw_sched_cmd::op_to_write, fw_sched_cmd::retval_len16, fw_sched_cmd::fw_sched::fw_sched_config::sc, t4_wr_mbox_meat(), fw_sched_cmd::fw_sched::fw_sched_config::type, fw_sched_cmd::u, and V_FW_CMD_OP.
Referenced by set_sched_class_config().
int t4_sched_params | ( | struct adapter * | adapter, |
int | type, | ||
int | level, | ||
int | mode, | ||
int | rateunit, | ||
int | ratemode, | ||
int | channel, | ||
int | cl, | ||
int | minrate, | ||
int | maxrate, | ||
int | weight, | ||
int | pktsize, | ||
int | burstsize, | ||
int | sleep_ok | ||
) |
Definition at line 11194 of file t4_hw.c.
References fw_sched_cmd::fw_sched::fw_sched_params::burstsize, fw_sched_cmd::fw_sched::fw_sched_params::ch, fw_sched_cmd::fw_sched::fw_sched_params::cl, cpu_to_be16, cpu_to_be32, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, FW_LEN16, FW_SCHED_CMD, FW_SCHED_SC_PARAMS, fw_sched_cmd::fw_sched::fw_sched_params::level, fw_sched_cmd::fw_sched::fw_sched_params::max, adapter::mbox, fw_sched_cmd::fw_sched::fw_sched_params::min, fw_sched_cmd::fw_sched::fw_sched_params::mode, fw_sched_cmd::op_to_write, fw_sched_cmd::fw_sched::params, fw_sched_cmd::fw_sched::fw_sched_params::pktsize, fw_sched_cmd::fw_sched::fw_sched_params::rate, fw_sched_cmd::retval_len16, fw_sched_cmd::fw_sched::fw_sched_params::sc, t4_wr_mbox_meat(), fw_sched_cmd::fw_sched::fw_sched_params::type, fw_sched_cmd::u, fw_sched_cmd::fw_sched::fw_sched_params::unit, V_FW_CMD_OP, and fw_sched_cmd::fw_sched::fw_sched_params::weight.
Referenced by set_sched_class_params(), and update_tx_sched().
int t4_sched_params_ch_rl | ( | struct adapter * | adapter, |
int | channel, | ||
int | ratemode, | ||
unsigned int | maxrate, | ||
int | sleep_ok | ||
) |
Definition at line 11225 of file t4_hw.c.
References fw_sched_cmd::fw_sched::fw_sched_params::ch, cpu_to_be32, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, FW_LEN16, FW_SCHED_CMD, FW_SCHED_PARAMS_LEVEL_CH_RL, FW_SCHED_SC_PARAMS, FW_SCHED_TYPE_PKTSCHED, fw_sched_cmd::fw_sched::fw_sched_params::level, fw_sched_cmd::fw_sched::fw_sched_params::max, adapter::mbox, fw_sched_cmd::op_to_write, fw_sched_cmd::fw_sched::params, fw_sched_cmd::fw_sched::fw_sched_params::rate, fw_sched_cmd::retval_len16, fw_sched_cmd::fw_sched::fw_sched_params::sc, t4_wr_mbox_meat(), fw_sched_cmd::fw_sched::fw_sched_params::type, fw_sched_cmd::u, and V_FW_CMD_OP.
int t4_sched_params_cl_rl_kbps | ( | struct adapter * | adapter, |
int | channel, | ||
int | cl, | ||
int | mode, | ||
unsigned int | maxrate, | ||
int | pktsize, | ||
int | sleep_ok | ||
) |
Definition at line 11272 of file t4_hw.c.
References fw_sched_cmd::fw_sched::fw_sched_params::ch, fw_sched_cmd::fw_sched::fw_sched_params::cl, cpu_to_be16, cpu_to_be32, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, FW_LEN16, FW_SCHED_CMD, FW_SCHED_PARAMS_LEVEL_CL_RL, FW_SCHED_PARAMS_RATE_ABS, FW_SCHED_PARAMS_UNIT_BITRATE, FW_SCHED_SC_PARAMS, FW_SCHED_TYPE_PKTSCHED, fw_sched_cmd::fw_sched::fw_sched_params::level, fw_sched_cmd::fw_sched::fw_sched_params::max, adapter::mbox, fw_sched_cmd::fw_sched::fw_sched_params::mode, fw_sched_cmd::op_to_write, fw_sched_cmd::fw_sched::params, fw_sched_cmd::fw_sched::fw_sched_params::pktsize, fw_sched_cmd::fw_sched::fw_sched_params::rate, fw_sched_cmd::retval_len16, fw_sched_cmd::fw_sched::fw_sched_params::sc, t4_wr_mbox_meat(), fw_sched_cmd::fw_sched::fw_sched_params::type, fw_sched_cmd::u, fw_sched_cmd::fw_sched::fw_sched_params::unit, and V_FW_CMD_OP.
int t4_sched_params_cl_wrr | ( | struct adapter * | adapter, |
int | channel, | ||
int | cl, | ||
int | weight, | ||
int | sleep_ok | ||
) |
Definition at line 11247 of file t4_hw.c.
References fw_sched_cmd::fw_sched::fw_sched_params::ch, fw_sched_cmd::fw_sched::fw_sched_params::cl, cpu_to_be16, cpu_to_be32, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, FW_LEN16, FW_SCHED_CMD, FW_SCHED_PARAMS_LEVEL_CL_WRR, FW_SCHED_SC_PARAMS, FW_SCHED_TYPE_PKTSCHED, fw_sched_cmd::fw_sched::fw_sched_params::level, adapter::mbox, fw_sched_cmd::op_to_write, fw_sched_cmd::fw_sched::params, fw_sched_cmd::retval_len16, fw_sched_cmd::fw_sched::fw_sched_params::sc, t4_wr_mbox_meat(), fw_sched_cmd::fw_sched::fw_sched_params::type, fw_sched_cmd::u, V_FW_CMD_OP, and fw_sched_cmd::fw_sched::fw_sched_params::weight.
t4_seeprom_read - read a serial EEPROM location @adapter: adapter to read @addr: EEPROM virtual address @data: where to store the read data
Read a 32-bit word from a location in serial EEPROM using the card's PCI VPD capability. Note that this function must be called with a virtual address.
Definition at line 2800 of file t4_hw.c.
References CH_ERR, EEPROMVSIZE, le32_to_cpu, adapter::params, adapter_params::pci, PCI_VPD_ADDR, PCI_VPD_ADDR_F, PCI_VPD_DATA, t4_os_pci_read_cfg4(), t4_os_pci_write_cfg2(), t4_seeprom_wait(), adapter::vpd_busy, pci_params::vpd_cap_addr, and adapter::vpd_flag.
Referenced by get_vpd_params(), and t4_seeprom_write().
|
static |
Definition at line 2747 of file t4_hw.c.
References EEPROM_DELAY, EEPROM_MAX_POLL, adapter::params, adapter_params::pci, PCI_VPD_ADDR, PCI_VPD_ADDR_F, t4_os_pci_read_cfg2(), udelay, adapter::vpd_busy, pci_params::vpd_cap_addr, and adapter::vpd_flag.
Referenced by t4_seeprom_read(), and t4_seeprom_write().
int t4_seeprom_wp | ( | struct adapter * | adapter, |
int | enable | ||
) |
t4_seeprom_wp - enable/disable EEPROM write protection @adapter: the adapter @enable: whether to enable or disable write protection
Enables or disables write protection on the serial EEPROM.
Definition at line 2949 of file t4_hw.c.
References EEPROM_STAT_ADDR, and t4_seeprom_write().
t4_seeprom_write - write a serial EEPROM location @adapter: adapter to write @addr: virtual EEPROM address @data: value to write
Write a 32-bit word to a location in serial EEPROM using the card's PCI VPD capability. Note that this function must be called with a virtual address.
Definition at line 2855 of file t4_hw.c.
References CH_ERR, cpu_to_le32, EEPROM_DELAY, EEPROM_MAX_POLL, EEPROM_STAT_ADDR, EEPROMVSIZE, adapter::params, adapter_params::pci, PCI_VPD_ADDR, PCI_VPD_ADDR_F, PCI_VPD_DATA, t4_os_pci_write_cfg2(), t4_os_pci_write_cfg4(), t4_seeprom_read(), t4_seeprom_wait(), udelay, adapter::vpd_busy, pci_params::vpd_cap_addr, and adapter::vpd_flag.
Referenced by t4_seeprom_wp().
int t4_set_addr_hash | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | viid, | ||
bool | ucast, | ||
u64 | vec, | ||
bool | sleep_ok | ||
) |
t4_set_addr_hash - program the MAC inexact-match hash filter @adap: the adapter @mbox: mailbox to use for the FW command @viid: the VI id @ucast: whether the hash filter should also match unicast addresses @vec: the value to be written to the hash filter @sleep_ok: call is allowed to sleep
Sets the 64-bit inexact-match hash filter for a virtual interface.
Definition at line 8546 of file t4_hw.c.
References cpu_to_be32, cpu_to_be64, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, fw_vi_mac_cmd::freemacs_to_len16, FW_VI_MAC_CMD, FW_VI_MAC_TYPE_HASHVEC, fw_vi_mac_cmd::fw_vi_mac::hash, fw_vi_mac_cmd::fw_vi_mac::fw_vi_mac_hash::hashvec, fw_vi_mac_cmd::op_to_viid, t4_wr_mbox_meat(), fw_vi_mac_cmd::u, V_FW_CMD_LEN16, V_FW_CMD_OP, V_FW_VI_ENABLE_CMD_VIID, V_FW_VI_MAC_CMD_ENTRY_TYPE, and V_FW_VI_MAC_CMD_HASHUNIEN.
Referenced by update_mac_settings().
int t4_set_devlog_level | ( | struct adapter * | adapter, |
unsigned int | level | ||
) |
Definition at line 11359 of file t4_hw.c.
References cpu_to_be32, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, FW_DEVLOG_CMD, FW_LEN16, fw_devlog_cmd::level, adapter::mbox, fw_devlog_cmd::op_to_write, fw_devlog_cmd::retval_len16, t4_wr_mbox(), and V_FW_CMD_OP.
int t4_set_filter_cfg | ( | struct adapter * | adap, |
int | mode, | ||
int | mask, | ||
int | vnic_mode | ||
) |
t4_set_filter_cfg - set up filter mode/mask and ingress config. @adap: the adapter @mode: a bitmap selecting which optional filter components to enable @mask: a bitmap selecting which components to enable in filter mask @vnic_mode: the ingress config/vnic mode setting
Sets the filter mode and mask by selecting the optional components to enable in filter tuples. Returns 0 on success and a negative error if the requested mode needs more bits than are available for optional components. The filter mask must be a subset of the filter mode.
Definition at line 10912 of file t4_hw.c.
References CH_ERR, CH_WARN, adapter::chip_params, tp_params::filter_mask, tp_params::filter_mode, chip_params::filter_opt_len, FW_PARAM_DEV_FILTER_MODE_MASK, FW_PARAM_DEV_FILTER_VNIC_MODE, FW_PARAMS_MNEM_DEV, FW_PARAMS_PARAM_DEV_FILTER, adapter::mbox, adapter::params, adapter::pf, read_filter_mode_and_ingress_config(), S_FCOE, S_FRAGMENTATION, t4_set_params(), adapter_params::tp, V_FW_PARAMS_MNEM, V_FW_PARAMS_PARAM_FILTER_MASK, V_FW_PARAMS_PARAM_FILTER_MODE, V_FW_PARAMS_PARAM_X, and V_FW_PARAMS_PARAM_Y.
Referenced by set_filter_mask(), and set_filter_mode().
int t4_set_pace_tbl | ( | struct adapter * | adap, |
const unsigned int * | pace_vals, | ||
unsigned int | start, | ||
unsigned int | n | ||
) |
t4_set_pace_tbl - set the pace table @adap: the adapter @pace_vals: the pace values in microseconds @start: index of the first entry in the HW pace table to set
: how many entries to set
Sets (a subset of the) HW pace table.
Definition at line 6485 of file t4_hw.c.
References A_TP_PACE_TABLE, dack_ticks_to_usec(), NTX_SCHED, and t4_write_reg().
int t4_set_params | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | pf, | ||
unsigned int | vf, | ||
unsigned int | nparams, | ||
const u32 * | params, | ||
const u32 * | val | ||
) |
t4_set_params - sets FW or device parameters @adap: the adapter @mbox: mailbox to use for the FW command @pf: the PF @vf: the VF @nparams: the number of parameters @params: the parameter names @val: the parameter values
Sets the value of FW or device parameters. Up to 7 parameters can be specified at once.
Definition at line 7885 of file t4_hw.c.
References FW_CMD_MAX_TIMEOUT, and t4_set_params_timeout().
Referenced by alloc_iq_fl_hwq(), bind_txq_to_traffic_class(), set_params__post_init(), set_params__pre_init(), sysctl_reset_sensor(), t4_configure_add_smac(), t4_configure_ringbb(), t4_set_filter_cfg(), and t4vf_set_params().
int t4_set_params_timeout | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | pf, | ||
unsigned int | vf, | ||
unsigned int | nparams, | ||
const u32 * | params, | ||
const u32 * | val, | ||
int | timeout | ||
) |
t4_set_params_timeout - sets FW or device parameters @adap: the adapter @mbox: mailbox to use for the FW command @pf: the PF @vf: the VF @nparams: the number of parameters @params: the parameter names @val: the parameter values @timeout: the timeout time
Sets the value of FW or device parameters. Up to 7 parameters can be specified at once.
Definition at line 7846 of file t4_hw.c.
References cpu_to_be32, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, FW_LEN16, FW_PARAMS_CMD, fw_params_cmd::fw_params_param::mnem, fw_params_cmd::op_to_vfn, fw_params_cmd::param, fw_params_cmd::retval_len16, t4_wr_mbox_timeout(), V_FW_CMD_OP, V_FW_PARAMS_CMD_PFN, and V_FW_PARAMS_CMD_VFN.
Referenced by t4_set_params(), and t5_fw_init_extern_mem().
t4_set_reg_field - set a register field to a value @adapter: the adapter to program @addr: the register address @mask: specifies the portion of the register to modify @val: the new value for the register field
Sets a register field specified by the supplied mask to the given value.
Definition at line 100 of file t4_hw.c.
References t4_read_reg(), and t4_write_reg().
Referenced by check_tx_state(), set_params__post_init(), setup_pad_and_pack_boundaries(), sysctl_tp_la_mask(), t4_fw_halt(), t4_fw_restart(), t4_intr_disable(), t4_intr_enable(), t4_set_trace_filter(), t4_set_tracer(), t4_shutdown_adapter(), t4_tweak_chip_settings(), t4_vxlan_stop(), t4_wol_magic_enable(), and t4_wol_pat_enable().
int t4_set_rxmode | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | viid, | ||
int | mtu, | ||
int | promisc, | ||
int | all_multi, | ||
int | bcast, | ||
int | vlanex, | ||
bool | sleep_ok | ||
) |
t4_set_rxmode - set Rx properties of a virtual interface @adap: the adapter @mbox: mailbox to use for the FW command @viid: the VI id @mtu: the new MTU or -1 @promisc: 1 to enable promiscuous mode, 0 to disable it, -1 no change @all_multi: 1 to enable all-multi mode, 0 to disable it, -1 no change @bcast: 1 to enable broadcast Rx, 0 to disable it, -1 no change @vlanex: 1 to enable HW VLAN extraction, 0 to disable it, -1 no change @sleep_ok: if true we may sleep while awaiting command completion
Sets Rx properties of a virtual interface.
Definition at line 8080 of file t4_hw.c.
References cpu_to_be32, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, FW_LEN16, FW_VI_RXMODE_CMD, M_FW_VI_RXMODE_CMD_ALLMULTIEN, M_FW_VI_RXMODE_CMD_BROADCASTEN, M_FW_VI_RXMODE_CMD_MTU, M_FW_VI_RXMODE_CMD_PROMISCEN, M_FW_VI_RXMODE_CMD_VLANEXEN, fw_vi_rxmode_cmd::mtu_to_vlanexen, fw_vi_rxmode_cmd::op_to_viid, fw_vi_rxmode_cmd::retval_len16, t4_wr_mbox_meat(), V_FW_CMD_OP, V_FW_VI_RXMODE_CMD_ALLMULTIEN, V_FW_VI_RXMODE_CMD_BROADCASTEN, V_FW_VI_RXMODE_CMD_MTU, V_FW_VI_RXMODE_CMD_PROMISCEN, V_FW_VI_RXMODE_CMD_VIID, and V_FW_VI_RXMODE_CMD_VLANEXEN.
Referenced by update_mac_settings().
int t4_set_sched_bps | ( | struct adapter * | adap, |
int | sched, | ||
unsigned int | kbps | ||
) |
t4_set_sched_bps - set the bit rate for a HW traffic scheduler @adap: the adapter @kbps: target rate in Kbps @sched: the scheduler index
Configure a Tx HW scheduler for the target rate.
Definition at line 6515 of file t4_hw.c.
References A_TP_TM_PIO_ADDR, A_TP_TM_PIO_DATA, A_TP_TX_MOD_Q1_Q0_RATE_LIMIT, vpd_params::cclk, adapter::params, t4_read_reg(), t4_write_reg(), and adapter_params::vpd.
int t4_set_sched_ipg | ( | struct adapter * | adap, |
int | sched, | ||
unsigned int | ipg | ||
) |
t4_set_sched_ipg - set the IPG for a Tx HW packet rate scheduler @adap: the adapter @sched: the scheduler index @ipg: the interpacket delay in tenths of nanoseconds
Set the interpacket delay for a HW packet rate scheduler.
Definition at line 6559 of file t4_hw.c.
References A_TP_TM_PIO_ADDR, A_TP_TM_PIO_DATA, A_TP_TX_MOD_Q1_Q0_TIMER_SEPARATOR, core_ticks_per_usec(), M_TXTIMERSEPQ0, M_TXTIMERSEPQ1, t4_read_reg(), t4_write_reg(), V_TXTIMERSEPQ0, and V_TXTIMERSEPQ1.
int t4_set_trace_filter | ( | struct adapter * | adap, |
const struct trace_params * | tp, | ||
int | idx, | ||
int | enable | ||
) |
t4_set_trace_filter - configure one of the tracing filters @adap: the adapter @tp: the desired trace filter parameters @idx: which filter to configure @enable: whether to enable or disable the filter
Configures one of the tracing filters available in HW. If @tp is NULL it indicates that the filter is already written in the register and it just needs to be enabled or disabled.
Definition at line 6638 of file t4_hw.c.
References A_MPS_TRC_CFG, A_MPS_TRC_FILTER0_DONT_CARE, A_MPS_TRC_FILTER0_MATCH, A_MPS_TRC_FILTER1_MATCH, A_MPS_TRC_FILTER_MATCH_CTL_A, A_MPS_TRC_FILTER_MATCH_CTL_B, trace_params::data, F_T5_TFEN, F_TFEN, F_TRCMULTIFILTER, trace_params::invert, is_t4(), M_TFLENGTH, M_TFMINPKTSIZE, M_TFOFFSET, trace_params::mask, trace_params::min_len, NTRACE, trace_params::port, trace_params::skip_len, trace_params::skip_ofst, trace_params::snap_len, t4_read_reg(), t4_set_reg_field(), t4_write_reg(), TRACE_LEN, V_T5_TFINVERTMATCH, V_T5_TFPORT, V_TFCAPTUREMAX, V_TFINVERTMATCH, V_TFLENGTH, V_TFMINPKTSIZE, V_TFOFFSET, and V_TFPORT.
Referenced by t4_set_tracer().
int t4_set_vf_mac | ( | struct adapter * | adapter, |
unsigned int | pf, | ||
unsigned int | vf, | ||
unsigned int | naddr, | ||
u8 * | addr | ||
) |
t4_set_vf_mac - Set MAC address for the specified VF @adapter: The adapter @pf: the PF used to instantiate the VFs @vf: one of the VFs instantiated by the specified PF @naddr: the number of MAC addresses @addr: the MAC address(es) to be set to the specified VF
Definition at line 10372 of file t4_hw.c.
References cpu_to_be32, fw_acl_mac_cmd::en_to_len16, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, FW_ACL_MAC_CMD, FW_LEN16, fw_acl_mac_cmd::macaddr0, fw_acl_mac_cmd::macaddr1, fw_acl_mac_cmd::macaddr2, fw_acl_mac_cmd::macaddr3, adapter::mbox, fw_acl_mac_cmd::nmac, fw_acl_mac_cmd::op_to_vfn, t4_wr_mbox(), V_FW_ACL_MAC_CMD_PFN, V_FW_ACL_MAC_CMD_VFN, and V_FW_CMD_OP.
Definition at line 11447 of file t4_hw.c.
References cpu_to_be16, cpu_to_be32, fw_acl_vlan_cmd::dropnovlan_fm, fw_acl_vlan_cmd::en_to_len16, F_FW_ACL_VLAN_CMD_DROPNOVLAN, F_FW_ACL_VLAN_CMD_EN, F_FW_ACL_VLAN_CMD_FM, F_FW_CMD_EXEC, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, FW_ACL_VLAN_CMD, FW_LEN16, adapter::mbox, fw_acl_vlan_cmd::nvlan, fw_acl_vlan_cmd::op_to_vfn, adapter::pf, t4_wr_mbox(), V_FW_ACL_VLAN_CMD_PFN, V_FW_ACL_VLAN_CMD_VFN, V_FW_CMD_OP, and fw_acl_vlan_cmd::vlanid.
int t4_sge_ctxt_flush | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
int | ctxt_type | ||
) |
t4_sge_ctxt_flush - flush the SGE context cache @adap: the adapter @mbox: mailbox to use for the FW command
Issues a FW command through the given mailbox to flush the SGE context cache.
Definition at line 7452 of file t4_hw.c.
References cpu_to_be32, CTXT_EGRESS, fw_ldst_cmd::cycles_to_len16, F_FW_CMD_READ, F_FW_CMD_REQUEST, F_FW_LDST_CMD_CTXTFLUSH, FW_LDST_ADDRSPC_SGE_EGRC, FW_LDST_ADDRSPC_SGE_INGC, FW_LDST_CMD, FW_LEN16, fw_ldst_cmd::fw_ldst::idctxt, fw_ldst_cmd::fw_ldst::fw_ldst_idctxt::msg_ctxtflush, fw_ldst_cmd::op_to_addrspace, t4_wr_mbox(), fw_ldst_cmd::u, V_FW_CMD_OP, and V_FW_LDST_CMD_ADDRSPACE.
int t4_sge_ctxt_rd | ( | struct adapter * | adap, |
unsigned int | mbox, | ||
unsigned int | cid, | ||
enum ctxt_type | ctype, | ||
u32 * | data | ||
) |
t4_sge_ctxt_rd - read an SGE context through FW @adap: the adapter @mbox: mailbox to use for the FW command @cid: the context id @ctype: the context type @data: where to store the context data
Issues a FW command through the given mailbox to read an SGE context.
Definition at line 11118 of file t4_hw.c.
References be32_to_cpu, cpu_to_be32, fw_ldst_cmd::fw_ldst::fw_ldst_idctxt::ctxt_data0, fw_ldst_cmd::fw_ldst::fw_ldst_idctxt::ctxt_data1, fw_ldst_cmd::fw_ldst::fw_ldst_idctxt::ctxt_data2, fw_ldst_cmd::fw_ldst::fw_ldst_idctxt::ctxt_data3, fw_ldst_cmd::fw_ldst::fw_ldst_idctxt::ctxt_data4, fw_ldst_cmd::fw_ldst::fw_ldst_idctxt::ctxt_data5, CTXT_EGRESS, CTXT_FLM, CTXT_INGRESS, fw_ldst_cmd::cycles_to_len16, F_FW_CMD_READ, F_FW_CMD_REQUEST, FW_LDST_ADDRSPC_SGE_CONMC, FW_LDST_ADDRSPC_SGE_EGRC, FW_LDST_ADDRSPC_SGE_FLMC, FW_LDST_ADDRSPC_SGE_INGC, FW_LDST_CMD, FW_LEN16, fw_ldst_cmd::fw_ldst::idctxt, fw_ldst_cmd::op_to_addrspace, fw_ldst_cmd::fw_ldst::fw_ldst_idctxt::physid, t4_wr_mbox(), fw_ldst_cmd::u, V_FW_CMD_OP, and V_FW_LDST_CMD_ADDRSPACE.
Referenced by get_sge_context(), and read_sge_ctxt().
t4_sge_ctxt_rd_bd - read an SGE context bypassing FW @adap: the adapter @cid: the context id @ctype: the context type @data: where to store the context data
Reads an SGE context directly, bypassing FW. This is only for debugging when FW is unavailable.
Definition at line 11162 of file t4_hw.c.
References A_SGE_CTXT_CMD, A_SGE_CTXT_DATA0, A_SGE_CTXT_DATA5, F_BUSY, t4_read_reg(), t4_wait_op_done(), t4_write_reg(), V_CTXTQID, and V_CTXTTYPE.
Referenced by get_sge_context(), and read_sge_ctxt().
void t4_sge_decode_idma_state | ( | struct adapter * | adapter, |
int | state | ||
) |
t4_sge_decode_idma_state - decode the idma state @adap: the adapter @state: the state idma is stuck in
Definition at line 7293 of file t4_hw.c.
References A_SGE_DEBUG_DATA_HIGH_INDEX_10, A_SGE_DEBUG_DATA_LOW_INDEX_2, A_SGE_DEBUG_DATA_LOW_INDEX_3, ARRAY_SIZE, CH_ERR, CH_WARN, CHELSIO_T4, CHELSIO_T5, CHELSIO_T6, chip_id(), and t4_read_reg().
Referenced by t4_idma_monitor().
|
static |
Definition at line 4071 of file t4_hw.c.
References intr_info::cause_reg, CH_ALERT, intr_info::details, intr_info::enable_reg, intr_info::fatal, intr_info::flags, intr_alert_char(), intr_details::mask, intr_details::msg, intr_info::name, NONFATAL_IF_DISABLED, and t4_read_reg().
Referenced by t4_handle_intr(), and t4_slow_intr_handler().
int t4_shutdown_adapter | ( | struct adapter * | adapter | ) |
t4_shutdown_adapter - shut down adapter, host & wire @adapter: the adapter
Perform an emergency shutdown of the adapter and stop it from continuing any further communication on the ports or DMA to the host. This is typically used when the adapter and/or firmware have crashed and we want to prevent any further accidental communication with the rest of the world. This will also force the port Link Status to go down – if register writes work – which should help our peers figure out that we're down.
Definition at line 9407 of file t4_hw.c.
References A_DBG_GPIO_EN, A_MAC_PORT_CFG, A_MAC_PORT_HSS_CFG0, A_SGE_CONTROL, A_XGMAC_PORT_CFG, A_XGMAC_PORT_HSS_CFG0, adapter::bt_map, F_GLOBALENABLE, F_HSSPDWNPLLA, F_HSSPDWNPLLB, F_HSSPLLBYPA, F_HSSPLLBYPB, for_each_port, is_t4(), port, PORT_REG, t4_intr_disable(), t4_read_reg(), t4_set_reg_field(), t4_write_reg(), T5_PORT_REG, and V_SIGNAL_DET.
Referenced by stop_adapter().
t4_slow_intr_handler - control path interrupt handler @adap: the adapter @verbose: increased verbosity, for debug
T4 interrupt handler for non-data global interrupt events, e.g., errors. The designation 'slow' is because it involves register reads, while data interrupts typically don't involve any MMIOs.
Definition at line 5295 of file t4_hw.c.
References A_PL_INT_CAUSE, A_PL_INT_ENABLE, A_PL_PERR_CAUSE, A_PL_PERR_ENABLE, intr_info::cause_reg, cim_intr_handler(), cplsw_intr_handler(), intr_info::enable_reg, F_CIM, F_CPL_SWITCH, F_DBG, F_EDC0, F_EDC1, F_HMA, F_I2CM, F_LE, F_MA, F_MAC0, F_MAC1, F_MAC2, F_MAC3, F_MC, F_MC0, F_MC1, F_MI, F_MPS, F_NCSI, F_PCIE, F_PL, F_PM_RX, F_PM_TX, F_PMU, F_SF, F_SGE, F_SMB, F_TP, F_UART, F_ULP_RX, F_ULP_TX, le_intr_handler(), ma_intr_handler(), mac_intr_handler(), MEM_EDC0, MEM_EDC1, mem_intr_handler(), MEM_MC0, MEM_MC1, mps_intr_handler(), intr_info::name, ncsi_intr_handler(), pcie_intr_handler(), plpl_intr_handler(), pmrx_intr_handler(), pmtx_intr_handler(), sge_intr_handler(), smb_intr_handler(), t4_handle_intr(), t4_read_reg(), t4_show_intr_info(), t4_write_reg(), tp_intr_handler(), ulprx_intr_handler(), and ulptx_intr_handler().
Referenced by t4_fatal_err(), and t4_intr_err().
|
static |
t4_tp_fw_ldst_rw - Access TP indirect register through LDST @adap: the adapter @cmd: TP fw ldst address space type @vals: where the indirect register values are stored/written @nregs: how many indirect registers to read/write @start_idx: index of first indirect register to read/write @rw: Read (1) or Write (0) @sleep_ok: if true we may sleep while awaiting command completion
Access TP indirect registers through LDST
Definition at line 5749 of file t4_hw.c.
References fw_ldst_cmd::fw_ldst::fw_ldst_addrval::addr, fw_ldst_cmd::fw_ldst::addrval, be32_to_cpu, cpu_to_be32, fw_ldst_cmd::cycles_to_len16, F_FW_CMD_READ, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, FW_LDST_CMD, FW_LEN16, adapter::mbox, fw_ldst_cmd::op_to_addrspace, t4_wr_mbox_meat(), fw_ldst_cmd::u, V_FW_CMD_OP, V_FW_LDST_CMD_ADDRSPACE, and fw_ldst_cmd::fw_ldst::fw_ldst_addrval::val.
Referenced by t4_tp_indirect_rw().
void t4_tp_get_cpl_stats | ( | struct adapter * | adap, |
struct tp_cpl_stats * | st, | ||
bool | sleep_ok | ||
) |
t4_tp_get_cpl_stats - read TP's CPL MIB counters @adap: the adapter @st: holds the counter values @sleep_ok: if true we may sleep while awaiting command completion
Returns the values of TP's CPL counters.
Definition at line 6239 of file t4_hw.c.
References A_TP_MIB_CPL_IN_REQ_0, A_TP_MIB_CPL_OUT_RSP_0, adapter::chip_params, chip_params::nchan, tp_cpl_stats::req, tp_cpl_stats::rsp, and t4_tp_mib_read().
Referenced by collect_cpl_stats(), and sysctl_cpl_stats().
void t4_tp_get_err_stats | ( | struct adapter * | adap, |
struct tp_err_stats * | st, | ||
bool | sleep_ok | ||
) |
t4_tp_get_err_stats - read TP's error MIB counters @adap: the adapter @st: holds the counter values @sleep_ok: if true we may sleep while awaiting command completion
Returns the values of TP's error counters.
Definition at line 6164 of file t4_hw.c.
References A_TP_MIB_HDR_IN_ERR_0, A_TP_MIB_MAC_IN_ERR_0, A_TP_MIB_OFD_ARP_DROP, A_TP_MIB_OFD_CHN_DROP_0, A_TP_MIB_OFD_VLN_DROP_0, A_TP_MIB_TCP_IN_ERR_0, A_TP_MIB_TCP_V6IN_ERR_0, A_TP_MIB_TNL_CNG_DROP_0, A_TP_MIB_TNL_DROP_0, adapter::chip_params, tp_err_stats::hdr_in_errs, tp_err_stats::mac_in_errs, chip_params::nchan, tp_err_stats::ofld_chan_drops, tp_err_stats::ofld_no_neigh, tp_err_stats::ofld_vlan_drops, t4_tp_mib_read(), tp_err_stats::tcp6_in_errs, tp_err_stats::tcp_in_errs, tp_err_stats::tnl_cong_drops, and tp_err_stats::tnl_tx_drops.
Referenced by collect_tp_err_stats(), and sysctl_tp_err_stats().
void t4_tp_get_proxy_stats | ( | struct adapter * | adap, |
struct tp_proxy_stats * | st, | ||
bool | sleep_ok | ||
) |
t4_tp_get_proxy_stats - read TP's proxy MIB counters @adap: the adapter @st: holds the counter values
Returns the values of TP's proxy counters.
Definition at line 6223 of file t4_hw.c.
References A_TP_MIB_TNL_LPBK_0, adapter::chip_params, chip_params::nchan, tp_proxy_stats::proxy, and t4_tp_mib_read().
void t4_tp_get_rdma_stats | ( | struct adapter * | adap, |
struct tp_rdma_stats * | st, | ||
bool | sleep_ok | ||
) |
t4_tp_get_rdma_stats - read TP's RDMA MIB counters @adap: the adapter @st: holds the counter values
Returns the values of TP's RDMA counters.
Definition at line 6256 of file t4_hw.c.
References A_TP_MIB_RQE_DFR_PKT, tp_rdma_stats::rqe_dfr_pkt, and t4_tp_mib_read().
Referenced by collect_rdma_stats(), and sysctl_rdma_stats().
void t4_tp_get_tcp_stats | ( | struct adapter * | adap, |
struct tp_tcp_stats * | v4, | ||
struct tp_tcp_stats * | v6, | ||
bool | sleep_ok | ||
) |
t4_tp_get_tcp_stats - read TP's TCP MIB counters @adap: the adapter @v4: holds the TCP/IP counter values @v6: holds the TCP/IPv6 counter values @sleep_ok: if true we may sleep while awaiting command completion
Returns the values of TP's TCP/IP and TCP/IPv6 MIB counters. Either @v4 or @v6 may be NULL to skip the corresponding stats.
Definition at line 6126 of file t4_hw.c.
References A_TP_MIB_TCP_OUT_RST, A_TP_MIB_TCP_RXT_SEG_LO, A_TP_MIB_TCP_V6OUT_RST, ARRAY_SIZE, STAT, STAT64, t4_tp_mib_read(), tp_tcp_stats::tcp_in_segs, tp_tcp_stats::tcp_out_rsts, tp_tcp_stats::tcp_out_segs, and tp_tcp_stats::tcp_retrans_segs.
Referenced by collect_tcp_stats(), and sysctl_tcp_stats().
void t4_tp_get_tid_stats | ( | struct adapter * | adap, |
struct tp_tid_stats * | st, | ||
bool | sleep_ok | ||
) |
t4_tp_get_tid_stats - read TP's tid MIB counters. @adap: the adapter @st: holds the counter values @sleep_ok: if true we may sleep while awaiting command completion
Returns the values of TP's counters for tids.
Definition at line 6317 of file t4_hw.c.
References A_TP_MIB_TID_DEL, tp_tid_stats::del, and t4_tp_mib_read().
Referenced by sysctl_tid_stats().
void t4_tp_get_tnl_stats | ( | struct adapter * | adap, |
struct tp_tnl_stats * | st, | ||
bool | sleep_ok | ||
) |
t4_tp_get_err_stats - read TP's error MIB counters @adap: the adapter @st: holds the counter values @sleep_ok: if true we may sleep while awaiting command completion
Returns the values of TP's error counters.
Definition at line 6205 of file t4_hw.c.
References A_TP_MIB_TNL_IN_PKT_0, A_TP_MIB_TNL_OUT_PKT_0, adapter::chip_params, tp_tnl_stats::in_pkt, chip_params::nchan, tp_tnl_stats::out_pkt, and t4_tp_mib_read().
Referenced by sysctl_tnl_stats().
|
static |
t4_tp_indirect_rw - Read/Write TP indirect register through LDST or backdoor @adap: the adapter @reg_addr: Address Register @reg_data: Data register @buff: where the indirect register values are stored/written @nregs: how many indirect registers to read/write @start_index: index of first indirect register to read/write @rw: READ(1) or WRITE(0) @sleep_ok: if true we may sleep while awaiting command completion
Read/Write TP indirect registers through LDST if possible. Else, use backdoor access
Definition at line 5793 of file t4_hw.c.
References A_TP_MIB_INDEX, A_TP_PIO_ADDR, A_TP_TM_PIO_ADDR, FW_LDST_ADDRSPC_TP_MIB, FW_LDST_ADDRSPC_TP_PIO, FW_LDST_ADDRSPC_TP_TM_PIO, t4_read_indirect(), t4_tp_fw_ldst_rw(), t4_use_ldst(), and t4_write_indirect().
Referenced by t4_tp_mib_read(), t4_tp_pio_read(), t4_tp_pio_write(), and t4_tp_tm_pio_read().
void t4_tp_mib_read | ( | struct adapter * | adap, |
u32 * | buff, | ||
u32 | nregs, | ||
u32 | start_index, | ||
bool | sleep_ok | ||
) |
t4_tp_mib_read - Read TP MIB registers @adap: the adapter @buff: where the indirect register values are written @nregs: how many indirect registers to read @start_index: index of first indirect register to read @sleep_ok: if true we may sleep while awaiting command completion
Read TP MIB Registers
Definition at line 5891 of file t4_hw.c.
References A_TP_MIB_DATA, A_TP_MIB_INDEX, and t4_tp_indirect_rw().
Referenced by collect_tp_indirect(), read_tp_mib_data(), t4_get_fcoe_stats(), t4_get_usm_stats(), t4_tp_get_cpl_stats(), t4_tp_get_err_stats(), t4_tp_get_proxy_stats(), t4_tp_get_rdma_stats(), t4_tp_get_tcp_stats(), t4_tp_get_tid_stats(), and t4_tp_get_tnl_stats().
void t4_tp_pio_read | ( | struct adapter * | adap, |
u32 * | buff, | ||
u32 | nregs, | ||
u32 | start_index, | ||
bool | sleep_ok | ||
) |
t4_tp_pio_read - Read TP PIO registers @adap: the adapter @buff: where the indirect register values are written @nregs: how many indirect registers to read @start_index: index of first indirect register to read @sleep_ok: if true we may sleep while awaiting command completion
Read TP PIO Registers
Definition at line 5840 of file t4_hw.c.
References A_TP_PIO_ADDR, A_TP_PIO_DATA, and t4_tp_indirect_rw().
Referenced by collect_full(), collect_tp_indirect(), read_filter_mode_and_ingress_config(), t4_read_rss_key(), t4_read_rss_pf_config(), t4_read_rss_pf_map(), t4_read_rss_pf_mask(), t4_read_rss_vf_config(), t4_tweak_chip_settings(), t5_wtp_data(), and t6_wtp_data().
void t4_tp_pio_write | ( | struct adapter * | adap, |
const u32 * | buff, | ||
u32 | nregs, | ||
u32 | start_index, | ||
bool | sleep_ok | ||
) |
t4_tp_pio_write - Write TP PIO registers @adap: the adapter @buff: where the indirect register values are stored @nregs: how many indirect registers to write @start_index: index of first indirect register to write @sleep_ok: if true we may sleep while awaiting command completion
Write TP PIO Registers
Definition at line 5857 of file t4_hw.c.
References A_TP_PIO_ADDR, A_TP_PIO_DATA, and t4_tp_indirect_rw().
Referenced by t4_tweak_chip_settings(), t4_write_rss_key(), t4_write_rss_pf_config(), t4_write_rss_pf_map(), t4_write_rss_pf_mask(), and t4_write_rss_vf_config().
t4_tp_read_la - read TP LA capture buffer @adap: the adapter @la_buf: where to store the LA data @wrptr: the HW write pointer within the capture buffer
Reads the contents of the TP LA buffer with the most recent entry at the end of the returned data and with the entry at @wrptr first. We leave the LA in the running state we find it in.
Definition at line 10200 of file t4_hw.c.
References A_TP_DBG_LA_CONFIG, A_TP_DBG_LA_DATAL, F_DBGLAENABLE, F_DBGLAWHLF, G_DBGLAMODE, G_DBGLAWPTR, tp_params::la_mask, M_DBGLARPTR, adapter::params, t4_read_reg(), t4_read_reg64(), t4_write_reg(), adapter_params::tp, TPLA_SIZE, and V_DBGLARPTR.
Referenced by collect_tp_la(), and sysctl_tp_la().
void t4_tp_tm_pio_read | ( | struct adapter * | adap, |
u32 * | buff, | ||
u32 | nregs, | ||
u32 | start_index, | ||
bool | sleep_ok | ||
) |
t4_tp_tm_pio_read - Read TP TM PIO registers @adap: the adapter @buff: where the indirect register values are written @nregs: how many indirect registers to read @start_index: index of first indirect register to read @sleep_ok: if true we may sleep while awaiting command completion
Read TP TM PIO Registers
Definition at line 5874 of file t4_hw.c.
References A_TP_TM_PIO_ADDR, A_TP_TM_PIO_DATA, and t4_tp_indirect_rw().
Referenced by collect_tp_indirect(), and t4_get_tx_sched().
void t4_tp_wr_bits_indirect | ( | struct adapter * | adap, |
unsigned int | addr, | ||
unsigned int | mask, | ||
unsigned int | val | ||
) |
t4_tp_wr_bits_indirect - set/clear bits in an indirect TP register @adap: the adapter @addr: the indirect TP register address @mask: specifies the field within the register to modify @val: new value for the field
Sets a field of an indirect TP register to the given value.
Definition at line 6377 of file t4_hw.c.
References A_TP_PIO_ADDR, A_TP_PIO_DATA, t4_read_reg(), and t4_write_reg().
Referenced by set_params__post_init().
Definition at line 3737 of file t4_hw.c.
References A_ULP_RX_LA_CTL, A_ULP_RX_LA_RDDATA, A_ULP_RX_LA_RDPTR, A_ULP_RX_LA_WRPTR, t4_read_reg(), t4_write_reg(), and ULPRX_LA_SIZE.
Referenced by collect_ulprx_la(), and sysctl_ulprx_la().
int t4_update_port_info | ( | struct port_info * | pi | ) |
t4_update_port_info - retrieve and update port information if changed @pi: the port_info
We issue a Get Port Information Command to the Firmware and, if successful, we check to see if anything is different from what we last recorded and update things accordingly.
Definition at line 9022 of file t4_hw.c.
References fw_port_cmd::action_to_len16, port_info::adapter, cpu_to_be32, F_FW_CMD_READ, F_FW_CMD_REQUEST, FW_LEN16, FW_PORT_ACTION_GET_PORT_INFO, FW_PORT_ACTION_GET_PORT_INFO32, FW_PORT_CMD, handle_port_info(), adapter::mbox, fw_port_cmd::op_to_portid, adapter::params, adapter_params::port_caps32, t4_wr_mbox_ns(), port_info::tx_chan, V_FW_CMD_OP, V_FW_PORT_CMD_ACTION, and V_FW_PORT_CMD_PORTID.
Referenced by cxgbe_init_synchronized(), cxgbe_media_status(), sysctl_module_fec(), t4_port_init(), and t4_resume().
|
inlinestatic |
Definition at line 83 of file t4_hw.c.
References t4_wait_op_done_val().
Referenced by sf1_read(), sf1_write(), t4_cim_read(), t4_cim_write(), t4_edc_read(), t4_mc_read(), t4_read_cim_ibq(), t4_read_cim_obq(), and t4_sge_ctxt_rd_bd().
|
static |
t4_wait_op_done_val - wait until an operation is completed @adapter: the adapter performing the operation @reg: the register to check for completion @mask: a single-bit field within @reg that indicates completion @polarity: the value of the field when the operation is completed @attempts: number of check iterations @delay: delay in usecs between iterations @valp: where to store the value of the register at completion time
Wait until an operation is completed by checking a bit in a register up to @attempts times. If @valp is not NULL the value of the register at the time it indicated completion is stored there. Returns 0 if the operation completes and -EAGAIN otherwise.
Definition at line 65 of file t4_hw.c.
References t4_read_reg(), and udelay.
Referenced by rd_rss_row(), and t4_wait_op_done().
t4_wol_magic_enable - enable/disable magic packet WoL @adap: the adapter @port: the physical port index @addr: MAC address expected in magic packets, NULL to disable
Enables/disables magic packet wake-on-LAN for the selected port.
Definition at line 7084 of file t4_hw.c.
References A_MAC_PORT_CFG2, A_MAC_PORT_MAGIC_MACID_HI, A_MAC_PORT_MAGIC_MACID_LO, A_XGMAC_PORT_CFG2, A_XGMAC_PORT_MAGIC_MACID_HI, A_XGMAC_PORT_MAGIC_MACID_LO, F_MAGICEN, is_t4(), port, PORT_REG, t4_set_reg_field(), t4_write_reg(), T5_PORT_REG, and V_MAGICEN.
int t4_wol_pat_enable | ( | struct adapter * | adap, |
unsigned int | port, | ||
unsigned int | map, | ||
u64 | mask0, | ||
u64 | mask1, | ||
unsigned int | crc, | ||
bool | enable | ||
) |
t4_wol_pat_enable - enable/disable pattern-based WoL @adap: the adapter @port: the physical port index @map: bitmap of which HW pattern filters to set @mask0: byte mask for bytes 0-63 of a packet @mask1: byte mask for bytes 64-127 of a packet @crc: Ethernet CRC for selected bytes @enable: enable/disable switch
Sets the pattern filters indicated in @map to mask out the bytes specified in @mask0/@mask1 in received packets and compare the CRC of the resulting packet against @crc. If @enable is true pattern-based WoL is enabled, otherwise disabled.
Definition at line 7125 of file t4_hw.c.
References A_MAC_PORT_CFG2, A_XGMAC_PORT_CFG2, EPIO_REG, F_BUSY, F_EPIOWR, F_PATEN, is_t4(), port, PORT_REG, t4_read_reg(), t4_set_reg_field(), t4_write_reg(), T5_PORT_REG, and V_ADDRESS.
int t4_wr_mbox_meat | ( | struct adapter * | adap, |
int | mbox, | ||
const void * | cmd, | ||
int | size, | ||
void * | rpl, | ||
bool | sleep_ok | ||
) |
Definition at line 510 of file t4_hw.c.
References FW_CMD_MAX_TIMEOUT, and t4_wr_mbox_meat_timeout().
Referenced by t4_alloc_encap_mac_filt(), t4_alloc_mac_filt(), t4_alloc_raw_mac_filt(), t4_free_encap_mac_filt(), t4_free_mac_filt(), t4_free_raw_mac_filt(), t4_sched_config(), t4_sched_params(), t4_sched_params_ch_rl(), t4_sched_params_cl_rl_kbps(), t4_sched_params_cl_wrr(), t4_set_addr_hash(), t4_set_rxmode(), t4_tp_fw_ldst_rw(), t4_wr_mbox(), and t4_wr_mbox_ns().
int t4_wr_mbox_meat_timeout | ( | struct adapter * | adap, |
int | mbox, | ||
const void * | cmd, | ||
int | size, | ||
void * | rpl, | ||
bool | sleep_ok, | ||
int | timeout | ||
) |
t4_wr_mbox_meat_timeout - send a command to FW through the given mailbox @adap: the adapter @mbox: index of the mailbox to use @cmd: the command to write @size: command length in bytes @rpl: where to optionally store the reply @sleep_ok: if true we may sleep while awaiting command completion @timeout: time to wait for command to finish before timing out (negative implies @sleep_ok=false)
Sends the given command to FW through the selected mailbox and waits for the FW to execute the command. If @rpl is not NULL it is used to store the FW's reply to the command. The command and its optional reply are of the same length. Some FW commands like RESET and INITIALIZE can take a considerable amount of time to execute. @sleep_ok determines whether we may sleep while awaiting the response. If sleeping is allowed we use progressive backoff otherwise we spin. Note that passing in a negative @timeout is an alternate mechanism for specifying @sleep_ok=false. This is useful when a higher level interface allows for specification of @timeout but not @sleep_ok ...
The return value is 0 on success or a negative errno on failure. A failure can happen either because we are not able to execute the command or FW executes it but signals an error. In the latter case the return value is the error code indicated by FW (negated).
Definition at line 328 of file t4_hw.c.
References A_CIM_PF_MAILBOX_CTRL, A_CIM_PF_MAILBOX_DATA, A_CIM_VF_EXT_MAILBOX_CTRL, A_PCIE_FW, ARRAY_SIZE, ASSERT_SYNCHRONIZED_OP, be64_to_cpu, CH_DUMP_MBOX(), CH_ERR, check_tx_state(), CHK_MBOX_ACCESS, F_MBMSGVALID, F_PCIE_FW_ERR, adapter::flags, fw_asrt(), FW_DEBUG_CMD, FW_T4VF_MBDATA_BASE_ADDR, FW_T6VF_MBDATA_BASE_ADDR, G_FW_CMD_OP, G_FW_CMD_RETVAL, G_MBOWNER, get_mbox_rpl(), is_t6(), IS_VF, MAX_NPORTS, MBOX_LEN, mdelay, msleep, PF_REG, read_tx_state(), res, t4_fatal_err(), t4_read_reg(), t4_write_reg(), t4_write_reg64(), V_FW_CMD_RETVAL, V_MBOWNER, VF_CIM_REG, X_CIM_PF_NOACCESS, X_MBOWNER_FW, X_MBOWNER_NONE, and X_MBOWNER_PL.
Referenced by t4_wr_mbox_meat(), and t4_wr_mbox_timeout().
int t4_write_flash | ( | struct adapter * | adapter, |
unsigned int | addr, | ||
unsigned int | n, | ||
const u8 * | data, | ||
int | byte_oriented | ||
) |
t4_write_flash - write up to a page of data to the serial flash @adapter: the adapter @addr: the start address to write
: length of data to write in bytes @data: the data to write @byte_oriented: whether to store data as bytes or as words
Writes up to a page of data (256 bytes) to the serial flash starting at the given address. All the data must be written to the same page. If @byte_oriented is set the write data is stored as byte stream (i.e. matches what on disk), otherwise in big-endian.
Definition at line 3237 of file t4_hw.c.
References A_SF_OP, ARRAY_SIZE, CH_ERR, cpu_to_be32, flash_wait_op(), adapter::params, sf1_write(), SF_PAGE_SIZE, SF_PROG_PAGE, adapter_params::sf_size, SF_WR_ENABLE, swab32, t4_read_flash(), and t4_write_reg().
Referenced by t4_load_boot(), t4_load_bootcfg(), t4_load_cfg(), t4_load_fw(), and write_flash().
void t4_write_indirect | ( | struct adapter * | adap, |
unsigned int | addr_reg, | ||
unsigned int | data_reg, | ||
const u32 * | vals, | ||
unsigned int | nregs, | ||
unsigned int | start_idx | ||
) |
t4_write_indirect - write indirectly addressed registers @adap: the adapter @addr_reg: register holding the indirect addresses @data_reg: register holding the value for the indirect registers @vals: values to write @nregs: how many indirect registers to write @start_idx: address of first indirect register to write
Writes a sequential block of registers that are accessed indirectly through an address/data register pair.
Definition at line 144 of file t4_hw.c.
References t4_write_reg().
Referenced by clear_stats(), and t4_tp_indirect_rw().
t4_write_rss_key - program one of the RSS keys @adap: the adapter @key: 10-entry array holding the 320-bit RSS key @idx: which RSS key to write @sleep_ok: if true we may sleep while awaiting command completion
Writes one of the RSS keys with the given 320-bit value. If @idx is 0..15 the corresponding entry in the RSS key table is written, otherwise the global RSS key is written.
Definition at line 5922 of file t4_hw.c.
References A_TP_RSS_CONFIG_VRT, A_TP_RSS_SECRET_KEY0, CHELSIO_T5, chip_id(), F_KEYEXTEND, F_KEYWREN, G_KEYMODE, t4_read_reg(), t4_tp_pio_write(), t4_write_reg(), V_KEYWRADDR, V_KEYWRADDRX, and V_T6_VFWRADDR.
Referenced by write_global_rss_key().
void t4_write_rss_pf_config | ( | struct adapter * | adapter, |
unsigned int | index, | ||
u32 | val, | ||
bool | sleep_ok | ||
) |
t4_write_rss_pf_config - write PF RSS Configuration Table @adapter: the adapter @index: the entry in the VF RSS table to read @val: the value to store @sleep_ok: if true we may sleep while awaiting command completion
Writes the PF RSS Configuration Table at the specified index with the specified value.
Definition at line 5976 of file t4_hw.c.
References A_TP_RSS_PF0_CONFIG, and t4_tp_pio_write().
t4_write_rss_pf_map - write PF RSS Map @adapter: the adapter @pfmap: PF RSS Map value
Writes the specified value to the PF RSS Map register.
Definition at line 6083 of file t4_hw.c.
References A_TP_RSS_PF_MAP, and t4_tp_pio_write().
t4_write_rss_pf_mask - write PF RSS Mask @adapter: the adapter @pfmask: PF RSS Mask value
Writes the specified value to the PF RSS Mask register.
Definition at line 6111 of file t4_hw.c.
References A_TP_RSS_PF_MSK, and t4_tp_pio_write().
void t4_write_rss_vf_config | ( | struct adapter * | adapter, |
unsigned int | index, | ||
u32 | vfl, | ||
u32 | vfh, | ||
bool | sleep_ok | ||
) |
t4_write_rss_vf_config - write VF RSS Configuration Table
@adapter: the adapter @index: the entry in the VF RSS table to write @vfl: the VFL to store @vfh: the VFH to store
Writes the VF RSS Configuration Table at the specified index with the specified (VFL, VFH) values.
Definition at line 6032 of file t4_hw.c.
References A_TP_RSS_CONFIG_VRT, A_TP_RSS_VFH_CONFIG, A_TP_RSS_VFL_CONFIG, CHELSIO_T5, chip_id(), F_KEYWREN, F_VFRDEN, F_VFRDRG, F_VFWREN, M_T6_VFWRADDR, M_VFWRADDR, t4_read_reg(), t4_tp_pio_write(), t4_write_reg(), V_T6_VFWRADDR, and V_VFWRADDR.
int t5_fw_init_extern_mem | ( | struct adapter * | adap | ) |
t5_fw_init_extern_mem - initialize the external memory @adap: the adapter
Initializes the external memory on T5.
Definition at line 10528 of file t4_hw.c.
References FW_CMD_MAX_TIMEOUT, FW_PARAMS_MNEM_DEV, FW_PARAMS_PARAM_DEV_MCINIT, is_t5(), adapter::mbox, adapter::pf, t4_set_params_timeout(), V_FW_PARAMS_MNEM, and V_FW_PARAMS_PARAM_X.
Definition at line 4280 of file t4_hw.c.
References A_TP_INT_CAUSE, A_TP_INT_ENABLE, F_FLMTXFLSTEMPTY, intr_info::name, NONFATAL_IF_DISABLED, and t4_handle_intr().
Referenced by t4_slow_intr_handler().
Definition at line 4604 of file t4_hw.c.
References A_ULP_RX_INT_CAUSE, A_ULP_RX_INT_CAUSE_2, A_ULP_RX_INT_ENABLE, A_ULP_RX_INT_ENABLE_2, F_CAUSE_CTX_0, F_CAUSE_CTX_1, F_SE_CNT_MISMATCH_0, F_SE_CNT_MISMATCH_1, intr_info::fatal, intr_info::name, NONFATAL_IF_DISABLED, and t4_handle_intr().
Referenced by t4_slow_intr_handler().
Definition at line 4646 of file t4_hw.c.
References A_ULP_TX_INT_CAUSE, A_ULP_TX_INT_CAUSE_2, A_ULP_TX_INT_ENABLE, A_ULP_TX_INT_ENABLE_2, F_PBL_BOUND_ERR_CH0, F_PBL_BOUND_ERR_CH1, F_PBL_BOUND_ERR_CH2, F_PBL_BOUND_ERR_CH3, intr_info::fatal, intr_info::name, NONFATAL_IF_DISABLED, and t4_handle_intr().
Referenced by t4_slow_intr_handler().