carl9170fw.git
10 years agokconfig: don't allocate n+1 elements in temporary array
Yann E. MORIN [Tue, 16 Jul 2013 18:32:33 +0000 (20:32 +0200)]
kconfig: don't allocate n+1 elements in temporary array

The temporary array that stores the search results is not NULL-terminated,
so there is no reason to allocate n+1 elements.

Reported-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agokconfig: minor style fixes in symbol-search code
Yann E. MORIN [Tue, 16 Jul 2013 18:28:51 +0000 (20:28 +0200)]
kconfig: minor style fixes in symbol-search code

Two minor style fixes:
  - no space before/after parenthesis in function definition
  - no {} for single-line if()

And one grammar fix in a comment.

Reported-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agokconfig: avoid multiple calls to strlen
Yann E. MORIN [Sat, 13 Jul 2013 13:09:43 +0000 (15:09 +0200)]
kconfig: avoid multiple calls to strlen

Calls to strlen are costly, so avoid calling strln as much as we can.

Reported-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agokconfig: allow "hex" and "range" to support longs
Kees Cook [Fri, 28 Jun 2013 19:56:51 +0000 (12:56 -0700)]
kconfig: allow "hex" and "range" to support longs

The parsing routines for Kconfig files use strtol(), but store and
render values as int. Switch types and formating to long to support a
wider range of values. For example, 0x80000000 wasn't representable.

Signed-off-by: Kees Cook <keescook@chromium.org>
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>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agoRevert "kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG"
Yann E. MORIN [Tue, 25 Jun 2013 21:37:44 +0000 (23:37 +0200)]
Revert "kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG"

This reverts commit 8357b48549e17b3e4e402c7f977b65708922e60f.

It breaks more stuff than it fixes.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agokconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG
Yann E. MORIN [Tue, 18 Jun 2013 17:35:29 +0000 (19:35 +0200)]
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.

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: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agokconfig: loop as long as we changed some symbols in randconfig
Yann E. MORIN [Sun, 28 Apr 2013 20:36:38 +0000 (22:36 +0200)]
kconfig: loop as long as we changed some symbols in randconfig

Because of choice-in-a-choice constructs, it can happen that not all
symbols are assigned a value during randconfig, leading in rare cases
to this situation:

    ---8<--- choice-in-choice.in
    choice
        bool "A/B/C"
    config A
        bool "A"

    config B
        bool "B"
    if B
    choice
        bool "E/F"
    config E
        bool "E"
    config F
        bool "F"
    endchoice
    endif # B

    config C
        bool "C"
    endchoice
    ---8<---

    $ ./config/conf --randconfig choice-in-choice.in
    [--SNIP--]
    $ ./config/conf --silentoldconfig choice-in-choice.in </dev/null
    [--SNIP--]
    A/B/C
      1. A (A)
    > 2. B (B)
      3. C (C)
    choice[1-3]: 2
      E/F
      > 1. E (E) (NEW)
        2. F (F) (NEW)
      choice[1-2]: aborted!

    Console input/output is redirected. Run 'make oldconfig' to update
    configuration.

Fix this by looping in randconfig for as long as some symbol gets assigned
a value.

Note: this was spotted with the USB EHCI Debug Device Gadget (USB_G_DBGP),
which uses this choice-in-a-choice construct, and exhibits this problem.
The example above is just a stripped-down minimalist test-case.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agokconfig: sort found symbols by relevance
Yann E. MORIN [Mon, 6 May 2013 12:57:47 +0000 (14:57 +0200)]
kconfig: sort found symbols by relevance

When searching for symbols, return the symbols sorted by relevance.

Sorting is done as thus:
  - first, symbols that match exactly
  - then, alphabetical sort

Since the search can be a regexp, it is possible that more than one symbol
matches exactly. In this case, we can't decide which to sort first, so we
fallback to alphabeticall sort.

Explain this (new!) sorting heuristic in the documentation.

Reported-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Jean Delvare <jdelvare@suse.de>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Roland Eggner <edvx1@systemanalysen.net>
Cc: Wang YanQing <udknight@gmail.com>
--
Changes v1->v2:
  - drop the previous, complex heuristic in favour of a simpler heuristic
    that is both easier to understand, *and* to maintain (Jean)
  - explain sorting heuristic in the doc  (Jean)
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agokconfig/conf: print the seed used to initialise the RNG for randconfig
Yann E. MORIN [Mon, 20 May 2013 21:09:03 +0000 (23:09 +0200)]
kconfig/conf: print the seed used to initialise the RNG for randconfig

... so the user has a chance to reproduce a test-case.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agokconfig/conf: accept a base-16 seed for randconfig
Yann E. MORIN [Mon, 20 May 2013 21:17:34 +0000 (23:17 +0200)]
kconfig/conf: accept a base-16 seed for randconfig

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agokconfig/conf: fix randconfig setting multiple symbols in a choice
Yann E. MORIN [Sun, 28 Apr 2013 15:33:15 +0000 (17:33 +0200)]
kconfig/conf: fix randconfig setting multiple symbols in a choice

Currently, randconfig may set more than one symbol in a given choice.
Given this config file:
    config A
        bool "A"
    if A
    choice
        bool "B/C/D"
    config B
        bool "B"
    config C
        bool "C"
    config D
        bool "D"
    endchoice
    endif # A

Then randconfig generates such .config files (case where A is not set is not
shown below for brevity), and where only the right-most .config is valid:
  CONFIG_A=y                  CONFIG_A=y                  CONFIG_A=y
  CONFIG_B=y                  CONFIG_B=y                  CONFIG_B=y
  CONFIG_C=y                  # CONFIG_C is not set       # CONFIG_C is not set
  # CONFIG_D is not set       CONFIG_D=y                  # CONFIG_D is not set

That is, in a randomised choice, the first symbol is always selected,
and at most one other symbol may be selected.

This is due to symbol randomised in a choice not being properly flagged
as having a value.

Fix that by flagging those symbols adequately: have a user-defined value,
and be not valid (to force recalculation of the symbol).

Note: if the choice is not conditional, then the randomisation is properly
done.

Reported-by: Matthieu CASTET <matthieu.castet@parrot.com>
Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
[yann.morin.1998@free.fr: independently re-done the same patch as Matthieu,
                          as pointed out by Sedat]
Cc: Arnaud Lacombe <lacombar@gmail.com>
Cc: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agomconf/nconf: mark empty menus/menuconfigs different from non-empty ones
Dirk Gouders [Sun, 19 May 2013 19:49:34 +0000 (21:49 +0200)]
mconf/nconf: mark empty menus/menuconfigs different from non-empty ones

Submenus are sometimes empty and it would be nice if there is
something that notifies us that we should not expect any content
_before_ we enter a submenu.

A new function menu_is_empty() was introduced and empty menus and
menuconfigs are now marked by "----" as opposed to non-empty ones that
are marked by "--->".

This scheme was suggested by "Yann E. MORIN" <yann.morin.1998@free.fr>.

Signed-off-by: Dirk Gouders <dirk@gouders.net>
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>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agokconfig: Fix defconfig when one choice menu selects options that another choice menu...
Arve Hjønnevåg [Fri, 7 Jun 2013 03:37:00 +0000 (20:37 -0700)]
kconfig: Fix defconfig when one choice menu selects options that another choice menu depends on

The defconfig and Kconfig combination below, which is based on 3.10-rc4
Kconfigs, resulted in several options getting set to "m" instead of "y".

defconfig.choice:
---8<---
CONFIG_MODULES=y
CONFIG_USB_ZERO=y
---8<---

Kconfig.choice:
---8<---
menuconfig MODULES
bool "Enable loadable module support"

config CONFIGFS_FS
tristate "Userspace-driven configuration filesystem"

config OCFS2_FS
        tristate "OCFS2 file system support"
        depends on CONFIGFS_FS
        select CRC32

config USB_LIBCOMPOSITE
tristate
select CONFIGFS_FS

choice
tristate "USB Gadget Drivers"
default USB_ETH

config USB_ZERO
tristate "Gadget Zero (DEVELOPMENT)"
select USB_LIBCOMPOSITE

config USB_ETH
tristate "Ethernet Gadget (with CDC Ethernet support)"
select USB_LIBCOMPOSITE

endchoice

config CRC32
        tristate "CRC32/CRC32c functions"
        default y

choice
        prompt "CRC32 implementation"
        depends on CRC32
        default CRC32_SLICEBY8

config CRC32_SLICEBY8
        bool "Slice by 8 bytes"

endchoice
---8<---

$ scripts/kconfig/conf --defconfig=defconfig.choice Kconfig.choice

would result in:

.config:
---8<---
CONFIG_MODULES=y
CONFIG_CONFIGFS_FS=m
CONFIG_USB_LIBCOMPOSITE=m
CONFIG_USB_ZERO=m
CONFIG_CRC32=y
CONFIG_CRC32_SLICEBY8=y
---8<---

when the expected result would be:

.config:
---8<---
CONFIG_MODULES=y
CONFIG_CONFIGFS_FS=y
CONFIG_USB_LIBCOMPOSITE=y
CONFIG_USB_ZERO=y
CONFIG_CRC32=y
CONFIG_CRC32_SLICEBY8=y
---8<---

Signed-off-by: Arve Hjønnevåg <arve@android.com>
[yann.morin.1998@free.fr: add the resulting .config to commit log,
                          remove unneeded USB_GADGET from the defconfig]
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>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agokconfig/menu.c: fix multiple references to expressions in menu_add_prop()
Dirk Gouders [Tue, 21 May 2013 08:54:11 +0000 (10:54 +0200)]
kconfig/menu.c: fix multiple references to expressions in menu_add_prop()

menu_add_prop() applies upper menus' visibilities to actual prompts
by AND-ing the prompts visibilities with the upper menus ones.

This creates a further reference to the menu's visibilities and when
the expression reduction functions do their work, they may remove or
modify expressions that have multiple references, thus causing
unpredictable side-effects.

The following example Kconfig constructs a case where this causes
problems: a menu and a prompt which's visibilities depend on the same
symbol.  When invoking mconf with this Kconfig and pressing "Z" we
see a problem caused by a free'd expression still referenced by the
menu's visibility:

------------------------------------------------------------------------
mainmenu "Kconfig Testing Configuration"

config VISIBLE
def_bool n

config Placeholder
bool "Place holder"

menu "Invisible"
visible if VISIBLE

config TEST_VAR
bool "Test option" if VISIBLE

endmenu
------------------------------------------------------------------------

This patch fixes this problem by creating copies of the menu's
visibility expressions before AND-ing them with the prompt's one.

Signed-off-by: Dirk Gouders <dirk@gouders.net>
[yann.morin.1998@free.fr: move variable into its block-scope,
                          keep lines <80 chars, typo]
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>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agoRevert "kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG"
Yann E. MORIN [Fri, 26 Apr 2013 20:41:32 +0000 (22:41 +0200)]
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>
10 years agokconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG
Yann E. MORIN [Sun, 10 Mar 2013 15:34:10 +0000 (16:34 +0100)]
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:
    ./scripts/kconfig/conf --randconfig Config.test.in

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

However, running:
    KCONFIG_ALLCONFIG=config.defaults \
    ./scripts/kconfig/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>
10 years agocarl9170 toolchain: update to gcc-4.8.2
Christian Lamparter [Wed, 23 Oct 2013 19:54:53 +0000 (21:54 +0200)]
carl9170 toolchain: update to gcc-4.8.2

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agoMerge branch 'master' of git://github.com/chunkeey/carl9170fw
Christian Lamparter [Sat, 1 Jun 2013 20:24:51 +0000 (22:24 +0200)]
Merge branch 'master' of git://github.com/chunkeey/carl9170fw

10 years agomenuconfig: fix NULL pointer dereference when searching a symbol
Li Zefan [Tue, 7 May 2013 13:56:54 +0000 (15:56 +0200)]
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>
10 years agomenuconfig: print more info for symbol without prompts
Wengmeiling [Tue, 30 Apr 2013 22:28:46 +0000 (15:28 -0700)]
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>
10 years agokconfig: fix lists definition for C++
Yann E. MORIN [Mon, 29 Apr 2013 17:50:32 +0000 (19:50 +0200)]
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>
10 years agoRevert "kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG"
Yann E. MORIN [Fri, 26 Apr 2013 20:41:32 +0000 (22:41 +0200)]
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>
10 years agokconfig: implement KCONFIG_PROBABILITY for randconfig
Yann E. MORIN [Sat, 13 Apr 2013 15:18:36 +0000 (17:18 +0200)]
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>
10 years agokconfig: allow specifying the seed for randconfig
Yann E. MORIN [Sat, 13 Apr 2013 20:49:13 +0000 (22:49 +0200)]
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>
10 years agokconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG
Yann E. MORIN [Sun, 10 Mar 2013 15:34:10 +0000 (16:34 +0100)]
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>
10 years agokconfig: do not override symbols already set
Yann E. MORIN [Wed, 24 Apr 2013 20:00:04 +0000 (22:00 +0200)]
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>
10 years agokconfig: fix randconfig tristate detection
Yann E. MORIN [Wed, 24 Apr 2013 16:14:27 +0000 (18:14 +0200)]
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>
10 years agomenuconfig: Add "breadcrumbs" navigation aid
Benjamin Poirier [Tue, 16 Apr 2013 14:07:23 +0000 (10:07 -0400)]
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>
10 years agomenuconfig: Fix memory leak introduced by jump keys feature
Benjamin Poirier [Mon, 15 Apr 2013 14:13:50 +0000 (10:13 -0400)]
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>
10 years agowireless: move crypto constants to ieee80211.h
Johannes Berg [Wed, 8 May 2013 11:09:08 +0000 (13:09 +0200)]
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>
10 years agomac80211: parse VHT channel switch IEs
Johannes Berg [Tue, 26 Mar 2013 13:54:16 +0000 (14:54 +0100)]
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>
10 years agowireless: define operating mode action frame
Johannes Berg [Thu, 27 Dec 2012 17:45:41 +0000 (18:45 +0100)]
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>
10 years agomac80211: handle extended channel switch announcement
Johannes Berg [Tue, 26 Mar 2013 14:17:18 +0000 (15:17 +0100)]
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>
10 years agomac80211: support secondary channel offset in CSA
Johannes Berg [Mon, 25 Mar 2013 17:29:27 +0000 (18:29 +0100)]
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>
10 years agomac80211: support extended channel switch
Johannes Berg [Tue, 26 Mar 2013 13:13:58 +0000 (14:13 +0100)]
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>
10 years agomac80211: unify CSA action frame/beacon processing
Johannes Berg [Tue, 26 Mar 2013 13:02:26 +0000 (14:02 +0100)]
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>
10 years agocarl9170 toolchain: toolchain updates
Christian Lamparter [Fri, 31 May 2013 15:24:11 +0000 (17:24 +0200)]
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>
11 years agomac80211: parse Timeout Interval Element using a struct
Johannes Berg [Wed, 27 Mar 2013 13:38:07 +0000 (14:38 +0100)]
mac80211: parse Timeout Interval Element using a struct

Instead of open-coding the accesses and length check do
the length check in the IE parser and assign a struct
pointer for use in the remaining code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocfg80211: add P2P Notice of Absence attribute
Janusz Dziedzic [Thu, 21 Mar 2013 14:47:54 +0000 (15:47 +0100)]
cfg80211: add P2P Notice of Absence attribute

Add P2P Notice of Absence attribute structure.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agoMerge branch 'master' of git://github.com/chunkeey/carl9170fw
Christian Lamparter [Sat, 23 Mar 2013 12:47:55 +0000 (13:47 +0100)]
Merge branch 'master' of git://github.com/chunkeey/carl9170fw

11 years agocarl9170 firmware: update version to 1.9.8 1.9.8
Christian Lamparter [Fri, 22 Mar 2013 23:27:51 +0000 (00:27 +0100)]
carl9170 firmware: update version to 1.9.8

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agokbuild: Fix missing '\n' for NEW symbols in yes "" | make oldconfig >conf.new
Ben Hutchings [Tue, 19 Feb 2013 00:24:26 +0000 (02:24 +0200)]
kbuild: Fix missing '\n' for NEW symbols in yes "" | make oldconfig >conf.new

According to Documentation/kbuild/kconfig.txt, the commands:

    yes "" | make oldconfig >conf.new
    grep "(NEW)" conf.new

should list the new config symbols with their default values.
However, currently there is no line break after each new symbol.  When
kconfig is interactive the user will type a new-line at this point,
but when non-interactive kconfig must print it.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Reference: http://bugs.debian.org/636029
[regid23@nt1.in: Adjusted Ben's work to apply cleanly to this tree]
Reported-and-tested-by: Regid Ichira <regid23@nt1.in>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agokconfig: Fix malloc handling in conf tools
Alan Cox [Tue, 6 Nov 2012 14:32:08 +0000 (14:32 +0000)]
kconfig: Fix malloc handling in conf tools

(and get them out of the noise in the audit work)

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agokconfig: get CONFIG_ prefix from the environment
Yann E. MORIN [Fri, 19 Oct 2012 23:06:25 +0000 (01:06 +0200)]
kconfig: get CONFIG_ prefix from the environment

Currently, the CONFIG_ prefix is hard-coded in the kconfig frontends
executables. This means that two projects that use kconfig with
different prefixes can not share the same kconfig frontends.

Instead of hard-coding the prefix in the frontends, get it from the
environment, and revert back to hard-coded value if not found.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agokconfig: add a function to get the CONFIG_ prefix
Yann E. MORIN [Fri, 19 Oct 2012 23:06:24 +0000 (01:06 +0200)]
kconfig: add a function to get the CONFIG_ prefix

Currently, we get the CONFIG_ prefix via the CONFIG_ macro, which means
the CONFIG_ prefix is hard-coded at compile time. This goes against
having a run-time defined CONFIG_ prefix.

Add a function that returns the CONFIG_ prefix to use (but keep the
current hard-coded behavior, to be changed in a later patch).

To avoid touching all the code that uses the CONFIG_ macro, we just
undef it, and define it to be a call to the function.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170 firmware: always reset usb endpoints
Christian Lamparter [Fri, 22 Mar 2013 21:21:34 +0000 (22:21 +0100)]
carl9170 firmware: always reset usb endpoints

It isn't clear what the firmware is supposed to do
when it is initializing the usb phy. The spec says
something about clearing the STALLED/HALTED flags
however the original firmware doesn't do that?!

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170 toolchain: update to gcc-4.8.0
Christian Lamparter [Fri, 22 Mar 2013 21:18:27 +0000 (22:18 +0100)]
carl9170 toolchain: update to gcc-4.8.0

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agomac80211: restrict peer's VHT capabilities to own
Johannes Berg [Fri, 1 Mar 2013 12:07:48 +0000 (13:07 +0100)]
mac80211: restrict peer's VHT capabilities to own

Implement restricting peer VHT capabilities to the device's own
capabilities. This is useful when a single driver supports more
than one device and the devices have different capabilities
(often they will differ in the number of spatial streams), but
in particular is also necessary for VHT capability overrides to
work correctly -- otherwise it'd be possible to e.g. advertise,
due to overrides, that TX-STBC is not supported, but then still
use it to TX to the AP because it supports RX-STBC.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agowireless: remove unused VHT MCS defines
Johannes Berg [Thu, 21 Feb 2013 16:26:44 +0000 (17:26 +0100)]
wireless: remove unused VHT MCS defines

There's an enum with the same values (but slightly
different names except for NOT_SUPPORTED) that is
actually used, so remove the defines.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agoieee80211: mark 802.11 related structs as being 2-byte aligned
Felix Fietkau [Fri, 22 Feb 2013 16:28:49 +0000 (17:28 +0100)]
ieee80211: mark 802.11 related structs as being 2-byte aligned

Regardless of what header features they use, or if they align the IP
header or not, 802.11 packets from all drivers guarantee a 2-byte
alignment (and there's a debug WARN_ON in case they don't).

Annotate packet structs with __aligned(2) to allow the compiler to use
16-bit load/store operations on platforms with extremely inefficient
unaligned access (e.g. MIPS).

This reduces code size and improves performance on affected platforms
and causes no binary code change on others.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agowireless: move sequence number arithmetic to ieee80211.h
Johannes Berg [Fri, 15 Feb 2013 18:25:00 +0000 (19:25 +0100)]
wireless: move sequence number arithmetic to ieee80211.h

Move the sequence number arithmetic code from mac80211 to
ieee80211.h so others can use it. Also rename the functions
from _seq to _sn, they operate on the sequence number, not
the sequence_control field.

Also move macros to convert the sequence control to/from
the sequence number value from various drivers.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agoMerge branch 'master' of git://github.com/chunkeey/carl9170fw
Christian Lamparter [Thu, 21 Feb 2013 17:40:59 +0000 (18:40 +0100)]
Merge branch 'master' of git://github.com/chunkeey/carl9170fw

11 years agomac80211: advertise operating mode notification capability
Johannes Berg [Mon, 11 Feb 2013 13:27:08 +0000 (14:27 +0100)]
mac80211: advertise operating mode notification capability

Use the new extended capabilities advertising to advertise
the fact that operating mode notification is supported.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agomac80211: constify IE parsing
Johannes Berg [Tue, 12 Feb 2013 15:43:19 +0000 (16:43 +0100)]
mac80211: constify IE parsing

Make all the parsed IE pointers const, and propagate
the change to all the users etc.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170 firmware: implement endpoint halt req/clear and get endpoint status
Christian Lamparter [Wed, 23 Jan 2013 18:10:58 +0000 (19:10 +0100)]
carl9170 firmware: implement endpoint halt req/clear and get endpoint status

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agoMerge branch 'master' of git://github.com/chunkeey/carl9170fw
Christian Lamparter [Fri, 1 Feb 2013 22:24:06 +0000 (23:24 +0100)]
Merge branch 'master' of git://github.com/chunkeey/carl9170fw

11 years agomac80211: support HT notify channel width action
Johannes Berg [Fri, 28 Dec 2012 11:12:10 +0000 (12:12 +0100)]
mac80211: support HT notify channel width action

Support the HT notify channel width action frame
to update the rate scaling about the bandwidth
the peer can receive in.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agowireless: use __packed in ieee80211.h
Johannes Berg [Fri, 28 Dec 2012 11:00:40 +0000 (12:00 +0100)]
wireless: use __packed in ieee80211.h

Use __packed instead of __attribute__((packed)).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agowireless: more 'capability info' bits
Vladimir Kondratiev [Tue, 18 Dec 2012 07:55:33 +0000 (09:55 +0200)]
wireless: more 'capability info' bits

define bits for 'capability info', as in recent spec edition
IEEE802.11-2012

Also, add mask for 2-bit field 'bss type', as it is in 802.11ad

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170 firmware: improve link stability
Christian Lamparter [Sat, 26 Jan 2013 20:19:57 +0000 (21:19 +0100)]
carl9170 firmware: improve link stability

This patch improves the link stability under load
by reordering and rewriting parts of the tx retry
procedure. It's all based on long hours of trail
and error, but sadly QoS + AMPDU is still not
working.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170: fix CONFIG_CARL9170FW_DEBUG && !CONFIG_CARL9170FW_RADIO_FUNC
Christian Lamparter [Sat, 19 Jan 2013 13:28:19 +0000 (14:28 +0100)]
carl9170: fix CONFIG_CARL9170FW_DEBUG && !CONFIG_CARL9170FW_RADIO_FUNC

wlantx.c:262:2: error: struct has no member named psm

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agoMerge branch 'master' of git://github.com/chunkeey/carl9170fw
Christian Lamparter [Sat, 19 Jan 2013 13:18:33 +0000 (14:18 +0100)]
Merge branch 'master' of git://github.com/chunkeey/carl9170fw

11 years agocarl9170 firmware: USB_MODESWITCH depends on USB_STANDARD_CMDS
Christian Lamparter [Thu, 17 Jan 2013 22:34:49 +0000 (23:34 +0100)]
carl9170 firmware: USB_MODESWITCH depends on USB_STANDARD_CMDS

usb.c:170:13: error: ‘usb_reset_eps’ defined but not used

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170 firmware: fix CONFIG_CARL9170FW_DEBUG compile error
Christian Lamparter [Thu, 17 Jan 2013 22:31:14 +0000 (23:31 +0100)]
carl9170 firmware: fix CONFIG_CARL9170FW_DEBUG compile error

wlan.c:59:7: error: assignment discards ‘volatile’ qualifier from pointer target type

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170 firmware: fix CONFIG_CARL9170FW_DEBUG_UART compile error
Christian Lamparter [Thu, 17 Jan 2013 22:28:36 +0000 (23:28 +0100)]
carl9170 firmware: fix CONFIG_CARL9170FW_DEBUG_UART compile error

uart.c:36:9: error: ‘AR9170_UART_LINE_STS_TX_FIFO_ALMOST_EMPTY’ undeclared

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170 firmware: fix !CONFIG_CARL9170FW_RADIO_FUNCTIONS compile errors
Christian Lamparter [Thu, 17 Jan 2013 22:26:35 +0000 (23:26 +0100)]
carl9170 firmware: fix !CONFIG_CARL9170FW_RADIO_FUNCTIONS compile errors

carlfw/src/main.c:87:27: error: unused variable ‘delta’
carlfw/src/main.c:87:15: error: unused variable ‘boff’
carlfw/src/main.c:90:12: error: ‘struct <anonymous>’ has no member named ‘state’

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170: allow kconfig options in autogen.sh's parameters
Christian Lamparter [Thu, 17 Jan 2013 22:16:13 +0000 (23:16 +0100)]
carl9170: allow kconfig options in autogen.sh's parameters

kconf supports several interesting options:
 --allnoconfig    New config where all options are answered with no
 --allyesconfig   New config where all options are answered with yes
 --alldefconfig   New config with all symbols set to default
 --randconfig     New config with random answer to all options

to build the default firmware image, it is enough to run:
./autogen.sh --alldefconfig

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170: fix out of bounds read
Christian Lamparter [Tue, 15 Jan 2013 21:31:15 +0000 (22:31 +0100)]
carl9170: fix out of bounds read

__carlfw_find_desc didn't check whenever the area for
a descriptor was within the file length. Also it could
read beyond the file while looking for a said descriptor.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170: fix indention and add missing fi
Christian Lamparter [Mon, 14 Jan 2013 19:57:02 +0000 (20:57 +0100)]
carl9170: fix indention and add missing fi

This patch fixes my overzealous editing in
"carl9170: Add checksum during installation, as preferred by the driver"

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170: Install binary in the parent directory, not /lib/firmware
Ben Hutchings [Mon, 14 Jan 2013 11:22:30 +0000 (11:22 +0000)]
carl9170: Install binary in the parent directory, not /lib/firmware

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170: Add checksum during installation, as preferred by the driver
Ben Hutchings [Mon, 14 Jan 2013 11:21:38 +0000 (11:21 +0000)]
carl9170: Add checksum during installation, as preferred by the driver

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170: Add and check SHA-256 sums for the toolchain tarballs
Ben Hutchings [Mon, 14 Jan 2013 02:41:56 +0000 (02:41 +0000)]
carl9170: Add and check SHA-256 sums for the toolchain tarballs

The sums for binutils and gcc are based on an HTTPS download (instead
of the default HTTP).

newlib doesn't seem to be available with any kind of signature, so I
compared a tarball and CVS checkout; let's hope they weren't both
compromised.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170: Fix minimum CMake version
Ben Hutchings [Mon, 14 Jan 2013 02:26:59 +0000 (02:26 +0000)]
carl9170: Fix minimum CMake version

The CMAKE_CURRENT_LIST_DIR command was added in version 2.8.4.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170: Add full licence texts to BSD-licenced CMake files
Ben Hutchings [Mon, 14 Jan 2013 02:26:07 +0000 (02:26 +0000)]
carl9170: Add full licence texts to BSD-licenced CMake files

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170 firmware: toolchain newlib 2.0.0
Christian Lamparter [Tue, 25 Dec 2012 19:17:02 +0000 (20:17 +0100)]
carl9170 firmware: toolchain newlib 2.0.0

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agoMerge branch 'master' of git://github.com/chunkeey/carl9170fw
Christian Lamparter [Sun, 16 Dec 2012 01:55:42 +0000 (02:55 +0100)]
Merge branch 'master' of git://github.com/chunkeey/carl9170fw

11 years agocarl9170 firmware: update version to 1.9.7 1.9.7
Christian Lamparter [Sat, 15 Dec 2012 22:05:53 +0000 (23:05 +0100)]
carl9170 firmware: update version to 1.9.7

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agomenuconfig: Replace CIRCLEQ by list_head-style lists.
Benjamin Poirier [Sun, 21 Oct 2012 09:27:53 +0000 (05:27 -0400)]
menuconfig: Replace CIRCLEQ by list_head-style lists.

sys/queue.h and CIRCLEQ in particular have proven to cause portability
problems (reported on Debian Sarge, Cygwin and FreeBSD)

Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Tested-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Tested-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agomenuconfig: Assign jump keys per-page instead of globally
Benjamin Poirier [Thu, 23 Aug 2012 18:55:08 +0000 (14:55 -0400)]
menuconfig: Assign jump keys per-page instead of globally

At the moment, keys 1-9 are assigned to the first 9 search results. This patch
makes them assigned to the first 9 results per-page instead. We are much less
likely to run out of keys that way.

Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agomenuconfig: Add jump keys to search results
Benjamin Poirier [Thu, 23 Aug 2012 18:55:06 +0000 (14:55 -0400)]
menuconfig: Add jump keys to search results

makes it possible to jump directly to the menu for a configuration entry after
having searched for it with '/'. If this menu is not currently accessible we
jump to the nearest accessible parent instead. After exiting this menu, the
user is returned to the search results where he may jump further in or
elsewhere.

Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agowireless: fix VHT max AMPDU exponent definition
Johannes Berg [Wed, 5 Dec 2012 15:45:31 +0000 (16:45 +0100)]
wireless: fix VHT max AMPDU exponent definition

This is really a 3-bit field, not a single bit,
so declare a mask and shift. Also fix hwsim, it
advertises the maximum possible.

While at it reindent all the defines using tabs
instead of spaces.

Change-Id: I7cd81c0d72f76deb5010aba5bfa3dd312006e898
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agomac80211: support VHT association
Johannes Berg [Thu, 22 Nov 2012 13:11:39 +0000 (14:11 +0100)]
mac80211: support VHT association

Determine the VHT channel from the AP's VHT operation IE
(if present) and configure the hardware to that channel
if it is supported. If channel contexts cause a channel
to not be usable, try a smaller bandwidth.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agowireless: add definitions for VHT MCS support
Johannes Berg [Mon, 12 Nov 2012 10:44:18 +0000 (11:44 +0100)]
wireless: add definitions for VHT MCS support

Add definitions for the VHT MCS support values that
are used to indicate, for each number of streams
(1 through 8) which MCSes are supported.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agomac80211: move Mesh Capability field definition to ieee80211.h
Marco Porsch [Thu, 22 Nov 2012 02:40:30 +0000 (18:40 -0800)]
mac80211: move Mesh Capability field definition to ieee80211.h

Signed-off-by: Marco Porsch <marco.porsch@etit.tu-chemnitz.de>
[prefix with IEEE80211_]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agomac80211: introduce IEEE80211_NUM_TIDS and use it
Johannes Berg [Wed, 14 Nov 2012 22:22:21 +0000 (23:22 +0100)]
mac80211: introduce IEEE80211_NUM_TIDS and use it

Introduce IEEE80211_NUM_TIDS in the generic 802.11
header file and use it in place of STA_TID_NUM and
NUM_RX_DATA_QUEUES which are both really the number
of TIDs.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170 firmware: fix max beacon length
Christian Lamparter [Sat, 15 Dec 2012 21:19:22 +0000 (22:19 +0100)]
carl9170 firmware: fix max beacon length

According to AR9170's data sheet, the
beacon length register only cares about
bits 8:0. So the max length [with 4
reserved bytes for the FCS] is at 511.

Note:

Because the beacon has to be stored in the
DMA memory region, we have to be careful
so we don't waste precious memory due to
alignment and padding. Therefore I decided
to reduce the max beacon length even more
down to 480 bytes. [This saves one 320 byte
DMA block from becoming unused padding, when
the default 2 vif configuration is selected].

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agoMerge branch 'master' of git://github.com/chunkeey/carl9170fw
Christian Lamparter [Sat, 15 Dec 2012 20:03:22 +0000 (21:03 +0100)]
Merge branch 'master' of git://github.com/chunkeey/carl9170fw

11 years agowireless: add peer-to-peer related definitions
Arend van Spriel [Mon, 5 Nov 2012 14:29:09 +0000 (15:29 +0100)]
wireless: add peer-to-peer related definitions

The Peer-to-Peer IE is vendor-specific IE identified by WiFi Alliance
OUI and specific P2P OUI type. The payload of this IE consists of
so-called P2P attributes. This patch adds definitions for processing
these attributes.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170 firmware toolchain: binutils 2.23.1
Christian Lamparter [Sun, 25 Nov 2012 10:48:34 +0000 (11:48 +0100)]
carl9170 firmware toolchain: binutils 2.23.1

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agowireless: remove duplicate enum ieee80211_eid definitions
Arend van Spriel [Fri, 12 Oct 2012 10:28:16 +0000 (12:28 +0200)]
wireless: remove duplicate enum ieee80211_eid definitions

WLAN_EID_WPA and WLAN_EID_GENERIC mapped to the same value
as WLAN_EID_VENDOR_SPECIFIC. The last one being more in line
with the standard specification. Removing WLAN_EID_WPA and
WLAN_EID_GENERIC as there are no longer drivers using these.

Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agoieee80211: Rename VHT cap struct
Mahesh Palivela [Wed, 10 Oct 2012 11:25:40 +0000 (11:25 +0000)]
ieee80211: Rename VHT cap struct

Rename struct ieee80211_vht_capabilities to ieee80211_vht_cap
and renamed its member vht_capabilities_info to vht_cap_info.

Signed-off-by: Mahesh Palivela <maheshp@posedge.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agowireless: remove obsolete chan no/center freq conversion functions
Johannes Berg [Tue, 24 Jul 2012 15:38:43 +0000 (17:38 +0200)]
wireless: remove obsolete chan no/center freq conversion functions

There are a number of functions that shouldn't really
be used when modern functions that take the band are
available in cfg80211. Remove these, but for now keep
 * ieee80211_freq_to_dsss_chan and
 * ieee80211_dsss_chan_to_freq
as they're used in older drivers.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170 firmware toolchain: binutils 2.23
Christian Lamparter [Sat, 10 Nov 2012 02:55:57 +0000 (03:55 +0100)]
carl9170 firmware toolchain: binutils 2.23

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170 firmware toolchain: various small updates
Christian Lamparter [Sat, 10 Nov 2012 02:47:58 +0000 (03:47 +0100)]
carl9170 firmware toolchain: various small updates

 - gnu tar can automatically decides the decompression algo.

 - because we use the filename (*_TAR) as a target it better
   be the same as in the fetch (*_URL)

 - stringify URLs.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170 firmware: add note about rx filter usage
Christian Lamparter [Sat, 20 Oct 2012 17:12:49 +0000 (19:12 +0200)]
carl9170 firmware: add note about rx filter usage

This patch adds a note about what it means when
a rx filter bit is set. Because unlike what most
people assume, it means that the data which matches
the condition is discarded and not
"passed to the host".

Reported-by: Javier Lopez <jlopex@cozybit.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agoMerge branch 'master' of git://github.com/chunkeey/carl9170fw
Christian Lamparter [Sat, 6 Oct 2012 18:24:28 +0000 (20:24 +0200)]
Merge branch 'master' of git://github.com/chunkeey/carl9170fw

11 years agocarl9170 firmware: remove inline attributes
Christian Lamparter [Sat, 6 Oct 2012 17:02:57 +0000 (19:02 +0200)]
carl9170 firmware: remove inline attributes

The compiler is smart enough to decide whenever
these functions can be inlined or not.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agocarl9170 toolchain: update to gcc-4.7.2
Christian Lamparter [Thu, 20 Sep 2012 16:49:12 +0000 (18:49 +0200)]
carl9170 toolchain: update to gcc-4.7.2

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agoMerge branch 'master' of git://github.com/chunkeey/carl9170fw
Christian Lamparter [Sun, 16 Sep 2012 15:39:36 +0000 (17:39 +0200)]
Merge branch 'master' of git://github.com/chunkeey/carl9170fw

11 years agocarl9170 firmware tools: update .gitignore
Christian Lamparter [Thu, 13 Sep 2012 23:53:32 +0000 (01:53 +0200)]
carl9170 firmware tools: update .gitignore

 - eeprom_fix is no more

 - ignore fwprepare binary

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>