Re: [PATCH 4/7] nl80211: Add info to scan results to support beacon report

2016-07-05 Thread Coelho, Luciano
On Tue, 2016-07-05 at 15:23 +0300, Luca Coelho wrote:
> From: Avraham Stern 
> 
> Beacon report radio measurement requires reporting observed BSSs
> on the channels specified in the beacon request. If the measurement
> mode is set to passive or active, it requires actually performing a
> scan (passive or active, accordingly), and reporting the time that
> the scan was started and the time each beacon/probe was received
> (both in terms of TSF of the BSS of the requesting AP). If the
> request mode is table, this information is optional.
> In addition, the radio measurement request specifies the channel
> dwell time for the measurement.
> 
> In order to use scan for beacon report when the mode is active or
> passive, add a parameter to scan request that specifies the
> channel dwell time, and add scan start time and beacon received time
> to scan results information.
> 
> Supporting beacon report is required for Multi Band Operation (MBO).
> 
> Signed-off-by: Assaf Krauss 
> Signed-off-by: David Spinadel 
> Signed-off-by: Avraham Stern 
> Signed-off-by: Luca Coelho 
> ---
> 
 include/net/cfg80211.h   | 40
> +++-
>  include/uapi/linux/nl80211.h | 42
> ++
>  net/mac80211/scan.c  |  9 +++--
>  net/wireless/core.c  |  4 ++--
>  net/wireless/core.h  | 12 
>  net/wireless/nl80211.c   | 27 +++
>  net/wireless/scan.c  | 18 --
>  net/wireless/trace.h | 33 +
>  8 files changed, 162 insertions(+), 23 deletions(-)

Ouch, I missed changing the APIs of the non-cfg80211 drivers here.
 I'll fix and resend.

Thanks to kbuild test robot for reporting. :)

--
Luca.N�r��yb�X��ǧv�^�)޺{.n�+{��*ޕ�,�{ay�ʇڙ�,j��f���h���z��w���
���j:+v���w�j�mzZ+�ݢj"��!�i

Re: [PATCH 4/7] nl80211: Add info to scan results to support beacon report

2016-07-05 Thread kbuild test robot
Hi,

[auto build test ERROR on mac80211-next/master]
[also build test ERROR on next-20160705]
[cannot apply to v4.7-rc6]
[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/Luca-Coelho/mac80211-cfg80211-a-bunch-of-patches-from-our-internal-tree/20160705-202748
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git 
master
config: i386-randconfig-n0-201627 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All error/warnings (new ones prefixed by >>):

   drivers/net/wireless/ath/wil6210/main.c: In function 'wil_reset':
>> drivers/net/wireless/ath/wil6210/main.c:856:41: warning: passing argument 2 
>> of 'cfg80211_scan_done' makes pointer from integer without a cast 
>> [-Wint-conversion]
  cfg80211_scan_done(wil->scan_request, true);
^~~~
   In file included from drivers/net/wireless/ath/wil6210/wil6210.h:22:0,
from drivers/net/wireless/ath/wil6210/main.c:21:
   include/net/cfg80211.h:4102:6: note: expected 'struct cfg80211_scan_info *' 
but argument is of type 'int'
void cfg80211_scan_done(struct cfg80211_scan_request *request,
 ^~
   drivers/net/wireless/ath/wil6210/main.c: In function '__wil_down':
   drivers/net/wireless/ath/wil6210/main.c:1055:41: warning: passing argument 2 
of 'cfg80211_scan_done' makes pointer from integer without a cast 
[-Wint-conversion]
  cfg80211_scan_done(wil->scan_request, true);
^~~~
   In file included from drivers/net/wireless/ath/wil6210/wil6210.h:22:0,
from drivers/net/wireless/ath/wil6210/main.c:21:
   include/net/cfg80211.h:4102:6: note: expected 'struct cfg80211_scan_info *' 
but argument is of type 'int'
void cfg80211_scan_done(struct cfg80211_scan_request *request,
 ^~
--
   drivers/net/wireless/ath/wil6210/cfg80211.c: In function 
'wil_cfg80211_stop_p2p_device':
>> drivers/net/wireless/ath/wil6210/cfg80211.c:1372:41: warning: passing 
>> argument 2 of 'cfg80211_scan_done' makes pointer from integer without a cast 
>> [-Wint-conversion]
  cfg80211_scan_done(wil->scan_request, 1);
^
   In file included from drivers/net/wireless/ath/wil6210/wil6210.h:22:0,
from drivers/net/wireless/ath/wil6210/cfg80211.c:18:
   include/net/cfg80211.h:4102:6: note: expected 'struct cfg80211_scan_info *' 
but argument is of type 'int'
void cfg80211_scan_done(struct cfg80211_scan_request *request,
 ^~
--
   drivers/net/wireless/ath/wil6210/wmi.c: In function 'wmi_evt_scan_complete':
>> drivers/net/wireless/ath/wil6210/wmi.c:437:41: error: incompatible type for 
>> argument 2 of 'cfg80211_scan_done'
  cfg80211_scan_done(wil->scan_request, aborted);
^~~
   In file included from drivers/net/wireless/ath/wil6210/wil6210.h:22:0,
from drivers/net/wireless/ath/wil6210/wmi.c:21:
   include/net/cfg80211.h:4102:6: note: expected 'struct cfg80211_scan_info *' 
but argument is of type 'bool {aka _Bool}'
void cfg80211_scan_done(struct cfg80211_scan_request *request,
 ^~
--
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c: In function 
'brcmf_notify_escan_complete':
>> drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:780:36: error: 
>> incompatible type for argument 2 of 'cfg80211_scan_done'
  cfg80211_scan_done(scan_request, aborted);
   ^~~
   In file included from 
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:23:0:
   include/net/cfg80211.h:4102:6: note: expected 'struct cfg80211_scan_info *' 
but argument is of type 'bool {aka _Bool}'
void cfg80211_scan_done(struct cfg80211_scan_request *request,
 ^~

vim +/cfg80211_scan_done +437 drivers/net/wireless/ath/wil6210/wmi.c

7743882d6 Vladimir Kondratiev 2013-01-28  431   wil_dbg_wmi(wil, 
"SCAN_COMPLETE(0x%08x)\n", data->status);
2a91d7d06 Vladimir Kondratiev 2014-06-16  432   wil_dbg_misc(wil, 
"Complete scan_request 0x%p aborted %d\n",
2a91d7d06 Vladimir Kondratiev 2014-06-16  433
wil->scan_request, aborted);
2a91d7d06 Vladimir Kondratiev 2014-06-16  434  
047e5d74b Vladimir Kondratiev 2014-05-27  435   
del_timer_sync(>scan_timer);
4332cac17 Lior David  2016-03-01  436   
mutex_lock(>p2p_wdev_mutex);
2be7d22f0 Vladimir Kondratiev 2012-12-20 @437   
cfg80211_scan_done(wil->scan_request, aborted);
4332cac17 Lior David  2016-03-01  438   wil->radio_wdev = 
wil->wdev;
4332cac17 Lior David  2016-03-01  439   

Re: [PATCH 4/7] nl80211: Add info to scan results to support beacon report

2016-07-05 Thread kbuild test robot
Hi,

[auto build test WARNING on mac80211-next/master]
[also build test WARNING on next-20160705]
[cannot apply to v4.7-rc6]
[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/Luca-Coelho/mac80211-cfg80211-a-bunch-of-patches-from-our-internal-tree/20160705-202748
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git 
master
config: x86_64-randconfig-i0-201627 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   drivers/net/wireless/ath/ath6kl/cfg80211.c: In function 
'ath6kl_cfg80211_disconnect_event':
>> drivers/net/wireless/ath/ath6kl/cfg80211.c:862:37: warning: passing argument 
>> 2 of 'cfg80211_scan_done' makes pointer from integer without a cast 
>> [-Wint-conversion]
  cfg80211_scan_done(vif->scan_req, true);
^~~~
   In file included from drivers/net/wireless/ath/ath6kl/core.h:26:0,
from drivers/net/wireless/ath/ath6kl/cfg80211.c:24:
   include/net/cfg80211.h:4102:6: note: expected 'struct cfg80211_scan_info *' 
but argument is of type 'int'
void cfg80211_scan_done(struct cfg80211_scan_request *request,
 ^~
   drivers/net/wireless/ath/ath6kl/cfg80211.c: In function 
'ath6kl_cfg80211_scan_complete_event':
   drivers/net/wireless/ath/ath6kl/cfg80211.c:1092:36: error: incompatible type 
for argument 2 of 'cfg80211_scan_done'
 cfg80211_scan_done(vif->scan_req, aborted);
   ^~~
   In file included from drivers/net/wireless/ath/ath6kl/core.h:26:0,
from drivers/net/wireless/ath/ath6kl/cfg80211.c:24:
   include/net/cfg80211.h:4102:6: note: expected 'struct cfg80211_scan_info *' 
but argument is of type 'bool {aka _Bool}'
void cfg80211_scan_done(struct cfg80211_scan_request *request,
 ^~
   drivers/net/wireless/ath/ath6kl/cfg80211.c: In function 
'ath6kl_cfg80211_vif_stop':
   drivers/net/wireless/ath/ath6kl/cfg80211.c:3617:37: warning: passing 
argument 2 of 'cfg80211_scan_done' makes pointer from integer without a cast 
[-Wint-conversion]
  cfg80211_scan_done(vif->scan_req, true);
^~~~
   In file included from drivers/net/wireless/ath/ath6kl/core.h:26:0,
from drivers/net/wireless/ath/ath6kl/cfg80211.c:24:
   include/net/cfg80211.h:4102:6: note: expected 'struct cfg80211_scan_info *' 
but argument is of type 'int'
void cfg80211_scan_done(struct cfg80211_scan_request *request,
 ^~
--
   drivers/net/wireless/marvell/mwifiex/main.c: In function 'mwifiex_close':
>> drivers/net/wireless/marvell/mwifiex/main.c:702:42: warning: passing 
>> argument 2 of 'cfg80211_scan_done' makes pointer from integer without a cast 
>> [-Wint-conversion]
  cfg80211_scan_done(priv->scan_request, 1);
 ^
   In file included from include/net/mac80211.h:23:0,
from drivers/net/wireless/marvell/mwifiex/decl.h:30,
from drivers/net/wireless/marvell/mwifiex/main.h:52,
from drivers/net/wireless/marvell/mwifiex/main.c:20:
   include/net/cfg80211.h:4102:6: note: expected 'struct cfg80211_scan_info *' 
but argument is of type 'int'
void cfg80211_scan_done(struct cfg80211_scan_request *request,
 ^~
--
   drivers/net/wireless/marvell/mwifiex/scan.c: In function 
'mwifiex_check_next_scan_command':
>> drivers/net/wireless/marvell/mwifiex/scan.c:1982:44: warning: passing 
>> argument 2 of 'cfg80211_scan_done' makes pointer from integer without a cast 
>> [-Wint-conversion]
cfg80211_scan_done(priv->scan_request, 1);
   ^
   In file included from include/net/mac80211.h:23:0,
from drivers/net/wireless/marvell/mwifiex/decl.h:30,
from drivers/net/wireless/marvell/mwifiex/scan.c:20:
   include/net/cfg80211.h:4102:6: note: expected 'struct cfg80211_scan_info *' 
but argument is of type 'int'
void cfg80211_scan_done(struct cfg80211_scan_request *request,
 ^~

vim +/cfg80211_scan_done +862 drivers/net/wireless/ath/ath6kl/cfg80211.c

8c8b65e3e Vasanthakumar Thiagarajan 2011-10-25  846 
memset(vif->req_bssid, 0, sizeof(vif->req_bssid));
bdcd81707 Kalle Valo2011-07-18  847  
bdcd81707 Kalle Valo2011-07-18  848 up(>sem);
bdcd81707 Kalle Valo2011-07-18  849  
14ee6f6b7 Vasanthakumar Thiagarajan 2011-10-25  850 vif->sme_state = 
SME_DISCONNECTED;
170826dd0 Vasanthakumar Thiagarajan 2011-09-10  851  
bdcd81707 Kalle Valo2011-07-18  852 return 0;
bdcd81707 Kalle Valo

[PATCH 4/7] nl80211: Add info to scan results to support beacon report

2016-07-05 Thread Luca Coelho
From: Avraham Stern 

Beacon report radio measurement requires reporting observed BSSs
on the channels specified in the beacon request. If the measurement
mode is set to passive or active, it requires actually performing a
scan (passive or active, accordingly), and reporting the time that
the scan was started and the time each beacon/probe was received
(both in terms of TSF of the BSS of the requesting AP). If the
request mode is table, this information is optional.
In addition, the radio measurement request specifies the channel
dwell time for the measurement.

In order to use scan for beacon report when the mode is active or
passive, add a parameter to scan request that specifies the
channel dwell time, and add scan start time and beacon received time
to scan results information.

Supporting beacon report is required for Multi Band Operation (MBO).

Signed-off-by: Assaf Krauss 
Signed-off-by: David Spinadel 
Signed-off-by: Avraham Stern 
Signed-off-by: Luca Coelho 
---
 include/net/cfg80211.h   | 40 +++-
 include/uapi/linux/nl80211.h | 42 ++
 net/mac80211/scan.c  |  9 +++--
 net/wireless/core.c  |  4 ++--
 net/wireless/core.h  | 12 
 net/wireless/nl80211.c   | 27 +++
 net/wireless/scan.c  | 18 --
 net/wireless/trace.h | 33 +
 8 files changed, 162 insertions(+), 23 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index fa4f0f7..e2658e3 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1424,6 +1424,21 @@ struct cfg80211_ssid {
 };
 
 /**
+ * struct cfg80211_scan_info - information about completed scan
+ * @scan_start_tsf: scan start time in terms of the TSF of the BSS that the
+ * wireless device that requested the scan is connected to. If this
+ * information is not available, this field is left zero.
+ * @tsf_bssid: the BSSID according to which %scan_start_tsf is set.
+ * @aborted: set to true if the scan was aborted for any reason,
+ * userspace will be notified of that
+ */
+struct cfg80211_scan_info {
+   u64 scan_start_tsf;
+   u8 tsf_bssid[ETH_ALEN] __aligned(2);
+   bool aborted;
+};
+
+/**
  * struct cfg80211_scan_request - scan request description
  *
  * @ssids: SSIDs to scan for (active scan only)
@@ -1433,12 +1448,17 @@ struct cfg80211_ssid {
  * @scan_width: channel width for scanning
  * @ie: optional information element(s) to add into Probe Request or %NULL
  * @ie_len: length of ie in octets
+ * @duration: how long to listen on each channel, in TUs. If
+ * %duration_mandatory is not set, this is the maximum dwell time and
+ * the actual dwell time may be shorter.
+ * @duration_mandatory: if set, the scan duration must be as specified by the
+ * %duration field.
  * @flags: bit field of flags controlling operation
  * @rates: bitmap of rates to advertise for each band
  * @wiphy: the wiphy this was for
  * @scan_start: time (in jiffies) when the scan started
  * @wdev: the wireless device to scan for
- * @aborted: (internal) scan request was notified as aborted
+ * @info: (internal) information about completed scan
  * @notified: (internal) scan request was notified as done or aborted
  * @no_cck: used to send probe requests at non CCK rate in 2GHz band
  * @mac_addr: MAC address used with randomisation
@@ -1454,6 +1474,8 @@ struct cfg80211_scan_request {
enum nl80211_bss_scan_width scan_width;
const u8 *ie;
size_t ie_len;
+   u16 duration;
+   bool duration_mandatory;
u32 flags;
 
u32 rates[NUM_NL80211_BANDS];
@@ -1467,7 +1489,8 @@ struct cfg80211_scan_request {
/* internal */
struct wiphy *wiphy;
unsigned long scan_start;
-   bool aborted, notified;
+   struct cfg80211_scan_info info;
+   bool notified;
bool no_cck;
 
/* keep last */
@@ -1600,12 +1623,19 @@ enum cfg80211_signal_type {
  * buffered on the device) and be accurate to about 10ms.
  * If the frame isn't buffered, just passing the return value of
  * ktime_get_boot_ns() is likely appropriate.
+ * @parent_tsf: the time at the start of reception of the first octet of the
+ * timestamp field of the frame. The time is the TSF of the BSS specified
+ * by %parent_bssid.
+ * @parent_bssid: the BSS according to which %parent_tsf is set. This is set to
+ * the BSS that requested the scan in which the beacon/probe was received.
  */
 struct cfg80211_inform_bss {
struct ieee80211_channel *chan;
enum nl80211_bss_scan_width scan_width;
s32 signal;
u64 boottime_ns;
+   u64 parent_tsf;
+   u8 parent_bssid[ETH_ALEN] __aligned(2);
 };
 
 /**
@@ -4067,10 +4097,10 @@ const