From 87f20e8d3122c57867bc0bba38703706d6fc50f2 Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatnagar Date: Mon, 31 Aug 2020 13:04:43 +0530 Subject: [PATCH] qcacld-3.0: Consider only self capability for RRM Do not update the RRM capabilities based on the peer association response frame as it is a self capability. Also, in case of passive scan for RRM beacon report, add 10 ms to the dwell time so that chances of receiving beacon increases. Change-Id: I2230e9b08996093cd6f312b5c48d84645d8895c8 CRs-Fixed: 2760810 --- .../src/pe/lim/lim_process_assoc_rsp_frame.c | 7 ---- core/mac/src/pe/rrm/rrm_api.c | 40 +++++++++---------- 2 files changed, 18 insertions(+), 29 deletions(-) diff --git a/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c b/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c index f21de04d3e09..97fcb367d18a 100644 --- a/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c +++ b/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c @@ -632,7 +632,6 @@ lim_process_assoc_rsp_frame(struct mac_context *mac_ctx, uint8_t *rx_pkt_info, QDF_STATUS status; enum ani_akm_type auth_type; bool sha384_akm; - tpRRMCaps rrm_caps = &mac_ctx->rrm.rrmPEContext.rrmEnabledCaps; assoc_cnf.resultCode = eSIR_SME_SUCCESS; /* Update PE session Id */ @@ -1116,12 +1115,6 @@ lim_process_assoc_rsp_frame(struct mac_context *mac_ctx, uint8_t *rx_pkt_info, session_entry->beaconParams.fShortPreamble = true; } - if (assoc_rsp->rrm_caps.present) { - rrm_caps->nonOperatingChanMax = - assoc_rsp->rrm_caps.nonOperatinChanMax; - rrm_caps->operatingChanMax = - assoc_rsp->rrm_caps.operatingChanMax; - } #ifdef FEATURE_WLAN_DIAG_SUPPORT lim_diag_event_report(mac_ctx, WLAN_PE_DIAG_CONNECTED, session_entry, QDF_STATUS_SUCCESS, QDF_STATUS_SUCCESS); diff --git a/core/mac/src/pe/rrm/rrm_api.c b/core/mac/src/pe/rrm/rrm_api.c index f62007beb213..420dbeef3ac8 100644 --- a/core/mac/src/pe/rrm/rrm_api.c +++ b/core/mac/src/pe/rrm/rrm_api.c @@ -576,24 +576,20 @@ rrm_process_beacon_report_req(struct mac_context *mac, maxMeasurementDuration = 2^(nonOperatingChanMax - 4) * BeaconInterval */ - if (mac->rrm.rrmPEContext.rrmEnabledCaps.nonOperatingChanMax) { - maxDuration = + maxDuration = mac->rrm.rrmPEContext.rrmEnabledCaps.nonOperatingChanMax - 4; - sign = (maxDuration < 0) ? 1 : 0; - maxDuration = (1L << ABS(maxDuration)); - if (!sign) - maxMeasduration = - maxDuration * pe_session->beaconParams.beaconInterval; - else - maxMeasduration = - pe_session->beaconParams.beaconInterval / maxDuration; - } else { + sign = (maxDuration < 0) ? 1 : 0; + maxDuration = (1L << ABS(maxDuration)); + if (!sign) maxMeasduration = - pBeaconReq->measurement_request.Beacon.meas_duration; - maxDuration = - mac->rrm.rrmPEContext.rrmEnabledCaps.nonOperatingChanMax; - sign = 0; - } + maxDuration * pe_session->beaconParams.beaconInterval; + else + maxMeasduration = + pe_session->beaconParams.beaconInterval / maxDuration; + + if( pBeaconReq->measurement_request.Beacon.meas_mode == + eSIR_PASSIVE_SCAN) + maxMeasduration += 10; measDuration = pBeaconReq->measurement_request.Beacon.meas_duration; @@ -615,14 +611,14 @@ rrm_process_beacon_report_req(struct mac_context *mac, return eRRM_REFUSED; } - if (pBeaconReq->durationMandatory) { - if (maxDuration && maxMeasduration < measDuration) { - pe_err("RX: [802.11 BCN_RPT] Dropping the req"); + if (maxMeasduration < measDuration) { + if (pBeaconReq->durationMandatory) { + pe_nofl_err("RX: [802.11 BCN_RPT] Dropping the req: duration mandatory & maxduration > measduration"); return eRRM_REFUSED; - } - } else if (maxDuration) { - measDuration = QDF_MIN(maxMeasduration, measDuration); + } else + measDuration = maxMeasduration; } + pe_debug("measurement duration %d", measDuration); /* Cache the data required for sending report. */