Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: [RFC 1/4] mac80211: support for IEEE80211N in IBSS
From: Johannes Berg @ 2011-01-20 10:20 UTC (permalink / raw)
  To: Alexander Simon; +Cc: linux-wireless
In-Reply-To: <loom.20110120T110320-779@post.gmane.org>

On Thu, 2011-01-20 at 10:15 +0000, Alexander Simon wrote:
> > Of course I'd accept that  Reducing duplicated code is good, and I
> > can deal with patches touching many files. Though it'd be nice to do the
> > necessary refactoring first.

> Ok give me some time and I'll have a look at util.c.

Thanks.

> > A nice touch, btw, would be if you included a diffstat. Maybe you should
> > look at using quilt or git to submit patches which help you automate a
> > lot of things.

> Actually I don't like git, but when this is getting something bigger,I'll agree
> to use it :)

I personally rarely use it for the kernel (even if I know how to very
well), mostly because rebasing is slow for me ... quilt helps a lot too.
If you intend to submit more patches than this series I suggest you
learn at least one of them, it'll make your life easier :-)

> > I'm sorry, I don't understand what you mean by "a separate option"? With
> > the approach that you've posted patches for you need to tell iw whether
> > you want HT or not, right?

> What i mean is, right now there's just one option - setting the HT channel.
> There could be less (the card automatically enables HT and uses it for a station
> that advertises HT), or even more (as in hostapd.confs HT section). Or there
> could be a module option to switch ht for ibss on or off. So, i'm asking about
> the "ideal" interface...

Hmm, I guess you have a point there -- restricting it to HT40- doesn't
make much sense since then you can't merge with another IBSS that is
using HT40+. I guess just enable/disable HT makes more sense?

johannes


^ permalink raw reply

* Re: [RFC 1/4] mac80211: support for IEEE80211N in IBSS
From: Alexander Simon @ 2011-01-20 10:15 UTC (permalink / raw)
  To: linux-wireless
In-Reply-To: <1295517283.3693.31.camel@jlt3.sipsolutions.net>

> Of course I'd accept that  Reducing duplicated code is good, and I
> can deal with patches touching many files. Though it'd be nice to do the
> necessary refactoring first.
Ok give me some time and I'll have a look at util.c.
> 
> A nice touch, btw, would be if you included a diffstat. Maybe you should
> look at using quilt or git to submit patches which help you automate a
> lot of things.
Actually I don't like git, but when this is getting something bigger,I'll agree
to use it :)


> > But i would appreciate if you could comment on the design of the patch
itself.
> > Basically i just took Benoits approach and made it running. A separate 
option
> > for setting channel_type isn't necessary. You could also tell by iw whether
to
> > use HT or not. Or no option at all, a module option ibss_ht etc. Or even 
setting
> > full options as hostapd does via iw.
> 
> I'm sorry, I don't understand what you mean by "a separate option"? With
> the approach that you've posted patches for you need to tell iw whether
> you want HT or not, right?
What i mean is, right now there's just one option - setting the HT channel.
There could be less (the card automatically enables HT and uses it for a station
that advertises HT), or even more (as in hostapd.confs HT section). Or there
could be a module option to switch ht for ibss on or off. So, i'm asking about
the "ideal" interface...


^ permalink raw reply

* Re: [RFC 1/4] mac80211: support for IEEE80211N in IBSS
From: Johannes Berg @ 2011-01-20  9:54 UTC (permalink / raw)
  To: Alexander Simon; +Cc: linux-wireless
In-Reply-To: <loom.20110120T103741-140@post.gmane.org>

On Thu, 2011-01-20 at 09:48 +0000, Alexander Simon wrote:

> > Well, then maybe I just discussed this with him -- there's similar code
> > building the HT IEs for stations, that code should be shared.

> So you mean my patch 2/4? It could work but you would have to change util.c of
> course. I was pretty sure you wouldn't have accepted that.

Of course I'd accept that :-) Reducing duplicated code is good, and I
can deal with patches touching many files. Though it'd be nice to do the
necessary refactoring first.

A nice touch, btw, would be if you included a diffstat. Maybe you should
look at using quilt or git to submit patches which help you automate a
lot of things.


> Ok, separating cfg from mac. No big deal. I'll have to look how to advertise
> something...

Look at WIPHY_FLAG_IBSS_RSN in net/wireless and net/mac80211 -- that's
how things can be advertised. Also, for this one of course you have
NL80211_ATTR_SUPPORT_IBSS_RSN.

> But i would appreciate if you could comment on the design of the patch itself.
> Basically i just took Benoits approach and made it running. A separate option
> for setting channel_type isn't necessary. You could also tell by iw whether to
> use HT or not. Or no option at all, a module option ibss_ht etc. Or even setting
> full options as hostapd does via iw.

I'm sorry, I don't understand what you mean by "a separate option"? With
the approach that you've posted patches for you need to tell iw whether
you want HT or not, right?

johannes


^ permalink raw reply

* Re: [RFC 4/4] mac80211: support for IEEE80211N in IBSS
From: Johannes Berg @ 2011-01-20  9:49 UTC (permalink / raw)
  To: Alexander Simon; +Cc: linux-wireless
In-Reply-To: <loom.20110120T102902-813@post.gmane.org>

On Thu, 2011-01-20 at 09:37 +0000, Alexander Simon wrote:
> This adds some ifs to let the packet aggregation also
> work while being in IBSS mode.
> 

Ok this one's a pretty well-split up patch, but

 * the subject should be more specific, like
   "mac80211: allow aggregation in IBSS mode"
 * the description should be more results-oriented,
   for example: "Allow aggregation sessions to be
   started in IBSS mode." The stuff about "add ifs"
   really isn't necessary we can all look at the code :-)
 * you missed Signed-off-by
 * your patch was line-wrapped, so it can't be applied

As for the other three patches, I don't think they were split up well --
the first one should be cfg80211 specific, and 2/3 should probably be
just one patch? Also for patches 1-3 the line wrapping in the commit log
was very awkward, try to stay < 72 characters per line.

However, if you combine 2 and 3, I still think you need a preliminary
patch to do the refactoring between the code that builds the HT IEs for
IBSS and ieee80211_add_ht_ie(). In fact, I notice there's similar code
in ieee80211_build_preq_ies() so a really good refactoring would take
code from both and replace it with a shared version that IBSS becomes
the third user of.

Have you seen
http://wireless.kernel.org/en/developers/Documentation/SubmittingPatches?

Thanks for your effort!

johannes


^ permalink raw reply

* Re: [RFC 1/4] mac80211: support for IEEE80211N in IBSS
From: Alexander Simon @ 2011-01-20  9:48 UTC (permalink / raw)
  To: linux-wireless
In-Reply-To: <1295515469.3693.17.camel@jlt3.sipsolutions.net>

Johannes Berg <johannes@...> writes:

> 
> On Thu, 2011-01-20 at 09:10 +0000, Alexander Simon wrote:
> 
> > What do you mean with a "not so refactoring version"? I am adding a new IE.
> > These are only insertions, no other changes. Or do you mean that
dev_alloc_skb?
> > However, i took the last "try" from Benoit.
> 
> Well, then maybe I just discussed this with him -- there's similar code
> building the HT IEs for stations, that code should be shared.
So you mean my patch 2/4? It could work but you would have to change util.c of
course. I was pretty sure you wouldn't have accepted that.

> Yes all of that might be necessary, but can you post patches that do one
> thing at a time? Like at least one cfg80211/nl80211 patch that adds the
> configurability, and then a mac80211 patch that will use it.
> 
> Also, I think cfg80211 should support advertising to userspace that it's
> supported.
> 
> Yes, I sometimes accept combined cfg80211/mac80211 patches, but I think
> this feature is bigger than that.

Ok, separating cfg from mac. No big deal. I'll have to look how to advertise
something...

But i would appreciate if you could comment on the design of the patch itself.
Basically i just took Benoits approach and made it running. A separate option
for setting channel_type isn't necessary. You could also tell by iw whether to
use HT or not. Or no option at all, a module option ibss_ht etc. Or even setting
full options as hostapd does via iw.

Thanks, Alex


^ permalink raw reply

* [RFC 4/4] mac80211: support for IEEE80211N in IBSS
From: Alexander Simon @ 2011-01-20  9:37 UTC (permalink / raw)
  To: linux-wireless
In-Reply-To: <1295447708.4685.5.camel@jlt3.sipsolutions.net>

This adds some ifs to let the packet aggregation also
work while being in IBSS mode.


diff -Nrup compat-wireless-2011-01-17.1/net/mac80211/agg-rx.c
compat-wireless-2011-01-17/net/mac80211/agg-rx.c
--- compat-wireless-2011-01-17.1/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-19
17:40:36.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.1/net/mac80211/agg-tx.c
compat-wireless-2011-01-17/net/mac80211/agg-tx.c
--- compat-wireless-2011-01-17.1/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-19
17:40:36.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.1/net/mac80211/ht.c
compat-wireless-2011-01-17/net/mac80211/ht.c
--- compat-wireless-2011-01-17.1/net/mac80211/ht.c
	2011-01-17 21:03:25.000000000
+0100
+++ compat-wireless-2011-01-17/net/mac80211/ht.c
	2011-01-19 17:40:36.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.1/net/mac80211/rx.c
compat-wireless-2011-01-17/net/mac80211/rx.c
--- compat-wireless-2011-01-17.1/net/mac80211/rx.c
	2011-01-17 21:03:26.000000000
+0100
+++ compat-wireless-2011-01-17/net/mac80211/rx.c
	2011-01-19 17:40:36.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 */



^ permalink raw reply

* [RFC 3/4] mac80211: support for IEEE80211N in IBSS
From: Alexander Simon @ 2011-01-20  9:26 UTC (permalink / raw)
  To: linux-wireless
In-Reply-To: <1295447708.4685.5.camel@jlt3.sipsolutions.net>

Parse a new stations HT IE.
ieee80211_ibss_add_sta is called with a new argument, ht capabilities of that
new station.
Luckily there was that function ieee80211_ht_cap_ie_to_sta_ht_cap that is
called. This inserts these HT capabilities into the sta_info struct that is eg
used by the rate algorithm.
As mentioned before, this parameter will be NULL when called from rx.c (main
receive path).

diff -Nrup compat-wireless-2011-01-17.2/net/mac80211/ibss.c
compat-wireless-2011-01-17.3//net/mac80211/ibss.c
--- compat-wireless-2011-01-17.2/net/mac80211/ibss.c	2011-01-20
10:02:16.000000000 +0100
+++ compat-wireless-2011-01-17.3//net/mac80211/ibss.c	2011-01-20
10:03:11.000000000 +0100
@@ -391,7 +391,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);
 		}
 
@@ -490,7 +490,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:
@@ -503,8 +503,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;
@@ -544,6 +544,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? */
diff -Nrup compat-wireless-2011-01-17.2/net/mac80211/ieee80211_i.h
compat-wireless-2011-01-17.3//net/mac80211/ieee80211_i.h
--- compat-wireless-2011-01-17.2/net/mac80211/ieee80211_i.h	2011-01-20
10:01:56.000000000 +0100
+++ compat-wireless-2011-01-17.3//net/mac80211/ieee80211_i.h	2011-01-20
10:03:11.000000000 +0100
@@ -1111,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.2/net/mac80211/rx.c
compat-wireless-2011-01-17.3//net/mac80211/rx.c
--- compat-wireless-2011-01-17.2/net/mac80211/rx.c	2011-01-17 21:03:26.000000000
+0100
+++ compat-wireless-2011-01-17.3//net/mac80211/rx.c	2011-01-20
10:03:11.000000000 +0100
@@ -2618,7 +2618,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:



^ permalink raw reply

* Re: [RFC 1/4] mac80211: support for IEEE80211N in IBSS
From: Johannes Berg @ 2011-01-20  9:24 UTC (permalink / raw)
  To: Alexander Simon; +Cc: linux-wireless
In-Reply-To: <loom.20110120T093834-982@post.gmane.org>

On Thu, 2011-01-20 at 09:10 +0000, Alexander Simon wrote:

> What do you mean with a "not so refactoring version"? I am adding a new IE.
> These are only insertions, no other changes. Or do you mean that dev_alloc_skb?
> However, i took the last "try" from Benoit.

Well, then maybe I just discussed this with him -- there's similar code
building the HT IEs for stations, that code should be shared.

> I split my patch into 4 sections: Setting channel_type, Building the HT IE when
> joining an IBSS, parse the HT IE of a newly joined station and enable
> aggregation code for IBSS.
> 
> This first patch adds setting nl80211_channel_type for an IBSS. This is mostly
> Benoits work.
> When a IBSS to connect to is given by iw, there is a new argument to set HT20,
> HT40+ or HT40-.
> When we create an IBSS, we have that struct params where we can find the channel
> type set by iw.
> When we join a already existing IBSS, we don't. If we find a HT IE, then we will
> distinguish our channel type by that.
> Here the problem remains if a legacy station has joined a HT IBSS and we got its
> beacon. Then we'll won't have an HT IE... This has to be fixed, maybe something
> like "found a HT20 STA, switching to HT20. And now found a HT40-, switching to
> HT40-"


Yes all of that might be necessary, but can you post patches that do one
thing at a time? Like at least one cfg80211/nl80211 patch that adds the
configurability, and then a mac80211 patch that will use it.

Also, I think cfg80211 should support advertising to userspace that it's
supported.

Yes, I sometimes accept combined cfg80211/mac80211 patches, but I think
this feature is bigger than that.

johannes



^ permalink raw reply

* [RFC 2/4] mac80211: support for IEEE80211N in IBSS
From: Alexander Simon @ 2011-01-20  9:21 UTC (permalink / raw)
  To: linux-wireless
In-Reply-To: <1295447708.4685.5.camel@jlt3.sipsolutions.net>

Building the HT IE when we join an IBSS.
I think this patch is rather simple to understand. It takes the configured
channel_type and all other else from the interface capabilities (like AMPDU,
SGIs). Beamforming is disabled.
This was adopted from ieee80211_build_preq_ies in util.c.
Yeah and you could ease the last changeset.

diff -Nrup compat-wireless-2011-01-17.1//net/mac80211/ibss.c
compat-wireless-2011-01-17.2//net/mac80211/ibss.c
--- compat-wireless-2011-01-17.1//net/mac80211/ibss.c	2011-01-20
10:01:56.000000000 +0100
+++ compat-wireless-2011-01-17.2//net/mac80211/ibss.c	2011-01-20
10:02:16.000000000 +0100
@@ -174,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;
+		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;
@@ -223,6 +281,7 @@ static void ieee80211_sta_join_ibss(stru
 	int i, j;
 	u16 beacon_int = cbss->beacon_interval;
 	enum nl80211_channel_type channel_type = NL80211_CHAN_NO_HT;
+	const u8 *ht_info_ie;
 
 	lockdep_assert_held(&sdata->u.ibss.mtx);
 
@@ -923,11 +982,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;
 



^ permalink raw reply

* [RFC 1/4] mac80211: support for IEEE80211N in IBSS
From: Alexander Simon @ 2011-01-20  9:10 UTC (permalink / raw)
  To: linux-wireless
In-Reply-To: <1295447708.4685.5.camel@jlt3.sipsolutions.net>

Ok, here we go.

What do you mean with a "not so refactoring version"? I am adding a new IE.
These are only insertions, no other changes. Or do you mean that dev_alloc_skb?
However, i took the last "try" from Benoit.

I split my patch into 4 sections: Setting channel_type, Building the HT IE when
joining an IBSS, parse the HT IE of a newly joined station and enable
aggregation code for IBSS.

This first patch adds setting nl80211_channel_type for an IBSS. This is mostly
Benoits work.
When a IBSS to connect to is given by iw, there is a new argument to set HT20,
HT40+ or HT40-.
When we create an IBSS, we have that struct params where we can find the channel
type set by iw.
When we join a already existing IBSS, we don't. If we find a HT IE, then we will
distinguish our channel type by that.
Here the problem remains if a legacy station has joined a HT IBSS and we got its
beacon. Then we'll won't have an HT IE... This has to be fixed, maybe something
like "found a HT20 STA, switching to HT20. And now found a HT40-, switching to
HT40-"

diff -Nrup compat-wireless-2011-01-17/include/net/cfg80211.h
compat-wireless-2011-01-17.1//include/net/cfg80211.h
--- compat-wireless-2011-01-17/include/net/cfg80211.h	2011-01-17
21:03:26.000000000 +0100
+++ compat-wireless-2011-01-17.1//include/net/cfg80211.h	2011-01-20
09:56:01.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/net/mac80211/ibss.c
compat-wireless-2011-01-17.1//net/mac80211/ibss.c
--- compat-wireless-2011-01-17/net/mac80211/ibss.c	2011-01-17 21:03:25.000000000
+0100
+++ compat-wireless-2011-01-17.1//net/mac80211/ibss.c	2011-01-20
09:56:01.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];
@@ -221,6 +222,7 @@ static void ieee80211_sta_join_ibss(stru
 	u32 basic_rates;
 	int i, j;
 	u16 beacon_int = cbss->beacon_interval;
+	enum nl80211_channel_type channel_type = NL80211_CHAN_NO_HT;
 
 	lockdep_assert_held(&sdata->u.ibss.mtx);
 
@@ -244,9 +246,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);
@@ -565,7 +587,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);
 }
 
@@ -925,13 +947,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/net/mac80211/ieee80211_i.h
compat-wireless-2011-01-17.1//net/mac80211/ieee80211_i.h
--- compat-wireless-2011-01-17/net/mac80211/ieee80211_i.h	2011-01-17
21:03:26.000000000 +0100
+++ compat-wireless-2011-01-17.1//net/mac80211/ieee80211_i.h	2011-01-20
09:56:01.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 */
diff -Nrup compat-wireless-2011-01-17/net/wireless/nl80211.c
compat-wireless-2011-01-17.1//net/wireless/nl80211.c
--- compat-wireless-2011-01-17/net/wireless/nl80211.c	2011-01-17
21:03:26.000000000 +0100
+++ compat-wireless-2011-01-17.1//net/wireless/nl80211.c	2011-01-20
09:56:01.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

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

Am Donnerstag, 20. Januar 2011 schrieb Jussi Kivilinna:
> Quoting Christian Lamparter <chunkeey@googlemail.com>:
> > 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].
> >
> 
> What I understood from that thread is that rt2x00/usb doesn't have HW  
> buffering and doesn't enable IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING  
> (rt2x00/pci does), and yet enables AP-mode. Driver has this comment:
> 	/*
> 	 * Initialize all hw fields.
> 	 *
> 	 * Don't set IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING unless we are
> 	 * capable of sending the buffered frames out after the DTIM
> 	 * transmission using rt2x00lib_beacondone. This will send out
> 	 * multicast and broadcast traffic immediately instead of buffering it
> 	 * infinitly and thus dropping it after some time.
> 	 */

Yep, your interpretation is correct. Multi- and broadcast buffering in mac80211
will stay, but only if your device is able to send them out in a timely manner,
which rt2x00 usb devices are not.

Helmut

^ permalink raw reply

* RE: [RFT 0/8] Clean proto/ethernet.h and remove it.
From: Arend Van Spriel @ 2011-01-20  8:58 UTC (permalink / raw)
  To: Jonas Gorski, linux-wireless@vger.kernel.org,
	devel@linuxdriverproject.org, gregkh@suse.de
  Cc: Brett Rudley, Henry Ptasinski, Dowan Kim, Roland Vossen
In-Reply-To: <1295476532-21130-1-git-send-email-jonas.gorski@gmail.com>

Hi Jonas,

The brcm80211 driver is currently a staging driver and as such maintained by GregKH (git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6.git). In the staging-next branch of that repository similar patches have already been posted. Maybe they are still in the queue.

Gr. AvS
________________________________________
From: Jonas Gorski [jonas.gorski@gmail.com]
Sent: Wednesday, January 19, 2011 11:35 PM
To: linux-wireless@vger.kernel.org
Cc: Brett Rudley; Henry Ptasinski; Dowan Kim; Roland Vossen; Arend Van Spriel
Subject: [RFT 0/8] Clean proto/ethernet.h and remove it.

After the short discussion I started cleaning up the code, and this is the
first small patch series. I thought I'll start with rather simple
replacements.

This series replaces everything from proto/ethernet.h with their
equivalents in the kernel and then removes it.

It does not fix previously existing style violations, so checkpatch still
complains about too long lines; I will address these in further patches.

Since I do not have a supported device at hand, I'd be happy if anyone
could test that I didn't break anything while replacing things. Especially
in patch 7 (Replace ether_addr with fixed size array) I might have broken
something.

--

Jonas

Jonas Gorski (8):
  staging: brcm80211: Remove unused ETHER_<foo> macros.
  staging: brcm80211: Use linux ethhdr struct.
  staging: brcm80211: Remove unused ETHER_<foo> defines.
  staging: brcm80211: Remove ETHER_MAX_LEN definition.
  staging: brcm80211: Remove ETHER_TYPE_BRCM.
  staging: brcm80211: Remove static ether_bcast.
  staging: brcm80211: Replace ether_addr with fixed size array.
  staging: brcm80211: Remove proto/ethernet.h.

 drivers/staging/brcm80211/brcmfmac/dhd_linux.c     |   19 +++---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c      |    1 -
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c   |    5 +-
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h   |    1 -
 drivers/staging/brcm80211/brcmfmac/wl_iw.c         |    5 +-
 drivers/staging/brcm80211/brcmfmac/wl_iw.h         |    1 -
 drivers/staging/brcm80211/include/bcmcdc.h         |    3 +-
 drivers/staging/brcm80211/include/bcmutils.h       |    2 +-
 drivers/staging/brcm80211/include/proto/802.11.h   |   20 +++---
 drivers/staging/brcm80211/include/proto/bcmevent.h |    8 ++-
 drivers/staging/brcm80211/include/proto/ethernet.h |   72 --------------------
 drivers/staging/brcm80211/include/proto/wpa.h      |    2 -
 drivers/staging/brcm80211/include/wlioctl.h        |   23 +++---
 drivers/staging/brcm80211/sys/wl_mac80211.c        |    3 +-
 drivers/staging/brcm80211/sys/wlc_alloc.c          |    4 +-
 drivers/staging/brcm80211/sys/wlc_ampdu.c          |    2 +-
 drivers/staging/brcm80211/sys/wlc_bmac.c           |   34 ++++-----
 drivers/staging/brcm80211/sys/wlc_bmac.h           |   14 ++--
 drivers/staging/brcm80211/sys/wlc_bsscfg.h         |    6 +-
 drivers/staging/brcm80211/sys/wlc_key.h            |    2 +-
 drivers/staging/brcm80211/sys/wlc_mac80211.c       |   55 +++++++--------
 drivers/staging/brcm80211/sys/wlc_mac80211.h       |   12 ++--
 drivers/staging/brcm80211/sys/wlc_pub.h            |   10 ++--
 drivers/staging/brcm80211/sys/wlc_scb.h            |    2 +-
 drivers/staging/brcm80211/util/bcmsrom.c           |   18 ++---
 drivers/staging/brcm80211/util/bcmutils.c          |    5 +-
 26 files changed, 117 insertions(+), 212 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/include/proto/ethernet.h




^ permalink raw reply

* Re: ath9k problem with kernel 2.6.37
From: Mohammed Shafi @ 2011-01-20  8:35 UTC (permalink / raw)
  To: James; +Cc: linux-wireless
In-Reply-To: <4D37E2A9.6010209@lockie.ca>

On Thu, Jan 20, 2011 at 12:52 PM, James <bjlockie@lockie.ca> wrote:
> phy0: Atheros AR5416 MAC/BB Rev:2 AR2133 RF Rev:81
> mem=0xffffc90001880000, irq=17
>
> I get few or no results when I do
> iwlist wlan1 scan with kernel 2.6.37
>

We will check it out

> but it is consistently good with kernel 2.6.36.2
>
> Is there a way to compare the kernel configs to make sure I didn't
> change anything?

Please try with latest compat wireless, which might be helpful

> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply

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

Quoting Christian Lamparter <chunkeey@googlemail.com>:

> 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].
>

What I understood from that thread is that rt2x00/usb doesn't have HW  
buffering and doesn't enable IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING  
(rt2x00/pci does), and yet enables AP-mode. Driver has this comment:
	/*
	 * Initialize all hw fields.
	 *
	 * Don't set IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING unless we are
	 * capable of sending the buffered frames out after the DTIM
	 * transmission using rt2x00lib_beacondone. This will send out
	 * multicast and broadcast traffic immediately instead of buffering it
	 * infinitly and thus dropping it after some time.
	 */

>>>>> 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.)
>

No such flag I'm afraid. Vendor driver appears to be reading  
tsf-register from driver and writing value to probe response frames,  
maybe something I should add to zd1211rw too.

-Jussi


^ permalink raw reply

* Re: [PATCH 2/2] ath9k: Fix power save usage count imbalance on deinit
From: Rajkumar Manoharan @ 2011-01-20  7:51 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Rajkumar Manoharan, linux-wireless@vger.kernel.org,
	stable@kernel.org
In-Reply-To: <AANLkTimSBJxY0f6G6BLcLbsDySvn6KZQu=Vdj134yZLD@mail.gmail.com>

On Thu, Jan 20, 2011 at 12:54:56AM +0530, Luis R. Rodriguez wrote:
> 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]()
> >
> 
> Are you sure this hunk does not regress the suspend/resume case when
> using the new dbus API?
>
I verfied the suspend/resume case with AR9280 card. But I don't
understand how the new dbus API is related with this patch?

--
Rajkumar

^ permalink raw reply

* ath9k problem with kernel 2.6.37
From: James @ 2011-01-20  7:22 UTC (permalink / raw)
  To: linux-wireless

phy0: Atheros AR5416 MAC/BB Rev:2 AR2133 RF Rev:81
mem=0xffffc90001880000, irq=17

I get few or no results when I do
iwlist wlan1 scan with kernel 2.6.37

but it is consistently good with kernel 2.6.36.2

Is there a way to compare the kernel configs to make sure I didn't
change anything?

^ permalink raw reply

* [RFC 3/3]staging: brcm80211 Remove WAKE_LOCK
From: Justin P. Mattock @ 2011-01-20  6:16 UTC (permalink / raw)
  To: linux-wireless; +Cc: linux-kernel, gregkh, Justin P. Mattock
In-Reply-To: <1295504166-1042-2-git-send-email-justinmattock@gmail.com>

The patch below removes WAKE_LOCK since it is no longer in the kernel.
Please let me know, if this is the proper way of doing this and/or more needs
to be done..

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c |    2 -
 drivers/staging/brcm80211/brcmfmac/dhd.h          |   15 ---------
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c    |   33 ---------------------
 drivers/staging/brcm80211/brcmfmac/wl_iw.c        |    4 --
 4 files changed, 0 insertions(+), 54 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
index d24b5e7..143e860 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
@@ -328,8 +328,6 @@ static irqreturn_t wlan_oob_irq(int irq, void *dev_id)
 		return IRQ_HANDLED;
 	}
 
-	WAKE_LOCK_TIMEOUT(dhdp, WAKE_LOCK_TMOUT, 25);
-
 	dhdsdio_isr((void *)dhdp->bus);
 
 	return IRQ_HANDLED;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 6a382c8..4383210 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -49,21 +49,6 @@ enum dhd_bus_state {
 	DHD_BUS_DATA		/* Ready for frame transfers */
 };
 
-enum dhd_bus_wake_state {
-	WAKE_LOCK_OFF,
-	WAKE_LOCK_PRIV,
-	WAKE_LOCK_DPC,
-	WAKE_LOCK_IOCTL,
-	WAKE_LOCK_DOWNLOAD,
-	WAKE_LOCK_TMOUT,
-	WAKE_LOCK_WATCHDOG,
-	WAKE_LOCK_LINK_DOWN_TMOUT,
-	WAKE_LOCK_PNO_FIND_TMOUT,
-	WAKE_LOCK_SOFTAP_SET,
-	WAKE_LOCK_SOFTAP_STOP,
-	WAKE_LOCK_SOFTAP_START,
-	WAKE_LOCK_MAX
-};
 enum dhd_prealloc_index {
 	DHD_PREALLOC_PROT = 0,
 	DHD_PREALLOC_RXBUF,
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index db45083..bf9e01a 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -1045,7 +1045,6 @@ int dhd_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf)
 #ifdef BCMDBUS
 	ret = dbus_send_pkt(dhdp->dbus, pktbuf, NULL /* pktinfo */);
 #else
-	WAKE_LOCK_TIMEOUT(dhdp, WAKE_LOCK_TMOUT, 25);
 	ret = dhd_bus_txdata(dhdp->bus, pktbuf);
 #endif				/* BCMDBUS */
 
@@ -1304,7 +1303,6 @@ static struct net_device_stats *dhd_get_stats(struct net_device *net)
 static int dhd_watchdog_thread(void *data)
 {
 	dhd_info_t *dhd = (dhd_info_t *) data;
-	WAKE_LOCK_INIT(&dhd->pub, WAKE_LOCK_WATCHDOG, "dhd_watchdog_thread");
 
 	/* This thread doesn't need any user-level access,
 	 * so get rid of all our resources
@@ -1325,18 +1323,14 @@ static int dhd_watchdog_thread(void *data)
 			break;
 		if (down_interruptible(&dhd->watchdog_sem) == 0) {
 			if (dhd->pub.dongle_reset == false) {
-				WAKE_LOCK(&dhd->pub, WAKE_LOCK_WATCHDOG);
 				/* Call the bus module watchdog */
 				dhd_bus_watchdog(&dhd->pub);
-				WAKE_UNLOCK(&dhd->pub, WAKE_LOCK_WATCHDOG);
 			}
 			/* Count the tick for reference */
 			dhd->pub.tickcnt++;
 		} else
 			break;
 	}
-
-	WAKE_LOCK_DESTROY(&dhd->pub, WAKE_LOCK_WATCHDOG);
 	return 0;
 }
 
@@ -1370,7 +1364,6 @@ static int dhd_dpc_thread(void *data)
 {
 	dhd_info_t *dhd = (dhd_info_t *) data;
 
-	WAKE_LOCK_INIT(&dhd->pub, WAKE_LOCK_DPC, "dhd_dpc_thread");
 	/* This thread doesn't need any user-level access,
 	 * so get rid of all our resources
 	 */
@@ -1393,21 +1386,15 @@ static int dhd_dpc_thread(void *data)
 			/* Call bus dpc unless it indicated down
 				 (then clean stop) */
 			if (dhd->pub.busstate != DHD_BUS_DOWN) {
-				WAKE_LOCK(&dhd->pub, WAKE_LOCK_DPC);
 				if (dhd_bus_dpc(dhd->pub.bus)) {
 					up(&dhd->dpc_sem);
-					WAKE_LOCK_TIMEOUT(&dhd->pub,
-							  WAKE_LOCK_TMOUT, 25);
 				}
-				WAKE_UNLOCK(&dhd->pub, WAKE_LOCK_DPC);
 			} else {
 				dhd_bus_stop(dhd->pub.bus, true);
 			}
 		} else
 			break;
 	}
-
-	WAKE_LOCK_DESTROY(&dhd->pub, WAKE_LOCK_DPC);
 	return 0;
 }
 
@@ -1797,14 +1784,9 @@ static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
 	if (is_set_key_cmd)
 		dhd_wait_pend8021x(net);
 
-	WAKE_LOCK_INIT(&dhd->pub, WAKE_LOCK_IOCTL, "dhd_ioctl_entry");
-	WAKE_LOCK(&dhd->pub, WAKE_LOCK_IOCTL);
-
 	bcmerror =
 	    dhd_prot_ioctl(&dhd->pub, ifidx, (wl_ioctl_t *)&ioc, buf, buflen);
 
-	WAKE_UNLOCK(&dhd->pub, WAKE_LOCK_IOCTL);
-	WAKE_LOCK_DESTROY(&dhd->pub, WAKE_LOCK_IOCTL);
 done:
 	if (!bcmerror && buf && ioc.buf) {
 		if (copy_to_user(ioc.buf, buf, buflen))
@@ -2115,11 +2097,6 @@ dhd_pub_t *dhd_attach(struct osl_info *osh, struct dhd_bus *bus,
 #endif	/* defined(CONFIG_PM_SLEEP) */
 	/* && defined(DHD_GPL) */
 	/* Init lock suspend to prevent kernel going to suspend */
-	WAKE_LOCK_INIT(&dhd->pub, WAKE_LOCK_TMOUT, "dhd_wake_lock");
-	WAKE_LOCK_INIT(&dhd->pub, WAKE_LOCK_LINK_DOWN_TMOUT,
-		       "dhd_wake_lock_link_dw_event");
-	WAKE_LOCK_INIT(&dhd->pub, WAKE_LOCK_PNO_FIND_TMOUT,
-		       "dhd_wake_lock_link_pno_find_event");
 #ifdef CONFIG_HAS_EARLYSUSPEND
 	dhd->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 20;
 	dhd->early_suspend.suspend = dhd_early_suspend;
@@ -2153,20 +2130,13 @@ int dhd_bus_start(dhd_pub_t *dhdp)
 
 	/* try to download image and nvram to the dongle */
 	if (dhd->pub.busstate == DHD_BUS_DOWN) {
-		WAKE_LOCK_INIT(dhdp, WAKE_LOCK_DOWNLOAD, "dhd_bus_start");
-		WAKE_LOCK(dhdp, WAKE_LOCK_DOWNLOAD);
 		if (!(dhd_bus_download_firmware(dhd->pub.bus, dhd->pub.osh,
 						fw_path, nv_path))) {
 			DHD_ERROR(("%s: dhdsdio_probe_download failed. "
 				"firmware = %s nvram = %s\n",
 				__func__, fw_path, nv_path));
-			WAKE_UNLOCK(dhdp, WAKE_LOCK_DOWNLOAD);
-			WAKE_LOCK_DESTROY(dhdp, WAKE_LOCK_DOWNLOAD);
 			return -1;
 		}
-
-		WAKE_UNLOCK(dhdp, WAKE_LOCK_DOWNLOAD);
-		WAKE_LOCK_DESTROY(dhdp, WAKE_LOCK_DOWNLOAD);
 	}
 
 	/* Start the watchdog timer */
@@ -2432,9 +2402,6 @@ void dhd_detach(dhd_pub_t *dhdp)
 			unregister_pm_notifier(&dhd_sleep_pm_notifier);
 #endif	/* defined(CONFIG_PM_SLEEP) */
 			/* && defined(DHD_GPL) */
-			WAKE_LOCK_DESTROY(dhdp, WAKE_LOCK_TMOUT);
-			WAKE_LOCK_DESTROY(dhdp, WAKE_LOCK_LINK_DOWN_TMOUT);
-			WAKE_LOCK_DESTROY(dhdp, WAKE_LOCK_PNO_FIND_TMOUT);
 			free_netdev(ifp->net);
 			kfree(ifp);
 			kfree(dhd);
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_iw.c b/drivers/staging/brcm80211/brcmfmac/wl_iw.c
index db6e68e..bbce44c 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_iw.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_iw.c
@@ -3409,8 +3409,6 @@ void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void *data)
 		if (!(flags & WLC_EVENT_MSG_LINK)) {
 			memset(wrqu.addr.sa_data, 0, ETH_ALEN);
 			memset(&extra, 0, ETH_ALEN);
-			WAKE_LOCK_TIMEOUT(iw->pub, WAKE_LOCK_LINK_DOWN_TMOUT,
-					  20 * HZ);
 		} else {
 			memcpy(wrqu.addr.sa_data, &e->addr, ETH_ALEN);
 			WL_TRACE("Link UP\n");
@@ -3523,8 +3521,6 @@ void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void *data)
 			WL_ERROR("%s Event WLC_E_PFN_NET_FOUND, send %s up : find %s len=%d\n",
 				 __func__, PNO_EVENT_UP,
 				 ssid->SSID, ssid->SSID_len);
-			WAKE_LOCK_TIMEOUT(iw->pub, WAKE_LOCK_PNO_FIND_TMOUT,
-					  20 * HZ);
 			cmd = IWEVCUSTOM;
 			memset(&wrqu, 0, sizeof(wrqu));
 			strcpy(extra, PNO_EVENT_UP);
-- 
1.6.5.GIT


^ permalink raw reply related

* [RFC 2/3]staging: ath6kl Remove CONFIG_HAS_WAKELOCK
From: Justin P. Mattock @ 2011-01-20  6:16 UTC (permalink / raw)
  To: linux-wireless; +Cc: linux-kernel, gregkh, Justin P. Mattock
In-Reply-To: <1295504166-1042-1-git-send-email-justinmattock@gmail.com>

The patch below removes CONFIG_HAS_WAKELOCK since it is no longer in the kernel.
Please let me know, if this is the proper way of doing this and/or more needs
to be done..

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>

---
 drivers/staging/ath6kl/os/linux/ar6000_android.c |   23 ------------------
 drivers/staging/ath6kl/os/linux/ar6000_pm.c      |   28 ----------------------
 2 files changed, 0 insertions(+), 51 deletions(-)

diff --git a/drivers/staging/ath6kl/os/linux/ar6000_android.c b/drivers/staging/ath6kl/os/linux/ar6000_android.c
index a588825..dbde05f 100644
--- a/drivers/staging/ath6kl/os/linux/ar6000_android.c
+++ b/drivers/staging/ath6kl/os/linux/ar6000_android.c
@@ -25,9 +25,6 @@
 #include <linux/vmalloc.h>
 #include <linux/fs.h>
 
-#ifdef CONFIG_HAS_WAKELOCK
-#include <linux/wakelock.h>
-#endif
 #ifdef CONFIG_HAS_EARLYSUSPEND
 #include <linux/earlysuspend.h>
 #endif
@@ -44,11 +41,6 @@ extern int bmienable;
 extern struct net_device *ar6000_devices[];
 extern char ifname[];
 
-#ifdef CONFIG_HAS_WAKELOCK
-extern struct wake_lock ar6k_wow_wake_lock;
-struct wake_lock ar6k_init_wake_lock;
-#endif
-
 const char def_ifname[] = "wlan0";
 module_param_string(fwpath, fwpath, sizeof(fwpath), 0644);
 module_param(enablelogcat, uint, 0644);
@@ -280,14 +272,8 @@ void android_release_firmware(const struct firmware *firmware)
 static A_STATUS ar6000_android_avail_ev(void *context, void *hif_handle)
 {
     A_STATUS ret;    
-#ifdef CONFIG_HAS_WAKELOCK
-    wake_lock(&ar6k_init_wake_lock);
-#endif
     ar6000_enable_mmchost_detect_change(0);
     ret = ar6000_avail_ev_p(context, hif_handle);
-#ifdef CONFIG_HAS_WAKELOCK
-    wake_unlock(&ar6k_init_wake_lock);
-#endif
     return ret;
 }
 
@@ -328,9 +314,6 @@ void android_module_init(OSDRV_CALLBACKS *osdrvCallbacks)
     bmienable = 1;
     if (ifname[0] == '\0')
         strcpy(ifname, def_ifname);
-#ifdef CONFIG_HAS_WAKELOCK
-    wake_lock_init(&ar6k_init_wake_lock, WAKE_LOCK_SUSPEND, "ar6k_init");
-#endif
 #ifdef CONFIG_HAS_EARLYSUSPEND
     ar6k_early_suspend.suspend = android_early_suspend;
     ar6k_early_suspend.resume  = android_late_resume;
@@ -349,9 +332,6 @@ void android_module_exit(void)
 #ifdef CONFIG_HAS_EARLYSUSPEND
     unregister_early_suspend(&ar6k_early_suspend);
 #endif
-#ifdef CONFIG_HAS_WAKELOCK
-    wake_lock_destroy(&ar6k_init_wake_lock);
-#endif
     ar6000_enable_mmchost_detect_change(1);
 }
 
