Skip to contentSkip to conversation

wifi: b43: apply the TX power limit set on the interface

PATCH New Rosen Penev 1 participant 1 message Oct 23 B43 wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: b43: apply the TX power limit set on the interface

A TX power limit set with "iw dev <dev> set txpower" never reaches the hardware. mac80211 keeps such a limit per interface and only passes it to the driver as BSS_CHANGED_TXPOWER. The power level of the hardware configuration, which b43_op_config() turns into the desired TX power, is only recalculated for a limit set on the whole wiphy, or when the channel changes.

Take the TX power of the interface on BSS_CHANGED_TXPOWER as the desired TX power, and recheck the TX power right away, as b43_op_config() does.

Fixes 1ea6f9c0d48b ("mac80211: handle TX power per virtual interface")
---
 drivers/net/wireless/broadcom/b43/main.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/net/wireless/broadcom/b43/main.c +11 -0
index 3825b6ad9f4f..01e3e80b43a5 100644
@@ -4161,6 +4161,17 @@ static void b43_op_bss_info_changed(struct ieee80211_hw *hw,
 	}
 
 	b43_mac_enable(dev);
+
+	/*
+	 * mac80211 passes a TX power limit set on the interface only here,
+	 * not in the power level of the hardware configuration.
+	 */
+	if (changed & BSS_CHANGED_TXPOWER && conf->txpower > 0 &&
+	    conf->txpower != dev->phy.desired_txpower) {
+		dev->phy.desired_txpower = conf->txpower;
+		b43_phy_txpower_check(dev, B43_TXPWR_IGNORE_TIME |
+					   B43_TXPWR_IGNORE_TSSI);
+	}
 out_unlock_mutex:
 	mutex_unlock(&wl->mutex);
 }
Signature · 1 line
2.56.0