qcacld-3.0: Refactor lim_is_pkt_candidate_for_drop()
refactor lim_is_pkt_candidate_for_drop function to include logic IBSS mode. Change-Id: I3446e8f4d373e8f88d56d010a48a70cecf4b3062 CRs-Fixed: 2232890
This commit is contained in:
@@ -2654,29 +2654,17 @@ tMgmtFrmDropReason lim_is_pkt_candidate_for_drop(tpAniSirGlobal pMac,
|
|||||||
if ((subType == SIR_MAC_MGMT_BEACON) ||
|
if ((subType == SIR_MAC_MGMT_BEACON) ||
|
||||||
(subType == SIR_MAC_MGMT_PROBE_RSP)) {
|
(subType == SIR_MAC_MGMT_PROBE_RSP)) {
|
||||||
if (lim_is_beacon_miss_scenario(pMac, pRxPacketInfo)) {
|
if (lim_is_beacon_miss_scenario(pMac, pRxPacketInfo)) {
|
||||||
MTRACE(mac_trace
|
MTRACE(mac_trace(pMac, TRACE_CODE_INFO_LOG, 0,
|
||||||
(pMac, TRACE_CODE_INFO_LOG, 0,
|
|
||||||
eLOG_NODROP_MISSED_BEACON_SCENARIO));
|
eLOG_NODROP_MISSED_BEACON_SCENARIO));
|
||||||
return eMGMT_DROP_NO_DROP;
|
return eMGMT_DROP_NO_DROP;
|
||||||
}
|
}
|
||||||
if (lim_is_system_in_scan_state(pMac)) {
|
if (lim_is_system_in_scan_state(pMac))
|
||||||
return eMGMT_DROP_NO_DROP;
|
return eMGMT_DROP_NO_DROP;
|
||||||
} else if (WMA_IS_RX_IN_SCAN(pRxPacketInfo)) {
|
else if (WMA_IS_RX_IN_SCAN(pRxPacketInfo))
|
||||||
return eMGMT_DROP_SCAN_MODE_FRAME;
|
return eMGMT_DROP_SCAN_MODE_FRAME;
|
||||||
} else {
|
|
||||||
/* Beacons and probe responses can come in any time
|
|
||||||
* because of parallel scans. Don't drop them.
|
|
||||||
*/
|
|
||||||
return eMGMT_DROP_NO_DROP;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
framelen = WMA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
|
framelen = WMA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
|
||||||
pBody = WMA_GET_RX_MPDU_DATA(pRxPacketInfo);
|
pBody = WMA_GET_RX_MPDU_DATA(pRxPacketInfo);
|
||||||
|
|
||||||
/* Drop INFRA Beacons and Probe Responses in IBSS Mode */
|
|
||||||
if ((subType == SIR_MAC_MGMT_BEACON) ||
|
|
||||||
(subType == SIR_MAC_MGMT_PROBE_RSP)) {
|
|
||||||
/* drop the frame if length is less than 12 */
|
/* drop the frame if length is less than 12 */
|
||||||
if (framelen < LIM_MIN_BCN_PR_LENGTH)
|
if (framelen < LIM_MIN_BCN_PR_LENGTH)
|
||||||
return eMGMT_DROP_INVALID_SIZE;
|
return eMGMT_DROP_INVALID_SIZE;
|
||||||
@@ -2690,14 +2678,17 @@ tMgmtFrmDropReason lim_is_pkt_candidate_for_drop(tpAniSirGlobal pMac,
|
|||||||
if (!capabilityInfo.ibss)
|
if (!capabilityInfo.ibss)
|
||||||
return eMGMT_DROP_NO_DROP;
|
return eMGMT_DROP_NO_DROP;
|
||||||
|
|
||||||
|
/* Drop INFRA Beacons and Probe Responses in IBSS Mode */
|
||||||
/* This can be enhanced to even check the SSID before deciding to enque the frame. */
|
/* This can be enhanced to even check the SSID before deciding to enque the frame. */
|
||||||
if (capabilityInfo.ess)
|
if (capabilityInfo.ess)
|
||||||
return eMGMT_DROP_INFRA_BCN_IN_IBSS;
|
return eMGMT_DROP_INFRA_BCN_IN_IBSS;
|
||||||
|
|
||||||
} else if ((subType == SIR_MAC_MGMT_PROBE_REQ) &&
|
} else if ((subType == SIR_MAC_MGMT_PROBE_REQ) &&
|
||||||
(!WMA_GET_RX_BEACON_SENT(pRxPacketInfo))) {
|
(!WMA_GET_RX_BEACON_SENT(pRxPacketInfo))) {
|
||||||
pHdr = WMA_GET_RX_MAC_HEADER(pRxPacketInfo);
|
pHdr = WMA_GET_RX_MAC_HEADER(pRxPacketInfo);
|
||||||
psessionEntry =
|
psessionEntry = pe_find_session_by_bssid(pMac,
|
||||||
pe_find_session_by_bssid(pMac, pHdr->bssId, &sessionId);
|
pHdr->bssId,
|
||||||
|
&sessionId);
|
||||||
if ((psessionEntry && !LIM_IS_IBSS_ROLE(psessionEntry)) ||
|
if ((psessionEntry && !LIM_IS_IBSS_ROLE(psessionEntry)) ||
|
||||||
(!psessionEntry))
|
(!psessionEntry))
|
||||||
return eMGMT_DROP_NO_DROP;
|
return eMGMT_DROP_NO_DROP;
|
||||||
|
Reference in New Issue
Block a user