* Re: [PATCH v2] wl12xx_sdio_test: rename files to match current style
From: Luciano Coelho @ 2010-12-16 9:26 UTC (permalink / raw)
To: Roger Quadros; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <4D09D80B.1020402@nokia.com>
On Thu, 2010-12-16 at 11:12 +0200, Roger Quadros wrote:
> >> what platform do you use to verify with mainline kernel& sdio
> wl1271 ?
> >
> > I use both our RX-71 and a Beagleboard. I have trees which work on
> > both, let me know if you want to clone them from my local git.
> >
>
> Yes that will be helpful. Please provide me a link to your tree that
> works with RX-71.
Ok, I'll send it to you privately. This is on our intranet, so nobody
else can access it from outside anyway (hopefully! ;).
--
Cheers,
Luca.
^ permalink raw reply
* Re: [PATCH v2] wl12xx_sdio_test: rename files to match current style
From: Roger Quadros @ 2010-12-16 9:12 UTC (permalink / raw)
To: Luciano Coelho; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <1292490247.11205.14.camel@chilepepper>
On 12/16/2010 11:04 AM, Luciano Coelho wrote:
> Hi Roger,
>
>
> I have a tree prepared with the latest wl12xx.git plus some patches that
> add support for our development platform (RX-71).
>
>
>> The only way to verify it is to load the module with the parameters rx=1 and
>> tx=1 and see if the "testing started" message appears.
>
> I tried it now, but I'm always getting this when loading the module:
>
> [ 114.883514] wl12xx_sdio_test mmc2:0001:2: could not wake up chip
> [ 114.889587] wl12xx_sdio_test: probe of mmc2:0001:2 failed with error 1
>
> Any clue what this is about?
Not sure. need to check.
>
>
>> what platform do you use to verify with mainline kernel& sdio wl1271 ?
>
> I use both our RX-71 and a Beagleboard. I have trees which work on
> both, let me know if you want to clone them from my local git.
>
Yes that will be helpful. Please provide me a link to your tree that works with
RX-71.
--
regards,
-roger
^ permalink raw reply
* Re: [PATCH v2] wl12xx_sdio_test: rename files to match current style
From: Luciano Coelho @ 2010-12-16 9:04 UTC (permalink / raw)
To: Roger Quadros; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <4D08DBDC.5070908@nokia.com>
Hi Roger,
On Wed, 2010-12-15 at 17:16 +0200, Roger Quadros wrote:
> On 12/15/2010 04:48 PM, Luciano Coelho wrote:
> > On Wed, 2010-12-15 at 16:33 +0200, ext Luciano Coelho wrote:
> >> On Wed, 2010-12-15 at 16:31 +0200, luciano.coelho@nokia.com wrote:
> >>> From: Luciano Coelho<luciano.coelho@nokia.com>
> >>>
> >>> Change some file names and Kconfig settings so that this new module matches
> >>> the new way of using wl12xx instead of wl1271.
> >>>
> >>> Also fix SDIO power enabling and disabling to match the latest way of doing
> >>> it.
> >>>
> >>> Cc: Roger Quadros<roger.quadros@nokia.com>
> >>> Signed-off-by: Luciano Coelho<luciano.coelho@nokia.com>
> >>> ---
> >>
> >> In v2 I used the -M flag (to detect renames, which I stupidly forgot
> >> before) and removed the file names from the header of the sdio_test.c
> >> file, since it's a bad idea to have it there (thanks Johannes for the
> >> comments).
> >
> > Roger, I have just compile-tested this module in upstream. Could you
> > run at least some basic tests with it to make sure it works?
> >
> >
>
> Luca,
>
> I don't have a ready setup with me which boots mainline kernel and has wl1271 on
> sdio.
I have a tree prepared with the latest wl12xx.git plus some patches that
add support for our development platform (RX-71).
> The only way to verify it is to load the module with the parameters rx=1 and
> tx=1 and see if the "testing started" message appears.
I tried it now, but I'm always getting this when loading the module:
[ 114.883514] wl12xx_sdio_test mmc2:0001:2: could not wake up chip
[ 114.889587] wl12xx_sdio_test: probe of mmc2:0001:2 failed with error 1
Any clue what this is about?
> what platform do you use to verify with mainline kernel & sdio wl1271 ?
I use both our RX-71 and a Beagleboard. I have trees which work on
both, let me know if you want to clone them from my local git.
--
Cheers,
Luca.
^ permalink raw reply
* pull request: wl12xx 2010-12-16
From: Luciano Coelho @ 2010-12-16 8:51 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless@vger.kernel.org
Hi John,
This pull-request contains some improvements and bug fixes for the
wl12xx driver. It's the same thing I sent yesterday, but with one extra
patch that fixes a compilation breakage.
Please pull or let me know if there's any problem. This tree is based
on wireless-next/master.
Thanks!
The following changes since commit 412b31334b831a8c2909afaca017c5a236ac2dd0:
Wolfgang Kufner (1):
rt2x00: Fix firmware loading regression on x86_64.
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx.git wl12xx-next
Eliad Peller (4):
wl1271: use debugfs_remove_recursive
wl1271: move wl12xx debugfs directory to under wiphy's debugfs
wl12xx: add auto-arp support
wl12xx: allow runtime changing of debug_level
Guy Eilam (1):
wl1271: fixed problem with WPS IEs in probe requests
Juuso Oikarinen (4):
wl12xx: Fix kernel crash related to hw recovery and interface shutdown
wl1271: Fix setting of the hardware connection monitoring probe-req template
wl12xx: Remove 11j channels from the supported channels list.
wl12xx: Change TX queue to be per AC
Luciano Coelho (4):
wl12xx: disable 11a channels when regulatory changes if 11a is not supported
wl12xx: fix illegal memset if debugfs is not enabled
wl12xx: disable 11a channels when wl->enable_11a is known
wl12xx_sdio_test: rename files to match current style
Roger Quadros (2):
wl1271: Add wl1271_load_firmware() and export some functions
wl1271_sdio_test: Add module for sdio RX/TX testing
drivers/net/wireless/wl12xx/Kconfig | 10 +
drivers/net/wireless/wl12xx/Makefile | 3 +
drivers/net/wireless/wl12xx/acx.c | 4 +-
drivers/net/wireless/wl12xx/acx.h | 9 +-
drivers/net/wireless/wl12xx/boot.c | 17 +-
drivers/net/wireless/wl12xx/boot.h | 1 +
drivers/net/wireless/wl12xx/cmd.c | 69 ++++
drivers/net/wireless/wl12xx/cmd.h | 4 +
drivers/net/wireless/wl12xx/debugfs.c | 192 +++--------
drivers/net/wireless/wl12xx/init.c | 13 +-
drivers/net/wireless/wl12xx/io.c | 1 +
drivers/net/wireless/wl12xx/main.c | 119 +++++--
drivers/net/wireless/wl12xx/scan.c | 4 +
drivers/net/wireless/wl12xx/sdio_test.c | 520 ++++++++++++++++++++++++++++
drivers/net/wireless/wl12xx/tx.c | 60 +++-
drivers/net/wireless/wl12xx/wl12xx.h | 129 +------
drivers/net/wireless/wl12xx/wl12xx_80211.h | 17 +-
17 files changed, 848 insertions(+), 324 deletions(-)
create mode 100644 drivers/net/wireless/wl12xx/sdio_test.c
--
Cheers,
Luca.
^ permalink raw reply
* Re: [PATCH 2/2] ath5k: Add channel time to survey data
From: Bruno Randolf @ 2010-12-16 7:23 UTC (permalink / raw)
To: Jonathan Guerin; +Cc: linville, ath5k-devel, linux-wireless
In-Reply-To: <AANLkTimPEAXpvdp2-MMA65=dO_-YZzcS9VbWCNOhVO1q@mail.gmail.com>
On Fri November 19 2010 21:28:52 Jonathan Guerin wrote:
> I'm not sure if I'm understanding the way the data is represented. I'm
> pulling it via nl80211 (or even if just using iw to poll the values
> regularly). They just appear to go back and forwards in time, as well
> as being very large values. Am I missing something? Is the count not
> supposed to be the amount of time for the measure since the card was
> brought up?
>
> Also, what does the 'channel time' value actually mean by 'time the
> station spent on this channel'? How is this different to the 'Channel
> busy time'? If it's not just busy time, but time the station was
> locked on this channel, why is the value FAR smaller than the channel
> busy time...?
Jonathan,
Yeah, the old implementation was all broken. Please check my patch from today
- I verified it works now.
bruno
> --
> Jonathan Guerin
>
> On Tue, Oct 19, 2010 at 5:56 PM, Bruno Randolf <br1@einfach.org> wrote:
> > Include the channel utilization (busy, rx, tx) in the survey results.
> >
> > Signed-off-by: Bruno Randolf <br1@einfach.org>
> > ---
> > drivers/net/wireless/ath/ath5k/base.c | 20 +++++++++++++++++++-
> > 1 files changed, 19 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/net/wireless/ath/ath5k/base.c
> > b/drivers/net/wireless/ath/ath5k/base.c index 8251946..484aad5 100644
> > --- a/drivers/net/wireless/ath/ath5k/base.c
> > +++ b/drivers/net/wireless/ath/ath5k/base.c
> > @@ -3206,14 +3206,32 @@ static int ath5k_get_survey(struct ieee80211_hw
> > *hw, int idx, {
> > struct ath5k_softc *sc = hw->priv;
> > struct ieee80211_conf *conf = &hw->conf;
> > + struct ath_common *common = ath5k_hw_common(sc->ah);
> > + struct ath_cycle_counters *cc = &common->cc_survey;
> > + unsigned int div = common->clockrate * 1000;
> >
> > - if (idx != 0)
> > + if (idx != 0)
> > return -ENOENT;
> >
> > survey->channel = conf->channel;
> > survey->filled = SURVEY_INFO_NOISE_DBM;
> > survey->noise = sc->ah->ah_noise_floor;
> >
> > + spin_lock_bh(&common->cc_lock);
> > + ath_hw_cycle_counters_update(common);
> > + if (cc->cycles > 0) {
> > + survey->filled |= SURVEY_INFO_CHANNEL_TIME |
> > + SURVEY_INFO_CHANNEL_TIME_BUSY |
> > + SURVEY_INFO_CHANNEL_TIME_RX |
> > + SURVEY_INFO_CHANNEL_TIME_TX;
> > + survey->channel_time += cc->cycles / div;
> > + survey->channel_time_busy += cc->rx_busy / div;
> > + survey->channel_time_rx += cc->rx_frame / div;
> > + survey->channel_time_tx += cc->tx_frame / div;
> > + }
> > + memset(cc, 0, sizeof(*cc));
> > + spin_unlock_bh(&common->cc_lock);
> > +
> > return 0;
> > }
> >
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-wireless"
> > in the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH] ath5k: Fix survey
From: Bruno Randolf @ 2010-12-16 7:22 UTC (permalink / raw)
To: linville; +Cc: ath5k-devel, jonathan, linux-wireless
The old survey implementation was broken and returned nonsense data.
Clear cycle counters and survey data on reset. Since the cycle counters easily
overflow it's better to keep a local version of collected survey data (in ms
resolution, instead of clockrate) and update this every time survey is
retrieved. If survey is retrieved often enough to avoid cycle counter overflows
this works fine, otherwise we could update survey more often, like ath9k does.
Still only the survey for the current channel is kept.
Signed-off-by: Bruno Randolf <br1@einfach.org>
---
drivers/net/wireless/ath/ath5k/base.c | 35 ++++++++++++++++++++++-----------
drivers/net/wireless/ath/ath5k/base.h | 2 ++
2 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 3c65fef..e4ec40c 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2658,6 +2658,7 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan,
bool skip_pcu)
{
struct ath5k_hw *ah = sc->ah;
+ struct ath_common *common = ath5k_hw_common(ah);
int ret, ani_mode;
ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "resetting\n");
@@ -2700,6 +2701,14 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan,
ah->ah_cal_next_nf = jiffies;
ewma_init(&ah->ah_beacon_rssi_avg, 1024, 8);
+ /* clear survey data and cycle counters */
+ memset(&sc->survey, 0, sizeof(sc->survey));
+ spin_lock(&common->cc_lock);
+ ath_hw_cycle_counters_update(common);
+ memset(&common->cc_survey, 0, sizeof(common->cc_survey));
+ memset(&common->cc_ani, 0, sizeof(common->cc_ani));
+ spin_unlock(&common->cc_lock);
+
/*
* Change channels and update the h/w rate map if we're switching;
* e.g. 11a to 11b/g.
@@ -3366,25 +3375,27 @@ static int ath5k_get_survey(struct ieee80211_hw *hw, int idx,
if (idx != 0)
return -ENOENT;
- survey->channel = conf->channel;
- survey->filled = SURVEY_INFO_NOISE_DBM;
- survey->noise = sc->ah->ah_noise_floor;
-
spin_lock_bh(&common->cc_lock);
ath_hw_cycle_counters_update(common);
if (cc->cycles > 0) {
- survey->filled |= SURVEY_INFO_CHANNEL_TIME |
- SURVEY_INFO_CHANNEL_TIME_BUSY |
- SURVEY_INFO_CHANNEL_TIME_RX |
- SURVEY_INFO_CHANNEL_TIME_TX;
- survey->channel_time += cc->cycles / div;
- survey->channel_time_busy += cc->rx_busy / div;
- survey->channel_time_rx += cc->rx_frame / div;
- survey->channel_time_tx += cc->tx_frame / div;
+ sc->survey.channel_time += cc->cycles / div;
+ sc->survey.channel_time_busy += cc->rx_busy / div;
+ sc->survey.channel_time_rx += cc->rx_frame / div;
+ sc->survey.channel_time_tx += cc->tx_frame / div;
}
memset(cc, 0, sizeof(*cc));
spin_unlock_bh(&common->cc_lock);
+ memcpy(survey, &sc->survey, sizeof(*survey));
+
+ survey->channel = conf->channel;
+ survey->noise = sc->ah->ah_noise_floor;
+ survey->filled = SURVEY_INFO_NOISE_DBM |
+ SURVEY_INFO_CHANNEL_TIME |
+ SURVEY_INFO_CHANNEL_TIME_BUSY |
+ SURVEY_INFO_CHANNEL_TIME_RX |
+ SURVEY_INFO_CHANNEL_TIME_TX;
+
return 0;
}
diff --git a/drivers/net/wireless/ath/ath5k/base.h b/drivers/net/wireless/ath/ath5k/base.h
index aa6c32a..6d51147 100644
--- a/drivers/net/wireless/ath/ath5k/base.h
+++ b/drivers/net/wireless/ath/ath5k/base.h
@@ -258,6 +258,8 @@ struct ath5k_softc {
struct tasklet_struct ani_tasklet; /* ANI calibration */
struct delayed_work tx_complete_work;
+
+ struct survey_info survey; /* collected survey info */
};
#define ath5k_hw_hasbssidmask(_ah) \
^ permalink raw reply related
* Re: Netlink Memory Leak Issue
From: Johannes Berg @ 2010-12-16 7:03 UTC (permalink / raw)
To: Saurabh8 Jain; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <B659B0EE7F1D5A499E4A4BEB0BECBA2518292B3D21@GUREXMB01.ASIAN.AD.ARICENT.COM>
On Thu, 2010-12-16 at 11:01 +0530, Saurabh8 Jain wrote:
> Hi,
>
> I would like to know the memory usage that happens between user space
> and kernel space communication. Communication happens via generic
> netlink library and we need to register doit and dump functions.
Yes.
> I was going through function "nl80211_set_mesh_params" in
> "net/wireless/nl80211.c" which receives values of mesh parameters. In
> this function skb is passed but it is never used and the skb is not
> freed. I saw other functions also which receives messages from user
> space but no memory is released for skb.
> Where is this memory getting free? Do I need to free this memory?
Look at net/netlink/ -- we don't need to handle that.
> When I executed iw commands to set few values in loop. I saw there is
> drop in free memory of "top" command. I am working on
> compatwireless-2010-06-27.
You're seriously taking "top" for a measurement? That's like the worst
possible way to measure memory usage.
johannes
^ permalink raw reply
* Re: [PATCH] mac80211: Push idle state to driver before stop
From: Johannes Berg @ 2010-12-16 6:59 UTC (permalink / raw)
To: Paul Stewart; +Cc: linux-wireless, luis.rodriguez
In-Reply-To: <20101215194246.D5FCE204D8@glenhelen.mtv.corp.google.com>
On Wed, 2010-12-15 at 10:54 -0800, Paul Stewart wrote:
> Sometimes mac80211 doesn't push idle state downwards to the
> driver. Specifically, there are times in some functions where
> the "local->hw.conf.flags & IEEE80211_CONF_IDLE" may change but
> the equivalent of "drv_config(local, IEEE80211_CONF_CHANGE_IDLE)"
> does not end up being called. This is usually not all that
> problematic except, for example, suspending and resuming an idle
> ath9k device. If the device isn't marked idle when
> ieee80211_stop_device() is called, the device never gets put to
> sleep, and will end up in an unresponsive state on resume.
I thought this was solved in ath9k differently? Was that somehow
inadequate?
> As a precaution, explicitly call drv_config() before
> ieee80211_stop_device(), which should be a no-op under normal
> circumstances, but where this problem arises, it will shut down
> the ath9k where necessary.
I'm not convinced that this makes a lot of sense. I'm sure you can come
up with other scenarios in which we stop a device and expect it to come
back. I'm not sure why mac80211 should be responsible for all this?
> One example where this problem occurs is when I down an interface
> while a scan is in progress on ath9k. If the device was not shut
> down correctly and the system suspends and resumes repeatedly with
> ath9k, I end up with a fatal register read error (0x7000/deadbeef)
> when trying to bring the interface back up.
>
> Signed-off-by: Paul Stewart <pstew@google.com>
> ---
> net/mac80211/iface.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
> index b6db237..5af5a89 100644
> --- a/net/mac80211/iface.c
> +++ b/net/mac80211/iface.c
> @@ -536,6 +536,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
> if (local->ops->napi_poll)
> napi_disable(&local->napi);
> ieee80211_clear_tx_pending(local);
> + drv_config(local, IEEE80211_CONF_CHANGE_IDLE);
> ieee80211_stop_device(local);
>
> /* no reconfiguring after stop! */
I don't like this anyway -- you're calling a driver callback directly,
and there's no guarantee that just that particular change will be used
by the driver -- it's free to look at other state given to it in each
callback as well. That seems problematic because of all the other logic
that we have in ieee80211_hw_config().
At the very least I think you need to provide a better rationale for
this patch and explain why the ath9k change isn't sufficient?
johannes
^ permalink raw reply
* Netlink Memory Leak Issue
From: Saurabh8 Jain @ 2010-12-16 5:31 UTC (permalink / raw)
To: linux-wireless@vger.kernel.org
Hi,
I would like to know the memory usage that happens between user space and kernel space communication. Communication happens via generic netlink library and we need to register doit and dump functions.
I was going through function "nl80211_set_mesh_params" in "net/wireless/nl80211.c" which receives values of mesh parameters. In this function skb is passed but it is never used and the skb is not freed. I saw other functions also which receives messages from user space but no memory is released for skb.
Where is this memory getting free? Do I need to free this memory?
When I executed iw commands to set few values in loop. I saw there is drop in free memory of "top" command. I am working on compatwireless-2010-06-27.
Thanks,
Saurabh Jain
"DISCLAIMER: This message is proprietary to Aricent and is intended solely for the use of the individual to whom it is addressed. It may contain privileged or confidential information and should not be circulated or used for any purpose other than for what it is intended. If you have received this message in error, please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly prohibited from using, copying, altering, or disclosing the contents of this message. Aricent accepts no responsibility for loss or damage arising from the use of the information transmitted by this email including damage from virus."
^ permalink raw reply
* Re: [PATCH] staging: ath6kl: Fixing device NULL pointer dereference
From: Joe Perches @ 2010-12-16 6:04 UTC (permalink / raw)
To: Vipin Mehta
Cc: Luis R. Rodriguez, devel@driverdev.osuosl.org,
linux-wireless@vger.kernel.org, Vipin Mehta
In-Reply-To: <20101216011416.GA388@vmehta-desktop>
On Wed, 2010-12-15 at 17:15 -0800, Vipin Mehta wrote:
> On Tue, Dec 14, 2010 at 08:15:24PM -0800, Luis R. Rodriguez wrote:
> > > diff --git a/drivers/staging/ath6kl/os/linux/ar6000_drv.c b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
> > > + A_MEMZERO(&osDevInfo, sizeof(osDevInfo));
> > > + if ( A_FAILED( HIFConfigureDevice(hif_handle, HIF_DEVICE_GET_OS_DEVICE,
> > while you are adding new code, why not use the direct Linux calls?
> I'll change the use of A_MEMZERO(), A_FAILED() macros and A_STATUS
> data type given that we have an incoming patch that cleans the rest
> of the code for similar usage. Changing the use of HIFConfigureDevice()
> will be more useful if we do it across the driver since it will require
> significant changes in the data structures defined in the HIF layer.
> It qualifies for an entirely separate patch and can be done later in a
> systematic way.
I hope you hold off for a bit making changes to ath6kl.
I just finished more of those cleanup conversions.
Here's what I've done so far.
There's a lot more of this still possible.
It's unfortunately large.
Sending separately to Vipin and Luis.
Reformat to remove typedefs, A_<foo> macros, etc.
Improve readability by using a more kernel conformant style.
Joe Perches (35):
staging: ath6kl: Convert enum A_STATUS to int
staging: ath6kl: Remove A_SUCCESS macro
staging: ath6kl: Remove A_FAILED macro
staging: ath6kl: Remove A_BOOL and TRUE/FALSE
staging: ath6kl: Convert A_CHAR to char
staging: ath6kl: Convert A_UINT8 to u8
staging: ath6kl: Convert A_UINT16 to u16
staging: ath6kl: Convert A_UINT32 to u32
staging: ath6kl: Convert A_UINT64 to u64
staging: ath6kl: Convert A_INT8 to s8
staging: ath6kl: Convert A_INT16 to s16
staging: ath6kl: Convert A_INT32 to s32
staging: ath6kl: Convert (status != A_OK) to (status)
staging: ath6kl: Remove #define A_OK
staging: ath6kl: Convert leading spaces to tab indentation
staging: ath6kl: Remove direct comparisons to true/false
staging: ath6kl: Cuddle while open braces
staging: ath6kl: Use do {} while (0) around #defines
staging: ath6kl: Remove most uses of braces around single statements
staging: ath6kl: Remove braces around single statement if { foo } else uses
staging: ath6kl: Remove blank lines
staging: ath6kl: Hoist assigns from ifs
staging: ath6kl: Cuddle open brace to if
staging: ath6kl: Cuddle else open brace
staging: ath6kl: Add space after commas
staging: ath6kl: Remove spaces before quoted newlines
staging: ath6kl: Convert A_UCHAR to u8
staging: ath6kl: Convert A_MEMCPY to memcpy
staging: ath6kl: Convert A_MEMCMP to memcmp
staging: ath6kl: Convert A_MALLOC to kmalloc/kzalloc
staging: ath6kl: Convert A_MALLOC_NOWAIT to kmalloc/kzalloc(,GFP_ATOMIC)
staging: ath6kl: Convert A_FREE to kfree
staging: ath6kl: Convert A_MEMZERO to memset
staging: ath6kl: Remove trailing whitespace
staging: ath6kl: Convert AR_DEBUG_PRINTF to ath6k_dbg
drivers/staging/ath6kl/bmi/include/bmi_internal.h | 19 +-
drivers/staging/ath6kl/bmi/src/bmi.c | 1738 ++--
.../staging/ath6kl/hif/common/hif_sdio_common.h | 72 +-
.../hif/sdio/linux_sdio/include/hif_internal.h | 87 +-
.../staging/ath6kl/hif/sdio/linux_sdio/src/hif.c | 2019 +++--
.../ath6kl/hif/sdio/linux_sdio/src/hif_scatter.c | 682 +-
drivers/staging/ath6kl/htc2/AR6000/ar6k.c | 2373 +++---
drivers/staging/ath6kl/htc2/AR6000/ar6k.h | 496 +-
drivers/staging/ath6kl/htc2/AR6000/ar6k_events.c | 1317 ++--
drivers/staging/ath6kl/htc2/AR6000/ar6k_gmbox.c | 1293 ++--
.../ath6kl/htc2/AR6000/ar6k_gmbox_hciuart.c | 2286 +++---
drivers/staging/ath6kl/htc2/htc.c | 875 +-
drivers/staging/ath6kl/htc2/htc_debug.h | 3 +-
drivers/staging/ath6kl/htc2/htc_internal.h | 206 +-
drivers/staging/ath6kl/htc2/htc_recv.c | 2827 +++---
drivers/staging/ath6kl/htc2/htc_send.c | 1821 ++--
drivers/staging/ath6kl/htc2/htc_services.c | 772 +-
drivers/staging/ath6kl/include/a_config.h | 2 +-
drivers/staging/ath6kl/include/a_debug.h | 62 +-
drivers/staging/ath6kl/include/a_drv.h | 2 +-
drivers/staging/ath6kl/include/a_drv_api.h | 108 +-
drivers/staging/ath6kl/include/a_osapi.h | 6 +-
drivers/staging/ath6kl/include/a_types.h | 2 +-
drivers/staging/ath6kl/include/aggr_recv_api.h | 46 +-
drivers/staging/ath6kl/include/ar3kconfig.h | 35 +-
drivers/staging/ath6kl/include/ar6000_api.h | 3 +-
drivers/staging/ath6kl/include/ar6000_diag.h | 29 +-
drivers/staging/ath6kl/include/ar6kap_common.h | 14 +-
drivers/staging/ath6kl/include/athbtfilter.h | 145 +-
drivers/staging/ath6kl/include/athendpack.h | 5 +-
drivers/staging/ath6kl/include/athstartpack.h | 4 +-
drivers/staging/ath6kl/include/bmi.h | 108 +-
.../ath6kl/include/common/AR6002/AR6002_regdump.h | 44 +-
.../ath6kl/include/common/AR6002/AR6K_version.h | 6 +-
.../staging/ath6kl/include/common/AR6002/addrs.h | 10 +-
.../common/AR6002/hw2.0/hw/analog_intf_reg.h | 1 -
.../include/common/AR6002/hw2.0/hw/analog_reg.h | 1 -
.../include/common/AR6002/hw2.0/hw/gpio_reg.h | 1 -
.../include/common/AR6002/hw2.0/hw/mbox_host_reg.h | 1 -
.../include/common/AR6002/hw2.0/hw/mbox_reg.h | 1 -
.../include/common/AR6002/hw2.0/hw/rtc_reg.h | 1 -
.../ath6kl/include/common/AR6002/hw2.0/hw/si_reg.h | 1 -
.../include/common/AR6002/hw2.0/hw/uart_reg.h | 1 -
.../include/common/AR6002/hw2.0/hw/vmc_reg.h | 1 -
.../common/AR6002/hw4.0/hw/analog_intf_ares_reg.h | 5 +-
.../AR6002/hw4.0/hw/analog_intf_athr_wlan_reg.h | 5 +-
.../common/AR6002/hw4.0/hw/analog_intf_reg.h | 9 +-
.../common/AR6002/hw4.0/hw/apb_athr_wlan_map.h | 3 +-
.../include/common/AR6002/hw4.0/hw/apb_map.h | 8 +-
.../include/common/AR6002/hw4.0/hw/bb_lc_reg.h | 5 +-
.../include/common/AR6002/hw4.0/hw/efuse_reg.h | 4 +-
.../common/AR6002/hw4.0/hw/gpio_athr_wlan_reg.h | 4 +-
.../include/common/AR6002/hw4.0/hw/gpio_reg.h | 8 +-
.../include/common/AR6002/hw4.0/hw/mac_dma_reg.h | 38 +-
.../include/common/AR6002/hw4.0/hw/mac_pcu_reg.h | 4 +-
.../include/common/AR6002/hw4.0/hw/mbox_host_reg.h | 9 +-
.../include/common/AR6002/hw4.0/hw/mbox_reg.h | 8 +-
.../common/AR6002/hw4.0/hw/mbox_wlan_host_reg.h | 4 +-
.../include/common/AR6002/hw4.0/hw/mbox_wlan_reg.h | 4 +-
.../include/common/AR6002/hw4.0/hw/rdma_reg.h | 4 +-
.../include/common/AR6002/hw4.0/hw/rtc_reg.h | 8 +-
.../include/common/AR6002/hw4.0/hw/rtc_wlan_reg.h | 4 +-
.../ath6kl/include/common/AR6002/hw4.0/hw/si_reg.h | 4 +-
.../include/common/AR6002/hw4.0/hw/uart_reg.h | 4 +-
.../include/common/AR6002/hw4.0/hw/umbox_reg.h | 9 +-
.../common/AR6002/hw4.0/hw/umbox_wlan_reg.h | 4 +-
.../include/common/AR6002/hw4.0/hw/vmc_reg.h | 8 +-
.../include/common/AR6002/hw4.0/hw/vmc_wlan_reg.h | 4 +-
drivers/staging/ath6kl/include/common/a_hci.h | 483 +-
drivers/staging/ath6kl/include/common/athdefs.h | 87 +-
drivers/staging/ath6kl/include/common/bmi_msg.h | 273 +-
drivers/staging/ath6kl/include/common/btcoexGpio.h | 15 +-
drivers/staging/ath6kl/include/common/cnxmgmt.h | 14 +-
drivers/staging/ath6kl/include/common/dbglog.h | 48 +-
drivers/staging/ath6kl/include/common/dbglog_id.h | 55 +-
drivers/staging/ath6kl/include/common/discovery.h | 60 +-
.../staging/ath6kl/include/common/dset_internal.h | 23 +-
drivers/staging/ath6kl/include/common/dsetid.h | 25 +-
.../staging/ath6kl/include/common/epping_test.h | 99 +-
drivers/staging/ath6kl/include/common/gmboxif.h | 27 +-
drivers/staging/ath6kl/include/common/htc.h | 204 +-
.../staging/ath6kl/include/common/htc_services.h | 30 +-
drivers/staging/ath6kl/include/common/ini_dset.h | 68 +-
drivers/staging/ath6kl/include/common/pkt_log.h | 16 +-
drivers/staging/ath6kl/include/common/regDb.h | 2 +-
drivers/staging/ath6kl/include/common/regdump.h | 14 +-
.../include/common/regulatory/reg_dbschema.h | 152 +-
.../include/common/regulatory/reg_dbvalues.h | 735 +-
drivers/staging/ath6kl/include/common/roaming.h | 18 +-
drivers/staging/ath6kl/include/common/targaddrs.h | 214 +-
drivers/staging/ath6kl/include/common/testcmd.h | 198 +-
drivers/staging/ath6kl/include/common/tlpm.h | 2 +-
drivers/staging/ath6kl/include/common/wlan_defs.h | 60 +-
drivers/staging/ath6kl/include/common/wlan_dset.h | 8 +-
drivers/staging/ath6kl/include/common/wmi.h | 2740 +++---
drivers/staging/ath6kl/include/common/wmi_thin.h | 310 +-
drivers/staging/ath6kl/include/common/wmix.h | 145 +-
drivers/staging/ath6kl/include/common_drv.h | 58 +-
drivers/staging/ath6kl/include/dbglog_api.h | 10 +-
drivers/staging/ath6kl/include/dl_list.h | 142 +-
drivers/staging/ath6kl/include/dset_api.h | 33 +-
drivers/staging/ath6kl/include/gpio_api.h | 24 +-
drivers/staging/ath6kl/include/hci_transport_api.h | 177 +-
drivers/staging/ath6kl/include/hif.h | 287 +-
drivers/staging/ath6kl/include/host_version.h | 4 +-
drivers/staging/ath6kl/include/htc_api.h | 449 +-
drivers/staging/ath6kl/include/htc_packet.h | 278 +-
drivers/staging/ath6kl/include/target_reg_table.h | 256 +-
drivers/staging/ath6kl/include/wlan_api.h | 103 +-
drivers/staging/ath6kl/include/wmi_api.h | 547 +-
drivers/staging/ath6kl/miscdrv/ar3kconfig.c | 971 +-
.../staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c | 805 +-
.../staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.h | 15 +-
.../staging/ath6kl/miscdrv/ar3kps/ar3kpsparser.c | 1504 ++--
.../staging/ath6kl/miscdrv/ar3kps/ar3kpsparser.h | 52 +-
drivers/staging/ath6kl/miscdrv/common_drv.c | 1479 ++--
drivers/staging/ath6kl/miscdrv/credit_dist.c | 599 +-
drivers/staging/ath6kl/miscdrv/miscdrv.h | 12 +-
drivers/staging/ath6kl/os/linux/ar6000_android.c | 559 +-
drivers/staging/ath6kl/os/linux/ar6000_drv.c | 9670 ++++++++++----------
drivers/staging/ath6kl/os/linux/ar6000_pm.c | 1077 ++--
drivers/staging/ath6kl/os/linux/ar6000_raw_if.c | 755 +-
drivers/staging/ath6kl/os/linux/ar6k_pal.c | 180 +-
drivers/staging/ath6kl/os/linux/cfg80211.c | 2389 +++---
drivers/staging/ath6kl/os/linux/eeprom.c | 640 +-
.../staging/ath6kl/os/linux/export_hci_transport.c | 96 +-
drivers/staging/ath6kl/os/linux/hci_bridge.c | 1597 ++--
.../staging/ath6kl/os/linux/include/ar6000_drv.h | 644 +-
drivers/staging/ath6kl/os/linux/include/ar6k_pal.h | 8 +-
.../ath6kl/os/linux/include/ar6xapi_linux.h | 172 +-
.../staging/ath6kl/os/linux/include/athdrv_linux.h | 299 +-
.../ath6kl/os/linux/include/athtypes_linux.h | 4 +-
drivers/staging/ath6kl/os/linux/include/cfg80211.h | 28 +-
.../staging/ath6kl/os/linux/include/config_linux.h | 2 +-
.../staging/ath6kl/os/linux/include/debug_linux.h | 53 +-
.../ath6kl/os/linux/include/export_hci_transport.h | 50 +-
.../ath6kl/os/linux/include/ieee80211_ioctl.h | 110 +-
.../staging/ath6kl/os/linux/include/osapi_linux.h | 243 +-
.../staging/ath6kl/os/linux/include/wlan_config.h | 20 +-
.../ath6kl/os/linux/include/wmi_filter_linux.h | 12 +-
drivers/staging/ath6kl/os/linux/ioctl.c | 7781 ++++++++---------
drivers/staging/ath6kl/os/linux/netbuf.c | 140 +-
drivers/staging/ath6kl/os/linux/wireless_ext.c | 4302 +++++-----
drivers/staging/ath6kl/reorder/aggr_rx_internal.h | 82 +-
drivers/staging/ath6kl/reorder/rcv_aggr.c | 1012 +--
drivers/staging/ath6kl/wlan/include/ieee80211.h | 219 +-
.../staging/ath6kl/wlan/include/ieee80211_node.h | 43 +-
drivers/staging/ath6kl/wlan/src/wlan_node.c | 833 +-
drivers/staging/ath6kl/wlan/src/wlan_recv_beacon.c | 253 +-
drivers/staging/ath6kl/wlan/src/wlan_utils.c | 41 +-
drivers/staging/ath6kl/wmi/wmi.c | 9408 +++++++++----------
drivers/staging/ath6kl/wmi/wmi_host.h | 66 +-
152 files changed, 37473 insertions(+), 38938 deletions(-)
^ permalink raw reply
* [PATCH] rtl8192ce: Fix build on powerpc
From: Larry Finger @ 2010-12-16 4:55 UTC (permalink / raw)
To: John W Linville; +Cc: sfr, linux-wireless
After merge of the rtl8192ce driver, a powerpc build fails with:
drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192c-sw.c: In function 'rtl92c_init_sw_vars':
drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192c-sw.c:76: error: implicit declaration of function 'vmalloc'
drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192c-sw.c:76: warning: cast to pointer from integer of different size
drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192c-sw.c: In function 'rtl92c_deinit_sw_vars':
drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192c-sw.c:91: error: implicit declaration of function 'vfree'
The problem is fixed by explicitly including the appropriate header.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
John,
Sorry about this. Too bad the implicit headers are not the same on all platforms.
Larry
---
Index: wireless-testing/drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192c-sw.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192c-sw.c
+++ wireless-testing/drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192c-sw.c
@@ -27,6 +27,8 @@
*
*****************************************************************************/
+#include <linux/vmalloc.h>
+
#include "../wifi.h"
#include "../core.h"
#include "../pci.h"
^ permalink raw reply
* Re: iwl rfkill suddenly dropped to hard block
From: Larry Finger @ 2010-12-16 4:23 UTC (permalink / raw)
To: Evgeniy Polyakov
Cc: John W. Linville, Intel Linux Wireless, netdev, linux-wireless,
wey-yi.w.guy
In-Reply-To: <20101216032247.GA7345@ioremap.net>
On 12/15/2010 09:22 PM, Evgeniy Polyakov wrote:
> On Wed, Dec 15, 2010 at 03:11:27PM -0500, John W. Linville (linville@tuxdriver.com) wrote:
>> Cc'ing linux-wireless and Wey-Yi...
>>
>> To be honest, nearly every report of "suddenly my rfkill is stuck
>> on" is because the laptop has multiple rfkill keys, usually with
>> one of them a slider along the edge of the case. In particular,
>> Thinkpads have such switches. The slider gets accidently engaged
>> (possibly while the laptop is being transported or somesuch) and
>> suddenly wireless stops working.
>>
>> Please check for the above. If you are sure that isn't the case, then
>> please try to determine the last working kernel and do a bisection --
>> hopefully you don't have to go all the way back to 2.6.33!
>
> I'm pretty sure it would be that simple if there was such a slider.
>
> There is no way I can bisect this problem since, first, i915 does not
> work anywhere after 2.6.34 upto current git tree, and second, because
> wifi perfectly well worked two days ago with this kernel, and now there
> are no good and bad kernels, only bad ones.
>
> Turning on dell_wmi brings 2 more rfkill classes, which are both
> hard and soft blocked. Both can not be unblocked (even soft unblock),
> although reported case can be soft unblocked (hard block status
> obviously does not change). Actually by default it is soft unblocked,
> other two (another wifi switch and bluetooth) are both hard and soft
> blocked.
>
> I would imagine this is just related to some dellish crap, but I saw a
> number of exactly the same cases in the web including linux-kernel mail
> lists in the past and also without 'slider on the back' case.
I doubt that it is Dell related, if that is what "dellish" means.
I have had some success in clearing this problem by unloading and reloading the
wireless driver. I had the problem on one box that has no rfkill switch and an
802.11b card that uses b43legacy.
Larry
^ permalink raw reply
* [PATCH 2/2] ath: fix NULL pointer dereference on reg_notifier()
From: Luis R. Rodriguez @ 2010-12-16 3:24 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, Luis R. Rodriguez
In-Reply-To: <1292469852-2987-1-git-send-email-lrodriguez@atheros.com>
The reg_notifier() was recently updated as being capable of
having the request passed as NULL, fix ath to follow this API
change. Without this we end up oopsing:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000004
IP: [<ffffffffa02fb8cb>] ath_reg_notifier_apply+0x5b/0xa0 [ath]
PGD b4c4c067 PUD b4c4d067 PMD 0
Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
last sysfs file: /sys/devices/pci0000:00/0000:00:1b.0/uevent
CPU 1
Modules linked in: <etc>
Pid: 436, comm: modprobe Not tainted 2.6.37-rc5-wl+ #36 6460DWU/6460DWU
RIP: 0010:[<ffffffffa02fb8cb>] [<ffffffffa02fb8cb>] ath_reg_notifier_apply+0x5b/0xa0 [ath]
RSP: 0018:ffff8800b6f6baa8 EFLAGS: 00010246
RAX: ffff8800b527b254 RBX: ffff8800b532c180 RCX: 0000000000000018
RDX: ffff8800b530c108 RSI: 0000000000000000 RDI: ffff8800b532c180
RBP: ffff8800b6f6baa8 R08: ffff8800b532f268 R09: 0000000000000235
R10: 00000000000016ad R11: 0000000000000018 R12: 0000000000000000
R13: 0000000000000016 R14: ffff8800b532f268 R15: 0000000000000011
FS: 00007f0c53104700(0000) GS:ffff8800bed00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000004 CR3: 00000000b6531000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process modprobe (pid: 436, threadinfo ffff8800b6f6a000, task ffff8800b404dc40)
Stack:
ffff8800b6f6bac8 ffffffffa03ea651 ffff8800b532c180 ffff8800b527b254
ffff8800b6f6bb38 ffffffffa01835ca ffffffffa019ed00 00000000a019ed80
0000000000000002 ffff880000000002 ffffffffa0366140 0000000010aee572
Call Trace:
[<ffffffffa03ea651>] ath9k_reg_notifier+0x41/0x50 [ath9k]
[<ffffffffa01835ca>] wiphy_update_regulatory+0x4ba/0x5a0 [cfg80211]
[<ffffffffa0366140>] ? ieee80211_register_hw+0xa0/0x5b0 [mac80211]
[<ffffffffa0366140>] ? ieee80211_register_hw+0xa0/0x5b0 [mac80211]
[<ffffffffa017f994>] wiphy_register+0x1d4/0x360 [cfg80211]
[<ffffffff8114b918>] ? __kmalloc+0x108/0x1c0
[<ffffffffa0366223>] ieee80211_register_hw+0x183/0x5b0 [mac80211]
[<ffffffffa03eb49b>] ath9k_init_device+0x66b/0x850 [ath9k]
[<ffffffffa03f9dd6>] ath_pci_probe+0x2f6/0x3c0 [ath9k]
[<ffffffff81037529>] ? default_spin_lock_flags+0x9/0x10
[<ffffffff812e19cf>] local_pci_probe+0x5f/0xd0
[<ffffffff812e2bf1>] pci_device_probe+0x101/0x120
[<ffffffff81390aca>] ? driver_sysfs_add+0x7a/0xb0
[<ffffffff81390c26>] driver_probe_device+0x96/0x1c0
[<ffffffff81390deb>] __driver_attach+0x9b/0xa0
[<ffffffff81390d50>] ? __driver_attach+0x0/0xa0
[<ffffffff81390008>] bus_for_each_dev+0x68/0x90
[<ffffffff81390a4e>] driver_attach+0x1e/0x20
[<ffffffff81390309>] bus_add_driver+0xe9/0x290
[<ffffffffa0407000>] ? ath9k_init+0x0/0x4d [ath9k]
[<ffffffff81391130>] driver_register+0x80/0x150
[<ffffffffa0407000>] ? ath9k_init+0x0/0x4d [ath9k]
[<ffffffffa0407000>] ? ath9k_init+0x0/0x4d [ath9k]
[<ffffffff812e2e76>] __pci_register_driver+0x56/0xd0
[<ffffffffa03f9ec3>] ath_pci_init+0x23/0x30 [ath9k]
[<ffffffffa040702b>] ath9k_init+0x2b/0x4d [ath9k]
[<ffffffff81002053>] do_one_initcall+0x43/0x190
[<ffffffff8109fb5b>] sys_init_module+0xbb/0x200
[<ffffffff8100c042>] system_call_fastpath+0x16/0x1b
Code: <who even reads this anyway? haha, ok you do>
RIP [<ffffffffa02fb8cb>] ath_reg_notifier_apply+0x5b/0xa0 [ath]
RSP <ffff8800b6f6baa8>
CR2: 0000000000000004
---[ end trace 6d03d3c7eda9f06b ]---
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
drivers/net/wireless/ath/regd.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index 3f4244f..2b14775 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -342,6 +342,14 @@ int ath_reg_notifier_apply(struct wiphy *wiphy,
/* We always apply this */
ath_reg_apply_radar_flags(wiphy);
+ /*
+ * This would happen when we have sent a custom regulatory request
+ * a world regulatory domain and the scheduler hasn't yet processed
+ * any pending requests in the queue.
+ */
+ if (!request)
+ return 0;
+
switch (request->initiator) {
case NL80211_REGDOM_SET_BY_DRIVER:
case NL80211_REGDOM_SET_BY_CORE:
--
1.7.3.2.90.gd4c43
^ permalink raw reply related
* [PATCH 1/2] cfg80211: fix null pointer dereference with a custom regulatory request
From: Luis R. Rodriguez @ 2010-12-16 3:24 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, Luis R. Rodriguez
In-Reply-To: <1292469852-2987-1-git-send-email-lrodriguez@atheros.com>
Once we moved the core regulatory request to the queue and let
the scheduler process it last_request will have been left NULL
until the schedular decides to process the first request. When
this happens and we are loading a driver with a custom regulatory
request like all Atheros drivers we end up with a NULL pointer
dereference. We fix this by checking if the request was a
custom one.
BUG: unable to handle kernel NULL pointer dereference at 0000000000000004
IP: [<ffffffffa016de87>] freq_reg_info_regd.clone.2+0x27/0x130 [cfg80211]
PGD 71f91067 PUD 712b2067 PMD 0
Oops: 0000 [#1] PREEMPT SMP
last sysfs file: /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/firmware/2-1/loading
CPU 0
Modules linked in: ath9k_htc(+) ath9k_common ath9k_hw ath <etc>
Pid: 3094, comm: insmod Tainted: G W 2.6.37-rc5-wl #16 INVALID/28427ZQ
RIP: 0010:[<ffffffffa016de87>] [<ffffffffa016de87>] freq_reg_info_regd.clone.2+0x27/0x130 [cfg80211]
RSP: 0018:ffff88007045db78 EFLAGS: 00010282
RAX: 0000000000000000 RBX: ffffffffa047d9a0 RCX: ffff88007045dbd0
RDX: 0000000000004e20 RSI: 000000000024cde0 RDI: ffff8800700483e0
RBP: ffff88007045db98 R08: ffffffffa02f5b40 R09: 0000000000000001
R10: 000000000000000e R11: 0000000000000001 R12: 0000000000000000
R13: ffff88007004e3b0 R14: 0000000000000000 R15: ffff880070048340
FS: 00007f635a707700(0000) GS:ffff880077400000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000004 CR3: 00000000708a9000 CR4: 00000000000006f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process insmod (pid: 3094, threadinfo ffff88007045c000, task ffff8800713e3ec0)
Stack:
ffffffffa047d9a0 0000000000000000 ffff88007004e3b0 0000000000000000
ffff88007045dc08 ffffffffa016e147 000000007045dc08 0000000000000002
ffff8800700483e0 ffffffffa02f5b40 ffff88007045dbd8 0000000000000000
Call Trace:
[<ffffffffa016e147>] wiphy_apply_custom_regulatory+0x137/0x1d0 [cfg80211]
[<ffffffffa047a690>] ? ath9k_reg_notifier+0x0/0x50 [ath9k_htc]
[<ffffffffa02f47f7>] ath_regd_init+0x347/0x430 [ath]
[<ffffffffa047b1f5>] ath9k_htc_probe_device+0x6c5/0x960 [ath9k_htc]
[<ffffffffa0472a2c>] ath9k_htc_hw_init+0xc/0x30 [ath9k_htc]
[<ffffffffa04747e6>] ath9k_hif_usb_probe+0x216/0x3b0 [ath9k_htc]
[<ffffffffa03bb6bc>] usb_probe_interface+0x10c/0x210 [usbcore]
[<ffffffff812aec26>] driver_probe_device+0x96/0x1c0
[<ffffffff812aedf3>] __driver_attach+0xa3/0xb0
[<ffffffff812aed50>] ? __driver_attach+0x0/0xb0
[<ffffffff812adaae>] bus_for_each_dev+0x5e/0x90
[<ffffffff812ae8c9>] driver_attach+0x19/0x20
[<ffffffff812ae438>] bus_add_driver+0x168/0x320
[<ffffffff812af071>] driver_register+0x71/0x140
[<ffffffff811fc4a8>] ? __raw_spin_lock_init+0x38/0x70
[<ffffffffa03ba39c>] usb_register_driver+0xdc/0x190 [usbcore]
[<ffffffffa03a2000>] ? ath9k_htc_init+0x0/0x4f [ath9k_htc]
[<ffffffffa047499e>] ath9k_hif_usb_init+0x1e/0x20 [ath9k_htc]
[<ffffffffa03a202b>] ath9k_htc_init+0x2b/0x4f [ath9k_htc]
[<ffffffff8100212f>] do_one_initcall+0x3f/0x180
[<ffffffff8109ef5b>] sys_init_module+0xbb/0x200
[<ffffffff8100bf52>] system_call_fastpath+0x16/0x1b
Code: <etc, who cares>
RIP [<ffffffffa016de87>] freq_reg_info_regd.clone.2+0x27/0x130 [cfg80211]
RSP <ffff88007045db78>
CR2: 0000000000000004
---[ end trace 79e4193601c8b713 ]---
Reported-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
include/net/cfg80211.h | 4 +++-
net/wireless/reg.c | 3 ++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 22be7c6..ef82664 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1419,7 +1419,9 @@ struct ieee80211_txrx_stypes {
/**
* struct wiphy - wireless hardware description
- * @reg_notifier: the driver's regulatory notification callback
+ * @reg_notifier: the driver's regulatory notification callback,
+ * note that if your driver uses wiphy_apply_custom_regulatory()
+ * the reg_notifier's request can be passed as NULL
* @regd: the driver's regulatory domain, if one was requested via
* the regulatory_hint() API. This can be used by the driver
* on the reg_notifier() if it chooses to ignore future
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 5ed615f..99d4183 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -661,7 +661,8 @@ static int freq_reg_info_regd(struct wiphy *wiphy,
* Follow the driver's regulatory domain, if present, unless a country
* IE has been processed or a user wants to help complaince further
*/
- if (last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE &&
+ if (!custom_regd &&
+ last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE &&
last_request->initiator != NL80211_REGDOM_SET_BY_USER &&
wiphy->regd)
regd = wiphy->regd;
--
1.7.3.2.90.gd4c43
^ permalink raw reply related
* [PATCH 0/2] cfg80211/ath: custom regulatory bug fixes
From: Luis R. Rodriguez @ 2010-12-16 3:24 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, Luis R. Rodriguez
Here are a couple of fixes for the recent change we did where we
moved the core regulatory hint to the queue. In a really slow box
or if you are doing crazy testing this can potentilly occur. I take
it the patch "cfg80211: put core regulatory request into queue"
will note make it in until 2.6.38, so these are not a stable fixes.
I was able to force the condition by doing:
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 99d4183..e6f483d0 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1481,7 +1481,7 @@ static void reg_process_pending_hints(void)
spin_unlock(®_requests_lock);
- reg_process_hint(reg_request);
+ //reg_process_hint(reg_request);
out:
mutex_unlock(®_mutex);
This mimics the situation of either having a slow box or you
doing some crazy module load/unload testing.
Luis R. Rodriguez (2):
cfg80211: fix null pointer dereference with a custom regulatory
request
ath: fix NULL pointer dereference on reg_notifier()
drivers/net/wireless/ath/regd.c | 8 ++++++++
include/net/cfg80211.h | 4 +++-
net/wireless/reg.c | 3 ++-
3 files changed, 13 insertions(+), 2 deletions(-)
--
1.7.3.2.90.gd4c43
^ permalink raw reply related
* Re: iwl rfkill suddenly dropped to hard block
From: Evgeniy Polyakov @ 2010-12-16 3:22 UTC (permalink / raw)
To: John W. Linville
Cc: Intel Linux Wireless, netdev, linux-wireless, wey-yi.w.guy
In-Reply-To: <20101215201126.GG2377@tuxdriver.com>
On Wed, Dec 15, 2010 at 03:11:27PM -0500, John W. Linville (linville@tuxdriver.com) wrote:
> Cc'ing linux-wireless and Wey-Yi...
>
> To be honest, nearly every report of "suddenly my rfkill is stuck
> on" is because the laptop has multiple rfkill keys, usually with
> one of them a slider along the edge of the case. In particular,
> Thinkpads have such switches. The slider gets accidently engaged
> (possibly while the laptop is being transported or somesuch) and
> suddenly wireless stops working.
>
> Please check for the above. If you are sure that isn't the case, then
> please try to determine the last working kernel and do a bisection --
> hopefully you don't have to go all the way back to 2.6.33!
I'm pretty sure it would be that simple if there was such a slider.
There is no way I can bisect this problem since, first, i915 does not
work anywhere after 2.6.34 upto current git tree, and second, because
wifi perfectly well worked two days ago with this kernel, and now there
are no good and bad kernels, only bad ones.
Turning on dell_wmi brings 2 more rfkill classes, which are both
hard and soft blocked. Both can not be unblocked (even soft unblock),
although reported case can be soft unblocked (hard block status
obviously does not change). Actually by default it is soft unblocked,
other two (another wifi switch and bluetooth) are both hard and soft
blocked.
I would imagine this is just related to some dellish crap, but I saw a
number of exactly the same cases in the web including linux-kernel mail
lists in the past and also without 'slider on the back' case.
--
Evgeniy Polyakov
^ permalink raw reply
* [PATCH 3/3] ath5k: Set available antenna information for cfg80211
From: Bruno Randolf @ 2010-12-16 2:30 UTC (permalink / raw)
To: johannes, linville; +Cc: dhalperi, linux-wireless
In-Reply-To: <20101216023022.24356.22416.stgit@localhost6.localdomain6>
Signed-off-by: Bruno Randolf <br1@einfach.org>
---
v3: rebased and updated for separate RX and TX availability
v2: rebased
---
drivers/net/wireless/ath/ath5k/base.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 4e3b97c..3c65fef 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2351,6 +2351,10 @@ ath5k_init_softc(struct ath5k_softc *sc, const struct ath_bus_ops *bus_ops)
BIT(NL80211_IFTYPE_ADHOC) |
BIT(NL80211_IFTYPE_MESH_POINT);
+ /* both antennas can be configured as RX or TX */
+ hw->wiphy->available_antennas_tx = 0x3;
+ hw->wiphy->available_antennas_rx = 0x3;
+
hw->extra_tx_headroom = 2;
hw->channel_change_time = 5000;
^ permalink raw reply related
* [PATCH 2/3] nl80211: Export available antennas
From: Bruno Randolf @ 2010-12-16 2:30 UTC (permalink / raw)
To: johannes, linville; +Cc: dhalperi, linux-wireless
In-Reply-To: <20101216023022.24356.22416.stgit@localhost6.localdomain6>
Export the information which antennas are available for configuration as TX or
RX antennas via nl80211.
Signed-off-by: Bruno Randolf <br1@einfach.org>
---
v3: rebased and updated for separate RX and TX availablility
v2: rebased
---
include/linux/nl80211.h | 9 +++++++++
net/wireless/nl80211.c | 5 +++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 1cee56b..a6e1ec5 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -844,6 +844,12 @@ enum nl80211_commands {
* the hardware should not be configured to receive on this antenna.
* For a more detailed descripton see @NL80211_ATTR_WIPHY_ANTENNA_TX.
*
+ * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX: Bitmap of antennas which are available
+ * for configuration as TX antennas via the above parameters.
+ *
+ * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX: Bitmap of antennas which are available
+ * for configuration as RX antennas via the above parameters.
+ *
* @NL80211_ATTR_MCAST_RATE: Multicast tx rate (in 100 kbps) for IBSS
*
* @NL80211_ATTR_OFFCHANNEL_TX_OK: For management frame TX, the frame may be
@@ -1040,6 +1046,9 @@ enum nl80211_attrs {
NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION,
+ NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX,
+ NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 087397b..ad3ca7d 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -605,6 +605,11 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags,
if (dev->wiphy.flags & WIPHY_FLAG_CONTROL_PORT_PROTOCOL)
NLA_PUT_FLAG(msg, NL80211_ATTR_CONTROL_PORT_ETHERTYPE);
+ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX,
+ dev->wiphy.available_antennas_tx);
+ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX,
+ dev->wiphy.available_antennas_rx);
+
if ((dev->wiphy.available_antennas_tx ||
dev->wiphy.available_antennas_rx) && dev->ops->get_antenna) {
u32 tx_ant = 0, rx_ant = 0;
^ permalink raw reply related
* [PATCH 1/3] cfg80211: Separate available antennas for RX and TX
From: Bruno Randolf @ 2010-12-16 2:30 UTC (permalink / raw)
To: johannes, linville; +Cc: dhalperi, linux-wireless
As has been pointed out by Daniel Halperin some devices (e.g. Intel IWL5100)
can only TX from a subset of RX antennas, so use separate availability masks
for RX and TX.
Signed-off-by: Bruno Randolf <br1@einfach.org>
---
include/net/cfg80211.h | 12 +++++++++---
net/wireless/nl80211.c | 17 ++++++++++-------
2 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index f45e15f..4d410f3 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1472,8 +1472,13 @@ struct ieee80211_txrx_stypes {
* transmitted through nl80211, points to an array indexed by interface
* type
*
- * @available_antennas: bitmap of antennas which are available to configure.
- * antenna configuration commands will be rejected unless this is set.
+ * @available_antennas_tx: bitmap of antennas which are available to be
+ * configured as TX antennas. Antenna configuration commands will be
+ * rejected unless this or @available_antennas_rx is set.
+ *
+ * @available_antennas_rx: bitmap of antennas which are available to be
+ * configured as RX antennas. Antenna configuration commands will be
+ * rejected unless this or @available_antennas_tx is set.
*
* @max_remain_on_channel_duration: Maximum time a remain-on-channel operation
* may request, if implemented.
@@ -1518,7 +1523,8 @@ struct wiphy {
u8 max_num_pmkids;
- u32 available_antennas;
+ u32 available_antennas_tx;
+ u32 available_antennas_rx;
/* If multiple wiphys are registered and you're handed e.g.
* a regular netdev with assigned ieee80211_ptr, you won't
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 594a6ac..087397b 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -605,7 +605,8 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags,
if (dev->wiphy.flags & WIPHY_FLAG_CONTROL_PORT_PROTOCOL)
NLA_PUT_FLAG(msg, NL80211_ATTR_CONTROL_PORT_ETHERTYPE);
- if (dev->wiphy.available_antennas && dev->ops->get_antenna) {
+ if ((dev->wiphy.available_antennas_tx ||
+ dev->wiphy.available_antennas_rx) && dev->ops->get_antenna) {
u32 tx_ant = 0, rx_ant = 0;
int res;
res = dev->ops->get_antenna(&dev->wiphy, &tx_ant, &rx_ant);
@@ -1107,7 +1108,9 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
if (info->attrs[NL80211_ATTR_WIPHY_ANTENNA_TX] &&
info->attrs[NL80211_ATTR_WIPHY_ANTENNA_RX]) {
u32 tx_ant, rx_ant;
- if (!rdev->wiphy.available_antennas || !rdev->ops->set_antenna) {
+ if ((!rdev->wiphy.available_antennas_tx &&
+ !rdev->wiphy.available_antennas_rx) ||
+ !rdev->ops->set_antenna) {
result = -EOPNOTSUPP;
goto bad_res;
}
@@ -1116,15 +1119,15 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
rx_ant = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_ANTENNA_RX]);
/* reject antenna configurations which don't match the
- * available antenna mask, except for the "all" mask */
- if ((~tx_ant && (tx_ant & ~rdev->wiphy.available_antennas)) ||
- (~rx_ant && (rx_ant & ~rdev->wiphy.available_antennas))) {
+ * available antenna masks, except for the "all" mask */
+ if ((~tx_ant && (tx_ant & ~rdev->wiphy.available_antennas_tx)) ||
+ (~rx_ant && (rx_ant & ~rdev->wiphy.available_antennas_rx))) {
result = -EINVAL;
goto bad_res;
}
- tx_ant = tx_ant & rdev->wiphy.available_antennas;
- rx_ant = rx_ant & rdev->wiphy.available_antennas;
+ tx_ant = tx_ant & rdev->wiphy.available_antennas_tx;
+ rx_ant = rx_ant & rdev->wiphy.available_antennas_rx;
result = rdev->ops->set_antenna(&rdev->wiphy, tx_ant, rx_ant);
if (result)
^ permalink raw reply related
* Re: [PATCH] staging: ath6kl: Fixing device NULL pointer dereference
From: Vipin Mehta @ 2010-12-16 1:15 UTC (permalink / raw)
To: Luis R. Rodriguez
Cc: Vipin Mehta, greg@kroah.com, linux-wireless@vger.kernel.org,
devel@driverdev.osuosl.org
In-Reply-To: <AANLkTin_fw6aRc5Rs1_BTcapTE9kgPHy7_Gex9wRtkWy@mail.gmail.com>
On Tue, Dec 14, 2010 at 08:15:24PM -0800, Luis R. Rodriguez wrote:
> On Tue, Dec 14, 2010 at 5:17 PM, Vipin Mehta <vmehta@atheros.com> wrote:
> > Fixing the device instance being passed to set_wiphy_dev() from
> > NULL to the one being returned by the MMC stack probe callback.
> >
> > Signed-off-by: Vipin Mehta <vmehta@atheros.com>
> > ---
> > drivers/staging/ath6kl/os/linux/ar6000_drv.c | 19 ++++++++++++-------
> > 1 files changed, 12 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/staging/ath6kl/os/linux/ar6000_drv.c b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
> > index a659f70..9f3e928 100644
> > --- a/drivers/staging/ath6kl/os/linux/ar6000_drv.c
> > +++ b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
> > @@ -1608,6 +1608,15 @@ ar6000_avail_ev(void *context, void *hif_handle)
> > struct wireless_dev *wdev;
> > #endif /* ATH6K_CONFIG_CFG80211 */
> > A_STATUS init_status = A_OK;
> > + HIF_DEVICE_OS_DEVICE_INFO osDevInfo;
> > +
> > + A_MEMZERO(&osDevInfo, sizeof(osDevInfo));
> > + if ( A_FAILED( HIFConfigureDevice(hif_handle, HIF_DEVICE_GET_OS_DEVICE,
> > + &osDevInfo, sizeof(osDevInfo))) )
>
> while you are adding new code, why not use the direct Linux calls?
I'll change the use of A_MEMZERO(), A_FAILED() macros and A_STATUS
data type given that we have an incoming patch that cleans the rest
of the code for similar usage. Changing the use of HIFConfigureDevice()
will be more useful if we do it across the driver since it will require
significant changes in the data structures defined in the HIF layer.
It qualifies for an entirely separate patch and can be done later in a
systematic way.
^ permalink raw reply
* [PATCH 4/4] mwifiex: convert uses of __attribute__ ((packed)) to __packed
From: Bing Zhao @ 2010-12-16 0:57 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
Frank Huang, Bing Zhao
In-Reply-To: <1292461079-26318-1-git-send-email-bzhao@marvell.com>
From: Kiran Divekar <dkiran@marvell.com>
Signed-off-by: Kiran Divekar <dkiran@marvell.com>
---
drivers/net/wireless/mwifiex/decl.h | 8 +-
drivers/net/wireless/mwifiex/fw.h | 180 +++++++++++++++++-----------------
drivers/net/wireless/mwifiex/ieee.h | 50 +++++-----
3 files changed, 119 insertions(+), 119 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/decl.h b/drivers/net/wireless/mwifiex/decl.h
index 155c071..95d9642 100644
--- a/drivers/net/wireless/mwifiex/decl.h
+++ b/drivers/net/wireless/mwifiex/decl.h
@@ -224,21 +224,21 @@ enum mwifiex_cmd_result_e {
MWIFIEX_CMD_RESULT_FAILURE = 1,
MWIFIEX_CMD_RESULT_TIMEOUT = 2,
MWIFIEX_CMD_RESULT_INVALID_DATA = 3
-} __attribute__ ((packed));
+} __packed;
enum mwifiex_wmm_ac_e {
WMM_AC_BK,
WMM_AC_BE,
WMM_AC_VI,
WMM_AC_VO
-} __attribute__ ((packed));
+} __packed;
enum mwifiex_wmm_queue_config_action_e {
MWIFIEX_WMM_QUEUE_CONFIG_ACTION_GET = 0,
MWIFIEX_WMM_QUEUE_CONFIG_ACTION_SET = 1,
MWIFIEX_WMM_QUEUE_CONFIG_ACTION_DEFAULT = 2,
MWIFIEX_WMM_QUEUE_CONFIG_ACTION_MAX
-} __attribute__ ((packed));
+} __packed;
enum mwifiex_wmm_queue_stats_action_e {
MWIFIEX_WMM_STATS_ACTION_START = 0,
@@ -247,7 +247,7 @@ enum mwifiex_wmm_queue_stats_action_e {
MWIFIEX_WMM_STATS_ACTION_SET_CFG = 3, /* Not currently used */
MWIFIEX_WMM_STATS_ACTION_GET_CFG = 4, /* Not currently used */
MWIFIEX_WMM_STATS_ACTION_MAX
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_device {
struct mwifiex_bss_attr bss_attr[MWIFIEX_MAX_BSS_NUM];
diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h
index 16cdb85..834122c 100644
--- a/drivers/net/wireless/mwifiex/fw.h
+++ b/drivers/net/wireless/mwifiex/fw.h
@@ -481,12 +481,12 @@ struct mwifiex_802_11_fixed_ies {
struct mwifiex_ie_types_header {
__le16 type;
__le16 len;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_ie_types_data {
struct mwifiex_ie_types_header header;
u8 data[1];
-} __attribute__ ((packed));
+} __packed;
#define MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET 0x01
#define MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET 0x08
@@ -502,7 +502,7 @@ struct txpd {
u8 flags;
u8 pkt_delay_2ms;
u8 reserved1;
-} __attribute__ ((packed));
+} __packed;
struct rxpd {
u8 bss_type;
@@ -520,7 +520,7 @@ struct rxpd {
* [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
u8 ht_info;
u8 reserved;
-} __attribute__ ((packed));
+} __packed;
enum mwifiex_chan_scan_mode_bitmasks {
MWIFIEX_PASSIVE_SCAN = BIT(0),
@@ -535,12 +535,12 @@ struct mwifiex_chan_scan_param_set {
u8 chan_scan_mode_bitmap;
__le16 min_scan_time;
__le16 max_scan_time;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_ie_types_chan_list_param_set {
struct mwifiex_ie_types_header header;
struct mwifiex_chan_scan_param_set chan_scan_param[1];
-} __attribute__ ((packed));
+} __packed;
struct chan_band_param_set {
u8 radio_type;
@@ -550,45 +550,45 @@ struct chan_band_param_set {
struct mwifiex_ie_types_chan_band_list_param_set {
struct mwifiex_ie_types_header header;
struct chan_band_param_set chan_band_param[1];
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_ie_types_rates_param_set {
struct mwifiex_ie_types_header header;
u8 rates[1];
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_ie_types_ssid_param_set {
struct mwifiex_ie_types_header header;
u8 ssid[1];
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_ie_types_num_probes {
struct mwifiex_ie_types_header header;
__le16 num_probes;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_ie_types_wildcard_ssid_params {
struct mwifiex_ie_types_header header;
u8 max_ssid_length;
u8 ssid[1];
-} __attribute__ ((packed));
+} __packed;
#define TSF_DATA_SIZE 8
struct mwifiex_ie_types_tsf_timestamp {
struct mwifiex_ie_types_header header;
u8 tsf_data[1];
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_cf_param_set {
u8 cfp_cnt;
u8 cfp_period;
u16 cfp_max_duration;
u16 cfp_duration_remaining;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_ibss_param_set {
u16 atim_window;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_ie_types_ss_param_set {
struct mwifiex_ie_types_header header;
@@ -596,18 +596,18 @@ struct mwifiex_ie_types_ss_param_set {
struct mwifiex_cf_param_set cf_param_set[1];
struct mwifiex_ibss_param_set ibss_param_set[1];
} cf_ibss;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_fh_param_set {
u16 dwell_time;
u8 hop_set;
u8 hop_pattern;
u8 hop_index;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_ds_param_set {
u8 current_chan;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_ie_types_phy_param_set {
struct mwifiex_ie_types_header header;
@@ -615,12 +615,12 @@ struct mwifiex_ie_types_phy_param_set {
struct mwifiex_fh_param_set fh_param_set[1];
struct mwifiex_ds_param_set ds_param_set[1];
} fh_ds;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_ie_types_auth_type {
struct mwifiex_ie_types_header header;
__le16 auth_type;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_ie_types_vendor_param_set {
struct mwifiex_ie_types_header header;
@@ -630,7 +630,7 @@ struct mwifiex_ie_types_vendor_param_set {
struct mwifiex_ie_types_rsn_param_set {
struct mwifiex_ie_types_header header;
u8 rsn_ie[1];
-} __attribute__ ((packed));
+} __packed;
#define KEYPARAMSET_FIXED_LEN 6
@@ -641,12 +641,12 @@ struct mwifiex_ie_type_key_param_set {
__le16 key_info;
__le16 key_len;
u8 key[50];
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_802_11_key_material {
__le16 action;
struct mwifiex_ie_type_key_param_set key_param_set;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_gen {
u16 command;
@@ -660,7 +660,7 @@ struct host_cmd_ds_gen {
struct host_cmd_ds_802_11_sleep_period {
__le16 action;
__le16 sleep_pd;
-} __attribute__ ((packed));
+} __packed;
enum sleep_resp_ctrl {
RESP_NOT_NEEDED = 0,
@@ -705,12 +705,12 @@ struct auto_ps_param {
struct mwifiex_ie_types_auto_ds_param {
struct mwifiex_ie_types_header header;
struct mwifiex_auto_ds_param param;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_ie_types_ps_param {
struct mwifiex_ie_types_header header;
struct mwifiex_ps_param param;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_802_11_ps_mode_enh {
__le16 action;
@@ -722,7 +722,7 @@ struct host_cmd_ds_802_11_ps_mode_enh {
__le16 ps_bitmap;
struct auto_ps_param auto_ps;
} params;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_get_hw_spec {
__le16 hw_if_version;
@@ -741,7 +741,7 @@ struct host_cmd_ds_get_hw_spec {
u8 dev_mcs_support;
__le16 mp_end_port; /* SDIO only, reserved for other interfacces */
__le16 reserved_4;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_802_11_rssi_info {
__le16 action;
@@ -781,12 +781,12 @@ struct host_cmd_ds_mac_multicast_adr {
__le16 num_of_adrs;
u8 mac_list[MWIFIEX_MAC_ADDR_LENGTH *
MWIFIEX_MAX_MULTICAST_LIST_SIZE];
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_802_11_deauthenticate {
u8 mac_addr[MWIFIEX_MAC_ADDR_LENGTH];
__le16 reason_code;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_802_11_associate {
u8 peer_sta_addr[MWIFIEX_MAC_ADDR_LENGTH];
@@ -794,11 +794,11 @@ struct host_cmd_ds_802_11_associate {
__le16 listen_interval;
__le16 beacon_period;
u8 dtim_period;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_802_11_associate_rsp {
struct ieee_types_assoc_rsp assoc_rsp;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_802_11_ad_hoc_start {
u8 ssid[IW_ESSID_MAX_SIZE];
@@ -810,12 +810,12 @@ struct host_cmd_ds_802_11_ad_hoc_start {
u16 reserved1;
__le16 cap_info_bitmap;
u8 DataRate[HOSTCMD_SUPPORTED_RATES];
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_802_11_ad_hoc_result {
u8 pad[3];
u8 bssid[MWIFIEX_MAC_ADDR_LENGTH];
-} __attribute__ ((packed));
+} __packed;
struct adhoc_bss_desc {
u8 bssid[MWIFIEX_MAC_ADDR_LENGTH];
@@ -835,13 +835,13 @@ struct adhoc_bss_desc {
* It is used in the Adhoc join command and will cause a
* binary layout mismatch with the firmware
*/
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_802_11_ad_hoc_join {
struct adhoc_bss_desc bss_descriptor;
u16 reserved1;
u16 reserved2;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_802_11_get_log {
__le32 mcast_tx_frame;
@@ -866,7 +866,7 @@ struct host_cmd_ds_tx_rate_query {
* [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
* [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
u8 ht_info;
-} __attribute__ ((packed));
+} __packed;
enum Host_Sleep_Action {
HS_CONFIGURE = 0x0001,
@@ -877,11 +877,11 @@ struct mwifiex_hs_config_param {
__le32 conditions;
u8 gpio;
u8 gap;
-} __attribute__ ((packed));
+} __packed;
struct hs_activate_param {
u16 resp_ctrl;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_802_11_hs_cfg_enh {
__le16 action;
@@ -890,7 +890,7 @@ struct host_cmd_ds_802_11_hs_cfg_enh {
struct mwifiex_hs_config_param hs_config;
struct hs_activate_param hs_activate;
} params;
-} __attribute__ ((packed));
+} __packed;
enum SNMP_MIB_INDEX {
OP_RATE_SET_I = 1,
@@ -909,7 +909,7 @@ struct host_cmd_ds_802_11_snmp_mib {
__le16 oid;
__le16 buf_size;
u8 value[1];
-} __attribute__ ((packed));
+} __packed;
#define RADIO_ON 0x01
#define RADIO_OFF 0x00
@@ -920,18 +920,18 @@ struct mwifiex_rate_scope {
__le16 hr_dsss_rate_bitmap;
__le16 ofdm_rate_bitmap;
__le16 ht_mcs_rate_bitmap[8];
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_rate_drop_pattern {
__le16 type;
__le16 length;
__le32 rate_drop_mode;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_tx_rate_cfg {
__le16 action;
__le16 cfg_index;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_power_group {
u8 modulation_class;
@@ -942,18 +942,18 @@ struct mwifiex_power_group {
s8 power_max;
u8 ht_bandwidth;
u8 reserved;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_types_power_group {
u16 type;
u16 length;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_txpwr_cfg {
__le16 action;
__le16 cfg_index;
__le32 mode;
-} __attribute__ ((packed));
+} __packed;
#define MWIFIEX_USER_SCAN_CHAN_MAX 50
@@ -990,7 +990,7 @@ struct mwifiex_scan_cmd_config {
*/
u8 tlv_buf[1]; /* SSID TLV(s) and ChanList TLVs are stored
here */
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_user_scan_chan {
u8 chan_number;
@@ -998,12 +998,12 @@ struct mwifiex_user_scan_chan {
u8 scan_type;
u8 reserved;
u32 scan_time;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_user_scan_ssid {
u8 ssid[IW_ESSID_MAX_SIZE + 1];
u8 max_len;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_user_scan_cfg {
/**
@@ -1044,50 +1044,50 @@ struct mwifiex_user_scan_cfg {
* Variable number (fixed maximum) of channels to scan up
*/
struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
-} __attribute__ ((packed));
+} __packed;
struct ie_body {
u8 grp_key_oui[4];
u8 ptk_cnt[2];
u8 ptk_body[4];
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_802_11_scan {
u8 bss_mode;
u8 bssid[MWIFIEX_MAC_ADDR_LENGTH];
u8 tlv_buffer[1];
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_802_11_scan_rsp {
__le16 bss_descript_size;
u8 number_of_sets;
u8 bss_desc_and_tlv_buffer[1];
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_802_11_bg_scan_query {
u8 flush;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_802_11_bg_scan_query_rsp {
u32 report_condition;
struct host_cmd_ds_802_11_scan_rsp scan_resp;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_ietypes_domain_param_set {
struct mwifiex_ie_types_header header;
u8 country_code[COUNTRY_CODE_LEN];
struct ieee80211_country_ie_triplet triplet[1];
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_802_11d_domain_info {
__le16 action;
struct mwifiex_ietypes_domain_param_set domain;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_802_11d_domain_info_rsp {
__le16 action;
struct mwifiex_ietypes_domain_param_set domain;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_11n_addba_req {
u8 add_req_result;
@@ -1096,7 +1096,7 @@ struct host_cmd_ds_11n_addba_req {
__le16 block_ack_param_set;
__le16 block_ack_tmo;
__le16 ssn;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_11n_addba_rsp {
u8 add_rsp_result;
@@ -1106,7 +1106,7 @@ struct host_cmd_ds_11n_addba_rsp {
__le16 block_ack_param_set;
__le16 block_ack_tmo;
__le16 ssn;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_11n_delba {
u8 del_result;
@@ -1114,32 +1114,32 @@ struct host_cmd_ds_11n_delba {
__le16 del_ba_param_set;
__le16 reason_code;
u8 reserved;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_11n_batimeout {
u8 tid;
u8 peer_mac_addr[MWIFIEX_MAC_ADDR_LENGTH];
u8 origninator;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_11n_cfg {
__le16 action;
__le16 ht_tx_cap;
__le16 ht_tx_info;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_txbuf_cfg {
__le16 action;
__le16 buff_size;
__le16 mp_end_port; /* SDIO only, reserved for other interfacces */
__le16 reserved3;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_amsdu_aggr_ctrl {
__le16 action;
__le16 enable;
__le16 curr_buf_size;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_ie_types_wmm_param_set {
struct mwifiex_ie_types_header header;
@@ -1160,7 +1160,7 @@ struct host_cmd_ds_wmm_get_status {
u8 queue_status_tlv[sizeof(struct mwifiex_ie_types_wmm_queue_status) *
IEEE80211_MAX_QUEUES];
u8 wmm_param_tlv[sizeof(struct ieee_types_wmm_parameter) + 2];
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_wmm_ac_status {
u8 disabled;
@@ -1171,32 +1171,32 @@ struct mwifiex_wmm_ac_status {
struct mwifiex_ie_types_htcap {
struct mwifiex_ie_types_header header;
struct ieee_htcap ht_cap;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_ie_types_htinfo {
struct mwifiex_ie_types_header header;
struct ieee_htinfo ht_info;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_ie_types_2040bssco {
struct mwifiex_ie_types_header header;
struct ieee_bssco_2040 bss_co_2040;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_ie_types_extcap {
struct mwifiex_ie_types_header header;
struct ieee_extcap ext_cap;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_ie_types_pmk {
struct mwifiex_ie_types_header header;
u8 pmk[1];
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_ie_types_passphrase {
struct mwifiex_ie_types_header header;
char passphrase[1];
-} __attribute__ ((packed));
+} __packed;
/* unicastcipher:
* Bit 0 : RFU
@@ -1215,7 +1215,7 @@ struct mwifiex_ie_types_cipher {
struct mwifiex_ie_types_header header;
u8 pair_cipher;
u8 group_cipher;
-} __attribute__ ((packed));
+} __packed;
/* rsnMode:
* Bit 0 : No RSN
@@ -1229,12 +1229,12 @@ struct mwifiex_ie_types_cipher {
struct mwifiex_ie_types_encrproto {
struct mwifiex_ie_types_header header;
__le16 rsn_mode;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_ie_types_bssid {
struct mwifiex_ie_types_header header;
u8 bssid[MWIFIEX_MAC_ADDR_LENGTH];
-} __attribute__ ((packed));
+} __packed;
/*
* This struct will handle GET,SET,CLEAR function for embedded
@@ -1250,7 +1250,7 @@ struct host_cmd_ds_802_11_supplicant_pmk {
* mwifiex_ie_types_passphrase passphrase;
* mwifiex_ie_types_bssid bssid;
*/
-} __attribute__ ((packed));
+} __packed;
/*
* This struct will GET the Supplicant supported bitmaps
@@ -1263,34 +1263,34 @@ struct host_cmd_ds_802_11_supplicant_profile {
__le16 reserved;
u8 tlv_buf[1];
/* mwifiex_ie_types_encrproto */
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_mac_reg_access {
__le16 action;
__le16 offset;
__le32 value;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_bbp_reg_access {
__le16 action;
__le16 offset;
u8 value;
u8 reserved[3];
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_rf_reg_access {
__le16 action;
__le16 offset;
u8 value;
u8 reserved[3];
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_pmic_reg_access {
__le16 action;
__le16 offset;
u8 value;
u8 reserved[3];
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_802_11_eeprom_access {
__le16 action;
@@ -1298,7 +1298,7 @@ struct host_cmd_ds_802_11_eeprom_access {
__le16 offset;
__le16 byte_count;
u8 value;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_802_11_rf_channel {
__le16 action;
@@ -1306,17 +1306,17 @@ struct host_cmd_ds_802_11_rf_channel {
__le16 rf_type;
__le16 reserved;
u8 reserved_1[32];
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_version_ext {
u8 version_str_sel;
char version_str[128];
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_802_11_rf_antenna {
__le16 action;
__le16 antenna_mode;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_802_11_ibss_status {
__le16 action;
@@ -1325,14 +1325,14 @@ struct host_cmd_ds_802_11_ibss_status {
__le16 beacon_interval;
__le16 atim_window;
__le16 use_g_rate_protect;
-} __attribute__ ((packed));
+} __packed;
#define CONNECTION_TYPE_INFRA 0
#define CONNECTION_TYPE_ADHOC 1
struct host_cmd_ds_set_bss_mode {
u8 con_type;
-} __attribute__ ((packed));
+} __packed;
struct host_cmd_ds_command {
__le16 command;
@@ -1387,7 +1387,7 @@ struct host_cmd_ds_command {
struct host_cmd_ds_802_11_eeprom_access eeprom;
struct host_cmd_ds_802_11_sleep_period sleep_pd;
} params;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_opt_sleep_confirm {
__le16 command;
@@ -1396,10 +1396,10 @@ struct mwifiex_opt_sleep_confirm {
__le16 result;
__le16 action;
struct sleep_confirm_param sleep_cfm;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_opt_sleep_confirm_buffer {
u8 hdr[4];
struct mwifiex_opt_sleep_confirm ps_cfm_sleep;
-} __attribute__ ((packed));
+} __packed;
#endif /* !_MWIFIEX_FW_H_ */
diff --git a/drivers/net/wireless/mwifiex/ieee.h b/drivers/net/wireless/mwifiex/ieee.h
index ae85c8a..263380c 100644
--- a/drivers/net/wireless/mwifiex/ieee.h
+++ b/drivers/net/wireless/mwifiex/ieee.h
@@ -29,7 +29,7 @@
struct ieee_types_header {
u8 element_id;
u8 len;
-} __attribute__ ((packed));
+} __packed;
struct ieee_types_vendor_header {
u8 element_id;
@@ -38,17 +38,17 @@ struct ieee_types_vendor_header {
u8 oui_type;
u8 oui_subtype;
u8 version;
-} __attribute__ ((packed));
+} __packed;
struct ieee_types_vendor_specific {
struct ieee_types_vendor_header vend_hdr;
u8 data[IEEE_MAX_IE_SIZE - sizeof(struct ieee_types_vendor_header)];
-} __attribute__ ((packed));
+} __packed;
struct ieee_types_generic {
struct ieee_types_header ieee_hdr;
u8 data[IEEE_MAX_IE_SIZE - sizeof(struct ieee_types_header)];
-} __attribute__ ((packed));
+} __packed;
#define CAPINFO_MASK (~(BIT(15) | BIT(14) | \
BIT(12) | BIT(11) | BIT(9)))
@@ -60,18 +60,18 @@ struct ieee_types_cf_param_set {
u8 cfp_period;
u16 cfp_max_duration;
u16 cfp_duration_remaining;
-} __attribute__ ((packed));
+} __packed;
struct ieee_types_ibss_param_set {
u8 element_id;
u8 len;
__le16 atim_window;
-} __attribute__ ((packed));
+} __packed;
union ieee_types_ss_param_set {
struct ieee_types_cf_param_set cf_param_set;
struct ieee_types_ibss_param_set ibss_param_set;
-} __attribute__ ((packed));
+} __packed;
struct ieee_types_fh_param_set {
u8 element_id;
@@ -80,31 +80,31 @@ struct ieee_types_fh_param_set {
u8 hop_set;
u8 hop_pattern;
u8 hop_index;
-} __attribute__ ((packed));
+} __packed;
struct ieee_types_ds_param_set {
u8 element_id;
u8 len;
u8 current_chan;
-} __attribute__ ((packed));
+} __packed;
union ieee_types_phy_param_set {
struct ieee_types_fh_param_set fh_param_set;
struct ieee_types_ds_param_set ds_param_set;
-} __attribute__ ((packed));
+} __packed;
struct ieee_types_erp_info {
u8 element_id;
u8 len;
u8 erp_flags;
-} __attribute__ ((packed));
+} __packed;
struct ieee_types_assoc_rsp {
__le16 cap_info_bitmap;
__le16 status_code;
__le16 a_id;
u8 ie_buffer[1];
-} __attribute__ ((packed));
+} __packed;
enum ieee_types_wmm_aciaifsn_bitmasks {
MWIFIEX_AIFSN = (BIT(0) | BIT(1) | BIT(2) | BIT(3)),
@@ -121,7 +121,7 @@ struct ieee_types_wmm_ac_parameters {
u8 aci_aifsn_bitmap;
u8 ecw_bitmap;
__le16 tx_op_limit;
-} __attribute__ ((packed));
+} __packed;
struct ieee_types_wmm_info {
@@ -137,7 +137,7 @@ struct ieee_types_wmm_info {
struct ieee_types_vendor_header vend_hdr;
u8 qos_info_bitmap;
-} __attribute__ ((packed));
+} __packed;
struct ieee_types_wmm_parameter {
/**
@@ -153,7 +153,7 @@ struct ieee_types_wmm_parameter {
u8 qos_info_bitmap;
u8 reserved;
struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_MAX_QUEUES];
-} __attribute__ ((packed));
+} __packed;
#define MWIFIEX_MAX_TRIPLET_802_11D 83
#define COUNTRY_CODE_LEN 3
@@ -165,7 +165,7 @@ struct ieee_htcap {
__le16 ht_ext_cap;
u32 tx_bf_cap;
u8 asel;
-} __attribute__ ((packed));
+} __packed;
struct ieee_htinfo {
u8 pri_chan;
@@ -173,15 +173,15 @@ struct ieee_htinfo {
u16 field3;
u16 field4;
u8 basic_mcs_set[16];
-} __attribute__ ((packed));
+} __packed;
struct ieee_bssco_2040 {
u8 bss_co_2040_value;
-} __attribute__ ((packed));
+} __packed;
struct ieee_extcap {
u8 ext_cap_value;
-} __attribute__ ((packed));
+} __packed;
struct ieee_obss_scan_param {
u16 obss_scan_passive_dwell;
@@ -191,32 +191,32 @@ struct ieee_obss_scan_param {
u16 obss_scan_active_total;
u16 bss_width_chan_trans_delay;
u16 obss_scan_active_threshold;
-} __attribute__ ((packed));
+} __packed;
struct ieee_types_htcap {
struct ieee_types_header ieee_hdr;
struct ieee_htcap ht_cap;
-} __attribute__ ((packed));
+} __packed;
struct ieee_types_htinfo {
struct ieee_types_header ieee_hdr;
struct ieee_htinfo ht_info;
-} __attribute__ ((packed));
+} __packed;
struct ieee_types_2040bssco {
struct ieee_types_header ieee_hdr;
struct ieee_bssco_2040 bss_co_2040;
-} __attribute__ ((packed));
+} __packed;
struct ieee_types_extcap {
struct ieee_types_header ieee_hdr;
struct ieee_extcap ext_cap;
-} __attribute__ ((packed));
+} __packed;
struct ieee_types_obss_scan_param {
struct ieee_types_header ieee_hdr;
struct ieee_obss_scan_param obss_scan;
-} __attribute__ ((packed));
+} __packed;
struct mwifiex_bssdescriptor {
u8 mac_address[MWIFIEX_MAC_ADDR_LENGTH];
--
1.7.0.2
^ permalink raw reply related
* [PATCH 3/4] mwifiex: keep exactly one space after #include
From: Bing Zhao @ 2010-12-16 0:57 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
Frank Huang, Bing Zhao
In-Reply-To: <1292461079-26318-1-git-send-email-bzhao@marvell.com>
From: Kiran Divekar <dkiran@marvell.com>
Signed-off-by: Kiran Divekar <dkiran@marvell.com>
---
drivers/net/wireless/mwifiex/decl.h | 6 +++---
drivers/net/wireless/mwifiex/main.c | 6 +++---
drivers/net/wireless/mwifiex/main.h | 34 +++++++++++++++++-----------------
drivers/net/wireless/mwifiex/sdio.h | 10 +++++-----
4 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/decl.h b/drivers/net/wireless/mwifiex/decl.h
index ea27216..155c071 100644
--- a/drivers/net/wireless/mwifiex/decl.h
+++ b/drivers/net/wireless/mwifiex/decl.h
@@ -20,9 +20,9 @@
#ifndef _MWIFIEX_DECL_H_
#define _MWIFIEX_DECL_H_
-#include <linux/wait.h>
-#include <linux/timer.h>
-#include <linux/wireless.h>
+#include <linux/wait.h>
+#include <linux/timer.h>
+#include <linux/wireless.h>
#define MWIFIEX_MAX_BSS_NUM (1)
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 09319db..4e1ac6f 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -17,9 +17,9 @@
* this warranty disclaimer.
**/
-#include "main.h"
-#include "wmm.h"
-#include "cfg80211.h"
+#include "main.h"
+#include "wmm.h"
+#include "cfg80211.h"
#define VERSION "1.0"
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index be7156c..8bb8b45 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -20,24 +20,24 @@
#ifndef _MWIFIEX_MAIN_H_
#define _MWIFIEX_MAIN_H_
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/sched.h>
-#include <linux/semaphore.h>
-#include <linux/ip.h>
-#include <linux/skbuff.h>
-#include <linux/if_arp.h>
-#include <linux/etherdevice.h>
-#include <net/sock.h>
-#include <net/lib80211.h>
-#include <linux/firmware.h>
-#include <linux/ctype.h>
-
-#include "decl.h"
-#include "ioctl.h"
-#include "ieee.h"
-#include "util.h"
-#include "fw.h"
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/sched.h>
+#include <linux/semaphore.h>
+#include <linux/ip.h>
+#include <linux/skbuff.h>
+#include <linux/if_arp.h>
+#include <linux/etherdevice.h>
+#include <net/sock.h>
+#include <net/lib80211.h>
+#include <linux/firmware.h>
+#include <linux/ctype.h>
+
+#include "decl.h"
+#include "ioctl.h"
+#include "ieee.h"
+#include "util.h"
+#include "fw.h"
extern const char driver_version[];
extern struct mwifiex_adapter *g_adapter;
diff --git a/drivers/net/wireless/mwifiex/sdio.h b/drivers/net/wireless/mwifiex/sdio.h
index 116a1eb..5a70cd8 100644
--- a/drivers/net/wireless/mwifiex/sdio.h
+++ b/drivers/net/wireless/mwifiex/sdio.h
@@ -21,12 +21,12 @@
#define _MWIFIEX_SDIO_H
-#include <linux/mmc/sdio.h>
-#include <linux/mmc/sdio_ids.h>
-#include <linux/mmc/sdio_func.h>
-#include <linux/mmc/card.h>
+#include <linux/mmc/sdio.h>
+#include <linux/mmc/sdio_ids.h>
+#include <linux/mmc/sdio_func.h>
+#include <linux/mmc/card.h>
-#include "main.h"
+#include "main.h"
#define BLOCK_MODE 1
#define BYTE_MODE 0
--
1.7.0.2
^ permalink raw reply related
* [PATCH 1/4] mwifiex: remove wrapper functions for spin_lock/spin_unlock
From: Bing Zhao @ 2010-12-16 0:57 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
Frank Huang, Bing Zhao
From: Amitkumar Karwar <akarwar@marvell.com>
Call spin_lock/spin_unlock functions directly instead of driver
specific wrapper functions. Use sparse annotations (__acquires()
/__releases()) to fix context imbalance sparse warnings.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/mwifiex/11n.c | 7 +-
drivers/net/wireless/mwifiex/11n_aggr.c | 27 ++++---
drivers/net/wireless/mwifiex/11n_aggr.h | 3 +-
drivers/net/wireless/mwifiex/11n_rxreorder.c | 20 +++--
drivers/net/wireless/mwifiex/cmdevt.c | 54 +++++++------
drivers/net/wireless/mwifiex/init.c | 78 +++----------------
drivers/net/wireless/mwifiex/main.c | 11 ++-
drivers/net/wireless/mwifiex/main.h | 21 +++--
drivers/net/wireless/mwifiex/scan.c | 22 +++--
drivers/net/wireless/mwifiex/sdio.c | 10 ++-
drivers/net/wireless/mwifiex/sta_cmdresp.c | 9 +-
drivers/net/wireless/mwifiex/txrx.c | 7 +-
drivers/net/wireless/mwifiex/util.c | 110 ++++++--------------------
drivers/net/wireless/mwifiex/util.h | 16 +---
drivers/net/wireless/mwifiex/wmm.c | 72 ++++++++++-------
15 files changed, 193 insertions(+), 274 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/11n.c b/drivers/net/wireless/mwifiex/11n.c
index d1494bf..73d2fb7 100644
--- a/drivers/net/wireless/mwifiex/11n.c
+++ b/drivers/net/wireless/mwifiex/11n.c
@@ -1102,9 +1102,11 @@ void
mwifiex_11n_delete_tx_ba_stream_tbl_entry(struct mwifiex_private *priv,
struct mwifiex_tx_ba_stream_tbl *tx_ba_tsr_tbl)
{
+ unsigned long flags;
+
ENTER();
- mwifiex_spin_lock(priv->tx_ba_stream_tbl_ptr.lock);
+ spin_lock_irqsave(&priv->tx_ba_stream_tbl_ptr.lock, flags);
if (!tx_ba_tsr_tbl &&
mwifiex_is_tx_ba_stream_ptr_valid(priv, tx_ba_tsr_tbl))
@@ -1119,7 +1121,8 @@ mwifiex_11n_delete_tx_ba_stream_tbl_entry(struct mwifiex_private *priv,
kfree(tx_ba_tsr_tbl);
exit:
- mwifiex_spin_unlock(priv->tx_ba_stream_tbl_ptr.lock);
+ spin_unlock_irqrestore(&priv->tx_ba_stream_tbl_ptr.lock, flags);
+
LEAVE();
}
diff --git a/drivers/net/wireless/mwifiex/11n_aggr.c b/drivers/net/wireless/mwifiex/11n_aggr.c
index e100ffc..ca24d54 100644
--- a/drivers/net/wireless/mwifiex/11n_aggr.c
+++ b/drivers/net/wireless/mwifiex/11n_aggr.c
@@ -306,7 +306,8 @@ done:
int
mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
struct mwifiex_ra_list_tbl *pra_list, int headroom,
- int ptrindex)
+ int ptrindex, unsigned long flags)
+ __releases(&priv->wmm.ra_list_spinlock)
{
int pkt_size = 0;
struct mwifiex_adapter *adapter = priv->adapter;
@@ -317,6 +318,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
struct timeval tstamp;
struct mwifiex_tx_param tx_param;
struct txpd *ptx_pd = NULL;
+
ENTER();
PRINTM(MDAT_D, "Handling Aggr packet\n");
@@ -329,6 +331,8 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
if (!mbuf_aggr) {
PRINTM(MERROR,
"Error allocating struct mwifiex_buffer\n");
+ spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock,
+ flags);
return MWIFIEX_STATUS_FAILURE;
}
@@ -347,6 +351,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA)
ptx_pd = (struct txpd *)mbuf_aggr->buffer;
} else {
+ spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags);
goto exit;
}
@@ -359,7 +364,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
pra_list->total_pkts_size -= mbuf_src->data_len;
- mwifiex_spin_unlock(priv->wmm.ra_list_spinlock);
+ spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags);
pkt_size += mwifiex_11n_form_amsdu_pkt(adapter,
(data + pkt_size),
mbuf_src->buffer +
@@ -372,10 +377,11 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
mwifiex_write_data_complete(adapter, mbuf_src,
MWIFIEX_STATUS_SUCCESS);
- mwifiex_spin_lock(priv->wmm.ra_list_spinlock);
+ spin_lock_irqsave(&priv->wmm.ra_list_spinlock, flags);
if (!mwifiex_is_ralist_valid(priv, pra_list, ptrindex)) {
- mwifiex_spin_unlock(priv->wmm.ra_list_spinlock);
+ spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock,
+ flags);
LEAVE();
return MWIFIEX_STATUS_FAILURE;
}
@@ -385,7 +391,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
mwifiex_util_peek_list(&pra_list->buf_head, true);
}
- mwifiex_spin_unlock(priv->wmm.ra_list_spinlock);
+ spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags);
/* Last AMSDU packet does not need padding */
pkt_size -= pad;
@@ -402,10 +408,11 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
mbuf_aggr, &tx_param);
switch (ret) {
case MWIFIEX_STATUS_RESOURCE:
- mwifiex_spin_lock(priv->wmm.ra_list_spinlock);
+ spin_lock_irqsave(&priv->wmm.ra_list_spinlock, flags);
if (!mwifiex_is_ralist_valid(priv, pra_list, ptrindex)) {
- mwifiex_spin_unlock(priv->wmm.ra_list_spinlock);
+ spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock,
+ flags);
mwifiex_write_data_complete(adapter, mbuf_aggr,
MWIFIEX_STATUS_FAILURE);
LEAVE();
@@ -424,7 +431,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
pra_list->total_pkts_size += mbuf_aggr->data_len;
mbuf_aggr->flags |= MWIFIEX_BUF_FLAG_REQUEUED_PKT;
- mwifiex_spin_unlock(priv->wmm.ra_list_spinlock);
+ spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags);
PRINTM(MDATA, "MWIFIEX_STATUS_RESOURCE is returned\n");
break;
case MWIFIEX_STATUS_FAILURE:
@@ -444,7 +451,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
break;
}
if (ret != MWIFIEX_STATUS_RESOURCE) {
- mwifiex_spin_lock(priv->wmm.ra_list_spinlock);
+ spin_lock_irqsave(&priv->wmm.ra_list_spinlock, flags);
if (mwifiex_is_ralist_valid(priv, pra_list, ptrindex)) {
priv->wmm.packets_out[ptrindex]++;
priv->wmm.tid_tbl_ptr[ptrindex].ra_list_curr = pra_list;
@@ -452,7 +459,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
adapter->bss_prio_tbl[priv->bss_priority].bss_prio_cur =
adapter->bss_prio_tbl[priv->bss_priority]
.bss_prio_cur->next;
- mwifiex_spin_unlock(priv->wmm.ra_list_spinlock);
+ spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags);
}
do_gettimeofday(&tstamp);
PRINTM(MDATA, "%lu.%lu : Data => kernel\n",
diff --git a/drivers/net/wireless/mwifiex/11n_aggr.h b/drivers/net/wireless/mwifiex/11n_aggr.h
index 7f190ad..5b076f2 100644
--- a/drivers/net/wireless/mwifiex/11n_aggr.h
+++ b/drivers/net/wireless/mwifiex/11n_aggr.h
@@ -26,6 +26,7 @@ enum mwifiex_status mwifiex_11n_deaggregate_pkt(struct mwifiex_private *priv,
struct mwifiex_buffer *mbuf);
int mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
struct mwifiex_ra_list_tbl *ptr, int headroom,
- int ptr_index);
+ int ptr_index, unsigned long flags)
+ __releases(&priv->wmm.ra_list_spinlock);
#endif /* !_MWIFIEX_11N_AGGR_H_ */
diff --git a/drivers/net/wireless/mwifiex/11n_rxreorder.c b/drivers/net/wireless/mwifiex/11n_rxreorder.c
index 8fdb1fb..9d72135 100644
--- a/drivers/net/wireless/mwifiex/11n_rxreorder.c
+++ b/drivers/net/wireless/mwifiex/11n_rxreorder.c
@@ -57,6 +57,7 @@ mwifiex_11n_dispatch_pkt_until_start_win(struct mwifiex_private *priv,
int no_pkt_to_send, i, xchg;
enum mwifiex_status ret = MWIFIEX_STATUS_SUCCESS;
void *rx_tmp_ptr = NULL;
+ unsigned long flags;
ENTER();
@@ -65,18 +66,18 @@ mwifiex_11n_dispatch_pkt_until_start_win(struct mwifiex_private *priv,
rx_reor_tbl_ptr->win_size) : rx_reor_tbl_ptr->win_size;
for (i = 0; i < no_pkt_to_send; ++i) {
- mwifiex_spin_lock(priv->rx_pkt_lock);
+ spin_lock_irqsave(&priv->rx_pkt_lock, flags);
rx_tmp_ptr = NULL;
if (rx_reor_tbl_ptr->rx_reorder_ptr[i]) {
rx_tmp_ptr = rx_reor_tbl_ptr->rx_reorder_ptr[i];
rx_reor_tbl_ptr->rx_reorder_ptr[i] = NULL;
}
- mwifiex_spin_unlock(priv->rx_pkt_lock);
+ spin_unlock_irqrestore(&priv->rx_pkt_lock, flags);
if (rx_tmp_ptr)
mwifiex_11n_dispatch_pkt(priv, rx_tmp_ptr);
}
- mwifiex_spin_lock(priv->rx_pkt_lock);
+ spin_lock_irqsave(&priv->rx_pkt_lock, flags);
/*
* We don't have a circular buffer, hence use rotation to simulate
* circular buffer
@@ -89,7 +90,7 @@ mwifiex_11n_dispatch_pkt_until_start_win(struct mwifiex_private *priv,
}
rx_reor_tbl_ptr->start_win = start_win;
- mwifiex_spin_unlock(priv->rx_pkt_lock);
+ spin_unlock_irqrestore(&priv->rx_pkt_lock, flags);
LEAVE();
return ret;
@@ -125,22 +126,23 @@ mwifiex_11n_scan_and_dispatch(struct mwifiex_private *priv,
int i, j, xchg;
enum mwifiex_status ret = MWIFIEX_STATUS_SUCCESS;
void *rx_tmp_ptr = NULL;
+ unsigned long flags;
ENTER();
for (i = 0; i < rx_reor_tbl_ptr->win_size; ++i) {
- mwifiex_spin_lock(priv->rx_pkt_lock);
+ spin_lock_irqsave(&priv->rx_pkt_lock, flags);
if (!rx_reor_tbl_ptr->rx_reorder_ptr[i]) {
- mwifiex_spin_unlock(priv->rx_pkt_lock);
+ spin_unlock_irqrestore(&priv->rx_pkt_lock, flags);
break;
}
rx_tmp_ptr = rx_reor_tbl_ptr->rx_reorder_ptr[i];
rx_reor_tbl_ptr->rx_reorder_ptr[i] = NULL;
- mwifiex_spin_unlock(priv->rx_pkt_lock);
+ spin_unlock_irqrestore(&priv->rx_pkt_lock, flags);
mwifiex_11n_dispatch_pkt(priv, rx_tmp_ptr);
}
- mwifiex_spin_lock(priv->rx_pkt_lock);
+ spin_lock_irqsave(&priv->rx_pkt_lock, flags);
/*
* We don't have a circular buffer, hence use rotation to simulate
* circular buffer
@@ -155,7 +157,7 @@ mwifiex_11n_scan_and_dispatch(struct mwifiex_private *priv,
}
rx_reor_tbl_ptr->start_win = (rx_reor_tbl_ptr->start_win + i)
&(MAX_TID_VALUE - 1);
- mwifiex_spin_unlock(priv->rx_pkt_lock);
+ spin_unlock_irqrestore(&priv->rx_pkt_lock, flags);
LEAVE();
return ret;
}
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c
index 873de93..cfdf206 100644
--- a/drivers/net/wireless/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/mwifiex/cmdevt.c
@@ -227,6 +227,7 @@ mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
uint16_t cmd_code;
uint16_t cmd_size;
struct timeval tstamp;
+ unsigned long flags;
ENTER();
@@ -260,9 +261,9 @@ mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
(adapter->seq_num, cmd_node->priv->bss_num,
cmd_node->priv->bss_type));
- mwifiex_spin_lock(adapter->mwifiex_cmd_lock);
+ spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
adapter->curr_cmd = cmd_node;
- mwifiex_spin_unlock(adapter->mwifiex_cmd_lock);
+ spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
cmd_code = le16_to_cpu(host_cmd->command);
cmd_size = le16_to_cpu(host_cmd->size);
@@ -291,9 +292,9 @@ mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
adapter->
curr_cmd);
- mwifiex_spin_lock(adapter->mwifiex_cmd_lock);
+ spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
adapter->curr_cmd = NULL;
- mwifiex_spin_unlock(adapter->mwifiex_cmd_lock);
+ spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
adapter->dbg.num_cmd_host_to_card_failure++;
ret = MWIFIEX_STATUS_FAILURE;
@@ -813,6 +814,7 @@ mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter)
struct cmd_ctrl_node *cmd_node = NULL;
enum mwifiex_status ret = MWIFIEX_STATUS_SUCCESS;
struct host_cmd_ds_command *host_cmd;
+ unsigned long flags;
ENTER();
@@ -830,7 +832,7 @@ mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter)
goto done;
}
- mwifiex_spin_lock(adapter->mwifiex_cmd_lock);
+ spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
/* Check if any command is pending */
cmd_node =
(struct cmd_ctrl_node *) mwifiex_util_peek_list(&adapter->
@@ -846,14 +848,15 @@ mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter)
if (adapter->ps_state != PS_STATE_AWAKE) {
PRINTM(MERROR, "Cannot send command in sleep state"
", this should not happen\n");
- mwifiex_spin_unlock(adapter->mwifiex_cmd_lock);
+ spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock,
+ flags);
goto done;
}
mwifiex_util_unlink_list(&adapter->cmd_pending_q,
(struct mwifiex_linked_list *)
cmd_node, true);
- mwifiex_spin_unlock(adapter->mwifiex_cmd_lock);
+ spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
ret = mwifiex_dnld_cmd_to_fw(priv, cmd_node);
priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
/* Any command sent to the firmware when host is in sleep
@@ -871,7 +874,7 @@ mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter)
}
goto done;
} else {
- mwifiex_spin_unlock(adapter->mwifiex_cmd_lock);
+ spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
}
ret = MWIFIEX_STATUS_SUCCESS;
done:
@@ -897,6 +900,7 @@ mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
uint16_t cmdresp_result;
struct mwifiex_ioctl_req *ioctl_buf = NULL;
struct timeval tstamp;
+ unsigned long flags;
ENTER();
@@ -939,9 +943,9 @@ mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
PRINTM(MERROR, "CMD_RESP: 0x%x been canceled!\n",
le16_to_cpu(resp->command));
mwifiex_insert_cmd_to_free_q(adapter, adapter->curr_cmd);
- mwifiex_spin_lock(adapter->mwifiex_cmd_lock);
+ spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
adapter->curr_cmd = NULL;
- mwifiex_spin_unlock(adapter->mwifiex_cmd_lock);
+ spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
ret = MWIFIEX_STATUS_FAILURE;
goto done;
}
@@ -982,9 +986,9 @@ mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
ioctl_buf->status_code = MWIFIEX_ERROR_FW_CMDRESP;
mwifiex_insert_cmd_to_free_q(adapter, adapter->curr_cmd);
- mwifiex_spin_lock(adapter->mwifiex_cmd_lock);
+ spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
adapter->curr_cmd = NULL;
- mwifiex_spin_unlock(adapter->mwifiex_cmd_lock);
+ spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
ret = MWIFIEX_STATUS_FAILURE;
goto done;
}
@@ -1024,9 +1028,9 @@ mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
/* Clean up and put current command back to cmd_free_q */
mwifiex_insert_cmd_to_free_q(adapter, adapter->curr_cmd);
- mwifiex_spin_lock(adapter->mwifiex_cmd_lock);
+ spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
adapter->curr_cmd = NULL;
- mwifiex_spin_unlock(adapter->mwifiex_cmd_lock);
+ spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
}
done:
@@ -1141,15 +1145,16 @@ mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter)
{
struct cmd_ctrl_node *cmd_node = NULL;
struct mwifiex_ioctl_req *ioctl_buf = NULL;
+ unsigned long flags;
/* Cancel current cmd */
if ((adapter->curr_cmd) && (adapter->curr_cmd->ioctl_buf)) {
ioctl_buf =
(struct mwifiex_ioctl_req *) adapter->curr_cmd->
ioctl_buf;
- mwifiex_spin_lock(adapter->mwifiex_cmd_lock);
+ spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
adapter->curr_cmd->ioctl_buf = NULL;
- mwifiex_spin_unlock(adapter->mwifiex_cmd_lock);
+ spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
ioctl_buf->status_code = MWIFIEX_ERROR_CMD_CANCEL;
mwifiex_ioctl_complete(adapter, ioctl_buf,
MWIFIEX_STATUS_FAILURE);
@@ -1184,9 +1189,9 @@ mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter)
cmd_node->ioctl_buf = NULL;
mwifiex_insert_cmd_to_free_q(adapter, cmd_node);
}
- mwifiex_spin_lock(adapter->mwifiex_cmd_lock);
+ spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
adapter->scan_processing = false;
- mwifiex_spin_unlock(adapter->mwifiex_cmd_lock);
+ spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
}
/*
@@ -1204,6 +1209,7 @@ mwifiex_cancel_pending_ioctl(struct mwifiex_adapter *adapter,
struct mwifiex_ioctl_req *ioctl_req)
{
struct cmd_ctrl_node *cmd_node = NULL;
+ unsigned long flags;
ENTER();
@@ -1213,14 +1219,14 @@ mwifiex_cancel_pending_ioctl(struct mwifiex_adapter *adapter,
if ((adapter->curr_cmd) &&
(adapter->curr_cmd->ioctl_buf == ioctl_req)) {
- mwifiex_spin_lock(adapter->mwifiex_cmd_lock);
+ spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
cmd_node = adapter->curr_cmd;
cmd_node->ioctl_buf = NULL;
cmd_node->cmd_flag |= CMD_F_CANCELED;
- mwifiex_spin_unlock(adapter->mwifiex_cmd_lock);
+ spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
}
- mwifiex_spin_lock(adapter->mwifiex_cmd_lock);
+ spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
while ((cmd_node =
mwifiex_get_pending_ioctl_cmd(adapter, ioctl_req)) != NULL) {
mwifiex_util_unlink_list(&adapter->cmd_pending_q,
@@ -1229,7 +1235,7 @@ mwifiex_cancel_pending_ioctl(struct mwifiex_adapter *adapter,
cmd_node->ioctl_buf = NULL;
mwifiex_insert_cmd_to_free_q(adapter, cmd_node);
}
- mwifiex_spin_unlock(adapter->mwifiex_cmd_lock);
+ spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
if (ioctl_req->req_id == MWIFIEX_IOCTL_SCAN) {
/* Cancel all pending scan command */
while ((cmd_node =
@@ -1242,9 +1248,9 @@ mwifiex_cancel_pending_ioctl(struct mwifiex_adapter *adapter,
cmd_node->ioctl_buf = NULL;
mwifiex_insert_cmd_to_free_q(adapter, cmd_node);
}
- mwifiex_spin_lock(adapter->mwifiex_cmd_lock);
+ spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
adapter->scan_processing = false;
- mwifiex_spin_unlock(adapter->mwifiex_cmd_lock);
+ spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
}
ioctl_req->status_code = MWIFIEX_ERROR_CMD_CANCEL;
mwifiex_ioctl_complete(adapter, ioctl_req, MWIFIEX_STATUS_FAILURE);
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index 51ce799..b7fdd18 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -391,44 +391,16 @@ enum mwifiex_status wlan_init_lock_list(struct mwifiex_adapter *adapter)
ENTER();
- if (mwifiex_init_lock(&adapter->mwifiex_lock)
- != MWIFIEX_STATUS_SUCCESS) {
- ret = MWIFIEX_STATUS_FAILURE;
- goto error;
- }
- if (mwifiex_init_lock(&adapter->int_lock)
- != MWIFIEX_STATUS_SUCCESS) {
- ret = MWIFIEX_STATUS_FAILURE;
- goto error;
- }
- if (mwifiex_init_lock(&adapter->main_proc_lock)
- != MWIFIEX_STATUS_SUCCESS) {
- ret = MWIFIEX_STATUS_FAILURE;
- goto error;
- }
- if (mwifiex_init_lock(&adapter->mwifiex_cmd_lock)
- != MWIFIEX_STATUS_SUCCESS) {
- ret = MWIFIEX_STATUS_FAILURE;
- goto error;
- }
+ spin_lock_init(&adapter->mwifiex_lock);
+ spin_lock_init(&adapter->int_lock);
+ spin_lock_init(&adapter->main_proc_lock);
+ spin_lock_init(&adapter->mwifiex_cmd_lock);
for (i = 0; i < adapter->priv_num; i++) {
if (adapter->priv[i]) {
priv = adapter->priv[i];
- if (mwifiex_init_lock(&priv->rx_pkt_lock)
- != MWIFIEX_STATUS_SUCCESS) {
- ret = MWIFIEX_STATUS_FAILURE;
- goto error;
- }
- if (mwifiex_init_lock(&priv->wmm.ra_list_spinlock)
- != MWIFIEX_STATUS_SUCCESS) {
- ret = MWIFIEX_STATUS_FAILURE;
- goto error;
- }
- if (mwifiex_init_lock(&priv->curr_bcn_buf_lock)
- != MWIFIEX_STATUS_SUCCESS) {
- ret = MWIFIEX_STATUS_FAILURE;
- goto error;
- }
+ spin_lock_init(&priv->rx_pkt_lock);
+ spin_lock_init(&priv->wmm.ra_list_spinlock);
+ spin_lock_init(&priv->curr_bcn_buf_lock);
}
}
@@ -458,7 +430,6 @@ enum mwifiex_status wlan_init_lock_list(struct mwifiex_adapter *adapter)
}
}
-error:
LEAVE();
return ret;
}
@@ -475,27 +446,6 @@ void wlan_free_lock_list(struct mwifiex_adapter *adapter)
ENTER();
- if (adapter->mwifiex_lock)
- mwifiex_free_lock(adapter->mwifiex_lock);
- if (adapter->int_lock)
- mwifiex_free_lock(adapter->int_lock);
- if (adapter->main_proc_lock)
- mwifiex_free_lock(adapter->main_proc_lock);
- if (adapter->mwifiex_cmd_lock)
- mwifiex_free_lock(adapter->mwifiex_cmd_lock);
-
- for (i = 0; i < adapter->priv_num; i++) {
- if (adapter->priv[i]) {
- priv = adapter->priv[i];
- if (priv->rx_pkt_lock)
- mwifiex_free_lock(priv->rx_pkt_lock);
- if (priv->wmm.ra_list_spinlock)
- mwifiex_free_lock(priv->wmm.ra_list_spinlock);
- if (priv->curr_bcn_buf_lock)
- mwifiex_free_lock(priv->curr_bcn_buf_lock);
- }
- }
-
/* Free lists */
mwifiex_util_free_list_head(&adapter->cmd_free_q);
@@ -608,6 +558,7 @@ mwifiex_shutdown_drv(struct mwifiex_adapter *adapter)
enum mwifiex_status ret = MWIFIEX_STATUS_PENDING;
struct mwifiex_private *priv = NULL;
s32 i = 0;
+ unsigned long flags;
ENTER();
@@ -635,25 +586,16 @@ mwifiex_shutdown_drv(struct mwifiex_adapter *adapter)
}
}
- if (mwifiex_spin_lock(adapter->mwifiex_lock)
- != MWIFIEX_STATUS_SUCCESS) {
- ret = MWIFIEX_STATUS_FAILURE;
- goto exit_shutdown_fw;
- }
+ spin_lock_irqsave(&adapter->mwifiex_lock, flags);
/* Free adapter structure */
mwifiex_free_adapter(adapter);
- if (mwifiex_spin_unlock(adapter->mwifiex_lock)
- != MWIFIEX_STATUS_SUCCESS) {
- ret = MWIFIEX_STATUS_FAILURE;
- goto exit_shutdown_fw;
- }
+ spin_unlock_irqrestore(&adapter->mwifiex_lock, flags);
/* Notify completion */
ret = mwifiex_shutdown_fw_complete(adapter);
-exit_shutdown_fw:
LEAVE();
return ret;
}
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 686567e..09319db 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -263,18 +263,19 @@ enum mwifiex_status
mwifiex_main_process(struct mwifiex_adapter *adapter)
{
enum mwifiex_status ret = MWIFIEX_STATUS_SUCCESS;
+ unsigned long flags;
ENTER();
- mwifiex_spin_lock(adapter->main_proc_lock);
+ spin_lock_irqsave(&adapter->main_proc_lock, flags);
/* Check if already processing */
if (adapter->mwifiex_processing) {
- mwifiex_spin_unlock(adapter->main_proc_lock);
+ spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
goto exit_main_proc;
} else {
adapter->mwifiex_processing = true;
- mwifiex_spin_unlock(adapter->main_proc_lock);
+ spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
}
process_start:
do {
@@ -393,9 +394,9 @@ process_start:
if ((adapter->int_status) || IS_CARD_RX_RCVD(adapter))
goto process_start;
- mwifiex_spin_lock(adapter->main_proc_lock);
+ spin_lock_irqsave(&adapter->main_proc_lock, flags);
adapter->mwifiex_processing = false;
- mwifiex_spin_unlock(adapter->main_proc_lock);
+ spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
exit_main_proc:
if (adapter->hw_status == MWIFIEX_HW_STATUS_CLOSING)
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 010a68a..be7156c 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -237,7 +237,8 @@ struct mwifiex_tid_tbl {
struct mwifiex_wmm_desc {
struct mwifiex_tid_tbl tid_tbl_ptr[MAX_NUM_TID];
u32 packets_out[MAX_NUM_TID];
- void *ra_list_spinlock;
+ /* spin lock to protect ra_list */
+ spinlock_t ra_list_spinlock;
struct mwifiex_wmm_ac_status ac_status[IEEE80211_MAX_QUEUES];
enum mwifiex_wmm_ac_e ac_down_graded_vals[IEEE80211_MAX_QUEUES];
u32 drv_pkt_delay_max;
@@ -388,7 +389,8 @@ struct mwifiex_private {
struct mwifiex_add_ba_param add_ba_param;
u16 rx_seq[MAX_NUM_TID];
struct mwifiex_list_head rx_reorder_tbl_ptr;
- void *rx_pkt_lock;
+ /* spin lock for Rx packets */
+ spinlock_t rx_pkt_lock;
#define MWIFIEX_ASSOC_RSP_BUF_SIZE 500
u8 assoc_rsp_buf[MWIFIEX_ASSOC_RSP_BUF_SIZE];
@@ -406,7 +408,8 @@ struct mwifiex_private {
u8 *curr_bcn_buf;
u32 curr_bcn_size;
- void *curr_bcn_buf_lock;
+ /* spin lock for beacon buffer */
+ spinlock_t curr_bcn_buf_lock;
u16 ioctl_wait_q_woken;
wait_queue_head_t ioctl_wait_q;
u16 cmd_wait_q_woken;
@@ -564,8 +567,10 @@ struct mwifiex_adapter {
struct workqueue_struct *workqueue;
struct work_struct main_work;
struct mwifiex_bss_prio_tbl bss_prio_tbl[MWIFIEX_MAX_BSS_NUM];
- void *mwifiex_lock;
- void *main_proc_lock;
+ /* spin lock for init/shutdown */
+ spinlock_t mwifiex_lock;
+ /* spin lock for main process */
+ spinlock_t main_proc_lock;
u32 mwifiex_processing;
u16 max_tx_buf_size;
u16 tx_buf_size;
@@ -575,7 +580,8 @@ struct mwifiex_adapter {
u16 radio_on;
u16 number_of_antenna;
u32 fw_cap_info;
- void *int_lock;
+ /* spin lock for interrupt handling */
+ spinlock_t int_lock;
u8 int_status;
u32 event_cause;
struct mwifiex_buffer *mwifiex_buffer_event;
@@ -589,7 +595,8 @@ struct mwifiex_adapter {
u16 seq_num;
struct cmd_ctrl_node *cmd_pool;
struct cmd_ctrl_node *curr_cmd;
- void *mwifiex_cmd_lock;
+ /* spin lock for command */
+ spinlock_t mwifiex_cmd_lock;
u32 num_cmd_timeout;
u16 last_init_cmd;
struct mwifiex_drv_timer *mwifiex_cmd_timer;
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index fc63922..23be1de 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -2222,6 +2222,7 @@ mwifiex_process_scan_results(struct mwifiex_private *priv)
struct mwifiex_adapter *adapter = priv->adapter;
s32 j;
u32 i;
+ unsigned long flags;
ENTER();
@@ -2235,7 +2236,7 @@ mwifiex_process_scan_results(struct mwifiex_private *priv)
priv->bss_mode);
if (j >= 0) {
- mwifiex_spin_lock(priv->curr_bcn_buf_lock);
+ spin_lock_irqsave(&priv->curr_bcn_buf_lock, flags);
priv->curr_bss_params.bss_descriptor.bcn_wpa_ie = NULL;
priv->curr_bss_params.bss_descriptor.wpa_offset = 0;
priv->curr_bss_params.bss_descriptor.bcn_rsn_ie = NULL;
@@ -2275,7 +2276,8 @@ mwifiex_process_scan_results(struct mwifiex_private *priv)
sizeof(priv->curr_bss_params.bss_descriptor));
mwifiex_save_curr_bcn(priv);
- mwifiex_spin_unlock(priv->curr_bcn_buf_lock);
+ spin_unlock_irqrestore(&priv->curr_bcn_buf_lock, flags);
+
} else {
mwifiex_restore_curr_bcn(priv);
}
@@ -2536,6 +2538,7 @@ mwifiex_scan_networks(struct mwifiex_private *priv,
u8 filtered_scan;
u8 scan_current_chan_only;
u8 max_chan_per_scan;
+ unsigned long flags;
ENTER();
@@ -2592,9 +2595,10 @@ mwifiex_scan_networks(struct mwifiex_private *priv,
cmd_node = (struct cmd_ctrl_node *)
mwifiex_util_dequeue_list(&adapter->
scan_pending_q, true);
- mwifiex_spin_lock(adapter->mwifiex_cmd_lock);
+ spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
adapter->scan_processing = true;
- mwifiex_spin_unlock(adapter->mwifiex_cmd_lock);
+ spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock,
+ flags);
mwifiex_insert_cmd_to_pending_q(adapter, cmd_node,
true);
}
@@ -2695,6 +2699,7 @@ mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
struct chan_band_param_set *chan_band;
u8 band;
u8 is_bgscan_resp;
+ unsigned long flags;
ENTER();
@@ -2917,9 +2922,9 @@ mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
adapter->num_in_scan_table = num_in_table;
if (!mwifiex_util_peek_list(&adapter->scan_pending_q, true)) {
- mwifiex_spin_lock(adapter->mwifiex_cmd_lock);
+ spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
adapter->scan_processing = false;
- mwifiex_spin_unlock(adapter->mwifiex_cmd_lock);
+ spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
/*
* Process the resulting scan table:
* - Remove any bad ssids
@@ -3348,12 +3353,13 @@ mwifiex_restore_curr_bcn(struct mwifiex_private *priv)
struct mwifiex_adapter *adapter = priv->adapter;
struct mwifiex_bssdescriptor *curr_bss =
&priv->curr_bss_params.bss_descriptor;
+ unsigned long flags;
if (priv->curr_bcn_buf &&
((adapter->bcn_buf_end + priv->curr_bcn_size) <
(adapter->bcn_buf + sizeof(adapter->bcn_buf)))) {
- mwifiex_spin_lock(priv->curr_bcn_buf_lock);
+ spin_lock_irqsave(&priv->curr_bcn_buf_lock, flags);
/* restore the current beacon buffer */
memcpy(adapter->bcn_buf_end, priv->curr_bcn_buf,
@@ -3408,7 +3414,7 @@ mwifiex_restore_curr_bcn(struct mwifiex_private *priv)
curr_bss->overlap_bss_offset);
}
- mwifiex_spin_unlock(priv->curr_bcn_buf_lock);
+ spin_unlock_irqrestore(&priv->curr_bcn_buf_lock, flags);
PRINTM(MINFO, "current beacon restored %d\n",
priv->curr_bcn_size);
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
index c06e662..d0d9ed7 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -954,6 +954,7 @@ static void mwifiex_interrupt_status(struct mwifiex_adapter *adapter)
struct sdio_mmc_card *card = adapter->card;
struct mwifiex_buffer mbuf;
u32 sdio_ireg = 0;
+ unsigned long flags;
ENTER();
@@ -978,9 +979,9 @@ static void mwifiex_interrupt_status(struct mwifiex_adapter *adapter)
* Clear the interrupt status register
*/
PRINTM(MINTR, "sdio_ireg = 0x%x\n", sdio_ireg);
- mwifiex_spin_lock(adapter->int_lock);
+ spin_lock_irqsave(&adapter->int_lock, flags);
adapter->int_status |= sdio_ireg;
- mwifiex_spin_unlock(adapter->int_lock);
+ spin_unlock_irqrestore(&adapter->int_lock, flags);
}
done:
LEAVE();
@@ -1312,13 +1313,14 @@ mwifiex_process_int_status(struct mwifiex_adapter *adapter)
u32 len_reg_l, len_reg_u;
u32 rx_blocks;
u16 rx_len;
+ unsigned long flags;
ENTER();
- mwifiex_spin_lock(adapter->int_lock);
+ spin_lock_irqsave(&adapter->int_lock, flags);
sdio_ireg = adapter->int_status;
adapter->int_status = 0;
- mwifiex_spin_unlock(adapter->int_lock);
+ spin_unlock_irqrestore(&adapter->int_lock, flags);
if (!sdio_ireg)
goto done;
diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c
index d5b8ef0..c1b646e 100644
--- a/drivers/net/wireless/mwifiex/sta_cmdresp.c
+++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c
@@ -47,6 +47,7 @@ mwifiex_process_cmdresp_error(struct mwifiex_private *priv,
{
struct cmd_ctrl_node *cmd_node = NULL;
struct mwifiex_adapter *adapter = priv->adapter;
+ unsigned long flags;
ENTER();
@@ -86,9 +87,9 @@ mwifiex_process_cmdresp_error(struct mwifiex_private *priv,
cmd_node->ioctl_buf = NULL;
mwifiex_insert_cmd_to_free_q(adapter, cmd_node);
}
- mwifiex_spin_lock(adapter->mwifiex_cmd_lock);
+ spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
adapter->scan_processing = false;
- mwifiex_spin_unlock(adapter->mwifiex_cmd_lock);
+ spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
mwifiex_recv_event(priv, MWIFIEX_EVENT_ID_DRV_SCAN_REPORT,
NULL);
break;
@@ -104,9 +105,9 @@ mwifiex_process_cmdresp_error(struct mwifiex_private *priv,
*/
mwifiex_insert_cmd_to_free_q(adapter, adapter->curr_cmd);
- mwifiex_spin_lock(adapter->mwifiex_cmd_lock);
+ spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
adapter->curr_cmd = NULL;
- mwifiex_spin_unlock(adapter->mwifiex_cmd_lock);
+ spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
LEAVE();
return;
diff --git a/drivers/net/wireless/mwifiex/txrx.c b/drivers/net/wireless/mwifiex/txrx.c
index a05f2d8..25a3205 100644
--- a/drivers/net/wireless/mwifiex/txrx.c
+++ b/drivers/net/wireless/mwifiex/txrx.c
@@ -181,6 +181,7 @@ mwifiex_recv_packet_complete(struct mwifiex_adapter *adapter,
enum mwifiex_status ret = MWIFIEX_STATUS_SUCCESS;
struct mwifiex_private *priv;
struct mwifiex_buffer *mbuf_parent;
+ unsigned long flags;
ENTER();
@@ -189,15 +190,15 @@ mwifiex_recv_packet_complete(struct mwifiex_adapter *adapter,
if (mbuf->parent) {
mbuf_parent = mbuf->parent;
- mwifiex_spin_lock(priv->rx_pkt_lock);
+ spin_lock_irqsave(&priv->rx_pkt_lock, flags);
--mbuf_parent->use_count;
if (!mbuf_parent->use_count) {
- mwifiex_spin_unlock(priv->rx_pkt_lock);
+ spin_unlock_irqrestore(&priv->rx_pkt_lock, flags);
mwifiex_recv_complete(adapter,
mbuf_parent, adapter->ioport,
status);
} else {
- mwifiex_spin_unlock(priv->rx_pkt_lock);
+ spin_unlock_irqrestore(&priv->rx_pkt_lock, flags);
}
mwifiex_free_buffer(mbuf);
diff --git a/drivers/net/wireless/mwifiex/util.c b/drivers/net/wireless/mwifiex/util.c
index 73fe3c4..9af28b3 100644
--- a/drivers/net/wireless/mwifiex/util.c
+++ b/drivers/net/wireless/mwifiex/util.c
@@ -63,73 +63,6 @@ mwifiex_shutdown_fw_complete(struct mwifiex_adapter *adapter)
}
/*
- * This function initializes a spin lock.
- */
-enum mwifiex_status
-mwifiex_init_lock(void **lock)
-{
- struct mwifiex_lock *mlock = NULL;
-
- mlock = kmalloc(sizeof(struct mwifiex_lock), GFP_KERNEL);
- if (!mlock)
- return MWIFIEX_STATUS_FAILURE;
-
- spin_lock_init(&mlock->lock);
- *lock = (void *) mlock;
-
- return MWIFIEX_STATUS_SUCCESS;
-}
-
-/*
- * This function frees a spin lock.
- */
-enum mwifiex_status
-mwifiex_free_lock(void *lock)
-{
- struct mwifiex_lock *mlock = lock;
-
- kfree(mlock);
-
- return MWIFIEX_STATUS_SUCCESS;
-}
-
-/*
- * This function requests a spin lock.
- */
-inline enum mwifiex_status
-mwifiex_spin_lock(void *lock)
-{
- struct mwifiex_lock *mlock = lock;
- unsigned long flags = 0;
-
- if (mlock) {
- spin_lock_irqsave(&mlock->lock, flags);
- mlock->flags = flags;
- return MWIFIEX_STATUS_SUCCESS;
- } else {
- return MWIFIEX_STATUS_FAILURE;
- }
-}
-EXPORT_SYMBOL_GPL(mwifiex_spin_lock);
-
-/*
- * This function requests a spin unlock.
- */
-inline enum mwifiex_status
-mwifiex_spin_unlock(void *lock)
-{
- struct mwifiex_lock *mlock = (struct mwifiex_lock *) lock;
-
- if (mlock) {
- spin_unlock_irqrestore(&mlock->lock, mlock->flags);
- return MWIFIEX_STATUS_SUCCESS;
- } else {
- return MWIFIEX_STATUS_FAILURE;
- }
-}
-EXPORT_SYMBOL_GPL(mwifiex_spin_unlock);
-
-/*
* This function peeks into a list.
*
* A pointer to the next node in the list is returned, but the node
@@ -139,15 +72,17 @@ struct mwifiex_linked_list *
mwifiex_util_peek_list(struct mwifiex_list_head *head, u8 lock_required)
{
struct mwifiex_linked_list *node = NULL;
+ unsigned long flags;
- if (lock_required)
- mwifiex_spin_lock(head->lock);
-
- if (head->next != (struct mwifiex_linked_list *) head)
- node = head->next;
-
- if (lock_required)
- mwifiex_spin_unlock(head->lock);
+ if (lock_required) {
+ spin_lock_irqsave(&head->lock, flags);
+ if (head->next != (struct mwifiex_linked_list *) head)
+ node = head->next;
+ spin_unlock_irqrestore(&head->lock, flags);
+ } else {
+ if (head->next != (struct mwifiex_linked_list *) head)
+ node = head->next;
+ }
return node;
}
@@ -161,11 +96,8 @@ inline void
mwifiex_util_init_list_head(struct mwifiex_list_head *head, u8 lock_required)
{
mwifiex_util_init_list((struct mwifiex_linked_list *) head);
-
if (lock_required)
- mwifiex_init_lock(&head->lock);
- else
- head->lock = NULL;
+ spin_lock_init(&head->lock);
}
/*
@@ -177,9 +109,10 @@ mwifiex_util_enqueue_list_tail(struct mwifiex_list_head *head,
u8 lock_required)
{
struct mwifiex_linked_list *old_last;
+ unsigned long flags = 0;
if (lock_required)
- mwifiex_spin_lock(head->lock);
+ spin_lock_irqsave(&head->lock, flags);
old_last = head->prev;
node->prev = old_last;
@@ -189,7 +122,7 @@ mwifiex_util_enqueue_list_tail(struct mwifiex_list_head *head,
head->prev = old_last->next;
if (lock_required)
- mwifiex_spin_unlock(head->lock);
+ spin_unlock_irqrestore(&head->lock, flags);
}
/*
@@ -201,9 +134,10 @@ mwifiex_util_enqueue_list_head(struct mwifiex_list_head *head,
u8 lock_required)
{
struct mwifiex_linked_list *old_first;
+ unsigned long flags = 0;
if (lock_required)
- mwifiex_spin_lock(head->lock);
+ spin_lock_irqsave(&head->lock, flags);
old_first = head->next;
node->prev = (struct mwifiex_linked_list *) head;
@@ -213,7 +147,7 @@ mwifiex_util_enqueue_list_head(struct mwifiex_list_head *head,
head->next = old_first->prev;
if (lock_required)
- mwifiex_spin_unlock(head->lock);
+ spin_unlock_irqrestore(&head->lock, flags);
}
/*
@@ -228,9 +162,10 @@ mwifiex_util_unlink_list(struct mwifiex_list_head *head,
{
struct mwifiex_linked_list *my_prev;
struct mwifiex_linked_list *my_next;
+ unsigned long flags = 0;
if (lock_required)
- mwifiex_spin_lock(head->lock);
+ spin_lock_irqsave(&head->lock, flags);
my_prev = node->prev;
my_next = node->next;
@@ -241,7 +176,7 @@ mwifiex_util_unlink_list(struct mwifiex_list_head *head,
node->next = node->prev;
if (lock_required)
- mwifiex_spin_unlock(head->lock);
+ spin_unlock_irqrestore(&head->lock, flags);
}
/*
@@ -251,9 +186,10 @@ inline struct mwifiex_linked_list *
mwifiex_util_dequeue_list(struct mwifiex_list_head *head, u8 lock_required)
{
struct mwifiex_linked_list *node;
+ unsigned long flags = 0;
if (lock_required)
- mwifiex_spin_lock(head->lock);
+ spin_lock_irqsave(&head->lock, flags);
node = head->next;
if (node != (struct mwifiex_linked_list *) head)
@@ -262,7 +198,7 @@ mwifiex_util_dequeue_list(struct mwifiex_list_head *head, u8 lock_required)
node = NULL;
if (lock_required)
- mwifiex_spin_unlock(head->lock);
+ spin_unlock_irqrestore(&head->lock, flags);
return node;
}
diff --git a/drivers/net/wireless/mwifiex/util.h b/drivers/net/wireless/mwifiex/util.h
index aaae399..9996398 100644
--- a/drivers/net/wireless/mwifiex/util.h
+++ b/drivers/net/wireless/mwifiex/util.h
@@ -103,12 +103,6 @@ do { \
mwifiex_print(MHEX_DUMP | MINFO, x, y, z); \
} while (0)
-
-struct mwifiex_lock {
- spinlock_t lock; /* lock for mutual exclusion access */
- unsigned long flags;
-};
-
struct mwifiex_linked_list {
struct mwifiex_linked_list *prev;
struct mwifiex_linked_list *next;
@@ -117,13 +111,10 @@ struct mwifiex_linked_list {
struct mwifiex_list_head {
struct mwifiex_linked_list *prev;
struct mwifiex_linked_list *next;
- void *lock;
+ /* spin lock used for linked list operations */
+ spinlock_t lock;
};
-enum mwifiex_status mwifiex_init_lock(void **lock);
-enum mwifiex_status mwifiex_free_lock(void *lock);
-enum mwifiex_status mwifiex_spin_lock(void *lock);
-enum mwifiex_status mwifiex_spin_unlock(void *lock);
void mwifiex_util_init_list_head(struct mwifiex_list_head *head,
u8 lock_required);
void mwifiex_util_enqueue_list_tail(struct mwifiex_list_head *head,
@@ -157,9 +148,6 @@ mwifiex_util_free_list_head(struct mwifiex_list_head *head)
{
head->next = NULL;
head->prev = head->next;
-
- if (head->lock)
- mwifiex_free_lock(head->lock);
}
struct mwifiex_drv_timer {
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c
index 3993845..4cdaaa4 100644
--- a/drivers/net/wireless/mwifiex/wmm.c
+++ b/drivers/net/wireless/mwifiex/wmm.c
@@ -147,10 +147,12 @@ done:
void
mwifiex_clean_txrx(struct mwifiex_private *priv)
{
+ unsigned long flags;
+
ENTER();
mwifiex_11n_cleanup_reorder_tbl(priv);
- mwifiex_spin_lock(priv->wmm.ra_list_spinlock);
+ spin_lock_irqsave(&priv->wmm.ra_list_spinlock, flags);
mwifiex_wmm_cleanup_queues(priv);
mwifiex_11n_delete_all_tx_ba_stream_tbl(priv);
@@ -161,7 +163,7 @@ mwifiex_clean_txrx(struct mwifiex_private *priv)
mwifiex_wmm_delete_all_ralist(priv);
memcpy(tos_to_tid, ac_to_tid, sizeof(tos_to_tid));
- mwifiex_spin_unlock(priv->wmm.ra_list_spinlock);
+ spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags);
LEAVE();
}
@@ -666,7 +668,7 @@ mwifiex_wmm_delete_all_ralist(struct mwifiex_private *priv)
}
mwifiex_util_init_list((struct mwifiex_linked_list *)
- &priv->wmm.tid_tbl_ptr[i].ra_list);
+ &priv->wmm.tid_tbl_ptr[i].ra_list);
priv->wmm.tid_tbl_ptr[i].ra_list_curr = NULL;
}
@@ -773,6 +775,7 @@ mwifiex_wmm_add_buf_txqueue(struct mwifiex_adapter *adapter,
u32 tid;
struct mwifiex_ra_list_tbl *ra_list;
u8 ra[MWIFIEX_MAC_ADDR_LENGTH], tid_down;
+ unsigned long flags;
ENTER();
@@ -788,7 +791,7 @@ mwifiex_wmm_add_buf_txqueue(struct mwifiex_adapter *adapter,
tid = mbuf->priority;
- mwifiex_spin_lock(priv->wmm.ra_list_spinlock);
+ spin_lock_irqsave(&priv->wmm.ra_list_spinlock, flags);
tid_down = mwifiex_wmm_downgrade_tid(priv, tid);
@@ -807,7 +810,7 @@ mwifiex_wmm_add_buf_txqueue(struct mwifiex_adapter *adapter,
}
if (!ra_list) {
- mwifiex_spin_unlock(priv->wmm.ra_list_spinlock);
+ spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags);
mwifiex_send_packet_complete(adapter, mbuf,
MWIFIEX_STATUS_FAILURE);
LEAVE();
@@ -821,7 +824,7 @@ mwifiex_wmm_add_buf_txqueue(struct mwifiex_adapter *adapter,
ra_list->total_pkts_size += mbuf->data_len;
- mwifiex_spin_unlock(priv->wmm.ra_list_spinlock);
+ spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags);
LEAVE();
}
@@ -1150,7 +1153,9 @@ mwifiex_num_pkts_in_txq(struct mwifiex_private *priv,
*/
static void
mwifiex_send_single_packet(struct mwifiex_private *priv,
- struct mwifiex_ra_list_tbl *ptr, int ptr_index)
+ struct mwifiex_ra_list_tbl *ptr, int ptr_index,
+ unsigned long flags)
+ __releases(&priv->wmm.ra_list_spinlock)
{
struct mwifiex_buffer *mbuf;
struct mwifiex_buffer *mbuf_next;
@@ -1170,7 +1175,7 @@ mwifiex_send_single_packet(struct mwifiex_private *priv,
(struct mwifiex_buffer *) mwifiex_util_peek_list(&ptr->
buf_head,
false);
- mwifiex_spin_unlock(priv->wmm.ra_list_spinlock);
+ spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags);
tx_param.next_pkt_len =
((mbuf_next) ? mbuf_next->data_len +
@@ -1181,10 +1186,12 @@ mwifiex_send_single_packet(struct mwifiex_private *priv,
/** Queue the packet back at the head */
PRINTM(MDAT_D, "Queuing pkt back to raList %p %p\n",
ptr, mbuf);
- mwifiex_spin_lock(priv->wmm.ra_list_spinlock);
+ spin_lock_irqsave(&priv->wmm.ra_list_spinlock, flags);
if (!mwifiex_is_ralist_valid(priv, ptr, ptr_index)) {
- mwifiex_spin_unlock(priv->wmm.ra_list_spinlock);
+ spin_unlock_irqrestore(
+ &priv->wmm.ra_list_spinlock,
+ flags);
mwifiex_write_data_complete(adapter, mbuf,
MWIFIEX_STATUS_FAILURE);
LEAVE();
@@ -1196,9 +1203,10 @@ mwifiex_send_single_packet(struct mwifiex_private *priv,
ptr->total_pkts_size += mbuf->data_len;
mbuf->flags |= MWIFIEX_BUF_FLAG_REQUEUED_PKT;
- mwifiex_spin_unlock(priv->wmm.ra_list_spinlock);
+ spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock,
+ flags);
} else {
- mwifiex_spin_lock(priv->wmm.ra_list_spinlock);
+ spin_lock_irqsave(&priv->wmm.ra_list_spinlock, flags);
if (mwifiex_is_ralist_valid(priv, ptr, ptr_index)) {
priv->wmm.packets_out[ptr_index]++;
priv->wmm.tid_tbl_ptr[ptr_index].ra_list_curr =
@@ -1207,10 +1215,11 @@ mwifiex_send_single_packet(struct mwifiex_private *priv,
adapter->bss_prio_tbl[priv->bss_priority].bss_prio_cur =
adapter->bss_prio_tbl[priv->bss_priority].
bss_prio_cur->next;
- mwifiex_spin_unlock(priv->wmm.ra_list_spinlock);
+ spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock,
+ flags);
}
} else {
- mwifiex_spin_unlock(priv->wmm.ra_list_spinlock);
+ spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags);
PRINTM(MDATA, "Nothing to send\n");
}
@@ -1241,7 +1250,9 @@ mwifiex_is_ptr_processed(struct mwifiex_private *priv,
*/
static void
mwifiex_send_processed_packet(struct mwifiex_private *priv,
- struct mwifiex_ra_list_tbl *ptr, int ptr_index)
+ struct mwifiex_ra_list_tbl *ptr, int ptr_index,
+ unsigned long flags)
+ __releases(&priv->wmm.ra_list_spinlock)
{
struct mwifiex_buffer *mbuf_next;
struct mwifiex_tx_param tx_param;
@@ -1258,7 +1269,7 @@ mwifiex_send_processed_packet(struct mwifiex_private *priv,
(struct mwifiex_buffer *) mwifiex_util_peek_list(&ptr->
buf_head,
false);
- mwifiex_spin_unlock(priv->wmm.ra_list_spinlock);
+ spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags);
tx_param.next_pkt_len =
((mbuf_next) ? mbuf_next->data_len +
sizeof(struct txpd) : 0);
@@ -1268,10 +1279,12 @@ mwifiex_send_processed_packet(struct mwifiex_private *priv,
switch (ret) {
case MWIFIEX_STATUS_RESOURCE:
PRINTM(MDATA, "MWIFIEX_STATUS_RESOURCE is returned\n");
- mwifiex_spin_lock(priv->wmm.ra_list_spinlock);
+ spin_lock_irqsave(&priv->wmm.ra_list_spinlock, flags);
if (!mwifiex_is_ralist_valid(priv, ptr, ptr_index)) {
- mwifiex_spin_unlock(priv->wmm.ra_list_spinlock);
+ spin_unlock_irqrestore(
+ &priv->wmm.ra_list_spinlock,
+ flags);
mwifiex_write_data_complete(adapter, mbuf,
MWIFIEX_STATUS_FAILURE);
LEAVE();
@@ -1282,7 +1295,8 @@ mwifiex_send_processed_packet(struct mwifiex_private *priv,
mbuf, true);
mbuf->flags |= MWIFIEX_BUF_FLAG_REQUEUED_PKT;
- mwifiex_spin_unlock(priv->wmm.ra_list_spinlock);
+ spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock,
+ flags);
break;
case MWIFIEX_STATUS_FAILURE:
adapter->data_sent = false;
@@ -1297,7 +1311,7 @@ mwifiex_send_processed_packet(struct mwifiex_private *priv,
break;
}
if (ret != MWIFIEX_STATUS_RESOURCE) {
- mwifiex_spin_lock(priv->wmm.ra_list_spinlock);
+ spin_lock_irqsave(&priv->wmm.ra_list_spinlock, flags);
if (mwifiex_is_ralist_valid(priv, ptr, ptr_index)) {
priv->wmm.packets_out[ptr_index]++;
priv->wmm.tid_tbl_ptr[ptr_index].ra_list_curr =
@@ -1306,10 +1320,11 @@ mwifiex_send_processed_packet(struct mwifiex_private *priv,
adapter->bss_prio_tbl[priv->bss_priority].bss_prio_cur =
adapter->bss_prio_tbl[priv->bss_priority].
bss_prio_cur->next;
- mwifiex_spin_unlock(priv->wmm.ra_list_spinlock);
+ spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock,
+ flags);
}
} else {
- mwifiex_spin_unlock(priv->wmm.ra_list_spinlock);
+ spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags);
}
LEAVE();
@@ -1327,6 +1342,7 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter)
int ptr_index = 0;
u8 ra[MWIFIEX_MAC_ADDR_LENGTH];
int tid_del = 0, tid = 0;
+ unsigned long flags;
ENTER();
@@ -1341,15 +1357,15 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter)
PRINTM(MDATA, "tid=%d\n", tid);
- mwifiex_spin_lock(priv->wmm.ra_list_spinlock);
+ spin_lock_irqsave(&priv->wmm.ra_list_spinlock, flags);
if (!mwifiex_is_ralist_valid(priv, ptr, ptr_index)) {
- mwifiex_spin_unlock(priv->wmm.ra_list_spinlock);
+ spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags);
LEAVE();
return MWIFIEX_STATUS_FAILURE;
}
if (mwifiex_is_ptr_processed(priv, ptr)) {
- mwifiex_send_processed_packet(priv, ptr, ptr_index);
+ mwifiex_send_processed_packet(priv, ptr, ptr_index, flags);
/* ra_list_spinlock has been freed in
mwifiex_send_processed_packet() */
LEAVE();
@@ -1361,7 +1377,7 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter)
((priv->sec_info.wpa_enabled
|| priv->sec_info.wpa2_enabled) && !priv->wpa_is_gtk_set))
) {
- mwifiex_send_single_packet(priv, ptr, ptr_index);
+ mwifiex_send_single_packet(priv, ptr, ptr_index, flags);
/* ra_list_spinlock has been freed in
mwifiex_send_single_packet() */
} else {
@@ -1388,11 +1404,11 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter)
adapter->tx_buf_size) >=
MIN_NUM_AMSDU)) {
mwifiex_11n_aggregate_pkt(priv, ptr, INTF_HEADER_LEN,
- ptr_index);
+ ptr_index, flags);
/* ra_list_spinlock has been freed in
mwifiex_11n_aggregate_pkt() */
} else {
- mwifiex_send_single_packet(priv, ptr, ptr_index);
+ mwifiex_send_single_packet(priv, ptr, ptr_index, flags);
/* ra_list_spinlock has been freed in
mwifiex_send_single_packet() */
}
--
1.7.0.2
^ permalink raw reply related
* [PATCH 2/4] mwifiex: modify set_default_key() prototype
From: Bing Zhao @ 2010-12-16 0:57 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
Frank Huang, Bing Zhao
In-Reply-To: <1292461079-26318-1-git-send-email-bzhao@marvell.com>
From: Amitkumar Karwar <akarwar@marvell.com>
This fixes compilation warning introduced recently due to
set_default_key prototype change in cfg80211.h (dbd2fd6 by
Johannes Berg):
cfg80211/nl80211: separate unicast/multicast default TX keys
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
---
drivers/net/wireless/mwifiex/cfg80211.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 99dade5..8d74446 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -64,7 +64,8 @@ static int mwifiex_cfg80211_del_key(struct wiphy *wiphy,
static int mwifiex_cfg80211_set_default_key(struct wiphy *wiphy,
struct net_device *netdev,
- u8 key_index);
+ u8 key_index, bool unicast,
+ bool multicast);
static int mwifiex_cfg80211_set_power_mgmt(struct wiphy *wiphy,
struct net_device *dev, bool enabled,
int timeout);
@@ -314,7 +315,8 @@ mwifiex_cfg80211_set_power_mgmt(struct wiphy *wiphy,
*/
static int
mwifiex_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *netdev,
- u8 key_index)
+ u8 key_index, bool unicast,
+ bool multicast)
{
return 0;
}
--
1.7.0.2
^ permalink raw reply related
* [PATCH v3] nl80211: Add notification for dropped Deauth/Disassoc
From: Jouni Malinen @ 2010-12-15 22:52 UTC (permalink / raw)
To: John W. Linville, Johannes Berg; +Cc: linux-wireless
In-Reply-To: <20101213220048.GA24752@jm.kir.nu>
Add a new notification to indicate that a received, unprotected
Deauthentication or Disassociation frame was dropped due to
management frame protection being in use. This notification is
needed to allow user space (e.g., wpa_supplicant) to implement
SA Query procedure to recover from association state mismatch
between an AP and STA.
This is needed to avoid getting stuck in non-working state when MFP
(IEEE 802.11w) is used and a protected Deauthentication or
Disassociation frame is dropped for any reason. After that, the
station would silently discard any unprotected Deauthentication or
Disassociation frame that could be indicating that the AP does not
have association for the STA (when the Reason Code would be 6 or 7).
IEEE Std 802.11w-2009, 11.13 describes this recovery mechanism.
Signed-off-by: Jouni Malinen <j@w1.fi>
---
include/linux/nl80211.h | 10 ++++++++++
include/net/cfg80211.h | 26 ++++++++++++++++++++++++++
net/mac80211/rx.c | 22 ++++++++++++++++++++--
net/wireless/mlme.c | 22 ++++++++++++++++++++++
net/wireless/nl80211.c | 16 ++++++++++++++++
net/wireless/nl80211.h | 6 ++++++
6 files changed, 100 insertions(+), 2 deletions(-)
v3: Include the forgotten include/net/cfg80211.h changes
--- wireless-testing.orig/include/linux/nl80211.h 2010-12-16 00:45:15.000000000 +0200
+++ wireless-testing/include/linux/nl80211.h 2010-12-16 00:45:18.000000000 +0200
@@ -394,6 +394,13 @@
*
* @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface.
*
+ * @NL80211_CMD_UNPROT_DEAUTHENTICATE: Unprotected deauthentication frame
+ * notification. This event is used to indicate that an unprotected
+ * deauthentication frame was dropped when MFP is in use.
+ * @NL80211_CMD_UNPROT_DISASSOCIATE: Unprotected disassociation frame
+ * notification. This event is used to indicate that an unprotected
+ * disassociation frame was dropped when MFP is in use.
+ *
* @NL80211_CMD_MAX: highest used command number
* @__NL80211_CMD_AFTER_LAST: internal use
*/
@@ -500,6 +507,9 @@ enum nl80211_commands {
NL80211_CMD_FRAME_WAIT_CANCEL,
+ NL80211_CMD_UNPROT_DEAUTHENTICATE,
+ NL80211_CMD_UNPROT_DISASSOCIATE,
+
/* add new commands above here */
/* used to define NL80211_CMD_MAX below */
--- wireless-testing.orig/net/mac80211/rx.c 2010-12-16 00:44:31.000000000 +0200
+++ wireless-testing/net/mac80211/rx.c 2010-12-16 00:45:18.000000000 +0200
@@ -1539,12 +1539,30 @@ ieee80211_drop_unencrypted_mgmt(struct i
if (rx->sta && test_sta_flags(rx->sta, WLAN_STA_MFP)) {
if (unlikely(!ieee80211_has_protected(fc) &&
ieee80211_is_unicast_robust_mgmt_frame(rx->skb) &&
- rx->key))
+ rx->key)) {
+ if (ieee80211_is_deauth(fc))
+ cfg80211_send_unprot_deauth(rx->sdata->dev,
+ rx->skb->data,
+ rx->skb->len);
+ else if (ieee80211_is_disassoc(fc))
+ cfg80211_send_unprot_disassoc(rx->sdata->dev,
+ rx->skb->data,
+ rx->skb->len);
return -EACCES;
+ }
/* BIP does not use Protected field, so need to check MMIE */
if (unlikely(ieee80211_is_multicast_robust_mgmt_frame(rx->skb) &&
- ieee80211_get_mmie_keyidx(rx->skb) < 0))
+ ieee80211_get_mmie_keyidx(rx->skb) < 0)) {
+ if (ieee80211_is_deauth(fc))
+ cfg80211_send_unprot_deauth(rx->sdata->dev,
+ rx->skb->data,
+ rx->skb->len);
+ else if (ieee80211_is_disassoc(fc))
+ cfg80211_send_unprot_disassoc(rx->sdata->dev,
+ rx->skb->data,
+ rx->skb->len);
return -EACCES;
+ }
/*
* When using MFP, Action frames are not allowed prior to
* having configured keys.
--- wireless-testing.orig/net/wireless/mlme.c 2010-12-16 00:44:31.000000000 +0200
+++ wireless-testing/net/wireless/mlme.c 2010-12-16 00:45:18.000000000 +0200
@@ -263,6 +263,28 @@ void cfg80211_send_disassoc(struct net_d
}
EXPORT_SYMBOL(cfg80211_send_disassoc);
+void cfg80211_send_unprot_deauth(struct net_device *dev, const u8 *buf,
+ size_t len)
+{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+ struct wiphy *wiphy = wdev->wiphy;
+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
+
+ nl80211_send_unprot_deauth(rdev, dev, buf, len, GFP_ATOMIC);
+}
+EXPORT_SYMBOL(cfg80211_send_unprot_deauth);
+
+void cfg80211_send_unprot_disassoc(struct net_device *dev, const u8 *buf,
+ size_t len)
+{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+ struct wiphy *wiphy = wdev->wiphy;
+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
+
+ nl80211_send_unprot_disassoc(rdev, dev, buf, len, GFP_ATOMIC);
+}
+EXPORT_SYMBOL(cfg80211_send_unprot_disassoc);
+
static void __cfg80211_auth_remove(struct wireless_dev *wdev, const u8 *addr)
{
int i;
--- wireless-testing.orig/net/wireless/nl80211.c 2010-12-16 00:45:15.000000000 +0200
+++ wireless-testing/net/wireless/nl80211.c 2010-12-16 00:45:18.000000000 +0200
@@ -5333,6 +5333,22 @@ void nl80211_send_disassoc(struct cfg802
NL80211_CMD_DISASSOCIATE, gfp);
}
+void nl80211_send_unprot_deauth(struct cfg80211_registered_device *rdev,
+ struct net_device *netdev, const u8 *buf,
+ size_t len, gfp_t gfp)
+{
+ nl80211_send_mlme_event(rdev, netdev, buf, len,
+ NL80211_CMD_UNPROT_DEAUTHENTICATE, gfp);
+}
+
+void nl80211_send_unprot_disassoc(struct cfg80211_registered_device *rdev,
+ struct net_device *netdev, const u8 *buf,
+ size_t len, gfp_t gfp)
+{
+ nl80211_send_mlme_event(rdev, netdev, buf, len,
+ NL80211_CMD_UNPROT_DISASSOCIATE, gfp);
+}
+
static void nl80211_send_mlme_timeout(struct cfg80211_registered_device *rdev,
struct net_device *netdev, int cmd,
const u8 *addr, gfp_t gfp)
--- wireless-testing.orig/net/wireless/nl80211.h 2010-12-16 00:44:31.000000000 +0200
+++ wireless-testing/net/wireless/nl80211.h 2010-12-16 00:45:18.000000000 +0200
@@ -25,6 +25,12 @@ void nl80211_send_deauth(struct cfg80211
void nl80211_send_disassoc(struct cfg80211_registered_device *rdev,
struct net_device *netdev,
const u8 *buf, size_t len, gfp_t gfp);
+void nl80211_send_unprot_deauth(struct cfg80211_registered_device *rdev,
+ struct net_device *netdev,
+ const u8 *buf, size_t len, gfp_t gfp);
+void nl80211_send_unprot_disassoc(struct cfg80211_registered_device *rdev,
+ struct net_device *netdev,
+ const u8 *buf, size_t len, gfp_t gfp);
void nl80211_send_auth_timeout(struct cfg80211_registered_device *rdev,
struct net_device *netdev,
const u8 *addr, gfp_t gfp);
--- wireless-testing.orig/include/net/cfg80211.h 2010-12-16 00:45:15.000000000 +0200
+++ wireless-testing/include/net/cfg80211.h 2010-12-16 00:45:18.000000000 +0200
@@ -2318,6 +2318,32 @@ void __cfg80211_send_disassoc(struct net
size_t len);
/**
+ * cfg80211_send_unprot_deauth - notification of unprotected deauthentication
+ * @dev: network device
+ * @buf: deauthentication frame (header + body)
+ * @len: length of the frame data
+ *
+ * This function is called whenever a received Deauthentication frame has been
+ * dropped in station mode because of MFP being used but the Deauthentication
+ * frame was not protected. This function may sleep.
+ */
+void cfg80211_send_unprot_deauth(struct net_device *dev, const u8 *buf,
+ size_t len);
+
+/**
+ * cfg80211_send_unprot_disassoc - notification of unprotected disassociation
+ * @dev: network device
+ * @buf: disassociation frame (header + body)
+ * @len: length of the frame data
+ *
+ * This function is called whenever a received Disassociation frame has been
+ * dropped in station mode because of MFP being used but the Disassociation
+ * frame was not protected. This function may sleep.
+ */
+void cfg80211_send_unprot_disassoc(struct net_device *dev, const u8 *buf,
+ size_t len);
+
+/**
* cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP)
* @dev: network device
* @addr: The source MAC address of the frame
--
Jouni Malinen PGP id EFC895FA
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox