Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: [PATCH] cfg80211: cap 20MHz VHT bitrate at MCS 8
From: Pedersen, Thomas @ 2016-09-16 18:31 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Ben Greear, linux-wireless
In-Reply-To: <1473789740.5622.3.camel@sipsolutions.net>

T24gVHVlLCAyMDE2LTA5LTEzIGF0IDIwOjAyICswMjAwLCBKb2hhbm5lcyBCZXJnIHdyb3RlOg0K
PiA+IFllYWggc28gYXBwYXJlbnRseSB0aGUgb3ZlcmhlYWQgaW52b2x2ZWQgaW4gMjU2LVFBTSA1
LzYgKE1DUyA5KQ0KPiA+IHJlc3VsdHMgaW4gbG93ZXIgZWZmZWN0aXZlIGJpdHJhdGUgdGhhbiBq
dXN0IHVzaW5nIE1DUyA4ICh1bmxlc3MNCj4gPiB5b3UncmUgdXNpbmcgMyBzcGF0aWFsIHN0cmVh
bXMpLg0KPiANCj4gQWguIEkgdG9vayBhIC0gdmVyeSBicmllZiAtIGxvb2sgYXQgd2h5IHRoaXMg
b25lIGlzIGludmFsaWQgYW5kDQo+IGNvdWxkbid0IGZpZ3VyZSBpdCBvdXQuDQoNCkkgZG9uJ3Qg
a25vdyB3aGF0IEknbSB0YWxraW5nIGFib3V0LiBUaGlzIHdhcyBhIG1pc2NvbW11bmljYXRpb24g
ZnJvbQ0KdGhlIHN5c3RlbXMgdGVhbS4gSSB0aGluayBpdCB3YXMgYmVjYXVzZSBFVk0gdGFyZ2V0
cyB3ZXJlIHRvbyBoaWdoLCBidXQNCkxEUEMgZml4ZXMgdGhhdCwgc2VlIGJlbG93Lg0KDQo+ID4g
IFNvdW5kcyBsaWtlIGEgcmF0ZSBjb250cm9sIG9yIHJlcG9ydGluZyBidWcgdGhlbi4NCj4gPiBQ
bGVhc2UgZHJvcCB0aGlzLg0KPiA+IA0KPiBPaywgdGhhbmtzLg0KDQpBY3R1YWxseSwgY2FuIHlv
dSBhcHBseSB0aGUgdjIgKGNmZzgwMjExOiBhZGQgYml0cmF0ZSBmb3IgMjBNSHogTUNTIDkpDQpv
ZiB0aGlzPyBTeXN0ZW1zIGd1eXMgY29uZmlybWVkIHRoZXkgdXNlIE1DUyA5IEAgMjBNSHogd2hl
biBMRFBDIGlzDQplbmFibGVkLiBBbHNvIGNvbmZpcm1lZCBiaXRyYXRlIHNob3VsZCBiZSBvay4N
Cg0KVGhhbmtzLA0KDQp0aG9tYXMNCg==

^ permalink raw reply

* Re: wireless.wiki.kernel.org: lingering status of http://linuxwireless.org/en/users/Drivers/wl12xx/calibrator/
From: Andreas Mohr @ 2016-09-16 16:27 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Andreas Mohr, linux-wireless
In-Reply-To: <1474018288.5481.4.camel@sipsolutions.net>

Hi,

On Fri, Sep 16, 2016 at 11:31:28AM +0200, Johannes Berg wrote:
> > The apparent underlying reason for this surfaces when going through
> > the en ... users ... Drivers hierarchy to
> > https://wireless.wiki.kernel.org/en/users/drivers/wl12xx
> > where it says
> > "
> > For relicensing, the content of this page was removed.
> > 
> > The old website for now has a copy of the old content:
> > 
> > http://linuxwireless.sipsolutions.net/en/users/Drivers/wl12xx/·
> > "
> 
> Right, so there were some people who couldn't be reached for
> relicensing of their submissions under the license the new wiki
> requires. The wl1251 and wl12xx pages were removed since I couldn't
> reach Gery Kahn and Oz Krakowski, or they couldn't agree to
> relicensing, I don't remember. I still have the Google spreadsheet that
> tells me who it was though :-)

Hmm, would be nice if that situation were sufficiently easily improvable still...
(however sometimes RL ain't that easy after all).


> I have no intention of removing it, since it's a static HTML site and
> has no maintenance overhead.

Sufficiently solid intentions, given status quo.
(so that content likely won't be available in one hundred years,
but now there's hope that it will remain available
over a "sane" remaining lifetime span of these devices... ;)


> > So, are there some ways to improve the content situation,
> > or will this job then eventually need to be done by last-ditch
> > efforts (web.archive.org etc.)?
> 
> I can't side-step the licensing issue, so no. You can download and
> store locally everything you need, I guess.

Dito.


(I already had the same thought and had acted accordingly)

Thank you for your service!

Andreas Mohr

^ permalink raw reply

* [PATCH -next] ath10k: fix error return code in ahb
From: Wei Yongjun @ 2016-09-16 13:05 UTC (permalink / raw)
  To: Kalle Valo, Raja Mani; +Cc: Wei Yongjun, ath10k, linux-wireless

From: Wei Yongjun <weiyongjun1@huawei.com>

Fix to return a negative error code from the error handling case
instead of 0, as done elsewhere in function ath10k_ahb_probe() or
ath10k_ahb_resource_init().

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/net/wireless/ath/ath10k/ahb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/ahb.c b/drivers/net/wireless/ath/ath10k/ahb.c
index b99ad5d..6dc1c60 100644
--- a/drivers/net/wireless/ath/ath10k/ahb.c
+++ b/drivers/net/wireless/ath/ath10k/ahb.c
@@ -572,6 +572,7 @@ static int ath10k_ahb_resource_init(struct ath10k *ar)
 	ar_ahb->irq = platform_get_irq_byname(pdev, "legacy");
 	if (ar_ahb->irq < 0) {
 		ath10k_err(ar, "failed to get irq number: %d\n", ar_ahb->irq);
+		ret = ar_ahb->irq;
 		goto err_clock_deinit;
 	}
 
@@ -850,6 +851,7 @@ static int ath10k_ahb_probe(struct platform_device *pdev)
 	chip_id = ath10k_ahb_soc_read32(ar, SOC_CHIP_ID_ADDRESS);
 	if (chip_id == 0xffffffff) {
 		ath10k_err(ar, "failed to get chip id\n");
+		ret = -ENODEV;
 		goto err_halt_device;
 	}

^ permalink raw reply related

* pull-request: mac80211-next 2016-09-16
From: Johannes Berg @ 2016-09-16 12:56 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-wireless

Hi Dave,

And here's another set for net-next, it's been a month or so and we have a
reasonably large number of patches (for a change, mostly because I cleaned
up some WEP crypto thing and a few static checkers.)

Let me know if there's any problem.

Thanks,
johannes



The following changes since commit 02154927c115c7599677df57203988e05b576346:

  net: dsa: bcm_sf2: Get VLAN_PORT_MASK from b53_device (2016-09-11 19:37:02 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git tags/mac80211-next-for-davem-2016-09-16

for you to fetch changes up to fbd05e4a6e82fd573d3aa79e284e424b8d78c149:

  cfg80211: add helper to find an IE that matches a byte-array (2016-09-16 14:49:52 +0200)

----------------------------------------------------------------
This time we have various things - all across the board:
 * MU-MIMO sniffer support in mac80211
 * a create_singlethread_workqueue() cleanup
 * interface dump filtering that was documented but not implemented
 * support for the new radiotap timestamp field
 * send delBA in two unexpected conditions (as required by the spec)
 * connect keys cleanups - allow only WEP with index 0-3
 * per-station aggregation limit to work around broken APs
 * debugfs improvement for the integrated codel algorithm
and various other small improvements and cleanups.

----------------------------------------------------------------
Aviya Erenfeld (2):
      mac80211: refactor monitor representation in sdata
      mac80211: add support for MU-MIMO air sniffer

Bhaktipriya Shridhar (1):
      cfg80211: Remove deprecated create_singlethread_workqueue

Denis Kenzior (1):
      nl80211: Allow GET_INTERFACE dumps to be filtered

Emmanuel Grumbach (2):
      cfg80211: clarify the requirements of .disconnect()
      mac80211: allow using AP_LINK_PS with mac80211-generated TIM IE

Johannes Berg (21):
      mac80211: add support for radiotap timestamp field
      mac80211: send delBA on unexpected BlockAck data frames
      mac80211: send delBA on unexpected BlockAck Request
      mac80211: simplify TDLS RA lookup
      mac80211: remove useless open_count check
      cfg80211: disallow shared key authentication with key index 4
      nl80211: fix connect keys range check
      nl80211: only allow WEP keys during connect command
      cfg80211: wext: only allow WEP keys to be configured before connected
      cfg80211: validate key index better
      cfg80211: reduce connect key caching struct size
      cfg80211: allow connect keys only with default (TX) key
      mac80211: fix possible out-of-bounds access
      mac80211: fix scan completed tracing
      nl80211: always check nla_nest_start() return value
      nl80211: always check nla_put* return values
      mac80211: remove unused assignment
      mac80211: remove pointless chanctx NULL check
      mac80211: remove sta_remove_debugfs driver callback
      cfg80211: remove unnecessary pointer-of
      mac80211_hwsim: statically initialize hwsim_radios list

Luca Coelho (1):
      cfg80211: add helper to find an IE that matches a byte-array

Maxim Altshul (1):
      mac80211: RX BA support for sta max_rx_aggregation_subframes

Rajkumar Manoharan (1):
      mac80211: allow driver to handle packet-loss mechanism

Toke Høiland-Jørgensen (1):
      mac80211: Re-structure aqm debugfs output and keep CoDel stats per txq

 drivers/net/wireless/mac80211_hwsim.c |   3 +-
 include/net/cfg80211.h                |  36 +++++++-
 include/net/ieee80211_radiotap.h      |  21 +++++
 include/net/mac80211.h                |  33 ++++++--
 net/mac80211/agg-rx.c                 |  11 ++-
 net/mac80211/cfg.c                    |  35 ++++++--
 net/mac80211/debugfs.c                | 152 ++++++----------------------------
 net/mac80211/debugfs_netdev.c         |  37 ++++++++-
 net/mac80211/debugfs_sta.c            |  56 ++++++++++++-
 net/mac80211/driver-ops.c             |   2 +-
 net/mac80211/driver-ops.h             |  18 +---
 net/mac80211/ieee80211_i.h            |  11 ++-
 net/mac80211/iface.c                  |  21 +++--
 net/mac80211/main.c                   |   3 +
 net/mac80211/mlme.c                   |  12 ++-
 net/mac80211/pm.c                     |   3 +-
 net/mac80211/rx.c                     |  69 ++++++++++++++-
 net/mac80211/scan.c                   |   2 +-
 net/mac80211/sta_info.c               |   5 +-
 net/mac80211/sta_info.h               |   3 +
 net/mac80211/status.c                 |   8 +-
 net/mac80211/tx.c                     |  21 ++---
 net/mac80211/util.c                   |   3 +-
 net/wireless/core.c                   |   2 +-
 net/wireless/core.h                   |   6 +-
 net/wireless/ibss.c                   |  11 +--
 net/wireless/mlme.c                   |   2 +-
 net/wireless/nl80211.c                |  85 ++++++++++++++++---
 net/wireless/scan.c                   |  58 ++++++-------
 net/wireless/sme.c                    |   3 +
 net/wireless/sysfs.c                  |   2 +-
 net/wireless/util.c                   |  13 +--
 net/wireless/wext-compat.c            |   9 +-
 net/wireless/wext-sme.c               |   5 +-
 34 files changed, 484 insertions(+), 277 deletions(-)

^ permalink raw reply

* Re: [PATCH] cfg80211: add helper to find an IE that matches a byte-array
From: Johannes Berg @ 2016-09-16 12:50 UTC (permalink / raw)
  To: Luca Coelho; +Cc: linux-wireless, Luca Coelho
In-Reply-To: <20160915151509.30840-1-luca@coelho.fi>

On Thu, 2016-09-15 at 18:15 +0300, Luca Coelho wrote:
> From: Luca Coelho <luciano.coelho@intel.com>
> 
> There are a few places where an IE that matches not only the EID, but
> also other bytes inside the element, needs to be found.  To simplify
> that and reduce the amount of similar code, implement a new helper
> function to match the EID and an extra array of bytes.
> 
Applied.

johannes

^ permalink raw reply

* Re: [PATCH 1/2] mac80211: allow to support AP_LINK_PS when the set_tim is still needed
From: Johannes Berg @ 2016-09-16 12:50 UTC (permalink / raw)
  To: Luca Coelho; +Cc: linux-wireless, Emmanuel Grumbach, Luca Coelho
In-Reply-To: <20160915133003.24214-1-luca@coelho.fi>

Both applied.

johannes

^ permalink raw reply

* pull-request: mac80211 2016-09-16
From: Johannes Berg @ 2016-09-16 12:47 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-wireless

Hi Dave,

Sorry - I know you only just pulled my tree for the previous fixes,
but we found two more problems in the last few days; it'd be great
to get those fixes in as well.

Let me know if there's any problem.

Thanks,
johannes



The following changes since commit ad5987b47e96a0fb6d13fea250e936aed000093c:

  nl80211: validate number of probe response CSA counters (2016-09-13 20:19:27 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git tags/mac80211-for-davem-2016-09-16

for you to fetch changes up to 85d5313ed717ad60769491c7c072d23bc0a68e7a:

  mac80211: reject TSPEC TIDs (TSIDs) for aggregation (2016-09-15 10:08:52 +0200)

----------------------------------------------------------------
Two more fixes:
 * reject aggregation sessions for TSID/TID 8-16 that we
   can never use anyway and which could confuse drivers
 * check return value of skb_linearize()

----------------------------------------------------------------
Johannes Berg (2):
      mac80211: check skb_linearize() return value
      mac80211: reject TSPEC TIDs (TSIDs) for aggregation

 net/mac80211/agg-rx.c | 8 +++++++-
 net/mac80211/agg-tx.c | 3 +++
 net/mac80211/tx.c     | 8 ++++++--
 3 files changed, 16 insertions(+), 3 deletions(-)

^ permalink raw reply

* Re: [PATCH v6 1/3] Documentation: dt: net: add ath9k wireless device binding
From: Rob Herring @ 2016-09-16 12:45 UTC (permalink / raw)
  To: Martin Blumenstingl
  Cc: Oleksij Rempel, ath9k-devel, devicetree, linux-wireless,
	ath9k-devel, mcgrof, mark.rutland, kvalo, chunkeey,
	arend.vanspriel, julian.calaby, bjorn, nbd, arnd
In-Reply-To: <CAFBinCAOQmk3KY1b+D1iKAOEBfasYyei681cae4PbD+201mzbQ@mail.gmail.com>

On Fri, Sep 09, 2016 at 10:57:06PM +0200, Martin Blumenstingl wrote:
> On Fri, Sep 9, 2016 at 9:48 AM, Oleksij Rempel <linux@rempel-privat.de> wrote:
> >> +Optional properties:
> >> +- reg: Address and length of the register set for the device.
> >> +- qca,clk-25mhz: Defines that a 25MHz clock is used
> >
> > Some SoCs even Atheros WiSoCs use WiFi clock for System Clock. In this
> > case we need to use clock framework any way, so why not in this case too?
> > Provide dummy static clock in DT and connect it with this node?
> >
> >         osc25m: oscillator {
> >                 compatible = "fixed-clock";
> >                 #clock-cells = <0>;
> >                 clock-frequency = <25000000>;
> >                 clock-accuracy = <30000>;
> >         };
> >
> >         acc: clock-controller@80040000 {
> >                 compatible = "some-clock-controller";
> >                 #clock-cells = <1>;
> >                 clocks = <&osc25m>;
> >                 reg = <0x80040000 0x204>;
> >         };
> >
> >
> > &pci0 {
> >         ath9k@168c,002d {
> >                 compatible = "pci168c,002d";
> >                 reg = <0x7000 0 0 0 0x1000>;
> >                 clocks = <&osc25m>;
> >                 qca,disable-5ghz;
> >         };
> > };
> >
> >
> > driver will need to use clk_get and compare frequency instead of
> > of_property_read_bool(np, "qca,clk-25mhz"). In this case you will need
> > to define source clock only one time and reuse it by all affected DT
> > nodes. If we have 40MHz clock you will only need to change it in
> > fixed-clock.
> that does sound like a good idea, thanks for that input!
> However, I will remove the property for the first version because I am
> trying to get PCI(e) devices supported. OF support for AHB (WiSoC)
> needs more work (in other places, like ahb.c) anyways.
> But this suggestion should be remembered!
> 
> >> +- qca,no-eeprom: Indicates that there is no physical EEPROM connected to the
> >> +                     ath9k wireless chip (in this case the calibration /
> >> +                     EEPROM data will be loaded from userspace using the
> >> +                     kernel firmware loader).
> >> +- qca,disable-2ghz: Overrides the settings from the EEPROM and disables the
> >> +                     2.4GHz band. Setting this property is only needed
> >> +                     when the RF circuit does not support the 2.4GHz band
> >> +                     while it is enabled nevertheless in the EEPROM.
> >> +- qca,disable-5ghz: Overrides the settings from the EEPROM and disables the
> >> +                     5GHz band. Setting this property is only needed when
> >> +                     the RF circuit does not support the 5GHz band while
> >> +                     it is enabled nevertheless in the EEPROM.
> >
> > This option can be reused for every WiFi controller. Not only for qca.
> > So may be instead of adding vendor specific name, make it reusable for
> > all vendors. Instead of qca,disable-5ghz and qca,disable-2ghz make
> > disable-5ghz and disable-2ghz?

Fine, but if you do this then document in a common location.

> I am personally fine with anything that fits best into the grand
> scheme of things.
> There are three scenarios I can think of which may be influenced by
> devicetree configuration:
> a) let the driver decide automatically whether the 2.4GHz and/or 5GHz
> band is/are enabled
> b) explicitly disable either bands (because the driver thinks due to
> whatever reason that a band is supported while in reality it isn't)
> c) explicitly enable a band (for example because the driver cannot
> automagically detect which band should be enabled)
> 
> for ath9k we default to a) but also allow b): the EEPROM (device
> specific calibration data) contains information about which bands are
> enabled (or not). But some manufacturers are shipping devices for
> example with the 5G band enabled, while the actual hardware doesn't
> support it.

