* Re: Possible BUG where mac80211 fails to stop queues
From: Johannes Berg @ 2009-07-27 16:04 UTC (permalink / raw)
To: Larry Finger; +Cc: John Linville, Michael Buesch, wireless
In-Reply-To: <4A6DCE0E.3010103@lwfinger.net>
[-- Attachment #1: Type: text/plain, Size: 1151 bytes --]
On Mon, 2009-07-27 at 10:55 -0500, Larry Finger wrote:
> > I've also seen it under extreme stress on Intel hardware, cf.
> > http://thread.gmane.org/gmane.linux.kernel.wireless.general/36497
>
> Fortunately, the b43 coding was robust enough to prevent queue
> overrun, thus we just end up with a warning.
Right. iwlwifi wasn't so lucky.
> > Are you seeing this multiple times? I don't think you have fragmentation
> > on, do you? At least I didn't and still saw the problem, which seemed a
> > bit strange, but I really couldn't see any other way for it to happen.
>
> When it occurs, I get just a single warning. Fragmentation was not on.
> I will prepare a patch that acknowledges that mac80211 might send one
> extra fragment after the queues are stopped and only issue a warning
> if we get more than one.
Sounds reasonable. You could even change the threshold from 2 to 4 and
enqueue the frame anyway, if still >= 2 slots free, I guess.
However, I think I've seen this happen more than once, which really
makes me think there's a bug in mac80211 too, but I haven't been able to
find that bug if any.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: [PATCH 1/3] mac80211: cooperate more with network namespaces
From: Johannes Berg @ 2009-07-27 16:02 UTC (permalink / raw)
To: Pavel Roskin; +Cc: linux-wireless
In-Reply-To: <1248710387.8500.5.camel@johannes.local>
[-- Attachment #1: Type: text/plain, Size: 1251 bytes --]
On Mon, 2009-07-27 at 17:59 +0200, Johannes Berg wrote:
> On Mon, 2009-07-27 at 11:34 -0400, Pavel Roskin wrote:
>
> > If you mean "verify info->control.vif is not NULL", it makes no
> > difference for me. No BUG is triggered. info->control.vif is never
> > NULL in ieee80211_tx_pending(), but sdata->dev is NULL the second time
> > ieee80211_tx_pending() is called. Just skipping that case doesn't help,
> > I still get a panic in that function after about 10 calls.
>
> Weird.
> So where does it panic if you skip with sdata->dev == NULL?
>
> I don't see how sdata->dev can possibly be NULL. Hmm. Ok, I think we may
> not be recycling things correctly. Is it possible that this is a frame
> that was rejected by the device, or maybe a frame that was attempted to
> transmit, but then got into software retransmit?
I have to leave now for an hour or two, but I'll review that code after
I return. It's possible that this never happened before because skb->iif
wasn't touched by drivers, but skb->cb is.
Actually, you're using ath5k, right? So we can see what
info->control.vif points to after ath5k has used the skb, because
apparently it's a valid pointer at least, just not a real vif pointer
any more.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: [PATCH 1/3] mac80211: cooperate more with network namespaces
From: Johannes Berg @ 2009-07-27 15:59 UTC (permalink / raw)
To: Pavel Roskin; +Cc: linux-wireless
In-Reply-To: <1248708886.2688.4.camel@mj>
[-- Attachment #1: Type: text/plain, Size: 763 bytes --]
On Mon, 2009-07-27 at 11:34 -0400, Pavel Roskin wrote:
> If you mean "verify info->control.vif is not NULL", it makes no
> difference for me. No BUG is triggered. info->control.vif is never
> NULL in ieee80211_tx_pending(), but sdata->dev is NULL the second time
> ieee80211_tx_pending() is called. Just skipping that case doesn't help,
> I still get a panic in that function after about 10 calls.
Weird.
So where does it panic if you skip with sdata->dev == NULL?
I don't see how sdata->dev can possibly be NULL. Hmm. Ok, I think we may
not be recycling things correctly. Is it possible that this is a frame
that was rejected by the device, or maybe a frame that was attempted to
transmit, but then got into software retransmit?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: Possible BUG where mac80211 fails to stop queues
From: Larry Finger @ 2009-07-27 15:55 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, Michael Buesch, wireless
In-Reply-To: <1248684480.19945.45.camel@johannes.local>
Johannes Berg wrote:
> On Sun, 2009-07-26 at 17:52 -0500, Larry Finger wrote:
>> While stress testing the newest version of the open-source firmware
>> for BCM43XX devices with the latest pull of wireless-testing, I ran
>> into a problem of DMA TX queue overrun. Initially I thought this was
>> due to the firmware change; however, I got the same error with the
>> standard firmware. I have not seen this before, but it may not be a
>> regression as it seems to occur only under special circumstances.
>
> I've also seen it under extreme stress on Intel hardware, cf.
> http://thread.gmane.org/gmane.linux.kernel.wireless.general/36497
Fortunately, the b43 coding was robust enough to prevent queue
overrun, thus we just end up with a warning.
--snip--
>> The system generates the warning for ring->stopped and prints the "DMA
>> queue overflow" message.
>
> Right. Exactly the same behaviour as I'm seeing on Intel hardware.
>
>> My understanding is that mac80211 serializes the calls for each TX
>> queue, and that the TX callback should not have been entered for this
>> case.
>>
>> If I am not understanding the way that mac80211 works, please correct
>> me. I would also appreciate any suggestions for further debugging.
>
> I stared at the mac80211 code for a long time and concluded that it was
> a race condition and couldn't really be fixed, see my analysis in the
> iwlwifi patch. I'd love to be proved wrong though.
>
> Are you seeing this multiple times? I don't think you have fragmentation
> on, do you? At least I didn't and still saw the problem, which seemed a
> bit strange, but I really couldn't see any other way for it to happen.
When it occurs, I get just a single warning. Fragmentation was not on.
I will prepare a patch that acknowledges that mac80211 might send one
extra fragment after the queues are stopped and only issue a warning
if we get more than one.
Thanks,
Larry
^ permalink raw reply
* [PATCH] mac80211: do not queue work after suspend in the dynamic ps timer
From: Luis R. Rodriguez @ 2009-07-27 15:38 UTC (permalink / raw)
To: linville; +Cc: johannes, linux-wireless, Luis R. Rodriguez
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
net/mac80211/mlme.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index f60a831..ee83125 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -760,7 +760,7 @@ void ieee80211_dynamic_ps_timer(unsigned long data)
{
struct ieee80211_local *local = (void *) data;
- if (local->quiescing)
+ if (local->quiescing || local->suspended)
return;
queue_work(local->hw.workqueue, &local->dynamic_ps_enable_work);
--
1.6.3.3
^ permalink raw reply related
* Re: [PATCH] mac80211: do not queue work after suspend in the dynamic ps timer
From: Luis R. Rodriguez @ 2009-07-27 15:37 UTC (permalink / raw)
To: linville, johannes; +Cc: linux-wireless, ath9k-devel, Luis R. Rodriguez
In-Reply-To: <1248482853-17032-3-git-send-email-lrodriguez@atheros.com>
On Fri, Jul 24, 2009 at 5:47 PM, Luis R.
Rodriguez<lrodriguez@atheros.com> wrote:
> This fixes this warning during suspend <--> resume:
>
> WARNING: at net/mac80211/util.c:511 ieee80211_queue_work+0x3a/0x40 [mac80211]()
Please ignore, I'll be sending this without depending on the other
patches, separately.
Luis
^ permalink raw reply
* Re: [PATCH 1/3] mac80211: cooperate more with network namespaces
From: Pavel Roskin @ 2009-07-27 15:34 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
In-Reply-To: <1248683249.19945.29.camel@johannes.local>
On Mon, 2009-07-27 at 10:27 +0200, Johannes Berg wrote:
> Thanks Pavel,
>
> > > while (!skb_queue_empty(&local->pending[i])) {
> > > struct sk_buff *skb = __skb_dequeue(&local->pending[i]);
> > > + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
> > > + struct ieee80211_sub_if_data *sdata;
> > > +
> > > + sdata = vif_to_sdata(info->control.vif);
> > > + dev_hold(sdata->dev);
> >
> > I'm getting a panic at this point if I run hostapd on ath9k and a
> > Windows client tries to authenticate with a wrong WPA key.
> >
> > Debugging shows that sdata->dev is NULL.
>
> I suspect 'sdata' is already pointing to something bogus, since it's the
> result of a container_of().
>
> Can you try with the sanity checking patch I'm about to send?
If you mean "verify info->control.vif is not NULL", it makes no
difference for me. No BUG is triggered. info->control.vif is never
NULL in ieee80211_tx_pending(), but sdata->dev is NULL the second time
ieee80211_tx_pending() is called. Just skipping that case doesn't help,
I still get a panic in that function after about 10 calls.
--
Regards,
Pavel Roskin
^ permalink raw reply
* [PATCH] ath9k: remove unused ATH_PCI_VERSION
From: Luis R. Rodriguez @ 2009-07-27 15:30 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, Luis R. Rodriguez
Our version goes by the kernel release.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
drivers/net/wireless/ath/ath9k/main.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 1c648db..1ce1de5 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -17,8 +17,6 @@
#include <linux/nl80211.h>
#include "ath9k.h"
-#define ATH_PCI_VERSION "0.1"
-
static char *dev_info = "ath9k";
MODULE_AUTHOR("Atheros Communications");
--
1.6.3.3
^ permalink raw reply related
* Re: [PATCH] dell-laptop: Fix rfkill state setting
From: Matthew Garrett @ 2009-07-27 15:23 UTC (permalink / raw)
To: Johannes Berg; +Cc: Tim Gardner, linux-wireless
In-Reply-To: <1248707418.8500.1.camel@johannes.local>
On Mon, Jul 27, 2009 at 05:10:18PM +0200, Johannes Berg wrote:
> Hmm. The previous code was
>
> - if (status & (1<<16))
> - new_state = RFKILL_STATE_SOFT_BLOCKED;
> -
> - if (status & (1<<bit))
> - *state = new_state;
> - else
> - *state = RFKILL_STATE_UNBLOCKED;
> -
> - return 0;
>
> where new_state was initialised to RFKILL_STATE_HARD_BLOCKED.
>
> So doesn't that mean that 1<<bit is the hard-block bit? Or was the
> previous code just bogus, but happened to work since rfkill didn't
> separate the hard/soft kill concepts?
The previous code may well have been bogus. The code is basically the
only documentation I have here - bit 16 indicates that the switch is on
(and thus everything else is hard blocked), while bits 17, 18 and 19
indicate blocked wifi, bluetooth and wwan respectively. I'd assumed that
those indicated that they were soft blocked independently of the
hardware block state, but it may be that the hardware doesn't expose the
soft state if the hard switch is blocking the devices.
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply
* Re: [PATCH] dell-laptop: Fix rfkill state setting
From: Tim Gardner @ 2009-07-27 15:19 UTC (permalink / raw)
To: Johannes Berg; +Cc: mjg, linux-wireless
In-Reply-To: <1248707418.8500.1.camel@johannes.local>
Johannes Berg wrote:
> On Mon, 2009-07-27 at 08:47 -0600, Tim Gardner wrote:
>> Matthew,
>>
>> I think the rfkill state change logic is inverted. I've tried the original
>> code on 3 different Dell models. Once 'rfkill block all' is run, then you
>> can never unblock 'dell-wifi: Wireless LAN'. With this change you can get
>> it unblocked, but you need to run 'rfkill unblock all' twice (which is
>> likely an issue with rfkill).
>>
>> rtg
>>
>> From 778aec563a251418e455d63f711aab1c936bff73 Mon Sep 17 00:00:00 2001
>> From: Tim Gardner <tim.gardner@canonical.com>
>> Date: Mon, 27 Jul 2009 08:30:54 -0600
>> Subject: [PATCH] UBUNTU: [Upstream] dell-laptop: Fix rfkill state setting.
>>
>> rfkill enable/disable transitions are predicated on the state of the
>> external hardware switch, i.e., if the external switch is in the on position,
>> then no rfkill state transitions are allowed.
>>
>> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
>> ---
>> drivers/platform/x86/dell-laptop.c | 7 +++++--
>> 1 files changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
>> index 74909c4..cf40c4e 100644
>> --- a/drivers/platform/x86/dell-laptop.c
>> +++ b/drivers/platform/x86/dell-laptop.c
>> @@ -197,8 +197,11 @@ static void dell_rfkill_query(struct rfkill *rfkill, void *data)
>> dell_send_request(&buffer, 17, 11);
>> status = buffer.output[1];
>>
>> - if (status & BIT(bit))
>> - rfkill_set_hw_state(rfkill, !!(status & BIT(16)));
>> + /*
>> + * Don't change state unless the read-only HW rfkill switch is disabled.
>> + */
>> + if (status & BIT(16))
>> + rfkill_set_hw_state(rfkill, !!(status & BIT(bit)));
>
> Hmm. The previous code was
>
> - if (status & (1<<16))
> - new_state = RFKILL_STATE_SOFT_BLOCKED;
> -
> - if (status & (1<<bit))
> - *state = new_state;
> - else
> - *state = RFKILL_STATE_UNBLOCKED;
> -
> - return 0;
>
> where new_state was initialised to RFKILL_STATE_HARD_BLOCKED.
>
> So doesn't that mean that 1<<bit is the hard-block bit? Or was the
> previous code just bogus, but happened to work since rfkill didn't
> separate the hard/soft kill concepts?
>
> johannes
I'm not as familiar with the semantics of soft/hard block in the
previous incarnation of rfkill, but the above code kind of looks
correct. At least the transmitter states are forced to blocked if the
rfkill switch is enabled.
rtg
--
Tim Gardner timg@tpi.com www.tpi.com
OR 503-601-0234 x102 MT 406-443-5357
^ permalink raw reply
* Re: [PATCH] dell-laptop: Fix rfkill state setting
From: Johannes Berg @ 2009-07-27 15:10 UTC (permalink / raw)
To: Tim Gardner; +Cc: mjg, linux-wireless
In-Reply-To: <20090727144747.E7F4EF891B@sepang.rtg.net>
[-- Attachment #1: Type: text/plain, Size: 2225 bytes --]
On Mon, 2009-07-27 at 08:47 -0600, Tim Gardner wrote:
> Matthew,
>
> I think the rfkill state change logic is inverted. I've tried the original
> code on 3 different Dell models. Once 'rfkill block all' is run, then you
> can never unblock 'dell-wifi: Wireless LAN'. With this change you can get
> it unblocked, but you need to run 'rfkill unblock all' twice (which is
> likely an issue with rfkill).
>
> rtg
>
> From 778aec563a251418e455d63f711aab1c936bff73 Mon Sep 17 00:00:00 2001
> From: Tim Gardner <tim.gardner@canonical.com>
> Date: Mon, 27 Jul 2009 08:30:54 -0600
> Subject: [PATCH] UBUNTU: [Upstream] dell-laptop: Fix rfkill state setting.
>
> rfkill enable/disable transitions are predicated on the state of the
> external hardware switch, i.e., if the external switch is in the on position,
> then no rfkill state transitions are allowed.
>
> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
> ---
> drivers/platform/x86/dell-laptop.c | 7 +++++--
> 1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
> index 74909c4..cf40c4e 100644
> --- a/drivers/platform/x86/dell-laptop.c
> +++ b/drivers/platform/x86/dell-laptop.c
> @@ -197,8 +197,11 @@ static void dell_rfkill_query(struct rfkill *rfkill, void *data)
> dell_send_request(&buffer, 17, 11);
> status = buffer.output[1];
>
> - if (status & BIT(bit))
> - rfkill_set_hw_state(rfkill, !!(status & BIT(16)));
> + /*
> + * Don't change state unless the read-only HW rfkill switch is disabled.
> + */
> + if (status & BIT(16))
> + rfkill_set_hw_state(rfkill, !!(status & BIT(bit)));
Hmm. The previous code was
- if (status & (1<<16))
- new_state = RFKILL_STATE_SOFT_BLOCKED;
-
- if (status & (1<<bit))
- *state = new_state;
- else
- *state = RFKILL_STATE_UNBLOCKED;
-
- return 0;
where new_state was initialised to RFKILL_STATE_HARD_BLOCKED.
So doesn't that mean that 1<<bit is the hard-block bit? Or was the
previous code just bogus, but happened to work since rfkill didn't
separate the hard/soft kill concepts?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: [PATCH] compat-2.6: update for master-2009-07-24 wireless-testing
From: Luis R. Rodriguez @ 2009-07-27 15:08 UTC (permalink / raw)
To: Joerg Albert; +Cc: linux-wireless
In-Reply-To: <20090727092714.218550@gmx.net>
On Mon, Jul 27, 2009 at 2:27 AM, Joerg Albert<jal2@gmx.de> wrote:
> drivers/net/usb/Makefile: remove cdc-phonet
>
> Signed-off-by: Joerg Albert <jal2@gmx.de>
Didn't apply but applied something similar. Pushed out a new tarball.
git-describe for wireless-testing.git says: v2.6.31-rc4-29150-g77206c0
This is a bleeding edge compat-wireless release based on: master-2009-07-26
This is compat-release: master-2009-07-26-2-g6295a8a
Luis
^ permalink raw reply
* [PATCH] ray_cs: remove bocus NULL check at head of ray_get_wireless_stats
From: John W. Linville @ 2009-07-27 15:02 UTC (permalink / raw)
To: linux-wireless; +Cc: ettl.martin, johannes, John W. Linville
In-Reply-To: <1248705282-9951-1-git-send-email-linville@tuxdriver.com>
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Martin Ettl <ettl.martin@gmx.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
Johannes points-out that the NULL check is mostly bogus given how
netdev_priv is computed and how get_wireless_stats gets called...
drivers/net/wireless/ray_cs.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 698b11b..8fdea7f 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -1511,9 +1511,6 @@ static iw_stats *ray_get_wireless_stats(struct net_device *dev)
struct pcmcia_device *link = local->finder;
struct status __iomem *p = local->sram + STATUS_BASE;
- if (local == (ray_dev_t *) NULL)
- return (iw_stats *) NULL;
-
local->wstats.status = local->card_status;
#ifdef WIRELESS_SPY
if ((local->spy_data.spy_number > 0)
--
1.6.2.5
^ permalink raw reply related
* Re: [PATCH] dell-laptop: Fix rfkill state setting
From: Matthew Garrett @ 2009-07-27 14:53 UTC (permalink / raw)
To: Tim Gardner; +Cc: johannes, linux-wireless
In-Reply-To: <20090727144747.E7F4EF891B@sepang.rtg.net>
On Mon, Jul 27, 2009 at 08:47:47AM -0600, Tim Gardner wrote:
> Matthew,
>
> I think the rfkill state change logic is inverted. I've tried the original
> code on 3 different Dell models. Once 'rfkill block all' is run, then you
> can never unblock 'dell-wifi: Wireless LAN'. With this change you can get
> it unblocked, but you need to run 'rfkill unblock all' twice (which is
> likely an issue with rfkill).
Yes, there's clearly an issue of some sort here. I'll dig out a Dell and
test this, but it looks good.
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply
* [PATCH] dell-laptop: Fix rfkill state setting
From: Tim Gardner @ 2009-07-27 14:47 UTC (permalink / raw)
To: mjg; +Cc: johannes, linux-wireless
Matthew,
I think the rfkill state change logic is inverted. I've tried the original
code on 3 different Dell models. Once 'rfkill block all' is run, then you
can never unblock 'dell-wifi: Wireless LAN'. With this change you can get
it unblocked, but you need to run 'rfkill unblock all' twice (which is
likely an issue with rfkill).
rtg
>From 778aec563a251418e455d63f711aab1c936bff73 Mon Sep 17 00:00:00 2001
From: Tim Gardner <tim.gardner@canonical.com>
Date: Mon, 27 Jul 2009 08:30:54 -0600
Subject: [PATCH] UBUNTU: [Upstream] dell-laptop: Fix rfkill state setting.
rfkill enable/disable transitions are predicated on the state of the
external hardware switch, i.e., if the external switch is in the on position,
then no rfkill state transitions are allowed.
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
drivers/platform/x86/dell-laptop.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index 74909c4..cf40c4e 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -197,8 +197,11 @@ static void dell_rfkill_query(struct rfkill *rfkill, void *data)
dell_send_request(&buffer, 17, 11);
status = buffer.output[1];
- if (status & BIT(bit))
- rfkill_set_hw_state(rfkill, !!(status & BIT(16)));
+ /*
+ * Don't change state unless the read-only HW rfkill switch is disabled.
+ */
+ if (status & BIT(16))
+ rfkill_set_hw_state(rfkill, !!(status & BIT(bit)));
}
static const struct rfkill_ops dell_rfkill_ops = {
--
1.6.2.4
^ permalink raw reply related
* [PATCH] ray_cs: avoid potential null dereference in ray_get_wireless_stats
From: John W. Linville @ 2009-07-27 14:34 UTC (permalink / raw)
To: linux-wireless; +Cc: ettl.martin, John W. Linville
http://bugzilla.kernel.org/show_bug.cgi?id=13854
Reported-by: Martin Ettl <ettl.martin@gmx.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
drivers/net/wireless/ray_cs.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 698b11b..a4308a6 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -1508,11 +1508,13 @@ static int ray_commit(struct net_device *dev, struct iw_request_info *info, /* N
static iw_stats *ray_get_wireless_stats(struct net_device *dev)
{
ray_dev_t *local = netdev_priv(dev);
- struct pcmcia_device *link = local->finder;
- struct status __iomem *p = local->sram + STATUS_BASE;
+ struct pcmcia_device *link;
+ struct status __iomem *p;
if (local == (ray_dev_t *) NULL)
return (iw_stats *) NULL;
+ link = local->finder;
+ p = local->sram + STATUS_BASE;
local->wstats.status = local->card_status;
#ifdef WIRELESS_SPY
--
1.6.2.5
^ permalink raw reply related
* [PATCH/RFC] wireless: remove get_tx_stats
From: Bob Copeland @ 2009-07-27 14:45 UTC (permalink / raw)
To: linux-wireless
This seems like a useful function, but as far as I can tell we aren't
actually calling it from anywhere. Any reason to keep it around?
Removing it saves a few k of text on an allyesconfig kernel.
text data bss dec hex filename
71007474 4631733 26855960 102495167 61bf3bf vmlinux.orig
71002218 4631585 26854216 102488019 61bd7d3 vmlinux
---
drivers/net/wireless/adm8211.c | 13 ---------
drivers/net/wireless/ath/ar9170/main.c | 13 ---------
drivers/net/wireless/ath/ath5k/base.c | 18 -------------
drivers/net/wireless/ath/ath5k/base.h | 1 -
drivers/net/wireless/b43/main.c | 24 ------------------
drivers/net/wireless/b43/pio.c | 19 --------------
drivers/net/wireless/b43/pio.h | 2 -
drivers/net/wireless/b43legacy/dma.c | 19 --------------
drivers/net/wireless/b43legacy/dma.h | 8 ------
drivers/net/wireless/b43legacy/main.c | 24 ------------------
drivers/net/wireless/b43legacy/pio.c | 12 ---------
drivers/net/wireless/b43legacy/pio.h | 2 -
drivers/net/wireless/iwlwifi/iwl-agn.c | 1 -
drivers/net/wireless/iwlwifi/iwl-core.c | 36 ---------------------------
drivers/net/wireless/iwlwifi/iwl-core.h | 2 -
drivers/net/wireless/iwlwifi/iwl3945-base.c | 1 -
drivers/net/wireless/mwl8k.c | 18 -------------
drivers/net/wireless/p54/main.c | 11 --------
drivers/net/wireless/rt2x00/rt2400pci.c | 1 -
drivers/net/wireless/rt2x00/rt2500pci.c | 1 -
drivers/net/wireless/rt2x00/rt2500usb.c | 1 -
drivers/net/wireless/rt2x00/rt2800usb.c | 1 -
drivers/net/wireless/rt2x00/rt2x00.h | 2 -
drivers/net/wireless/rt2x00/rt2x00mac.c | 16 ------------
drivers/net/wireless/rt2x00/rt61pci.c | 1 -
drivers/net/wireless/rt2x00/rt73usb.c | 1 -
include/net/mac80211.h | 8 ------
net/mac80211/driver-ops.h | 8 ------
net/mac80211/driver-trace.h | 23 -----------------
29 files changed, 0 insertions(+), 287 deletions(-)
diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
index 5695911..8ee31d6 100644
--- a/drivers/net/wireless/adm8211.c
+++ b/drivers/net/wireless/adm8211.c
@@ -302,18 +302,6 @@ static int adm8211_get_stats(struct ieee80211_hw *dev,
return 0;
}
-static int adm8211_get_tx_stats(struct ieee80211_hw *dev,
- struct ieee80211_tx_queue_stats *stats)
-{
- struct adm8211_priv *priv = dev->priv;
-
- stats[0].len = priv->cur_tx - priv->dirty_tx;
- stats[0].limit = priv->tx_ring_size - 2;
- stats[0].count = priv->dirty_tx;
-
- return 0;
-}
-
static void adm8211_interrupt_tci(struct ieee80211_hw *dev)
{
struct adm8211_priv *priv = dev->priv;
@@ -1759,7 +1747,6 @@ static const struct ieee80211_ops adm8211_ops = {
.bss_info_changed = adm8211_bss_info_changed,
.configure_filter = adm8211_configure_filter,
.get_stats = adm8211_get_stats,
- .get_tx_stats = adm8211_get_tx_stats,
.get_tsf = adm8211_get_tsft
};
diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
index c7287a8..1c6cbdd 100644
--- a/drivers/net/wireless/ath/ar9170/main.c
+++ b/drivers/net/wireless/ath/ar9170/main.c
@@ -2434,18 +2434,6 @@ static int ar9170_get_stats(struct ieee80211_hw *hw,
return 0;
}
-static int ar9170_get_tx_stats(struct ieee80211_hw *hw,
- struct ieee80211_tx_queue_stats *tx_stats)
-{
- struct ar9170 *ar = hw->priv;
-
- spin_lock_bh(&ar->tx_stats_lock);
- memcpy(tx_stats, ar->tx_stats, sizeof(tx_stats[0]) * hw->queues);
- spin_unlock_bh(&ar->tx_stats_lock);
-
- return 0;
-}
-
static int ar9170_conf_tx(struct ieee80211_hw *hw, u16 queue,
const struct ieee80211_tx_queue_params *param)
{
@@ -2544,7 +2532,6 @@ static const struct ieee80211_ops ar9170_ops = {
.set_key = ar9170_set_key,
.sta_notify = ar9170_sta_notify,
.get_stats = ar9170_get_stats,
- .get_tx_stats = ar9170_get_tx_stats,
.ampdu_action = ar9170_ampdu_action,
};
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 7db32ce..80f992b 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -239,8 +239,6 @@ static int ath5k_set_key(struct ieee80211_hw *hw,
struct ieee80211_key_conf *key);
static int ath5k_get_stats(struct ieee80211_hw *hw,
struct ieee80211_low_level_stats *stats);
-static int ath5k_get_tx_stats(struct ieee80211_hw *hw,
- struct ieee80211_tx_queue_stats *stats);
static u64 ath5k_get_tsf(struct ieee80211_hw *hw);
static void ath5k_set_tsf(struct ieee80211_hw *hw, u64 tsf);
static void ath5k_reset_tsf(struct ieee80211_hw *hw);
@@ -264,7 +262,6 @@ static const struct ieee80211_ops ath5k_hw_ops = {
.set_key = ath5k_set_key,
.get_stats = ath5k_get_stats,
.conf_tx = NULL,
- .get_tx_stats = ath5k_get_tx_stats,
.get_tsf = ath5k_get_tsf,
.set_tsf = ath5k_set_tsf,
.reset_tsf = ath5k_reset_tsf,
@@ -1313,7 +1310,6 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf,
spin_lock_bh(&txq->lock);
list_add_tail(&bf->list, &txq->q);
- sc->tx_stats[txq->qnum].len++;
if (txq->link == NULL) /* is this first packet? */
ath5k_hw_set_txdp(ah, txq->qnum, bf->daddr);
else /* no, so only link it */
@@ -1546,7 +1542,6 @@ ath5k_txq_drainq(struct ath5k_softc *sc, struct ath5k_txq *txq)
ath5k_txbuf_free(sc, bf);
spin_lock_bh(&sc->txbuflock);
- sc->tx_stats[txq->qnum].len--;
list_move_tail(&bf->list, &sc->txbuf);
sc->txbuf_len++;
spin_unlock_bh(&sc->txbuflock);
@@ -1980,10 +1975,8 @@ ath5k_tx_processq(struct ath5k_softc *sc, struct ath5k_txq *txq)
}
ieee80211_tx_status(sc->hw, skb);
- sc->tx_stats[txq->qnum].count++;
spin_lock(&sc->txbuflock);
- sc->tx_stats[txq->qnum].len--;
list_move_tail(&bf->list, &sc->txbuf);
sc->txbuf_len++;
spin_unlock(&sc->txbuflock);
@@ -3039,17 +3032,6 @@ ath5k_get_stats(struct ieee80211_hw *hw,
return 0;
}
-static int
-ath5k_get_tx_stats(struct ieee80211_hw *hw,
- struct ieee80211_tx_queue_stats *stats)
-{
- struct ath5k_softc *sc = hw->priv;
-
- memcpy(stats, &sc->tx_stats, sizeof(sc->tx_stats));
-
- return 0;
-}
-
static u64
ath5k_get_tsf(struct ieee80211_hw *hw)
{
diff --git a/drivers/net/wireless/ath/ath5k/base.h b/drivers/net/wireless/ath/ath5k/base.h
index 778e422..1912ee7 100644
--- a/drivers/net/wireless/ath/ath5k/base.h
+++ b/drivers/net/wireless/ath/ath5k/base.h
@@ -114,7 +114,6 @@ struct ath5k_softc {
struct pci_dev *pdev; /* for dma mapping */
void __iomem *iobase; /* address of the device */
struct mutex lock; /* dev-level lock */
- struct ieee80211_tx_queue_stats tx_stats[AR5K_NUM_TX_QUEUES];
struct ieee80211_low_level_stats ll_stats;
struct ieee80211_hw *hw; /* IEEE 802.11 common */
struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 3f4360a..5fce8de 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -3229,29 +3229,6 @@ out_unlock:
return err;
}
-static int b43_op_get_tx_stats(struct ieee80211_hw *hw,
- struct ieee80211_tx_queue_stats *stats)
-{
- struct b43_wl *wl = hw_to_b43_wl(hw);
- struct b43_wldev *dev = wl->current_dev;
- unsigned long flags;
- int err = -ENODEV;
-
- if (!dev)
- goto out;
- spin_lock_irqsave(&wl->irq_lock, flags);
- if (likely(b43_status(dev) >= B43_STAT_STARTED)) {
- if (b43_using_pio_transfers(dev))
- b43_pio_get_tx_stats(dev, stats);
- else
- b43_dma_get_tx_stats(dev, stats);
- err = 0;
- }
- spin_unlock_irqrestore(&wl->irq_lock, flags);
-out:
- return err;
-}
-
static int b43_op_get_stats(struct ieee80211_hw *hw,
struct ieee80211_low_level_stats *stats)
{
@@ -4444,7 +4421,6 @@ static const struct ieee80211_ops b43_hw_ops = {
.configure_filter = b43_op_configure_filter,
.set_key = b43_op_set_key,
.get_stats = b43_op_get_stats,
- .get_tx_stats = b43_op_get_tx_stats,
.get_tsf = b43_op_get_tsf,
.set_tsf = b43_op_set_tsf,
.start = b43_op_start,
diff --git a/drivers/net/wireless/b43/pio.c b/drivers/net/wireless/b43/pio.c
index 69138e8..07b4491 100644
--- a/drivers/net/wireless/b43/pio.c
+++ b/drivers/net/wireless/b43/pio.c
@@ -607,25 +607,6 @@ void b43_pio_handle_txstatus(struct b43_wldev *dev,
spin_unlock(&q->lock);
}
-void b43_pio_get_tx_stats(struct b43_wldev *dev,
- struct ieee80211_tx_queue_stats *stats)
-{
- const int nr_queues = dev->wl->hw->queues;
- struct b43_pio_txqueue *q;
- unsigned long flags;
- int i;
-
- for (i = 0; i < nr_queues; i++) {
- q = select_queue_by_priority(dev, i);
-
- spin_lock_irqsave(&q->lock, flags);
- stats[i].len = B43_PIO_MAX_NR_TXPACKETS - q->free_packet_slots;
- stats[i].limit = B43_PIO_MAX_NR_TXPACKETS;
- stats[i].count = q->nr_tx_packets;
- spin_unlock_irqrestore(&q->lock, flags);
- }
-}
-
/* Returns whether we should fetch another frame. */
static bool pio_rx_frame(struct b43_pio_rxqueue *q)
{
diff --git a/drivers/net/wireless/b43/pio.h b/drivers/net/wireless/b43/pio.h
index 6c174c9..603820c 100644
--- a/drivers/net/wireless/b43/pio.h
+++ b/drivers/net/wireless/b43/pio.h
@@ -168,8 +168,6 @@ void b43_pio_free(struct b43_wldev *dev);
int b43_pio_tx(struct b43_wldev *dev, struct sk_buff *skb);
void b43_pio_handle_txstatus(struct b43_wldev *dev,
const struct b43_txstatus *status);
-void b43_pio_get_tx_stats(struct b43_wldev *dev,
- struct ieee80211_tx_queue_stats *stats);
void b43_pio_rx(struct b43_pio_rxqueue *q);
void b43_pio_tx_suspend(struct b43_wldev *dev);
diff --git a/drivers/net/wireless/b43legacy/dma.c b/drivers/net/wireless/b43legacy/dma.c
index 2f90fb9..505812e 100644
--- a/drivers/net/wireless/b43legacy/dma.c
+++ b/drivers/net/wireless/b43legacy/dma.c
@@ -1504,25 +1504,6 @@ void b43legacy_dma_handle_txstatus(struct b43legacy_wldev *dev,
spin_unlock(&ring->lock);
}
-void b43legacy_dma_get_tx_stats(struct b43legacy_wldev *dev,
- struct ieee80211_tx_queue_stats *stats)
-{
- const int nr_queues = dev->wl->hw->queues;
- struct b43legacy_dmaring *ring;
- unsigned long flags;
- int i;
-
- for (i = 0; i < nr_queues; i++) {
- ring = priority_to_txring(dev, i);
-
- spin_lock_irqsave(&ring->lock, flags);
- stats[i].len = ring->used_slots / SLOTS_PER_PACKET;
- stats[i].limit = ring->nr_slots / SLOTS_PER_PACKET;
- stats[i].count = ring->nr_tx_packets;
- spin_unlock_irqrestore(&ring->lock, flags);
- }
-}
-
static void dma_rx(struct b43legacy_dmaring *ring,
int *slot)
{
diff --git a/drivers/net/wireless/b43legacy/dma.h b/drivers/net/wireless/b43legacy/dma.h
index 2f18600..a7dac14 100644
--- a/drivers/net/wireless/b43legacy/dma.h
+++ b/drivers/net/wireless/b43legacy/dma.h
@@ -292,9 +292,6 @@ void b43legacy_dma_free(struct b43legacy_wldev *dev);
void b43legacy_dma_tx_suspend(struct b43legacy_wldev *dev);
void b43legacy_dma_tx_resume(struct b43legacy_wldev *dev);
-void b43legacy_dma_get_tx_stats(struct b43legacy_wldev *dev,
- struct ieee80211_tx_queue_stats *stats);
-
int b43legacy_dma_tx(struct b43legacy_wldev *dev,
struct sk_buff *skb);
void b43legacy_dma_handle_txstatus(struct b43legacy_wldev *dev,
@@ -315,11 +312,6 @@ void b43legacy_dma_free(struct b43legacy_wldev *dev)
{
}
static inline
-void b43legacy_dma_get_tx_stats(struct b43legacy_wldev *dev,
- struct ieee80211_tx_queue_stats *stats)
-{
-}
-static inline
int b43legacy_dma_tx(struct b43legacy_wldev *dev,
struct sk_buff *skb)
{
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index c4973c1..cc8498c 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -2443,29 +2443,6 @@ static int b43legacy_op_conf_tx(struct ieee80211_hw *hw, u16 queue,
return 0;
}
-static int b43legacy_op_get_tx_stats(struct ieee80211_hw *hw,
- struct ieee80211_tx_queue_stats *stats)
-{
- struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw);
- struct b43legacy_wldev *dev = wl->current_dev;
- unsigned long flags;
- int err = -ENODEV;
-
- if (!dev)
- goto out;
- spin_lock_irqsave(&wl->irq_lock, flags);
- if (likely(b43legacy_status(dev) >= B43legacy_STAT_STARTED)) {
- if (b43legacy_using_pio(dev))
- b43legacy_pio_get_tx_stats(dev, stats);
- else
- b43legacy_dma_get_tx_stats(dev, stats);
- err = 0;
- }
- spin_unlock_irqrestore(&wl->irq_lock, flags);
-out:
- return err;
-}
-
static int b43legacy_op_get_stats(struct ieee80211_hw *hw,
struct ieee80211_low_level_stats *stats)
{
@@ -3506,7 +3483,6 @@ static const struct ieee80211_ops b43legacy_hw_ops = {
.bss_info_changed = b43legacy_op_bss_info_changed,
.configure_filter = b43legacy_op_configure_filter,
.get_stats = b43legacy_op_get_stats,
- .get_tx_stats = b43legacy_op_get_tx_stats,
.start = b43legacy_op_start,
.stop = b43legacy_op_stop,
.set_tim = b43legacy_op_beacon_set_tim,
diff --git a/drivers/net/wireless/b43legacy/pio.c b/drivers/net/wireless/b43legacy/pio.c
index 51866c9..3c743f2 100644
--- a/drivers/net/wireless/b43legacy/pio.c
+++ b/drivers/net/wireless/b43legacy/pio.c
@@ -546,18 +546,6 @@ void b43legacy_pio_handle_txstatus(struct b43legacy_wldev *dev,
tasklet_schedule(&queue->txtask);
}
-void b43legacy_pio_get_tx_stats(struct b43legacy_wldev *dev,
- struct ieee80211_tx_queue_stats *stats)
-{
- struct b43legacy_pio *pio = &dev->pio;
- struct b43legacy_pioqueue *queue;
-
- queue = pio->queue1;
- stats[0].len = B43legacy_PIO_MAXTXPACKETS - queue->nr_txfree;
- stats[0].limit = B43legacy_PIO_MAXTXPACKETS;
- stats[0].count = queue->nr_tx_packets;
-}
-
static void pio_rx_error(struct b43legacy_pioqueue *queue,
int clear_buffers,
const char *error)
diff --git a/drivers/net/wireless/b43legacy/pio.h b/drivers/net/wireless/b43legacy/pio.h
index 464fec0..d89ebca 100644
--- a/drivers/net/wireless/b43legacy/pio.h
+++ b/drivers/net/wireless/b43legacy/pio.h
@@ -106,8 +106,6 @@ int b43legacy_pio_tx(struct b43legacy_wldev *dev,
struct sk_buff *skb);
void b43legacy_pio_handle_txstatus(struct b43legacy_wldev *dev,
const struct b43legacy_txstatus *status);
-void b43legacy_pio_get_tx_stats(struct b43legacy_wldev *dev,
- struct ieee80211_tx_queue_stats *stats);
void b43legacy_pio_rx(struct b43legacy_pioqueue *queue);
/* Suspend TX queue in hardware. */
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 4cb1a1b..fb7039c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2799,7 +2799,6 @@ static struct ieee80211_ops iwl_hw_ops = {
.set_key = iwl_mac_set_key,
.update_tkip_key = iwl_mac_update_tkip_key,
.get_stats = iwl_mac_get_stats,
- .get_tx_stats = iwl_mac_get_tx_stats,
.conf_tx = iwl_mac_conf_tx,
.reset_tsf = iwl_mac_reset_tsf,
.bss_info_changed = iwl_bss_info_changed,
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index b6db955..4bc15ea 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -2859,42 +2859,6 @@ out:
}
EXPORT_SYMBOL(iwl_mac_config);
-int iwl_mac_get_tx_stats(struct ieee80211_hw *hw,
- struct ieee80211_tx_queue_stats *stats)
-{
- struct iwl_priv *priv = hw->priv;
- int i, avail;
- struct iwl_tx_queue *txq;
- struct iwl_queue *q;
- unsigned long flags;
-
- IWL_DEBUG_MAC80211(priv, "enter\n");
-
- if (!iwl_is_ready_rf(priv)) {
- IWL_DEBUG_MAC80211(priv, "leave - RF not ready\n");
- return -EIO;
- }
-
- spin_lock_irqsave(&priv->lock, flags);
-
- for (i = 0; i < AC_NUM; i++) {
- txq = &priv->txq[i];
- q = &txq->q;
- avail = iwl_queue_space(q);
-
- stats[i].len = q->n_window - avail;
- stats[i].limit = q->n_window - q->high_mark;
- stats[i].count = q->n_window;
-
- }
- spin_unlock_irqrestore(&priv->lock, flags);
-
- IWL_DEBUG_MAC80211(priv, "leave\n");
-
- return 0;
-}
-EXPORT_SYMBOL(iwl_mac_get_tx_stats);
-
void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
{
struct iwl_priv *priv = hw->priv;
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index febcf76..653a120 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -294,8 +294,6 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw,
struct ieee80211_if_init_conf *conf);
int iwl_mac_config(struct ieee80211_hw *hw, u32 changed);
void iwl_config_ap(struct iwl_priv *priv);
-int iwl_mac_get_tx_stats(struct ieee80211_hw *hw,
- struct ieee80211_tx_queue_stats *stats);
void iwl_mac_reset_tsf(struct ieee80211_hw *hw);
/*****************************************************
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 5ded898..66dbba2 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -3810,7 +3810,6 @@ static struct ieee80211_ops iwl3945_hw_ops = {
.config = iwl_mac_config,
.configure_filter = iwl_configure_filter,
.set_key = iwl3945_mac_set_key,
- .get_tx_stats = iwl_mac_get_tx_stats,
.conf_tx = iwl_mac_conf_tx,
.reset_tsf = iwl_mac_reset_tsf,
.bss_info_changed = iwl_bss_info_changed,
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 4f72547..8fe9aaa 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -3372,23 +3372,6 @@ static int mwl8k_conf_tx(struct ieee80211_hw *hw, u16 queue,
return rc;
}
-static int mwl8k_get_tx_stats(struct ieee80211_hw *hw,
- struct ieee80211_tx_queue_stats *stats)
-{
- struct mwl8k_priv *priv = hw->priv;
- struct mwl8k_tx_queue *txq;
- int index;
-
- spin_lock_bh(&priv->tx_lock);
- for (index = 0; index < MWL8K_TX_QUEUES; index++) {
- txq = priv->txq + index;
- memcpy(&stats[index], &txq->tx_stats,
- sizeof(struct ieee80211_tx_queue_stats));
- }
- spin_unlock_bh(&priv->tx_lock);
- return 0;
-}
-
struct mwl8k_get_stats_worker {
struct mwl8k_work_struct header;
struct ieee80211_low_level_stats *stats;
@@ -3437,7 +3420,6 @@ static const struct ieee80211_ops mwl8k_ops = {
.configure_filter = mwl8k_configure_filter,
.set_rts_threshold = mwl8k_set_rts_threshold,
.conf_tx = mwl8k_conf_tx,
- .get_tx_stats = mwl8k_get_tx_stats,
.get_stats = mwl8k_get_stats,
};
diff --git a/drivers/net/wireless/p54/main.c b/drivers/net/wireless/p54/main.c
index 955f6d7..f7f0446 100644
--- a/drivers/net/wireless/p54/main.c
+++ b/drivers/net/wireless/p54/main.c
@@ -353,16 +353,6 @@ static int p54_get_stats(struct ieee80211_hw *dev,
return 0;
}
-static int p54_get_tx_stats(struct ieee80211_hw *dev,
- struct ieee80211_tx_queue_stats *stats)
-{
- struct p54_common *priv = dev->priv;
-
- memcpy(stats, &priv->tx_stats[P54_QUEUE_DATA],
- sizeof(stats[0]) * dev->queues);
- return 0;
-}
-
static void p54_bss_info_changed(struct ieee80211_hw *dev,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *info,
@@ -517,7 +507,6 @@ static const struct ieee80211_ops p54_ops = {
.configure_filter = p54_configure_filter,
.conf_tx = p54_conf_tx,
.get_stats = p54_get_stats,
- .get_tx_stats = p54_get_tx_stats
};
struct ieee80211_hw *p54_init_common(size_t priv_data_len)
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 30185ad..38ebd8e 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1565,7 +1565,6 @@ static const struct ieee80211_ops rt2400pci_mac80211_ops = {
.get_stats = rt2x00mac_get_stats,
.bss_info_changed = rt2x00mac_bss_info_changed,
.conf_tx = rt2400pci_conf_tx,
- .get_tx_stats = rt2x00mac_get_tx_stats,
.get_tsf = rt2400pci_get_tsf,
.tx_last_beacon = rt2400pci_tx_last_beacon,
.rfkill_poll = rt2x00mac_rfkill_poll,
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 3b31715..4ef5946 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1864,7 +1864,6 @@ static const struct ieee80211_ops rt2500pci_mac80211_ops = {
.get_stats = rt2x00mac_get_stats,
.bss_info_changed = rt2x00mac_bss_info_changed,
.conf_tx = rt2x00mac_conf_tx,
- .get_tx_stats = rt2x00mac_get_tx_stats,
.get_tsf = rt2500pci_get_tsf,
.tx_last_beacon = rt2500pci_tx_last_beacon,
.rfkill_poll = rt2x00mac_rfkill_poll,
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index de48c5c..36bf046 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1901,7 +1901,6 @@ static const struct ieee80211_ops rt2500usb_mac80211_ops = {
.get_stats = rt2x00mac_get_stats,
.bss_info_changed = rt2x00mac_bss_info_changed,
.conf_tx = rt2x00mac_conf_tx,
- .get_tx_stats = rt2x00mac_get_tx_stats,
.rfkill_poll = rt2x00mac_rfkill_poll,
};
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index 9efb417..fc2a5c3 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -2791,7 +2791,6 @@ static const struct ieee80211_ops rt2800usb_mac80211_ops = {
.set_rts_threshold = rt2800usb_set_rts_threshold,
.bss_info_changed = rt2x00mac_bss_info_changed,
.conf_tx = rt2800usb_conf_tx,
- .get_tx_stats = rt2x00mac_get_tx_stats,
.get_tsf = rt2800usb_get_tsf,
.rfkill_poll = rt2x00mac_rfkill_poll,
};
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index cbec91e..329478c 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -973,8 +973,6 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
#endif /* CONFIG_RT2X00_LIB_CRYPTO */
int rt2x00mac_get_stats(struct ieee80211_hw *hw,
struct ieee80211_low_level_stats *stats);
-int rt2x00mac_get_tx_stats(struct ieee80211_hw *hw,
- struct ieee80211_tx_queue_stats *stats);
void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *bss_conf,
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index 7de1a2c..7cbf5c4 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -560,22 +560,6 @@ int rt2x00mac_get_stats(struct ieee80211_hw *hw,
}
EXPORT_SYMBOL_GPL(rt2x00mac_get_stats);
-int rt2x00mac_get_tx_stats(struct ieee80211_hw *hw,
- struct ieee80211_tx_queue_stats *stats)
-{
- struct rt2x00_dev *rt2x00dev = hw->priv;
- unsigned int i;
-
- for (i = 0; i < rt2x00dev->ops->tx_queues; i++) {
- stats[i].len = rt2x00dev->tx[i].length;
- stats[i].limit = rt2x00dev->tx[i].limit;
- stats[i].count = rt2x00dev->tx[i].count;
- }
-
- return 0;
-}
-EXPORT_SYMBOL_GPL(rt2x00mac_get_tx_stats);
-
void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *bss_conf,
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index fb95b8c..41f665c 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2721,7 +2721,6 @@ static const struct ieee80211_ops rt61pci_mac80211_ops = {
.get_stats = rt2x00mac_get_stats,
.bss_info_changed = rt2x00mac_bss_info_changed,
.conf_tx = rt61pci_conf_tx,
- .get_tx_stats = rt2x00mac_get_tx_stats,
.get_tsf = rt61pci_get_tsf,
.rfkill_poll = rt2x00mac_rfkill_poll,
};
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 4f9b177..de0296c 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2246,7 +2246,6 @@ static const struct ieee80211_ops rt73usb_mac80211_ops = {
.get_stats = rt2x00mac_get_stats,
.bss_info_changed = rt2x00mac_bss_info_changed,
.conf_tx = rt73usb_conf_tx,
- .get_tx_stats = rt2x00mac_get_tx_stats,
.get_tsf = rt73usb_get_tsf,
.rfkill_poll = rt2x00mac_rfkill_poll,
};
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index d4e09a0..8e3b982 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1388,12 +1388,6 @@ enum ieee80211_ampdu_mlme_action {
* bursting) for a hardware TX queue.
* Returns a negative error code on failure.
*
- * @get_tx_stats: Get statistics of the current TX queue status. This is used
- * to get number of currently queued packets (queue length), maximum queue
- * size (limit), and total number of packets sent using each TX queue
- * (count). The 'stats' pointer points to an array that has hw->queues
- * items.
- *
* @get_tsf: Get the current TSF timer value from firmware/hardware. Currently,
* this is only used for IBSS mode BSSID merging and debugging. Is not a
* required function.
@@ -1464,8 +1458,6 @@ struct ieee80211_ops {
enum sta_notify_cmd, struct ieee80211_sta *sta);
int (*conf_tx)(struct ieee80211_hw *hw, u16 queue,
const struct ieee80211_tx_queue_params *params);
- int (*get_tx_stats)(struct ieee80211_hw *hw,
- struct ieee80211_tx_queue_stats *stats);
u64 (*get_tsf)(struct ieee80211_hw *hw);
void (*set_tsf)(struct ieee80211_hw *hw, u64 tsf);
void (*reset_tsf)(struct ieee80211_hw *hw);
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 4100c36..e7f3e8b 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -170,14 +170,6 @@ static inline int drv_conf_tx(struct ieee80211_local *local, u16 queue,
return ret;
}
-static inline int drv_get_tx_stats(struct ieee80211_local *local,
- struct ieee80211_tx_queue_stats *stats)
-{
- int ret = local->ops->get_tx_stats(&local->hw, stats);
- trace_drv_get_tx_stats(local, stats, ret);
- return ret;
-}
-
static inline u64 drv_get_tsf(struct ieee80211_local *local)
{
u64 ret = -1ULL;
diff --git a/net/mac80211/driver-trace.h b/net/mac80211/driver-trace.h
index 5a10da2..54086cc 100644
--- a/net/mac80211/driver-trace.h
+++ b/net/mac80211/driver-trace.h
@@ -504,29 +504,6 @@ TRACE_EVENT(drv_conf_tx,
)
);
-TRACE_EVENT(drv_get_tx_stats,
- TP_PROTO(struct ieee80211_local *local,
- struct ieee80211_tx_queue_stats *stats,
- int ret),
-
- TP_ARGS(local, stats, ret),
-
- TP_STRUCT__entry(
- LOCAL_ENTRY
- __field(int, ret)
- ),
-
- TP_fast_assign(
- LOCAL_ASSIGN;
- __entry->ret = ret;
- ),
-
- TP_printk(
- LOCAL_PR_FMT " ret:%d",
- LOCAL_PR_ARG, __entry->ret
- )
-);
-
TRACE_EVENT(drv_get_tsf,
TP_PROTO(struct ieee80211_local *local, u64 ret),
--
1.6.2.5
--
Bob Copeland %% www.bobcopeland.com
^ permalink raw reply related
* [PATCH v2 12/14] iwlwifi: debugFs to enable/disable HT40 support
From: Guy, Wey-Yi @ 2009-07-27 14:37 UTC (permalink / raw)
To: linville@tuxdriver.com, linux-wireless@vger.kernel.org,
ipw3945-devel@lists.sourceforge.net, Gábor Stefanik
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Add debugfs file to enable/disable HT40(40MHz) channel support.
By default, 40MHz is supported if AP can support the function.
By echo "1" to "disable_ht40_mode" file, iwlwifi driver will disable the
40MHz support and only allow 20MHz channel.
Because the information exchange happen during association time,
so enable/disable fat channel only can be performed when it is not
associated with AP.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
v2: namene change from "fat" to "HT40"
---
drivers/net/wireless/iwlwifi/iwl-core.c | 4 ++
drivers/net/wireless/iwlwifi/iwl-debug.h | 1 +
drivers/net/wireless/iwlwifi/iwl-debugfs.c | 46
++++++++++++++++++++++++++++
drivers/net/wireless/iwlwifi/iwl-dev.h | 1 +
4 files changed, 52 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c
b/drivers/net/wireless/iwlwifi/iwl-core.c
index 710dd41..a4be19e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -632,6 +632,10 @@ u8 iwl_is_fat_tx_allowed(struct iwl_priv *priv,
if (!sta_ht_inf->ht_supported)
return 0;
}
+#ifdef CONFIG_IWLWIFI_DEBUG
+ if (priv->disable_ht40)
+ return 0;
+#endif
return iwl_is_channel_extension(priv, priv->band,
le16_to_cpu(priv->staging_rxon.channel),
iwl_ht_conf->extension_chan_offset);
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h
b/drivers/net/wireless/iwlwifi/iwl-debug.h
index 609a681..8aa93f2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debug.h
+++ b/drivers/net/wireless/iwlwifi/iwl-debug.h
@@ -88,6 +88,7 @@ struct iwl_debugfs {
#ifdef CONFIG_IWLWIFI_LEDS
struct dentry *file_led;
#endif
+ struct dentry *file_disable_ht40_mode;
} dbgfs_data_files;
struct dir_rf_files {
struct dentry *file_disable_sensitivity;
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 748dc31..06113bb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -653,6 +653,49 @@ static ssize_t
iwl_dbgfs_thermal_throttling_read(struct file *file,
return ret;
}
+static ssize_t iwl_dbgfs_disable_ht40_mode_write(struct file *file,
+ const char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct iwl_priv *priv = file->private_data;
+ char buf[8];
+ int buf_size;
+ int ht40_mode;
+
+ memset(buf, 0, sizeof(buf));
+ buf_size = min(count, sizeof(buf) - 1);
+ if (copy_from_user(buf, user_buf, buf_size))
+ return -EFAULT;
+ if (sscanf(buf, "%d", &ht40_mode) != 1)
+ return -EFAULT;
+ if (!iwl_is_associated(priv))
+ priv->disable_ht40 = ht40_mode ? true : false;
+ else {
+ IWL_ERR(priv, "Sta associated with AP - "
+ "Change fat mode is not allowed\n");
+ return -EINVAL;
+ }
+
+ return count;
+}
+
+static ssize_t iwl_dbgfs_disable_ht40_mode_read(struct file *file,
+ char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
+ char buf[100];
+ int pos = 0;
+ const size_t bufsz = sizeof(buf);
+ ssize_t ret;
+
+ pos += scnprintf(buf + pos, bufsz - pos,
+ "11n 40Mhz Mode: %s\n",
+ priv->disable_ht40 ? "Disabled" : "Enabled");
+ ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
+ return ret;
+}
+
DEBUGFS_READ_WRITE_FILE_OPS(sram);
DEBUGFS_WRITE_FILE_OPS(log_event);
DEBUGFS_READ_FILE_OPS(nvm);
@@ -667,6 +710,7 @@ DEBUGFS_READ_FILE_OPS(qos);
DEBUGFS_READ_FILE_OPS(led);
#endif
DEBUGFS_READ_FILE_OPS(thermal_throttling);
+DEBUGFS_READ_WRITE_FILE_OPS(disable_ht40_mode);
/*
* Create the debugfs files and directories
@@ -708,6 +752,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const
char *name)
DEBUGFS_ADD_FILE(led, data);
#endif
DEBUGFS_ADD_FILE(thermal_throttling, data);
+ DEBUGFS_ADD_FILE(disable_ht40_mode, data);
DEBUGFS_ADD_BOOL(disable_sensitivity, rf,
&priv->disable_sens_cal);
DEBUGFS_ADD_BOOL(disable_chain_noise, rf,
&priv->disable_chain_noise_cal);
@@ -747,6 +792,7 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv)
DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_led);
#endif
DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_thermal_throttling);
+ DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_disable_ht40_mode);
DEBUGFS_REMOVE(priv->dbgfs->dir_data);
DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity);
DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_chain_noise);
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h
b/drivers/net/wireless/iwlwifi/iwl-dev.h
index facbc3d..0ee3ad2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1164,6 +1164,7 @@ struct iwl_priv {
/* debugging info */
u32 framecnt_to_us;
atomic_t restrict_refcnt;
+ bool disable_ht40;
#ifdef CONFIG_IWLWIFI_DEBUGFS
/* debugfs */
struct iwl_debugfs *dbgfs;
--
1.5.6.3
^ permalink raw reply related
* Re: 2.6.31-rc2: Possible regression in rt61pci driver
From: Pavel Roskin @ 2009-07-27 14:27 UTC (permalink / raw)
To: Chris Clayton; +Cc: linux-wireless
In-Reply-To: <c6b1100b0907270235l19e9c2d9kb33dae2d6a0f78@mail.gmail.com>
On Mon, 2009-07-27 at 10:35 +0100, Chris Clayton wrote:
> I've built and installed a kernel with all the various types of
> MAC80211 debugging turned on (in addition to the RT61 driver's) and
> with CONFIG_MAC80211_DEFAULT_PS enabled. The attached file is the
> output from dmesg just after a freeze occurs. (The pcmcia card eject
> represents me ejecting the wireless card, so that the freeze "thaws"
> and I can capture the output from dmesg).
>
> Let me know if any additional diagnostics are needed. I have enabled
> MAC80211 debugfs too.
I could not reproduce the freezing with CONFIG_MAC80211_DEFAULT_PS
enabled. That said, I'm using wireless-testing with a patch for the
scanning state machine (hopefully it will be committed today).
The output of dmesg doesn't show anything interesting. The stack dump
from the video card is unlikely to be related.
But I think you may be getting something when the freeze happen. But to
see it, you need to be on a text console. There are other ways to
capture the kernel messages, which are described in the file
Documentation/oops-tracing.txt in the Linux sources.
--
Regards,
Pavel Roskin
^ permalink raw reply
* Re: Problem with exclusive interrupt in hostap_cs
From: Wolfram Sang @ 2009-07-27 13:50 UTC (permalink / raw)
To: linux-wireless; +Cc: linux-pcmcia
In-Reply-To: <49EDF923.2020102@lwfinger.net>
Hi Larry,
Larry Finger wrote:
> I took a second look at the code and found that other drivers are using the
> routine prism2_interrupt() with shared interrupts, thus the patch below should
> be all that is needed.
>
> I trust that you will be able to build the patched driver.
>
> Larry
>
>
> Index: wireless-testing/drivers/net/wireless/hostap/hostap_cs.c
> ===================================================================
> --- wireless-testing.orig/drivers/net/wireless/hostap/hostap_cs.c
> +++ wireless-testing/drivers/net/wireless/hostap/hostap_cs.c
> @@ -666,7 +666,8 @@ static int prism2_config(struct pcmcia_d
> * irq structure is initialized.
> */
> if (link->conf.Attributes & CONF_ENABLE_IRQ) {
> - link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
> + link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING |
> + IRQ_HANDLE_PRESENT;
> link->irq.IRQInfo1 = IRQ_LEVEL_ID;
> link->irq.Handler = prism2_interrupt;
> link->irq.Instance = dev;
Do you think this could be queued up by now? Looks okay to me...
Regards,
Wolfram
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* hostapd and mac80211
From: Sibel Demirkol @ 2009-07-27 12:43 UTC (permalink / raw)
To: linux-wireless
Hi,
I am not a Linux expert and I have difficulty to understand the
message passing from kernel space to user space.
I use a PC Engines WRAP board and ath9k chip as an AP. I wanted to use
openWRT to install my packages and 2.6.28 kernel.
What I have difficulty to understand is, once a message received with
interrupt handler at ath9k driver, it is passed to mac80211 package
for mac processing (As I understood)? Then if I use hostapd for
example, how is it passed the message to hostapd deamon from mac80211
stack? I know about nl80211 link class and cfg80211.. But could you
explain me where the code lies for these message passings?
^ permalink raw reply
* [PATCH 4/4] cfg80211: self-contained wext handling where possible
From: Johannes Berg @ 2009-07-27 10:01 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
In-Reply-To: <20090727100149.839649874@sipsolutions.net>
Finally! This is what you've all been waiting for!
This patch makes cfg80211 take care of wext emulation
_completely_ by itself, drivers that don't need things
cfg80211 doesn't do yet don't even need to be aware of
wireless extensions.
This means we can also clean up mac80211's and iwm's
Kconfig and make it possible to build them w/o wext
now!
RIP wext.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
drivers/net/wireless/iwmc3200wifi/Kconfig | 1
drivers/net/wireless/iwmc3200wifi/Makefile | 2
drivers/net/wireless/iwmc3200wifi/iwm.h | 2
drivers/net/wireless/iwmc3200wifi/netdev.c | 1
drivers/net/wireless/iwmc3200wifi/wext.c | 95 ----------------------------
net/mac80211/Kconfig | 1
net/mac80211/Makefile | 1
net/mac80211/ieee80211_i.h | 4 -
net/mac80211/iface.c | 1
net/mac80211/scan.c | 1
net/mac80211/wext.c | 98 -----------------------------
net/wireless/core.c | 3
net/wireless/mlme.c | 2
net/wireless/scan.c | 1
net/wireless/sme.c | 2
net/wireless/wext-compat.c | 40 +++++++++++
net/wireless/wext-compat.h | 5 +
17 files changed, 54 insertions(+), 206 deletions(-)
--- wireless-testing.orig/net/mac80211/wext.c 2009-07-27 11:42:06.000000000 +0200
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,98 +0,0 @@
-/*
- * Copyright 2002-2005, Instant802 Networks, Inc.
- * Copyright 2005-2006, Devicescape Software, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/netdevice.h>
-#include <linux/types.h>
-#include <linux/slab.h>
-#include <linux/skbuff.h>
-#include <linux/etherdevice.h>
-#include <linux/if_arp.h>
-#include <linux/wireless.h>
-#include <net/iw_handler.h>
-#include <asm/uaccess.h>
-
-#include <net/mac80211.h>
-#include "ieee80211_i.h"
-#include "led.h"
-#include "rate.h"
-#include "wpa.h"
-#include "aes_ccm.h"
-
-
-
-/* Structures to export the Wireless Handlers */
-
-static const iw_handler ieee80211_handler[] =
-{
- (iw_handler) NULL, /* SIOCSIWCOMMIT */
- (iw_handler) cfg80211_wext_giwname, /* SIOCGIWNAME */
- (iw_handler) NULL, /* SIOCSIWNWID */
- (iw_handler) NULL, /* SIOCGIWNWID */
- (iw_handler) cfg80211_wext_siwfreq, /* SIOCSIWFREQ */
- (iw_handler) cfg80211_wext_giwfreq, /* SIOCGIWFREQ */
- (iw_handler) cfg80211_wext_siwmode, /* SIOCSIWMODE */
- (iw_handler) cfg80211_wext_giwmode, /* SIOCGIWMODE */
- (iw_handler) NULL, /* SIOCSIWSENS */
- (iw_handler) NULL, /* SIOCGIWSENS */
- (iw_handler) NULL /* not used */, /* SIOCSIWRANGE */
- (iw_handler) cfg80211_wext_giwrange, /* SIOCGIWRANGE */
- (iw_handler) NULL /* not used */, /* SIOCSIWPRIV */
- (iw_handler) NULL /* kernel code */, /* SIOCGIWPRIV */
- (iw_handler) NULL /* not used */, /* SIOCSIWSTATS */
- (iw_handler) NULL /* kernel code */, /* SIOCGIWSTATS */
- (iw_handler) NULL, /* SIOCSIWSPY */
- (iw_handler) NULL, /* SIOCGIWSPY */
- (iw_handler) NULL, /* SIOCSIWTHRSPY */
- (iw_handler) NULL, /* SIOCGIWTHRSPY */
- (iw_handler) cfg80211_wext_siwap, /* SIOCSIWAP */
- (iw_handler) cfg80211_wext_giwap, /* SIOCGIWAP */
- (iw_handler) cfg80211_wext_siwmlme, /* SIOCSIWMLME */
- (iw_handler) NULL, /* SIOCGIWAPLIST */
- (iw_handler) cfg80211_wext_siwscan, /* SIOCSIWSCAN */
- (iw_handler) cfg80211_wext_giwscan, /* SIOCGIWSCAN */
- (iw_handler) cfg80211_wext_siwessid, /* SIOCSIWESSID */
- (iw_handler) cfg80211_wext_giwessid, /* SIOCGIWESSID */
- (iw_handler) NULL, /* SIOCSIWNICKN */
- (iw_handler) NULL, /* SIOCGIWNICKN */
- (iw_handler) NULL, /* -- hole -- */
- (iw_handler) NULL, /* -- hole -- */
- (iw_handler) cfg80211_wext_siwrate, /* SIOCSIWRATE */
- (iw_handler) cfg80211_wext_giwrate, /* SIOCGIWRATE */
- (iw_handler) cfg80211_wext_siwrts, /* SIOCSIWRTS */
- (iw_handler) cfg80211_wext_giwrts, /* SIOCGIWRTS */
- (iw_handler) cfg80211_wext_siwfrag, /* SIOCSIWFRAG */
- (iw_handler) cfg80211_wext_giwfrag, /* SIOCGIWFRAG */
- (iw_handler) cfg80211_wext_siwtxpower, /* SIOCSIWTXPOW */
- (iw_handler) cfg80211_wext_giwtxpower, /* SIOCGIWTXPOW */
- (iw_handler) cfg80211_wext_siwretry, /* SIOCSIWRETRY */
- (iw_handler) cfg80211_wext_giwretry, /* SIOCGIWRETRY */
- (iw_handler) cfg80211_wext_siwencode, /* SIOCSIWENCODE */
- (iw_handler) cfg80211_wext_giwencode, /* SIOCGIWENCODE */
- (iw_handler) cfg80211_wext_siwpower, /* SIOCSIWPOWER */
- (iw_handler) cfg80211_wext_giwpower, /* SIOCGIWPOWER */
- (iw_handler) NULL, /* -- hole -- */
- (iw_handler) NULL, /* -- hole -- */
- (iw_handler) cfg80211_wext_siwgenie, /* SIOCSIWGENIE */
- (iw_handler) NULL, /* SIOCGIWGENIE */
- (iw_handler) cfg80211_wext_siwauth, /* SIOCSIWAUTH */
- (iw_handler) cfg80211_wext_giwauth, /* SIOCGIWAUTH */
- (iw_handler) cfg80211_wext_siwencodeext, /* SIOCSIWENCODEEXT */
- (iw_handler) NULL, /* SIOCGIWENCODEEXT */
- (iw_handler) NULL, /* SIOCSIWPMKSA */
- (iw_handler) NULL, /* -- hole -- */
-};
-
-const struct iw_handler_def ieee80211_iw_handler_def =
-{
- .num_standard = ARRAY_SIZE(ieee80211_handler),
- .standard = (iw_handler *) ieee80211_handler,
- .get_wireless_stats = cfg80211_wireless_stats,
-};
--- wireless-testing.orig/net/wireless/wext-compat.c 2009-07-27 11:42:06.000000000 +0200
+++ wireless-testing/net/wireless/wext-compat.c 2009-07-27 11:42:14.000000000 +0200
@@ -1397,3 +1397,43 @@ int cfg80211_wext_giwessid(struct net_de
}
}
EXPORT_SYMBOL_GPL(cfg80211_wext_giwessid);
+
+static const iw_handler cfg80211_handlers[] = {
+ [IW_IOCTL_IDX(SIOCGIWNAME)] = (iw_handler) cfg80211_wext_giwname,
+ [IW_IOCTL_IDX(SIOCSIWFREQ)] = (iw_handler) cfg80211_wext_siwfreq,
+ [IW_IOCTL_IDX(SIOCGIWFREQ)] = (iw_handler) cfg80211_wext_giwfreq,
+ [IW_IOCTL_IDX(SIOCSIWMODE)] = (iw_handler) cfg80211_wext_siwmode,
+ [IW_IOCTL_IDX(SIOCGIWMODE)] = (iw_handler) cfg80211_wext_giwmode,
+ [IW_IOCTL_IDX(SIOCGIWRANGE)] = (iw_handler) cfg80211_wext_giwrange,
+ [IW_IOCTL_IDX(SIOCSIWAP)] = (iw_handler) cfg80211_wext_siwap,
+ [IW_IOCTL_IDX(SIOCGIWAP)] = (iw_handler) cfg80211_wext_giwap,
+ [IW_IOCTL_IDX(SIOCSIWMLME)] = (iw_handler) cfg80211_wext_siwmlme,
+ [IW_IOCTL_IDX(SIOCSIWSCAN)] = (iw_handler) cfg80211_wext_siwscan,
+ [IW_IOCTL_IDX(SIOCGIWSCAN)] = (iw_handler) cfg80211_wext_giwscan,
+ [IW_IOCTL_IDX(SIOCSIWESSID)] = (iw_handler) cfg80211_wext_siwessid,
+ [IW_IOCTL_IDX(SIOCGIWESSID)] = (iw_handler) cfg80211_wext_giwessid,
+ [IW_IOCTL_IDX(SIOCSIWRATE)] = (iw_handler) cfg80211_wext_siwrate,
+ [IW_IOCTL_IDX(SIOCGIWRATE)] = (iw_handler) cfg80211_wext_giwrate,
+ [IW_IOCTL_IDX(SIOCSIWRTS)] = (iw_handler) cfg80211_wext_siwrts,
+ [IW_IOCTL_IDX(SIOCGIWRTS)] = (iw_handler) cfg80211_wext_giwrts,
+ [IW_IOCTL_IDX(SIOCSIWFRAG)] = (iw_handler) cfg80211_wext_siwfrag,
+ [IW_IOCTL_IDX(SIOCGIWFRAG)] = (iw_handler) cfg80211_wext_giwfrag,
+ [IW_IOCTL_IDX(SIOCSIWTXPOW)] = (iw_handler) cfg80211_wext_siwtxpower,
+ [IW_IOCTL_IDX(SIOCGIWTXPOW)] = (iw_handler) cfg80211_wext_giwtxpower,
+ [IW_IOCTL_IDX(SIOCSIWRETRY)] = (iw_handler) cfg80211_wext_siwretry,
+ [IW_IOCTL_IDX(SIOCGIWRETRY)] = (iw_handler) cfg80211_wext_giwretry,
+ [IW_IOCTL_IDX(SIOCSIWENCODE)] = (iw_handler) cfg80211_wext_siwencode,
+ [IW_IOCTL_IDX(SIOCGIWENCODE)] = (iw_handler) cfg80211_wext_giwencode,
+ [IW_IOCTL_IDX(SIOCSIWPOWER)] = (iw_handler) cfg80211_wext_siwpower,
+ [IW_IOCTL_IDX(SIOCGIWPOWER)] = (iw_handler) cfg80211_wext_giwpower,
+ [IW_IOCTL_IDX(SIOCSIWGENIE)] = (iw_handler) cfg80211_wext_siwgenie,
+ [IW_IOCTL_IDX(SIOCSIWAUTH)] = (iw_handler) cfg80211_wext_siwauth,
+ [IW_IOCTL_IDX(SIOCGIWAUTH)] = (iw_handler) cfg80211_wext_giwauth,
+ [IW_IOCTL_IDX(SIOCSIWENCODEEXT)]= (iw_handler) cfg80211_wext_siwencodeext,
+};
+
+const struct iw_handler_def cfg80211_wext_handler = {
+ .num_standard = ARRAY_SIZE(cfg80211_handlers),
+ .standard = cfg80211_handlers,
+ .get_wireless_stats = cfg80211_wireless_stats,
+};
--- wireless-testing.orig/net/wireless/wext-compat.h 2009-07-27 11:42:06.000000000 +0200
+++ wireless-testing/net/wireless/wext-compat.h 2009-07-27 11:42:14.000000000 +0200
@@ -1,6 +1,9 @@
#ifndef __WEXT_COMPAT
#define __WEXT_COMPAT
+#include <net/iw_handler.h>
+#include <linux/wireless.h>
+
int cfg80211_ibss_wext_siwfreq(struct net_device *dev,
struct iw_request_info *info,
struct iw_freq *freq, char *extra);
@@ -42,4 +45,6 @@ int cfg80211_mgd_wext_giwessid(struct ne
struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy,
struct iw_freq *freq);
+
+extern const struct iw_handler_def cfg80211_wext_handler;
#endif /* __WEXT_COMPAT */
--- wireless-testing.orig/net/mac80211/Kconfig 2009-07-25 10:45:11.000000000 +0200
+++ wireless-testing/net/mac80211/Kconfig 2009-07-27 11:42:14.000000000 +0200
@@ -6,7 +6,6 @@ config MAC80211
select CRYPTO_ARC4
select CRYPTO_AES
select CRC32
- select WIRELESS_EXT
---help---
This option enables the hardware independent IEEE 802.11
networking stack.
--- wireless-testing.orig/net/mac80211/Makefile 2009-07-25 10:45:11.000000000 +0200
+++ wireless-testing/net/mac80211/Makefile 2009-07-27 11:42:14.000000000 +0200
@@ -3,7 +3,6 @@ obj-$(CONFIG_MAC80211) += mac80211.o
# mac80211 objects
mac80211-y := \
main.o \
- wext.o \
sta_info.o \
wep.o \
wpa.o \
--- wireless-testing.orig/net/mac80211/scan.c 2009-07-25 10:45:11.000000000 +0200
+++ wireless-testing/net/mac80211/scan.c 2009-07-27 11:42:15.000000000 +0200
@@ -18,7 +18,6 @@
#include <linux/if_arp.h>
#include <linux/rtnetlink.h>
#include <net/mac80211.h>
-#include <net/iw_handler.h>
#include "ieee80211_i.h"
#include "driver-ops.h"
--- wireless-testing.orig/net/mac80211/ieee80211_i.h 2009-07-25 10:45:11.000000000 +0200
+++ wireless-testing/net/mac80211/ieee80211_i.h 2009-07-27 11:42:15.000000000 +0200
@@ -24,7 +24,6 @@
#include <linux/spinlock.h>
#include <linux/etherdevice.h>
#include <net/cfg80211.h>
-#include <net/iw_handler.h>
#include <net/mac80211.h>
#include "key.h"
#include "sta_info.h"
@@ -951,9 +950,6 @@ void ieee80211_bss_info_change_notify(st
void ieee80211_configure_filter(struct ieee80211_local *local);
u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata);
-/* wireless extensions */
-extern const struct iw_handler_def ieee80211_iw_handler_def;
-
/* STA code */
void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata);
int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
--- wireless-testing.orig/net/mac80211/iface.c 2009-07-25 10:45:14.000000000 +0200
+++ wireless-testing/net/mac80211/iface.c 2009-07-27 11:42:15.000000000 +0200
@@ -684,7 +684,6 @@ static void ieee80211_if_setup(struct ne
{
ether_setup(dev);
dev->netdev_ops = &ieee80211_dataif_ops;
- dev->wireless_handlers = &ieee80211_iw_handler_def;
dev->destructor = free_netdev;
}
--- wireless-testing.orig/net/wireless/scan.c 2009-07-25 10:45:11.000000000 +0200
+++ wireless-testing/net/wireless/scan.c 2009-07-27 11:42:15.000000000 +0200
@@ -14,6 +14,7 @@
#include <net/iw_handler.h>
#include "core.h"
#include "nl80211.h"
+#include "wext-compat.h"
#define IEEE80211_SCAN_RESULT_EXPIRE (15 * HZ)
--- wireless-testing.orig/net/wireless/core.c 2009-07-25 10:45:11.000000000 +0200
+++ wireless-testing/net/wireless/core.c 2009-07-27 11:42:15.000000000 +0200
@@ -19,6 +19,7 @@
#include "core.h"
#include "sysfs.h"
#include "debugfs.h"
+#include "wext-compat.h"
/* name for sysfs, %d is appended */
#define PHY_NAME "phy"
@@ -665,6 +666,8 @@ static int cfg80211_netdev_notifier_call
wdev->sme_state = CFG80211_SME_IDLE;
mutex_unlock(&rdev->devlist_mtx);
#ifdef CONFIG_WIRELESS_EXT
+ if (!dev->wireless_handlers)
+ dev->wireless_handlers = &cfg80211_wext_handler;
wdev->wext.default_key = -1;
wdev->wext.default_mgmt_key = -1;
wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC;
--- wireless-testing.orig/net/wireless/sme.c 2009-07-25 10:45:11.000000000 +0200
+++ wireless-testing/net/wireless/sme.c 2009-07-27 11:42:15.000000000 +0200
@@ -8,6 +8,8 @@
#include <linux/etherdevice.h>
#include <linux/if_arp.h>
#include <linux/workqueue.h>
+#include <linux/wireless.h>
+#include <net/iw_handler.h>
#include <net/cfg80211.h>
#include <net/rtnetlink.h>
#include "nl80211.h"
--- wireless-testing.orig/net/wireless/mlme.c 2009-07-27 11:42:03.000000000 +0200
+++ wireless-testing/net/wireless/mlme.c 2009-07-27 11:42:15.000000000 +0200
@@ -8,7 +8,9 @@
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/nl80211.h>
+#include <linux/wireless.h>
#include <net/cfg80211.h>
+#include <net/iw_handler.h>
#include "core.h"
#include "nl80211.h"
--- wireless-testing.orig/drivers/net/wireless/iwmc3200wifi/Makefile 2009-07-25 10:45:11.000000000 +0200
+++ wireless-testing/drivers/net/wireless/iwmc3200wifi/Makefile 2009-07-27 11:42:15.000000000 +0200
@@ -1,5 +1,5 @@
obj-$(CONFIG_IWM) := iwmc3200wifi.o
iwmc3200wifi-objs += main.o netdev.o rx.o tx.o sdio.o hal.o fw.o
-iwmc3200wifi-objs += commands.o wext.o cfg80211.o eeprom.o
+iwmc3200wifi-objs += commands.o cfg80211.o eeprom.o
iwmc3200wifi-$(CONFIG_IWM_DEBUG) += debugfs.o
--- wireless-testing.orig/drivers/net/wireless/iwmc3200wifi/iwm.h 2009-07-25 10:45:11.000000000 +0200
+++ wireless-testing/drivers/net/wireless/iwmc3200wifi/iwm.h 2009-07-27 11:42:15.000000000 +0200
@@ -306,8 +306,6 @@ static inline void *iwm_private(struct i
#define skb_to_rx_info(s) ((struct iwm_rx_info *)(s->cb))
#define skb_to_tx_info(s) ((struct iwm_tx_info *)s->cb)
-extern const struct iw_handler_def iwm_iw_handler_def;
-
void *iwm_if_alloc(int sizeof_bus, struct device *dev,
struct iwm_if_ops *if_ops);
void iwm_if_free(struct iwm_priv *iwm);
--- wireless-testing.orig/drivers/net/wireless/iwmc3200wifi/netdev.c 2009-07-25 10:45:11.000000000 +0200
+++ wireless-testing/drivers/net/wireless/iwmc3200wifi/netdev.c 2009-07-27 11:42:15.000000000 +0200
@@ -123,7 +123,6 @@ void *iwm_if_alloc(int sizeof_bus, struc
}
ndev->netdev_ops = &iwm_netdev_ops;
- ndev->wireless_handlers = &iwm_iw_handler_def;
ndev->ieee80211_ptr = wdev;
SET_NETDEV_DEV(ndev, wiphy_dev(wdev->wiphy));
wdev->netdev = ndev;
--- wireless-testing.orig/drivers/net/wireless/iwmc3200wifi/wext.c 2009-07-27 11:42:06.000000000 +0200
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,95 +0,0 @@
-/*
- * Intel Wireless Multicomm 3200 WiFi driver
- *
- * Copyright (C) 2009 Intel Corporation <ilw@linux.intel.com>
- * Samuel Ortiz <samuel.ortiz@intel.com>
- * Zhu Yi <yi.zhu@intel.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License version
- * 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- *
- */
-
-#include <linux/wireless.h>
-#include <net/cfg80211.h>
-
-#include "iwm.h"
-#include "commands.h"
-
-static const iw_handler iwm_handlers[] =
-{
- (iw_handler) NULL, /* SIOCSIWCOMMIT */
- (iw_handler) cfg80211_wext_giwname, /* SIOCGIWNAME */
- (iw_handler) NULL, /* SIOCSIWNWID */
- (iw_handler) NULL, /* SIOCGIWNWID */
- (iw_handler) cfg80211_wext_siwfreq, /* SIOCSIWFREQ */
- (iw_handler) cfg80211_wext_giwfreq, /* SIOCGIWFREQ */
- (iw_handler) cfg80211_wext_siwmode, /* SIOCSIWMODE */
- (iw_handler) cfg80211_wext_giwmode, /* SIOCGIWMODE */
- (iw_handler) NULL, /* SIOCSIWSENS */
- (iw_handler) NULL, /* SIOCGIWSENS */
- (iw_handler) NULL /* not used */, /* SIOCSIWRANGE */
- (iw_handler) cfg80211_wext_giwrange, /* SIOCGIWRANGE */
- (iw_handler) NULL /* not used */, /* SIOCSIWPRIV */
- (iw_handler) NULL /* kernel code */, /* SIOCGIWPRIV */
- (iw_handler) NULL /* not used */, /* SIOCSIWSTATS */
- (iw_handler) NULL /* kernel code */, /* SIOCGIWSTATS */
- (iw_handler) NULL, /* SIOCSIWSPY */
- (iw_handler) NULL, /* SIOCGIWSPY */
- (iw_handler) NULL, /* SIOCSIWTHRSPY */
- (iw_handler) NULL, /* SIOCGIWTHRSPY */
- (iw_handler) cfg80211_wext_siwap, /* SIOCSIWAP */
- (iw_handler) cfg80211_wext_giwap, /* SIOCGIWAP */
- (iw_handler) NULL, /* SIOCSIWMLME */
- (iw_handler) NULL, /* SIOCGIWAPLIST */
- (iw_handler) cfg80211_wext_siwscan, /* SIOCSIWSCAN */
- (iw_handler) cfg80211_wext_giwscan, /* SIOCGIWSCAN */
- (iw_handler) cfg80211_wext_siwessid, /* SIOCSIWESSID */
- (iw_handler) cfg80211_wext_giwessid, /* SIOCGIWESSID */
- (iw_handler) NULL, /* SIOCSIWNICKN */
- (iw_handler) NULL, /* SIOCGIWNICKN */
- (iw_handler) NULL, /* -- hole -- */
- (iw_handler) NULL, /* -- hole -- */
- (iw_handler) NULL, /* SIOCSIWRATE */
- (iw_handler) cfg80211_wext_giwrate, /* SIOCGIWRATE */
- (iw_handler) cfg80211_wext_siwrts, /* SIOCSIWRTS */
- (iw_handler) cfg80211_wext_giwrts, /* SIOCGIWRTS */
- (iw_handler) cfg80211_wext_siwfrag, /* SIOCSIWFRAG */
- (iw_handler) cfg80211_wext_giwfrag, /* SIOCGIWFRAG */
- (iw_handler) cfg80211_wext_siwtxpower, /* SIOCSIWTXPOW */
- (iw_handler) cfg80211_wext_giwtxpower, /* SIOCGIWTXPOW */
- (iw_handler) NULL, /* SIOCSIWRETRY */
- (iw_handler) NULL, /* SIOCGIWRETRY */
- (iw_handler) cfg80211_wext_siwencode, /* SIOCSIWENCODE */
- (iw_handler) cfg80211_wext_giwencode, /* SIOCGIWENCODE */
- (iw_handler) cfg80211_wext_siwpower, /* SIOCSIWPOWER */
- (iw_handler) cfg80211_wext_giwpower, /* SIOCGIWPOWER */
- (iw_handler) NULL, /* -- hole -- */
- (iw_handler) NULL, /* -- hole -- */
- (iw_handler) cfg80211_wext_siwgenie, /* SIOCSIWGENIE */
- (iw_handler) NULL, /* SIOCGIWGENIE */
- (iw_handler) cfg80211_wext_siwauth, /* SIOCSIWAUTH */
- (iw_handler) cfg80211_wext_giwauth, /* SIOCGIWAUTH */
- (iw_handler) cfg80211_wext_siwencodeext, /* SIOCSIWENCODEEXT */
- (iw_handler) NULL, /* SIOCGIWENCODEEXT */
- (iw_handler) NULL, /* SIOCSIWPMKSA */
- (iw_handler) NULL, /* -- hole -- */
-};
-
-const struct iw_handler_def iwm_iw_handler_def = {
- .num_standard = ARRAY_SIZE(iwm_handlers),
- .standard = (iw_handler *) iwm_handlers,
- .get_wireless_stats = cfg80211_wireless_stats,
-};
-
--- wireless-testing.orig/drivers/net/wireless/iwmc3200wifi/Kconfig 2009-07-25 10:45:11.000000000 +0200
+++ wireless-testing/drivers/net/wireless/iwmc3200wifi/Kconfig 2009-07-27 11:42:15.000000000 +0200
@@ -2,7 +2,6 @@ config IWM
tristate "Intel Wireless Multicomm 3200 WiFi driver"
depends on MMC && WLAN_80211 && EXPERIMENTAL
depends on CFG80211
- select WIRELESS_EXT
select FW_LOADER
help
The Intel Wireless Multicomm 3200 hardware is a combo
--
^ permalink raw reply
* [PATCH 3/4] cfg80211: combine IWESSID handlers
From: Johannes Berg @ 2009-07-27 10:01 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
In-Reply-To: <20090727100149.839649874@sipsolutions.net>
Since we now have handlers IWESSID for all modes, we can
combine them into one.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
drivers/net/wireless/iwmc3200wifi/wext.c | 36 +------------------------------
include/net/cfg80211.h | 20 +++++------------
net/mac80211/wext.c | 35 +-----------------------------
net/wireless/ibss.c | 4 ---
net/wireless/wext-compat.c | 34 +++++++++++++++++++++++++++++
net/wireless/wext-compat.h | 12 ++++++++++
net/wireless/wext-sme.c | 4 ---
7 files changed, 56 insertions(+), 89 deletions(-)
--- wireless-testing.orig/include/net/cfg80211.h 2009-07-25 10:44:27.000000000 +0200
+++ wireless-testing/include/net/cfg80211.h 2009-07-25 10:44:28.000000000 +0200
@@ -1595,19 +1595,6 @@ int cfg80211_wext_siwmlme(struct net_dev
int cfg80211_wext_giwrange(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *extra);
-int cfg80211_ibss_wext_siwessid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *ssid);
-int cfg80211_ibss_wext_giwessid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *ssid);
-
-int cfg80211_mgd_wext_siwessid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *ssid);
-int cfg80211_mgd_wext_giwessid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *ssid);
int cfg80211_wext_siwgenie(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *extra);
@@ -1624,7 +1611,12 @@ int cfg80211_wext_siwfreq(struct net_dev
int cfg80211_wext_giwfreq(struct net_device *dev,
struct iw_request_info *info,
struct iw_freq *freq, char *extra);
-
+int cfg80211_wext_siwessid(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *ssid);
+int cfg80211_wext_giwessid(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *ssid);
int cfg80211_wext_siwrate(struct net_device *dev,
struct iw_request_info *info,
struct iw_param *rate, char *extra);
--- wireless-testing.orig/net/wireless/wext-compat.c 2009-07-25 10:44:27.000000000 +0200
+++ wireless-testing/net/wireless/wext-compat.c 2009-07-25 10:44:28.000000000 +0200
@@ -1363,3 +1363,37 @@ int cfg80211_wext_giwap(struct net_devic
}
}
EXPORT_SYMBOL_GPL(cfg80211_wext_giwap);
+
+int cfg80211_wext_siwessid(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *ssid)
+{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+
+ switch (wdev->iftype) {
+ case NL80211_IFTYPE_ADHOC:
+ return cfg80211_ibss_wext_siwessid(dev, info, data, ssid);
+ case NL80211_IFTYPE_STATION:
+ return cfg80211_mgd_wext_siwessid(dev, info, data, ssid);
+ default:
+ return -EOPNOTSUPP;
+ }
+}
+EXPORT_SYMBOL_GPL(cfg80211_wext_siwessid);
+
+int cfg80211_wext_giwessid(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *ssid)
+{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+
+ switch (wdev->iftype) {
+ case NL80211_IFTYPE_ADHOC:
+ return cfg80211_ibss_wext_giwessid(dev, info, data, ssid);
+ case NL80211_IFTYPE_STATION:
+ return cfg80211_mgd_wext_giwessid(dev, info, data, ssid);
+ default:
+ return -EOPNOTSUPP;
+ }
+}
+EXPORT_SYMBOL_GPL(cfg80211_wext_giwessid);
--- wireless-testing.orig/net/wireless/wext-compat.h 2009-07-25 10:44:27.000000000 +0200
+++ wireless-testing/net/wireless/wext-compat.h 2009-07-25 10:44:28.000000000 +0200
@@ -13,6 +13,12 @@ int cfg80211_ibss_wext_siwap(struct net_
int cfg80211_ibss_wext_giwap(struct net_device *dev,
struct iw_request_info *info,
struct sockaddr *ap_addr, char *extra);
+int cfg80211_ibss_wext_siwessid(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *ssid);
+int cfg80211_ibss_wext_giwessid(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *ssid);
int cfg80211_mgd_wext_siwfreq(struct net_device *dev,
struct iw_request_info *info,
@@ -26,6 +32,12 @@ int cfg80211_mgd_wext_siwap(struct net_d
int cfg80211_mgd_wext_giwap(struct net_device *dev,
struct iw_request_info *info,
struct sockaddr *ap_addr, char *extra);
+int cfg80211_mgd_wext_siwessid(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *ssid);
+int cfg80211_mgd_wext_giwessid(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *ssid);
struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy,
struct iw_freq *freq);
--- wireless-testing.orig/net/mac80211/wext.c 2009-07-25 10:44:27.000000000 +0200
+++ wireless-testing/net/mac80211/wext.c 2009-07-25 10:44:28.000000000 +0200
@@ -27,37 +27,6 @@
#include "aes_ccm.h"
-static int ieee80211_ioctl_siwessid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *ssid)
-{
- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-
- if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
- return cfg80211_ibss_wext_siwessid(dev, info, data, ssid);
- else if (sdata->vif.type == NL80211_IFTYPE_STATION)
- return cfg80211_mgd_wext_siwessid(dev, info, data, ssid);
-
- return -EOPNOTSUPP;
-}
-
-
-static int ieee80211_ioctl_giwessid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *ssid)
-{
- struct ieee80211_sub_if_data *sdata;
-
- sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-
- if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
- return cfg80211_ibss_wext_giwessid(dev, info, data, ssid);
- else if (sdata->vif.type == NL80211_IFTYPE_STATION)
- return cfg80211_mgd_wext_giwessid(dev, info, data, ssid);
-
- return -EOPNOTSUPP;
-}
-
/* Structures to export the Wireless Handlers */
@@ -89,8 +58,8 @@ static const iw_handler ieee80211_handle
(iw_handler) NULL, /* SIOCGIWAPLIST */
(iw_handler) cfg80211_wext_siwscan, /* SIOCSIWSCAN */
(iw_handler) cfg80211_wext_giwscan, /* SIOCGIWSCAN */
- (iw_handler) ieee80211_ioctl_siwessid, /* SIOCSIWESSID */
- (iw_handler) ieee80211_ioctl_giwessid, /* SIOCGIWESSID */
+ (iw_handler) cfg80211_wext_siwessid, /* SIOCSIWESSID */
+ (iw_handler) cfg80211_wext_giwessid, /* SIOCGIWESSID */
(iw_handler) NULL, /* SIOCSIWNICKN */
(iw_handler) NULL, /* SIOCGIWNICKN */
(iw_handler) NULL, /* -- hole -- */
--- wireless-testing.orig/net/wireless/wext-sme.c 2009-07-25 10:44:27.000000000 +0200
+++ wireless-testing/net/wireless/wext-sme.c 2009-07-25 10:44:28.000000000 +0200
@@ -192,8 +192,6 @@ int cfg80211_mgd_wext_siwessid(struct ne
cfg80211_unlock_rdev(wiphy_to_dev(wdev->wiphy));
return err;
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_mgd_wext_siwessid);
int cfg80211_mgd_wext_giwessid(struct net_device *dev,
struct iw_request_info *info,
@@ -218,8 +216,6 @@ int cfg80211_mgd_wext_giwessid(struct ne
return 0;
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_mgd_wext_giwessid);
int cfg80211_mgd_wext_siwap(struct net_device *dev,
struct iw_request_info *info,
--- wireless-testing.orig/net/wireless/ibss.c 2009-07-25 10:44:27.000000000 +0200
+++ wireless-testing/net/wireless/ibss.c 2009-07-25 10:44:28.000000000 +0200
@@ -381,8 +381,6 @@ int cfg80211_ibss_wext_siwessid(struct n
return err;
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_ibss_wext_siwessid);
int cfg80211_ibss_wext_giwessid(struct net_device *dev,
struct iw_request_info *info,
@@ -410,8 +408,6 @@ int cfg80211_ibss_wext_giwessid(struct n
return 0;
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_ibss_wext_giwessid);
int cfg80211_ibss_wext_siwap(struct net_device *dev,
struct iw_request_info *info,
--- wireless-testing.orig/drivers/net/wireless/iwmc3200wifi/wext.c 2009-07-25 10:44:27.000000000 +0200
+++ wireless-testing/drivers/net/wireless/iwmc3200wifi/wext.c 2009-07-25 10:44:28.000000000 +0200
@@ -27,38 +27,6 @@
#include "iwm.h"
#include "commands.h"
-static int iwm_wext_siwessid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *ssid)
-{
- struct iwm_priv *iwm = ndev_to_iwm(dev);
-
- switch (iwm->conf.mode) {
- case UMAC_MODE_IBSS:
- return cfg80211_ibss_wext_siwessid(dev, info, data, ssid);
- case UMAC_MODE_BSS:
- return cfg80211_mgd_wext_siwessid(dev, info, data, ssid);
- default:
- return -EOPNOTSUPP;
- }
-}
-
-static int iwm_wext_giwessid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *ssid)
-{
- struct iwm_priv *iwm = ndev_to_iwm(dev);
-
- switch (iwm->conf.mode) {
- case UMAC_MODE_IBSS:
- return cfg80211_ibss_wext_giwessid(dev, info, data, ssid);
- case UMAC_MODE_BSS:
- return cfg80211_mgd_wext_giwessid(dev, info, data, ssid);
- default:
- return -EOPNOTSUPP;
- }
-}
-
static const iw_handler iwm_handlers[] =
{
(iw_handler) NULL, /* SIOCSIWCOMMIT */
@@ -87,8 +55,8 @@ static const iw_handler iwm_handlers[] =
(iw_handler) NULL, /* SIOCGIWAPLIST */
(iw_handler) cfg80211_wext_siwscan, /* SIOCSIWSCAN */
(iw_handler) cfg80211_wext_giwscan, /* SIOCGIWSCAN */
- (iw_handler) iwm_wext_siwessid, /* SIOCSIWESSID */
- (iw_handler) iwm_wext_giwessid, /* SIOCGIWESSID */
+ (iw_handler) cfg80211_wext_siwessid, /* SIOCSIWESSID */
+ (iw_handler) cfg80211_wext_giwessid, /* SIOCGIWESSID */
(iw_handler) NULL, /* SIOCSIWNICKN */
(iw_handler) NULL, /* SIOCGIWNICKN */
(iw_handler) NULL, /* -- hole -- */
--
^ permalink raw reply
* [PATCH 2/4] cfg80211: combine IWAP handlers
From: Johannes Berg @ 2009-07-27 10:01 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
In-Reply-To: <20090727100149.839649874@sipsolutions.net>
Since we now have IWAP handlers for all modes, we can
combine them into one.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
drivers/net/wireless/iwmc3200wifi/wext.c | 34 +-------------------
include/net/cfg80211.h | 24 +++-----------
net/mac80211/wext.c | 41 +-----------------------
net/wireless/ibss.c | 4 --
net/wireless/wext-compat.c | 52 ++++++++++++++++++++++++++-----
net/wireless/wext-compat.h | 12 +++++++
net/wireless/wext-sme.c | 4 --
7 files changed, 66 insertions(+), 105 deletions(-)
--- wireless-testing.orig/include/net/cfg80211.h 2009-07-25 10:44:27.000000000 +0200
+++ wireless-testing/include/net/cfg80211.h 2009-07-25 10:44:27.000000000 +0200
@@ -1601,12 +1601,6 @@ int cfg80211_ibss_wext_siwessid(struct n
int cfg80211_ibss_wext_giwessid(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *ssid);
-int cfg80211_ibss_wext_siwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *ap_addr, char *extra);
-int cfg80211_ibss_wext_giwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *ap_addr, char *extra);
int cfg80211_mgd_wext_siwessid(struct net_device *dev,
struct iw_request_info *info,
@@ -1614,12 +1608,6 @@ int cfg80211_mgd_wext_siwessid(struct ne
int cfg80211_mgd_wext_giwessid(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *ssid);
-int cfg80211_mgd_wext_siwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *ap_addr, char *extra);
-int cfg80211_mgd_wext_giwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *ap_addr, char *extra);
int cfg80211_wext_siwgenie(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *extra);
@@ -1686,12 +1674,12 @@ int cfg80211_wext_giwpower(struct net_de
struct iw_request_info *info,
struct iw_param *wrq, char *extra);
-int cfg80211_wds_wext_siwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *addr, char *extra);
-int cfg80211_wds_wext_giwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *addr, char *extra);
+int cfg80211_wext_siwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *ap_addr, char *extra);
+int cfg80211_wext_giwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *ap_addr, char *extra);
/*
* callbacks for asynchronous cfg80211 methods, notification
--- wireless-testing.orig/net/mac80211/wext.c 2009-07-25 10:44:27.000000000 +0200
+++ wireless-testing/net/mac80211/wext.c 2009-07-25 10:44:27.000000000 +0200
@@ -59,43 +59,6 @@ static int ieee80211_ioctl_giwessid(stru
}
-static int ieee80211_ioctl_siwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *ap_addr, char *extra)
-{
- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-
- if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
- return cfg80211_ibss_wext_siwap(dev, info, ap_addr, extra);
-
- if (sdata->vif.type == NL80211_IFTYPE_STATION)
- return cfg80211_mgd_wext_siwap(dev, info, ap_addr, extra);
-
- if (sdata->vif.type == NL80211_IFTYPE_WDS)
- return cfg80211_wds_wext_siwap(dev, info, ap_addr, extra);
- return -EOPNOTSUPP;
-}
-
-
-static int ieee80211_ioctl_giwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *ap_addr, char *extra)
-{
- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-
- if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
- return cfg80211_ibss_wext_giwap(dev, info, ap_addr, extra);
-
- if (sdata->vif.type == NL80211_IFTYPE_STATION)
- return cfg80211_mgd_wext_giwap(dev, info, ap_addr, extra);
-
- if (sdata->vif.type == NL80211_IFTYPE_WDS)
- return cfg80211_wds_wext_giwap(dev, info, ap_addr, extra);
-
- return -EOPNOTSUPP;
-}
-
-
/* Structures to export the Wireless Handlers */
static const iw_handler ieee80211_handler[] =
@@ -120,8 +83,8 @@ static const iw_handler ieee80211_handle
(iw_handler) NULL, /* SIOCGIWSPY */
(iw_handler) NULL, /* SIOCSIWTHRSPY */
(iw_handler) NULL, /* SIOCGIWTHRSPY */
- (iw_handler) ieee80211_ioctl_siwap, /* SIOCSIWAP */
- (iw_handler) ieee80211_ioctl_giwap, /* SIOCGIWAP */
+ (iw_handler) cfg80211_wext_siwap, /* SIOCSIWAP */
+ (iw_handler) cfg80211_wext_giwap, /* SIOCGIWAP */
(iw_handler) cfg80211_wext_siwmlme, /* SIOCSIWMLME */
(iw_handler) NULL, /* SIOCGIWAPLIST */
(iw_handler) cfg80211_wext_siwscan, /* SIOCSIWSCAN */
--- wireless-testing.orig/net/wireless/wext-compat.c 2009-07-25 10:44:27.000000000 +0200
+++ wireless-testing/net/wireless/wext-compat.c 2009-07-25 10:44:27.000000000 +0200
@@ -1149,9 +1149,9 @@ int cfg80211_wext_giwpower(struct net_de
}
EXPORT_SYMBOL_GPL(cfg80211_wext_giwpower);
-int cfg80211_wds_wext_siwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *addr, char *extra)
+static int cfg80211_wds_wext_siwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *addr, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
@@ -1177,11 +1177,10 @@ int cfg80211_wds_wext_siwap(struct net_d
return 0;
}
-EXPORT_SYMBOL_GPL(cfg80211_wds_wext_siwap);
-int cfg80211_wds_wext_giwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *addr, char *extra)
+static int cfg80211_wds_wext_giwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *addr, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
@@ -1193,7 +1192,6 @@ int cfg80211_wds_wext_giwap(struct net_d
return 0;
}
-EXPORT_SYMBOL_GPL(cfg80211_wds_wext_giwap);
int cfg80211_wext_siwrate(struct net_device *dev,
struct iw_request_info *info,
@@ -1327,3 +1325,41 @@ struct iw_statistics *cfg80211_wireless_
return &wstats;
}
EXPORT_SYMBOL_GPL(cfg80211_wireless_stats);
+
+int cfg80211_wext_siwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *ap_addr, char *extra)
+{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+
+ switch (wdev->iftype) {
+ case NL80211_IFTYPE_ADHOC:
+ return cfg80211_ibss_wext_siwap(dev, info, ap_addr, extra);
+ case NL80211_IFTYPE_STATION:
+ return cfg80211_mgd_wext_siwap(dev, info, ap_addr, extra);
+ case NL80211_IFTYPE_WDS:
+ return cfg80211_wds_wext_siwap(dev, info, ap_addr, extra);
+ default:
+ return -EOPNOTSUPP;
+ }
+}
+EXPORT_SYMBOL_GPL(cfg80211_wext_siwap);
+
+int cfg80211_wext_giwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *ap_addr, char *extra)
+{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+
+ switch (wdev->iftype) {
+ case NL80211_IFTYPE_ADHOC:
+ return cfg80211_ibss_wext_giwap(dev, info, ap_addr, extra);
+ case NL80211_IFTYPE_STATION:
+ return cfg80211_mgd_wext_giwap(dev, info, ap_addr, extra);
+ case NL80211_IFTYPE_WDS:
+ return cfg80211_wds_wext_giwap(dev, info, ap_addr, extra);
+ default:
+ return -EOPNOTSUPP;
+ }
+}
+EXPORT_SYMBOL_GPL(cfg80211_wext_giwap);
--- wireless-testing.orig/net/wireless/wext-compat.h 2009-07-25 10:44:27.000000000 +0200
+++ wireless-testing/net/wireless/wext-compat.h 2009-07-25 10:44:27.000000000 +0200
@@ -7,6 +7,12 @@ int cfg80211_ibss_wext_siwfreq(struct ne
int cfg80211_ibss_wext_giwfreq(struct net_device *dev,
struct iw_request_info *info,
struct iw_freq *freq, char *extra);
+int cfg80211_ibss_wext_siwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *ap_addr, char *extra);
+int cfg80211_ibss_wext_giwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *ap_addr, char *extra);
int cfg80211_mgd_wext_siwfreq(struct net_device *dev,
struct iw_request_info *info,
@@ -14,6 +20,12 @@ int cfg80211_mgd_wext_siwfreq(struct net
int cfg80211_mgd_wext_giwfreq(struct net_device *dev,
struct iw_request_info *info,
struct iw_freq *freq, char *extra);
+int cfg80211_mgd_wext_siwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *ap_addr, char *extra);
+int cfg80211_mgd_wext_giwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *ap_addr, char *extra);
struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy,
struct iw_freq *freq);
--- wireless-testing.orig/net/wireless/ibss.c 2009-07-25 10:44:27.000000000 +0200
+++ wireless-testing/net/wireless/ibss.c 2009-07-25 10:44:27.000000000 +0200
@@ -466,8 +466,6 @@ int cfg80211_ibss_wext_siwap(struct net_
return err;
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_ibss_wext_siwap);
int cfg80211_ibss_wext_giwap(struct net_device *dev,
struct iw_request_info *info,
@@ -493,6 +491,4 @@ int cfg80211_ibss_wext_giwap(struct net_
return 0;
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_ibss_wext_giwap);
#endif
--- wireless-testing.orig/net/wireless/wext-sme.c 2009-07-25 10:44:27.000000000 +0200
+++ wireless-testing/net/wireless/wext-sme.c 2009-07-25 10:44:27.000000000 +0200
@@ -273,8 +273,6 @@ int cfg80211_mgd_wext_siwap(struct net_d
cfg80211_unlock_rdev(wiphy_to_dev(wdev->wiphy));
return err;
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_mgd_wext_siwap);
int cfg80211_mgd_wext_giwap(struct net_device *dev,
struct iw_request_info *info,
@@ -299,8 +297,6 @@ int cfg80211_mgd_wext_giwap(struct net_d
return 0;
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_mgd_wext_giwap);
int cfg80211_wext_siwgenie(struct net_device *dev,
struct iw_request_info *info,
--- wireless-testing.orig/drivers/net/wireless/iwmc3200wifi/wext.c 2009-07-25 10:44:27.000000000 +0200
+++ wireless-testing/drivers/net/wireless/iwmc3200wifi/wext.c 2009-07-25 10:44:27.000000000 +0200
@@ -27,36 +27,6 @@
#include "iwm.h"
#include "commands.h"
-static int iwm_wext_siwap(struct net_device *dev, struct iw_request_info *info,
- struct sockaddr *ap_addr, char *extra)
-{
- struct iwm_priv *iwm = ndev_to_iwm(dev);
-
- switch (iwm->conf.mode) {
- case UMAC_MODE_IBSS:
- return cfg80211_ibss_wext_siwap(dev, info, ap_addr, extra);
- case UMAC_MODE_BSS:
- return cfg80211_mgd_wext_siwap(dev, info, ap_addr, extra);
- default:
- return -EOPNOTSUPP;
- }
-}
-
-static int iwm_wext_giwap(struct net_device *dev, struct iw_request_info *info,
- struct sockaddr *ap_addr, char *extra)
-{
- struct iwm_priv *iwm = ndev_to_iwm(dev);
-
- switch (iwm->conf.mode) {
- case UMAC_MODE_IBSS:
- return cfg80211_ibss_wext_giwap(dev, info, ap_addr, extra);
- case UMAC_MODE_BSS:
- return cfg80211_mgd_wext_giwap(dev, info, ap_addr, extra);
- default:
- return -EOPNOTSUPP;
- }
-}
-
static int iwm_wext_siwessid(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *ssid)
@@ -111,8 +81,8 @@ static const iw_handler iwm_handlers[] =
(iw_handler) NULL, /* SIOCGIWSPY */
(iw_handler) NULL, /* SIOCSIWTHRSPY */
(iw_handler) NULL, /* SIOCGIWTHRSPY */
- (iw_handler) iwm_wext_siwap, /* SIOCSIWAP */
- (iw_handler) iwm_wext_giwap, /* SIOCGIWAP */
+ (iw_handler) cfg80211_wext_siwap, /* SIOCSIWAP */
+ (iw_handler) cfg80211_wext_giwap, /* SIOCGIWAP */
(iw_handler) NULL, /* SIOCSIWMLME */
(iw_handler) NULL, /* SIOCGIWAPLIST */
(iw_handler) cfg80211_wext_siwscan, /* SIOCSIWSCAN */
--
^ permalink raw reply
* [PATCH 1/4] cfg80211: combine iwfreq implementations
From: Johannes Berg @ 2009-07-27 10:01 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
In-Reply-To: <20090727100149.839649874@sipsolutions.net>
Until now we implemented iwfreq for managed mode, we
needed to keep the implementations separate, but now
that we have all versions implemented we can combine
them and export just one handler.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
drivers/net/wireless/iwmc3200wifi/wext.c | 34 --------------
include/net/cfg80211.h | 20 ++------
net/mac80211/wext.c | 73 -------------------------------
net/wireless/core.h | 3 +
net/wireless/ibss.c | 5 --
net/wireless/nl80211.c | 2
net/wireless/wext-compat.c | 54 ++++++++++++++++++++++
net/wireless/wext-compat.h | 21 ++++++++
net/wireless/wext-sme.c | 5 --
9 files changed, 91 insertions(+), 126 deletions(-)
--- wireless-testing.orig/include/net/cfg80211.h 2009-07-25 10:40:04.000000000 +0200
+++ wireless-testing/include/net/cfg80211.h 2009-07-25 10:44:27.000000000 +0200
@@ -1595,12 +1595,6 @@ int cfg80211_wext_siwmlme(struct net_dev
int cfg80211_wext_giwrange(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *extra);
-int cfg80211_ibss_wext_siwfreq(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_freq *freq, char *extra);
-int cfg80211_ibss_wext_giwfreq(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_freq *freq, char *extra);
int cfg80211_ibss_wext_siwessid(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *ssid);
@@ -1614,12 +1608,6 @@ int cfg80211_ibss_wext_giwap(struct net_
struct iw_request_info *info,
struct sockaddr *ap_addr, char *extra);
-int cfg80211_mgd_wext_siwfreq(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_freq *freq, char *extra);
-int cfg80211_mgd_wext_giwfreq(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_freq *freq, char *extra);
int cfg80211_mgd_wext_siwessid(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *ssid);
@@ -1642,8 +1630,12 @@ int cfg80211_wext_giwauth(struct net_dev
struct iw_request_info *info,
struct iw_param *data, char *extra);
-struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy,
- struct iw_freq *freq);
+int cfg80211_wext_siwfreq(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_freq *freq, char *extra);
+int cfg80211_wext_giwfreq(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_freq *freq, char *extra);
int cfg80211_wext_siwrate(struct net_device *dev,
struct iw_request_info *info,
--- wireless-testing.orig/net/mac80211/wext.c 2009-07-24 13:21:08.000000000 +0200
+++ wireless-testing/net/mac80211/wext.c 2009-07-25 10:44:27.000000000 +0200
@@ -27,75 +27,6 @@
#include "aes_ccm.h"
-static int ieee80211_ioctl_siwfreq(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_freq *freq, char *extra)
-{
- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
- struct ieee80211_local *local = sdata->local;
- struct ieee80211_channel *chan;
-
- if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
- return cfg80211_ibss_wext_siwfreq(dev, info, freq, extra);
- else if (sdata->vif.type == NL80211_IFTYPE_STATION)
- return cfg80211_mgd_wext_siwfreq(dev, info, freq, extra);
-
- /* freq->e == 0: freq->m = channel; otherwise freq = m * 10^e */
- if (freq->e == 0) {
- if (freq->m < 0)
- return -EINVAL;
- else
- chan = ieee80211_get_channel(local->hw.wiphy,
- ieee80211_channel_to_frequency(freq->m));
- } else {
- int i, div = 1000000;
- for (i = 0; i < freq->e; i++)
- div /= 10;
- if (div <= 0)
- return -EINVAL;
- chan = ieee80211_get_channel(local->hw.wiphy, freq->m / div);
- }
-
- if (!chan)
- return -EINVAL;
-
- if (chan->flags & IEEE80211_CHAN_DISABLED)
- return -EINVAL;
-
- /*
- * no change except maybe auto -> fixed, ignore the HT
- * setting so you can fix a channel you're on already
- */
- if (local->oper_channel == chan)
- return 0;
-
- local->oper_channel = chan;
- local->oper_channel_type = NL80211_CHAN_NO_HT;
- ieee80211_hw_config(local, 0);
-
- return 0;
-}
-
-
-static int ieee80211_ioctl_giwfreq(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_freq *freq, char *extra)
-{
- struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-
- if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
- return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra);
- else if (sdata->vif.type == NL80211_IFTYPE_STATION)
- return cfg80211_mgd_wext_giwfreq(dev, info, freq, extra);
-
- freq->m = local->oper_channel->center_freq;
- freq->e = 6;
-
- return 0;
-}
-
-
static int ieee80211_ioctl_siwessid(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *ssid)
@@ -173,8 +104,8 @@ static const iw_handler ieee80211_handle
(iw_handler) cfg80211_wext_giwname, /* SIOCGIWNAME */
(iw_handler) NULL, /* SIOCSIWNWID */
(iw_handler) NULL, /* SIOCGIWNWID */
- (iw_handler) ieee80211_ioctl_siwfreq, /* SIOCSIWFREQ */
- (iw_handler) ieee80211_ioctl_giwfreq, /* SIOCGIWFREQ */
+ (iw_handler) cfg80211_wext_siwfreq, /* SIOCSIWFREQ */
+ (iw_handler) cfg80211_wext_giwfreq, /* SIOCGIWFREQ */
(iw_handler) cfg80211_wext_siwmode, /* SIOCSIWMODE */
(iw_handler) cfg80211_wext_giwmode, /* SIOCGIWMODE */
(iw_handler) NULL, /* SIOCSIWSENS */
--- wireless-testing.orig/net/wireless/ibss.c 2009-07-24 13:21:08.000000000 +0200
+++ wireless-testing/net/wireless/ibss.c 2009-07-25 10:44:27.000000000 +0200
@@ -7,6 +7,7 @@
#include <linux/etherdevice.h>
#include <linux/if_arp.h>
#include <net/cfg80211.h>
+#include "wext-compat.h"
#include "nl80211.h"
@@ -312,8 +313,6 @@ int cfg80211_ibss_wext_siwfreq(struct ne
return err;
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_ibss_wext_siwfreq);
int cfg80211_ibss_wext_giwfreq(struct net_device *dev,
struct iw_request_info *info,
@@ -342,8 +341,6 @@ int cfg80211_ibss_wext_giwfreq(struct ne
/* no channel if not joining */
return -EINVAL;
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_ibss_wext_giwfreq);
int cfg80211_ibss_wext_siwessid(struct net_device *dev,
struct iw_request_info *info,
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ wireless-testing/net/wireless/wext-compat.h 2009-07-25 10:44:27.000000000 +0200
@@ -0,0 +1,21 @@
+#ifndef __WEXT_COMPAT
+#define __WEXT_COMPAT
+
+int cfg80211_ibss_wext_siwfreq(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_freq *freq, char *extra);
+int cfg80211_ibss_wext_giwfreq(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_freq *freq, char *extra);
+
+int cfg80211_mgd_wext_siwfreq(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_freq *freq, char *extra);
+int cfg80211_mgd_wext_giwfreq(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_freq *freq, char *extra);
+
+struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy,
+ struct iw_freq *freq);
+
+#endif /* __WEXT_COMPAT */
--- wireless-testing.orig/net/wireless/wext-sme.c 2009-07-24 13:21:08.000000000 +0200
+++ wireless-testing/net/wireless/wext-sme.c 2009-07-25 10:44:27.000000000 +0200
@@ -8,6 +8,7 @@
#include <linux/etherdevice.h>
#include <linux/if_arp.h>
#include <net/cfg80211.h>
+#include "wext-compat.h"
#include "nl80211.h"
int cfg80211_mgd_wext_connect(struct cfg80211_registered_device *rdev,
@@ -108,8 +109,6 @@ int cfg80211_mgd_wext_siwfreq(struct net
cfg80211_unlock_rdev(rdev);
return err;
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_mgd_wext_siwfreq);
int cfg80211_mgd_wext_giwfreq(struct net_device *dev,
struct iw_request_info *info,
@@ -138,8 +137,6 @@ int cfg80211_mgd_wext_giwfreq(struct net
/* no channel if not joining */
return -EINVAL;
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_mgd_wext_giwfreq);
int cfg80211_mgd_wext_siwessid(struct net_device *dev,
struct iw_request_info *info,
--- wireless-testing.orig/net/wireless/core.h 2009-07-25 10:40:04.000000000 +0200
+++ wireless-testing/net/wireless/core.h 2009-07-25 10:44:27.000000000 +0200
@@ -66,6 +66,9 @@ struct cfg80211_registered_device {
struct work_struct conn_work;
struct work_struct event_work;
+ /* current channel */
+ struct ieee80211_channel *channel;
+
#ifdef CONFIG_CFG80211_DEBUGFS
/* Debugfs entries */
struct wiphy_debugfsdentries {
--- wireless-testing.orig/net/wireless/nl80211.c 2009-07-25 10:40:04.000000000 +0200
+++ wireless-testing/net/wireless/nl80211.c 2009-07-25 10:44:27.000000000 +0200
@@ -757,6 +757,8 @@ static int nl80211_set_wiphy(struct sk_b
channel_type);
if (result)
goto bad_res;
+
+ rdev->channel = chan;
}
changed = 0;
--- wireless-testing.orig/net/wireless/wext-compat.c 2009-07-25 10:40:04.000000000 +0200
+++ wireless-testing/net/wireless/wext-compat.c 2009-07-25 10:44:27.000000000 +0200
@@ -14,6 +14,7 @@
#include <linux/etherdevice.h>
#include <net/iw_handler.h>
#include <net/cfg80211.h>
+#include "wext-compat.h"
#include "core.h"
int cfg80211_wext_giwname(struct net_device *dev,
@@ -300,7 +301,6 @@ struct ieee80211_channel *cfg80211_wext_
return ERR_PTR(-EINVAL);
return chan;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_freq);
int cfg80211_wext_siwrts(struct net_device *dev,
struct iw_request_info *info,
@@ -759,6 +759,58 @@ int cfg80211_wext_giwencode(struct net_d
}
EXPORT_SYMBOL_GPL(cfg80211_wext_giwencode);
+int cfg80211_wext_siwfreq(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_freq *freq, char *extra)
+{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
+ struct ieee80211_channel *chan;
+ int err;
+
+ switch (wdev->iftype) {
+ case NL80211_IFTYPE_STATION:
+ return cfg80211_mgd_wext_siwfreq(dev, info, freq, extra);
+ case NL80211_IFTYPE_ADHOC:
+ return cfg80211_ibss_wext_siwfreq(dev, info, freq, extra);
+ default:
+ chan = cfg80211_wext_freq(wdev->wiphy, freq);
+ if (!chan)
+ return -EINVAL;
+ if (IS_ERR(chan))
+ return PTR_ERR(chan);
+ err = rdev->ops->set_channel(wdev->wiphy, chan,
+ NL80211_CHAN_NO_HT);
+ if (err)
+ return err;
+ rdev->channel = chan;
+ return 0;
+ }
+}
+EXPORT_SYMBOL_GPL(cfg80211_wext_siwfreq);
+
+int cfg80211_wext_giwfreq(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_freq *freq, char *extra)
+{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
+
+ switch (wdev->iftype) {
+ case NL80211_IFTYPE_STATION:
+ return cfg80211_mgd_wext_giwfreq(dev, info, freq, extra);
+ case NL80211_IFTYPE_ADHOC:
+ return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra);
+ default:
+ if (!rdev->channel)
+ return -EINVAL;
+ freq->m = rdev->channel->center_freq;
+ freq->e = 6;
+ return 0;
+ }
+}
+EXPORT_SYMBOL_GPL(cfg80211_wext_giwfreq);
+
int cfg80211_wext_siwtxpower(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *data, char *extra)
--- wireless-testing.orig/drivers/net/wireless/iwmc3200wifi/wext.c 2009-07-24 13:21:08.000000000 +0200
+++ wireless-testing/drivers/net/wireless/iwmc3200wifi/wext.c 2009-07-25 10:44:27.000000000 +0200
@@ -27,36 +27,6 @@
#include "iwm.h"
#include "commands.h"
-static int iwm_wext_siwfreq(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_freq *freq, char *extra)
-{
- struct iwm_priv *iwm = ndev_to_iwm(dev);
-
- switch (iwm->conf.mode) {
- case UMAC_MODE_IBSS:
- return cfg80211_ibss_wext_siwfreq(dev, info, freq, extra);
- default:
- return -EOPNOTSUPP;
- }
-}
-
-static int iwm_wext_giwfreq(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_freq *freq, char *extra)
-{
- struct iwm_priv *iwm = ndev_to_iwm(dev);
-
- switch (iwm->conf.mode) {
- case UMAC_MODE_IBSS:
- return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra);
- case UMAC_MODE_BSS:
- return cfg80211_mgd_wext_giwfreq(dev, info, freq, extra);
- default:
- return -EOPNOTSUPP;
- }
-}
-
static int iwm_wext_siwap(struct net_device *dev, struct iw_request_info *info,
struct sockaddr *ap_addr, char *extra)
{
@@ -125,8 +95,8 @@ static const iw_handler iwm_handlers[] =
(iw_handler) cfg80211_wext_giwname, /* SIOCGIWNAME */
(iw_handler) NULL, /* SIOCSIWNWID */
(iw_handler) NULL, /* SIOCGIWNWID */
- (iw_handler) iwm_wext_siwfreq, /* SIOCSIWFREQ */
- (iw_handler) iwm_wext_giwfreq, /* SIOCGIWFREQ */
+ (iw_handler) cfg80211_wext_siwfreq, /* SIOCSIWFREQ */
+ (iw_handler) cfg80211_wext_giwfreq, /* SIOCGIWFREQ */
(iw_handler) cfg80211_wext_siwmode, /* SIOCSIWMODE */
(iw_handler) cfg80211_wext_giwmode, /* SIOCGIWMODE */
(iw_handler) NULL, /* SIOCSIWSENS */
--
^ 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