mt76: connac: check band caps in mt76_connac_mcu_set_rate_txpower

Check device band capabilities before configuring single-sku

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Lorenzo Bianconi
2021-06-10 13:31:49 +02:00
committed by Felix Fietkau
parent 60f3d3adbb
commit 67ed4d902c
+13 -4
View File
@@ -1829,11 +1829,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);