And you can't determine that based on different device IDs? If you can 
use vendor/device ID, then you should. If not, then this is fine.

Is it possible to have no EEPROM at all? If so, you might want to just 
put the raw EEPROM data into DT rather than a property for every field 
(I'm assuming there's more than just what you have properties for now).

Rob

^ permalink raw reply

* Re: [PATCH v6 1/3] Documentation: dt: net: add ath9k wireless device binding
From: Rob Herring @ 2016-09-16 12:37 UTC (permalink / raw)
  To: Martin Blumenstingl
  Cc: ath9k-devel, devicetree, linux-wireless, ath9k-devel, mcgrof,
	mark.rutland, kvalo, chunkeey, arend.vanspriel, julian.calaby,
	bjorn, linux, nbd
In-Reply-To: <20160906214623.20424-2-martin.blumenstingl@googlemail.com>

On Tue, Sep 06, 2016 at 11:46:21PM +0200, Martin Blumenstingl wrote:
> Add documentation how devicetree can be used to configure ath9k based
> devices.
> 
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
>  .../devicetree/bindings/net/wireless/qca,ath9k.txt | 39 ++++++++++++++++++++++
>  1 file changed, 39 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/wireless/qca,ath9k.txt
> 
> diff --git a/Documentation/devicetree/bindings/net/wireless/qca,ath9k.txt b/Documentation/devicetree/bindings/net/wireless/qca,ath9k.txt
> new file mode 100644
> index 0000000..77b9202
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/wireless/qca,ath9k.txt
> @@ -0,0 +1,39 @@
> +* Qualcomm Atheros ath9k wireless devices
> +
> +This node provides properties for configuring the ath9k wireless device. The
> +node is expected to be specified as a child node of the PCI controller to
> +which the wireless chip is connected.
> +
> +Required properties:
> +- compatible: For PCI and PCIe devices this should be an identifier following
> +		the format as defined in "PCI Bus Binding to Open Firmware"
> +		Revision 2.1. One of the possible formats is "pciVVVV,DDDD"
> +		where VVVV is the PCI vendor ID and DDDD is PCI device ID.
> +
> +Optional properties:
> +- reg: Address and length of the register set for the device.

reg is not optional.

> +- qca,clk-25mhz: Defines that a 25MHz clock is used
> +- qca,no-eeprom: Indicates that there is no physical EEPROM connected to the
> +			ath9k wireless chip (in this case the calibration /
> +			EEPROM data will be loaded from userspace using the
> +			kernel firmware loader).
> +- qca,disable-2ghz: Overrides the settings from the EEPROM and disables the
> +			2.4GHz band. Setting this property is only needed
> +			when the RF circuit does not support the 2.4GHz band
> +			while it is enabled nevertheless in the EEPROM.
> +- qca,disable-5ghz: Overrides the settings from the EEPROM and disables the
> +			5GHz band. Setting this property is only needed when
> +			the RF circuit does not support the 5GHz band while
> +			it is enabled nevertheless in the EEPROM.
> +- mac-address: See ethernet.txt in the parent directory
> +- local-mac-address: See ethernet.txt in the parent directory
> +
> +
> +In this example, the node is defined as child node of the PCI controller:
> +&pci0 {
> +	ath9k@168c,002d {

unit address is not the vendor/device ID, but the reg value. So 
'@7000,0,0' I think in this case. Double check the OF PCI bus binding.


> +		compatible = "pci168c,002d";
> +		reg = <0x7000 0 0 0 0x1000>;
> +		qca,disable-5ghz;
> +	};
> +};
> -- 
> 2.9.3
> 

^ permalink raw reply

* Re: [PATCH v2 3/9] cfg80211: add add_nan_func / rm_nan_func
From: kbuild test robot @ 2016-09-16 12:20 UTC (permalink / raw)
  To: Luca Coelho
  Cc: kbuild-all, johannes, linux-wireless, Ayala Beker,
	Andrei Otcheretianski, Emmanuel Grumbach, Luca Coelho
In-Reply-To: <20160916083321.5840-4-luca@coelho.fi>

[-- Attachment #1: Type: text/plain, Size: 3482 bytes --]

Hi Ayala,

[auto build test WARNING on mac80211-next/master]
[also build test WARNING on next-20160916]
[cannot apply to v4.8-rc6]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:    https://github.com/0day-ci/linux/commits/Luca-Coelho/Add-support-for-Neighbor-Awareness-Networking/20160916-164553
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
config: x86_64-randconfig-v0-09161926 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/uapi/linux/if.h:23,
                    from net/wireless/nl80211.c:9:
   net/wireless/nl80211.c: In function 'nl80211_nan_add_func':
   net/wireless/nl80211.c:10588:30: error: implicit declaration of function 'genl_info_snd_portid' [-Werror=implicit-function-declaration]
         wdev->owner_nlportid != genl_info_snd_portid(info))
                                 ^
   include/linux/compiler.h:149:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^~~~
>> net/wireless/nl80211.c:10587:2: note: in expansion of macro 'if'
     if (wdev->owner_nlportid &&
     ^~
   net/wireless/nl80211.c:10785:6: error: implicit declaration of function 'nla_put_u64' [-Werror=implicit-function-declaration]
     if (nla_put_u64(msg, NL80211_ATTR_COOKIE, func->cookie))
         ^
   include/linux/compiler.h:149:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^~~~
   net/wireless/nl80211.c:10785:2: note: in expansion of macro 'if'
     if (nla_put_u64(msg, NL80211_ATTR_COOKIE, func->cookie))
     ^~
   cc1: some warnings being treated as errors

vim +/if +10587 net/wireless/nl80211.c

 10571		struct wireless_dev *wdev = info->user_ptr[1];
 10572		struct nlattr *tb[NUM_NL80211_NAN_FUNC_ATTR], *func_attr;
 10573		struct cfg80211_nan_func *func;
 10574		struct sk_buff *msg = NULL;
 10575		void *hdr = NULL;
 10576		int err = 0;
 10577	
 10578		if (wdev->iftype != NL80211_IFTYPE_NAN)
 10579			return -EOPNOTSUPP;
 10580	
 10581		if (!wdev->nan_started)
 10582			return -ENOTCONN;
 10583	
 10584		if (!info->attrs[NL80211_ATTR_NAN_FUNC])
 10585			return -EINVAL;
 10586	
 10587		if (wdev->owner_nlportid &&
 10588		    wdev->owner_nlportid != genl_info_snd_portid(info))
 10589			return -ENOTCONN;
 10590	
 10591		err = nla_parse(tb, NL80211_NAN_FUNC_ATTR_MAX,
 10592				nla_data(info->attrs[NL80211_ATTR_NAN_FUNC]),
 10593				nla_len(info->attrs[NL80211_ATTR_NAN_FUNC]),
 10594				nl80211_nan_func_policy);
 10595		if (err)

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 22768 bytes --]

^ permalink raw reply

* [PATCH] ath10k: add cc_wraparound type for QCA9888 and QCA9884
From: akolli @ 2016-09-16 11:45 UTC (permalink / raw)
  To: ath10k; +Cc: akolli, linux-wireless, Anilkumar Kolli

From: Anilkumar Kolli <akolli@qti.qualcomm.com>

During offchannel scan, iw survey dump shows wrong values.
Fix this by assigning cycle counter wranarround type for
QCA9888 and QCA9884, they share same config with QCA4019.

Signed-off-by: Anilkumar Kolli <akolli@qti.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/core.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 3a8984ba9f74..93168d9f8902 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -191,6 +191,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
 		.name = "qca9984/qca9994 hw1.0",
 		.patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR,
 		.uart_pin = 7,
+		.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
 		.otp_exe_param = 0x00000700,
 		.continuous_frag_desc = true,
 		.cck_rate_map_rev2 = true,
@@ -215,6 +216,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
 		.name = "qca9888 hw2.0",
 		.patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR,
 		.uart_pin = 7,
+		.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
 		.otp_exe_param = 0x00000700,
 		.continuous_frag_desc = true,
 		.channel_counters_freq_hz = 150000,
-- 
1.7.9.5

^ permalink raw reply related

* Re: [PATCH v2 2/9] mac80211: add boilerplate code for start / stop NAN
From: Arend Van Spriel @ 2016-09-16 11:08 UTC (permalink / raw)
  To: Luca Coelho, johannes
  Cc: linux-wireless, Ayala Beker, Andrei Otcheretianski,
	Emmanuel Grumbach, Luca Coelho
In-Reply-To: <20160916083321.5840-3-luca@coelho.fi>

On 16-9-2016 10:33, Luca Coelho wrote:
> From: Ayala Beker <ayala.beker@intel.com>
> 
> This code doesn't do much besides allowing to start and
> stop the vif.
> 
> Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> Signed-off-by: Ayala Beker <ayala.beker@intel.com>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> ---
>  include/net/mac80211.h    |  9 +++++++++
>  net/mac80211/cfg.c        | 36 ++++++++++++++++++++++++++++++++++
>  net/mac80211/chan.c       |  3 +++
>  net/mac80211/driver-ops.h | 29 ++++++++++++++++++++++++++-
>  net/mac80211/iface.c      |  8 ++++++--
>  net/mac80211/main.c       |  5 +++++
>  net/mac80211/offchannel.c |  3 ++-
>  net/mac80211/trace.h      | 50 +++++++++++++++++++++++++++++++++++++++++++++++
>  net/mac80211/util.c       |  3 ++-
>  9 files changed, 141 insertions(+), 5 deletions(-)

[...]

> diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
> index fe35a1c..67b42c8 100644
> --- a/net/mac80211/driver-ops.h
> +++ b/net/mac80211/driver-ops.h
> @@ -163,7 +163,8 @@ static inline void drv_bss_info_changed(struct ieee80211_local *local,
>  
>  	if (WARN_ON_ONCE(sdata->vif.type == NL80211_IFTYPE_P2P_DEVICE ||
>  			 (sdata->vif.type == NL80211_IFTYPE_MONITOR &&
> -			  !sdata->vif.mu_mimo_owner)))
> +			  !sdata->vif.mu_mimo_owner) ||
> +			 sdata->vif.type == NL80211_IFTYPE_NAN))

Might be more clear to move this up right after P2P_DEVICE check.

>  		return;
>  
>  	if (!check_sdata_in_driver(sdata))
> @@ -1165,4 +1166,30 @@ static inline void drv_wake_tx_queue(struct ieee80211_local *local,
>  	local->ops->wake_tx_queue(&local->hw, &txq->txq);
>  }
>  
> +static inline int drv_start_nan(struct ieee80211_local *local,
> +				struct ieee80211_sub_if_data *sdata,
> +				struct cfg80211_nan_conf *conf)
> +{
> +	int ret;
> +
> +	might_sleep();
> +	check_sdata_in_driver(sdata);
> +
> +	trace_drv_start_nan(local, sdata, conf);
> +	ret = local->ops->start_nan(&local->hw, &sdata->vif, conf);
> +	trace_drv_return_int(local, ret);
> +	return ret;
> +}
> +
> +static inline void drv_stop_nan(struct ieee80211_local *local,
> +				struct ieee80211_sub_if_data *sdata)
> +{
> +	might_sleep();
> +	check_sdata_in_driver(sdata);
> +
> +	trace_drv_stop_nan(local, sdata);
> +	local->ops->stop_nan(&local->hw, &sdata->vif);
> +	trace_drv_return_void(local);
> +}
> +
>  #endif /* __MAC80211_DRIVER_OPS */
> diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
> index e694ca2..507f46a 100644
> --- a/net/mac80211/iface.c
> +++ b/net/mac80211/iface.c
> @@ -327,6 +327,9 @@ static int ieee80211_check_queues(struct ieee80211_sub_if_data *sdata,
>  	int n_queues = sdata->local->hw.queues;
>  	int i;
>  
> +	if (iftype == NL80211_IFTYPE_NAN)
> +		return 0;
> +
>  	if (iftype != NL80211_IFTYPE_P2P_DEVICE) {
>  		for (i = 0; i < IEEE80211_NUM_ACS; i++) {
>  			if (WARN_ON_ONCE(sdata->vif.hw_queue[i] ==
> @@ -647,7 +650,8 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
>  			local->fif_probe_req++;
>  		}
>  
> -		if (sdata->vif.type != NL80211_IFTYPE_P2P_DEVICE)
> +		if (sdata->vif.type != NL80211_IFTYPE_P2P_DEVICE &&
> +		    sdata->vif.type != NL80211_IFTYPE_NAN)

similar check keeps reoccuring in various places so maybe we can create
a helper function for it.

>  			changed |= ieee80211_reset_erp_info(sdata);
>  		ieee80211_bss_info_change_notify(sdata, changed);
>  

Regards,
Arend

^ permalink raw reply

* Re: [PATCH v2 1/9] cfg80211: add start / stop NAN commands
From: Johannes Berg @ 2016-09-16 11:00 UTC (permalink / raw)
  To: Arend Van Spriel, Luca Coelho
  Cc: linux-wireless, Ayala Beker, Andrei Otcheretianski,
	Emmanuel Grumbach, Luca Coelho
In-Reply-To: <6bfd6007-8650-3c75-2e90-c2c94202e2b9@broadcom.com>


> I think NUM_NL80211_IFTYPES should not be in the switch. If it must I
> would leave it as last one here.
> 

It just suppresses compiler warnings :)

johannes

^ permalink raw reply

* Re: [PATCH v2 1/9] cfg80211: add start / stop NAN commands
From: Arend Van Spriel @ 2016-09-16 10:58 UTC (permalink / raw)
  To: Luca Coelho, johannes
  Cc: linux-wireless, Ayala Beker, Andrei Otcheretianski,
	Emmanuel Grumbach, Luca Coelho
In-Reply-To: <20160916083321.5840-2-luca@coelho.fi>

On 16-9-2016 10:33, Luca Coelho wrote:
> From: Ayala Beker <ayala.beker@intel.com>
> 
> This allows user space to start/stop NAN interface.
> A NAN interface is like P2P device in a few aspects: it
> doesn't have a netdev associated to it.
> Add the new interface type and prevent operations that
> can't be executed on NAN interface like scan.
> 
> Define several attributes that may be configured by user space
> when starting NAN functionality (master preference and dual
> band operation)
> 
> Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> ---
>  include/net/cfg80211.h       | 21 +++++++++-
>  include/uapi/linux/nl80211.h | 52 +++++++++++++++++++++++++
>  net/mac80211/cfg.c           |  2 +
>  net/mac80211/chan.c          |  3 ++
>  net/mac80211/iface.c         |  4 ++
>  net/mac80211/offchannel.c    |  1 +
>  net/mac80211/rx.c            |  3 ++
>  net/mac80211/util.c          |  1 +
>  net/wireless/chan.c          |  2 +
>  net/wireless/core.c          | 34 ++++++++++++++++
>  net/wireless/core.h          |  3 ++
>  net/wireless/mlme.c          |  1 +
>  net/wireless/nl80211.c       | 93 ++++++++++++++++++++++++++++++++++++++++++--
>  net/wireless/rdev-ops.h      | 20 ++++++++++
>  net/wireless/trace.h         | 27 +++++++++++++
>  net/wireless/util.c          |  6 ++-
>  16 files changed, 267 insertions(+), 6 deletions(-)
> 
> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> index d5e7f69..ca64d69 100644
> --- a/include/net/cfg80211.h
> +++ b/include/net/cfg80211.h
> @@ -2293,6 +2293,19 @@ struct cfg80211_qos_map {
>  };

[...]

> +/**
> + * enum nl80211_nan_dual_band_conf - NAN dual band configuration
> + *
> + * Defines the NAN dual band mode of operation

Does it make sense to have such a notion of bands in use. And what does
5.2GHz mean. Is this a subband within 5G channels? Probably I should
read the NAN spec to understand what is meant here. I would consider
5.2G as lower 5G, ie. discovery on channel 44 but not sure if that is
meant here.

> + * @NL80211_NAN_BAND_DEFAULT: device default mode
> + * @NL80211_NAN_BAND_SINGLE: 2.4GHz only mode
> + * @NL80211_NAN_BAND_DUAL: 2.4GHz and 5.2GHz mode
> +  */
> +enum nl80211_nan_dual_band_conf {
> +	NL80211_NAN_BAND_DEFAULT,
> +	NL80211_NAN_BAND_SINGLE,
> +	NL80211_NAN_BAND_DUAL,
> +
> +	/* keep last */
> +	__NL80211_NAN_BAND_AFTER_LAST,
> +	NL80211_NAN_BAND_MAX =
> +	__NL80211_NAN_BAND_AFTER_LAST - 1,
> +};
> +
>  #endif /* __LINUX_NL80211_H */
> diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
> index e29ff57..a74027f 100644
> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c
> @@ -257,6 +257,7 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
>  	case NL80211_IFTYPE_WDS:
>  	case NL80211_IFTYPE_MONITOR:
>  	case NL80211_IFTYPE_P2P_DEVICE:
> +	case NL80211_IFTYPE_NAN:
>  	case NL80211_IFTYPE_UNSPECIFIED:
>  	case NUM_NL80211_IFTYPES:

Huh? What is this doing here? Not yours but weird still.

>  	case NL80211_IFTYPE_P2P_CLIENT:
> @@ -2036,6 +2037,7 @@ static int ieee80211_scan(struct wiphy *wiphy,
>  		     !(req->flags & NL80211_SCAN_FLAG_AP)))
>  			return -EOPNOTSUPP;
>  		break;
> +	case NL80211_IFTYPE_NAN:
>  	default:
>  		return -EOPNOTSUPP;
>  	}
> diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
> index 74142d0..acb50f8 100644
> --- a/net/mac80211/chan.c
> +++ b/net/mac80211/chan.c
> @@ -274,6 +274,7 @@ ieee80211_get_chanctx_max_required_bw(struct ieee80211_local *local,
>  				    ieee80211_get_max_required_bw(sdata));
>  			break;
>  		case NL80211_IFTYPE_P2P_DEVICE:
> +		case NL80211_IFTYPE_NAN:
>  			continue;
>  		case NL80211_IFTYPE_ADHOC:
>  		case NL80211_IFTYPE_WDS:
> @@ -718,6 +719,7 @@ void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local,
>  
>  		switch (sdata->vif.type) {
>  		case NL80211_IFTYPE_P2P_DEVICE:
> +		case NL80211_IFTYPE_NAN:
>  			continue;
>  		case NL80211_IFTYPE_STATION:
>  			if (!sdata->u.mgd.associated)
> @@ -981,6 +983,7 @@ ieee80211_vif_chanctx_reservation_complete(struct ieee80211_sub_if_data *sdata)
>  	case NL80211_IFTYPE_P2P_GO:
>  	case NL80211_IFTYPE_P2P_DEVICE:
>  	case NUM_NL80211_IFTYPES:

I think NUM_NL80211_IFTYPES should not be in the switch. If it must I
would leave it as last one here.

> +	case NL80211_IFTYPE_NAN:
>  		WARN_ON(1);
>  		break;
>  	}

Regards,
Arend

^ permalink raw reply

* ath10k mesh mode issue
From: Matteo Grandi @ 2016-09-16 10:56 UTC (permalink / raw)
  To: LinuxWireless Mailing List

Hello all,

I'm using Gateworks Ventana 5410 boards
(http://www.gateworks.com/product/item/ventana-gw5410-network-processor)
running Ubuntu Trusty-Ventana kernel v3.14 with a Compex WLE600V5-27
miniPCIe Qualcomm Atheros QCA9882 wifi dongle installed
https://www.landashop.com/compex-wle-600v5.html?___store=english&___from_store=default

The aim is to use some of these boards to build a mesh network and
perform some HT test (it's a part of my MSc thesis).
I'm trying to configure the devices in mesh mode, but I've encountered
some problems, this is the dmesg output:

root@Yazi:~# iw dev wlan1 interface add mp1 type mp
root@Yazi:~# iw dev mp1 set freq 5240
root@Yazi:~# dmesg | grep ath
[    7.134520] ath10k_pci 0000:07:00.0: pci irq legacy interrupts 0
irq_mode 0 reset_mode 0
[    7.349228] ath10k_pci 0000:07:00.0: Direct firmware load failed
with error -2
[    7.349245] ath10k_pci 0000:07:00.0: Falling back to user helper
[    7.417170] ath10k_pci 0000:07:00.0: Direct firmware load failed
with error -2
[    7.417189] ath10k_pci 0000:07:00.0: Falling back to user helper
[    8.589474] ath10k_pci 0000:07:00.0: qca988x hw2.0 (0x4100016c,
0x043222ff sub 0000:0000) fw 10.2.4.70.54 fwapi 5 bdapi 1 htt-ver 2.1
wmi-op 5 htt-op 2 cal otp max-sta 128 raw 0 hwcrypto 1 features
no-p2p,raw-mode
[    8.589491] ath10k_pci 0000:07:00.0: debug 1 debugfs 1 tracing 0
dfs 0 testmode 1
[    8.691670] ath: EEPROM regdomain: 0x0
[    8.691680] ath: EEPROM indicates default country code should be used
[    8.691686] ath: doing EEPROM country->regdmn map search
[    8.691695] ath: country maps to regdmn code: 0x3a
[    8.691702] ath: Country alpha2 being used: US
[    8.691706] ath: Regpair used: 0x3a
root@Yazi:~# ifconfig mp1 up
SIOCSIFFLAGS: Invalid argument
root@Yazi:~# dmesg | grep ath
[    7.134520] ath10k_pci 0000:07:00.0: pci irq legacy interrupts 0
irq_mode 0 reset_mode 0
[    7.349228] ath10k_pci 0000:07:00.0: Direct firmware load failed
with error -2
[    7.349245] ath10k_pci 0000:07:00.0: Falling back to user helper
[    7.417170] ath10k_pci 0000:07:00.0: Direct firmware load failed
with error -2
[    7.417189] ath10k_pci 0000:07:00.0: Falling back to user helper
[    8.589474] ath10k_pci 0000:07:00.0: qca988x hw2.0 (0x4100016c,
0x043222ff sub 0000:0000) fw 10.2.4.70.54 fwapi 5 bdapi 1 htt-ver 2.1
wmi-op 5 htt-op 2 cal otp max-sta 128 raw 0 hwcrypto 1 features
no-p2p,raw-mode
[    8.589491] ath10k_pci 0000:07:00.0: debug 1 debugfs 1 tracing 0
dfs 0 testmode 1
[    8.691670] ath: EEPROM regdomain: 0x0
[    8.691680] ath: EEPROM indicates default country code should be used
[    8.691686] ath: doing EEPROM country->regdmn map search
[    8.691695] ath: country maps to regdmn code: 0x3a
[    8.691702] ath: Country alpha2 being used: US
[    8.691706] ath: Regpair used: 0x3a
[  176.983250] ath10k_pci 0000:07:00.0: must load driver with
rawmode=1 to add mesh interfaces

It seems that the rowmode is NOT enable, but 8 lines above it's seems
to be ok...

Let me give you some useful details:
- the lspci output:
root@Yazi:~# lspci
00:00.0 PCI bridge: Synopsys, Inc. Device abcd (rev 01)
01:00.0 PCI bridge: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI
Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
01:00.1 System peripheral: PLX Technology, Inc. PEX 8609 8-lane,
8-Port PCI Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
02:01.0 PCI bridge: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI
Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
02:04.0 PCI bridge: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI
Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
02:05.0 PCI bridge: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI
Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
02:06.0 PCI bridge: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI
Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
02:07.0 PCI bridge: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI
Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
02:08.0 PCI bridge: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI
Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
02:09.0 PCI bridge: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI
Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
07:00.0 Network controller: Qualcomm Atheros QCA986x/988x 802.11ac
Wireless Network Adapter
08:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8057
PCI-E Gigabit Ethernet Controller

-the lsmod output:
root@Yazi:~# lsmod
Module                  Size  Used by
arc4                    1687  2
ath10k_pci             34340  0
ath10k_core           289147  1 ath10k_pci
sky2                   53987  0
mac80211              458056  1 ath10k_core
ath                    21573  1 ath10k_core
cfg80211              218260  3 ath,mac80211,ath10k_core
compat                 24039  4 cfg80211,mac80211,ath10k_pci,ath10k_core

- the firmware currently in use is the firmware-5.bin_10.2.4.70.54
(renamed firmware-5.bin and with executable permission) located in
/lib/firmware/ath10k/QCA988X/hw2.0. I retrived it on
https://github.com/kvalo/ath10k-firmware
- The backports-4.2.6-1 was crosscompiled with the kernel following
the official wiki guide provided by Gateworks
- I've also tried to load the ath10k modules adding the parameter
rowmode=1 but I had an error "rawmode unknown parameter"
- in another try I used the firmware "firmware-5.bin_10.2.4.70.6-2"
after retriving this
https://github.com/o11s/open80211s/wiki/ath10k-(802.11ac)-for-Mesh-Support
but nothing is changed...

I'm not an expert so I'm sorry if I miss some basics...
Hope in your help!

All the bes

^ permalink raw reply

* ath10k mesh mode issue
From: Matteo Grandi @ 2016-09-16 10:52 UTC (permalink / raw)
  To: LinuxWireless Mailing List

Hello all,

I'm using Gateworks Ventana 5410 boards
(http://www.gateworks.com/product/item/ventana-gw5410-network-processor)
running Ubuntu Trusty-Ventana kernel v3.14 with a Compex WLE600V5-27
miniPCIe Qualcomm Atheros QCA9882 wifi dongle installed
https://www.landashop.com/compex-wle-600v5.html?___store=english&___from_store=default

The aim is to use some of these boards to build a mesh network and
perform some HT test (it's a part of my MSc thesis).
I'm trying to configure the devices in mesh mode, but I've encountered
some problems, this is the dmesg output:

root@Yazi:~# iw dev wlan1 interface add mp1 type mp
root@Yazi:~# iw dev mp1 set freq 5240
root@Yazi:~# dmesg | grep ath
[    7.134520] ath10k_pci 0000:07:00.0: pci irq legacy interrupts 0
irq_mode 0 reset_mode 0
[    7.349228] ath10k_pci 0000:07:00.0: Direct firmware load failed
with error -2
[    7.349245] ath10k_pci 0000:07:00.0: Falling back to user helper
[    7.417170] ath10k_pci 0000:07:00.0: Direct firmware load failed
with error -2
[    7.417189] ath10k_pci 0000:07:00.0: Falling back to user helper
[    8.589474] ath10k_pci 0000:07:00.0: qca988x hw2.0 (0x4100016c,
0x043222ff sub 0000:0000) fw 10.2.4.70.54 fwapi 5 bdapi 1 htt-ver 2.1
wmi-op 5 htt-op 2 cal otp max-sta 128 raw 0 hwcrypto 1 features
no-p2p,raw-mode
[    8.589491] ath10k_pci 0000:07:00.0: debug 1 debugfs 1 tracing 0
dfs 0 testmode 1
[    8.691670] ath: EEPROM regdomain: 0x0
[    8.691680] ath: EEPROM indicates default country code should be used
[    8.691686] ath: doing EEPROM country->regdmn map search
[    8.691695] ath: country maps to regdmn code: 0x3a
[    8.691702] ath: Country alpha2 being used: US
[    8.691706] ath: Regpair used: 0x3a
root@Yazi:~# ifconfig mp1 up
SIOCSIFFLAGS: Invalid argument
root@Yazi:~# dmesg | grep ath
[    7.134520] ath10k_pci 0000:07:00.0: pci irq legacy interrupts 0
irq_mode 0 reset_mode 0
[    7.349228] ath10k_pci 0000:07:00.0: Direct firmware load failed
with error -2
[    7.349245] ath10k_pci 0000:07:00.0: Falling back to user helper
[    7.417170] ath10k_pci 0000:07:00.0: Direct firmware load failed
with error -2
[    7.417189] ath10k_pci 0000:07:00.0: Falling back to user helper
[    8.589474] ath10k_pci 0000:07:00.0: qca988x hw2.0 (0x4100016c,
0x043222ff sub 0000:0000) fw 10.2.4.70.54 fwapi 5 bdapi 1 htt-ver 2.1
wmi-op 5 htt-op 2 cal otp max-sta 128 raw 0 hwcrypto 1 features
no-p2p,raw-mode
[    8.589491] ath10k_pci 0000:07:00.0: debug 1 debugfs 1 tracing 0
dfs 0 testmode 1
[    8.691670] ath: EEPROM regdomain: 0x0
[    8.691680] ath: EEPROM indicates default country code should be used
[    8.691686] ath: doing EEPROM country->regdmn map search
[    8.691695] ath: country maps to regdmn code: 0x3a
[    8.691702] ath: Country alpha2 being used: US
[    8.691706] ath: Regpair used: 0x3a
[  176.983250] ath10k_pci 0000:07:00.0: must load driver with
rawmode=1 to add mesh interfaces

It seems that the rowmode is NOT enable, but 8 lines above it's seems
to be ok...

Let me give you some useful details:
- the lspci output:
root@Yazi:~# lspci
00:00.0 PCI bridge: Synopsys, Inc. Device abcd (rev 01)
01:00.0 PCI bridge: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI
Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
01:00.1 System peripheral: PLX Technology, Inc. PEX 8609 8-lane,
8-Port PCI Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
02:01.0 PCI bridge: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI
Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
02:04.0 PCI bridge: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI
Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
02:05.0 PCI bridge: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI
Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
02:06.0 PCI bridge: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI
Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
02:07.0 PCI bridge: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI
Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
02:08.0 PCI bridge: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI
Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
02:09.0 PCI bridge: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI
Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
07:00.0 Network controller: Qualcomm Atheros QCA986x/988x 802.11ac
Wireless Network Adapter
08:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8057
PCI-E Gigabit Ethernet Controller

-the lsmod output:
root@Yazi:~# lsmod
Module                  Size  Used by
arc4                    1687  2
ath10k_pci             34340  0
ath10k_core           289147  1 ath10k_pci
sky2                   53987  0
mac80211              458056  1 ath10k_core
ath                    21573  1 ath10k_core
cfg80211              218260  3 ath,mac80211,ath10k_core
compat                 24039  4 cfg80211,mac80211,ath10k_pci,ath10k_core

- the firmware currently in use is the firmware-5.bin_10.2.4.70.54
(renamed firmware-5.bin and with executable permission) located in
/lib/firmware/ath10k/QCA988X/hw2.0. I retrived it on
https://github.com/kvalo/ath10k-firmware
- The backports-4.2.6-1 was crosscompiled with the kernel following
the official wiki guide provided by Gateworks
- I've also tried to load the ath10k modules adding the parameter
rowmode=1 but I had an error "rawmode unknown parameter"
- in another try I used the firmware "firmware-5.bin_10.2.4.70.6-2"
after retriving this
https://github.com/o11s/open80211s/wiki/ath10k-(802.11ac)-for-Mesh-Support
but nothing is changed...

I'm not an expert so I'm sorry if I miss some basics...
Hope in your help!

All the best

^ permalink raw reply

* Re: [PATCH v2 3/9] cfg80211: add add_nan_func / rm_nan_func
From: kbuild test robot @ 2016-09-16 10:46 UTC (permalink / raw)
  To: Luca Coelho
  Cc: kbuild-all, johannes, linux-wireless, Ayala Beker,
	Andrei Otcheretianski, Emmanuel Grumbach, Luca Coelho
In-Reply-To: <20160916083321.5840-4-luca@coelho.fi>

[-- Attachment #1: Type: text/plain, Size: 7963 bytes --]

Hi Ayala,

[auto build test ERROR on mac80211-next/master]
[also build test ERROR on next-20160916]
[cannot apply to v4.8-rc6]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:    https://github.com/0day-ci/linux/commits/Luca-Coelho/Add-support-for-Neighbor-Awareness-Networking/20160916-164553
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
config: x86_64-lkp (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   net/wireless/nl80211.c: In function 'nl80211_nan_add_func':
>> net/wireless/nl80211.c:10588:30: error: implicit declaration of function 'genl_info_snd_portid' [-Werror=implicit-function-declaration]
         wdev->owner_nlportid != genl_info_snd_portid(info))
                                 ^~~~~~~~~~~~~~~~~~~~
>> net/wireless/nl80211.c:10785:6: error: implicit declaration of function 'nla_put_u64' [-Werror=implicit-function-declaration]
     if (nla_put_u64(msg, NL80211_ATTR_COOKIE, func->cookie))
         ^~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/genl_info_snd_portid +10588 net/wireless/nl80211.c

 10582			return -ENOTCONN;
 10583	
 10584		if (!info->attrs[NL80211_ATTR_NAN_FUNC])
 10585			return -EINVAL;
 10586	
 10587		if (wdev->owner_nlportid &&
 10588		    wdev->owner_nlportid != genl_info_snd_portid(info))
 10589			return -ENOTCONN;
 10590	
 10591		err = nla_parse(tb, NL80211_NAN_FUNC_ATTR_MAX,
 10592				nla_data(info->attrs[NL80211_ATTR_NAN_FUNC]),
 10593				nla_len(info->attrs[NL80211_ATTR_NAN_FUNC]),
 10594				nl80211_nan_func_policy);
 10595		if (err)
 10596			return err;
 10597	
 10598		func = kzalloc(sizeof(*func), GFP_KERNEL);
 10599		if (!func)
 10600			return -ENOMEM;
 10601	
 10602		func->cookie = wdev->wiphy->cookie_counter++;
 10603	
 10604		if (!tb[NL80211_NAN_FUNC_TYPE] ||
 10605		    nla_get_u8(tb[NL80211_NAN_FUNC_TYPE]) > NL80211_NAN_FUNC_MAX_TYPE) {
 10606			err = -EINVAL;
 10607			goto out;
 10608		}
 10609	
 10610	
 10611		func->type = nla_get_u8(tb[NL80211_NAN_FUNC_TYPE]);
 10612	
 10613		if (!tb[NL80211_NAN_FUNC_SERVICE_ID]) {
 10614			err = -EINVAL;
 10615			goto out;
 10616		}
 10617	
 10618		memcpy(func->service_id, nla_data(tb[NL80211_NAN_FUNC_SERVICE_ID]),
 10619		       sizeof(func->service_id));
 10620	
 10621		func->close_range =
 10622			nla_get_flag(tb[NL80211_NAN_FUNC_CLOSE_RANGE]);
 10623	
 10624		if (tb[NL80211_NAN_FUNC_SERVICE_INFO]) {
 10625			func->serv_spec_info_len =
 10626				nla_len(tb[NL80211_NAN_FUNC_SERVICE_INFO]);
 10627			func->serv_spec_info =
 10628				kmemdup(nla_data(tb[NL80211_NAN_FUNC_SERVICE_INFO]),
 10629					func->serv_spec_info_len,
 10630					GFP_KERNEL);
 10631			if (!func->serv_spec_info) {
 10632				err = -ENOMEM;
 10633				goto out;
 10634			}
 10635		}
 10636	
 10637		if (tb[NL80211_NAN_FUNC_TTL])
 10638			func->ttl = nla_get_u32(tb[NL80211_NAN_FUNC_TTL]);
 10639	
 10640		switch (func->type) {
 10641		case NL80211_NAN_FUNC_PUBLISH:
 10642			if (!tb[NL80211_NAN_FUNC_PUBLISH_TYPE]) {
 10643				err = -EINVAL;
 10644				goto out;
 10645			}
 10646	
 10647			func->publish_type =
 10648				nla_get_u8(tb[NL80211_NAN_FUNC_PUBLISH_TYPE]);
 10649			func->publish_bcast =
 10650				nla_get_flag(tb[NL80211_NAN_FUNC_PUBLISH_BCAST]);
 10651	
 10652			if ((!(func->publish_type & NL80211_NAN_SOLICITED_PUBLISH)) &&
 10653				func->publish_bcast) {
 10654				err = -EINVAL;
 10655				goto out;
 10656			}
 10657			break;
 10658		case NL80211_NAN_FUNC_SUBSCRIBE:
 10659			func->subscribe_active =
 10660				nla_get_flag(tb[NL80211_NAN_FUNC_SUBSCRIBE_ACTIVE]);
 10661			break;
 10662		case NL80211_NAN_FUNC_FOLLOW_UP:
 10663			if (!tb[NL80211_NAN_FUNC_FOLLOW_UP_ID] ||
 10664			    !tb[NL80211_NAN_FUNC_FOLLOW_UP_REQ_ID]) {
 10665				err = -EINVAL;
 10666				goto out;
 10667			}
 10668	
 10669			func->followup_id =
 10670				nla_get_u8(tb[NL80211_NAN_FUNC_FOLLOW_UP_ID]);
 10671			func->followup_reqid =
 10672				nla_get_u8(tb[NL80211_NAN_FUNC_FOLLOW_UP_REQ_ID]);
 10673			memcpy(func->followup_dest.addr,
 10674			       nla_data(tb[NL80211_NAN_FUNC_FOLLOW_UP_DEST]),
 10675			       sizeof(func->followup_dest.addr));
 10676			if (func->ttl) {
 10677				err = -EINVAL;
 10678				goto out;
 10679			}
 10680			break;
 10681		default:
 10682			err = -EINVAL;
 10683			goto out;
 10684		}
 10685	
 10686		if (tb[NL80211_NAN_FUNC_SRF]) {
 10687			struct nlattr *srf_tb[NUM_NL80211_NAN_SRF_ATTR];
 10688	
 10689			err = nla_parse(srf_tb, NL80211_NAN_SRF_ATTR_MAX,
 10690					nla_data(tb[NL80211_NAN_FUNC_SRF]),
 10691					nla_len(tb[NL80211_NAN_FUNC_SRF]), NULL);
 10692			if (err)
 10693				goto out;
 10694	
 10695			func->srf_include =
 10696				nla_get_flag(srf_tb[NL80211_NAN_SRF_INCLUDE]);
 10697	
 10698			if (srf_tb[NL80211_NAN_SRF_BF]) {
 10699				if (srf_tb[NL80211_NAN_SRF_MAC_ADDRS] ||
 10700				    !srf_tb[NL80211_NAN_SRF_BF_IDX]) {
 10701					err = -EINVAL;
 10702					goto out;
 10703				}
 10704	
 10705				func->srf_bf_len =
 10706					nla_len(srf_tb[NL80211_NAN_SRF_BF]);
 10707				func->srf_bf =
 10708					kmemdup(nla_data(srf_tb[NL80211_NAN_SRF_BF]),
 10709						func->srf_bf_len, GFP_KERNEL);
 10710				if (!func->srf_bf) {
 10711					err = -ENOMEM;
 10712					goto out;
 10713				}
 10714	
 10715				func->srf_bf_idx =
 10716					nla_get_u8(srf_tb[NL80211_NAN_SRF_BF_IDX]);
 10717			} else {
 10718				struct nlattr *attr, *mac_attr =
 10719					srf_tb[NL80211_NAN_SRF_MAC_ADDRS];
 10720				int n_entries, rem, i = 0;
 10721	
 10722				if (!mac_attr) {
 10723					err = -EINVAL;
 10724					goto out;
 10725				}
 10726	
 10727				n_entries = validate_acl_mac_addrs(mac_attr);
 10728				if (n_entries <= 0) {
 10729					err = -EINVAL;
 10730					goto out;
 10731				}
 10732	
 10733				func->srf_num_macs = n_entries;
 10734				func->srf_macs =
 10735					kzalloc(sizeof(*func->srf_macs) * n_entries,
 10736						GFP_KERNEL);
 10737				if (!func->srf_macs) {
 10738					err = -ENOMEM;
 10739					goto out;
 10740				}
 10741	
 10742				nla_for_each_nested(attr, mac_attr, rem)
 10743					memcpy(func->srf_macs[i++].addr, nla_data(attr),
 10744					       sizeof(*func->srf_macs));
 10745			}
 10746		}
 10747	
 10748		if (tb[NL80211_NAN_FUNC_TX_MATCH_FILTER]) {
 10749			err = handle_nan_filter(tb[NL80211_NAN_FUNC_TX_MATCH_FILTER],
 10750						func, true);
 10751			if (err)
 10752				goto out;
 10753		}
 10754	
 10755		if (tb[NL80211_NAN_FUNC_RX_MATCH_FILTER]) {
 10756			err = handle_nan_filter(tb[NL80211_NAN_FUNC_RX_MATCH_FILTER],
 10757						func, false);
 10758			if (err)
 10759				goto out;
 10760		}
 10761	
 10762		msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
 10763		if (!msg) {
 10764			err = -ENOMEM;
 10765			goto out;
 10766		}
 10767	
 10768		hdr = nl80211hdr_put(msg, genl_info_snd_portid(info), info->snd_seq, 0,
 10769				     NL80211_CMD_ADD_NAN_FUNCTION);
 10770		/* This can't really happen - we just allocated 4KB */
 10771		if (WARN_ON(!hdr)) {
 10772			err = -ENOMEM;
 10773			goto out;
 10774		}
 10775	
 10776		err = rdev_add_nan_func(rdev, wdev, func);
 10777	out:
 10778		if (err < 0) {
 10779			cfg80211_free_nan_func(func);
 10780			nlmsg_free(msg);
 10781			return err;
 10782		}
 10783	
 10784		/* propagate the instance id and cookie to userspace  */
 10785		if (nla_put_u64(msg, NL80211_ATTR_COOKIE, func->cookie))
 10786			goto nla_put_failure;
 10787	
 10788		func_attr = nla_nest_start(msg, NL80211_ATTR_NAN_FUNC);

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 23730 bytes --]

^ permalink raw reply

* Re: [PATCH v2 0/9] Add support for Neighbor Awareness Networking
From: Luca Coelho @ 2016-09-16 10:26 UTC (permalink / raw)
  To: Arend Van Spriel, johannes; +Cc: linux-wireless
In-Reply-To: <1055fff0-4eb0-08c5-2e16-a0b6f2887bda@broadcom.com>

On Fri, 2016-09-16 at 11:00 +0200, Arend Van Spriel wrote:
> On 16-9-2016 10:33, Luca Coelho wrote:
> > 
> > From: Luca Coelho <luciano.coelho@intel.com>
> > 
> > Hi,
> > 
> > This is v2 of the NAN patches that Emmanuel sent a while
> > back[1].  In
> > this version, we squashed some patches and took care of some
> > comments
> > after reviews (both internal and public).
> 
> Hi Luca,
> 
> You may have missed some as I think this should be v4.

Right... I saw those other ones, but they didn't have a cover-letter,
this series is sort of the v2 of "Add support for Neighbor Awareness
Networking".  Or something... :)

In any case, this new series should include all the changes done on the
way.

--
Luca.

^ permalink raw reply

* Re: brcmfmac MAC address change delay and 500ms down delay
From: Arend Van Spriel @ 2016-09-16  9:58 UTC (permalink / raw)
  To: Dan Williams, linux-wireless
In-Reply-To: <1473950537.25907.8.camel@redhat.com>

On 15-9-2016 16:42, Dan Williams wrote:
> Hi,
> 
> While refining NetworkManager's MAC address randomization behavior we
> came across two issues with brcmfmac:
> 
> 1) when changing the MAC address, the driver schedules work for the new
> change and returns success, but doesn't actually change the MAC until
> the work is scheduled.  Because it returns 0 from the
> ndo_set_mac_address hook the net core will generate a NETDEV_CHANGEADDR
> event and rtnetlink will send out an RTM_NEWLINK with the old MAC
> address.  No event for the new address will be sent.  So it's pretty
> hard to figure out when the address actually changed, and when its safe
> to associate, without polling the device's MAC address.  Ugly.

And apparently unnecessary. I recalled we had this as the
ndo_set_mac_address callback could be called in atomic context. So we
are using a worker because we are grabbing a mutex upon sending the
control info to the device. Looking into the core network code it seems
the callback is not called in atomic context so it seems we can get rid
of the worker here. I made a patch

> 2) when closing the device (eg, set !IFF_UP) the driver unconditionally
> blocks for 500ms in __brcmf_cfg80211_down():
> 
> 	if (check_vif_up(ifp->vif)) {
> 		brcmf_link_down(ifp->vif, WLAN_REASON_UNSPECIFIED);
> 
> 		/* Make sure WPA_Supplicant receives all the event
> 		   generated due to DISASSOC call to the fw to keep
> 		   the state fw and WPA_Supplicant state consistent
> 		 */
> 		brcmf_delay(500);
> 	}

This is actually a bogus delay as we are under an RTNL lock here so I
think the events will not go out until after the delay has finished. I
did submit a patch long ago removing this delay, but the change was not
accepted. Let me revisit that.

> Should I dump these into kernel bugzilla, or is there some internal bug
> tracker they could get stuffed into?

Kernel bugzilla is fine although I check it rather infrequently.

Regards,
Arend

^ permalink raw reply

* [PATCH][V2] mwifiex: fix null pointer deference when adapter is null
From: Colin King @ 2016-09-16  9:37 UTC (permalink / raw)
  To: Amitkumar Karwar, Nishant Sarmukadam, Kalle Valo, linux-wireless,
	netdev

From: Colin Ian King <colin.king@canonical.com>

If adapter is null the error exit path in mwifiex_shutdown_sw is
to down the semaphore sem and print some debug via mwifiex_dbg.
However, passing a NULL adapter to mwifiex_dbg causes a null
pointer deference when accessing adapter->dev.  This fix checks
for a null adapter at the start of the function and to exit
without the need to up the semaphore and we also skip the debug
to avoid the null pointer dereference.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/wireless/marvell/mwifiex/main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index 9b2e98c..2478ccd 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -1369,12 +1369,12 @@ mwifiex_shutdown_sw(struct mwifiex_adapter *adapter, struct semaphore *sem)
 	struct mwifiex_private *priv;
 	int i;
 
+	if (!adapter)
+		goto exit_return;
+
 	if (down_interruptible(sem))
 		goto exit_sem_err;
 
-	if (!adapter)
-		goto exit_remove;
-
 	priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
 	mwifiex_deauthenticate(priv, NULL);
 
@@ -1430,10 +1430,10 @@ mwifiex_shutdown_sw(struct mwifiex_adapter *adapter, struct semaphore *sem)
 		rtnl_unlock();
 	}
 
-exit_remove:
 	up(sem);
 exit_sem_err:
 	mwifiex_dbg(adapter, INFO, "%s, successful\n", __func__);
+exit_return:
 	return 0;
 }
 
-- 
2.7.4

^ permalink raw reply related

* Re: wireless.wiki.kernel.org: lingering status of http://linuxwireless.org/en/users/Drivers/wl12xx/calibrator/
From: Johannes Berg @ 2016-09-16  9:31 UTC (permalink / raw)
  To: Andreas Mohr; +Cc: linux-wireless
In-Reply-To: <20160915151437.GA24991@rhlx01.hs-esslingen.de>

Hi,

> since we are working with TI WL12xx hardware,
> I keep a reference on
> http://linuxwireless.org/en/users/Drivers/wl12xx/calibrator/ ,
> where it now says:
> "NOTE: this page is for archival only, see the note at the end of the
> page."
> "This is a static dump of the old wiki, taken after locking it in
> January 2015. The new wiki is at https://wireless.wiki.kernel.org/."

Indeed, we migrated the wiki to new infrastructure hosted on kernel.org
back then.

> Trying to find related information by searching for "calibrator" on
> https://wireless.wiki.kernel.org will yield
> https://wireless.wiki.kernel.org/en/developers/documentation/nl80211?
> s[]=calibrator where "wl12xx calibrator" is a *dead link*.
> The apparent underlying reason for this surfaces when going through
> the en ... users ... Drivers hierarchy to
> https://wireless.wiki.kernel.org/en/users/drivers/wl12xx
> where it says
> "
> For relicensing, the content of this page was removed.
> 
> The old website for now has a copy of the old content:
> 
> http://linuxwireless.sipsolutions.net/en/users/Drivers/wl12xx/·
> "

Right, so there were some people who couldn't be reached for
relicensing of their submissions under the license the new wiki
requires. The wl1251 and wl12xx pages were removed since I couldn't
reach Gery Kahn and Oz Krakowski, or they couldn't agree to
relicensing, I don't remember. I still have the Google spreadsheet that
tells me who it was though :-)

