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

Go to the source code of this file.

Macros

#define msleep   t3_os_sleep
 
#define ADVERTISE_ENPAGE   (1 << 12)
 
#define ADVERTISE_10000FULL   (1 << 12)
 
#define ADVERTISE_LOOP_TIMING   (1 << 0)
 
#define F_XS_LANE_ALIGN_STAT   (1 << 0)
 
#define F_PCS_BLK_LOCK   (1 << 1)
 
#define F_PMD_SIGNAL_OK   (1 << 2)
 
#define F_LINK_STAT   (1 << 3)
 
#define F_ANEG_SPEED_1G   (1 << 4)
 
#define F_ANEG_MASTER   (1 << 5)
 
#define S_ANEG_STAT   6
 
#define M_ANEG_STAT   0x3
 
#define G_ANEG_STAT(x)   (((x) >> S_ANEG_STAT) & M_ANEG_STAT)
 

Enumerations

enum  { TN1010_VEND1_STAT = 1 }
 
enum  { ANEG_ADVER = 16 , ANEG_LPA = 19 , ANEG_10G_CTRL = 32 , ANEG_10G_STAT = 33 }
 
enum  { ANEG_IN_PROGR = 0 , ANEG_COMPLETE = 1 , ANEG_FAILED = 3 }
 

Functions

 __FBSDID ("$FreeBSD$")
 
static int tn1010_reset (struct cphy *phy, int wait)
 
static int tn1010_power_down (struct cphy *phy, int enable)
 
static int tn1010_autoneg_enable (struct cphy *phy)
 
static int tn1010_autoneg_restart (struct cphy *phy)
 
static int tn1010_advertise (struct cphy *phy, unsigned int advert)
 
static int tn1010_get_link_status (struct cphy *phy, int *link_state, int *speed, int *duplex, int *fc)
 
static int tn1010_set_speed_duplex (struct cphy *phy, int speed, int duplex)
 
int t3_tn1010_phy_prep (pinfo_t *pinfo, int phy_addr, const struct mdio_ops *mdio_ops)
 

Variables

static struct cphy_ops tn1010_ops
 

Macro Definition Documentation

◆ ADVERTISE_10000FULL

#define ADVERTISE_10000FULL   (1 << 12)

Definition at line 53 of file cxgb_tn1010.c.

◆ ADVERTISE_ENPAGE

#define ADVERTISE_ENPAGE   (1 << 12)

Definition at line 52 of file cxgb_tn1010.c.

◆ ADVERTISE_LOOP_TIMING

#define ADVERTISE_LOOP_TIMING   (1 << 0)

Definition at line 54 of file cxgb_tn1010.c.

◆ F_ANEG_MASTER

#define F_ANEG_MASTER   (1 << 5)

Definition at line 62 of file cxgb_tn1010.c.

◆ F_ANEG_SPEED_1G

#define F_ANEG_SPEED_1G   (1 << 4)

Definition at line 61 of file cxgb_tn1010.c.

◆ F_LINK_STAT

#define F_LINK_STAT   (1 << 3)

Definition at line 60 of file cxgb_tn1010.c.

◆ F_PCS_BLK_LOCK

#define F_PCS_BLK_LOCK   (1 << 1)

Definition at line 58 of file cxgb_tn1010.c.

◆ F_PMD_SIGNAL_OK

#define F_PMD_SIGNAL_OK   (1 << 2)

Definition at line 59 of file cxgb_tn1010.c.

◆ F_XS_LANE_ALIGN_STAT

#define F_XS_LANE_ALIGN_STAT   (1 << 0)

Definition at line 57 of file cxgb_tn1010.c.

◆ G_ANEG_STAT

#define G_ANEG_STAT (   x)    (((x) >> S_ANEG_STAT) & M_ANEG_STAT)

Definition at line 66 of file cxgb_tn1010.c.

◆ M_ANEG_STAT

#define M_ANEG_STAT   0x3

Definition at line 65 of file cxgb_tn1010.c.

◆ msleep

#define msleep   t3_os_sleep

Definition at line 37 of file cxgb_tn1010.c.

◆ S_ANEG_STAT

#define S_ANEG_STAT   6

Definition at line 64 of file cxgb_tn1010.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TN1010_VEND1_STAT 

Definition at line 40 of file cxgb_tn1010.c.

◆ anonymous enum

anonymous enum
Enumerator
ANEG_ADVER 
ANEG_LPA 
ANEG_10G_CTRL 
ANEG_10G_STAT 

Definition at line 45 of file cxgb_tn1010.c.

◆ anonymous enum

anonymous enum
Enumerator
ANEG_IN_PROGR 
ANEG_COMPLETE 
ANEG_FAILED 

Definition at line 68 of file cxgb_tn1010.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ t3_tn1010_phy_prep()

int t3_tn1010_phy_prep ( pinfo_t pinfo,
int  phy_addr,
const struct mdio_ops mdio_ops 
)

◆ tn1010_advertise()

static int tn1010_advertise ( struct cphy phy,
unsigned int  advert 
)
static

◆ tn1010_autoneg_enable()

static int tn1010_autoneg_enable ( struct cphy phy)
static

Definition at line 90 of file cxgb_tn1010.c.

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

Here is the call graph for this function:

◆ tn1010_autoneg_restart()

static int tn1010_autoneg_restart ( struct cphy phy)
static

Definition at line 101 of file cxgb_tn1010.c.

References BMCR_ANRESTART, MDIO_DEV_ANEG, phy, t3_mdio_change_bits(), and tn1010_power_down().

Here is the call graph for this function:

◆ tn1010_get_link_status()

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

◆ tn1010_power_down()

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

Definition at line 84 of file cxgb_tn1010.c.

References MDIO_DEV_PMA_PMD, phy, and t3_mdio_change_bits().

Referenced by tn1010_autoneg_enable(), and tn1010_autoneg_restart().

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

◆ tn1010_reset()

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

Definition at line 77 of file cxgb_tn1010.c.

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

Here is the call graph for this function:

◆ tn1010_set_speed_duplex()

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

Definition at line 178 of file cxgb_tn1010.c.

Variable Documentation

◆ tn1010_ops

struct cphy_ops tn1010_ops
static
Initial value:
= {
.reset = tn1010_reset,
.intr_enable = t3_phy_lasi_intr_enable,
.intr_disable = t3_phy_lasi_intr_disable,
.intr_clear = t3_phy_lasi_intr_clear,
.intr_handler = t3_phy_lasi_intr_handler,
.autoneg_enable = tn1010_autoneg_enable,
.autoneg_restart = tn1010_autoneg_restart,
.advertise = tn1010_advertise,
.set_speed_duplex = tn1010_set_speed_duplex,
.get_link_status = tn1010_get_link_status,
.power_down = tn1010_power_down,
}
int t3_phy_lasi_intr_handler(struct cphy *phy)
Definition: cxgb_t3_hw.c:535
int t3_phy_lasi_intr_clear(struct cphy *phy)
Definition: cxgb_t3_hw.c:528
int t3_phy_lasi_intr_enable(struct cphy *phy)
Definition: cxgb_t3_hw.c:518
int t3_phy_lasi_intr_disable(struct cphy *phy)
Definition: cxgb_t3_hw.c:523
static int tn1010_get_link_status(struct cphy *phy, int *link_state, int *speed, int *duplex, int *fc)
Definition: cxgb_tn1010.c:133
static int tn1010_autoneg_enable(struct cphy *phy)
Definition: cxgb_tn1010.c:90
static int tn1010_autoneg_restart(struct cphy *phy)
Definition: cxgb_tn1010.c:101
static int tn1010_reset(struct cphy *phy, int wait)
Definition: cxgb_tn1010.c:77
static int tn1010_advertise(struct cphy *phy, unsigned int advert)
Definition: cxgb_tn1010.c:112
static int tn1010_power_down(struct cphy *phy, int enable)
Definition: cxgb_tn1010.c:84
static int tn1010_set_speed_duplex(struct cphy *phy, int speed, int duplex)
Definition: cxgb_tn1010.c:178

Definition at line 199 of file cxgb_tn1010.c.

Referenced by t3_tn1010_phy_prep().