wlan: Enable or disable aggregation dynamically

Add vendor command to enable or disable aggregation
at runtime.

CRs-Fixed: 2002690
Change-Id: I2e17a4dcd5109ee42da9ae5b3605be49c96a6f48
diff --git a/CORE/MAC/src/pe/lim/limApi.c b/CORE/MAC/src/pe/lim/limApi.c
index 24a0fa4..ddac0e6 100644
--- a/CORE/MAC/src/pe/lim/limApi.c
+++ b/CORE/MAC/src/pe/lim/limApi.c
@@ -2799,3 +2799,49 @@
 
     return eSIR_SUCCESS;
 }
+
+/**
+ * lim_process_sme_del_ba_ses_req()- process del ba req
+ * @pMac:Mac ctx
+ * @pMsgBuf: message buffer from sme
+ * Returns success on taking action based on cfg value, otherwise failure
+ */
+tSirRetStatus lim_process_sme_del_ba_ses_req(tpAniSirGlobal pMac,
+                                          tANI_U32 *pMsgBuf)
+{
+    tDelBaParams *pMsg = NULL;
+    tpPESession psessionEntry = NULL;
+    int val;
+
+    pMsg = (tDelBaParams*)pMsgBuf;
+    if (pMsg == NULL) {
+        limLog(pMac, LOGE, FL("NULL pMsg"));
+        return eSIR_FAILURE;
+    }
+
+    psessionEntry = peFindSessionBySessionId(pMac, pMsg->session_id);
+    if (NULL == psessionEntry)
+    {
+        limLog(pMac, LOGE, FL("NULL psessionEntry"));
+        return eSIR_FAILURE;
+    }
+
+    if (wlan_cfgGetInt
+       (pMac, WNI_CFG_ENABLE_TX_RX_AGGREGATION, &val) !=
+              eSIR_SUCCESS)
+    {
+        limLog(pMac, LOGE,
+               FL( "Unable to get WNI_CFG_ENABLE_TX_RX_AGGREGATION"));
+        return eSIR_FAILURE;
+    }
+
+    if (!val)
+    {
+        limLog(pMac, LOGW,
+               FL("user requested to disable all RX BA sessions"));
+        limDeleteBASessions(pMac, psessionEntry, BA_BOTH_DIRECTIONS,
+                             eSIR_MAC_PEER_TIMEDOUT_REASON);
+    }
+
+    return eSIR_SUCCESS;
+}