Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
t3_hw.c File Reference
#include "common.h"
#include "regs.h"
#include "sge_defs.h"
#include "firmware_exports.h"

Go to the source code of this file.

Data Structures

struct  port_type_info
 
struct  t3_vpd
 
struct  intr_info
 
struct  mc7_timing_params
 

Macros

#define MDIO_ATTEMPTS   20
 
#define VPD_ENTRY(name, len)   u8 name##_kword[2]; u8 name##_len; u8 name##_data[len]
 
#define EEPROM_MAX_POLL   40
 
#define EEPROM_STAT_ADDR   0x4000
 
#define VPD_BASE   0xc00
 
#define CIM_CTL_BASE   0x2000
 
#define SGE_INTR_MASK
 
#define MC5_INTR_MASK
 
#define MC7_INTR_MASK   (F_AE | F_UE | F_CE | V_PE(M_PE))
 
#define XGM_INTR_MASK
 
#define PCIX_INTR_MASK
 
#define PCIE_INTR_MASK
 
#define ULPRX_INTR_MASK
 
#define ULPTX_INTR_MASK   0xfc
 
#define CPLSW_INTR_MASK
 
#define CIM_INTR_MASK
 
#define PMTX_INTR_MASK
 
#define PMRX_INTR_MASK
 
#define MPS_INTR_MASK
 
#define XGM_EXTRA_INTR_MASK   (F_LINKFAULTCHANGE)
 
#define PL_INTR_MASK
 
#define ICSPI_FRM_ERR
 
#define OESPI_FRM_ERR
 
#define IESPI_FRM_ERR
 
#define OCSPI_FRM_ERR
 
#define MC7_INTR_FATAL   (F_UE | V_PE(M_PE) | F_AE)
 
#define XGM_INTR_FATAL
 
#define SG_CONTEXT_CMD_ATTEMPTS   100
 
#define mem_region(adap, start, size, reg)
 
#define TP_TMR_RES   50
 
#define TP_DACK_TIMER   50
 
#define TP_RTO_MIN   250
 
#define SECONDS   * tps
 
#define CC_MIN_INCR   2U
 
#define ulp_region(adap, name, start, len)
 
#define ulptx_region(adap, name, start, len)
 

Enumerations

enum  {
  SF_ATTEMPTS = 5, SF_SEC_SIZE = 64 * 1024, SF_SIZE = SF_SEC_SIZE * 8, SF_PROG_PAGE = 2,
  SF_WR_DISABLE = 4, SF_RD_STATUS = 5, SF_WR_ENABLE = 6, SF_RD_DATA_FAST = 0xb,
  SF_ERASE_SECTOR = 0xd8, FW_FLASH_BOOT_ADDR = 0x70000, FW_VERS_ADDR = 0x7fffc, FW_MIN_SIZE = 8
}
 
enum  fw_version_type { FW_VERSION_N3, FW_VERSION_T3 }
 

Functions

int t3_wait_op_done_val (struct adapter *adapter, int reg, u32 mask, int polarity, int attempts, int delay, u32 *valp)
 
void t3_write_regs (struct adapter *adapter, const struct addr_val_pair *p, int n, unsigned int offset)
 
void t3_set_reg_field (struct adapter *adapter, unsigned int addr, u32 mask, u32 val)
 
int t3_mc7_bd_read (struct mc7 *mc7, unsigned int start, unsigned int n, u64 *buf)
 
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)
 
struct adapter_infot3_get_adapter_info (unsigned int 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_sram, unsigned int size)
 
int t3_get_fw_version (struct adapter *adapter, u32 *vers)
 
int t3_check_fw_version (struct adapter *adapter)
 
int t3_load_fw (struct adapter *adapter, const u8 *fw_data, unsigned int size)
 
int t3_cim_ctl_blk_read (struct adapter *adap, unsigned int addr, unsigned int n, unsigned int *valp)
 
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)
 
void t3_set_vlan_accel (struct adapter *adapter, unsigned int ports, int on)
 
int t3_phy_intr_handler (struct adapter *adapter)
 
int t3_slow_intr_handler (struct adapter *adapter)
 
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_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 bsize, 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)
 
void t3_config_rss (struct adapter *adapter, unsigned int rss_config, const u8 *cpus, const u16 *rspq)
 
void t3_tp_set_offload_mode (struct adapter *adap, int enable)
 
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_tp_get_mib_stats (struct adapter *adap, struct tp_mib_stats *tps)
 
int t3_set_proto_sram (struct adapter *adap, const u8 *data)
 
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)
 
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)
 
void t3_led_ready (struct adapter *adapter)
 
int t3_replay_prep_adapter (struct adapter *adapter)
 

Macro Definition Documentation

#define CC_MIN_INCR   2U

Definition at line 2848 of file t3_hw.c.

#define CIM_CTL_BASE   0x2000

Definition at line 1134 of file t3_hw.c.

#define CIM_INTR_MASK
Value:
F_BLKRDCTLINT | F_BLKWRFLASHINT | F_BLKRDFLASHINT | \
F_SGLWRFLASHINT | F_WRBLKFLASHINT | F_BLKWRBOOTINT | \
F_FLASHRANGEINT | F_SDRAMRANGEINT | F_RSVDSPACEINT | \
F_DRAMPARERR | F_ICACHEPARERR | F_DCACHEPARERR | \
F_OBQSGEPARERR | F_OBQULPHIPARERR | F_OBQULPLOPARERR | \
F_IBQSGELOPARERR | F_IBQSGEHIPARERR | F_IBQULPPARERR | \
F_IBQTPPARERR | F_ITAGPARERR | F_DTAGPARERR)

Definition at line 1460 of file t3_hw.c.

#define CPLSW_INTR_MASK
Value:
F_SGE_FRAMING_ERROR | F_CIM_FRAMING_ERROR | \
F_ZERO_SWITCH_ERROR)

Definition at line 1457 of file t3_hw.c.

#define EEPROM_MAX_POLL   40

Definition at line 598 of file t3_hw.c.

#define EEPROM_STAT_ADDR   0x4000

Definition at line 599 of file t3_hw.c.

#define ICSPI_FRM_ERR
Value:
F_ICSPI1_FIFO2X_RX_FRAMING_ERROR | F_ICSPI0_RX_FRAMING_ERROR | \
F_ICSPI1_RX_FRAMING_ERROR | F_ICSPI0_TX_FRAMING_ERROR | \
F_ICSPI1_TX_FRAMING_ERROR)

Definition at line 1657 of file t3_hw.c.

#define IESPI_FRM_ERR
Value:
F_IESPI1_FIFO2X_RX_FRAMING_ERROR | F_IESPI0_RX_FRAMING_ERROR | \
F_IESPI1_RX_FRAMING_ERROR | F_IESPI0_TX_FRAMING_ERROR | \
F_IESPI1_TX_FRAMING_ERROR)

Definition at line 1687 of file t3_hw.c.

#define MC5_INTR_MASK
Value:
F_REQQPARERR | F_DISPQPARERR | F_DELACTEMPTY | \
F_NFASRCHFAIL)

Definition at line 1435 of file t3_hw.c.

#define MC7_INTR_FATAL   (F_UE | V_PE(M_PE) | F_AE)

Definition at line 1752 of file t3_hw.c.

#define MC7_INTR_MASK   (F_AE | F_UE | F_CE | V_PE(M_PE))

Definition at line 1438 of file t3_hw.c.

#define MDIO_ATTEMPTS   20

Definition at line 204 of file t3_hw.c.

#define mem_region (   adap,
  start,
  size,
  reg 
)
Value:
t3_write_reg((adap), A_ ## reg, (start)); \
start += size

Definition at line 2559 of file t3_hw.c.

#define MPS_INTR_MASK
Value:
V_TX1TPPARERRENB(M_TX1TPPARERRENB) | \
V_RXTPPARERRENB(M_RXTPPARERRENB) | \
V_MCAPARERRENB(M_MCAPARERRENB))

Definition at line 1474 of file t3_hw.c.

#define OCSPI_FRM_ERR
Value:
F_OCSPI1_RX_FRAMING_ERROR | F_OCSPI0_TX_FRAMING_ERROR | \
F_OCSPI1_TX_FRAMING_ERROR | F_OCSPI0_OFIFO2X_TX_FRAMING_ERROR | \
F_OCSPI1_OFIFO2X_TX_FRAMING_ERROR)

Definition at line 1691 of file t3_hw.c.

#define OESPI_FRM_ERR
Value:
F_OESPI1_RX_FRAMING_ERROR | F_OESPI0_TX_FRAMING_ERROR | \
F_OESPI1_TX_FRAMING_ERROR | F_OESPI0_OFIFO2X_TX_FRAMING_ERROR | \
F_OESPI1_OFIFO2X_TX_FRAMING_ERROR)

Definition at line 1661 of file t3_hw.c.

#define PCIE_INTR_MASK
Value:
F_PCIE_WFPARERR | F_PCIE_RFPARERR | F_PCIE_CFPARERR | \
/* V_PCIE_MSIXPARERR(M_PCIE_MSIXPARERR) | */ \
F_RETRYBUFPARERR | F_RETRYLUTPARERR | F_RXPARERR | \
F_TXPARERR | V_BISTERR(M_BISTERR))

Definition at line 1448 of file t3_hw.c.

#define PCIX_INTR_MASK
Value:
F_RCVMSTABT | F_SIGSYSERR | F_DETPARERR | \
F_SPLCMPDIS | F_UNXSPLCMP | F_RCVSPLCMPERR | \
F_DETCORECCERR | F_DETUNCECCERR | F_PIOPARERR | \
V_WFPARERR(M_WFPARERR) | V_RFPARERR(M_RFPARERR) | \
V_CFPARERR(M_CFPARERR) /* | V_MSIXPARERR(M_MSIXPARERR) */)

