Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/axgbe/xgbe-mdio.c
Show First 20 Lines • Show All 746 Lines • ▼ Show 20 Lines | static void xgbe_an_init(struct xgbe_prv_data *pdata) | ||||
/* We don't intend to perform XNP */ | /* We don't intend to perform XNP */ | ||||
reg &= ~XGBE_XNP_NP_EXCHANGE; | reg &= ~XGBE_XNP_NP_EXCHANGE; | ||||
XMDIO_WRITE(pdata, MDIO_MMD_AN, MDIO_AN_ADVERTISE, reg); | XMDIO_WRITE(pdata, MDIO_MMD_AN, MDIO_AN_ADVERTISE, reg); | ||||
} | } | ||||
static void xgbe_phy_adjust_link(struct xgbe_prv_data *pdata) | static void xgbe_phy_adjust_link(struct xgbe_prv_data *pdata) | ||||
{ | { | ||||
int new_state = 0; | |||||
if (pdata->phy.link) { | if (pdata->phy.link) { | ||||
/* Flow control support */ | /* Flow control support */ | ||||
pdata->pause_autoneg = pdata->phy.pause_autoneg; | pdata->pause_autoneg = pdata->phy.pause_autoneg; | ||||
if (pdata->tx_pause != pdata->phy.tx_pause) { | if (pdata->tx_pause != pdata->phy.tx_pause) { | ||||
new_state = 1; | |||||
pdata->hw_if.config_tx_flow_control(pdata); | pdata->hw_if.config_tx_flow_control(pdata); | ||||
pdata->tx_pause = pdata->phy.tx_pause; | pdata->tx_pause = pdata->phy.tx_pause; | ||||
} | } | ||||
if (pdata->rx_pause != pdata->phy.rx_pause) { | if (pdata->rx_pause != pdata->phy.rx_pause) { | ||||
new_state = 1; | |||||
pdata->hw_if.config_rx_flow_control(pdata); | pdata->hw_if.config_rx_flow_control(pdata); | ||||
pdata->rx_pause = pdata->phy.rx_pause; | pdata->rx_pause = pdata->phy.rx_pause; | ||||
} | } | ||||
/* Speed support */ | /* Speed support */ | ||||
if (pdata->phy_speed != pdata->phy.speed) { | if (pdata->phy_speed != pdata->phy.speed) { | ||||
new_state = 1; | |||||
pdata->phy_speed = pdata->phy.speed; | pdata->phy_speed = pdata->phy.speed; | ||||
} | } | ||||
if (pdata->phy_link != pdata->phy.link) { | if (pdata->phy_link != pdata->phy.link) { | ||||
new_state = 1; | |||||
pdata->phy_link = pdata->phy.link; | pdata->phy_link = pdata->phy.link; | ||||
} | } | ||||
} else if (pdata->phy_link) { | } else if (pdata->phy_link) { | ||||
new_state = 1; | |||||
pdata->phy_link = 0; | pdata->phy_link = 0; | ||||
pdata->phy_speed = SPEED_UNKNOWN; | pdata->phy_speed = SPEED_UNKNOWN; | ||||
} | } | ||||
} | } | ||||
static int xgbe_phy_config_fixed(struct xgbe_prv_data *pdata) | static int xgbe_phy_config_fixed(struct xgbe_prv_data *pdata) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 388 Lines • Show Last 20 Lines |