Merge branch 'master' of git://github.com/chunkeey/carl9170fw
authorChristian Lamparter <chunkeey@googlemail.com>
Sat, 1 Jun 2013 20:24:51 +0000 (22:24 +0200)
committerChristian Lamparter <chunkeey@googlemail.com>
Sat, 1 Jun 2013 20:24:51 +0000 (22:24 +0200)
config/conf.c
config/confdata.c
config/list.h
config/menu.c
include/linux/ieee80211.h
toolchain/Makefile
toolchain/SHA256SUMS

index cdbdb1129eeb3067b26451c0851d014d709a4ad2..ea4080d6eaab0b93b3752cd858604571547ad353 100644 (file)
@@ -13,6 +13,7 @@
 #include <getopt.h>
 #include <sys/stat.h>
 #include <sys/time.h>
+#include <errno.h>
 
 #include "lkc.h"
 
@@ -498,14 +499,23 @@ int main(int ac, char **av)
                {
                        struct timeval now;
                        unsigned int seed;
+                       char *seed_env;
 
                        /*
                         * Use microseconds derived seed,
                         * compensate for systems where it may be zero
                         */
                        gettimeofday(&now, NULL);
-
                        seed = (unsigned int)((now.tv_sec + 1) * (now.tv_usec + 1));
+
+                       seed_env = getenv("KCONFIG_SEED");
+                       if( seed_env && *seed_env ) {
+                               char *endp;
+                               int tmp = (int)strtol(seed_env, &endp, 10);
+                               if (*endp == '\0') {
+                                       seed = tmp;
+                               }
+                       }
                        srand(seed);
                        break;
                }
index 7a2bc8fc85658581bf83d931dee22c69249fce9b..b882b56db09d7da6c2da962aa1d0f9156653efae 100644 (file)
@@ -1169,10 +1169,54 @@ static void set_all_choice_values(struct symbol *csym)
 void conf_set_all_new_symbols(enum conf_def_mode mode)
 {
        struct symbol *sym, *csym;
-       int i, cnt;
+       int i, cnt, pby, pty, ptm;      /* pby: probability of boolean  = y
+                                        * pty: probability of tristate = y
+                                        * ptm: probability of tristate = m
+                                        */
+
+       pby = 50; pty = ptm = 33; /* can't go as the default in switch-case
+                                  * below, otherwise gcc whines about
+                                  * -Wmaybe-uninitialized */
+       if (mode == def_random) {
+               int n, p[3];
+               char *env = getenv("KCONFIG_PROBABILITY");
+               n = 0;
+               while( env && *env ) {
+                       char *endp;
+                       int tmp = strtol( env, &endp, 10 );
+                       if( tmp >= 0 && tmp <= 100 ) {
+                               p[n++] = tmp;
+                       } else {
+                               errno = ERANGE;
+                               perror( "KCONFIG_PROBABILITY" );
+                               exit( 1 );
+                       }
+                       env = (*endp == ':') ? endp+1 : endp;
+                       if( n >=3 ) {
+                               break;
+                       }
+               }
+               switch( n ) {
+               case 1:
+                       pby = p[0]; ptm = pby/2; pty = pby-ptm;
+                       break;
+               case 2:
+                       pty = p[0]; ptm = p[1]; pby = pty + ptm;
+                       break;
+               case 3:
+                       pby = p[0]; pty = p[1]; ptm = p[2];
+                       break;
+               }
+
+               if( pty+ptm > 100 ) {
+                       errno = ERANGE;
+                       perror( "KCONFIG_PROBABILITY" );
+                       exit( 1 );
+               }
+       }
 
        for_all_symbols(i, sym) {
-               if (sym_has_value(sym))
+               if (sym_has_value(sym) || (sym->flags & SYMBOL_VALID))
                        continue;
                switch (sym_get_type(sym)) {
                case S_BOOLEAN:
@@ -1188,8 +1232,15 @@ void conf_set_all_new_symbols(enum conf_def_mode mode)
                                sym->def[S_DEF_USER].tri = no;
                                break;
                        case def_random:
-                               cnt = sym_get_type(sym) == S_TRISTATE ? 3 : 2;
-                               sym->def[S_DEF_USER].tri = (tristate)(rand() % cnt);
+                               sym->def[S_DEF_USER].tri = no;
+                               cnt = rand() % 100;
+                               if (sym->type == S_TRISTATE) {
+                                       if (cnt < pty)
+                                               sym->def[S_DEF_USER].tri = yes;
+                                       else if (cnt < (pty+ptm))
+                                               sym->def[S_DEF_USER].tri = mod;
+                               } else if (cnt < pby)
+                                       sym->def[S_DEF_USER].tri = yes;
                                break;
                        default:
                                continue;
index 0ae730be5f49d87025601300ba3a7bb86110f3eb..685d80e1bb0e77de75a97a2ada22991131597b58 100644 (file)
@@ -50,6 +50,19 @@ struct list_head {
             &pos->member != (head);    \
             pos = list_entry(pos->member.next, typeof(*pos), member))
 
+/**
+ * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
+ * @pos:       the type * to use as a loop cursor.
+ * @n:         another type * to use as temporary storage
+ * @head:      the head for your list.
+ * @member:    the name of the list_struct within the struct.
+ */
+#define list_for_each_entry_safe(pos, n, head, member)                 \
+       for (pos = list_entry((head)->next, typeof(*pos), member),      \
+               n = list_entry(pos->member.next, typeof(*pos), member); \
+            &pos->member != (head);                                    \
+            pos = n, n = list_entry(n->member.next, typeof(*n), member))
+
 /**
  * list_empty - tests whether a list is empty
  * @head: the list to test.
@@ -88,4 +101,31 @@ static inline void list_add_tail(struct list_head *_new, struct list_head *head)
        __list_add(_new, head->prev, head);
 }
 
+/*
+ * Delete a list entry by making the prev/next entries
+ * point to each other.
+ *
+ * This is only for internal list manipulation where we know
+ * the prev/next entries already!
+ */
+static inline void __list_del(struct list_head *prev, struct list_head *next)
+{
+       next->prev = prev;
+       prev->next = next;
+}
+
+#define LIST_POISON1  ((void *) 0x00100100)
+#define LIST_POISON2  ((void *) 0x00200200)
+/**
+ * list_del - deletes entry from list.
+ * @entry: the element to delete from the list.
+ * Note: list_empty() on entry does not return true after this, the entry is
+ * in an undefined state.
+ */
+static inline void list_del(struct list_head *entry)
+{
+       __list_del(entry->prev, entry->next);
+       entry->next = (struct list_head*)LIST_POISON1;
+       entry->prev = (struct list_head*)LIST_POISON2;
+}
 #endif
index f3bffa309333061ed5d852e7c00132107017add5..b5c7d90df9df801dac0ca12d64b609e686e74b62 100644 (file)
@@ -515,13 +515,6 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
        struct jump_key *jump;
 
        str_printf(r, _("Prompt: %s\n"), _(prop->text));
-       str_printf(r, _("  Defined at %s:%d\n"), prop->menu->file->name,
-               prop->menu->lineno);
-       if (!expr_is_yes(prop->visible.expr)) {
-               str_append(r, _("  Depends on: "));
-               expr_gstr_print(prop->visible.expr, r);
-               str_append(r, "\n");
-       }
        menu = prop->menu->parent;
        for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) {
                bool accessible = menu_is_visible(menu);
@@ -571,6 +564,18 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
        }
 }
 
+/*
+ * get peoperty of type P_SYMBOL
+ */
+static struct property *get_symbol_prop(struct symbol *sym)
+{
+       struct property *prop = NULL;
+
+       for_all_properties(sym, prop, P_SYMBOL)
+               break;
+       return prop;
+}
+
 /*
  * head is optional and may be NULL
  */
@@ -595,6 +600,18 @@ void get_symbol_str(struct gstr *r, struct symbol *sym,
        }
        for_all_prompts(sym, prop)
                get_prompt_str(r, prop, head);
+
+       prop = get_symbol_prop(sym);
+       if (prop) {
+               str_printf(r, _("  Defined at %s:%d\n"), prop->menu->file->name,
+                       prop->menu->lineno);
+               if (!expr_is_yes(prop->visible.expr)) {
+                       str_append(r, _("  Depends on: "));
+                       expr_gstr_print(prop->visible.expr, r);
+                       str_append(r, "\n");
+               }
+       }
+
        hit = false;
        for_all_properties(sym, prop, P_SELECT) {
                if (!hit) {
index 5567dc173fde920675aa7ffd86e9702ad0251337..a334caffc4a0510e3d709dee3681c00c152fe228 100644 (file)
@@ -680,6 +680,36 @@ struct ieee80211_channel_sw_ie {
        u8 count;
 } __packed;
 
+/**
+ * struct ieee80211_ext_chansw_ie
+ *
+ * This structure represents the "Extended Channel Switch Announcement element"
+ */
+struct ieee80211_ext_chansw_ie {
+       u8 mode;
+       u8 new_operating_class;
+       u8 new_ch_num;
+       u8 count;
+} __packed;
+
+/**
+ * struct ieee80211_sec_chan_offs_ie - secondary channel offset IE
+ * @sec_chan_offs: secondary channel offset, uses IEEE80211_HT_PARAM_CHA_SEC_*
+ *     values here
+ * This structure represents the "Secondary Channel Offset element"
+ */
+struct ieee80211_sec_chan_offs_ie {
+       u8 sec_chan_offs;
+} __packed;
+
+/**
+ * struct ieee80211_wide_bw_chansw_ie - wide bandwidth channel switch IE
+ */
+struct ieee80211_wide_bw_chansw_ie {
+       u8 new_channel_width;
+       u8 new_center_freq_seg0, new_center_freq_seg1;
+} __packed;
+
 /**
  * struct ieee80211_tim
  *
@@ -747,6 +777,30 @@ enum ieee80211_ht_chanwidth_values {
        IEEE80211_HT_CHANWIDTH_ANY = 1,
 };
 
+/**
+ * enum ieee80211_opmode_bits - VHT operating mode field bits
+ * @IEEE80211_OPMODE_NOTIF_CHANWIDTH_MASK: channel width mask
+ * @IEEE80211_OPMODE_NOTIF_CHANWIDTH_20MHZ: 20 MHz channel width
+ * @IEEE80211_OPMODE_NOTIF_CHANWIDTH_40MHZ: 40 MHz channel width
+ * @IEEE80211_OPMODE_NOTIF_CHANWIDTH_80MHZ: 80 MHz channel width
+ * @IEEE80211_OPMODE_NOTIF_CHANWIDTH_160MHZ: 160 MHz or 80+80 MHz channel width
+ * @IEEE80211_OPMODE_NOTIF_RX_NSS_MASK: number of spatial streams mask
+ *     (the NSS value is the value of this field + 1)
+ * @IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT: number of spatial streams shift
+ * @IEEE80211_OPMODE_NOTIF_RX_NSS_TYPE_BF: indicates streams in SU-MIMO PPDU
+ *     using a beamforming steering matrix
+ */
+enum ieee80211_vht_opmode_bits {
+       IEEE80211_OPMODE_NOTIF_CHANWIDTH_MASK   = 3,
+       IEEE80211_OPMODE_NOTIF_CHANWIDTH_20MHZ  = 0,
+       IEEE80211_OPMODE_NOTIF_CHANWIDTH_40MHZ  = 1,
+       IEEE80211_OPMODE_NOTIF_CHANWIDTH_80MHZ  = 2,
+       IEEE80211_OPMODE_NOTIF_CHANWIDTH_160MHZ = 3,
+       IEEE80211_OPMODE_NOTIF_RX_NSS_MASK      = 0x70,
+       IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT     = 4,
+       IEEE80211_OPMODE_NOTIF_RX_NSS_TYPE_BF   = 0x80,
+};
+
 #define WLAN_SA_QUERY_TR_ID_LEN 2
 
 struct ieee80211_mgmt {
@@ -821,10 +875,13 @@ struct ieee80211_mgmt {
                                } __packed wme_action;
                                struct{
                                        u8 action_code;
-                                       u8 element_id;
-                                       u8 length;
-                                       struct ieee80211_channel_sw_ie sw_elem;
+                                       u8 variable[0];
                                } __packed chan_switch;
+                               struct{
+                                       u8 action_code;
+                                       struct ieee80211_ext_chansw_ie data;
+                                       u8 variable[0];
+                               } __packed ext_chan_switch;
                                struct{
                                        u8 action_code;
                                        u8 dialog_token;
@@ -877,6 +934,10 @@ struct ieee80211_mgmt {
                                        __le16 capability;
                                        u8 variable[0];
                                } __packed tdls_discover_resp;
+                               struct {
+                                       u8 action_code;
+                                       u8 operating_mode;
+                               } __packed vht_opmode_notif;
                        } u;
                } __packed action;
        } u;
@@ -1004,6 +1065,26 @@ enum ieee80211_p2p_attr_id {
        IEEE80211_P2P_ATTR_MAX
 };
 
+/* Notice of Absence attribute - described in P2P spec 4.1.14 */
+/* Typical max value used here */
+#define IEEE80211_P2P_NOA_DESC_MAX     4
+
+struct ieee80211_p2p_noa_desc {
+       u8 count;
+       __le32 duration;
+       __le32 interval;
+       __le32 start_time;
+} __packed;
+
+struct ieee80211_p2p_noa_attr {
+       u8 index;
+       u8 oppps_ctwindow;
+       struct ieee80211_p2p_noa_desc desc[IEEE80211_P2P_NOA_DESC_MAX];
+} __packed;
+
+#define IEEE80211_P2P_OPPPS_ENABLE_BIT         BIT(7)
+#define IEEE80211_P2P_OPPPS_CTWINDOW_MASK      0x7F
+
 /**
  * struct ieee80211_bar - HT Block Ack Request
  *
@@ -1611,6 +1692,7 @@ enum ieee80211_eid {
 
        WLAN_EID_HT_CAPABILITY = 45,
        WLAN_EID_HT_OPERATION = 61,
+       WLAN_EID_SECONDARY_CHANNEL_OFFSET = 62,
 
        WLAN_EID_RSN = 48,
        WLAN_EID_MMIE = 76,
@@ -1644,6 +1726,9 @@ enum ieee80211_eid {
 
        WLAN_EID_VHT_CAPABILITY = 191,
        WLAN_EID_VHT_OPERATION = 192,
+       WLAN_EID_OPMODE_NOTIF = 199,
+       WLAN_EID_WIDE_BW_CHANNEL_SWITCH = 194,
+       WLAN_EID_CHANNEL_SWITCH_WRAPPER = 196,
 
        /* 802.11ad */
        WLAN_EID_NON_TX_BSSID_CAP =  83,
@@ -1698,6 +1783,7 @@ enum ieee80211_category {
        WLAN_CATEGORY_WMM = 17,
        WLAN_CATEGORY_FST = 18,
        WLAN_CATEGORY_UNPROT_DMG = 20,
+       WLAN_CATEGORY_VHT = 21,
        WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126,
        WLAN_CATEGORY_VENDOR_SPECIFIC = 127,
 };
@@ -1723,6 +1809,13 @@ enum ieee80211_ht_actioncode {
        WLAN_HT_ACTION_ASEL_IDX_FEEDBACK = 7,
 };
 
+/* VHT action codes */
+enum ieee80211_vht_actioncode {
+       WLAN_VHT_ACTION_COMPRESSED_BF = 0,
+       WLAN_VHT_ACTION_GROUPID_MGMT = 1,
+       WLAN_VHT_ACTION_OPMODE_NOTIF = 2,
+};
+
 /* Self Protected Action codes */
 enum ieee80211_self_protected_actioncode {
        WLAN_SP_RESERVED = 0,
@@ -1757,8 +1850,18 @@ enum ieee80211_key_len {
        WLAN_KEY_LEN_AES_CMAC = 16,
 };
 
+#define IEEE80211_WEP_IV_LEN           4
+#define IEEE80211_WEP_ICV_LEN          4
+#define IEEE80211_CCMP_HDR_LEN         8
+#define IEEE80211_CCMP_MIC_LEN         8
+#define IEEE80211_CCMP_PN_LEN          6
+#define IEEE80211_TKIP_IV_LEN          8
+#define IEEE80211_TKIP_ICV_LEN         4
+#define IEEE80211_CMAC_PN_LEN          6
+
 /* Public action codes */
 enum ieee80211_pub_actioncode {
+       WLAN_PUB_ACTION_EXT_CHANSW_ANN = 4,
        WLAN_PUB_ACTION_TDLS_DISCOVER_RES = 14,
 };
 
@@ -1919,6 +2022,16 @@ enum ieee80211_timeout_interval_type {
        WLAN_TIMEOUT_ASSOC_COMEBACK = 3 /* 802.11w */,
 };
 
+/**
+ * struct ieee80211_timeout_interval_ie - Timeout Interval element
+ * @type: type, see &enum ieee80211_timeout_interval_type
+ * @value: timeout interval value
+ */
+struct ieee80211_timeout_interval_ie {
+       u8 type;
+       __le32 value;
+} __packed;
+
 /* BACK action code */
 enum ieee80211_back_actioncode {
        WLAN_ACTION_ADDBA_REQ = 0,
index ed3dcae53d37632a6e3c89acfe281d1abe5de8f4..3e29f8d536201251a46a8f33e17be23d862a4a0d 100644 (file)
@@ -6,61 +6,63 @@ NEWLIB_VER=2.0.0
 NEWLIB_TAR=newlib-$(NEWLIB_VER).tar.gz
 NEWLIB_URL="ftp://sourceware.org/pub/newlib/$(NEWLIB_TAR)"
 
-GCC_VER=4.8.0
+GCC_VER=4.8.1
 GCC_TAR=gcc-$(GCC_VER).tar.bz2
 GCC_URL="http://mirrors.kernel.org/gnu/gcc/gcc-$(GCC_VER)/$(GCC_TAR)"
 
+JOBS?=$(shell grep -c ^processor /proc/cpuinfo)
+
 BASEDIR=$(shell pwd)
 
 define checksum
 @if grep -q '  $(subst .,\.,$(1))$$' SHA256SUMS; then                  \
-       grep '  $(subst .,\.,$(1))$$' SHA256SUMS | sha256sum -c;        \
+       grep '  $(subst .,\.,$(1))$$' SHA256SUMS | sha256sum -c || rm $(1);     \
 else                                                                   \
        echo "WARNING: no checksum defined for $(1)";                   \
 fi
 endef
 
-all: gcc
+all: clean gcc
 
 src/$(BINUTILS_TAR):
-       wget -P src $(BINUTILS_URL)
+       wget -P "$(BASEDIR)/src" $(BINUTILS_URL)
        $(call checksum,$@)
 
 src/$(NEWLIB_TAR):
-       wget -P src $(NEWLIB_URL)
+       wget -P "$(BASEDIR)/src" $(NEWLIB_URL)
        $(call checksum,$@)
 
 src/$(GCC_TAR):
-       wget -P src $(GCC_URL)
+       wget -P "$(BASEDIR)/src" $(GCC_URL)
        $(call checksum,$@)
 
 src/binutils-$(BINUTILS_VER): src/$(BINUTILS_TAR)
-       tar -C src -xf $<
+       tar -C "$(BASEDIR)/src" -xf $<
 
 src/newlib-$(NEWLIB_VER): src/$(NEWLIB_TAR)
-       tar -C src -xf $<
+       tar -C "$(BASEDIR)/src" -xf $<
 
 src/gcc-$(GCC_VER): src/$(GCC_TAR) src/newlib-$(NEWLIB_VER)
-       tar -C src -xf $<
+       tar -C "$(BASEDIR)/src" -xf $<
        ln -s $(BASEDIR)/src/newlib-$(NEWLIB_VER)/newlib $@
        ln -s $(BASEDIR)/src/newlib-$(NEWLIB_VER)/libgloss $@
 
 binutils: src/binutils-$(BINUTILS_VER)
-       mkdir -p build/binutils
-       cd build/binutils; \
+       mkdir -p "$(BASEDIR)/build/binutils"
+       cd "$(BASEDIR)/build/binutils"; \
        $(BASEDIR)/$</configure --target=sh-elf --prefix=$(BASEDIR)/inst; \
-       $(MAKE) -j3; \
+       $(MAKE) -j$(JOBS); \
        $(MAKE) install
 
 gcc: src/gcc-$(GCC_VER) binutils
-       mkdir -p build/gcc
-       cd build/gcc; \
+       mkdir -p "$(BASEDIR)/build/gcc"
+       cd "$(BASEDIR)/build/gcc"; \
        $(BASEDIR)/$</configure --target=sh-elf --prefix=$(BASEDIR)/inst -enable-languages=c --without-pkgversion --with-newlib; \
-       $(MAKE) -j3; \
+       $(MAKE) -j$(JOBS); \
        $(MAKE) install
 
 clean:
-       rm -rf build inst
-
+       rm -rf "$(BASEDIR)/build" "$(BASEDIR)/inst"
+       
 distclean: clean
-       rm -rf src
+       rm -rf "$(BASEDIR)/src"
index c8439d9fb21af2d5496b28ba73efbaa0300e6ee1..94bfe55416e36c7b0f2d9db0c2c89e4417f72d2b 100644 (file)
@@ -5,4 +5,5 @@ c644b2847244278c57bec2ddda69d8fab5a7c767f3b9af69aa7aa3da823ff692  src/newlib-1.2
 8a9283d7010fb9fe5ece3ca507e0af5c19412626384f8a5e9434251ae100b084  src/gcc-4.7.2.tar.bz2
 49c29e9129325e7c3b221aa829743ddcd796d024440e47c80fc0d6769af72d8a  src/newlib-2.0.0.tar.gz
 b037fe5132b71ecad2ea7141ec92292b5d32427bf90fd90cde432b1d5abacc2c  src/gcc-4.8.0.tar.bz2
+545b44be3ad9f2c4e90e6880f5c9d4f0a8f0e5f67e1ffb0d45da9fa01bb05813  src/gcc-4.8.1.tar.bz2