carl9170fw.git
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>
9 years agomac80211: support DTPC IE (from Cisco Client eXtensions)
Steinar H. Gunderson [Wed, 3 Sep 2014 13:48:37 +0000 (06:48 -0700)]
mac80211: support DTPC IE (from Cisco Client eXtensions)

Linux already supports 802.11h, where the access point can tell the
client to reduce its transmission power. However, 802.11h is only
defined for 5 GHz, where the need for this is much smaller than on
2.4 GHz.

Cisco has their own solution, called DTPC (Dynamic Transmit Power
Control). Cisco APs on a controller sometimes but not always send
802.11h; they always send DTPC, even on 2.4 GHz. This patch adds support
for parsing and honoring the DTPC IE in addition to the 802.11h
element (they do not always contain the same limits, so both must
be honored); the format is not documented, but very simple.

Tested (on top of wireless.git and on 3.16.1) against a Cisco Aironet
1142 joined to a Cisco 2504 WLC, by setting various transmit power
levels for the given access points and observing the results.
The Wireshark 802.11 dissector agrees with the interpretation of the
element, except for negative numbers, which seem to never happen
anyway.

Signed-off-by: Steinar H. Gunderson <sgunderson@bigfoot.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agocfg80211: add Intel Mobile Communications copyright
Johannes Berg [Wed, 3 Sep 2014 12:24:58 +0000 (15:24 +0300)]
cfg80211: add Intel Mobile Communications copyright

Our legal structure changed at some point (see wikipedia), but
we forgot to immediately switch over to the new copyright
notice.

For files that we have modified in the time since the change,
add the proper copyright notice now.

Signed-off-by: Johannes Berg <johannes.berg@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 agoieee80211: Support parsing TPC report element in action frames
Andrei Otcheretianski [Wed, 30 Jul 2014 11:36:18 +0000 (14:36 +0300)]
ieee80211: Support parsing TPC report element in action frames

TPC report element is contained in spectrum management's tpc report
action frames and in radio measurement's link measurement report
action frames. Add a function which checks whether an action frame
contains this element. This may be needed by the drivers in order
to set the correct tx power value in these frames.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@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 TDLS QoS param IE on setup-confirm
Arik Nemtsov [Thu, 17 Jul 2014 14:14:24 +0000 (17:14 +0300)]
mac80211: add TDLS QoS param IE on setup-confirm

When TDLS QoS is supported by the the peer and the local card, add
the WMM parameter IE to the setup-confirm frame. Take the QoS settings
from the current AP, or if unsupported, use the default values from
the specification. This behavior is mandated by IEEE802.11-2012 section
10.22.4.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Liad Kaufman <liad.kaufman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agomac80211: add API to request TDLS operation from userspace
Arik Nemtsov [Wed, 11 Jun 2014 14:18:25 +0000 (17:18 +0300)]
mac80211: add API to request TDLS operation from userspace

Write a mac80211 to the cfg80211 API for requesting a userspace TDLS
operation. Define TDLS specific reason codes that can be used here.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agowireless: add missing WLAN_EID_BSS_INTOLERANT_CHL_REPORT
Jes Sorensen [Mon, 26 May 2014 16:06:34 +0000 (18:06 +0200)]
wireless: add missing WLAN_EID_BSS_INTOLERANT_CHL_REPORT

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agocarl9170: update COPYRIGHT boilerplate text
Christian Lamparter [Thu, 1 Jan 2015 13:42:58 +0000 (14:42 +0100)]
carl9170: update COPYRIGHT boilerplate text

The boilderplate text had an obsolete address in it.
Link to the GNU Project's licence website instead.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
9 years agocarl9170 toolchain: update to gcc 4.9.2, newlib 2.2.0 and binutils 2.25
Christian Lamparter [Thu, 1 Jan 2015 13:18:02 +0000 (14:18 +0100)]
carl9170 toolchain: update to gcc 4.9.2, newlib 2.2.0 and binutils 2.25

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agocarl9170 toolchain: update to gcc-4.9.1
Christian Lamparter [Wed, 17 Sep 2014 17:57:56 +0000 (19:57 +0200)]
carl9170 toolchain: update to gcc-4.9.1

For users with issues due to a gcc-4.9 host compiler:
<https://bugzilla.redhat.com/show_bug.cgi?id=1087374>

Note: The README.md has been updated as well. For
requests about the firmware (or driver) please
include "carl9170" in the subject line.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agocarl9170 firmware: investigate 80/88MHz clock freezes
Christian Lamparter [Tue, 16 Sep 2014 17:38:32 +0000 (19:38 +0200)]
carl9170 firmware: investigate 80/88MHz clock freezes

The SoC can run up to 80/88MHz in HT40 mode. This improves
throughput and timing accuracy over the 40/44MHz clock.
However some devices seem to become unstable under load.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agocarl9170 firmware: update README.md
Christian Lamparter [Thu, 7 Aug 2014 18:00:14 +0000 (20:00 +0200)]
carl9170 firmware: update README.md

New version of the README in markdown. Includes additional
information about contact and firmware configuration.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agocarl9170 firmware: command endpoint is bulk in full-speed mode
Christian Lamparter [Thu, 7 Aug 2014 09:56:25 +0000 (11:56 +0200)]
carl9170 firmware: command endpoint is bulk in full-speed mode

Roland Wahl discovered that endpoint 4 needs to be an bulk
endpoint in the full-speed configuration.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agowireless: max MSDU size for DMG networks
Vladimir Kondratiev [Wed, 19 Mar 2014 11:14:40 +0000 (13:14 +0200)]
wireless: max MSDU size for DMG networks

In the 802.11ad, aka DMG (Dynamic Multi-Gigabit), aka 60Ghz
spec, maximum MSDU size extended to 7920 bytes.
add #define for this.

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>
10 years agoieee80211: remove function ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan}
Zhao, Gang [Tue, 18 Feb 2014 13:36:03 +0000 (21:36 +0800)]
ieee80211: remove function ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan}

Function ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan} have been
replaced with ieee80211_{channel_to_frequency, frequency_to_channel}.

There should be no users of the two functions now. So remove them.

Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Zhao, Gang <gamerh2o@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agowireless: sort and extend element ID list
Johannes Berg [Tue, 4 Feb 2014 08:41:04 +0000 (09:41 +0100)]
wireless: sort and extend element ID list

The element ID list is currently almost sorted by amendment
or similar topic, but the order is difficult to maintain and
not very transparent. Sort the list by ID instead, and add
a lot of missing IDs.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agomac80211: fix bufferable MMPDU RX handling
Johannes Berg [Fri, 24 Jan 2014 13:41:44 +0000 (14:41 +0100)]
mac80211: fix bufferable MMPDU RX handling

Action, disassoc and deauth frames are bufferable, and as such don't
have the PM bit in the frame control field reserved which means we
need to react to the bit when receiving in such a frame.

Fix this by introducing a new helper ieee80211_is_bufferable_mmpdu()
and using it for the RX path that currently ignores the PM bit in
any non-data frames for doze->wake transitions, but listens to it in
all frames for wake->doze transitions, both of which are wrong.

Also use the new helper in the TX path to clean up the code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agoieee80211: add definition for SMS4 key len
Avinash Patil [Fri, 10 Jan 2014 19:08:55 +0000 (11:08 -0800)]
ieee80211: add definition for SMS4 key len

Add SMS4 key length definition to ieee80211_key_len enum.
It's used by WAPI.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agoieee80211: add definition for TDLS wide band extended capability
Avinash Patil [Thu, 9 Jan 2014 23:22:57 +0000 (15:22 -0800)]
ieee80211: add definition for TDLS wide band extended capability

Seventh bit of 8th byte of extended capabilities specifies wide
bandwidth support for TDLS links. Add this definition to ieee80211.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agocarl9170 toolchain: update to gcc 4.9.0 and newlib 2.1.0
Christian Lamparter [Thu, 1 May 2014 19:39:49 +0000 (21:39 +0200)]
carl9170 toolchain: update to gcc 4.9.0 and newlib 2.1.0

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agocarl9170 firmware: replace already defined __section with __in_section
Christian Lamparter [Thu, 1 May 2014 19:38:35 +0000 (21:38 +0200)]
carl9170 firmware: replace already defined __section with __in_section

newlib already provides __section... and unfortunately it differs
from our own. This commit introduces a new define __in_section for
now.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
10 years agomac80211: enable easier manipulation of VHT beamforming caps
Eyal Shapira [Mon, 11 Nov 2013 18:14:00 +0000 (20:14 +0200)]
mac80211: enable easier manipulation of VHT beamforming caps

Introduce shift and mask defines for beamformee STS cap and number
of sounding dimensions cap as these can take any 3 bit value.
While at it also cleanup an unrequired parenthesis.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Reviewed-by: Johannes Berg <johannes.berg@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>
10 years agoMerge branch 'master' of git://github.com/chunkeey/carl9170fw
Christian Lamparter [Sun, 22 Dec 2013 04:14:09 +0000 (05:14 +0100)]
Merge branch 'master' of git://github.com/chunkeey/carl9170fw

10 years agocarl9170 toolchain: update to binutils-2.24
Christian Lamparter [Mon, 2 Dec 2013 19:39:35 +0000 (20:39 +0100)]
carl9170 toolchain: update to binutils-2.24

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agomac80211: process the CSA frame for mesh accordingly
Chun-Yeow Yeoh [Tue, 15 Oct 2013 02:08:27 +0000 (19:08 -0700)]
mac80211: process the CSA frame for mesh accordingly

Process the CSA frame according to the procedures define in IEEE Std
802.11-2012 section 10.9.8.4.3 as follow:
* The mesh channel switch parameters element (MCSP) must be availabe.
* If the MCSP's TTL is 1, drop the frame but still process the CSA.
* If the MCSP's precedence value is less than or equal to the current
  precedence value, drop the frame and do not process the CSA.
* The CSA frame is forwarded after TTL is decremented by 1 and the
  initiator field is set to 0. Transmit restrict field and others
  are maintained as is.
* No beacon or probe response frame are handled here.

Also, introduce the debug message used for mesh CSA purpose.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agokconfig: fix bug in search results string: use strlen(gstr->s), not gstr->len
Martin Walch [Thu, 3 Oct 2013 16:35:16 +0000 (18:35 +0200)]
kconfig: fix bug in search results string: use strlen(gstr->s), not gstr->len

The struct gstr has a capacity that may differ from the actual string length.

However, a string manipulation in the function search_conf made the assumption
that it is the same, which led to messing up some search results, especially
when the content of the gstr in use had not yet reached at least 63 chars.

Signed-off-by: Martin Walch <walch.martin@web.de>
Acked-by: Wang YanQing <udknight@gmail.com>
Acked-by: Benjamin Poirier <bpoirier@suse.de>
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>
11 years agokconfig: remove unused definition from scanner
Martin Walch [Thu, 3 Oct 2013 16:33:47 +0000 (18:33 +0200)]
kconfig: remove unused definition from scanner

The definition ws [ \n\t] is not used anywhere. Drop it to avoid confusion.

As it is a dead definition, any changes in the resulting code generated by
flex would be surprising (actually testing this showed that there are really
no changes). So, there is no need to touch the existing zconf.lex.c_shipped.

Signed-off-by: Martin Walch <walch.martin@web.de>
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>
11 years agokconfig: adjust warning message for conflicting types
Martin Walch [Thu, 3 Oct 2013 16:32:02 +0000 (18:32 +0200)]
kconfig: adjust warning message for conflicting types

Each symbol must have exactly one type assigned. However, if a symbol happens
to have two different types assigned at runtime, a warning is printed and the
first type is preserved while the second type is being ignored.

The warning message says

type of <symbol name> redefined from <first type> to <second type>

which may be misleading as it may create the impression that the second type
replaces the first type.

This patch clarifies this by changing the warning to

ignoring type redefinition of <symbol name> from <first type> to <second type>

Signed-off-by: Martin Walch <walch.martin@web.de>
Acked-by: Wang YanQing <udknight@gmail.com>
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>
11 years agokconfig: fix trivial typos and update mconf documentation
Martin Walch [Thu, 3 Oct 2013 15:28:14 +0000 (17:28 +0200)]
kconfig: fix trivial typos and update mconf documentation

This fixes lots of typos in comments and strings.

It also updates the documentation strings in mconf to reflect the changes in
the user interface from the two commits

6364fd0cb1e4c7f72b974613e0cf5744ae4d2cb2
  menuconfig: Add Save/Load buttons
1bdbac478a858d2aa73a6784c7c2e09de0f6d06b
  menuconfig: Get rid of the top-level entries for "Load an Alternate/Save an Alternate"

And it updates the layout of the example search result, i. e. moves down the
"Defined at" and "Depends on" lines and adds a symbol state ([=n]) to the
symbol in the "Selected by" line.

Furthermore, the help texts now should fit in 80 columns again when viewed
in mconf.

Signed-off-by: Martin Walch <walch.martin@web.de>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Wang YanQing <udknight@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agokconfig: add short explanation to SYMBOL_WRITE
Martin Walch [Thu, 3 Oct 2013 15:21:23 +0000 (17:21 +0200)]
kconfig: add short explanation to SYMBOL_WRITE

replace the question mark in the comment after SYMBOL_WRITE with an explanation

Signed-off-by: Martin Walch <walch.martin@web.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agoMerge branch 'master' of git://github.com/chunkeey/carl9170fw
Christian Lamparter [Fri, 25 Oct 2013 21:05:15 +0000 (23:05 +0200)]
Merge branch 'master' of git://github.com/chunkeey/carl9170fw

11 years agocarl9170 firmware: update to version 1.9.9 1.9.9
Christian Lamparter [Fri, 25 Oct 2013 20:55:51 +0000 (22:55 +0200)]
carl9170 firmware: update to version 1.9.9

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agoMerge branch 'master' of git://github.com/chunkeey/carl9170fw
Christian Lamparter [Fri, 25 Oct 2013 19:57:24 +0000 (21:57 +0200)]
Merge branch 'master' of git://github.com/chunkeey/carl9170fw

11 years agoieee80211: fix vht cap definitions
Eliad Peller [Thu, 29 Aug 2013 12:03:14 +0000 (15:03 +0300)]
ieee80211: fix vht cap definitions

VHT_CAP_BEAMFORMER_ANTENNAS cap is actually defined in the draft as
VHT_CAP_BEAMFORMEE_STS_MAX, and its size is 3 bits long.

VHT_CAP_SOUNDING_DIMENSIONS is also 3 bits long.

Fix the definitions and change the cap masking accordingly.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agowireless: make TU conversion macros available
Johannes Berg [Thu, 25 Jul 2013 19:45:17 +0000 (21:45 +0200)]
wireless: make TU conversion macros available

A few places in the code (mac80211 and iwlmvm) use the same
TU_TO_JIFFIES() macro and could use TU_TO_EXP_TIME() that
mac80211 has. Make these available to everyone and use them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agoieee80211: add definition for 802.11ac information elements
Fred Zhou [Thu, 1 Aug 2013 06:16:28 +0000 (14:16 +0800)]
ieee80211: add definition for 802.11ac information elements

Add element IDs for Extended BSS Load, VHT TX
Power Envelope, AID, and Quiet Channel.

Signed-off-by: Fred Zhou <fred.zy@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agoieee80211: add definition for interworking support
Avinash Patil [Sat, 27 Jul 2013 00:02:29 +0000 (17:02 -0700)]
ieee80211: add definition for interworking support

IEEE802.11u interworking support is advertised via extended
capabilities IE bit 31. This is 7th bit of 4th byte of extended
capabilities.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agomac80211: set mesh formation field properly
Jacob Minshall [Wed, 29 May 2013 21:32:36 +0000 (14:32 -0700)]
mac80211: set mesh formation field properly

Cap max peerings at 63 in accordance with IEEE-2012 8.4.2.100.7.
Triggers a beacon regeneration every time the number of peerings changes.
Previously this would only happen if the "accepting peerings" bit changed.

Signed-off-by: Jacob Minshall <jacob@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agokconfig: do not allow more than one symbol to have 'option modules'
Yann E. MORIN [Tue, 3 Sep 2013 20:22:26 +0000 (22:22 +0200)]
kconfig: do not allow more than one symbol to have 'option modules'

Previously, it was possible to have more than one symbol with the
'option modules' attached to them, although only the last one would
in fact control tristates.

Since this does not make much sense, only allow at most one symbol to
control tristates.

Note: it is still possible to have more than one symbol that control
tristates, but indirectly:

    config MOD1
        bool "mod1"
        select MODULES
    config MOD2
        bool "mod2"
        select MODULES
    config MODULES
        bool
        option modules

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agokconfig: do not special-case 'MODULES' symbol
Yann E. MORIN [Tue, 3 Sep 2013 15:07:18 +0000 (17:07 +0200)]
kconfig: do not special-case 'MODULES' symbol

Currently, the 'MODULES' symbol is hard-coded to be the default symbol
that enables/disables tristates, if no other symbol was declared with
'option modules'.

While this used to be needed for the Linux kernel, we now have an
explicit 'option modules' attached to the 'MODULES' symbol (since
cset 11097a036), so we no longer need to special-case it in the
kconfig code.

Furthermore, kconfig is extensively used out of the Linux kernel, and
other projects may have another meaning for a symbol named 'MODULES'.

This patch changes the way we enable/disable tristates: if a symbol was
found with 'option modules' attached to it, then that symbol controls
enabling tristates. Otherwise, tristates are disabled, even if a symbol
named 'MODULES' exists.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agokconfig: silence warning when parsing auto.conf when a symbol has changed type
Yann E. MORIN [Tue, 6 Aug 2013 16:45:07 +0000 (18:45 +0200)]
kconfig: silence warning when parsing auto.conf when a symbol has changed type

When a symbol changes type from tristate to bool, and was previously set to
'm', a subsequent silentoldconfig would warn about inconsistency, such as:

    include/config/auto.conf:3014:warning: symbol value 'm' invalid for
    HOTPLUG_PCI_PCIE

Seen by Linus with the merge in aa8032b (sequence to reproduce by Michal):
    git checkout 1fe0135
    make mrproper
    make allmodconfig
    make silentoldconfig
    git checkout aa8032b
    make allmodconfig
    make silentoldconfig

Since HOTPLUG_PCI_PCIE changed from tristate to bool in aa8032b, it was
previously set to 'm' in auto.conf by the first allmodconfig+silentoldconfig,
but then was set to 'y' by the second allmodconfig. Then the second
silentoldconfig prints the warning.

The warning in this case is a spurious warning, which happens at the time
kconfig tries to detect symbols that have changed, to touch the empty
header files in include/config used for dependency-tracking by make.

Silence the warning when we read the old auto.conf file, since it is
perfectly legit that a symbol changed type since the previous call.

Thread in:
    http://marc.info/?l=linux-pci&m=137569198904000&w=2

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
11 years agokconfig: switch to "long long" for sanity
Kees Cook [Thu, 18 Jul 2013 18:32:01 +0000 (11:32 -0700)]
kconfig: switch to "long long" for sanity

Instead of using "long" for kconfig "hex" and "range" values, which may
change in size depending on the host architecture, use "long long". This
will allow values greater than INT_MAX on 32-bit hosts when cross
compiling.

Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-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>
11 years agokconfig: simplify symbol-search code
Yann E. MORIN [Tue, 16 Jul 2013 18:39:42 +0000 (20:39 +0200)]
kconfig: simplify symbol-search code

There is no need for a double indirection in the temporary array that
stores the internediate search results.

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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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

11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>