Commit 1f9dde02 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

mt76: connac: check band caps in mt76_connac_mcu_set_rate_txpower

Check device band capabilities before configuring single-sku
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 90052b84
......@@ -1809,11 +1809,20 @@ int mt76_connac_mcu_set_rate_txpower(struct mt76_phy *phy)
{
int err;
err = mt76_connac_mcu_rate_txpower_band(phy, NL80211_BAND_2GHZ);
if (err < 0)
return err;
if (phy->cap.has_2ghz) {
err = mt76_connac_mcu_rate_txpower_band(phy,
NL80211_BAND_2GHZ);
if (err < 0)
return err;
}
if (phy->cap.has_5ghz) {
err = mt76_connac_mcu_rate_txpower_band(phy,
NL80211_BAND_5GHZ);
if (err < 0)
return err;
}
return mt76_connac_mcu_rate_txpower_band(phy, NL80211_BAND_5GHZ);
return 0;
}
EXPORT_SYMBOL_GPL(mt76_connac_mcu_set_rate_txpower);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment