Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
t4vf_common.h File Reference
#include "../cxgb4/t4fw_api.h"
#include "adapter.h"

Go to the source code of this file.

Data Structures

struct  t4vf_port_stats
 
struct  link_config
 
struct  dev_params
 
struct  sge_params
 
struct  vpd_params
 
struct  rss_params
 
union  rss_vi_config
 
struct  vf_resources
 
struct  adapter_params
 

Macros

#define FW_LEN16(fw_struct)   FW_CMD_LEN16(sizeof(fw_struct) / 16)
 
#define PCI_VENDOR_ID_CHELSIO   0x1425
 
#define for_each_port(adapter, iter)   for (iter = 0; iter < (adapter)->params.nports; iter++)
 

Enumerations

enum  { PAUSE_RX = 1 << 0, PAUSE_TX = 1 << 1, PAUSE_AUTONEG = 1 << 2 }
 

Functions

int t4vf_wr_mbox_core (struct adapter *, const void *, int, void *, bool)
 
int __devinit t4vf_wait_dev_ready (struct adapter *)
 
int __devinit t4vf_port_init (struct adapter *, int)
 
int t4vf_fw_reset (struct adapter *)
 
int t4vf_query_params (struct adapter *, unsigned int, const u32 *, u32 *)
 
int t4vf_set_params (struct adapter *, unsigned int, const u32 *, const u32 *)
 
int t4vf_get_sge_params (struct adapter *)
 
int t4vf_get_vpd_params (struct adapter *)
 
int t4vf_get_dev_params (struct adapter *)
 
int t4vf_get_rss_glb_config (struct adapter *)
 
int t4vf_get_vfres (struct adapter *)
 
int t4vf_read_rss_vi_config (struct adapter *, unsigned int, union rss_vi_config *)
 
int t4vf_write_rss_vi_config (struct adapter *, unsigned int, union rss_vi_config *)
 
int t4vf_config_rss_range (struct adapter *, unsigned int, int, int, const u16 *, int)
 
int t4vf_alloc_vi (struct adapter *, int)
 
int t4vf_free_vi (struct adapter *, int)
 
int t4vf_enable_vi (struct adapter *, unsigned int, bool, bool)
 
int t4vf_identify_port (struct adapter *, unsigned int, unsigned int)
 
int t4vf_set_rxmode (struct adapter *, unsigned int, int, int, int, int, int, bool)
 
int t4vf_alloc_mac_filt (struct adapter *, unsigned int, bool, unsigned int, const u8 **, u16 *, u64 *, bool)
 
int t4vf_change_mac (struct adapter *, unsigned int, int, const u8 *, bool)
 
int t4vf_set_addr_hash (struct adapter *, unsigned int, bool, u64, bool)
 
int t4vf_get_port_stats (struct adapter *, int, struct t4vf_port_stats *)
 
int t4vf_iq_free (struct adapter *, unsigned int, unsigned int, unsigned int, unsigned int)
 
int t4vf_eth_eq_free (struct adapter *, unsigned int)
 
int t4vf_handle_fw_rpl (struct adapter *, const __be64 *)
 

Macro Definition Documentation

#define for_each_port (   adapter,
  iter 
)    for (iter = 0; iter < (adapter)->params.nports; iter++)

Definition at line 196 of file t4vf_common.h.

#define FW_LEN16 (   fw_struct)    FW_CMD_LEN16(sizeof(fw_struct) / 16)

Definition at line 44 of file t4vf_common.h.

#define PCI_VENDOR_ID_CHELSIO   0x1425

Definition at line 193 of file t4vf_common.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
PAUSE_RX 
PAUSE_TX 
PAUSE_AUTONEG 

Definition at line 90 of file t4vf_common.h.

Function Documentation

int t4vf_alloc_mac_filt ( struct adapter adapter,
unsigned int  viid,
bool  free,
unsigned int  naddr,
const u8 **  addr,
u16 idx,
u64 hash,
bool  sleep_ok 
)

t4vf_alloc_mac_filt - allocates exact-match filters for MAC addresses : the adapter : the Virtual Interface Identifier : if true any existing filters for this VI id are first removed : the number of MAC addresses to allocate filters for (up to 7) : the MAC address(es) : where to store the index of each allocated filter : pointer to hash address filter bitmap : call is allowed to sleep

Allocates an exact-match filter for each of the supplied addresses and sets it to the corresponding address. If is not NULL it should have at least 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 is not NULL addresses that fail to allocate an exact filter are hashed and update the hash filter bitmap pointed at by .

Returns a negative error number or the number of filters allocated.

Definition at line 1023 of file t4vf_hw.c.

int t4vf_alloc_vi ( struct adapter adapter,
int  port_id 
)

t4vf_alloc_vi - allocate a virtual interface on a port : the adapter : physical port associated with the VI

Allocate a new Virtual Interface and bind it to the indicated physical port. Return the new Virtual Interface Identifier on success, or a [negative] error number on failure.

Definition at line 858 of file t4vf_hw.c.

int t4vf_change_mac ( struct adapter adapter,
unsigned int  viid,
int  idx,
const u8 addr,
bool  persist 
)

t4vf_change_mac - modifies the exact-match filter for a MAC address : the adapter : the Virtual Interface ID : index of existing filter for old value of MAC address, or -1 : the new MAC address value : if idx < 0, the new MAC allocation should be persistent

Modifies an exact-match filter and sets it to the new MAC address. 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. can be -1 if the address is a new addition.

Returns a negative error number or the index of the filter with the new MAC value.

Definition at line 1114 of file t4vf_hw.c.

int t4vf_config_rss_range ( struct adapter adapter,
unsigned int  viid,
int  start,
int  n,
const u16 rspq,
int  nrspq 
)

t4vf_config_rss_range - configure a portion of the RSS mapping table : the adapter : Virtual Interface of RSS Table Slice : starting entry in the table to write
: how many table entries to write : values for the "Response Queue" (Ingress Queue) lookup table : number of values in

Programs the selected part of the VI's RSS mapping table with the provided values. If <
the supplied values are used repeatedly until the full table range is populated.

The caller must ensure the values in are in the range 0..1023.

Definition at line 768 of file t4vf_hw.c.

int t4vf_enable_vi ( struct adapter adapter,
unsigned int  viid,
bool  rx_en,
bool  tx_en 
)

t4vf_enable_vi - enable/disable a virtual interface : the adapter : the Virtual Interface ID : 1=enable Rx, 0=disable Rx : 1=enable Tx, 0=disable Tx

Enables/disables a virtual interface.

Definition at line 916 of file t4vf_hw.c.

int t4vf_eth_eq_free ( struct adapter adapter,
unsigned int  eqid 
)

t4vf_eth_eq_free - free an Ethernet egress queue : the adapter : egress queue ID

Frees an Ethernet egress queue.

Definition at line 1290 of file t4vf_hw.c.

int t4vf_free_vi ( struct adapter adapter,
int  viid 
)

t4vf_free_vi – free a virtual interface : the adapter : the virtual interface identifier

Free a previously allocated Virtual Interface. Return an error on failure.

Definition at line 890 of file t4vf_hw.c.

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 346 of file t4vf_hw.c.

int t4vf_get_dev_params ( struct adapter adapter)

t4vf_get_dev_params - retrieve device paremeters : the adapter

Retrives various device parameters. The parameters are stored in ->params.dev.

Definition at line 510 of file t4vf_hw.c.

int t4vf_get_port_stats ( struct adapter adapter,
int  pidx,
struct t4vf_port_stats s 
)

t4vf_get_port_stats - collect "port" statistics : the adapter : the port index : the stats structure to fill

Collect statistics for the "port"'s Virtual Interface.

Definition at line 1187 of file t4vf_hw.c.

int t4vf_get_rss_glb_config ( struct adapter adapter)

t4vf_get_rss_glb_config - retrieve adapter RSS Global Configuration : the adapter

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

Definition at line 536 of file t4vf_hw.c.

int t4vf_get_sge_params ( struct adapter adapter)

t4vf_get_sge_params - retrieve adapter Scatter gather Engine parameters : 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 ->params.sge.

Definition at line 439 of file t4vf_hw.c.

int t4vf_get_vfres ( struct adapter adapter)

t4vf_get_vfres - retrieve VF resource limits : the adapter

Retrieves configured resource limits and capabilities for a virtual function. The results are stored in ->vfres.

Definition at line 611 of file t4vf_hw.c.

int t4vf_get_vpd_params ( struct adapter adapter)

t4vf_get_vpd_params - retrieve device VPD paremeters : the adapter

Retrives various device Vital Product Data parameters. The parameters are stored in ->params.vpd.

Definition at line 487 of file t4vf_hw.c.

int t4vf_handle_fw_rpl ( struct adapter adapter,
const __be64 rpl 
)

t4vf_handle_fw_rpl - process a firmware reply message : the adapter : start of the firmware message

Processes a firmware message, such as link state change messages.

Definition at line 1311 of file t4vf_hw.c.

int t4vf_identify_port ( struct adapter adapter,
unsigned int  viid,
unsigned int  nblinks 
)

t4vf_identify_port - identify a VI's port by blinking its LED : the adapter : the Virtual Interface ID : how many times to blink LED at 2.5 Hz

Identifies a VI's port by blinking its LED.

Definition at line 940 of file t4vf_hw.c.

int t4vf_iq_free ( struct adapter adapter,
unsigned int  iqtype,
unsigned int  iqid,
unsigned int  fl0id,
unsigned int  fl1id 
)

t4vf_iq_free - free an ingress queue and its free lists : the adapter : the ingress queue type (FW_IQ_TYPE_FL_INT_CAP, etc.) : ingress queue ID : FL0 queue ID or 0xffff if no attached FL0 : FL1 queue ID or 0xffff if no attached FL1

Frees an ingress queue and its associated free lists, if any.

Definition at line 1263 of file t4vf_hw.c.

int __devinit t4vf_port_init ( struct adapter adapter,
int  pidx 
)

t4vf_port_init - initialize port hardware/software state : the adapter : the adapter port index

Definition at line 278 of file t4vf_hw.c.

int t4vf_query_params ( struct adapter adapter,
unsigned int  nparams,
const u32 params,
u32 vals 
)

t4vf_query_params - query FW or device parameters : the adapter : the number of parameters : the parameter names : the parameter values

Reads the values of firmware or device parameters. Up to 7 parameters can be queried at once.

Definition at line 367 of file t4vf_hw.c.

int t4vf_read_rss_vi_config ( struct adapter adapter,
unsigned int  viid,
union rss_vi_config config 
)

t4vf_read_rss_vi_config - read a VI's RSS configuration : the adapter : Virtual Interface ID : pointer to host-native VI RSS Configuration buffer

Reads the Virtual Interface's RSS configuration information and translates it into CPU-native format.

Definition at line 664 of file t4vf_hw.c.

int t4vf_set_addr_hash ( struct adapter adapter,
unsigned int  viid,
bool  ucast,
u64  vec,
bool  sleep_ok 
)

t4vf_set_addr_hash - program the MAC inexact-match hash filter : the adapter : the Virtual Interface Identifier : whether the hash filter should also match unicast addresses : the value to be written to the hash filter : call is allowed to sleep

Sets the 64-bit inexact-match hash filter for a virtual interface.

Definition at line 1160 of file t4vf_hw.c.

int t4vf_set_params ( struct adapter adapter,
unsigned int  nparams,
const u32 params,
const u32 vals 
)

t4vf_set_params - sets FW or device parameters : the adapter : the number of parameters : the parameter names : the parameter values

Sets the values of firmware or device parameters. Up to 7 parameters can be specified at once.

Definition at line 405 of file t4vf_hw.c.

int t4vf_set_rxmode ( struct adapter adapter,
unsigned int  viid,
int  mtu,
int  promisc,
int  all_multi,
int  bcast,
int  vlanex,
bool  sleep_ok 
)

t4vf_set_rxmode - set Rx properties of a virtual interface : the adapter : the VI id : the new MTU or -1 for no change : 1 to enable promiscuous mode, 0 to disable it, -1 no change : 1 to enable all-multi mode, 0 to disable it, -1 no change : 1 to enable broadcast Rx, 0 to disable it, -1 no change : 1 to enable hardware VLAN Tag extraction, 0 to disable it, -1 no change

Sets Rx properties of a virtual interface.

Definition at line 969 of file t4vf_hw.c.

int __devinit t4vf_wait_dev_ready ( struct adapter )

Definition at line 49 of file t4vf_hw.c.

int t4vf_wr_mbox_core ( struct adapter adapter,
const void cmd,
int  size,
void rpl,
bool  sleep_ok 
)

t4vf_wr_mbox_core - send a command to FW through the mailbox : the adapter : the command to write : command length in bytes : where to optionally store the reply : if true we may sleep while awaiting command completion

Sends the given command to FW through the mailbox and waits for the FW to execute the command. If 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. FW can take up to 500 ms to respond. determines whether we may sleep while awaiting the response. If sleeping is allowed we use progressive backoff otherwise we spin.

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 115 of file t4vf_hw.c.

int t4vf_write_rss_vi_config ( struct adapter adapter,
unsigned int  viid,
union rss_vi_config config 
)

t4vf_write_rss_vi_config - write a VI's RSS configuration : the adapter : Virtual Interface ID : pointer to host-native VI RSS Configuration buffer

Write the Virtual Interface's RSS configuration information (translating it into firmware-native format before writing).

Definition at line 715 of file t4vf_hw.c.