Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
common.h File Reference
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/ctype.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/netdevice.h>
#include <linux/ethtool.h>
#include <linux/mdio.h>
#include "version.h"
#include "adapter.h"

Go to the source code of this file.

Data Structures

struct  sg_ent
 
struct  mdio_ops
 
struct  adapter_info
 
struct  mc5_stats
 
struct  mc7_stats
 
struct  mac_stats
 
struct  tp_mib_stats
 
struct  tp_params
 
struct  qset_params
 
struct  sge_params
 
struct  mc5_params
 
struct  vpd_params
 
struct  pci_params
 
struct  adapter_params
 
struct  trace_params
 
struct  link_config
 
struct  mc5
 
struct  mc7
 
struct  cmac
 
struct  cphy_ops
 
struct  cphy
 
struct  addr_val_pair
 

Macros

#define CH_ERR(adap, fmt,...)   dev_err(&adap->pdev->dev, fmt, ## __VA_ARGS__)
 
#define CH_WARN(adap, fmt,...)   dev_warn(&adap->pdev->dev, fmt, ## __VA_ARGS__)
 
#define CH_ALERT(adap, fmt,...)   dev_printk(KERN_ALERT, &adap->pdev->dev, fmt, ## __VA_ARGS__)
 
#define CH_MSG(adapter, level, category, fmt,...)
 
#define CH_DBG(adapter, category, fmt,...)
 
#define NETIF_MSG_MMIO   0x8000000
 
#define MAX_RX_COALESCING_LEN   12288U
 
#define TP_VERSION_MAJOR   1
 
#define TP_VERSION_MINOR   1
 
#define TP_VERSION_MICRO   0
 
#define S_TP_VERSION_MAJOR   16
 
#define M_TP_VERSION_MAJOR   0xFF
 
#define V_TP_VERSION_MAJOR(x)   ((x) << S_TP_VERSION_MAJOR)
 
#define G_TP_VERSION_MAJOR(x)   (((x) >> S_TP_VERSION_MAJOR) & M_TP_VERSION_MAJOR)
 
#define S_TP_VERSION_MINOR   8
 
#define M_TP_VERSION_MINOR   0xFF
 
#define V_TP_VERSION_MINOR(x)   ((x) << S_TP_VERSION_MINOR)
 
#define G_TP_VERSION_MINOR(x)   (((x) >> S_TP_VERSION_MINOR) & M_TP_VERSION_MINOR)
 
#define S_TP_VERSION_MICRO   0
 
#define M_TP_VERSION_MICRO   0xFF
 
#define V_TP_VERSION_MICRO(x)   ((x) << S_TP_VERSION_MICRO)
 
#define G_TP_VERSION_MICRO(x)   (((x) >> S_TP_VERSION_MICRO) & M_TP_VERSION_MICRO)
 
#define SGE_NUM_GENBITS   2
 
#define TX_DESC_FLITS   16U
 
#define WR_FLITS   (TX_DESC_FLITS + 1 - SGE_NUM_GENBITS)
 
#define SPEED_INVALID   0xffff
 
#define DUPLEX_INVALID   0xff
 
#define MAC_STATS_ACCUM_SECS   180
 
#define XGM_REG(reg_addr, idx)   ((reg_addr) + (idx) * (XGMAC0_1_BASE_ADDR - XGMAC0_0_BASE_ADDR))
 
#define PCI_VENDOR_ID_CHELSIO   0x1425
 
#define for_each_port(adapter, iter)   for (iter = 0; iter < (adapter)->params.nports; ++iter)
 
#define adapter_info(adap)   ((adap)->params.info)
 

Enumerations

enum  {
  MAX_NPORTS = 2, MAX_FRAME_SIZE = 10240, EEPROMSIZE = 8192, SERNUM_LEN = 16,
  RSS_TABLE_SIZE = 64, TCB_SIZE = 128, NMTUS = 16, NCCTRL_WIN = 32,
  PROTO_SRAM_LINES = 128
}
 
enum  { PAUSE_RX = 1 << 0, PAUSE_TX = 1 << 1, PAUSE_AUTONEG = 1 << 2 }
 
enum  { SUPPORTED_IRQ = 1 << 24 }
 
enum  { STAT_ULP_CH0_PBL_OOB, STAT_ULP_CH1_PBL_OOB, STAT_PCI_CORR_ECC, IRQ_NUM_STATS }
 
enum  { SGE_QSETS = 8, SGE_RXQ_PER_SET = 2, SGE_TXQ_PER_SET = 3 }
 
enum  sge_context_type { SGE_CNTXT_RDMA = 0, SGE_CNTXT_ETH = 2, SGE_CNTXT_OFLD = 4, SGE_CNTXT_CTRL = 5 }
 
enum  { AN_PKT_SIZE = 32, IMMED_PKT_SIZE = 48 }
 
enum  { DEFAULT_NSERVERS = 512, DEFAULT_NFILTERS = 128 }
 
enum  { MC5_MODE_144_BIT = 1, MC5_MODE_72_BIT = 2 }
 
enum  { MC5_MIN_TIDS = 16 }
 
enum  {
  PCI_VARIANT_PCI, PCI_VARIANT_PCIX_MODE1_PARITY, PCI_VARIANT_PCIX_MODE1_ECC, PCI_VARIANT_PCIX_266_MODE2,
  PCI_VARIANT_PCIE
}
 
enum  { T3_REV_A = 0, T3_REV_B = 2, T3_REV_B2 = 3, T3_REV_C = 4 }
 
enum  { MAC_DIRECTION_RX = 1, MAC_DIRECTION_TX = 2, MAC_RXFIFO_SIZE = 32768 }
 
enum  { PHY_LOOPBACK_TX = 1, PHY_LOOPBACK_RX = 2 }
 
enum  { cphy_cause_link_change = 1, cphy_cause_fifo_error = 2, cphy_cause_module_change = 4 }
 
enum  {
  phy_modtype_none, phy_modtype_sr, phy_modtype_lr, phy_modtype_lrm,
  phy_modtype_twinax, phy_modtype_twinax_long, phy_modtype_unknown
}
 
enum  {
  EDC_OPT_AEL2005 = 0, EDC_OPT_AEL2005_SIZE = 1084, EDC_TWX_AEL2005 = 1, EDC_TWX_AEL2005_SIZE = 1464,
  EDC_TWX_AEL2020 = 2, EDC_TWX_AEL2020_SIZE = 1628, EDC_MAX_SIZE = EDC_TWX_AEL2020_SIZE
}
 

Functions

void t3_set_reg_field (struct adapter *adap, unsigned int addr, u32 mask, u32 val)
 
void t3_write_regs (struct adapter *adapter, const struct addr_val_pair *p, int n, unsigned int offset)
 
int t3_wait_op_done_val (struct adapter *adapter, int reg, u32 mask, int polarity, int attempts, int delay, u32 *valp)
 
int t3_mdio_change_bits (struct cphy *phy, int mmd, int reg, unsigned int clear, unsigned int set)
 
int t3_phy_reset (struct cphy *phy, int mmd, int wait)
 
int t3_phy_advertise (struct cphy *phy, unsigned int advert)
 
int t3_phy_advertise_fiber (struct cphy *phy, unsigned int advert)
 
int t3_set_phy_speed_duplex (struct cphy *phy, int speed, int duplex)
 
int t3_phy_lasi_intr_enable (struct cphy *phy)
 
int t3_phy_lasi_intr_disable (struct cphy *phy)
 
int t3_phy_lasi_intr_clear (struct cphy *phy)
 
int t3_phy_lasi_intr_handler (struct cphy *phy)
 
void t3_intr_enable (struct adapter *adapter)
 
void t3_intr_disable (struct adapter *adapter)
 
void t3_intr_clear (struct adapter *adapter)
 
void t3_xgm_intr_enable (struct adapter *adapter, int idx)
 
void t3_xgm_intr_disable (struct adapter *adapter, int idx)
 
void t3_port_intr_enable (struct adapter *adapter, int idx)
 
void t3_port_intr_disable (struct adapter *adapter, int idx)
 
int t3_slow_intr_handler (struct adapter *adapter)
 
int t3_phy_intr_handler (struct adapter *adapter)
 
void t3_link_changed (struct adapter *adapter, int port_id)
 
void t3_link_fault (struct adapter *adapter, int port_id)
 
int t3_link_start (struct cphy *phy, struct cmac *mac, struct link_config *lc)
 
struct adapter_infot3_get_adapter_info (unsigned int board_id)
 
int t3_seeprom_read (struct adapter *adapter, u32 addr, __le32 *data)
 
int t3_seeprom_write (struct adapter *adapter, u32 addr, __le32 data)
 
int t3_seeprom_wp (struct adapter *adapter, int enable)
 
int t3_get_tp_version (struct adapter *adapter, u32 *vers)
 
int t3_check_tpsram_version (struct adapter *adapter)
 
int t3_check_tpsram (struct adapter *adapter, const u8 *tp_ram, unsigned int size)
 
int t3_set_proto_sram (struct adapter *adap, const u8 *data)
 
int t3_load_fw (struct adapter *adapter, const u8 *fw_data, unsigned int size)
 
int t3_get_fw_version (struct adapter *adapter, u32 *vers)
 
int t3_check_fw_version (struct adapter *adapter)
 
int t3_init_hw (struct adapter *adapter, u32 fw_params)
 
int t3_reset_adapter (struct adapter *adapter)
 
int t3_prep_adapter (struct adapter *adapter, const struct adapter_info *ai, int reset)
 
int t3_replay_prep_adapter (struct adapter *adapter)
 
void t3_led_ready (struct adapter *adapter)
 
void t3_fatal_err (struct adapter *adapter)
 
void t3_set_vlan_accel (struct adapter *adapter, unsigned int ports, int on)
 
void t3_config_rss (struct adapter *adapter, unsigned int rss_config, const u8 *cpus, const u16 *rspq)
 
int t3_cim_ctl_blk_read (struct adapter *adap, unsigned int addr, unsigned int n, unsigned int *valp)
 
int t3_mc7_bd_read (struct mc7 *mc7, unsigned int start, unsigned int n, u64 *buf)
 
int t3_mac_reset (struct cmac *mac)
 
void t3b_pcs_reset (struct cmac *mac)
 
void t3_mac_disable_exact_filters (struct cmac *mac)
 
void t3_mac_enable_exact_filters (struct cmac *mac)
 
int t3_mac_enable (struct cmac *mac, int which)
 
int t3_mac_disable (struct cmac *mac, int which)
 
int t3_mac_set_mtu (struct cmac *mac, unsigned int mtu)
 
int t3_mac_set_rx_mode (struct cmac *mac, struct net_device *dev)
 
int t3_mac_set_address (struct cmac *mac, unsigned int idx, u8 addr[6])
 
int t3_mac_set_num_ucast (struct cmac *mac, int n)
 
struct mac_statst3_mac_update_stats (struct cmac *mac)
 
int t3_mac_set_speed_duplex_fc (struct cmac *mac, int speed, int duplex, int fc)
 
int t3b2_mac_watchdog_task (struct cmac *mac)
 
void t3_mc5_prep (struct adapter *adapter, struct mc5 *mc5, int mode)
 
