qcacmn: mgmt frame txrx

Modify P2P IE and tx mgmt frame. Handles tx confirm and rx frame
events.

Change-Id: I0c0ada2e12ee5ebdd3e8d7b7a6f2bd2af4357548
CRs-Fixed: 2015297
diff --git a/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h b/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h
index f2d1ae5..7f77444 100644
--- a/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h
+++ b/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h
@@ -462,6 +462,24 @@
 	uint8_t i_seq[2];
 } qdf_packed;
 
+/* sequence number offset base on begin of mac header */
+#define WLAN_SEQ_CTL_OFFSET         22
+#define WLAN_LOW_SEQ_NUM_MASK       0x000F
+#define WLAN_HIGH_SEQ_NUM_MASK      0x0FF0
+#define WLAN_HIGH_SEQ_NUM_OFFSET    4
+
+/**
+ * struct wlan_seq_ctl: sequence number control
+ * @frag_num: frag number
+ * @seq_num_lo: sequence number low byte
+ * @seq_num_hi: sequence number high byte
+ */
+struct wlan_seq_ctl {
+	uint8_t frag_num:4;
+	uint8_t seq_num_lo:4;
+	uint8_t seq_num_hi:8;
+} qdf_packed;
+
 /**
  * union wlan_capability : wlan_capability info
  * @value: capability value
@@ -727,7 +745,6 @@
 	uint8_t ft_capab;
 } qdf_packed;
 
-
 /**
  * is_wpa_oui() - If vendor IE is WPA type
  * @frm: vendor IE pointer
diff --git a/umac/cmn_services/inc/wlan_cmn.h b/umac/cmn_services/inc/wlan_cmn.h
index 7308796..024f9f2 100644
--- a/umac/cmn_services/inc/wlan_cmn.h
+++ b/umac/cmn_services/inc/wlan_cmn.h
@@ -89,6 +89,8 @@
 #define WLAN_CHAN_15_FREQ       (2512)
 #define WLAN_CHAN_170_FREQ      (5852)
 
+#define WLAN_MAC_EID_VENDOR     221
+
 /**
  * enum wlan_umac_comp_id - UMAC component id
  * @WLAN_UMAC_COMP_MLME:     MLME
diff --git a/umac/cmn_services/utils/inc/wlan_utility.h b/umac/cmn_services/utils/inc/wlan_utility.h
index e03c437..8888acd 100644
--- a/umac/cmn_services/utils/inc/wlan_utility.h
+++ b/umac/cmn_services/utils/inc/wlan_utility.h
@@ -49,4 +49,19 @@
  */
 uint8_t wlan_freq_to_chan(uint32_t freq);
 
+/**
+ * wlan_get_vendor_ie_ptr_from_oui() - Find out vendor ie
+ * @oui: oui buffer
+ * @oui_size: oui size
+ * @ie: source ie address
+ * @ie_len: source ie length
+ *
+ * This function find out vendor ie by pass source ie and vendor oui.
+ *
+ * Return: vendor ie address - success
+ *         NULL - failure
+ */
+uint8_t *wlan_get_vendor_ie_ptr_from_oui(uint8_t *oui,
+	uint8_t oui_size, uint8_t *ie, uint16_t ie_len);
+
 #endif /* _WLAN_UTILITY_H_ */
diff --git a/umac/cmn_services/utils/src/wlan_utility.c b/umac/cmn_services/utils/src/wlan_utility.c
index 644b72a..bf99460 100644
--- a/umac/cmn_services/utils/src/wlan_utility.c
+++ b/umac/cmn_services/utils/src/wlan_utility.c
@@ -69,3 +69,28 @@
 
 	return chan;
 }
+
+uint8_t *wlan_get_vendor_ie_ptr_from_oui(uint8_t *oui,
+	uint8_t oui_size, uint8_t *ie, uint16_t ie_len)
+{
+	int32_t left = ie_len;
+	uint8_t *ptr = ie;
+	uint8_t elem_id, elem_len;
+
+	while (left >= 2) {
+		elem_id  = ptr[0];
+		elem_len = ptr[1];
+		left -= 2;
+		if (elem_len > left)
+			return NULL;
+		if (WLAN_MAC_EID_VENDOR == elem_id) {
+			if (memcmp(&ptr[2], oui, oui_size) == 0)
+				return ptr;
+		}
+
+		left -= elem_len;
+		ptr += (elem_len + 2);
+	}
+
+	return NULL;
+}