Browse Source

qcacld-3.0: Add ADDBA extenstion element support

Add support to parase and include the ADDBA extesion
element in ADDBA request and response frames

Change-Id: Ifab94f77ff9d2757794d5530fee6596534a6d73b
CRs-Fixed: 2166790
Kiran Kumar Lokere 7 years ago
parent
commit
4087585aa2

+ 12 - 0
core/mac/src/cfg/cfgUtil/dot11f.frms

@@ -113,6 +113,7 @@ const EID_PU_BUFFER_STATUS           = 106;
 const EID_QOS_MAP_SET                = 110;
 const EID_ESE_SPECIFIC               = 150;
 const EID_ESE_CCKM_SPECIFIC          = 156;
+const EID_ADDBA_EXTN_ELEMENT         = 159;
 const EID_VHT_CAPABILITIES           =  191;
 const EID_VHT_OPERATION_ELEMENT      =  192;
 const EID_VHT_EXT_BSS_LOAD           =  193;
@@ -475,6 +476,15 @@ FF ba_start_seq_ctrl(2)
     }
 }
 
+IE addba_extn_element(EID_ADDBA_EXTN_ELEMENT)
+{
+    {
+      no_fragmentation: 1;
+      he_frag_operation: 2;
+      reserved: 5;
+    }
+}
+
 FF delba_param_set(2)
 {
     {
@@ -4265,6 +4275,7 @@ FRAME addba_req
     FF    addba_param_set;
     FF    ba_timeout;
     FF    ba_start_seq_ctrl;
+    OPTIE addba_extn_element;
 }
 
 FRAME addba_rsp
@@ -4275,6 +4286,7 @@ FRAME addba_rsp
     FF    Status;
     FF    addba_param_set;
     FF    ba_timeout;
+    OPTIE addba_extn_element;
 }
 
 FRAME delba_req

+ 56 - 13
core/mac/src/include/dot11f.h

@@ -35,7 +35,7 @@
  *
  *
  * This file was automatically generated by 'framesc'
- * Thu Jan 25 09:35:43 2018 from the following file(s):
+ * Thu Jan 25 11:13:36 2018 from the following file(s):
  *
  * dot11f.frms
  *
@@ -8097,6 +8097,47 @@ uint32_t dot11f_get_packed_ie_wsc_reassoc_res(
 }; /* End extern "C". */
 #endif /* C++ */
 
