FreeBSD kernel CXGBE device code
t4vf_hw.c File Reference
#include <sys/cdefs.h>
#include "common.h"
#include "t4_regs.h"
#include "t4_regs_values.h"
Include dependency graph for t4vf_hw.c:

Go to the source code of this file.

Macros

#define msleep(x)
 

Functions

 __FBSDID ("$FreeBSD$")
 
int t4vf_wait_dev_ready (struct adapter *adapter)
 
int t4vf_fw_reset (struct adapter *adapter)
 
int t4vf_get_sge_params (struct adapter *adapter)
 
int t4vf_get_rss_glb_config (struct adapter *adapter)
 
int t4vf_get_vfres (struct adapter *adapter)
 
int t4vf_prep_adapter (struct adapter *adapter)
 
int t4vf_get_vf_mac (struct adapter *adapter, unsigned int port, unsigned int *naddr, u8 *addr)
 

Macro Definition Documentation

◆ msleep

#define msleep (   x)
Value:
do { \
if (cold) \
DELAY((x) * 1000); \
else \
pause("t4hw", (x) * hz / 1000); \
} while (0)

Definition at line 35 of file t4vf_hw.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ t4vf_fw_reset()

int t4vf_fw_reset ( struct adapter adapter)

t4vf_fw_reset - issue a reset to FW @adapter: the adapter

Issues a reset command to FW. For a Physical Function this would result in the Firmware reseting all of its state. For a Virtual Function this just resets the state associated with the VF.

Definition at line 74 of file t4vf_hw.c.

References cpu_to_be32, F_FW_CMD_WRITE, FW_LEN16, FW_RESET_CMD, fw_reset_cmd::op_to_write, fw_reset_cmd::retval_len16, t4vf_wr_mbox(), V_FW_CMD_LEN16, and V_FW_CMD_OP.

Referenced by t4vf_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ t4vf_get_rss_glb_config()

int t4vf_get_rss_glb_config ( struct adapter adapter)

t4vf_get_rss_glb_config - retrieve adapter RSS Global Configuration @adapter: the adapter

Retrieves global RSS mode and parameters with which we have to live and stores them in the @adapter's RSS parameters.

Definition at line 233 of file t4vf_hw.c.

References rss_params::basicvirtual, fw_rss_glb_config_cmd::fw_rss_glb_config::basicvirtual, be32_to_cpu, cpu_to_be32, F_FW_CMD_READ, F_FW_CMD_REQUEST, F_FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ, F_FW_RSS_GLB_CONFIG_CMD_OFDMAPEN, F_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4, F_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6, F_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4, F_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6, F_FW_RSS_GLB_CONFIG_CMD_SYNMAPEN, F_FW_RSS_GLB_CONFIG_CMD_TNLALLLKP, F_FW_RSS_GLB_CONFIG_CMD_TNLMAPEN, FW_LEN16, FW_RSS_GLB_CONFIG_CMD, FW_RSS_GLB_CONFIG_CMD_MODE_BASICVIRTUAL, FW_SUCCESS, G_FW_RSS_GLB_CONFIG_CMD_MODE, rss_params::hashtoeplitz, fw_rss_glb_config_cmd::fw_rss_glb_config::manual, rss_params::mode, fw_rss_glb_config_cmd::fw_rss_glb_config::fw_rss_glb_config_manual::mode_pkd, rss_params::ofdmapen, fw_rss_glb_config_cmd::op_to_write, adapter::params, fw_rss_glb_config_cmd::retval_len16, adapter_params::rss, rss_params::syn2tupenipv4, rss_params::syn2tupenipv6, rss_params::syn4tupenipv4, rss_params::syn4tupenipv6, rss_params::synmapen, fw_rss_glb_config_cmd::fw_rss_glb_config::fw_rss_glb_config_basicvirtual::synmapen_to_hashtoeplitz, t4vf_wr_mbox(), rss_params::tnlalllookup, rss_params::tnlmapen, rss_params::u, fw_rss_glb_config_cmd::u, and V_FW_CMD_OP.

Referenced by get_params__post_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ t4vf_get_sge_params()

int t4vf_get_sge_params ( struct adapter adapter)

t4vf_get_sge_params - retrieve adapter Scatter gather Engine parameters @adapter: the adapter

Retrieves various core SGE parameters in the form of hardware SGE register values. The caller is responsible for decoding these as needed. The SGE parameters are stored in @adapter->params.sge.

Definition at line 93 of file t4vf_hw.c.

References A_PL_VF_WHOAMI, A_SGE_CONM_CTRL, A_SGE_CONTROL, A_SGE_CONTROL2, A_SGE_FL_BUFFER_SIZE0, A_SGE_HOST_PAGE_SIZE, A_SGE_INGRESS_RX_THRESHOLD, A_SGE_TIMER_VALUE_0_AND_1, A_SGE_TIMER_VALUE_2_AND_3, A_SGE_TIMER_VALUE_4_AND_5, CH_ERR, CHELSIO_T5, chip_id(), core_ticks_to_us(), sge_params::counter_val, F_EGRSTATUSPAGESIZE, sge_params::fl_pktshift, sge_params::fl_starve_threshold, sge_params::fl_starve_threshold2, FW_PARAMS_MNEM_REG, FW_SUCCESS, G_EGRTHRESHOLD, G_EGRTHRESHOLDPACKING, G_INGPACKBOUNDARY, G_INGPADBOUNDARY, G_PKTSHIFT, G_SOURCEPF, 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, is_t4(), is_t5(), M_HOSTPAGESIZEPF0, sge_params::pack_boundary, sge_params::pad_boundary, sge_params::page_shift, adapter::params, S_HOSTPAGESIZEPF0, S_HOSTPAGESIZEPF1, adapter_params::sge, sge_params::sge_control, sge_params::sge_fl_buffer_size, SGE_FLBUF_SIZES, sge_params::spg_len, t4_read_reg(), t4vf_query_params(), sge_params::timer_val, V_FW_PARAMS_MNEM, V_FW_PARAMS_PARAM_XYZ, VF_PL_REG, X_INGPADBOUNDARY_SHIFT, and X_T6_INGPADBOUNDARY_SHIFT.

Referenced by get_params__post_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ t4vf_get_vf_mac()

int t4vf_get_vf_mac ( struct adapter adapter,
unsigned int  port,
unsigned int *  naddr,
u8 addr 
)

◆ t4vf_get_vfres()

◆ t4vf_prep_adapter()

int t4vf_prep_adapter ( struct adapter adapter)

Definition at line 354 of file t4vf_hw.c.

References vpd_params::cclk, chip_id(), adapter::chip_params, adapter_params::chipid, adapter::dev, adapter_params::fpga, adapter_params::nports, adapter::params, vf_resources::pmask, t4_get_chip_params(), t4vf_wait_dev_ready(), adapter_params::vfres, and adapter_params::vpd.

Referenced by t4vf_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ t4vf_wait_dev_ready()

int t4vf_wait_dev_ready ( struct adapter adapter)

Definition at line 47 of file t4vf_hw.c.

References A_PL_VF_WHOAMI, msleep, t4_read_reg(), and VF_PL_REG.

Referenced by t4vf_prep_adapter().

Here is the call graph for this function:
Here is the caller graph for this function: