Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: deauthentication and disassociation nl80211 commands
From: Maxim Levitsky @ 2009-10-15 11:45 UTC (permalink / raw)
  To: Jouni Malinen; +Cc: hostap@lists.shmoo.com, linux-wireless
In-Reply-To: <20091012065210.GA25578@jm.kir.nu>

On Mon, 2009-10-12 at 09:52 +0300, Jouni Malinen wrote:
> On Mon, Oct 05, 2009 at 04:11:47AM +0200, Maxim Levitsky wrote:
> 
> > Today kernel explicitly requests the driver to perform both
> > disassociation and deauthentication in that order.
> 
> I hope that deauthentication alone would be enough since that is
> supposed to implicitly first take care of disassociation as far as the
> IEEE 802.11 standard is concerned. It should also be noted that "kernel"
> here is referring to mac80211; most other drivers/IEEE 802.11 stacks
> do not have this type of restriction.
> 
> > However, currently wpa_supplicant assumes that once it called
> > wpa_drv_disassociate it can again start the complete connect sequence
> > from the authentication.
> 
> Actually, wpa_supplicant assume that it can authenticate again at any
> point, i.e., even without first calling wpa_drv_disassociate.
> 
> > In fact I have carefully studied the code and found that calls to
> > wpa_supplicant_deauthenticate (which is the only user of
> > wpa_drv_deauthenticate) only happen at deinitialization of wireless
> > interface and when wpa_supplicant really has to do it, that is if there
> > is a failure (mic failure for example).
> 
> Yes, wpa_supplicant tries to follow the operations as defined in IEEE
> 802.11 and does not unnecessarily deauthenticate. In addition, when
> reassociating back to the same AP (e.g., to change some parameters),
> there will be no deauthentication/disassociation at all.
> 
> > My hacky patch that was rejected on the grounds that it is not right to
> > introduce the driver dependent behavior might actually be the correct
> > solution. It just makes the wpa_supplicant_disassociate do both
> > disassociation and deauthentication, as was always assumed by the
> > wpa_supplicant core.
> 
> There is no such assumption and the patch is not correct.

Thanks for explanation, then this is a kernel issue.


> 
> > Or kernel should became smarter and do the work for wpa_supplicant. 
> 
> No, it should not do that either. Rather, it should allow valid IEEE
> 802.11 operations to be performed (authentication while authenticated is
> allowed)..
> 
> > If mac80211 is already authenticated to the AP that was requested, it
> > should just return success.
> 
> No. It should start new authentication in that case.
> 
> > If it isn't authenticated to new AP then, new authentication should be
> > made.
> > (and old one can be kept, but removed after a timeout)
> 
> That should be done regardless of the current authentication/association
> state.
> 
> > When do you plan to switch officially the wpa_supplicant to
> > driver_nl80211?
> 
> To whom is this "you" referring? wpa_supplicant does support both WEXT
> and nl80211. It is up to the user (of wpa_supplicant; e.g., NM) to
> decide which driver wrapper it wants to use.

I mean, the general community, distributions, NM, ...

> 
> 
> As far as working out this issue is concerned, I committed a following
> change to wpa_supplicant:
> http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=commitdiff;h=6d6f4bb87f33278aed133875d0d561eb55d7ae59
> 
> I cannot day that I exactly like this due to the required extra code in
> events.c, but the part in driver_nl80211.c shows how this type of
> driver-specific cases should be handled in general. Anyway, I hope that
> this can be eventually removed from wpa_supplicant.
Me nether, now I am sure that this is kernel issue, and should be done
there.


Thanks a lot,
	Maxim Levitsky




^ permalink raw reply

* Re: NOHZ: local_softirq_pending 08
From: Jarek Poplawski @ 2009-10-15 11:40 UTC (permalink / raw)
  To: Tilman Schmidt
  Cc: David Miller, johannes, hidave.darkstar, linux-kernel, tglx,
	linux-wireless, linux-ppp, netdev, paulus
In-Reply-To: <4AD31213.6020006@imap.cc>

On 12-10-2009 13:25, Tilman Schmidt wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Mon, 12 Oct 2009 03:32:46 -0700 (PDT), David Miller wrote:
>> The PPP receive paths in ppp_generic.c do a local_bh_disable()/
>> local_bh_enable() around packet receiving (via ppp_recv_lock()/
>> ppp_recv_unlock() in ppp_do_recv).
>>
>> So at least that part is perfectly fine.
>>
>> ppp_input(), as called from ppp_sync_process(), also disables BH's
>> around ppp_do_recv() calls (via read_lock_bh()/read_unlock_bh()).
>>
>> So that's fine too.
>>
>> Do you have a bug report or are you just scanning around looking
>> for trouble? :-)
> 
> I have encountered the message in the subject during a test of
> the Gigaset CAPI driver, and would like to determine whether
> it's a bug in the driver, a bug somewhere else, or no bug at
> all. The test scenario was PPP over ISDN with pppd+capiplugin.
> In an alternative scenario, also PPP over ISDN but with
> smpppd+capidrv, the message did not occur.
> 
> Johannes' answer pointed me to the netif_rx() function.
> The Gigaset driver itself doesn't call that function at all.
> In the scenario where I saw the message, it was the SYNC_PPP
> line discipline that did. But from your explanation I gather
> that the cause cannot lie there.
> 
> So now I'm looking for other possible causes of that message.

Anyway, I agree with Michael Buesch there is no reason to waste time
for tracking all netif_rx vs netif_rx_ni uses, and it seems we could
avoid it by using the "proper" version of raise_softirq_irqoff() in
__napi_schedule(). Could anybody try if I'm not wrong?

Thanks,
Jarek P.
---

 net/core/dev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 28b0b9e..7fc4009 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2728,7 +2728,7 @@ void __napi_schedule(struct napi_struct *n)
 
 	local_irq_save(flags);
 	list_add_tail(&n->poll_list, &__get_cpu_var(softnet_data).poll_list);
-	__raise_softirq_irqoff(NET_RX_SOFTIRQ);
+	raise_softirq_irqoff(NET_RX_SOFTIRQ);
 	local_irq_restore(flags);
 }
 EXPORT_SYMBOL(__napi_schedule);

^ permalink raw reply related

* Re: Current status of rt2800usb and staging/rt2870
From: Bartlomiej Zolnierkiewicz @ 2009-10-15  9:47 UTC (permalink / raw)
  To: Gertjan van Wingerde
  Cc: Ivo van Doorn, John W. Linville, Dan Williams,
	Ozan Çağlayan, linux-wireless, linux-kernel
In-Reply-To: <14add3d10910142328xffa8e91re7902aa3bd04b52d@mail.gmail.com>

On Thursday 15 October 2009 08:28:07 Gertjan van Wingerde wrote:
> On Wed, Oct 14, 2009 at 10:10 PM, Bartlomiej Zolnierkiewicz
> <bzolnier@gmail.com> wrote:
> > On Wednesday 14 October 2009 20:56:17 Ivo van Doorn wrote:
> >> Hi,
> >>
> >> > > On Wed, Oct 14, 2009 at 05:28:21PM +0200, Bartlomiej Zolnierkiewicz wrote:
> >> > >
> >> > > > I don't have a have a problem with it personally as long as people accept
> >> > > > the competition..  but instead of working on _their_ projects they go around
> >> > > > screaming at everybody who does not want to spin inside the great process
> >> > > > designed by them..
> >> > >
> >> > > Please whine somewhere else.  You have the freedom to work in
> >> > > drivers/staging all you want.  You do not have the power to force us to
> >> > > like it -- especially in a case where you are diverting attention from
> >> > > the community-maintained drivers instead of cooperating with them.
> >> >
> >> > Cooperating you say.
> >> >
> >> > rtl8187 -- before starting the work on rtl8187se I've pinged the maintainer
> >> > to coordinate the effort and hear his opinion on how to progress..
> >> >
> >> > I've never heard back.
> >> >
> >> > rt2x00 -- I know that people have datasheets for some chipsets but I've
> >> > never heard "How can we help you" etc. thing.
> >>
> >> The rt2x00 members received the specsheets under the condition that we didn't
> >> distribute them further.
> >>
> >> So everybody which requested the datasheets from the rt2x00 project were presented
> >> with a choice:
> >> 1) We provide the email address of the Ralink contact person which can device if you
> >> can get the specsheet or not (possibly under NDA, but this isn't always the case).
> >> 2) Specific questions about the registers can be asked and we give all the information we
> >> know from our work on the rt2x00 project plus additional information from the specsheet.
> >> Seeing that the specsheet doesn't always match reality, you get the better answers with
> >> this option, but some people just hate it when they need to ask other people for stuff.
> >>
> >> > All I've ever heard was _lies_ about current state of affairs or that
> >> > my work is in the way.
> >>
> >> I have encounterd your email address in only 2 rt2x00 related discussions
> >> (yes I have checked my entire email archive). Both cases were regarding
> >> staging vs rt2x00.
> >>
> >> So far I never said rt2800usb or rt2800pci were high quality, I never said they were in a good
> >> shape. On the other hand, I often talked about the problems with the drivers, requesting help
> >> to improve the drivers, etc etc.
> >>
> >> So are you basing this "I am hearing lies" about a random person talking on the street
> >> about rt2x00 which is telling the lie?
> >
> > Maybe I've used a bit too strong wording but the fact is that vendor drivers
> > are useful for providing users with *unsupported* and *temporary* solution
> > until the proper drivers are in place have been questioned a lot in the past,
> > and sorry but it is a fact (it may be hard to swallow but it shouldn't be
> > discussed about).
> >
> > The staging is a new game in town and provides real benefit for end-users
> > to use their hardware early while proper solutions are being worked on (not
> > like most of distributions weren't shipping crap drivers anyway -- now at
> > least we have some control over it).
> >
> > This is extremely important in segments where Linux is still not the leading
> > OS.  We cannot tell users to go hike -- they are our users! Moreover they
> > are quite smart so they will use what works best for their needs anyway,
> > not necessarily what is the easiest for us to maintain in the long-term or
> > work on.
> >
> > Staging also helps companies involved to transform their software offerings
> > in a more smooth way.  Often such transition requires long process and much
> > work on the company side to adapt to our model of doing things so patience
> > is recommended.  (Lets not forget that staging provides also a stick part,
> > drivers are removed from staging if nobody cares about them and even if
> > there are volunteers caring about support for certain hardware the company
> > will still get a bad publicity if it doesn't participate in the process)..
> >
> > So staging is here to stay and it is up to particular maintainers how they
> > are going to it use this "tool" and integrate it into their current mode of
> > operation..
> >
> > I'm sorry if my words were offending to you or other wireless developers.
> > I kind of feel the frustration of people who had put years of effort into
> > providing the proper wireless infrastructure + drivers and are ignored
> > by vendors.  However we have to keep the ball rolling and cannot dismiss
> > valid user complaints or ignore other possibilities of doing things.
> >
> 
> All,
> 
> I don't think this discussion is leading us anywhere.
> I believe everybody agrees with the "staging"/Ralink provided drivers to be good
> to provide end-users a working solution until the rt2x00 driver has
> been completed.
> 
> However, the problem that we have seen (from the rt2x00 project point
> of view) is that
> the Ralink drivers that are in staging are confusing / distraction
> developer attention. We
> have had quite a few occasions where new developers started to work on
> the staging
> drivers, as they thought these were "the way to go".
> 
> I think that can be easily solved by including in the Ralink staging
> drivers a README
> file pointing to the rt2x00 drivers, and a note stating that the
> rt2x00 drivers are the ones
> for long-term Linux support, and that the staging drivers are there
> just to help users making
> their hardware work.

I think that there is already a note stating something like that.

However if you think that something needs to be added or changed then
please just send Greg a patch

^ permalink raw reply

* [PATCH 4/5] wl1271: fix endianess issues
From: Luciano Coelho @ 2009-10-15  7:33 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless
In-Reply-To: <1255592010-10287-1-git-send-email-luciano.coelho@nokia.com>

We were not handling endianess correctly.  The wl1271 chip runs on
little-endian values.  This patch makes sure that all the communication with
the wl1271 firmware is done in little-endian by using cpu_to_le* and
le*_to_cpu where appropriate.

Also, all the struct definitions for data exchanged with the firmware has
been changed to use __le16/32 types instead of u16/32.

This fixes a few sparse warnings, such as these:

drivers/net/wireless/wl12xx/wl1271_cmd.c:554:42: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_cmd.c:555:42: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_cmd.c:577:58: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_cmd.c:579:58: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_cmd.c:676:18: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_cmd.c:787:22: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_cmd.c:789:21: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_tx.c:98:47: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/wl12xx/wl1271_acx.c:932:32: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_boot.c:191:32: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/wl12xx/wl1271_boot.c:197:38: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/wl12xx/wl1271_boot.c:199:37: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/wl12xx/wl1271_init.c:255:40: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_init.c:275:53: warning: incorrect type in assignment (different base types)

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
---
 drivers/net/wireless/wl12xx/wl1271.h       |   10 +-
 drivers/net/wireless/wl12xx/wl1271_acx.c   |   72 ++++----
 drivers/net/wireless/wl12xx/wl1271_acx.h   |  286 ++++++++++++++--------------
 drivers/net/wireless/wl12xx/wl1271_boot.c  |    6 +-
 drivers/net/wireless/wl12xx/wl1271_cmd.c   |   74 ++++----
 drivers/net/wireless/wl12xx/wl1271_cmd.h   |   68 ++++----
 drivers/net/wireless/wl12xx/wl1271_event.c |    3 +-
 drivers/net/wireless/wl12xx/wl1271_event.h |   28 ++--
 drivers/net/wireless/wl12xx/wl1271_init.h  |    4 +-
 drivers/net/wireless/wl12xx/wl1271_main.c  |   12 +-
 drivers/net/wireless/wl12xx/wl1271_rx.c    |   11 +-
 drivers/net/wireless/wl12xx/wl1271_rx.h    |    4 +-
 drivers/net/wireless/wl12xx/wl1271_tx.c    |   22 ++-
 drivers/net/wireless/wl12xx/wl1271_tx.h    |   18 +-
 drivers/net/wireless/wl12xx/wl12xx_80211.h |    4 +-
 15 files changed, 318 insertions(+), 304 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1271.h b/drivers/net/wireless/wl12xx/wl1271.h
index 1309b20..566f152 100644
--- a/drivers/net/wireless/wl12xx/wl1271.h
+++ b/drivers/net/wireless/wl12xx/wl1271.h
@@ -283,15 +283,15 @@ struct wl1271_debugfs {
 
 /* FW status registers */
 struct wl1271_fw_status {
-	u32 intr;
+	__le32 intr;
 	u8  fw_rx_counter;
 	u8  drv_rx_counter;
 	u8  reserved;
 	u8  tx_results_counter;
-	u32 rx_pkt_descs[NUM_RX_PKT_DESC];
-	u32 tx_released_blks[NUM_TX_QUEUES];
-	u32 fw_localtime;
-	u32 padding[2];
+	__le32 rx_pkt_descs[NUM_RX_PKT_DESC];
+	__le32 tx_released_blks[NUM_TX_QUEUES];
+	__le32 fw_localtime;
+	__le32 padding[2];
 } __attribute__ ((packed));
 
 struct wl1271_rx_mem_pool_addr {
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.c b/drivers/net/wireless/wl12xx/wl1271_acx.c
index e891cd5..bf5a868 100644
--- a/drivers/net/wireless/wl12xx/wl1271_acx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_acx.c
@@ -210,7 +210,7 @@ int wl1271_acx_rx_msdu_life_time(struct wl1271 *wl)
 		goto out;
 	}
 
-	acx->lifetime = wl->conf.rx.rx_msdu_life_time;
+	acx->lifetime = cpu_to_le32(wl->conf.rx.rx_msdu_life_time);
 	ret = wl1271_cmd_configure(wl, DOT11_RX_MSDU_LIFE_TIME,
 				   acx, sizeof(*acx));
 	if (ret < 0) {
@@ -236,8 +236,8 @@ int wl1271_acx_rx_config(struct wl1271 *wl, u32 config, u32 filter)
 		goto out;
 	}
 
-	rx_config->config_options = config;
-	rx_config->filter_options = filter;
+	rx_config->config_options = cpu_to_le32(config);
+	rx_config->filter_options = cpu_to_le32(filter);
 
 	ret = wl1271_cmd_configure(wl, ACX_RX_CFG,
 				   rx_config, sizeof(*rx_config));
@@ -264,7 +264,7 @@ int wl1271_acx_pd_threshold(struct wl1271 *wl)
 		goto out;
 	}
 
-	pd->threshold = wl->conf.rx.packet_detection_threshold;
+	pd->threshold = cpu_to_le32(wl->conf.rx.packet_detection_threshold);
 
 	ret = wl1271_cmd_configure(wl, ACX_PD_THRESHOLD, pd, sizeof(*pd));
 	if (ret < 0) {
@@ -348,8 +348,8 @@ int wl1271_acx_service_period_timeout(struct wl1271 *wl)
 
 	wl1271_debug(DEBUG_ACX, "acx service period timeout");
 
-	rx_timeout->ps_poll_timeout = wl->conf.rx.ps_poll_timeout;
-	rx_timeout->upsd_timeout = wl->conf.rx.upsd_timeout;
+	rx_timeout->ps_poll_timeout = cpu_to_le16(wl->conf.rx.ps_poll_timeout);
+	rx_timeout->upsd_timeout = cpu_to_le16(wl->conf.rx.upsd_timeout);
 
 	ret = wl1271_cmd_configure(wl, ACX_SERVICE_PERIOD_TIMEOUT,
 				   rx_timeout, sizeof(*rx_timeout));
@@ -377,7 +377,7 @@ int wl1271_acx_rts_threshold(struct wl1271 *wl, u16 rts_threshold)
 		goto out;
 	}
 
-	rts->threshold = rts_threshold;
+	rts->threshold = cpu_to_le16(rts_threshold);
 
 	ret = wl1271_cmd_configure(wl, DOT11_RTS_THRESHOLD, rts, sizeof(*rts));
 	if (ret < 0) {
@@ -494,8 +494,8 @@ int wl1271_acx_conn_monit_params(struct wl1271 *wl)
 		goto out;
 	}
 
-	acx->synch_fail_thold = wl->conf.conn.synch_fail_thold;
-	acx->bss_lose_timeout = wl->conf.conn.bss_lose_timeout;
+	acx->synch_fail_thold = cpu_to_le32(wl->conf.conn.synch_fail_thold);
+	acx->bss_lose_timeout = cpu_to_le32(wl->conf.conn.bss_lose_timeout);
 
 	ret = wl1271_cmd_configure(wl, ACX_CONN_MONIT_PARAMS,
 				   acx, sizeof(*acx));
@@ -552,16 +552,18 @@ int wl1271_acx_sg_cfg(struct wl1271 *wl)
 	}
 
 	/* BT-WLAN coext parameters */
-	param->per_threshold = c->per_threshold;
-	param->max_scan_compensation_time = c->max_scan_compensation_time;
-	param->nfs_sample_interval = c->nfs_sample_interval;
+	param->per_threshold = cpu_to_le32(c->per_threshold);
+	param->max_scan_compensation_time =
+		cpu_to_le32(c->max_scan_compensation_time);
+	param->nfs_sample_interval = cpu_to_le16(c->nfs_sample_interval);
 	param->load_ratio = c->load_ratio;
 	param->auto_ps_mode = c->auto_ps_mode;
 	param->probe_req_compensation = c->probe_req_compensation;
 	param->scan_window_compensation = c->scan_window_compensation;
 	param->antenna_config = c->antenna_config;
 	param->beacon_miss_threshold = c->beacon_miss_threshold;
-	param->rate_adaptation_threshold = c->rate_adaptation_threshold;
+	param->rate_adaptation_threshold =
+		cpu_to_le32(c->rate_adaptation_threshold);
 	param->rate_adaptation_snr = c->rate_adaptation_snr;
 
 	ret = wl1271_cmd_configure(wl, ACX_SG_CFG, param, sizeof(*param));
@@ -588,7 +590,7 @@ int wl1271_acx_cca_threshold(struct wl1271 *wl)
 		goto out;
 	}
 
-	detection->rx_cca_threshold = wl->conf.rx.rx_cca_threshold;
+	detection->rx_cca_threshold = cpu_to_le16(wl->conf.rx.rx_cca_threshold);
 	detection->tx_energy_detection = wl->conf.tx.tx_energy_detection;
 
 	ret = wl1271_cmd_configure(wl, ACX_CCA_THRESHOLD,
@@ -616,8 +618,8 @@ int wl1271_acx_bcn_dtim_options(struct wl1271 *wl)
 		goto out;
 	}
 
-	bb->beacon_rx_timeout = wl->conf.conn.beacon_rx_timeout;
-	bb->broadcast_timeout = wl->conf.conn.broadcast_timeout;
+	bb->beacon_rx_timeout = cpu_to_le16(wl->conf.conn.beacon_rx_timeout);
+	bb->broadcast_timeout = cpu_to_le16(wl->conf.conn.broadcast_timeout);
 	bb->rx_broadcast_in_ps = wl->conf.conn.rx_broadcast_in_ps;
 	bb->ps_poll_threshold = wl->conf.conn.ps_poll_threshold;
 
@@ -645,7 +647,7 @@ int wl1271_acx_aid(struct wl1271 *wl, u16 aid)
 		goto out;
 	}
 
-	acx_aid->aid = aid;
+	acx_aid->aid = cpu_to_le16(aid);
 
 	ret = wl1271_cmd_configure(wl, ACX_AID, acx_aid, sizeof(*acx_aid));
 	if (ret < 0) {
@@ -672,9 +674,8 @@ int wl1271_acx_event_mbox_mask(struct wl1271 *wl, u32 event_mask)
 	}
 
 	/* high event mask is unused */
-	mask->high_event_mask = 0xffffffff;
-
-	mask->event_mask = event_mask;
+	mask->high_event_mask = cpu_to_le32(0xffffffff);
+	mask->event_mask = cpu_to_le32(event_mask);
 
 	ret = wl1271_cmd_configure(wl, ACX_EVENT_MBOX_MASK,
 				   mask, sizeof(*mask));
@@ -773,8 +774,8 @@ int wl1271_acx_rate_policies(struct wl1271 *wl, u32 enabled_rates)
 	}
 
 	/* configure one default (one-size-fits-all) rate class */
-	acx->rate_class_cnt = 1;
-	acx->rate_class[0].enabled_rates = enabled_rates;
+	acx->rate_class_cnt = cpu_to_le32(1);
+	acx->rate_class[0].enabled_rates = cpu_to_le32(enabled_rates);
 	acx->rate_class[0].short_retry_limit = c->short_retry_limit;
 	acx->rate_class[0].long_retry_limit = c->long_retry_limit;
 	acx->rate_class[0].aflags = c->aflags;
@@ -808,10 +809,10 @@ int wl1271_acx_ac_cfg(struct wl1271 *wl)
 		struct conf_tx_ac_category *c = &(wl->conf.tx.ac_conf[i]);
 		acx->ac = c->ac;
 		acx->cw_min = c->cw_min;
-		acx->cw_max = c->cw_max;
+		acx->cw_max = cpu_to_le16(c->cw_max);
 		acx->aifsn = c->aifsn;
 		acx->reserved = 0;
-		acx->tx_op_limit = c->tx_op_limit;
+		acx->tx_op_limit = cpu_to_le16(c->tx_op_limit);
 
 		ret = wl1271_cmd_configure(wl, ACX_AC_CFG, acx, sizeof(*acx));
 		if (ret < 0) {
@@ -847,8 +848,8 @@ int wl1271_acx_tid_cfg(struct wl1271 *wl)
 		acx->tsid = c->tsid;
 		acx->ps_scheme = c->ps_scheme;
 		acx->ack_policy = c->ack_policy;
-		acx->apsd_conf[0] = c->apsd_conf[0];
-		acx->apsd_conf[1] = c->apsd_conf[1];
+		acx->apsd_conf[0] = cpu_to_le32(c->apsd_conf[0]);
+		acx->apsd_conf[1] = cpu_to_le32(c->apsd_conf[1]);
 
 		ret = wl1271_cmd_configure(wl, ACX_TID_CFG, acx, sizeof(*acx));
 		if (ret < 0) {
@@ -876,7 +877,7 @@ int wl1271_acx_frag_threshold(struct wl1271 *wl)
 		goto out;
 	}
 
-	acx->frag_threshold = wl->conf.tx.frag_threshold;
+	acx->frag_threshold = cpu_to_le16(wl->conf.tx.frag_threshold);
 	ret = wl1271_cmd_configure(wl, ACX_FRAG_CFG, acx, sizeof(*acx));
 	if (ret < 0) {
 		wl1271_warning("Setting of frag threshold failed: %d", ret);
@@ -902,8 +903,8 @@ int wl1271_acx_tx_config_options(struct wl1271 *wl)
 		goto out;
 	}
 
-	acx->tx_compl_timeout = wl->conf.tx.tx_compl_timeout;
-	acx->tx_compl_threshold = wl->conf.tx.tx_compl_threshold;
+	acx->tx_compl_timeout = cpu_to_le16(wl->conf.tx.tx_compl_timeout);
+	acx->tx_compl_threshold = cpu_to_le16(wl->conf.tx.tx_compl_threshold);
 	ret = wl1271_cmd_configure(wl, ACX_TX_CONFIG_OPT, acx, sizeof(*acx));
 	if (ret < 0) {
 		wl1271_warning("Setting of tx options failed: %d", ret);
@@ -929,11 +930,11 @@ int wl1271_acx_mem_cfg(struct wl1271 *wl)
 	}
 
 	/* memory config */
-	mem_conf->num_stations = cpu_to_le16(DEFAULT_NUM_STATIONS);
+	mem_conf->num_stations = DEFAULT_NUM_STATIONS;
 	mem_conf->rx_mem_block_num = ACX_RX_MEM_BLOCKS;
 	mem_conf->tx_min_mem_block_num = ACX_TX_MIN_MEM_BLOCKS;
 	mem_conf->num_ssid_profiles = ACX_NUM_SSID_PROFILES;
-	mem_conf->total_tx_descriptors = ACX_TX_DESCRIPTORS;
+	mem_conf->total_tx_descriptors = cpu_to_le32(ACX_TX_DESCRIPTORS);
 
 	ret = wl1271_cmd_configure(wl, ACX_MEM_CFG, mem_conf,
 				   sizeof(*mem_conf));
@@ -973,7 +974,8 @@ int wl1271_acx_init_mem_config(struct wl1271 *wl)
 	}
 
 	/* initialize TX block book keeping */
-	wl->tx_blocks_available = wl->target_mem_map->num_tx_mem_blocks;
+	wl->tx_blocks_available =
+		le32_to_cpu(wl->target_mem_map->num_tx_mem_blocks);
 	wl1271_debug(DEBUG_TX, "available tx blocks: %d",
 		     wl->tx_blocks_available);
 
@@ -993,9 +995,9 @@ int wl1271_acx_init_rx_interrupt(struct wl1271 *wl)
 		goto out;
 	}
 
-	rx_conf->threshold = wl->conf.rx.irq_pkt_threshold;
-	rx_conf->timeout = wl->conf.rx.irq_timeout;
-	rx_conf->mblk_threshold = wl->conf.rx.irq_blk_threshold;
+	rx_conf->threshold = cpu_to_le16(wl->conf.rx.irq_pkt_threshold);
+	rx_conf->timeout = cpu_to_le16(wl->conf.rx.irq_timeout);
+	rx_conf->mblk_threshold = cpu_to_le16(wl->conf.rx.irq_blk_threshold);
 	rx_conf->queue_type = wl->conf.rx.queue_type;
 
 	ret = wl1271_cmd_configure(wl, ACX_RX_CONFIG_OPT, rx_conf,
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.h b/drivers/net/wireless/wl12xx/wl1271_acx.h
index 5085497..2ce0a81 100644
--- a/drivers/net/wireless/wl12xx/wl1271_acx.h
+++ b/drivers/net/wireless/wl12xx/wl1271_acx.h
@@ -71,10 +71,10 @@ struct acx_header {
 	struct wl1271_cmd_header cmd;
 
 	/* acx (or information element) header */
-	u16 id;
+	__le16 id;
 
 	/* payload length (not including headers */
-	u16 len;
+	__le16 len;
 } __attribute__ ((packed));
 
 struct acx_error_counter {
@@ -83,21 +83,21 @@ struct acx_error_counter {
 	/* The number of PLCP errors since the last time this */
 	/* information element was interrogated. This field is */
 	/* automatically cleared when it is interrogated.*/
-	u32 PLCP_error;
+	__le32 PLCP_error;
 
 	/* The number of FCS errors since the last time this */
 	/* information element was interrogated. This field is */
 	/* automatically cleared when it is interrogated.*/
-	u32 FCS_error;
+	__le32 FCS_error;
 
 	/* The number of MPDUs without PLCP header errors received*/
 	/* since the last time this information element was interrogated. */
 	/* This field is automatically cleared when it is interrogated.*/
-	u32 valid_frame;
+	__le32 valid_frame;
 
 	/* the number of missed sequence numbers in the squentially */
 	/* values of frames seq numbers */
-	u32 seq_num_miss;
+	__le32 seq_num_miss;
 } __attribute__ ((packed));
 
 struct acx_revision {
@@ -126,7 +126,7 @@ struct acx_revision {
 	 *              (1 = first spin, 2 = second spin, and so on).
 	 * bits 24 - 31: Chip ID - The WiLink chip ID.
 	 */
-	u32 hw_version;
+	__le32 hw_version;
 } __attribute__ ((packed));
 
 enum wl1271_psm_mode {
@@ -186,7 +186,7 @@ struct acx_rx_msdu_lifetime {
 	 * The maximum amount of time, in TU, before the
 	 * firmware discards the MSDU.
 	 */
-	u32 lifetime;
+	__le32 lifetime;
 } __attribute__ ((packed));
 
 /*
@@ -273,14 +273,14 @@ struct acx_rx_msdu_lifetime {
 struct acx_rx_config {
 	struct acx_header header;
 
-	u32 config_options;
-	u32 filter_options;
+	__le32 config_options;
+	__le32 filter_options;
 } __attribute__ ((packed));
 
 struct acx_packet_detection {
 	struct acx_header header;
 
-	u32 threshold;
+	__le32 threshold;
 } __attribute__ ((packed));
 
 
@@ -317,14 +317,14 @@ struct acx_dot11_grp_addr_tbl {
 struct acx_rx_timeout {
 	struct acx_header header;
 
-	u16 ps_poll_timeout;
-	u16 upsd_timeout;
+	__le16 ps_poll_timeout;
+	__le16 upsd_timeout;
 } __attribute__ ((packed));
 
 struct acx_rts_threshold {
 	struct acx_header header;
 
-	u16 threshold;
+	__le16 threshold;
 	u8 pad[2];
 } __attribute__ ((packed));
 
@@ -388,8 +388,8 @@ struct acx_beacon_filter_ie_table {
 struct acx_conn_monit_params {
        struct acx_header header;
 
-       u32 synch_fail_thold; /* number of beacons missed */
-       u32 bss_lose_timeout; /* number of TU's from synch fail */
+       __le32 synch_fail_thold; /* number of beacons missed */
+       __le32 bss_lose_timeout; /* number of TU's from synch fail */
 } __attribute__ ((packed));
 
 enum {
@@ -466,16 +466,16 @@ struct acx_smart_reflex_config_params {
 struct acx_bt_wlan_coex_param {
 	struct acx_header header;
 
-	u32 per_threshold;
-	u32 max_scan_compensation_time;
-	u16 nfs_sample_interval;
+	__le32 per_threshold;
+	__le32 max_scan_compensation_time;
+	__le16 nfs_sample_interval;
 	u8 load_ratio;
 	u8 auto_ps_mode;
 	u8 probe_req_compensation;
 	u8 scan_window_compensation;
 	u8 antenna_config;
 	u8 beacon_miss_threshold;
-	u32 rate_adaptation_threshold;
+	__le32 rate_adaptation_threshold;
 	s8 rate_adaptation_snr;
 	u8 padding[3];
 } __attribute__ ((packed));
@@ -484,7 +484,7 @@ struct acx_energy_detection {
 	struct acx_header header;
 
 	/* The RX Clear Channel Assessment threshold in the PHY */
-	u16 rx_cca_threshold;
+	__le16 rx_cca_threshold;
 	u8 tx_energy_detection;
 	u8 pad;
 } __attribute__ ((packed));
@@ -492,8 +492,8 @@ struct acx_energy_detection {
 struct acx_beacon_broadcast {
 	struct acx_header header;
 
-	u16 beacon_rx_timeout;
-	u16 broadcast_timeout;
+	__le16 beacon_rx_timeout;
+	__le16 broadcast_timeout;
 
 	/* Enables receiving of broadcast packets in PS mode */
 	u8 rx_broadcast_in_ps;
@@ -506,8 +506,8 @@ struct acx_beacon_broadcast {
 struct acx_event_mask {
 	struct acx_header header;
 
-	u32 event_mask;
-	u32 high_event_mask; /* Unused */
+	__le32 event_mask;
+	__le32 high_event_mask; /* Unused */
 } __attribute__ ((packed));
 
 #define CFG_RX_FCS		BIT(2)
@@ -551,8 +551,8 @@ struct acx_event_mask {
 struct acx_feature_config {
 	struct acx_header header;
 
-	u32 options;
-	u32 data_flow_options;
+	__le32 options;
+	__le32 data_flow_options;
 } __attribute__ ((packed));
 
 struct acx_current_tx_power {
@@ -576,7 +576,7 @@ struct acx_aid {
 	/*
 	 * To be set when associated with an AP.
 	 */
-	u16 aid;
+	__le16 aid;
 	u8 pad[2];
 } __attribute__ ((packed));
 
@@ -608,152 +608,152 @@ struct acx_ctsprotect {
 } __attribute__ ((packed));
 
 struct acx_tx_statistics {
-	u32 internal_desc_overflow;
+	__le32 internal_desc_overflow;
 }  __attribute__ ((packed));
 
 struct acx_rx_statistics {
-	u32 out_of_mem;
-	u32 hdr_overflow;
-	u32 hw_stuck;
-	u32 dropped;
-	u32 fcs_err;
-	u32 xfr_hint_trig;
-	u32 path_reset;
-	u32 reset_counter;
+	__le32 out_of_mem;
+	__le32 hdr_overflow;
+	__le32 hw_stuck;
+	__le32 dropped;
+	__le32 fcs_err;
+	__le32 xfr_hint_trig;
+	__le32 path_reset;
+	__le32 reset_counter;
 } __attribute__ ((packed));
 
 struct acx_dma_statistics {
-	u32 rx_requested;
-	u32 rx_errors;
-	u32 tx_requested;
-	u32 tx_errors;
+	__le32 rx_requested;
+	__le32 rx_errors;
+	__le32 tx_requested;
+	__le32 tx_errors;
 }  __attribute__ ((packed));
 
 struct acx_isr_statistics {
 	/* host command complete */
-	u32 cmd_cmplt;
+	__le32 cmd_cmplt;
 
 	/* fiqisr() */
-	u32 fiqs;
+	__le32 fiqs;
 
 	/* (INT_STS_ND & INT_TRIG_RX_HEADER) */
-	u32 rx_headers;
+	__le32 rx_headers;
 
 	/* (INT_STS_ND & INT_TRIG_RX_CMPLT) */
-	u32 rx_completes;
+	__le32 rx_completes;
 
 	/* (INT_STS_ND & INT_TRIG_NO_RX_BUF) */
-	u32 rx_mem_overflow;
+	__le32 rx_mem_overflow;
 
 	/* (INT_STS_ND & INT_TRIG_S_RX_RDY) */
-	u32 rx_rdys;
+	__le32 rx_rdys;
 
 	/* irqisr() */
-	u32 irqs;
+	__le32 irqs;
 
 	/* (INT_STS_ND & INT_TRIG_TX_PROC) */
-	u32 tx_procs;
+	__le32 tx_procs;
 
 	/* (INT_STS_ND & INT_TRIG_DECRYPT_DONE) */
-	u32 decrypt_done;
+	__le32 decrypt_done;
 
 	/* (INT_STS_ND & INT_TRIG_DMA0) */
-	u32 dma0_done;
+	__le32 dma0_done;
 
 	/* (INT_STS_ND & INT_TRIG_DMA1) */
-	u32 dma1_done;
+	__le32 dma1_done;
 
 	/* (INT_STS_ND & INT_TRIG_TX_EXC_CMPLT) */
-	u32 tx_exch_complete;
+	__le32 tx_exch_complete;
 
 	/* (INT_STS_ND & INT_TRIG_COMMAND) */
-	u32 commands;
+	__le32 commands;
 
 	/* (INT_STS_ND & INT_TRIG_RX_PROC) */
-	u32 rx_procs;
+	__le32 rx_procs;
 
 	/* (INT_STS_ND & INT_TRIG_PM_802) */
-	u32 hw_pm_mode_changes;
+	__le32 hw_pm_mode_changes;
 
 	/* (INT_STS_ND & INT_TRIG_ACKNOWLEDGE) */
-	u32 host_acknowledges;
+	__le32 host_acknowledges;
 
 	/* (INT_STS_ND & INT_TRIG_PM_PCI) */
-	u32 pci_pm;
+	__le32 pci_pm;
 
 	/* (INT_STS_ND & INT_TRIG_ACM_WAKEUP) */
-	u32 wakeups;
+	__le32 wakeups;
 
 	/* (INT_STS_ND & INT_TRIG_LOW_RSSI) */
-	u32 low_rssi;
+	__le32 low_rssi;
 } __attribute__ ((packed));
 
 struct acx_wep_statistics {
 	/* WEP address keys configured */
-	u32 addr_key_count;
+	__le32 addr_key_count;
 
 	/* default keys configured */
-	u32 default_key_count;
+	__le32 default_key_count;
 
-	u32 reserved;
+	__le32 reserved;
 
 	/* number of times that WEP key not found on lookup */
-	u32 key_not_found;
+	__le32 key_not_found;
 
 	/* number of times that WEP key decryption failed */
-	u32 decrypt_fail;
+	__le32 decrypt_fail;
 
 	/* WEP packets decrypted */
-	u32 packets;
+	__le32 packets;
 
 	/* WEP decrypt interrupts */
-	u32 interrupt;
+	__le32 interrupt;
 } __attribute__ ((packed));
 
 #define ACX_MISSED_BEACONS_SPREAD 10
 
 struct acx_pwr_statistics {
 	/* the amount of enters into power save mode (both PD & ELP) */
-	u32 ps_enter;
+	__le32 ps_enter;
 
 	/* the amount of enters into ELP mode */
-	u32 elp_enter;
+	__le32 elp_enter;
 
 	/* the amount of missing beacon interrupts to the host */
-	u32 missing_bcns;
+	__le32 missing_bcns;
 
 	/* the amount of wake on host-access times */
-	u32 wake_on_host;
+	__le32 wake_on_host;
 
 	/* the amount of wake on timer-expire */
-	u32 wake_on_timer_exp;
+	__le32 wake_on_timer_exp;
 
 	/* the number of packets that were transmitted with PS bit set */
-	u32 tx_with_ps;
+	__le32 tx_with_ps;
 
 	/* the number of packets that were transmitted with PS bit clear */
-	u32 tx_without_ps;
+	__le32 tx_without_ps;
 
 	/* the number of received beacons */
-	u32 rcvd_beacons;
+	__le32 rcvd_beacons;
 
 	/* the number of entering into PowerOn (power save off) */
-	u32 power_save_off;
+	__le32 power_save_off;
 
 	/* the number of entries into power save mode */
-	u16 enable_ps;
+	__le16 enable_ps;
 
 	/*
 	 * the number of exits from power save, not including failed PS
 	 * transitions
 	 */
-	u16 disable_ps;
+	__le16 disable_ps;
 
 	/*
 	 * the number of times the TSF counter was adjusted because
 	 * of drift
 	 */
-	u32 fix_tsf_ps;
+	__le32 fix_tsf_ps;
 
 	/* Gives statistics about the spread continuous missed beacons.
 	 * The 16 LSB are dedicated for the PS mode.
@@ -764,53 +764,53 @@ struct acx_pwr_statistics {
 	 * ...
 	 * cont_miss_bcns_spread[9] - ten and more continuous missed beacons.
 	*/
-	u32 cont_miss_bcns_spread[ACX_MISSED_BEACONS_SPREAD];
+	__le32 cont_miss_bcns_spread[ACX_MISSED_BEACONS_SPREAD];
 
 	/* the number of beacons in awake mode */
-	u32 rcvd_awake_beacons;
+	__le32 rcvd_awake_beacons;
 } __attribute__ ((packed));
 
 struct acx_mic_statistics {
-	u32 rx_pkts;
-	u32 calc_failure;
+	__le32 rx_pkts;
+	__le32 calc_failure;
 } __attribute__ ((packed));
 
 struct acx_aes_statistics {
-	u32 encrypt_fail;
-	u32 decrypt_fail;
-	u32 encrypt_packets;
-	u32 decrypt_packets;
-	u32 encrypt_interrupt;
-	u32 decrypt_interrupt;
+	__le32 encrypt_fail;
+	__le32 decrypt_fail;
+	__le32 encrypt_packets;
+	__le32 decrypt_packets;
+	__le32 encrypt_interrupt;
+	__le32 decrypt_interrupt;
 } __attribute__ ((packed));
 
 struct acx_event_statistics {
-	u32 heart_beat;
-	u32 calibration;
-	u32 rx_mismatch;
-	u32 rx_mem_empty;
-	u32 rx_pool;
-	u32 oom_late;
-	u32 phy_transmit_error;
-	u32 tx_stuck;
+	__le32 heart_beat;
+	__le32 calibration;
+	__le32 rx_mismatch;
+	__le32 rx_mem_empty;
+	__le32 rx_pool;
+	__le32 oom_late;
+	__le32 phy_transmit_error;
+	__le32 tx_stuck;
 } __attribute__ ((packed));
 
 struct acx_ps_statistics {
-	u32 pspoll_timeouts;
-	u32 upsd_timeouts;
-	u32 upsd_max_sptime;
-	u32 upsd_max_apturn;
-	u32 pspoll_max_apturn;
-	u32 pspoll_utilization;
-	u32 upsd_utilization;
+	__le32 pspoll_timeouts;
+	__le32 upsd_timeouts;
+	__le32 upsd_max_sptime;
+	__le32 upsd_max_apturn;
+	__le32 pspoll_max_apturn;
+	__le32 pspoll_utilization;
+	__le32 upsd_utilization;
 } __attribute__ ((packed));
 
 struct acx_rxpipe_statistics {
-	u32 rx_prep_beacon_drop;
-	u32 descr_host_int_trig_rx_data;
-	u32 beacon_buffer_thres_host_int_trig_rx_data;
-	u32 missed_beacon_host_int_trig_rx_data;
-	u32 tx_xfr_host_int_trig_rx_data;
+	__le32 rx_prep_beacon_drop;
+	__le32 descr_host_int_trig_rx_data;
+	__le32 beacon_buffer_thres_host_int_trig_rx_data;
+	__le32 missed_beacon_host_int_trig_rx_data;
+	__le32 tx_xfr_host_int_trig_rx_data;
 } __attribute__ ((packed));
 
 struct acx_statistics {
@@ -830,7 +830,7 @@ struct acx_statistics {
 } __attribute__ ((packed));
 
 struct acx_rate_class {
-	u32 enabled_rates;
+	__le32 enabled_rates;
 	u8 short_retry_limit;
 	u8 long_retry_limit;
 	u8 aflags;
@@ -840,7 +840,7 @@ struct acx_rate_class {
 struct acx_rate_policy {
 	struct acx_header header;
 
-	u32 rate_class_cnt;
+	__le32 rate_class_cnt;
 	struct acx_rate_class rate_class[CONF_TX_MAX_RATE_CLASSES];
 } __attribute__ ((packed));
 
@@ -848,10 +848,10 @@ struct acx_ac_cfg {
 	struct acx_header header;
 	u8 ac;
 	u8 cw_min;
-	u16 cw_max;
+	__le16 cw_max;
 	u8 aifsn;
 	u8 reserved;
-	u16 tx_op_limit;
+	__le16 tx_op_limit;
 } __attribute__ ((packed));
 
 struct acx_tid_config {
@@ -862,19 +862,19 @@ struct acx_tid_config {
 	u8 ps_scheme;
 	u8 ack_policy;
 	u8 padding[3];
-	u32 apsd_conf[2];
+	__le32 apsd_conf[2];
 } __attribute__ ((packed));
 
 struct acx_frag_threshold {
 	struct acx_header header;
-	u16 frag_threshold;
+	__le16 frag_threshold;
 	u8 padding[2];
 } __attribute__ ((packed));
 
 struct acx_tx_config_options {
 	struct acx_header header;
-	u16 tx_compl_timeout;     /* msec */
-	u16 tx_compl_threshold;   /* number of packets */
+	__le16 tx_compl_timeout;     /* msec */
+	__le16 tx_compl_threshold;   /* number of packets */
 } __attribute__ ((packed));
 
 #define ACX_RX_MEM_BLOCKS     64
@@ -889,59 +889,59 @@ struct wl1271_acx_config_memory {
 	u8 tx_min_mem_block_num;
 	u8 num_stations;
 	u8 num_ssid_profiles;
-	u32 total_tx_descriptors;
+	__le32 total_tx_descriptors;
 } __attribute__ ((packed));
 
 struct wl1271_acx_mem_map {
 	struct acx_header header;
 
-	void *code_start;
-	void *code_end;
+	__le32 code_start;
+	__le32 code_end;
 
-	void *wep_defkey_start;
-	void *wep_defkey_end;
+	__le32 wep_defkey_start;
+	__le32 wep_defkey_end;
 
-	void *sta_table_start;
-	void *sta_table_end;
+	__le32 sta_table_start;
+	__le32 sta_table_end;
 
-	void *packet_template_start;
-	void *packet_template_end;
+	__le32 packet_template_start;
+	__le32 packet_template_end;
 
 	/* Address of the TX result interface (control block) */
-	u32 tx_result;
-	u32 tx_result_queue_start;
+	__le32 tx_result;
+	__le32 tx_result_queue_start;
 
-	void *queue_memory_start;
-	void *queue_memory_end;
+	__le32 queue_memory_start;
+	__le32 queue_memory_end;
 
-	u32 packet_memory_pool_start;
-	u32 packet_memory_pool_end;
+	__le32 packet_memory_pool_start;
+	__le32 packet_memory_pool_end;
 
-	void *debug_buffer1_start;
-	void *debug_buffer1_end;
+	__le32 debug_buffer1_start;
+	__le32 debug_buffer1_end;
 
-	void *debug_buffer2_start;
-	void *debug_buffer2_end;
+	__le32 debug_buffer2_start;
+	__le32 debug_buffer2_end;
 
 	/* Number of blocks FW allocated for TX packets */
-	u32 num_tx_mem_blocks;
+	__le32 num_tx_mem_blocks;
 
 	/* Number of blocks FW allocated for RX packets */
-	u32 num_rx_mem_blocks;
+	__le32 num_rx_mem_blocks;
 
 	/* the following 4 fields are valid in SLAVE mode only */
 	u8 *tx_cbuf;
 	u8 *rx_cbuf;
-	void *rx_ctrl;
-	void *tx_ctrl;
+	__le32 rx_ctrl;
+	__le32 tx_ctrl;
 } __attribute__ ((packed));
 
 struct wl1271_acx_rx_config_opt {
 	struct acx_header header;
 
-	u16 mblk_threshold;
-	u16 threshold;
-	u16 timeout;
+	__le16 mblk_threshold;
+	__le16 threshold;
+	__le16 timeout;
 	u8 queue_type;
 	u8 reserved;
 } __attribute__ ((packed));
diff --git a/drivers/net/wireless/wl12xx/wl1271_boot.c b/drivers/net/wireless/wl12xx/wl1271_boot.c
index 41a3050..ba4a2b4 100644
--- a/drivers/net/wireless/wl12xx/wl1271_boot.c
+++ b/drivers/net/wireless/wl12xx/wl1271_boot.c
@@ -188,15 +188,15 @@ static int wl1271_boot_upload_firmware(struct wl1271 *wl)
 	u8 *fw;
 
 	fw = wl->fw;
-	chunks = be32_to_cpup((u32 *) fw);
+	chunks = be32_to_cpup((__be32 *) fw);
 	fw += sizeof(u32);
 
 	wl1271_debug(DEBUG_BOOT, "firmware chunks to be uploaded: %u", chunks);
 
 	while (chunks--) {
-		addr = be32_to_cpup((u32 *) fw);
+		addr = be32_to_cpup((__be32 *) fw);
 		fw += sizeof(u32);
-		len = be32_to_cpup((u32 *) fw);
+		len = be32_to_cpup((__be32 *) fw);
 		fw += sizeof(u32);
 
 		if (len > 300000) {
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.c b/drivers/net/wireless/wl12xx/wl1271_cmd.c
index 195eee7..0666328 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.c
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.c
@@ -50,7 +50,7 @@ int wl1271_cmd_send(struct wl1271 *wl, u16 id, void *buf, size_t len)
 	int ret = 0;
 
 	cmd = buf;
-	cmd->id = id;
+	cmd->id = cpu_to_le16(id);
 	cmd->status = 0;
 
 	WARN_ON(len % 4 != 0);
@@ -217,8 +217,8 @@ int wl1271_cmd_join(struct wl1271 *wl)
 	for (i = 0; i < ETH_ALEN; i++)
 		bssid[i] = wl->bssid[ETH_ALEN - i - 1];
 
-	join->rx_config_options = wl->rx_config;
-	join->rx_filter_options = wl->rx_filter;
+	join->rx_config_options = cpu_to_le32(wl->rx_config);
+	join->rx_filter_options = cpu_to_le32(wl->rx_filter);
 	join->bss_type = wl->bss_type;
 
 	/*
@@ -227,21 +227,22 @@ int wl1271_cmd_join(struct wl1271 *wl)
 	 * association. The filter logic needs to be implemented properly
 	 * and once that is done, this hack can be removed.
 	 */
-	join->rx_config_options = 0;
-	join->rx_filter_options = WL1271_DEFAULT_RX_FILTER;
+	join->rx_config_options = cpu_to_le32(0);
+	join->rx_filter_options = cpu_to_le32(WL1271_DEFAULT_RX_FILTER);
 
 	if (wl->band == IEEE80211_BAND_2GHZ)
-		join->basic_rate_set =
-			CONF_HW_BIT_RATE_1MBPS | CONF_HW_BIT_RATE_2MBPS |
-		CONF_HW_BIT_RATE_5_5MBPS | CONF_HW_BIT_RATE_11MBPS;
+		join->basic_rate_set = cpu_to_le32(CONF_HW_BIT_RATE_1MBPS   |
+						   CONF_HW_BIT_RATE_2MBPS   |
+						   CONF_HW_BIT_RATE_5_5MBPS |
+						   CONF_HW_BIT_RATE_11MBPS);
 	else {
 		join->bss_type |= WL1271_JOIN_CMD_BSS_TYPE_5GHZ;
-		join->basic_rate_set =
-			CONF_HW_BIT_RATE_6MBPS | CONF_HW_BIT_RATE_12MBPS |
-			CONF_HW_BIT_RATE_24MBPS;
+		join->basic_rate_set = cpu_to_le32(CONF_HW_BIT_RATE_6MBPS  |
+						   CONF_HW_BIT_RATE_12MBPS |
+						   CONF_HW_BIT_RATE_24MBPS);
 	}
 
-	join->beacon_interval = WL1271_DEFAULT_BEACON_INT;
+	join->beacon_interval = cpu_to_le16(WL1271_DEFAULT_BEACON_INT);
 	join->dtim_interval = WL1271_DEFAULT_DTIM_PERIOD;
 
 	join->channel = wl->channel;
@@ -305,6 +306,7 @@ int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer)
 
 	if (answer) {
 		struct wl1271_command *cmd_answer;
+		u16 status;
 
 		/*
 		 * The test command got in, we can read the answer.
@@ -314,10 +316,10 @@ int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer)
 		wl1271_spi_read(wl, wl->cmd_box_addr, buf, buf_len, false);
 
 		cmd_answer = buf;
+		status = le16_to_cpu(cmd_answer->header.status);
 
-		if (cmd_answer->header.status != CMD_STATUS_SUCCESS)
-			wl1271_error("TEST command answer error: %d",
-				     cmd_answer->header.status);
+		if (status != CMD_STATUS_SUCCESS)
+			wl1271_error("TEST command answer error: %d", status);
 	}
 
 	return 0;
@@ -338,10 +340,10 @@ int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len)
 
 	wl1271_debug(DEBUG_CMD, "cmd interrogate");
 
-	acx->id = id;
+	acx->id = cpu_to_le16(id);
 
 	/* payload length, does not include any headers */
-	acx->len = len - sizeof(*acx);
+	acx->len = cpu_to_le16(len - sizeof(*acx));
 
 	ret = wl1271_cmd_send(wl, CMD_INTERROGATE, acx, sizeof(*acx));
 	if (ret < 0) {
@@ -353,9 +355,9 @@ int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len)
 	wl1271_spi_read(wl, wl->cmd_box_addr, buf, len, false);
 
 	acx = buf;
-	if (acx->cmd.status != CMD_STATUS_SUCCESS)
+	if (le16_to_cpu(acx->cmd.status) != CMD_STATUS_SUCCESS)
 		wl1271_error("INTERROGATE command error: %d",
-			     acx->cmd.status);
+			     le16_to_cpu(acx->cmd.status));
 
 out:
 	return ret;
@@ -376,10 +378,10 @@ int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len)
 
 	wl1271_debug(DEBUG_CMD, "cmd configure");
 
-	acx->id = id;
+	acx->id = cpu_to_le16(id);
 
 	/* payload length, does not include any headers */
-	acx->len = len - sizeof(*acx);
+	acx->len = cpu_to_le16(len - sizeof(*acx));
 
 	ret = wl1271_cmd_send(wl, CMD_CONFIGURE, acx, len);
 	if (ret < 0) {
@@ -463,7 +465,7 @@ int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode)
 	ps_params->send_null_data = 1;
 	ps_params->retries = 5;
 	ps_params->hang_over_period = 128;
-	ps_params->null_data_rate = 1; /* 1 Mbps */
+	ps_params->null_data_rate = cpu_to_le32(1); /* 1 Mbps */
 
 	ret = wl1271_cmd_send(wl, CMD_SET_PS_MODE, ps_params,
 			      sizeof(*ps_params));
@@ -494,8 +496,8 @@ int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer,
 	WARN_ON(len > MAX_READ_SIZE);
 	len = min_t(size_t, len, MAX_READ_SIZE);
 
-	cmd->addr = addr;
-	cmd->size = len;
+	cmd->addr = cpu_to_le32(addr);
+	cmd->size = cpu_to_le32(len);
 
 	ret = wl1271_cmd_send(wl, CMD_READ_MEMORY, cmd, sizeof(*cmd));
 	if (ret < 0) {
@@ -506,9 +508,9 @@ int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer,
 	/* the read command got in, we can now read the answer */
 	wl1271_spi_read(wl, wl->cmd_box_addr, cmd, sizeof(*cmd), false);
 
-	if (cmd->header.status != CMD_STATUS_SUCCESS)
+	if (le16_to_cpu(cmd->header.status) != CMD_STATUS_SUCCESS)
 		wl1271_error("error in read command result: %d",
-			     cmd->header.status);
+			     le16_to_cpu(cmd->header.status));
 
 	memcpy(answer, cmd->value, len);
 
@@ -559,7 +561,7 @@ int wl1271_cmd_scan(struct wl1271 *wl, u8 *ssid, size_t len,
 		scan_options |= WL1271_SCAN_OPT_PASSIVE;
 	if (high_prio)
 		scan_options |= WL1271_SCAN_OPT_PRIORITY_HIGH;
-	params->params.scan_options = scan_options;
+	params->params.scan_options = cpu_to_le16(scan_options);
 
 	params->params.num_probe_requests = probe_requests;
 	/* Let the fw autodetect suitable tx_rate for probes */
@@ -643,9 +645,9 @@ int wl1271_cmd_scan(struct wl1271 *wl, u8 *ssid, size_t len,
 	wl1271_spi_read(wl, wl->cmd_box_addr, params, sizeof(*params),
 			false);
 
-	if (params->header.status != CMD_STATUS_SUCCESS) {
+	if (le16_to_cpu(params->header.status) != CMD_STATUS_SUCCESS) {
 		wl1271_error("Scan command error: %d",
-			     params->header.status);
+			     le16_to_cpu(params->header.status));
 		wl->scanning = false;
 		ret = -EIO;
 		goto out;
@@ -675,7 +677,7 @@ int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id,
 
 	cmd->len = cpu_to_le16(buf_len);
 	cmd->template_type = template_id;
-	cmd->enabled_rates = wl->conf.tx.rc_conf.enabled_rates;
+	cmd->enabled_rates = cpu_to_le32(wl->conf.tx.rc_conf.enabled_rates);
 	cmd->short_retry_limit = wl->conf.tx.rc_conf.short_retry_limit;
 	cmd->long_retry_limit = wl->conf.tx.rc_conf.long_retry_limit;
 
@@ -858,7 +860,7 @@ int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id)
 	}
 
 	cmd->id = id;
-	cmd->key_action = KEY_SET_ID;
+	cmd->key_action = cpu_to_le16(KEY_SET_ID);
 	cmd->key_type = KEY_WEP;
 
 	ret = wl1271_cmd_send(wl, CMD_SET_KEYS, cmd, sizeof(*cmd));
@@ -889,12 +891,12 @@ int wl1271_cmd_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
 	if (key_type != KEY_WEP)
 		memcpy(cmd->addr, addr, ETH_ALEN);
 
-	cmd->key_action = action;
+	cmd->key_action = cpu_to_le16(action);
 	cmd->key_size = key_size;
 	cmd->key_type = key_type;
 
-	cmd->ac_seq_num16[0] = tx_seq_16;
-	cmd->ac_seq_num32[0] = tx_seq_32;
+	cmd->ac_seq_num16[0] = cpu_to_le16(tx_seq_16);
+	cmd->ac_seq_num32[0] = cpu_to_le32(tx_seq_32);
 
 	/* we have only one SSID profile */
 	cmd->ssid_profile = 0;
@@ -943,8 +945,8 @@ int wl1271_cmd_disconnect(struct wl1271 *wl)
 		goto out;
 	}
 
-	cmd->rx_config_options = wl->rx_config;
-	cmd->rx_filter_options = wl->rx_filter;
+	cmd->rx_config_options = cpu_to_le32(wl->rx_config);
+	cmd->rx_filter_options = cpu_to_le32(wl->rx_filter);
 	/* disconnect reason is not used in immediate disconnections */
 	cmd->type = DISCONNECT_IMMEDIATE;
 
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.h b/drivers/net/wireless/wl12xx/wl1271_cmd.h
index 15254fa..57d6905 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.h
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.h
@@ -120,8 +120,8 @@ enum cmd_templ {
 #define WL1271_CMD_TEMPL_MAX_SIZE  252
 
 struct wl1271_cmd_header {
-	u16 id;
-	u16 status;
+	__le16 id;
+	__le16 status;
 	/* payload */
 	u8 data[0];
 } __attribute__ ((packed));
@@ -174,11 +174,11 @@ struct cmd_read_write_memory {
 	struct wl1271_cmd_header header;
 
 	/* The address of the memory to read from or write to.*/
-	u32 addr;
+	__le32 addr;
 
 	/* The amount of data in bytes to read from or write to the WiLink
 	 * device.*/
-	u32 size;
+	__le32 size;
 
 	/* The actual value read from or written to the Wilink. The source
 	   of this field is the Host in WRITE command or the Wilink in READ
@@ -203,18 +203,18 @@ enum {
 struct wl1271_cmd_join {
 	struct wl1271_cmd_header header;
 
-	u32 bssid_lsb;
-	u16 bssid_msb;
-	u16 beacon_interval; /* in TBTTs */
-	u32 rx_config_options;
-	u32 rx_filter_options;
+	__le32 bssid_lsb;
+	__le16 bssid_msb;
+	__le16 beacon_interval; /* in TBTTs */
+	__le32 rx_config_options;
+	__le32 rx_filter_options;
 
 	/*
 	 * The target uses this field to determine the rate at
 	 * which to transmit control frame responses (such as
 	 * ACK or CTS frames).
 	 */
-	u32 basic_rate_set;
+	__le32 basic_rate_set;
 	u8 dtim_interval;
 	/*
 	 * bits 0-2: This bitwise field specifies the type
@@ -243,10 +243,10 @@ struct cmd_enabledisable_path {
 struct wl1271_cmd_template_set {
 	struct wl1271_cmd_header header;
 
-	u16 len;
+	__le16 len;
 	u8 template_type;
 	u8 index;  /* relevant only for KLV_TEMPLATE type */
-	u32 enabled_rates;
+	__le32 enabled_rates;
 	u8 short_retry_limit;
 	u8 long_retry_limit;
 	u8 aflags;
@@ -283,7 +283,7 @@ struct wl1271_cmd_ps_params {
 	  * to power save mode.
 	  */
 	u8 hang_over_period;
-	u32 null_data_rate;
+	__le32 null_data_rate;
 } __attribute__ ((packed));
 
 /* HW encryption keys */
@@ -314,9 +314,9 @@ struct wl1271_cmd_set_keys {
 	u8 addr[ETH_ALEN];
 
 	/* key_action_e */
-	u16 key_action;
+	__le16 key_action;
 
-	u16 reserved_1;
+	__le16 reserved_1;
 
 	/* key size in bytes */
 	u8 key_size;
@@ -332,8 +332,8 @@ struct wl1271_cmd_set_keys {
 	u8 id;
 	u8 reserved_2[6];
 	u8 key[MAX_KEY_SIZE];
-	u16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY];
-	u32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY];
+	__le16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY];
+	__le32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY];
 } __attribute__ ((packed));
 
 
@@ -350,17 +350,17 @@ struct wl1271_cmd_set_keys {
 #define WL1271_SCAN_BAND_DUAL 2
 
 struct basic_scan_params {
-	u32 rx_config_options;
-	u32 rx_filter_options;
+	__le32 rx_config_options;
+	__le32 rx_filter_options;
 	/* Scan option flags (WL1271_SCAN_OPT_*) */
-	u16 scan_options;
+	__le16 scan_options;
 	/* Number of scan channels in the list (maximum 30) */
 	u8 num_channels;
 	/* This field indicates the number of probe requests to send
 	   per channel for an active scan */
 	u8 num_probe_requests;
 	/* Rate bit field for sending the probes */
-	u32 tx_rate;
+	__le32 tx_rate;
 	u8 tid_trigger;
 	u8 ssid_len;
 	/* in order to align */
@@ -375,10 +375,10 @@ struct basic_scan_params {
 
 struct basic_scan_channel_params {
 	/* Duration in TU to wait for frames on a channel for active scan */
-	u32 min_duration;
-	u32 max_duration;
-	u32 bssid_lsb;
-	u16 bssid_msb;
+	__le32 min_duration;
+	__le32 max_duration;
+	__le32 bssid_lsb;
+	__le16 bssid_msb;
 	u8 early_termination;
 	u8 tx_power_att;
 	u8 channel;
@@ -398,7 +398,7 @@ struct wl1271_cmd_scan {
 struct wl1271_cmd_trigger_scan_to {
 	struct wl1271_cmd_header header;
 
-	u32 timeout;
+	__le32 timeout;
 };
 
 struct wl1271_cmd_test_header {
@@ -426,7 +426,7 @@ struct wl1271_cmd_cal_channel_tune {
 	u8 band;
 	u8 channel;
 
-	u16 radio_status;
+	__le16 radio_status;
 } __attribute__ ((packed));
 
 struct wl1271_cmd_cal_update_ref_point {
@@ -434,8 +434,8 @@ struct wl1271_cmd_cal_update_ref_point {
 
 	struct wl1271_cmd_test_header test;
 
-	s32 ref_power;
-	s32 ref_detector;
+	__le32 ref_power;
+	__le32 ref_detector;
 	u8  sub_band;
 	u8  padding[3];
 } __attribute__ ((packed));
@@ -450,12 +450,12 @@ struct wl1271_cmd_cal_p2g {
 
 	struct wl1271_cmd_test_header test;
 
-	u16 len;
+	__le16 len;
 	u8  buf[MAX_TLV_LENGTH];
 	u8  type;
 	u8  padding;
 
-	s16 radio_status;
+	__le16 radio_status;
 	u8  nvs_version[MAX_NVS_VERSION_LENGTH];
 
 	u8  sub_band_mask;
@@ -479,10 +479,10 @@ enum wl1271_disconnect_type {
 };
 
 struct wl1271_cmd_disconnect {
-	u32 rx_config_options;
-	u32 rx_filter_options;
+	__le32 rx_config_options;
+	__le32 rx_filter_options;
 
-	u16 reason;
+	__le16 reason;
 	u8  type;
 
 	u8  padding;
diff --git a/drivers/net/wireless/wl12xx/wl1271_event.c b/drivers/net/wireless/wl12xx/wl1271_event.c
index a4b11e4..31d396b 100644
--- a/drivers/net/wireless/wl12xx/wl1271_event.c
+++ b/drivers/net/wireless/wl12xx/wl1271_event.c
@@ -82,7 +82,8 @@ static int wl1271_event_process(struct wl1271 *wl, struct event_mailbox *mbox)
 
 	wl1271_event_mbox_dump(mbox);
 
-	vector = mbox->events_vector & ~(mbox->events_mask);
+	vector = le32_to_cpu(mbox->events_vector);
+	vector &= ~(le32_to_cpu(mbox->events_mask));
 	wl1271_debug(DEBUG_EVENT, "vector: 0x%x", vector);
 
 	if (vector & SCAN_COMPLETE_EVENT_ID) {
diff --git a/drivers/net/wireless/wl12xx/wl1271_event.h b/drivers/net/wireless/wl12xx/wl1271_event.h
index adc4653..3ab53d3 100644
--- a/drivers/net/wireless/wl12xx/wl1271_event.h
+++ b/drivers/net/wireless/wl12xx/wl1271_event.h
@@ -66,33 +66,33 @@ enum {
 struct event_debug_report {
 	u8 debug_event_id;
 	u8 num_params;
-	u16 pad;
-	u32 report_1;
-	u32 report_2;
-	u32 report_3;
+	__le16 pad;
+	__le32 report_1;
+	__le32 report_2;
+	__le32 report_3;
 } __attribute__ ((packed));
 
 #define NUM_OF_RSSI_SNR_TRIGGERS 8
 
 struct event_mailbox {
-	u32 events_vector;
-	u32 events_mask;
-	u32 reserved_1;
-	u32 reserved_2;
+	__le32 events_vector;
+	__le32 events_mask;
+	__le32 reserved_1;
+	__le32 reserved_2;
 
 	u8 dbg_event_id;
 	u8 num_relevant_params;
-	u16 reserved_3;
-	u32 event_report_p1;
-	u32 event_report_p2;
-	u32 event_report_p3;
+	__le16 reserved_3;
+	__le32 event_report_p1;
+	__le32 event_report_p2;
+	__le32 event_report_p3;
 
 	u8 number_of_scan_results;
 	u8 scan_tag;
 	u8 reserved_4[2];
-	u32 compl_scheduled_scan_status;
+	__le32 compl_scheduled_scan_status;
 
-	u16 scheduled_scan_attended_channels;
+	__le16 scheduled_scan_attended_channels;
 	u8 soft_gemini_sense_info;
 	u8 soft_gemini_protective_info;
 	s8 rssi_snr_trigger_metric[NUM_OF_RSSI_SNR_TRIGGERS];
diff --git a/drivers/net/wireless/wl12xx/wl1271_init.h b/drivers/net/wireless/wl12xx/wl1271_init.h
index 513d0cb..6e21cee 100644
--- a/drivers/net/wireless/wl12xx/wl1271_init.h
+++ b/drivers/net/wireless/wl12xx/wl1271_init.h
@@ -65,7 +65,7 @@ struct wl1271_radio_parms {
 
 	/* Dynamic radio parameters */
 	/* 2.4GHz */
-	s16 tx_ref_pd_voltage;
+	__le16 tx_ref_pd_voltage;
 	s8  tx_ref_power;
 	s8  tx_offset_db;
 
@@ -82,7 +82,7 @@ struct wl1271_radio_parms {
 	u8 padding2;
 
 	/* 5GHz */
-	s16 tx_ref_pd_voltage_5[CONF_NUMBER_OF_SUB_BANDS_5];
+	__le16 tx_ref_pd_voltage_5[CONF_NUMBER_OF_SUB_BANDS_5];
 	s8  tx_ref_power_5[CONF_NUMBER_OF_SUB_BANDS_5];
 	s8  tx_offset_db_5[CONF_NUMBER_OF_SUB_BANDS_5];
 
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index ee7ffaf..86132bb 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -397,8 +397,11 @@ static void wl1271_fw_status(struct wl1271 *wl,
 
 	/* update number of available TX blocks */
 	for (i = 0; i < NUM_TX_QUEUES; i++) {
-		u32 cnt = status->tx_released_blks[i] - wl->tx_blocks_freed[i];
-		wl->tx_blocks_freed[i] = status->tx_released_blks[i];
+		u32 cnt = le32_to_cpu(status->tx_released_blks[i]) -
+			wl->tx_blocks_freed[i];
+
+		wl->tx_blocks_freed[i] =
+			le32_to_cpu(status->tx_released_blks[i]);
 		wl->tx_blocks_available += cnt;
 		total += cnt;
 	}
@@ -408,7 +411,8 @@ static void wl1271_fw_status(struct wl1271 *wl,
 		ieee80211_queue_work(wl->hw, &wl->tx_work);
 
 	/* update the host-chipset time offset */
-	wl->time_offset = jiffies_to_usecs(jiffies) - status->fw_localtime;
+	wl->time_offset = jiffies_to_usecs(jiffies) -
+		le32_to_cpu(status->fw_localtime);
 }
 
 static void wl1271_irq_work(struct work_struct *work)
@@ -432,7 +436,7 @@ static void wl1271_irq_work(struct work_struct *work)
 	wl1271_spi_write32(wl, ACX_REG_INTERRUPT_MASK, WL1271_ACX_INTR_ALL);
 
 	wl1271_fw_status(wl, wl->fw_status);
-	intr = wl->fw_status->intr;
+	intr = le32_to_cpu(wl->fw_status->intr);
 	if (!intr) {
 		wl1271_debug(DEBUG_IRQ, "Zero interrupt received.");
 		goto out_sleep;
diff --git a/drivers/net/wireless/wl12xx/wl1271_rx.c b/drivers/net/wireless/wl12xx/wl1271_rx.c
index 1ea3f41..dbf07be 100644
--- a/drivers/net/wireless/wl12xx/wl1271_rx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_rx.c
@@ -30,14 +30,15 @@
 static u8 wl1271_rx_get_mem_block(struct wl1271_fw_status *status,
 				  u32 drv_rx_counter)
 {
-	return status->rx_pkt_descs[drv_rx_counter] & RX_MEM_BLOCK_MASK;
+	return le32_to_cpu(status->rx_pkt_descs[drv_rx_counter]) &
+		RX_MEM_BLOCK_MASK;
 }
 
 static u32 wl1271_rx_get_buf_size(struct wl1271_fw_status *status,
 				 u32 drv_rx_counter)
 {
-	return (status->rx_pkt_descs[drv_rx_counter] & RX_BUF_SIZE_MASK) >>
-		RX_BUF_SIZE_SHIFT_DIV;
+	return (le32_to_cpu(status->rx_pkt_descs[drv_rx_counter]) &
+		RX_BUF_SIZE_MASK) >> RX_BUF_SIZE_SHIFT_DIV;
 }
 
 /* The values of this table must match the wl1271_rates[] array */
@@ -203,8 +204,8 @@ void wl1271_rx(struct wl1271 *wl, struct wl1271_fw_status *status)
 			break;
 		}
 
-		wl->rx_mem_pool_addr.addr =
-			(mem_block << 8) + wl_mem_map->packet_memory_pool_start;
+		wl->rx_mem_pool_addr.addr = (mem_block << 8) +
+			le32_to_cpu(wl_mem_map->packet_memory_pool_start);
 		wl->rx_mem_pool_addr.addr_extra =
 			wl->rx_mem_pool_addr.addr + 4;
 
diff --git a/drivers/net/wireless/wl12xx/wl1271_rx.h b/drivers/net/wireless/wl12xx/wl1271_rx.h
index d1ca60e..1ae6d17 100644
--- a/drivers/net/wireless/wl12xx/wl1271_rx.h
+++ b/drivers/net/wireless/wl12xx/wl1271_rx.h
@@ -102,14 +102,14 @@
 #define RX_BUF_SIZE_SHIFT_DIV 6
 
 struct wl1271_rx_descriptor {
-	u16 length;
+	__le16 length;
 	u8  status;
 	u8  flags;
 	u8  rate;
 	u8  channel;
 	s8  rssi;
 	u8  snr;
-	u32 timestamp;
+	__le32 timestamp;
 	u8  packet_class;
 	u8  process_id;
 	u8  pad_len;
diff --git a/drivers/net/wireless/wl12xx/wl1271_tx.c b/drivers/net/wireless/wl12xx/wl1271_tx.c
index 4560458..00af065 100644
--- a/drivers/net/wireless/wl12xx/wl1271_tx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_tx.c
@@ -88,6 +88,7 @@ static int wl1271_tx_fill_hdr(struct wl1271 *wl, struct sk_buff *skb,
 {
 	struct wl1271_tx_hw_descr *desc;
 	int pad;
+	u16 tx_attr;
 
 	desc = (struct wl1271_tx_hw_descr *) skb->data;
 
@@ -95,16 +96,17 @@ static int wl1271_tx_fill_hdr(struct wl1271 *wl, struct sk_buff *skb,
 	if (extra) {
 		void *framestart = skb->data + sizeof(*desc);
 		u16 fc = *(u16 *)(framestart + extra);
-		int hdrlen = ieee80211_hdrlen(fc);
+		int hdrlen = ieee80211_hdrlen(cpu_to_le16(fc));
 		memmove(framestart, framestart + extra, hdrlen);
 	}
 
 	/* configure packet life time */
-	desc->start_time = jiffies_to_usecs(jiffies) - wl->time_offset;
-	desc->life_time = TX_HW_MGMT_PKT_LIFETIME_TU;
+	desc->start_time = cpu_to_le32(jiffies_to_usecs(jiffies) -
+				       wl->time_offset);
+	desc->life_time = cpu_to_le16(TX_HW_MGMT_PKT_LIFETIME_TU);
 
 	/* configure the tx attributes */
-	desc->tx_attr = wl->session_counter << TX_HW_ATTR_OFST_SESSION_COUNTER;
+	tx_attr = wl->session_counter << TX_HW_ATTR_OFST_SESSION_COUNTER;
 	/* FIXME: do we know the packet priority? can we identify mgmt
 	   packets, and use max prio for them at least? */
 	desc->tid = 0;
@@ -113,11 +115,13 @@ static int wl1271_tx_fill_hdr(struct wl1271 *wl, struct sk_buff *skb,
 
 	/* align the length (and store in terms of words) */
 	pad = WL1271_TX_ALIGN(skb->len);
-	desc->length = pad >> 2;
+	desc->length = cpu_to_le16(pad >> 2);
 
 	/* calculate number of padding bytes */
 	pad = pad - skb->len;
-	desc->tx_attr |= pad << TX_HW_ATTR_OFST_LAST_WORD_PAD;
+	tx_attr |= pad << TX_HW_ATTR_OFST_LAST_WORD_PAD;
+
+	desc->tx_attr = cpu_to_le16(tx_attr);
 
 	wl1271_debug(DEBUG_TX, "tx_fill_hdr: pad: %d", pad);
 	return 0;
@@ -331,7 +335,7 @@ void wl1271_tx_complete(struct wl1271 *wl, u32 count)
 	wl1271_debug(DEBUG_TX, "tx_complete received, packets: %d", count);
 
 	/* read the tx results from the chipset */
-	wl1271_spi_read(wl, memmap->tx_result,
+	wl1271_spi_read(wl, le32_to_cpu(memmap->tx_result),
 			wl->tx_res_if, sizeof(*wl->tx_res_if), false);
 
 	/* verify that the result buffer is not getting overrun */
@@ -353,10 +357,10 @@ void wl1271_tx_complete(struct wl1271 *wl, u32 count)
 	}
 
 	/* write host counter to chipset (to ack) */
-	wl1271_spi_write32(wl, memmap->tx_result +
+	wl1271_spi_write32(wl, le32_to_cpu(memmap->tx_result) +
 			   offsetof(struct wl1271_tx_hw_res_if,
 				    tx_result_host_counter),
-			   wl->tx_res_if->tx_result_fw_counter);
+			   le32_to_cpu(wl->tx_res_if->tx_result_fw_counter));
 }
 
 /* caller must hold wl->mutex */
diff --git a/drivers/net/wireless/wl12xx/wl1271_tx.h b/drivers/net/wireless/wl12xx/wl1271_tx.h
index 4a61406..416396c 100644
--- a/drivers/net/wireless/wl12xx/wl1271_tx.h
+++ b/drivers/net/wireless/wl12xx/wl1271_tx.h
@@ -58,7 +58,7 @@
 
 struct wl1271_tx_hw_descr {
 	/* Length of packet in words, including descriptor+header+data */
-	u16 length;
+	__le16 length;
 	/* Number of extra memory blocks to allocate for this packet in
 	   addition to the number of blocks derived from the packet length */
 	u8 extra_mem_blocks;
@@ -67,12 +67,12 @@ struct wl1271_tx_hw_descr {
 	   HW!! */
 	u8 total_mem_blocks;
 	/* Device time (in us) when the packet arrived to the driver */
-	u32 start_time;
+	__le32 start_time;
 	/* Max delay in TUs until transmission. The last device time the
 	   packet can be transmitted is: startTime+(1024*LifeTime) */
-	u16 life_time;
+	__le16 life_time;
 	/* Bitwise fields - see TX_ATTR... definitions above. */
-	u16 tx_attr;
+	__le16 tx_attr;
 	/* Packet identifier used also in the Tx-Result. */
 	u8 id;
 	/* The packet TID value (as User-Priority) */
@@ -100,12 +100,12 @@ struct wl1271_tx_hw_res_descr {
 	   several possible reasons for failure. */
 	u8 status;
 	/* Total air access duration including all retrys and overheads.*/
-	u16 medium_usage;
+	__le16 medium_usage;
 	/* The time passed from host xfer to Tx-complete.*/
-	u32 fw_handling_time;
+	__le32 fw_handling_time;
 	/* Total media delay
 	   (from 1st EDCA AIFS counter until TX Complete). */
-	u32 medium_delay;
+	__le32 medium_delay;
 	/* LS-byte of last TKIP seq-num (saved per AC for recovery). */
 	u8 lsb_security_sequence_number;
 	/* Retry count - number of transmissions without successful ACK.*/
@@ -118,8 +118,8 @@ struct wl1271_tx_hw_res_descr {
 } __attribute__ ((packed));
 
 struct wl1271_tx_hw_res_if {
-	u32 tx_result_fw_counter;
-	u32 tx_result_host_counter;
+	__le32 tx_result_fw_counter;
+	__le32 tx_result_host_counter;
 	struct wl1271_tx_hw_res_descr tx_results_queue[TX_HW_RESULT_QUEUE_LEN];
 } __attribute__ ((packed));
 
diff --git a/drivers/net/wireless/wl12xx/wl12xx_80211.h b/drivers/net/wireless/wl12xx/wl12xx_80211.h
index 657c2db..055d7bc 100644
--- a/drivers/net/wireless/wl12xx/wl12xx_80211.h
+++ b/drivers/net/wireless/wl12xx/wl12xx_80211.h
@@ -122,8 +122,8 @@ struct wl12xx_null_data_template {
 } __attribute__ ((packed));
 
 struct wl12xx_ps_poll_template {
-	u16 fc;
-	u16 aid;
+	__le16 fc;
+	__le16 aid;
 	u8 bssid[ETH_ALEN];
 	u8 ta[ETH_ALEN];
 } __attribute__ ((packed));
-- 
1.5.6.5


^ permalink raw reply related

* [PATCH 1/5] wl1271: Set IEEE80211_FCTL_TODS in the null data template
From: Luciano Coelho @ 2009-10-15  7:33 UTC (permalink / raw)
  To: linville
  Cc: linux-wireless, Juuso Oikarinen, Vidhya Govindan,
	Janne Ylälehto
In-Reply-To: <1255592010-10287-1-git-send-email-luciano.coelho@nokia.com>

From: Juuso Oikarinen <juuso.oikarinen@nokia.com>

Set the IEEE80211_FCTL_TODS bit in the FC of the null data template.
This is a mandatory requirement in specification.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Cc: Vidhya Govindan <vidhya.govindan@nokia.com>
Cc: Janne Ylälehto <janne.ylalehto@nokia.com>
Reviewed-by: Janne Ylalehto <janne.ylalehto@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
---
 drivers/net/wireless/wl12xx/wl1271_cmd.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.c b/drivers/net/wireless/wl12xx/wl1271_cmd.c
index fe4f1e6..1d64aa4 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.c
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.c
@@ -769,7 +769,8 @@ int wl1271_cmd_build_null_data(struct wl1271 *wl)
 
 	memcpy(template.header.sa, wl->mac_addr, ETH_ALEN);
 	template.header.frame_ctl = cpu_to_le16(IEEE80211_FTYPE_DATA |
-						IEEE80211_STYPE_NULLFUNC);
+						IEEE80211_STYPE_NULLFUNC |
+						IEEE80211_FCTL_TODS);
 
 	return wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, &template,
 				       sizeof(template));
-- 
1.5.6.5


^ permalink raw reply related

* [PATCH 2/5] wl1271: fix sparse warnings about undeclared functions
From: Luciano Coelho @ 2009-10-15  7:33 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless
In-Reply-To: <1255592010-10287-1-git-send-email-luciano.coelho@nokia.com>

The following sparse warnings were fixed:

drivers/net/wireless/wl12xx/wl1271_spi.c:199:6: warning: symbol 'wl1271_spi_read_busy' was not declared. Should it be static?
drivers/net/wireless/wl12xx/wl1271_cmd.c:84:5: warning: symbol 'wl1271_cmd_cal_channel_tune' was not declared. Should it be static?
drivers/net/wireless/wl12xx/wl1271_cmd.c:107:5: warning: symbol 'wl1271_cmd_cal_update_ref_point' was not declared. Should it be static?
drivers/net/wireless/wl12xx/wl1271_cmd.c:132:5: warning: symbol 'wl1271_cmd_cal_p2g' was not declared. Should it be static?
drivers/net/wireless/wl12xx/wl1271_cmd.c:153:5: warning: symbol 'wl1271_cmd_cal' was not declared. Should it be static?

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
---
 drivers/net/wireless/wl12xx/wl1271_cmd.c |    8 ++++----
 drivers/net/wireless/wl12xx/wl1271_spi.c |    5 ++++-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.c b/drivers/net/wireless/wl12xx/wl1271_cmd.c
index 1d64aa4..195eee7 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.c
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.c
@@ -81,7 +81,7 @@ out:
 	return ret;
 }
 
-int wl1271_cmd_cal_channel_tune(struct wl1271 *wl)
+static int wl1271_cmd_cal_channel_tune(struct wl1271 *wl)
 {
 	struct wl1271_cmd_cal_channel_tune *cmd;
 	int ret = 0;
@@ -104,7 +104,7 @@ int wl1271_cmd_cal_channel_tune(struct wl1271 *wl)
 	return ret;
 }
 
-int wl1271_cmd_cal_update_ref_point(struct wl1271 *wl)
+static int wl1271_cmd_cal_update_ref_point(struct wl1271 *wl)
 {
 	struct wl1271_cmd_cal_update_ref_point *cmd;
 	int ret = 0;
@@ -129,7 +129,7 @@ int wl1271_cmd_cal_update_ref_point(struct wl1271 *wl)
 	return ret;
 }
 
-int wl1271_cmd_cal_p2g(struct wl1271 *wl)
+static int wl1271_cmd_cal_p2g(struct wl1271 *wl)
 {
 	struct wl1271_cmd_cal_p2g *cmd;
 	int ret = 0;
@@ -150,7 +150,7 @@ int wl1271_cmd_cal_p2g(struct wl1271 *wl)
 	return ret;
 }
 
-int wl1271_cmd_cal(struct wl1271 *wl)
+static int wl1271_cmd_cal(struct wl1271 *wl)
 {
 	/*
 	 * FIXME: we must make sure that we're not sleeping when calibration
diff --git a/drivers/net/wireless/wl12xx/wl1271_spi.c b/drivers/net/wireless/wl12xx/wl1271_spi.c
index 3c5aa58..02978a1 100644
--- a/drivers/net/wireless/wl12xx/wl1271_spi.c
+++ b/drivers/net/wireless/wl12xx/wl1271_spi.c
@@ -196,7 +196,9 @@ int wl1271_set_partition(struct wl1271 *wl,
 
 #define WL1271_BUSY_WORD_TIMEOUT 1000
 
-void wl1271_spi_read_busy(struct wl1271 *wl, void *buf, size_t len)
+/* FIXME: Check busy words, removed due to SPI bug */
+#if 0
+static void wl1271_spi_read_busy(struct wl1271 *wl, void *buf, size_t len)
 {
 	struct spi_transfer t[1];
 	struct spi_message m;
@@ -256,6 +258,7 @@ void wl1271_spi_read_busy(struct wl1271 *wl, void *buf, size_t len)
 	memset(buf, 0, len);
 	wl1271_error("SPI read busy-word timeout!\n");
 }
+#endif
 
 void wl1271_spi_raw_read(struct wl1271 *wl, int addr, void *buf,
 			 size_t len, bool fixed)
-- 
1.5.6.5


^ permalink raw reply related

* [PATCH 5/5] wl1271: added missing packed modifier in some cmd structs
From: Luciano Coelho @ 2009-10-15  7:33 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless
In-Reply-To: <1255592010-10287-1-git-send-email-luciano.coelho@nokia.com>

Some of the struct definitions in the wl1271_acx.h file were missing the
__attribute__ ((packed)) modifier.

Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
---
 drivers/net/wireless/wl12xx/wl1271_cmd.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.h b/drivers/net/wireless/wl12xx/wl1271_cmd.h
index 57d6905..174b820 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.h
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.h
@@ -184,7 +184,7 @@ struct cmd_read_write_memory {
 	   of this field is the Host in WRITE command or the Wilink in READ
 	   command. */
 	u8 value[MAX_READ_SIZE];
-};
+} __attribute__ ((packed));
 
 #define CMDMBOX_HEADER_LEN 4
 #define CMDMBOX_INFO_ELEM_HEADER_LEN 4
@@ -399,12 +399,12 @@ struct wl1271_cmd_trigger_scan_to {
 	struct wl1271_cmd_header header;
 
 	__le32 timeout;
-};
+} __attribute__ ((packed));
 
 struct wl1271_cmd_test_header {
 	u8 id;
 	u8 padding[3];
-};
+} __attribute__ ((packed));
 
 enum wl1271_channel_tune_bands {
 	WL1271_CHANNEL_TUNE_BAND_2_4,
-- 
1.5.6.5


^ permalink raw reply related

* [PATCH 3/5] wl1271: added missing packed modifier in some acx structs
From: Luciano Coelho @ 2009-10-15  7:33 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless
In-Reply-To: <1255592010-10287-1-git-send-email-luciano.coelho@nokia.com>

Some of the struct definitions in the wl1271_acx.h file were missing the
__attribute__ ((packed)) modifier.

Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
---
 drivers/net/wireless/wl12xx/wl1271_acx.h |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.h b/drivers/net/wireless/wl12xx/wl1271_acx.h
index 1580314..5085497 100644
--- a/drivers/net/wireless/wl12xx/wl1271_acx.h
+++ b/drivers/net/wireless/wl12xx/wl1271_acx.h
@@ -75,7 +75,7 @@ struct acx_header {
 
 	/* payload length (not including headers */
 	u16 len;
-};
+} __attribute__ ((packed));
 
 struct acx_error_counter {
 	struct acx_header header;
@@ -390,7 +390,7 @@ struct acx_conn_monit_params {
 
        u32 synch_fail_thold; /* number of beacons missed */
        u32 bss_lose_timeout; /* number of TU's from synch fail */
-};
+} __attribute__ ((packed));
 
 enum {
 	SG_ENABLE = 0,
@@ -420,19 +420,19 @@ struct acx_smart_reflex_state {
 
 	u8 enable;
 	u8 padding[3];
-};
+} __attribute__ ((packed));
 
 struct smart_reflex_err_table {
 	u8 len;
 	s8 upper_limit;
 	s8 values[14];
-};
+} __attribute__ ((packed));
 
 struct acx_smart_reflex_config_params {
 	struct acx_header header;
 
 	struct smart_reflex_err_table error_table[3];
-};
+} __attribute__ ((packed));
 
 #define PTA_ANTENNA_TYPE_DEF		  (0)
 #define PTA_BT_HP_MAXTIME_DEF		  (2000)
-- 
1.5.6.5


^ permalink raw reply related

* [PATCH 0/5] wl1271: Endianess and power save mode fixes
From: Luciano Coelho @ 2009-10-15  7:33 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless

Hi,

Here are a few more patches for the wl1271 driver.  First, we have fixed a
problem with the null data packets which was causing problems with power save
mode on some APs.  We were not setting the FCTL_TODS bit as the specification
requires.

Second, we have fixed some sparse warnings and fixed the endianess handling in
the driver (it used to be written for little-endian archs only).

Cheers,
Luca.

Juuso Oikarinen (1):
  wl1271: Set IEEE80211_FCTL_TODS in the null data template

Luciano Coelho (4):
  wl1271: fix sparse warnings about undeclared functions
  wl1271: added missing packed modifier in some acx structs
  wl1271: fix endianess issues
  wl1271: added missing packed modifier in some cmd structs

 drivers/net/wireless/wl12xx/wl1271.h       |   10 +-
 drivers/net/wireless/wl12xx/wl1271_acx.c   |   72 ++++----
 drivers/net/wireless/wl12xx/wl1271_acx.h   |  296 ++++++++++++++--------------
 drivers/net/wireless/wl12xx/wl1271_boot.c  |    6 +-
 drivers/net/wireless/wl12xx/wl1271_cmd.c   |   85 ++++----
 drivers/net/wireless/wl12xx/wl1271_cmd.h   |   74 ++++----
 drivers/net/wireless/wl12xx/wl1271_event.c |    3 +-
 drivers/net/wireless/wl12xx/wl1271_event.h |   28 ++--
 drivers/net/wireless/wl12xx/wl1271_init.h  |    4 +-
 drivers/net/wireless/wl12xx/wl1271_main.c  |   12 +-
 drivers/net/wireless/wl12xx/wl1271_rx.c    |   11 +-
 drivers/net/wireless/wl12xx/wl1271_rx.h    |    4 +-
 drivers/net/wireless/wl12xx/wl1271_spi.c   |    5 +-
 drivers/net/wireless/wl12xx/wl1271_tx.c    |   22 ++-
 drivers/net/wireless/wl12xx/wl1271_tx.h    |   18 +-
 drivers/net/wireless/wl12xx/wl12xx_80211.h |    4 +-
 16 files changed, 336 insertions(+), 318 deletions(-)


^ permalink raw reply

* Re: [PATCH] ath5k: use noise calibration from madwifi hal
From: Nick Kossifidis @ 2009-10-15  6:57 UTC (permalink / raw)
  To: Bob Copeland; +Cc: linville, linux-wireless, ath5k-devel, jirislaby, lrodriguez
In-Reply-To: <1255544190-30020-1-git-send-email-me@bobcopeland.com>

2009/10/14 Bob Copeland <me@bobcopeland.com>:
> This updates ath5k to calibrate the noise floor similar to the
> way it is done in the madwifi hal and ath9k.  Of note:
>
> - we start NF measurement at the same time as AGC calibration,
>  but do not actually read the value until the periodic (long)
>  calibration
> - we keep a history of the last few values read and write the
>  median back to the hardware for CCA
> - we do not complain if NF calibration isn't complete, instead
>  we keep the last read value.
>
> Signed-off-by: Bob Copeland <me@bobcopeland.com>
> ---
>  drivers/net/wireless/ath/ath5k/ath5k.h  |   13 ++
>  drivers/net/wireless/ath/ath5k/attach.c |    2 +
>  drivers/net/wireless/ath/ath5k/phy.c    |  185 +++++++++++++++++++++----------
>  drivers/net/wireless/ath/ath5k/reg.h    |   11 +-
>  drivers/net/wireless/ath/ath5k/reset.c  |   17 +---
>  5 files changed, 148 insertions(+), 80 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
> index 6cd5efc..1c90d6b 100644
> --- a/drivers/net/wireless/ath/ath5k/ath5k.h
> +++ b/drivers/net/wireless/ath/ath5k/ath5k.h
> @@ -204,6 +204,7 @@
>  #define AR5K_TUNE_CWMAX_11B                    1023
>  #define AR5K_TUNE_CWMAX_XR                     7
>  #define AR5K_TUNE_NOISE_FLOOR                  -72
> +#define AR5K_TUNE_CCA_MAX_GOOD_VALUE           -95
>  #define AR5K_TUNE_MAX_TXPOWER                  63
>  #define AR5K_TUNE_DEFAULT_TXPOWER              25
>  #define AR5K_TUNE_TPC_TXPOWER                  false
> @@ -1012,6 +1013,14 @@ struct ath5k_capabilities {
>        } cap_queues;
>  };
>
> +/* size of noise floor history (keep it a power of two) */
> +#define ATH5K_NF_CAL_HIST_MAX  8
> +struct ath5k_nfcal_hist
> +{
> +       s16 index;                              /* current index into nfval */
> +       s16 nfval[ATH5K_NF_CAL_HIST_MAX];       /* last few noise floors */
> +};
> +
>
>  /***************************************\
>   HARDWARE ABSTRACTION LAYER STRUCTURE
> @@ -1125,6 +1134,8 @@ struct ath5k_hw {
>                struct ieee80211_channel r_last_channel;
>        } ah_radar;
>
> +       struct ath5k_nfcal_hist ah_nfcal_hist;
> +
>        /* noise floor from last periodic calibration */
>        s32                     ah_noise_floor;
>
> @@ -1288,8 +1299,10 @@ extern int ath5k_hw_rfgain_opt_init(struct ath5k_hw *ah);
>  extern bool ath5k_channel_ok(struct ath5k_hw *ah, u16 freq, unsigned int flags);
>  extern int ath5k_hw_channel(struct ath5k_hw *ah, struct ieee80211_channel *channel);
>  /* PHY calibration */
> +void ath5k_hw_init_nfcal_hist(struct ath5k_hw *ah);
>  extern int ath5k_hw_phy_calibrate(struct ath5k_hw *ah, struct ieee80211_channel *channel);
>  extern int ath5k_hw_noise_floor_calibration(struct ath5k_hw *ah, short freq);
> +extern s16 ath5k_hw_get_noise_floor(struct ath5k_hw *ah);
>  extern void ath5k_hw_calibration_poll(struct ath5k_hw *ah);
>  /* Spur mitigation */
>  bool ath5k_hw_chan_has_spur_noise(struct ath5k_hw *ah,
> diff --git a/drivers/net/wireless/ath/ath5k/attach.c b/drivers/net/wireless/ath/ath5k/attach.c
> index 71a1bd2..1ec85af 100644
> --- a/drivers/net/wireless/ath/ath5k/attach.c
> +++ b/drivers/net/wireless/ath/ath5k/attach.c
> @@ -342,6 +342,8 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc)
>
>        ath5k_hw_rfgain_opt_init(ah);
>
> +       ath5k_hw_init_nfcal_hist(ah);
> +
>        /* turn on HW LEDs */
>        ath5k_hw_set_ledstate(ah, AR5K_LED_INIT);
>
> diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
> index 1a039f2..8959907 100644
> --- a/drivers/net/wireless/ath/ath5k/phy.c
> +++ b/drivers/net/wireless/ath/ath5k/phy.c
> @@ -1124,77 +1124,148 @@ ath5k_hw_calibration_poll(struct ath5k_hw *ah)
>                ah->ah_swi_mask = AR5K_SWI_FULL_CALIBRATION;
>                AR5K_REG_ENABLE_BITS(ah, AR5K_CR, AR5K_CR_SWI);
>        }
> +}
>
> +static int sign_extend(int val, const int nbits)
> +{
> +       int order = BIT(nbits-1);
> +       return (val ^ order) - order;
>  }
>
> -/**
> - * ath5k_hw_noise_floor_calibration - perform PHY noise floor calibration
> - *
> - * @ah: struct ath5k_hw pointer we are operating on
> - * @freq: the channel frequency, just used for error logging
> - *
> - * This function performs a noise floor calibration of the PHY and waits for
> - * it to complete. Then the noise floor value is compared to some maximum
> - * noise floor we consider valid.
> - *
> - * Note that this is different from what the madwifi HAL does: it reads the
> - * noise floor and afterwards initiates the calibration. Since the noise floor
> - * calibration can take some time to finish, depending on the current channel
> - * use, that avoids the occasional timeout warnings we are seeing now.
> - *
> - * See the following link for an Atheros patent on noise floor calibration:
> - * http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&Sect2=HITOFF&d=PALL \
> - * &p=1&u=%2Fnetahtml%2FPTO%2Fsrchnum.htm&r=1&f=G&l=50&s1=7245893.PN.&OS=PN/7
> +static s32 ath5k_hw_read_measured_noise_floor(struct ath5k_hw *ah)
> +{
> +       s32 val;
> +
> +       val = ath5k_hw_reg_read(ah, AR5K_PHY_NF);
> +       return sign_extend(AR5K_REG_MS(val, AR5K_PHY_NF_MINCCA_PWR), 9);
> +}
> +
> +void ath5k_hw_init_nfcal_hist(struct ath5k_hw *ah)
> +{
> +       int i;
> +
> +       ah->ah_nfcal_hist.index = 0;
> +       for (i = 0; i < ATH5K_NF_CAL_HIST_MAX; i++)
> +               ah->ah_nfcal_hist.nfval[i] = AR5K_TUNE_CCA_MAX_GOOD_VALUE;
> +}
> +
> +static void ath5k_hw_update_nfcal_hist(struct ath5k_hw *ah, s16 noise_floor)
> +{
> +       struct ath5k_nfcal_hist *hist = &ah->ah_nfcal_hist;
> +       hist->index = (hist->index + 1) & (ATH5K_NF_CAL_HIST_MAX-1);
> +       hist->nfval[hist->index] = noise_floor;
> +}
> +
> +static s16 ath5k_hw_get_median_noise_floor(struct ath5k_hw *ah)
> +{
> +       s16 sort[ATH5K_NF_CAL_HIST_MAX];
> +       s16 tmp;
> +       int i, j;
> +
> +       memcpy(sort, ah->ah_nfcal_hist.nfval, sizeof(sort));
> +       for (i = 0; i < ATH5K_NF_CAL_HIST_MAX - 1; i++) {
> +               for (j = 1; j < ATH5K_NF_CAL_HIST_MAX - i; j++) {
> +                       if (sort[j] > sort[j-1]) {
> +                               tmp = sort[j];
> +                               sort[j] = sort[j-1];
> +                               sort[j-1] = tmp;
> +                       }
> +               }
> +       }
> +       for (i = 0; i < ATH5K_NF_CAL_HIST_MAX; i++) {
> +               ATH5K_DBG(ah->ah_sc, ATH5K_DEBUG_CALIBRATE,
> +                       "cal %d:%d\n", i, sort[i]);
> +       }
> +       return sort[(ATH5K_NF_CAL_HIST_MAX-1) / 2];
> +}
> +
> +/*
> + * When we tell the hardware to perform a noise floor calibration
> + * by setting the AR5K_PHY_AGCCTL_NF bit, it will periodically
> + * sample-and-hold the minimum noise level seen at the antennas.
> + * This value is then stored in a ring buffer of recently measured
> + * noise floor values so we have a moving window of the last few
> + * samples.
>  *
> - * XXX: Since during noise floor calibration antennas are detached according to
> - * the patent, we should stop tx queues here.
> + * The median of the values in the history is then loaded into the
> + * hardware for its own use for RSSI and CCA measurements.
>  */
> -int
> -ath5k_hw_noise_floor_calibration(struct ath5k_hw *ah, short freq)
> +void ath5k_hw_update_noise_floor(struct ath5k_hw *ah)
>  {
> -       int ret;
> -       unsigned int i;
> -       s32 noise_floor;
> +       struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
> +       u32 val;
> +       s16 nf, threshold;
> +       u8 ee_mode;
>
> -       /*
> -        * Enable noise floor calibration
> -        */
> -       AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_AGCCTL,
> -                               AR5K_PHY_AGCCTL_NF);
> +       /* keep last value if calibration hasn't completed */
> +       if (ath5k_hw_reg_read(ah, AR5K_PHY_AGCCTL) & AR5K_PHY_AGCCTL_NF) {
> +               ATH5K_DBG(ah->ah_sc, ATH5K_DEBUG_CALIBRATE,
> +                       "NF did not complete in calibration window\n");
>
> -       ret = ath5k_hw_register_timeout(ah, AR5K_PHY_AGCCTL,
> -                       AR5K_PHY_AGCCTL_NF, 0, false);
> -       if (ret) {
> -               ATH5K_ERR(ah->ah_sc,
> -                       "noise floor calibration timeout (%uMHz)\n", freq);
> -               return -EAGAIN;
> +               return;
>        }
>
> -       /* Wait until the noise floor is calibrated and read the value */
> -       for (i = 20; i > 0; i--) {
> -               mdelay(1);
> -               noise_floor = ath5k_hw_reg_read(ah, AR5K_PHY_NF);
> -               noise_floor = AR5K_PHY_NF_RVAL(noise_floor);
> -               if (noise_floor & AR5K_PHY_NF_ACTIVE) {
> -                       noise_floor = AR5K_PHY_NF_AVAL(noise_floor);
> -
> -                       if (noise_floor <= AR5K_TUNE_NOISE_FLOOR)
> -                               break;
> -               }
> +       switch (ah->ah_current_channel->hw_value & CHANNEL_MODES) {
> +       case CHANNEL_A:
> +       case CHANNEL_T:
> +       case CHANNEL_XR:
> +               ee_mode = AR5K_EEPROM_MODE_11A;
> +               break;
> +       case CHANNEL_G:
> +       case CHANNEL_TG:
> +               ee_mode = AR5K_EEPROM_MODE_11G;
> +               break;
> +       default:
> +       case CHANNEL_B:
> +               ee_mode = AR5K_EEPROM_MODE_11B;
> +               break;
>        }
>
> -       ATH5K_DBG_UNLIMIT(ah->ah_sc, ATH5K_DEBUG_CALIBRATE,
> -               "noise floor %d\n", noise_floor);
>
> -       if (noise_floor > AR5K_TUNE_NOISE_FLOOR) {
> -               ATH5K_ERR(ah->ah_sc,
> -                       "noise floor calibration failed (%uMHz)\n", freq);
> -               return -EAGAIN;
> +       /* completed NF calibration, test threshold */
> +       nf = ath5k_hw_read_measured_noise_floor(ah);
> +       threshold = ee->ee_noise_floor_thr[ee_mode];
> +
> +       if (nf > threshold) {
> +               ATH5K_DBG(ah->ah_sc, ATH5K_DEBUG_CALIBRATE,
> +                       "noise floor failure detected; "
> +                       "read %d, threshold %d\n",
> +                       nf, threshold);
> +
> +               nf = AR5K_TUNE_CCA_MAX_GOOD_VALUE;
>        }
>
> -       ah->ah_noise_floor = noise_floor;
> +       ath5k_hw_update_nfcal_hist(ah, nf);
> +       nf = ath5k_hw_get_median_noise_floor(ah);
>
> -       return 0;
> +       /* load noise floor (in .5 dBm) so the hardware will use it */
> +       val = ath5k_hw_reg_read(ah, AR5K_PHY_NF) & ~AR5K_PHY_NF_M;
> +       val |= (nf * 2) & AR5K_PHY_NF_M;
> +       ath5k_hw_reg_write(ah, val, AR5K_PHY_NF);
> +
> +       AR5K_REG_MASKED_BITS(ah, AR5K_PHY_AGCCTL, AR5K_PHY_AGCCTL_NF,
> +               ~(AR5K_PHY_AGCCTL_NF_EN | AR5K_PHY_AGCCTL_NF_NOUPDATE));
> +
> +       ath5k_hw_register_timeout(ah, AR5K_PHY_AGCCTL, AR5K_PHY_AGCCTL_NF,
> +               0, false);
> +
> +       /*
> +        * Load a high max CCA Power value (-50 dBm in .5 dBm units)
> +        * so that we're not capped by the median we just loaded.
> +        * This will be used as the initial value for the next noise
> +        * floor calibration.
> +        */
> +       val = (val & ~AR5K_PHY_NF_M) | ((-50 * 2) & AR5K_PHY_NF_M);
> +       ath5k_hw_reg_write(ah, val, AR5K_PHY_NF);
> +       AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_AGCCTL,
> +               AR5K_PHY_AGCCTL_NF_EN |
> +               AR5K_PHY_AGCCTL_NF_NOUPDATE |
> +               AR5K_PHY_AGCCTL_NF);
> +
> +       ah->ah_noise_floor = nf;
> +
> +       ATH5K_DBG(ah->ah_sc, ATH5K_DEBUG_CALIBRATE,
> +               "noise floor calibrated: %d\n", nf);
>  }
>
>  /*
> @@ -1287,7 +1358,7 @@ static int ath5k_hw_rf5110_calibrate(struct ath5k_hw *ah,
>                return ret;
>        }
>
> -       ath5k_hw_noise_floor_calibration(ah, channel->center_freq);
> +       ath5k_hw_update_noise_floor(ah);
>
>        /*
>         * Re-enable RX/TX and beacons
> @@ -1360,7 +1431,7 @@ done:
>         * since noise floor calibration interrupts rx path while I/Q
>         * calibration doesn't. We don't need to run noise floor calibration
>         * as often as I/Q calibration.*/
> -       ath5k_hw_noise_floor_calibration(ah, channel->center_freq);
> +       ath5k_hw_update_noise_floor(ah);
>
>        /* Initiate a gain_F calibration */
>        ath5k_hw_request_rfgain_probe(ah);
> diff --git a/drivers/net/wireless/ath/ath5k/reg.h b/drivers/net/wireless/ath/ath5k/reg.h
> index debad07..7486da6 100644
> --- a/drivers/net/wireless/ath/ath5k/reg.h
> +++ b/drivers/net/wireless/ath/ath5k/reg.h
> @@ -2039,17 +2039,14 @@
>  #define        AR5K_PHY_AGCCTL_NF_NOUPDATE     0x00020000      /* Don't update nf automaticaly */
>
>  /*
> - * PHY noise floor status register
> + * PHY noise floor status register (CCA = Clear Channel Assessment)
>  */
>  #define AR5K_PHY_NF                    0x9864                  /* Register address */
> -#define AR5K_PHY_NF_M                  0x000001ff      /* Noise floor mask */
> -#define AR5K_PHY_NF_ACTIVE             0x00000100      /* Noise floor calibration still active */
> -#define AR5K_PHY_NF_RVAL(_n)           (((_n) >> 19) & AR5K_PHY_NF_M)
> -#define AR5K_PHY_NF_AVAL(_n)           (-((_n) ^ AR5K_PHY_NF_M) + 1)
> -#define AR5K_PHY_NF_SVAL(_n)           (((_n) & AR5K_PHY_NF_M) | (1 << 9))
> +#define AR5K_PHY_NF_M                  0x000001ff      /* Noise floor, written to hardware in 1/2 dBm units */
> +#define AR5K_PHY_NF_SVAL(_n)           (((_n) & AR5K_PHY_NF_M) | (1 << 9))
>  #define        AR5K_PHY_NF_THRESH62            0x0007f000      /* Thresh62 -check ANI patent- (field) */
>  #define        AR5K_PHY_NF_THRESH62_S          12
> -#define        AR5K_PHY_NF_MINCCA_PWR          0x0ff80000      /* ??? */
> +#define        AR5K_PHY_NF_MINCCA_PWR          0x0ff80000      /* Minimum measured noise level, read from hardware in 1 dBm units */
>  #define        AR5K_PHY_NF_MINCCA_PWR_S        19
>
>  /*
> diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c
> index 34e13c7..aa05cf3 100644
> --- a/drivers/net/wireless/ath/ath5k/reset.c
> +++ b/drivers/net/wireless/ath/ath5k/reset.c
> @@ -1289,7 +1289,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
>         * out and/or noise floor calibration might timeout.
>         */
>        AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_AGCCTL,
> -                               AR5K_PHY_AGCCTL_CAL);
> +                               AR5K_PHY_AGCCTL_CAL | AR5K_PHY_AGCCTL_NF);
>
>        /* At the same time start I/Q calibration for QAM constellation
>         * -no need for CCK- */
> @@ -1310,21 +1310,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
>                        channel->center_freq);
>        }
>
> -       /*
> -        * If we run NF calibration before AGC, it always times out.
> -        * Binary HAL starts NF and AGC calibration at the same time
> -        * and only waits for AGC to finish. Also if AGC or NF cal.
> -        * times out, reset doesn't fail on binary HAL. I believe
> -        * that's wrong because since rx path is routed to a detector,
> -        * if cal. doesn't finish we won't have RX. Sam's HAL for AR5210/5211
> -        * enables noise floor calibration after offset calibration and if noise
> -        * floor calibration fails, reset fails. I believe that's
> -        * a better approach, we just need to find a polling interval
> -        * that suits best, even if reset continues we need to make
> -        * sure that rx path is ready.
> -        */
> -       ath5k_hw_noise_floor_calibration(ah, channel->center_freq);
> -
>        /* Restore antenna mode */
>        ath5k_hw_set_antenna_mode(ah, ah->ah_ant_mode);
>

a) Please leave some comments to let people know that when nf
calibration runs antennas are detached (it measures the noise produced
from the card itself),  that if we enable nf calibration before agc
calibration it always fails + the link to Atheros patent.

b) What about thresh62 ? Do we also need to update/rewrite this value
(we got it from EEPROM and write it on the register during reset) ?

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

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

^ permalink raw reply

* Re: [PATCH] cfg80211: no  cookies in cfg80211_send_ABCD()
From: Holger Schurig @ 2009-10-15  6:54 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, Johannes Berg
In-Reply-To: <20091014200837.GA11962@tuxdriver.com>

> This doesn't appear to be any different (other than the
> subject) than the previous version?

Right, but VGERs simple spam filter prevented the first version 
to go to the mailing-list. He didn't like the triple-X in 
cfg80211_send_XXX() in the subject ...

^ permalink raw reply

* Re: [Ipw2100-devel] 2.6.32-rc4 ipw2200: oops on missing firmware
From: Zhu Yi @ 2009-10-15  6:50 UTC (permalink / raw)
  To: Frans Pop
  Cc: Ferenc Wagner, ipw2100-devel@lists.sourceforge.net,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <200910131855.25878.elendil@planet.nl>

On Wed, 2009-10-14 at 00:55 +0800, Frans Pop wrote:
> Adding relevant CCs. Original message follows.
> 
> ==============
> Hi,
> 
> See the screenshot at http://apt.niif.hu/ipw_oops.png.  During bootup,
> initramfs-tools tried to load the ipw2200 module, but nobody fed it
> the necessary firmware, so request_firmware timed out and the module
> unload cleanup oopsed in device_pm_remove:
> 
> void device_pm_remove(struct device *dev)
> {
>         pr_debug("PM: Removing info for %s:%s\n",
>                  dev->bus ? dev->bus->name : "No Bus",
>                  kobject_name(&dev->kobj));
>         mutex_lock(&dpm_list_mtx);
>         list_del_init(&dev->power.entry);
>         mutex_unlock(&dpm_list_mtx);
>         pm_runtime_remove(dev);
> }
> 
> 00000a0a <device_pm_remove>:
>  a0a:   55                      push   %ebp
>  a0b:   89 e5                   mov    %esp,%ebp
>  a0d:   53                      push   %ebx
>  a0e:   89 c3                   mov    %eax,%ebx
>  a10:   b8 08 00 00 00          mov    $0x8,%eax
>  a15:   e8 fc ff ff ff          call   a16 <device_pm_remove+0xc>
>  a1a:   8d 4b 5c                lea    0x5c(%ebx),%ecx
>  a1d:   8b 53 5c                mov    0x5c(%ebx),%edx
>  a20:   8b 43 60                mov    0x60(%ebx),%eax
>  a23:   89 42 04                mov    %eax,0x4(%edx)
>  a26:   89 10                   mov    %edx,(%eax)
>  a28:   89 4b 5c                mov    %ecx,0x5c(%ebx)
>  a2b:   89 4b 60                mov    %ecx,0x60(%ebx)
>  a2e:   b8 08 00 00 00          mov    $0x8,%eax
>  a33:   e8 fc ff ff ff          call   a34 <device_pm_remove+0x2a>
>  a38:   89 d8                   mov    %ebx,%eax
>  a3a:   e8 fc ff ff ff          call   a3b <device_pm_remove+0x31>
>  a3f:   5b                      pop    %ebx
>  a40:   5d                      pop    %ebp
>  a41:   c3                      ret    
> 
> The offending IP translates to line a23, so the problem is edx being 0
> at that point.  I'm not sure which struct device field has offset
> 0x5c, maybe power, but I'm lost at this point anyway.

OK. The rfkill device is removed without being added before! The root
cause is, for non-monitor interfaces, the syntax for
alloc_ieee80211/free_80211 is wrong. Because alloc_ieee80211 only
creates (wiphy_new) a wiphy, but free_80211() does wiphy_unregister()
also. This is only correct when the later wiphy_register() is called
successfully, which apparently is not the case for your fw doesn't exist
one. Please see if this patch fix the problem.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>

diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 240cff1..a741d37 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -6325,8 +6325,10 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
 
       fail:
 	if (dev) {
-		if (registered)
+		if (registered) {
+			unregister_ieee80211(priv->ieee);
 			unregister_netdev(dev);
+		}
 
 		ipw2100_hw_stop_adapter(priv);
 
@@ -6383,6 +6385,7 @@ static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev)
 		/* Unregister the device first - this results in close()
 		 * being called if the device is open.  If we free storage
 		 * first, then close() will crash. */
+		unregister_ieee80211(priv->ieee);
 		unregister_netdev(dev);
 
 		/* ipw2100_down will ensure that there is no more pending work
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 7f169e1..e2af22b 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -11823,6 +11823,7 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev,
 		if (err) {
 			IPW_ERROR("Failed to register promiscuous network "
 				  "device (error %d).\n", err);
+			unregister_ieee80211(priv->ieee);
 			unregister_netdev(priv->net_dev);
 			goto out_remove_sysfs;
 		}
@@ -11873,6 +11874,7 @@ static void __devexit ipw_pci_remove(struct pci_dev *pdev)
 
 	mutex_unlock(&priv->mutex);
 
+	unregister_ieee80211(priv->ieee);
 	unregister_netdev(priv->net_dev);
 
 	if (priv->rxq) {
diff --git a/drivers/net/wireless/ipw2x00/libipw.h b/drivers/net/wireless/ipw2x00/libipw.h
index bf45391..f42ade6 100644
--- a/drivers/net/wireless/ipw2x00/libipw.h
+++ b/drivers/net/wireless/ipw2x00/libipw.h
@@ -1020,6 +1020,7 @@ static inline int libipw_is_cck_rate(u8 rate)
 /* ieee80211.c */
 extern void free_ieee80211(struct net_device *dev, int monitor);
 extern struct net_device *alloc_ieee80211(int sizeof_priv, int monitor);
+extern void unregister_ieee80211(struct libipw_device *ieee);
 extern int libipw_change_mtu(struct net_device *dev, int new_mtu);
 
 extern void libipw_networks_age(struct libipw_device *ieee,
diff --git a/drivers/net/wireless/ipw2x00/libipw_module.c b/drivers/net/wireless/ipw2x00/libipw_module.c
index a0e9f6a..be5b809 100644
--- a/drivers/net/wireless/ipw2x00/libipw_module.c
+++ b/drivers/net/wireless/ipw2x00/libipw_module.c
@@ -235,16 +235,19 @@ void free_ieee80211(struct net_device *dev, int monitor)
 	libipw_networks_free(ieee);
 
 	/* free cfg80211 resources */
-	if (!monitor) {
-		wiphy_unregister(ieee->wdev.wiphy);
-		kfree(ieee->a_band.channels);
-		kfree(ieee->bg_band.channels);
+	if (!monitor)
 		wiphy_free(ieee->wdev.wiphy);
-	}
 
 	free_netdev(dev);
 }
 
+void unregister_ieee80211(struct libipw_device *ieee)
+{
+	wiphy_unregister(ieee->wdev.wiphy);
+	kfree(ieee->a_band.channels);
+	kfree(ieee->bg_band.channels);
+}
+
 #ifdef CONFIG_LIBIPW_DEBUG
 
 static int debug = 0;
@@ -330,3 +333,4 @@ module_init(libipw_init);
 
 EXPORT_SYMBOL(alloc_ieee80211);
 EXPORT_SYMBOL(free_ieee80211);
+EXPORT_SYMBOL(unregister_ieee80211);



^ permalink raw reply related

* Re: Current status of rt2800usb and staging/rt2870
From: Gertjan van Wingerde @ 2009-10-15  6:28 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: Ivo van Doorn, John W. Linville, Dan Williams,
	Ozan Çağlayan, linux-wireless, linux-kernel
In-Reply-To: <200910142210.25080.bzolnier@gmail.com>

On Wed, Oct 14, 2009 at 10:10 PM, Bartlomiej Zolnierkiewicz
<bzolnier@gmail.com> wrote:
> On Wednesday 14 October 2009 20:56:17 Ivo van Doorn wrote:
>> Hi,
>>
>> > > On Wed, Oct 14, 2009 at 05:28:21PM +0200, Bartlomiej Zolnierkiewicz wrote:
>> > >
>> > > > I don't have a have a problem with it personally as long as people accept
>> > > > the competition..  but instead of working on _their_ projects they go around
>> > > > screaming at everybody who does not want to spin inside the great process
>> > > > designed by them..
>> > >
>> > > Please whine somewhere else.  You have the freedom to work in
>> > > drivers/staging all you want.  You do not have the power to force us to
>> > > like it -- especially in a case where you are diverting attention from
>> > > the community-maintained drivers instead of cooperating with them.
>> >
>> > Cooperating you say.
>> >
>> > rtl8187 -- before starting the work on rtl8187se I've pinged the maintainer
>> > to coordinate the effort and hear his opinion on how to progress..
>> >
>> > I've never heard back.
>> >
>> > rt2x00 -- I know that people have datasheets for some chipsets but I've
>> > never heard "How can we help you" etc. thing.
>>
>> The rt2x00 members received the specsheets under the condition that we didn't
>> distribute them further.
>>
>> So everybody which requested the datasheets from the rt2x00 project were presented
>> with a choice:
>> 1) We provide the email address of the Ralink contact person which can device if you
>> can get the specsheet or not (possibly under NDA, but this isn't always the case).
>> 2) Specific questions about the registers can be asked and we give all the information we
>> know from our work on the rt2x00 project plus additional information from the specsheet.
>> Seeing that the specsheet doesn't always match reality, you get the better answers with
>> this option, but some people just hate it when they need to ask other people for stuff.
>>
>> > All I've ever heard was _lies_ about current state of affairs or that
>> > my work is in the way.
>>
>> I have encounterd your email address in only 2 rt2x00 related discussions
>> (yes I have checked my entire email archive). Both cases were regarding
>> staging vs rt2x00.
>>
>> So far I never said rt2800usb or rt2800pci were high quality, I never said they were in a good
>> shape. On the other hand, I often talked about the problems with the drivers, requesting help
>> to improve the drivers, etc etc.
>>
>> So are you basing this "I am hearing lies" about a random person talking on the street
>> about rt2x00 which is telling the lie?
>
> Maybe I've used a bit too strong wording but the fact is that vendor drivers
> are useful for providing users with *unsupported* and *temporary* solution
> until the proper drivers are in place have been questioned a lot in the past,
> and sorry but it is a fact (it may be hard to swallow but it shouldn't be
> discussed about).
>
> The staging is a new game in town and provides real benefit for end-users
> to use their hardware early while proper solutions are being worked on (not
> like most of distributions weren't shipping crap drivers anyway -- now at
> least we have some control over it).
>
> This is extremely important in segments where Linux is still not the leading
> OS.  We cannot tell users to go hike -- they are our users! Moreover they
> are quite smart so they will use what works best for their needs anyway,
> not necessarily what is the easiest for us to maintain in the long-term or
> work on.
>
> Staging also helps companies involved to transform their software offerings
> in a more smooth way.  Often such transition requires long process and much
> work on the company side to adapt to our model of doing things so patience
> is recommended.  (Lets not forget that staging provides also a stick part,
> drivers are removed from staging if nobody cares about them and even if
> there are volunteers caring about support for certain hardware the company
> will still get a bad publicity if it doesn't participate in the process)..
>
> So staging is here to stay and it is up to particular maintainers how they
> are going to it use this "tool" and integrate it into their current mode of
> operation..
>
> I'm sorry if my words were offending to you or other wireless developers.
> I kind of feel the frustration of people who had put years of effort into
> providing the proper wireless infrastructure + drivers and are ignored
> by vendors.  However we have to keep the ball rolling and cannot dismiss
> valid user complaints or ignore other possibilities of doing things.
>

All,

I don't think this discussion is leading us anywhere.
I believe everybody agrees with the "staging"/Ralink provided drivers to be good
to provide end-users a working solution until the rt2x00 driver has
been completed.

However, the problem that we have seen (from the rt2x00 project point
of view) is that
the Ralink drivers that are in staging are confusing / distraction
developer attention. We
have had quite a few occasions where new developers started to work on
the staging
drivers, as they thought these were "the way to go".

I think that can be easily solved by including in the Ralink staging
drivers a README
file pointing to the rt2x00 drivers, and a note stating that the
rt2x00 drivers are the ones
for long-term Linux support, and that the staging drivers are there
just to help users making
their hardware work.

Just my $0.02 on this topic.

---
Gertjan
rt2x00 project developer

^ permalink raw reply

* Re: Moving drivers into staging (was Re: [GIT PULL] SCSI fixes for 2.6.32-rc3)
From: Ingo Molnar @ 2009-10-15  6:03 UTC (permalink / raw)
  To: Stefan Richter
  Cc: Joe Perches, Greg KH, Luis R. Rodriguez, James Bottomley,
	Linus Torvalds, Theodore Tso, Andrew Morton, linux-scsi,
	linux-kernel, Jing Huang, netdev, linux-wireless
In-Reply-To: <tkrat.88ac5cebebbd9689@s5r6.in-berlin.de>


* Stefan Richter <stefanr@s5r6.in-berlin.de> wrote:

> > Well, the answer is obvious i think. Tell me, at a glance, if you 
> > see a patch on lkml, which one is for a staging driver to be 
> > obsoleted, and which one is the one going upstream real soon? The 
> > patches say:
> > 
> >  +++ a/drivers/staging/foo/x.c
> > 
> >  +++ a/drivers/staging/bar/y.c
> > 
> > Then tell me the same at a glance if you see patches for:
> > 
> >  +++ a/drivers/staging/wip/x.c
> > 
> >  +++ a/drivers/staging/bad/y.c
> 
> Does this information matter much?

Yes. You might not appreciate it as you are active in a relatively 
narrow field (so all patches in your world have an 'obvious' place) - 
but i for example take most of the context of a change from the email 
itself and the more self-descriptive it is, the better. I would be more 
likely to review work-in-progress patches while not bother about 
obsolete drivers on the way out. YMMV.

> What's more interesting is whether development activity will _lead_ to 
> a driver being moved from bad or ugly to good.

... a prerequisite of which is for more developers to be accutely aware 
of in what state a driver is.

Anyway ... it's all up to Greg and he indicated that he wants the 
simplest structure, which is fair enough.

	Ingo

^ permalink raw reply

* Re: Stable compat-wireless 2.6.32-rc4 released
From: Kunal Gangakhedkar @ 2009-10-15  5:56 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: tim.gardner, linux-wireless
In-Reply-To: <43e72e890910140734j196a06f2y8905d3eb1ba1abc8@mail.gmail.com>

On Wednesday 14 Oct 2009 8:04:32 pm Luis R. Rodriguez wrote:
> On Tue, Oct 13, 2009 at 11:01 PM, Kunal Gangakhedkar
>
> <kunal.gangakhedkar@gmail.com> wrote:
> > On Wednesday 14 Oct 2009 6:20:33 am Luis R. Rodriguez wrote:
> >> On Tue, Oct 13, 2009 at 5:25 PM, Tim Gardner <tim.gardner@canonical.com>
> >
> > wrote:
> >> > Speaking as a distro, what advantage does the stable wireless backport
> >> > offer for the currently released kernel if we are already consumers of
> >> > stable updates?
> >>
> >> Well if you are a distro stuck on the 2.6.31 kernel the stable
> >> compat-wireless-2.6.32 gets you 2.6.32 wireless bits on 2.6.31 and
> >> that means any features/drivers/large fixes/enhancements that didn't
> >> make it to 2.6.31.
> >
> > Isn't this the whole purpose of linux-backports-modules in ubuntu as
> > well?
>
> Yes, but lbm currently relies on the bleeding edge compat-wireless
> which is exactly that -- bleeding edge, it may or may not work. The
> stable compat-wireless releases are based on the latest stable kernel
> releases and latest rc kernel release so they are deemed to be stable
> snapshots following the kernel release cycle.
>
>   Luis

Got that - thanks for the explanation :)

Kunal

^ permalink raw reply

* Re: [PATCH V3] iwlwifi: use paged Rx
From: Zhu Yi @ 2009-10-15  2:18 UTC (permalink / raw)
  To: Sedat Dilek; +Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org
In-Reply-To: <2d0a357f0910141204o9adc257w7744e47b47b1cace@mail.gmail.com>

On Thu, 2009-10-15 at 03:04 +0800, Sedat Dilek wrote:
> you are using ieee80211_rx() in
> * drivers/net/wireless/iwlwifi/iwl-3945.c
> * drivers/net/wireless/iwlwifi/iwl-rx.c
> files.
> Kalle posted "mac80211: add ieee80211_rx_ni()" patch [1] and I applied
> on top of master 2009-10-13.
> wl1251 driver uses ieee80211_rx_ni() [2].
> My question:
> Is iwlagn/iwl3945 using workqueues - means shall/can it use
> ieee80211_rx_ni() instead?

The iwlagn context for calling ieee80211_rx{_irqsafe} is tasklet. But
before my patch, the call site is also protected by a
spinlock_irqsave(). This makes the actual context to be an IRQ one. Thus
ieee80211_rx_irqsafe() is used originally. In this patch, I removed the
spin lock protection for it (see the patch comment for why we can do it)
so that ieee80211_rx() can be used now.

> Out of curiosity, I substituted ieee80211_rx() by ieee80211_rx_ni()
> and it seems to work.

This is unnecessary. Tasklet has already had bh disabled.

Thanks,
-yi


^ permalink raw reply

* Re: [PATCH] mac80211: fix SME warning by removing stale BSS upon assoc failure
From: Luis R. Rodriguez @ 2009-10-14 23:38 UTC (permalink / raw)
  To: Luis Rodriguez
  Cc: Johannes Berg, linville@tuxdriver.com,
	linux-wireless@vger.kernel.org, ic.felix@gmail.com
In-Reply-To: <20091014233528.GA4172@tux>

On Wed, Oct 14, 2009 at 04:35:28PM -0700, Luis Rodriguez wrote:
> > > --- a/net/mac80211/mlme.c
> > > +++ b/net/mac80211/mlme.c
> > > @@ -1463,11 +1463,11 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
> > >     if (status_code != WLAN_STATUS_SUCCESS) {
> > >             printk(KERN_DEBUG "%s: AP denied association (code=%d)\n",
> > >                    sdata->dev->name, status_code);
> > >             list_del(&wk->list);
> > >             kfree(wk);
> > > -           return RX_MGMT_CFG80211_ASSOC;
> > > +           return RX_MGMT_CFG80211_DEAUTH;
> >
> > I'm sure this is correct. Maybe cfg80211 doesn't react properly to
> > getting an assoc frame with non-zero status?
> 
> I see, will have to take a look when I get a chance then, not now though.

Actually can you elaborate a little on the logic here as to why
we want to issue an association command with non-zero status to
cfg80211 instead of just knocking off the current authentication
and killing the BSS?

  Luis

^ permalink raw reply

* Re: [PATCH] mac80211: fix SME warning by removing stale BSS upon assoc failure
From: Luis R. Rodriguez @ 2009-10-14 23:35 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Luis Rodriguez, linville@tuxdriver.com,
	linux-wireless@vger.kernel.org, ic.felix@gmail.com
In-Reply-To: <1255562895.4095.297.camel@johannes.local>

On Wed, Oct 14, 2009 at 04:28:15PM -0700, Johannes Berg wrote:
> On Tue, 2009-10-13 at 20:50 -0400, Luis R. Rodriguez wrote:
> > If you try to authenticate with an AP we will keep track of the
> > AP's BSS and expect to eventually either give up on the AP or complete
> > an association cycle with it. If an AP rejects our association though
> > mac80211 currently insists on telling cfg80211 a BSS authenticated
> > correctly, this is wrong as it leaves a bogus BSS lingering around.
> 
> But if assoc fails, it _did_ authenticate correctly.

Well sure, but why do we want to keep the authentication present if
association failed? And as a matter of fact it lingers there forever.
Is that desired behaviour?

> > --- a/net/mac80211/mlme.c
> > +++ b/net/mac80211/mlme.c
> > @@ -1463,11 +1463,11 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
> >  	if (status_code != WLAN_STATUS_SUCCESS) {
> >  		printk(KERN_DEBUG "%s: AP denied association (code=%d)\n",
> >  		       sdata->dev->name, status_code);
> >  		list_del(&wk->list);
> >  		kfree(wk);
> > -		return RX_MGMT_CFG80211_ASSOC;
> > +		return RX_MGMT_CFG80211_DEAUTH;
> 
> I'm sure this is correct. Maybe cfg80211 doesn't react properly to
> getting an assoc frame with non-zero status?

I see, will have to take a look when I get a chance then, not now though.

  Luis

^ permalink raw reply

* Re: [PATCH] mac80211: fix SME warning by removing stale BSS upon assoc failure
From: Johannes Berg @ 2009-10-14 23:28 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linville, linux-wireless, ic.felix
In-Reply-To: <1255481442-27130-1-git-send-email-lrodriguez@atheros.com>

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

On Tue, 2009-10-13 at 20:50 -0400, Luis R. Rodriguez wrote:
> If you try to authenticate with an AP we will keep track of the
> AP's BSS and expect to eventually either give up on the AP or complete
> an association cycle with it. If an AP rejects our association though
> mac80211 currently insists on telling cfg80211 a BSS authenticated
> correctly, this is wrong as it leaves a bogus BSS lingering around.

But if assoc fails, it _did_ authenticate correctly.

> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -1463,11 +1463,11 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
>  	if (status_code != WLAN_STATUS_SUCCESS) {
>  		printk(KERN_DEBUG "%s: AP denied association (code=%d)\n",
>  		       sdata->dev->name, status_code);
>  		list_del(&wk->list);
>  		kfree(wk);
> -		return RX_MGMT_CFG80211_ASSOC;
> +		return RX_MGMT_CFG80211_DEAUTH;

I'm sure this is correct. Maybe cfg80211 doesn't react properly to
getting an assoc frame with non-zero status?

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* Re: Issues building compat-wireless-2009-10-13
From: Riffer @ 2009-10-14 22:32 UTC (permalink / raw)
  To: Philip A. Prindeville; +Cc: linux-wireless
In-Reply-To: <4AD64823.9020906@redfish-solutions.com>

Hello!

Give compat-wireless-2009-10-14 a try - it compiles and works against
2.6.30-02063006-generic.

-- 
Riffer
http://www.meineneue.de

^ permalink raw reply

* Issues building compat-wireless-2009-10-13
From: Philip A. Prindeville @ 2009-10-14 21:52 UTC (permalink / raw)
  To: linux-wireless

Generated a snapshot at midnight, Pacific.

Tried to build it against 2.6.27.29 a little while ago.  Seeing:

  CC [M]  /home/philipp/alix/build_i586/compat-wireless-2009-10-13/drivers/net/wireless/ipw2x00/ipw2100.o
/home/philipp/alix/build_i586/compat-wireless-2009-10-13/drivers/net/wireless/ipw2x00/ipw2100.c: In function 'ipw2100_alloc_device':
/home/philipp/alix/build_i586/compat-wireless-2009-10-13/drivers/net/wireless/ipw2x00/ipw2100.c:6063: error: 'struct iw_public_data' has no member named 'ieee80211'
/home/philipp/alix/build_i586/compat-wireless-2009-10-13/drivers/net/wireless/ipw2x00/ipw2100.c: At top level:
/home/philipp/alix/build_i586/compat-wireless-2009-10-13/drivers/net/wireless/ipw2x00/ipw2100.c:8325: error: unknown field 'num_private' specified in initializer
/home/philipp/alix/build_i586/compat-wireless-2009-10-13/drivers/net/wireless/ipw2x00/ipw2100.c:8325: warning: initialization makes pointer from integer without a cast
/home/philipp/alix/build_i586/compat-wireless-2009-10-13/drivers/net/wireless/ipw2x00/ipw2100.c:8326: error: unknown field 'num_private_args' specified in initializer
/home/philipp/alix/build_i586/compat-wireless-2009-10-13/drivers/net/wireless/ipw2x00/ipw2100.c:8326: warning: excess elements in struct initializer
/home/philipp/alix/build_i586/compat-wireless-2009-10-13/drivers/net/wireless/ipw2x00/ipw2100.c:8326: warning: (near initialization for 'ipw2100_wx_handler_def')
/home/philipp/alix/build_i586/compat-wireless-2009-10-13/drivers/net/wireless/ipw2x00/ipw2100.c:8327: error: unknown field 'private' specified in initializer
/home/philipp/alix/build_i586/compat-wireless-2009-10-13/drivers/net/wireless/ipw2x00/ipw2100.c:8327: warning: excess elements in struct initializer
/home/philipp/alix/build_i586/compat-wireless-2009-10-13/drivers/net/wireless/ipw2x00/ipw2100.c:8327: warning: (near initialization for 'ipw2100_wx_handler_def')
/home/philipp/alix/build_i586/compat-wireless-2009-10-13/drivers/net/wireless/ipw2x00/ipw2100.c:8328: error: unknown field 'private_args' specified in initializer
/home/philipp/alix/build_i586/compat-wireless-2009-10-13/drivers/net/wireless/ipw2x00/ipw2100.c:8328: warning: excess elements in struct initializer
/home/philipp/alix/build_i586/compat-wireless-2009-10-13/drivers/net/wireless/ipw2x00/ipw2100.c:8328: warning: (near initialization for 'ipw2100_wx_handler_def')
make[5]: *** [/home/philipp/alix/build_i586/compat-wireless-2009-10-13/drivers/net/wireless/ipw2x00/ipw2100.o] Error 1
make[4]: *** [/home/philipp/alix/build_i586/compat-wireless-2009-10-13/drivers/net/wireless/ipw2x00] Error 2
make[3]: *** [/home/philipp/alix/build_i586/compat-wireless-2009-10-13/drivers/net/wireless] Error 2
make[2]: *** [_module_/home/philipp/alix/build_i586/compat-wireless-2009-10-13] Error 2
make[2]: Leaving directory `/home/philipp/alix/build_i586/linux-2.6.27.29-astlinux'
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/home/philipp/alix/build_i586/compat-wireless-2009-10-13'
make: *** [/home/philipp/alix/build_i586/compat-wireless-2009-10-13/net/wireless/lib80211.ko] Error 2



Is this a known issue?

Thanks,

-Philip



^ permalink raw reply

* Re: Error Installing 'iw'
From: Pavel Roskin @ 2009-10-14 21:14 UTC (permalink / raw)
  To: Pramono Tunggul; +Cc: linux-wireless
In-Reply-To: <4AD4CC94.1030407@infi-nity.com>

On Wed, 2009-10-14 at 01:53 +0700, Pramono Tunggul wrote:
> Guyz, when I try to start airmon-ng, it said that I have to install iw,
> so I download and install iw but I have never succeed to install iw,
> 
> PACKAGE_CONFIG_PATH=/usr/lib
> export PACKAGE_CONFIG_PATH

Maybe you meant to set PKG_CONFIG_PATH, as described in README?

> make
> 
> CC iw.o
> In file included from /usr/local/include/netlink/netlink.h:23,
> from /usr/include/netlink/genl/genl.h:15,
> from iw.c:17:
> /usr/local/include/netlink/netlink-kernel.h:222: error: expected 
> specifier-qualifier-list before ‘__u32’

First of all, libnl is still found in /usr/local/lib, not in /usr/lib,
in case it was your intention.

There is no line 222 in netlink-kernel.h from libnl 1.1.  Perhaps you
are using an old version of libnl?  I suggest that you try version 1.1.

-- 
Regards,
Pavel Roskin

^ permalink raw reply

* Re: Current status of rt2800usb and staging/rt2870
From: Bartlomiej Zolnierkiewicz @ 2009-10-14 20:10 UTC (permalink / raw)
  To: Ivo van Doorn
  Cc: John W. Linville, Dan Williams, Ozan Çağlayan,
	linux-wireless, linux-kernel
In-Reply-To: <200910142056.18295.IvDoorn@gmail.com>

On Wednesday 14 October 2009 20:56:17 Ivo van Doorn wrote:
> Hi,
> 
> > > On Wed, Oct 14, 2009 at 05:28:21PM +0200, Bartlomiej Zolnierkiewicz wrote:
> > > 
> > > > I don't have a have a problem with it personally as long as people accept
> > > > the competition..  but instead of working on _their_ projects they go around
> > > > screaming at everybody who does not want to spin inside the great process
> > > > designed by them..
> > > 
> > > Please whine somewhere else.  You have the freedom to work in
> > > drivers/staging all you want.  You do not have the power to force us to
> > > like it -- especially in a case where you are diverting attention from
> > > the community-maintained drivers instead of cooperating with them.
> > 
> > Cooperating you say.
> > 
> > rtl8187 -- before starting the work on rtl8187se I've pinged the maintainer
> > to coordinate the effort and hear his opinion on how to progress..
> > 
> > I've never heard back.
> > 
> > rt2x00 -- I know that people have datasheets for some chipsets but I've
> > never heard "How can we help you" etc. thing.
> 
> The rt2x00 members received the specsheets under the condition that we didn't
> distribute them further.
> 
> So everybody which requested the datasheets from the rt2x00 project were presented
> with a choice:
> 1) We provide the email address of the Ralink contact person which can device if you
> can get the specsheet or not (possibly under NDA, but this isn't always the case).
> 2) Specific questions about the registers can be asked and we give all the information we
> know from our work on the rt2x00 project plus additional information from the specsheet.
> Seeing that the specsheet doesn't always match reality, you get the better answers with
> this option, but some people just hate it when they need to ask other people for stuff.
> 
> > All I've ever heard was _lies_ about current state of affairs or that
> > my work is in the way.
> 
> I have encounterd your email address in only 2 rt2x00 related discussions
> (yes I have checked my entire email archive). Both cases were regarding
> staging vs rt2x00.
> 
> So far I never said rt2800usb or rt2800pci were high quality, I never said they were in a good
> shape. On the other hand, I often talked about the problems with the drivers, requesting help
> to improve the drivers, etc etc.
> 
> So are you basing this "I am hearing lies" about a random person talking on the street
> about rt2x00 which is telling the lie?

Maybe I've used a bit too strong wording but the fact is that vendor drivers
are useful for providing users with *unsupported* and *temporary* solution
until the proper drivers are in place have been questioned a lot in the past,
and sorry but it is a fact (it may be hard to swallow but it shouldn't be
discussed about).

The staging is a new game in town and provides real benefit for end-users
to use their hardware early while proper solutions are being worked on (not
like most of distributions weren't shipping crap drivers anyway -- now at
least we have some control over it).

This is extremely important in segments where Linux is still not the leading
OS.  We cannot tell users to go hike -- they are our users! Moreover they
are quite smart so they will use what works best for their needs anyway,
not necessarily what is the easiest for us to maintain in the long-term or
work on.

Staging also helps companies involved to transform their software offerings
in a more smooth way.  Often such transition requires long process and much
work on the company side to adapt to our model of doing things so patience
is recommended.  (Lets not forget that staging provides also a stick part,
drivers are removed from staging if nobody cares about them and even if
there are volunteers caring about support for certain hardware the company
will still get a bad publicity if it doesn't participate in the process)..

So staging is here to stay and it is up to particular maintainers how they
are going to it use this "tool" and integrate it into their current mode of
operation..

I'm sorry if my words were offending to you or other wireless developers.
I kind of feel the frustration of people who had put years of effort into
providing the proper wireless infrastructure + drivers and are ignored
by vendors.  However we have to keep the ball rolling and cannot dismiss
valid user complaints or ignore other possibilities of doing things.

Bartlomiej

^ permalink raw reply

* Re: Current status of rt2800usb and staging/rt2870
From: Bartlomiej Zolnierkiewicz @ 2009-10-14 20:41 UTC (permalink / raw)
  To: Luis Correia
  Cc: John W. Linville, Dan Williams, Ivo van Doorn,
	Ozan Çağlayan, linux-wireless, linux-kernel
In-Reply-To: <efe7343f0910141126o54ea2e31r5327e0db06a8b7ec@mail.gmail.com>

On Wednesday 14 October 2009 20:26:49 Luis Correia wrote:
> On Wed, Oct 14, 2009 at 18:33, Bartlomiej Zolnierkiewicz
> <bzolnier@gmail.com> wrote:
> > On Wednesday 14 October 2009 18:47:11 John W. Linville wrote:
> >> On Wed, Oct 14, 2009 at 05:28:21PM +0200, Bartlomiej Zolnierkiewicz wrote:
> >>
> >> > I don't have a have a problem with it personally as long as people accept
> >> > the competition..  but instead of working on _their_ projects they go around
> >> > screaming at everybody who does not want to spin inside the great process
> >> > designed by them..
> >>
> >> Please whine somewhere else.  You have the freedom to work in
> >> drivers/staging all you want.  You do not have the power to force us to
> >> like it -- especially in a case where you are diverting attention from
> >> the community-maintained drivers instead of cooperating with them.
> >
> > Cooperating you say.
> >
> > rtl8187 -- before starting the work on rtl8187se I've pinged the maintainer
> > to coordinate the effort and hear his opinion on how to progress..
> >
> > I've never heard back.
> >
> > rt2x00 -- I know that people have datasheets for some chipsets but I've
> > never heard "How can we help you" etc. thing.
> 
> I have all the datasheets that Ralink supplied to us.
> All of them are PRELIMINARY and most have errors, and therefore useless.
> 
> All useful information is in the crap drivers.
> 
> Ralink never provide better ones, and even our 'inside guy' says the
> hardware documentation guys are always very late in providing more
> info.
> 
> So, for me, it isn't lack of documentation that will ever help, believe me.
> 
> >
> > All I've ever heard was _lies_ about current state of affairs or that
> > my work is in the way.
> 
> AFAICS, your work was never questioned, at least by me.
> You are welcome to work on rt2x00 , that was also never a problem. All
> you would need is join in.
> 
> Ralink also said they were commited to present drivers for new chipset
> to be mac80211 compliant, we're waiting on that.
> 
> So, you're really welcome to join the rt2x00 team Bartlomiej, the only
> thing we ask is that all work should be done using the existing
> rt2x00lib, rt2x00pci and rt2x00usb base 'libraries'.

Well, I will still continue to work on staging drivers:

- I need to understand vendor drivers better before doing any larger rt2x00
  modifications.  Cleaning it up is just an added value while reading it..

- I feel quite comfortable working on de-convoluting crappy code and has years
  of experience of doing it.

- I'm still using Ralink hardware personally so I need something that provides
  the basic usability _now_.

but since I'm also going to start adding some missing bits to rt2x00 soon
I would be happy to join rt2x00 project..

^ permalink raw reply

* Re: AP: ath5k + hostapd occasionally sulks
From: Marin Glibic @ 2009-10-14 20:24 UTC (permalink / raw)
  To: linux-wireless

I've also been hit by this bug, mentioned last month - but he guy had no 
additional info. This is with compat-wireless 2009-10-09 and linux 
2.6.31.3, all in master mode, using recent hostapd from git.
Might also be two bugs... first one being module warning and "ath5k 
phy0: no further txbuf available, dropping packet" the other.


Oct 14 18:18:28 machinename kernel: ------------[ cut here ]------------
Oct 14 18:18:28 machinename kernel: WARNING: at 
/source/compat/compat-wireless-2009-10-09/net/mac80211/rc80211_minstrel.c:69 
minstrel_tx_status+0xdf/0x100 [mac80211]()
Oct 14 18:18:28 machinename kernel: Hardware name: KT600-8237
Oct 14 18:18:28 machinename kernel: Modules linked in: lp fuse ppdev 
parport_pc rtc_cmos parport rtc_core rtc_lib fan ath5k mac80211 ath 
processor uhci_hcd thermal thermal_sys cfg80211 hwmon button i2c_viapro rfk
ill i2c_core 3c59x led_class ehci_hcd shpchp via_agp evdev mii agpgart sg
Oct 14 18:18:28 machinename kernel: Pid: 0, comm: swapper Not tainted 
2.6.31.3-smp #2
Oct 14 18:18:28 machinename kernel: Call Trace:
Oct 14 18:18:28 machinename kernel:  [<c13cd9c0>] ? printk+0x18/0x20
Oct 14 18:18:28 machinename kernel:  [<e0a8ce2f>] ? 
minstrel_tx_status+0xdf/0x100 [mac80211]
Oct 14 18:18:28 machinename kernel:  [<c1032afc>] 
warn_slowpath_common+0x6c/0xc0
Oct 14 18:18:28 machinename kernel:  [<e0a8ce2f>] ? 
minstrel_tx_status+0xdf/0x100 [mac80211]
Oct 14 18:18:28 machinename kernel:  [<c1032b65>] 
warn_slowpath_null+0x15/0x20
Oct 14 18:18:28 machinename kernel:  [<e0a8ce2f>] 
minstrel_tx_status+0xdf/0x100 [mac80211]
Oct 14 18:18:28 machinename kernel:  [<e0a6fc8c>] 
ieee80211_tx_status+0x47c/0x4d0 [mac80211]
Oct 14 18:18:28 machinename kernel:  [<e0ad1293>] 
ath5k_tasklet_tx+0x203/0x3b0 [ath5k]
Oct 14 18:18:28 machinename kernel:  [<e0ac5883>] ? 
ath5k_hw_get_isr+0x223/0x3a0 [ath5k]
Oct 14 18:18:28 machinename kernel:  [<c1037430>] tasklet_action+0x50/0xb0
Oct 14 18:18:28 machinename kernel:  [<c10382aa>] __do_softirq+0xba/0x180
Oct 14 18:18:28 machinename kernel:  [<c10660c8>] ? 
handle_IRQ_event+0x58/0x140
Oct 14 18:18:28 machinename kernel:  [<c1018dce>] ? 
ack_apic_level+0x7e/0x270
Oct 14 18:18:28 machinename kernel:  [<c103839d>] do_softirq+0x2d/0x40
Oct 14 18:18:28 machinename kernel:  [<c10384f5>] irq_exit+0x65/0x90
Oct 14 18:18:28 machinename kernel:  [<c1004d3f>] do_IRQ+0x4f/0xc0
Oct 14 18:18:28 machinename kernel:  [<c104c7a9>] ? ktime_get+0x19/0x40
Oct 14 18:18:28 machinename kernel:  [<c10034e9>] common_interrupt+0x29/0x30
Oct 14 18:18:28 machinename kernel:  [<e0a1f381>] ? 
acpi_idle_enter_simple+0x132/0x15d [processor]
Oct 14 18:18:28 machinename kernel:  [<c1324c7f>] 
cpuidle_idle_call+0x6f/0xc0
Oct 14 18:18:28 machinename kernel:  [<c1001efd>] cpu_idle+0x4d/0x80
Oct 14 18:18:28 machinename kernel:  [<c13bd835>] rest_init+0x55/0x60
Oct 14 18:18:28 machinename kernel:  [<c15498a5>] start_kernel+0x2d5/0x338
Oct 14 18:18:28 machinename kernel:  [<c1549386>] ? 
unknown_bootoption+0x0/0x1f9
Oct 14 18:18:28 machinename kernel:  [<c1549079>] 
i386_start_kernel+0x79/0x81
Oct 14 18:18:28 machinename kernel: ---[ end trace 86949b8386bc65bb ]---

and then bit later:

Oct 14 20:22:02 machinename kernel: ath5k phy0: no further txbuf 
available, dropping packet
Oct 14 20:22:32 machinename last message repeated 4 times
Oct 14 20:23:33 machinename last message repeated 8 times
Oct 14 20:24:35 machinename last message repeated 8 times
Oct 14 20:25:33 machinename last message repeated 7 times
Oct 14 20:26:33 machinename last message repeated 8 times
Oct 14 20:27:33 machinename last message repeated 8 times
Oct 14 20:28:33 machinename last message repeated 8 times
and lot of these. Network traffic goes down. And even when it works, 
network traffic is very slow (<50kB/s)



some hw info:

2.6.31.3-smp #2 SMP Sat Oct 10 22:25:14 CEST 2009 i686 AMD Athlon(tm) XP 
2000+ AuthenticAMD GNU/Linux

00:0a.0 Ethernet controller [0200]: Atheros Communications Inc. Atheros 
AR5001X+ Wireless Network Adapter [168c:0013] (rev 01)
         Subsystem: Wistron NeWeb Corp. CM9 Wireless a/b/g MiniPCI 
Adapter [185f:1012]
         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- 
ParErr- Stepping- SERR- FastB2B- DisINTx-
         Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium 
 >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
         Latency: 168 (2500ns min, 7000ns max), Cache Line Size: 32 bytes
         Interrupt: pin A routed to IRQ 17
         Region 0: Memory at dd000000 (32-bit, non-prefetchable) [size=64K]
         Capabilities: [44] Power Management version 2
                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA 
PME(D0-,D1-,D2-,D3hot-,D3cold-)
                 Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=2 PME-
         Kernel driver in use: ath5k
         Kernel modules: ath5k

Hopefully somebody will catch this. Thanks.

^ permalink raw reply


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