FreeBSD kernel CXGB device code
cxgb_vsc7323.c File Reference
#include <sys/cdefs.h>
#include <common/cxgb_common.h>
Include dependency graph for cxgb_vsc7323.c:

Go to the source code of this file.

Macros

#define VSC_REG(block, subblock, reg)    ((reg) | ((subblock) << 8) | ((block) << 12))
 
#define STATS0_START   1
 
#define STATS1_START   0x24
 
#define NSTATS0   (0x1d - STATS0_START + 1)
 
#define NSTATS1   (0x2a - STATS1_START + 1)
 
#define ELMR_STAT(port, reg)   (ELMR_STATS + port * 0x40 + reg)
 
#define RMON_UPDATE(mac, name, hw_stat)    mac->stats.name += (u64)((hw_stat) - (u32)(mac->stats.name))
 

Enumerations

enum  {
  ELMR_ADDR = 0 , ELMR_STAT = 1 , ELMR_DATA_LO = 2 , ELMR_DATA_HI = 3 ,
  ELMR_THRES0 = 0xe000 , ELMR_BW = 0xe00c , ELMR_FIFO_SZ = 0xe00d , ELMR_STATS = 0xf000 ,
  ELMR_MDIO_ADDR = 10
}
 

Functions

 __FBSDID ("$FreeBSD$")
 
int t3_elmr_blk_write (adapter_t *adap, int start, const u32 *vals, int n)
 
static int elmr_write (adapter_t *adap, int addr, u32 val)
 
int t3_elmr_blk_read (adapter_t *adap, int start, u32 *vals, int n)
 
int t3_vsc7323_init (adapter_t *adap, int nports)
 
int t3_vsc7323_set_speed_fc (adapter_t *adap, int speed, int fc, int port)
 
int t3_vsc7323_set_mtu (adapter_t *adap, unsigned int mtu, int port)
 
int t3_vsc7323_set_addr (adapter_t *adap, u8 addr[6], int port)
 
int t3_vsc7323_enable (adapter_t *adap, int port, int which)
 
int t3_vsc7323_disable (adapter_t *adap, int port, int which)
 
const struct mac_statst3_vsc7323_update_stats (struct cmac *mac)
 

Macro Definition Documentation

◆ ELMR_STAT

#define ELMR_STAT (   port,
  reg 
)    (ELMR_STATS + port * 0x40 + reg)

Definition at line 284 of file cxgb_vsc7323.c.

◆ NSTATS0

#define NSTATS0   (0x1d - STATS0_START + 1)

Definition at line 281 of file cxgb_vsc7323.c.

◆ NSTATS1

#define NSTATS1   (0x2a - STATS1_START + 1)

Definition at line 282 of file cxgb_vsc7323.c.

◆ RMON_UPDATE

#define RMON_UPDATE (   mac,
  name,
  hw_stat 
)     mac->stats.name += (u64)((hw_stat) - (u32)(mac->stats.name))

◆ STATS0_START

#define STATS0_START   1

Definition at line 279 of file cxgb_vsc7323.c.

◆ STATS1_START

#define STATS1_START   0x24

Definition at line 280 of file cxgb_vsc7323.c.

◆ VSC_REG

#define VSC_REG (   block,
  subblock,
  reg 
)     ((reg) | ((subblock) << 8) | ((block) << 12))

Definition at line 50 of file cxgb_vsc7323.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ELMR_ADDR 
ELMR_STAT 
ELMR_DATA_LO 
ELMR_DATA_HI 
ELMR_THRES0 
ELMR_BW 
ELMR_FIFO_SZ 
ELMR_STATS 
ELMR_MDIO_ADDR 

Definition at line 36 of file cxgb_vsc7323.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ elmr_write()

static int elmr_write ( adapter_t adap,
int  addr,
u32  val 
)
static

Definition at line 71 of file cxgb_vsc7323.c.

References t3_elmr_blk_write().

Referenced by t3_vsc7323_disable(), t3_vsc7323_enable(), t3_vsc7323_init(), t3_vsc7323_set_addr(), t3_vsc7323_set_mtu(), and t3_vsc7323_set_speed_fc().

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

◆ t3_elmr_blk_read()

int t3_elmr_blk_read ( adapter_t adap,
int  start,
u32 vals,
int  n 
)

Definition at line 76 of file cxgb_vsc7323.c.

References adapter_info, ELMR_ADDR, ELMR_DATA_HI, ELMR_DATA_LO, ELMR_LOCK, ELMR_MDIO_ADDR, ELMR_STAT, ELMR_UNLOCK, mdio_ops::read, udelay, and mdio_ops::write.

Referenced by t3_vsc7323_disable(), t3_vsc7323_enable(), and t3_vsc7323_update_stats().

Here is the caller graph for this function:

◆ t3_elmr_blk_write()

int t3_elmr_blk_write ( adapter_t adap,
int  start,
const u32 vals,
int  n 
)

Definition at line 53 of file cxgb_vsc7323.c.

References adapter_info, ELMR_ADDR, ELMR_DATA_HI, ELMR_DATA_LO, ELMR_LOCK, ELMR_MDIO_ADDR, ELMR_UNLOCK, and mdio_ops::write.

Referenced by elmr_write(), and t3_vsc7323_init().

Here is the caller graph for this function:

◆ t3_vsc7323_disable()

int t3_vsc7323_disable ( adapter_t adap,
int  port,
int  which 
)

Definition at line 261 of file cxgb_vsc7323.c.

References elmr_write(), MAC_DIRECTION_RX, MAC_DIRECTION_TX, t3_elmr_blk_read(), and VSC_REG.

Referenced by t3_mac_disable().

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

◆ t3_vsc7323_enable()

int t3_vsc7323_enable ( adapter_t adap,
int  port,
int  which 
)

Definition at line 243 of file cxgb_vsc7323.c.

References elmr_write(), MAC_DIRECTION_RX, MAC_DIRECTION_TX, t3_elmr_blk_read(), and VSC_REG.

Referenced by t3_mac_enable().

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

◆ t3_vsc7323_init()

int t3_vsc7323_init ( adapter_t adap,
int  nports 
)

Definition at line 113 of file cxgb_vsc7323.c.

References ARRAY_SIZE, ELMR_BW, ELMR_THRES0, elmr_write(), addr_val_pair::reg_addr, t3_elmr_blk_write(), addr_val_pair::val, and VSC_REG.

Referenced by t3_prep_adapter(), and t3_reinit_adapter().

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

◆ t3_vsc7323_set_addr()

int t3_vsc7323_set_addr ( adapter_t adap,
u8  addr[6],
int  port 
)

Definition at line 231 of file cxgb_vsc7323.c.

References elmr_write(), and VSC_REG.

Referenced by t3_mac_set_address().

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

◆ t3_vsc7323_set_mtu()

int t3_vsc7323_set_mtu ( adapter_t adap,
unsigned int  mtu,
int  port 
)

Definition at line 226 of file cxgb_vsc7323.c.

References elmr_write(), and VSC_REG.

Referenced by t3_mac_set_mtu().

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

◆ t3_vsc7323_set_speed_fc()

int t3_vsc7323_set_speed_fc ( adapter_t adap,
int  speed,
int  fc,
int  port 
)

Definition at line 195 of file cxgb_vsc7323.c.

References elmr_write(), PAUSE_RX, PAUSE_TX, SPEED_10, SPEED_100, SPEED_1000, and VSC_REG.

Referenced by t3_mac_set_speed_duplex_fc().

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

◆ t3_vsc7323_update_stats()