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;
+}
diff --git a/CORE/MAC/src/pe/lim/limProcessActionFrame.c b/CORE/MAC/src/pe/lim/limProcessActionFrame.c
index 8b402d1..37c8457 100644
--- a/CORE/MAC/src/pe/lim/limProcessActionFrame.c
+++ b/CORE/MAC/src/pe/lim/limProcessActionFrame.c
@@ -1270,7 +1270,7 @@
tpDphHashNode pSta;
tSirMacStatusCodes status = eSIR_MAC_SUCCESS_STATUS;
tANI_U16 aid;
- tANI_U32 frameLen, nStatus,val;
+ tANI_U32 frameLen, nStatus,val, val1;
tANI_U8 *pBody;
tANI_U8 delBAFlag =0;
@@ -1278,6 +1278,7 @@
pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
val = 0;
+ val1 = 0;
// Unpack the received frame
nStatus = dot11fUnpackAddBAReq( pMac, pBody, frameLen, &frmAddBAReq );
@@ -1339,6 +1340,20 @@
}
#endif //WLAN_SOFTAP_VSTA_FEATURE
+ if (wlan_cfgGetInt(pMac, WNI_CFG_ENABLE_TX_RX_AGGREGATION, &val1) !=
+ eSIR_SUCCESS)
+ {
+ limLog(pMac, LOGE,
+ FL("Unable to get WNI_CFG_ENABLE_TX_RX_AGGREGATION"));
+ val1 = 1;
+ }
+ if (!val1)
+ {
+ limLog(pMac, LOGE,
+ FL("aggregation disabled - ignoring ADDBA"));
+ goto returnAfterError;
+ }
+
if (wlan_cfgGetInt(pMac, WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC, &val) !=
eSIR_SUCCESS)
{
diff --git a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c
index 15d6c64..835a6e6 100644
--- a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c
+++ b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c
@@ -2534,6 +2534,11 @@
vos_mem_free((v_VOID_t*)limMsg->bodyptr);
limMsg->bodyptr = NULL;
break;
+ case eWNI_SME_DEL_BA_SES_REQ:
+ lim_process_sme_del_ba_ses_req(pMac, limMsg->bodyptr);
+ vos_mem_free((v_VOID_t*)limMsg->bodyptr);
+ limMsg->bodyptr = NULL;
+ break;
default:
vos_mem_free((v_VOID_t*)limMsg->bodyptr);
limMsg->bodyptr = NULL;
diff --git a/CORE/MAC/src/pe/lim/limTypes.h b/CORE/MAC/src/pe/lim/limTypes.h
index feaf1ed..6a8fb8d 100644
--- a/CORE/MAC/src/pe/lim/limTypes.h
+++ b/CORE/MAC/src/pe/lim/limTypes.h
@@ -1078,5 +1078,9 @@
tSirRetStatus lim_process_sme_get_tsf_req(tpAniSirGlobal pMac,
tANI_U32 *pMsgBuf);
+
+tSirRetStatus lim_process_sme_del_ba_ses_req(tpAniSirGlobal pMac,
+ tANI_U32 *pMsgBuf);
+
#endif /* __LIM_TYPES_H */