@@ -395,9 +375,6 @@ void android_ar6k_check_wow_status(AR_SOFTC_T *ar, struct sk_buff *skb, A_BOOL i
         }
         if (needWake) {
             /* keep host wake up if there is any event and packate comming in*/
-#ifdef CONFIG_HAS_WAKELOCK
-            wake_lock_timeout(&ar6k_wow_wake_lock, 3*HZ);
-#endif
             if (wowledon) {
                 char buf[32];
                 int len = sprintf(buf, "on");
diff --git a/drivers/staging/ath6kl/os/linux/ar6000_pm.c b/drivers/staging/ath6kl/os/linux/ar6000_pm.c
index b937df9..13195d4 100644
--- a/drivers/staging/ath6kl/os/linux/ar6000_pm.c
+++ b/drivers/staging/ath6kl/os/linux/ar6000_pm.c
@@ -30,23 +30,12 @@
 #include <linux/platform_device.h>
 #include "wlan_config.h"
 
-#ifdef CONFIG_HAS_WAKELOCK
-#include <linux/wakelock.h>
-#endif
-
 #define WOW_ENABLE_MAX_INTERVAL 0
 #define WOW_SET_SCAN_PARAMS     0
 
 extern unsigned int wmitimeout;
 extern wait_queue_head_t arEvent;
 
-#ifdef CONFIG_PM
-#ifdef CONFIG_HAS_WAKELOCK
-struct wake_lock ar6k_suspend_wake_lock;
-struct wake_lock ar6k_wow_wake_lock;
-#endif
-#endif /* CONFIG_PM */
-
 #ifdef ANDROID_ENV
 extern void android_ar6k_check_wow_status(AR_SOFTC_T *ar, struct sk_buff *skb, A_BOOL isEvent);
 #endif
@@ -89,9 +78,6 @@ static void ar6000_wow_resume(AR_SOFTC_T *ar)
         A_UINT16 bg_period = (ar->scParams.bg_period==0) ? 60 : ar->scParams.bg_period;
         WMI_SET_HOST_SLEEP_MODE_CMD hostSleepMode = {TRUE, FALSE};
         ar->arWowState = WLAN_WOW_STATE_NONE;
-#ifdef CONFIG_HAS_WAKELOCK
-        wake_lock_timeout(&ar6k_wow_wake_lock, 3*HZ);
-#endif
         if (wmi_set_host_sleep_mode_cmd(ar->arWmi, &hostSleepMode)!=A_OK) {
             AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to setup restore host awake\n"));
         }
@@ -267,9 +253,6 @@ A_STATUS ar6000_resume_ev(void *context)
     AR_SOFTC_T *ar = (AR_SOFTC_T *)context;
     A_UINT16 powerState = ar->arWlanPowerState;
 
-#ifdef CONFIG_HAS_WAKELOCK
-    wake_lock(&ar6k_suspend_wake_lock);
-#endif
     AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("%s: enter previous state %d wowState %d\n", __func__, powerState, ar->arWowState));
     switch (powerState) {
     case WLAN_POWER_STATE_WOW:
@@ -287,9 +270,6 @@ A_STATUS ar6000_resume_ev(void *context)
         AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Strange SDIO bus power mode!!\n"));
         break;
     }
-#ifdef CONFIG_HAS_WAKELOCK
-    wake_unlock(&ar6k_suspend_wake_lock);
-#endif
     return A_OK;
 }
 
@@ -704,10 +684,6 @@ void ar6000_pm_init()
 {
     A_REGISTER_MODULE_DEBUG_INFO(pm);
 #ifdef CONFIG_PM
-#ifdef CONFIG_HAS_WAKELOCK
-    wake_lock_init(&ar6k_suspend_wake_lock, WAKE_LOCK_SUSPEND, "ar6k_suspend");
-    wake_lock_init(&ar6k_wow_wake_lock, WAKE_LOCK_SUSPEND, "ar6k_wow");
-#endif
     /*
      * Register ar6000_pm_device into system.
      * We should also add platform_device into the first item of array
@@ -723,9 +699,5 @@ void ar6000_pm_exit()
 {
 #ifdef CONFIG_PM
     platform_driver_unregister(&ar6000_pm_device);
-#ifdef CONFIG_HAS_WAKELOCK
-    wake_lock_destroy(&ar6k_suspend_wake_lock);
-    wake_lock_destroy(&ar6k_wow_wake_lock);
-#endif
 #endif /* CONFIG_PM */
 }
-- 
1.6.5.GIT


^ permalink raw reply related

* [RFC 1/3]staging: brcm80211 dhd.h Remove CONFIG_HAS_WAKELOCK
From: Justin P. Mattock @ 2011-01-20  6:16 UTC (permalink / raw)
  To: linux-wireless; +Cc: linux-kernel, gregkh, Justin P. Mattock

Note:not sure if there is already something like this submitted or not.

The first two patches removes CONFIG_HAS_WAKELOCK since it is no longer in the kernel.
Please let me know, if this is the proper way of doing this and/or more needs
to be done..


Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>

---
 drivers/staging/brcm80211/brcmfmac/dhd.h |   41 ------------------------------
 1 files changed, 0 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 69c6a02..6a382c8 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -33,9 +33,6 @@
 #include <linux/ethtool.h>
 #include <asm/uaccess.h>
 #include <asm/unaligned.h>
-#if defined(CONFIG_HAS_WAKELOCK)
-#include <linux/wakelock.h>
-#endif			/* defined (CONFIG_HAS_WAKELOCK) */
 /* The kernel threading is sdio-specific */
 
 #include <wlioctl.h>
@@ -145,9 +142,6 @@ typedef struct dhd_pub {
 	u8 country_code[WLC_CNTRY_BUF_SZ];
 	char eventmask[WL_EVENTING_MASK_LEN];
 
-#if defined(CONFIG_HAS_WAKELOCK)
-	struct wake_lock wakelock[WAKE_LOCK_MAX];
-#endif		/*  defined (CONFIG_HAS_WAKELOCK) */
 } dhd_pub_t;
 
 #if defined(CONFIG_PM_SLEEP)
@@ -230,41 +224,6 @@ static inline void MUTEX_UNLOCK_WL_SCAN_SET(void)
 {
 }
 
-static inline void WAKE_LOCK_INIT(dhd_pub_t *dhdp, int index, char *y)
-{
-#if defined(CONFIG_HAS_WAKELOCK)
-	wake_lock_init(&dhdp->wakelock[index], WAKE_LOCK_SUSPEND, y);
-#endif	/* defined (CONFIG_HAS_WAKELOCK) */
-}
-
-static inline void WAKE_LOCK(dhd_pub_t *dhdp, int index)
-{
-#if defined(CONFIG_HAS_WAKELOCK)
-	wake_lock(&dhdp->wakelock[index]);
-#endif	/* defined (CONFIG_HAS_WAKELOCK) */
-}
-
-static inline void WAKE_UNLOCK(dhd_pub_t *dhdp, int index)
-{
-#if defined(CONFIG_HAS_WAKELOCK)
-	wake_unlock(&dhdp->wakelock[index]);
-#endif	/* defined (CONFIG_HAS_WAKELOCK) */
-}
-
-static inline void WAKE_LOCK_TIMEOUT(dhd_pub_t *dhdp, int index, long time)
-{
-#if defined(CONFIG_HAS_WAKELOCK)
-	wake_lock_timeout(&dhdp->wakelock[index], time);
-#endif	/* defined (CONFIG_HAS_WAKELOCK) */
-}
-
-static inline void WAKE_LOCK_DESTROY(dhd_pub_t *dhdp, int index)
-{
-#if defined(CONFIG_HAS_WAKELOCK)
-	wake_lock_destroy(&dhdp->wakelock[index]);
-#endif /* defined (CONFIG_HAS_WAKELOCK) */
-}
-
 typedef struct dhd_if_event {
 	u8 ifidx;
 	u8 action;
-- 
1.6.5.GIT


^ permalink raw reply related

* [RFT 7/8] staging: brcm80211: Replace ether_addr with fixed size array.
From: Jonas Gorski @ 2011-01-19 22:35 UTC (permalink / raw)
  To: linux-wireless
  Cc: Brett Rudley, Henry Ptasinski, Dowan Kim, Roland Vossen,
	Arend van Spriel
In-Reply-To: <1295476532-21130-7-git-send-email-jonas.gorski@gmail.com>

Replace the ether_addr struct with a fixed size array.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 drivers/staging/brcm80211/include/bcmutils.h       |    2 +-
 drivers/staging/brcm80211/include/proto/802.11.h   |   18 ++++----
 drivers/staging/brcm80211/include/proto/bcmevent.h |    2 +-
 drivers/staging/brcm80211/include/proto/ethernet.h |    8 ---
 drivers/staging/brcm80211/include/wlioctl.h        |   22 ++++----
 drivers/staging/brcm80211/sys/wl_mac80211.c        |    3 +-
 drivers/staging/brcm80211/sys/wlc_alloc.c          |    4 +-
 drivers/staging/brcm80211/sys/wlc_ampdu.c          |    2 +-
 drivers/staging/brcm80211/sys/wlc_bmac.c           |   34 ++++++-------
 drivers/staging/brcm80211/sys/wlc_bmac.h           |   14 ++---
 drivers/staging/brcm80211/sys/wlc_bsscfg.h         |    6 +-
 drivers/staging/brcm80211/sys/wlc_key.h            |    2 +-
 drivers/staging/brcm80211/sys/wlc_mac80211.c       |   50 +++++++++-----------
 drivers/staging/brcm80211/sys/wlc_mac80211.h       |   12 ++---
 drivers/staging/brcm80211/sys/wlc_pub.h            |   10 ++--
 drivers/staging/brcm80211/sys/wlc_scb.h            |    2 +-
 drivers/staging/brcm80211/util/bcmsrom.c           |   16 +++---
 drivers/staging/brcm80211/util/bcmutils.c          |    4 +-
 18 files changed, 95 insertions(+), 116 deletions(-)

diff --git a/drivers/staging/brcm80211/include/bcmutils.h b/drivers/staging/brcm80211/include/bcmutils.h
index a8f76d8..7e6c1b0 100644
--- a/drivers/staging/brcm80211/include/bcmutils.h
+++ b/drivers/staging/brcm80211/include/bcmutils.h
@@ -157,7 +157,7 @@ extern struct sk_buff *pktq_mdeq(struct pktq *pq, uint prec_bmp, int *prec_out);
 	extern uint pkttotlen(struct osl_info *osh, struct sk_buff *p);
 
 /* ethernet address */
-	extern int bcm_ether_atoe(char *p, struct ether_addr *ea);
+	extern int bcm_ether_atoe(char *p, u8 *ea);
 
 /* ip address */
 	struct ipv4_addr;
diff --git a/drivers/staging/brcm80211/include/proto/802.11.h b/drivers/staging/brcm80211/include/proto/802.11.h
index ffde19c..11940fe 100644
--- a/drivers/staging/brcm80211/include/proto/802.11.h
+++ b/drivers/staging/brcm80211/include/proto/802.11.h
@@ -48,18 +48,18 @@
 BWL_PRE_PACKED_STRUCT struct dot11_header {
 	u16 fc;
 	u16 durid;
-	struct ether_addr a1;
-	struct ether_addr a2;
-	struct ether_addr a3;
+	u8 a1[ETH_ALEN];
+	u8 a2[ETH_ALEN];
+	u8 a3[ETH_ALEN];
 	u16 seq;
-	struct ether_addr a4;
+	u8 a4[ETH_ALEN];
 } BWL_POST_PACKED_STRUCT;
 
 BWL_PRE_PACKED_STRUCT struct dot11_rts_frame {
 	u16 fc;
 	u16 durid;
-	struct ether_addr ra;
-	struct ether_addr ta;
+	u8 ra[ETH_ALEN];
+	u8 ta[ETH_ALEN];
 } BWL_POST_PACKED_STRUCT;
 
 #define	DOT11_RTS_LEN		16
@@ -72,9 +72,9 @@ BWL_PRE_PACKED_STRUCT struct dot11_rts_frame {
 BWL_PRE_PACKED_STRUCT struct dot11_management_header {
 	u16 fc;
 	u16 durid;
-	struct ether_addr da;
-	struct ether_addr sa;
-	struct ether_addr bssid;
+	u8 da[ETH_ALEN];
+	u8 sa[ETH_ALEN];
+	u8 bssid[ETH_ALEN];
 	u16 seq;
 } BWL_POST_PACKED_STRUCT;
 #define	DOT11_MGMT_HDR_LEN	24
diff --git a/drivers/staging/brcm80211/include/proto/bcmevent.h b/drivers/staging/brcm80211/include/proto/bcmevent.h
index f61c048..5802ea0 100644
--- a/drivers/staging/brcm80211/include/proto/bcmevent.h
+++ b/drivers/staging/brcm80211/include/proto/bcmevent.h
@@ -34,7 +34,7 @@ typedef BWL_PRE_PACKED_STRUCT struct {
 	u32 reason;
 	u32 auth_type;
 	u32 datalen;
-	struct ether_addr addr;
+	u8 addr[ETH_ALEN];
 	char ifname[BCM_MSG_IFNAME_MAX];
 } BWL_POST_PACKED_STRUCT wl_event_msg_t;
 
diff --git a/drivers/staging/brcm80211/include/proto/ethernet.h b/drivers/staging/brcm80211/include/proto/ethernet.h
index b401fda..f52f430 100644
--- a/drivers/staging/brcm80211/include/proto/ethernet.h
+++ b/drivers/staging/brcm80211/include/proto/ethernet.h
@@ -19,12 +19,4 @@
 
 #include <linux/if_ether.h>
 
-#include <packed_section_start.h>
-
-BWL_PRE_PACKED_STRUCT struct ether_addr {
-	u8 octet[ETH_ALEN];
-} BWL_POST_PACKED_STRUCT;
-
-#include <packed_section_end.h>
-
 #endif				/* _NET_ETHERNET_H_ */
diff --git a/drivers/staging/brcm80211/include/wlioctl.h b/drivers/staging/brcm80211/include/wlioctl.h
index 9be793c..9b85f31 100644
--- a/drivers/staging/brcm80211/include/wlioctl.h
+++ b/drivers/staging/brcm80211/include/wlioctl.h
@@ -46,7 +46,7 @@ typedef struct wl_bss_info {
 	u32 length;		/* byte length of data in this record,
 				 * starting at version and including IEs
 				 */
-	struct ether_addr BSSID;
+	u8 BSSID[ETH_ALEN];
 	u16 beacon_period;	/* units are Kusec */
 	u16 capability;	/* Capability information */
 	u8 SSID_len;
@@ -128,7 +128,7 @@ typedef struct wl_extdscan_params {
 
 typedef struct wl_scan_params {
 	wlc_ssid_t ssid;	/* default: {0, ""} */
-	struct ether_addr bssid;	/* default: bcast */
+	u8 bssid[ETH_ALEN];	/* default: bcast */
 	s8 bss_type;		/* default: any,
 				 * DOT11_BSSTYPE_ANY/INFRASTRUCTURE/INDEPENDENT
 				 */
@@ -234,8 +234,8 @@ typedef struct wl_iscan_results {
 
 typedef struct wl_probe_params {
 	wlc_ssid_t ssid;
-	struct ether_addr bssid;
-	struct ether_addr mac;
+	u8 bssid[ETH_ALEN];
+	u8 mac[ETH_ALEN];
 } wl_probe_params_t;
 #endif /* BRCM_FULLMAC */
 
@@ -262,7 +262,7 @@ typedef struct wl_u32_list {
 
 /* used for association with a specific BSSID and chanspec list */
 typedef struct wl_assoc_params {
-	struct ether_addr bssid;	/* 00:00:00:00:00:00: broadcast scan */
+	u8 bssid[ETH_ALEN];	/* 00:00:00:00:00:00: broadcast scan */
 	s32 chanspec_num;	/* 0: all available channels,
 				 * otherwise count of chanspecs in chanspec_list
 				 */
@@ -492,7 +492,7 @@ typedef struct wl_wsec_key {
 		u16 lo;	/* lower 16 bits of IV */
 	} rxiv;
 	u32 pad_5[2];
-	struct ether_addr ea;	/* per station */
+	u8 ea[ETH_ALEN];	/* per station */
 } wl_wsec_key_t;
 
 #define WSEC_MIN_PSK_LEN	8
@@ -534,7 +534,7 @@ typedef struct {
 #define	MAXPMKID		16
 
 typedef struct _pmkid {
-	struct ether_addr BSSID;
+	u8 BSSID[ETH_ALEN];
 	u8 PMKID[WPA2_PMKID_LEN];
 } pmkid_t;
 
@@ -544,7 +544,7 @@ typedef struct _pmkid_list {
 } pmkid_list_t;
 
 typedef struct _pmkid_cand {
-	struct ether_addr BSSID;
+	u8 BSSID[ETH_ALEN];
 	u8 preauth;
 } pmkid_cand_t;
 
@@ -572,7 +572,7 @@ typedef struct {
 /* Used to get specific STA parameters */
 typedef struct {
 	u32 val;
-	struct ether_addr ea;
+	u8 ea[ETH_ALEN];
 } scb_val_t;
 #endif /* BRCM_FULLMAC */
 
@@ -586,7 +586,7 @@ typedef struct channel_info {
 /* For ioctls that take a list of MAC addresses */
 struct maclist {
 	uint count;		/* number of MAC addresses */
-	struct ether_addr ea[1];	/* variable length array of MAC addresses */
+	u8 *ea;			/* variable length array of MAC addresses */
 };
 
 /* get pkt count struct passed through ioctl */
@@ -1614,7 +1614,7 @@ struct ampdu_tid_control {
 
 /* structure for identifying ea/tid for sending addba/delba */
 struct ampdu_ea_tid {
-	struct ether_addr ea;	/* Station address */
+	u8 ea[ETH_ALEN];	/* Station address */
 	u8 tid;		/* tid */
 };
 /* structure for identifying retry/tid for retry_limit_tid/rr_retry_limit_tid */
diff --git a/drivers/staging/brcm80211/sys/wl_mac80211.c b/drivers/staging/brcm80211/sys/wl_mac80211.c
index bdd629d..ca87eb1 100644
--- a/drivers/staging/brcm80211/sys/wl_mac80211.c
+++ b/drivers/staging/brcm80211/sys/wl_mac80211.c
@@ -395,8 +395,7 @@ wl_ops_bss_info_changed(struct ieee80211_hw *hw,
 			info->aid, info->bssid);
 		/* BSSID changed, for whatever reason (IBSS and managed mode) */
 		/* FIXME: need to store bssid in bsscfg */
-		wlc_set_addrmatch(wl->wlc, RCM_BSSID_OFFSET,
-				  (struct ether_addr *)info->bssid);
+		wlc_set_addrmatch(wl->wlc, RCM_BSSID_OFFSET, info->bssid);
 	}
 	if (changed & BSS_CHANGED_BEACON) {
 		WL_ERROR("BSS_CHANGED_BEACON\n");
diff --git a/drivers/staging/brcm80211/sys/wlc_alloc.c b/drivers/staging/brcm80211/sys/wlc_alloc.c
index 746439e..02ae320 100644
--- a/drivers/staging/brcm80211/sys/wlc_alloc.c
+++ b/drivers/staging/brcm80211/sys/wlc_alloc.c
@@ -86,8 +86,8 @@ static struct wlc_pub *wlc_pub_malloc(struct osl_info *osh, uint unit,
 	/* need to init the tunables now */
 	wlc_tunables_init(pub->tunables, devid);
 
-	pub->multicast = (struct ether_addr *)wlc_calloc(osh, unit,
-		(sizeof(struct ether_addr) * MAXMULTILIST));
+	pub->multicast = (u8 *)wlc_calloc(osh, unit,
+		(ETH_ALEN * MAXMULTILIST));
 	if (pub->multicast == NULL) {
 		*err = 1003;
 		goto fail;
diff --git a/drivers/staging/brcm80211/sys/wlc_ampdu.c b/drivers/staging/brcm80211/sys/wlc_ampdu.c
index d749917..31e79cf 100644
--- a/drivers/staging/brcm80211/sys/wlc_ampdu.c
+++ b/drivers/staging/brcm80211/sys/wlc_ampdu.c
@@ -1329,7 +1329,7 @@ void wlc_ampdu_macaddr_upd(struct wlc_info *wlc)
 
 	/* driver needs to write the ta in the template; ta is at offset 16 */
 	memset(template, 0, sizeof(template));
-	bcopy((char *)wlc->pub->cur_etheraddr.octet, template, ETH_ALEN);
+	bcopy(wlc->pub->cur_etheraddr, template, ETH_ALEN);
 	wlc_write_template_ram(wlc, (T_BA_TPL_BASE + 16), (T_RAM_ACCESS_SZ * 2),
 			       template);
 }
diff --git a/drivers/staging/brcm80211/sys/wlc_bmac.c b/drivers/staging/brcm80211/sys/wlc_bmac.c
index 69f600a..d4ca079 100644
--- a/drivers/staging/brcm80211/sys/wlc_bmac.c
+++ b/drivers/staging/brcm80211/sys/wlc_bmac.c
@@ -1032,9 +1032,9 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
 		err = 21;
 		goto fail;
 	}
-	bcm_ether_atoe(macaddr, &wlc_hw->etheraddr);
-	if (is_broadcast_ether_addr(wlc_hw->etheraddr.octet) ||
-	    is_zero_ether_addr(wlc_hw->etheraddr.octet)) {
+	bcm_ether_atoe(macaddr, wlc_hw->etheraddr);
+	if (is_broadcast_ether_addr(wlc_hw->etheraddr) ||
+	    is_zero_ether_addr(wlc_hw->etheraddr)) {
 		WL_ERROR("wl%d: wlc_bmac_attach: bad macaddr %s\n",
 			 unit, macaddr);
 		err = 22;
@@ -1348,13 +1348,12 @@ void wlc_bmac_wait_for_wake(struct wlc_hw_info *wlc_hw)
 	ASSERT(wlc_bmac_read_shm(wlc_hw, M_UCODE_DBGST) != DBGST_ASLEEP);
 }
 
-void wlc_bmac_hw_etheraddr(struct wlc_hw_info *wlc_hw, struct ether_addr *ea)
+void wlc_bmac_hw_etheraddr(struct wlc_hw_info *wlc_hw, u8 *ea)
 {
 	bcopy(&wlc_hw->etheraddr, ea, ETH_ALEN);
 }
 
-void wlc_bmac_set_hw_etheraddr(struct wlc_hw_info *wlc_hw,
-			       struct ether_addr *ea)
+void wlc_bmac_set_hw_etheraddr(struct wlc_hw_info *wlc_hw, u8 *ea)
 {
 	bcopy(ea, &wlc_hw->etheraddr, ETH_ALEN);
 }
@@ -1720,8 +1719,7 @@ static void wlc_ucode_mute_override_clear(struct wlc_hw_info *wlc_hw)
  * Write a MAC address to the rcmta structure
  */
 void
-wlc_bmac_set_rcmta(struct wlc_hw_info *wlc_hw, int idx,
-		   const struct ether_addr *addr)
+wlc_bmac_set_rcmta(struct wlc_hw_info *wlc_hw, int idx, const u8 *addr)
 {
 	d11regs_t *regs = wlc_hw->regs;
 	volatile u16 *objdata16 = (volatile u16 *)&regs->objdata;
@@ -1734,10 +1732,8 @@ wlc_bmac_set_rcmta(struct wlc_hw_info *wlc_hw, int idx,
 	ASSERT(wlc_hw->corerev > 4);
 
 	mac_hm =
-	    (addr->octet[3] << 24) | (addr->octet[2] << 16) | (addr->
-							       octet[1] << 8) |
-	    addr->octet[0];
-	mac_l = (addr->octet[5] << 8) | addr->octet[4];
+	    (addr[3] << 24) | (addr[2] << 16) | (addr[1] << 8) |  addr[0];
+	mac_l = (addr[5] << 8) | addr[4];
 
 	osh = wlc_hw->osh;
 
@@ -1754,7 +1750,7 @@ wlc_bmac_set_rcmta(struct wlc_hw_info *wlc_hw, int idx,
  */
 void
 wlc_bmac_set_addrmatch(struct wlc_hw_info *wlc_hw, int match_reg_offset,
-		       const struct ether_addr *addr)
+		       const u8 *addr)
 {
 	d11regs_t *regs;
 	u16 mac_l;
@@ -1767,9 +1763,9 @@ wlc_bmac_set_addrmatch(struct wlc_hw_info *wlc_hw, int match_reg_offset,
 	ASSERT((match_reg_offset < RCM_SIZE) || (wlc_hw->corerev == 4));
 
 	regs = wlc_hw->regs;
-	mac_l = addr->octet[0] | (addr->octet[1] << 8);
-	mac_m = addr->octet[2] | (addr->octet[3] << 8);
-	mac_h = addr->octet[4] | (addr->octet[5] << 8);
+	mac_l = addr[0] | (addr[1] << 8);
+	mac_m = addr[2] | (addr[3] << 8);
+	mac_h = addr[4] | (addr[5] << 8);
 
 	osh = wlc_hw->osh;
 
@@ -3042,7 +3038,7 @@ void wlc_intrsrestore(struct wlc_info *wlc, u32 macintmask)
 
 void wlc_bmac_mute(struct wlc_hw_info *wlc_hw, bool on, mbool flags)
 {
-	struct ether_addr null_ether_addr = { {0, 0, 0, 0, 0, 0} };
+	u8 null_ether_addr[] = {0, 0, 0, 0, 0, 0};
 
 	if (on) {
 		/* suspend tx fifos */
@@ -3053,7 +3049,7 @@ void wlc_bmac_mute(struct wlc_hw_info *wlc_hw, bool on, mbool flags)
 
 		/* zero the address match register so we do not send ACKs */
 		wlc_bmac_set_addrmatch(wlc_hw, RCM_MAC_OFFSET,
-				       &null_ether_addr);
+				       null_ether_addr);
 	} else {
 		/* resume tx fifos */
 		if (!wlc_hw->wlc->tx_suspended) {
@@ -3065,7 +3061,7 @@ void wlc_bmac_mute(struct wlc_hw_info *wlc_hw, bool on, mbool flags)
 
 		/* Restore address */
 		wlc_bmac_set_addrmatch(wlc_hw, RCM_MAC_OFFSET,
-				       &wlc_hw->etheraddr);
+				       wlc_hw->etheraddr);
 	}
 
 	wlc_phy_mute_upd(wlc_hw->band->pi, on, flags);
diff --git a/drivers/staging/brcm80211/sys/wlc_bmac.h b/drivers/staging/brcm80211/sys/wlc_bmac.h
index 98150aa..0461f50 100644
--- a/drivers/staging/brcm80211/sys/wlc_bmac.h
+++ b/drivers/staging/brcm80211/sys/wlc_bmac.h
@@ -201,12 +201,10 @@ extern void wlc_bmac_write_template_ram(struct wlc_hw_info *wlc_hw, int offset,
 extern void wlc_bmac_copyfrom_vars(struct wlc_hw_info *wlc_hw, char **buf,
 				   uint *len);
 
-extern void wlc_bmac_process_ps_switch(struct wlc_hw_info *wlc,
-				       struct ether_addr *ea, s8 ps_on);
-extern void wlc_bmac_hw_etheraddr(struct wlc_hw_info *wlc_hw,
-				  struct ether_addr *ea);
-extern void wlc_bmac_set_hw_etheraddr(struct wlc_hw_info *wlc_hw,
-				      struct ether_addr *ea);
+extern void wlc_bmac_process_ps_switch(struct wlc_hw_info *wlc, u8 *ea,
+				       s8 ps_on);
+extern void wlc_bmac_hw_etheraddr(struct wlc_hw_info *wlc_hw, u8 *ea);
+extern void wlc_bmac_set_hw_etheraddr(struct wlc_hw_info *wlc_hw, u8 *ea);
 extern bool wlc_bmac_validate_chip_access(struct wlc_hw_info *wlc_hw);
 
 extern bool wlc_bmac_radio_read_hwdisabled(struct wlc_hw_info *wlc_hw);
@@ -227,10 +225,10 @@ extern void wlc_ucode_wake_override_clear(struct wlc_hw_info *wlc_hw,
 					  u32 override_bit);
 
 extern void wlc_bmac_set_rcmta(struct wlc_hw_info *wlc_hw, int idx,
-			       const struct ether_addr *addr);
+			       const u8 *addr);
 extern void wlc_bmac_set_addrmatch(struct wlc_hw_info *wlc_hw,
 				   int match_reg_offset,
-				   const struct ether_addr *addr);
+				   const u8 *addr);
 extern void wlc_bmac_write_hw_bcntemplates(struct wlc_hw_info *wlc_hw,
 					   void *bcn, int len, bool both);
 
diff --git a/drivers/staging/brcm80211/sys/wlc_bsscfg.h b/drivers/staging/brcm80211/sys/wlc_bsscfg.h
index d6a1971..b2a2aa7 100644
--- a/drivers/staging/brcm80211/sys/wlc_bsscfg.h
+++ b/drivers/staging/brcm80211/sys/wlc_bsscfg.h
@@ -71,7 +71,7 @@ struct wlc_bsscfg {
 	/* MAC filter */
 	uint nmac;		/* # of entries on maclist array */
 	int macmode;		/* allow/deny stations on maclist array */
-	struct ether_addr *maclist;	/* list of source MAC addrs to match */
+	u8 *maclist;	/* list of source MAC addrs to match */
 
 	/* security */
 	u32 wsec;		/* wireless security bitvec */
@@ -93,8 +93,8 @@ struct wlc_bsscfg {
 	u32 tk_cm_bt_tmstmp;	/* Timestamp when TKIP BT is activated */
 	bool tk_cm_activate;	/* activate countermeasures after EAPOL-Key sent */
 
-	struct ether_addr BSSID;	/* BSSID (associated) */
-	struct ether_addr cur_etheraddr;	/* h/w address */
+	u8 BSSID[ETH_ALEN];	/* BSSID (associated) */
+	u8 cur_etheraddr[ETH_ALEN];	/* h/w address */
 	u16 bcmc_fid;	/* the last BCMC FID queued to TX_BCMC_FIFO */
 	u16 bcmc_fid_shm;	/* the last BCMC FID written to shared mem */
 
diff --git a/drivers/staging/brcm80211/sys/wlc_key.h b/drivers/staging/brcm80211/sys/wlc_key.h
index 6678c69..3e23d51 100644
--- a/drivers/staging/brcm80211/sys/wlc_key.h
+++ b/drivers/staging/brcm80211/sys/wlc_key.h
@@ -87,7 +87,7 @@ typedef struct wsec_iv {
 #define WLC_NUMRXIVS	16	/* # rx IVs (one per 802.11e TID) */
 
 typedef struct wsec_key {
-	struct ether_addr ea;	/* per station */
+	u8 ea[ETH_ALEN];	/* per station */
 	u8 idx;		/* key index in wsec_keys array */
 	u8 id;		/* key ID [0-3] */
 	u8 algo;		/* CRYPTO_ALGO_AES_CCM, CRYPTO_ALGO_WEP128, etc */
diff --git a/drivers/staging/brcm80211/sys/wlc_mac80211.c b/drivers/staging/brcm80211/sys/wlc_mac80211.c
index 0bf70fc..6af50ba 100644
--- a/drivers/staging/brcm80211/sys/wlc_mac80211.c
+++ b/drivers/staging/brcm80211/sys/wlc_mac80211.c
@@ -300,7 +300,7 @@ static int _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
 		      struct wlc_if *wlcif);
 
 #if defined(BCMDBG)
-void wlc_get_rcmta(struct wlc_info *wlc, int idx, struct ether_addr *addr)
+void wlc_get_rcmta(struct wlc_info *wlc, int idx, u8 *addr)
 {
 	d11regs_t *regs = wlc->regs;
 	u32 v32;
@@ -315,15 +315,15 @@ void wlc_get_rcmta(struct wlc_info *wlc, int idx, struct ether_addr *addr)
 	W_REG(osh, &regs->objaddr, (OBJADDR_RCMTA_SEL | (idx * 2)));
 	(void)R_REG(osh, &regs->objaddr);
 	v32 = R_REG(osh, &regs->objdata);
-	addr->octet[0] = (u8) v32;
-	addr->octet[1] = (u8) (v32 >> 8);
-	addr->octet[2] = (u8) (v32 >> 16);
-	addr->octet[3] = (u8) (v32 >> 24);
+	addr[0] = (u8) v32;
+	addr[1] = (u8) (v32 >> 8);
+	addr[2] = (u8) (v32 >> 16);
+	addr[3] = (u8) (v32 >> 24);
 	W_REG(osh, &regs->objaddr, (OBJADDR_RCMTA_SEL | ((idx * 2) + 1)));
 	(void)R_REG(osh, &regs->objaddr);
 	v32 = R_REG(osh, (volatile u16 *)&regs->objdata);
-	addr->octet[4] = (u8) v32;
-	addr->octet[5] = (u8) (v32 >> 8);
+	addr[4] = (u8) v32;
+	addr[5] = (u8) (v32 >> 8);
 }
 #endif				/* defined(BCMDBG) */
 
@@ -679,7 +679,7 @@ int wlc_set_mac(wlc_bsscfg_t *cfg)
 
 	if (cfg == wlc->cfg) {
 		/* enter the MAC addr into the RXE match registers */
-		wlc_set_addrmatch(wlc, RCM_MAC_OFFSET, &cfg->cur_etheraddr);
+		wlc_set_addrmatch(wlc, RCM_MAC_OFFSET, cfg->cur_etheraddr);
 	}
 
 	wlc_ampdu_macaddr_upd(wlc);
@@ -696,7 +696,7 @@ void wlc_set_bssid(wlc_bsscfg_t *cfg)
 
 	/* if primary config, we need to update BSSID in RXE match registers */
 	if (cfg == wlc->cfg) {
-		wlc_set_addrmatch(wlc, RCM_BSSID_OFFSET, &cfg->BSSID);
+		wlc_set_addrmatch(wlc, RCM_BSSID_OFFSET, cfg->BSSID);
 	}
 #ifdef SUPPORT_HWKEYS
 	else if (BSSCFG_STA(cfg) && cfg->BSS) {
@@ -1728,7 +1728,6 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
 	ASSERT(WSEC_MAX_DEFAULT_KEYS == WLC_DEFAULT_KEYS);
 
 	/* some code depends on packed structures */
-	ASSERT(sizeof(struct ether_addr) == ETH_ALEN);
 	ASSERT(sizeof(struct ethhdr) == ETH_HLEN);
 	ASSERT(sizeof(d11regs_t) == SI_CORE_SIZE);
 	ASSERT(sizeof(ofdm_phy_hdr_t) == D11_PHY_HDR_LEN);
@@ -1838,10 +1837,9 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
 			wlc->core->txavail[i] = wlc->hw->txavail[i];
 	}
 
-	wlc_bmac_hw_etheraddr(wlc->hw, &wlc->perm_etheraddr);
+	wlc_bmac_hw_etheraddr(wlc->hw, wlc->perm_etheraddr);
 
-	bcopy((char *)&wlc->perm_etheraddr, (char *)&pub->cur_etheraddr,
-	      ETH_ALEN);
+	bcopy(wlc->perm_etheraddr, pub->cur_etheraddr, ETH_ALEN);
 
 	for (j = 0; j < NBANDS(wlc); j++) {
 		/* Use band 1 for single band 11a */
@@ -3602,8 +3600,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
 				if (src_key->flags & WSEC_PRIMARY_KEY)
 					key.flags |= WL_PRIMARY_KEY;
 
-				bcopy(src_key->ea.octet, key.ea.octet,
-				      ETH_ALEN);
+				bcopy(src_key->ea, key.ea, ETH_ALEN);
 			}
 
 			bcopy((char *)&key, arg, sizeof(key));
@@ -3639,7 +3636,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
 				u32 hi;
 				/* group keys in WPA-NONE (IBSS only, AES and TKIP) use a global TXIV */
 				if ((bsscfg->WPA_auth & WPA_AUTH_NONE) &&
-				    is_zero_ether_addr(key->ea.octet)) {
+				    is_zero_ether_addr(key->ea)) {
 					lo = bsscfg->wpa_none_txiv.lo;
 					hi = bsscfg->wpa_none_txiv.hi;
 				} else {
@@ -5811,7 +5808,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
 			rspec[k] = WLC_RATE_1M;
 		} else {
 			if (WLANTSEL_ENAB(wlc) &&
-			    !is_multicast_ether_addr(h->a1.octet)) {
+			    !is_multicast_ether_addr(h->a1)) {
 				/* set tx antenna config */
 				wlc_antsel_antcfg_get(wlc->asi, false, false, 0,
 						      0, &antcfg, &fbantcfg);
@@ -5974,7 +5971,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
 
 	/* DUR field for main rate */
 	if ((fc != FC_PS_POLL) &&
-	    !is_multicast_ether_addr(h->a1.octet) && !use_rifs) {
+	    !is_multicast_ether_addr(h->a1) && !use_rifs) {
 		durid =
 		    wlc_compute_frame_dur(wlc, rspec[0], preamble_type[0],
 					  next_frag_len);
@@ -5992,7 +5989,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
 	/* DUR field for fallback rate */
 	if (fc == FC_PS_POLL)
 		txh->FragDurFallback = h->durid;
-	else if (is_multicast_ether_addr(h->a1.octet) || use_rifs)
+	else if (is_multicast_ether_addr(h->a1) || use_rifs)
 		txh->FragDurFallback = 0;
 	else {
 		durid = wlc_compute_frame_dur(wlc, rspec[1],
@@ -6004,7 +6001,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
 	if (frag == 0)
 		mcl |= TXC_STARTMSDU;
 
-	if (!is_multicast_ether_addr(h->a1.octet))
+	if (!is_multicast_ether_addr(h->a1))
 		mcl |= TXC_IMMEDACK;
 
 	if (BAND_5G(wlc->band->bandtype))
@@ -6039,7 +6036,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
 	txh->TxFesTimeFallback = htol16(0);
 
 	/* TxFrameRA */
-	bcopy((char *)&h->a1, (char *)&txh->TxFrameRA, ETH_ALEN);
+	bcopy(h->a1, txh->TxFrameRA, ETH_ALEN);
 
 	/* TxFrameID */
 	txh->TxFrameID = htol16(frameid);
@@ -6233,7 +6230,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
 	if (SCB_WME(scb) && qos && wlc->edcf_txop[ac]) {
 		uint frag_dur, dur, dur_fallback;
 
-		ASSERT(!is_multicast_ether_addr(h->a1.octet));
+		ASSERT(!is_multicast_ether_addr(h->a1));
 
 		/* WME: Update TXOP threshold */
 		if ((!(tx_info->flags & IEEE80211_TX_CTL_AMPDU)) && (frag == 0)) {
@@ -7043,8 +7040,8 @@ void BCMFASTPATH wlc_recv(struct wlc_info *wlc, struct sk_buff *p)
 	if (!is_amsdu) {
 		/* CTS and ACK CTL frames are w/o a2 */
 		if (FC_TYPE(fc) == FC_TYPE_DATA || FC_TYPE(fc) == FC_TYPE_MNG) {
-			if ((is_zero_ether_addr(h->a2.octet) ||
-			     is_multicast_ether_addr(h->a2.octet))) {
+			if ((is_zero_ether_addr(h->a2) ||
+			     is_multicast_ether_addr(h->a2))) {
 				WL_ERROR("wl%d: %s: dropping a frame with invalid src mac address, a2: %pM\n",
 					 wlc->pub->unit, __func__, &h->a2);
 				WLCNTINCR(wlc->pub->_cnt->rxbadsrcmac);
@@ -8222,13 +8219,12 @@ void wlc_write_hw_bcntemplates(struct wlc_info *wlc, void *bcn, int len,
 }
 
 void
-wlc_set_addrmatch(struct wlc_info *wlc, int match_reg_offset,
-		  const struct ether_addr *addr)
+wlc_set_addrmatch(struct wlc_info *wlc, int match_reg_offset, const u8 *addr)
 {
 	wlc_bmac_set_addrmatch(wlc->hw, match_reg_offset, addr);
 }
 
-void wlc_set_rcmta(struct wlc_info *wlc, int idx, const struct ether_addr *addr)
+void wlc_set_rcmta(struct wlc_info *wlc, int idx, const u8 *addr)
 {
 	wlc_bmac_set_rcmta(wlc->hw, idx, addr);
 }
diff --git a/drivers/staging/brcm80211/sys/wlc_mac80211.h b/drivers/staging/brcm80211/sys/wlc_mac80211.h
index 5df996b..a9c907c 100644
--- a/drivers/staging/brcm80211/sys/wlc_mac80211.h
+++ b/drivers/staging/brcm80211/sys/wlc_mac80211.h
@@ -470,7 +470,7 @@ struct wlc_hw_info {
 	uint mac_suspend_depth;	/* current depth of mac_suspend levels */
 	u32 wake_override;	/* Various conditions to force MAC to WAKE mode */
 	u32 mute_override;	/* Prevent ucode from sending beacons */
-	struct ether_addr etheraddr;	/* currently configured ethernet address */
+	u8 etheraddr[ETH_ALEN];	/* currently configured ethernet address */
 	u32 led_gpio_mask;	/* LED GPIO Mask */
 	bool noreset;		/* true= do not reset hw, used by WLC_OUT */
 	bool forcefastclk;	/* true if the h/w is forcing the use of fast clk */
@@ -566,7 +566,7 @@ struct wlc_info {
 
 	u32 machwcap;	/* MAC capabilities, BMAC shadow */
 
-	struct ether_addr perm_etheraddr;	/* original sprom local ethernet address */
+	u8 perm_etheraddr[ETH_ALEN];	/* original sprom local ethernet address */
 
 	bool bandlocked;	/* disable auto multi-band switching */
 	bool bandinit_pending;	/* track band init in auto band */
@@ -835,13 +835,11 @@ extern void wlc_write_template_ram(struct wlc_info *wlc, int offset, int len,
 extern void wlc_write_hw_bcntemplates(struct wlc_info *wlc, void *bcn, int len,
 				      bool both);
 #if defined(BCMDBG)
-extern void wlc_get_rcmta(struct wlc_info *wlc, int idx,
-			  struct ether_addr *addr);
+extern void wlc_get_rcmta(struct wlc_info *wlc, int idx, u8 *addr);
 #endif
-extern void wlc_set_rcmta(struct wlc_info *wlc, int idx,
-			  const struct ether_addr *addr);
+extern void wlc_set_rcmta(struct wlc_info *wlc, int idx, const u8 *addr);
 extern void wlc_set_addrmatch(struct wlc_info *wlc, int match_reg_offset,
-			      const struct ether_addr *addr);
+			      const u8 *addr);
 extern void wlc_read_tsf(struct wlc_info *wlc, u32 *tsf_l_ptr,
 			 u32 *tsf_h_ptr);
 extern void wlc_set_cwmin(struct wlc_info *wlc, u16 newmin);
diff --git a/drivers/staging/brcm80211/sys/wlc_pub.h b/drivers/staging/brcm80211/sys/wlc_pub.h
index 146a690..c8f5cd8 100644
--- a/drivers/staging/brcm80211/sys/wlc_pub.h
+++ b/drivers/staging/brcm80211/sys/wlc_pub.h
@@ -154,7 +154,7 @@ typedef void *wlc_pkt_t;
 /* Event data type */
 typedef struct wlc_event {
 	wl_event_msg_t event;	/* encapsulated event */
-	struct ether_addr *addr;	/* used to keep a trace of the potential present of
+	u8 *addr;		/* used to keep a trace of the potential present of
 					 * an address in wlc_event_msg_t
 					 */
 	int bsscfgidx;		/* BSS config when needed */
@@ -165,7 +165,7 @@ typedef struct wlc_event {
 
 /* wlc internal bss_info, wl external one is in wlioctl.h */
 typedef struct wlc_bss_info {
-	struct ether_addr BSSID;	/* network BSSID */
+	u8 BSSID[ETH_ALEN];	/* network BSSID */
 	u16 flags;		/* flags for internal attributes */
 	u8 SSID_len;		/* the length of SSID */
 	u8 SSID[32];		/* SSID string */
@@ -291,9 +291,9 @@ struct wlc_pub {
 	s8 _coex;		/* 20/40 MHz BSS Management AUTO, ENAB, DISABLE */
 	bool _priofc;		/* Priority-based flowcontrol */
 
-	struct ether_addr cur_etheraddr;	/* our local ethernet address */
+	u8 cur_etheraddr[ETH_ALEN];	/* our local ethernet address */
 
-	struct ether_addr *multicast;	/* ptr to list of multicast addresses */
+	u8 *multicast;		/* ptr to list of multicast addresses */
 	uint nmulticast;	/* # enabled multicast addresses */
 
 	u32 wlfeatureflag;	/* Flags to control sw features from registry */
@@ -524,7 +524,7 @@ extern void wlc_statsupd(struct wlc_info *wlc);
 extern int wlc_get_header_len(void);
 extern void wlc_mac_bcn_promisc_change(struct wlc_info *wlc, bool promisc);
 extern void wlc_set_addrmatch(struct wlc_info *wlc, int match_reg_offset,
-			      const struct ether_addr *addr);
+			      const u8 *addr);
 extern void wlc_wme_setparams(struct wlc_info *wlc, u16 aci, void *arg,
 			      bool suspend);
 
diff --git a/drivers/staging/brcm80211/sys/wlc_scb.h b/drivers/staging/brcm80211/sys/wlc_scb.h
index fe84e99..142b756 100644
--- a/drivers/staging/brcm80211/sys/wlc_scb.h
+++ b/drivers/staging/brcm80211/sys/wlc_scb.h
@@ -58,7 +58,7 @@ struct scb {
 	u32 flags;		/* various bit flags as defined below */
 	u32 flags2;		/* various bit flags2 as defined below */
 	u8 state;		/* current state bitfield of auth/assoc process */
-	struct ether_addr ea;	/* station address */
+	u8 ea[ETH_ALEN];	/* station address */
 	void *fragbuf[NUMPRIO];	/* defragmentation buffer per prio */
 	uint fragresid[NUMPRIO];	/* #bytes unused in frag buffer per prio */
 
diff --git a/drivers/staging/brcm80211/util/bcmsrom.c b/drivers/staging/brcm80211/util/bcmsrom.c
index 19d4502..79038e0 100644
--- a/drivers/staging/brcm80211/util/bcmsrom.c
+++ b/drivers/staging/brcm80211/util/bcmsrom.c
@@ -1725,16 +1725,16 @@ static void _initvars_srom_pci(u8 sromrev, u16 *srom, uint off, varbuf_t *b)
 			continue;
 
 		if (flags & SRFL_ETHADDR) {
-			struct ether_addr ea;
+			u8 ea[ETH_ALEN];
 
-			ea.octet[0] = (srom[srv->off - off] >> 8) & 0xff;
-			ea.octet[1] = srom[srv->off - off] & 0xff;
-			ea.octet[2] = (srom[srv->off + 1 - off] >> 8) & 0xff;
-			ea.octet[3] = srom[srv->off + 1 - off] & 0xff;
-			ea.octet[4] = (srom[srv->off + 2 - off] >> 8) & 0xff;
-			ea.octet[5] = srom[srv->off + 2 - off] & 0xff;
+			ea[0] = (srom[srv->off - off] >> 8) & 0xff;
+			ea[1] = srom[srv->off - off] & 0xff;
+			ea[2] = (srom[srv->off + 1 - off] >> 8) & 0xff;
+			ea[3] = srom[srv->off + 1 - off] & 0xff;
+			ea[4] = (srom[srv->off + 2 - off] >> 8) & 0xff;
+			ea[5] = srom[srv->off + 2 - off] & 0xff;
 
-			varbuf_append(b, "%s=%pM", name, ea.octet);
+			varbuf_append(b, "%s=%pM", name, ea);
 		} else {
 			ASSERT(mask_valid(srv->mask));
 			ASSERT(mask_width(srv->mask));
diff --git a/drivers/staging/brcm80211/util/bcmutils.c b/drivers/staging/brcm80211/util/bcmutils.c
index fd30cc6..caab133 100644
--- a/drivers/staging/brcm80211/util/bcmutils.c
+++ b/drivers/staging/brcm80211/util/bcmutils.c
@@ -348,12 +348,12 @@ struct sk_buff *BCMFASTPATH pktq_mdeq(struct pktq *pq, uint prec_bmp,
 }
 
 /* parse a xx:xx:xx:xx:xx:xx format ethernet address */
-int bcm_ether_atoe(char *p, struct ether_addr *ea)
+int bcm_ether_atoe(char *p, u8 *ea)
 {
 	int i = 0;
 
 	for (;;) {
-		ea->octet[i++] = (char)simple_strtoul(p, &p, 16);
+		ea[i++] = (char)simple_strtoul(p, &p, 16);
 		if (!*p++ || i == 6)
 			break;
 	}
-- 
1.5.6.5


^ permalink raw reply related

* [RFT 0/8] Clean proto/ethernet.h and remove it.
From: Jonas Gorski @ 2011-01-19 22:35 UTC (permalink / raw)
  To: linux-wireless
  Cc: Brett Rudley, Henry Ptasinski, Dowan Kim, Roland Vossen,
	Arend van Spriel

After the short discussion I started cleaning up the code, and this is the
first small patch series. I thought I'll start with rather simple 
replacements.

This series replaces everything from proto/ethernet.h with their 
equivalents in the kernel and then removes it.

It does not fix previously existing style violations, so checkpatch still
complains about too long lines; I will address these in further patches.

Since I do not have a supported device at hand, I'd be happy if anyone
could test that I didn't break anything while replacing things. Especially
in patch 7 (Replace ether_addr with fixed size array) I might have broken
something.

-- 

Jonas

Jonas Gorski (8):
  staging: brcm80211: Remove unused ETHER_<foo> macros.
  staging: brcm80211: Use linux ethhdr struct.
  staging: brcm80211: Remove unused ETHER_<foo> defines.
  staging: brcm80211: Remove ETHER_MAX_LEN definition.
  staging: brcm80211: Remove ETHER_TYPE_BRCM.
  staging: brcm80211: Remove static ether_bcast.
  staging: brcm80211: Replace ether_addr with fixed size array.
  staging: brcm80211: Remove proto/ethernet.h.

 drivers/staging/brcm80211/brcmfmac/dhd_linux.c     |   19 +++---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c      |    1 -
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c   |    5 +-
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h   |    1 -
 drivers/staging/brcm80211/brcmfmac/wl_iw.c         |    5 +-
 drivers/staging/brcm80211/brcmfmac/wl_iw.h         |    1 -
 drivers/staging/brcm80211/include/bcmcdc.h         |    3 +-
 drivers/staging/brcm80211/include/bcmutils.h       |    2 +-
 drivers/staging/brcm80211/include/proto/802.11.h   |   20 +++---
 drivers/staging/brcm80211/include/proto/bcmevent.h |    8 ++-
 drivers/staging/brcm80211/include/proto/ethernet.h |   72 --------------------
 drivers/staging/brcm80211/include/proto/wpa.h      |    2 -
 drivers/staging/brcm80211/include/wlioctl.h        |   23 +++---
 drivers/staging/brcm80211/sys/wl_mac80211.c        |    3 +-
 drivers/staging/brcm80211/sys/wlc_alloc.c          |    4 +-
 drivers/staging/brcm80211/sys/wlc_ampdu.c          |    2 +-
 drivers/staging/brcm80211/sys/wlc_bmac.c           |   34 ++++-----
 drivers/staging/brcm80211/sys/wlc_bmac.h           |   14 ++--
 drivers/staging/brcm80211/sys/wlc_bsscfg.h         |    6 +-
 drivers/staging/brcm80211/sys/wlc_key.h            |    2 +-
 drivers/staging/brcm80211/sys/wlc_mac80211.c       |   55 +++++++--------
 drivers/staging/brcm80211/sys/wlc_mac80211.h       |   12 ++--
 drivers/staging/brcm80211/sys/wlc_pub.h            |   10 ++--
 drivers/staging/brcm80211/sys/wlc_scb.h            |    2 +-
 drivers/staging/brcm80211/util/bcmsrom.c           |   18 ++---
 drivers/staging/brcm80211/util/bcmutils.c          |    5 +-
 26 files changed, 117 insertions(+), 212 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/include/proto/ethernet.h


^ permalink raw reply

* [RFT 3/8] staging: brcm80211: Remove unused ETHER_<foo> defines.
From: Jonas Gorski @ 2011-01-19 22:35 UTC (permalink / raw)
  To: linux-wireless
  Cc: Brett Rudley, Henry Ptasinski, Dowan Kim, Roland Vossen,
	Arend van Spriel
In-Reply-To: <1295476532-21130-3-git-send-email-jonas.gorski@gmail.com>

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 drivers/staging/brcm80211/include/proto/ethernet.h |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/brcm80211/include/proto/ethernet.h b/drivers/staging/brcm80211/include/proto/ethernet.h
index af3b977..1176df9 100644
--- a/drivers/staging/brcm80211/include/proto/ethernet.h
+++ b/drivers/staging/brcm80211/include/proto/ethernet.h
@@ -21,19 +21,10 @@
 
 #include <packed_section_start.h>
 
-#define	ETHER_TYPE_LEN		2
-#define	ETHER_CRC_LEN		4
-#define	ETHER_MIN_LEN		64
-#define	ETHER_MIN_DATA		46
 #define	ETHER_MAX_LEN		1518
-#define	ETHER_MAX_DATA		1500
 
 #define	ETHER_TYPE_BRCM		0x886c
 
-#define ETHER_DEST_OFFSET	(0 * ETH_ALEN)
-#define ETHER_SRC_OFFSET	(1 * ETH_ALEN)
-#define ETHER_TYPE_OFFSET	(2 * ETH_ALEN)
-
 BWL_PRE_PACKED_STRUCT struct ether_addr {
 	u8 octet[ETH_ALEN];
 } BWL_POST_PACKED_STRUCT;
-- 
1.5.6.5


^ permalink raw reply related

* [RFT 4/8] staging: brcm80211: Remove ETHER_MAX_LEN definition.
From: Jonas Gorski @ 2011-01-19 22:35 UTC (permalink / raw)
  To: linux-wireless
  Cc: Brett Rudley, Henry Ptasinski, Dowan Kim, Roland Vossen,
	Arend van Spriel
In-Reply-To: <1295476532-21130-4-git-send-email-jonas.gorski@gmail.com>

Since ETHER_MAX_LEN is only used for CDC_MAX_MSG_SIZE, directly use the value
in bcmcdc.h and remove the definition.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 drivers/staging/brcm80211/include/bcmcdc.h         |    3 +--
 drivers/staging/brcm80211/include/proto/ethernet.h |    2 --
 2 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/brcm80211/include/bcmcdc.h b/drivers/staging/brcm80211/include/bcmcdc.h
index 10c1ddc..e56470e 100644
--- a/drivers/staging/brcm80211/include/bcmcdc.h
+++ b/drivers/staging/brcm80211/include/bcmcdc.h
@@ -13,7 +13,6 @@
  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
-#include <proto/ethernet.h>
 
 typedef struct cdc_ioctl {
 	u32 cmd;		/* ioctl command value */
@@ -24,7 +23,7 @@ typedef struct cdc_ioctl {
 } cdc_ioctl_t;
 
 /* Max valid buffer size that can be sent to the dongle */
-#define CDC_MAX_MSG_SIZE   ETHER_MAX_LEN
+#define CDC_MAX_MSG_SIZE	1518
 
 /* len field is divided into input and output buffer lengths */
 #define CDCL_IOC_OUTLEN_MASK   0x0000FFFF	/* maximum or expected
diff --git a/drivers/staging/brcm80211/include/proto/ethernet.h b/drivers/staging/brcm80211/include/proto/ethernet.h
index 1176df9..bc99842 100644
--- a/drivers/staging/brcm80211/include/proto/ethernet.h
+++ b/drivers/staging/brcm80211/include/proto/ethernet.h
@@ -21,8 +21,6 @@
 
 #include <packed_section_start.h>
 
-#define	ETHER_MAX_LEN		1518
-
 #define	ETHER_TYPE_BRCM		0x886c
 
 BWL_PRE_PACKED_STRUCT struct ether_addr {
-- 
1.5.6.5


^ permalink raw reply related

* [RFT 5/8] staging: brcm80211: Remove ETHER_TYPE_BRCM.
From: Jonas Gorski @ 2011-01-19 22:35 UTC (permalink / raw)
  To: linux-wireless
  Cc: Brett Rudley, Henry Ptasinski, Dowan Kim, Roland Vossen,
	Arend van Spriel
In-Reply-To: <1295476532-21130-5-git-send-email-jonas.gorski@gmail.com>

Use the recently introduced ETH_P_LINK_CTL instead of ETHER_TYPE_BRCM, and
remove the define.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c     |    2 +-
 drivers/staging/brcm80211/include/proto/ethernet.h |    2 --
 2 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 87bf42d..71c5203 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -1215,7 +1215,7 @@ void dhd_rx_frame(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf,
 		skb_pull(skb, ETH_HLEN);
 
 		/* Process special event packets and then discard them */
-		if (ntoh16(skb->protocol) == ETHER_TYPE_BRCM)
+		if (skb->protocol == htons(ETH_P_LINK_CTL))
 			dhd_wl_host_event(dhd, &ifidx,
 					  skb_mac_header(skb),
 					  &event, &data);
diff --git a/drivers/staging/brcm80211/include/proto/ethernet.h b/drivers/staging/brcm80211/include/proto/ethernet.h
index bc99842..77deb94 100644
--- a/drivers/staging/brcm80211/include/proto/ethernet.h
+++ b/drivers/staging/brcm80211/include/proto/ethernet.h
@@ -21,8 +21,6 @@
 
 #include <packed_section_start.h>
 
-#define	ETHER_TYPE_BRCM		0x886c
-
 BWL_PRE_PACKED_STRUCT struct ether_addr {
 	u8 octet[ETH_ALEN];
 } BWL_POST_PACKED_STRUCT;
-- 
1.5.6.5


^ permalink raw reply related

* [RFT 8/8] staging: brcm80211: Remove proto/ethernet.h.
From: Jonas Gorski @ 2011-01-19 22:35 UTC (permalink / raw)
  To: linux-wireless
  Cc: Brett Rudley, Henry Ptasinski, Dowan Kim, Roland Vossen,
	Arend van Spriel
In-Reply-To: <1295476532-21130-8-git-send-email-jonas.gorski@gmail.com>

Since proto/ethernet.h now is empty except for one include, delete it and add
the single include where necessary.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c     |    1 -
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c      |    1 -
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c   |    1 -
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h   |    1 -
 drivers/staging/brcm80211/brcmfmac/wl_iw.c         |    1 -
 drivers/staging/brcm80211/brcmfmac/wl_iw.h         |    1 -
 drivers/staging/brcm80211/include/proto/802.11.h   |    2 +
 drivers/staging/brcm80211/include/proto/bcmevent.h |    2 +
 drivers/staging/brcm80211/include/proto/ethernet.h |   22 --------------------
 drivers/staging/brcm80211/include/proto/wpa.h      |    2 -
 drivers/staging/brcm80211/include/wlioctl.h        |    1 -
 drivers/staging/brcm80211/util/bcmsrom.c           |    2 -
 drivers/staging/brcm80211/util/bcmutils.c          |    1 -
 13 files changed, 4 insertions(+), 34 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/include/proto/ethernet.h

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 71c5203..cdeed33 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -36,7 +36,6 @@
 #include <bcmutils.h>
 #include <bcmendian.h>
 
-#include <proto/ethernet.h>
 #include <dngl_stats.h>
 #include <dhd.h>
 #include <dhd_bus.h>
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 3edce44..383416d 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -44,7 +44,6 @@
 #include <sbsdpcmdev.h>
 #include <bcmsdpcm.h>
 
-#include <proto/ethernet.h>
 #include <proto/802.1d.h>
 #include <proto/802.11.h>
 
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index c7e3837..f27524c 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -20,7 +20,6 @@
 
 #include <bcmutils.h>
 #include <bcmendian.h>
-#include <proto/ethernet.h>
 
 #include <asm/uaccess.h>
 
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
index 482691b..b4734d1 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
@@ -20,7 +20,6 @@
 #include <linux/wireless.h>
 #include <linux/wireless.h>
 #include <net/cfg80211.h>
-#include <proto/ethernet.h>
 #include <wlioctl.h>
 
 struct wl_conf;
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_iw.c b/drivers/staging/brcm80211/brcmfmac/wl_iw.c
index 346b190..85a2884 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_iw.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_iw.c
@@ -23,7 +23,6 @@
 
 #include <bcmutils.h>
 #include <bcmendian.h>
-#include <proto/ethernet.h>
 
 #include <linux/if_arp.h>
 #include <asm/uaccess.h>
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_iw.h b/drivers/staging/brcm80211/brcmfmac/wl_iw.h
index c8637c5..ef5c72d 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_iw.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_iw.h
@@ -19,7 +19,6 @@
 
 #include <linux/wireless.h>
 
-#include <proto/ethernet.h>
 #include <wlioctl.h>
 
 #define WL_SCAN_PARAMS_SSID_MAX	10
diff --git a/drivers/staging/brcm80211/include/proto/802.11.h b/drivers/staging/brcm80211/include/proto/802.11.h
index 11940fe..6bb1802 100644
--- a/drivers/staging/brcm80211/include/proto/802.11.h
+++ b/drivers/staging/brcm80211/include/proto/802.11.h
@@ -17,6 +17,8 @@
 #ifndef _802_11_H_
 #define _802_11_H_
 
+#include <linux/if_ether.h>
+
 #include <proto/wpa.h>
 #include <packed_section_start.h>
 
diff --git a/drivers/staging/brcm80211/include/proto/bcmevent.h b/drivers/staging/brcm80211/include/proto/bcmevent.h
index 5802ea0..68d30c9 100644
--- a/drivers/staging/brcm80211/include/proto/bcmevent.h
+++ b/drivers/staging/brcm80211/include/proto/bcmevent.h
@@ -17,6 +17,8 @@
 #ifndef _BCMEVENT_H_
 #define _BCMEVENT_H_
 
+#include <linux/if_ether.h>
+
 #include <packed_section_start.h>
 
 #define BCM_EVENT_MSG_VERSION		1
diff --git a/drivers/staging/brcm80211/include/proto/ethernet.h b/drivers/staging/brcm80211/include/proto/ethernet.h
deleted file mode 100644
index f52f430..0000000
--- a/drivers/staging/brcm80211/include/proto/ethernet.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _NET_ETHERNET_H_
-#define _NET_ETHERNET_H_
-
-#include <linux/if_ether.h>
-
-#endif				/* _NET_ETHERNET_H_ */
diff --git a/drivers/staging/brcm80211/include/proto/wpa.h b/drivers/staging/brcm80211/include/proto/wpa.h
index 10c2fb6..5ffcffd 100644
--- a/drivers/staging/brcm80211/include/proto/wpa.h
+++ b/drivers/staging/brcm80211/include/proto/wpa.h
@@ -17,8 +17,6 @@
 #ifndef _proto_wpa_h_
 #define _proto_wpa_h_
 
-#include <proto/ethernet.h>
-
 #define WPA2_PMKID_LEN	16
 #define RSN_CAP_1_REPLAY_CNTR		0
 #define RSN_CAP_2_REPLAY_CNTRS		1
diff --git a/drivers/staging/brcm80211/include/wlioctl.h b/drivers/staging/brcm80211/include/wlioctl.h
index 9b85f31..06989fa 100644
--- a/drivers/staging/brcm80211/include/wlioctl.h
+++ b/drivers/staging/brcm80211/include/wlioctl.h
@@ -17,7 +17,6 @@
 #ifndef _wlioctl_h_
 #define	_wlioctl_h_
 
-#include <proto/ethernet.h>
 #ifdef BRCM_FULLMAC
 #include <proto/bcmeth.h>
 #endif
diff --git a/drivers/staging/brcm80211/util/bcmsrom.c b/drivers/staging/brcm80211/util/bcmsrom.c
index 79038e0..fa696ee 100644
--- a/drivers/staging/brcm80211/util/bcmsrom.c
+++ b/drivers/staging/brcm80211/util/bcmsrom.c
@@ -44,8 +44,6 @@
 #include <sbsdpcmdev.h>
 #endif
 
-#include <proto/ethernet.h>	/* for sprom content groking */
-
 #define	BS_ERROR(args)
 
 #define SROM_OFFSET(sih) ((sih->ccrev > 31) ? \
diff --git a/drivers/staging/brcm80211/util/bcmutils.c b/drivers/staging/brcm80211/util/bcmutils.c
index caab133..258fd90 100644
--- a/drivers/staging/brcm80211/util/bcmutils.c
+++ b/drivers/staging/brcm80211/util/bcmutils.c
@@ -28,7 +28,6 @@
 #include <bcmnvram.h>
 #include <bcmendian.h>
 #include <bcmdevs.h>
-#include <proto/ethernet.h>
 #include <proto/802.1d.h>
 #include <proto/802.11.h>
 
-- 
1.5.6.5


^ permalink raw reply related


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