Add parsing of preferred frequency list element
authorAhmad Kholaif <akholaif@qca.qualcomm.com>
Fri, 24 Jul 2015 00:39:45 +0000 (17:39 -0700)
committerJouni Malinen <j@w1.fi>
Thu, 30 Jul 2015 19:13:48 +0000 (22:13 +0300)
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 <jouni@qca.qualcomm.com>
src/common/ieee802_11_common.c
src/common/ieee802_11_common.h

index d55e296..063de6a 100644 (file)
@@ -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 "
index 8d73980..45cf121 100644 (file)
@@ -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;
 };