Просмотр исходного кода

qcacld-3.0: Don't defer beacon and probe response in LIM

Don't defer beacon and probe response in LIM

Change-Id: I92c31f6eb2c4ce2d4f5ddf67684f4042c90108dd
CRs-Fixed: 2033037
Sandeep Puligilla 8 лет назад
Родитель
Сommit
d9f88ce8d0

+ 4 - 1
core/mac/src/pe/include/lim_api.h

@@ -80,7 +80,10 @@
 #define LIM_IS_CONNECTION_ACTIVE(psessionEntry)  (psessionEntry->LimRxedBeaconCntDuringHB)
 /*pMac->lim.gLimProcessDefdMsgs*/
 #define GET_LIM_PROCESS_DEFD_MESGS(pMac) (pMac->lim.gLimProcessDefdMsgs)
-#define SET_LIM_PROCESS_DEFD_MESGS(pMac, val) (pMac->lim.gLimProcessDefdMsgs = val)
+#define SET_LIM_PROCESS_DEFD_MESGS(pMac, val) \
+		pMac->lim.gLimProcessDefdMsgs = val; \
+		pe_debug("%s Defer LIM messages - value %d", __func__, val);
+
 /* LIM exported function templates */
 #define LIM_MIN_BCN_PR_LENGTH  12
 #define LIM_BCN_PR_CAPABILITY_OFFSET 10

+ 21 - 2
core/mac/src/pe/lim/lim_process_message_queue.c

