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

Go to the source code of this file.

Macros

#define msleep   t3_os_sleep
 
#define CFG_CHG_INTR_MASK
 
#define INTR_MASK
 
#define S_ACSR_ACTIPHY_TMR   0
 
#define M_ACSR_ACTIPHY_TMR   0x3
 
#define V_ACSR_ACTIPHY_TMR(x)   ((x) << S_ACSR_ACTIPHY_TMR)
 
#define S_ACSR_SPEED   3
 
#define M_ACSR_SPEED   0x3
 
#define G_ACSR_SPEED(x)   (((x) >> S_ACSR_SPEED) & M_ACSR_SPEED)
 
#define S_ACSR_DUPLEX   5
 
#define F_ACSR_DUPLEX   (1 << S_ACSR_DUPLEX)
 
#define S_ACSR_ACTIPHY   6
 
#define F_ACSR_ACTIPHY   (1 << S_ACSR_ACTIPHY)
 
#define VSC8211_PHY_CTRL   24
 
#define S_VSC8211_TXFIFODEPTH   7
 
#define M_VSC8211_TXFIFODEPTH   0x7
 
#define V_VSC8211_TXFIFODEPTH(x)   ((x) << S_VSC8211_TXFIFODEPTH)
 
#define G_VSC8211_TXFIFODEPTH(x)   (((x) >> S_VSC8211_TXFIFODEPTH) & M_VSC8211_TXFIFODEPTH)
 
#define S_VSC8211_RXFIFODEPTH   4
 
#define M_VSC8211_RXFIFODEPTH   0x7
 
#define V_VSC8211_RXFIFODEPTH(x)   ((x) << S_VSC8211_RXFIFODEPTH)
 
#define G_VSC8211_RXFIFODEPTH(x)   (((x) >> S_VSC8211_RXFIFODEPTH) & M_VSC8211_RXFIFODEPTH)
 

Enumerations

enum  {
  VSC8211_SIGDET_CTRL = 19 , VSC8211_EXT_CTRL = 23 , VSC8211_PHY_CTRL = 24 , VSC8211_INTR_ENABLE = 25 ,
  VSC8211_INTR_STATUS = 26 , VSC8211_LED_CTRL = 27 , VSC8211_AUX_CTRL_STAT = 28 , VSC8211_EXT_PAGE_AXS = 31
}
 
enum  {
  VSC_INTR_RX_ERR = 1 << 0 , VSC_INTR_MS_ERR = 1 << 1 , VSC_INTR_CABLE = 1 << 2 , VSC_INTR_FALSE_CARR = 1 << 3 ,
  VSC_INTR_MEDIA_CHG = 1 << 4 , VSC_INTR_RX_FIFO = 1 << 5 , VSC_INTR_TX_FIFO = 1 << 6 , VSC_INTR_DESCRAMBL = 1 << 7 ,
  VSC_INTR_SYMBOL_ERR = 1 << 8 , VSC_INTR_NEG_DONE = 1 << 10 , VSC_INTR_NEG_ERR = 1 << 11 , VSC_INTR_DPLX_CHG = 1 << 12 ,
  VSC_INTR_LINK_CHG = 1 << 13 , VSC_INTR_SPD_CHG = 1 << 14 , VSC_INTR_ENABLE = 1 << 15
}
 
enum  { VSC_CTRL_CLAUSE37_VIEW = 1 << 4 , VSC_CTRL_MEDIA_MODE_HI = 0xf000 }
 

Functions

 __FBSDID ("$FreeBSD$")
 
static int vsc8211_reset (struct cphy *cphy, int wait)
 
static int vsc8211_intr_enable (struct cphy *cphy)
 
static int vsc8211_intr_disable (struct cphy *cphy)
 
static int vsc8211_intr_clear (struct cphy *cphy)
 
static int vsc8211_autoneg_enable (struct cphy *cphy)
 
static int vsc8211_autoneg_restart (struct cphy *cphy)
 
static int vsc8211_get_link_status (struct cphy *cphy, int *link_state, int *speed, int *duplex, int *fc)
 
static int vsc8211_get_link_status_fiber (struct cphy *cphy, int *link_state, int *speed, int *duplex, int *fc)
 
static int vsc8211_set_automdi (struct cphy *phy, int enable)
 
static int vsc8211_set_speed_duplex (struct cphy *phy, int speed, int duplex)
 
static int vsc8211_power_down (struct cphy *cphy, int enable)
 
static int vsc8211_intr_handler (struct cphy *cphy)
 
