From 9baaac2d8495d56040a27063afe84f460525c2b3 Mon Sep 17 00:00:00 2001 From: Ahmad Kholaif Date: Thu, 23 Jul 2015 17:39:45 -0700 Subject: [PATCH] Add parsing of preferred frequency list element This adds parsing of QCA vendor specific elements and as the first such element to be parsed, stores pointers to the preferred frequency list element that can be used to enhance P2P channel negotiation behavior. Signed-off-by: Jouni Malinen --- src/common/ieee802_11_common.c | 15 +++++++++++++++ src/common/ieee802_11_common.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c index d55e29694..063de6a76 100644 --- a/src/common/ieee802_11_common.c +++ b/src/common/ieee802_11_common.c @@ -11,6 +11,7 @@ #include "common.h" #include "defs.h" #include "wpa_common.h" +#include "qca-vendor.h" #include "ieee802_11_defs.h" #include "ieee802_11_common.h" @@ -147,6 +148,20 @@ static int ieee802_11_parse_vendor_specific(const u8 *pos, size_t elen, } break; + case OUI_QCA: + switch (pos[3]) { + case QCA_VENDOR_ELEM_P2P_PREF_CHAN_LIST: + elems->pref_freq_list = pos; + elems->pref_freq_list_len = elen; + break; + default: + wpa_printf(MSG_EXCESSIVE, + "Unknown QCA information element ignored (type=%d len=%lu)", + pos[3], (unsigned long) elen); + return -1; + } + break; + default: wpa_printf(MSG_EXCESSIVE, "unknown vendor specific " "information element ignored (vendor OUI " diff --git a/src/common/ieee802_11_common.h b/src/common/ieee802_11_common.h index 8d73980e0..45cf121e8 100644 --- a/src/common/ieee802_11_common.h +++ b/src/common/ieee802_11_common.h @@ -58,6 +58,7 @@ struct ieee802_11_elems { const u8 *osen; const u8 *ampe; const u8 *mic; + const u8 *pref_freq_list; u8 ssid_len; u8 supp_rates_len; @@ -86,6 +87,7 @@ struct ieee802_11_elems { u8 osen_len; u8 ampe_len; u8 mic_len; + u8 pref_freq_list_len; struct mb_ies_info mb_ies; };