@@ -371,6 +371,9 @@ static void lim_process_hw_mode_trans_ind(tpAniSirGlobal mac, void *body)
 
 uint8_t static def_msg_decision(tpAniSirGlobal pMac, struct scheduler_msg *limMsg)
 {
+	uint8_t type, subtype;
+	QDF_STATUS status;
+	bool mgmt_pkt_defer = true;
 
 /* this function should not changed */
 	if (pMac->lim.gLimSmeState == eLIM_SME_OFFLINE_STATE) {
@@ -387,6 +390,21 @@ uint8_t static def_msg_decision(tpAniSirGlobal pMac, struct scheduler_msg *limMs
 	if ((!lim_is_system_in_scan_state(pMac))
 	    && (true != GET_LIM_PROCESS_DEFD_MESGS(pMac))
 	    && !pMac->lim.gLimSystemInScanLearnMode) {
+
+		if (limMsg->type == SIR_BB_XPORT_MGMT_MSG) {
+			/*
+			 * Dont defer beacon and probe response
+			 * because it will fill the differ queue quickly
+			 */
+			status = lim_util_get_type_subtype(limMsg->bodyptr,
+				&type, &subtype);
+			if (QDF_IS_STATUS_SUCCESS(status) &&
+				(type == SIR_MAC_MGMT_FRAME) &&
+				((subtype == SIR_MAC_MGMT_BEACON) ||
+				 (subtype == SIR_MAC_MGMT_PROBE_RSP)))
+				mgmt_pkt_defer = false;
+		}
+
 		if ((limMsg->type != WMA_ADD_BSS_RSP)
 		    && (limMsg->type != WMA_DELETE_BSS_RSP)
 		    && (limMsg->type != WMA_DELETE_BSS_HO_FAIL_RSP)
@@ -420,7 +438,8 @@ uint8_t static def_msg_decision(tpAniSirGlobal pMac, struct scheduler_msg *limMs
 		     * after ADD TS request is sent over the air and
 		     * ADD TS response received over the air */
 		    !(limMsg->type == SIR_BB_XPORT_MGMT_MSG &&
-			pMac->lim.gLimAddtsSent)) {
+			pMac->lim.gLimAddtsSent) &&
+			(mgmt_pkt_defer)) {
 			pe_debug("Defer the current message %s , gLimProcessDefdMsgs is false and system is not in scan/learn mode",
 				       lim_msg_str(limMsg->type));
 			/* Defer processsing this message */
@@ -694,7 +713,7 @@ uint32_t lim_defer_msg(tpAniSirGlobal pMac, struct scheduler_msg *pMsg)
 			       LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DEFERRED));
 		       )
 	} else {
-		pe_err("Dropped lim message (0x%X)", pMsg->type);
+		pe_err("Dropped lim message (0x%X) Message %s", pMsg->type, lim_msg_str(pMsg->type));
 		MTRACE(mac_trace_msg_rx
 			       (pMac, NO_SESSION,
 			       LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DROPPED));

+ 43 - 0
core/mac/src/pe/lim/lim_utils.c

@@ -904,6 +904,8 @@ void lim_reset_deferred_msg_q(tpAniSirGlobal pMac)
 uint8_t lim_write_deferred_msg_q(tpAniSirGlobal mac_ctx,
 				 struct scheduler_msg *lim_msg)
 {
+	uint8_t type, subtype;
+
 	pe_debug("Queue a deferred message size: %d write: %d - type: 0x%x",
 		mac_ctx->lim.gLimDeferredMsgQ.size,
 		mac_ctx->lim.gLimDeferredMsgQ.write,
@@ -939,6 +941,13 @@ uint8_t lim_write_deferred_msg_q(tpAniSirGlobal mac_ctx,
 			mac_ctx->lim.gLimMlmState,
 			mac_ctx->lim.gLimAddtsSent);
 
+	if (SIR_BB_XPORT_MGMT_MSG == lim_msg->type) {
+		lim_util_get_type_subtype(lim_msg->bodyptr,
+					&type, &subtype);
+		pe_debug(" Deferred managment type %d subtype %d ",
+			type, subtype);
+	}
+
 	/*
 	 * To prevent the deferred Q is full of management frames, only give
 	 * them certain space
@@ -8039,3 +8048,37 @@ bool lim_check_if_vendor_oui_match(tpAniSirGlobal mac_ctx,
 	else
 		return false;
 }
+
+QDF_STATUS lim_util_get_type_subtype(void *pkt, uint8_t *type,
+						uint8_t *subtype)
+{
+	cds_pkt_t *cds_pkt;
+	QDF_STATUS status;
+	tpSirMacMgmtHdr hdr;
+	uint8_t *rxpktinfor;
+
+	cds_pkt = (cds_pkt_t *) pkt;
+	if (!cds_pkt) {
+		pe_err("NULL packet received");
+		return QDF_STATUS_E_FAILURE;
+	}
+	status =
+		wma_ds_peek_rx_packet_info(cds_pkt, (void *)&rxpktinfor, false);
+	if (!QDF_IS_STATUS_SUCCESS(status)) {
+		pe_err("Failed extract cds packet. status %d", status);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	hdr = WMA_GET_RX_MAC_HEADER(rxpktinfor);
+	if (hdr->fc.type == SIR_MAC_MGMT_FRAME) {
+		pe_debug("RxBd: %p mHdr: %p Type: %d Subtype: %d  SizesFC: %zu",
+		  rxpktinfor, hdr, hdr->fc.type, hdr->fc.subType,
+		  sizeof(tSirMacFrameCtl));
+		*type = hdr->fc.type;
+		*subtype = hdr->fc.subType;
+	} else {
+		pe_err("Not a managment packet type %d", hdr->fc.type);
+		return QDF_STATUS_E_INVAL;
+	}
+	return QDF_STATUS_SUCCESS;
+}

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

@@ -1192,4 +1192,7 @@ void lim_decrement_pending_mgmt_count(tpAniSirGlobal mac_ctx);
 bool lim_check_if_vendor_oui_match(tpAniSirGlobal mac_ctx,
 					uint8_t *oui, uint8_t oui_len,
 			       uint8_t *ie, uint8_t ie_len);
+QDF_STATUS lim_util_get_type_subtype(void *pkt, uint8_t *type,
+					uint8_t *subtype);
+
 #endif /* __LIM_UTILS_H */