Re: wireless workshop

2018-10-17 Thread merez

On 2018-10-09 13:28, Johannes Berg wrote:

Hi all,

On Tue, 2018-09-18 at 08:11 -0400, Jamal Hadi Salim wrote:

On behalf of the NetDev Society, this is a formal announcement that
Netdev 0x13 conference will be held in Prague, Czech Republic.
Tentative dates are March 20-22, 2019.


Kalle and I have (more or less) decided to propose a wireless workshop
for Netdev 0x13.

In order to gauge interest and plan room size, can you reply (privately
if you like) if this would work for you and you'd (want to) attend?

Thanks,
johannes


Great initiative!
I would be happy to attend.

--
Maya Erez
Qualcomm Israel, Inc. on behalf of Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a 
Linux Foundation Collaborative Project


[PATCH] mt76: usb: fix static tracepoints

2018-10-17 Thread Lorenzo Bianconi
Add submit_urb and rx_urb static tracepoints in mt76-usb module.
Move trace_mac_txstat_fetch in mt76x02_mac_load_tx_status routine
in order to be available to usb drivers. Moreover remove
no longer used mt76x0/trace.{c,h}

Signed-off-by: Lorenzo Bianconi 
---
 .../wireless/mediatek/mt76/mt76x0/Makefile|   3 +-
 .../net/wireless/mediatek/mt76/mt76x0/init.c  |   1 -
 .../net/wireless/mediatek/mt76/mt76x0/mac.c   |   1 -
 .../net/wireless/mediatek/mt76/mt76x0/phy.c   |   8 +-
 .../net/wireless/mediatek/mt76/mt76x0/trace.c |  21 --
 .../net/wireless/mediatek/mt76/mt76x0/trace.h | 312 --
 .../net/wireless/mediatek/mt76/mt76x0/usb.c   |   1 -
 .../net/wireless/mediatek/mt76/mt76x02_mac.c  |   4 +-
 drivers/net/wireless/mediatek/mt76/usb.c  |   5 +
 .../net/wireless/mediatek/mt76/usb_trace.h|  29 +-
 10 files changed, 38 insertions(+), 347 deletions(-)
 delete mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/trace.c
 delete mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/trace.h

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/Makefile 
b/drivers/net/wireless/mediatek/mt76/mt76x0/Makefile
index e49cbf6be945..1b4f2fa99317 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/Makefile
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/Makefile
@@ -3,10 +3,9 @@ obj-$(CONFIG_MT76x0E) += mt76x0e.o
 obj-$(CONFIG_MT76x0_COMMON) += mt76x0-common.o
 
 mt76x0-common-y := \
-   init.o main.o trace.o eeprom.o phy.o mac.o
+   init.o main.o eeprom.o phy.o mac.o
 
 mt76x0u-y := usb.o usb_mcu.o
 mt76x0e-y := pci.o pci_mcu.o
 
 # ccflags-y := -DDEBUG
-CFLAGS_trace.o := -I$(src)
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/init.c 
b/drivers/net/wireless/mediatek/mt76/mt76x0/init.c
index d49357c7f104..263d5e8df945 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/init.c
@@ -16,7 +16,6 @@
 
 #include "mt76x0.h"
 #include "eeprom.h"
-#include "trace.h"
 #include "mcu.h"
 #include "initvals.h"
 
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/mac.c 
b/drivers/net/wireless/mediatek/mt76/mt76x0/mac.c
index 98d4a97f0a72..8cbdeb6d3dbe 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/mac.c
@@ -16,7 +16,6 @@
 #include 
 
 #include "mt76x0.h"
-#include "trace.h"
 
 void mt76x0_mac_set_protection(struct mt76x02_dev *dev, bool legacy_prot,
   int ht_mode)
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c 
b/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c
index dbb92586b6e1..859fb6f23773 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c
@@ -20,7 +20,6 @@
 #include "mt76x0.h"
 #include "mcu.h"
 #include "eeprom.h"
-#include "trace.h"
 #include "phy.h"
 #include "initvals.h"
 #include "initvals_phy.h"
@@ -54,7 +53,7 @@ mt76x0_rf_csr_wr(struct mt76x02_dev *dev, u32 offset, u8 
value)
FIELD_PREP(MT_RF_CSR_CFG_REG_ID, reg) |
MT_RF_CSR_CFG_WR |
MT_RF_CSR_CFG_KICK);
-   trace_mt76x0_rf_write(>mt76, bank, offset, value);
+
 out:
mutex_unlock(>phy_mutex);
 
@@ -95,10 +94,9 @@ static int mt76x0_rf_csr_rr(struct mt76x02_dev *dev, u32 
offset)
 
val = mt76_rr(dev, MT_RF_CSR_CFG);
if (FIELD_GET(MT_RF_CSR_CFG_REG_ID, val) == reg &&
-   FIELD_GET(MT_RF_CSR_CFG_REG_BANK, val) == bank) {
+   FIELD_GET(MT_RF_CSR_CFG_REG_BANK, val) == bank)
ret = FIELD_GET(MT_RF_CSR_CFG_DATA, val);
-   trace_mt76x0_rf_read(>mt76, bank, offset, ret);
-   }
+
 out:
mutex_unlock(>phy_mutex);
 
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/trace.c 
b/drivers/net/wireless/mediatek/mt76/mt76x0/trace.c
deleted file mode 100644
index 8abdd3cd546d..
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/trace.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2014 Felix Fietkau 
- * Copyright (C) 2015 Jakub Kicinski 
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include 
-
-#ifndef __CHECKER__
-#define CREATE_TRACE_POINTS
-#include "trace.h"
-
-#endif
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/trace.h 
b/drivers/net/wireless/mediatek/mt76/mt76x0/trace.h
deleted file mode 100644
index 75d1d6738c34..
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/trace.h
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * Copyright (C) 2014 Felix Fietkau 
- * Copyright (C) 2015 Jakub Kicinski 
- *
- * This program is free software; you can redistribute it 

[PATCH] mac80211_hwsim: Timer should be initialized before device registered

2018-10-17 Thread Vasyl Vavrychuk
From: Vasyl Vavrychuk 

Otherwise if network manager starts configuring Wi-Fi interface
immidiatelly after getting notification of its creation, we will get
NULL pointer dereference:

  BUG: unable to handle kernel NULL pointer dereference at   (null)
  IP: [] hrtimer_active+0x28/0x50
  ...
  Call Trace:
   [] ? hrtimer_try_to_cancel+0x27/0x110
   [] ? hrtimer_cancel+0x15/0x20
   [] ? mac80211_hwsim_config+0x140/0x1c0 [mac80211_hwsim]

Signed-off-by: Vasyl Vavrychuk 
---
 drivers/net/wireless/mac80211_hwsim.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/mac80211_hwsim.c 