> Somehow I am not quite feeling entirely well with this status quo
> (I would expect that that content *will* get lost, and possibly
> rather sooner than later, since someone is bound to eventually say
> "the old site copy is not needed any more").

I have no intention of removing it, since it's a static HTML site and
has no maintenance overhead.

> So, are there some ways to improve the content situation,
> or will this job then eventually need to be done by last-ditch
> efforts (web.archive.org etc.)?

I can't side-step the licensing issue, so no. You can download and
store locally everything you need, I guess.

johannes

^ permalink raw reply

* Re: [PATCH v2 0/9] Add support for Neighbor Awareness Networking
From: Arend Van Spriel @ 2016-09-16  9:00 UTC (permalink / raw)
  To: Luca Coelho, johannes; +Cc: linux-wireless, Luca Coelho
In-Reply-To: <20160916083321.5840-1-luca@coelho.fi>

On 16-9-2016 10:33, Luca Coelho wrote:
> From: Luca Coelho <luciano.coelho@intel.com>
> 
> Hi,
> 
> This is v2 of the NAN patches that Emmanuel sent a while back[1].  In
> this version, we squashed some patches and took care of some comments
> after reviews (both internal and public).

Hi Luca,

You may have missed some as I think this should be v4.

Regards,
Arend

[1]
http://mid.gmane.org/1458845547-28762-1-git-send-email-emmanuel.grumbach@intel.com

> NAN was described in the original post[2].
> 
> I hope they're good for merging now, because I'm tired of carrying
> this changes forward in our internal trees. :P
> 
> Nevertheless, comments are welcome, as always.
> 
> [1] http://mid.gmane.org/1456752313-5792-1-git-send-email-emmanuel.grumbach@intel.com
> [2] http://mid.gmane.org/1442500351-8780-1-git-send-email-andrei.otcheretianski@intel.com
> 
> Cheers,
> Luca.
> 
> 
> Ayala Beker (9):
>   cfg80211: add start / stop NAN commands
>   mac80211: add boilerplate code for start / stop NAN
>   cfg80211: add add_nan_func / rm_nan_func
>   cfg80211: allow the user space to change current NAN configuration
>   cfg80211: provide a function to report a match for NAN
>   cfg80211: Provide an API to report NAN function termination
>   mac80211: implement nan_change_conf
>   mac80211: Implement add_nan_func and rm_nan_func
>   mac80211: Add API to report NAN function match
> 
>  include/net/cfg80211.h       | 184 ++++++++++++-
>  include/net/mac80211.h       |  65 +++++
>  include/uapi/linux/nl80211.h | 258 +++++++++++++++++
>  net/mac80211/cfg.c           | 208 ++++++++++++++
>  net/mac80211/chan.c          |   6 +
>  net/mac80211/driver-ops.h    |  82 +++++-
>  net/mac80211/ieee80211_i.h   |  17 ++
>  net/mac80211/iface.c         |  28 +-
>  net/mac80211/main.c          |   8 +
>  net/mac80211/offchannel.c    |   4 +-
>  net/mac80211/rx.c            |   3 +
>  net/mac80211/trace.h         | 133 +++++++++
>  net/mac80211/util.c          |  50 +++-
>  net/wireless/chan.c          |   2 +
>  net/wireless/core.c          |  35 +++
>  net/wireless/core.h          |   3 +
>  net/wireless/mlme.c          |   1 +
>  net/wireless/nl80211.c       | 642 ++++++++++++++++++++++++++++++++++++++++++-
>  net/wireless/rdev-ops.h      |  58 ++++
>  net/wireless/trace.h         |  90 ++++++
>  net/wireless/util.c          |  28 +-
>  21 files changed, 1894 insertions(+), 11 deletions(-)
> 

^ permalink raw reply

* [PATCH v2 9/9] mac80211: Add API to report NAN function match
From: Luca Coelho @ 2016-09-16  8:33 UTC (permalink / raw)
  To: johannes
  Cc: linux-wireless, Ayala Beker, Andrei Otcheretianski,
	Emmanuel Grumbach, Luca Coelho
In-Reply-To: <20160916083321.5840-1-luca@coelho.fi>

From: Ayala Beker <ayala.beker@intel.com>

Provide an API to report NAN function match. Mac80211 will lookup the
corresponding cookie and report the match to cfg80211.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 include/net/mac80211.h | 16 ++++++++++++++++
 net/mac80211/cfg.c     | 25 +++++++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 5b74229..1b6271e 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -5777,4 +5777,20 @@ void ieee80211_nan_func_terminated(struct ieee80211_vif *vif,
 				   u8 inst_id,
 				   enum nl80211_nan_func_term_reason reason,
 				   gfp_t gfp);
+
+/**
+ * ieee80211_nan_func_match - notify about NAN function match event.
+ *
+ * This function is used to notify mac80211 about NAN function match. The
+ * cookie inside the match struct will be assigned by mac80211.
+ * Note that this function can't be called from hard irq.
+ *
+ * @vif: &struct ieee80211_vif pointer from the add_interface callback.
+ * @match: match event information
+ * @gfp: allocation flags
+ */
+void ieee80211_nan_func_match(struct ieee80211_vif *vif,
+			      struct cfg80211_nan_match_params *match,
+			      gfp_t gfp);
+
 #endif /* MAC80211_H */
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index aee0e25c..20ac00f 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3555,6 +3555,31 @@ void ieee80211_nan_func_terminated(struct ieee80211_vif *vif,
 }
 EXPORT_SYMBOL(ieee80211_nan_func_terminated);
 
+void ieee80211_nan_func_match(struct ieee80211_vif *vif,
+			      struct cfg80211_nan_match_params *match,
+			      gfp_t gfp)
+{
+	struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
+	struct cfg80211_nan_func *func;
+
+	if (WARN_ON(vif->type != NL80211_IFTYPE_NAN))
+		return;
+
+	spin_lock_bh(&sdata->u.nan.func_lock);
+
+	func = idr_find(&sdata->u.nan.function_inst_ids,  match->inst_id);
+	if (WARN_ON(!func)) {
+		spin_unlock_bh(&sdata->u.nan.func_lock);
+		return;
+	}
+	match->cookie = func->cookie;
+
+	spin_unlock_bh(&sdata->u.nan.func_lock);
+
+	cfg80211_nan_match(ieee80211_vif_to_wdev(vif), match, gfp);
+}
+EXPORT_SYMBOL(ieee80211_nan_func_match);
+
 const struct cfg80211_ops mac80211_config_ops = {
 	.add_virtual_intf = ieee80211_add_iface,
 	.del_virtual_intf = ieee80211_del_iface,
-- 
2.9.3

^ permalink raw reply related

* [PATCH v2 8/9] mac80211: Implement add_nan_func and rm_nan_func
From: Luca Coelho @ 2016-09-16  8:33 UTC (permalink / raw)
  To: johannes
  Cc: linux-wireless, Ayala Beker, Andrei Otcheretianski,
	Emmanuel Grumbach, Luca Coelho
In-Reply-To: <20160916083321.5840-1-luca@coelho.fi>

From: Ayala Beker <ayala.beker@intel.com>

Implement add/rm_nan_func functions and handle NAN function
termination notifications. Handle instance_id allocation for
NAN functions and implement the reconfig flow.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 include/net/mac80211.h     |  31 ++++++++++++
 net/mac80211/cfg.c         | 114 +++++++++++++++++++++++++++++++++++++++++++++
 net/mac80211/driver-ops.h  |  32 +++++++++++++
 net/mac80211/ieee80211_i.h |   7 +++
 net/mac80211/iface.c       |  20 +++++++-
 net/mac80211/main.c        |   3 ++
 net/mac80211/trace.h       |  52 +++++++++++++++++++++
 net/mac80211/util.c        |  48 ++++++++++++++++++-
 8 files changed, 304 insertions(+), 3 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index ef8d02a..5b74229 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2177,6 +2177,8 @@ enum ieee80211_hw_flags {
  * @n_cipher_schemes: a size of an array of cipher schemes definitions.
  * @cipher_schemes: a pointer to an array of cipher scheme definitions
  *	supported by HW.
+ * @max_nan_de_entries: maximum number of NAN DE functions supported by the
+ *	device.
  */
 struct ieee80211_hw {
 	struct ieee80211_conf conf;
@@ -2211,6 +2213,7 @@ struct ieee80211_hw {
 	u8 uapsd_max_sp_len;
 	u8 n_cipher_schemes;
 	const struct ieee80211_cipher_scheme *cipher_schemes;
+	u8 max_nan_de_entries;
 };
 
 static inline bool _ieee80211_hw_check(struct ieee80211_hw *hw,
@@ -3429,6 +3432,12 @@ enum ieee80211_reconfig_type {
  *	The driver gets both full configuration and the changed parameters since
  *	some devices may need the full configuration while others need only the
  *	changed parameters.
+ * @add_nan_func: Add a NAN function. Returns 0 on success. The data in
+ *	cfg80211_nan_func must not be referenced outside the scope of
+ *	this call.
+ * @rm_nan_func: Remove a NAN function. The driver must call
+ *	ieee80211_nan_func_terminated() with
+ *	NL80211_NAN_FUNC_TERM_REASON_USER_REQUEST reason code upon removal.
  */
 struct ieee80211_ops {
 	void (*tx)(struct ieee80211_hw *hw,
@@ -3673,6 +3682,12 @@ struct ieee80211_ops {
 	int (*nan_change_conf)(struct ieee80211_hw *hw,
 			       struct ieee80211_vif *vif,
 			       struct cfg80211_nan_conf *conf, u32 changes);
+	int (*add_nan_func)(struct ieee80211_hw *hw,
+			    struct ieee80211_vif *vif,
+			    const struct cfg80211_nan_func *nan_func);
+	void (*rm_nan_func)(struct ieee80211_hw *hw,
+			    struct ieee80211_vif *vif,
+			    u8 instance_id);
 };
 
 /**
@@ -5746,4 +5761,20 @@ struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw,
 void ieee80211_txq_get_depth(struct ieee80211_txq *txq,
 			     unsigned long *frame_cnt,
 			     unsigned long *byte_cnt);
+
+/**
+ * ieee80211_nan_func_terminated - notify about NAN function termination.
+ *
+ * This function is used to notify mac80211 about NAN function termination.
+ * Note that this function can't be called from hard irq.
+ *
+ * @vif: &struct ieee80211_vif pointer from the add_interface callback.
+ * @inst_id: the local instance id
+ * @reason: termination reason (one of the NL80211_NAN_FUNC_TERM_REASON_*)
+ * @gfp: allocation flags
+ */
+void ieee80211_nan_func_terminated(struct ieee80211_vif *vif,
+				   u8 inst_id,
+				   enum nl80211_nan_func_term_reason reason,
+				   gfp_t gfp);
 #endif /* MAC80211_H */
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 38fdb53..aee0e25c 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -174,6 +174,8 @@ static int ieee80211_start_nan(struct wiphy *wiphy,
 	if (ret)
 		ieee80211_sdata_stop(sdata);
 
+	sdata->u.nan.conf = *conf;
+
 	return ret;
 }
 
@@ -216,6 +218,84 @@ static int ieee80211_nan_change_conf(struct wiphy *wiphy,
 	return ret;
 }
 
+static int ieee80211_add_nan_func(struct wiphy *wiphy,
+				  struct wireless_dev *wdev,
+				  struct cfg80211_nan_func *nan_func)
+{
+	struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
+	int ret;
+
+	if (sdata->vif.type != NL80211_IFTYPE_NAN)
+		return -EOPNOTSUPP;
+
+	if (!ieee80211_sdata_running(sdata))
+		return -ENETDOWN;
+
+	spin_lock_bh(&sdata->u.nan.func_lock);
+
+	ret = idr_alloc(&sdata->u.nan.function_inst_ids,
+			nan_func, 1, sdata->local->hw.max_nan_de_entries + 1,
+			GFP_ATOMIC);
+	spin_unlock_bh(&sdata->u.nan.func_lock);
+
+	if (ret < 0)
+		return ret;
+
+	nan_func->instance_id = ret;
+
+	WARN_ON(nan_func->instance_id == 0);
+
+	ret = drv_add_nan_func(sdata->local, sdata, nan_func);
+	if (ret) {
+		spin_lock_bh(&sdata->u.nan.func_lock);
+		idr_remove(&sdata->u.nan.function_inst_ids,
+			   nan_func->instance_id);
+		spin_unlock_bh(&sdata->u.nan.func_lock);
+	}
+
+	return ret;
+}
+
+static struct cfg80211_nan_func *
+ieee80211_find_nan_func_by_cookie(struct ieee80211_sub_if_data *sdata,
+				  u64 cookie)
+{
+	struct cfg80211_nan_func *func;
+	int id;
+
+	lockdep_assert_held(&sdata->u.nan.func_lock);
+
+	idr_for_each_entry(&sdata->u.nan.function_inst_ids, func, id) {
+		if (func->cookie == cookie)
+			return func;
+	}
+
+	return NULL;
+}
+
+static void ieee80211_rm_nan_func(struct wiphy *wiphy,
+				  struct wireless_dev *wdev, u64 cookie)
+{
+	struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
+	struct cfg80211_nan_func *func;
+	u8 instance_id = 0;
+
+	if (sdata->vif.type != NL80211_IFTYPE_NAN ||
+	    !ieee80211_sdata_running(sdata))
+		return;
+
+	spin_lock_bh(&sdata->u.nan.func_lock);
+
+	func = ieee80211_find_nan_func_by_cookie(sdata, cookie);
+	if (func)
+		instance_id = func->instance_id;
+
+	spin_unlock_bh(&sdata->u.nan.func_lock);
+
+	if (instance_id)
+		drv_rm_nan_func(sdata->local, sdata, instance_id);
+}
+
 static int ieee80211_set_noack_map(struct wiphy *wiphy,
 				  struct net_device *dev,
 				  u16 noack_map)
@@ -3443,6 +3523,38 @@ static int ieee80211_del_tx_ts(struct wiphy *wiphy, struct net_device *dev,
 	return -ENOENT;
 }
 
+void ieee80211_nan_func_terminated(struct ieee80211_vif *vif,
+				   u8 inst_id,
+				   enum nl80211_nan_func_term_reason reason,
+				   gfp_t gfp)
+{
+	struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
+	struct cfg80211_nan_func *func;
+	u64 cookie;
+
+	if (WARN_ON(vif->type != NL80211_IFTYPE_NAN))
+		return;
+
+	spin_lock_bh(&sdata->u.nan.func_lock);
+
+	func = idr_find(&sdata->u.nan.function_inst_ids, inst_id);
+	if (WARN_ON(!func)) {
+		spin_unlock_bh(&sdata->u.nan.func_lock);
+		return;
+	}
+
+	cookie = func->cookie;
+	idr_remove(&sdata->u.nan.function_inst_ids, inst_id);
+
+	spin_unlock_bh(&sdata->u.nan.func_lock);
+
+	cfg80211_free_nan_func(func);
+
+	cfg80211_nan_func_terminated(ieee80211_vif_to_wdev(vif), inst_id,
+				     reason, cookie, gfp);
+}
+EXPORT_SYMBOL(ieee80211_nan_func_terminated);
+
 const struct cfg80211_ops mac80211_config_ops = {
 	.add_virtual_intf = ieee80211_add_iface,
 	.del_virtual_intf = ieee80211_del_iface,
@@ -3531,4 +3643,6 @@ const struct cfg80211_ops mac80211_config_ops = {
 	.start_nan = ieee80211_start_nan,
 	.stop_nan = ieee80211_stop_nan,
 	.nan_change_conf = ieee80211_nan_change_conf,
+	.add_nan_func = ieee80211_add_nan_func,
+	.rm_nan_func = ieee80211_rm_nan_func,
 };
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 50aeb3a..ff1066b 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -1213,4 +1213,36 @@ static inline int drv_nan_change_conf(struct ieee80211_local *local,
 	return ret;
 }
 
+static inline int drv_add_nan_func(struct ieee80211_local *local,
+				   struct ieee80211_sub_if_data *sdata,
+				   const struct cfg80211_nan_func *nan_func)
+{
+	int ret;
+
+	might_sleep();
+	check_sdata_in_driver(sdata);
+
+	if (!local->ops->add_nan_func)
+		return -EOPNOTSUPP;
+
+	trace_drv_add_nan_func(local, sdata, nan_func);
+	ret = local->ops->add_nan_func(&local->hw, &sdata->vif, nan_func);
+	trace_drv_return_int(local, ret);
+
+	return ret;
+}
+
+static inline void drv_rm_nan_func(struct ieee80211_local *local,
+				   struct ieee80211_sub_if_data *sdata,
+				   u8 instance_id)
+{
+	might_sleep();
+	check_sdata_in_driver(sdata);
+
+	trace_drv_rm_nan_func(local, sdata, instance_id);
+	if (local->ops->rm_nan_func)
+		local->ops->rm_nan_func(&local->hw, &sdata->vif, instance_id);
+	trace_drv_return_void(local);
+}
+
 #endif /* __MAC80211_DRIVER_OPS */
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 712b20b..2b391f2 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -86,6 +86,8 @@ struct ieee80211_local;
 
 #define IEEE80211_DEAUTH_FRAME_LEN	(24 /* hdr */ + 2 /* reason */)
 
+#define IEEE80211_MAX_NAN_INSTANCE_ID 255
+
 struct ieee80211_fragment_entry {
 	struct sk_buff_head skb_list;
 	unsigned long first_frag_time;
@@ -834,9 +836,14 @@ struct ieee80211_if_mntr {
  * struct ieee80211_if_nan - NAN state
  *
  * @conf: current NAN configuration
+ * @func_ids: a bitmap of available instance_id's
  */
 struct ieee80211_if_nan {
 	struct cfg80211_nan_conf conf;
+
+	/* protects function_inst_ids */
+	spinlock_t func_lock;
+	struct idr function_inst_ids;
 };
 
 struct ieee80211_sub_if_data {
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 507f46a..638ec07 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -798,6 +798,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
 	struct ps_data *ps;
 	struct cfg80211_chan_def chandef;
 	bool cancel_scan;
+	struct cfg80211_nan_func *func;
 
 	clear_bit(SDATA_STATE_RUNNING, &sdata->state);
 
@@ -950,11 +951,22 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
 
 		ieee80211_adjust_monitor_flags(sdata, -1);
 		break;
+	case NL80211_IFTYPE_NAN:
+		/* clean all the functions */
+		spin_lock_bh(&sdata->u.nan.func_lock);
+
+		idr_for_each_entry(&sdata->u.nan.function_inst_ids, func, i) {
+			idr_remove(&sdata->u.nan.function_inst_ids, i);
+			cfg80211_free_nan_func(func);
+		}
+		idr_destroy(&sdata->u.nan.function_inst_ids);
+
+		spin_unlock_bh(&sdata->u.nan.func_lock);
+		break;
 	case NL80211_IFTYPE_P2P_DEVICE:
 		/* relies on synchronize_rcu() below */
 		RCU_INIT_POINTER(local->p2p_sdata, NULL);
 		/* fall through */
-	case NL80211_IFTYPE_NAN:
 	default:
 		cancel_work_sync(&sdata->work);
 		/*
@@ -1462,9 +1474,13 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata,
 	case NL80211_IFTYPE_WDS:
 		sdata->vif.bss_conf.bssid = NULL;
 		break;
+	case NL80211_IFTYPE_NAN:
+		idr_init(&sdata->u.nan.function_inst_ids);
+		spin_lock_init(&sdata->u.nan.func_lock);
+		sdata->vif.bss_conf.bssid = sdata->vif.addr;
+		break;
 	case NL80211_IFTYPE_AP_VLAN:
 	case NL80211_IFTYPE_P2P_DEVICE:
-	case NL80211_IFTYPE_NAN:
 		sdata->vif.bss_conf.bssid = sdata->vif.addr;
 		break;
 	case NL80211_IFTYPE_UNSPECIFIED:
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index b5cf2c5..1075ac2 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -1063,6 +1063,9 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 
 	local->dynamic_ps_forced_timeout = -1;
 
+	if (!local->hw.max_nan_de_entries)
+		local->hw.max_nan_de_entries = IEEE80211_MAX_NAN_INSTANCE_ID;
+
 	result = ieee80211_wep_init(local);
 	if (result < 0)
 		wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n",
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index 0bafe11..e6bed8a 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -1781,6 +1781,58 @@ TRACE_EVENT(drv_nan_change_conf,
 	)
 );
 
+TRACE_EVENT(drv_add_nan_func,
+	TP_PROTO(struct ieee80211_local *local,
+		 struct ieee80211_sub_if_data *sdata,
+		 const struct cfg80211_nan_func *func),
+
+	TP_ARGS(local, sdata, func),
+	TP_STRUCT__entry(
+		LOCAL_ENTRY
+		VIF_ENTRY
+		__field(u8, type)
+		__field(u8, inst_id)
+	),
+
+	TP_fast_assign(
+		LOCAL_ASSIGN;
+		VIF_ASSIGN;
+		__entry->type = func->type;
+		__entry->inst_id = func->instance_id;
+	),
+
+	TP_printk(
+		LOCAL_PR_FMT  VIF_PR_FMT
+		", type: %u, inst_id: %u",
+		LOCAL_PR_ARG, VIF_PR_ARG, __entry->type, __entry->inst_id
+	)
+);
+
+TRACE_EVENT(drv_rm_nan_func,
+	TP_PROTO(struct ieee80211_local *local,
+		 struct ieee80211_sub_if_data *sdata,
+		 u8 instance_id),
+
+	TP_ARGS(local, sdata, instance_id),
+	TP_STRUCT__entry(
+		LOCAL_ENTRY
+		VIF_ENTRY
+		__field(u8, instance_id)
+	),
+
+	TP_fast_assign(
+		LOCAL_ASSIGN;
+		VIF_ASSIGN;
+		__entry->instance_id = instance_id;
+	),
+
+	TP_printk(
+		LOCAL_PR_FMT  VIF_PR_FMT
+		", instance_id: %u",
+		LOCAL_PR_ARG, VIF_PR_ARG, __entry->instance_id
+	)
+);
+
 /*
  * Tracing for API calls that drivers call.
  */
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 5b57fca..91754c8 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1749,6 +1749,46 @@ static void ieee80211_reconfig_stations(struct ieee80211_sub_if_data *sdata)
 	mutex_unlock(&local->sta_mtx);
 }
 
+static int ieee80211_reconfig_nan(struct ieee80211_sub_if_data *sdata)
+{
+	struct cfg80211_nan_func *func, **funcs;
+	int res, id, i = 0;
+
+	res = drv_start_nan(sdata->local, sdata,
+			    &sdata->u.nan.conf);
+	if (WARN_ON(res))
+		return res;
+
+	funcs = kzalloc((sdata->local->hw.max_nan_de_entries + 1) *
+			sizeof(*funcs), GFP_KERNEL);
+	if (!funcs)
+		return -ENOMEM;
+
+	/* Add all the functions:
+	 * This is a little bit ugly. We need to call a potentially sleeping
+	 * callback for each NAN function, so we can't hold the spinlock.
+	 */
+	spin_lock_bh(&sdata->u.nan.func_lock);
+
+	idr_for_each_entry(&sdata->u.nan.function_inst_ids, func, id)
+		funcs[i++] = func;
+
+	spin_unlock_bh(&sdata->u.nan.func_lock);
+
+	for (i = 0; funcs[i]; i++) {
+		res = drv_add_nan_func(sdata->local, sdata, funcs[i]);
+		if (WARN_ON(res))
+			ieee80211_nan_func_terminated(&sdata->vif,
+						      funcs[i]->instance_id,
+						      NL80211_NAN_FUNC_TERM_REASON_ERROR,
+						      GFP_KERNEL);
+	}
+
+	kfree(funcs);
+
+	return 0;
+}
+
 int ieee80211_reconfig(struct ieee80211_local *local)
 {
 	struct ieee80211_hw *hw = &local->hw;
@@ -1972,11 +2012,17 @@ int ieee80211_reconfig(struct ieee80211_local *local)
 				ieee80211_bss_info_change_notify(sdata, changed);
 			}
 			break;
+		case NL80211_IFTYPE_NAN:
+			res = ieee80211_reconfig_nan(sdata);
+			if (res < 0) {
+				ieee80211_handle_reconfig_failure(local);
+				return res;
+			}
+			break;
 		case NL80211_IFTYPE_WDS:
 		case NL80211_IFTYPE_AP_VLAN:
 		case NL80211_IFTYPE_MONITOR:
 		case NL80211_IFTYPE_P2P_DEVICE:
-		case NL80211_IFTYPE_NAN:
 			/* nothing to do */
 			break;
 		case NL80211_IFTYPE_UNSPECIFIED:
-- 
2.9.3

^ permalink raw reply related

* [PATCH v2 7/9] mac80211: implement nan_change_conf
From: Luca Coelho @ 2016-09-16  8:33 UTC (permalink / raw)
  To: johannes
  Cc: linux-wireless, Ayala Beker, Andrei Otcheretianski,
	Emmanuel Grumbach, Luca Coelho
In-Reply-To: <20160916083321.5840-1-luca@coelho.fi>

From: Ayala Beker <ayala.beker@intel.com>

Implement nan_change_conf callback which allows to change current
NAN configuration (master preference and dual band operation).
Store the current NAN configuration in sdata, so it can be used
both to provide the driver the updated configuration with changes
and also it will be used in hw reconfig flows in next patches.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 include/net/mac80211.h     |  9 +++++++++
 net/mac80211/cfg.c         | 31 +++++++++++++++++++++++++++++++
 net/mac80211/driver-ops.h  | 21 +++++++++++++++++++++
 net/mac80211/ieee80211_i.h | 10 ++++++++++
 net/mac80211/trace.h       | 31 +++++++++++++++++++++++++++++++
 5 files changed, 102 insertions(+)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index df9b5cf..ef8d02a 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3423,6 +3423,12 @@ enum ieee80211_reconfig_type {
  *
  * @start_nan: join an existing NAN cluster, or create a new one.
  * @stop_nan: leave the NAN cluster.
+ * @nan_change_conf: change NAN configuration. The data in cfg80211_nan_conf
+ *	contains full new configuration and changes specify which parameters
+ *	are changed with respect to the last NAN config.
+ *	The driver gets both full configuration and the changed parameters since
+ *	some devices may need the full configuration while others need only the
+ *	changed parameters.
  */
 struct ieee80211_ops {
 	void (*tx)(struct ieee80211_hw *hw,
@@ -3664,6 +3670,9 @@ struct ieee80211_ops {
 			 struct cfg80211_nan_conf *conf);
 	int (*stop_nan)(struct ieee80211_hw *hw,
 			struct ieee80211_vif *vif);
+	int (*nan_change_conf)(struct ieee80211_hw *hw,
+			       struct ieee80211_vif *vif,
+			       struct cfg80211_nan_conf *conf, u32 changes);
 };
 
 /**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 9aabb09..38fdb53 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -186,6 +186,36 @@ static void ieee80211_stop_nan(struct wiphy *wiphy,
 	ieee80211_sdata_stop(sdata);
 }
 
+static int ieee80211_nan_change_conf(struct wiphy *wiphy,
+				     struct wireless_dev *wdev,
+				     struct cfg80211_nan_conf *conf,
+				     u32 changes)
+{
+	struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
+	struct cfg80211_nan_conf new_conf;
+	int ret = 0;
+
+	if (sdata->vif.type != NL80211_IFTYPE_NAN)
+		return -EOPNOTSUPP;
+
+	if (!ieee80211_sdata_running(sdata))
+		return -ENETDOWN;
+
+	new_conf = sdata->u.nan.conf;
+
+	if (changes & CFG80211_NAN_CONF_CHANGED_PREF)
+		new_conf.master_pref = conf->master_pref;
+
+	if (changes & CFG80211_NAN_CONF_CHANGED_DUAL)
+		new_conf.dual = conf->dual;
+
+	ret = drv_nan_change_conf(sdata->local, sdata, &new_conf, changes);
+	if (!ret)
+		sdata->u.nan.conf = new_conf;
+
+	return ret;
+}
+
 static int ieee80211_set_noack_map(struct wiphy *wiphy,
 				  struct net_device *dev,
 				  u16 noack_map)
@@ -3500,4 +3530,5 @@ const struct cfg80211_ops mac80211_config_ops = {
 	.del_tx_ts = ieee80211_del_tx_ts,
 	.start_nan = ieee80211_start_nan,
 	.stop_nan = ieee80211_stop_nan,
+	.nan_change_conf = ieee80211_nan_change_conf,
 };
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 67b42c8..50aeb3a 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -1192,4 +1192,25 @@ static inline void drv_stop_nan(struct ieee80211_local *local,
 	trace_drv_return_void(local);
 }
 
+static inline int drv_nan_change_conf(struct ieee80211_local *local,
+				       struct ieee80211_sub_if_data *sdata,
+				       struct cfg80211_nan_conf *conf,
+				       u32 changes)
+{
+	int ret;
+
+	might_sleep();
+	check_sdata_in_driver(sdata);
+
+	if (!local->ops->nan_change_conf)
+		return -EOPNOTSUPP;
+
+	trace_drv_nan_change_conf(local, sdata, conf, changes);
+	ret = local->ops->nan_change_conf(&local->hw, &sdata->vif, conf,
+					  changes);
+	trace_drv_return_int(local, ret);
+
+	return ret;
+}
+
 #endif /* __MAC80211_DRIVER_OPS */
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index c71c735..712b20b 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -830,6 +830,15 @@ struct ieee80211_if_mntr {
 	u8 mu_follow_addr[ETH_ALEN] __aligned(2);
 };
 
+/**
+ * struct ieee80211_if_nan - NAN state
+ *
+ * @conf: current NAN configuration
+ */
+struct ieee80211_if_nan {
+	struct cfg80211_nan_conf conf;
+};
+
 struct ieee80211_sub_if_data {
 	struct list_head list;
 
@@ -929,6 +938,7 @@ struct ieee80211_sub_if_data {
 		struct ieee80211_if_mesh mesh;
 		struct ieee80211_if_ocb ocb;
 		struct ieee80211_if_mntr mntr;
+		struct ieee80211_if_nan nan;
 	} u;
 
 #ifdef CONFIG_MAC80211_DEBUGFS
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index deefbfb..0bafe11 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -1750,6 +1750,37 @@ TRACE_EVENT(drv_stop_nan,
 	)
 );
 
+TRACE_EVENT(drv_nan_change_conf,
+	TP_PROTO(struct ieee80211_local *local,
+		 struct ieee80211_sub_if_data *sdata,
+		 struct cfg80211_nan_conf *conf,
+		 u32 changes),
+
+	TP_ARGS(local, sdata, conf, changes),
+	TP_STRUCT__entry(
+		LOCAL_ENTRY
+		VIF_ENTRY
+		__field(u8, master_pref)
+		__field(u8, dual)
+		__field(u32, changes)
+	),
+
+	TP_fast_assign(
+		LOCAL_ASSIGN;
+		VIF_ASSIGN;
+		__entry->master_pref = conf->master_pref;
+		__entry->dual = conf->dual;
+		__entry->changes = changes;
+	),
+
+	TP_printk(
+		LOCAL_PR_FMT  VIF_PR_FMT
+		", master preference: %u, dual: %d, changes: 0x%x",
+		LOCAL_PR_ARG, VIF_PR_ARG, __entry->master_pref,
+		__entry->dual, __entry->changes
+	)
+);
+
 /*
  * Tracing for API calls that drivers call.
  */
-- 
2.9.3

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox