Skip to content

Commit 64b22ee

Browse files
RyanHsugregkh
authored andcommitted
ath10k: fix incorrect txpower set by P2P_DEVICE interface
[ Upstream commit 88407beb1b1462f706a1950a355fd086e1c450b6 ] Ath10k reports the phy capability that supports P2P_DEVICE interface. When we use the P2P supported wpa_supplicant to start connection, it'll create two interfaces, one is wlan0 (vdev_id=0) and one is P2P_DEVICE p2p-dev-wlan0 which is for p2p control channel (vdev_id=1). ath10k_pci mac vdev create 0 (add interface) type 2 subtype 0 ath10k_add_interface: vdev_id: 0, txpower: 0, bss_power: 0 ... ath10k_pci mac vdev create 1 (add interface) type 2 subtype 1 ath10k_add_interface: vdev_id: 1, txpower: 0, bss_power: 0 And the txpower in per vif bss_conf will only be set to valid tx power when the interface is assigned with channel_ctx. But this P2P_DEVICE interface will never be used for any connection, so that the uninitialized bss_conf.txpower=0 is assinged to the arvif->txpower when interface created. Since the txpower configuration is firmware per physical interface. So the smallest txpower of all vifs will be the one limit the tx power of the physical device, that causing the low txpower issue on other active interfaces. wlan0: Limiting TX power to 21 (24 - 3) dBm ath10k_pci mac vdev_id 0 txpower 21 ath10k_mac_txpower_recalc: vdev_id: 1, txpower: 0 ath10k_mac_txpower_recalc: vdev_id: 0, txpower: 21 ath10k_pci mac txpower 0 This issue only happens when we use the wpa_supplicant that supports P2P or if we use the iw tool to create the control P2P_DEVICE interface. Signed-off-by: Ryan Hsu <ryanhsu@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c4cf731 commit 64b22ee

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • drivers/net/wireless/ath/ath10k

drivers/net/wireless/ath/ath10k/mac.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4180,16 +4180,17 @@ static int ath10k_mac_txpower_recalc(struct ath10k *ar)
41804180
lockdep_assert_held(&ar->conf_mutex);
41814181

41824182
list_for_each_entry(arvif, &ar->arvifs, list) {
4183-
WARN_ON(arvif->txpower < 0);
4183+
if (arvif->txpower <= 0)
4184+
continue;
41844185

41854186
if (txpower == -1)
41864187
txpower = arvif->txpower;
41874188
else
41884189
txpower = min(txpower, arvif->txpower);
41894190
}
41904191

4191-
if (WARN_ON(txpower == -1))
4192-
return -EINVAL;
4192+
if (txpower == -1)
4193+
return 0;
41934194

41944195
ret = ath10k_mac_txpower_setup(ar, txpower);
41954196
if (ret) {

0 commit comments

Comments
 (0)