* Re: BCM4331 deauthenticates every five minutes
From: Chris Adams @ 2013-06-20 0:28 UTC (permalink / raw)
To: Rafał Miłecki, Larry Finger, b43-dev, linux-wireless
In-Reply-To: <20130619175850.GD4784@cmadams.net>
Once upon a time, Chris Adams <cma@cmadams.net> said:
> The AP appears to be an Adtran (don't know the model).
The issue appears to be specific to the Adtran AP combined with the b43
device. I have a D-Link DIR-625 at home (running OpenWRT 12.09, using
ath9k wireless driver), and the MacBook seems to stay connected to it
okay.
--
Chris Adams <cma@cmadams.net>
^ permalink raw reply
* Re: [ath9k-devel] ath9k_htc: station unable to authenticate
From: Oleksij Rempel @ 2013-06-20 5:33 UTC (permalink / raw)
To: Ignacy Gawedzki, Johannes Berg, ath9k-devel@lists.ath9k.org,
linux-wireless@vger.kernel.org, Corey Richardson
In-Reply-To: <20130619193316.GA29582@zenon.in.qult.net>
Am 19.06.2013 21:33, schrieb Ignacy Gawedzki:
> On Wed, Jun 19, 2013 at 08:37:42PM +0200, thus spake Oleksij Rempel:
>> Can you please tell more about your access point:
>> - hardware
>> - firmware
>> - configuration
>> - "iw dev wlan0 scan dump"
>
> I tested the thing with at least three different APs:
>
> - Netgear DG834Gv4 with latest firmware.
this one is BG with Broadcom BCM4318. Is here original firmware or openwrt?
> - Netgear DG834Gv5 (don't know which firmware and can't check at this time).
this is BG with Conexant CX94610
> - hostapd (can't say which version at this time either) with the same
> ath9k_htc.
this one is actually BGN, did you configured it for N? Can you please
provide your hostapd.conf.
Do you have problems on all 3 configurations? Can you please test it
with some N (HT) capable AP. But please, not with N-draft certified AP.
--
Regards,
Oleksij
^ permalink raw reply
* Re: [GIT] net merged into net-next
From: Johannes Berg @ 2013-06-20 5:37 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-wireless, stephen
In-Reply-To: <20130619.165713.2010181145193961339.davem@davemloft.net>
On Wed, 2013-06-19 at 16:57 -0700, David Miller wrote:
>
> 'net' has been merged into 'net-next', the only non-trivial merge
> conflict was in wireless.
>
> It has to do with the bug fix that went recently into 'net' to fix the
> race that Linus discovered, which overlaps with the 'net-next' locking
> changes to nl80211.
>
> I am pretty sure I fixed a bug in those locking changes in my merge
> commit, in that the RTNL mutex was not released in all return paths of
> nl80211_dump_wiphy().
Yes.
> Please double-check my work.
Looks good, thanks.
We had a fix for the RTNL mutex bug on its way to you (currently in
wireless-next), but this way is good too :-)
johannes
^ permalink raw reply
* Re: [ath9k-devel] ath9k_htc: station unable to authenticate
From: Ignacy Gawedzki @ 2013-06-20 6:39 UTC (permalink / raw)
To: Oleksij Rempel
Cc: Johannes Berg, ath9k-devel@lists.ath9k.org,
linux-wireless@vger.kernel.org, Corey Richardson
In-Reply-To: <51C2942A.2080706@rempel-privat.de>
On Thu, Jun 20, 2013 at 07:33:30AM +0200, thus spake Oleksij Rempel:
> Am 19.06.2013 21:33, schrieb Ignacy Gawedzki:
> >I tested the thing with at least three different APs:
> >
> > - Netgear DG834Gv4 with latest firmware.
>
> this one is BG with Broadcom BCM4318. Is here original firmware or openwrt?
Original firmware, since OpenWRT doesn't support the ADSL chip.
> > - Netgear DG834Gv5 (don't know which firmware and can't check at this time).
>
> this is BG with Conexant CX94610
>
> > - hostapd (can't say which version at this time either) with the same
> > ath9k_htc.
>
> this one is actually BGN, did you configured it for N? Can you
> please provide your hostapd.conf.
I'll manage to get the configuration as soon as possible. It seems the
association problem went away since I patched the drivers on the AP too, so
"unpatching" the drivers on the station is not enough to reproduce the
problem. I'll unpatch the drivers on the AP and re-run the test.
> Do you have problems on all 3 configurations?
On both Netgears for sure. For hostapd I'll confirm that in a little while.
> Can you please test it
> with some N (HT) capable AP. But please, not with N-draft certified
> AP.
Is ath9k_htc N-capable?
--
I used to have a sig, but I've stopped smoking now.
^ permalink raw reply
* Re: [ath9k-devel] ath9k_htc: station unable to authenticate
From: Oleksij Rempel @ 2013-06-20 6:47 UTC (permalink / raw)
To: Ignacy Gawedzki, Johannes Berg, ath9k-devel@lists.ath9k.org,
linux-wireless@vger.kernel.org, Corey Richardson
In-Reply-To: <20130620063925.GA3885@zenon.in.qult.net>
Am 20.06.2013 08:39, schrieb Ignacy Gawedzki:
> On Thu, Jun 20, 2013 at 07:33:30AM +0200, thus spake Oleksij Rempel:
>> Am 19.06.2013 21:33, schrieb Ignacy Gawedzki:
>>> I tested the thing with at least three different APs:
>>>
>>> - Netgear DG834Gv4 with latest firmware.
>>
>> this one is BG with Broadcom BCM4318. Is here original firmware or openwrt?
>
> Original firmware, since OpenWRT doesn't support the ADSL chip.
>
>>> - Netgear DG834Gv5 (don't know which firmware and can't check at this time).
>>
>> this is BG with Conexant CX94610
>>
>>> - hostapd (can't say which version at this time either) with the same
>>> ath9k_htc.
>>
>> this one is actually BGN, did you configured it for N? Can you
>> please provide your hostapd.conf.
>
> I'll manage to get the configuration as soon as possible. It seems the
> association problem went away since I patched the drivers on the AP too, so
> "unpatching" the drivers on the station is not enough to reproduce the
> problem. I'll unpatch the drivers on the AP and re-run the test.
>
>> Do you have problems on all 3 configurations?
>
> On both Netgears for sure. For hostapd I'll confirm that in a little while.
>
>> Can you please test it
>> with some N (HT) capable AP. But please, not with N-draft certified
>> AP.
>
> Is ath9k_htc N-capable?
Yes, if hostapd configured properly.
Question to Corey,
i assume your old AP was supporting only BG networks. And your new one,
which is working fine, supports N?
--
Regards,
Oleksij
^ permalink raw reply
* [PATCH] ath6kl: Fix race in heart beat polling
From: Mohammed Shafi Shajakhan @ 2013-06-20 7:17 UTC (permalink / raw)
To: linux-wireless
Cc: Kalle Valo, Vasanthakumar Thiagarajan, Mohammed Shafi Shajakhan
From: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Make sure to cancel heart beat timer before
freeing wmi to avoid potential NULL pointer
dereference.
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/init.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 6a67881..4f316bd 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -1836,6 +1836,9 @@ void ath6kl_stop_txrx(struct ath6kl *ar)
clear_bit(WMI_READY, &ar->flag);
+ if (ar->fw_recovery.enable)
+ del_timer_sync(&ar->fw_recovery.hb_timer);
+
/*
* After wmi_shudown all WMI events will be dropped. We
* need to cleanup the buffers allocated in AP mode and
--
1.7.9.5
^ permalink raw reply related
* [PATCH 3.9/3.10] ath9k_htc: Handle IDLE state transition properly
From: Sujith Manoharan @ 2013-06-20 8:27 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, stable
From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Make sure that a chip reset is done when IDLE is turned
off - this fixes authentication timeouts.
Cc: stable@vger.kernel.org
Reported-by: Ignacy Gawedzki <i@lri.fr>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index eaa94fe..fba6ea7 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1183,7 +1183,7 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed)
mutex_lock(&priv->htc_pm_lock);
priv->ps_idle = !!(conf->flags & IEEE80211_CONF_IDLE);
- if (priv->ps_idle)
+ if (!priv->ps_idle)
chip_reset = true;
mutex_unlock(&priv->htc_pm_lock);
--
1.8.3.1
^ permalink raw reply related
* Re: BCM4331 deauthenticates every five minutes
From: Arend van Spriel @ 2013-06-20 8:33 UTC (permalink / raw)
To: Chris Adams
Cc: Rafał Miłecki, Larry Finger, b43-dev, linux-wireless
In-Reply-To: <20130619211108.GG4784@cmadams.net>
On 06/19/2013 11:11 PM, Chris Adams wrote:
> Once upon a time, Arend van Spriel <arend@broadcom.com> said:
>> Can you make a capture using a wireless sniffer (using your thinkpad maybe)?
>
> How would I go about doing that? I've done lots of network debugging
> with tcpdump and such, but not much wireless stuff.
>
I use wireshark these days. If you install that you can use the steps
below and select the wireless interface in wireshark to capture. I use
wlan0 as interface name, but it may be different for you.
1. disable network-manager so it won't interfere.
2. bring the interface down
$ sudo ifconfig wlan0 down
3. change interface type to monitor
$ sudo iw dev wlan0 set type monitor
4. bring up the interface
$ sudo ifconfig wlan0 up
5. start wireshark and select wlan0
$ gksudo wireshark
It will complain that running wireshark as root is not secure. If you
care about that, you should read [1].
Regards,
Arend
[1]
http://wiki.wireshark.org/Security#Administrator.2Froot_account_not_required.21
^ permalink raw reply
* Re: BCM4331 deauthenticates every five minutes
From: Arend van Spriel @ 2013-06-20 8:36 UTC (permalink / raw)
To: Chris Adams
Cc: Rafał Miłecki, Larry Finger, b43-dev, linux-wireless
In-Reply-To: <51C2BE54.20509@broadcom.com>
On 06/20/2013 10:33 AM, Arend van Spriel wrote:
> On 06/19/2013 11:11 PM, Chris Adams wrote:
>> Once upon a time, Arend van Spriel <arend@broadcom.com> said:
>>> Can you make a capture using a wireless sniffer (using your thinkpad
>>> maybe)?
>>
>> How would I go about doing that? I've done lots of network debugging
>> with tcpdump and such, but not much wireless stuff.
>>
>
> I use wireshark these days. If you install that you can use the steps
> below and select the wireless interface in wireshark to capture. I use
> wlan0 as interface name, but it may be different for you.
>
> 1. disable network-manager so it won't interfere.
> 2. bring the interface down
> $ sudo ifconfig wlan0 down
> 3. change interface type to monitor
> $ sudo iw dev wlan0 set type monitor
> 4. bring up the interface
> $ sudo ifconfig wlan0 up
> 5. start wireshark and select wlan0
> $ gksudo wireshark
>
> It will complain that running wireshark as root is not secure. If you
> care about that, you should read [1].
Forgot a step. You need to select a channel. You can do that before
starting a capture in wireshark: $ sudo iw dev wlan0 set channel 5
> Regards,
> Arend
>
> [1]
> http://wiki.wireshark.org/Security#Administrator.2Froot_account_not_required.21
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* [PATCH] ath9k: fix queue depth accounting in ath_tx_txqaddbuf
From: Felix Fietkau @ 2013-06-20 13:11 UTC (permalink / raw)
To: linux-wireless; +Cc: linville
ath_tx_txqaddbuf assumes that all the linked buffers in the queue passed
to it are part of the same A-MPDU or MPDU. The CAB queue rework violates
this assumption, which can cause the internal queue depth to go
negative.
Fix this by increasing the counter for all slots of [bf, bf->bf_lastbf]
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
drivers/net/wireless/ath/ath9k/xmit.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 7e19d9b..bfb58a5 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -1778,9 +1778,13 @@ static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq,
}
if (!internal) {
- txq->axq_depth++;
- if (bf_is_ampdu_not_probing(bf))
- txq->axq_ampdu_depth++;
+ while (bf) {
+ txq->axq_depth++;
+ if (bf_is_ampdu_not_probing(bf))
+ txq->axq_ampdu_depth++;
+
+ bf = bf->bf_lastbf->bf_next;
+ }
}
}
--
1.8.0.2
^ permalink raw reply related
* Patch availability
From: Ricardo @ 2013-06-20 13:11 UTC (permalink / raw)
To: linux-wireless
Hi,
My name is Ricardo and I am very interested on these patches, are them
available for download?
Currently, I am working with ath5k patched with GCDC patches, but I prefer
to work with an ath9k patched driver since it is easier to get ath9k cards
nowadays.
If I can help in anything (development, testing), just let me know.
Regards, Ricardo.
^ permalink raw reply
* [PATCH 1/2] wil6210: set vring index for all descriptors
From: Kirshenbaum Erez @ 2013-06-20 12:45 UTC (permalink / raw)
To: qca_vkondrat; +Cc: linux-wireless, Kirshenbaum Erez
The vring index (MAC queue id) must be set in all TX descriptors
otherwise HW will fail to release descriptors for a specific vring
(disconnect or vring switch flows).
This is normally occurs when fragmentation required, if vring index
will not be the same for all SKB descriptors HW will fail to flush this
MAC queue.
Signed-off-by: Kirshenbaum Erez <erezk@wilocity.com>
---
drivers/net/wireless/ath/wil6210/txrx.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c
index e1c492b..b79ba10 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.c
+++ b/drivers/net/wireless/ath/wil6210/txrx.c
@@ -621,7 +621,8 @@ static struct vring *wil_find_tx_vring(struct wil6210_priv *wil,
return NULL;
}
-static int wil_tx_desc_map(struct vring_tx_desc *d, dma_addr_t pa, u32 len)
+static int wil_tx_desc_map(struct vring_tx_desc *d, dma_addr_t pa, u32 len,
+ int vring_index)
{
wil_desc_addr_set(&d->dma.addr, pa);
d->dma.ip_length = 0;
@@ -631,6 +632,7 @@ static int wil_tx_desc_map(struct vring_tx_desc *d, dma_addr_t pa, u32 len)
d->dma.status = 0; /* BIT(0) should be 0 for HW_OWNED */
d->dma.length = cpu_to_le16((u16)len);
d->dma.d0 = 0;
+ d->dma.d0 = (vring_index << DMA_CFG_DESC_TX_0_QID_POS);
d->mac.d[0] = 0;
d->mac.d[1] = 0;
d->mac.d[2] = 0;
@@ -684,7 +686,7 @@ static int wil_tx_vring(struct wil6210_priv *wil, struct vring *vring,
if (unlikely(dma_mapping_error(dev, pa)))
return -EINVAL;
/* 1-st segment */
- wil_tx_desc_map(d, pa, skb_headlen(skb));
+ wil_tx_desc_map(d, pa, skb_headlen(skb), vring_index);
d->mac.d[2] |= ((nr_frags + 1) <<
MAC_CFG_DESC_TX_2_NUM_OF_DESCRIPTORS_POS);
if (nr_frags)
@@ -701,7 +703,7 @@ static int wil_tx_vring(struct wil6210_priv *wil, struct vring *vring,
DMA_TO_DEVICE);
if (unlikely(dma_mapping_error(dev, pa)))
goto dma_error;
- wil_tx_desc_map(d, pa, len);
+ wil_tx_desc_map(d, pa, len, vring_index);
vring->ctx[i] = NULL;
*_d = *d;
}
@@ -709,7 +711,6 @@ static int wil_tx_vring(struct wil6210_priv *wil, struct vring *vring,
d->dma.d0 |= BIT(DMA_CFG_DESC_TX_0_CMD_EOP_POS);
d->dma.d0 |= BIT(9); /* BUG: undocumented bit */
d->dma.d0 |= BIT(DMA_CFG_DESC_TX_0_CMD_DMA_IT_POS);
- d->dma.d0 |= (vring_index << DMA_CFG_DESC_TX_0_QID_POS);
*_d = *d;
wil_hex_dump_txrx("Tx ", DUMP_PREFIX_NONE, 32, 4,
--
1.7.11.7
^ permalink raw reply related
* [PATCH 2/2] wil6210: add HW write-back option in TX descriptor
From: Kirshenbaum Erez @ 2013-06-20 12:45 UTC (permalink / raw)
To: qca_vkondrat; +Cc: linux-wireless, Kirshenbaum Erez
Map BIT 9 in TX DMA DWARD 0 as HW write back option.
We must turn on this option in the last TX descriptor,
this is required for old HW compatability.
This option indicate to HW that WB is required for this descriptor.
Signed-off-by: Kirshenbaum Erez <erezk@wilocity.com>
---
drivers/net/wireless/ath/wil6210/txrx.c | 2 +-
drivers/net/wireless/ath/wil6210/txrx.h | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c
index b79ba10..c3e763c 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.c
+++ b/drivers/net/wireless/ath/wil6210/txrx.c
@@ -709,7 +709,7 @@ static int wil_tx_vring(struct wil6210_priv *wil, struct vring *vring,
}
/* for the last seg only */
d->dma.d0 |= BIT(DMA_CFG_DESC_TX_0_CMD_EOP_POS);
- d->dma.d0 |= BIT(9); /* BUG: undocumented bit */
+ d->dma.d0 |= BIT(DMA_CFG_DESC_TX_0_CMD_MARK_WB_POS);
d->dma.d0 |= BIT(DMA_CFG_DESC_TX_0_CMD_DMA_IT_POS);
*_d = *d;
diff --git a/drivers/net/wireless/ath/wil6210/txrx.h b/drivers/net/wireless/ath/wil6210/txrx.h
index 23c0781..859aea6 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.h
+++ b/drivers/net/wireless/ath/wil6210/txrx.h
@@ -201,6 +201,10 @@ struct vring_tx_mac {
#define DMA_CFG_DESC_TX_0_CMD_EOP_LEN 1
#define DMA_CFG_DESC_TX_0_CMD_EOP_MSK 0x100
+#define DMA_CFG_DESC_TX_0_CMD_MARK_WB_POS 9
+#define DMA_CFG_DESC_TX_0_CMD_MARK_WB_LEN 1
+#define DMA_CFG_DESC_TX_0_CMD_MARK_WB_MSK 0x200
+
#define DMA_CFG_DESC_TX_0_CMD_DMA_IT_POS 10
#define DMA_CFG_DESC_TX_0_CMD_DMA_IT_LEN 1
#define DMA_CFG_DESC_TX_0_CMD_DMA_IT_MSK 0x400
--
1.7.11.7
^ permalink raw reply related
* Re: [PATCH 1/2] wil6210: set vring index for all descriptors
From: Vladimir Kondratiev @ 2013-06-20 13:55 UTC (permalink / raw)
To: Kirshenbaum Erez; +Cc: linux-wireless
In-Reply-To: <1371732325-4112-1-git-send-email-erezk@wilocity.com>
On Thursday, June 20, 2013 03:45:25 PM Kirshenbaum Erez wrote:
> The vring index (MAC queue id) must be set in all TX descriptors
> otherwise HW will fail to release descriptors for a specific vring
> (disconnect or vring switch flows).
> This is normally occurs when fragmentation required, if vring index
> will not be the same for all SKB descriptors HW will fail to flush this
> MAC queue.
>
> Signed-off-by: Kirshenbaum Erez <erezk@wilocity.com>
> ---
> drivers/net/wireless/ath/wil6210/txrx.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c
> index e1c492b..b79ba10 100644
> --- a/drivers/net/wireless/ath/wil6210/txrx.c
> +++ b/drivers/net/wireless/ath/wil6210/txrx.c
> @@ -621,7 +621,8 @@ static struct vring *wil_find_tx_vring(struct wil6210_priv *wil,
> return NULL;
> }
>
> -static int wil_tx_desc_map(struct vring_tx_desc *d, dma_addr_t pa, u32 len)
> +static int wil_tx_desc_map(struct vring_tx_desc *d, dma_addr_t pa, u32 len,
> + int vring_index)
> {
> wil_desc_addr_set(&d->dma.addr, pa);
> d->dma.ip_length = 0;
> @@ -631,6 +632,7 @@ static int wil_tx_desc_map(struct vring_tx_desc *d, dma_addr_t pa, u32 len)
> d->dma.status = 0; /* BIT(0) should be 0 for HW_OWNED */
> d->dma.length = cpu_to_le16((u16)len);
> d->dma.d0 = 0;
Then, remove line above
> + d->dma.d0 = (vring_index << DMA_CFG_DESC_TX_0_QID_POS);
> d->mac.d[0] = 0;
> d->mac.d[1] = 0;
> d->mac.d[2] = 0;
<skip>
The rest looks fine
Thanks, Vladimir
^ permalink raw reply
* Re: [PATCH 2/2] wil6210: add HW write-back option in TX descriptor
From: Vladimir Kondratiev @ 2013-06-20 14:00 UTC (permalink / raw)
To: Kirshenbaum Erez; +Cc: linux-wireless
In-Reply-To: <1371732340-4149-1-git-send-email-erezk@wilocity.com>
On Thursday, June 20, 2013 03:45:40 PM Kirshenbaum Erez wrote:
> Map BIT 9 in TX DMA DWARD 0 as HW write back option.
> We must turn on this option in the last TX descriptor,
> this is required for old HW compatability.
> This option indicate to HW that WB is required for this descriptor.
>
> Signed-off-by: Kirshenbaum Erez <erezk@wilocity.com>
Here is my
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Thanks for this.
^ permalink raw reply
* [PATCH] nl80211/drivers: change bss channel to chandef
From: Simon Wunderlich @ 2013-06-20 14:10 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Simon Wunderlich
To prepare the wireless stack for 5/10 MHz channels, change the
cfg80211_bss structure to contain a chandef instead of a channel. This
allows to distinguish between BSSs with different widths (5, 10, 20+
MHz) on the same channel. Scanning or connecting explicitly in a
certain channel width can be added later.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 4 +-
drivers/net/wireless/ath/ath6kl/wmi.c | 5 +-
drivers/net/wireless/ath/wil6210/wmi.c | 5 +-
.../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 2 +
drivers/net/wireless/libertas/cfg.c | 7 +-
drivers/net/wireless/mwifiex/cfg80211.c | 4 +-
drivers/net/wireless/mwifiex/scan.c | 3 +
drivers/net/wireless/orinoco/scan.c | 8 +-
drivers/net/wireless/rndis_wlan.c | 4 +
drivers/staging/wlan-ng/cfg80211.c | 9 +-
include/net/cfg80211.h | 18 ++--
net/mac80211/ibss.c | 20 ++--
net/mac80211/mlme.c | 23 ++--
net/mac80211/scan.c | 4 +-
net/wireless/chan.c | 4 +-
net/wireless/core.h | 2 +-
net/wireless/ibss.c | 2 +-
net/wireless/mlme.c | 16 +--
net/wireless/nl80211.c | 14 +--
net/wireless/scan.c | 111 ++++++++++++++------
net/wireless/sme.c | 21 +++-
net/wireless/trace.h | 42 ++++----
net/wireless/wext-sme.c | 2 +-
23 files changed, 214 insertions(+), 116 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 2437ad2..0819e07 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -686,6 +686,7 @@ ath6kl_add_bss_if_needed(struct ath6kl_vif *vif,
{
struct ath6kl *ar = vif->ar;
struct cfg80211_bss *bss;
+ struct cfg80211_chan_def chandef;
u16 cap_mask, cap_val;
u8 *ie;
@@ -716,7 +717,8 @@ ath6kl_add_bss_if_needed(struct ath6kl_vif *vif,
ie[1] = vif->ssid_len;
memcpy(ie + 2, vif->ssid, vif->ssid_len);
memcpy(ie + 2 + vif->ssid_len, beacon_ie, beacon_ie_len);
- bss = cfg80211_inform_bss(ar->wiphy, chan,
+ cfg80211_chandef_create(&chandef, chan, NL80211_CHAN_NO_HT);
+ bss = cfg80211_inform_bss(ar->wiphy, &chandef,
bssid, 0, cap_val, 100,
ie, 2 + vif->ssid_len + beacon_ie_len,
0, GFP_KERNEL);
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index 87aefb4..4e42f29 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -1044,6 +1044,7 @@ static int ath6kl_wmi_bssinfo_event_rx(struct wmi *wmi, u8 *datap, int len,
struct wmi_bss_info_hdr2 *bih;
u8 *buf;
struct ieee80211_channel *channel;
+ struct cfg80211_chan_def chandef;
struct ath6kl *ar = wmi->parent_dev;
struct ieee80211_mgmt *mgmt;
struct cfg80211_bss *bss;
@@ -1120,7 +1121,9 @@ static int ath6kl_wmi_bssinfo_event_rx(struct wmi *wmi, u8 *datap, int len,
memcpy(&mgmt->u.beacon, buf, len);
- bss = cfg80211_inform_bss_frame(ar->wiphy, channel, mgmt,
+ cfg80211_chandef_create(&chandef, channel, NL80211_CHAN_NO_HT);
+
+ bss = cfg80211_inform_bss_frame(ar->wiphy, &chandef, mgmt,
24 + len, (bih->snr - 95) * 100,
GFP_ATOMIC);
kfree(mgmt);
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c
index 527ffb5..e2047e5 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.c
+++ b/drivers/net/wireless/ath/wil6210/wmi.c
@@ -300,6 +300,7 @@ static void wmi_evt_rx_mgmt(struct wil6210_priv *wil, int id, void *d, int len)
{
struct wmi_rx_mgmt_packet_event *data = d;
struct wiphy *wiphy = wil_to_wiphy(wil);
+ struct cfg80211_chan_def chandef;
struct ieee80211_mgmt *rx_mgmt_frame =
(struct ieee80211_mgmt *)data->payload;
int ch_no = data->info.channel+1;
@@ -327,7 +328,9 @@ static void wmi_evt_rx_mgmt(struct wil6210_priv *wil, int id, void *d, int len)
if (ieee80211_is_beacon(fc) || ieee80211_is_probe_resp(fc)) {
struct cfg80211_bss *bss;
- bss = cfg80211_inform_bss_frame(wiphy, channel, rx_mgmt_frame,
+ /* TODO: this is actually no 20 MHz channel width ... */
+ cfg80211_chandef_create(&chandef, channel, NL80211_CHAN_NO_HT);
+ bss = cfg80211_inform_bss_frame(wiphy, &chandef, rx_mgmt_frame,
d_len, signal, GFP_KERNEL);
if (bss) {
wil_dbg_wmi(wil, "Added BSS %pM\n",
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index 8bd256b..f6151d0 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -2235,6 +2235,7 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_info *cfg,
{
struct wiphy *wiphy = cfg_to_wiphy(cfg);
struct ieee80211_channel *notify_channel;
+ struct cfg80211_chan_def chandef;
struct cfg80211_bss *bss;
struct ieee80211_supported_band *band;
struct brcmu_chan ch;
@@ -2279,6 +2280,7 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_info *cfg,
brcmf_dbg(CONN, "Beacon interval: %d\n", notify_interval);
brcmf_dbg(CONN, "Signal: %d\n", notify_signal);
+ cfg80211_chandef_create(&chandef, channel, NL80211_CHAN_NO_HT);
bss = cfg80211_inform_bss(wiphy, notify_channel, (const u8 *)bi->BSSID,
0, notify_capability, notify_interval, notify_ie,
notify_ielen, notify_signal, GFP_KERNEL);
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
index 116f4ab..e252fd7 100644
--- a/drivers/net/wireless/libertas/cfg.c
+++ b/drivers/net/wireless/libertas/cfg.c
@@ -504,6 +504,7 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy,
struct cmd_header *resp)
{
struct cfg80211_bss *bss;
+ struct cfg80211_chan_def chandef;
struct cmd_ds_802_11_scan_rsp *scanresp = (void *)resp;
int bsssize;
const u8 *pos;
@@ -652,7 +653,9 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy,
if (channel &&
!(channel->flags & IEEE80211_CHAN_DISABLED)) {
- bss = cfg80211_inform_bss(wiphy, channel,
+ cfg80211_chandef_create(&chandef, channel,
+ NL80211_CHAN_NO_HT);
+ bss = cfg80211_inform_bss(wiphy, &chandef,
bssid, get_unaligned_le64(tsfdesc),
capa, intvl, ie, ielen,
LBS_SCAN_RSSI_TO_MBM(rssi),
@@ -1759,7 +1762,7 @@ static void lbs_join_post(struct lbs_private *priv,
lbs_deb_hex(LBS_DEB_CFG80211, "IE", fake_ie, fake - fake_ie);
bss = cfg80211_inform_bss(priv->wdev->wiphy,
- params->chandef.chan,
+ ¶ms->chandef,
bssid,
0,
capability,
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 856aea2..a2843fd 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1514,6 +1514,7 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv)
struct ieee80211_channel *chan;
struct mwifiex_bss_info bss_info;
struct cfg80211_bss *bss;
+ struct cfg80211_chan_def chandef;
int ie_len;
u8 ie_buf[IEEE80211_MAX_SSID_LEN + sizeof(struct ieee_types_header)];
enum ieee80211_band band;
@@ -1533,7 +1534,8 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv)
ieee80211_channel_to_frequency(bss_info.bss_chan,
band));
- bss = cfg80211_inform_bss(priv->wdev->wiphy, chan,
+ cfg80211_chandef_create(&chandef, chan, NL80211_CHAN_NO_HT);
+ bss = cfg80211_inform_bss(priv->wdev->wiphy, &chandef,
bss_info.bssid, 0, WLAN_CAPABILITY_IBSS,
0, ie_buf, ie_len, 0, GFP_KERNEL);
cfg80211_put_bss(priv->wdev->wiphy, bss);
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index 801b6b7..410b281 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -1559,6 +1559,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
u8 is_bgscan_resp;
unsigned long flags;
struct cfg80211_bss *bss;
+ struct cfg80211_chan_def chandef;
is_bgscan_resp = (le16_to_cpu(resp->command)
== HostCmd_CMD_802_11_BG_SCAN_QUERY);
@@ -1743,6 +1744,8 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
chan = ieee80211_get_channel(priv->wdev->wiphy, freq);
if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) {
+ cfg80211_chandef_create(&chandef, channel,
+ NL80211_CHAN_NO_HT);
bss = cfg80211_inform_bss(priv->wdev->wiphy,
chan, bssid, timestamp,
cap_info_bitmap, beacon_period,
diff --git a/drivers/net/wireless/orinoco/scan.c b/drivers/net/wireless/orinoco/scan.c
index e8c5714..8837a81 100644
--- a/drivers/net/wireless/orinoco/scan.c
+++ b/drivers/net/wireless/orinoco/scan.c
@@ -76,6 +76,7 @@ static void orinoco_add_hostscan_result(struct orinoco_private *priv,
{
struct wiphy *wiphy = priv_to_wiphy(priv);
struct ieee80211_channel *channel;
+ struct cfg80211_chan_def chandef;
struct cfg80211_bss *cbss;
u8 *ie;
u8 ie_buf[46];
@@ -122,7 +123,8 @@ static void orinoco_add_hostscan_result(struct orinoco_private *priv,
beacon_interval = le16_to_cpu(bss->a.beacon_interv);
signal = SIGNAL_TO_MBM(le16_to_cpu(bss->a.level));
- cbss = cfg80211_inform_bss(wiphy, channel, bss->a.bssid, timestamp,
+ cfg80211_chandef_create(&chandef, channel, NL80211_CHAN_NO_HT);
+ cbss = cfg80211_inform_bss(wiphy, &chandef, bss->a.bssid, timestamp,
capability, beacon_interval, ie_buf, ie_len,
signal, GFP_KERNEL);
cfg80211_put_bss(wiphy, cbss);
@@ -134,6 +136,7 @@ void orinoco_add_extscan_result(struct orinoco_private *priv,
{
struct wiphy *wiphy = priv_to_wiphy(priv);
struct ieee80211_channel *channel;
+ struct cfg80211_chan_def chandef;
struct cfg80211_bss *cbss;
const u8 *ie;
u64 timestamp;
@@ -155,7 +158,8 @@ void orinoco_add_extscan_result(struct orinoco_private *priv,
ie = bss->data;
signal = SIGNAL_TO_MBM(bss->level);
- cbss = cfg80211_inform_bss(wiphy, channel, bss->bssid, timestamp,
+ cfg80211_chandef_create(&chandef, channel, NL80211_CHAN_NO_HT);
+ cbss = cfg80211_inform_bss(wiphy, &chandef, bss->bssid, timestamp,
capability, beacon_interval, ie, ie_len,
signal, GFP_KERNEL);
cfg80211_put_bss(wiphy, cbss);
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 8169a85..e8a4e16 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -1984,6 +1984,7 @@ static bool rndis_bss_info_update(struct usbnet *usbdev,
{
struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev);
struct ieee80211_channel *channel;
+ struct cfg80211_chan_def chandef;
struct cfg80211_bss *bss;
s32 signal;
u64 timestamp;
@@ -2023,6 +2024,7 @@ static bool rndis_bss_info_update(struct usbnet *usbdev,
capability = le16_to_cpu(fixed->capabilities);
beacon_interval = le16_to_cpu(fixed->beacon_interval);
+ cfg80211_chandef_create(&chandef, channel, NL80211_CHAN_NO_HT);
bss = cfg80211_inform_bss(priv->wdev.wiphy, channel, bssid->mac,
timestamp, capability, beacon_interval, ie, ie_len, signal,
GFP_KERNEL);
@@ -2648,6 +2650,7 @@ static void rndis_wlan_craft_connected_bss(struct usbnet *usbdev, u8 *bssid,
struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev);
struct ieee80211_channel *channel;
struct ndis_80211_ssid ssid;
+ struct cfg80211_chan_def chandef;
struct cfg80211_bss *bss;
s32 signal;
u64 timestamp;
@@ -2712,6 +2715,7 @@ static void rndis_wlan_craft_connected_bss(struct usbnet *usbdev, u8 *bssid,
bssid, (u32)timestamp, capability, beacon_period, ie_len,
ssid.essid, signal);
+ cfg80211_chandef_create(&chandef, channel, NL80211_CHAN_NO_HT);
bss = cfg80211_inform_bss(priv->wdev.wiphy, channel, bssid,
timestamp, capability, beacon_period, ie_buf, ie_len,
signal, GFP_KERNEL);
diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c
index f1bce18..e91d50a 100644
--- a/drivers/staging/wlan-ng/cfg80211.c
+++ b/drivers/staging/wlan-ng/cfg80211.c
@@ -334,8 +334,11 @@ int prism2_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
wlandevice_t *wlandev;
struct p80211msg_dot11req_scan msg1;
struct p80211msg_dot11req_scan_results msg2;
+ struct cfg80211_chan_def chandef;
struct cfg80211_bss *bss;
+ struct ieee80211_channel *channel;
int result;
+ int freq;
int err = 0;
int numbss = 0;
int i = 0;
@@ -408,8 +411,10 @@ int prism2_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
ie_buf[1] = msg2.ssid.data.len;
ie_len = ie_buf[1] + 2;
memcpy(&ie_buf[2], &(msg2.ssid.data.data), msg2.ssid.data.len);
- bss = cfg80211_inform_bss(wiphy,
- ieee80211_get_channel(wiphy, ieee80211_dsss_chan_to_freq(msg2.dschannel.data)),
+ freq = ieee80211_dsss_chan_to_freq(msg2.dschannel.data);
+ channel = ieee80211_get_channel(wiphy, freq);
+ cfg80211_chandef_create(&chandef, channel, NL80211_CHAN_NO_HT);
+ bss = cfg80211_inform_bss(wiphy, &chandef,
(const u8 *) &(msg2.bssid.data.data),
msg2.timestamp.data, msg2.capinfo.data,
msg2.beaconperiod.data,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index e3a39fc..18c0850 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1402,7 +1402,7 @@ struct cfg80211_bss_ies {
* This structure describes a BSS (which may also be a mesh network)
* for use in scan results and similar.
*
- * @channel: channel this BSS is on
+ * @chandef: chandef of the channel this BSS is on
* @bssid: BSSID of the BSS
* @beacon_interval: the beacon interval as from the frame
* @capability: the capability field in host byte order
@@ -1423,7 +1423,7 @@ struct cfg80211_bss_ies {
* @priv: private area for driver use, has at least wiphy->bss_priv_size bytes
*/
struct cfg80211_bss {
- struct ieee80211_channel *channel;
+ struct cfg80211_chan_def chandef;
const struct cfg80211_bss_ies __rcu *ies;
const struct cfg80211_bss_ies __rcu *beacon_ies;
@@ -3382,7 +3382,7 @@ void cfg80211_sched_scan_stopped(struct wiphy *wiphy);
* cfg80211_inform_bss_frame - inform cfg80211 of a received BSS frame
*
* @wiphy: the wiphy reporting the BSS
- * @channel: The channel the frame was received on
+ * @chandef: The chandef of the channel the frame was received on
* @mgmt: the management frame (probe response or beacon)
* @len: length of the management frame
* @signal: the signal strength, type depends on the wiphy's signal_type
@@ -3396,7 +3396,7 @@ void cfg80211_sched_scan_stopped(struct wiphy *wiphy);
*/
struct cfg80211_bss * __must_check
cfg80211_inform_bss_frame(struct wiphy *wiphy,
- struct ieee80211_channel *channel,
+ struct cfg80211_chan_def *chandef,
struct ieee80211_mgmt *mgmt, size_t len,
s32 signal, gfp_t gfp);
@@ -3404,7 +3404,7 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
* cfg80211_inform_bss - inform cfg80211 of a new BSS
*
* @wiphy: the wiphy reporting the BSS
- * @channel: The channel the frame was received on
+ * @chandef: The chandef of the channel the frame was received on
* @bssid: the BSSID of the BSS
* @tsf: the TSF sent by the peer in the beacon/probe response (or 0)
* @capability: the capability field sent by the peer
@@ -3422,22 +3422,22 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
*/
struct cfg80211_bss * __must_check
cfg80211_inform_bss(struct wiphy *wiphy,
- struct ieee80211_channel *channel,
+ struct cfg80211_chan_def *chandef,
const u8 *bssid, u64 tsf, u16 capability,
u16 beacon_interval, const u8 *ie, size_t ielen,
s32 signal, gfp_t gfp);
struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
- struct ieee80211_channel *channel,
+ struct cfg80211_chan_def *chandef,
const u8 *bssid,
const u8 *ssid, size_t ssid_len,
u16 capa_mask, u16 capa_val);
static inline struct cfg80211_bss *
cfg80211_get_ibss(struct wiphy *wiphy,
- struct ieee80211_channel *channel,
+ struct cfg80211_chan_def *chandef,
const u8 *ssid, size_t ssid_len)
{
- return cfg80211_get_bss(wiphy, channel, NULL, ssid, ssid_len,
+ return cfg80211_get_bss(wiphy, chandef, NULL, ssid, ssid_len,
WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS);
}
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index ea7b9c2..bef96b8 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -246,7 +246,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
mod_timer(&ifibss->timer,
round_jiffies(jiffies + IEEE80211_IBSS_MERGE_INTERVAL));
- bss = cfg80211_inform_bss_frame(local->hw.wiphy, chan,
+ bss = cfg80211_inform_bss_frame(local->hw.wiphy, &chandef,
mgmt, presp->head_len, 0, GFP_KERNEL);
cfg80211_put_bss(local->hw.wiphy, bss);
netif_carrier_on(sdata->dev);
@@ -270,7 +270,7 @@ static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
if (beacon_int < 10)
beacon_int = 10;
- sband = sdata->local->hw.wiphy->bands[cbss->channel->band];
+ sband = sdata->local->hw.wiphy->bands[cbss->chandef.chan->band];
basic_rates = 0;
@@ -294,7 +294,7 @@ static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
__ieee80211_sta_join_ibss(sdata, cbss->bssid,
beacon_int,
- cbss->channel,
+ cbss->chandef.chan,
basic_rates,
cbss->capability,
tsf, false);
@@ -546,7 +546,8 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
/* different channel */
if (sdata->u.ibss.fixed_channel &&
- sdata->u.ibss.chandef.chan != cbss->channel)
+ !cfg80211_chandef_compatible(&sdata->u.ibss.chandef,
+ &cbss->chandef))
goto put_bss;
/* different SSID */
@@ -749,7 +750,7 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
struct ieee80211_local *local = sdata->local;
struct cfg80211_bss *cbss;
- struct ieee80211_channel *chan = NULL;
+ struct cfg80211_chan_def *chandef = NULL;
const u8 *bssid = NULL;
int active_ibss;
u16 capability;
@@ -768,10 +769,10 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
if (ifibss->fixed_bssid)
bssid = ifibss->bssid;
if (ifibss->fixed_channel)
- chan = ifibss->chandef.chan;
+ chandef = &ifibss->chandef;
if (!is_zero_ether_addr(ifibss->bssid))
bssid = ifibss->bssid;
- cbss = cfg80211_get_bss(local->hw.wiphy, chan, bssid,
+ cbss = cfg80211_get_bss(local->hw.wiphy, chandef, bssid,
ifibss->ssid, ifibss->ssid_len,
WLAN_CAPABILITY_IBSS | WLAN_CAPABILITY_PRIVACY,
capability);
@@ -800,7 +801,8 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
sdata_info(sdata, "Trigger new scan to find an IBSS to join\n");
ieee80211_request_ibss_scan(sdata, ifibss->ssid,
- ifibss->ssid_len, chan);
+ ifibss->ssid_len,
+ chandef ? chandef->chan : NULL);
} else {
int interval = IEEE80211_SCAN_INTERVAL;
@@ -1094,7 +1096,7 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
if (ifibss->privacy)
capability |= WLAN_CAPABILITY_PRIVACY;
- cbss = cfg80211_get_bss(local->hw.wiphy, ifibss->chandef.chan,
+ cbss = cfg80211_get_bss(local->hw.wiphy, &ifibss->chandef,
ifibss->bssid, ifibss->ssid,
ifibss->ssid_len, WLAN_CAPABILITY_IBSS |
WLAN_CAPABILITY_PRIVACY,
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index e0939eb..c7ffbc9 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -953,7 +953,7 @@ static void ieee80211_chswitch_work(struct work_struct *work)
}
/* XXX: shouldn't really modify cfg80211-owned data! */
- ifmgd->associated->channel = local->_oper_chandef.chan;
+ ifmgd->associated->chandef = local->_oper_chandef;
/* XXX: wait for a beacon first? */
ieee80211_wake_queues_by_reason(&local->hw,
@@ -1053,7 +1053,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
count = elems->ext_chansw_ie->count;
mode = elems->ext_chansw_ie->mode;
} else if (elems->ch_switch_ie) {
- new_band = cbss->channel->band;
+ new_band = cbss->chandef.chan->band;
new_chan_no = elems->ch_switch_ie->new_ch_num;
count = elems->ch_switch_ie->count;
mode = elems->ch_switch_ie->mode;
@@ -2030,7 +2030,8 @@ static void ieee80211_mgd_probe_ap_send(struct ieee80211_sub_if_data *sdata)
ieee80211_send_probe_req(sdata, dst, ssid + 2, ssid_len, NULL,
0, (u32) -1, true, 0,
- ifmgd->associated->channel, false);
+ ifmgd->associated->chandef.chan,
+ false);
rcu_read_unlock();
}
@@ -2138,7 +2139,7 @@ struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw,
ssid_len = ssid[1];
skb = ieee80211_build_probe_req(sdata, cbss->bssid,
- (u32) -1, cbss->channel,
+ (u32) -1, cbss->chandef.chan,
ssid + 2, ssid_len,
NULL, 0, true);
rcu_read_unlock();
@@ -3316,7 +3317,7 @@ static int ieee80211_probe_auth(struct ieee80211_sub_if_data *sdata)
*/
ieee80211_send_probe_req(sdata, NULL, ssidie + 2, ssidie[1],
NULL, 0, (u32) -1, true, 0,
- auth_data->bss->channel, false);
+ auth_data->bss->chandef.chan, false);
rcu_read_unlock();
}
@@ -3711,7 +3712,7 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
struct cfg80211_chan_def chandef;
int ret;
- sband = local->hw.wiphy->bands[cbss->channel->band];
+ sband = local->hw.wiphy->bands[cbss->chandef.chan->band];
ifmgd->flags &= ~(IEEE80211_STA_DISABLE_40MHZ |
IEEE80211_STA_DISABLE_80P80MHZ |
@@ -3758,7 +3759,7 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
}
ifmgd->flags |= ieee80211_determine_chantype(sdata, sband,
- cbss->channel,
+ cbss->chandef.chan,
ht_oper, vht_oper,
&chandef, true);
@@ -3823,7 +3824,7 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
struct ieee80211_supported_band *sband;
const struct cfg80211_bss_ies *ies;
- sband = local->hw.wiphy->bands[cbss->channel->band];
+ sband = local->hw.wiphy->bands[cbss->chandef.chan->band];
err = ieee80211_prep_channel(sdata, cbss);
if (err) {
@@ -3851,11 +3852,11 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
basic_rates = BIT(min_rate_index);
}
- new_sta->sta.supp_rates[cbss->channel->band] = rates;
+ new_sta->sta.supp_rates[cbss->chandef.chan->band] = rates;
sdata->vif.bss_conf.basic_rates = basic_rates;
/* cf. IEEE 802.11 9.2.12 */
- if (cbss->channel->band == IEEE80211_BAND_2GHZ &&
+ if (cbss->chandef.chan->band == IEEE80211_BAND_2GHZ &&
have_higher_than_11mbit)
sdata->flags |= IEEE80211_SDATA_OPERATING_GMODE;
else
@@ -4117,7 +4118,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
/* Also disable HT if we don't support it or the AP doesn't use WMM */
- sband = local->hw.wiphy->bands[req->bss->channel->band];
+ sband = local->hw.wiphy->bands[req->bss->chandef.chan->band];
if (!sband->ht_cap.ht_supported ||
local->hw.queues < IEEE80211_NUM_ACS || !bss->wmm_used) {
ifmgd->flags |= IEEE80211_STA_DISABLE_HT;
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 1b122a7..2f460e4 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -65,6 +65,7 @@ ieee80211_bss_info_update(struct ieee80211_local *local,
bool beacon = ieee80211_is_beacon(mgmt->frame_control);
struct cfg80211_bss *cbss;
struct ieee80211_bss *bss;
+ struct cfg80211_chan_def chandef;
int clen, srlen;
s32 signal = 0;
@@ -73,7 +74,8 @@ ieee80211_bss_info_update(struct ieee80211_local *local,
else if (local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)
signal = (rx_status->signal * 100) / local->hw.max_signal;
- cbss = cfg80211_inform_bss_frame(local->hw.wiphy, channel,
+ cfg80211_chandef_create(&chandef, channel, NL80211_CHAN_NO_HT);
+ cbss = cfg80211_inform_bss_frame(local->hw.wiphy, &chandef,
mgmt, len, signal, GFP_ATOMIC);
if (!cbss)
return NULL;
diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index 50f6195..ddfd779 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -502,7 +502,7 @@ cfg80211_get_chan_state(struct wireless_dev *wdev,
switch (wdev->iftype) {
case NL80211_IFTYPE_ADHOC:
if (wdev->current_bss) {
- *chan = wdev->current_bss->pub.channel;
+ *chan = wdev->current_bss->pub.chandef.chan;
*chanmode = wdev->ibss_fixed
? CHAN_MODE_SHARED
: CHAN_MODE_EXCLUSIVE;
@@ -511,7 +511,7 @@ cfg80211_get_chan_state(struct wireless_dev *wdev,
case NL80211_IFTYPE_STATION:
case NL80211_IFTYPE_P2P_CLIENT:
if (wdev->current_bss) {
- *chan = wdev->current_bss->pub.channel;
+ *chan = wdev->current_bss->pub.chandef.chan;
*chanmode = CHAN_MODE_SHARED;
return;
}
diff --git a/net/wireless/core.h b/net/wireless/core.h
index a6b45bf..b6c4749 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -285,7 +285,7 @@ int cfg80211_stop_ap(struct cfg80211_registered_device *rdev,
/* MLME */
int cfg80211_mlme_auth(struct cfg80211_registered_device *rdev,
struct net_device *dev,
- struct ieee80211_channel *chan,
+ struct cfg80211_chan_def *chandef,
enum nl80211_auth_type auth_type,
const u8 *bssid,
const u8 *ssid, int ssid_len,
diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c
index 39bff7d..c9761c8 100644
--- a/net/wireless/ibss.c
+++ b/net/wireless/ibss.c
@@ -373,7 +373,7 @@ int cfg80211_ibss_wext_giwfreq(struct net_device *dev,
wdev_lock(wdev);
if (wdev->current_bss)
- chan = wdev->current_bss->pub.channel;
+ chan = wdev->current_bss->pub.chandef.chan;
else if (wdev->wext.ibss.chandef.chan)
chan = wdev->wext.ibss.chandef.chan;
wdev_unlock(wdev);
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index a61a44b..70546aa 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -193,7 +193,7 @@ EXPORT_SYMBOL(cfg80211_michael_mic_failure);
/* some MLME handling for userspace SME */
int cfg80211_mlme_auth(struct cfg80211_registered_device *rdev,
struct net_device *dev,
- struct ieee80211_channel *chan,
+ struct cfg80211_chan_def *chandef,
enum nl80211_auth_type auth_type,
const u8 *bssid,
const u8 *ssid, int ssid_len,
@@ -224,12 +224,13 @@ int cfg80211_mlme_auth(struct cfg80211_registered_device *rdev,
ether_addr_equal(bssid, wdev->current_bss->pub.bssid))
return -EALREADY;
- req.bss = cfg80211_get_bss(&rdev->wiphy, chan, bssid, ssid, ssid_len,
- WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
+ req.bss = cfg80211_get_bss(&rdev->wiphy, chandef, bssid, ssid,
+ ssid_len, WLAN_CAPABILITY_ESS,
+ WLAN_CAPABILITY_ESS);
if (!req.bss)
return -ENOENT;
- err = cfg80211_can_use_chan(rdev, wdev, req.bss->channel,
+ err = cfg80211_can_use_chan(rdev, wdev, req.bss->chandef.chan,
CHAN_MODE_SHARED);
if (err)
goto out;
@@ -283,6 +284,7 @@ int cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
struct cfg80211_assoc_request *req)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
+ struct cfg80211_chan_def chandef;
int err;
ASSERT_WDEV_LOCK(wdev);
@@ -297,8 +299,10 @@ int cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
cfg80211_oper_and_vht_capa(&req->vht_capa_mask,
rdev->wiphy.vht_capa_mod_mask);
- req->bss = cfg80211_get_bss(&rdev->wiphy, chan, bssid, ssid, ssid_len,
- WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
+ cfg80211_chandef_create(&chandef, chan, NL80211_CHAN_NO_HT);
+ req->bss = cfg80211_get_bss(&rdev->wiphy, &chandef, bssid, ssid,
+ ssid_len, WLAN_CAPABILITY_ESS,
+ WLAN_CAPABILITY_ESS);
if (!req->bss)
return -ENOENT;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 4ab1ffa..70d2b63 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5608,7 +5608,8 @@ static int nl80211_send_bss(struct sk_buff *msg, struct netlink_callback *cb,
nla_put_u16(msg, NL80211_BSS_BEACON_INTERVAL, res->beacon_interval))
goto nla_put_failure;
if (nla_put_u16(msg, NL80211_BSS_CAPABILITY, res->capability) ||
- nla_put_u32(msg, NL80211_BSS_FREQUENCY, res->channel->center_freq) ||
+ nla_put_u32(msg, NL80211_BSS_FREQUENCY,
+ res->chandef.chan->center_freq) ||
nla_put_u32(msg, NL80211_BSS_SEEN_MS_AGO,
jiffies_to_msecs(jiffies - intbss->ts)))
goto nla_put_failure;
@@ -5823,7 +5824,7 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
{
struct cfg80211_registered_device *rdev = info->user_ptr[0];
struct net_device *dev = info->user_ptr[1];
- struct ieee80211_channel *chan;
+ struct cfg80211_chan_def chandef;
const u8 *bssid, *ssid, *ie = NULL, *sae_data = NULL;
int err, ssid_len, ie_len = 0, sae_data_len = 0;
enum nl80211_auth_type auth_type;
@@ -5887,10 +5888,9 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
return -EOPNOTSUPP;
bssid = nla_data(info->attrs[NL80211_ATTR_MAC]);
- chan = ieee80211_get_channel(&rdev->wiphy,
- nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]));
- if (!chan || (chan->flags & IEEE80211_CHAN_DISABLED))
- return -EINVAL;
+ err = nl80211_parse_chandef(rdev, info, &chandef);
+ if (!err)
+ return err;
ssid = nla_data(info->attrs[NL80211_ATTR_SSID]);
ssid_len = nla_len(info->attrs[NL80211_ATTR_SSID]);
@@ -5928,7 +5928,7 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
return 0;
wdev_lock(dev->ieee80211_ptr);
- err = cfg80211_mlme_auth(rdev, dev, chan, auth_type, bssid,
+ err = cfg80211_mlme_auth(rdev, dev, &chandef, auth_type, bssid,
ssid, ssid_len, ie, ie_len,
key.p.key, key.p.key_len, key.idx,
sae_data, sae_data_len);
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index dd01b58..2dfb357 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -419,6 +419,20 @@ enum bss_compare_mode {
BSS_CMP_HIDE_NUL,
};
+static int cfg80211_chandef_compare(struct cfg80211_chan_def *a,
+ struct cfg80211_chan_def *b)
+{
+ if (a->center_freq1 != b->center_freq1)
+ return b->center_freq1 - a->center_freq1;
+ if (a->center_freq2 != b->center_freq2)
+ return b->center_freq2 - a->center_freq2;
+ /* this is used only to create an order */
+ if (b->width > a->width)
+ return 1;
+ else
+ return -1;
+}
+
static int cmp_bss(struct cfg80211_bss *a,
struct cfg80211_bss *b,
enum bss_compare_mode mode)
@@ -428,8 +442,8 @@ static int cmp_bss(struct cfg80211_bss *a,
const u8 *ie2 = NULL;
int i, r;
- if (a->channel != b->channel)
- return b->channel->center_freq - a->channel->center_freq;
+ if (!cfg80211_chandef_compatible(&a->chandef, &b->chandef))
+ return cfg80211_chandef_compare(&a->chandef, &b->chandef);
a_ies = rcu_access_pointer(a->ies);
if (!a_ies)
@@ -524,7 +538,7 @@ static int cmp_bss(struct cfg80211_bss *a,
}
struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
- struct ieee80211_channel *channel,
+ struct cfg80211_chan_def *chandef,
const u8 *bssid,
const u8 *ssid, size_t ssid_len,
u16 capa_mask, u16 capa_val)
@@ -533,7 +547,7 @@ struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
struct cfg80211_internal_bss *bss, *res = NULL;
unsigned long now = jiffies;
- trace_cfg80211_get_bss(wiphy, channel, bssid, ssid, ssid_len, capa_mask,
+ trace_cfg80211_get_bss(wiphy, chandef, bssid, ssid, ssid_len, capa_mask,
capa_val);
spin_lock_bh(&dev->bss_lock);
@@ -541,7 +555,8 @@ struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
list_for_each_entry(bss, &dev->bss_list, list) {
if ((bss->pub.capability & capa_mask) != capa_val)
continue;
- if (channel && bss->pub.channel != channel)
+ if (chandef && chandef->chan &&
+ !cfg80211_chandef_compatible(&bss->pub.chandef, chandef))
continue;
/* Don't get expired BSS structs */
if (time_after(now, bss->ts + IEEE80211_SCAN_RESULT_EXPIRE) &&
@@ -648,7 +663,8 @@ static bool cfg80211_combine_bsses(struct cfg80211_registered_device *dev,
list_for_each_entry(bss, &dev->bss_list, list) {
if (!ether_addr_equal(bss->pub.bssid, new->pub.bssid))
continue;
- if (bss->pub.channel != new->pub.channel)
+ if (!cfg80211_chandef_compatible(&bss->pub.chandef,
+ &new->pub.chandef))
continue;
if (rcu_access_pointer(bss->pub.beacon_ies))
continue;
@@ -684,7 +700,7 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev,
{
struct cfg80211_internal_bss *found = NULL;
- if (WARN_ON(!tmp->pub.channel))
+ if (WARN_ON(!tmp->pub.chandef.chan))
return NULL;
tmp->ts = jiffies;
@@ -834,9 +850,10 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev,
return NULL;
}
-static struct ieee80211_channel *
-cfg80211_get_bss_channel(struct wiphy *wiphy, const u8 *ie, size_t ielen,
- struct ieee80211_channel *channel)
+static int
+cfg80211_get_bss_chandef(struct wiphy *wiphy, const u8 *ie, size_t ielen,
+ struct cfg80211_chan_def *new_chandef,
+ struct cfg80211_chan_def *chandef)
{
const u8 *tmp;
u32 freq;
@@ -854,27 +871,54 @@ cfg80211_get_bss_channel(struct wiphy *wiphy, const u8 *ie, size_t ielen,
}
}
- if (channel_number < 0)
- return channel;
+ if (channel_number < 0) {
+ *new_chandef = *chandef;
+ } else {
+ freq = ieee80211_channel_to_frequency(channel_number,
+ chandef->chan->band);
+ new_chandef->chan = ieee80211_get_channel(wiphy, freq);
+ }
+ if (!new_chandef->chan)
+ return -EINVAL;
+ if (!new_chandef->chan->flags & IEEE80211_CHAN_DISABLED)
+ return -EINVAL;
- freq = ieee80211_channel_to_frequency(channel_number, channel->band);
- channel = ieee80211_get_channel(wiphy, freq);
- if (!channel)
- return NULL;
- if (channel->flags & IEEE80211_CHAN_DISABLED)
- return NULL;
- return channel;
+ /* use 20 MHz width on compatible channels. 5/10 MHz channels will
+ * have a different width stored.
+ */
+ switch (chandef->width) {
+ default:
+ WARN_ON_ONCE(1);
+ /* fall through */
+ case NL80211_CHAN_WIDTH_20:
+ case NL80211_CHAN_WIDTH_40:
+ case NL80211_CHAN_WIDTH_80:
+ case NL80211_CHAN_WIDTH_80P80:
+ case NL80211_CHAN_WIDTH_160:
+ new_chandef->width = NL80211_CHAN_WIDTH_20_NOHT;
+ break;
+ case NL80211_CHAN_WIDTH_5:
+ new_chandef->width = NL80211_CHAN_WIDTH_5;
+ break;
+ case NL80211_CHAN_WIDTH_10:
+ new_chandef->width = NL80211_CHAN_WIDTH_10;
+ break;
+ }
+ new_chandef->center_freq1 = new_chandef->chan->center_freq;
+ new_chandef->center_freq2 = 0;
+ return 0;
}
struct cfg80211_bss*
cfg80211_inform_bss(struct wiphy *wiphy,
- struct ieee80211_channel *channel,
+ struct cfg80211_chan_def *chandef,
const u8 *bssid, u64 tsf, u16 capability,
u16 beacon_interval, const u8 *ie, size_t ielen,
s32 signal, gfp_t gfp)
{
struct cfg80211_bss_ies *ies;
struct cfg80211_internal_bss tmp = {}, *res;
+ struct cfg80211_chan_def new_chandef;
if (WARN_ON(!wiphy))
return NULL;
@@ -883,12 +927,11 @@ cfg80211_inform_bss(struct wiphy *wiphy,
(signal < 0 || signal > 100)))
return NULL;
- channel = cfg80211_get_bss_channel(wiphy, ie, ielen, channel);
- if (!channel)
+ if (!cfg80211_get_bss_chandef(wiphy, ie, ielen, &new_chandef, chandef))
return NULL;
memcpy(tmp.pub.bssid, bssid, ETH_ALEN);
- tmp.pub.channel = channel;
+ tmp.pub.chandef = new_chandef;
tmp.pub.signal = signal;
tmp.pub.beacon_interval = beacon_interval;
tmp.pub.capability = capability;
@@ -915,7 +958,7 @@ cfg80211_inform_bss(struct wiphy *wiphy,
return NULL;
if (res->pub.capability & WLAN_CAPABILITY_ESS)
- regulatory_hint_found_beacon(wiphy, channel, gfp);
+ regulatory_hint_found_beacon(wiphy, new_chandef.chan, gfp);
trace_cfg80211_return_bss(&res->pub);
/* cfg80211_bss_update gives us a referenced result */
@@ -925,19 +968,20 @@ EXPORT_SYMBOL(cfg80211_inform_bss);
struct cfg80211_bss *
cfg80211_inform_bss_frame(struct wiphy *wiphy,
- struct ieee80211_channel *channel,
+ struct cfg80211_chan_def *chandef,
struct ieee80211_mgmt *mgmt, size_t len,
s32 signal, gfp_t gfp)
{
struct cfg80211_internal_bss tmp = {}, *res;
struct cfg80211_bss_ies *ies;
+ struct cfg80211_chan_def new_chandef;
size_t ielen = len - offsetof(struct ieee80211_mgmt,
u.probe_resp.variable);
BUILD_BUG_ON(offsetof(struct ieee80211_mgmt, u.probe_resp.variable) !=
offsetof(struct ieee80211_mgmt, u.beacon.variable));
- trace_cfg80211_inform_bss_frame(wiphy, channel, mgmt, len, signal);
+ trace_cfg80211_inform_bss_frame(wiphy, chandef, mgmt, len, signal);
if (WARN_ON(!mgmt))
return NULL;
@@ -952,9 +996,8 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
if (WARN_ON(len < offsetof(struct ieee80211_mgmt, u.probe_resp.variable)))
return NULL;
- channel = cfg80211_get_bss_channel(wiphy, mgmt->u.beacon.variable,
- ielen, channel);
- if (!channel)
+ if (!cfg80211_get_bss_chandef(wiphy, mgmt->u.beacon.variable,
+ ielen, &new_chandef, chandef))
return NULL;
ies = kmalloc(sizeof(*ies) + ielen, gfp);
@@ -971,7 +1014,7 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
rcu_assign_pointer(tmp.pub.ies, ies);
memcpy(tmp.pub.bssid, mgmt->bssid, ETH_ALEN);
- tmp.pub.channel = channel;
+ tmp.pub.chandef = new_chandef;
tmp.pub.signal = signal;
tmp.pub.beacon_interval = le16_to_cpu(mgmt->u.probe_resp.beacon_int);
tmp.pub.capability = le16_to_cpu(mgmt->u.probe_resp.capab_info);
@@ -981,7 +1024,7 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
return NULL;
if (res->pub.capability & WLAN_CAPABILITY_ESS)
- regulatory_hint_found_beacon(wiphy, channel, gfp);
+ regulatory_hint_found_beacon(wiphy, new_chandef.chan, gfp);
trace_cfg80211_return_bss(&res->pub);
/* cfg80211_bss_update gives us a referenced result */
@@ -1241,6 +1284,7 @@ ieee80211_bss(struct wiphy *wiphy, struct iw_request_info *info,
char *end_buf)
{
const struct cfg80211_bss_ies *ies;
+ int freq;
struct iw_event iwe;
const u8 *ie;
u8 *buf, *cfg, *p;
@@ -1256,14 +1300,15 @@ ieee80211_bss(struct wiphy *wiphy, struct iw_request_info *info,
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = SIOCGIWFREQ;
- iwe.u.freq.m = ieee80211_frequency_to_channel(bss->pub.channel->center_freq);
+ freq = bss->pub.chandef.chan->center_freq;
+ iwe.u.freq.m = ieee80211_frequency_to_channel(freq);
iwe.u.freq.e = 0;
current_ev = iwe_stream_add_event(info, current_ev, end_buf, &iwe,
IW_EV_FREQ_LEN);
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = SIOCGIWFREQ;
- iwe.u.freq.m = bss->pub.channel->center_freq;
+ iwe.u.freq.m = bss->pub.chandef.chan->center_freq;
iwe.u.freq.e = 6;
current_ev = iwe_stream_add_event(info, current_ev, end_buf, &iwe,
IW_EV_FREQ_LEN);
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index ae7e2cb..112c024 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -139,6 +139,7 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev)
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
struct cfg80211_connect_params *params;
struct cfg80211_assoc_request req = {};
+ struct cfg80211_chan_def chandef;
int err;
ASSERT_WDEV_LOCK(wdev);
@@ -157,8 +158,13 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev)
case CFG80211_CONN_AUTHENTICATE_NEXT:
BUG_ON(!rdev->ops->auth);
wdev->conn->state = CFG80211_CONN_AUTHENTICATING;
+ /* cfg80211_connect_params may hold an chandef in the future
+ * to allow to connect to 5 or 10 MHz networks.
+ */
+ cfg80211_chandef_create(&chandef, params->channel,
+ NL80211_CHAN_NO_HT);
return cfg80211_mlme_auth(rdev, wdev->netdev,
- params->channel, params->auth_type,
+ &chandef, params->auth_type,
params->bssid,
params->ssid, params->ssid_len,
NULL, 0,
@@ -242,6 +248,7 @@ void cfg80211_conn_work(struct work_struct *work)
static struct cfg80211_bss *cfg80211_get_conn_bss(struct wireless_dev *wdev)
{
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
+ struct cfg80211_chan_def chandef;
struct cfg80211_bss *bss;
u16 capa = WLAN_CAPABILITY_ESS;
@@ -250,7 +257,9 @@ static struct cfg80211_bss *cfg80211_get_conn_bss(struct wireless_dev *wdev)
if (wdev->conn->params.privacy)
capa |= WLAN_CAPABILITY_PRIVACY;
- bss = cfg80211_get_bss(wdev->wiphy, wdev->conn->params.channel,
+ cfg80211_chandef_create(&chandef, wdev->conn->params.channel,
+ NL80211_CHAN_NO_HT);
+ bss = cfg80211_get_bss(wdev->wiphy, &chandef,
wdev->conn->params.bssid,
wdev->conn->params.ssid,
wdev->conn->params.ssid_len,
@@ -261,7 +270,7 @@ static struct cfg80211_bss *cfg80211_get_conn_bss(struct wireless_dev *wdev)
memcpy(wdev->conn->bssid, bss->bssid, ETH_ALEN);
wdev->conn->params.bssid = wdev->conn->bssid;
- wdev->conn->params.channel = bss->channel;
+ wdev->conn->params.channel = bss->chandef.chan;
wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT;
schedule_work(&rdev->conn_work);
@@ -650,7 +659,7 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
* - country_ie + 2, the start of the country ie data, and
* - and country_ie[1] which is the IE length
*/
- regulatory_hint_11d(wdev->wiphy, bss->channel->band,
+ regulatory_hint_11d(wdev->wiphy, bss->chandef.chan->band,
country_ie + 2, country_ie[1]);
kfree(country_ie);
}
@@ -754,9 +763,11 @@ void cfg80211_roamed(struct net_device *dev,
const u8 *resp_ie, size_t resp_ie_len, gfp_t gfp)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
+ struct cfg80211_chan_def chandef;
struct cfg80211_bss *bss;
- bss = cfg80211_get_bss(wdev->wiphy, channel, bssid, wdev->ssid,
+ cfg80211_chandef_create(&chandef, channel, NL80211_CHAN_NO_HT);
+ bss = cfg80211_get_bss(wdev->wiphy, &chandef, bssid, wdev->ssid,
wdev->ssid_len, WLAN_CAPABILITY_ESS,
WLAN_CAPABILITY_ESS);
if (WARN_ON(!bss))
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index e1534baf..e06d313 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -1900,15 +1900,15 @@ TRACE_EVENT(cfg80211_send_rx_assoc,
TP_STRUCT__entry(
NETDEV_ENTRY
MAC_ENTRY(bssid)
- CHAN_ENTRY
+ CHAN_DEF_ENTRY
),
TP_fast_assign(
NETDEV_ASSIGN;
MAC_ASSIGN(bssid, bss->bssid);
- CHAN_ASSIGN(bss->channel);
+ CHAN_DEF_ASSIGN(&bss->chandef);
),
- TP_printk(NETDEV_PR_FMT ", " MAC_PR_FMT ", " CHAN_PR_FMT,
- NETDEV_PR_ARG, MAC_PR_ARG(bssid), CHAN_PR_ARG)
+ TP_printk(NETDEV_PR_FMT ", " MAC_PR_FMT ", " CHAN_DEF_PR_FMT,
+ NETDEV_PR_ARG, MAC_PR_ARG(bssid), CHAN_DEF_PR_ARG)
);
DECLARE_EVENT_CLASS(netdev_frame_event,
@@ -2365,13 +2365,13 @@ DEFINE_EVENT(wiphy_only_evt, cfg80211_sched_scan_stopped,
);
TRACE_EVENT(cfg80211_get_bss,
- TP_PROTO(struct wiphy *wiphy, struct ieee80211_channel *channel,
+ TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef,
const u8 *bssid, const u8 *ssid, size_t ssid_len,
u16 capa_mask, u16 capa_val),
- TP_ARGS(wiphy, channel, bssid, ssid, ssid_len, capa_mask, capa_val),
+ TP_ARGS(wiphy, chandef, bssid, ssid, ssid_len, capa_mask, capa_val),
TP_STRUCT__entry(
WIPHY_ENTRY
- CHAN_ENTRY
+ CHAN_DEF_ENTRY
MAC_ENTRY(bssid)
__dynamic_array(u8, ssid, ssid_len)
__field(u16, capa_mask)
@@ -2379,38 +2379,39 @@ TRACE_EVENT(cfg80211_get_bss,
),
TP_fast_assign(
WIPHY_ASSIGN;
- CHAN_ASSIGN(channel);
+ CHAN_DEF_ASSIGN(chandef);
MAC_ASSIGN(bssid, bssid);
memcpy(__get_dynamic_array(ssid), ssid, ssid_len);
__entry->capa_mask = capa_mask;
__entry->capa_val = capa_val;
),
- TP_printk(WIPHY_PR_FMT ", " CHAN_PR_FMT ", " MAC_PR_FMT ", buf: %#.2x, "
- "capa_mask: %d, capa_val: %u", WIPHY_PR_ARG, CHAN_PR_ARG,
- MAC_PR_ARG(bssid), ((u8 *)__get_dynamic_array(ssid))[0],
+ TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT ", " MAC_PR_FMT
+ ", buf: %#.2x, capa_mask: %d, capa_val: %u", WIPHY_PR_ARG,
+ CHAN_DEF_PR_ARG, MAC_PR_ARG(bssid),
+ ((u8 *)__get_dynamic_array(ssid))[0],
__entry->capa_mask, __entry->capa_val)
);
TRACE_EVENT(cfg80211_inform_bss_frame,
- TP_PROTO(struct wiphy *wiphy, struct ieee80211_channel *channel,
+ TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef,
struct ieee80211_mgmt *mgmt, size_t len,
s32 signal),
- TP_ARGS(wiphy, channel, mgmt, len, signal),
+ TP_ARGS(wiphy, chandef, mgmt, len, signal),
TP_STRUCT__entry(
WIPHY_ENTRY
- CHAN_ENTRY
+ CHAN_DEF_ENTRY
__dynamic_array(u8, mgmt, len)
__field(s32, signal)
),
TP_fast_assign(
WIPHY_ASSIGN;
- CHAN_ASSIGN(channel);
+ CHAN_DEF_ASSIGN(chandef);
if (mgmt)
memcpy(__get_dynamic_array(mgmt), mgmt, len);
__entry->signal = signal;
),
- TP_printk(WIPHY_PR_FMT ", " CHAN_PR_FMT "signal: %d",
- WIPHY_PR_ARG, CHAN_PR_ARG, __entry->signal)
+ TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT "signal: %d",
+ WIPHY_PR_ARG, CHAN_DEF_PR_ARG, __entry->signal)
);
DECLARE_EVENT_CLASS(cfg80211_bss_evt,
@@ -2418,13 +2419,14 @@ DECLARE_EVENT_CLASS(cfg80211_bss_evt,
TP_ARGS(pub),
TP_STRUCT__entry(
MAC_ENTRY(bssid)
- CHAN_ENTRY
+ CHAN_DEF_ENTRY
),
TP_fast_assign(
MAC_ASSIGN(bssid, pub->bssid);
- CHAN_ASSIGN(pub->channel);
+ CHAN_DEF_ASSIGN(&pub->chandef);
),
- TP_printk(MAC_PR_FMT ", " CHAN_PR_FMT, MAC_PR_ARG(bssid), CHAN_PR_ARG)
+ TP_printk(MAC_PR_FMT ", " CHAN_DEF_PR_FMT, MAC_PR_ARG(bssid),
+ CHAN_DEF_PR_ARG)
);
DEFINE_EVENT(cfg80211_bss_evt, cfg80211_return_bss,
diff --git a/net/wireless/wext-sme.c b/net/wireless/wext-sme.c
index 14c9a25..bca1c26 100644
--- a/net/wireless/wext-sme.c
+++ b/net/wireless/wext-sme.c
@@ -149,7 +149,7 @@ int cfg80211_mgd_wext_giwfreq(struct net_device *dev,
wdev_lock(wdev);
if (wdev->current_bss)
- chan = wdev->current_bss->pub.channel;
+ chan = wdev->current_bss->pub.chandef.chan;
else if (wdev->wext.connect.channel)
chan = wdev->wext.connect.channel;
wdev_unlock(wdev);
--
1.7.10.4
^ permalink raw reply related
* [PATCH 2/1] wil6210: set vring index for all descriptors
From: Kirshenbaum Erez @ 2013-06-20 13:24 UTC (permalink / raw)
To: qca_vkondrat; +Cc: linux-wireless, Kirshenbaum Erez
The vring index (MAC queue id) must be set in all TX descriptors
otherwise HW will fail to release descriptors for a specific vring
(disconnect or vring switch flows).
This is normally occurs when fragmentation required, if vring index
will not be the same for all SKB descriptors HW will fail to flush
this MAC queue.
Signed-off-by: Kirshenbaum Erez <erezk@wilocity.com>
---
drivers/net/wireless/ath/wil6210/txrx.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c
index e1c492b..73d6c2d 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.c
+++ b/drivers/net/wireless/ath/wil6210/txrx.c
@@ -621,7 +621,8 @@ static struct vring *wil_find_tx_vring(struct wil6210_priv *wil,
return NULL;
}
-static int wil_tx_desc_map(struct vring_tx_desc *d, dma_addr_t pa, u32 len)
+static int wil_tx_desc_map(struct vring_tx_desc *d, dma_addr_t pa, u32 len,
+ int vring_index)
{
wil_desc_addr_set(&d->dma.addr, pa);
d->dma.ip_length = 0;
@@ -630,7 +631,7 @@ static int wil_tx_desc_map(struct vring_tx_desc *d, dma_addr_t pa, u32 len)
d->dma.error = 0;
d->dma.status = 0; /* BIT(0) should be 0 for HW_OWNED */
d->dma.length = cpu_to_le16((u16)len);
- d->dma.d0 = 0;
+ d->dma.d0 = (vring_index << DMA_CFG_DESC_TX_0_QID_POS);
d->mac.d[0] = 0;
d->mac.d[1] = 0;
d->mac.d[2] = 0;
@@ -684,7 +685,7 @@ static int wil_tx_vring(struct wil6210_priv *wil, struct vring *vring,
if (unlikely(dma_mapping_error(dev, pa)))
return -EINVAL;
/* 1-st segment */
- wil_tx_desc_map(d, pa, skb_headlen(skb));
+ wil_tx_desc_map(d, pa, skb_headlen(skb), vring_index);
d->mac.d[2] |= ((nr_frags + 1) <<
MAC_CFG_DESC_TX_2_NUM_OF_DESCRIPTORS_POS);
if (nr_frags)
@@ -701,7 +702,7 @@ static int wil_tx_vring(struct wil6210_priv *wil, struct vring *vring,
DMA_TO_DEVICE);
if (unlikely(dma_mapping_error(dev, pa)))
goto dma_error;
- wil_tx_desc_map(d, pa, len);
+ wil_tx_desc_map(d, pa, len, vring_index);
vring->ctx[i] = NULL;
*_d = *d;
}
@@ -709,7 +710,6 @@ static int wil_tx_vring(struct wil6210_priv *wil, struct vring *vring,
d->dma.d0 |= BIT(DMA_CFG_DESC_TX_0_CMD_EOP_POS);
d->dma.d0 |= BIT(9); /* BUG: undocumented bit */
d->dma.d0 |= BIT(DMA_CFG_DESC_TX_0_CMD_DMA_IT_POS);
- d->dma.d0 |= (vring_index << DMA_CFG_DESC_TX_0_QID_POS);
*_d = *d;
wil_hex_dump_txrx("Tx ", DUMP_PREFIX_NONE, 32, 4,
--
1.7.11.7
^ permalink raw reply related
* Re: [PATCH 2/1] wil6210: set vring index for all descriptors
From: Vladimir Kondratiev @ 2013-06-20 14:47 UTC (permalink / raw)
To: Kirshenbaum Erez; +Cc: linux-wireless
In-Reply-To: <1371734684-4453-1-git-send-email-erezk@wilocity.com>
On Thursday, June 20, 2013 04:24:44 PM Kirshenbaum Erez wrote:
> The vring index (MAC queue id) must be set in all TX descriptors
> otherwise HW will fail to release descriptors for a specific vring
> (disconnect or vring switch flows).
> This is normally occurs when fragmentation required, if vring index
> will not be the same for all SKB descriptors HW will fail to flush
> this MAC queue.
>
> Signed-off-by: Kirshenbaum Erez <erezk@wilocity.com>
>
Here is my
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Thanks.
^ permalink raw reply
* Re: BCM4331 deauthenticates every five minutes
From: Dan Williams @ 2013-06-20 15:24 UTC (permalink / raw)
To: Arend van Spriel
Cc: Chris Adams, Rafał Miłecki, Larry Finger, b43-dev,
linux-wireless
In-Reply-To: <51C2BE54.20509@broadcom.com>
On Thu, 2013-06-20 at 10:33 +0200, Arend van Spriel wrote:
> On 06/19/2013 11:11 PM, Chris Adams wrote:
> > Once upon a time, Arend van Spriel <arend@broadcom.com> said:
> >> Can you make a capture using a wireless sniffer (using your thinkpad maybe)?
> >
> > How would I go about doing that? I've done lots of network debugging
> > with tcpdump and such, but not much wireless stuff.
> >
>
> I use wireshark these days. If you install that you can use the steps
> below and select the wireless interface in wireshark to capture. I use
> wlan0 as interface name, but it may be different for you.
>
> 1. disable network-manager so it won't interfere.
It should be enough run "nmcli nm wifi off" and then un-rfkill the
interface, and NM will leave it alone until you turn wifi back on. It
will also remove the interface from wpa_supplicant.
Dan
> 2. bring the interface down
> $ sudo ifconfig wlan0 down
> 3. change interface type to monitor
> $ sudo iw dev wlan0 set type monitor
> 4. bring up the interface
> $ sudo ifconfig wlan0 up
> 5. start wireshark and select wlan0
> $ gksudo wireshark
>
> It will complain that running wireshark as root is not secure. If you
> care about that, you should read [1].
>
> Regards,
> Arend
>
> [1]
> http://wiki.wireshark.org/Security#Administrator.2Froot_account_not_required.21
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* RE: [Ilw] backtrack 5r3 not supporting intel centrino n 2230
From: Grumbach, Emmanuel @ 2013-06-20 19:35 UTC (permalink / raw)
To: sanil gupta, linux-wireless@vger.kernel.org, ilw@linux.intel.com
In-Reply-To: <CAHd80D_Pt8Uj4K6kuYNcruvKA8YjYPrttoOptA74mQ-cgTpmhQ@mail.gmail.com>
Hello,
I guess you want to send this question to the backtrack support people. We will help you if you use mainline kernel.
Thanks,
Emmanuel
From: ilw-bounces@linux.intel.com [mailto:ilw-bounces@linux.intel.com] On Behalf Of sanil gupta
Sent: Thursday, June 20, 2013 10:01 PM
To: linux-wireless@vger.kernel.org; ilw@linux.intel.com
Subject: [Ilw] backtrack 5r3 not supporting intel centrino n 2230
Hello
I am a new user to the backtrack and very interested in doing it but the problem is that i can't use internet using backtrack 5r3 as my wireless card is intel centrino n 2230.I request you to please help me out with this problem as soon as possible
thank you
^ permalink raw reply
* Re: [PATCH] brcmfmac: Turn off ARP offloading when configured for AP.
From: Greg KH @ 2013-06-20 19:54 UTC (permalink / raw)
To: Arend van Spriel; +Cc: stable, linux-wireless, Hante Meuleman, John W. Linville
In-Reply-To: <20130619141920.GB7395@kroah.com>
On Wed, Jun 19, 2013 at 07:19:20AM -0700, Greg KH wrote:
> On Wed, Jun 19, 2013 at 09:27:09AM +0200, Arend van Spriel wrote:
> > On 06/06/2013 10:55 AM, Arend van Spriel wrote:
> > >From: Hante Meuleman <meuleman@broadcom.com>
> >
> > Hi Greg,
> >
> > I noticed your review announcement for v3.9.7 and did not see the
> > change below. I sent it to stable because the original upstream
> > commit did not apply. Did I miss some step in the process?
>
> Ah, somehow I missed your patch, sorry about that, I do have it in my
> mbox. What kernel tree(s) do you want it to be applied to? I'll pick
> it up in my next round of releases.
Now applied, sorry for the delay.
greg k-h
^ permalink raw reply
* [PATCH] ipw2200: fix error return code in ipw_load()
From: Wei Yongjun @ 2013-06-21 2:42 UTC (permalink / raw)
To: stas.yakovlev, linville; +Cc: yongjun_wei, linux-wireless
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Fix to return -ENOMEM in the ipw_rx_queue_alloc() error handling
case instead of 0, as done elsewhere in this function.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
drivers/net/wireless/ipw2x00/ipw2200.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 4ed5e45..6b823a1 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -3548,6 +3548,7 @@ static int ipw_load(struct ipw_priv *priv)
ipw_rx_queue_reset(priv, priv->rxq);
if (!priv->rxq) {
IPW_ERROR("Unable to initialize Rx queue\n");
+ rc = -ENOMEM;
goto error;
}
^ permalink raw reply related
* [PATCH -next] cw1200: Fix up a large pile of sparse warnings
From: Solomon Peachy @ 2013-06-21 3:03 UTC (permalink / raw)
To: linux-wireless; +Cc: Solomon Peachy
Most of these relate to endianness problems, and are purely cosmetic.
But a couple of them were legit -- listen interval parsing and some of
the rate selection code would malfunction on BE systems.
There's still one cosmetic warning remaining, in the (admittedly) ugly
code in cw1200_spi.c. It's there because the hardware needs 16-bit SPI
transfers, but many SPI controllers only operate 8 bits at a time.
If there's a cleaner way of handling this, I'm all ears.
Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
---
drivers/net/wireless/cw1200/cw1200.h | 2 +-
drivers/net/wireless/cw1200/cw1200_spi.c | 32 ++++++++++++++---------
drivers/net/wireless/cw1200/hwio.c | 18 +++++++------
drivers/net/wireless/cw1200/hwio.h | 31 +++++++++++-----------
drivers/net/wireless/cw1200/main.c | 4 +--
drivers/net/wireless/cw1200/queue.c | 2 +-
drivers/net/wireless/cw1200/sta.c | 23 ++++++++--------
drivers/net/wireless/cw1200/txrx.c | 9 +++----
drivers/net/wireless/cw1200/wsm.c | 33 ++++++++++++-----------
drivers/net/wireless/cw1200/wsm.h | 45 +++++++++++++++-----------------
10 files changed, 102 insertions(+), 97 deletions(-)
diff --git a/drivers/net/wireless/cw1200/cw1200.h b/drivers/net/wireless/cw1200/cw1200.h
index 243e963..1ad7d36 100644
--- a/drivers/net/wireless/cw1200/cw1200.h
+++ b/drivers/net/wireless/cw1200/cw1200.h
@@ -267,7 +267,7 @@ struct cw1200_common {
struct delayed_work bss_loss_work;
spinlock_t bss_loss_lock; /* Protect BSS loss state */
int bss_loss_state;
- int bss_loss_confirm_id;
+ u32 bss_loss_confirm_id;
int delayed_link_loss;
struct work_struct bss_params_work;
diff --git a/drivers/net/wireless/cw1200/cw1200_spi.c b/drivers/net/wireless/cw1200/cw1200_spi.c
index 953bd19..b62befb 100644
--- a/drivers/net/wireless/cw1200/cw1200_spi.c
+++ b/drivers/net/wireless/cw1200/cw1200_spi.c
@@ -61,7 +61,7 @@ static int cw1200_spi_memcpy_fromio(struct hwbus_priv *self,
void *dst, int count)
{
int ret, i;
- uint16_t regaddr;
+ u16 regaddr;
struct spi_message m;
struct spi_transfer t_addr = {
@@ -76,15 +76,18 @@ static int cw1200_spi_memcpy_fromio(struct hwbus_priv *self,
regaddr = (SDIO_TO_SPI_ADDR(addr))<<12;
regaddr |= SET_READ;
regaddr |= (count>>1);
- regaddr = cpu_to_le16(regaddr);
#ifdef SPI_DEBUG
- pr_info("READ : %04d from 0x%02x (%04x)\n", count, addr,
- le16_to_cpu(regaddr));
+ pr_info("READ : %04d from 0x%02x (%04x)\n", count, addr, regaddr);
#endif
+ /* Header is LE16 */
+ regaddr = cpu_to_le16(regaddr);
+
+ /* We have to byteswap if the SPI bus is limited to 8b operation
+ or we are running on a Big Endian system
+ */
#if defined(__LITTLE_ENDIAN)
- /* We have to byteswap if the SPI bus is limited to 8b operation */
if (self->func->bits_per_word == 8)
#endif
regaddr = swab16(regaddr);
@@ -104,8 +107,10 @@ static int cw1200_spi_memcpy_fromio(struct hwbus_priv *self,
printk("\n");
#endif
+ /* We have to byteswap if the SPI bus is limited to 8b operation
+ or we are running on a Big Endian system
+ */
#if defined(__LITTLE_ENDIAN)
- /* We have to byteswap if the SPI bus is limited to 8b operation */
if (self->func->bits_per_word == 8)
#endif
{
@@ -122,7 +127,7 @@ static int cw1200_spi_memcpy_toio(struct hwbus_priv *self,
const void *src, int count)
{
int rval, i;
- uint16_t regaddr;
+ u16 regaddr;
struct spi_transfer t_addr = {
.tx_buf = ®addr,
.len = sizeof(regaddr),
@@ -136,20 +141,23 @@ static int cw1200_spi_memcpy_toio(struct hwbus_priv *self,
regaddr = (SDIO_TO_SPI_ADDR(addr))<<12;
regaddr &= SET_WRITE;
regaddr |= (count>>1);
- regaddr = cpu_to_le16(regaddr);
#ifdef SPI_DEBUG
- pr_info("WRITE: %04d to 0x%02x (%04x)\n", count, addr,
- le16_to_cpu(regaddr));
+ pr_info("WRITE: %04d to 0x%02x (%04x)\n", count, addr, regaddr);
#endif
+ /* Header is LE16 */
+ regaddr = cpu_to_le16(regaddr);
+
+ /* We have to byteswap if the SPI bus is limited to 8b operation
+ or we are running on a Big Endian system
+ */
#if defined(__LITTLE_ENDIAN)
- /* We have to byteswap if the SPI bus is limited to 8b operation */
if (self->func->bits_per_word == 8)
#endif
{
uint16_t *buf = (uint16_t *)src;
- regaddr = swab16(regaddr);
+ regaddr = swab16(regaddr);
for (i = 0; i < ((count + 1) >> 1); i++)
buf[i] = swab16(buf[i]);
}
diff --git a/drivers/net/wireless/cw1200/hwio.c b/drivers/net/wireless/cw1200/hwio.c
index dad3fb3..ff230b7 100644
--- a/drivers/net/wireless/cw1200/hwio.c
+++ b/drivers/net/wireless/cw1200/hwio.c
@@ -69,31 +69,33 @@ static int __cw1200_reg_write(struct cw1200_common *priv, u16 addr,
static inline int __cw1200_reg_read_32(struct cw1200_common *priv,
u16 addr, u32 *val)
{
- int i = __cw1200_reg_read(priv, addr, val, sizeof(*val), 0);
- *val = le32_to_cpu(*val);
+ __le32 tmp;
+ int i = __cw1200_reg_read(priv, addr, &tmp, sizeof(tmp), 0);
+ *val = le32_to_cpu(tmp);
return i;
}
static inline int __cw1200_reg_write_32(struct cw1200_common *priv,
u16 addr, u32 val)
{
- val = cpu_to_le32(val);
- return __cw1200_reg_write(priv, addr, &val, sizeof(val), 0);
+ __le32 tmp = cpu_to_le32(val);
+ return __cw1200_reg_write(priv, addr, &tmp, sizeof(tmp), 0);
}
static inline int __cw1200_reg_read_16(struct cw1200_common *priv,
u16 addr, u16 *val)
{
- int i = __cw1200_reg_read(priv, addr, val, sizeof(*val), 0);
- *val = le16_to_cpu(*val);
+ __le16 tmp;
+ int i = __cw1200_reg_read(priv, addr, &tmp, sizeof(tmp), 0);
+ *val = le16_to_cpu(tmp);
return i;
}
static inline int __cw1200_reg_write_16(struct cw1200_common *priv,
u16 addr, u16 val)
{
- val = cpu_to_le16(val);
- return __cw1200_reg_write(priv, addr, &val, sizeof(val), 0);
+ __le16 tmp = cpu_to_le16(val);
+ return __cw1200_reg_write(priv, addr, &tmp, sizeof(tmp), 0);
}
int cw1200_reg_read(struct cw1200_common *priv, u16 addr, void *buf,
diff --git a/drivers/net/wireless/cw1200/hwio.h b/drivers/net/wireless/cw1200/hwio.h
index 563329c..ddf5266 100644
--- a/drivers/net/wireless/cw1200/hwio.h
+++ b/drivers/net/wireless/cw1200/hwio.h
@@ -169,35 +169,34 @@ int cw1200_reg_write(struct cw1200_common *priv, u16 addr,
static inline int cw1200_reg_read_16(struct cw1200_common *priv,
u16 addr, u16 *val)
{
- u32 tmp;
+ __le32 tmp;
int i;
i = cw1200_reg_read(priv, addr, &tmp, sizeof(tmp));
- tmp = le32_to_cpu(tmp);
- *val = tmp & 0xffff;
+ *val = le32_to_cpu(tmp) & 0xfffff;
return i;
}
static inline int cw1200_reg_write_16(struct cw1200_common *priv,
u16 addr, u16 val)
{
- u32 tmp = val;
- tmp = cpu_to_le32(tmp);
+ __le32 tmp = cpu_to_le32((u32)val);
return cw1200_reg_write(priv, addr, &tmp, sizeof(tmp));
}
static inline int cw1200_reg_read_32(struct cw1200_common *priv,
u16 addr, u32 *val)
{
- int i = cw1200_reg_read(priv, addr, val, sizeof(*val));
- *val = le32_to_cpu(*val);
+ __le32 tmp;
+ int i = cw1200_reg_read(priv, addr, &tmp, sizeof(tmp));
+ *val = le32_to_cpu(tmp);
return i;
}
static inline int cw1200_reg_write_32(struct cw1200_common *priv,
u16 addr, u32 val)
{
- val = cpu_to_le32(val);
- return cw1200_reg_write(priv, addr, &val, sizeof(val));
+ __le32 tmp = cpu_to_le32(val);
+ return cw1200_reg_write(priv, addr, &tmp, sizeof(val));
}
int cw1200_indirect_read(struct cw1200_common *priv, u32 addr, void *buf,
@@ -224,22 +223,24 @@ static inline int cw1200_ahb_read(struct cw1200_common *priv, u32 addr,
static inline int cw1200_apb_read_32(struct cw1200_common *priv,
u32 addr, u32 *val)
{
- int i = cw1200_apb_read(priv, addr, val, sizeof(*val));
- *val = le32_to_cpu(*val);
+ __le32 tmp;
+ int i = cw1200_apb_read(priv, addr, &tmp, sizeof(tmp));
+ *val = le32_to_cpu(tmp);
return i;
}
static inline int cw1200_apb_write_32(struct cw1200_common *priv,
u32 addr, u32 val)
{
- val = cpu_to_le32(val);
- return cw1200_apb_write(priv, addr, &val, sizeof(val));
+ __le32 tmp = cpu_to_le32(val);
+ return cw1200_apb_write(priv, addr, &tmp, sizeof(val));
}
static inline int cw1200_ahb_read_32(struct cw1200_common *priv,
u32 addr, u32 *val)
{
- int i = cw1200_ahb_read(priv, addr, val, sizeof(*val));
- *val = le32_to_cpu(*val);
+ __le32 tmp;
+ int i = cw1200_ahb_read(priv, addr, &tmp, sizeof(tmp));
+ *val = le32_to_cpu(tmp);
return i;
}
diff --git a/drivers/net/wireless/cw1200/main.c b/drivers/net/wireless/cw1200/main.c
index da88503..3724e73 100644
--- a/drivers/net/wireless/cw1200/main.c
+++ b/drivers/net/wireless/cw1200/main.c
@@ -238,8 +238,8 @@ static const struct ieee80211_ops cw1200_ops = {
/*.cancel_remain_on_channel = cw1200_cancel_remain_on_channel, */
};
-int cw1200_ba_rx_tids = -1;
-int cw1200_ba_tx_tids = -1;
+static int cw1200_ba_rx_tids = -1;
+static int cw1200_ba_tx_tids = -1;
module_param(cw1200_ba_rx_tids, int, 0644);
module_param(cw1200_ba_tx_tids, int, 0644);
MODULE_PARM_DESC(cw1200_ba_rx_tids, "Block ACK RX TIDs");
diff --git a/drivers/net/wireless/cw1200/queue.c b/drivers/net/wireless/cw1200/queue.c
index 8510454..9c3925f 100644
--- a/drivers/net/wireless/cw1200/queue.c
+++ b/drivers/net/wireless/cw1200/queue.c
@@ -355,7 +355,7 @@ int cw1200_queue_get(struct cw1200_queue *queue,
*tx = (struct wsm_tx *)item->skb->data;
*tx_info = IEEE80211_SKB_CB(item->skb);
*txpriv = &item->txpriv;
- (*tx)->packet_id = __cpu_to_le32(item->packet_id);
+ (*tx)->packet_id = item->packet_id;
list_move_tail(&item->head, &queue->pending);
++queue->num_pending;
--queue->link_map_cache[item->txpriv.link_id];
diff --git a/drivers/net/wireless/cw1200/sta.c b/drivers/net/wireless/cw1200/sta.c
index 4cd0352..7365674 100644
--- a/drivers/net/wireless/cw1200/sta.c
+++ b/drivers/net/wireless/cw1200/sta.c
@@ -621,7 +621,7 @@ int cw1200_conf_tx(struct ieee80211_hw *dev, struct ieee80211_vif *vif,
mutex_lock(&priv->conf_mutex);
if (queue < dev->queues) {
- old_uapsd_flags = priv->uapsd_info.uapsd_flags;
+ old_uapsd_flags = le16_to_cpu(priv->uapsd_info.uapsd_flags);
WSM_TX_QUEUE_SET(&priv->tx_queue_params, queue, 0, 0, 0);
ret = wsm_set_tx_queue_params(priv,
@@ -645,7 +645,7 @@ int cw1200_conf_tx(struct ieee80211_hw *dev, struct ieee80211_vif *vif,
ret = cw1200_set_uapsd_param(priv, &priv->edca);
if (!ret && priv->setbssparams_done &&
(priv->join_status == CW1200_JOIN_STATUS_STA) &&
- (old_uapsd_flags != priv->uapsd_info.uapsd_flags))
+ (old_uapsd_flags != le16_to_cpu(priv->uapsd_info.uapsd_flags)))
ret = cw1200_set_pm(priv, &priv->powersave_mode);
}
} else {
@@ -1089,18 +1089,18 @@ static int cw1200_parse_sdd_file(struct cw1200_common *priv)
ret = -1;
break;
}
- v = le16_to_cpu(*((u16 *)(p + 2)));
+ v = le16_to_cpu(*((__le16 *)(p + 2)));
if (!v) /* non-zero means this is enabled */
break;
- v = le16_to_cpu(*((u16 *)(p + 4)));
+ v = le16_to_cpu(*((__le16 *)(p + 4)));
priv->conf_listen_interval = (v >> 7) & 0x1F;
pr_debug("PTA found; Listen Interval %d\n",
priv->conf_listen_interval);
break;
}
case SDD_REFERENCE_FREQUENCY_ELT_ID: {
- u16 clk = le16_to_cpu(*((u16 *)(p + 2)));
+ u16 clk = le16_to_cpu(*((__le16 *)(p + 2)));
if (clk != priv->hw_refclk)
pr_warn("SDD file doesn't match configured refclk (%d vs %d)\n",
clk, priv->hw_refclk);
@@ -1785,9 +1785,9 @@ static int cw1200_set_btcoexinfo(struct cw1200_common *priv)
} else {
pr_debug("[STA] STA has non ERP rates\n");
/* B only mode */
- arg.internalTxRate = (__ffs(priv->association_mode.basic_rate_set));
+ arg.internalTxRate = (__ffs(le32_to_cpu(priv->association_mode.basic_rate_set)));
}
- arg.nonErpInternalTxRate = (__ffs(priv->association_mode.basic_rate_set));
+ arg.nonErpInternalTxRate = (__ffs(le32_to_cpu(priv->association_mode.basic_rate_set)));
} else {
/* P2P mode */
arg.internalTxRate = (__ffs(priv->bss_params.operational_rate_set & ~0xF));
@@ -1908,7 +1908,7 @@ void cw1200_bss_info_changed(struct ieee80211_hw *dev,
if (info->assoc || info->ibss_joined) {
struct ieee80211_sta *sta = NULL;
- u32 val = 0;
+ __le32 htprot = 0;
if (info->dtim_period)
priv->join_dtim_period = info->dtim_period;
@@ -1935,19 +1935,18 @@ void cw1200_bss_info_changed(struct ieee80211_hw *dev,
/* Non Greenfield stations present */
if (priv->ht_info.operation_mode &
IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT)
- val |= WSM_NON_GREENFIELD_STA_PRESENT;
+ htprot |= cpu_to_le32(WSM_NON_GREENFIELD_STA_PRESENT);
/* Set HT protection method */
- val |= (priv->ht_info.operation_mode & IEEE80211_HT_OP_MODE_PROTECTION) << 2;
+ htprot |= cpu_to_le32((priv->ht_info.operation_mode & IEEE80211_HT_OP_MODE_PROTECTION) << 2);
/* TODO:
* STBC_param.dual_cts
* STBC_param.LSIG_TXOP_FILL
*/
- val = cpu_to_le32(val);
wsm_write_mib(priv, WSM_MIB_ID_SET_HT_PROTECTION,
- &val, sizeof(val));
+ &htprot, sizeof(htprot));
priv->association_mode.greenfield =
cw1200_ht_greenfield(&priv->ht_info);
diff --git a/drivers/net/wireless/cw1200/txrx.c b/drivers/net/wireless/cw1200/txrx.c
index 44ca10c..5862c37 100644
--- a/drivers/net/wireless/cw1200/txrx.c
+++ b/drivers/net/wireless/cw1200/txrx.c
@@ -599,15 +599,15 @@ cw1200_tx_h_bt(struct cw1200_common *priv,
} else if (ieee80211_is_data(t->hdr->frame_control)) {
/* Skip LLC SNAP header (+6) */
u8 *payload = &t->skb->data[t->hdrlen];
- u16 *ethertype = (u16 *)&payload[6];
- if (*ethertype == __be16_to_cpu(ETH_P_PAE))
+ __be16 *ethertype = (__be16 *)&payload[6];
+ if (be16_to_cpu(*ethertype) == ETH_P_PAE)
priority = WSM_EPTA_PRIORITY_EAPOL;
} else if (ieee80211_is_assoc_req(t->hdr->frame_control) ||
ieee80211_is_reassoc_req(t->hdr->frame_control)) {
struct ieee80211_mgmt *mgt_frame =
(struct ieee80211_mgmt *)t->hdr;
- if (mgt_frame->u.assoc_req.listen_interval <
+ if (le16_to_cpu(mgt_frame->u.assoc_req.listen_interval) <
priv->listen_interval) {
pr_debug("Modified Listen Interval to %d from %d\n",
priv->listen_interval,
@@ -615,8 +615,7 @@ cw1200_tx_h_bt(struct cw1200_common *priv,
/* Replace listen interval derieved from
* the one read from SDD
*/
- mgt_frame->u.assoc_req.listen_interval =
- priv->listen_interval;
+ mgt_frame->u.assoc_req.listen_interval = cpu_to_le16(priv->listen_interval);
}
}
diff --git a/drivers/net/wireless/cw1200/wsm.c b/drivers/net/wireless/cw1200/wsm.c
index d95094f..cbb74d7 100644
--- a/drivers/net/wireless/cw1200/wsm.c
+++ b/drivers/net/wireless/cw1200/wsm.c
@@ -42,19 +42,19 @@
(buf)->data += size; \
} while (0)
-#define __WSM_GET(buf, type, cvt) \
+#define __WSM_GET(buf, type, type2, cvt) \
({ \
type val; \
if ((buf)->data + sizeof(type) > (buf)->end) \
goto underflow; \
- val = cvt(*(type *)(buf)->data); \
+ val = cvt(*(type2 *)(buf)->data); \
(buf)->data += sizeof(type); \
val; \
})
-#define WSM_GET8(buf) __WSM_GET(buf, u8, (u8))
-#define WSM_GET16(buf) __WSM_GET(buf, u16, __le16_to_cpu)
-#define WSM_GET32(buf) __WSM_GET(buf, u32, __le32_to_cpu)
+#define WSM_GET8(buf) __WSM_GET(buf, u8, u8, (u8))
+#define WSM_GET16(buf) __WSM_GET(buf, u16, __le16, __le16_to_cpu)
+#define WSM_GET32(buf) __WSM_GET(buf, u32, __le32, __le32_to_cpu)
#define WSM_PUT(buf, ptr, size) \
do { \
@@ -65,18 +65,18 @@
(buf)->data += size; \
} while (0)
-#define __WSM_PUT(buf, val, type, cvt) \
+#define __WSM_PUT(buf, val, type, type2, cvt) \
do { \
if ((buf)->data + sizeof(type) > (buf)->end) \
if (wsm_buf_reserve((buf), sizeof(type))) \
goto nomem; \
- *(type *)(buf)->data = cvt(val); \
+ *(type2 *)(buf)->data = cvt(val); \
(buf)->data += sizeof(type); \
} while (0)
-#define WSM_PUT8(buf, val) __WSM_PUT(buf, val, u8, (u8))
-#define WSM_PUT16(buf, val) __WSM_PUT(buf, val, u16, __cpu_to_le16)
-#define WSM_PUT32(buf, val) __WSM_PUT(buf, val, u32, __cpu_to_le32)
+#define WSM_PUT8(buf, val) __WSM_PUT(buf, val, u8, u8, (u8))
+#define WSM_PUT16(buf, val) __WSM_PUT(buf, val, u16, __le16, __cpu_to_le16)
+#define WSM_PUT32(buf, val) __WSM_PUT(buf, val, u32, __le32, __cpu_to_le32)
static void wsm_buf_reset(struct wsm_buf *buf);
static int wsm_buf_reserve(struct wsm_buf *buf, size_t extra_size);
@@ -931,8 +931,8 @@ static int wsm_event_indication(struct cw1200_common *priv, struct wsm_buf *buf)
if (!event)
return -ENOMEM;
- event->evt.id = __le32_to_cpu(WSM_GET32(buf));
- event->evt.data = __le32_to_cpu(WSM_GET32(buf));
+ event->evt.id = WSM_GET32(buf);
+ event->evt.data = WSM_GET32(buf);
pr_debug("[WSM] Event: %d(%d)\n",
event->evt.id, event->evt.data);
@@ -1311,7 +1311,7 @@ int wsm_handle_rx(struct cw1200_common *priv, u16 id,
wsm_buf.begin = (u8 *)&wsm[0];
wsm_buf.data = (u8 *)&wsm[1];
- wsm_buf.end = &wsm_buf.begin[__le32_to_cpu(wsm->len)];
+ wsm_buf.end = &wsm_buf.begin[__le16_to_cpu(wsm->len)];
pr_debug("[WSM] <<< 0x%.4X (%td)\n", id,
wsm_buf.end - wsm_buf.begin);
@@ -1550,7 +1550,7 @@ static bool wsm_handle_tx_data(struct cw1200_common *priv,
*/
pr_debug("[WSM] Convert probe request to scan.\n");
wsm_lock_tx_async(priv);
- priv->pending_frame_id = __le32_to_cpu(wsm->packet_id);
+ priv->pending_frame_id = wsm->packet_id;
if (queue_delayed_work(priv->workqueue,
&priv->scan.probe_work, 0) <= 0)
wsm_unlock_tx(priv);
@@ -1558,15 +1558,14 @@ static bool wsm_handle_tx_data(struct cw1200_common *priv,
break;
case do_drop:
pr_debug("[WSM] Drop frame (0x%.4X).\n", fctl);
- BUG_ON(cw1200_queue_remove(queue,
- __le32_to_cpu(wsm->packet_id)));
+ BUG_ON(cw1200_queue_remove(queue, wsm->packet_id));
handled = true;
break;
case do_wep:
pr_debug("[WSM] Issue set_default_wep_key.\n");
wsm_lock_tx_async(priv);
priv->wep_default_key_id = tx_info->control.hw_key->keyidx;
- priv->pending_frame_id = __le32_to_cpu(wsm->packet_id);
+ priv->pending_frame_id = wsm->packet_id;
if (queue_work(priv->workqueue, &priv->wep_key_work) <= 0)
wsm_unlock_tx(priv);
handled = true;
diff --git a/drivers/net/wireless/cw1200/wsm.h b/drivers/net/wireless/cw1200/wsm.h
index 2816171..7afc613 100644
--- a/drivers/net/wireless/cw1200/wsm.h
+++ b/drivers/net/wireless/cw1200/wsm.h
@@ -806,7 +806,7 @@ struct wsm_tx {
struct wsm_hdr hdr;
/* Packet identifier that meant to be used in completion. */
- __le32 packet_id;
+ u32 packet_id; /* Note this is actually a cookie */
/* WSM_TRANSMIT_RATE_... */
u8 max_tx_rate;
@@ -825,18 +825,18 @@ struct wsm_tx {
u8 flags;
/* Should be 0. */
- __le32 reserved;
+ u32 reserved;
/* The elapsed time in TUs, after the initial transmission */
/* of an MSDU, after which further attempts to transmit */
/* the MSDU shall be terminated. Overrides the global */
/* dot11MaxTransmitMsduLifeTime setting [optional] */
/* Device will set the default value if this is 0. */
- __le32 expire_time;
+ u32 expire_time;
/* WSM_HT_TX_... */
__le32 ht_tx_parameters;
-};
+} __packed;
/* = sizeof(generic hi hdr) + sizeof(wsm hdr) + sizeof(alignment) */
#define WSM_TX_EXTRA_HEADROOM (28)
@@ -846,10 +846,10 @@ struct wsm_tx {
struct wsm_rx {
/* WSM_STATUS_... */
- __le32 status;
+ u32 status;
/* Specifies the channel of the received packet. */
- __le16 channel_number;
+ u16 channel_number;
/* WSM_TRANSMIT_RATE_... */
u8 rx_rate;
@@ -859,11 +859,8 @@ struct wsm_rx {
u8 rcpi_rssi;
/* WSM_RX_STATUS_... */
- __le32 flags;
-
- /* Payload */
- u8 data[0];
-} __packed;
+ u32 flags;
+};
/* = sizeof(generic hi hdr) + sizeof(wsm hdr) */
#define WSM_RX_EXTRA_HEADROOM (16)
@@ -1119,22 +1116,22 @@ int wsm_set_tx_queue_params(struct cw1200_common *priv,
#define WSM_EDCA_PARAMS_RESP_ID 0x0413
struct wsm_edca_queue_params {
/* CWmin (in slots) for the access class. */
- __le16 cwmin;
+ u16 cwmin;
/* CWmax (in slots) for the access class. */
- __le16 cwmax;
+ u16 cwmax;
/* AIFS (in slots) for the access class. */
- __le16 aifns;
+ u16 aifns;
/* TX OP Limit (in microseconds) for the access class. */
- __le16 txop_limit;
+ u16 txop_limit;
/* dot11MaxReceiveLifetime to be used for the specified */
/* the access class. Overrides the global */
/* dot11MaxReceiveLifetime value */
- __le32 max_rx_lifetime;
-} __packed;
+ u32 max_rx_lifetime;
+};
struct wsm_edca_params {
/* NOTE: index is a linux queue id. */
@@ -1147,12 +1144,12 @@ struct wsm_edca_params {
__uapsd) \
do { \
struct wsm_edca_queue_params *p = &(__edca)->params[__queue]; \
- p->cwmin = (__cw_min); \
- p->cwmax = (__cw_max); \
- p->aifns = (__aifs); \
- p->txop_limit = ((__txop) * TXOP_UNIT); \
- p->max_rx_lifetime = (__lifetime); \
- (__edca)->uapsd_enable[__queue] = (__uapsd); \
+ p->cwmin = __cw_min; \
+ p->cwmax = __cw_max; \
+ p->aifns = __aifs; \
+ p->txop_limit = ((__txop) * TXOP_UNIT); \
+ p->max_rx_lifetime = __lifetime; \
+ (__edca)->uapsd_enable[__queue] = (__uapsd); \
} while (0)
int wsm_set_edca_params(struct cw1200_common *priv,
@@ -1475,7 +1472,7 @@ static inline int wsm_set_template_frame(struct cw1200_common *priv,
u8 *p = skb_push(arg->skb, 4);
p[0] = arg->frame_type;
p[1] = arg->rate;
- ((u16 *)p)[1] = __cpu_to_le16(arg->skb->len - 4);
+ ((__le16 *)p)[1] = __cpu_to_le16(arg->skb->len - 4);
ret = wsm_write_mib(priv, WSM_MIB_ID_TEMPLATE_FRAME, p, arg->skb->len);
skb_pull(arg->skb, 4);
return ret;
--
1.8.2.1
^ permalink raw reply related
* [PATCH] ath9k: Enable WoW only for supported models
From: Sujith Manoharan @ 2013-06-21 5:41 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Since platform support is required for WoW, identify and
and enable Wow only for supported cards.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath9k/ath9k.h | 1 +
drivers/net/wireless/ath/ath9k/init.c | 1 +
drivers/net/wireless/ath/ath9k/pci.c | 57 ++++++++++++++++++++++++++++++++++
3 files changed, 59 insertions(+)
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 04b2d3e..c1224b5 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -634,6 +634,7 @@ void ath_ant_comb_update(struct ath_softc *sc);
#define ATH9K_PCI_CUS198 0x0001
#define ATH9K_PCI_CUS230 0x0002
#define ATH9K_PCI_CUS217 0x0004
+#define ATH9K_PCI_WOW 0x0008
/*
* Default cache line size, in bytes.
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 1e555d8..16f8b20 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -837,6 +837,7 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
#ifdef CONFIG_PM_SLEEP
if ((ah->caps.hw_caps & ATH9K_HW_WOW_DEVICE_CAPABLE) &&
+ (sc->driver_data & ATH9K_PCI_WOW) &&
device_can_wakeup(sc->dev))
hw->wiphy->wowlan = &ath9k_wowlan_support;
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index b096bb2..c585c9b 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -79,6 +79,63 @@ static DEFINE_PCI_DEVICE_TABLE(ath_pci_id_table) = {
0x6661),
.driver_data = ATH9K_PCI_CUS217 },
+ /* AR9462 with WoW support */
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ PCI_VENDOR_ID_ATHEROS,
+ 0x3117),
+ .driver_data = ATH9K_PCI_WOW },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ PCI_VENDOR_ID_LENOVO,
+ 0x3214),
+ .driver_data = ATH9K_PCI_WOW },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ PCI_VENDOR_ID_ATTANSIC,
+ 0x0091),
+ .driver_data = ATH9K_PCI_WOW },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ PCI_VENDOR_ID_AZWAVE,
+ 0x2110),
+ .driver_data = ATH9K_PCI_WOW },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ PCI_VENDOR_ID_ASUSTEK,
+ 0x850E),
+ .driver_data = ATH9K_PCI_WOW },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ 0x11AD, /* LITEON */
+ 0x6631),
+ .driver_data = ATH9K_PCI_WOW },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ 0x11AD, /* LITEON */
+ 0x6641),
+ .driver_data = ATH9K_PCI_WOW },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ PCI_VENDOR_ID_HP,
+ 0x1864),
+ .driver_data = ATH9K_PCI_WOW },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ 0x14CD, /* USI */
+ 0x0063),
+ .driver_data = ATH9K_PCI_WOW },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ 0x14CD, /* USI */
+ 0x0064),
+ .driver_data = ATH9K_PCI_WOW },
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
+ 0x0034,
+ 0x10CF, /* Fujitsu */
+ 0x1783),
+ .driver_data = ATH9K_PCI_WOW },
+
{ PCI_VDEVICE(ATHEROS, 0x0034) }, /* PCI-E AR9462 */
{ PCI_VDEVICE(ATHEROS, 0x0037) }, /* PCI-E AR1111/AR9485 */
{ PCI_VDEVICE(ATHEROS, 0x0036) }, /* PCI-E AR9565 */
--
1.8.3.1
^ permalink raw reply related
* [PATCH 1/2] mac80211: allow self-protected frame tx without sta
From: Thomas Pedersen @ 2013-06-21 6:50 UTC (permalink / raw)
To: Johannes Berg
Cc: linux-wireless, open80211s, marco, Bob Copeland, Thomas Pedersen
Useful for userspace mesh to authenticate and peer without
a station entry, since both steps may fail anyway.
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
---
net/mac80211/cfg.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 18ba7ed..d6f9823 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2821,7 +2821,8 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
!rcu_access_pointer(sdata->bss->beacon))
need_offchan = true;
if (!ieee80211_is_action(mgmt->frame_control) ||
- mgmt->u.action.category == WLAN_CATEGORY_PUBLIC)
+ mgmt->u.action.category == WLAN_CATEGORY_PUBLIC ||
+ mgmt->u.action.category == WLAN_CATEGORY_SELF_PROTECTED)
break;
rcu_read_lock();
sta = sta_info_get(sdata, mgmt->da);
--
1.7.10.4
^ permalink raw reply related
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