diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2021-06-05 14:50:52 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2021-06-19 10:22:49 +0300 |
commit | 1f9dde02aab74a32e896ef10e15d72c39e54bb14 (patch) | |
tree | 3531691d5417e6fddc2171679243b2d51ec3ae48 | |
parent | 90052b844d7a6db8649239434b262d28b1430cf4 (diff) | |
download | linux-1f9dde02aab74a32e896ef10e15d72c39e54bb14.tar.xz |
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 <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c index d7d7cede955b..78498d86efc3 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c @@ -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); |