int t3_mc5_init (struct mc5 *mc5, unsigned int nservers, unsigned int nfilters, unsigned int nroutes)
 
void t3_mc5_intr_handler (struct mc5 *mc5)
 
void t3_tp_set_offload_mode (struct adapter *adap, int enable)
 
void t3_tp_get_mib_stats (struct adapter *adap, struct tp_mib_stats *tps)
 
void t3_load_mtus (struct adapter *adap, unsigned short mtus[NMTUS], unsigned short alpha[NCCTRL_WIN], unsigned short beta[NCCTRL_WIN], unsigned short mtu_cap)
 
void t3_config_trace_filter (struct adapter *adapter, const struct trace_params *tp, int filter_index, int invert, int enable)
 
int t3_config_sched (struct adapter *adap, unsigned int kbps, int sched)
 
void t3_sge_prep (struct adapter *adap, struct sge_params *p)
 
void t3_sge_init (struct adapter *adap, struct sge_params *p)
 
int t3_sge_init_ecntxt (struct adapter *adapter, unsigned int id, int gts_enable, enum sge_context_type type, int respq, u64 base_addr, unsigned int size, unsigned int token, int gen, unsigned int cidx)
 
int t3_sge_init_flcntxt (struct adapter *adapter, unsigned int id, int gts_enable, u64 base_addr, unsigned int size, unsigned int esize, unsigned int cong_thres, int gen, unsigned int cidx)
 
int t3_sge_init_rspcntxt (struct adapter *adapter, unsigned int id, int irq_vec_idx, u64 base_addr, unsigned int size, unsigned int fl_thres, int gen, unsigned int cidx)
 
int t3_sge_init_cqcntxt (struct adapter *adapter, unsigned int id, u64 base_addr, unsigned int size, int rspq, int ovfl_mode, unsigned int credits, unsigned int credit_thres)
 
int t3_sge_enable_ecntxt (struct adapter *adapter, unsigned int id, int enable)
 
int t3_sge_disable_fl (struct adapter *adapter, unsigned int id)
 
int t3_sge_disable_rspcntxt (struct adapter *adapter, unsigned int id)
 
int t3_sge_disable_cqcntxt (struct adapter *adapter, unsigned int id)
 
int t3_sge_cqcntxt_op (struct adapter *adapter, unsigned int id, unsigned int op, unsigned int credits)
 
int t3_vsc8211_phy_prep (struct cphy *phy, struct adapter *adapter, int phy_addr, const struct mdio_ops *mdio_ops)
 
int t3_ael1002_phy_prep (struct cphy *phy, struct adapter *adapter, int phy_addr, const struct mdio_ops *mdio_ops)
 
int t3_ael1006_phy_prep (struct cphy *phy, struct adapter *adapter, int phy_addr, const struct mdio_ops *mdio_ops)
 
int t3_ael2005_phy_prep (struct cphy *phy, struct adapter *adapter, int phy_addr, const struct mdio_ops *mdio_ops)
 
int t3_ael2020_phy_prep (struct cphy *phy, struct adapter *adapter, int phy_addr, const struct mdio_ops *mdio_ops)
 
int t3_qt2045_phy_prep (struct cphy *phy, struct adapter *adapter, int phy_addr, const struct mdio_ops *mdio_ops)
 
int t3_xaui_direct_phy_prep (struct cphy *phy, struct adapter *adapter, int phy_addr, const struct mdio_ops *mdio_ops)
 
int t3_aq100x_phy_prep (struct cphy *phy, struct adapter *adapter, int phy_addr, const struct mdio_ops *mdio_ops)
 

Macro Definition Documentation

#define adapter_info (   adap)    ((adap)->params.info)

Definition at line 617 of file common.h.

#define CH_ALERT (   adap,
  fmt,
  ... 
)    dev_printk(KERN_ALERT, &adap->pdev->dev, fmt, ## __VA_ARGS__)

Definition at line 47 of file common.h.

#define CH_DBG (   adapter,
  category,
  fmt,
  ... 
)

Definition at line 64 of file common.h.