int t3_vsc8211_fifo_depth (adapter_t *adap, unsigned int mtu, int port)
 
int t3_vsc8211_phy_prep (pinfo_t *pinfo, int phy_addr, const struct mdio_ops *mdio_ops)
 

Variables

static struct cphy_ops vsc8211_ops
 
static struct cphy_ops vsc8211_fiber_ops
 

Macro Definition Documentation

◆ CFG_CHG_INTR_MASK

#define CFG_CHG_INTR_MASK
Value:
VSC_INTR_DPLX_CHG | VSC_INTR_SPD_CHG | \
VSC_INTR_NEG_DONE)
@ VSC_INTR_SPD_CHG
Definition: cxgb_vsc8211.c:65
@ VSC_INTR_NEG_ERR
Definition: cxgb_vsc8211.c:62
@ VSC_INTR_LINK_CHG
Definition: cxgb_vsc8211.c:64

Definition at line 74 of file cxgb_vsc8211.c.

◆ F_ACSR_ACTIPHY

#define F_ACSR_ACTIPHY   (1 << S_ACSR_ACTIPHY)

Definition at line 93 of file cxgb_vsc8211.c.

◆ F_ACSR_DUPLEX

#define F_ACSR_DUPLEX   (1 << S_ACSR_DUPLEX)

Definition at line 90 of file cxgb_vsc8211.c.

◆ G_ACSR_SPEED

#define G_ACSR_SPEED (   x)    (((x) >> S_ACSR_SPEED) & M_ACSR_SPEED)

Definition at line 87 of file cxgb_vsc8211.c.

◆ G_VSC8211_RXFIFODEPTH

#define G_VSC8211_RXFIFODEPTH (   x)    (((x) >> S_VSC8211_RXFIFODEPTH) & M_VSC8211_RXFIFODEPTH)

Definition at line 392 of file cxgb_vsc8211.c.

◆ G_VSC8211_TXFIFODEPTH

#define G_VSC8211_TXFIFODEPTH (   x)    (((x) >> S_VSC8211_TXFIFODEPTH) & M_VSC8211_TXFIFODEPTH)

Definition at line 387 of file cxgb_vsc8211.c.

◆ INTR_MASK

#define INTR_MASK
Value:
VSC_INTR_ENABLE)
#define CFG_CHG_INTR_MASK
Definition: cxgb_vsc8211.c:74
@ VSC_INTR_TX_FIFO
Definition: cxgb_vsc8211.c:58
@ VSC_INTR_RX_FIFO
Definition: cxgb_vsc8211.c:57

Definition at line 77 of file cxgb_vsc8211.c.

◆ M_ACSR_ACTIPHY_TMR

#define M_ACSR_ACTIPHY_TMR   0x3

Definition at line 82 of file cxgb_vsc8211.c.

◆ M_ACSR_SPEED

#define M_ACSR_SPEED   0x3

Definition at line 86 of file cxgb_vsc8211.c.

◆ M_VSC8211_RXFIFODEPTH

#define M_VSC8211_RXFIFODEPTH   0x7

Definition at line 390 of file cxgb_vsc8211.c.

◆ M_VSC8211_TXFIFODEPTH

#define M_VSC8211_TXFIFODEPTH   0x7

Definition at line 385 of file cxgb_vsc8211.c.

◆ msleep

#define msleep   t3_os_sleep

Definition at line 37 of file cxgb_vsc8211.c.

◆ S_ACSR_ACTIPHY

#define S_ACSR_ACTIPHY   6

Definition at line 92 of file cxgb_vsc8211.c.

◆ S_ACSR_ACTIPHY_TMR

#define S_ACSR_ACTIPHY_TMR   0

Definition at line 81 of file cxgb_vsc8211.c.

◆ S_ACSR_DUPLEX

#define S_ACSR_DUPLEX   5

Definition at line 89 of file cxgb_vsc8211.c.

◆ S_ACSR_SPEED

#define S_ACSR_SPEED   3

Definition at line 85 of file cxgb_vsc8211.c.

◆ S_VSC8211_RXFIFODEPTH

#define S_VSC8211_RXFIFODEPTH   4

Definition at line 389 of file cxgb_vsc8211.c.

◆ S_VSC8211_TXFIFODEPTH

#define S_VSC8211_TXFIFODEPTH   7

Definition at line 384 of file cxgb_vsc8211.c.

◆ V_ACSR_ACTIPHY_TMR

#define V_ACSR_ACTIPHY_TMR (   x)    ((x) << S_ACSR_ACTIPHY_TMR)

