Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: [PATCH 8/8] ath5k: Remove redundant sc->curband
From: Bob Copeland @ 2011-01-19 11:19 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless
In-Reply-To: <20110119092113.19628.33322.stgit@localhost6.localdomain6>

On Wed, Jan 19, 2011 at 4:21 AM, Bruno Randolf <br1@einfach.org> wrote:
> Remove sc->curband because the band is already stored in the current channel.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>

Nice cleanup series!

Acked-by: Bob Copeland <me@bobcopeland.com>

-- 
Bob Copeland %% www.bobcopeland.com

^ permalink raw reply

* Re: [PATCH 2/8] ath5k: Simplify loop when setting up channels
From: Bruno Randolf @ 2011-01-19 11:51 UTC (permalink / raw)
  To: Bob Copeland; +Cc: linville, linux-wireless
In-Reply-To: <AANLkTinNaMK_QUDVRxQ32XtKiQXmyDeuHGoCv2rWnW=e@mail.gmail.com>

On Wed January 19 2011 20:07:28 you wrote:
> On Wed, Jan 19, 2011 at 4:20 AM, Bruno Randolf <br1@einfach.org> wrote:
> > Simplify confusing code and get rid of an unnecessary variable.
> > 
> > Signed-off-by: Bruno Randolf <br1@einfach.org>
> > 
> > 
> > @@ -285,8 +285,8 @@ ath5k_copy_channels(struct ath5k_hw *ah,
> >                return 0;
> >        }
> > 
> > -       for (i = 0, count = 0; i < size && max > 0; i++) {
> > -               ch = i + 1 ;
> > +       count = 0;
> > +       for (ch = 1; ch < size && count <= max; ch++) {
> 
> Should be <= size now, right?  And maybe rename size to max_channel
> or something like that.

Oh, yeah. Will fix.

bruno

^ permalink raw reply

* [PATCH] mac80211: use DECLARE_EVENT_CLASS
From: Johannes Berg @ 2011-01-19 11:50 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless@vger.kernel.org

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

For events that include only the local struct as
their parameter, we can use DECLARE_EVENT_CLASS
and save quite some binary size across segments
as well lines of code.

   text	   data	    bss	    dec	    hex	filename
 375745	  19296	    916	 395957	  60ab5	mac80211.ko.before
 367473	  17888	    916	 386277	  5e4e5	mac80211.ko.after
  -8272   -1408       0   -9680   -25d0 delta

Some more tracepoints with identical arguments
could be combined like this but for now this is
the one that benefits most.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/driver-trace.h |  197 ++++++--------------------------------------
 1 file changed, 28 insertions(+), 169 deletions(-)

--- wireless-testing.orig/net/mac80211/driver-trace.h	2011-01-19 12:46:39.000000000 +0100
+++ wireless-testing/net/mac80211/driver-trace.h	2011-01-19 12:47:23.000000000 +0100
@@ -38,7 +38,7 @@ static inline void trace_ ## name(proto)
  * Tracing for driver callbacks.
  */
 
-TRACE_EVENT(drv_return_void,
+DECLARE_EVENT_CLASS(local_only_evt,
 	TP_PROTO(struct ieee80211_local *local),
 	TP_ARGS(local),
 	TP_STRUCT__entry(
@@ -50,6 +50,11 @@ TRACE_EVENT(drv_return_void,
 	TP_printk(LOCAL_PR_FMT, LOCAL_PR_ARG)
 );
 
+DEFINE_EVENT(local_only_evt, drv_return_void,
+	TP_PROTO(struct ieee80211_local *local),
+	TP_ARGS(local)
+);
+
 TRACE_EVENT(drv_return_int,
 	TP_PROTO(struct ieee80211_local *local, int ret),
 	TP_ARGS(local, ret),
@@ -78,40 +83,14 @@ TRACE_EVENT(drv_return_u64,
 	TP_printk(LOCAL_PR_FMT " - %llu", LOCAL_PR_ARG, __entry->ret)
 );
 
-TRACE_EVENT(drv_start,
+DEFINE_EVENT(local_only_evt, drv_start,
 	TP_PROTO(struct ieee80211_local *local),
-
-	TP_ARGS(local),
-
-	TP_STRUCT__entry(
-		LOCAL_ENTRY
-	),
-
-	TP_fast_assign(
-		LOCAL_ASSIGN;
-	),
-
-	TP_printk(
-		LOCAL_PR_FMT, LOCAL_PR_ARG
-	)
+	TP_ARGS(local)
 );
 
-TRACE_EVENT(drv_stop,
+DEFINE_EVENT(local_only_evt, drv_stop,
 	TP_PROTO(struct ieee80211_local *local),
-
-	TP_ARGS(local),
-
-	TP_STRUCT__entry(
-		LOCAL_ENTRY
-	),
-
-	TP_fast_assign(
-		LOCAL_ASSIGN;
-	),
-
-	TP_printk(
-		LOCAL_PR_FMT, LOCAL_PR_ARG
-	)
+	TP_ARGS(local)
 );
 
 TRACE_EVENT(drv_add_interface,
@@ -439,40 +418,14 @@ TRACE_EVENT(drv_hw_scan,
 	)
 );
 
-TRACE_EVENT(drv_sw_scan_start,
+DEFINE_EVENT(local_only_evt, drv_sw_scan_start,
 	TP_PROTO(struct ieee80211_local *local),
-
-	TP_ARGS(local),
-
-	TP_STRUCT__entry(
-		LOCAL_ENTRY
-	),
-
-	TP_fast_assign(
-		LOCAL_ASSIGN;
-	),
-
-	TP_printk(
-		LOCAL_PR_FMT, LOCAL_PR_ARG
-	)
+	TP_ARGS(local)
 );
 
-TRACE_EVENT(drv_sw_scan_complete,
+DEFINE_EVENT(local_only_evt, drv_sw_scan_complete,
 	TP_PROTO(struct ieee80211_local *local),
-
-	TP_ARGS(local),
-
-	TP_STRUCT__entry(
-		LOCAL_ENTRY
-	),
-
-	TP_fast_assign(
-		LOCAL_ASSIGN;
-	),
-
-	TP_printk(
-		LOCAL_PR_FMT, LOCAL_PR_ARG
-	)
+	TP_ARGS(local)
 );
 
 TRACE_EVENT(drv_get_stats,
@@ -702,23 +655,9 @@ TRACE_EVENT(drv_conf_tx,
 	)
 );
 
-TRACE_EVENT(drv_get_tsf,
+DEFINE_EVENT(local_only_evt, drv_get_tsf,
 	TP_PROTO(struct ieee80211_local *local),
-
-	TP_ARGS(local),
-
-	TP_STRUCT__entry(
-		LOCAL_ENTRY
-	),
-
-	TP_fast_assign(
-		LOCAL_ASSIGN;
-	),
-
-	TP_printk(
-		LOCAL_PR_FMT,
-		LOCAL_PR_ARG
-	)
+	TP_ARGS(local)
 );
 
 TRACE_EVENT(drv_set_tsf,
@@ -742,41 +681,14 @@ TRACE_EVENT(drv_set_tsf,
 	)
 );
 
-TRACE_EVENT(drv_reset_tsf,
+DEFINE_EVENT(local_only_evt, drv_reset_tsf,
 	TP_PROTO(struct ieee80211_local *local),
-
-	TP_ARGS(local),
-
-	TP_STRUCT__entry(
-		LOCAL_ENTRY
-	),
-
-	TP_fast_assign(
-		LOCAL_ASSIGN;
-	),
-
-	TP_printk(
-		LOCAL_PR_FMT, LOCAL_PR_ARG
-	)
+	TP_ARGS(local)
 );
 
-TRACE_EVENT(drv_tx_last_beacon,
+DEFINE_EVENT(local_only_evt, drv_tx_last_beacon,
 	TP_PROTO(struct ieee80211_local *local),
-
-	TP_ARGS(local),
-
-	TP_STRUCT__entry(
-		LOCAL_ENTRY
-	),
-
-	TP_fast_assign(
-		LOCAL_ASSIGN;
-	),
-
-	TP_printk(
-		LOCAL_PR_FMT,
-		LOCAL_PR_ARG
-	)
+	TP_ARGS(local)
 );
 
 TRACE_EVENT(drv_ampdu_action,
@@ -962,22 +874,9 @@ TRACE_EVENT(drv_remain_on_channel,
 	)
 );
 
-TRACE_EVENT(drv_cancel_remain_on_channel,
+DEFINE_EVENT(local_only_evt, drv_cancel_remain_on_channel,
 	TP_PROTO(struct ieee80211_local *local),
-
-	TP_ARGS(local),
-
-	TP_STRUCT__entry(
-		LOCAL_ENTRY
-	),
-
-	TP_fast_assign(
-		LOCAL_ASSIGN;
-	),
-
-	TP_printk(
-		LOCAL_PR_FMT, LOCAL_PR_ARG
-	)
+	TP_ARGS(local)
 );
 
 /*
@@ -1072,23 +971,9 @@ TRACE_EVENT(api_stop_tx_ba_cb,
 	)
 );
 
-TRACE_EVENT(api_restart_hw,
+DEFINE_EVENT(local_only_evt, api_restart_hw,
 	TP_PROTO(struct ieee80211_local *local),
-
-	TP_ARGS(local),
-
-	TP_STRUCT__entry(
-		LOCAL_ENTRY
-	),
-
-	TP_fast_assign(
-		LOCAL_ASSIGN;
-	),
-
-	TP_printk(
-		LOCAL_PR_FMT,
-		LOCAL_PR_ARG
-	)
+	TP_ARGS(local)
 );
 
 TRACE_EVENT(api_beacon_loss,
@@ -1217,40 +1102,14 @@ TRACE_EVENT(api_chswitch_done,
 	)
 );
 
-TRACE_EVENT(api_ready_on_channel,
+DEFINE_EVENT(local_only_evt, api_ready_on_channel,
 	TP_PROTO(struct ieee80211_local *local),
-
-	TP_ARGS(local),
-
-	TP_STRUCT__entry(
-		LOCAL_ENTRY
-	),
-
-	TP_fast_assign(
-		LOCAL_ASSIGN;
-	),
-
-	TP_printk(
-		LOCAL_PR_FMT, LOCAL_PR_ARG
-	)
+	TP_ARGS(local)
 );
 
-TRACE_EVENT(api_remain_on_channel_expired,
+DEFINE_EVENT(local_only_evt, api_remain_on_channel_expired,
 	TP_PROTO(struct ieee80211_local *local),
-
-	TP_ARGS(local),
-
-	TP_STRUCT__entry(
-		LOCAL_ENTRY
-	),
-
-	TP_fast_assign(
-		LOCAL_ASSIGN;
-	),
-
-	TP_printk(
-		LOCAL_PR_FMT, LOCAL_PR_ARG
-	)
+	TP_ARGS(local)
 );
 
 /*



^ permalink raw reply

* Re: [PATCH 5/8] ath5k: Add 802.11j 4.9GHz channels to allowed channels
From: Bruno Randolf @ 2011-01-19 11:52 UTC (permalink / raw)
  To: Bob Copeland; +Cc: linville, linux-wireless
In-Reply-To: <AANLkTi=2crGZhucAhNHU-iaOkRamg33tQo_-K5h9d64v@mail.gmail.com>

On Wed January 19 2011 20:14:41 Bob Copeland wrote:
> On Wed, Jan 19, 2011 at 4:20 AM, Bruno Randolf <br1@einfach.org> wrote:
> > Add the 802.11j (20MHz channel width) channels to the allowed channels.
> > This still does not enable 802.11j in ath5k since these frequencies are
> > out of the configured range. A later patch will deal with that.
> > 
> > Signed-off-by: Bruno Randolf <br1@einfach.org>
> > ---
> > 
> > -static bool ath5k_is_standard_channel(short chan)
> > +static bool ath5k_is_standard_channel(short chan, enum ieee80211_band
> > band) {
> > -       return ((chan <= 14) ||
> > -               /* UNII 1,2 */
> > -               ((chan & 3) == 0 && chan >= 36 && chan <= 64) ||
> > +       if (band == IEEE80211_BAND_2GHZ && chan <= 14)
> > +               return true;
> 
> This routine is only used to post-filter the channels so I don't
> think we need to check the band.  It's mostly just to weed out all
> of the 10 mhz-spaced 5 ghz channels we used to export.
> 
> > -               ((chan & 3) == 1 && chan >= 149 && chan <= 165));
> > +               ((chan & 3) == 1 && chan >= 149 && chan <= 165) ||
> > +               /* 802.11j 5.030-5.080 GHz (20MHz) */
> > +               (chan == 8 || chan == 12 || chan == 16) ||
> 
> Ok I was also going to complain that some channel numbers < 14 were
> valid in the 5 ghz band but you know that :)

That's also the reason why we need to know the band:

in 2GHz all channels < 14 are allowed.
in 5GHz only a few.

Thanks for your review!

bruno

^ permalink raw reply

* [RFC] mac80211: support for IEEE80211N in IBSS
From: Alexander Simon @ 2011-01-19 13:38 UTC (permalink / raw)
  To: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1482 bytes --]

Hey list,

finally i got my (in ath9ks list announced) patch for HT rates in ad-hoc 
networks ready that has been requested quite often.
I took the initial patches from Benoît Papillault and worked on them.
Benoît already implemented setting the HT mode with iw, building and 
receiving IEs.

I added processing of the IEs when a new station joins the network into the 
internal station capabilities (struct sta_cap). This is necessary for eg. the 
rate algo to choose HT rates.

I had to change packet aggretation code to also work in ADHOC iftype.

As already said, the interface mode is set with iw. That mode will also be 
advertised in the IEs, the additional HT capabilities are taken from the 
interface capabilities. So there is no option to disable single capabilities 
as in hostapd yet.

If a station is added through main receive path (ie. a third station sending 
data to another station), HT is not threat yet. So there may be a initial 
delay of maximum 100ms (beacon interval) running in legacy. It would 
require disproportionally much work to implement this.

I tested this with with ath9k and iwlagn cards. Note that for ath9k i worked 
with minstrel_ht.

You will also need Benoît's patch for iw to set HT mode.
http://ns3.spinics.net/lists/linux-wireless/msg50200.html
You would then be able to setup an IBSS with eg.:
iw wlan0 ibss join my_ht_ibss 2412 HT40+

Alex

Signed-off-by: Alexander Simon <alexander.simon@saxnet.de>

[-- Attachment #2: enable_ieee80211_n_for_ibss.patch --]
[-- Type: text/x-patch, Size: 13725 bytes --]

diff -Nrup compat-wireless-2011-01-17.orig//include/net/cfg80211.h compat-wireless-2011-01-17/include/net/cfg80211.h
--- compat-wireless-2011-01-17.orig//include/net/cfg80211.h	2011-01-17 21:03:26.000000000 +0100
+++ compat-wireless-2011-01-17/include/net/cfg80211.h	2011-01-18 15:47:56.000000000 +0100
@@ -960,6 +960,7 @@ struct cfg80211_ibss_params {
 	u8 *ssid;
 	u8 *bssid;
 	struct ieee80211_channel *channel;
+	enum nl80211_channel_type channel_type;
 	u8 *ie;
 	u8 ssid_len, ie_len;
 	u16 beacon_interval;
diff -Nrup compat-wireless-2011-01-17.orig//net/mac80211/agg-rx.c compat-wireless-2011-01-17/net/mac80211/agg-rx.c
--- compat-wireless-2011-01-17.orig//net/mac80211/agg-rx.c	2011-01-17 21:03:25.000000000 +0100
+++ compat-wireless-2011-01-17/net/mac80211/agg-rx.c	2011-01-18 15:47:56.000000000 +0100
@@ -160,6 +160,8 @@ static void ieee80211_send_addba_resp(st
 		memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
 	else if (sdata->vif.type == NL80211_IFTYPE_STATION)
 		memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
+	else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
+		memcpy(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN);
 
 	mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
 					  IEEE80211_STYPE_ACTION);
diff -Nrup compat-wireless-2011-01-17.orig//net/mac80211/agg-tx.c compat-wireless-2011-01-17/net/mac80211/agg-tx.c
--- compat-wireless-2011-01-17.orig//net/mac80211/agg-tx.c	2011-01-17 21:03:25.000000000 +0100
+++ compat-wireless-2011-01-17/net/mac80211/agg-tx.c	2011-01-18 15:47:56.000000000 +0100
@@ -83,6 +83,8 @@ static void ieee80211_send_addba_request
 		memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
 	else if (sdata->vif.type == NL80211_IFTYPE_STATION)
 		memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
+	else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
+		memcpy(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN);
 
 	mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
 					  IEEE80211_STYPE_ACTION);
@@ -376,7 +378,8 @@ int ieee80211_start_tx_ba_session(struct
 	 */
 	if (sdata->vif.type != NL80211_IFTYPE_STATION &&
 	    sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
-	    sdata->vif.type != NL80211_IFTYPE_AP)
+	    sdata->vif.type != NL80211_IFTYPE_AP &&
+	    sdata->vif.type != NL80211_IFTYPE_ADHOC)
 		return -EINVAL;
 
 	if (test_sta_flags(sta, WLAN_STA_BLOCK_BA)) {
diff -Nrup compat-wireless-2011-01-17.orig//net/mac80211/ht.c compat-wireless-2011-01-17/net/mac80211/ht.c
--- compat-wireless-2011-01-17.orig//net/mac80211/ht.c	2011-01-17 21:03:25.000000000 +0100
+++ compat-wireless-2011-01-17/net/mac80211/ht.c	2011-01-18 15:47:56.000000000 +0100
@@ -179,6 +179,8 @@ void ieee80211_send_delba(struct ieee802
 		memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
 	else if (sdata->vif.type == NL80211_IFTYPE_STATION)
 		memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
+	else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
+		memcpy(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN);
 
 	mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
 					  IEEE80211_STYPE_ACTION);
diff -Nrup compat-wireless-2011-01-17.orig//net/mac80211/ibss.c compat-wireless-2011-01-17/net/mac80211/ibss.c
--- compat-wireless-2011-01-17.orig//net/mac80211/ibss.c	2011-01-17 21:03:25.000000000 +0100
+++ compat-wireless-2011-01-17/net/mac80211/ibss.c	2011-01-18 15:47:56.000000000 +0100
@@ -66,6 +66,7 @@ static void ieee80211_rx_mgmt_auth_ibss(
 static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
 				      const u8 *bssid, const int beacon_int,
 				      struct ieee80211_channel *chan,
+				      enum nl80211_channel_type channel_type,
 				      const u32 basic_rates,
 				      const u16 capability, u64 tsf)
 {
@@ -107,7 +108,7 @@ static void __ieee80211_sta_join_ibss(st
 	sdata->drop_unencrypted = capability & WLAN_CAPABILITY_PRIVACY ? 1 : 0;
 
 	local->oper_channel = chan;
-	WARN_ON(!ieee80211_set_channel_type(local, sdata, NL80211_CHAN_NO_HT));
+	WARN_ON(!ieee80211_set_channel_type(local, sdata, channel_type));
 	ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
 
 	sband = local->hw.wiphy->bands[chan->band];
@@ -173,6 +174,64 @@ static void __ieee80211_sta_join_ibss(st
 		memcpy(skb_put(skb, ifibss->ie_len),
 		       ifibss->ie, ifibss->ie_len);
 
+	if (channel_type != NL80211_CHAN_NO_HT && sband->ht_cap.ht_supported) {
+		u16 cap = sband->ht_cap.cap;
+		struct ieee80211_ht_cap *ht_cap;
+		struct ieee80211_ht_info *ht_info;
+
+		/* Build HT Capabilities */
+		if (ieee80211_disable_40mhz_24ghz &&
+		    sband->band == IEEE80211_BAND_2GHZ) {
+			cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
+			cap &= ~IEEE80211_HT_CAP_SGI_40;
+		}
+
+		pos = skb_put(skb, 2 + sizeof(struct ieee80211_ht_cap));
+		*pos++ = WLAN_EID_HT_CAPABILITY;
+		*pos++ = sizeof(struct ieee80211_ht_cap);
+		ht_cap = (struct ieee80211_ht_cap *)pos;
+
+		ht_cap->cap_info = cpu_to_le16(cap);
+		ht_cap->ampdu_params_info = sband->ht_cap.ampdu_factor |
+			(sband->ht_cap.ampdu_density <<
+			IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT);
+		memcpy(&ht_cap->mcs, &sband->ht_cap.mcs, sizeof(sband->ht_cap.mcs));
+		ht_cap->extended_ht_cap_info = 0x0000;
+		ht_cap->tx_BF_cap_info = 0x00000000;
+		ht_cap->antenna_selection_info = 0x00;
+
+		/* Build HT Information */
+		pos = skb_put(skb, 2 + sizeof(struct ieee80211_ht_info));
+		*pos++ = WLAN_EID_HT_INFORMATION;
+		*pos++ = sizeof(struct ieee80211_ht_info);
+		ht_info = (struct ieee80211_ht_info *)pos;
+
+		ht_info->control_chan = 
+			ieee80211_frequency_to_channel(chan->center_freq);
+		ht_info->ht_param = 0x00;
+		switch (local->_oper_channel_type) {
+			case NL80211_CHAN_HT40MINUS:
+				ht_info->ht_param |= IEEE80211_HT_PARAM_CHA_SEC_BELOW;
+				break;
+			case NL80211_CHAN_HT40PLUS:
+				ht_info->ht_param |= IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
+				break;
+			case NL80211_CHAN_HT20:
+			default:
+				ht_info->ht_param |= IEEE80211_HT_PARAM_CHA_SEC_NONE;
+				break;
+		}
+		if (sband->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40)
+			ht_info->ht_param |= IEEE80211_HT_PARAM_CHAN_WIDTH_ANY;
+		ht_info->operation_mode = 0x0000; //<-- is this correct?
+		ht_info->stbc_param = 0x0000;
+
+		/* It seems that Basic MCS set and Supported MCS set
+		   are identical for the first 10 bytes */
+		memset(&ht_info->basic_set, 0, 16);
+		memcpy(&ht_info->basic_set, &sband->ht_cap.mcs, 10);
+	}
+
 	if (local->hw.queues >= 4) {
 		pos = skb_put(skb, 9);
 		*pos++ = WLAN_EID_VENDOR_SPECIFIC;
@@ -221,6 +280,9 @@ static void ieee80211_sta_join_ibss(stru
 	u32 basic_rates;
 	int i, j;
 	u16 beacon_int = cbss->beacon_interval;
+	const u8 *ht_info_ie;
+	enum nl80211_channel_type channel_type = NL80211_CHAN_NO_HT;
+
 
 	lockdep_assert_held(&sdata->u.ibss.mtx);
 
@@ -244,9 +306,29 @@ static void ieee80211_sta_join_ibss(stru
 		}
 	}
 
+	/* parse HT Information IE, if present */
+	ht_info_ie = ieee80211_bss_get_ie(cbss, WLAN_EID_HT_INFORMATION);
+	if (ht_info_ie) {
+		const struct ieee80211_ht_info *ht_info = 
+				(const struct ieee80211_ht_info *)(ht_info_ie + 2);
+
+		switch (ht_info->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) {
+		case IEEE80211_HT_PARAM_CHA_SEC_NONE:
+			channel_type = NL80211_CHAN_HT20;
+			break;
+		case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
+			channel_type = NL80211_CHAN_HT40PLUS;
+			break;
+		case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
+			channel_type = NL80211_CHAN_HT40MINUS;
+			break;
+		}
+	}
+
 	__ieee80211_sta_join_ibss(sdata, cbss->bssid,
 				  beacon_int,
 				  cbss->channel,
+				  channel_type,
 				  basic_rates,
 				  cbss->capability,
 				  cbss->tsf);
@@ -310,7 +392,7 @@ static void ieee80211_rx_bss_info(struct
 				}
 			} else
 				sta = ieee80211_ibss_add_sta(sdata, mgmt->bssid,
-						mgmt->sa, supp_rates,
+						mgmt->sa, supp_rates, elems->ht_cap_elem,
 						GFP_ATOMIC);
 		}
 
@@ -409,7 +491,7 @@ static void ieee80211_rx_bss_info(struct
 		ieee80211_sta_join_ibss(sdata, bss);
 		supp_rates = ieee80211_sta_get_rates(local, elems, band);
 		ieee80211_ibss_add_sta(sdata, mgmt->bssid, mgmt->sa,
-				       supp_rates, GFP_KERNEL);
+				       supp_rates, elems->ht_cap_elem, GFP_KERNEL);
 	}
 
  put_bss:
@@ -422,8 +504,8 @@ static void ieee80211_rx_bss_info(struct
  * must be callable in atomic context.
  */
 struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
-					u8 *bssid,u8 *addr, u32 supp_rates,
-					gfp_t gfp)
+					u8 *bssid, u8 *addr, u32 supp_rates,
+					struct ieee80211_ht_cap *ht_cap, gfp_t gfp)
 {
 	struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
 	struct ieee80211_local *local = sdata->local;
@@ -463,6 +545,10 @@ struct sta_info *ieee80211_ibss_add_sta(
 	sta->sta.supp_rates[band] = supp_rates |
 			ieee80211_mandatory_rates(local, band);
 
+	if (ht_cap)
+		ieee80211_ht_cap_ie_to_sta_ht_cap(local->hw.wiphy->bands[band],
+				ht_cap, &sta->sta.ht_cap);
+
 	rate_control_rate_init(sta);
 
 	/* If it fails, maybe we raced another insertion? */
@@ -565,7 +651,7 @@ static void ieee80211_sta_create_ibss(st
 		sdata->drop_unencrypted = 0;
 
 	__ieee80211_sta_join_ibss(sdata, bssid, sdata->vif.bss_conf.beacon_int,
-				  ifibss->channel, ifibss->basic_rates,
+				  ifibss->channel, ifibss->channel_type, ifibss->basic_rates,
 				  capability, 0);
 }
 
@@ -901,11 +987,16 @@ int ieee80211_ibss_join(struct ieee80211
 	struct sk_buff *skb;
 
 	skb = dev_alloc_skb(sdata->local->hw.extra_tx_headroom +
-			    36 /* bitrates */ +
-			    34 /* SSID */ +
-			    3  /* DS params */ +
-			    4  /* IBSS params */ +
-			    params->ie_len);
+				sizeof(struct ieee80211_hdr_3addr) + 
+				12 /* struct ieee80211_mgmt.u.beacon */ +
+				2 + IEEE80211_MAX_SSID_LEN /* max SSID */ +
+				2 + 8 /* max Supported Rates */ +
+				3 /* max DS params */ +
+				4 /* IBSS params */ +
+				2 + (IEEE80211_MAX_SUPP_RATES - 8) /* max Ext Rates */ +
+				2 + sizeof(struct ieee80211_ht_cap) +
+				2 + sizeof(struct ieee80211_ht_info) +
+				params->ie_len);
 	if (!skb)
 		return -ENOMEM;
 
@@ -925,13 +1016,14 @@ int ieee80211_ibss_join(struct ieee80211
 	sdata->vif.bss_conf.beacon_int = params->beacon_interval;
 
 	sdata->u.ibss.channel = params->channel;
+	sdata->u.ibss.channel_type = params->channel_type;
 	sdata->u.ibss.fixed_channel = params->channel_fixed;
 
 	/* fix ourselves to that channel now already */
 	if (params->channel_fixed) {
 		sdata->local->oper_channel = params->channel;
 		WARN_ON(!ieee80211_set_channel_type(sdata->local, sdata,
-						    NL80211_CHAN_NO_HT));
+						    params->channel_type));
 	}
 
 	if (params->ie) {
diff -Nrup compat-wireless-2011-01-17.orig//net/mac80211/ieee80211_i.h compat-wireless-2011-01-17/net/mac80211/ieee80211_i.h
--- compat-wireless-2011-01-17.orig//net/mac80211/ieee80211_i.h	2011-01-17 21:03:26.000000000 +0100
+++ compat-wireless-2011-01-17/net/mac80211/ieee80211_i.h	2011-01-18 15:47:56.000000000 +0100
@@ -438,6 +438,7 @@ struct ieee80211_if_ibss {
 	u8 ssid_len, ie_len;
 	u8 *ie;
 	struct ieee80211_channel *channel;
+	enum nl80211_channel_type channel_type;
 
 	unsigned long ibss_join_req;
 	/* probe response/beacon for IBSS */
@@ -1110,7 +1111,7 @@ void ieee80211_ibss_notify_scan_complete
 void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata);
 struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
 					u8 *bssid, u8 *addr, u32 supp_rates,
-					gfp_t gfp);
+					struct ieee80211_ht_cap *ht_cap, gfp_t gfp);
 int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
 			struct cfg80211_ibss_params *params);
 int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata);
diff -Nrup compat-wireless-2011-01-17.orig//net/mac80211/rx.c compat-wireless-2011-01-17/net/mac80211/rx.c
--- compat-wireless-2011-01-17.orig//net/mac80211/rx.c	2011-01-17 21:03:26.000000000 +0100
+++ compat-wireless-2011-01-17/net/mac80211/rx.c	2011-01-18 15:47:56.000000000 +0100
@@ -2063,7 +2063,8 @@ ieee80211_rx_h_action(struct ieee80211_r
 		 */
 		if (sdata->vif.type != NL80211_IFTYPE_STATION &&
 		    sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
-		    sdata->vif.type != NL80211_IFTYPE_AP)
+		    sdata->vif.type != NL80211_IFTYPE_AP &&
+		    sdata->vif.type != NL80211_IFTYPE_ADHOC)
 			break;
 
 		/* verify action_code is present */
@@ -2618,7 +2619,7 @@ static int prepare_for_handlers(struct i
 			else
 				rate_idx = status->rate_idx;
 			rx->sta = ieee80211_ibss_add_sta(sdata, bssid,
-					hdr->addr2, BIT(rate_idx), GFP_ATOMIC);
+					hdr->addr2, BIT(rate_idx), NULL, GFP_ATOMIC);
 		}
 		break;
 	case NL80211_IFTYPE_MESH_POINT:
diff -Nrup compat-wireless-2011-01-17.orig//net/wireless/nl80211.c compat-wireless-2011-01-17/net/wireless/nl80211.c
--- compat-wireless-2011-01-17.orig//net/wireless/nl80211.c	2011-01-17 21:03:26.000000000 +0100
+++ compat-wireless-2011-01-17/net/wireless/nl80211.c	2011-01-18 15:47:56.000000000 +0100
@@ -3907,8 +3907,24 @@ static int nl80211_join_ibss(struct sk_b
 		ibss.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
 	}
 
-	ibss.channel = ieee80211_get_channel(wiphy,
-		nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]));
+	if (info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE]) {
+		enum nl80211_channel_type channel_type;
+
+		channel_type = nla_get_u32(
+			info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE]);
+		if (channel_type != NL80211_CHAN_NO_HT &&
+				channel_type != NL80211_CHAN_HT20 &&
+				channel_type != NL80211_CHAN_HT40PLUS &&
+				channel_type != NL80211_CHAN_HT40MINUS)
+			return -EINVAL;
+		ibss.channel_type = channel_type;
+	} else {
+		ibss.channel_type = NL80211_CHAN_NO_HT;
+	}
+
+	ibss.channel = rdev_freq_to_chan(rdev,
+		nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]),
+		ibss.channel_type);
 	if (!ibss.channel ||
 	    ibss.channel->flags & IEEE80211_CHAN_NO_IBSS ||
 	    ibss.channel->flags & IEEE80211_CHAN_DISABLED)

^ permalink raw reply

* [RFC] mac80211: ieee80211_ibss_add_sta called uneccessarily
From: Alexander Simon @ 2011-01-19 13:43 UTC (permalink / raw)
  To: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 873 bytes --]

Hi,

while creating a patch for IEEE802.11n with IBSS, i found that 
ieee80211_ibss_add_sta is called way to often by prepare_for_handlers in 
net/mac80211/rx.c.

In net/mac80211/rx.c we check if the IBSSs match with ieee80211_bssid_match(). 
If they dont and we are not scanning, we are leaving.
But ieee80211_bssid_match() will also return true if our BSSID is set to 
broadcast. And the interface is set to broadcast if we are scanning witch 
happens if we created an IBSS and are still "alone". So we will never return.

So i would change !ieee80211_bssid_match just into compare_ether_addr.

Well, this only affects CPU (and my printk output) as ieee80211_ibss_add_sta 
checks the BSSIDs on its own again, but we safe some needless function calls.

Hope i could give a understandable explanation of my patch

Signed-off-by: Alexander Simon <alexander.simon@saxnet.de>

[-- Attachment #2: fix_ieee80211_ibss_add_sta_call.patch --]
[-- Type: text/x-patch, Size: 656 bytes --]

diff -Nrup compat-wireless-2011-01-17.orig/net/mac80211/rx.c compat-wireless-2011-01-17/net/mac80211/rx.c
--- compat-wireless-2011-01-17.orig/net/mac80211/rx.c	2011-01-17 21:03:26.000000000 +0100
+++ compat-wireless-2011-01-17/net/mac80211/rx.c	2011-01-18 15:42:46.000000000 +0100
@@ -2601,7 +2601,7 @@ static int prepare_for_handlers(struct i
 		if (ieee80211_is_beacon(hdr->frame_control)) {
 			return 1;
 		}
-		else if (!ieee80211_bssid_match(bssid, sdata->u.ibss.bssid)) {
+		else if (compare_ether_addr(bssid, sdata->u.ibss.bssid)) {
 			if (!(status->rx_flags & IEEE80211_RX_IN_SCAN))
 				return 0;
 			status->rx_flags &= ~IEEE80211_RX_RA_MATCH;

^ permalink raw reply

* Re: [RFC] mac80211: support for IEEE80211N in IBSS
From: Johannes Berg @ 2011-01-19 14:35 UTC (permalink / raw)
  To: Alexander Simon; +Cc: linux-wireless
In-Reply-To: <201101191438.01161.alexander.simon@saxnet.de>

On Wed, 2011-01-19 at 14:38 +0100, Alexander Simon wrote:
> Hey list,
> 
> finally i got my (in ath9ks list announced) patch for HT rates in ad-hoc 
> networks ready that has been requested quite often.
> I took the initial patches from Benoît Papillault and worked on them.

Didn't he have versions that refactored more, like the IE building?
That'd be good in any case.

Can you split this up into a few patches and repost inline (not
attached) so we can review it more easily?

johannes


^ permalink raw reply

* Re: [PATCH 5/8] ath5k: Add 802.11j 4.9GHz channels to allowed channels
From: Bob Copeland @ 2011-01-19 15:18 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless
In-Reply-To: <201101192052.53702.br1@einfach.org>

On Wed, Jan 19, 2011 at 6:52 AM, Bruno Randolf <br1@einfach.org> >
That's also the reason why we need to know the band:
>
> in 2GHz all channels < 14 are allowed.
> in 5GHz only a few.
>
> Thanks for your review!

Oh, I get it now, yes, that makes sense :)

Acked-by: Bob Copeland <me@bobcopeland.com>

-- 
Bob Copeland %% www.bobcopeland.com

^ permalink raw reply

* Re: [PATCH 1/8] ath5k: Use mac80211 channel mapping function
From: Bob Copeland @ 2011-01-19 15:39 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless
In-Reply-To: <20110119092036.19628.84273.stgit@localhost6.localdomain6>

On Wed, Jan 19, 2011 at 4:20 AM, Bruno Randolf <br1@einfach.org> wrote:
> Use mac80211 channel mapping function instead of own homegrown version.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
> ---
>  drivers/net/wireless/ath/ath5k/base.c |   23 ++++++++---------------
>  1 files changed, 8 insertions(+), 15 deletions(-)

Acked-by: Bob Copeland <me@bobcopeland.com>

-- 
Bob Copeland %% www.bobcopeland.com

^ permalink raw reply

* [PATCH 1/2] ath9k_hw: Fix system hang when resuming from S3/S4
From: Rajkumar Manoharan @ 2011-01-19 15:47 UTC (permalink / raw)
  To: linux-wireless; +Cc: Rajkumar Manoharan, Jack Lee

The bit 6 & 7 of AR_WA (0x4004) should be enabled only
for the chips that are supporting L0s functionality
while resuming back from S3/S4.

Enabling these bits for AR9280 is causing system hang
within a few S3/S4-resume cycles.

Cc: Jack Lee <jlee@atheros.com>
Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
---
 drivers/net/wireless/ath/ath9k/ar9002_hw.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9002_hw.c b/drivers/net/wireless/ath/ath9k/ar9002_hw.c
index f8a7771..f44c84a 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c
@@ -426,9 +426,8 @@ static void ar9002_hw_configpcipowersave(struct ath_hw *ah,
 		}
 
 		/* WAR for ASPM system hang */
-		if (AR_SREV_9280(ah) || AR_SREV_9285(ah) || AR_SREV_9287(ah)) {
+		if (AR_SREV_9285(ah) || AR_SREV_9287(ah))
 			val |= (AR_WA_BIT6 | AR_WA_BIT7);
-		}
 
 		if (AR_SREV_9285E_20(ah))
 			val |= AR_WA_BIT23;
-- 
1.7.3.5


^ permalink raw reply related

* [PATCH 2/2] ath9k: Fix power save usage count imbalance on deinit
From: Rajkumar Manoharan @ 2011-01-19 15:47 UTC (permalink / raw)
  To: linux-wireless; +Cc: Rajkumar Manoharan, stable
In-Reply-To: <1295452063-13828-1-git-send-email-rmanoharan@atheros.com>

Upon unloading the driver, the ps_usecount is incremented
before configuring gpio registers in deinit_device.
But it is failed to restore the ps_usecount after that.
The problem is that the chip is moved to FULL SLEEP
by radio_disable when mac80211 is reporting as idle
though ps_usecount is not zero.

This patch retores ps_usecount properly and ensures that
the chip is always moved to full sleep only if ps usage
counte is zero which helps in debugging. And also fixes
the following warning.

ath: DMA failed to stop in 10 ms AR_CR=0xdeadbeef AR_DIAG_SW=0xdeadbeef
ath: Could not stop RX, we could be confusing the DMA engine when we
start RX up
------------[ cut here ]------------
WARNING: at drivers/net/wireless/ath/ath9k/recv.c:536
ath_stoprecv+0xf4/0x100 [ath9k]()

Cc: stable@kernel.org
Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
---
 drivers/net/wireless/ath/ath9k/init.c |    2 ++
 drivers/net/wireless/ath/ath9k/main.c |    2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 767d8b8..b38c874 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -824,6 +824,8 @@ void ath9k_deinit_device(struct ath_softc *sc)
 	wiphy_rfkill_stop_polling(sc->hw->wiphy);
 	ath_deinit_leds(sc);
 
+	ath9k_ps_restore(sc);
+
 	for (i = 0; i < sc->num_sec_wiphy; i++) {
 		struct ath_wiphy *aphy = sc->sec_wiphy[i];
 		if (aphy == NULL)
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index c03184e..aff1c72 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -966,8 +966,6 @@ void ath_radio_disable(struct ath_softc *sc, struct ieee80211_hw *hw)
 
 	spin_unlock_bh(&sc->sc_pcu_lock);
 	ath9k_ps_restore(sc);
-
-	ath9k_setpower(sc, ATH9K_PM_FULL_SLEEP);
 }
 
 int ath_reset(struct ath_softc *sc, bool retry_tx)
-- 
1.7.3.5


^ permalink raw reply related

* Re: [PATCH 3/8] ath5k: Rename ath5k_copy_channels
From: Nick Kossifidis @ 2011-01-19 15:54 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless
In-Reply-To: <20110119092047.19628.99228.stgit@localhost6.localdomain6>

2011/1/19 Bruno Randolf <br1@einfach.org>:
> Rename ath5k_copy_channels() to ath5k_setup_channels() - nothing is copied
> here.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
> ---
>  drivers/net/wireless/ath/ath5k/base.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
> index 0387acb..9e8b1f4 100644
> --- a/drivers/net/wireless/ath/ath5k/base.c
> +++ b/drivers/net/wireless/ath/ath5k/base.c
> @@ -256,7 +256,7 @@ static bool ath5k_is_standard_channel(short chan)
>  }
>
>  static unsigned int
> -ath5k_copy_channels(struct ath5k_hw *ah,
> +ath5k_setup_channels(struct ath5k_hw *ah,
>                struct ieee80211_channel *channels,
>                unsigned int mode,
>                unsigned int max)
> @@ -356,7 +356,7 @@ ath5k_setup_bands(struct ieee80211_hw *hw)
>                sband->n_bitrates = 12;
>
>                sband->channels = sc->channels;
> -               sband->n_channels = ath5k_copy_channels(ah, sband->channels,
> +               sband->n_channels = ath5k_setup_channels(ah, sband->channels,
>                                        AR5K_MODE_11G, max_c);
>
>                hw->wiphy->bands[IEEE80211_BAND_2GHZ] = sband;
> @@ -382,7 +382,7 @@ ath5k_setup_bands(struct ieee80211_hw *hw)
>                }
>
>                sband->channels = sc->channels;
> -               sband->n_channels = ath5k_copy_channels(ah, sband->channels,
> +               sband->n_channels = ath5k_setup_channels(ah, sband->channels,
>                                        AR5K_MODE_11B, max_c);
>
>                hw->wiphy->bands[IEEE80211_BAND_2GHZ] = sband;
> @@ -402,7 +402,7 @@ ath5k_setup_bands(struct ieee80211_hw *hw)
>                sband->n_bitrates = 8;
>
>                sband->channels = &sc->channels[count_c];
> -               sband->n_channels = ath5k_copy_channels(ah, sband->channels,
> +               sband->n_channels = ath5k_setup_channels(ah, sband->channels,
>                                        AR5K_MODE_11A, max_c);
>
>                hw->wiphy->bands[IEEE80211_BAND_5GHZ] = sband;
>


Acked-by: Nick Kossifidis <mickflemm@gmail.com>


-- 
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick

^ permalink raw reply

* Re: [PATCH 5/8] ath5k: Add 802.11j 4.9GHz channels to allowed channels
From: Nick Kossifidis @ 2011-01-19 15:55 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless
In-Reply-To: <20110119092057.19628.9296.stgit@localhost6.localdomain6>

2011/1/19 Bruno Randolf <br1@einfach.org>:
> Add the 802.11j (20MHz channel width) channels to the allowed channels. This
> still does not enable 802.11j in ath5k since these frequencies are out of the
> configured range. A later patch will deal with that.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
> ---
>  drivers/net/wireless/ath/ath5k/base.c |   19 +++++++++++++------
>  1 files changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
> index a28ad58..6900543 100644
> --- a/drivers/net/wireless/ath/ath5k/base.c
> +++ b/drivers/net/wireless/ath/ath5k/base.c
> @@ -244,15 +244,21 @@ static int ath5k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *re
>  /*
>  * Returns true for the channel numbers used without all_channels modparam.
>  */
> -static bool ath5k_is_standard_channel(short chan)
> +static bool ath5k_is_standard_channel(short chan, enum ieee80211_band band)
>  {
> -       return ((chan <= 14) ||
> -               /* UNII 1,2 */
> -               ((chan & 3) == 0 && chan >= 36 && chan <= 64) ||
> +       if (band == IEEE80211_BAND_2GHZ && chan <= 14)
> +               return true;
> +
> +       return  /* UNII 1,2 */
> +               (((chan & 3) == 0 && chan >= 36 && chan <= 64) ||
>                /* midband */
>                ((chan & 3) == 0 && chan >= 100 && chan <= 140) ||
>                /* UNII-3 */
> -               ((chan & 3) == 1 && chan >= 149 && chan <= 165));
> +               ((chan & 3) == 1 && chan >= 149 && chan <= 165) ||
> +               /* 802.11j 5.030-5.080 GHz (20MHz) */
> +               (chan == 8 || chan == 12 || chan == 16) ||
> +               /* 802.11j 4.9GHz (20MHz) */
> +               (chan == 184 || chan == 188 || chan == 192 || chan == 196));
>  }
>
>  static unsigned int
> @@ -291,7 +297,8 @@ ath5k_setup_channels(struct ath5k_hw *ah, struct ieee80211_channel *channels,
>                if (!ath5k_channel_ok(ah, freq, chfreq))
>                        continue;
>
> -               if (!modparam_all_channels && !ath5k_is_standard_channel(ch))
> +               if (!modparam_all_channels &&
> +                   !ath5k_is_standard_channel(ch, band))
>                        continue;
>
>                /* Write channel info and increment counter */
>


Acked-by: Nick Kossifidis <mickflemm@gmail.com>

-- 
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick

^ permalink raw reply

* Re: [PATCH 6/8] ath5: Remove unused CTL definitions
From: Nick Kossifidis @ 2011-01-19 15:55 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless
In-Reply-To: <20110119092102.19628.68971.stgit@localhost6.localdomain6>

2011/1/19 Bruno Randolf <br1@einfach.org>:
> They are unused in ath5k and a more detailled definition is in
> ath/regd_common.h.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
> ---
>  drivers/net/wireless/ath/ath5k/eeprom.h |   23 -----------------------
>  1 files changed, 0 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/eeprom.h b/drivers/net/wireless/ath/ath5k/eeprom.h
> index d46f105..6511c27 100644
> --- a/drivers/net/wireless/ath/ath5k/eeprom.h
> +++ b/drivers/net/wireless/ath/ath5k/eeprom.h
> @@ -268,29 +268,6 @@ enum ath5k_ctl_mode {
>        AR5K_CTL_MODE_M = 15,
>  };
>
> -/* Default CTL ids for the 3 main reg domains.
> - * Atheros only uses these by default but vendors
> - * can have up to 32 different CTLs for different
> - * scenarios. Note that theese values are ORed with
> - * the mode id (above) so we can have up to 24 CTL
> - * datasets out of these 3 main regdomains. That leaves
> - * 8 ids that can be used by vendors and since 0x20 is
> - * missing from HAL sources i guess this is the set of
> - * custom CTLs vendors can use. */
> -#define        AR5K_CTL_FCC    0x10
> -#define        AR5K_CTL_CUSTOM 0x20
> -#define        AR5K_CTL_ETSI   0x30
> -#define        AR5K_CTL_MKK    0x40
> -
> -/* Indicates a CTL with only mode set and
> - * no reg domain mapping, such CTLs are used
> - * for world roaming domains or simply when
> - * a reg domain is not set */
> -#define        AR5K_CTL_NO_REGDOMAIN   0xf0
> -
> -/* Indicates an empty (invalid) CTL */
> -#define AR5K_CTL_NO_CTL                0xff
> -
>  /* Per channel calibration data, used for power table setup */
>  struct ath5k_chan_pcal_info_rf5111 {
>        /* Power levels in half dbm units
>


Acked-by: Nick Kossifidis <mickflemm@gmail.com>



-- 
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick

^ permalink raw reply

* Re: [PATCH 7/8] ath5k: Remove unused sc->curmode
From: Nick Kossifidis @ 2011-01-19 15:56 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless
In-Reply-To: <20110119092108.19628.43971.stgit@localhost6.localdomain6>

2011/1/19 Bruno Randolf <br1@einfach.org>:
> sc->curmode is set but never used. Remove it and the helper function. Also the
> ath5k_rate_update which is refered to in the comment does not exist (any more?)
> so we don't need to setup the band in that place.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
> ---
>  drivers/net/wireless/ath/ath5k/base.c |   18 ------------------
>  drivers/net/wireless/ath/ath5k/base.h |    1 -
>  2 files changed, 0 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
> index 6900543..a00cc11 100644
> --- a/drivers/net/wireless/ath/ath5k/base.c
> +++ b/drivers/net/wireless/ath/ath5k/base.c
> @@ -439,18 +439,6 @@ ath5k_chan_set(struct ath5k_softc *sc, struct ieee80211_channel *chan)
>        return ath5k_reset(sc, chan, true);
>  }
>
> -static void
> -ath5k_setcurmode(struct ath5k_softc *sc, unsigned int mode)
> -{
> -       sc->curmode = mode;
> -
> -       if (mode == AR5K_MODE_11A) {
> -               sc->curband = &sc->sbands[IEEE80211_BAND_5GHZ];
> -       } else {
> -               sc->curband = &sc->sbands[IEEE80211_BAND_2GHZ];
> -       }
> -}
> -
>  struct ath_vif_iter_data {
>        const u8        *hw_macaddr;
>        u8              mask[ETH_ALEN];
> @@ -2776,12 +2764,6 @@ ath5k_init(struct ieee80211_hw *hw)
>                goto err;
>        }
>
> -       /* NB: setup here so ath5k_rate_update is happy */
> -       if (test_bit(AR5K_MODE_11A, ah->ah_modes))
> -               ath5k_setcurmode(sc, AR5K_MODE_11A);
> -       else
> -               ath5k_setcurmode(sc, AR5K_MODE_11B);
> -
>        /*
>         * Allocate tx+rx descriptors and populate the lists.
>         */
> diff --git a/drivers/net/wireless/ath/ath5k/base.h b/drivers/net/wireless/ath/ath5k/base.h
> index 6d51147..58660e4 100644
> --- a/drivers/net/wireless/ath/ath5k/base.h
> +++ b/drivers/net/wireless/ath/ath5k/base.h
> @@ -202,7 +202,6 @@ struct ath5k_softc {
>  #define ATH_STAT_STARTED       4               /* opened & irqs enabled */
>
>        unsigned int            filter_flags;   /* HW flags, AR5K_RX_FILTER_* */
> -       unsigned int            curmode;        /* current phy mode */
>        struct ieee80211_channel *curchan;      /* current h/w channel */
>
>        u16                     nvifs;
>


Acked-by: Nick Kossifidis <mickflemm@gmail.com>


-- 
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick

^ permalink raw reply

* Re: [PATCH 8/8] ath5k: Remove redundant sc->curband
From: Nick Kossifidis @ 2011-01-19 15:57 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless
In-Reply-To: <20110119092113.19628.33322.stgit@localhost6.localdomain6>

2011/1/19 Bruno Randolf <br1@einfach.org>:
> Remove sc->curband because the band is already stored in the current channel.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
> ---
>  drivers/net/wireless/ath/ath5k/base.c |   11 ++++-------
>  drivers/net/wireless/ath/ath5k/base.h |    2 --
>  2 files changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
> index a00cc11..0e39ee8 100644
> --- a/drivers/net/wireless/ath/ath5k/base.c
> +++ b/drivers/net/wireless/ath/ath5k/base.c
> @@ -551,7 +551,7 @@ ath5k_hw_to_driver_rix(struct ath5k_softc *sc, int hw_rix)
>                        "hw_rix out of bounds: %x\n", hw_rix))
>                return 0;
>
> -       rix = sc->rate_idx[sc->curband->band][hw_rix];
> +       rix = sc->rate_idx[sc->curchan->band][hw_rix];
>        if (WARN(rix < 0, "invalid hw_rix: %x\n", hw_rix))
>                rix = 0;
>
> @@ -1361,7 +1361,7 @@ ath5k_receive_frame(struct ath5k_softc *sc, struct sk_buff *skb,
>        rxs->flag |= RX_FLAG_TSFT;
>
>        rxs->freq = sc->curchan->center_freq;
> -       rxs->band = sc->curband->band;
> +       rxs->band = sc->curchan->band;
>
>        rxs->signal = sc->ah->ah_noise_floor + rs->rs_rssi;
>
> @@ -1376,7 +1376,7 @@ ath5k_receive_frame(struct ath5k_softc *sc, struct sk_buff *skb,
>        rxs->flag |= ath5k_rx_decrypted(sc, skb, rs);
>
>        if (rxs->rate_idx >= 0 && rs->rs_rate ==
> -           sc->curband->bitrates[rxs->rate_idx].hw_value_short)
> +           sc->sbands[sc->curchan->band].bitrates[rxs->rate_idx].hw_value_short)
>                rxs->flag |= RX_FLAG_SHORTPRE;
>
>        ath5k_debug_dump_skb(sc, skb, "RX  ", 0);
> @@ -2536,7 +2536,6 @@ ath5k_init_hw(struct ath5k_softc *sc)
>         * and then setup of the interrupt mask.
>         */
>        sc->curchan = sc->hw->conf.channel;
> -       sc->curband = &sc->sbands[sc->curchan->band];
>        sc->imask = AR5K_INT_RXOK | AR5K_INT_RXERR | AR5K_INT_RXEOL |
>                AR5K_INT_RXORN | AR5K_INT_TXDESC | AR5K_INT_TXEOL |
>                AR5K_INT_FATAL | AR5K_INT_GLOBAL | AR5K_INT_MIB;
> @@ -2663,10 +2662,8 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan,
>         * so we should also free any remaining
>         * tx buffers */
>        ath5k_drain_tx_buffs(sc);
> -       if (chan) {
> +       if (chan)
>                sc->curchan = chan;
> -               sc->curband = &sc->sbands[chan->band];
> -       }
>        ret = ath5k_hw_reset(ah, sc->opmode, sc->curchan, chan != NULL,
>                                                                skip_pcu);
>        if (ret) {
> diff --git a/drivers/net/wireless/ath/ath5k/base.h b/drivers/net/wireless/ath/ath5k/base.h
> index 58660e4..8f919dc 100644
> --- a/drivers/net/wireless/ath/ath5k/base.h
> +++ b/drivers/net/wireless/ath/ath5k/base.h
> @@ -183,8 +183,6 @@ struct ath5k_softc {
>        enum nl80211_iftype     opmode;
>        struct ath5k_hw         *ah;            /* Atheros HW */
>
> -       struct ieee80211_supported_band         *curband;
> -
>  #ifdef CONFIG_ATH5K_DEBUG
>        struct ath5k_dbg_info   debug;          /* debug info */
>  #endif /* CONFIG_ATH5K_DEBUG */
>


Acked-by: Nick Kossifidis <mickflemm@gmail.com>


-- 
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick

^ permalink raw reply

* Re: [PATCH 4/8] ath5k: ath5k_setup_channels cleanup and whitespace
From: Nick Kossifidis @ 2011-01-19 15:57 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless
In-Reply-To: <20110119092052.19628.61933.stgit@localhost6.localdomain6>

2011/1/19 Bruno Randolf <br1@einfach.org>:
> Remove useless test_bit - it's not going to happen because of the way this
> function is called only when that bit is set.
>
> And fix some whitespace.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
> ---
>  drivers/net/wireless/ath/ath5k/base.c |   11 +++--------
>  1 files changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
> index 9e8b1f4..a28ad58 100644
> --- a/drivers/net/wireless/ath/ath5k/base.c
> +++ b/drivers/net/wireless/ath/ath5k/base.c
> @@ -256,21 +256,16 @@ static bool ath5k_is_standard_channel(short chan)
>  }
>
>  static unsigned int
> -ath5k_setup_channels(struct ath5k_hw *ah,
> -               struct ieee80211_channel *channels,
> -               unsigned int mode,
> -               unsigned int max)
> +ath5k_setup_channels(struct ath5k_hw *ah, struct ieee80211_channel *channels,
> +               unsigned int mode, unsigned int max)
>  {
>        unsigned int count, size, chfreq, freq, ch;
>        enum ieee80211_band band;
>
> -       if (!test_bit(mode, ah->ah_modes))
> -               return 0;
> -
>        switch (mode) {
>        case AR5K_MODE_11A:
>                /* 1..220, but 2GHz frequencies are filtered by check_channel */
> -               size = 220 ;
> +               size = 220;
>                chfreq = CHANNEL_5GHZ;
>                band = IEEE80211_BAND_5GHZ;
>                break;
>


Acked-by: Nick Kossifidis <mickflemm@gmail.com>


-- 
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick

^ permalink raw reply

* Re: [PATCH 0/8] ath5k 802.11j preparation and cleanup
From: Nick Kossifidis @ 2011-01-19 15:58 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless
In-Reply-To: <20110119091949.19628.28309.stgit@localhost6.localdomain6>

2011/1/19 Bruno Randolf <br1@einfach.org>:
> This series prepares ath5k for 802.11j (4.9GHz) support but most of the patches
> are just cleaning up things i found in the process. 802.11j is still not
> enabled.
>
> bruno
>
> ---
>
> Bruno Randolf (8):
>      ath5k: Use mac80211 channel mapping function
>      ath5k: Simplify loop when setting up channels
>      ath5k: Rename ath5k_copy_channels
>      ath5k: ath5k_setup_channels cleanup and whitespace
>      ath5k: Add 802.11j 4.9GHz channels to allowed channels
>      ath5: Remove unused CTL definitions
>      ath5k: Remove unused sc->curmode
>      ath5k: Remove redundant sc->curband
>
>
>  drivers/net/wireless/ath/ath5k/base.c   |   95 +++++++++++--------------------
>  drivers/net/wireless/ath/ath5k/base.h   |    3 -
>  drivers/net/wireless/ath/ath5k/eeprom.h |   23 --------
>  3 files changed, 34 insertions(+), 87 deletions(-)
>
> --
> Signature

Nice clean up !


-- 
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick

^ permalink raw reply

* wireless-testing rebased on 2.6.38-rc1
From: John W. Linville @ 2011-01-19 18:22 UTC (permalink / raw)
  To: linux-wireless

The wireless-testing tree has been rebased upon 2.6.38-rc1.
Please updates your trees accordingly.

Thanks,

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* Re: [RFC PATCH 10/17] zd1211rw: implement beacon fetching and handling ieee80211_get_buffered_bc()
From: Jussi Kivilinna @ 2011-01-19 18:49 UTC (permalink / raw)
  To: Christian Lamparter; +Cc: linux-wireless, Daniel Drake, Ulrich Kunitz
In-Reply-To: <201101092133.37610.chunkeey@googlemail.com>

Quoting Christian Lamparter <chunkeey@googlemail.com>:

> On Sunday 09 January 2011 16:46:56 Jussi Kivilinna wrote:
>> Quoting Christian Lamparter <chunkeey@googlemail.com>:
>> > On Wednesday 05 January 2011 00:49:10 Jussi Kivilinna wrote:
>> >> diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c
>> >> b/drivers/net/wireless/zd1211rw/zd_mac.c
>> >> index aace010..a3c7e8f 100644
>> >> --- a/drivers/net/wireless/zd1211rw/zd_mac.c
>> >> +++ b/drivers/net/wireless/zd1211rw/zd_mac.c
>> >> @@ -958,16 +958,46 @@ static int zd_op_config(struct ieee80211_hw
>> >> *hw, u32 changed)
>> >>  	return zd_chip_set_channel(&mac->chip, conf->channel->hw_value);
>> >>  }
>> >>
>> >> +static void zd_beacon_done(struct zd_mac *mac)
>> >> +{
>> >
>> > this is an interesting one...
>> >
>> > Since zd_beacon_done also uploads the next beacon so long in advance,
>> > there could be an equally long race between the outdated state of the
>> > next beacon's DTIM broadcast traffic indicator (802.11-2007 7.3.2.6)
>> > which -in your case- was uploaded almost a beacon interval ago and
>> > the xmit of ieee80211_get_buffered_bc *now*.
>> >
>> > The dtim bc/mc bit might be not set, when a mc/bc arrived after the
>> > beacon was uploaded, but before the "beacon done event" from the
>> > hardware. So, dozing stations don't expect the broadcast traffic
>> > and of course, they might miss it completely.
>> >
>> > It's probably better to fix this in mac80211 (see the attached hack).
>>
>> Ok, should I add this to my patchset?
> well, difficult to say. As far as I can say, it should be correct for "your
> case". But, on the other hand: what about solutions that can't buffer
> mc/bc frames (and needs to call ieee80211_get_buffered_bc), however the
> firmware is clever enough to maintain a beacon internally (so they
> won't call ieee80211_beacon_get and only relies on set_tim)?
>
> Sure, it's just a unlikely corner case... In fact, I didn't check if
> that's even possible, but it does sound reasonable to some extend.
>

 From what I checked none of currect driver/device is such. Maybe if  
such device appears then !bss->dtim_bc_mc check in  
ieee80211_beacon_add_tim() could be masked with driver flag (something  
like  
IEEE80211_HW_CAN_AND_HANDLE_BEACON_BUT_STILL_NEEDS_HOST_BROADCAST_PS_BUFFERING).

>> > In fact, you could just as well drop "[09/17] zd1211rw: implement
>> > seq_num for IEEE80211_TX_CTL_ASSIGN_SEQ"... unless of course, I'm
>> > an idiot and there is a really clever way around these issues.
>>
>> Oh well, I should have checked this more closely before doing that
>> patch. HW is assigning seq-numbers already and that patch is not needed.
>
> heh, p54's fw can assign sequence numbers as well, but there's a txdesc flag
> to control the counter, so the firmware does not mess with the  
> sequence control
> of QoS-Data frames. I hope zd1211* has one too.
>

There is tx-control flag that doesn't have effect, but since zd1211  
doesn't appear to support QoS it's not a problem.

-Jussi


^ permalink raw reply

* Re: [PATCH 2/2] ath9k: Fix power save usage count imbalance on deinit
From: Luis R. Rodriguez @ 2011-01-19 19:24 UTC (permalink / raw)
  To: Rajkumar Manoharan; +Cc: linux-wireless, stable
In-Reply-To: <1295452063-13828-2-git-send-email-rmanoharan@atheros.com>

On Wed, Jan 19, 2011 at 7:47 AM, Rajkumar Manoharan
<rmanoharan@atheros.com> wrote:
> Upon unloading the driver, the ps_usecount is incremented
> before configuring gpio registers in deinit_device.
> But it is failed to restore the ps_usecount after that.
> The problem is that the chip is moved to FULL SLEEP
> by radio_disable when mac80211 is reporting as idle
> though ps_usecount is not zero.
>
> This patch retores ps_usecount properly and ensures that
> the chip is always moved to full sleep only if ps usage
> counte is zero which helps in debugging. And also fixes
> the following warning.
>
> ath: DMA failed to stop in 10 ms AR_CR=0xdeadbeef AR_DIAG_SW=0xdeadbeef
> ath: Could not stop RX, we could be confusing the DMA engine when we
> start RX up
> ------------[ cut here ]------------
> WARNING: at drivers/net/wireless/ath/ath9k/recv.c:536
> ath_stoprecv+0xf4/0x100 [ath9k]()
>
> Cc: stable@kernel.org
> Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
> ---
>  drivers/net/wireless/ath/ath9k/init.c |    2 ++
>  drivers/net/wireless/ath/ath9k/main.c |    2 --
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
> index 767d8b8..b38c874 100644
> --- a/drivers/net/wireless/ath/ath9k/init.c
> +++ b/drivers/net/wireless/ath/ath9k/init.c
> @@ -824,6 +824,8 @@ void ath9k_deinit_device(struct ath_softc *sc)
>        wiphy_rfkill_stop_polling(sc->hw->wiphy);
>        ath_deinit_leds(sc);
>
> +       ath9k_ps_restore(sc);
> +
>        for (i = 0; i < sc->num_sec_wiphy; i++) {
>                struct ath_wiphy *aphy = sc->sec_wiphy[i];
>                if (aphy == NULL)
> diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
> index c03184e..aff1c72 100644
> --- a/drivers/net/wireless/ath/ath9k/main.c
> +++ b/drivers/net/wireless/ath/ath9k/main.c
> @@ -966,8 +966,6 @@ void ath_radio_disable(struct ath_softc *sc, struct ieee80211_hw *hw)
>
>        spin_unlock_bh(&sc->sc_pcu_lock);
>        ath9k_ps_restore(sc);
> -
> -       ath9k_setpower(sc, ATH9K_PM_FULL_SLEEP);

Are you sure this hunk does not regress the suspend/resume case when
using the new dbus API?

  Luis

^ permalink raw reply

* pull request: bluetooth-2.6 2011-01-19
From: Gustavo F. Padovan @ 2011-01-19 19:27 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, linux-bluetooth

Hi John,

Here is the first set of Bluetooth fixes for 2.6.38. It includes a patch from
Alexander Holler to reduce memory usage by the ath3k bluetooth driver. A
misusu of logical operation in L2CAP by David Sterba. There is also a fix to a
RFCOMM crash by Lukáš Turek.

Last we have six patches from Johan Hedberg, the first fix a leak in the
HCI blacklist feature. The other 5 patches, are fixes created against the BITE
tester (used in the Bluetooth qualification process). All of them are very
simple. Worth to note that one of them is a revert and "Bluetooth: Create a
unified auth_type evaluation function" is a very simple refactoring. These
patches makes 2.6.38 ready for the Bluetooth qualification process.

Please merge, or let me know any doubts or problems you find. Thanks.


The following changes since commit 38d59392b29437af3a702209b6a5196ef01f79a8:

  iwlwifi: fix valid chain reading from EEPROM (2011-01-18 15:10:31 -0500)

are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth-2.6.git master

Alexander Holler (1):
      Bluetooth: ath3k: reduce memory usage

David Sterba (1):
      Bluetooth: l2cap: fix misuse of logical operation in place of bitop

Johan Hedberg (6):
      Bluetooth: Fix leaking blacklist when unregistering a hci device
      Revert "Bluetooth: Update sec_level/auth_type for already existing connections"
      Bluetooth: Fix MITM protection requirement preservation
      Bluetooth: Create a unified auth_type evaluation function
      Bluetooth: Fix authentication request for L2CAP raw sockets
      Bluetooth: Fix race condition with conn->sec_level

Lukáš Turek (1):
      Bluetooth: Never deallocate a session when some DLC points to it

 drivers/bluetooth/ath3k.c        |   75 +++++++++-------------------------
 include/net/bluetooth/hci_core.h |    1 +
 net/bluetooth/hci_conn.c         |   16 ++++---
 net/bluetooth/hci_core.c         |    4 ++
 net/bluetooth/hci_event.c        |    9 ++--
 net/bluetooth/l2cap.c            |   84 ++++++++++++++-----------------------
 net/bluetooth/rfcomm/core.c      |    3 +-
 7 files changed, 73 insertions(+), 119 deletions(-)

-- 
Gustavo F. Padovan
http://profusion.mobi

^ permalink raw reply

* Compat-wireless release for 2011-01-19 is baked
From: Compat-wireless cronjob account @ 2011-01-19 20:05 UTC (permalink / raw)
  To: linux-wireless

>From git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next
   8ffd020..143a29f  history    -> origin/history
 + a4e85a5...a3d484f master     -> origin/master  (forced update)
   9e8a462..c56eb8f  stable     -> origin/stable
 * [new tag]         next-20110119 -> next-20110119
 * [new tag]         v2.6.38-rc1 -> v2.6.38-rc1

compat-wireless code metrics

    782530 - Total upstream lines of code being pulled
      2103 - backport code changes
      1843 - backport code additions
       260 - backport code deletions
      7279 - backport from compat module
      9382 - total backport code
    1.1989 - % of code consists of backport work
      1531 - Crap changes not yet posted
      1488 - Crap additions not yet posted
        43 - Crap deletions not yet posted
    0.1956 - % of crap code

Base tree: linux-next.git
Base tree version: next-20110119
compat-wireless release: compat-wireless-2011-01-06-3-g8db1608-pc

^ permalink raw reply

* Re: Does linux wireless support TL-WN861N
From: Brian Prodoehl @ 2011-01-19 20:06 UTC (permalink / raw)
  To: JD; +Cc: Rafał Miłecki, linux-wireless, ath9k-devel
In-Reply-To: <4D35ECD8.8070000@gmail.com>

2011/1/18 JD <jd1008@gmail.com>:
> On 01/18/2011 11:23 AM, Rafał Miłecki wrote:
>>
>> 2011/1/18 JD<jd1008@gmail.com>:
>>>
>>> TP-Link TL-WN861N
>>> see
>>>
>>> http://www.tp-link.com/products/productDetails.asp?class=&content=spe&pmodel=TL-WN861N
>>
>> https://forum.openwrt.org/viewtopic.php?id=25431
>> http://www.wikidevi.com/wiki/TP-LINK_TL-WN861N_v2
>>
>> Both sources tell about AR9223 chipset, but I is not mentioned on
>> http://wireless.kernel.org/en/users/Drivers/ath9k
>>
>> Maybe someone from ath9k ML knows it? Or try to Google it.
>>
> Thanx Rafal.
> I did find it listed on
>
> http://wireless.kernel.org/en/users/Drivers/ath9k/products/external?highlight=%28TL-WN861N%29
>
> However, I also found out that it has very very poor Rx sensitivity (only
> -68 dBm) at 11g,
> and much much less at 11N. My location relative to AP is very bad. I need a
> card supported
> by ath9k and with Rx sensitivity that can go all the way to -97dBm.
>
> Cheers,
>
> JD

That sensitivity number is the sensitivity at the 54Mbps bitrate.  If
you're comparing product briefs or datasheets, make sure you're
comparing numbers for the same bitrate.  That card can receive 1Mbps
down to -90dBm, and 6Mbps down to -88dBm.  You'll find cards with
sensitivity 6 or 7dB better, but that's about it.

-Brian

^ permalink raw reply

* Re: [RFC PATCH 10/17] zd1211rw: implement beacon fetching and handling ieee80211_get_buffered_bc()
From: Christian Lamparter @ 2011-01-19 20:22 UTC (permalink / raw)
  To: Jussi Kivilinna; +Cc: linux-wireless, Daniel Drake, Ulrich Kunitz, kvalo
In-Reply-To: <20110119204903.179429gv9mcqcidc@hayate.sektori.org>

On Wednesday 19 January 2011 19:49:03 Jussi Kivilinna wrote:
> Quoting Christian Lamparter <chunkeey@googlemail.com>:
>> On Sunday 09 January 2011 16:46:56 Jussi Kivilinna wrote:
>>> Quoting Christian Lamparter <chunkeey@googlemail.com>:
>>>> this is an interesting one...
>>>>
>>>> Since zd_beacon_done also uploads the next beacon so long in advance,
>>>> there could be an equally long race between the outdated state of the
>>>> next beacon's DTIM broadcast traffic indicator (802.11-2007 7.3.2.6)
>>>> which -in your case- was uploaded almost a beacon interval ago and
>>>> the xmit of ieee80211_get_buffered_bc *now*.
>>>>
>>>> The dtim bc/mc bit might be not set, when a mc/bc arrived after the
>>>> beacon was uploaded, but before the "beacon done event" from the
>>>> hardware. So, dozing stations don't expect the broadcast traffic
>>>> and of course, they might miss it completely.
>>>>
>>>> It's probably better to fix this in mac80211 (see the attached hack).
>>>
>>> Ok, should I add this to my patchset?
>> well, difficult to say. As far as I can say, it should be correct for "your
>> case". But, on the other hand: what about solutions that can't buffer
>> mc/bc frames (and needs to call ieee80211_get_buffered_bc), however the
>> firmware is clever enough to maintain a beacon internally (so they
>> won't call ieee80211_beacon_get and only relies on set_tim)?
>>
>> Sure, it's just a unlikely corner case... In fact, I didn't check if
>> that's even possible, but it does sound reasonable to some extend.
>
> From what I checked none of currect driver/device is such.
> Maybe if such device appears then !bss->dtim_bc_mc check in  
> ieee80211_beacon_add_tim() could be masked with driver flag (something  
> like
> IEEE80211_HW_CAN_AND_HANDLE_BEACON_BUT_STILL_NEEDS_HOST_BROADCAST_PS_BUFFERING).

True, but a recent discussion into this matter have made parts of the
API you are planning to use sort-of "deprecated"? [I think?]

http://marc.info/?l=linux-wireless&m=129463297300480

I don't know the exact details, but I'm sure Kvalo does have his reasons.
[afaik it has to do with wl12xx, he even explained it once, but I can't
find that mail anymore].

>>>> In fact, you could just as well drop "[09/17] zd1211rw: implement
>>>> seq_num for IEEE80211_TX_CTL_ASSIGN_SEQ"... unless of course, I'm
>>>> an idiot and there is a really clever way around these issues.
>>>
>>> Oh well, I should have checked this more closely before doing that
>>> patch. HW is assigning seq-numbers already and that patch is not needed.
>>
>> heh, p54's fw can assign sequence numbers as well, but there's a txdesc flag
>> to control the counter, so the firmware does not mess with the  
>> sequence control
>> of QoS-Data frames. I hope zd1211* has one too.
> 
> There is tx-control flag that doesn't have effect, but since zd1211  
> doesn't appear to support QoS it's not a problem.

Ok, that sound reasonable.

One more thing, is there a tx-control flag to instruct the HW/FW to write
the TSF into probe response frames, just like it does for beacons frames?

Sure, this feature is far more important for IBSS, but the 802.11-2007
specs @11.1.4 says that a STA might use beacons or probe responses to
synchronize its timers. [However 11.1.1.1 and 11.1.3.4 say that STAs
should "only" pick this information from beacons, if I'm not mistaken?!]
(Also a uniform "0..0" timestamp in every probe-response looks so sad.)

Best Regards,
	Christian

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox