]> git.baikalelectronics.ru Git - kernel.git/commit
mac80211: Fix setting txpower to zero
authorBen Greear <greearb@candelatech.com>
Tue, 17 Dec 2019 18:30:57 +0000 (10:30 -0800)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 14 Feb 2020 08:57:00 +0000 (09:57 +0100)
commit75752cc0a8a674e9962d07b62184dad4fd557826
tree2c02017022b57c79419de37ea08522f32474008c
parente9e8887fa718d108c31e78569bc94d2e86d6d1a2
mac80211: Fix setting txpower to zero

With multiple VIFS ath10k, and probably others, tries to find the
minimum txpower for all vifs and uses that when setting txpower in
the firmware.

If a second vif is added and starts to scan, it's txpower is not
initialized yet and it set to zero.

ath10k had a patch to ignore zero values, but then it is impossible
to actually set txpower to zero.

So, instead initialize the txpower to INT_MIN in mac80211, and let
drivers know that means the power has not been set and so should
be ignored.

This should fix regression in:

commit 333ca4a35e1bf77880d00e93ab7b28de800c1a7f
Author: Ryan Hsu <ryanhsu@qca.qualcomm.com>
Date:   Tue Dec 13 14:55:19 2016 -0800

    ath10k: fix incorrect txpower set by P2P_DEVICE interface

Tested on ath10k 9984 with ath10k-ct firmware.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Link: https://lore.kernel.org/r/20191217183057.24586-1-greearb@candelatech.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/ath/ath10k/mac.c
drivers/net/wireless/ath/ath9k/main.c
drivers/net/wireless/ath/ath9k/xmit.c
include/net/mac80211.h
net/mac80211/iface.c
net/mac80211/main.c