summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgaurank kathpalia <gkathpal@codeaurora.org>2018-03-21 17:16:05 +0530
committernshrivas <nshrivas@codeaurora.org>2018-04-03 08:20:08 -0700
commitacbfa37c9be070be2891d4779d06f20eedb095db (patch)
tree4ab2d1b59e0099fb8088ffda451fa318b5e9d1d2
parente9404fd0ece88f06bd9da6d553c1cfb3292da7e3 (diff)
qcacld-3.0: Prioritize connection req frames in pe queue
If there are many beacon/probe received and posted to pe queue the connection req frames may get delayed and thus effect the connection. This may also lead to connection failures. To avoid this prioritize the connection req frames in pe queue. Change-Id: Ib95c83a01e56b6b0e42511e9161ebb59ee666b13 CRs-Fixed: 2217321
-rw-r--r--core/mac/src/include/dph_global.h7
-rw-r--r--core/mac/src/pe/lim/lim_process_assoc_req_frame.c24
-rw-r--r--core/mac/src/pe/lim/lim_process_auth_frame.c21
-rw-r--r--core/mac/src/sys/legacy/src/system/src/sys_entry_func.c15
4 files changed, 46 insertions, 21 deletions
diff --git a/core/mac/src/include/dph_global.h b/core/mac/src/include/dph_global.h
index 55779288ef7c..d5e38e4293da 100644
--- a/core/mac/src/include/dph_global.h
+++ b/core/mac/src/include/dph_global.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -173,6 +173,11 @@ typedef struct sDphHashNode {
tDphQosParams qos;
/* station version info - valid only if versionPresent is set */
tSirMacPropVersion version;
+ /* Previous authentication packet sequence number */
+ uint16_t prev_auth_seq_no;
+ /* Previous association packet sequence number */
+ uint16_t prev_assoc_seq_no;
+
#ifdef PLM_WDS
uint8_t wdsIndex;
uint8_t wdsPeerBeaconSeen;
diff --git a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c
index 3e3345768882..dfbe6cbc95ca 100644
--- a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c
+++ b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c
@@ -1102,6 +1102,7 @@ static bool lim_process_assoc_req_sta_ctx(tpAniSirGlobal mac_ctx,
eLIM_MLM_AUTHENTICATED_STATE)) {
/* STA has triggered pre-auth again */
*auth_type = sta_pre_auth_ctx->authType;
+ sta_ds->prev_auth_seq_no = sta_pre_auth_ctx->seq_num;
lim_delete_pre_auth_node(mac_ctx, hdr->sa);
} else {
*auth_type = sta_ds->mlmStaContext.authType;
@@ -1248,6 +1249,9 @@ static bool lim_update_sta_ds(tpAniSirGlobal mac_ctx, tpSirMacMgmtHdr hdr,
sta_ds->qos.addts = assoc_req->addtsReq;
sta_ds->qos.capability = assoc_req->qosCapability;
sta_ds->versionPresent = 0;
+ sta_ds->prev_assoc_seq_no = (((hdr->seqControl.seqNumHi <<
+ HIGH_SEQ_NUM_OFFSET) |
+ hdr->seqControl.seqNumLo));
/*
* short slot and short preamble should be updated before doing
* limaddsta
@@ -1768,19 +1772,21 @@ void lim_process_assoc_req_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_pkt_info,
}
/*
- * If a STA is already present in DPH and it is initiating a Assoc
- * re-transmit, do not process it. This can happen when first Assoc Req
- * frame is received but ACK lost at STA side. The ACK for this dropped
- * Assoc Req frame should be sent by HW. Host simply does not process it
- * once the entry for the STA is already present in DPH.
+ * If a STA is already present in DPH and the host receives an assoc
+ * request with the same sequence number , do not process it, as the
+ * previous assoc has already been processed and the response will be
+ * retried by the firmware if the peer hasnt received the response yet
*/
sta_ds = dph_lookup_hash_entry(mac_ctx, hdr->sa, &assoc_id,
&session->dph.dphHashTable);
if (NULL != sta_ds) {
- if (hdr->fc.retry > 0) {
- pe_err("STA is initiating Assoc Req after ACK lost. Do not process sessionid: %d sys sub_type=%d for role=%d from: "
- MAC_ADDRESS_STR, session->peSessionId,
- sub_type, GET_LIM_SYSTEM_ROLE(session),
+ if (sta_ds->prev_assoc_seq_no == (((hdr->seqControl.seqNumHi <<
+ HIGH_SEQ_NUM_OFFSET) |
+ hdr->seqControl.seqNumLo))) {
+ pe_err("Got an Assoc Req with same seq no. SN:%d .Do not process sessionid: %d sys sub_type=%d for role=%d from: "
+ MAC_ADDRESS_STR, sta_ds->prev_assoc_seq_no,
+ session->peSessionId,
+ sub_type, GET_LIM_SYSTEM_ROLE(session),
MAC_ADDR_ARRAY(hdr->sa));
return;
} else if (!sta_ds->rmfEnabled && (sub_type == LIM_REASSOC)) {
diff --git a/core/mac/src/pe/lim/lim_process_auth_frame.c b/core/mac/src/pe/lim/lim_process_auth_frame.c
index 5758561e39b5..6c1a99e4b4af 100644
--- a/core/mac/src/pe/lim/lim_process_auth_frame.c
+++ b/core/mac/src/pe/lim/lim_process_auth_frame.c
@@ -364,8 +364,11 @@ static void lim_process_auth_frame_type1(tpAniSirGlobal mac_ctx,
* modify the state of the existing association until the
* SA-Query procedure determines that the original SA is
* invalid.
+ * If the Auth sequence number is same as the previous auth seq
+ * number, dont send a deauth as the auth packet is just the
+ * duplicate of previous auth.
*/
- if (isConnected
+ if (isConnected && sta_ds_ptr->prev_auth_seq_no != curr_seq_num
#ifdef WLAN_FEATURE_11W
&& !sta_ds_ptr->rmfEnabled
#endif
@@ -385,14 +388,15 @@ static void lim_process_auth_frame_type1(tpAniSirGlobal mac_ctx,
auth_node = lim_search_pre_auth_list(mac_ctx, mac_hdr->sa);
if (auth_node) {
/* Pre-auth context exists for the STA */
- if (!(mac_hdr->fc.retry == 0 ||
- auth_node->seq_num != curr_seq_num)) {
+ if (auth_node->seq_num == curr_seq_num) {
/*
- * This can happen when first authentication frame is
- * received but ACK lost at STA side, in this case 2nd
- * auth frame is already in transmission queue
+ * If a STA is already present in authnode and the host receives an auth
+ * request with the same sequence number , do not process it, as the
+ * previous auth has already been processed and the response will be
+ * retried by the firmware if the peer hasnt received the response yet
*/
- pe_warn("STA is initiating Auth after ACK lost");
+ pe_warn("STA is initiating Auth with SN: %d after ACK lost",
+ auth_node->seq_num);
return;
}
/*
@@ -1144,8 +1148,7 @@ lim_process_auth_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_pkt_info,
pe_session->limMlmState, MAC_ADDR_ARRAY(mac_hdr->bssId),
(uint) abs((int8_t) WMA_GET_RX_RSSI_NORMALIZED(rx_pkt_info)));
- if (pe_session->prev_auth_seq_num == curr_seq_num &&
- mac_hdr->fc.retry) {
+ if (pe_session->prev_auth_seq_num == curr_seq_num) {
pe_err("auth frame, seq num: %d is already processed, drop it",
curr_seq_num);
return;
diff --git a/core/mac/src/sys/legacy/src/system/src/sys_entry_func.c b/core/mac/src/sys/legacy/src/system/src/sys_entry_func.c
index 9f36260402c5..030221f92d97 100644
--- a/core/mac/src/sys/legacy/src/system/src/sys_entry_func.c
+++ b/core/mac/src/sys/legacy/src/system/src/sys_entry_func.c
@@ -166,8 +166,19 @@ sys_bbt_process_message_core(tpAniSirGlobal mac_ctx, tpSirMsgQ msg,
mac_ctx->sys.gSysFrameCount[type][subtype]);
}
- /* Post the message to PE Queue */
- ret = (tSirRetStatus) lim_post_msg_api(mac_ctx, msg);
+ /*
+ * Post the message to PE Queue. Prioritize the
+ * Auth and assoc frames.
+ */
+ if ((subtype == SIR_MAC_MGMT_AUTH) ||
+ (subtype == SIR_MAC_MGMT_ASSOC_RSP) ||
+ (subtype == SIR_MAC_MGMT_REASSOC_RSP) ||
+ (subtype == SIR_MAC_MGMT_ASSOC_REQ) ||
+ (subtype == SIR_MAC_MGMT_REASSOC_REQ))
+ ret = (tSirRetStatus)
+ lim_post_msg_high_priority(mac_ctx, msg);
+ else
+ ret = (tSirRetStatus) lim_post_msg_api(mac_ctx, msg);
if (ret != eSIR_SUCCESS) {
pe_err("posting to LIM2 failed, ret %d\n", ret);
goto fail;