carl9170 toolchain: toolchain updates

 + update to gcc-4.8.1

 + delete source files which failed the sha256 check

 + automatic parallel build of the toolchain

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
mac80211: unify CSA action frame/beacon processing

CSA action frame content should be processed as variable IEs
rather than fixed to make it extensible. Unify the code and
process them just like CSA in beacons to make it easier to
extend for HT/VHT.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
mac80211: support extended channel switch

Support extended channel switch when the operating
class is one of the global operating classes as
defined in Annex E of 802.11-2012. If it isn't,
disconnect from the AP instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
mac80211: support secondary channel offset in CSA

Add support for the secondary channel offset IE in channel
switch announcements. This is necessary for proper handling
of CSA on HT access points.

For this to work it is also necessary to convert everything
here to use chandef structs instead of just channels. The
driver updates aren't really correct though. In particular,
the TI wl18xx driver update can't possibly be right since
it just ignores the new channel width for lack of firmware
API.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
mac80211: handle extended channel switch announcement

Handle the (public) extended channel switch announcement
action frames. Parts of the data in these frames isn't
really in IEs, but put it into the elems struct anyway
to simplify the handling.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
wireless: define operating mode action frame

Define the action frame format, the VHT category
and its action types and the field format and EID
for operating mode notifications. The frame may
be used outside of VHT context as well, so don't
include "VHT" in the names.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
mac80211: parse VHT channel switch IEs

VHT introduces multiple IEs that need to be parsed for a
wide bandwidth channel switch. Two are (currently) needed
in mac80211:
 * wide bandwidth channel switch element
 * channel switch wrapper element

The former is contained in the latter for beacons and probe
responses, but not for the spectrum management action frames
so the IE parser needs a new argument to differentiate them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
wireless: move crypto constants to ieee80211.h

mac80211 and the Intel drivers all define crypto
constants, move them to ieee80211.h instead.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
menuconfig: Fix memory leak introduced by jump keys feature

Fixes the memory leak of struct jump_key allocated in get_prompt_str()

Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: stable@vger.kernel.org
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
menuconfig: Add "breadcrumbs" navigation aid

Displays a trail of the menu entries used to get to the current menu.

Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
[yann.morin.1998@free.fr: small, trivial code re-ordering]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
kconfig: fix randconfig tristate detection

Because the modules' symbole (CONFIG_MODULES) may not yet be set when
we check a symbol's tristate capabilty, we'll always find that tristate
symbols are booleans, even if we randomly decided that to enable modules:
sym_get_type(sym) always return boolean for tristates when modules_sym
has not been previously set to 'y' *and* its value calculated *and* its
visibility calculated, both of which only occur after we randomly assign
values to symbols.

Fix that by looking at the raw type of symbols. Tristate set to 'm' will
be promoted to 'y' when their values will be later calculated.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
kconfig: do not override symbols already set

For randconfig, if a list of required symbols is specified with
KCONFIG_ALLCONFIG, such symbols do not "have a value" as per
sym_has_value(), but have the "valid" flag set.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG

Currently, randconfig does randomise choice entries, unless KCONFIG_ALLCONFIG
is specified.

For example, given those two files (Thomas' test-case):

    ---8<--- Config.test.in
    config OPTIONA
        bool "Option A"

    choice
        prompt "This is a choice"

    config CHOICE_OPTIONA
        bool "Choice Option A"

    config CHOICE_OPTIONB
        bool "Choice Option B"

    endchoice

    config OPTIONB
        bool "Option B"
    ---8<--- Config.test.in

    ---8<--- config.defaults
    CONFIG_OPTIONA=y
    ---8<--- config.defaults

And running:
    ./config/conf --randconfig Config.test.in

does properly randomise the two choice symbols (and the two booleans).

However, running:
    KCONFIG_ALLCONFIG=config.defaults \
    ./config/conf --randconfig Config.test.in

does *not* reandomise the two choice entries, and only CHOICE_OPTIONA
will ever be selected. (OPTIONA will always be set (expected), and
OPTIONB will be be properly randomised (expected).)

This patch defers setting that a choice has a value until a symbol for
that choice is indeed set, so that choices are properly randomised when
KCONFIG_ALLCONFIG is set, but not if a symbol for that choice is set.

Also, as a side-efect, this patch fixes the following case:

    ---8<---
    choice
    config OPTION_A
        bool "Option A"
    config OPTION_B
        bool "Option B"
    config OPTION_C
        bool "Option C"
    endchoice
    ---8<---

which could previously generate such .config files:

    ---8<---                            ---8<---
    CONFIG_OPTION_A=y                   CONFIG_OPTION_A=y
    CONFIG_OPTION_B=y                   # CONFIG_OPTION_B is not set
    # CONFIG_OPTION_C is not set        CONFIG_OPTION_C=y
    ---8<---                            ---8<---

Ie., the first entry in a choice is always set, plus zero or one of
the other options may be set.

This patch ensures that only one option may be set for a choice.

Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
kconfig: allow specifying the seed for randconfig

For reproducibility, it can be useful to be able to specify the
seed to use to seed the RNG.

Add a new KCONFIG_SEED environment variable which can be set to
the seed to use:
    $ make KCONFIG_SEED=42 randconfig
    $ sha1sum .config
    70a128c8dcc61303069e1be352cce64114dfcbca  .config
    $ make KCONFIG_SEED=42 randconfig
    $ sha1sum .config
    70a128c8dcc61303069e1be352cce64114dfcbca  .config

It's very usefull for eg. debugging the kconfig parser.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
kconfig: implement KCONFIG_PROBABILITY for randconfig

Currently the odds to set each symbol is (rounded):
    booleans:   y: 50%          n: 50%
    tristates:  y: 33%  m: 33%  n: 33%

Introduce a KCONFIG_PROBABILITY environment variable to tweak the
probabilities (in percentage), as such:
    KCONFIG_PROBABILITY     y:n split           y:m:n split
    -----------------------------------------------------------------
[1] unset or empty          50  : 50            33  : 33  : 34
[2] N                        N  : 100-N         N/2 : N/2 : 100-N
    N:M                     N+M : 100-(N+M)      N  :  M  : 100-(N+M)
    N:M:L                    N  : 100-N          M  :  L  : 100-(M+L)

[1] The current behaviour is kept as default, for backward compatibility
[2] The solution initially implemented by Peter for Buildroot, see:
    http://git.buildroot.org/buildroot/commit/?id=3435c1afb5

Signed-off-by: Peter Korsgaard <jacmet@uclibc.org>
[yann.morin.1998@free.fr: add to Documentation/]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Revert "kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG"

This reverts commit 422c809f03f043d0950d8362214818e956a9daee.
It causes more harm than it solves issues.

Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
kconfig: fix lists definition for C++

The C++ compiler is more strict in that it refuses to assign
a void* to a struct list_head*.

Fix that by explicitly casting the poisonning constants.

(Tested with all 5 frontends, now.)

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Benjamin Poirier <bpoirier@suse.de>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
menuconfig: print more info for symbol without prompts

When we search a config symbol, if it has no prompt the position of this
symbol in the Kconfig file and it's dependencies are not printed.  This
can be inconvenient, especially when it's set to n and we want to find out
why.

the following is an example:

before:

Symbol: GENERIC_SMP_IDLE_THREAD [=y]
Type  : boolean
  Selected by: X86 [=y]

after:

Symbol: GENERIC_SMP_IDLE_THREAD [=y]
Type  : boolean
  Defined at arch/Kconfig:213
  Selected by: X86 [=y]

Signed-off-by: Weng Meiling <wengmeiling.weng@huawei.com>
Signed-off-by: Libo Chen <libo.chen@huawei.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>
menuconfig: fix NULL pointer dereference when searching a symbol

Searching for PPC_EFIKA results in a segmentation fault, and it's
because get_symbol_prop() returns NULL.

In this case CONFIG_PPC_EFIKA is defined in arch/powerpc/platforms/
52xx/Kconfig, so it won't be parsed if ARCH!=PPC, but menuconfig knows
this symbol when it parses sound/soc/fsl/Kconfig:

    config SND_MPC52xx_SOC_EFIKA
        tristate "SoC AC97 Audio support for bbplan Efika and STAC9766"
        depends on PPC_EFIKA

This bug was introduced by commit bcdedcc1afd6 ("menuconfig: print more
info for symbol without prompts").

Reported-and-tested-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Li Zefan <lizefan@huawei.com>
Tested-by: Libo Chen <libo.chen@huawei.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>