Definition at line 1442 of file t3_hw.c.

#define PL_INTR_MASK
Value:
F_PM1_RX | F_ULP2_TX | F_ULP2_RX | F_TP1 | F_CIM | \
F_MC7_CM | F_MC7_PMTX | F_MC7_PMRX | F_SGE3 | F_PCIM0 | \
F_MPS0 | F_CPL_SWITCH)

Definition at line 1479 of file t3_hw.c.

#define PMRX_INTR_MASK
Value:
V_IESPI_PAR_ERROR(M_IESPI_PAR_ERROR) | \
V_OCSPI_PAR_ERROR(M_OCSPI_PAR_ERROR))

Definition at line 1471 of file t3_hw.c.

#define PMTX_INTR_MASK
Value:
V_ICSPI_PAR_ERROR(M_ICSPI_PAR_ERROR) | \
V_OESPI_PAR_ERROR(M_OESPI_PAR_ERROR))

Definition at line 1468 of file t3_hw.c.

#define SECONDS   * tps
#define SG_CONTEXT_CMD_ATTEMPTS   100

Definition at line 2125 of file t3_hw.c.

#define SGE_INTR_MASK
Value:
F_UC_REQ_FRAMINGERROR | F_R_REQ_FRAMINGERROR | \
F_CPPARITYERROR | F_OCPARITYERROR | F_RCPARITYERROR | \
F_IRPARITYERROR | V_ITPARITYERROR(M_ITPARITYERROR) | \
V_FLPARITYERROR(M_FLPARITYERROR) | F_LODRBPARITYERROR | \
F_HIDRBPARITYERROR | F_LORCQPARITYERROR | \
F_HIRCQPARITYERROR | F_LOPRIORITYDBFULL | \
F_HIPRIORITYDBFULL | F_LOPRIORITYDBEMPTY | \
F_HIPRIORITYDBEMPTY | F_HIPIODRBDROPERR | \
F_LOPIODRBDROPERR)

Definition at line 1425 of file t3_hw.c.

#define TP_DACK_TIMER   50

Definition at line 2690 of file t3_hw.c.

#define TP_RTO_MIN   250

Definition at line 2691 of file t3_hw.c.

#define TP_TMR_RES   50

Definition at line 2687 of file t3_hw.c.

#define ulp_region (   adap,
  name,
  start,
  len 
)
Value:
t3_write_reg((adap), A_ULPRX_ ## name ## _LLIMIT, (start)); \
t3_write_reg((adap), A_ULPRX_ ## name ## _ULIMIT, \
(start) + (len) - 1); \
start += len

Definition at line 2908 of file t3_hw.c.

#define ULPRX_INTR_MASK
Value:
F_ARBPF0PERR | F_ARBFPERR | F_PCMDMUXPERR | \
F_DATASELFRAMEERR1 | F_DATASELFRAMEERR0)

Definition at line 1453 of file t3_hw.c.

#define ULPTX_INTR_MASK   0xfc

Definition at line 1456 of file t3_hw.c.

#define ulptx_region (   adap,
  name,
  start,
  len 
)
Value:
t3_write_reg((adap), A_ULPTX_ ## name ## _LLIMIT, (start)); \
t3_write_reg((adap), A_ULPTX_ ## name ## _ULIMIT, \
(start) + (len) - 1)

Definition at line 2914 of file t3_hw.c.

#define VPD_BASE   0xc00

Definition at line 600 of file t3_hw.c.

#define VPD_ENTRY (   name,
  len 
)    u8 name##_kword[2]; u8 name##_len; u8 name##_data[len]

Definition at line 566 of file t3_hw.c.

#define XGM_EXTRA_INTR_MASK   (F_LINKFAULTCHANGE)

Definition at line 1478 of file t3_hw.c.

#define XGM_INTR_FATAL
Value:

Definition at line 1805 of file t3_hw.c.

#define XGM_INTR_MASK
Value:
V_RXFIFO_PRTY_ERR(M_RXFIFO_PRTY_ERR) | \
F_TXFIFO_UNDERRUN)

Definition at line 1439 of file t3_hw.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
SF_ATTEMPTS 
SF_SEC_SIZE 
SF_SIZE 
SF_PROG_PAGE 
SF_WR_DISABLE 
SF_RD_STATUS 
SF_WR_ENABLE 
SF_RD_DATA_FAST 
SF_ERASE_SECTOR 
FW_FLASH_BOOT_ADDR 
FW_VERS_ADDR 
FW_MIN_SIZE 

Definition at line 737 of file t3_hw.c.

Enumerator:
FW_VERSION_N3 
FW_VERSION_T3 

Definition at line 1002 of file t3_hw.c.

Function Documentation

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.

struct adapter_info* t3_get_adapter_info ( unsigned int  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_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_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.

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.

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_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.

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.