diff --git a/sys/dev/bnxt/bnxt.h b/sys/dev/bnxt/bnxt.h --- a/sys/dev/bnxt/bnxt.h +++ b/sys/dev/bnxt/bnxt.h @@ -843,5 +843,6 @@ int bnxt_read_sfp_module_eeprom_info(struct bnxt_softc *bp, uint16_t i2c_addr, uint16_t page_number, uint8_t bank, bool bank_sel_en, uint16_t start_addr, uint16_t data_length, uint8_t *buf); +uint8_t get_phy_type(struct bnxt_softc *softc); #endif /* _BNXT_H */ diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c --- a/sys/dev/bnxt/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_hwrm.c @@ -862,8 +862,20 @@ uint16_t fw_link_speed = softc->link_info.req_link_speed; if (autoneg & BNXT_AUTONEG_SPEED) { - req->auto_mode |= - HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS; + uint8_t phy_type = get_phy_type(softc); + + if (phy_type == HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASET || + phy_type == HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET || + phy_type == HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE) { + + req->auto_mode |= htole32(HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK); + if (link_info->advertising) { + req->enables |= htole32(HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK); + req->auto_link_speed_mask = htole16(link_info->advertising); + } + } else { + req->auto_mode |= HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS; + } req->enables |= htole32(HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE); diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -219,7 +219,6 @@ static void bnxt_def_cp_task(void *context); static void bnxt_handle_async_event(struct bnxt_softc *softc, struct cmpl_base *cmpl); -static uint8_t get_phy_type(struct bnxt_softc *softc); static uint64_t bnxt_get_baudrate(struct bnxt_link_info *link); static void bnxt_get_wol_settings(struct bnxt_softc *softc); static int bnxt_wol_config(if_ctx_t ctx); @@ -2144,7 +2143,6 @@ HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB; break; case IFM_1000_KX: - case IFM_1000_T: case IFM_1000_SGMII: case IFM_1000_CX: case IFM_1000_SX: @@ -2163,7 +2161,6 @@ case IFM_10G_KR: case IFM_10G_LR: case IFM_10G_SR: - case IFM_10G_T: softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; softc->link_info.req_link_speed = HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB; @@ -2240,6 +2237,14 @@ softc->link_info.req_signal_mode = HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_PAM4; break; + case IFM_1000_T: + softc->link_info.advertising = HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB; + softc->link_info.autoneg |= BNXT_AUTONEG_SPEED; + break; + case IFM_10G_T: + softc->link_info.advertising = HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB; + softc->link_info.autoneg |= BNXT_AUTONEG_SPEED; + break; default: device_printf(softc->dev, "Unsupported media type! Using auto\n");