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

Go to the source code of this file.

Macros

#define msleep   t3_os_sleep
 
#define AQBIT(x)   (1 << (0x##x))
 
#define ADV_1G_FULL   AQBIT(f)
 
#define ADV_1G_HALF   AQBIT(e)
 
#define ADV_10G_FULL   AQBIT(c)
 
#define AQ_WRITE_REGS(phy, regs)
 
#define AQ_READ_REGS(phy, regs)
 

Enumerations

enum  {
  AQ_LINK_STAT = 0xe800 , AQ_XAUI_RX_CFG = 0xc400 , AQ_XAUI_KX_CFG = 0xc440 , AQ_XAUI_TX_CFG = 0xe400 ,
  AQ_100M_CTRL = 0x0010 , AQ_10G_CTRL = 0x0020 , AQ_1G_CTRL = 0xc400 , AQ_ANEG_STAT = 0xc800 ,
  AQ_FW_VERSION = 0x0020 , AQ_THERMAL_THR = 0xc421 , AQ_THERMAL1 = 0xc820 , AQ_THERMAL2 = 0xc821 ,
  AQ_IFLAG_GLOBAL = 0xfc00 , AQ_IMASK_GLOBAL = 0xff00
}
 

Functions

 __FBSDID ("$FreeBSD$")
 
static int aq100x_temperature (struct cphy *phy)
 
static int aq100x_set_defaults (struct cphy *phy)
 
static int aq100x_reset (struct cphy *phy, int wait)
 
static int aq100x_intr_enable (struct cphy *phy)
 
static int aq100x_intr_disable (struct cphy *phy)
 
static int aq100x_intr_clear (struct cphy *phy)
 
static int aq100x_vendor_intr (struct cphy *phy, int *rc)
 
static int aq100x_intr_handler (struct cphy *phy)
 
static int aq100x_power_down (struct cphy *phy, int off)
 
static int aq100x_autoneg_enable (struct cphy *phy)
 
static int aq100x_autoneg_restart (struct cphy *phy)
 
static int aq100x_advertise (struct cphy *phy, unsigned int advertise_map)
 
static int aq100x_set_loopback (struct cphy *phy, int mmd, int dir, int enable)
 
static int aq100x_set_speed_duplex (struct cphy *phy, int speed, int duplex)
 
static int aq100x_get_link_status (struct cphy *phy, int *link_state, int *speed, int *duplex, int *fc)
 
int t3_aq100x_phy_prep (pinfo_t *pinfo, int phy_addr, const struct mdio_ops *mdio_ops)
 

Variables

static struct cphy_ops aq100x_ops
 

Macro Definition Documentation

◆ ADV_10G_FULL

#define ADV_10G_FULL   AQBIT(c)

Definition at line 66 of file cxgb_aq100x.c.

◆ ADV_1G_FULL

#define ADV_1G_FULL   AQBIT(f)

Definition at line 64 of file cxgb_aq100x.c.

◆ ADV_1G_HALF

#define ADV_1G_HALF   AQBIT(e)

Definition at line 65 of file cxgb_aq100x.c.

◆ AQ_READ_REGS

#define AQ_READ_REGS (   phy,
  regs 
)
Value:
do { \
unsigned i, v; \
for (i = 0; i < ARRAY_SIZE(regs); i++) { \
(void) mdio_read(phy, regs[i].mmd, regs[i].reg, &v); \
} \
} while (0)
struct cphy phy
Definition: cxgb_adapter.h:5
static int mdio_read(struct cphy *phy, int mmd, int reg, unsigned int *valp)
Definition: cxgb_common.h:592
#define ARRAY_SIZE(x)
Definition: cxgb_osdep.h:189

Definition at line 74 of file cxgb_aq100x.c.

◆ AQ_WRITE_REGS

#define AQ_WRITE_REGS (   phy,
  regs 
)
Value:
do { \
int i; \
for (i = 0; i < ARRAY_SIZE(regs); i++) { \
(void) mdio_write(phy, regs[i].mmd, regs[i].reg, regs[i].val); \
} \
} while (0)
static int mdio_write(struct cphy *phy, int mmd, int reg, unsigned int val)
Definition: cxgb_common.h:598

Definition at line 68 of file cxgb_aq100x.c.

◆ AQBIT

#define AQBIT (   x)    (1 << (0x##x))

Definition at line 63 of file cxgb_aq100x.c.

◆ msleep

#define msleep   t3_os_sleep

Definition at line 37 of file cxgb_aq100x.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
AQ_LINK_STAT 
AQ_XAUI_RX_CFG 
AQ_XAUI_KX_CFG 
AQ_XAUI_TX_CFG 
AQ_100M_CTRL 
AQ_10G_CTRL 
AQ_1G_CTRL 
AQ_ANEG_STAT 
AQ_FW_VERSION 
AQ_THERMAL_THR 
AQ_THERMAL1 
AQ_THERMAL2 
AQ_IFLAG_GLOBAL 
AQ_IMASK_GLOBAL 

Definition at line 39 of file cxgb_aq100x.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ aq100x_advertise()

◆ aq100x_autoneg_enable()

static int aq100x_autoneg_enable ( struct cphy phy)
static

Definition at line 257 of file cxgb_aq100x.c.

References aq100x_power_down(), BMCR_ANENABLE, BMCR_ANRESTART, MDIO_DEV_ANEG, phy, and t3_mdio_change_bits().

Referenced by aq100x_autoneg_restart().

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

◆ aq100x_autoneg_restart()

static int aq100x_autoneg_restart ( struct cphy phy)
static

Definition at line 270 of file cxgb_aq100x.c.

References aq100x_autoneg_enable(), and phy.

Here is the call graph for this function:

◆ aq100x_get_link_status()

static int aq100x_get_link_status ( struct cphy phy,
int *  link_state,
int *  speed,
int *  duplex,
int *  fc 
)
static

◆ aq100x_intr_clear()

static int aq100x_intr_clear ( struct cphy phy)
static

Definition at line 152 of file cxgb_aq100x.c.

References AQ_IMASK_GLOBAL, AQ_READ_REGS, MDIO_DEV_VEND1, and phy.

◆ aq100x_intr_disable()

static int aq100x_intr_disable ( struct cphy phy)
static

Definition at line 134 of file cxgb_aq100x.c.

References AQ_IMASK_GLOBAL, AQ_WRITE_REGS, MDIO_DEV_VEND1, and phy.

◆ aq100x_intr_enable()

static int aq100x_intr_enable ( struct cphy phy)
static

Definition at line 116 of file cxgb_aq100x.c.

References AQ_IMASK_GLOBAL, AQ_WRITE_REGS, AQBIT, MDIO_DEV_VEND1, and phy.

◆ aq100x_intr_handler()

static int aq100x_intr_handler ( struct cphy phy)
static

Definition at line 204 of file cxgb_aq100x.c.

References cphy::adapter, cphy::addr, aq100x_vendor_intr(), AQ_IFLAG_GLOBAL, AQBIT, CH_WARN, MDIO_DEV_VEND1, mdio_read(), and phy.

Here is the call graph for this function:

◆ aq100x_power_down()

static int aq100x_power_down ( struct cphy phy,
int  off 
)
static

Definition at line 228 of file cxgb_aq100x.c.

References cphy::adapter, cphy::addr, CH_WARN, MDIO_DEV_PMA_PMD, mdio_read(), msleep, phy, and t3_mdio_change_bits().

Referenced by aq100x_autoneg_enable().

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

◆ aq100x_reset()

static int aq100x_reset ( struct cphy phy,
int  wait 
)
static

Definition at line 106 of file cxgb_aq100x.c.

References aq100x_set_defaults(), MDIO_DEV_PMA_PMD, phy, and t3_phy_reset().

Here is the call graph for this function:

◆ aq100x_set_defaults()

static int aq100x_set_defaults ( struct cphy phy)
static

Definition at line 100 of file cxgb_aq100x.c.

References AQ_THERMAL_THR, MDIO_DEV_VEND1, mdio_write(), and phy.

Referenced by aq100x_reset(), and t3_aq100x_phy_prep().

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

◆ aq100x_set_loopback()

static int aq100x_set_loopback ( struct cphy phy,
int  mmd,
int  dir,
int  enable 
)
static

Definition at line 317 of file cxgb_aq100x.c.

References BMCR_LOOPBACK, MDIO_DEV_PMA_PMD, phy, and t3_mdio_change_bits().

Here is the call graph for this function:

◆ aq100x_set_speed_duplex()

static int aq100x_set_speed_duplex ( struct cphy phy,
int  speed,
int  duplex 
)
static

Definition at line 324 of file cxgb_aq100x.c.

References BMCR_ANENABLE, BMCR_ANRESTART, BMCR_SPEED100, BMCR_SPEED1000, DUPLEX_FULL, MDIO_DEV_ANEG, MDIO_DEV_PMA_PMD, phy, SPEED_100, SPEED_1000, SPEED_10000, and t3_mdio_change_bits().

Here is the call graph for this function:

◆ aq100x_temperature()

static int aq100x_temperature ( struct cphy phy)
static

Definition at line 85 of file cxgb_aq100x.c.

References AQ_THERMAL1, AQ_THERMAL2, MDIO_DEV_VEND1, mdio_read(), and phy.

Referenced by aq100x_vendor_intr().

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

◆ aq100x_vendor_intr()

static int aq100x_vendor_intr ( struct cphy phy,
int *  rc 
)
static

Definition at line 168 of file cxgb_aq100x.c.

References A_T3DBG_GPIO_EN, cphy::adapter, cphy::addr, aq100x_temperature(), AQBIT, CH_WARN, cphy_cause_alarm, F_GPIO10_OUT_VAL, F_GPIO6_OUT_VAL, MDIO_DEV_VEND1, mdio_read(), phy, and t3_set_reg_field().

Referenced by aq100x_intr_handler().

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

◆ t3_aq100x_phy_prep()

Variable Documentation

◆ aq100x_ops

struct cphy_ops aq100x_ops
static
Initial value:
= {
.reset = aq100x_reset,
.intr_enable = aq100x_intr_enable,
.intr_disable = aq100x_intr_disable,
.intr_clear = aq100x_intr_clear,
.intr_handler = aq100x_intr_handler,
.autoneg_enable = aq100x_autoneg_enable,
.autoneg_restart = aq100x_autoneg_restart,
.advertise = aq100x_advertise,
.set_loopback = aq100x_set_loopback,
.set_speed_duplex = aq100x_set_speed_duplex,
.get_link_status = aq100x_get_link_status,
.power_down = aq100x_power_down,
}
static int aq100x_autoneg_enable(struct cphy *phy)
Definition: cxgb_aq100x.c:257
static int aq100x_intr_clear(struct cphy *phy)
Definition: cxgb_aq100x.c:152
static int aq100x_power_down(struct cphy *phy, int off)
Definition: cxgb_aq100x.c:228
static int aq100x_set_loopback(struct cphy *phy, int mmd, int dir, int enable)
Definition: cxgb_aq100x.c:317
static int aq100x_autoneg_restart(struct cphy *phy)
Definition: cxgb_aq100x.c:270
static int aq100x_set_speed_duplex(struct cphy *phy, int speed, int duplex)
Definition: cxgb_aq100x.c:324
static int aq100x_intr_disable(struct cphy *phy)
Definition: cxgb_aq100x.c:134
static int aq100x_intr_enable(struct cphy *phy)
Definition: cxgb_aq100x.c:116
static int aq100x_get_link_status(struct cphy *phy, int *link_state, int *speed, int *duplex, int *fc)
Definition: cxgb_aq100x.c:354
static int aq100x_intr_handler(struct cphy *phy)
Definition: cxgb_aq100x.c:204
static int aq100x_advertise(struct cphy *phy, unsigned int advertise_map)
Definition: cxgb_aq100x.c:276
static int aq100x_reset(struct cphy *phy, int wait)
Definition: cxgb_aq100x.c:106

Definition at line 449 of file cxgb_aq100x.c.

Referenced by t3_aq100x_phy_prep().