Linux wireless drivers development
 help / color / mirror / Atom feed
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH 7/9] mac80211: suppress unchanged "limiting TX power" messages
Date: Tue,  8 Dec 2015 16:04:37 +0200	[thread overview]
Message-ID: <1449583479-26658-8-git-send-email-emmanuel.grumbach@intel.com> (raw)
In-Reply-To: <1449583479-26658-1-git-send-email-emmanuel.grumbach@intel.com>

From: Johannes Berg <johannes.berg@intel.com>

When the AP is advertising limited TX power, the message can be
printed over and over again. Suppress it when the power level
isn't changing.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=106011

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/mlme.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 62c8e4f..31d5881 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1379,21 +1379,26 @@ static u32 ieee80211_handle_pwr_constr(struct ieee80211_sub_if_data *sdata,
 	 */
 	if (has_80211h_pwr &&
 	    (!has_cisco_pwr || pwr_level_80211h <= pwr_level_cisco)) {
+		new_ap_level = pwr_level_80211h;
+
+		if (sdata->ap_power_level == new_ap_level)
+			return 0;
+
 		sdata_dbg(sdata,
 			  "Limiting TX power to %d (%d - %d) dBm as advertised by %pM\n",
 			  pwr_level_80211h, chan_pwr, pwr_reduction_80211h,
 			  sdata->u.mgd.bssid);
-		new_ap_level = pwr_level_80211h;
 	} else {  /* has_cisco_pwr is always true here. */
+		new_ap_level = pwr_level_cisco;
+
+		if (sdata->ap_power_level == new_ap_level)
+			return 0;
+
 		sdata_dbg(sdata,
 			  "Limiting TX power to %d dBm as advertised by %pM\n",
 			  pwr_level_cisco, sdata->u.mgd.bssid);
-		new_ap_level = pwr_level_cisco;
 	}
 
-	if (sdata->ap_power_level == new_ap_level)
-		return 0;
-
 	sdata->ap_power_level = new_ap_level;
 	if (__ieee80211_recalc_txpower(sdata))
 		return BSS_CHANGED_TXPOWER;
-- 
2.5.0


  parent reply	other threads:[~2015-12-08 14:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 14:04 [PATCH 0/9] various mac80211 / cfg80211 patches Emmanuel Grumbach
2015-12-08 14:04 ` [PATCH 1/9] mac80211: process and save VHT MU-MIMO group frame Emmanuel Grumbach
2015-12-08 14:04 ` [PATCH 2/9] mac80211: limit the A-MSDU Tx based on peer's capabilities Emmanuel Grumbach
2015-12-08 16:02   ` Krishna Chaitanya
2015-12-08 16:31     ` Grumbach, Emmanuel
     [not found]       ` <CABPxzYKp-97mNgtZZubiQ3Ew2VjOh-hFRPRwLY5WLvac9kU32g@mail.gmail.com>
2015-12-08 16:43         ` Grumbach, Emmanuel
     [not found]           ` <CABPxzYKZ8k1HvkygEuEy4dhc4xcc2ss9Bt8jJKcQ98DWZK9pvw@mail.gmail.com>
2015-12-08 19:06             ` Grumbach, Emmanuel
     [not found]               ` <CABPxzYJ445Xb1-znpG8w_8cUbZ1OVtBCCpgY9gOTPTpcs66DAQ@mail.gmail.com>
2015-12-08 19:22                 ` Grumbach, Emmanuel
2015-12-09  7:00                   ` Krishna Chaitanya
2015-12-08 14:04 ` [PATCH 3/9] mac80211: add flag for duplication check Emmanuel Grumbach
2015-12-08 14:04 ` [PATCH 4/9] mac80211: pass aggregation window size to lower level Emmanuel Grumbach
2015-12-08 14:04 ` [PATCH 5/9] mac80211: document status.freq restrictions Emmanuel Grumbach
2015-12-08 14:04 ` [PATCH 6/9] mac80211: handle width changes from opmode notification IE in beacon Emmanuel Grumbach
2015-12-08 15:38   ` Krishna Chaitanya
2015-12-08 15:42     ` Johannes Berg
2015-12-08 15:47       ` Krishna Chaitanya
2015-12-08 15:53         ` Johannes Berg
2015-12-08 15:55           ` Krishna Chaitanya
2015-12-08 15:58             ` Johannes Berg
2015-12-08 16:03               ` Krishna Chaitanya
2015-12-08 14:04 ` Emmanuel Grumbach [this message]
2015-12-08 14:04 ` [PATCH 8/9] mac80211: run scan completed work on reconfig failure Emmanuel Grumbach
2015-12-08 14:04 ` [PATCH 9/9] mac80211: reprogram in interface order Emmanuel Grumbach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1449583479-26658-8-git-send-email-emmanuel.grumbach@intel.com \
    --to=emmanuel.grumbach@intel.com \
    --cc=johannes.berg@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox