Skip to content

Instantly share code, notes, and snippets.

@adde88
Created March 1, 2019 10:03
Show Gist options
  • Save adde88/7e014eb39b70aa3c5e95ed524ea298c9 to your computer and use it in GitHub Desktop.
Save adde88/7e014eb39b70aa3c5e95ed524ea298c9 to your computer and use it in GitHub Desktop.
Kernel patch: Ignore 802.11d TX power frames, when setting "fixed TX power"
This will force the linux kernel to ignore 802.11d frames sent by acces spoints.
This will only work when TX power is set to fixed. (iwconfig wlan0 txpower fixed)
Andreas Nilsen <adde88@gmail.com> / @adde88
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -65,7 +65,8 @@ bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata)
if (sdata->user_power_level != IEEE80211_UNSET_POWER_LEVEL)
power = min(power, sdata->user_power_level);
- if (sdata->ap_power_level != IEEE80211_UNSET_POWER_LEVEL)
+ if (sdata->ap_power_level != IEEE80211_UNSET_POWER_LEVEL &&
+ sdata->vif.bss_conf.txpower_type != NL80211_TX_POWER_FIXED)
power = min(power, sdata->ap_power_level);
if (power != sdata->vif.bss_conf.txpower) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment