Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/aq/aq_fw2x.c
| Show First 20 Lines • Show All 651 Lines • ▼ Show 20 Lines | |||||
| /* Arm autonomous thermal shutdown (1E.C478.A), cleared by any PHY reset. */ | /* Arm autonomous thermal shutdown (1E.C478.A), cleared by any PHY reset. */ | ||||
| static int | static int | ||||
| aq_fw2x_thermal_arm(struct aq_hw* hw) | aq_fw2x_thermal_arm(struct aq_hw* hw) | ||||
| { | { | ||||
| uint16_t ctrl; | uint16_t ctrl; | ||||
| int err; | int err; | ||||
| if ((hw->fw_caps & FW2X_CAP_TEMPERATURE) == 0) | |||||
| return (ENOTSUP); | |||||
| mtx_lock(&hw->fw_mtx); | mtx_lock(&hw->fw_mtx); | ||||
| aq_fw2x_phy_id_probe(hw); | aq_fw2x_phy_id_probe(hw); | ||||
| err = aq_fw2x_phy_read(hw, AQ_PHY_MMD_GLOBAL, AQ_PHY_THERMAL_CTRL_REG, | err = aq_fw2x_phy_read(hw, AQ_PHY_MMD_GLOBAL, AQ_PHY_THERMAL_CTRL_REG, | ||||
| &ctrl); | &ctrl); | ||||
| if (err == 0 && ctrl == 0xffff) | if (err == 0 && ctrl == 0xffff) | ||||
| err = ENXIO; | err = ENXIO; | ||||
| if (err == 0 && (ctrl & AQ_PHY_THERMAL_SD_EN) == 0) | if (err == 0 && (ctrl & AQ_PHY_THERMAL_SD_EN) == 0) | ||||
| err = aq_fw2x_phy_write(hw, AQ_PHY_MMD_GLOBAL, | err = aq_fw2x_phy_write(hw, AQ_PHY_MMD_GLOBAL, | ||||
| ▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines | |||||