b/drivers/net/wireless/mac80211_hwsim.c
index 1068757ec42e..d0e0a9f5bf98 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -2890,6 +2890,10 @@ static int mac80211_hwsim_new_radio(struct genl_info 
*info,
 
wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
 
+   tasklet_hrtimer_init(>beacon_timer,
+mac80211_hwsim_beacon,
+CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
+
err = ieee80211_register_hw(hw);
if (err < 0) {
pr_debug("mac80211_hwsim: ieee80211_register_hw failed (%d)\n",
@@ -2914,10 +2918,6 @@ static int mac80211_hwsim_new_radio(struct genl_info 
*info,
data->debugfs,
data, _simulate_radar);
 
-   tasklet_hrtimer_init(>beacon_timer,
-mac80211_hwsim_beacon,
-CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
-
spin_lock_bh(_radio_lock);
err = rhashtable_insert_fast(_radios_rht, >rht,
 hwsim_rht_params);
-- 
2.19.1



[PATCH v3 2/2] mac80211_hwsim: allow configurable cipher types

2018-10-17 Thread James Prestwood
The mac80211_hwsim driver does not specify supported cipher types, which
in turn enables all ciphers to be supported in software. (see
net/mac80211/main.c:ieee80211_init_cipher_suites). Allowing ciphers
to be configurable is valuable for simulating older drivers that may
not support all ciphers.

This patch adds a new attribute:

 - HWSIM_ATTR_CIPHER_SUPPORT
A u32 array/list of supported cipher types

This only allows enabling/disabling cipher types listed in the (new)
"hwsim_ciphers" array in mac80211_hwsim.c. Any unknown cipher type
will result in -EINVAL.

Signed-off-by: James Prestwood 
---
 drivers/net/wireless/mac80211_hwsim.c | 64 +++
 drivers/net/wireless/mac80211_hwsim.h |  2 +
 2 files changed, 66 insertions(+)

diff --git a/drivers/net/wireless/mac80211_hwsim.c 
b/drivers/net/wireless/mac80211_hwsim.c
index 2799eb247b7e..69596eb255d7 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -371,6 +371,20 @@ static const struct ieee80211_rate hwsim_rates[] = {
{ .bitrate = 540 }
 };
 
+static const u32 hwsim_ciphers[] = {
+   WLAN_CIPHER_SUITE_WEP40,
+   WLAN_CIPHER_SUITE_WEP104,
+   WLAN_CIPHER_SUITE_TKIP,
+   WLAN_CIPHER_SUITE_CCMP,
+   WLAN_CIPHER_SUITE_CCMP_256,
+   WLAN_CIPHER_SUITE_GCMP,
+   WLAN_CIPHER_SUITE_GCMP_256,
+   WLAN_CIPHER_SUITE_AES_CMAC,
+   WLAN_CIPHER_SUITE_BIP_CMAC_256,
+   WLAN_CIPHER_SUITE_BIP_GMAC_128,
+   WLAN_CIPHER_SUITE_BIP_GMAC_256,
+};
+
 #define OUI_QCA 0x001374
 #define QCA_NL80211_SUBCMD_TEST 1
 enum qca_nl80211_vendor_subcmds {
@@ -474,6 +488,8 @@ struct mac80211_hwsim_data {
struct ieee80211_iface_limit if_limits[3];
int n_if_limits;
 
+   u32 ciphers[ARRAY_SIZE(hwsim_ciphers)];
+
struct mac_address addresses[2];
int channels, idx;
bool use_chanctx;
@@ -602,6 +618,7 @@ static const struct nla_policy 
hwsim_genl_policy[HWSIM_ATTR_MAX + 1] = {
[HWSIM_ATTR_FREQ] = { .type = NLA_U32 },
[HWSIM_ATTR_PERM_ADDR] = { .type = NLA_UNSPEC, .len = ETH_ALEN },
[HWSIM_ATTR_IFTYPE_SUPPORT] = { .type = NLA_U32 },
+   [HWSIM_ATTR_CIPHER_SUPPORT] = { .type = NLA_BINARY },
 };
 
 static void mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
@@ -2375,6 +2392,8 @@ struct hwsim_new_radio_params {
bool no_vif;
const u8 *perm_addr;
u32 iftypes;
+   u32 *ciphers;
+   u8 n_ciphers;
 };
 
 static void hwsim_mcast_config_msg(struct sk_buff *mcast_skb,
@@ -2638,6 +2657,13 @@ static int mac80211_hwsim_new_radio(struct genl_info 
*info,
hw->wiphy->iface_combinations = >if_combination;
hw->wiphy->n_iface_combinations = 1;
 
+   if (param->ciphers) {
+   memcpy(data->ciphers, param->ciphers,
+   param->n_ciphers * sizeof(u32));
+   hw->wiphy->cipher_suites = data->ciphers;
+   hw->wiphy->n_cipher_suites = param->n_ciphers;
+   }
+
INIT_DELAYED_WORK(>roc_start, hw_roc_start);
INIT_DELAYED_WORK(>roc_done, hw_roc_done);
INIT_DELAYED_WORK(>hw_scan, hw_scan_work);
@@ -3185,6 +3211,29 @@ static int hwsim_register_received_nl(struct sk_buff 
*skb_2,
return 0;
 }
 
+/* ensures ciphers only include ciphers listed in 'hwsim_ciphers' array */
+static int hwsim_validate_ciphers(const u32 *ciphers, int n_ciphers)
+{
+   int i;
+
+   for (i = 0; i < n_ciphers; i++) {
+   int j;
+   int found = 0;
+
+   for (j = 0; j < ARRAY_SIZE(hwsim_ciphers); j++) {
+   if (ciphers[i] == hwsim_ciphers[j]) {
+   found = 1;
+   break;
+   }
+   }
+
+   if (!found)
+   return -1;
+   }
+
+   return 0;
+}
+
 static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info)
 {
struct hwsim_new_radio_params param = { 0 };
@@ -3267,6 +3316,21 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, 
struct genl_info *info)
param.p2p_device = true;
}
 
+   if (info->attrs[HWSIM_ATTR_CIPHER_SUPPORT]) {
+   param.ciphers = nla_data(
+   info->attrs[HWSIM_ATTR_CIPHER_SUPPORT]);
+   param.n_ciphers = nla_len(
+   info->attrs[HWSIM_ATTR_CIPHER_SUPPORT]);
+
+   if (param.n_ciphers > sizeof(hwsim_ciphers))
+   return -EINVAL;
+
+   param.n_ciphers /= sizeof(u32);
+
+   if (hwsim_validate_ciphers(param.ciphers, param.n_ciphers))
+   return -EINVAL;
+   }
+
ret = mac80211_hwsim_new_radio(info, );
kfree(hwname);
return ret;
diff --git a/drivers/net/wireless/mac80211_hwsim.h 
b/drivers/net/wireless/mac80211_hwsim.h
index 3f6b670116d0..a1ef8457fad4 100644
--- 

Re: [PATCH v2 1/2] mac80211_hwsim: allow setting iftype support

2018-10-17 Thread James Prestwood
On Wed, 2018-10-17 at 23:08 +0200, Johannes Berg wrote:
> > Ah ok, that makes sense. Ok, well I can fixup that typo, as well as
> > reordering the use_chanctx stuff I mentioned. Unless there was
> > anything
> > else? If not I can submit v3.
> 
> I haven't really looked at it much yet, it's 11pm here and I'm tired
> :-)
> 
> Feel free to resubmit, but I'm not going to promise I won't make you
> submit v4 if you do ;-)

Ha, ok no problem. Ill submit v3 now.

Thanks,
james

> 
> johannes
> 


Re: [PATCH v2 1/2] mac80211_hwsim: allow setting iftype support

2018-10-17 Thread Johannes Berg


> Ah ok, that makes sense. Ok, well I can fixup that typo, as well as
> reordering the use_chanctx stuff I mentioned. Unless there was anything
> else? If not I can submit v3.

I haven't really looked at it much yet, it's 11pm here and I'm tired :-)

Feel free to resubmit, but I'm not going to promise I won't make you
submit v4 if you do ;-)

johannes



Re: [PATCH v2 1/2] mac80211_hwsim: allow setting iftype support

2018-10-17 Thread James Prestwood
On Wed, 2018-10-17 at 22:58 +0200, Johannes Berg wrote:
> On Wed, 2018-10-17 at 14:00 -0700, James Prestwood wrote:
> > 
> > > That makes me wonder if you'd also want to support limiting the #
> > > of
> > > interfaces/channels to mimic another device?
> > 
> > Yeah it seems like it would be pretty easy to add that on top of
> > this
> > change, although I don't really see us actually using it.
> 
> Sure, fair enough.
> 
> > I can add it,
> > but my only concern is I would not test it up to the same level I
> > tested iftype/ciphers. 
> 
> If you don't really want to use it, then I don't think you need to
> add
> it. I was just wondering if it made a difference.
> 
> > Maybe this is also because I am not entirely
> > sure what num_different_channels is doing. Is this only relevant
> > when
> > multiple interfaces exist on a radio? Like setting how many
> > channels
> > can be use simultaneously?
> 
> Correct. "Simultaneously" is a bit of an overstatement, typically
> today
> it's implemented by TDM - if you have two interfaces with a
> connection
> to an AP each, but on different channels, each interface would just
> tell
> its AP that it's going to sleep, but instead hop to the other channel
> and tell that AP that it woke up... etc.

Ah ok, that makes sense. Ok, well I can fixup that typo, as well as
reordering the use_chanctx stuff I mentioned. Unless there was anything
else? If not I can submit v3.

> 
> johannes
> 


Re: [PATCH v2 1/2] mac80211_hwsim: allow setting iftype support

2018-10-17 Thread Johannes Berg
On Wed, 2018-10-17 at 14:00 -0700, James Prestwood wrote:
> 
> > That makes me wonder if you'd also want to support limiting the # of
> > interfaces/channels to mimic another device?
> 
> Yeah it seems like it would be pretty easy to add that on top of this
> change, although I don't really see us actually using it.

Sure, fair enough.

> I can add it,
> but my only concern is I would not test it up to the same level I
> tested iftype/ciphers. 

If you don't really want to use it, then I don't think you need to add
it. I was just wondering if it made a difference.

> Maybe this is also because I am not entirely
> sure what num_different_channels is doing. Is this only relevant when
> multiple interfaces exist on a radio? Like setting how many channels
> can be use simultaneously?

Correct. "Simultaneously" is a bit of an overstatement, typically today
it's implemented by TDM - if you have two interfaces with a connection
to an AP each, but on different channels, each interface would just tell
its AP that it's going to sleep, but instead hop to the other channel
and tell that AP that it woke up... etc.

johannes



Re: [PATCH v2 1/2] mac80211_hwsim: allow setting iftype support

2018-10-17 Thread James Prestwood
On Wed, 2018-10-17 at 21:53 +0200, Johannes Berg wrote:
> On Wed, 2018-10-17 at 12:33 -0700, James Prestwood wrote:
> > The mac80211_hwsim driver hard codes its supported interface types.
> > For
> > testing purposes it would be valuable to allow changing these
> > supported
> > types in order to simulate actual drivers than support a limited
> > set of
> 
> typo: than -> that
> 
> > In order to accomplish this, the ieee80211_iface_limit structure
> > needed
> > to be built dynamically to only include limit rules for iftypes
> > that
> > the user requested to enable.
> 
> That makes me wonder if you'd also want to support limiting the # of
> interfaces/channels to mimic another device?

Yeah it seems like it would be pretty easy to add that on top of this
change, although I don't really see us actually using it. I can add it,
but my only concern is I would not test it up to the same level I
tested iftype/ciphers. Maybe this is also because I am not entirely
sure what num_different_channels is doing. Is this only relevant when
multiple interfaces exist on a radio? Like setting how many channels
can be use simultaneously?

> 
> johannes
> 


Re: [PATCH v2 1/2] mac80211_hwsim: allow setting iftype support

2018-10-17 Thread James Prestwood
On Wed, 2018-10-17 at 12:33 -0700, James Prestwood wrote:
> The mac80211_hwsim driver hard codes its supported interface types.
> For
> testing purposes it would be valuable to allow changing these
> supported
> types in order to simulate actual drivers than support a limited set
> of
> iftypes. A new attribute was added to allow this:
> 
> - HWSIM_ATTR_IFTYPE_SUPPORT
>   A u32 bit field of supported NL80211_IFTYPE_* bits
> 
> This will only enable/disable iftypes that mac80211_hwsim already
> supports.
> 
> In order to accomplish this, the ieee80211_iface_limit structure
> needed
> to be built dynamically to only include limit rules for iftypes that
> the user requested to enable.
> 
> Signed-off-by: James Prestwood 
> ---
>  drivers/net/wireless/mac80211_hwsim.c | 154 +++-
> --
>  drivers/net/wireless/mac80211_hwsim.h |   2 +
>  2 files changed, 90 insertions(+), 66 deletions(-)
> 
> diff --git a/drivers/net/wireless/mac80211_hwsim.c
> b/drivers/net/wireless/mac80211_hwsim.c
> index 18e819d964f1..2e4dac2de187 100644
> --- a/drivers/net/wireless/mac80211_hwsim.c
> +++ b/drivers/net/wireless/mac80211_hwsim.c
> @@ -448,48 +448,6 @@ static const struct nl80211_vendor_cmd_info
> mac80211_hwsim_vendor_events[] = {
>   { .vendor_id = OUI_QCA, .subcmd = 1 },
>  };
>  
> -static const struct ieee80211_iface_limit hwsim_if_limits[] = {
> - { .max = 1, .types = BIT(NL80211_IFTYPE_ADHOC) },
> - { .max = 2048,  .types = BIT(NL80211_IFTYPE_STATION) |
> -  BIT(NL80211_IFTYPE_P2P_CLIENT) |
> -#ifdef CONFIG_MAC80211_MESH
> -  BIT(NL80211_IFTYPE_MESH_POINT) |
> -#endif
> -  BIT(NL80211_IFTYPE_AP) |
> -  BIT(NL80211_IFTYPE_P2P_GO) },
> - /* must be last, see hwsim_if_comb */
> - { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_DEVICE) }
> -};
> -
> -static const struct ieee80211_iface_combination hwsim_if_comb[] = {
> - {
> - .limits = hwsim_if_limits,
> - /* remove the last entry which is P2P_DEVICE */
> - .n_limits = ARRAY_SIZE(hwsim_if_limits) - 1,
> - .max_interfaces = 2048,
> - .num_different_channels = 1,
> - .radar_detect_widths =
> BIT(NL80211_CHAN_WIDTH_20_NOHT) |
> -BIT(NL80211_CHAN_WIDTH_20) |
> -BIT(NL80211_CHAN_WIDTH_40) |
> -BIT(NL80211_CHAN_WIDTH_80) |
> -BIT(NL80211_CHAN_WIDTH_160),
> - },
> -};
> -
> -static const struct ieee80211_iface_combination
> hwsim_if_comb_p2p_dev[] = {
> - {
> - .limits = hwsim_if_limits,
> - .n_limits = ARRAY_SIZE(hwsim_if_limits),
> - .max_interfaces = 2048,
> - .num_different_channels = 1,
> - .radar_detect_widths =
> BIT(NL80211_CHAN_WIDTH_20_NOHT) |
> -BIT(NL80211_CHAN_WIDTH_20) |
> -BIT(NL80211_CHAN_WIDTH_40) |
> -BIT(NL80211_CHAN_WIDTH_80) |
> -BIT(NL80211_CHAN_WIDTH_160),
> - },
> -};
> -
>  static spinlock_t hwsim_radio_lock;
>  static LIST_HEAD(hwsim_radios);
>  static struct workqueue_struct *hwsim_wq;
> @@ -513,6 +471,8 @@ struct mac80211_hwsim_data {
>   struct ieee80211_channel
> channels_5ghz[ARRAY_SIZE(hwsim_channels_5ghz)];
>   struct ieee80211_rate rates[ARRAY_SIZE(hwsim_rates)];
>   struct ieee80211_iface_combination if_combination;
> + struct ieee80211_iface_limit if_limits[3];
> + int n_if_limits;
>  
>   struct mac_address addresses[2];
>   int channels, idx;
> @@ -641,6 +601,7 @@ static const struct nla_policy
> hwsim_genl_policy[HWSIM_ATTR_MAX + 1] = {
>   [HWSIM_ATTR_NO_VIF] = { .type = NLA_FLAG },
>   [HWSIM_ATTR_FREQ] = { .type = NLA_U32 },
>   [HWSIM_ATTR_PERM_ADDR] = { .type = NLA_UNSPEC, .len =
> ETH_ALEN },
> + [HWSIM_ATTR_IFTYPE_SUPPORT] = { .type = NLA_U32 },
>  };
>  
>  static void mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
> @@ -2413,6 +2374,7 @@ struct hwsim_new_radio_params {
>   const char *hwname;
>   bool no_vif;
>   const u8 *perm_addr;
> + u32 iftypes;
>  };
>  
>  static void hwsim_mcast_config_msg(struct sk_buff *mcast_skb,
> @@ -2517,6 +2479,29 @@ static void hwsim_mcast_new_radio(int id,
> struct genl_info *info,
>   nlmsg_free(mcast_skb);
>  }
>  
> +#ifdef CONFIG_MAC80211_MESH
> +#define HWSIM_MESH_BIT BIT(NL80211_IFTYPE_MESH_POINT)
> +#else
> +#define HWSIM_MESH_BIT 0
> +#endif
> +
> +#define HWSIM_DEFAULT_IF_LIMIT \
> + ( \
> + BIT(NL80211_IFTYPE_STATION) | \
> + BIT(NL80211_IFTYPE_P2P_CLIENT) | \
> + BIT(NL80211_IFTYPE_AP) | \
> + BIT(NL80211_IFTYPE_P2P_GO) | \
> + HWSIM_MESH_BIT \
> + )
> +
> +#define 

[PATCH v2 0/2] Configuring iftype/cipher support

2018-10-17 Thread James Prestwood
This is V2 of my original patch, but a lot has changed:

- (extended) feature support has been completely removed due to
  (extended) features being set in core driver code. There was
  no way to set all (extended) features in JUST mac80211_hwsim.

- Iftype support was changed to a bit mask, and checks were added
  to ensure only iftypes that mac80211_hwsim already supported
  were allowed to be enabled/disabled. The interface limit rules
  are now built dynamically rather than being static structures.
  This was done because limit verification code complains if you
  have a limit rule for an iftype that you do not support.

- A new patch was added to allow supported ciphers to be configured.


James Prestwood (2):
  mac80211_hwsim: allow setting iftype support
  mac80211_hwsim: allow configurable cipher types

 drivers/net/wireless/mac80211_hwsim.c | 218 ++
 drivers/net/wireless/mac80211_hwsim.h |   4 +
 2 files changed, 156 insertions(+), 66 deletions(-)

-- 
2.17.1



[PATCH v2 2/2] mac80211_hwsim: allow configurable cipher types

2018-10-17 Thread James Prestwood
The mac80211_hwsim driver does not specify supported cipher types, which
in turn enables all ciphers to be supported in software. (see
net/mac80211/main.c:ieee80211_init_cipher_suites). Allowing ciphers
to be configurable is valuable for simulating older drivers that may
not support all ciphers.

This patch adds a new attribute:

 - HWSIM_ATTR_CIPHER_SUPPORT
A u32 array/list of supported cipher types

This only allows enabling/disabling cipher types listed in the (new)
"hwsim_ciphers" array in mac80211_hwsim.c. Any unknown cipher type
will result in -EINVAL.

Signed-off-by: James Prestwood 
---
 drivers/net/wireless/mac80211_hwsim.c | 64 +++
 drivers/net/wireless/mac80211_hwsim.h |  2 +
 2 files changed, 66 insertions(+)

diff --git a/drivers/net/wireless/mac80211_hwsim.c 
b/drivers/net/wireless/mac80211_hwsim.c
index 2e4dac2de187..b6b832a41286 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -371,6 +371,20 @@ static const struct ieee80211_rate hwsim_rates[] = {
{ .bitrate = 540 }
 };
 
+static const u32 hwsim_ciphers[] = {
+   WLAN_CIPHER_SUITE_WEP40,
+   WLAN_CIPHER_SUITE_WEP104,
+   WLAN_CIPHER_SUITE_TKIP,
+   WLAN_CIPHER_SUITE_CCMP,
+   WLAN_CIPHER_SUITE_CCMP_256,
+   WLAN_CIPHER_SUITE_GCMP,
+   WLAN_CIPHER_SUITE_GCMP_256,
+   WLAN_CIPHER_SUITE_AES_CMAC,
+   WLAN_CIPHER_SUITE_BIP_CMAC_256,
+   WLAN_CIPHER_SUITE_BIP_GMAC_128,
+   WLAN_CIPHER_SUITE_BIP_GMAC_256,
+};
+
 #define OUI_QCA 0x001374
 #define QCA_NL80211_SUBCMD_TEST 1
 enum qca_nl80211_vendor_subcmds {
@@ -474,6 +488,8 @@ struct mac80211_hwsim_data {
struct ieee80211_iface_limit if_limits[3];
int n_if_limits;
 
+   u32 ciphers[ARRAY_SIZE(hwsim_ciphers)];
+
struct mac_address addresses[2];
int channels, idx;
bool use_chanctx;
@@ -602,6 +618,7 @@ static const struct nla_policy 
hwsim_genl_policy[HWSIM_ATTR_MAX + 1] = {
[HWSIM_ATTR_FREQ] = { .type = NLA_U32 },
[HWSIM_ATTR_PERM_ADDR] = { .type = NLA_UNSPEC, .len = ETH_ALEN },
[HWSIM_ATTR_IFTYPE_SUPPORT] = { .type = NLA_U32 },
+   [HWSIM_ATTR_CIPHER_SUPPORT] = { .type = NLA_BINARY },
 };
 
 static void mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
@@ -2375,6 +2392,8 @@ struct hwsim_new_radio_params {
bool no_vif;
const u8 *perm_addr;
u32 iftypes;
+   u32 *ciphers;
+   u8 n_ciphers;
 };
 
 static void hwsim_mcast_config_msg(struct sk_buff *mcast_skb,
@@ -2637,6 +2656,13 @@ static int mac80211_hwsim_new_radio(struct genl_info 
*info,
hw->wiphy->iface_combinations = >if_combination;
hw->wiphy->n_iface_combinations = 1;
 
+   if (param->ciphers) {
+   memcpy(data->ciphers, param->ciphers,
+   param->n_ciphers * sizeof(u32));
+   hw->wiphy->cipher_suites = data->ciphers;
+   hw->wiphy->n_cipher_suites = param->n_ciphers;
+   }
+
INIT_DELAYED_WORK(>roc_start, hw_roc_start);
INIT_DELAYED_WORK(>roc_done, hw_roc_done);
INIT_DELAYED_WORK(>hw_scan, hw_scan_work);
@@ -3184,6 +3210,29 @@ static int hwsim_register_received_nl(struct sk_buff 
*skb_2,
return 0;
 }
 
+/* ensures ciphers only include ciphers listed in 'hwsim_ciphers' array */
+static int hwsim_validate_ciphers(const u32 *ciphers, int n_ciphers)
+{
+   int i;
+
+   for (i = 0; i < n_ciphers; i++) {
+   int j;
+   int found = 0;
+
+   for (j = 0; j < ARRAY_SIZE(hwsim_ciphers); j++) {
+   if (ciphers[i] == hwsim_ciphers[j]) {
+   found = 1;
+   break;
+   }
+   }
+
+   if (!found)
+   return -1;
+   }
+
+   return 0;
+}
+
 static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info)
 {
struct hwsim_new_radio_params param = { 0 };
@@ -3266,6 +3315,21 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, 
struct genl_info *info)
param.p2p_device = true;
}
 
+   if (info->attrs[HWSIM_ATTR_CIPHER_SUPPORT]) {
+   param.ciphers = nla_data(
+   info->attrs[HWSIM_ATTR_CIPHER_SUPPORT]);
+   param.n_ciphers = nla_len(
+   info->attrs[HWSIM_ATTR_CIPHER_SUPPORT]);
+
+   if (param.n_ciphers > sizeof(hwsim_ciphers))
+   return -EINVAL;
+
+   param.n_ciphers /= sizeof(u32);
+
+   if (hwsim_validate_ciphers(param.ciphers, param.n_ciphers))
+   return -EINVAL;
+   }
+
ret = mac80211_hwsim_new_radio(info, );
kfree(hwname);
return ret;
diff --git a/drivers/net/wireless/mac80211_hwsim.h 
b/drivers/net/wireless/mac80211_hwsim.h
index 3f6b670116d0..a1ef8457fad4 100644
--- 

[PATCH v2 1/2] mac80211_hwsim: allow setting iftype support

2018-10-17 Thread James Prestwood
The mac80211_hwsim driver hard codes its supported interface types. For
testing purposes it would be valuable to allow changing these supported
types in order to simulate actual drivers than support a limited set of
iftypes. A new attribute was added to allow this:

- HWSIM_ATTR_IFTYPE_SUPPORT
A u32 bit field of supported NL80211_IFTYPE_* bits

This will only enable/disable iftypes that mac80211_hwsim already
supports.

In order to accomplish this, the ieee80211_iface_limit structure needed
to be built dynamically to only include limit rules for iftypes that
the user requested to enable.

Signed-off-by: James Prestwood 
---
 drivers/net/wireless/mac80211_hwsim.c | 154 +++---
 drivers/net/wireless/mac80211_hwsim.h |   2 +
 2 files changed, 90 insertions(+), 66 deletions(-)

diff --git a/drivers/net/wireless/mac80211_hwsim.c 
b/drivers/net/wireless/mac80211_hwsim.c
index 18e819d964f1..2e4dac2de187 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -448,48 +448,6 @@ static const struct nl80211_vendor_cmd_info 
mac80211_hwsim_vendor_events[] = {
{ .vendor_id = OUI_QCA, .subcmd = 1 },
 };
 
-static const struct ieee80211_iface_limit hwsim_if_limits[] = {
-   { .max = 1, .types = BIT(NL80211_IFTYPE_ADHOC) },
-   { .max = 2048,  .types = BIT(NL80211_IFTYPE_STATION) |
-BIT(NL80211_IFTYPE_P2P_CLIENT) |
-#ifdef CONFIG_MAC80211_MESH
-BIT(NL80211_IFTYPE_MESH_POINT) |
-#endif
-BIT(NL80211_IFTYPE_AP) |
-BIT(NL80211_IFTYPE_P2P_GO) },
-   /* must be last, see hwsim_if_comb */
-   { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_DEVICE) }
-};
-
-static const struct ieee80211_iface_combination hwsim_if_comb[] = {
-   {
-   .limits = hwsim_if_limits,
-   /* remove the last entry which is P2P_DEVICE */
-   .n_limits = ARRAY_SIZE(hwsim_if_limits) - 1,
-   .max_interfaces = 2048,
-   .num_different_channels = 1,
-   .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
-  BIT(NL80211_CHAN_WIDTH_20) |
-  BIT(NL80211_CHAN_WIDTH_40) |
-  BIT(NL80211_CHAN_WIDTH_80) |
-  BIT(NL80211_CHAN_WIDTH_160),
-   },
-};
-
-static const struct ieee80211_iface_combination hwsim_if_comb_p2p_dev[] = {
-   {
-   .limits = hwsim_if_limits,
-   .n_limits = ARRAY_SIZE(hwsim_if_limits),
-   .max_interfaces = 2048,
-   .num_different_channels = 1,
-   .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
-  BIT(NL80211_CHAN_WIDTH_20) |
-  BIT(NL80211_CHAN_WIDTH_40) |
-  BIT(NL80211_CHAN_WIDTH_80) |
-  BIT(NL80211_CHAN_WIDTH_160),
-   },
-};
-
 static spinlock_t hwsim_radio_lock;
 static LIST_HEAD(hwsim_radios);
 static struct workqueue_struct *hwsim_wq;
@@ -513,6 +471,8 @@ struct mac80211_hwsim_data {
struct ieee80211_channel channels_5ghz[ARRAY_SIZE(hwsim_channels_5ghz)];
struct ieee80211_rate rates[ARRAY_SIZE(hwsim_rates)];
struct ieee80211_iface_combination if_combination;
+   struct ieee80211_iface_limit if_limits[3];
+   int n_if_limits;
 
struct mac_address addresses[2];
int channels, idx;
@@ -641,6 +601,7 @@ static const struct nla_policy 
hwsim_genl_policy[HWSIM_ATTR_MAX + 1] = {
[HWSIM_ATTR_NO_VIF] = { .type = NLA_FLAG },
[HWSIM_ATTR_FREQ] = { .type = NLA_U32 },
[HWSIM_ATTR_PERM_ADDR] = { .type = NLA_UNSPEC, .len = ETH_ALEN },
+   [HWSIM_ATTR_IFTYPE_SUPPORT] = { .type = NLA_U32 },
 };
 
 static void mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
@@ -2413,6 +2374,7 @@ struct hwsim_new_radio_params {
const char *hwname;
bool no_vif;
const u8 *perm_addr;
+   u32 iftypes;
 };
 
 static void hwsim_mcast_config_msg(struct sk_buff *mcast_skb,
@@ -2517,6 +2479,29 @@ static void hwsim_mcast_new_radio(int id, struct 
genl_info *info,
nlmsg_free(mcast_skb);
 }
 
+#ifdef CONFIG_MAC80211_MESH
+#define HWSIM_MESH_BIT BIT(NL80211_IFTYPE_MESH_POINT)
+#else
+#define HWSIM_MESH_BIT 0
+#endif
+
+#define HWSIM_DEFAULT_IF_LIMIT \
+   ( \
+   BIT(NL80211_IFTYPE_STATION) | \
+   BIT(NL80211_IFTYPE_P2P_CLIENT) | \
+   BIT(NL80211_IFTYPE_AP) | \
+   BIT(NL80211_IFTYPE_P2P_GO) | \
+   HWSIM_MESH_BIT \
+   )
+
+#define HWSIM_IFTYPE_SUPPORT_MASK \
+   BIT(NL80211_IFTYPE_STATION) | \
+   BIT(NL80211_IFTYPE_AP) | \
+   BIT(NL80211_IFTYPE_P2P_CLIENT) | \
+   BIT(NL80211_IFTYPE_P2P_GO) | \
+   BIT(NL80211_IFTYPE_ADHOC) | \
+ 

For your photos 20

2018-10-17 Thread Jenny

We provide photoshop services to some of the companies from around the
world.

Some online stores use our services for retouching portraits, jewelry,
apparels, furnitures etc.

Here are the details of what we provide:
Clipping path for photos
Deep etching  for photos
Image masking  for photos
Portrait retouching  for photos

Please reply back for further info.
We can provide testing for your photos if needed.

Thanks,
Jenny



[PATCH] qtnfmac: fix error handling in control path

2018-10-17 Thread Sergey Matyukevich
This patch fixes the following warnings:

- smatch
drivers/net/wireless/quantenna/qtnfmac/commands.c:132 
qtnf_cmd_send_with_reply() warn: variable dereferenced before check 'resp' (see 
line 117)
drivers/net/wireless/quantenna/qtnfmac/commands.c:716  qtnf_cmd_get_sta_info() 
error: uninitialized symbol 'var_resp_len'.
drivers/net/wireless/quantenna/qtnfmac/commands.c:1668 qtnf_cmd_get_mac_info() 
error: uninitialized symbol 'var_data_len'.
drivers/net/wireless/quantenna/qtnfmac/commands.c:1697 qtnf_cmd_get_hw_info() 
error: uninitialized symbol 'info_len'.
drivers/net/wireless/quantenna/qtnfmac/commands.c:1753 qtnf_cmd_band_info_get() 
error: uninitialized symbol 'info_len'.
drivers/net/wireless/quantenna/qtnfmac/commands.c:1782 
qtnf_cmd_send_get_phy_params() error: uninitialized symbol 'response_size'.
drivers/net/wireless/quantenna/qtnfmac/commands.c:2438 
qtnf_cmd_get_chan_stats() error: uninitialized symbol 'var_data_len'.

- gcc-8.2.1
drivers/net/wireless/quantenna/qtnfmac/commands.c: In function 
'qtnf_cmd_send_with_reply':
drivers/net/wireless/quantenna/qtnfmac/commands.c:133:54: error: 'resp' may be 
used uninitialized in this function [-Werror=maybe-uninitialized]

Reported-by: Dan Carpenter 
Reported-by: Arnd Bergmann 
Signed-off-by: Sergey Matyukevich 
---
 drivers/net/wireless/quantenna/qtnfmac/commands.c | 21 +
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c 
b/drivers/net/wireless/quantenna/qtnfmac/commands.c
index bfdc1ad30c13..659e7649fe22 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/commands.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c
@@ -84,7 +84,7 @@ static int qtnf_cmd_send_with_reply(struct qtnf_bus *bus,
size_t *var_resp_size)
 {
struct qlink_cmd *cmd;
-   const struct qlink_resp *resp;
+   struct qlink_resp *resp = NULL;
struct sk_buff *resp_skb = NULL;
u16 cmd_id;
u8 mac_id;
@@ -113,7 +113,12 @@ static int qtnf_cmd_send_with_reply(struct qtnf_bus *bus,
if (ret)
goto out;
 
-   resp = (const struct qlink_resp *)resp_skb->data;
+   if (WARN_ON(!resp_skb || !resp_skb->data)) {
+   ret = -EFAULT;
+   goto out;
+   }
+
+   resp = (struct qlink_resp *)resp_skb->data;
ret = qtnf_cmd_check_reply_header(resp, cmd_id, mac_id, vif_id,
  const_resp_size);
if (ret)
@@ -686,7 +691,7 @@ int qtnf_cmd_get_sta_info(struct qtnf_vif *vif, const u8 
*sta_mac,
struct sk_buff *cmd_skb, *resp_skb = NULL;
struct qlink_cmd_get_sta_info *cmd;
const struct qlink_resp_get_sta_info *resp;
-   size_t var_resp_len;
+   size_t var_resp_len = 0;
int ret = 0;
 
cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid,
@@ -1650,7 +1655,7 @@ int qtnf_cmd_get_mac_info(struct qtnf_wmac *mac)
 {
struct sk_buff *cmd_skb, *resp_skb = NULL;
const struct qlink_resp_get_mac_info *resp;
-   size_t var_data_len;
+   size_t var_data_len = 0;
int ret = 0;
 
cmd_skb = qtnf_cmd_alloc_new_cmdskb(mac->macid, QLINK_VIFID_RSVD,
@@ -1680,8 +1685,8 @@ int qtnf_cmd_get_hw_info(struct qtnf_bus *bus)
 {
struct sk_buff *cmd_skb, *resp_skb = NULL;
const struct qlink_resp_get_hw_info *resp;
+   size_t info_len = 0;
int ret = 0;
-   size_t info_len;
 
cmd_skb = qtnf_cmd_alloc_new_cmdskb(QLINK_MACID_RSVD, QLINK_VIFID_RSVD,
QLINK_CMD_GET_HW_INFO,
@@ -1709,9 +1714,9 @@ int qtnf_cmd_band_info_get(struct qtnf_wmac *mac,
   struct ieee80211_supported_band *band)
 {
struct sk_buff *cmd_skb, *resp_skb = NULL;
-   size_t info_len;
struct qlink_cmd_band_info_get *cmd;
struct qlink_resp_band_info_get *resp;
+   size_t info_len = 0;
int ret = 0;
u8 qband;
 
@@ -1764,8 +1769,8 @@ int qtnf_cmd_band_info_get(struct qtnf_wmac *mac,
 int qtnf_cmd_send_get_phy_params(struct qtnf_wmac *mac)
 {
struct sk_buff *cmd_skb, *resp_skb = NULL;
-   size_t response_size;
struct qlink_resp_phy_params *resp;
+   size_t response_size = 0;
int ret = 0;
 
cmd_skb = qtnf_cmd_alloc_new_cmdskb(mac->macid, 0,
@@ -2431,7 +2436,7 @@ int qtnf_cmd_get_chan_stats(struct qtnf_wmac *mac, u16 
channel,
struct sk_buff *cmd_skb, *resp_skb = NULL;
struct qlink_cmd_get_chan_stats *cmd;
struct qlink_resp_get_chan_stats *resp;
-   size_t var_data_len;
+   size_t var_data_len = 0;
int ret = 0;
 
cmd_skb = qtnf_cmd_alloc_new_cmdskb(mac->macid, QLINK_VIFID_RSVD,
-- 
2.11.0



Re: [LKP] f77477b162: hwsim.ap_open_multicast_to_unicast.fail

2018-10-17 Thread Johannes Berg
On Wed, 2018-10-17 at 13:53 +0800, kernel test robot wrote:
> FYI, we noticed the following commit (built with gcc-7):
> 
> commit: f77477b1624c0ac20c0c85c8b529da48686ab54d ("[PATCH] New functionality 
> for aborting ongoing CAC.")
> url: 
> https://github.com/0day-ci/linux/commits/Enrique-Giraldo/New-functionality-for-aborting-ongoing-CAC/20180925-181417
> base: https://git.kernel.org/cgit/linux/kernel/git/jberg/mac80211-next.git 
> master
> 
> in testcase: hwsim
> with following parameters:
> 
>   group: hwsim-01

Yeah, this patch completely broke the nl80211 API :-)

johannes



Re: [PATCH v4 4/8] rt2800: fix registers init for MT7620

2018-10-17 Thread Tom Psyborg
On 16/10/2018, Stanislaw Gruszka  wrote:
> Hello
>
> On Tue, Oct 16, 2018 at 01:32:18PM +0200, Tom Psyborg wrote:
>> I am sending you two builds privately so please check if there are any
>> differences between the two builds and report back. Thanks.
>
> I extracted rt2800lib.ko module from provided images, did disassembly via:
>
> ./staging_dir/toolchain-mipsel_24kc_gcc-7.3.0_musl/bin/mipsel-openwrt-linux-objdump
> \
>  -d -r --prefix-addresses ~/rt2800lib-BUILDn.ko  > ~/BUILDn.dump.txt
>
> command and compered disassembled code. Here is difference:
>
> $ diff -up  BUILD1.dump.txt BUILD2.dump.txt
> --- BUILD1.dump.txt   2018-10-16 16:40:34.834220838 +0200
> +++ BUILD2.dump.txt   2018-10-16 16:40:40.187219211 +0200
> @@ -1,5 +1,5 @@
>
> -/home/stasiu/rt2800lib-BUILD1.ko: file format elf32-tradlittlemips
> +/home/stasiu/rt2800lib-BUILD2.ko: file format elf32-tradlittlemips
>
>
>  Disassembly of section .text:
> @@ -9374,7 +9374,7 @@ Disassembly of section .text:
>  7f80  jalrv0
>  7f84  movea0,s0
>  7f88  lhu v1,732(s0)
> -7f8c  li  v0,21392
> +7f8c  li  v0,25426
>  7f90  bne v1,v0,810c
> 
>  7f94  li  a2,1025
>  7f98  lw  v0,4(s0)
>
> There is no difference in init_registers (which is inlined in
> rt2800_enable_radio). The only difference is in some number
> rt2800_clear_beacon() function.
>
> Regards
> Stanislaw
>

i meant you try it on your nexx device. and post dmesg if you can boot them


RE: Large number of crda failures

2018-10-17 Thread Jean-Pierre TOSONI
Code 234 => exit(-EINVAL)
Could be that crda is started in a context where the COUNTRY environment 
variable is invalid, or started with an argument (crda must be run without 
argument).

> -Message d'origine-
> De : linux-wireless-ow...@vger.kernel.org 
> [mailto:linux-wireless-ow...@vger.kernel.org] De la part de
> Adam Cottrel
> Envoyé : mardi 16 octobre 2018 18:51
> À : linux-wireless@vger.kernel.org
> Objet : Large number of crda failures
> 
> Hi,
> 
> On start up I am getting a large number of error faults reported with CRDA:-
> ➢ ies0600133 systemd-udevd[3949]: Process '/sbin/crda' failed with exit code 
> 234
> Typically, over 50 lines are reported to the syslogs
> 
> However, once the system has fully started, I do not get any issues with 
> running:-
> ➢ iw reg set XX
> 
> These errors are doubling the boot time for Linux. My kernel is 4.14.4 and I 
> am running a Debian base.
> 
> Please can someone advise what is going wrong?
> 
> Best,
> Adam


[PATCH v6 1/2] cfg80211: add peer measurement with FTM initiator API

2018-10-17 Thread Johannes Berg
From: Johannes Berg 

Add a new "peer measurement" API, that can be used to measure
certain things related to a peer. Right now, only implement
FTM (flight time measurement) over it, but the idea is that
it'll be extensible to also support measuring the necessary
things to calculate e.g. angle-of-arrival for WiGig.

The API is structured to have a generic list of peers and
channels to measure with/on, and then for each of those a
set of measurements (again, only FTM right now) to perform.

Results are sent to the requesting socket, including a final
complete message.

Closing the controlling netlink socket will abort a running
measurement.

Signed-off-by: Johannes Berg 
---
v3:
 - add a bit to report "final" for partial results
 - remove list keeping etc. and just unicast out the results
   to the requester (big code reduction ...)
 - also send complete message unicast, and as a result
   remove the multicast group
 - separate out struct cfg80211_pmsr_ftm_request_peer
   from struct cfg80211_pmsr_request_peer
 - document timeout == 0 if no timeout
 - disallow setting timeout nl80211 attribute to 0,
   must not include attribute for no timeout
 - make MAC address randomization optional
 - change num bursts exponent default to 0 (1 burst, rather
   rather than the old default of 15==don't care)

v4:
 - clarify NL80211_ATTR_TIMEOUT documentation

v5:
 - remove unnecessary nl80211 multicast/family changes
 - remove partial results bit/flag, final is sufficient
 - add max_bursts_exponent, max_ftms_per_burst to capability
 - rename "frames per burst" -> "FTMs per burst"

v6:
 - rename cfg80211_pmsr_free_wdev() to cfg80211_pmsr_wdev_down()
   and call it in leave, so the device can't go down with any
   pending measurements
---
 include/net/cfg80211.h   | 261 
 include/uapi/linux/nl80211.h | 417 +
 net/wireless/Makefile|   1 +
 net/wireless/core.c  |  33 ++
 net/wireless/core.h  |   4 +
 net/wireless/nl80211.c   | 192 ++--
 net/wireless/nl80211.h   |  28 ++
 net/wireless/pmsr.c  | 590 +++
 net/wireless/rdev-ops.h  |  25 ++
 net/wireless/trace.h |  68 
 10 files changed, 1600 insertions(+), 19 deletions(-)
 create mode 100644 net/wireless/pmsr.c

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 1fa41b7a1be3..40fe81cb4ad4 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2848,6 +2848,190 @@ struct cfg80211_ftm_responder_stats {
u32 out_of_window_triggers_num;
 };
 
+/**
+ * struct cfg80211_pmsr_ftm_result - FTM result
+ * @failure_reason: if this measurement failed (PMSR status is
+ * %NL80211_PMSR_STATUS_FAILURE), this gives a more precise
+ * reason than just "failure"
+ * @burst_index: if reporting partial results, this is the index
+ * in [0 .. num_bursts-1] of the burst that's being reported
+ * @num_ftmr_attempts: number of FTM request frames transmitted
+ * @num_ftmr_successes: number of FTM request frames acked
+ * @busy_retry_time: if failure_reason is %NL80211_PMSR_FTM_FAILURE_PEER_BUSY,
+ * fill this to indicate in how many seconds a retry is deemed possible
+ * by the responder
+ * @num_bursts_exp: actual number of bursts exponent negotiated
+ * @burst_duration: actual burst duration negotiated
+ * @ftms_per_burst: actual frames per burst negotiated
+ * @lci_len: length of LCI information (if present)
+ * @civicloc_len: length of civic location information (if present)
+ * @lci: LCI data (may be %NULL)
+ * @civicloc: civic location data (may be %NULL)
+ * @rssi_avg: average RSSI over FTM action frames reported
+ * @rssi_spread: spread of the RSSI over FTM action frames reported
+ * @tx_rate: bitrate for transmitted FTM action frame response
+ * @rx_rate: bitrate of received FTM action frame
+ * @rtt_avg: average of RTTs measured (must have either this or @dist_avg)
+ * @rtt_variance: variance of RTTs measured (note that standard deviation is
+ * the square root of the variance)
+ * @rtt_spread: spread of the RTTs measured
+ * @dist_avg: average of distances (mm) measured
+ * (must have either this or @rtt_avg)
+ * @dist_variance: variance of distances measured (see also @rtt_variance)
+ * @dist_spread: spread of distances measured (see also @rtt_spread)
+ * @num_ftmr_attempts_valid: @num_ftmr_attempts is valid
+ * @num_ftmr_successes_valid: @num_ftmr_successes is valid
+ * @rssi_avg_valid: @rssi_avg is valid
+ * @rssi_spread_valid: @rssi_spread is valid
+ * @tx_rate_valid: @tx_rate is valid
+ * @rx_rate_valid: @rx_rate is valid
+ * @rtt_avg_valid: @rtt_avg is valid
+ * @rtt_variance_valid: @rtt_variance is valid
+ * @rtt_spread_valid: @rtt_spread is valid
+ * @dist_avg_valid: @dist_avg is valid
+ * @dist_variance_valid: @dist_variance is valid
+ * @dist_spread_valid: @dist_spread is valid
+ */
+struct cfg80211_pmsr_ftm_result {
+   const u8 *lci;
+   const u8 *civicloc;
+   

[PATCH v6 2/2] mac80211: allow drivers to use peer measurement API

2018-10-17 Thread Johannes Berg
From: Johannes Berg 

There's nothing much for mac80211 to do, so only pass through
the requests with minimal checks and tracing. The driver must
call cfg80211's results APIs.

Signed-off-by: Johannes Berg 
---
v4: first version - just takes the same number as the cfg80211 patch
v5: no changes
v6: no changes
---
 include/net/mac80211.h|  7 +++
 net/mac80211/cfg.c| 22 ++
 net/mac80211/driver-ops.h | 34 ++
 net/mac80211/trace.h  | 12 
 4 files changed, 75 insertions(+)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 71985e95d2d9..e3d57e7a55cc 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3623,6 +3623,9 @@ enum ieee80211_reconfig_type {
  * skb is always a real frame, head may or may not be an A-MSDU.
  * @get_ftm_responder_stats: Retrieve FTM responder statistics, if available.
  * Statistics should be cumulative, currently no way to reset is provided.
+ *
+ * @start_pmsr: start peer measurement (e.g. FTM) (this call can sleep)
+ * @abort_pmsr: abort peer measurement (this call can sleep)
  */
 struct ieee80211_ops {
void (*tx)(struct ieee80211_hw *hw,
@@ -3911,6 +3914,10 @@ struct ieee80211_ops {
int (*get_ftm_responder_stats)(struct ieee80211_hw *hw,
   struct ieee80211_vif *vif,
   struct cfg80211_ftm_responder_stats 
*ftm_stats);
+   int (*start_pmsr)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+ struct cfg80211_pmsr_request *request);
+   void (*abort_pmsr)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+  struct cfg80211_pmsr_request *request);
 };
 
 /**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 51622333d460..2ffbbf4d 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3849,6 +3849,26 @@ ieee80211_get_ftm_responder_stats(struct wiphy *wiphy,
return drv_get_ftm_responder_stats(local, sdata, ftm_stats);
 }
 
+static int
+ieee80211_start_pmsr(struct wiphy *wiphy, struct wireless_dev *dev,
+struct cfg80211_pmsr_request *request)
+{
+   struct ieee80211_local *local = wiphy_priv(wiphy);
+   struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(dev);
+
+   return drv_start_pmsr(local, sdata, request);
+}
+
+static void
+ieee80211_abort_pmsr(struct wiphy *wiphy, struct wireless_dev *dev,
+struct cfg80211_pmsr_request *request)
+{
+   struct ieee80211_local *local = wiphy_priv(wiphy);
+   struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(dev);
+
+   return drv_abort_pmsr(local, sdata, request);
+}
+
 const struct cfg80211_ops mac80211_config_ops = {
.add_virtual_intf = ieee80211_add_iface,
.del_virtual_intf = ieee80211_del_iface,
@@ -3944,4 +3964,6 @@ const struct cfg80211_ops mac80211_config_ops = {
.tx_control_port = ieee80211_tx_control_port,
.get_txq_stats = ieee80211_get_txq_stats,
.get_ftm_responder_stats = ieee80211_get_ftm_responder_stats,
+   .start_pmsr = ieee80211_start_pmsr,
+   .abort_pmsr = ieee80211_abort_pmsr,
 };
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 0b1747a2313d..3e0d5922a440 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -1199,6 +1199,40 @@ drv_get_ftm_responder_stats(struct ieee80211_local 
*local,
return ret;
 }
 
+static inline int drv_start_pmsr(struct ieee80211_local *local,
+struct ieee80211_sub_if_data *sdata,
+struct cfg80211_pmsr_request *request)
+{
+   int ret = -EOPNOTSUPP;
+
+   might_sleep();
+   if (!check_sdata_in_driver(sdata))
+   return -EIO;
+
+   trace_drv_start_pmsr(local, sdata);
+
+   if (local->ops->start_pmsr)
+   ret = local->ops->start_pmsr(>hw, >vif, request);
+   trace_drv_return_int(local, ret);
+
+   return ret;
+}
+
+static inline void drv_abort_pmsr(struct ieee80211_local *local,
+ struct ieee80211_sub_if_data *sdata,
+ struct cfg80211_pmsr_request *request)
+{
+   trace_drv_abort_pmsr(local, sdata);
+
+   might_sleep();
+   if (!check_sdata_in_driver(sdata))
+   return;
+
+   if (local->ops->abort_pmsr)
+   local->ops->abort_pmsr(>hw, >vif, request);
+   trace_drv_return_void(local);
+}
+
 static inline int drv_start_nan(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct cfg80211_nan_conf *conf)
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index 588c51a67c89..ac2f1922d469 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -1882,6 +1882,18 @@ TRACE_EVENT(drv_del_nan_func,
)
 );
 

[PATCH v5 2/2] mac80211: allow drivers to use peer measurement API

2018-10-17 Thread Johannes Berg
From: Johannes Berg 

There's nothing much for mac80211 to do, so only pass through
the requests with minimal checks and tracing. The driver must
call cfg80211's results APIs.

Signed-off-by: Johannes Berg 
---
v4: first version - just takes the same number as the cfg80211 patch
v5: no changes
---
 include/net/mac80211.h|  7 +++
 net/mac80211/cfg.c| 22 ++
 net/mac80211/driver-ops.h | 34 ++
 net/mac80211/trace.h  | 12 
 4 files changed, 75 insertions(+)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 71985e95d2d9..e3d57e7a55cc 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3623,6 +3623,9 @@ enum ieee80211_reconfig_type {
  * skb is always a real frame, head may or may not be an A-MSDU.
  * @get_ftm_responder_stats: Retrieve FTM responder statistics, if available.
  * Statistics should be cumulative, currently no way to reset is provided.
+ *
+ * @start_pmsr: start peer measurement (e.g. FTM) (this call can sleep)
+ * @abort_pmsr: abort peer measurement (this call can sleep)
  */
 struct ieee80211_ops {
void (*tx)(struct ieee80211_hw *hw,
@@ -3911,6 +3914,10 @@ struct ieee80211_ops {
int (*get_ftm_responder_stats)(struct ieee80211_hw *hw,
   struct ieee80211_vif *vif,
   struct cfg80211_ftm_responder_stats 
*ftm_stats);
+   int (*start_pmsr)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+ struct cfg80211_pmsr_request *request);
+   void (*abort_pmsr)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+  struct cfg80211_pmsr_request *request);
 };
 
 /**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 51622333d460..2ffbbf4d 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3849,6 +3849,26 @@ ieee80211_get_ftm_responder_stats(struct wiphy *wiphy,
return drv_get_ftm_responder_stats(local, sdata, ftm_stats);
 }
 
+static int
+ieee80211_start_pmsr(struct wiphy *wiphy, struct wireless_dev *dev,
+struct cfg80211_pmsr_request *request)
+{
+   struct ieee80211_local *local = wiphy_priv(wiphy);
+   struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(dev);
+
+   return drv_start_pmsr(local, sdata, request);
+}
+
+static void
+ieee80211_abort_pmsr(struct wiphy *wiphy, struct wireless_dev *dev,
+struct cfg80211_pmsr_request *request)
+{
+   struct ieee80211_local *local = wiphy_priv(wiphy);
+   struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(dev);
+
+   return drv_abort_pmsr(local, sdata, request);
+}
+
 const struct cfg80211_ops mac80211_config_ops = {
.add_virtual_intf = ieee80211_add_iface,
.del_virtual_intf = ieee80211_del_iface,
@@ -3944,4 +3964,6 @@ const struct cfg80211_ops mac80211_config_ops = {
.tx_control_port = ieee80211_tx_control_port,
.get_txq_stats = ieee80211_get_txq_stats,
.get_ftm_responder_stats = ieee80211_get_ftm_responder_stats,
+   .start_pmsr = ieee80211_start_pmsr,
+   .abort_pmsr = ieee80211_abort_pmsr,
 };
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 0b1747a2313d..3e0d5922a440 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -1199,6 +1199,40 @@ drv_get_ftm_responder_stats(struct ieee80211_local 
*local,
return ret;
 }
 
+static inline int drv_start_pmsr(struct ieee80211_local *local,
+struct ieee80211_sub_if_data *sdata,
+struct cfg80211_pmsr_request *request)
+{
+   int ret = -EOPNOTSUPP;
+
+   might_sleep();
+   if (!check_sdata_in_driver(sdata))
+   return -EIO;
+
+   trace_drv_start_pmsr(local, sdata);
+
+   if (local->ops->start_pmsr)
+   ret = local->ops->start_pmsr(>hw, >vif, request);
+   trace_drv_return_int(local, ret);
+
+   return ret;
+}
+
+static inline void drv_abort_pmsr(struct ieee80211_local *local,
+ struct ieee80211_sub_if_data *sdata,
+ struct cfg80211_pmsr_request *request)
+{
+   trace_drv_abort_pmsr(local, sdata);
+
+   might_sleep();
+   if (!check_sdata_in_driver(sdata))
+   return;
+
+   if (local->ops->abort_pmsr)
+   local->ops->abort_pmsr(>hw, >vif, request);
+   trace_drv_return_void(local);
+}
+
 static inline int drv_start_nan(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct cfg80211_nan_conf *conf)
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index 588c51a67c89..ac2f1922d469 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -1882,6 +1882,18 @@ TRACE_EVENT(drv_del_nan_func,
)
 );
 

[PATCH v5 1/2] cfg80211: add peer measurement with FTM initiator API

2018-10-17 Thread Johannes Berg
From: Johannes Berg 

Add a new "peer measurement" API, that can be used to measure
certain things related to a peer. Right now, only implement
FTM (flight time measurement) over it, but the idea is that
it'll be extensible to also support measuring the necessary
things to calculate e.g. angle-of-arrival for WiGig.

The API is structured to have a generic list of peers and
channels to measure with/on, and then for each of those a
set of measurements (again, only FTM right now) to perform.

Results are sent to the requesting socket, including a final
complete message.

Closing the controlling netlink socket will abort a running
measurement.

Signed-off-by: Johannes Berg 
---
v3:
 - add a bit to report "final" for partial results
 - remove list keeping etc. and just unicast out the results
   to the requester (big code reduction ...)
 - also send complete message unicast, and as a result
   remove the multicast group
 - separate out struct cfg80211_pmsr_ftm_request_peer
   from struct cfg80211_pmsr_request_peer
 - document timeout == 0 if no timeout
 - disallow setting timeout nl80211 attribute to 0,
   must not include attribute for no timeout
 - make MAC address randomization optional
 - change num bursts exponent default to 0 (1 burst, rather
   rather than the old default of 15==don't care)

v4:
 - clarify NL80211_ATTR_TIMEOUT documentation

v5:
 - remove unnecessary nl80211 multicast/family changes
 - remove partial results bit/flag, final is sufficient
 - add max_bursts_exponent, max_ftms_per_burst to capability
 - rename "frames per burst" -> "FTMs per burst"
---
 include/net/cfg80211.h   | 261 
 include/uapi/linux/nl80211.h | 417 +
 net/wireless/Makefile|   1 +
 net/wireless/core.c  |  33 ++
 net/wireless/core.h  |   4 +
 net/wireless/nl80211.c   | 192 ++--
 net/wireless/nl80211.h   |  28 ++
 net/wireless/pmsr.c  | 590 +++
 net/wireless/rdev-ops.h  |  25 ++
 net/wireless/trace.h |  68 
 10 files changed, 1600 insertions(+), 19 deletions(-)
 create mode 100644 net/wireless/pmsr.c

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 1fa41b7a1be3..40fe81cb4ad4 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2848,6 +2848,190 @@ struct cfg80211_ftm_responder_stats {
u32 out_of_window_triggers_num;
 };
 
+/**
+ * struct cfg80211_pmsr_ftm_result - FTM result
+ * @failure_reason: if this measurement failed (PMSR status is
+ * %NL80211_PMSR_STATUS_FAILURE), this gives a more precise
+ * reason than just "failure"
+ * @burst_index: if reporting partial results, this is the index
+ * in [0 .. num_bursts-1] of the burst that's being reported
+ * @num_ftmr_attempts: number of FTM request frames transmitted
+ * @num_ftmr_successes: number of FTM request frames acked
+ * @busy_retry_time: if failure_reason is %NL80211_PMSR_FTM_FAILURE_PEER_BUSY,
+ * fill this to indicate in how many seconds a retry is deemed possible
+ * by the responder
+ * @num_bursts_exp: actual number of bursts exponent negotiated
+ * @burst_duration: actual burst duration negotiated
+ * @ftms_per_burst: actual frames per burst negotiated
+ * @lci_len: length of LCI information (if present)
+ * @civicloc_len: length of civic location information (if present)
+ * @lci: LCI data (may be %NULL)
+ * @civicloc: civic location data (may be %NULL)
+ * @rssi_avg: average RSSI over FTM action frames reported
+ * @rssi_spread: spread of the RSSI over FTM action frames reported
+ * @tx_rate: bitrate for transmitted FTM action frame response
+ * @rx_rate: bitrate of received FTM action frame
+ * @rtt_avg: average of RTTs measured (must have either this or @dist_avg)
+ * @rtt_variance: variance of RTTs measured (note that standard deviation is
+ * the square root of the variance)
+ * @rtt_spread: spread of the RTTs measured
+ * @dist_avg: average of distances (mm) measured
+ * (must have either this or @rtt_avg)
+ * @dist_variance: variance of distances measured (see also @rtt_variance)
+ * @dist_spread: spread of distances measured (see also @rtt_spread)
+ * @num_ftmr_attempts_valid: @num_ftmr_attempts is valid
+ * @num_ftmr_successes_valid: @num_ftmr_successes is valid
+ * @rssi_avg_valid: @rssi_avg is valid
+ * @rssi_spread_valid: @rssi_spread is valid
+ * @tx_rate_valid: @tx_rate is valid
+ * @rx_rate_valid: @rx_rate is valid
+ * @rtt_avg_valid: @rtt_avg is valid
+ * @rtt_variance_valid: @rtt_variance is valid
+ * @rtt_spread_valid: @rtt_spread is valid
+ * @dist_avg_valid: @dist_avg is valid
+ * @dist_variance_valid: @dist_variance is valid
+ * @dist_spread_valid: @dist_spread is valid
+ */
+struct cfg80211_pmsr_ftm_result {
+   const u8 *lci;
+   const u8 *civicloc;
+   unsigned int lci_len;
+   unsigned int civicloc_len;
+   enum nl80211_peer_measurement_ftm_failure_reasons failure_reason;
+   u32 num_ftmr_attempts, 

Re: [PATCH v4 1/2] cfg80211: add peer measurement with FTM initiator API

2018-10-17 Thread Johannes Berg
On Wed, 2018-10-17 at 14:52 +0300, Lior David wrote:
> 
> On 10/16/2018 12:30 PM, Johannes Berg wrote:
> 
> [...]
> > + * @rtt_avg: average of RTTs measured (must have either this or @dist_avg)
> > + * @rtt_variance: variance of RTTs measured (note that standard deviation 
> > is
> > + * the square root of the variance)
> > + * @rtt_spread: spread of the RTTs measured
> > + * @dist_avg: average of distances (mm) measured
> > + * (must have either this or @rtt_avg)
> > + * @dist_variance: variance of distances measured (see also @rtt_variance)
> > + * @dist_spread: spread of distances measured (see also @rtt_spread)
> 
> I don't remember much from my statistics class, can you please provide some
> details about the variance and spread fields? Alternatively I can look at the
> first driver implementation for reference, unless it is calculated by FW :-)

It can only be calculated by firmware, unless the firmware reports all
measurements.

Spread here is just "highest value - lowest value.

Variance is a more complicated measure of the distribution... What do
you want to know? Here we have a finite set of values, so 

https://en.wikipedia.org/wiki/Variance#Population_variance

> > + * @partial: indicates that this is a partial result for this type
> > + * @final: if reporting partial results, mark this as the last one
> 
> Maybe it is enough to have just the "final" bit? I mean if final bit is clear
> doesn't this imply the result is partial since more results will follow?

Hmm, good point.

> > +/**
> > + * struct cfg80211_pmsr_capabilities - cfg80211 peer measurement 
> > capabilities
> > + * @max_peers: maximum number of peers in a single measurement
> > + * @report_ap_tsf: can report assoc AP's TSF for radio resource measurement
> > + * @randomize_mac_addr: can randomize MAC address for measurement
> > + * @ftm.supported: FTM measurement is supported
> > + * @ftm.asap: ASAP-mode is supported
> > + * @ftm.non_asap: non-ASAP-mode is supported
> > + * @ftm.request_lci: can request LCI data
> > + * @ftm.request_civicloc: can request civic location data
> > + * @ftm.preambles: bitmap of preambles supported ( nl80211_preamble)
> > + * @ftm.bandwidths: bitmap of bandwidths supported ( 
> > nl80211_chan_width)
> 
> Consider adding ftm.max_bursts (or max_bursts_exponent) 

Ok.

> and
> ftm.max_measurements_per_burst (is this the same as frames_per_burst?). For
> example in our implementation we can't do more than 6 measurements per burst
> because of resource limitations.

I guess measurements per burst are frames per burst? I'm not counting 4x
the frames because those are exchanged.

The spec says "FTMs per Burst", so perhaps I should align with that.

I suppose we can add that.

> Ok I see variance and spread are better documented here, maybe move the units
> information to the above structure definitions?

Well, they may seem above - but I thought it was more important to
document it better in the userspace API.

> > +/* multicast groups */
> > +enum nl80211_multicast_groups {
> > +   NL80211_MCGRP_CONFIG,
> > +   NL80211_MCGRP_SCAN,
> > +   NL80211_MCGRP_REGULATORY,
> > +   NL80211_MCGRP_MLME,
> > +   NL80211_MCGRP_VENDOR,
> > +   NL80211_MCGRP_NAN,
> > +   NL80211_MCGRP_TESTMODE /* keep last - ifdef! */
> > +};
> > +
> 
> Are these changes needed anymore since you don't send results as multicast?

No, good point.

johannes



Re: [PATCH v4 1/2] cfg80211: add peer measurement with FTM initiator API

2018-10-17 Thread Lior David



On 10/16/2018 12:30 PM, Johannes Berg wrote:

[...]
> + * @rtt_avg: average of RTTs measured (must have either this or @dist_avg)
> + * @rtt_variance: variance of RTTs measured (note that standard deviation is
> + *   the square root of the variance)
> + * @rtt_spread: spread of the RTTs measured
> + * @dist_avg: average of distances (mm) measured
> + *   (must have either this or @rtt_avg)
> + * @dist_variance: variance of distances measured (see also @rtt_variance)
> + * @dist_spread: spread of distances measured (see also @rtt_spread)
I don't remember much from my statistics class, can you please provide some
details about the variance and spread fields? Alternatively I can look at the
first driver implementation for reference, unless it is calculated by FW :-)


> +
> +/**
> + * struct cfg80211_pmsr_result - peer measurement result
> + * @addr: address of the peer
> + * @host_time: host time (use ktime_get_boottime() adjust to the time when 
> the
> + *   measurement was made)
> + * @ap_tsf: AP's TSF at measurement time
> + * @status: status of the measurement
> + * @partial: indicates that this is a partial result for this type
> + * @final: if reporting partial results, mark this as the last one
Maybe it is enough to have just the "final" bit? I mean if final bit is clear
doesn't this imply the result is partial since more results will follow?

[...]

>  /*
> @@ -3863,6 +4055,33 @@ struct wiphy_iftype_ext_capab {
>   u8 extended_capabilities_len;
>  };
>  
> +/**
> + * struct cfg80211_pmsr_capabilities - cfg80211 peer measurement capabilities
> + * @max_peers: maximum number of peers in a single measurement
> + * @report_ap_tsf: can report assoc AP's TSF for radio resource measurement
> + * @randomize_mac_addr: can randomize MAC address for measurement
> + * @ftm.supported: FTM measurement is supported
> + * @ftm.asap: ASAP-mode is supported
> + * @ftm.non_asap: non-ASAP-mode is supported
> + * @ftm.request_lci: can request LCI data
> + * @ftm.request_civicloc: can request civic location data
> + * @ftm.preambles: bitmap of preambles supported ( nl80211_preamble)
> + * @ftm.bandwidths: bitmap of bandwidths supported ( nl80211_chan_width)
Consider adding ftm.max_bursts (or max_bursts_exponent) and
ftm.max_measurements_per_burst (is this the same as frames_per_burst?). For
example in our implementation we can't do more than 6 measurements per burst
because of resource limitations.

> +
> +/**
> + * enum nl80211_peer_measurement_ftm_resp - FTM response attributes
> + * @__NL80211_PMSR_FTM_RESP_ATTR_INVALID: invalid
> + *
> + * @NL80211_PMSR_FTM_RESP_ATTR_FAIL_REASON: FTM-specific failure reason
> + *   (u32, optional)
> + * @NL80211_PMSR_FTM_RESP_ATTR_BURST_INDEX: optional, if bursts are reported
> + *   as separate results then it will be the burst index 0...(N-1) and
> + *   the top level will indicate partial results (u32)
> + * @NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_ATTEMPTS: number of FTM Request 
> frames
> + *   transmitted (u32, optional)
> + * @NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_SUCCESSES: number of FTM Request 
> frames
> + *   that were acknowleged (u32, optional)
> + * @NL80211_PMSR_FTM_RESP_ATTR_BUSY_RETRY_TIME: retry time received from the
> + *   busy peer (u32, seconds)
> + * @NL80211_PMSR_FTM_RESP_ATTR_NUM_BURSTS_EXP: actual number of bursts 
> exponent
> + *   used by the responder (similar to request, u8)
> + * @NL80211_PMSR_FTM_RESP_ATTR_BURST_DURATION: actual burst duration used by
> + *   the responder (similar to request, u8)
> + * @NL80211_PMSR_FTM_RESP_ATTR_FRAMES_PER_BURST: actual frames per burst used
> + *   by the responder (similar to request, u8)
> + * @NL80211_PMSR_FTM_RESP_ATTR_RSSI_AVG: average RSSI across all FTM action
> + *   frames (optional, s32, 1/2 dBm)
> + * @NL80211_PMSR_FTM_RESP_ATTR_RSSI_SPREAD: RSSI spread across all FTM action
> + *   frames (optional, s32, 1/2 dBm)
> + * @NL80211_PMSR_FTM_RESP_ATTR_TX_RATE: bitrate we used for the response to 
> the
> + *   FTM action frame (optional, nested, using  nl80211_rate_info
> + *   attributes)
> + * @NL80211_PMSR_FTM_RESP_ATTR_RX_RATE: bitrate the responder used for the 
> FTM
> + *   action frame (optional, nested, using  nl80211_rate_info attrs)
> + * @NL80211_PMSR_FTM_RESP_ATTR_RTT_AVG: average RTT (s64, picoseconds, 
> optional
> + *   but one of RTT/DIST must be present)
> + * @NL80211_PMSR_FTM_RESP_ATTR_RTT_VARIANCE: RTT variance (u64, ps^2, note 
> that
> + *   standard deviation is the square root of variance, optional)
> + * @NL80211_PMSR_FTM_RESP_ATTR_RTT_SPREAD: RTT spread (u64, picoseconds,
> + *   optional)
> + * @NL80211_PMSR_FTM_RESP_ATTR_DIST_AVG: average distance (s64, mm, optional
> + *   but one of RTT/DIST must be present)
> + * @NL80211_PMSR_FTM_RESP_ATTR_DIST_VARIANCE: distance variance (u64, mm^2, 
> note
> + *   that standard deviation is the square root of variance, optional)
> + * @NL80211_PMSR_FTM_RESP_ATTR_DIST_SPREAD: distance spread (u64, mm, 
> optional)
Ok I see variance and 

Re: [PATCH] mt76: clean up unused leftover EXPORT_SYMBOLs

2018-10-17 Thread Lorenzo Bianconi
> Make previously exported functions static where possible
> 
> Signed-off-by: Felix Fietkau 
> ---
>  drivers/net/wireless/mediatek/mt76/mt76.h | 2 --
>  drivers/net/wireless/mediatek/mt76/mt76x02_mac.c  | 8 +---
>  drivers/net/wireless/mediatek/mt76/mt76x02_mac.h  | 2 --
>  drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c | 1 -
>  drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c | 2 --
>  drivers/net/wireless/mediatek/mt76/usb.c  | 6 ++
>  6 files changed, 3 insertions(+), 18 deletions(-)

Acked-by: Lorenzo Bianconi 


[PATCH] mt76: clean up unused leftover EXPORT_SYMBOLs

2018-10-17 Thread Felix Fietkau
Make previously exported functions static where possible

Signed-off-by: Felix Fietkau 
---
 drivers/net/wireless/mediatek/mt76/mt76.h | 2 --
 drivers/net/wireless/mediatek/mt76/mt76x02_mac.c  | 8 +---
 drivers/net/wireless/mediatek/mt76/mt76x02_mac.h  | 2 --
 drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c | 1 -
 drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c | 2 --
 drivers/net/wireless/mediatek/mt76/usb.c  | 6 ++
 6 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h 
b/drivers/net/wireless/mediatek/mt76/mt76.h
index 3bfa7f5e3513..53ddc4fa5884 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76.h
@@ -668,8 +668,6 @@ int mt76u_vendor_request(struct mt76_dev *dev, u8 req,
 void *buf, size_t len);
 void mt76u_single_wr(struct mt76_dev *dev, const u8 req,
 const u16 offset, const u32 val);
-u32 mt76u_rr(struct mt76_dev *dev, u32 addr);
-void mt76u_wr(struct mt76_dev *dev, u32 addr, u32 val);
 int mt76u_init(struct mt76_dev *dev, struct usb_interface *intf);
 void mt76u_deinit(struct mt76_dev *dev);
 int mt76u_buf_alloc(struct mt76_dev *dev, struct mt76u_buf *buf,
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c 
b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
index 3896da690b83..899ffd026e62 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
@@ -18,7 +18,7 @@
 #include "mt76x02.h"
 #include "mt76x02_trace.h"
 
-enum mt76x02_cipher_type
+static enum mt76x02_cipher_type
 mt76x02_mac_get_key_info(struct ieee80211_key_conf *key, u8 *key_data)
 {
memset(key_data, 0, 32);
@@ -43,7 +43,6 @@ mt76x02_mac_get_key_info(struct ieee80211_key_conf *key, u8 
*key_data)
return MT_CIPHER_NONE;
}
 }
-EXPORT_SYMBOL_GPL(mt76x02_mac_get_key_info);
 
 int mt76x02_mac_shared_key_setup(struct mt76x02_dev *dev, u8 vif_idx,
 u8 key_idx, struct ieee80211_key_conf *key)
@@ -95,7 +94,6 @@ int mt76x02_mac_wcid_set_key(struct mt76x02_dev *dev, u8 idx,
 
return 0;
 }
-EXPORT_SYMBOL_GPL(mt76x02_mac_wcid_set_key);
 
 void mt76x02_mac_wcid_setup(struct mt76x02_dev *dev, u8 idx,
u8 vif_idx, u8 *mac)
@@ -154,7 +152,6 @@ void mt76x02_txq_init(struct mt76x02_dev *dev, struct 
ieee80211_txq *txq)
 
mt76_txq_init(>mt76, txq);
 }
-EXPORT_SYMBOL_GPL(mt76x02_txq_init);
 
 static __le16
 mt76x02_mac_tx_rate_val(struct mt76x02_dev *dev,
@@ -239,7 +236,6 @@ bool mt76x02_mac_load_tx_status(struct mt76x02_dev *dev,
 
return true;
 }
-EXPORT_SYMBOL_GPL(mt76x02_mac_load_tx_status);
 
 static int
 mt76x02_mac_process_tx_rate(struct ieee80211_tx_rate *txrate, u16 rate,
@@ -483,7 +479,6 @@ void mt76x02_send_tx_status(struct mt76x02_dev *dev,
 out:
rcu_read_unlock();
 }
-EXPORT_SYMBOL_GPL(mt76x02_send_tx_status);
 
 int
 mt76x02_mac_process_rate(struct mt76_rx_status *status, u16 rate)
@@ -705,7 +700,6 @@ void mt76x02_mac_poll_tx_status(struct mt76x02_dev *dev, 
bool irq)
kfifo_put(>txstatus_fifo, stat);
}
 }
-EXPORT_SYMBOL_GPL(mt76x02_mac_poll_tx_status);
 
 static void
 mt76x02_mac_queue_txdone(struct mt76x02_dev *dev, struct sk_buff *skb,
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.h 
b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.h
index c1936e2277d1..81c16aef6a94 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.h
@@ -199,8 +199,6 @@ mt76x02_skb_tx_info(struct sk_buff *skb)
 }
 
 void mt76x02_txq_init(struct mt76x02_dev *dev, struct ieee80211_txq *txq);
-enum mt76x02_cipher_type
-mt76x02_mac_get_key_info(struct ieee80211_key_conf *key, u8 *key_data);
 
 int mt76x02_mac_shared_key_setup(struct mt76x02_dev *dev, u8 vif_idx,
 u8 key_idx, struct ieee80211_key_conf *key);
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c 
b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
index 39f092034240..784b76e08382 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
@@ -225,7 +225,6 @@ static void mt76x02_dma_enable(struct mt76x02_dev *dev)
mt76_clear(dev, MT_WPDMA_GLO_CFG,
   MT_WPDMA_GLO_CFG_TX_WRITEBACK_DONE);
 }
-EXPORT_SYMBOL_GPL(mt76x02_dma_enable);
 
 void mt76x02_dma_cleanup(struct mt76x02_dev *dev)
 {
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c 
b/drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c
index d3de08872d6e..7ec3f8f5f228 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c
@@ -110,7 +110,6 @@ s8 mt76x02_tx_get_max_txpwr_adj(struct mt76x02_dev *dev,
 
return max_txpwr;
 }
-EXPORT_SYMBOL_GPL(mt76x02_tx_get_max_txpwr_adj);
 
 s8 

Re: [RFC v2] cfg80211: add peer measurement with FTM API

2018-10-17 Thread Johannes Berg
On Wed, 2018-10-17 at 13:05 +0300, Lior David wrote:
> 
> On 10/11/2018 1:05 PM, Johannes Berg wrote:
> > 
> > > Thanks for the explanation. The send to same socket does sound more 
> > > efficient.
> > > (In our internal implementation with vendor commands we were forced
> > > to send the results as broadcast...)
> > 
> > I suppose we can fix that, in the sense that we can add API to allow
> > vendor commands to know the socket to send back to etc.
> > 
> 
> I think that would be useful in general though as far as I know we don't have
> any pending feature that requires it right now.

Ok. For the record, I have no objection to somebody who needs this doing
it, but it's not entirely trivial so I'm not going to just do it now.

johannes



Re: [RFC v2] cfg80211: add peer measurement with FTM API

2018-10-17 Thread Lior David



On 10/11/2018 1:05 PM, Johannes Berg wrote:
> 
>> Thanks for the explanation. The send to same socket does sound more 
>> efficient.
>> (In our internal implementation with vendor commands we were forced
>> to send the results as broadcast...)
> 
> I suppose we can fix that, in the sense that we can add API to allow
> vendor commands to know the socket to send back to etc.
> 
I think that would be useful in general though as far as I know we don't have
any pending feature that requires it right now.

[...]

>>
>> As I remember the driver/FW can easily find the connected channel for 
>> connected
>> station. For unconnected station we should probably force this parameter.
> 
> Should be able to, yes, but I suppose even userspace can. It just seems
> like extra complexity to impose on the driver, since cfg80211 doesn't
> necessarily have all the right information.
> 
Agree with this. I guess we can keep the channel parameter mandatory.

> Actually, hmm, that would imply "use maximum bandwidth" or something?
> And then what if that bandwidth isn't possible with FTM for some reason?
> It's a bit tricky then.
> 
DMG always uses the entire channel (2160MHz). We may need to use partial channel
in EDMG but not sure yet. We have an upcoming patch for EDMG support so we can
deal with this later.

>>
>> Good point. I see we currently use 20_NOHT for DMG, guess we can continue 
>> using it.
> 
> Well, I think it'd make more sense to just enforce the DMG bandwidth
> everywhere, but I won't force the issue over this.
> 
Ok. I think using 20_NOHT for now is more consistent since other APIs specify it
for DMG channels.

Thanks,
Lior


[no subject]

2018-10-17 Thread Mavis Wancyzk



Hallo Am Mrs Mavis Wancyzk, Sie haben eine Spende von 2,800,000.00EUR Ich 
gewann die America Lottery im Wert von $ 758.7 Millionen und ich spende einen 
Teil davon an fünf Glückliche Menschen und Wohltätigkeits-Häuser in Erinnerung 
an meinen verstorbenen Ehemann, der an Krebs gestorben ist . Kontaktieren Sie 
mich für weitere Details unter: [maviswanczy...@hotmail.com]
 
http://Money.cnn.com/2017/08/23/News/Powerball-700-Million-Jackpot/Index.html


Re: [RFC 4/9] mt76x0: pci: add pre_tbtt_tasklet support

2018-10-17 Thread Lorenzo Bianconi
> On Tue, Oct 16, 2018 at 11:23:26PM +0200, Lorenzo Bianconi wrote:
> > Enable/disable pre_tbtt_tasklet in mt76x0 driver in order
> > to add AP support
> 
> Is there some USB limitation that disallow tho do this for USB
> as well? Or perhaps this is easer for now do this for PCI devices
> and add AP support for USB later? But perhaps, since you adding
> support for AP you could do this for both buses.

AFAIK usb devices do not have TBTT interrupts so I think we can
use a timer to load beacon frames into the device. Anyway I guess
pre_tbtt_tasklet tasklet is something mmio specific.

Regards,
Lorenzo

> 
> Thanks
> Stanislaw 


Re: [RFC 4/9] mt76x0: pci: add pre_tbtt_tasklet support

2018-10-17 Thread Stanislaw Gruszka
On Tue, Oct 16, 2018 at 11:23:26PM +0200, Lorenzo Bianconi wrote:
> Enable/disable pre_tbtt_tasklet in mt76x0 driver in order
> to add AP support

Is there some USB limitation that disallow tho do this for USB
as well? Or perhaps this is easer for now do this for PCI devices
and add AP support for USB later? But perhaps, since you adding
support for AP you could do this for both buses.

Thanks
Stanislaw 


Re: [bug report] iwlwifi: mvm: kill INACTIVE queue state

2018-10-17 Thread Johannes Berg
Hi Dan,

>   1239  ret = iwl_mvm_remove_inactive_tids(mvm, mvmsta, i,
>   1240 
> inactive_tid_bitmap,
>   1241 _queues,
>   1242 _queues);
>   1243  if (ret >= 0 && free_queue < 0)
> 
> 
> The iwl_mvm_remove_inactive_tids() returns a bool so it doesn't make
> sense to test for >= 0.  Probably we should test for ret == true?

Huh, thanks for the report, we'll check.

johannes



[bug report] iwlwifi: mvm: kill INACTIVE queue state

2018-10-17 Thread Dan Carpenter
Hello Johannes Berg,

The patch 724fe7710ac5: "iwlwifi: mvm: kill INACTIVE queue state"
from Jul 4, 2018, leads to the following static checker warning:

drivers/net/wireless/intel/iwlwifi/mvm/sta.c:1243 
iwl_mvm_inactivity_check()
warn: 'iwl_mvm_remove_inactive_tids(mvm, mvmsta, i, 
inactive_tid_bitmap, _queues, _queues)' is unsigned

drivers/net/wireless/intel/iwlwifi/mvm/sta.c
  1223  /*
  1224   * If the STA doesn't exist anymore, it isn't an error. 
It could
  1225   * be that it was removed since getting the queues, and 
in this
  1226   * case it should've inactivated its queues anyway.
  1227   */
  1228  if (IS_ERR_OR_NULL(sta))
  1229  continue;
  1230  
  1231  mvmsta = iwl_mvm_sta_from_mac80211(sta);
  1232  
  1233  /* this isn't so nice, but works OK due to the way we 
loop */
  1234  spin_unlock(>queue_info_lock);
  1235  
  1236  /* and we need this locking order */
  1237  spin_lock(>lock);
  1238  spin_lock(>queue_info_lock);
  1239  ret = iwl_mvm_remove_inactive_tids(mvm, mvmsta, i,
  1240 inactive_tid_bitmap,
  1241 _queues,
  1242 _queues);
  1243  if (ret >= 0 && free_queue < 0)


The iwl_mvm_remove_inactive_tids() returns a bool so it doesn't make
sense to test for >= 0.  Probably we should test for ret == true?

  1244  free_queue = ret;
  1245  /* only unlock sta lock - we still need the queue info 
lock */
  1246  spin_unlock(>lock);
  1247  }

regards,
dan carpenter


Re: [PATCH] iwlwifi: acpi: Use kmemdup rather than duplicating its implementation in iwl_parse_nvm_mcc_info

2018-10-17 Thread YueHaibing



On 2018/10/17 15:25, Luciano Coelho wrote:
> On Fri, 2018-10-05 at 09:02 +, YueHaibing wrote:
>> Use kmemdup rather than duplicating its implementation
>>
>> Signed-off-by: YueHaibing 
>> ---
> 
> Thanks, YueHaibing.  I have applied this in our internal tree and it
> will eventually reach the mainline, following our normal upstreaming
> process.
> 
> I have modified the subject and the commit message a bit.

Thanks you!

> 
> --
> Cheers,
> Luca.
> 
> 
> .
> 



Re: [PATCH] iwlwifi: acpi: Use kmemdup rather than duplicating its implementation in iwl_parse_nvm_mcc_info

2018-10-17 Thread Luciano Coelho
On Fri, 2018-10-05 at 09:02 +, YueHaibing wrote:
> Use kmemdup rather than duplicating its implementation
> 
> Signed-off-by: YueHaibing 
> ---

Thanks, YueHaibing.  I have applied this in our internal tree and it
will eventually reach the mainline, following our normal upstreaming
process.

I have modified the subject and the commit message a bit.

--
Cheers,
Luca.



Re: [PATCH] Minor corrections of comments in the iwlwifi mvm rate scaling source

2018-10-17 Thread Luca Coelho
On Thu, 2018-09-13 at 13:07 +0200, Rémy Grünblatt wrote:
> Hi,
> 
> I believe some comments in the rate scaling source of the iwlwifi mvm
> are wrong, as we have #define RATE_MCS_SGI_POS  13 and #define
> RATE_MCS_SGI_MSK  (1 << RATE_MCS_SGI_POS)

Hi Remy,

Sorry for the delay, your patch was not correctly formatted and since
this is a minor fix in a comment, it slipped through my fingers.

I have made a different patch to fix this, changing the hex values for
the tables instead, because in the example we say this is about SGI, so
I just set the SGI bit:

- * rate[0] 0x400D019 VHT | ANT: AB BW: 80Mhz MCS: 9 NSS: 2 SGI
- * rate[1] 0x400D019 VHT | ANT: AB BW: 80Mhz MCS: 9 NSS: 2 SGI
- * rate[2] 0x400D018 VHT | ANT: AB BW: 80Mhz MCS: 8 NSS: 2 SGI
- * rate[3] 0x400D018 VHT | ANT: AB BW: 80Mhz MCS: 8 NSS: 2 SGI
- * rate[4] 0x400D017 VHT | ANT: AB BW: 80Mhz MCS: 7 NSS: 2 SGI
- * rate[5] 0x400D017 VHT | ANT: AB BW: 80Mhz MCS: 7 NSS: 2 SGI
+ * rate[0] 0x400F019 VHT | ANT: AB BW: 80Mhz MCS: 9 NSS: 2 SGI
+ * rate[1] 0x400F019 VHT | ANT: AB BW: 80Mhz MCS: 9 NSS: 2 SGI
+ * rate[2] 0x400F018 VHT | ANT: AB BW: 80Mhz MCS: 8 NSS: 2 SGI
+ * rate[3] 0x400F018 VHT | ANT: AB BW: 80Mhz MCS: 8 NSS: 2 SGI
+ * rate[4] 0x400F017 VHT | ANT: AB BW: 80Mhz MCS: 7 NSS: 2 SGI
+ * rate[5] 0x400F017 VHT | ANT: AB BW: 80Mhz MCS: 7 NSS: 2 SGI


This is now queued in our internal tree and will reach the mainline at
some point, following our normal process.

Thanks for reporting.

--
Cheers,
Luca.