+/* EID 159 (0x9f) */
+typedef struct sDot11fIEaddba_extn_element {
+	uint8_t             present;
+	uint8_t     no_fragmentation:1;
+	uint8_t    he_frag_operation:2;
+	uint8_t             reserved:5;
+} tDot11fIEaddba_extn_element;
+
+#define DOT11F_EID_ADDBA_EXTN_ELEMENT (159)
+
+/* N.B. These #defines do *not* include the EID & length */
+#define DOT11F_IE_ADDBA_EXTN_ELEMENT_MIN_LEN (1)
+
+#define DOT11F_IE_ADDBA_EXTN_ELEMENT_MAX_LEN (1)
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* C++ */
+uint32_t dot11f_unpack_ie_addba_extn_element(
+	tpAniSirGlobal,
+	uint8_t *,
+	uint8_t,
+	tDot11fIEaddba_extn_element*,
+	bool);
+
+uint32_t dot11f_pack_ie_addba_extn_element(
+	tpAniSirGlobal,
+	tDot11fIEaddba_extn_element *,
+	uint8_t *,
+	uint32_t,
+	uint32_t*);
+
+uint32_t dot11f_get_packed_ie_addba_extn_element(
+	tpAniSirGlobal,
+	tDot11fIEaddba_extn_element *,
+	uint32_t*);
+
+#ifdef __cplusplus
+}; /* End extern "C". */
+#endif /* C++ */
+
 /* EID 221 (0xdd) {OUI 0x00, 0x13, 0x74, 0x05} */
 typedef struct sDot11fIEbss_color_change {
 	uint8_t             present;
@@ -10876,12 +10917,13 @@ uint32_t dot11f_get_packed_wmm_del_ts_size(tpAniSirGlobal pCtx,
 #endif /* C++ */
 
 typedef struct sDot11faddba_req{
-	tDot11fFfCategory                 Category;
-	tDot11fFfAction                   Action;
-	tDot11fFfDialogToken              DialogToken;
-	tDot11fFfaddba_param_set          addba_param_set;
-	tDot11fFfba_timeout               ba_timeout;
-	tDot11fFfba_start_seq_ctrl        ba_start_seq_ctrl;
+	tDot11fFfCategory                  Category;
+	tDot11fFfAction                    Action;
+	tDot11fFfDialogToken               DialogToken;
+	tDot11fFfaddba_param_set           addba_param_set;
+	tDot11fFfba_timeout                ba_timeout;
+	tDot11fFfba_start_seq_ctrl         ba_start_seq_ctrl;
+	tDot11fIEaddba_extn_element        addba_extn_element;
 } tDot11faddba_req;
 
 #define DOT11F_ADDBA_REQ (46)
@@ -10905,12 +10947,13 @@ uint32_t dot11f_get_packed_addba_req_size(tpAniSirGlobal pCtx,
 #endif /* C++ */
 
 typedef struct sDot11faddba_rsp{
-	tDot11fFfCategory               Category;
-	tDot11fFfAction                 Action;
-	tDot11fFfDialogToken            DialogToken;
-	tDot11fFfStatus                 Status;
-	tDot11fFfaddba_param_set        addba_param_set;
-	tDot11fFfba_timeout             ba_timeout;
+	tDot11fFfCategory                  Category;
+	tDot11fFfAction                    Action;
+	tDot11fFfDialogToken               DialogToken;
+	tDot11fFfStatus                    Status;
+	tDot11fFfaddba_param_set           addba_param_set;
+	tDot11fFfba_timeout                ba_timeout;
+	tDot11fIEaddba_extn_element        addba_extn_element;
 } tDot11faddba_rsp;
 
 #define DOT11F_ADDBA_RSP (47)

+ 3 - 2
core/mac/src/pe/lim/lim_process_action_frame.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -1697,7 +1697,8 @@ static void lim_process_addba_req(tpAniSirGlobal mac_ctx, uint8_t *rx_pkt_info,
 
 	if (QDF_STATUS_SUCCESS == qdf_status) {
 		lim_send_addba_response_frame(mac_ctx, mac_hdr->sa,
-			addba_req->addba_param_set.tid, session);
+			addba_req->addba_param_set.tid, session,
+			addba_req->addba_extn_element.present);
 	} else {
 		pe_err("Failed to process addba request");
 	}

+ 21 - 1
core/mac/src/pe/lim/lim_send_management_frames.c

@@ -4684,6 +4684,7 @@ returnAfterError:
  * @peer_mac: Peer MAC address
  * @tid: TID for which addba response is being sent
  * @session: PE session entry
+ * @addba_extn_present: ADDBA extension present flag
  *
  * This function is called when ADDBA request is successful. ADDBA response is
  * setup by calling addba_response_setup API and frame is then sent out OTA.
@@ -4691,7 +4692,8 @@ returnAfterError:
  * Return: QDF_STATUS
  */
 QDF_STATUS lim_send_addba_response_frame(tpAniSirGlobal mac_ctx,
-			tSirMacAddr peer_mac, uint16_t tid, tpPESession session)
+		tSirMacAddr peer_mac, uint16_t tid,
+		tpPESession session, uint8_t addba_extn_present)
 {
 
 	tDot11faddba_rsp frm;
@@ -4706,6 +4708,7 @@ QDF_STATUS lim_send_addba_response_frame(tpAniSirGlobal mac_ctx,
 	uint8_t peer_id, dialog_token;
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 	void *peer, *pdev;
+	uint8_t he_frag = 0;
 
 	sme_sessionid = session->smeSessionId;
 
@@ -4737,12 +4740,29 @@ QDF_STATUS lim_send_addba_response_frame(tpAniSirGlobal mac_ctx,
 	frm.addba_param_set.amsdu_supp = SIR_MAC_BA_POLICY_IMMEDIATE;
 	frm.addba_param_set.policy = SIR_MAC_BA_AMSDU_SUPPORTED;
 	frm.ba_timeout.timeout = batimeout;
+	if (addba_extn_present) {
+		frm.addba_extn_element.present = 1;
+		frm.addba_extn_element.no_fragmentation = 1;
+		if (lim_is_session_he_capable(session)) {
+			he_frag = lim_get_session_he_frag_cap(session);
+			if (he_frag != 0) {
+				frm.addba_extn_element.no_fragmentation = 0;
+				frm.addba_extn_element.he_frag_operation =
+					he_frag;
+			}
+		}
+	}
 
 	pe_debug("Sending a ADDBA Response from %pM to %pM",
 		session->selfMacAddr, peer_mac);
 	pe_debug("tid: %d, dialog_token: %d, status: %d, buff_size: %d",
 		tid, frm.DialogToken.token, frm.Status.status,
 		frm.addba_param_set.buff_size);
+	pe_debug("addba_extn %d he_capable %d no_frag %d he_frag %d",
+		addba_extn_present,
+		lim_is_session_he_capable(session),
+		frm.addba_extn_element.no_fragmentation,
+		frm.addba_extn_element.he_frag_operation);
 
 	status = dot11f_get_packed_addba_rsp_size(mac_ctx, &frm, &payload_size);
 	if (DOT11F_FAILED(status)) {

+ 2 - 2
core/mac/src/pe/lim/lim_types.h

@@ -985,8 +985,8 @@ enum {
 };
 
 QDF_STATUS lim_send_addba_response_frame(tpAniSirGlobal mac_ctx,
-		tSirMacAddr peer_mac, uint16_t tid, tpPESession session);
-
+		tSirMacAddr peer_mac, uint16_t tid,
+		tpPESession session, uint8_t addba_extn_present);
 /**
  * lim_process_join_failure_timeout() - This function is called to process
  * JoinFailureTimeout

+ 16 - 0
core/mac/src/pe/lim/lim_utils.h

@@ -988,6 +988,17 @@ static inline bool lim_is_session_he_capable(tpPESession session)
 	return session->he_capable;
 }
 
+/**
+ * lim_get_session_he_frag_cap(): Get session HE fragmentation cap
+ * @session: pointer to session
+ *
+ * Return: HE fragmentation value
+ */
+static inline uint8_t lim_get_session_he_frag_cap(tpPESession session)
+{
+	return session->he_config.fragmentation;
+}
+
 static inline bool lim_is_sta_he_capable(tpDphHashNode sta_ds)
 {
 	return sta_ds->mlmStaContext.he_capable;
@@ -1150,6 +1161,11 @@ static inline bool lim_is_session_he_capable(tpPESession session)
 	return false;
 }
 
+static inline uint8_t lim_get_session_he_frag_cap(tpPESession session)
+{
+	return 0;
+}
+
 static inline bool lim_is_sta_he_capable(tpDphHashNode sta_ds)
 {
 	return false;

File diff suppressed because it is too large
+ 321 - 273
core/mac/src/sys/legacy/src/utils/src/dot11f.c


Some files were not shown because too many files changed in this diff