carl9170fw.git
5 years agokconfig: Document the 'symbol' struct
Ulf Magnusson [Wed, 4 Oct 2017 05:48:14 +0000 (07:48 +0200)]
kconfig: Document the 'symbol' struct

Visibility and choices in particular might be a bit tricky to figure
out.

Also fix existing comment to point out that P_MENU is also used for
menus.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years agokconfig: Document the 'menu' struct
Ulf Magnusson [Wed, 4 Oct 2017 03:37:12 +0000 (05:37 +0200)]
kconfig: Document the 'menu' struct

Understanding what it represents helps a lot when reading the code, and
it's not obvious, so document it.

The ROOT_MENU flag is only set and tested by the gconf and qconf front
ends, so leave it undocumented here. The obvious guess for what it means
is correct.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years agokconfig: Warn if choice default is not in choice
Ulf Magnusson [Tue, 3 Oct 2017 23:25:46 +0000 (01:25 +0200)]
kconfig: Warn if choice default is not in choice

This will catch mistakes like in the following real-world example, where
a "CONFIG_" prefix snuck in, making an undefined symbol the default:

choice
prompt "Compiler optimization level"
default CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE

config CC_OPTIMIZE_FOR_PERFORMANCE
...

config CC_OPTIMIZE_FOR_SIZE
...

endchoice

This now prints the following warning:

init/Kconfig:1036:warning: choice default symbol 'CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE' is not contained in the choice

Cases where the default symbol belongs to the wrong choice are also
detected.

(The mistake is harmless here: Since the default symbol is not visible,
the choice falls back on using the first visible symbol as the default,
which is CC_OPTIMIZE_FOR_PERFORMANCE, as intended.)

Discovered while playing around with Kconfiglib
(https://github.com/ulfalizer/Kconfiglib).

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years agocarl9170 toolchain: update newlib, mpfr and binutils
Christian Lamparter [Sun, 10 Feb 2019 10:23:11 +0000 (11:23 +0100)]
carl9170 toolchain: update newlib, mpfr and binutils

This patch updates the toolchain to utilize:

newlib 3.1.0
mpfr 4.0.2
binutils 2.32

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years agocarl9170 toolchain: Update binutils and GCC
Jason Self [Fri, 27 Jul 2018 05:13:28 +0000 (22:13 -0700)]
carl9170 toolchain: Update binutils and GCC

binutils 2.31.1
GCC 8.2.0

Signed-off-by: Jason Self <j@jxself.org>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years agocarl9170 toolchain: update to gcc 8.1.0
Christian Lamparter [Wed, 2 May 2018 17:24:10 +0000 (19:24 +0200)]
carl9170 toolchain: update to gcc 8.1.0

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years agocarl9170 firmware: fix [-Wpacked-not-aligned] warnings
Christian Lamparter [Wed, 2 May 2018 17:12:51 +0000 (19:12 +0200)]
carl9170 firmware: fix [-Wpacked-not-aligned] warnings

Mark certain structs/union aligned(4) to fix -Wpacked-not-aligned
warnings on gcc 8+.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years agocarl9170 toolchain: update binutils and mpfr
Christian Lamparter [Fri, 9 Feb 2018 20:42:27 +0000 (21:42 +0100)]
carl9170 toolchain: update binutils and mpfr

binutils 2.30
mpfr 4.0.1

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years agokconfig: fix relational operators for bool and tristate symbols
Nicolas Pitre [Fri, 17 Nov 2017 01:06:39 +0000 (20:06 -0500)]
kconfig: fix relational operators for bool and tristate symbols

Since commit 31847b67bec0 ("kconfig: allow use of relations other than
(in)equality") it is possible to use relational operators in Kconfig
statements. However, those operators give unexpected results when
applied to bool/tristate values:

(n < y) = y (correct)
(m < y) = y (correct)
(n < m) = n (wrong)

This happens because relational operators process bool and tristate
symbols as strings and m sorts before n. It makes little sense to do a
lexicographical compare on bool and tristate values though.

Documentation/kbuild/kconfig-language.txt states that expression can have
a value of 'n', 'm' or 'y' (or 0, 1, 2 respectively for calculations).
Let's make it so for relational comparisons with bool/tristate
expressions as well and document them. If at least one symbol is an
actual string then the lexicographical compare works just as before.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years agokconfig/symbol.c: use correct pointer type argument for sizeof
Heinrich Schuchardt [Wed, 8 Nov 2017 21:09:59 +0000 (22:09 +0100)]
kconfig/symbol.c: use correct pointer type argument for sizeof

sym_arr is of type struct symbol **.
So in malloc we need sizeof(struct symbol *).

The problem was indicated by coccinelle.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years agoLicense cleanup: add SPDX GPL-2.0 license identifier to files with no license
Greg Kroah-Hartman [Wed, 1 Nov 2017 14:07:57 +0000 (15:07 +0100)]
License cleanup: add SPDX GPL-2.0 license identifier to files with no license

Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.

By default all files without license information are under the default
license of the kernel, which is GPL version 2.

Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier.  The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.

This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.

How this work was done:

Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
 - file had no licensing information it it.
 - file was a */uapi/* one with no licensing information in it,
 - file was a */uapi/* one with existing licensing information,

Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.

The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne.  Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.

The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed.  Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.

Criteria used to select files for SPDX license identifier tagging was:
 - Files considered eligible had to be source code files.
 - Make and config files were included as candidates if they contained >5
   lines of source
 - File already had some variant of a license header in it (even if <5
   lines).

All documentation files were explicitly excluded.

The following heuristics were used to determine which SPDX license
identifiers to apply.

 - when both scanners couldn't find any license traces, file was
   considered to have no license information in it, and the top level
   COPYING file license applied.

   For non */uapi/* files that summary was:

   SPDX license identifier                            # files
   ---------------------------------------------------|-------
   GPL-2.0                                              11139

   and resulted in the first patch in this series.

   If that file was a */uapi/* path one, it was "GPL-2.0 WITH
   Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:

   SPDX license identifier                            # files
   ---------------------------------------------------|-------
   GPL-2.0 WITH Linux-syscall-note                        930

   and resulted in the second patch in this series.

 - if a file had some form of licensing information in it, and was one
   of the */uapi/* ones, it was denoted with the Linux-syscall-note if
   any GPL family license was found in the file or had no licensing in
   it (per prior point).  Results summary:

   SPDX license identifier                            # files
   ---------------------------------------------------|------
   GPL-2.0 WITH Linux-syscall-note                       270
   GPL-2.0+ WITH Linux-syscall-note                      169
   ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
   ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
   LGPL-2.1+ WITH Linux-syscall-note                      15
   GPL-1.0+ WITH Linux-syscall-note                       14
   ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
   LGPL-2.0+ WITH Linux-syscall-note                       4
   LGPL-2.1 WITH Linux-syscall-note                        3
   ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
   ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1

   and that resulted in the third patch in this series.

 - when the two scanners agreed on the detected license(s), that became
   the concluded license(s).

 - when there was disagreement between the two scanners (one detected a
   license but the other didn't, or they both detected different
   licenses) a manual inspection of the file occurred.

 - In most cases a manual inspection of the information in the file
   resulted in a clear resolution of the license that should apply (and
   which scanner probably needed to revisit its heuristics).

 - When it was not immediately clear, the license identifier was
   confirmed with lawyers working with the Linux Foundation.

 - If there was any question as to the appropriate license identifier,
   the file was flagged for further research and to be revisited later
   in time.

In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.

Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights.  The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.

Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.

In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.

Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
 - a full scancode scan run, collecting the matched texts, detected
   license ids and scores
 - reviewing anything where there was a license detected (about 500+
   files) to ensure that the applied SPDX license was correct
 - reviewing anything where there was no detection but the patch license
   was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
   SPDX license was correct

This produced a worksheet with 20 files needing minor correction.  This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.

These .csv files were then reviewed by Greg.  Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected.  This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.)  Finally Greg ran the script using the .csv files to
generate the patches.

Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years agocarl9170 firmware: remove explicit language standard std=gnu99 parameter
Christian Lamparter [Fri, 26 Jan 2018 19:54:59 +0000 (20:54 +0100)]
carl9170 firmware: remove explicit language standard std=gnu99 parameter

GCC 7.3.0 defaults to -std=gnu11 if no C language dialect options is given.
<https://gcc.gnu.org/onlinedocs/gcc-7.3.0/gcc/Standards.html>

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years agocarl9170 firmware tools: remove old gcc >= 4.4 check
Christian Lamparter [Fri, 26 Jan 2018 19:47:33 +0000 (20:47 +0100)]
carl9170 firmware tools: remove old gcc >= 4.4 check

This check served its purpose. But the days of gcc 4.4 are long
gone. It's no longer needed.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years agocarl9170 firmware toolchain: update gcc, newlib, binutils and support
Christian Lamparter [Fri, 26 Jan 2018 19:26:17 +0000 (20:26 +0100)]
carl9170 firmware toolchain: update gcc, newlib, binutils and support

This patch updates nearly all toolchain packages to the latest
version. This includes:
gcc 7.3.0
binutils 2.29.1
newlib 3.0.0
mpfr 4.0.0
mpc 1.1.0

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agoRemove gperf usage from toolchain
Linus Torvalds [Sat, 19 Aug 2017 17:17:02 +0000 (10:17 -0700)]
Remove gperf usage from toolchain

It turns out that gperf-3.1 changed types in the generated code in ways
that aren't even trivially detectable without having to generate a test-file.

It's just not worth using tools and libraries from clowns that don't
understand or care about compatibility.  So get rid of gperf.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [removed gperf related stuff]
7 years agoKconfig: Introduce the "imply" keyword
Nicolas Pitre [Fri, 11 Nov 2016 05:10:05 +0000 (00:10 -0500)]
Kconfig: Introduce the "imply" keyword

The "imply" keyword is a weak version of "select" where the target
config symbol can still be turned off, avoiding those pitfalls that come
with the "select" keyword.

This is useful e.g. with multiple drivers that want to indicate their
ability to hook into a secondary subsystem while allowing the user to
configure that subsystem out without also having to unset these drivers.

Currently, the same effect can almost be achieved with:

config DRIVER_A
tristate

config DRIVER_B
tristate

config DRIVER_C
tristate

config DRIVER_D
tristate

[...]

config SUBSYSTEM_X
tristate
default DRIVER_A || DRIVER_B || DRIVER_C || DRIVER_D || [...]

This is unwieldy to maintain especially with a large number of drivers.
Furthermore, there is no easy way to restrict the choice for SUBSYSTEM_X
to y or n, excluding m, when some drivers are built-in. The "select"
keyword allows for excluding m, but it excludes n as well. Hence
this "imply" keyword.  The above becomes:

config DRIVER_A
tristate
imply SUBSYSTEM_X

config DRIVER_B
tristate
imply SUBSYSTEM_X

[...]

config SUBSYSTEM_X
tristate

This is much cleaner, and way more flexible than "select". SUBSYSTEM_X
can still be configured out, and it can be set as a module when none of
the drivers are configured in or all of them are modular.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: John Stultz <john.stultz@linaro.org>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Cc: Paul Bolle <pebolle@tiscali.nl>
Cc: linux-kbuild@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: Michal Marek <mmarek@suse.com>
Cc: Edward Cree <ecree@solarflare.com>
Link: http://lkml.kernel.org/r/1478841010-28605-2-git-send-email-nicolas.pitre@linaro.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agokconfig/symbol.c: handle choice_values that depend on 'm' symbols
Dirk Gouders [Fri, 29 Apr 2016 08:24:52 +0000 (10:24 +0200)]
kconfig/symbol.c: handle choice_values that depend on 'm' symbols

If choices consist of choice_values of type tristate that depend on
symbols set to 'm', those choice_values are not set to 'n' if the
choice is changed from 'm' to 'y' (in which case only one active
choice_value is allowed). Those values are also written to the config
file causing modules to be built when they should not.

The following config can be used to reproduce and examine the problem;
with the frontend of your choice set "Choice 0" and "Choice 1" to 'm',
then set "Tristate Choice" to 'y' and save the configuration:

config modules
boolean modules
default y
option modules

config dependency
tristate "Dependency"
default m

choice
prompt "Tristate Choice"
default choice0

config choice0
tristate "Choice 0"

config choice1
tristate "Choice 1"
depends on dependency

endchoice

This patch sets tristate choice_values' visibility that depend on
symbols set to 'm' to 'n' if the corresponding choice is set to 'y'.

This makes them disappear from the choice list and will also cause the
choice_values' value set to 'n' in sym_calc_value() and as a result
they are written as "not set" to the resulting .config file.

Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Dirk Gouders <dirk@gouders.net>
Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Tested-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agokconfig: add unexpected data itself to warning
Paul Bolle [Wed, 16 Mar 2016 20:27:27 +0000 (21:27 +0100)]
kconfig: add unexpected data itself to warning

If the .config parser runs into unexpected data it emits warnings like:
    .config:6911:warning: unexpected data

Add the unexpected data itself to this warning. That makes it easier to
discover what is actually going wrong:
     .config:6911:warning: unexpected data: CONFOG_CHARGER_TPS65217=m

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agoieee80211: Add WFA TPC report element OUI type
Avraham Stern [Fri, 29 Sep 2017 11:21:14 +0000 (14:21 +0300)]
ieee80211: Add WFA TPC report element OUI type

Add Transmit Power Control OUI type definition for WLAN_OUI_MICROSOFT.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agoieee80211: update public action codes
Peter Oh [Tue, 27 Jun 2017 22:07:29 +0000 (15:07 -0700)]
ieee80211: update public action codes

Update Public Action field values as updated in IEEE Std 802.11-2016,
so that modules/drivers can refer it.

Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agocfg80211: support 4-way handshake offloading for 802.1X
Avraham Stern [Fri, 9 Jun 2017 12:08:43 +0000 (13:08 +0100)]
cfg80211: support 4-way handshake offloading for 802.1X

Add API for setting the PMK to the driver. For FT support, allow
setting also the PMK-R0 Name.

This can be used by drivers that support 4-Way handshake offload
while IEEE802.1X authentication is managed by upper layers.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
[arend.vanspriel@broadcom.com: add WANT_1X_4WAY_HS attribute]
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
[reword NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X docs a bit to
say that the device may require it]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agocfg80211: support 4-way handshake offloading for WPA/WPA2-PSK
Eliad Peller [Fri, 9 Jun 2017 12:08:42 +0000 (13:08 +0100)]
cfg80211: support 4-way handshake offloading for WPA/WPA2-PSK

Let drivers advertise support for station-mode 4-way handshake
offloading with a new NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK flag.

Extend use of NL80211_ATTR_PMK attribute indicating it might be passed
as part of NL80211_CMD_CONNECT command, and contain the PSK (which is
the PMK, hence the name.)

The driver/device is assumed to handle the 4-way handshake by
itself in this case (including key derivations, etc.), instead
of relying on the supplicant.

This patch is somewhat based on this one (by Vladimir Kondratiev):
https://patchwork.kernel.org/patch/1309561/.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
[arend.vanspriel@broadcom.com rebase dealing with existing ATTR_PMK]
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
[reword NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK docs to indicate
that this offload might be required]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agomac80211: Add support for BSS max idle period element
Avraham Stern [Wed, 26 Apr 2017 07:58:47 +0000 (10:58 +0300)]
mac80211: Add support for BSS max idle period element

Parse the BSS max idle period element and set the BSS configuration
accordingly so the driver can use this information to configure the
max idle period and to use protected management frames for keep alive
when required.

The BSS max idle period element is defined in IEEE802.11-2016,
section 9.4.2.79

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agoieee80211: fix kernel-doc parsing errors
Johannes Berg [Wed, 26 Apr 2017 07:58:52 +0000 (10:58 +0300)]
ieee80211: fix kernel-doc parsing errors

Some of the enum definitions are unnamed but there's still
an attempt at documenting them - that doesn't work. Name
them to make that work.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agoieee80211: add FT-802.1X AKM suite selector
Luca Coelho [Wed, 26 Apr 2017 07:58:48 +0000 (10:58 +0300)]
ieee80211: add FT-802.1X AKM suite selector

Add the definition for FT-8021.1X AKM selector as defined in
IEEE Std 802.11-2016, table 9-133.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agoieee80211: add SUITE_B AKM selectors
Luca Coelho [Wed, 26 Apr 2017 07:58:46 +0000 (10:58 +0300)]
ieee80211: add SUITE_B AKM selectors

Add the definitions for SUITE_B and SUITE_B_192 AKM selectors as
defined in IEEE802.11REVmc_D5.0, table 9-132.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agocfg80211: Add support for FILS shared key authentication offload
Vidyullatha Kanchanapally [Thu, 30 Mar 2017 21:22:34 +0000 (00:22 +0300)]
cfg80211: Add support for FILS shared key authentication offload

Enhance nl80211 and cfg80211 connect request and response APIs to
support FILS shared key authentication offload. The new nl80211
attributes can be used to provide additional information to the driver
to establish a FILS connection. Also enhance the set/del PMKSA to allow
support for adding and deleting PMKSA based on FILS cache identifier.

Add a new feature flag that drivers can use to advertize support for
FILS shared key authentication and association in station mode when
using their own SME.

Signed-off-by: Vidyullatha Kanchanapally <vkanchan@qti.qualcomm.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agoieee80211: define HT operation CCFS2 field
Johannes Berg [Wed, 15 Feb 2017 14:02:10 +0000 (15:02 +0100)]
ieee80211: define HT operation CCFS2 field

The Channel Center Frequency Segment 2 field is used in
802.11-2016 for encoding the actual channel position of
the 80+80/160 MHz channel, if the max NSS is restricted.
This is used for backwards compatibility.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agoieee80211: rename CCFS1/CCFS2 to CCFS0/CCFS1
Johannes Berg [Wed, 15 Feb 2017 14:02:06 +0000 (15:02 +0100)]
ieee80211: rename CCFS1/CCFS2 to CCFS0/CCFS1

This matches the spec, and otherwise things are really
confusing with the next patch adding CCFS2.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agoieee80211: add FT-PSK AKM suite selector
Avraham Stern [Mon, 13 Feb 2017 12:37:41 +0000 (14:37 +0200)]
ieee80211: add FT-PSK AKM suite selector

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agonl80211: add HT/VHT capabilities to AP parameters
Johannes Berg [Tue, 7 Feb 2017 20:40:44 +0000 (22:40 +0200)]
nl80211: add HT/VHT capabilities to AP parameters

For the benefit of drivers that rebuild IEs in firmware, parse the
IEs for HT/VHT capabilities and the respective membership selector
in the (extended) supported rates. This avoids duplicating the same
code into all drivers that need this information.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agowireless: define cipher/AKM suites using a macro
Johannes Berg [Thu, 26 Jan 2017 16:15:44 +0000 (17:15 +0100)]
wireless: define cipher/AKM suites using a macro

The spec writes cipher/AKM suites as something like 00-0F-AC:9,
but the part after the colon isn't hex, it's decimal, so that
we've already had a few mistakes (in other code, or unmerged
patches) to e.g. write 0x000FAC10 instead of 0x000FAC0A.

Use a macro to avoid that problem.

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agowireless: move IEEE80211_NUM_ACS to ieee80211.h
Johannes Berg [Thu, 5 Jan 2017 12:37:28 +0000 (13:37 +0100)]
wireless: move IEEE80211_NUM_ACS to ieee80211.h

This constant isn't really specific to mac80211, so move it
"up" a level to ieee80211.h

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agocfg80211: Add KEK/nonces for FILS association frames
Jouni Malinen [Wed, 26 Oct 2016 21:42:03 +0000 (00:42 +0300)]
cfg80211: Add KEK/nonces for FILS association frames

The new nl80211 attributes can be used to provide KEK and nonces to
allow the driver to encrypt and decrypt FILS (Re)Association
Request/Response frames in station mode.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agocfg80211: Add Fast Initial Link Setup (FILS) auth algs
Jouni Malinen [Wed, 26 Oct 2016 21:42:02 +0000 (00:42 +0300)]
cfg80211: Add Fast Initial Link Setup (FILS) auth algs

This defines authentication algorithms for FILS (IEEE 802.11ai).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agocfg80211: Define IEEE P802.11ai (FILS) information elements
Jouni Malinen [Wed, 26 Oct 2016 21:42:01 +0000 (00:42 +0300)]
cfg80211: Define IEEE P802.11ai (FILS) information elements

Define the Element IDs and Element ID Extensions from IEEE
P802.11ai/D11.0. In addition, add a new cfg80211_find_ext_ie() wrapper
to make it easier to find information elements that used the Element ID
Extension field.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agomac80211: Encrypt "Group addressed privacy" action frames
Masashi Honma [Wed, 22 Jun 2016 10:55:20 +0000 (19:55 +0900)]
mac80211: Encrypt "Group addressed privacy" action frames

Previously, the action frames to group address was not encrypted. But
[1] "Table 8-38 Category values" indicates "Mesh" and "Multihop" category
action frames should be encrypted (Group addressed privacy == yes). And the
encyption key should be MGTK ([1] 10.13 Group addressed robust management frame
procedures). So this patch modifies the code to make it suitable for spec.

[1] IEEE Std 802.11-2012

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agomac80211: Encrypt "Group addressed privacy" action frames
Masashi Honma [Wed, 22 Jun 2016 10:55:20 +0000 (19:55 +0900)]
mac80211: Encrypt "Group addressed privacy" action frames

Previously, the action frames to group address was not encrypted. But
[1] "Table 8-38 Category values" indicates "Mesh" and "Multihop" category
action frames should be encrypted (Group addressed privacy == yes). And the
encyption key should be MGTK ([1] 10.13 Group addressed robust management frame
procedures). So this patch modifies the code to make it suitable for spec.

[1] IEEE Std 802.11-2012

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agocarl9170fw: update README.md
Christian Lamparter [Sun, 5 Nov 2017 16:22:25 +0000 (17:22 +0100)]
carl9170fw: update README.md

the space (and version) requirements for the toolchain
have to be updated, since it grew bigger and bigger.

This patch also rewrites the contacts section, to make
it hopefully more clear to write to the ML.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agocarl9170 firmware toolchain: include GMP, MPFR and MPC into toolchain built
Jason Self [Sun, 5 Nov 2017 16:18:00 +0000 (17:18 +0100)]
carl9170 firmware toolchain: include GMP, MPFR and MPC into toolchain built

[Updated to the latest releases and modified
from the provided diff... including other changes]

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agocarl9170: fix spurious "error: unrecognized command line option ‘-rdynamic’"
Christian Lamparter [Sun, 5 Nov 2017 15:42:39 +0000 (16:42 +0100)]
carl9170: fix spurious "error: unrecognized command line option ‘-rdynamic’"

This error came from cmake's module Linux-GNU-C.cmake that sets the
linker options. However, this is an embedded target and it does not
support dynamic linking. Until this is fixed, let's just overwrite
the line.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years agocarl9170 toolchain: update to gcc 7.2.0, binutils 2.29 and newlib 2.5.0
Christian Lamparter [Sat, 16 Sep 2017 21:41:24 +0000 (23:41 +0200)]
carl9170 toolchain: update to gcc 7.2.0, binutils 2.29 and newlib 2.5.0

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
7 years agocarl9170 firmware: add fall through comments
Christian Lamparter [Wed, 3 May 2017 12:12:22 +0000 (14:12 +0200)]
carl9170 firmware: add fall through comments

GCC 7.1.0 adds -Wimplicit-fallthrough if -Wextra is set.
In order to suppress the warning, a fallthrough comment
has to be added at the right place.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
7 years agocarl9170 toolchain: update to gcc 7.1.0 and binutils 2.28
Christian Lamparter [Wed, 3 May 2017 12:00:29 +0000 (14:00 +0200)]
carl9170 toolchain: update to gcc 7.1.0 and binutils 2.28

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
7 years agocarl9170 toolchain: update to gcc 6.3.0
Christian Lamparter [Sat, 24 Dec 2016 13:20:57 +0000 (14:20 +0100)]
carl9170 toolchain: update to gcc 6.3.0

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agocarl9170 toolchain: update to gcc 6.2.0 and binutils 2.27
Christian Lamparter [Mon, 22 Aug 2016 21:41:21 +0000 (23:41 +0200)]
carl9170 toolchain: update to gcc 6.2.0 and binutils 2.27

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years agocarl9170 firmware tools: remove unused otus_magic
Christian Lamparter [Mon, 22 Aug 2016 21:39:55 +0000 (23:39 +0200)]
carl9170 firmware tools: remove unused otus_magic

gcc 6.2.0 is warning about the following unused const:
src/fwinfo.c:265:22: warning: ‘otus_magic’ defined but not used.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years agounbreak allmodconfig KCONFIG_ALLCONFIG=...
Al Viro [Thu, 14 Jan 2016 18:13:49 +0000 (18:13 +0000)]
unbreak allmodconfig KCONFIG_ALLCONFIG=...

Prior to 3.13 make allmodconfig KCONFIG_ALLCONFIG=/dev/null used
to be equivalent to make allmodconfig; these days it hardwires MODULES to n.
In fact, any KCONFIG_ALLCONFIG that doesn't set MODULES explicitly is
treated as if it set it to n.

Regression had been introduced by commit cfa98f ("kconfig: do not
override symbols already set"); what happens is that conf_read_simple()
does sym_calc_value(modules_sym) on exit, which leaves SYMBOL_VALID set and
has conf_set_all_new_symbols() skip modules_sym.

It's pretty easy to fix - simply move that call of sym_calc_value()
into the callers, except for the ones in KCONFIG_ALLCONFIG handling.
Objections?

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Fixes: cfa98f2e0ae9 ("kconfig: do not override symbols already set")
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agokconfig: return 'false' instead of 'no' in bool function
Vegard Nossum [Fri, 1 Jan 2016 16:34:05 +0000 (17:34 +0100)]
kconfig: return 'false' instead of 'no' in bool function

menu_is_visible() is a bool function and should use boolean return
values. "no" is a tristate value which happens to also have a value
of 0, but we should nevertheless use the right symbol for it.

This is a very minor cleanup with no semantic change.

Fixes: 86e187ff9 ("kconfig: add an option to determine a menu's visibility")
Cc: Arnaud Lacombe <lacombar@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agokconfig: allow kconfig to handle longer path names
Markus Mayer [Wed, 9 Dec 2015 22:56:12 +0000 (14:56 -0800)]
kconfig: allow kconfig to handle longer path names

The current (arbitrary) limit of 128 characters for path names has
proven too short for Android builds, as longer path names are used
there.

Change conf.c, so it can handle path lengths up to PATH_MAX characters.

Signed-off-by: Markus Mayer <mmayer@broadcom.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agokconfig: Fix copy&paste error
Michal Sojka [Mon, 19 Oct 2015 14:51:02 +0000 (16:51 +0200)]
kconfig: Fix copy&paste error

Fixes: 31847b67bec0 ("kconfig: allow use of relations other than (in)equality")
Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agokbuild: document recursive dependency limitation / resolution
Luis R. Rodriguez [Wed, 7 Oct 2015 23:16:33 +0000 (16:16 -0700)]
kbuild: document recursive dependency limitation / resolution

Recursive dependency issues with kconfig are unavoidable due to
some limitations with kconfig, since these issues are recurring
provide a hint to the user how they can resolve these dependency
issues and also document why such limitation exists.

While at it also document a bit of future prospects of ways to
enhance Kconfig, including providing formal semantics and evaluation
of use of a SAT solver. If you're interested in this work or prospects
of it check out the kconfig-sat project wiki [0] and mailing list [1].

[0] http://kernelnewbies.org/KernelProjects/kconfig-sat
[1] https://groups.google.com/d/forum/kconfig-sat

Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: James Bottomley <jbottomley@odin.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Paul Bolle <pebolle@tiscali.nl>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Mate Soos <soos.mate@gmail.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agokconfig: warn of unhandled characters in Kconfig commands
Andreas Ruprecht [Sun, 12 Jul 2015 07:41:50 +0000 (09:41 +0200)]
kconfig: warn of unhandled characters in Kconfig commands

In Kconfig, definitions of options take the following form:
"<COMMAND> <PARAM> <PARAM> ...". COMMANDs and PARAMs are treated
slightly different by the underlying parser.

While commit 2e0d737fc76f ("kconfig: don't silently ignore unhandled
characters") introduced a warning for unsupported characters around
PARAMs, it does not cover situations where a COMMAND has additional
characters before it.

This change makes Kconfig emit a warning if superfluous characters
are found before COMMANDs. As the 'help' statement sometimes is
written as '---help---', the '-' character would now also be regarded
as unhandled and generate a warning. To avoid that, '-' is added to
the list of allowed characters, and the token '---help---' is included
in the zconf.gperf file.

Reported-by: Valentin Rothberg <valentinrothberg@gmail.com>
Signed-off-by: Andreas Ruprecht <andreas.ruprecht@fau.de>
Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
Tested-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agokconfig: Delete unnecessary checks before the function call "sym_calc_value"
Markus Elfring [Tue, 7 Jul 2015 19:48:23 +0000 (21:48 +0200)]
kconfig: Delete unnecessary checks before the function call "sym_calc_value"

The sym_calc_value() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agokconfig: allow use of relations other than (in)equality
Jan Beulich [Mon, 15 Jun 2015 12:00:21 +0000 (13:00 +0100)]
kconfig: allow use of relations other than (in)equality

Over the years I found it desirable to be able to use all sorts of
relations, not just (in)equality. And apparently I'm not the only one,
as there's at least one example in the tree where the programmer
assumed this would work (see DEBUG_UART_8250_WORD in
arch/arm/Kconfig.debug). Another possible use would e.g. be to fold the
two SMP/NR_CPUS prompts into one: SMP could be promptless, simply
depending on NR_CPUS > 1.

A (desirable) side effect of this change - resulting from numeric
values now necessarily being compared as numbers rather than as
strings - is that comparing hex values now works as expected: Other
than int ones (which aren't allowed to have leading zeroes), zeroes
following the 0x prefix made them compare unequal even if their values
were equal.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agokconfig: don't silently ignore unhandled characters
Jan Beulich [Tue, 20 Jan 2015 12:52:48 +0000 (12:52 +0000)]
kconfig: don't silently ignore unhandled characters

At the very least we should tell people that what they wrote is not
what the utility understands.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agoKconfig: Remove bad inference rules expr_eliminate_dups2()
Martin Walch [Fri, 22 May 2015 11:41:52 +0000 (13:41 +0200)]
Kconfig: Remove bad inference rules expr_eliminate_dups2()

expr_eliminate_dups2() in config/expr.c applies two invalid
inference rules:

(FOO || BAR) && (!FOO && !BAR) -> n
(FOO && BAR) || (!FOO || !BAR) -> y

They would be correct in propositional logic, but this is a three-valued
logic, and here it is wrong in that it changes semantics. It becomes
immediately visible when assigning the value 1 to both, FOO and BAR:

(FOO || BAR) && (!FOO && !BAR)
-> min(max(1, 1), min(2-1, 2-1)) = min(1, 1) = 1

while n evaluates to 0 and

(FOO && BAR) || (!FOO || !BAR)
-> max(min(1, 1), max(2-1, 2-1)) = max(1, 1) = 1

with y evaluating to 2.

Fix it by removing expr_eliminate_dups2() and the functions that have no
use anywhere else: expr_extract_eq_and(), expr_extract_eq_or(),
and expr_extract_eq() from config/expr.c

Currently the bug is not triggered in mainline, so this patch does not
modify the configuration space there. To observe the bug consider this
example:

config MODULES
        def_bool y
        option modules

config FOO
        def_tristate m

config BAR
        def_tristate m

config TEST1
        def_tristate y
        depends on (FOO || BAR) && (!FOO && !BAR)

if TEST1 = n
comment "TEST1 broken"
endif

config TEST2
        def_tristate y
        depends on (FOO && BAR) || (!FOO || !BAR)

if TEST2 = y
comment "TEST2 broken"
endif

config TEST3
        def_tristate y
        depends on m && !m

if TEST3 = n
comment "TEST3 broken"
endif

TEST1, TEST2 and TEST3 should all evaluate to m, but without the patch,
none of them does. It is probably not obvious that TEST3 is the same bug,
but it becomes clear when considering what happens internally to the
expression
m && !m":
First it expands to
(m && MODULES) && !(m && MODULES),
then it is transformed into
(m && MODULES) && (!m || !MODULES),
and finally due to the bug it is replaced with n.

As a side effect, this patch reduces code size in expr.c by roughly 10%
and slightly improves startup time for all configuration frontends.

Signed-off-by: Martin Walch <walch.martin@web.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agomac80211: add A-MSDU tx support
Felix Fietkau [Thu, 3 Mar 2016 21:59:00 +0000 (22:59 +0100)]
mac80211: add A-MSDU tx support

Requires software tx queueing and fast-xmit support. For good
performance, drivers need frag_list support as well. This avoids the
need for copying data of aggregated frames. Running without it is only
supported for debugging purposes.

To avoid performance and packet size issues, the rate control module or
driver needs to limit the maximum A-MSDU size by setting
max_rc_amsdu_len in struct ieee80211_sta.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
[fix locking issue]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agomac80211: add fast-rx path
Johannes Berg [Thu, 31 Mar 2016 17:02:10 +0000 (20:02 +0300)]
mac80211: add fast-rx path

The regular RX path has a lot of code, but with a few
assumptions on the hardware it's possible to reduce the
amount of code significantly. Currently the assumptions
on the driver are the following:
 * hardware/driver reordering buffer (if supporting aggregation)
 * hardware/driver decryption & PN checking (if using encryption)
 * hardware/driver did de-duplication
 * hardware/driver did A-MSDU deaggregation
 * AP_LINK_PS is used (in AP mode)
 * no client powersave handling in mac80211 (in client mode)

of which some are actually checked per packet:
 * de-duplication
 * PN checking
 * decryption
and additionally packets must
 * not be A-MSDU (have been deaggregated by driver/device)
 * be data packets
 * not be fragmented
 * be unicast
 * have RFC 1042 header

Additionally dynamically we assume:
 * no encryption or CCMP/GCMP, TKIP/WEP/other not allowed
 * station must be authorized
 * 4-addr format not enabled

Some data needed for the RX path is cached in a new per-station
"fast_rx" structure, so that we only need to look at this and
the packet, no other memory when processing packets on the fast
RX path.

After doing the above per-packet checks, the data path collapses
down to a pretty simple conversion function taking advantage of
the data cached in the small fast_rx struct.

This should speed up the RX processing, and will make it easier
to reason about parallelizing RX (for which statistics will need
to be per-CPU still.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agoieee80211: support parsing Fine Timing Measurement action frame
Avraham Stern [Thu, 17 Mar 2016 13:02:53 +0000 (15:02 +0200)]
ieee80211: support parsing Fine Timing Measurement action frame

Add definition for Fine Timing Measurement (FTM) frame format
as defined in IEEE802.11-REVmcD5.0 section 9.6.8.33

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agomac80211: limit the A-MSDU Tx based on peer's capabilities
Emmanuel Grumbach [Sun, 13 Dec 2015 13:41:05 +0000 (15:41 +0200)]
mac80211: limit the A-MSDU Tx based on peer's capabilities

In VHT, the specification allows to limit the number of
MSDUs in an A-MSDU in the Extended Capabilities IE. There
is also a limitation on the byte size in the VHT IE.
In HT, the only limitation is on the byte size.
Parse the capabilities from the peer and make them
available to the driver.

In HT, there is another limitation when a BA agreement
is active: the byte size can't be greater than 4095.
This is not enforced here.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agomac80211: process and save VHT MU-MIMO group frame
Sara Sharon [Tue, 8 Dec 2015 14:04:31 +0000 (16:04 +0200)]
mac80211: process and save VHT MU-MIMO group frame

The Group ID Management frame is an Action frame of
category VHT. It is transmitted by the AP to assign
or change the user position of a STA for one or more
group IDs.
Process and save the group membership data. Notify
underlying driver of changes.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agowireless: add WNM action frame categories
Johannes Berg [Wed, 7 Oct 2015 13:48:26 +0000 (15:48 +0200)]
wireless: add WNM action frame categories

Add the WNM and unprotected WNM categories and mark the latter
as not robust.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agowireless: update robust action frame list
Johannes Berg [Wed, 7 Oct 2015 13:48:25 +0000 (15:48 +0200)]
wireless: update robust action frame list

Unprotected DMG and VHT action frames are not protected, reflect
that in the list.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agonet/ieee80211: ieee80211_is_* can be boolean
Yaowei Bai [Thu, 8 Oct 2015 13:28:55 +0000 (21:28 +0800)]
net/ieee80211: ieee80211_is_* can be boolean

This patch makes ieee80211_is_* return bool to improve
readability due to these particular functions only using either
one or zero as their return value.

No functional change.

Signed-off-by: Yaowei Bai <bywxiaobai@163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agowireless: mark element IDs 8 and 9 reserved
Johannes Berg [Fri, 28 Aug 2015 12:31:48 +0000 (14:31 +0200)]
wireless: mark element IDs 8 and 9 reserved

These were never used in the tree, and are marked as reserved
in the IEEE 802.11 documentation (ANA).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agomac80211: allow to transmit A-MSDU within A-MPDU
Emmanuel Grumbach [Sun, 16 Aug 2015 08:13:22 +0000 (11:13 +0300)]
mac80211: allow to transmit A-MSDU within A-MPDU

Advertise the capability to send A-MSDU within A-MPDU
in the AddBA request sent by mac80211. Let the driver
know about the peer's capabilities.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agomac80211: fix BIT position for TDLS WIDE extended cap
Emmanuel Grumbach [Sun, 19 Jul 2015 13:09:12 +0000 (16:09 +0300)]
mac80211: fix BIT position for TDLS WIDE extended cap

The bit was not according to ieee80211 specification.
Fix that.

Reviewed-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agocarl9170 toolchain: update to gcc 6.1.0, newlib 2.4.0 and binutils 2.26
Christian Lamparter [Wed, 27 Apr 2016 13:25:30 +0000 (15:25 +0200)]
carl9170 toolchain: update to gcc 6.1.0, newlib 2.4.0 and binutils 2.26

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agocarl9170 firmware: fix off-by-one error when CARL9170FW_USB_MODESWITCH is set
Christian Lamparter [Mon, 15 Feb 2016 16:32:14 +0000 (17:32 +0100)]
carl9170 firmware: fix off-by-one error when CARL9170FW_USB_MODESWITCH is set

usb/usb.c: In function ‘usb_set_configuration’:
usb/usb.c:544:1: error: control reaches end of non-void function [-Werror=return-type]

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agocarl9170 firmware: reserve feature flag for PATTERN_GENERATOR
Christian Lamparter [Mon, 15 Feb 2016 00:15:02 +0000 (01:15 +0100)]
carl9170 firmware: reserve feature flag for PATTERN_GENERATOR

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agocarl9170 firmware: add get_random_u16 helper
Christian Lamparter [Sun, 14 Feb 2016 23:33:56 +0000 (00:33 +0100)]
carl9170 firmware: add get_random_u16 helper

The HW has a built-in random number generator. This
patch adds a convenient helper to get random 16-bit
values in the firmware.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
8 years agocarl9170 toolchain: update to gcc-5.3.0
Christian Lamparter [Fri, 4 Dec 2015 23:02:24 +0000 (00:02 +0100)]
carl9170 toolchain: update to gcc-5.3.0

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agocarl9170 toolchain: update to gcc-5.2.0
Christian Lamparter [Fri, 21 Aug 2015 11:54:27 +0000 (13:54 +0200)]
carl9170 toolchain: update to gcc-5.2.0

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agocarl9170 firmware tools: fix compile errors in wol.c
Christian Lamparter [Fri, 21 Aug 2015 11:44:36 +0000 (13:44 +0200)]
carl9170 firmware tools: fix compile errors in wol.c

wol.c: In function ‘monitor_init’:
wol.c:40:19: warning: implicit declaration of function ‘if_nametoindex’
  ll.sll_ifindex = if_nametoindex(ifname);
                   ^
wol.c:46:45: warning: implicit declaration of function ‘htons’
  monitor_sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
                                             ^

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agocarl9170 firmware: fix CMake developer Warning about CMP0050
Christian Lamparter [Wed, 20 May 2015 12:22:58 +0000 (14:22 +0200)]
carl9170 firmware: fix CMake developer Warning about CMP0050

This patch fixes the numerous warnings about the unsupported use
of the SOURCE signature for the add_custom_command:

"CMake Warning (dev) at carlfw/CMakeLists.txt (add_custom_command):
  Policy CMP0050 is not set: Disallow add_custom_command SOURCE signatures.
  Run "cmake --help-policy CMP0050" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The SOURCE signatures of add_custom_command are no longer supported.
This warning is for project developers.  Use -Wno-dev to suppress it."

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agokconfig: Do not print status messages in make -s mode
Michal Marek [Wed, 8 Apr 2015 11:30:42 +0000 (13:30 +0200)]
kconfig: Do not print status messages in make -s mode

Add an -s option to the various frontends and pass it when make -s is
used. Also, use $(kecho) instead of @echo in the Makefile.

Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agokconfig: Remove unnecessary prototypes from headers
Michal Marek [Tue, 24 Feb 2015 15:37:13 +0000 (16:37 +0100)]
kconfig: Remove unnecessary prototypes from headers

Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agokconfig: Remove dead code
Michal Marek [Tue, 24 Feb 2015 15:32:09 +0000 (16:32 +0100)]
kconfig: Remove dead code

Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agokconfig: Get rid of the P() macro in headers
Michal Marek [Tue, 27 Jan 2015 16:11:42 +0000 (17:11 +0100)]
kconfig: Get rid of the P() macro in headers

This was originally meant for dlopen()ing a potential kconfig shared
library. The unused dlopen code has already been removed in commit
5a6f8d2b (kconfig: nuke LKC_DIRECT_LINK cruft), so let's remove the
rest. The lkc_proto.h change was made with the following sed script:

  sed -r 's/^P\(([^,]*), *([^,]*), *(.*)\);/\2 \1\3;/'

Plus some manual adjustments.

Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agokconfig: use va_end to match corresponding va_start
Colin Ian King [Mon, 12 Jan 2015 13:18:26 +0000 (13:18 +0000)]
kconfig: use va_end to match corresponding va_start

Although on some systems va_end is a no-op, it is good practice
to use va_end, especially since the manual states:

"Each invocation of va_start() must be matched by a corresponding
invocation of va_end() in the same function."

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agomac80111: Add BIP-CMAC-256 cipher
Jouni Malinen [Sat, 24 Jan 2015 17:52:08 +0000 (19:52 +0200)]
mac80111: Add BIP-CMAC-256 cipher

This allows mac80211 to configure BIP-CMAC-256 to the driver and also
use software-implementation within mac80211 when the driver does not
support this with hardware accelaration.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agocfg80211: Add new GCMP, CCMP-256, BIP-GMAC, BIP-CMAC-256 ciphers
Jouni Malinen [Sat, 24 Jan 2015 17:52:05 +0000 (19:52 +0200)]
cfg80211: Add new GCMP, CCMP-256, BIP-GMAC, BIP-CMAC-256 ciphers

This makes cfg80211 aware of the GCMP, GCMP-256, CCMP-256, BIP-GMAC-128,
BIP-GMAC-256, and BIP-CMAC-256 cipher suites. These new cipher suites
were defined in IEEE Std 802.11ac-2013.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agocarl9170 toolchain: update to gcc-5.1.0
Christian Lamparter [Tue, 19 May 2015 13:07:23 +0000 (15:07 +0200)]
carl9170 toolchain: update to gcc-5.1.0

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agocarl9170 firmware: support write one byte at a time command
Christian Lamparter [Wed, 21 Jan 2015 15:56:40 +0000 (16:56 +0100)]
carl9170 firmware: support write one byte at a time command

This command is necessary to write into the serial eeprom.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agocarl9170: add register definitions for EEPROM and SPI controller
Christian Lamparter [Wed, 21 Jan 2015 15:39:26 +0000 (16:39 +0100)]
carl9170: add register definitions for EEPROM and SPI controller

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agocarl9170: fix spelling in config file
Christian Lamparter [Sat, 10 Jan 2015 18:46:07 +0000 (19:46 +0100)]
carl9170: fix spelling in config file

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agocarl9170 toolchain: add SHA256 for binutils-2.25
Christian Lamparter [Sat, 10 Jan 2015 17:20:41 +0000 (18:20 +0100)]
carl9170 toolchain: add SHA256 for binutils-2.25

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agokconfig: Fix warning "‘jump’ may be used uninitialized"
Peter Kümmel [Tue, 4 Nov 2014 11:01:59 +0000 (12:01 +0100)]
kconfig: Fix warning "‘jump’ may be used uninitialized"

Warning:
In file included from scripts/kconfig/zconf.tab.c:2537:0:
scripts/kconfig/menu.c: In function ‘get_symbol_str’:
scripts/kconfig/menu.c:590:18: warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     jump->offset = strlen(r->s);

Simplifies the test logic because (head && local) means (jump != 0)
and makes GCC happy when checking if the jump pointer was initialized.

Signed-off-by: Peter Kümmel <syntheticpp@gmx.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agoReplace mentions of "list_struct" to "list_head"
Andrey Utkin [Fri, 14 Nov 2014 01:09:55 +0000 (05:09 +0400)]
Replace mentions of "list_struct" to "list_head"

There's no such thing as "list_struct".

Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agokbuild: trivial - use tabs for code indent where possible
Masahiro Yamada [Tue, 10 Jun 2014 10:08:13 +0000 (19:08 +0900)]
kbuild: trivial - use tabs for code indent where possible

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agokbuild: trivial - remove trailing empty lines
Masahiro Yamada [Thu, 29 May 2014 05:12:29 +0000 (14:12 +0900)]
kbuild: trivial - remove trailing empty lines

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agokconfig: make allnoconfig disable options behind EMBEDDED and EXPERT
Josh Triplett [Mon, 7 Apr 2014 22:39:09 +0000 (15:39 -0700)]
kconfig: make allnoconfig disable options behind EMBEDDED and EXPERT

"make allnoconfig" exists to ease testing of minimal configurations.
Documentation/SubmitChecklist includes a note to test with allnoconfig.
This helps catch missing dependencies on common-but-not-required
functionality, which might otherwise go unnoticed.

However, allnoconfig still leaves many symbols enabled, because they're
hidden behind CONFIG_EMBEDDED or CONFIG_EXPERT.  For instance, allnoconfig
still has CONFIG_PRINTK and CONFIG_BLOCK enabled, so drivers don't
typically get build-tested with those disabled.

To address this, introduce a new Kconfig option "allnoconfig_y", used on
symbols which only exist to hide other symbols.  Set it on CONFIG_EMBEDDED
(which then selects CONFIG_EXPERT).  allnoconfig will then disable all the
symbols hidden behind those.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Tested-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agocarl9170 tools: add attribute macros to host library file
Christian Lamparter [Thu, 1 Jan 2015 16:34:17 +0000 (17:34 +0100)]
carl9170 tools: add attribute macros to host library file

The macros [__packed, __aligned(x), ...] are already defined
as part of newlib's sys/cdefs.h. However they are not part of
standard libc which is used to compile the host tools.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agomac80211: add parsing of TDLS specific IEs
Arik Nemtsov [Sun, 9 Nov 2014 16:50:18 +0000 (18:50 +0200)]
mac80211: add parsing of TDLS specific IEs

These are used in TDLS channel switching code.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agocfg/mac80211: define TDLS channel switch feature bit
Arik Nemtsov [Sun, 9 Nov 2014 16:50:14 +0000 (18:50 +0200)]
cfg/mac80211: define TDLS channel switch feature bit

Define some related TDLS protocol constants and advertise channel switch
support in the extended-capabilities IE when the feature bit is defined.

Actually supporting TDLS channel-switching also requires support for
some new nl80211 commands, to be introduced by future patches.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agomac80211: add BSS coex IE to TDLS setup frames
Arik Nemtsov [Sun, 9 Nov 2014 16:50:13 +0000 (18:50 +0200)]
mac80211: add BSS coex IE to TDLS setup frames

Add the BSS coex IE in case we support HT40 channels, as mandated by
section 8.5.13 in IEEE802.11 2012.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agoieee80211: add "max length of AMPDU" enum for VHT
Eran Harary [Mon, 3 Nov 2014 18:06:47 +0000 (20:06 +0200)]
ieee80211: add "max length of AMPDU" enum for VHT

Maximum length of AMPDU that an STA can receive in VHT.
length = 2 ^ (13 + max_ampdu_length_exp) - 1.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agomac80211: add extended channel switching capability if the driver supports CSA
Luciano Coelho [Wed, 8 Oct 2014 06:48:36 +0000 (09:48 +0300)]
mac80211: add extended channel switching capability if the driver supports CSA

The Extended Channel Switching capability bit in the extended
capabilities element must be set if the driver supports CSA on
non-beaconing interfaces.

Since this capability needs to be set during driver registration, the
extended_capabiliities global variable needs to be moved to the local
structure so that it can be modified.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agocfg80211: add WMM traffic stream API
Johannes Berg [Tue, 9 Sep 2014 19:55:35 +0000 (22:55 +0300)]
cfg80211: add WMM traffic stream API

Add nl80211 and driver API to validate, add and delete traffic
streams with appropriate settings.

The API calls for userspace doing the action frame handshake
with the peer, and then allows only to set up the parameters
in the driver. To avoid setting up a session only to tear it
down again, the validate API is provided, but the real usage
later can still fail so userspace must be prepared for that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>