Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/bnxt/if_bnxt.c
Show First 20 Lines • Show All 685 Lines • ▼ Show 20 Lines | bnxt_attach_pre(if_ctx_t ctx) | ||||
/* Register the driver with the FW */ | /* Register the driver with the FW */ | ||||
rc = bnxt_hwrm_func_drv_rgtr(softc); | rc = bnxt_hwrm_func_drv_rgtr(softc); | ||||
if (rc) { | if (rc) { | ||||
device_printf(softc->dev, "attach: hwrm drv rgtr failed\n"); | device_printf(softc->dev, "attach: hwrm drv rgtr failed\n"); | ||||
goto drv_rgtr_fail; | goto drv_rgtr_fail; | ||||
} | } | ||||
rc = bnxt_hwrm_func_rgtr_async_events(softc, NULL, 0); | |||||
if (rc) { | |||||
device_printf(softc->dev, "attach: hwrm rgtr async evts failed\n"); | |||||
goto drv_rgtr_fail; | |||||
} | |||||
/* Get the HW capabilities */ | /* Get the HW capabilities */ | ||||
rc = bnxt_hwrm_func_qcaps(softc); | rc = bnxt_hwrm_func_qcaps(softc); | ||||
if (rc) | if (rc) | ||||
goto failed; | goto failed; | ||||
iflib_set_mac(ctx, softc->func.mac_addr); | iflib_set_mac(ctx, softc->func.mac_addr); | ||||
scctx->isc_txrx = &bnxt_txrx; | scctx->isc_txrx = &bnxt_txrx; | ||||
▲ Show 20 Lines • Show All 1,579 Lines • ▼ Show 20 Lines | if (softc->link_info.pause == ( | ||||
flow_ctrl = "FC - receive & transmit"; | flow_ctrl = "FC - receive & transmit"; | ||||
else if (softc->link_info.pause == | else if (softc->link_info.pause == | ||||
HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX) | HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX) | ||||
flow_ctrl = "FC - transmit"; | flow_ctrl = "FC - transmit"; | ||||
else if (softc->link_info.pause == | else if (softc->link_info.pause == | ||||
HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX) | HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX) | ||||
flow_ctrl = "FC - receive"; | flow_ctrl = "FC - receive"; | ||||
else | else | ||||
flow_ctrl = "none"; | flow_ctrl = "FC - none"; | ||||
iflib_link_state_change(softc->ctx, LINK_STATE_UP, | iflib_link_state_change(softc->ctx, LINK_STATE_UP, | ||||
IF_Gbps(100)); | IF_Gbps(100)); | ||||
device_printf(softc->dev, "Link is UP %s, %s\n", duplex, | device_printf(softc->dev, "Link is UP %s, %s - %d Mbps \n", duplex, | ||||
flow_ctrl); | flow_ctrl, (softc->link_info.link_speed * 100)); | ||||
} else { | } else { | ||||
iflib_link_state_change(softc->ctx, LINK_STATE_DOWN, | iflib_link_state_change(softc->ctx, LINK_STATE_DOWN, | ||||
bnxt_get_baudrate(&softc->link_info)); | bnxt_get_baudrate(&softc->link_info)); | ||||
device_printf(softc->dev, "Link is Down\n"); | device_printf(softc->dev, "Link is Down\n"); | ||||
} | } | ||||
softc->link_info.last_link_up = softc->link_info.link_up; | softc->link_info.last_link_up = softc->link_info.link_up; | ||||
softc->link_info.last_pause = softc->link_info.pause; | softc->link_info.last_pause = softc->link_info.pause; | ||||
▲ Show 20 Lines • Show All 264 Lines • Show Last 20 Lines |