linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 1/5] mac80211:  Make STA disconnect messages warn instead of debug.
@ 2011-02-06 20:11 greearb
  2011-02-06 20:11 ` [RFC 2/5] ath9k: Print channel-type in chan-change dbg message greearb
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: greearb @ 2011-02-06 20:11 UTC (permalink / raw)
  To: linux-wireless; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

This makes them more easily seen in /var/log/messages
and the console, for instance.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 f77adf1... 340bef6... M	net/mac80211/mlme.c
 net/mac80211/mlme.c |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index f77adf1..340bef6 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2019,10 +2019,10 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
 				ieee80211_mgd_probe_ap_send(sdata);
 			} else {
 #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
-				wiphy_debug(local->hw.wiphy,
-					    "%s: No ack for nullfunc frame to"
-					    " AP %pM, disconnecting.\n",
-					    sdata->name, bssid);
+				wiphy_warn(local->hw.wiphy,
+					   "%s: No ack for nullfunc frame to"
+					   " AP %pM, disconnecting.\n",
+					   sdata->name, bssid);
 #endif
 				ieee80211_sta_connection_lost(sdata, bssid);
 			}
@@ -2030,11 +2030,11 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
 			run_again(ifmgd, ifmgd->probe_timeout);
 		else if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) {
 #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
-			wiphy_debug(local->hw.wiphy,
-				    "%s: Failed to send nullfunc to AP %pM"
-				    " after %dms, disconnecting.\n",
-				    sdata->name,
-				    bssid, probe_wait_ms);
+			wiphy_warn(local->hw.wiphy,
+				   "%s: Failed to send nullfunc to AP %pM"
+				   " after %dms, disconnecting.\n",
+				   sdata->name,
+				   bssid, probe_wait_ms);
 #endif
 			ieee80211_sta_connection_lost(sdata, bssid);
 		} else if (ifmgd->probe_send_count < max_tries) {
@@ -2052,11 +2052,11 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
 			 * We actually lost the connection ... or did we?
 			 * Let's make sure!
 			 */
-			wiphy_debug(local->hw.wiphy,
-				    "%s: No probe response from AP %pM"
-				    " after %dms, disconnecting.\n",
-				    sdata->name,
-				    bssid, probe_wait_ms);
+			wiphy_warn(local->hw.wiphy,
+				   "%s: No probe response from AP %pM"
+				   " after %dms, disconnecting.\n",
+				   sdata->name,
+				   bssid, probe_wait_ms);
 
 			ieee80211_sta_connection_lost(sdata, bssid);
 		}
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [RFC 2/5] ath9k:  Print channel-type in chan-change dbg message.
  2011-02-06 20:11 [RFC 1/5] mac80211: Make STA disconnect messages warn instead of debug greearb
@ 2011-02-06 20:11 ` greearb
  2011-02-06 20:11 ` [RFC 3/5] mac80211: Properly set work-item channel-type greearb
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: greearb @ 2011-02-06 20:11 UTC (permalink / raw)
  To: linux-wireless; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 70bb871... 1447887... M	drivers/net/wireless/ath/ath9k/main.c
 drivers/net/wireless/ath/ath9k/main.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 70bb871..1447887 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1677,8 +1677,9 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
 		else
 			sc->sc_flags &= ~SC_OP_OFFCHANNEL;
 
-		ath_dbg(common, ATH_DBG_CONFIG, "Set channel: %d MHz\n",
-			curchan->center_freq);
+		ath_dbg(common, ATH_DBG_CONFIG,
+			"Set channel: %d MHz type: %d\n",
+			curchan->center_freq, conf->channel_type);
 
 		ath9k_cmn_update_ichannel(&sc->sc_ah->channels[pos],
 					  curchan, conf->channel_type);
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [RFC 3/5] mac80211:  Properly set work-item channel-type.
  2011-02-06 20:11 [RFC 1/5] mac80211: Make STA disconnect messages warn instead of debug greearb
  2011-02-06 20:11 ` [RFC 2/5] ath9k: Print channel-type in chan-change dbg message greearb
@ 2011-02-06 20:11 ` greearb
  2011-02-06 20:11 ` [RFC 4/5] mac80211: Allow scanning on existing channel-type greearb
  2011-02-06 20:11 ` [RFC 5/5] mac80211: Allow work items to use existing channel type greearb
  3 siblings, 0 replies; 5+ messages in thread
From: greearb @ 2011-02-06 20:11 UTC (permalink / raw)
  To: linux-wireless; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

Some were indirectly set to NO_HT (zero), but I think
it's better to explicitly set it in case the enum ever
changes.  In cfg.c, it seems the channel-type was just
ignored (and thus always set to NO_HT).

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 a7cd6a1... 9938f7f... M	net/mac80211/cfg.c
:100644 100644 340bef6... cd68f2a... M	net/mac80211/mlme.c
 net/mac80211/cfg.c  |    1 +
 net/mac80211/mlme.c |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index a7cd6a1..9938f7f 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1871,6 +1871,7 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct net_device *dev,
 
 	wk->type = IEEE80211_WORK_OFFCHANNEL_TX;
 	wk->chan = chan;
+	wk->chan_type = channel_type;
 	wk->sdata = sdata;
 	wk->done = ieee80211_offchan_tx_done;
 	wk->offchan_tx.frame = skb;
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 340bef6..cd68f2a 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2294,6 +2294,7 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
 	else
 		wk->type = IEEE80211_WORK_DIRECT_PROBE;
 	wk->chan = req->bss->channel;
+	wk->chan_type = NL80211_CHAN_NO_HT;
 	wk->sdata = sdata;
 	wk->done = ieee80211_probe_auth_done;
 
@@ -2443,6 +2444,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
 		memcpy(wk->assoc.prev_bssid, req->prev_bssid, ETH_ALEN);
 
 	wk->chan = req->bss->channel;
+	wk->chan_type = NL80211_CHAN_NO_HT;
 	wk->sdata = sdata;
 	wk->done = ieee80211_assoc_done;
 	if (!bss->dtim_period &&
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [RFC 4/5] mac80211:  Allow scanning on existing channel-type.
  2011-02-06 20:11 [RFC 1/5] mac80211: Make STA disconnect messages warn instead of debug greearb
  2011-02-06 20:11 ` [RFC 2/5] ath9k: Print channel-type in chan-change dbg message greearb
  2011-02-06 20:11 ` [RFC 3/5] mac80211: Properly set work-item channel-type greearb
@ 2011-02-06 20:11 ` greearb
  2011-02-06 20:11 ` [RFC 5/5] mac80211: Allow work items to use existing channel type greearb
  3 siblings, 0 replies; 5+ messages in thread
From: greearb @ 2011-02-06 20:11 UTC (permalink / raw)
  To: linux-wireless; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

Previous code set the channel type to NO_HT, but it
appears that NO_HT packets can be sent on any channel
type, so we do not need to change the channel type
as long as the channel is correct.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 c155c0b... 86562ce... M	net/mac80211/main.c
:100644 100644 93da164... 1f277c9... M	net/mac80211/scan.c
 net/mac80211/main.c |   16 ++++++++++++++--
 net/mac80211/scan.c |    6 ++----
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index c155c0b..86562ce 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -112,7 +112,13 @@ bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local)
 	/* This logic needs to match logic in ieee80211_hw_config */
 	if (local->scan_channel) {
 		chan = local->scan_channel;
-		channel_type = NL80211_CHAN_NO_HT;
+		/* If scanning on oper channel, use whatever channel-type
+		 * is currently in use.
+		 */
+		if (chan == local->oper_channel)
+			channel_type = local->_oper_channel_type;
+		else
+			channel_type = NL80211_CHAN_NO_HT;
 	} else if (local->tmp_channel) {
 		chan = scan_chan = local->tmp_channel;
 		channel_type = local->tmp_channel_type;
@@ -151,7 +157,13 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
 	offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL;
 	if (scan_chan) {
 		chan = scan_chan;
-		channel_type = NL80211_CHAN_NO_HT;
+		/* If scanning on oper channel, use whatever channel-type
+		 * is currently in use.
+		 */
+		if (chan == local->oper_channel)
+			channel_type = local->_oper_channel_type;
+		else
+			channel_type = NL80211_CHAN_NO_HT;
 	} else if (local->tmp_channel) {
 		chan = scan_chan = local->tmp_channel;
 		channel_type = local->tmp_channel_type;
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 93da164..1f277c9 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -574,8 +574,7 @@ static void ieee80211_scan_state_decision(struct ieee80211_local *local,
 
 	if (ieee80211_cfg_on_oper_channel(local)) {
 		/* We're currently on operating channel. */
-		if ((next_chan == local->oper_channel) &&
-		    (local->_oper_channel_type == NL80211_CHAN_NO_HT))
+		if (next_chan == local->oper_channel)
 			/* We don't need to move off of operating channel. */
 			local->next_scan_state = SCAN_SET_CHANNEL;
 		else
@@ -677,8 +676,7 @@ static void ieee80211_scan_state_set_channel(struct ieee80211_local *local,
 	local->scan_channel = chan;
 
 	/* Only call hw-config if we really need to change channels. */
-	if ((chan != local->hw.conf.channel) ||
-	    (local->hw.conf.channel_type != NL80211_CHAN_NO_HT))
+	if (chan != local->hw.conf.channel)
 		if (ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL))
 			skip = 1;
 
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [RFC 5/5] mac80211:  Allow work items to use existing channel type.
  2011-02-06 20:11 [RFC 1/5] mac80211: Make STA disconnect messages warn instead of debug greearb
                   ` (2 preceding siblings ...)
  2011-02-06 20:11 ` [RFC 4/5] mac80211: Allow scanning on existing channel-type greearb
@ 2011-02-06 20:11 ` greearb
  3 siblings, 0 replies; 5+ messages in thread
From: greearb @ 2011-02-06 20:11 UTC (permalink / raw)
  To: linux-wireless; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

Narrow channel types can function within larger channel types.
So, use existing channel type for work items when possible.
This decreases hardware channel changes significantly when
using non NO_HT channel types on the operating channel.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 6bf787a... 64f2b28... M	net/mac80211/work.c
 net/mac80211/work.c |   53 ++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 50 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index 6bf787a..64f2b28 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -874,6 +874,44 @@ static void ieee80211_work_rx_queued_mgmt(struct ieee80211_local *local,
 	kfree_skb(skb);
 }
 
+static bool ieee80211_work_ct_coexists(enum nl80211_channel_type wk_ct,
+				       enum nl80211_channel_type oper_ct)
+{
+	switch (wk_ct) {
+	case NL80211_CHAN_NO_HT:
+		return true;
+	case NL80211_CHAN_HT20:
+		if (oper_ct != NL80211_CHAN_NO_HT)
+			return true;
+		return false;
+	case NL80211_CHAN_HT40MINUS:
+	case NL80211_CHAN_HT40PLUS:
+		return (wk_ct == oper_ct);
+	}
+	WARN_ON(1); /* shouldn't get here */
+	return false;
+}
+
+static enum nl80211_channel_type
+ieee80211_calc_ct(enum nl80211_channel_type wk_ct,
+		  enum nl80211_channel_type oper_ct)
+{
+	switch (wk_ct) {
+	case NL80211_CHAN_NO_HT:
+		return oper_ct;
+	case NL80211_CHAN_HT20:
+		if (oper_ct != NL80211_CHAN_NO_HT)
+			return oper_ct;
+		return wk_ct;
+	case NL80211_CHAN_HT40MINUS:
+	case NL80211_CHAN_HT40PLUS:
+		return wk_ct;
+	}
+	WARN_ON(1); /* shouldn't get here */
+	return wk_ct;
+}
+
+
 static void ieee80211_work_timer(unsigned long data)
 {
 	struct ieee80211_local *local = (void *) data;
@@ -927,14 +965,22 @@ static void ieee80211_work_work(struct work_struct *work)
 			bool on_oper_chan;
 			bool tmp_chan_changed = false;
 			bool on_oper_chan2;
+			enum nl80211_channel_type wk_ct;
 			on_oper_chan = ieee80211_cfg_on_oper_channel(local);
+
+			/* Work with existing channel type if possible. */
+			wk_ct = wk->chan_type;
+			if (wk->chan == local->hw.conf.channel)
+				wk_ct = ieee80211_calc_ct(wk->chan_type,
+						local->hw.conf.channel_type);
+
 			if (local->tmp_channel)
 				if ((local->tmp_channel != wk->chan) ||
-				    (local->tmp_channel_type != wk->chan_type))
+				    (local->tmp_channel_type != wk_ct))
 					tmp_chan_changed = true;
 
 			local->tmp_channel = wk->chan;
-			local->tmp_channel_type = wk->chan_type;
+			local->tmp_channel_type = wk_ct;
 			/*
 			 * Leave the station vifs in awake mode if they
 			 * happen to be on the same channel as
@@ -1031,7 +1077,8 @@ static void ieee80211_work_work(struct work_struct *work)
 			continue;
 		if (wk->chan != local->tmp_channel)
 			continue;
-		if (wk->chan_type != local->tmp_channel_type)
+		if (ieee80211_work_ct_coexists(wk->chan_type,
+					       local->tmp_channel_type))
 			continue;
 		remain_off_channel = true;
 	}
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-02-06 20:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-06 20:11 [RFC 1/5] mac80211: Make STA disconnect messages warn instead of debug greearb
2011-02-06 20:11 ` [RFC 2/5] ath9k: Print channel-type in chan-change dbg message greearb
2011-02-06 20:11 ` [RFC 3/5] mac80211: Properly set work-item channel-type greearb
2011-02-06 20:11 ` [RFC 4/5] mac80211: Allow scanning on existing channel-type greearb
2011-02-06 20:11 ` [RFC 5/5] mac80211: Allow work items to use existing channel type greearb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).