Definition at line 83 of file cxgb_vsc8211.c.

◆ V_VSC8211_RXFIFODEPTH

#define V_VSC8211_RXFIFODEPTH (   x)    ((x) << S_VSC8211_RXFIFODEPTH)

Definition at line 391 of file cxgb_vsc8211.c.

◆ V_VSC8211_TXFIFODEPTH

#define V_VSC8211_TXFIFODEPTH (   x)    ((x) << S_VSC8211_TXFIFODEPTH)

Definition at line 386 of file cxgb_vsc8211.c.

◆ VSC8211_PHY_CTRL

#define VSC8211_PHY_CTRL   24

Definition at line 382 of file cxgb_vsc8211.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
VSC8211_SIGDET_CTRL 
VSC8211_EXT_CTRL 
VSC8211_PHY_CTRL 
VSC8211_INTR_ENABLE 
VSC8211_INTR_STATUS 
VSC8211_LED_CTRL 
VSC8211_AUX_CTRL_STAT 
VSC8211_EXT_PAGE_AXS 

Definition at line 40 of file cxgb_vsc8211.c.

◆ anonymous enum

anonymous enum
Enumerator
VSC_INTR_RX_ERR 
VSC_INTR_MS_ERR 
VSC_INTR_CABLE 
VSC_INTR_FALSE_CARR 
VSC_INTR_MEDIA_CHG 
VSC_INTR_RX_FIFO 
VSC_INTR_TX_FIFO 
VSC_INTR_DESCRAMBL 
VSC_INTR_SYMBOL_ERR 
VSC_INTR_NEG_DONE 
VSC_INTR_NEG_ERR 
VSC_INTR_DPLX_CHG 
VSC_INTR_LINK_CHG 
VSC_INTR_SPD_CHG 
VSC_INTR_ENABLE 

Definition at line 51 of file cxgb_vsc8211.c.

◆ anonymous enum

anonymous enum
Enumerator
VSC_CTRL_CLAUSE37_VIEW 
VSC_CTRL_MEDIA_MODE_HI 

Definition at line 69 of file cxgb_vsc8211.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ t3_vsc8211_fifo_depth()

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

Definition at line 394 of file cxgb_vsc8211.c.

References adap2pinfo(), M_VSC8211_RXFIFODEPTH, M_VSC8211_TXFIFODEPTH, mdio_read(), mdio_write(), phy, port_info::phy, V_VSC8211_RXFIFODEPTH, V_VSC8211_TXFIFODEPTH, and VSC8211_PHY_CTRL.

Referenced by t3_mac_set_mtu().

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

◆ t3_vsc8211_phy_prep()

◆ vsc8211_autoneg_enable()

static int vsc8211_autoneg_enable ( struct cphy cphy)
static

Definition at line 121 of file cxgb_vsc8211.c.

References BMCR_ANENABLE, BMCR_ANRESTART, BMCR_ISOLATE, and t3_mdio_change_bits().

Here is the call graph for this function:

◆ vsc8211_autoneg_restart()

static int vsc8211_autoneg_restart ( struct cphy cphy)
static

Definition at line 127 of file cxgb_vsc8211.c.

References BMCR_ANRESTART, BMCR_ISOLATE, and t3_mdio_change_bits().

Here is the call graph for this function:

◆ vsc8211_get_link_status()

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

◆ vsc8211_get_link_status_fiber()

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

◆ vsc8211_intr_clear()

static int vsc8211_intr_clear ( struct cphy cphy)
static

Definition at line 113 of file cxgb_vsc8211.c.

References mdio_read(), and VSC8211_INTR_STATUS.

Here is the call graph for this function:

◆ vsc8211_intr_disable()

static int vsc8211_intr_disable ( struct cphy cphy)
static

Definition at line 108 of file cxgb_vsc8211.c.

References mdio_write(), and VSC8211_INTR_ENABLE.

Here is the call graph for this function:

◆ vsc8211_intr_enable()

static int vsc8211_intr_enable ( struct cphy cphy)
static

Definition at line 103 of file cxgb_vsc8211.c.

References INTR_MASK, mdio_write(), and VSC8211_INTR_ENABLE.

Here is the call graph for this function:

◆ vsc8211_intr_handler()

static int vsc8211_intr_handler ( struct cphy cphy)
static

Definition at line 305 of file cxgb_vsc8211.c.

References CFG_CHG_INTR_MASK, cphy_cause_fifo_error, cphy_cause_link_change, INTR_MASK, mdio_read(), VSC8211_INTR_STATUS, VSC_INTR_RX_FIFO, and VSC_INTR_TX_FIFO.

Here is the call graph for this function:

◆ vsc8211_power_down()

static int vsc8211_power_down ( struct cphy cphy,
int  enable 
)
static

Definition at line 299 of file cxgb_vsc8211.c.

References t3_mdio_change_bits().

Here is the call graph for this function:

◆ vsc8211_reset()

static int vsc8211_reset ( struct cphy cphy,
int  wait 
)
static

Definition at line 98 of file cxgb_vsc8211.c.

References t3_phy_reset().

Referenced by t3_vsc8211_phy_prep().

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

◆ vsc8211_set_automdi()

static int vsc8211_set_automdi ( struct cphy phy,
int  enable 
)
static

Definition at line 276 of file cxgb_vsc8211.c.

References mdio_write(), phy, and VSC8211_EXT_PAGE_AXS.

Referenced by vsc8211_set_speed_duplex().

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

◆ vsc8211_set_speed_duplex()

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

Definition at line 289 of file cxgb_vsc8211.c.

References phy, t3_set_phy_speed_duplex(), and vsc8211_set_automdi().

Here is the call graph for this function:

Variable Documentation

◆ vsc8211_fiber_ops

struct cphy_ops vsc8211_fiber_ops
static
Initial value:
= {
.reset = vsc8211_reset,
.intr_enable = vsc8211_intr_enable,
.intr_disable = vsc8211_intr_disable,
.intr_clear = vsc8211_intr_clear,
.intr_handler = vsc8211_intr_handler,
.autoneg_enable = vsc8211_autoneg_enable,
.autoneg_restart = vsc8211_autoneg_restart,
.advertise = t3_phy_advertise_fiber,
.set_speed_duplex = t3_set_phy_speed_duplex,
.get_link_status = vsc8211_get_link_status_fiber,
.power_down = vsc8211_power_down,
}
int t3_phy_advertise_fiber(struct cphy *phy, unsigned int advert)
Definition: cxgb_t3_hw.c:468
int t3_set_phy_speed_duplex(struct cphy *phy, int speed, int duplex)
Definition: cxgb_t3_hw.c:492
static int vsc8211_intr_clear(struct cphy *cphy)
Definition: cxgb_vsc8211.c:113
static int vsc8211_autoneg_restart(struct cphy *cphy)
Definition: cxgb_vsc8211.c:127
static int vsc8211_power_down(struct cphy *cphy, int enable)
Definition: cxgb_vsc8211.c:299
static int vsc8211_get_link_status_fiber(struct cphy *cphy, int *link_state, int *speed, int *duplex, int *fc)
Definition: cxgb_vsc8211.c:206
static int vsc8211_intr_handler(struct cphy *cphy)
Definition: cxgb_vsc8211.c:305
static int vsc8211_intr_enable(struct cphy *cphy)
Definition: cxgb_vsc8211.c:103
static int vsc8211_autoneg_enable(struct cphy *cphy)
Definition: cxgb_vsc8211.c:121
static int vsc8211_intr_disable(struct cphy *cphy)
Definition: cxgb_vsc8211.c:108
static int vsc8211_reset(struct cphy *cphy, int wait)
Definition: cxgb_vsc8211.c:98

Definition at line 367 of file cxgb_vsc8211.c.

Referenced by t3_vsc8211_phy_prep().

◆ vsc8211_ops

struct cphy_ops vsc8211_ops
static
Initial value:
= {
.reset = vsc8211_reset,
.intr_enable = vsc8211_intr_enable,
.intr_disable = vsc8211_intr_disable,
.intr_clear = vsc8211_intr_clear,
.intr_handler = vsc8211_intr_handler,
.autoneg_enable = vsc8211_autoneg_enable,
.autoneg_restart = vsc8211_autoneg_restart,
.advertise = t3_phy_advertise,
.set_speed_duplex = vsc8211_set_speed_duplex,
.get_link_status = vsc8211_get_link_status,
.power_down = vsc8211_power_down,
}
int t3_phy_advertise(struct cphy *phy, unsigned int advert)
Definition: cxgb_t3_hw.c:425
static int vsc8211_get_link_status(struct cphy *cphy, int *link_state, int *speed, int *duplex, int *fc)
Definition: cxgb_vsc8211.c:133
static int vsc8211_set_speed_duplex(struct cphy *phy, int speed, int duplex)
Definition: cxgb_vsc8211.c:289

Definition at line 353 of file cxgb_vsc8211.c.

Referenced by t3_vsc8211_phy_prep().