#define CH_ERR (   adap,
  fmt,
  ... 
)    dev_err(&adap->pdev->dev, fmt, ## __VA_ARGS__)

Definition at line 45 of file common.h.

#define CH_MSG (   adapter,
  level,
  category,
  fmt,
  ... 
)
Value:
do { \
if ((adapter)->msg_enable & NETIF_MSG_##category) \
dev_printk(KERN_##level, &adapter->pdev->dev, fmt, \
## __VA_ARGS__); \
} while (0)

Definition at line 54 of file common.h.

#define CH_WARN (   adap,
  fmt,
  ... 
)    dev_warn(&adap->pdev->dev, fmt, ## __VA_ARGS__)

Definition at line 46 of file common.h.

#define DUPLEX_INVALID   0xff

Definition at line 442 of file common.h.

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

Definition at line 614 of file common.h.

#define G_TP_VERSION_MAJOR (   x)    (((x) >> S_TP_VERSION_MAJOR) & M_TP_VERSION_MAJOR)

Definition at line 109 of file common.h.

#define G_TP_VERSION_MICRO (   x)    (((x) >> S_TP_VERSION_MICRO) & M_TP_VERSION_MICRO)

Definition at line 121 of file common.h.

#define G_TP_VERSION_MINOR (   x)    (((x) >> S_TP_VERSION_MINOR) & M_TP_VERSION_MINOR)

Definition at line 115 of file common.h.

#define M_TP_VERSION_MAJOR   0xFF

Definition at line 107 of file common.h.

#define M_TP_VERSION_MICRO   0xFF

Definition at line 119 of file common.h.

#define M_TP_VERSION_MINOR   0xFF

Definition at line 113 of file common.h.

#define MAC_STATS_ACCUM_SECS   180

Definition at line 598 of file common.h.

#define MAX_RX_COALESCING_LEN   12288U

Definition at line 82 of file common.h.

#define NETIF_MSG_MMIO   0x8000000

Definition at line 68 of file common.h.

#define PCI_VENDOR_ID_CHELSIO   0x1425

Definition at line 611 of file common.h.

#define S_TP_VERSION_MAJOR   16

Definition at line 106 of file common.h.

#define S_TP_VERSION_MICRO   0

Definition at line 118 of file common.h.

#define S_TP_VERSION_MINOR   8

Definition at line 112 of file common.h.

#define SGE_NUM_GENBITS   2

Definition at line 149 of file common.h.

#define SPEED_INVALID   0xffff

Definition at line 441 of file common.h.

#define TP_VERSION_MAJOR   1

Definition at line 102 of file common.h.

#define TP_VERSION_MICRO   0

Definition at line 104 of file common.h.

#define TP_VERSION_MINOR   1

Definition at line 103 of file common.h.

#define TX_DESC_FLITS   16U

Definition at line 152 of file common.h.

#define V_TP_VERSION_MAJOR (   x)    ((x) << S_TP_VERSION_MAJOR)

Definition at line 108 of file common.h.

#define V_TP_VERSION_MICRO (   x)    ((x) << S_TP_VERSION_MICRO)

Definition at line 120 of file common.h.

#define V_TP_VERSION_MINOR (   x)    ((x) << S_TP_VERSION_MINOR)

Definition at line 114 of file common.h.

#define WR_FLITS   (TX_DESC_FLITS + 1 - SGE_NUM_GENBITS)

Definition at line 153 of file common.h.

#define XGM_REG (   reg_addr,
  idx 
)    ((reg_addr) + (idx) * (XGMAC0_1_BASE_ADDR - XGMAC0_0_BASE_ADDR))

Definition at line 600 of file common.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
MAX_NPORTS 
MAX_FRAME_SIZE 
EEPROMSIZE 
SERNUM_LEN 
RSS_TABLE_SIZE 
TCB_SIZE 
NMTUS 
NCCTRL_WIN 
PROTO_SRAM_LINES 

Definition at line 70 of file common.h.

anonymous enum
Enumerator:
PAUSE_RX 
PAUSE_TX 
PAUSE_AUTONEG 

Definition at line 84 of file common.h.

anonymous enum
Enumerator:
SUPPORTED_IRQ 

Definition at line 90 of file common.h.

anonymous enum
Enumerator:
STAT_ULP_CH0_PBL_OOB 
STAT_ULP_CH1_PBL_OOB 
STAT_PCI_CORR_ECC 
IRQ_NUM_STATS 

Definition at line 94 of file common.h.

anonymous enum
Enumerator:
SGE_QSETS 
SGE_RXQ_PER_SET 
SGE_TXQ_PER_SET 

Definition at line 124 of file common.h.

anonymous enum
Enumerator:
AN_PKT_SIZE 
IMMED_PKT_SIZE 

Definition at line 137 of file common.h.

anonymous enum
Enumerator:
DEFAULT_NSERVERS 
DEFAULT_NFILTERS 

Definition at line 342 of file common.h.

anonymous enum
Enumerator:
MC5_MODE_144_BIT 
MC5_MODE_72_BIT 

Definition at line 348 of file common.h.

anonymous enum
Enumerator:
MC5_MIN_TIDS 

Definition at line 354 of file common.h.

anonymous enum
Enumerator:
PCI_VARIANT_PCI 
PCI_VARIANT_PCIX_MODE1_PARITY 
PCI_VARIANT_PCIX_MODE1_ECC 
PCI_VARIANT_PCIX_266_MODE2 
PCI_VARIANT_PCIE 

Definition at line 375 of file common.h.

anonymous enum
Enumerator:
T3_REV_A 
T3_REV_B 
T3_REV_B2 
T3_REV_C 

Definition at line 404 of file common.h.

anonymous enum
Enumerator:
MAC_DIRECTION_RX 
MAC_DIRECTION_TX 
MAC_RXFIFO_SIZE 

Definition at line 488 of file common.h.

anonymous enum
Enumerator:
PHY_LOOPBACK_TX 
PHY_LOOPBACK_RX 

Definition at line 495 of file common.h.

anonymous enum
Enumerator:
cphy_cause_link_change 
cphy_cause_fifo_error 
cphy_cause_module_change 

Definition at line 501 of file common.h.

anonymous enum
Enumerator:
phy_modtype_none 
phy_modtype_sr 
phy_modtype_lr 
phy_modtype_lrm 
phy_modtype_twinax 
phy_modtype_twinax_long 
phy_modtype_unknown 

Definition at line 508 of file common.h.

anonymous enum
Enumerator:
EDC_OPT_AEL2005 
EDC_OPT_AEL2005_SIZE 
EDC_TWX_AEL2005 
EDC_TWX_AEL2005_SIZE 
EDC_TWX_AEL2020 
EDC_TWX_AEL2020_SIZE 
EDC_MAX_SIZE 

Definition at line 539 of file common.h.

Enumerator:
SGE_CNTXT_RDMA 
SGE_CNTXT_ETH 
SGE_CNTXT_OFLD 
SGE_CNTXT_CTRL 

Definition at line 130 of file common.h.

Function Documentation

int t3_ael1002_phy_prep ( struct cphy phy,
struct adapter adapter,
int  phy_addr,
const struct mdio_ops mdio_ops 
)

Definition at line 212 of file ael1002.c.

int t3_ael1006_phy_prep ( struct cphy phy,
struct adapter adapter,
int  phy_addr,
const struct mdio_ops mdio_ops 
)

Definition at line 238 of file ael1002.c.

int t3_ael2005_phy_prep ( struct cphy phy,
struct adapter adapter,
int  phy_addr,
const struct mdio_ops mdio_ops 
)

Definition at line 509 of file ael1002.c.

int t3_ael2020_phy_prep ( struct cphy phy,
struct adapter adapter,
int  phy_addr,
const struct mdio_ops mdio_ops 
)

Definition at line 815 of file ael1002.c.

int t3_aq100x_phy_prep ( struct cphy phy,
struct adapter adapter,
int  phy_addr,
const struct mdio_ops mdio_ops 
)

Definition at line 266 of file aq100x.c.

int t3_check_fw_version ( struct adapter adapter)

t3_check_fw_version - check if the FW is compatible with this driver : the adapter

Checks if an adapter's FW is compatible with the driver. Returns 0 if the versions are compatible, a negative error otherwise.

Definition at line 1026 of file t3_hw.c.

int t3_check_tpsram ( struct adapter adapter,
const u8 tp_sram,
unsigned int  size 
)

t3_check_tpsram - check if provided protocol SRAM is compatible with this driver : the adapter : the firmware image to write : image size

Checks if an adapter's tp sram is compatible with the driver. Returns 0 if the versions are compatible, a negative error otherwise.

Definition at line 983 of file t3_hw.c.

int t3_check_tpsram_version ( struct adapter adapter)

t3_check_tpsram_version - read the tp sram version : the adapter

Reads the protocol sram version from flash.

Definition at line 946 of file t3_hw.c.

int t3_cim_ctl_blk_read ( struct adapter adap,
unsigned int  addr,
unsigned int  n,
unsigned int valp 
)

t3_cim_ctl_blk_read - read a block from CIM control region

: the adapter : the start address within the CIM control region
: number of words to read : where to store the result

Reads a block of 4-byte words from the CIM control region.

Definition at line 1146 of file t3_hw.c.

void t3_config_rss ( struct adapter adapter,
unsigned int  rss_config,
const u8 cpus,
const u16 rspq 
)

t3_config_rss - configure Rx packet steering : the adapter : RSS settings (written to TP_RSS_CONFIG) : values for the CPU lookup table (0xff terminated) : values for the response queue lookup table (0xffff terminated)

Programs the receive packet steering logic. and provide the values for the CPU and response queue lookup tables. If they provide fewer values than the size of the tables the supplied values are used repeatedly until the tables are fully populated.

Definition at line 2500 of file t3_hw.c.

int t3_config_sched ( struct adapter adap,
unsigned int  kbps,
int  sched 
)

t3_config_sched - configure a HW traffic scheduler : the adapter : target rate in Kbps : the scheduler index

Configure a HW scheduler for the target rate

Definition at line 3002 of file t3_hw.c.

void t3_config_trace_filter ( struct adapter adapter,
const struct trace_params tp,
int  filter_index,
int  invert,
int  enable 
)

Definition at line 2961 of file t3_hw.c.

void t3_fatal_err ( struct adapter adapter)

Definition at line 2961 of file cxgb3_main.c.

struct adapter_info* t3_get_adapter_info ( unsigned int  board_id)
read

Definition at line 542 of file t3_hw.c.

int t3_get_fw_version ( struct adapter adapter,
u32 vers 
)

t3_get_fw_version - read the firmware version : the adapter : where to place the version

Reads the FW version from flash.

Definition at line 1014 of file t3_hw.c.

int t3_get_tp_version ( struct adapter adapter,
u32 vers 
)

t3_get_tp_version - read the tp sram version : the adapter : where to place the version

Reads the protocol sram version from sram.

Definition at line 924 of file t3_hw.c.

int t3_init_hw ( struct adapter adapter,
u32  fw_params 
)

Definition at line 3339 of file t3_hw.c.

void t3_intr_clear ( struct adapter adapter)

t3_intr_clear - clear all interrupts : the adapter whose interrupts should be cleared

Clears all interrupts.

Definition at line 2023 of file t3_hw.c.

void t3_intr_disable ( struct adapter adapter)

t3_intr_disable - disable a card's interrupts : the adapter whose interrupts should be disabled

Disable interrupts. We only disable the top-level interrupt concentrator and the SGE data interrupts.

Definition at line 2010 of file t3_hw.c.

void t3_intr_enable ( struct adapter adapter)

t3_intr_enable - enable interrupts : the adapter whose interrupts should be enabled

Enable interrupts by setting the interrupt enable registers of the various HW modules and then enabling the top-level interrupt concentrator.

Definition at line 1959 of file t3_hw.c.

void t3_led_ready ( struct adapter adapter)

Definition at line 3746 of file t3_hw.c.

void t3_link_changed ( struct adapter adapter,
int  port_id 
)

t3_link_changed - handle interface link changes : the adapter : the port index that changed link state

Called when a port's link settings change to propagate the new values to the associated PHY and MAC. After performing the common tasks it invokes an OS-specific handler.

Definition at line 1206 of file t3_hw.c.

void t3_link_fault ( struct adapter adapter,
int  port_id 
)

Definition at line 1263 of file t3_hw.c.

int t3_link_start ( struct cphy phy,
struct cmac mac,
struct link_config lc 
)

t3_link_start - apply link configuration to MAC/PHY : the PHY to setup : the MAC to setup : the requested link configuration

Set up a port's MAC and PHY according to a desired link configuration.

  • If the PHY can auto-negotiate first decide what to advertise, then enable/disable auto-negotiation as desired, and reset.
  • If the PHY does not auto-negotiate just reset it.
  • If auto-negotiation is off set the MAC to the proper speed/duplex/FC, otherwise do it later based on the outcome of auto-negotiation.

Definition at line 1329 of file t3_hw.c.

int t3_load_fw ( struct adapter adapter,
const u8 fw_data,
unsigned int  size 
)

t3_load_fw - download firmware : the adapter : the firmware image to write : image size

Write the supplied firmware image to the card's serial flash. The FW image has the following sections: - 8 bytes of code and data, followed by 4 bytes of FW version, followed by the 32-bit 1's complement checksum of the whole image.

Definition at line 1090 of file t3_hw.c.

void t3_load_mtus ( struct adapter adap,
unsigned short  mtus[NMTUS],
unsigned short  alpha[NCCTRL_WIN],
unsigned short  beta[NCCTRL_WIN],
unsigned short  mtu_cap 
)

t3_load_mtus - write the MTU and congestion control HW tables : the adapter : the unrestricted values for the MTU table : the values for the congestion control alpha parameter : the values for the congestion control beta parameter : the maximum permitted effective MTU

Write the MTU table with the supplied MTUs capping each at &mtu_cap. Update the high-speed congestion control table with the supplied alpha, beta, and MTUs.

Definition at line 2862 of file t3_hw.c.

int t3_mac_disable ( struct cmac mac,
int  which 
)

Definition at line 506 of file xgmac.c.

void t3_mac_disable_exact_filters ( struct cmac mac)

Definition at line 264 of file xgmac.c.

int t3_mac_enable ( struct cmac mac,
int  which 
)

Definition at line 467 of file xgmac.c.

void t3_mac_enable_exact_filters ( struct cmac mac)

Definition at line 275 of file xgmac.c.

int t3_mac_reset ( struct cmac mac)

Definition at line 79 of file xgmac.c.

int t3_mac_set_address ( struct cmac mac,
unsigned int  idx,
u8  addr[6] 
)

Definition at line 243 of file xgmac.c.

int t3_mac_set_mtu ( struct cmac mac,
unsigned int  mtu 
)

Definition at line 345 of file xgmac.c.

int t3_mac_set_num_ucast ( struct cmac mac,
int  n 
)

Definition at line 256 of file xgmac.c.

int t3_mac_set_rx_mode ( struct cmac mac,
struct net_device dev 
)

Definition at line 300 of file xgmac.c.

int t3_mac_set_speed_duplex_fc ( struct cmac mac,
int  speed,
int  duplex,
int  fc 
)

Definition at line 428 of file xgmac.c.

struct mac_stats* t3_mac_update_stats ( struct cmac mac)
read

Definition at line 598 of file xgmac.c.

int t3_mc5_init ( struct mc5 mc5,
unsigned int  nservers,
unsigned int  nfilters,
unsigned int  nroutes 
)

Definition at line 323 of file mc5.c.

void t3_mc5_intr_handler ( struct mc5 mc5)

Definition at line 383 of file mc5.c.

void t3_mc5_prep ( struct adapter adapter,
struct mc5 mc5,
int  mode 
)

Definition at line 417 of file mc5.c.

int t3_mc7_bd_read ( struct mc7 mc7,
unsigned int  start,
unsigned int  n,
u64 buf 
)

t3_mc7_bd_read - read from MC7 through backdoor accesses : identifies MC7 to read from : index of first 64-bit word to read
: number of 64-bit words to read : where to store the read result

Read n 64-bit words from MC7 starting at word start, using backdoor accesses.

Definition at line 145 of file t3_hw.c.

int t3_mdio_change_bits ( struct cphy phy,
int  mmd,
int  reg,
unsigned int  clear,
unsigned int  set 
)

t3_mdio_change_bits - modify the value of a PHY register : the PHY to operate on : the device address : the register address : what part of the register value to mask off : what part of the register value to set

Changes the value of a PHY register by applying a mask to its current value and ORing the result with a new value.

Definition at line 328 of file t3_hw.c.

int t3_phy_advertise ( struct cphy phy,
unsigned int  advert 
)

t3_phy_advertise - set the PHY advertisement registers for autoneg : the PHY to operate on : bitmap of capabilities the PHY should advertise

Sets a 10/100/1000 PHY's advertisement registers to advertise the requested capabilities.

Definition at line 382 of file t3_hw.c.

int t3_phy_advertise_fiber ( struct cphy phy,
unsigned int  advert 
)

t3_phy_advertise_fiber - set fiber PHY advertisement register : the PHY to operate on : bitmap of capabilities the PHY should advertise

Sets a fiber PHY's advertisement register to advertise the requested capabilities.

Definition at line 425 of file t3_hw.c.

int t3_phy_intr_handler ( struct adapter adapter)

Definition at line 1859 of file t3_hw.c.

int t3_phy_lasi_intr_clear ( struct cphy phy)

Definition at line 486 of file t3_hw.c.

int t3_phy_lasi_intr_disable ( struct cphy phy)

Definition at line 481 of file t3_hw.c.

int t3_phy_lasi_intr_enable ( struct cphy phy)

Definition at line 475 of file t3_hw.c.

int t3_phy_lasi_intr_handler ( struct cphy phy)

Definition at line 493 of file t3_hw.c.

int t3_phy_reset ( struct cphy phy,
int  mmd,
int  wait 
)

t3_phy_reset - reset a PHY block : the PHY to operate on : the device address of the PHY block to reset : how long to wait for the reset to complete in 1ms increments

Resets a PHY block and optionally waits for the reset to complete. should be 0 for 10/100/1000 PHYs and the device address to reset for 10G PHYs.

Definition at line 352 of file t3_hw.c.

void t3_port_intr_disable ( struct adapter adapter,
int  idx 
)

t3_port_intr_disable - disable port-specific interrupts : associated adapter : index of port whose interrupts should be disabled

Disable port-specific (i.e., MAC and PHY) interrupts for the given adapter port.

Definition at line 2099 of file t3_hw.c.

void t3_port_intr_enable ( struct adapter adapter,
int  idx 
)

t3_port_intr_enable - enable port-specific interrupts : associated adapter : index of port whose interrupts should be enabled

Enable port-specific (i.e., MAC and PHY) interrupts for the given adapter port.

Definition at line 2082 of file t3_hw.c.

int t3_prep_adapter ( struct adapter adapter,
const struct adapter_info ai,
int  reset 
)

Definition at line 3621 of file t3_hw.c.

int t3_qt2045_phy_prep ( struct cphy phy,
struct adapter adapter,
int  phy_addr,
const struct mdio_ops mdio_ops 
)

Definition at line 870 of file ael1002.c.

int t3_replay_prep_adapter ( struct adapter adapter)

Definition at line 3752 of file t3_hw.c.

int t3_reset_adapter ( struct adapter adapter)

Definition at line 3557 of file t3_hw.c.

int t3_seeprom_read ( struct adapter adapter,
u32  addr,
__le32 data 
)

t3_seeprom_read - read a VPD EEPROM location : adapter to read : EEPROM address : where to store the read data

Read a 32-bit word from a location in VPD EEPROM using the card's PCI VPD ROM capability. A zero is written to the flag bit when the address is written to the control register. The hardware device will set the flag to 1 when 4 bytes have been read into the data register.

Definition at line 613 of file t3_hw.c.

int t3_seeprom_wp ( struct adapter adapter,
int  enable 
)

t3_seeprom_wp - enable/disable EEPROM write protection : the adapter : 1 to enable write protection, 0 to disable it

Enables or disables write protection on the serial EEPROM.

Definition at line 679 of file t3_hw.c.

int t3_seeprom_write ( struct adapter adapter,
u32  addr,
__le32  data 
)

t3_seeprom_write - write a VPD EEPROM location : adapter to write : EEPROM address : value to write

Write a 32-bit word to a location in VPD EEPROM using the card's PCI VPD ROM capability.

Definition at line 647 of file t3_hw.c.

int t3_set_phy_speed_duplex ( struct cphy phy,
int  speed,
int  duplex 
)

t3_set_phy_speed_duplex - force PHY speed and duplex : the PHY to operate on : requested PHY speed : requested PHY duplex

Force a 10/100/1000 PHY's speed and duplex. This also disables auto-negotiation except for GigE, where auto-negotiation is mandatory.

Definition at line 449 of file t3_hw.c.

int t3_set_proto_sram ( struct adapter adap,
const u8 data 
)

t3_set_proto_sram - set the contents of the protocol sram : the adapter : the protocol image

Write the contents of the protocol SRAM.

Definition at line 2940 of file t3_hw.c.

void t3_set_reg_field ( struct adapter adapter,
unsigned int  addr,
u32  mask,
u32  val 
)

t3_set_reg_field - set a register field to a value : the adapter to program : the register address : specifies the portion of the register to modify : the new value for the register field

Sets a register field specified by the supplied mask to the given value.

Definition at line 103 of file t3_hw.c.

void t3_set_vlan_accel ( struct adapter adapter,
unsigned int  ports,
int  on 
)

t3_set_vlan_accel - control HW VLAN extraction : the adapter : bitmap of adapter ports to operate on : enable (1) or disable (0) HW VLAN extraction

Enables or disables HW extraction of VLAN tags for the given port.

Definition at line 1369 of file t3_hw.c.

int t3_sge_cqcntxt_op ( struct adapter adapter,
unsigned int  id,
unsigned int  op,
unsigned int  credits 
)

t3_sge_cqcntxt_op - perform an operation on a completion queue context : the adapter : the context id : the operation to perform

Perform the selected operation on an SGE completion queue context. The caller is responsible for ensuring only one context operation occurs at a time.

Definition at line 2458 of file t3_hw.c.

int t3_sge_disable_cqcntxt ( struct adapter adapter,
unsigned int  id 
)

t3_sge_disable_cqcntxt - disable an SGE completion queue : the adapter : the completion queue context id

Disable an SGE completion queue. The caller is responsible for ensuring only one context operation occurs at a time.

Definition at line 2432 of file t3_hw.c.

int t3_sge_disable_fl ( struct adapter adapter,
unsigned int  id 
)

t3_sge_disable_fl - disable an SGE free-buffer list : the adapter : the free list context id

Disable an SGE free-buffer list. The caller is responsible for ensuring only one context operation occurs at a time.

Definition at line 2384 of file t3_hw.c.

int t3_sge_disable_rspcntxt ( struct adapter adapter,
unsigned int  id 
)

t3_sge_disable_rspcntxt - disable an SGE response queue : the adapter : the response queue context id

Disable an SGE response queue. The caller is responsible for ensuring only one context operation occurs at a time.

Definition at line 2408 of file t3_hw.c.

int t3_sge_enable_ecntxt ( struct adapter adapter,
unsigned int  id,
int  enable 
)

t3_sge_enable_ecntxt - enable/disable an SGE egress context : the adapter : the egress context id : enable (1) or disable (0) the context

Enable or disable an SGE egress context. The caller is responsible for ensuring only one context operation occurs at a time.

Definition at line 2360 of file t3_hw.c.

void t3_sge_init ( struct adapter adap,
struct sge_params p 
)

t3_sge_init - initialize SGE : the adapter : the SGE parameters

Performs SGE initialization needed every time after a chip reset. We do not initialize any of the queue sets here, instead the driver top-level must request those individually. We also do not enable DMA here, that should be done after the queues have been set up.

Definition at line 3242 of file sge.c.

int t3_sge_init_cqcntxt ( struct adapter adapter,
unsigned int  id,
u64  base_addr,
unsigned int  size,
int  rspq,
int  ovfl_mode,
unsigned int  credits,
unsigned int  credit_thres 
)

t3_sge_init_cqcntxt - initialize an SGE completion queue context : the adapter to configure : the context id : base address of queue : number of queue entries : response queue for async notifications : CQ overflow mode : completion queue credits : the credit threshold

Initialize an SGE completion queue context and make it ready for use. The caller is responsible for ensuring only one context operation occurs at a time.

Definition at line 2329 of file t3_hw.c.

int t3_sge_init_ecntxt ( struct adapter adapter,
unsigned int  id,
int  gts_enable,
enum sge_context_type  type,
int  respq,
u64  base_addr,
unsigned int  size,
unsigned int  token,
int  gen,
unsigned int  cidx 
)

t3_sge_init_ecntxt - initialize an SGE egress context : the adapter to configure : the context id : whether to enable GTS for the context : the egress context type : associated response queue : base address of queue : number of queue entries : uP token : initial generation value for the context : consumer pointer

Initialize an SGE egress context and make it ready for use. If the platform allows concurrent context operations, the caller is responsible for appropriate locking.

Definition at line 2207 of file t3_hw.c.

int t3_sge_init_flcntxt ( struct adapter adapter,
unsigned int  id,
int  gts_enable,
u64  base_addr,
unsigned int  size,
unsigned int  bsize,
unsigned int  cong_thres,
int  gen,
unsigned int  cidx 
)

t3_sge_init_flcntxt - initialize an SGE free-buffer list context : the adapter to configure : the context id : whether to enable GTS for the context : base address of queue : number of queue entries : size of each buffer for this queue : threshold to signal congestion to upstream producers : initial generation value for the context : consumer pointer

Initialize an SGE free list context and make it ready for use. The caller is responsible for ensuring only one context operation occurs at a time.

Definition at line 2250 of file t3_hw.c.

int t3_sge_init_rspcntxt ( struct adapter adapter,
unsigned int  id,
int  irq_vec_idx,
u64  base_addr,
unsigned int  size,
unsigned int  fl_thres,
int  gen,
unsigned int  cidx 
)

t3_sge_init_rspcntxt - initialize an SGE response queue context : the adapter to configure : the context id : MSI-X interrupt vector index, 0 if no MSI-X, -1 if no IRQ : base address of queue : number of queue entries : threshold for selecting the normal or jumbo free list : initial generation value for the context : consumer pointer

Initialize an SGE response queue context and make it ready for use. The caller is responsible for ensuring only one context operation occurs at a time.

Definition at line 2290 of file t3_hw.c.

void t3_sge_prep ( struct adapter adap,
struct sge_params p 
)

t3_sge_prep - one-time SGE initialization : the associated adapter : SGE parameters

Performs one-time initialization of SGE SW state. Includes determining defaults for the assorted SGE parameters, which admins can change until they are used to initialize the SGE.

Definition at line 3281 of file sge.c.

int t3_slow_intr_handler ( struct adapter adapter)

Definition at line 1888 of file t3_hw.c.

void t3_tp_get_mib_stats ( struct adapter adap,
struct tp_mib_stats tps 
)

t3_tp_get_mib_stats - read TP's MIB counters : the adapter : holds the returned counter values

Returns the values of TP's MIB counters.

Definition at line 2902 of file t3_hw.c.

void t3_tp_set_offload_mode ( struct adapter adap,
int  enable 
)

t3_tp_set_offload_mode - put TP in NIC/offload mode : the adapter : 1 to select offload mode, 0 for regular NIC

Switches TP to NIC/offload mode.

Definition at line 2535 of file t3_hw.c.

int t3_vsc8211_phy_prep ( struct cphy phy,
struct adapter adapter,
int  phy_addr,
const struct mdio_ops mdio_ops 
)

Definition at line 367 of file vsc8211.c.

int t3_wait_op_done_val ( struct adapter adapter,
int  reg,
u32  mask,
int  polarity,
int  attempts,
int  delay,
u32 valp 
)

t3_wait_op_done_val - wait until an operation is completed : the adapter performing the operation : the register to check for completion : a single-bit field within that indicates completion : the value of the field when the operation is completed : number of check iterations : delay in usecs between iterations : 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 times. If 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 55 of file t3_hw.c.

void t3_write_regs ( struct adapter adapter,
const struct addr_val_pair p,
int  n,
unsigned int  offset 
)

t3_write_regs - write a bunch of registers : the adapter to program : an array of register address/register value pairs
: the number of address/value pairs : register address offset

Takes an array of register address/register value pairs and writes each value to the corresponding register. Register addresses are adjusted by the supplied offset.

Definition at line 84 of file t3_hw.c.

int t3_xaui_direct_phy_prep ( struct cphy phy,
struct adapter adapter,
int  phy_addr,
const struct mdio_ops mdio_ops 
)

Definition at line 934 of file ael1002.c.

void t3_xgm_intr_disable ( struct adapter adapter,
int  idx 
)

Definition at line 2066 of file t3_hw.c.

void t3_xgm_intr_enable ( struct adapter adapter,
int  idx 
)

Definition at line 2058 of file t3_hw.c.

int t3b2_mac_watchdog_task ( struct cmac mac)

Definition at line 532 of file xgmac.c.

void t3b_pcs_reset ( struct cmac mac)

Definition at line 70 of file xgmac.c.