* Re: [PATCH v2 09/14] rt2x00: rt2x00pci: set PCI MWI only if supported
From: Stanislaw Gruszka @ 2017-01-16 10:08 UTC (permalink / raw)
To: Daniel Golle
Cc: linux-wireless, Johannes Berg, roman, michel.stempin, c.mignanti,
evaxige, Kalle Valo, Felix Fietkau, John Crispin, Gabor Juhos
In-Reply-To: <20170116030613.GA32249@makrotopia.org>
On Mon, Jan 16, 2017 at 04:06:25AM +0100, Daniel Golle wrote:
> From: Claudio Mignanti <c.mignanti@gmail.com>
>
> This is needed for devices without support for PCI MWI. See also
> https://dev.openwrt.org/changeset/21850
>
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> ---
> drivers/net/wireless/ralink/rt2x00/rt2x00pci.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00pci.c b/drivers/net/wireless/ralink/rt2x00/rt2x00pci.c
> index eb6dbcd4fddf..4becfeb75ba8 100644
> --- a/drivers/net/wireless/ralink/rt2x00/rt2x00pci.c
> +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00pci.c
> @@ -94,8 +94,10 @@ int rt2x00pci_probe(struct pci_dev *pci_dev, const struct rt2x00_ops *ops)
>
> pci_set_master(pci_dev);
>
> +#ifdef CONFIG_PCI_SET_MWI
> if (pci_set_mwi(pci_dev))
> rt2x00_probe_err("MWI not available\n");
> +#endif
There is no CONFIG_PCI_SET_MWI in the kernel. This patch is either not
needed (pci subsystem has own PCI_DISABLE_MWI define) or wrong (we
should not call this function for some devices).
Stanislaw
^ permalink raw reply
* Re: [PATCH v2 10/14] rt2x00: rt2800lib: correctly set HT20/HT40 filter
From: Stanislaw Gruszka @ 2017-01-16 10:12 UTC (permalink / raw)
To: Daniel Golle
Cc: linux-wireless, Johannes Berg, roman, michel.stempin, c.mignanti,
evaxige, Kalle Valo, Felix Fietkau, John Crispin, Gabor Juhos
In-Reply-To: <20170116030820.GA32255@makrotopia.org>
On Mon, Jan 16, 2017 at 04:08:38AM +0100, Daniel Golle wrote:
> From: Serge Vasilugin <vasilugin@yandex.ru>
>
> Simple patch to correct HT20/HT40 filter setting.
> Tested with Rt3290, Rt3352 and Rt5350
>
> Signed-off-by: Serge Vasilugin <vasilugin@yandex.ru>
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
^ permalink raw reply
* Re: [PATCH v2 11/14] rt2x00: rt2800lib: fix rf id for RT3352
From: Stanislaw Gruszka @ 2017-01-16 10:12 UTC (permalink / raw)
To: Daniel Golle
Cc: linux-wireless, Johannes Berg, roman, michel.stempin, c.mignanti,
evaxige, Kalle Valo, Felix Fietkau, John Crispin, Gabor Juhos
In-Reply-To: <20170116031246.GA32267@makrotopia.org>
On Mon, Jan 16, 2017 at 04:13:01AM +0100, Daniel Golle wrote:
> From: Felix Fietkau <nbd@openwrt.org>
>
> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
^ permalink raw reply
* Re: [PATCH v2 12/14] rt2x00: rt2800lib: support for for RT3352 with external PA
From: Stanislaw Gruszka @ 2017-01-16 10:14 UTC (permalink / raw)
To: Daniel Golle
Cc: linux-wireless, Johannes Berg, roman, michel.stempin, c.mignanti,
evaxige, Kalle Valo, Felix Fietkau, John Crispin, Gabor Juhos
In-Reply-To: <20170116031444.GA32304@makrotopia.org>
On Mon, Jan 16, 2017 at 04:14:57AM +0100, Daniel Golle wrote:
> This is needed for WiFi to work e.g. on DIR-615 rev.H1 which got
> external RF power amplifiers connected to the WiSoC.
>
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
^ permalink raw reply
* [PATCH] brcmfmac: add support for BCM43455 with modalias sdio:c00v02D0dA9BF
From: Martin Blumenstingl @ 2017-01-16 10:17 UTC (permalink / raw)
To: linux-mmc, brcm80211-dev-list.pdl, linux-wireless, kvalo,
ulf.hansson
Cc: arend.vanspriel, franky.lin, hante.meuleman, Martin Blumenstingl
BCM43455 is a more recent revision of the BCM4345. Some of the BCM43455
got a dedicated SDIO device ID which is currently not supported by
brcmfmac.
Adding the new sdio_device_id to brcmfmac is enough to get the BCM43455
supported because the chip itself is already supported (due to BCM4345
support in the driver).
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
This is the proper patch following the (short) discussion from [0]
[0] https://marc.info/?l=linux-wireless&m=148455981002310&w=2
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 1 +
include/linux/mmc/sdio_ids.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
index 72139b579b18..5bc2ba214735 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
@@ -1104,6 +1104,7 @@ static const struct sdio_device_id brcmf_sdmmc_ids[] = {
BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4339),
BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43430),
BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4345),
+ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43455),
BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354),
BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4356),
{ /* end: all zeroes */ }
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
index d43ef96bf075..71b113e1223f 100644
--- a/include/linux/mmc/sdio_ids.h
+++ b/include/linux/mmc/sdio_ids.h
@@ -36,6 +36,7 @@
#define SDIO_DEVICE_ID_BROADCOM_43362 0xa962
#define SDIO_DEVICE_ID_BROADCOM_43430 0xa9a6
#define SDIO_DEVICE_ID_BROADCOM_4345 0x4345
+#define SDIO_DEVICE_ID_BROADCOM_43455 0xa9bf
#define SDIO_DEVICE_ID_BROADCOM_4354 0x4354
#define SDIO_DEVICE_ID_BROADCOM_4356 0x4356
--
2.11.0
^ permalink raw reply related
* Re: [PATCH v2 14/14] rt2x00: add support for RT5350 WiSoC
From: Stanislaw Gruszka @ 2017-01-16 10:17 UTC (permalink / raw)
To: Daniel Golle
Cc: linux-wireless, Johannes Berg, roman, michel.stempin, c.mignanti,
evaxige, Kalle Valo, Felix Fietkau, John Crispin, Gabor Juhos
In-Reply-To: <20170116031734.GA32321@makrotopia.org>
On Mon, Jan 16, 2017 at 04:17:58AM +0100, Daniel Golle wrote:
> @@ -7131,6 +7236,12 @@ static int rt2800_validate_eeprom(struct rt2x00_dev *rt2x00dev)
> rt2x00_set_field16(&word, EEPROM_NIC_CONF0_RF_TYPE, RF2820);
> rt2800_eeprom_write(rt2x00dev, EEPROM_NIC_CONF0, word);
> rt2x00_eeprom_dbg(rt2x00dev, "Antenna: 0x%04x\n", word);
> + } else if (rt2x00_rt(rt2x00dev, RT5350)) {
> + rt2x00_set_field16(&word, EEPROM_NIC_CONF0_RXPATH, 1);
> + rt2x00_set_field16(&word, EEPROM_NIC_CONF0_TXPATH, 1);
> + rt2x00_set_field16(&word, EEPROM_NIC_CONF0_RF_TYPE, RF3320);
Here you set RF3320 ..
> + rt2x00_eeprom_write(rt2x00dev, EEPROM_NIC_CONF0, word);
> + rt2x00_eeprom_dbg(rt2x00dev, "Antenna: 0x%04x\n", word);
> } else if (rt2x00_rt(rt2x00dev, RT2860) ||
> rt2x00_rt(rt2x00dev, RT2872)) {
> /*
> @@ -7265,6 +7376,8 @@ static int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev)
> rt2800_eeprom_read(rt2x00dev, EEPROM_CHIP_ID, &rf);
> else if (rt2x00_rt(rt2x00dev, RT3352))
> rf = RF3322;
> + else if (rt2x00_rt(rt2x00dev, RT5350))
> + rf = RF5350;
and here RF5350. This does not seems to be correct.
Stanislaw
^ permalink raw reply
* Re: [PATCH] brcmfmac: add support for BCM43455 with modalias sdio:c00v02D0dA9BF
From: Arend Van Spriel @ 2017-01-16 10:50 UTC (permalink / raw)
To: Martin Blumenstingl, linux-mmc, brcm80211-dev-list.pdl,
linux-wireless, kvalo, ulf.hansson
Cc: franky.lin, hante.meuleman
In-Reply-To: <20170116101757.20483-1-martin.blumenstingl@googlemail.com>
On 16-1-2017 11:17, Martin Blumenstingl wrote:
> BCM43455 is a more recent revision of the BCM4345. Some of the BCM43455
> got a dedicated SDIO device ID which is currently not supported by
> brcmfmac.
> Adding the new sdio_device_id to brcmfmac is enough to get the BCM43455
> supported because the chip itself is already supported (due to BCM4345
> support in the driver).
Hopefully Kalle can take this through his tree, ie. wireless-drivers-next.
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
> This is the proper patch following the (short) discussion from [0]
>
> [0] https://marc.info/?l=linux-wireless&m=148455981002310&w=2
>
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 1 +
> include/linux/mmc/sdio_ids.h | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
> index 72139b579b18..5bc2ba214735 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
> @@ -1104,6 +1104,7 @@ static const struct sdio_device_id brcmf_sdmmc_ids[] = {
> BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4339),
> BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43430),
> BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4345),
> + BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43455),
> BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354),
> BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4356),
> { /* end: all zeroes */ }
> diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
> index d43ef96bf075..71b113e1223f 100644
> --- a/include/linux/mmc/sdio_ids.h
> +++ b/include/linux/mmc/sdio_ids.h
> @@ -36,6 +36,7 @@
> #define SDIO_DEVICE_ID_BROADCOM_43362 0xa962
> #define SDIO_DEVICE_ID_BROADCOM_43430 0xa9a6
> #define SDIO_DEVICE_ID_BROADCOM_4345 0x4345
> +#define SDIO_DEVICE_ID_BROADCOM_43455 0xa9bf
> #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354
> #define SDIO_DEVICE_ID_BROADCOM_4356 0x4356
>
>
^ permalink raw reply
* wpa_supplicant mesh mode issue
From: Matteo Grandi @ 2017-01-16 11:26 UTC (permalink / raw)
To: LinuxWireless Mailing List
Hi all,
I'm trying to set-up a mesh network using wpa-supplicant (already did
using iw and works fine) because I would like to implement security.
I followed the guide
https://wireless.wiki.kernel.org/en/users/drivers/ath10k/mesh?s[]=mesh&s[]=point
but I bump into some issues:
- when I set the parameter user_mpm=1 in the wpa_supplicant.conf file,
I have the llid and plid both set to 0 and the mesh points aren't able
to ping each other.
- Setting the parameter user_mpm=0 the peers can ping each other.
- If I implement the security I fall back to the same llid/plid=0 issue.
So it seems thet have user_mpm=1 and/or security implementation allows
to build the mesh, but it's impossible to ping and transmit on it.
Using user_mpm=0 allows the proper work of the mesh but only id
security is NOT used.
Is it ok to have llid/plid=0 when security is implemented or user_mpm=1?
Is someone already had this issue?
I'll be grateful for every hint!
Here my configuration file and the station dump:
With secure MP and user_mpm=0 or 1:
# Basic Mesh Point configuration on channel 36
ctrl_interface=/var/run/wpa_supplicant
user_mpm=0
network={
ssid="ath10k36"
mode=5
frequency= 5180
#SECURITY MANAGEMENT
#key_mgmt=NONE
key_mgmt=SAE
psk="i2cati2cati2cat"
ieee80211w=1
}
Station 04:f0:21:22:91:81 (on m36p)
inactive time: 160 ms
rx bytes: 354494
rx packets: 4146
tx bytes: 1074
tx packets: 8
tx retries: 0
tx failed: 0
rx drop misc: 1
signal: -40 dBm
signal avg: -40 dBm
tx bitrate: 6.0 MBit/s
rx bitrate: 6.0 MBit/s
mesh llid: 0
mesh plid: 0
mesh plink: ESTAB
mesh local PS mode: ACTIVE
mesh peer PS mode: UNKNOWN
mesh non-peer PS mode: ACTIVE
authorized: no
authenticated: yes
associated: no
preamble: long
WMM/WME: yes
MFP: yes
TDLS peer: no
DTIM period: 2
beacon interval:1000
connected time: 2146 seconds
Station 04:f0:21:22:91:88 (on m36h)
inactive time: 600 ms
rx bytes: 434903
rx packets: 5080
tx bytes: 754
tx packets: 5
tx retries: 0
tx failed: 0
rx drop misc: 8
signal: -41 dBm
signal avg: -41 dBm
Toffset: 2666496059 us
tx bitrate: 6.0 MBit/s
rx bitrate: 6.0 MBit/s
mesh llid: 0
mesh plid: 0
mesh plink: ESTAB
mesh local PS mode: ACTIVE
mesh peer PS mode: UNKNOWN
mesh non-peer PS mode: ACTIVE
authorized: no
authenticated: yes
associated: no
preamble: long
WMM/WME: yes
MFP: yes
TDLS peer: no
DTIM period: 2
beacon interval:1000
connected time: 2620 seconds
Without secure MP and user_mpm=0
# Basic Mesh Point configuration on channel 36
ctrl_interface=/var/run/wpa_supplicant
user_mpm=0
network={
ssid="ath10k36"
mode=5
frequency= 5180
#SECURITY MANAGEMENT
key_mgmt=NONE
#key_mgmt=SAE
#psk="i2cati2cati2cat"
#ieee80211w=1
}
Station 04:f0:21:22:91:81 (on m36)
inactive time: 940 ms
rx bytes: 1882
rx packets: 24
tx bytes: 308
tx packets: 3
tx retries: 0
tx failed: 0
rx drop misc: 2
signal: -39 dBm
signal avg: -39 dBm
tx bitrate: 6.0 MBit/s
rx bitrate: 6.0 MBit/s
mesh llid: 36778
mesh plid: 44382
mesh plink: ESTAB
mesh local PS mode: ACTIVE
mesh peer PS mode: UNKNOWN
mesh non-peer PS mode: ACTIVE
authorized: yes
authenticated: yes
associated: yes
preamble: long
WMM/WME: yes
MFP: no
TDLS peer: no
DTIM period: 2
beacon interval:1000
short slot time:yes
connected time: 11 seconds
Thanks a lot
Best Regards
Matteo
^ permalink raw reply
* [RFC V2 1/5] nl80211: allow multiple active scheduled scan requests
From: Arend van Spriel @ 2017-01-16 11:42 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Arend van Spriel
In-Reply-To: <1484566941-27000-1-git-send-email-arend.vanspriel@broadcom.com>
This patch implements the idea to have multiple scheduled scan requests
running concurrently. It mainly illustrates how to deal with the incoming
request from user-space in terms of backward compatibility. In order to
use multiple scheduled scans user-space needs to provide a flag attribute
NL80211_ATTR_SCHED_SCAN_MULTI to indicate support. If not the request is
treated as a legacy scan.
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
include/net/cfg80211.h | 7 ++++
include/uapi/linux/nl80211.h | 12 +++++-
net/wireless/core.c | 30 +++++++++-----
net/wireless/core.h | 10 ++++-
net/wireless/nl80211.c | 37 +++++++++++++++--
net/wireless/rdev-ops.h | 2 +-
net/wireless/scan.c | 96 ++++++++++++++++++++++++++++++++++++--------
net/wireless/trace.h | 18 ++++++---
8 files changed, 173 insertions(+), 39 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index b7aba6e..4b98ff8 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1633,6 +1633,7 @@ struct cfg80211_bss_select_adjust {
/**
* struct cfg80211_sched_scan_request - scheduled scan request description
*
+ * @reqid: identifies this request.
* @ssids: SSIDs to scan for (passed in the probe_reqs in active scans)
* @n_ssids: number of SSIDs
* @n_channels: total number of channels to scan
@@ -1661,6 +1662,7 @@ struct cfg80211_bss_select_adjust {
* @rcu_head: RCU callback used to free the struct
* @owner_nlportid: netlink portid of owner (if this should is a request
* owned by a particular socket)
+ * @list: for keeping list of requests.
* @delay: delay in seconds to use before starting the first scan
* cycle. The driver may ignore this parameter and start
* immediately (or at any other time), if this feature is not
@@ -1677,6 +1679,7 @@ struct cfg80211_bss_select_adjust {
* comparisions.
*/
struct cfg80211_sched_scan_request {
+ u64 reqid;
struct cfg80211_ssid *ssids;
int n_ssids;
u32 n_channels;
@@ -1704,6 +1707,7 @@ struct cfg80211_sched_scan_request {
unsigned long scan_start;
struct rcu_head rcu_head;
u32 owner_nlportid;
+ struct list_head list;
/* keep last */
struct ieee80211_channel *channels[0];
@@ -3457,6 +3461,8 @@ struct wiphy_iftype_ext_capab {
* this variable determines its size
* @max_scan_ssids: maximum number of SSIDs the device can scan for in
* any given scan
+ * @max_sched_scan_reqs: maximum number of scheduled scan requests that
+ * the device can run concurrently.
* @max_sched_scan_ssids: maximum number of SSIDs the device can scan
* for in any given scheduled scan
* @max_match_sets: maximum number of match sets the device can handle
@@ -3589,6 +3595,7 @@ struct wiphy {
int bss_priv_size;
u8 max_scan_ssids;
+ u8 max_sched_scan_reqs;
u8 max_sched_scan_ssids;
u8 max_match_sets;
u16 max_scan_ie_len;
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index c51b40c..961e381 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -351,7 +351,9 @@
* are used. Extra IEs can also be passed from the userspace by
* using the %NL80211_ATTR_IE attribute. The first cycle of the
* scheduled scan can be delayed by %NL80211_ATTR_SCHED_SCAN_DELAY
- * is supplied.
+ * is supplied. If the device supports multiple concurrent scheduled
+ * scans, it will allow such when the caller provides the flag attribute
+ * %NL80211_ATTR_SCHED_SCAN_MULTI to indicate user-space support for it.
* @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT if
* scheduled scan is not running. The caller may assume that as soon
* as the call returns, it is safe to start a new scheduled scan again.
@@ -2000,6 +2002,11 @@ enum nl80211_commands {
* u32 attribute with an &enum nl80211_timeout_reason value. This is used,
* e.g., with %NL80211_CMD_CONNECT event.
*
+ * @NL80211_ATTR_SCHED_SCAN_MULTI: flag attribute which user-space shall use to
+ * indicate that it supports multiple active scheduled scan requests.
+ * @NL80211_ATTR_SCHED_SCAN_MAX_REQS: indicates maximum number of scheduled
+ * scan request that may be active for the device (u8).
+ *
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2411,6 +2418,9 @@ enum nl80211_attrs {
NL80211_ATTR_TIMEOUT_REASON,
+ NL80211_ATTR_SCHED_SCAN_MULTI,
+ NL80211_ATTR_SCHED_SCAN_MAX_REQS,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 903fc419..1f91e85 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -346,13 +346,17 @@ static void cfg80211_destroy_iface_wk(struct work_struct *work)
static void cfg80211_sched_scan_stop_wk(struct work_struct *work)
{
struct cfg80211_registered_device *rdev;
+ struct cfg80211_sched_scan_request *pos, *tmp;
rdev = container_of(work, struct cfg80211_registered_device,
sched_scan_stop_wk);
rtnl_lock();
- __cfg80211_stop_sched_scan(rdev, false);
+ /* request gets removed from list so need safe iterator */
+ list_for_each_entry_safe(pos, tmp, &rdev->sched_scan_req_list, list) {
+ cfg80211_stop_sched_scan_req(rdev, pos, false);
+ }
rtnl_unlock();
}
@@ -436,6 +440,7 @@ struct wiphy *wiphy_new_nm(const struct cfg80211_ops *ops, int sizeof_priv,
spin_lock_init(&rdev->beacon_registrations_lock);
spin_lock_init(&rdev->bss_lock);
INIT_LIST_HEAD(&rdev->bss_list);
+ INIT_LIST_HEAD(&rdev->sched_scan_req_list);
INIT_WORK(&rdev->scan_done_wk, __cfg80211_scan_done);
INIT_WORK(&rdev->sched_scan_results_wk, __cfg80211_sched_scan_results);
INIT_LIST_HEAD(&rdev->mlme_unreg);
@@ -690,6 +695,10 @@ int wiphy_register(struct wiphy *wiphy)
(wiphy->bss_select_support & ~(BIT(__NL80211_BSS_SELECT_ATTR_AFTER_LAST) - 2))))
return -EINVAL;
+ if ((wiphy->flags & WIPHY_FLAG_SUPPORTS_SCHED_SCAN) &&
+ !wiphy->max_sched_scan_reqs)
+ wiphy->max_sched_scan_reqs = 1;
+
if (wiphy->addresses)
memcpy(wiphy->perm_addr, wiphy->addresses[0].addr, ETH_ALEN);
@@ -1000,7 +1009,7 @@ void __cfg80211_leave(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev)
{
struct net_device *dev = wdev->netdev;
- struct cfg80211_sched_scan_request *sched_scan_req;
+ struct cfg80211_sched_scan_request *pos, *tmp;
ASSERT_RTNL();
ASSERT_WDEV_LOCK(wdev);
@@ -1011,9 +1020,10 @@ void __cfg80211_leave(struct cfg80211_registered_device *rdev,
break;
case NL80211_IFTYPE_P2P_CLIENT:
case NL80211_IFTYPE_STATION:
- sched_scan_req = rtnl_dereference(rdev->sched_scan_req);
- if (sched_scan_req && dev == sched_scan_req->dev)
- __cfg80211_stop_sched_scan(rdev, false);
+ list_for_each_entry_safe(pos, tmp, &rdev->sched_scan_req_list, list) {
+ if (dev == pos->dev)
+ cfg80211_stop_sched_scan_req(rdev, pos, false);
+ }
#ifdef CONFIG_CFG80211_WEXT
kfree(wdev->wext.ie);
@@ -1088,7 +1098,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev;
- struct cfg80211_sched_scan_request *sched_scan_req;
+ struct cfg80211_sched_scan_request *pos, *tmp;
if (!wdev)
return NOTIFY_DONE;
@@ -1157,10 +1167,10 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
___cfg80211_scan_done(rdev, false);
}
- sched_scan_req = rtnl_dereference(rdev->sched_scan_req);
- if (WARN_ON(sched_scan_req &&
- sched_scan_req->dev == wdev->netdev)) {
- __cfg80211_stop_sched_scan(rdev, false);
+ list_for_each_entry_safe(pos, tmp,
+ &rdev->sched_scan_req_list, list) {
+ if (WARN_ON(pos && pos->dev == wdev->netdev))
+ cfg80211_stop_sched_scan_req(rdev, pos, false);
}
rdev->opencount--;
diff --git a/net/wireless/core.h b/net/wireless/core.h
index 58ca206..cc99520 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -74,6 +74,7 @@ struct cfg80211_registered_device {
u32 bss_entries;
struct cfg80211_scan_request *scan_req; /* protected by RTNL */
struct sk_buff *scan_msg;
+ struct list_head sched_scan_req_list;
struct cfg80211_sched_scan_request __rcu *sched_scan_req;
unsigned long suspend_at;
struct work_struct scan_done_wk;
@@ -423,9 +424,16 @@ int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,
void __cfg80211_scan_done(struct work_struct *wk);
void ___cfg80211_scan_done(struct cfg80211_registered_device *rdev,
bool send_message);
+void cfg80211_add_sched_scan_req(struct cfg80211_registered_device *rdev,
+ struct cfg80211_sched_scan_request *req);
+int cfg80211_sched_scan_req_possible(struct cfg80211_registered_device *rdev,
+ bool want_multi);
void __cfg80211_sched_scan_results(struct work_struct *wk);
+int cfg80211_stop_sched_scan_req(struct cfg80211_registered_device *rdev,
+ struct cfg80211_sched_scan_request *req,
+ bool driver_initiated);
int __cfg80211_stop_sched_scan(struct cfg80211_registered_device *rdev,
- bool driver_initiated);
+ u64 reqid, bool driver_initiated);
void cfg80211_upload_connect_keys(struct wireless_dev *wdev);
int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
struct net_device *dev, enum nl80211_iftype ntype,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index b4e7bdd..411774b 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -410,6 +410,7 @@ enum nl80211_multicast_groups {
.len = sizeof(struct nl80211_bss_select_rssi_adjust)
},
[NL80211_ATTR_TIMEOUT_REASON] = { .type = NLA_U32 },
+ [NL80211_ATTR_SCHED_SCAN_MULTI] = { .type = NLA_FLAG },
};
/* policy for the key attributes */
@@ -1468,6 +1469,8 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
rdev->wiphy.coverage_class) ||
nla_put_u8(msg, NL80211_ATTR_MAX_NUM_SCAN_SSIDS,
rdev->wiphy.max_scan_ssids) ||
+ nla_put_u8(msg, NL80211_ATTR_SCHED_SCAN_MAX_REQS,
+ rdev->wiphy.max_sched_scan_reqs) ||
nla_put_u8(msg, NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS,
rdev->wiphy.max_sched_scan_ssids) ||
nla_put_u16(msg, NL80211_ATTR_MAX_SCAN_IE_LEN,
@@ -7207,14 +7210,17 @@ static int nl80211_start_sched_scan(struct sk_buff *skb,
struct net_device *dev = info->user_ptr[1];
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_sched_scan_request *sched_scan_req;
+ bool want_multi;
int err;
if (!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_SCHED_SCAN) ||
!rdev->ops->sched_scan_start)
return -EOPNOTSUPP;
- if (rdev->sched_scan_req)
- return -EINPROGRESS;
+ want_multi = !!info->attrs[NL80211_ATTR_SCHED_SCAN_MULTI];
+ err = cfg80211_sched_scan_req_possible(rdev, want_multi);
+ if (err)
+ return err;
sched_scan_req = nl80211_parse_sched_scan(&rdev->wiphy, wdev,
info->attrs);
@@ -7223,6 +7229,14 @@ static int nl80211_start_sched_scan(struct sk_buff *skb,
if (err)
goto out_err;
+ /* leave request id zero for legacy request
+ * or if driver does not support multi-scheduled scan
+ */
+ if (want_multi && rdev->wiphy.max_sched_scan_reqs > 1) {
+ while (!sched_scan_req->reqid)
+ sched_scan_req->reqid = rdev->wiphy.cookie_counter++;
+ }
+
err = rdev_sched_scan_start(rdev, dev, sched_scan_req);
if (err)
goto out_free;
@@ -7233,7 +7247,7 @@ static int nl80211_start_sched_scan(struct sk_buff *skb,
if (info->attrs[NL80211_ATTR_SOCKET_OWNER])
sched_scan_req->owner_nlportid = info->snd_portid;
- rcu_assign_pointer(rdev->sched_scan_req, sched_scan_req);
+ cfg80211_add_sched_scan_req(rdev, sched_scan_req);
nl80211_send_sched_scan(rdev, dev,
NL80211_CMD_START_SCHED_SCAN);
@@ -7248,13 +7262,28 @@ static int nl80211_start_sched_scan(struct sk_buff *skb,
static int nl80211_stop_sched_scan(struct sk_buff *skb,
struct genl_info *info)
{
+ struct cfg80211_sched_scan_request *req;
struct cfg80211_registered_device *rdev = info->user_ptr[0];
+ u64 cookie;
if (!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_SCHED_SCAN) ||
!rdev->ops->sched_scan_stop)
return -EOPNOTSUPP;
- return __cfg80211_stop_sched_scan(rdev, false);
+ if (info->attrs[NL80211_ATTR_COOKIE]) {
+ cookie = nla_get_u64(info->attrs[NL80211_ATTR_COOKIE]);
+ return __cfg80211_stop_sched_scan(rdev, cookie, false);
+ } else {
+ req = list_first_or_null_rcu(&rdev->sched_scan_req_list,
+ struct cfg80211_sched_scan_request,
+ list);
+ if (!req || req->reqid ||
+ (req->owner_nlportid &&
+ req->owner_nlportid != info->snd_portid))
+ return -ENOENT;
+
+ return cfg80211_stop_sched_scan_req(rdev, req, false);
+ }
}
static int nl80211_start_radar_detection(struct sk_buff *skb,
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index 2f42507..9ada5e2 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -802,7 +802,7 @@ static inline int rdev_get_antenna(struct cfg80211_registered_device *rdev,
struct cfg80211_sched_scan_request *request)
{
int ret;
- trace_rdev_sched_scan_start(&rdev->wiphy, dev, request);
+ trace_rdev_sched_scan_start(&rdev->wiphy, dev, request->reqid);
ret = rdev->ops->sched_scan_start(&rdev->wiphy, dev, request);
trace_rdev_return_int(&rdev->wiphy, ret);
return ret;
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 21be56b..6704198 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -300,6 +300,64 @@ void cfg80211_scan_done(struct cfg80211_scan_request *request,
}
EXPORT_SYMBOL(cfg80211_scan_done);
+void cfg80211_add_sched_scan_req(struct cfg80211_registered_device *rdev,
+ struct cfg80211_sched_scan_request *req)
+{
+ list_add_rcu(&req->list, &rdev->sched_scan_req_list);
+}
+
+static void cfg80211_del_sched_scan_req(struct cfg80211_registered_device *rdev,
+ struct cfg80211_sched_scan_request *req)
+{
+ list_del_rcu(&req->list);
+ kfree_rcu(req, rcu_head);
+}
+
+static struct cfg80211_sched_scan_request *
+cfg80211_find_sched_scan_req(struct cfg80211_registered_device *rdev, u64 reqid)
+{
+ struct cfg80211_sched_scan_request *pos;
+
+ list_for_each_entry(pos, &rdev->sched_scan_req_list, list) {
+ if (pos->reqid == reqid)
+ return pos;
+ }
+ return ERR_PTR(-ENOENT);
+}
+
+/*
+ * Determines if a scheduled scan request can be handled. When a legacy
+ * scheduled scan is running no other scheduled scan is allowed regardless
+ * whether the request is for legacy or multi-support scan. When a multi-support
+ * scheduled scan is running a request for legacy scan is not allowed. In this
+ * case a request for multi-support scan can be handled if resources are
+ * available, ie. struct wiphy::max_sched_scan_reqs limit is not yet reached.
+ */
+int cfg80211_sched_scan_req_possible(struct cfg80211_registered_device *rdev,
+ bool want_multi)
+{
+ struct cfg80211_sched_scan_request *pos;
+ int i = 0;
+
+ list_for_each_entry(pos, &rdev->sched_scan_req_list, list) {
+ /* request id zero means legacy in progress */
+ if (!i && !pos->reqid)
+ return -EINPROGRESS;
+ i++;
+ }
+
+ if (i) {
+ /* no legacy allowed when multi request(s) are active */
+ if (!want_multi)
+ return -EINPROGRESS;
+
+ /* resource limit reached */
+ if (i == rdev->wiphy.max_sched_scan_reqs)
+ return -ENOSPC;
+ }
+ return 0;
+}
+
void __cfg80211_sched_scan_results(struct work_struct *wk)
{
struct cfg80211_registered_device *rdev;
@@ -347,7 +405,7 @@ void cfg80211_sched_scan_stopped_rtnl(struct wiphy *wiphy)
trace_cfg80211_sched_scan_stopped(wiphy);
- __cfg80211_stop_sched_scan(rdev, true);
+ __cfg80211_stop_sched_scan(rdev, 0, true);
}
EXPORT_SYMBOL(cfg80211_sched_scan_stopped_rtnl);
@@ -359,34 +417,40 @@ void cfg80211_sched_scan_stopped(struct wiphy *wiphy)
}
EXPORT_SYMBOL(cfg80211_sched_scan_stopped);
-int __cfg80211_stop_sched_scan(struct cfg80211_registered_device *rdev,
- bool driver_initiated)
+int cfg80211_stop_sched_scan_req(struct cfg80211_registered_device *rdev,
+ struct cfg80211_sched_scan_request *req,
+ bool driver_initiated)
{
- struct cfg80211_sched_scan_request *sched_scan_req;
- struct net_device *dev;
-
ASSERT_RTNL();
- if (!rdev->sched_scan_req)
- return -ENOENT;
-
- sched_scan_req = rtnl_dereference(rdev->sched_scan_req);
- dev = sched_scan_req->dev;
-
if (!driver_initiated) {
- int err = rdev_sched_scan_stop(rdev, dev);
+ int err = rdev_sched_scan_stop(rdev, req->dev);
if (err)
return err;
}
- nl80211_send_sched_scan(rdev, dev, NL80211_CMD_SCHED_SCAN_STOPPED);
+ nl80211_send_sched_scan(rdev, req->dev, NL80211_CMD_SCHED_SCAN_STOPPED);
- RCU_INIT_POINTER(rdev->sched_scan_req, NULL);
- kfree_rcu(sched_scan_req, rcu_head);
+ cfg80211_del_sched_scan_req(rdev, req);
return 0;
}
+int __cfg80211_stop_sched_scan(struct cfg80211_registered_device *rdev,
+ u64 reqid, bool driver_initiated)
+{
+ struct cfg80211_sched_scan_request *sched_scan_req;
+
+ ASSERT_RTNL();
+
+ sched_scan_req = cfg80211_find_sched_scan_req(rdev, reqid);
+ if (IS_ERR(sched_scan_req))
+ return PTR_ERR(sched_scan_req);
+
+ return cfg80211_stop_sched_scan_req(rdev, sched_scan_req,
+ driver_initiated);
+}
+
void cfg80211_bss_age(struct cfg80211_registered_device *rdev,
unsigned long age_secs)
{
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index ea1b47e..7990c07 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -1588,20 +1588,26 @@
TP_ARGS(wiphy, rx, tx)
);
-TRACE_EVENT(rdev_sched_scan_start,
- TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
- struct cfg80211_sched_scan_request *request),
- TP_ARGS(wiphy, netdev, request),
+DECLARE_EVENT_CLASS(wiphy_netdev_id_evt,
+ TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u64 id),
+ TP_ARGS(wiphy, netdev, id),
TP_STRUCT__entry(
WIPHY_ENTRY
NETDEV_ENTRY
+ __field(u64, id)
),
TP_fast_assign(
WIPHY_ASSIGN;
NETDEV_ASSIGN;
+ __entry->id = id;
),
- TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT,
- WIPHY_PR_ARG, NETDEV_PR_ARG)
+ TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", id: %llu",
+ WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->id)
+);
+
+DEFINE_EVENT(wiphy_netdev_id_evt, rdev_sched_scan_start,
+ TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u64 id),
+ TP_ARGS(wiphy, netdev, id)
);
TRACE_EVENT(rdev_tdls_mgmt,
--
1.9.1
^ permalink raw reply related
* [RFC V2 4/5] cfg80211: add request id to cfg80211_sched_scan_results() api
From: Arend van Spriel @ 2017-01-16 11:42 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Arend van Spriel
In-Reply-To: <1484566941-27000-1-git-send-email-arend.vanspriel@broadcom.com>
Have proper request id filled in the SCHED_SCAN_RESULTS notification
toward user-space by having the driver provide it through the api.
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
drivers/net/wireless/ath/ath6kl/wmi.c | 2 +-
.../broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +-
drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c | 2 +-
include/net/cfg80211.h | 4 ++-
net/mac80211/scan.c | 2 +-
net/wireless/core.c | 1 -
net/wireless/core.h | 1 -
net/wireless/nl80211.c | 2 ++
net/wireless/scan.c | 30 +++++++++++-----------
net/wireless/trace.h | 17 +++++++++---
10 files changed, 37 insertions(+), 26 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index 84a6d12..04df853 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -1082,7 +1082,7 @@ void ath6kl_wmi_sscan_timer(unsigned long ptr)
{
struct ath6kl_vif *vif = (struct ath6kl_vif *) ptr;
- cfg80211_sched_scan_results(vif->ar->wiphy);
+ cfg80211_sched_scan_results(vif->ar->wiphy, 0);
}
static int ath6kl_wmi_bssinfo_event_rx(struct wmi *wmi, u8 *datap, int len,
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 8280f19..34d318e 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -766,7 +766,7 @@ s32 brcmf_notify_escan_complete(struct brcmf_cfg80211_info *cfg,
brcmf_dbg(SCAN, "scheduled scan completed\n");
cfg->internal_escan = false;
if (!aborted)
- cfg80211_sched_scan_results(cfg_to_wiphy(cfg));
+ cfg80211_sched_scan_results(cfg_to_wiphy(cfg), 0);
} else if (scan_request) {
struct cfg80211_scan_info info = {
.aborted = aborted,
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c b/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
index 8548027..12b471f 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
@@ -1201,7 +1201,7 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no,
break;
case HostCmd_CMD_802_11_BG_SCAN_QUERY:
ret = mwifiex_ret_802_11_scan(priv, resp);
- cfg80211_sched_scan_results(priv->wdev.wiphy);
+ cfg80211_sched_scan_results(priv->wdev.wiphy, 0);
mwifiex_dbg(adapter, CMD,
"info: CMD_RESP: BG_SCAN result is ready!\n");
break;
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 0a65cfe..8a635e0 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1702,6 +1702,7 @@ struct cfg80211_sched_scan_request {
struct cfg80211_bss_select_adjust rssi_adjust;
/* internal */
+ struct work_struct results_wk;
struct wiphy *wiphy;
struct net_device *dev;
unsigned long scan_start;
@@ -4455,8 +4456,9 @@ void cfg80211_scan_done(struct cfg80211_scan_request *request,
* cfg80211_sched_scan_results - notify that new scan results are available
*
* @wiphy: the wiphy which got scheduled scan results
+ * @reqid: identifier for the related scheduled scan request
*/
-void cfg80211_sched_scan_results(struct wiphy *wiphy);
+void cfg80211_sched_scan_results(struct wiphy *wiphy, u64 reqid);
/**
* cfg80211_sched_scan_stopped - notify that the scheduled scan has stopped
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index faab3c4..3fd8757 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -1219,7 +1219,7 @@ void ieee80211_sched_scan_results(struct ieee80211_hw *hw)
trace_api_sched_scan_results(local);
- cfg80211_sched_scan_results(hw->wiphy);
+ cfg80211_sched_scan_results(hw->wiphy, 0);
}
EXPORT_SYMBOL(ieee80211_sched_scan_results);
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 1f91e85..3ac0f91 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -442,7 +442,6 @@ struct wiphy *wiphy_new_nm(const struct cfg80211_ops *ops, int sizeof_priv,
INIT_LIST_HEAD(&rdev->bss_list);
INIT_LIST_HEAD(&rdev->sched_scan_req_list);
INIT_WORK(&rdev->scan_done_wk, __cfg80211_scan_done);
- INIT_WORK(&rdev->sched_scan_results_wk, __cfg80211_sched_scan_results);
INIT_LIST_HEAD(&rdev->mlme_unreg);
spin_lock_init(&rdev->mlme_unreg_lock);
INIT_WORK(&rdev->mlme_unreg_wk, cfg80211_mlme_unreg_wk);
diff --git a/net/wireless/core.h b/net/wireless/core.h
index cc99520..f69a4e8 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -78,7 +78,6 @@ struct cfg80211_registered_device {
struct cfg80211_sched_scan_request __rcu *sched_scan_req;
unsigned long suspend_at;
struct work_struct scan_done_wk;
- struct work_struct sched_scan_results_wk;
struct genl_info *cur_cmd_info;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index f303f6f..4f34873 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -7229,6 +7229,8 @@ static int nl80211_start_sched_scan(struct sk_buff *skb,
if (err)
goto out_err;
+ INIT_WORK(&sched_scan_req->results_wk, __cfg80211_sched_scan_results);
+
/* leave request id zero for legacy request
* or if driver does not support multi-scheduled scan
*/
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 04615338..5f24c13 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -361,38 +361,38 @@ int cfg80211_sched_scan_req_possible(struct cfg80211_registered_device *rdev,
void __cfg80211_sched_scan_results(struct work_struct *wk)
{
struct cfg80211_registered_device *rdev;
- struct cfg80211_sched_scan_request *request;
+ struct cfg80211_sched_scan_request *req;
- rdev = container_of(wk, struct cfg80211_registered_device,
- sched_scan_results_wk);
+ req = container_of(wk, struct cfg80211_sched_scan_request, results_wk);
+ rdev = wiphy_to_rdev(req->wiphy);
rtnl_lock();
- request = rtnl_dereference(rdev->sched_scan_req);
-
/* we don't have sched_scan_req anymore if the scan is stopping */
- if (request) {
- if (request->flags & NL80211_SCAN_FLAG_FLUSH) {
+ if (req) {
+ if (req->flags & NL80211_SCAN_FLAG_FLUSH) {
/* flush entries from previous scans */
spin_lock_bh(&rdev->bss_lock);
- __cfg80211_bss_expire(rdev, request->scan_start);
+ __cfg80211_bss_expire(rdev, req->scan_start);
spin_unlock_bh(&rdev->bss_lock);
- request->scan_start = jiffies;
+ req->scan_start = jiffies;
}
- nl80211_send_sched_scan(request, NL80211_CMD_SCHED_SCAN_RESULTS);
+ nl80211_send_sched_scan(req, NL80211_CMD_SCHED_SCAN_RESULTS);
}
rtnl_unlock();
}
-void cfg80211_sched_scan_results(struct wiphy *wiphy)
+void cfg80211_sched_scan_results(struct wiphy *wiphy, u64 reqid)
{
- trace_cfg80211_sched_scan_results(wiphy);
+ struct cfg80211_sched_scan_request *request;
+
+ trace_cfg80211_sched_scan_results(wiphy, reqid);
/* ignore if we're not scanning */
- if (rcu_access_pointer(wiphy_to_rdev(wiphy)->sched_scan_req))
- queue_work(cfg80211_wq,
- &wiphy_to_rdev(wiphy)->sched_scan_results_wk);
+ request = cfg80211_find_sched_scan_req(wiphy_to_rdev(wiphy), reqid);
+ if (!IS_ERR(request))
+ queue_work(cfg80211_wq, &request->results_wk);
}
EXPORT_SYMBOL(cfg80211_sched_scan_results);
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index 8c04685..cb10ce7 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -2795,14 +2795,23 @@
MAC_PR_ARG(tsf_bssid))
);
-DEFINE_EVENT(wiphy_only_evt, cfg80211_sched_scan_results,
+DEFINE_EVENT(wiphy_only_evt, cfg80211_sched_scan_stopped,
TP_PROTO(struct wiphy *wiphy),
TP_ARGS(wiphy)
);
-DEFINE_EVENT(wiphy_only_evt, cfg80211_sched_scan_stopped,
- TP_PROTO(struct wiphy *wiphy),
- TP_ARGS(wiphy)
+TRACE_EVENT(cfg80211_sched_scan_results,
+ TP_PROTO(struct wiphy *wiphy, u64 id),
+ TP_ARGS(wiphy, id),
+ TP_STRUCT__entry(
+ WIPHY_ENTRY
+ __field(u64, id)
+ ),
+ TP_fast_assign(
+ WIPHY_ASSIGN;
+ __entry->id = id;
+ ),
+ TP_printk(WIPHY_PR_FMT ", id: %llu", WIPHY_PR_ARG, __entry->id)
);
TRACE_EVENT(cfg80211_get_bss,
--
1.9.1
^ permalink raw reply related
* [RFC V2 2/5] nl80211: include request id in scheduled scan event messages
From: Arend van Spriel @ 2017-01-16 11:42 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Arend van Spriel
In-Reply-To: <1484566941-27000-1-git-send-email-arend.vanspriel@broadcom.com>
Include the request id in the event messages so user-space knows
which scan the event relates to.
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
net/wireless/nl80211.c | 23 +++++++++++------------
net/wireless/nl80211.h | 3 +--
net/wireless/scan.c | 5 ++---
3 files changed, 14 insertions(+), 17 deletions(-)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 411774b..f303f6f 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -7249,8 +7249,7 @@ static int nl80211_start_sched_scan(struct sk_buff *skb,
cfg80211_add_sched_scan_req(rdev, sched_scan_req);
- nl80211_send_sched_scan(rdev, dev,
- NL80211_CMD_START_SCHED_SCAN);
+ nl80211_send_sched_scan(sched_scan_req, NL80211_CMD_START_SCHED_SCAN);
return 0;
out_free:
@@ -12932,18 +12931,19 @@ static int nl80211_prep_scan_msg(struct sk_buff *msg,
static int
nl80211_prep_sched_scan_msg(struct sk_buff *msg,
- struct cfg80211_registered_device *rdev,
- struct net_device *netdev,
- u32 portid, u32 seq, int flags, u32 cmd)
+ struct cfg80211_sched_scan_request *req, u32 cmd)
{
void *hdr;
- hdr = nl80211hdr_put(msg, portid, seq, flags, cmd);
+ hdr = nl80211hdr_put(msg, 0, 0, 0, cmd);
if (!hdr)
return -1;
- if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
- nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex))
+ if (nla_put_u32(msg, NL80211_ATTR_WIPHY,
+ wiphy_to_rdev(req->wiphy)->wiphy_idx) ||
+ nla_put_u32(msg, NL80211_ATTR_IFINDEX, req->dev->ifindex) ||
+ nla_put_u64_64bit(msg, NL80211_ATTR_COOKIE, req->reqid,
+ NL80211_ATTR_PAD))
goto nla_put_failure;
genlmsg_end(msg, hdr);
@@ -13003,8 +13003,7 @@ void nl80211_send_scan_msg(struct cfg80211_registered_device *rdev,
NL80211_MCGRP_SCAN, GFP_KERNEL);
}
-void nl80211_send_sched_scan(struct cfg80211_registered_device *rdev,
- struct net_device *netdev, u32 cmd)
+void nl80211_send_sched_scan(struct cfg80211_sched_scan_request *req, u32 cmd)
{
struct sk_buff *msg;
@@ -13012,12 +13011,12 @@ void nl80211_send_sched_scan(struct cfg80211_registered_device *rdev,
if (!msg)
return;
- if (nl80211_prep_sched_scan_msg(msg, rdev, netdev, 0, 0, 0, cmd) < 0) {
+ if (nl80211_prep_sched_scan_msg(msg, req, cmd) < 0) {
nlmsg_free(msg);
return;
}
- genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
+ genlmsg_multicast_netns(&nl80211_fam, wiphy_net(req->wiphy), msg, 0,
NL80211_MCGRP_SCAN, GFP_KERNEL);
}
diff --git a/net/wireless/nl80211.h b/net/wireless/nl80211.h
index e488dca..eb66de6 100644
--- a/net/wireless/nl80211.h
+++ b/net/wireless/nl80211.h
@@ -16,8 +16,7 @@ struct sk_buff *nl80211_build_scan_msg(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev, bool aborted);
void nl80211_send_scan_msg(struct cfg80211_registered_device *rdev,
struct sk_buff *msg);
-void nl80211_send_sched_scan(struct cfg80211_registered_device *rdev,
- struct net_device *netdev, u32 cmd);
+void nl80211_send_sched_scan(struct cfg80211_sched_scan_request *req, u32 cmd);
void nl80211_common_reg_change_event(enum nl80211_commands cmd_id,
struct regulatory_request *request);
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 6704198..f2b2064 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -379,8 +379,7 @@ void __cfg80211_sched_scan_results(struct work_struct *wk)
spin_unlock_bh(&rdev->bss_lock);
request->scan_start = jiffies;
}
- nl80211_send_sched_scan(rdev, request->dev,
- NL80211_CMD_SCHED_SCAN_RESULTS);
+ nl80211_send_sched_scan(request, NL80211_CMD_SCHED_SCAN_RESULTS);
}
rtnl_unlock();
@@ -429,7 +428,7 @@ int cfg80211_stop_sched_scan_req(struct cfg80211_registered_device *rdev,
return err;
}
- nl80211_send_sched_scan(rdev, req->dev, NL80211_CMD_SCHED_SCAN_STOPPED);
+ nl80211_send_sched_scan(req, NL80211_CMD_SCHED_SCAN_STOPPED);
cfg80211_del_sched_scan_req(rdev, req);
--
1.9.1
^ permalink raw reply related
* [RFC V2 5/5] cfg80211: add request id in cfg80211_sched_scan_stopped{,_rtnl}() api
From: Arend van Spriel @ 2017-01-16 11:42 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Arend van Spriel
In-Reply-To: <1484566941-27000-1-git-send-email-arend.vanspriel@broadcom.com>
Allow driver to indicate which scheduled scan request is being aborted
by providing the request id.
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 2 +-
.../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +-
drivers/net/wireless/marvell/mwifiex/cfg80211.c | 6 +++---
drivers/net/wireless/marvell/mwifiex/main.c | 2 +-
drivers/net/wireless/marvell/mwifiex/sta_event.c | 2 +-
drivers/net/wireless/marvell/mwifiex/sta_ioctl.c | 2 +-
include/net/cfg80211.h | 6 ++++--
net/mac80211/pm.c | 2 +-
net/mac80211/scan.c | 2 +-
net/mac80211/util.c | 2 +-
net/wireless/scan.c | 10 +++++-----
net/wireless/trace.h | 17 +++++++++++------
12 files changed, 31 insertions(+), 24 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 1509286..e52aef8 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -170,7 +170,7 @@ static void ath6kl_cfg80211_sscan_disable(struct ath6kl_vif *vif)
if (!stopped)
return;
- cfg80211_sched_scan_stopped(ar->wiphy);
+ cfg80211_sched_scan_stopped(ar->wiphy, 0);
}
static int ath6kl_set_wpa_version(struct ath6kl_vif *vif,
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 34d318e..8c5e54a 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -3359,7 +3359,7 @@ static int brcmf_start_internal_escan(struct brcmf_if *ifp,
goto free_req;
out_err:
- cfg80211_sched_scan_stopped(wiphy);
+ cfg80211_sched_scan_stopped(wiphy, 0);
free_req:
kfree(request);
return err;
diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index 243349476..b5b7741 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -2036,7 +2036,7 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy,
struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
if (!mwifiex_stop_bg_scan(priv))
- cfg80211_sched_scan_stopped_rtnl(priv->wdev.wiphy);
+ cfg80211_sched_scan_stopped_rtnl(priv->wdev.wiphy, 0);
if (mwifiex_deauthenticate(priv, NULL))
return -EFAULT;
@@ -2304,7 +2304,7 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv)
(int)sme->ssid_len, (char *)sme->ssid, sme->bssid);
if (!mwifiex_stop_bg_scan(priv))
- cfg80211_sched_scan_stopped_rtnl(priv->wdev.wiphy);
+ cfg80211_sched_scan_stopped_rtnl(priv->wdev.wiphy, 0);
ret = mwifiex_cfg80211_assoc(priv, sme->ssid_len, sme->ssid, sme->bssid,
priv->bss_mode, sme->channel, sme, 0);
@@ -2513,7 +2513,7 @@ static int mwifiex_set_ibss_params(struct mwifiex_private *priv,
priv->scan_block = false;
if (!mwifiex_stop_bg_scan(priv))
- cfg80211_sched_scan_stopped_rtnl(priv->wdev.wiphy);
+ cfg80211_sched_scan_stopped_rtnl(priv->wdev.wiphy, 0);
user_scan_cfg = kzalloc(sizeof(*user_scan_cfg), GFP_KERNEL);
if (!user_scan_cfg)
diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index e5c3a8a..ff9b767 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -750,7 +750,7 @@ static int mwifiex_init_hw_fw(struct mwifiex_adapter *adapter,
mwifiex_dbg(priv->adapter, INFO,
"aborting bgscan on ndo_stop\n");
mwifiex_stop_bg_scan(priv);
- cfg80211_sched_scan_stopped(priv->wdev.wiphy);
+ cfg80211_sched_scan_stopped(priv->wdev.wiphy, 0);
}
return 0;
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_event.c b/drivers/net/wireless/marvell/mwifiex/sta_event.c
index 9df0c4d..cce61d8 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_event.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_event.c
@@ -793,7 +793,7 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
case EVENT_BG_SCAN_STOPPED:
dev_dbg(adapter->dev, "event: BGS_STOPPED\n");
- cfg80211_sched_scan_stopped(priv->wdev.wiphy);
+ cfg80211_sched_scan_stopped(priv->wdev.wiphy, 0);
if (priv->sched_scanning)
priv->sched_scanning = false;
break;
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
index 644f3a2..d9a9e25 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
@@ -560,7 +560,7 @@ int mwifiex_enable_hs(struct mwifiex_adapter *adapter)
#endif
mwifiex_dbg(adapter, CMD, "aborting bgscan!\n");
mwifiex_stop_bg_scan(priv);
- cfg80211_sched_scan_stopped(priv->wdev.wiphy);
+ cfg80211_sched_scan_stopped(priv->wdev.wiphy, 0);
#ifdef CONFIG_PM
}
#endif
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 8a635e0..fc3f0b2 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4464,24 +4464,26 @@ void cfg80211_scan_done(struct cfg80211_scan_request *request,
* cfg80211_sched_scan_stopped - notify that the scheduled scan has stopped
*
* @wiphy: the wiphy on which the scheduled scan stopped
+ * @reqid: identifier for the related scheduled scan request
*
* The driver can call this function to inform cfg80211 that the
* scheduled scan had to be stopped, for whatever reason. The driver
* is then called back via the sched_scan_stop operation when done.
*/
-void cfg80211_sched_scan_stopped(struct wiphy *wiphy);
+void cfg80211_sched_scan_stopped(struct wiphy *wiphy, u64 reqid);
/**
* cfg80211_sched_scan_stopped_rtnl - notify that the scheduled scan has stopped
*
* @wiphy: the wiphy on which the scheduled scan stopped
+ * @reqid: identifier for the related scheduled scan request
*
* The driver can call this function to inform cfg80211 that the
* scheduled scan had to be stopped, for whatever reason. The driver
* is then called back via the sched_scan_stop operation when done.
* This function should be called with rtnl locked.
*/
-void cfg80211_sched_scan_stopped_rtnl(struct wiphy *wiphy);
+void cfg80211_sched_scan_stopped_rtnl(struct wiphy *wiphy, u64 reqid);
/**
* cfg80211_inform_bss_frame_data - inform cfg80211 of a received BSS frame
diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c
index 28a3a09..d37de3f 100644
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
@@ -10,7 +10,7 @@ static void ieee80211_sched_scan_cancel(struct ieee80211_local *local)
{
if (ieee80211_request_sched_scan_stop(local))
return;
- cfg80211_sched_scan_stopped_rtnl(local->hw.wiphy);
+ cfg80211_sched_scan_stopped_rtnl(local->hw.wiphy, 0);
}
int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 3fd8757..94be10e 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -1239,7 +1239,7 @@ void ieee80211_sched_scan_end(struct ieee80211_local *local)
mutex_unlock(&local->mtx);
- cfg80211_sched_scan_stopped(local->hw.wiphy);
+ cfg80211_sched_scan_stopped(local->hw.wiphy, 0);
}
void ieee80211_sched_scan_stopped_work(struct work_struct *work)
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index ac59fbd..616d55d 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -2103,7 +2103,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
mutex_unlock(&local->mtx);
if (sched_scan_stopped)
- cfg80211_sched_scan_stopped_rtnl(local->hw.wiphy);
+ cfg80211_sched_scan_stopped_rtnl(local->hw.wiphy, 0);
wake_up:
if (local->in_reconfig) {
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 5f24c13..22bb9fd 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -396,22 +396,22 @@ void cfg80211_sched_scan_results(struct wiphy *wiphy, u64 reqid)
}
EXPORT_SYMBOL(cfg80211_sched_scan_results);
-void cfg80211_sched_scan_stopped_rtnl(struct wiphy *wiphy)
+void cfg80211_sched_scan_stopped_rtnl(struct wiphy *wiphy, u64 reqid)
{
struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
ASSERT_RTNL();
- trace_cfg80211_sched_scan_stopped(wiphy);
+ trace_cfg80211_sched_scan_stopped(wiphy, reqid);
- __cfg80211_stop_sched_scan(rdev, 0, true);
+ __cfg80211_stop_sched_scan(rdev, reqid, true);
}
EXPORT_SYMBOL(cfg80211_sched_scan_stopped_rtnl);
-void cfg80211_sched_scan_stopped(struct wiphy *wiphy)
+void cfg80211_sched_scan_stopped(struct wiphy *wiphy, u64 reqid)
{
rtnl_lock();
- cfg80211_sched_scan_stopped_rtnl(wiphy);
+ cfg80211_sched_scan_stopped_rtnl(wiphy, reqid);
rtnl_unlock();
}
EXPORT_SYMBOL(cfg80211_sched_scan_stopped);
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index cb10ce7..7d03a0f 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -2795,12 +2795,7 @@
MAC_PR_ARG(tsf_bssid))
);
-DEFINE_EVENT(wiphy_only_evt, cfg80211_sched_scan_stopped,
- TP_PROTO(struct wiphy *wiphy),
- TP_ARGS(wiphy)
-);
-
-TRACE_EVENT(cfg80211_sched_scan_results,
+DECLARE_EVENT_CLASS(wiphy_id_evt,
TP_PROTO(struct wiphy *wiphy, u64 id),
TP_ARGS(wiphy, id),
TP_STRUCT__entry(
@@ -2814,6 +2809,16 @@
TP_printk(WIPHY_PR_FMT ", id: %llu", WIPHY_PR_ARG, __entry->id)
);
+DEFINE_EVENT(wiphy_id_evt, cfg80211_sched_scan_stopped,
+ TP_PROTO(struct wiphy *wiphy, u64 id),
+ TP_ARGS(wiphy, id)
+);
+
+DEFINE_EVENT(wiphy_id_evt, cfg80211_sched_scan_results,
+ TP_PROTO(struct wiphy *wiphy, u64 id),
+ TP_ARGS(wiphy, id)
+);
+
TRACE_EVENT(cfg80211_get_bss,
TP_PROTO(struct wiphy *wiphy, struct ieee80211_channel *channel,
const u8 *bssid, const u8 *ssid, size_t ssid_len,
--
1.9.1
^ permalink raw reply related
* [RFC V2 3/5] cfg80211: add request id parameter to .sched_scan_stop() signature
From: Arend van Spriel @ 2017-01-16 11:42 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Arend van Spriel
In-Reply-To: <1484566941-27000-1-git-send-email-arend.vanspriel@broadcom.com>
For multiple scheduled scan support the driver needs to know which
scheduled scan request is being stopped. Pass the request id in the
.sched_scan_stop() callback.
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 2 +-
.../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 6 +++---
drivers/net/wireless/marvell/mwifiex/cfg80211.c | 2 +-
include/net/cfg80211.h | 15 ++++++++-------
net/mac80211/cfg.c | 3 ++-
net/wireless/rdev-ops.h | 6 +++---
net/wireless/scan.c | 2 +-
net/wireless/trace.h | 10 +++++-----
8 files changed, 24 insertions(+), 22 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index b7fe0af..1509286 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -3354,7 +3354,7 @@ static int ath6kl_cfg80211_sscan_start(struct wiphy *wiphy,
}
static int ath6kl_cfg80211_sscan_stop(struct wiphy *wiphy,
- struct net_device *dev)
+ struct net_device *dev, u64 reqid)
{
struct ath6kl_vif *vif = netdev_priv(dev);
bool stopped;
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index ccae3bb..8280f19 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -3392,7 +3392,7 @@ static int brcmf_start_internal_escan(struct brcmf_if *ifp,
}
static int brcmf_cfg80211_sched_scan_stop(struct wiphy *wiphy,
- struct net_device *ndev)
+ struct net_device *ndev, u64 reqid)
{
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
struct brcmf_if *ifp = netdev_priv(ndev);
@@ -3595,7 +3595,7 @@ static s32 brcmf_cfg80211_resume(struct wiphy *wiphy)
cfg->wowl.pre_pmmode);
cfg->wowl.active = false;
if (cfg->wowl.nd_enabled) {
- brcmf_cfg80211_sched_scan_stop(cfg->wiphy, ifp->ndev);
+ brcmf_cfg80211_sched_scan_stop(cfg->wiphy, ifp->ndev, 0);
brcmf_fweh_unregister(cfg->pub, BRCMF_E_PFN_NET_FOUND);
brcmf_fweh_register(cfg->pub, BRCMF_E_PFN_NET_FOUND,
brcmf_notify_sched_scan_results);
@@ -3679,7 +3679,7 @@ static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy,
/* Stop scheduled scan */
if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_PNO))
- brcmf_cfg80211_sched_scan_stop(wiphy, ndev);
+ brcmf_cfg80211_sched_scan_stop(wiphy, ndev, 0);
/* end any scanning */
if (test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status))
diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index 1e3bd43..243349476 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -2701,7 +2701,7 @@ static int mwifiex_set_ibss_params(struct mwifiex_private *priv,
* previous bgscan configuration in the firmware
*/
static int mwifiex_cfg80211_sched_scan_stop(struct wiphy *wiphy,
- struct net_device *dev)
+ struct net_device *dev, u64 reqid)
{
struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 4b98ff8..0a65cfe 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2709,12 +2709,12 @@ struct cfg80211_nan_func {
* @set_cqm_txe_config: Configure connection quality monitor TX error
* thresholds.
* @sched_scan_start: Tell the driver to start a scheduled scan.
- * @sched_scan_stop: Tell the driver to stop an ongoing scheduled scan. This
- * call must stop the scheduled scan and be ready for starting a new one
- * before it returns, i.e. @sched_scan_start may be called immediately
- * after that again and should not fail in that case. The driver should
- * not call cfg80211_sched_scan_stopped() for a requested stop (when this
- * method returns 0.)
+ * @sched_scan_stop: Tell the driver to stop an ongoing scheduled scan with
+ * given request id. This call must stop the scheduled scan and be ready
+ * for starting a new one before it returns, i.e. @sched_scan_start may be
+ * called immediately after that again and should not fail in that case.
+ * The driver should not call cfg80211_sched_scan_stopped() for a requested
+ * stop (when this method returns 0).
*
* @mgmt_frame_register: Notify driver that a management frame type was
* registered. The callback is allowed to sleep.
@@ -3009,7 +3009,8 @@ struct cfg80211_ops {
int (*sched_scan_start)(struct wiphy *wiphy,
struct net_device *dev,
struct cfg80211_sched_scan_request *request);
- int (*sched_scan_stop)(struct wiphy *wiphy, struct net_device *dev);
+ int (*sched_scan_stop)(struct wiphy *wiphy, struct net_device *dev,
+ u64 reqid);
int (*set_rekey_data)(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_gtk_rekey_data *data);
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index a0be2f6..85748d0 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2198,7 +2198,8 @@ static void ieee80211_abort_scan(struct wiphy *wiphy, struct wireless_dev *wdev)
}
static int
-ieee80211_sched_scan_stop(struct wiphy *wiphy, struct net_device *dev)
+ieee80211_sched_scan_stop(struct wiphy *wiphy, struct net_device *dev,
+ u64 reqid)
{
struct ieee80211_local *local = wiphy_priv(wiphy);
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index 9ada5e2..9da0701 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -809,11 +809,11 @@ static inline int rdev_get_antenna(struct cfg80211_registered_device *rdev,
}
static inline int rdev_sched_scan_stop(struct cfg80211_registered_device *rdev,
- struct net_device *dev)
+ struct net_device *dev, u64 reqid)
{
int ret;
- trace_rdev_sched_scan_stop(&rdev->wiphy, dev);
- ret = rdev->ops->sched_scan_stop(&rdev->wiphy, dev);
+ trace_rdev_sched_scan_stop(&rdev->wiphy, dev, reqid);
+ ret = rdev->ops->sched_scan_stop(&rdev->wiphy, dev, reqid);
trace_rdev_return_int(&rdev->wiphy, ret);
return ret;
}
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index f2b2064..04615338 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -423,7 +423,7 @@ int cfg80211_stop_sched_scan_req(struct cfg80211_registered_device *rdev,
ASSERT_RTNL();
if (!driver_initiated) {
- int err = rdev_sched_scan_stop(rdev, req->dev);
+ int err = rdev_sched_scan_stop(rdev, req->dev, req->reqid);
if (err)
return err;
}
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index 7990c07..8c04685 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -576,11 +576,6 @@
TP_ARGS(wiphy, netdev)
);
-DEFINE_EVENT(wiphy_netdev_evt, rdev_sched_scan_stop,
- TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
- TP_ARGS(wiphy, netdev)
-);
-
DEFINE_EVENT(wiphy_netdev_evt, rdev_set_rekey_data,
TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
TP_ARGS(wiphy, netdev)
@@ -1610,6 +1605,11 @@
TP_ARGS(wiphy, netdev, id)
);
+DEFINE_EVENT(wiphy_netdev_id_evt, rdev_sched_scan_stop,
+ TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u64 id),
+ TP_ARGS(wiphy, netdev, id)
+);
+
TRACE_EVENT(rdev_tdls_mgmt,
TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
u8 *peer, u8 action_code, u8 dialog_token,
--
1.9.1
^ permalink raw reply related
* [RFC V2 0/5] cfg80211: support multiple scheduled scans
From: Arend van Spriel @ 2017-01-16 11:42 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Arend van Spriel
After sending out the initial RFC for multiple scheduled scan support [1]
here a series that deal with it all (I hope) so including events and the
driver function call apis. Resending it due to build issue and it was based
on old mac80211-next master revision.
*Now* it does apply to the master branch of the mac80211-next repository.
Arend van Spriel (5):
nl80211: allow multiple active scheduled scan requests
nl80211: include request id in scheduled scan event messages
cfg80211: add request id parameter to .sched_scan_stop() signature
cfg80211: add request id to cfg80211_sched_scan_results() api
cfg80211: add request id in cfg80211_sched_scan_stopped{,_rtnl}() api
drivers/net/wireless/ath/ath6kl/cfg80211.c | 4 +-
drivers/net/wireless/ath/ath6kl/wmi.c | 2 +-
.../broadcom/brcm80211/brcmfmac/cfg80211.c | 10 +-
drivers/net/wireless/marvell/mwifiex/cfg80211.c | 8 +-
drivers/net/wireless/marvell/mwifiex/main.c | 2 +-
drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c | 2 +-
drivers/net/wireless/marvell/mwifiex/sta_event.c | 2 +-
drivers/net/wireless/marvell/mwifiex/sta_ioctl.c | 2 +-
include/net/cfg80211.h | 32 +++--
include/uapi/linux/nl80211.h | 12 +-
net/mac80211/cfg.c | 3 +-
net/mac80211/pm.c | 2 +-
net/mac80211/scan.c | 4 +-
net/mac80211/util.c | 2 +-
net/wireless/core.c | 31 +++--
net/wireless/core.h | 11 +-
net/wireless/nl80211.c | 62 +++++++---
net/wireless/nl80211.h | 3 +-
net/wireless/rdev-ops.h | 8 +-
net/wireless/scan.c | 135 +++++++++++++++------
net/wireless/trace.h | 54 ++++++---
21 files changed, 271 insertions(+), 120 deletions(-)
--
1.9.1
^ permalink raw reply
* Re: Searching new home for ath[59]k-devel mailing lists
From: Michael Renzmann @ 2017-01-16 12:15 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless
In-Reply-To: <49460.217.24.3.26.1484376491.squirrel@webmail.madwifi-project.org>
Hi Kalle, hi all.
Michael Renzmann wrote:
> Someone should also update the "Mailing list" section of [1] accordingly.
> I guess one needs to have a valid user account for that to do, and I don't
> have one atm.
I now have an account, but am not sure how to proceed.
ath5k-devel is referenced on the ath5k driver page, and ath9k-devel is
referenced by the driver pages of ath9k and ath9k_htc. All three pages
have a section "Mailing list", that pages of other drivers (without
dedicated lists) don't seem to have.
Two options come to my mind:
1. Entirely remove the section "Mailing list".
2. Edit the section; point interested developers to the linux-wireless
list for future discussion, and also reference the list archives of the
old list for those who are interested in what was discussed in the past.
Opinions or other suggestions, anyone?
Bye, Mike
^ permalink raw reply
* Re: Support of rtl8723bs
From: Hanno Zulla @ 2017-01-16 13:09 UTC (permalink / raw)
To: Jes Sorensen, Bastien Nocera; +Cc: Larry Finger, anthony.wong, linux-wireless
In-Reply-To: <wrfj4m5lhzja.fsf@redhat.com>
Hi,
has there been any progress on the rtl8723bs / sdio issue?
There were no updates to this mailing list or the usual git repositories
since this was last discussed, unless I missed the proper place to look
for this.
I'm sorry that I can't be more helpful with actual development, but am
eager to help with testing this device.
Thank you,
Hanno
^ permalink raw reply
* Re: Support of rtl8723bs
From: Jes Sorensen @ 2017-01-16 13:25 UTC (permalink / raw)
To: Hanno Zulla; +Cc: Bastien Nocera, Larry Finger, anthony.wong, linux-wireless
In-Reply-To: <5ff75d7f-3017-1028-eacb-57e37f2c03c1@hanno.de>
Hanno Zulla <abos@hanno.de> writes:
> Hi,
>
> has there been any progress on the rtl8723bs / sdio issue?
>
> There were no updates to this mailing list or the usual git repositories
> since this was last discussed, unless I missed the proper place to look
> for this.
>
> I'm sorry that I can't be more helpful with actual development, but am
> eager to help with testing this device.
>
> Thank you,
> Hanno
Hanno,
The 8723bs project is currently in idle mode, I haven't had time to
spend time on it for the last couple of months.
Cheers,
Jes
^ permalink raw reply
* Re: Searching new home for ath[59]k-devel mailing lists
From: Kalle Valo @ 2017-01-16 13:49 UTC (permalink / raw)
To: Michael Renzmann; +Cc: linux-wireless
In-Reply-To: <49712.217.24.3.26.1484568941.squirrel@webmail.madwifi-project.org>
Hi Michael,
"Michael Renzmann" <mrenzmann@madwifi-project.org> writes:
> Michael Renzmann wrote:
>> Someone should also update the "Mailing list" section of [1] accordingly.
>> I guess one needs to have a valid user account for that to do, and I don't
>> have one atm.
>
> I now have an account, but am not sure how to proceed.
>
> ath5k-devel is referenced on the ath5k driver page, and ath9k-devel is
> referenced by the driver pages of ath9k and ath9k_htc. All three pages
> have a section "Mailing list", that pages of other drivers (without
> dedicated lists) don't seem to have.
>
> Two options come to my mind:
>
> 1. Entirely remove the section "Mailing list".
>
> 2. Edit the section; point interested developers to the linux-wireless
> list for future discussion, and also reference the list archives of the
> old list for those who are interested in what was discussed in the past.
>
> Opinions or other suggestions, anyone?
I would go for option 2, not everyone know about linux-wireless mailing
list so better to document that properly in the wiki.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH] ath10k: Search SMBIOS for OEM board file extension
From: Waldemar Rymarkiewicz @ 2017-01-16 14:58 UTC (permalink / raw)
To: kbuild test robot
Cc: kbuild-all, Valo, Kalle, ath10k, Bartosz Markowski, Chang, Robert,
Liu, Alan, linux-wireless
In-Reply-To: <201701150241.yCa5lXiT%fengguang.wu@intel.com>
On 14 January 2017 at 19:09, kbuild test robot <lkp@intel.com> wrote:
> Hi Waldemar,
>
> [auto build test WARNING on ath6kl/ath-next]
> [also build test WARNING on v4.10-rc3 next-20170113]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>
> url: https://github.com/0day-ci/linux/commits/Waldemar-Rymarkiewicz/ath10k-Search-SMBIOS-for-OEM-board-file-extension/20170115-005232
> base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath-next
> config: xtensa-allmodconfig (attached as .config)
> compiler: xtensa-linux-gcc (GCC) 4.9.0
> reproduce:
> wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> make.cross ARCH=xtensa
>
> All warnings (new ones prefixed by >>):
>
> drivers/net/wireless/ath/ath10k/core.c: In function 'ath10k_core_check_bdfext':
>>> drivers/net/wireless/ath/ath10k/core.c:754:2: warning: ignoring return value of 'strscpy', declared with attribute warn_unused_result [-Wunused-result]
> strscpy(ar->id.bdf_ext, bdf_ext + strlen(magic),
> ^
I will fix and send v2.
Thanks,
/Waldek
^ permalink raw reply
* ANNOUNCE: Netdev 2.1 Call For Proposals Opened!
From: Jamal Hadi Salim @ 2017-01-16 15:00 UTC (permalink / raw)
To: netdev
Cc: netfilter-devel, netfilter, info, linux-wireless, tech-committee,
David Miller, Stephen Jaworski, Rob Echlin, lwn,
info@netdev01.org, tech-committee
Folks,
We are pleased to announce that the CFP for netdev 2.1 is now open.
Netdev 2.1 is a community-driven conference geared towards Linux
netheads. Linux kernel networking and user space utilization of the
interfaces to the Linux kernel networking subsystem are the focus.
If you are using Linux as a boot system for proprietary networking, then
this conference _may not be for you_.
Netdev2.1 will be held in Montreal April 6-8
For more details visit: www.netdevconf.org
Netdev 2.1 has a theme: IOT networking and DDOS.
Submissions in that area are highly encouraged.
Current topics include:
IOT networking.
DDOS.
Wireless.
Performance analysis and improvement.
Networking hardware and offload.
Netfilter.
Traffic control.
Different networking layers (L2/3, etc.).
Security.
Additional topics can be suggested.
Session submissions
--------------------
We encourage submission of paper and tutorial proposals, though we
*highly highly discourage* submission of recycled talks. Your proposals
will be evaluated by the technical committee that will provide prompt
feedback to you. If your proposal is approved, you will be requested to
submit your Camera-ready paper.
Unlike other conferences where only the schedule is announced,
proposals will be regularly announced as they get accepted on our
website and on relevant lists and twitter.
Please stay within the relevant topic focus and tie to FOSS Linux
networking to make it easier for the technical committee to provide
quick feedback. In order to give a talk you must be registered.
If your proposal is accepted you will not be charged a conference fee
or your conference fee will be refunded to you when your talk gets
accepted.
Types of proposals
-------------------
1. BoF
This serves to carry out initial discussions on some topic without any
pre-planned agenda. At least one person is responsible for introducing
the topic, chairing and moderating it. You have to list a few people
that will be planning to participate in the discussion. Expect people
from the public to participate actively in the discussions.
The lifetime of a BOF may be only one or two Netdev conference
gatherings. We discourage perpetual BOFs. BoFs don't need to have an
existing networking subsystem or mailing list. BOFs also don't need to
strive to be upgraded to be a Workshop in the future. Their longevity
could only be one conference. The sitting format could vary and be
either lecture or round table format depending on the proposal.
2. Talk
At least one person (of possibly multiple authors) is responsible for
the presentation. Details proposal/development plans to the public for
45 minutes.
A paper submission of the talk is expected (please use the provided
template). The paper has to be a minimum of two pages and not to exceed
10 pages (not including the references).
3. Tutorial
This implies planned agenda too.
Introduces audience to a topic.
Includes practical examples on using the functionality.
Functionality should already be in mainline or at least have been posted
already.
4. Workshops
Workshops are centered around existing networking subsystems.
Workshops are intended to be an extension of the mailing list in the
sense that many times previous discussions from the mailing list (or
that could otherwise have happened there) are taken to the round-table
to simplify the decision-making process.
The networking subsystem maintainer(s) should at least prepare a
list of agenda items well before the workshop takes place to allow
participants to come prepared; this makes the discussions most
productive.
Sometimes brain-storming sessions will also be appropriate where
being prepared is less important, for example for discussions
around new user requirements this can be very valuable.
At the workshop meeting itself discussions prevail and notes are
later sent back to the mailing list; presentations are typically
- at the discretion of the chairs - only used where needed to
clarify a problem statement for discussion.
Submiting Proposals
-------------------
Your proposal must be sent to tech-committee@netdevconf.org before
February 20, 2017 with the following format:
Title: Title of the proposal
Type: BoF, Talk, Tutorial.
Description: (350 words max).
Submitter names:
Estimated time: (talk = 45 minutes max., tutorial = 90 minutes max.).
Once your proposal is accepted, please prepare your paper based on the
conference template (odt or latex).
How to submit your paper
------------------------
Once your proposal is accepted and you have been invited to submit a
paper, please send the paper to both info@netdevconf.org and
tech-committee@netdevconf.org.
Deadlines
---------
February 20, 2017 Call for proposals close
Paper submission for review March 27, 2017
Slides submission April 3, 2017
How to submit your slides
-------------------------
If your slides of your talk are ready, please send the PDF to:
info@netdevconf.org.
cheers,
jamal
^ permalink raw reply
* [PATCH] ath10k: dump Copy Engine registers during firmware crash
From: Kalle Valo @ 2017-01-16 15:31 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
From: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
Dump Copy Engine source and destination ring addresses.
This is useful information to debug firmware crashes, assertes or hangs over long run
assessing the Copy Engine Register status. This also enables dumping CE
register status in debugfs Crash Dump file.
Screenshot:
ath10k_pci 0000:02:00.0: simulating hard firmware crash
ath10k_pci 0000:02:00.0: firmware crashed! (uuid 84901ff5-d33c-456e-93ee-0165dea643cf)
ath10k_pci 0000:02:00.0: qca988x hw2.0 target 0x4100016c chip_id 0x043202ff sub 0000:0000
ath10k_pci 0000:02:00.0: kconfig debug 1 debugfs 1 tracing 1 dfs 1 testmode 1
ath10k_pci 0000:02:00.0: firmware ver 10.2.4.70.59-2 api 5 features no-p2p,raw-mode,mfp,allows-mesh-bcast crc32 4159f498
ath10k_pci 0000:02:00.0: board_file api 1 bmi_id N/A crc32 bebc7c08
ath10k_pci 0000:02:00.0: htt-ver 2.1 wmi-op 5 htt-op 2 cal otp max-sta 128 raw 0 hwcrypto 1
ath10k_pci 0000:02:00.0: firmware register dump:
ath10k_pci 0000:02:00.0: [00]: 0x4100016C 0x00000000 0x009A0F2A 0x00000000
ath10k_pci 0000:02:00.0: [04]: 0x00000000 0x00000000 0x00000000 0x00000000
ath10k_pci 0000:02:00.0: [08]: 0x00000000 0x00000000 0x00000000 0x00000000
ath10k_pci 0000:02:00.0: [12]: 0x00000000 0x00000000 0x00000000 0x00000000
ath10k_pci 0000:02:00.0: [16]: 0x00000000 0x00000000 0x00000000 0x009A0F2A
ath10k_pci 0000:02:00.0: [20]: 0x00000000 0x00401930 0x00000000 0x00000000
ath10k_pci 0000:02:00.0: [24]: 0x00000000 0x00000000 0x00000000 0x00000000
ath10k_pci 0000:02:00.0: [28]: 0x00000000 0x00000000 0x00000000 0x00000000
ath10k_pci 0000:02:00.0: [32]: 0x00000000 0x00000000 0x00000000 0x00000000
ath10k_pci 0000:02:00.0: [36]: 0x00000000 0x00000000 0x00000000 0x00000000
ath10k_pci 0000:02:00.0: [40]: 0x00000000 0x00000000 0x00000000 0x00000000
ath10k_pci 0000:02:00.0: [44]: 0x00000000 0x00000000 0x00000000 0x00000000
ath10k_pci 0000:02:00.0: [48]: 0x00000000 0x00000000 0x00000000 0x00000000
ath10k_pci 0000:02:00.0: [52]: 0x00000000 0x00000000 0x00000000 0x00000000
ath10k_pci 0000:02:00.0: [56]: 0x00000000 0x00000000 0x00000000 0x00000000
ath10k_pci 0000:02:00.0: Copy Engine register dump:
ath10k_pci 0000:02:00.0: [00]: 0x00057400 7 7 3 3
ath10k_pci 0000:02:00.0: [01]: 0x00057800 18 18 85 86
ath10k_pci 0000:02:00.0: [02]: 0x00057c00 49 49 48 49
ath10k_pci 0000:02:00.0: [03]: 0x00058000 16 16 17 16
ath10k_pci 0000:02:00.0: [04]: 0x00058400 4 4 44 4
ath10k_pci 0000:02:00.0: [05]: 0x00058800 12 12 11 12
ath10k_pci 0000:02:00.0: [06]: 0x00058c00 3 3 3 3
ath10k_pci 0000:02:00.0: [07]: 0x00059000 0 0 0 0
ieee80211 phy0: Hardware restart was requested
ath10k_pci 0000:02:00.0: device successfully recovered
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
[kvalo@qca.qualcomm.com: simplify the implementation]
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/ce.c | 39 +++++++++++++++++++++++++++++++
drivers/net/wireless/ath/ath10k/ce.h | 4 ++-
drivers/net/wireless/ath/ath10k/core.h | 16 +++++++++++++
drivers/net/wireless/ath/ath10k/debug.c | 16 +++++++++++++
drivers/net/wireless/ath/ath10k/hw.h | 3 ++
drivers/net/wireless/ath/ath10k/pci.c | 1 +
6 files changed, 77 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c
index 0b4d79659884..c04e68796a20 100644
--- a/drivers/net/wireless/ath/ath10k/ce.c
+++ b/drivers/net/wireless/ath/ath10k/ce.c
@@ -1130,3 +1130,42 @@ void ath10k_ce_free_pipe(struct ath10k *ar, int ce_id)
ce_state->src_ring = NULL;
ce_state->dest_ring = NULL;
}
+
+void ath10k_ce_dump_registers(struct ath10k *ar,
+ struct ath10k_fw_crash_data *crash_data)
+{
+ struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
+ struct ath10k_ce_crash_data ce;
+ u32 addr, id;
+
+ lockdep_assert_held(&ar->data_lock);
+
+ ath10k_err(ar, "Copy Engine register dump:\n");
+
+ spin_lock_bh(&ar_pci->ce_lock);
+ for (id = 0; id < CE_COUNT; id++) {
+ addr = ath10k_ce_base_address(ar, id);
+ ce.base_addr = cpu_to_le32(addr);
+
+ ce.src_wr_idx =
+ cpu_to_le32(ath10k_ce_src_ring_write_index_get(ar, addr));
+ ce.src_r_idx =
+ cpu_to_le32(ath10k_ce_src_ring_read_index_get(ar, addr));
+ ce.dst_wr_idx =
+ cpu_to_le32(ath10k_ce_dest_ring_write_index_get(ar, addr));
+ ce.dst_r_idx =
+ cpu_to_le32(ath10k_ce_dest_ring_read_index_get(ar, addr));
+
+ if (crash_data)
+ crash_data->ce_crash_data[id] = ce;
+
+ ath10k_err(ar, "[%02d]: 0x%08x %3u %3u %3u %3u", id,
+ le32_to_cpu(ce.base_addr),
+ le32_to_cpu(ce.src_wr_idx),
+ le32_to_cpu(ce.src_r_idx),
+ le32_to_cpu(ce.dst_wr_idx),
+ le32_to_cpu(ce.dst_r_idx));
+ }
+
+ spin_unlock_bh(&ar_pci->ce_lock);
+}
diff --git a/drivers/net/wireless/ath/ath10k/ce.h b/drivers/net/wireless/ath/ath10k/ce.h
index dfc098606bee..e76a98242b98 100644
--- a/drivers/net/wireless/ath/ath10k/ce.h
+++ b/drivers/net/wireless/ath/ath10k/ce.h
@@ -20,8 +20,6 @@
#include "hif.h"
-/* Maximum number of Copy Engine's supported */
-#define CE_COUNT_MAX 12
#define CE_HTT_H2T_MSG_SRC_NENTRIES 8192
/* Descriptor rings must be aligned to this boundary */
@@ -228,6 +226,8 @@ void ath10k_ce_per_engine_service_any(struct ath10k *ar);
void ath10k_ce_per_engine_service(struct ath10k *ar, unsigned int ce_id);
int ath10k_ce_disable_interrupts(struct ath10k *ar);
void ath10k_ce_enable_interrupts(struct ath10k *ar);
+void ath10k_ce_dump_registers(struct ath10k *ar,
+ struct ath10k_fw_crash_data *crash_data);
/* ce_attr.flags values */
/* Use NonSnooping PCIe accesses? */
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index c7664d6569fa..7a6fcea760f0 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -419,6 +419,21 @@ struct ath10k_vif_iter {
struct ath10k_vif *arvif;
};
+/* Copy Engine register dump, protected by ce-lock */
+struct ath10k_ce_crash_data {
+ __le32 base_addr;
+ __le32 src_wr_idx;
+ __le32 src_r_idx;
+ __le32 dst_wr_idx;
+ __le32 dst_r_idx;
+};
+
+struct ath10k_ce_crash_hdr {
+ __le32 ce_count;
+ __le32 reserved[3]; /* for future use */
+ struct ath10k_ce_crash_data entries[];
+};
+
/* used for crash-dump storage, protected by data-lock */
struct ath10k_fw_crash_data {
bool crashed_since_read;
@@ -426,6 +441,7 @@ struct ath10k_fw_crash_data {
uuid_le uuid;
struct timespec timestamp;
__le32 registers[REG_DUMP_COUNT_QCA988X];
+ struct ath10k_ce_crash_data ce_crash_data[CE_COUNT_MAX];
};
struct ath10k_debug {
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index b882b0892dcf..d5ff0f4ef5ce 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -41,6 +41,7 @@
*/
enum ath10k_fw_crash_dump_type {
ATH10K_FW_CRASH_DUMP_REGISTERS = 0,
+ ATH10K_FW_CRASH_DUMP_CE_DATA = 1,
ATH10K_FW_CRASH_DUMP_MAX,
};
@@ -729,6 +730,7 @@ static struct ath10k_dump_file_data *ath10k_build_dump_file(struct ath10k *ar,
bool mark_read)
{
struct ath10k_fw_crash_data *crash_data = ar->debug.fw_crash_data;
+ struct ath10k_ce_crash_hdr *ce_hdr;
struct ath10k_dump_file_data *dump_data;
struct ath10k_tlv_dump_data *dump_tlv;
int hdr_len = sizeof(*dump_data);
@@ -737,6 +739,8 @@ static struct ath10k_dump_file_data *ath10k_build_dump_file(struct ath10k *ar,
len = hdr_len;
len += sizeof(*dump_tlv) + sizeof(crash_data->registers);
+ len += sizeof(*dump_tlv) + sizeof(*ce_hdr) +
+ CE_COUNT * sizeof(ce_hdr->entries[0]);
sofar += hdr_len;
@@ -795,6 +799,18 @@ static struct ath10k_dump_file_data *ath10k_build_dump_file(struct ath10k *ar,
sizeof(crash_data->registers));
sofar += sizeof(*dump_tlv) + sizeof(crash_data->registers);
+ dump_tlv = (struct ath10k_tlv_dump_data *)(buf + sofar);
+ dump_tlv->type = cpu_to_le32(ATH10K_FW_CRASH_DUMP_CE_DATA);
+ dump_tlv->tlv_len = cpu_to_le32(sizeof(*ce_hdr) +
+ CE_COUNT * sizeof(ce_hdr->entries[0]));
+ ce_hdr = (struct ath10k_ce_crash_hdr *)(dump_tlv->tlv_data);
+ ce_hdr->ce_count = cpu_to_le32(CE_COUNT);
+ memset(ce_hdr->reserved, 0, sizeof(ce_hdr->reserved));
+ memcpy(ce_hdr->entries, crash_data->ce_crash_data,
+ CE_COUNT * sizeof(ce_hdr->entries[0]));
+ sofar += sizeof(*dump_tlv) + sizeof(*ce_hdr) +
+ CE_COUNT * sizeof(ce_hdr->entries[0]);
+
ar->debug.fw_crash_data->crashed_since_read = !mark_read;
spin_unlock_bh(&ar->data_lock);
diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h
index 7feffec531cc..38aa7c95732e 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -578,6 +578,9 @@ ath10k_rx_desc_get_l3_pad_bytes(struct ath10k_hw_params *hw,
#define TARGET_10_4_IPHDR_PAD_CONFIG 1
#define TARGET_10_4_QWRAP_CONFIG 0
+/* Maximum number of Copy Engine's supported */
+#define CE_COUNT_MAX 12
+
/* Number of Copy Engines supported */
#define CE_COUNT ar->hw_values->ce_count
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 93b9790cfe8d..95ccd6db7623 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -1474,6 +1474,7 @@ static void ath10k_pci_fw_crashed_dump(struct ath10k *ar)
ath10k_err(ar, "firmware crashed! (uuid %s)\n", uuid);
ath10k_print_driver_info(ar);
ath10k_pci_dump_registers(ar, crash_data);
+ ath10k_ce_dump_registers(ar, crash_data);
spin_unlock_bh(&ar->data_lock);
^ permalink raw reply related
* [PATCH V2] mtd: bcm47xxsflash: use platform_(set|get)_drvdata
From: Rafał Miłecki @ 2017-01-16 16:28 UTC (permalink / raw)
To: David Woodhouse, Brian Norris, Boris Brezillon, Marek Vasut,
Richard Weinberger, Cyrille Pitchen, Kalle Valo
Cc: linux-mtd, linux-wireless, Hauke Mehrtens,
Rafał Miłecki
From: Rafał Miłecki <rafal@milecki.pl>
We have generic place & helpers for storing platform driver data so
there is no reason for using custom priv pointer.
This allows cleaning up struct bcma_sflash from unneeded fields.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
Kalle: This is mtd focused patch, so I guess it should go through mtd tree. Do
you find bcma change important enough to care to Ack it? :)
---
drivers/mtd/devices/bcm47xxsflash.c | 6 +++---
include/linux/bcma/bcma_driver_chipcommon.h | 3 ---
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/mtd/devices/bcm47xxsflash.c b/drivers/mtd/devices/bcm47xxsflash.c
index 514be04..4decd8c 100644
--- a/drivers/mtd/devices/bcm47xxsflash.c
+++ b/drivers/mtd/devices/bcm47xxsflash.c
@@ -284,7 +284,6 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev)
b47s = devm_kzalloc(dev, sizeof(*b47s), GFP_KERNEL);
if (!b47s)
return -ENOMEM;
- sflash->priv = b47s;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
@@ -334,6 +333,8 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev)
b47s->size = sflash->size;
bcm47xxsflash_fill_mtd(b47s, &pdev->dev);
+ platform_set_drvdata(pdev, b47s);
+
err = mtd_device_parse_register(&b47s->mtd, probes, NULL, NULL, 0);
if (err) {
pr_err("Failed to register MTD device: %d\n", err);
@@ -349,8 +350,7 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev)
static int bcm47xxsflash_bcma_remove(struct platform_device *pdev)
{
- struct bcma_sflash *sflash = dev_get_platdata(&pdev->dev);
- struct bcm47xxsflash *b47s = sflash->priv;
+ struct bcm47xxsflash *b47s = platform_get_drvdata(pdev);
mtd_device_unregister(&b47s->mtd);
iounmap(b47s->window);
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index b20e3d5..2f1c690 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -593,9 +593,6 @@ struct bcma_sflash {
u32 blocksize;
u16 numblocks;
u32 size;
-
- struct mtd_info *mtd;
- void *priv;
};
#endif
--
2.10.1
^ permalink raw reply related
* Re: Support of rtl8723bs
From: Larry Finger @ 2017-01-16 17:24 UTC (permalink / raw)
To: Jes Sorensen, Hanno Zulla; +Cc: Bastien Nocera, anthony.wong, linux-wireless
In-Reply-To: <wrfjpojn3zms.fsf@redhat.com>
On 01/16/2017 07:25 AM, Jes Sorensen wrote:
> Hanno Zulla <abos@hanno.de> writes:
>> Hi,
>>
>> has there been any progress on the rtl8723bs / sdio issue?
>>
>> There were no updates to this mailing list or the usual git repositories
>> since this was last discussed, unless I missed the proper place to look
>> for this.
>>
>> I'm sorry that I can't be more helpful with actual development, but am
>> eager to help with testing this device.
>>
>> Thank you,
>> Hanno
>
> Hanno,
>
> The 8723bs project is currently in idle mode, I haven't had time to
> spend time on it for the last couple of months.
I have also been busy.
Larry
^ permalink raw reply
* Strange Behaviors in 802.11 Association MLME
From: Jinghao Shi @ 2017-01-16 21:16 UTC (permalink / raw)
To: linux-wireless; +Cc: Geoffrey Challen, Shuvendu Lahiri, Ranveer Chandra
Hi,
We're working on a formal validation framework for wireless protocol
implementations. We have performed experiments on the 802.11
association state machine and have found peculiar association
behaviors.We'd like to share our findings to the community and confirm
whether they reveal potential implementation bugs.
TLDR version: the client sends association request despite having
received association response from the AP, is this a bug?
We utilized a real time reactive packet jammer to create the following
packet loss pattern (the rate control policy was set to re-transmit
the packet at most once before reporting the packet as failed. This
may not be realistic in practice but helps reveal interesting
behaviors faster.)
- ASSOC_REQ (received by the AP, confirmed by the following ASSOC_RESP)
- ACK <---- JAMMED
- ASSOC_REQ_RETRY <----- JAMMED, the driver will declare this packet as failed
- ASSOC_RESP (received by the client, confirmed by the following ACK)
- ACK
- ASSOC_REQ <--- problematic packet
- ...
I'm also attaching a pcap capture during this session. Our current
conjecture is that the failure status of the ASSOC_REQ was delivered
to the mac80211 MLME entity before the reception of the ASSOC_RESP
packet.
Let us know if there's any other information we can collect to help
tracing down the issue.
Regards,
Jinghao Shi
PhD Student
University at Buffalo
^ permalink raw reply
* Re: brcmfmac: add support for BCM43455 with modalias sdio:c00v02D0dA9BF
From: Andreas Färber @ 2017-01-17 0:19 UTC (permalink / raw)
To: Martin Blumenstingl, linux-mmc, brcm80211-dev-list.pdl,
linux-wireless, kvalo, ulf.hansson
Cc: arend.vanspriel, franky.lin, hante.meuleman
In-Reply-To: <20170116101757.20483-1-martin.blumenstingl@googlemail.com>
Hi Martin,
Am 16.01.2017 um 11:17 schrieb Martin Blumenstingl:
> BCM43455 is a more recent revision of the BCM4345. Some of the BCM43455
> got a dedicated SDIO device ID which is currently not supported by
> brcmfmac.
> Adding the new sdio_device_id to brcmfmac is enough to get the BCM43455
> supported because the chip itself is already supported (due to BCM4345
> support in the driver).
>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> ---
> This is the proper patch following the (short) discussion from [0]
>
> [0] https://marc.info/?l=linux-wireless&m=148455981002310&w=2
>
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 1 +
> include/linux/mmc/sdio_ids.h | 1 +
> 2 files changed, 2 insertions(+)
Reviewed-by: Andreas Färber <afaerber@suse.de>
I encountered the same ID on my R-Box Pro 3G and tested the exact same
patch based on [0] there:
[ +0,130866] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0:
Mar 1 2015 07:29:38 version 7.45.18 (r538002) FWID 01-6a2c8ad4
...
[ +0,156118] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code
(0x30 0x30)
...
[ +1,790419] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code
(0x30 0x30)
Tested-by: Andreas Färber <afaerber@suse.de>
Thanks,
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox