summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhishek Singh <absingh@codeaurora.org>2017-03-10 12:42:37 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2017-03-17 12:16:49 -0700
commit688e51c2405a6338af87edd5567f9d34a7895c0d (patch)
treeb14d51b3f03a5da4b102bc6f4ac216dd52b1e7d4
parent9ad20152e7aacb8d09b382599b2df698790cc858 (diff)
qcacld-3.0: Fix compile errors when WLAN_FEATURE_11W is disabled
Fix compilation errors when WLAN_FEATURE_11W is disabled. Change-Id: I5bed89f0077a51117c57e176568f849293d40ee5 CRs-Fixed: 2019223
-rw-r--r--core/dp/txrx/ol_txrx.c11
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c47
-rw-r--r--core/mac/src/pe/lim/lim_p2p.c82
-rw-r--r--core/mac/src/pe/lim/lim_session.c39
-rw-r--r--core/mac/src/pe/lim/lim_utils.c2
-rw-r--r--core/sme/inc/csr_api.h2
-rw-r--r--core/sme/src/csr/csr_api_roam.c42
-rw-r--r--core/wma/src/wma_dev_if.c124
-rw-r--r--core/wma/src/wma_mgmt.c15
9 files changed, 199 insertions, 165 deletions
diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c
index 3fa58cb4eac1..27afac5be95d 100644
--- a/core/dp/txrx/ol_txrx.c
+++ b/core/dp/txrx/ol_txrx.c
@@ -2539,15 +2539,7 @@ ol_txrx_peer_get_peer_mac_addr(ol_txrx_peer_handle peer)
return peer->mac_addr.raw;
}
-/**
- * ol_txrx_get_pn_info() - Returns pn info from peer
- * @peer: handle to peer
- * @last_pn_valid: return last_rmf_pn_valid value from peer.
- * @last_pn: return last_rmf_pn value from peer.
- * @rmf_pn_replays: return rmf_pn_replays value from peer.
- *
- * Return: NONE
- */
+#ifdef WLAN_FEATURE_11W
void
ol_txrx_get_pn_info(ol_txrx_peer_handle peer, uint8_t **last_pn_valid,
uint64_t **last_pn, uint32_t **rmf_pn_replays)
@@ -2556,6 +2548,7 @@ ol_txrx_get_pn_info(ol_txrx_peer_handle peer, uint8_t **last_pn_valid,
*last_pn = &peer->last_rmf_pn;
*rmf_pn_replays = &peer->rmf_pn_replays;
}
+#endif
/**
* ol_txrx_get_opmode() - Return operation mode of vdev
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 32989944e732..2a7544f9247f 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -12336,6 +12336,38 @@ static bool wlan_hdd_handle_sap_sta_dfs_conc(hdd_adapter_t *adapter,
return true;
}
+#ifdef WLAN_FEATURE_11W
+/**
+ * wlan_hdd_cfg80211_check_pmf_valid() - check if pmf status is ok
+ * @roam_profile: pointer to roam profile
+ *
+ * if MFPEnabled is set but the peer AP is non-PMF i.e 80211w=2
+ * or pmf=2 is an explicit configuration in the supplicant
+ * configuration, drop the connection request.
+ *
+ * Return: 0 if check result is valid, otherwise return error code
+ */
+static int wlan_hdd_cfg80211_check_pmf_valid(tCsrRoamProfile *roam_profile)
+{
+ if (roam_profile->MFPEnabled &&
+ !(roam_profile->MFPRequired ||
+ roam_profile->MFPCapable)) {
+ hdd_err("Drop connect req as supplicant has indicated PMF required for the non-PMF peer. MFPEnabled %d MFPRequired %d MFPCapable %d",
+ roam_profile->MFPEnabled,
+ roam_profile->MFPRequired,
+ roam_profile->MFPCapable);
+ return -EINVAL;
+ }
+ return 0;
+}
+#else
+static inline
+int wlan_hdd_cfg80211_check_pmf_valid(tCsrRoamProfile *roam_profile)
+{
+ return 0;
+}
+#endif
+
/**
* wlan_hdd_cfg80211_connect_start() - to start the association process
* @pAdapter: Pointer to adapter
@@ -12565,18 +12597,9 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
hdd_select_cbmode(pAdapter, operatingChannel,
&pRoamProfile->ch_params);
}
- /*
- * if MFPEnabled is set but the peer AP is non-PMF i.e 80211w=2
- * or pmf=2 is an explicit configuration in the supplicant
- * configuration, drop the connection request.
- */
- if (pWextState->roamProfile.MFPEnabled &&
- !(pWextState->roamProfile.MFPRequired ||
- pWextState->roamProfile.MFPCapable)) {
- hdd_err("Drop connect req as supplicant has indicated PMF req for a non-PMF peer. MFPEnabled %d MFPRequired %d MFPCapable %d",
- pWextState->roamProfile.MFPEnabled,
- pWextState->roamProfile.MFPRequired,
- pWextState->roamProfile.MFPCapable);
+
+ if (wlan_hdd_cfg80211_check_pmf_valid(
+ &pWextState->roamProfile)) {
status = -EINVAL;
goto conn_failure;
}
diff --git a/core/mac/src/pe/lim/lim_p2p.c b/core/mac/src/pe/lim/lim_p2p.c
index 81ea2d81989f..fa44a88c4c44 100644
--- a/core/mac/src/pe/lim/lim_p2p.c
+++ b/core/mac/src/pe/lim/lim_p2p.c
@@ -506,6 +506,52 @@ static void lim_tx_action_frame(tpAniSirGlobal mac_ctx,
return;
}
+#ifdef WLAN_FEATURE_11W
+static void lim_check_rmf_and_set_protected(tpAniSirGlobal mac_ctx,
+ tSirMbMsgP2p *mb_msg, uint8_t *frame)
+{
+ uint8_t session_id = 0;
+ tpPESession session_entry;
+ tpSirMacMgmtHdr mac_hdr;
+ tpSirMacActionFrameHdr action_hdr;
+ tpSirMacFrameCtl fc = (tpSirMacFrameCtl) mb_msg->data;
+
+ action_hdr = (tpSirMacActionFrameHdr)
+ (frame + sizeof(tSirMacMgmtHdr));
+ mac_hdr = (tpSirMacMgmtHdr) frame;
+ session_entry = pe_find_session_by_bssid(mac_ctx,
+ (uint8_t *) mb_msg->data + BSSID_OFFSET,
+ &session_id);
+
+ /*
+ * Check for session corresponding to ADDR2 as supplicant
+ * is filling ADDR2 with BSSID
+ */
+ if (!session_entry) {
+ session_entry = pe_find_session_by_bssid(mac_ctx,
+ (uint8_t *) mb_msg->data + ADDR2_OFFSET,
+ &session_id);
+ }
+ /*
+ * Setting Protected bit only for Robust Action Frames
+ * This has to be based on the current Connection with the
+ * station. lim_set_protected_bit API will set the protected
+ * bit if connection is PMF
+ */
+ if (session_entry && (SIR_MAC_MGMT_ACTION == fc->subType) &&
+ session_entry->limRmfEnabled &&
+ (!lim_is_group_addr(mac_hdr->da)) &&
+ lim_is_robust_mgmt_action_frame(action_hdr->category))
+ lim_set_protected_bit(mac_ctx, session_entry,
+ mac_hdr->da, mac_hdr);
+}
+#else
+static inline void lim_check_rmf_and_set_protected(tpAniSirGlobal mac_ctx,
+ tSirMbMsgP2p *mb_msg, uint8_t *frame)
+{
+}
+#endif
+
/**
* lim_send_p2p_action_frame() - Process action frame request
* @mac_ctx: Pointer to mac context
@@ -528,17 +574,12 @@ void lim_send_p2p_action_frame(tpAniSirGlobal mac_ctx,
uint8_t noa_len = 0;
uint8_t noa_stream[SIR_MAX_NOA_ATTR_LEN + (2 * SIR_P2P_IE_HEADER_LEN)];
uint8_t orig_len = 0;
- uint8_t session_id = 0;
uint8_t *p2p_ie = NULL;
tpPESession session_entry = NULL;
uint8_t *presence_noa_attr = NULL;
uint8_t *tmp_p2p_ie = NULL;
uint16_t remain_len = 0;
uint8_t sme_session_id = 0;
-#ifdef WLAN_FEATURE_11W
- tpSirMacMgmtHdr mac_hdr;
- tpSirMacActionFrameHdr action_hdr;
-#endif
msg_len = mb_msg->msgLen - sizeof(tSirMbMsgP2p);
lim_log(mac_ctx, LOGD, FL("sending fc->type=%d fc->subType=%d"),
@@ -693,36 +734,7 @@ void lim_send_p2p_action_frame(tpAniSirGlobal mac_ctx,
qdf_mem_copy(frame, mb_msg->data, msg_len);
}
-#ifdef WLAN_FEATURE_11W
- action_hdr = (tpSirMacActionFrameHdr)
- (frame + sizeof(tSirMacMgmtHdr));
- mac_hdr = (tpSirMacMgmtHdr) frame;
- session_entry = pe_find_session_by_bssid(mac_ctx,
- (uint8_t *) mb_msg->data + BSSID_OFFSET,
- &session_id);
-
- /*
- * Check for session corresponding to ADDR2 as supplicant
- * is filling ADDR2 with BSSID
- */
- if (NULL == session_entry) {
- session_entry = pe_find_session_by_bssid(mac_ctx,
- (uint8_t *) mb_msg->data + ADDR2_OFFSET,
- &session_id);
- }
- /*
- * Setting Protected bit only for Robust Action Frames
- * This has to be based on the current Connection with the
- * station. lim_set_protected_bit API will set the protected
- * bit if connection is PMF
- */
- if (session_entry && (SIR_MAC_MGMT_ACTION == fc->subType) &&
- session_entry->limRmfEnabled &&
- (!lim_is_group_addr(mac_hdr->da)) &&
- lim_is_robust_mgmt_action_frame(action_hdr->category))
- lim_set_protected_bit(mac_ctx, session_entry,
- mac_hdr->da, mac_hdr);
-#endif
+ lim_check_rmf_and_set_protected(mac_ctx, mb_msg, frame);
lim_tx_action_frame(mac_ctx, mb_msg, msg_len, packet, frame);
return;
diff --git a/core/mac/src/pe/lim/lim_session.c b/core/mac/src/pe/lim/lim_session.c
index 53cb139dec10..106be6d18c78 100644
--- a/core/mac/src/pe/lim/lim_session.c
+++ b/core/mac/src/pe/lim/lim_session.c
@@ -248,6 +248,36 @@ static void pe_reset_protection_callback(void *ptr)
}
}
+#ifdef WLAN_FEATURE_11W
+/**
+ * pe_init_pmf_comeback_timer: init PMF comeback timer
+ * @mac_ctx: pointer to global adapter context
+ * @session: pe session
+ * @session_id: session ID
+ *
+ * Return: void
+ */
+static void pe_init_pmf_comeback_timer(tpAniSirGlobal mac_ctx,
+tpPESession session, uint8_t session_id)
+{
+ QDF_STATUS status;
+
+ session->pmfComebackTimerInfo.pMac = mac_ctx;
+ session->pmfComebackTimerInfo.sessionID = session_id;
+ status = qdf_mc_timer_init(&session->pmfComebackTimer,
+ QDF_TIMER_TYPE_SW, lim_pmf_comeback_timer_callback,
+ (void *)&session->pmfComebackTimerInfo);
+ if (!QDF_IS_STATUS_SUCCESS(status))
+ lim_log(mac_ctx, LOGE, FL("cannot init pmf comeback timer."));
+}
+#else
+static inline void
+pe_init_pmf_comeback_timer(tpAniSirGlobal mac_ctx,
+ tpPESession session, uint8_t session_id)
+{
+}
+#endif
+
/**
* pe_create_session() creates a new PE session given the BSSID
* @param pMac: pointer to global adapter context
@@ -401,14 +431,7 @@ pe_create_session(tpAniSirGlobal pMac, uint8_t *bssid, uint8_t *sessionId,
QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_ERROR,
FL("cannot create or start protectionFieldsResetTimer"));
}
-
- session_ptr->pmfComebackTimerInfo.pMac = pMac;
- session_ptr->pmfComebackTimerInfo.sessionID = *sessionId;
- status = qdf_mc_timer_init(&session_ptr->pmfComebackTimer,
- QDF_TIMER_TYPE_SW, lim_pmf_comeback_timer_callback,
- (void *)&session_ptr->pmfComebackTimerInfo);
- if (!QDF_IS_STATUS_SUCCESS(status))
- lim_log(pMac, LOGE, FL("cannot init pmf comeback timer."));
+ pe_init_pmf_comeback_timer(pMac, session_ptr, *sessionId);
return &pMac->lim.gpSession[i];
}
diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c
index ae9d7af0dbfb..ba2a46d0be81 100644
--- a/core/mac/src/pe/lim/lim_utils.c
+++ b/core/mac/src/pe/lim/lim_utils.c
@@ -546,6 +546,7 @@ tSirRetStatus lim_init_mlm(tpAniSirGlobal pMac)
return eSIR_SUCCESS;
} /*** end lim_init_mlm() ***/
+#ifdef WLAN_FEATURE_11W
/**
* lim_deactivate_del_sta() - This function deactivate/delete associates STA
* @mac_ctx: pointer to Global Mac Structure
@@ -577,6 +578,7 @@ static void lim_deactivate_del_sta(tpAniSirGlobal mac_ctx, uint32_t bss_entry,
tx_timer_delete(&sta_ds->pmfSaQueryTimer);
}
}
+#endif
/**
* lim_cleanup_mlm() - This function is called to cleanup
diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h
index 2d8e76481ca3..17a8bf3ad0b5 100644
--- a/core/sme/inc/csr_api.h
+++ b/core/sme/inc/csr_api.h
@@ -63,10 +63,8 @@ typedef enum {
#endif /* FEATURE_WLAN_WAPI */
eCSR_AUTH_TYPE_CCKM_WPA,
eCSR_AUTH_TYPE_CCKM_RSN,
-#ifdef WLAN_FEATURE_11W
eCSR_AUTH_TYPE_RSN_PSK_SHA256,
eCSR_AUTH_TYPE_RSN_8021X_SHA256,
-#endif
eCSR_NUM_OF_SUPPORT_AUTH_TYPE,
eCSR_AUTH_TYPE_FAILED = 0xff,
eCSR_AUTH_TYPE_UNKNOWN = eCSR_AUTH_TYPE_FAILED,
diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c
index 1487b6df30a9..33fb4903c6eb 100644
--- a/core/sme/src/csr/csr_api_roam.c
+++ b/core/sme/src/csr/csr_api_roam.c
@@ -13968,6 +13968,36 @@ static QDF_STATUS csr_set_ldpc_exception(tpAniSirGlobal mac_ctx,
return QDF_STATUS_SUCCESS;
}
+#ifdef WLAN_FEATURE_11W
+/**
+ * csr_set_mgmt_enc_type() - set mgmt enc type for PMF
+ * @profile: roam profile
+ * @ies: AP ie
+ * @csr_join_req: csr join req
+ *
+ * Return: void
+ */
+static void csr_set_mgmt_enc_type(tCsrRoamProfile *profile,
+ tDot11fBeaconIEs *ies, tSirSmeJoinReq *csr_join_req)
+{
+ if (profile->MFPEnabled)
+ csr_join_req->MgmtEncryptionType = eSIR_ED_AES_128_CMAC;
+ else
+ csr_join_req->MgmtEncryptionType = eSIR_ED_NONE;
+ if (profile->MFPEnabled &&
+ !(profile->MFPRequired) &&
+ ((ies->RSN.present) &&
+ (!(ies->RSN.RSN_Cap[0] >> 7) & 0x1)))
+ csr_join_req->MgmtEncryptionType = eSIR_ED_NONE;
+}
+#else
+static inline void csr_set_mgmt_enc_type(tCsrRoamProfile *profile,
+ tDot11fBeaconIEs *pIes, tSirSmeJoinReq *csr_join_req)
+{
+}
+#endif
+
+
/**
* The communication between HDD and LIM is thru mailbox (MB).
* Both sides will access the data structure "tSirSmeJoinReq".
@@ -14355,17 +14385,7 @@ QDF_STATUS csr_send_join_req_msg(tpAniSirGlobal pMac, uint32_t sessionId,
csr_join_req->MCEncryptionType =
csr_translate_encrypt_type_to_ed_type
(pProfile->negotiatedMCEncryptionType);
-#ifdef WLAN_FEATURE_11W
- if (pProfile->MFPEnabled)
- csr_join_req->MgmtEncryptionType = eSIR_ED_AES_128_CMAC;
- else
- csr_join_req->MgmtEncryptionType = eSIR_ED_NONE;
-#endif
- if (pProfile->MFPEnabled &&
- !(pProfile->MFPRequired) &&
- ((pIes->RSN.present) &&
- (!(pIes->RSN.RSN_Cap[0] >> 7) & 0x1)))
- csr_join_req->MgmtEncryptionType = eSIR_ED_NONE;
+ csr_set_mgmt_enc_type(pProfile, pIes, csr_join_req);
#ifdef FEATURE_WLAN_ESE
ese_config = pMac->roam.configParam.isEseIniFeatureEnabled;
#endif
diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c
index b3a96b0901be..905ff476250f 100644
--- a/core/wma/src/wma_dev_if.c
+++ b/core/wma/src/wma_dev_if.c
@@ -2980,6 +2980,33 @@ wma_vdev_set_bss_params(tp_wma_handle wma, int vdev_id,
wma_update_protection_mode(wma, vdev_id, llbCoexist);
}
+#ifdef WLAN_FEATURE_11W
+static void wma_set_mgmt_frame_protection(tp_wma_handle wma)
+{
+ struct pdev_params param = {0};
+ QDF_STATUS ret;
+
+ /*
+ * when 802.11w PMF is enabled for hw encr/decr
+ * use hw MFP Qos bits 0x10
+ */
+ param.param_id = WMI_PDEV_PARAM_PMF_QOS;
+ param.param_value = true;
+ ret = wmi_unified_pdev_param_send(wma->wmi_handle,
+ &param, WMA_WILDCARD_PDEV_ID);
+ if (QDF_IS_STATUS_ERROR(ret)) {
+ WMA_LOGE("%s: Failed to set QOS MFP/PMF (%d)",
+ __func__, ret);
+ } else {
+ WMA_LOGD("%s: QOS MFP/PMF set", __func__);
+ }
+}
+#else
+static inline void wma_set_mgmt_frame_protection(tp_wma_handle wma)
+{
+}
+#endif /* WLAN_FEATURE_11W */
+
/**
* wma_add_bss_ap_mode() - process add bss request in ap mode
* @wma: wma handle
@@ -2997,10 +3024,6 @@ static void wma_add_bss_ap_mode(tp_wma_handle wma, tpAddBssParams add_bss)
uint8_t vdev_id, peer_id;
QDF_STATUS status;
int8_t maxTxPower;
- struct pdev_params param = {0};
-#ifdef WLAN_FEATURE_11W
- QDF_STATUS ret;
-#endif /* WLAN_FEATURE_11W */
struct sir_hw_mode_params hw_mode = {0};
pdev = cds_get_context(QDF_MODULE_ID_TXRX);
@@ -3060,24 +3083,9 @@ static void wma_add_bss_ap_mode(tp_wma_handle wma, tpAddBssParams add_bss)
req.vht_capable = add_bss->vhtCapable;
req.max_txpow = add_bss->maxTxPower;
maxTxPower = add_bss->maxTxPower;
-#ifdef WLAN_FEATURE_11W
- if (add_bss->rmfEnabled) {
- /*
- * when 802.11w PMF is enabled for hw encr/decr
- * use hw MFP Qos bits 0x10
- */
- param.param_id = WMI_PDEV_PARAM_PMF_QOS;
- param.param_value = true;
- ret = wmi_unified_pdev_param_send(wma->wmi_handle,
- &param, WMA_WILDCARD_PDEV_ID);
- if (QDF_IS_STATUS_ERROR(ret)) {
- WMA_LOGE("%s: Failed to set QOS MFP/PMF (%d)",
- __func__, ret);
- } else {
- WMA_LOGD("%s: QOS MFP/PMF set to %d", __func__, true);
- }
- }
-#endif /* WLAN_FEATURE_11W */
+
+ if (add_bss->rmfEnabled)
+ wma_set_mgmt_frame_protection(wma);
req.beacon_intval = add_bss->beaconInterval;
req.dtim_period = add_bss->dtimPeriod;
@@ -3297,7 +3305,6 @@ static void wma_add_bss_sta_mode(tp_wma_handle wma, tpAddBssParams add_bss)
tpAniSirGlobal pMac = cds_get_context(QDF_MODULE_ID_PE);
struct sir_hw_mode_params hw_mode = {0};
bool peer_assoc_sent = false;
- struct pdev_params param = {0};
uint8_t vdev_id = add_bss->staContext.smesessionId;
if (NULL == pMac) {
@@ -3499,24 +3506,9 @@ static void wma_add_bss_sta_mode(tp_wma_handle wma, tpAddBssParams add_bss)
wma_send_peer_assoc(wma, add_bss->nwType,
&add_bss->staContext);
peer_assoc_sent = true;
-#ifdef WLAN_FEATURE_11W
- if (add_bss->rmfEnabled) {
- /* when 802.11w PMF is enabled for hw encr/decr
- use hw MFP Qos bits 0x10 */
- param.param_id = WMI_PDEV_PARAM_PMF_QOS;
- param.param_value = true;
- status = wmi_unified_pdev_param_send(wma->wmi_handle,
- &param,
- WMA_WILDCARD_PDEV_ID);
- if (QDF_IS_STATUS_ERROR(status)) {
- WMA_LOGE("%s: Failed to set QOS MFP/PMF (%d)",
- __func__, status);
- } else {
- WMA_LOGD("%s: QOS MFP/PMF set to %d",
- __func__, true);
- }
- }
-#endif /* WLAN_FEATURE_11W */
+
+ if (add_bss->rmfEnabled)
+ wma_set_mgmt_frame_protection(wma);
wma_vdev_set_bss_params(wma, add_bss->staContext.smesessionId,
add_bss->beaconInterval,
@@ -3641,7 +3633,6 @@ static void wma_add_sta_req_ap_mode(tp_wma_handle wma, tpAddStaParams add_sta)
struct wma_txrx_node *iface = NULL;
struct wma_target_req *msg;
bool peer_assoc_cnf = false;
- struct pdev_params param;
pdev = cds_get_context(QDF_MODULE_ID_TXRX);
@@ -3776,30 +3767,8 @@ static void wma_add_sta_req_ap_mode(tp_wma_handle wma, tpAddStaParams add_sta)
}
#endif
-#ifdef WLAN_FEATURE_11W
- if (add_sta->rmfEnabled) {
- /*
- * We have to store the state of PMF connection
- * per STA for SAP case
- * We will isolate the ifaces based on vdevid
- */
- iface->rmfEnabled = add_sta->rmfEnabled;
- /*
- * when 802.11w PMF is enabled for hw encr/decr
- * use hw MFP Qos bits 0x10
- */
- param.param_id = WMI_PDEV_PARAM_PMF_QOS;
- param.param_value = true;
- status = wmi_unified_pdev_param_send(wma->wmi_handle,
- &param, WMA_WILDCARD_PDEV_ID);
- if (QDF_IS_STATUS_ERROR(status)) {
- WMA_LOGE("%s: Failed to set QOS MFP/PMF (%d)",
- __func__, status);
- } else {
- WMA_LOGD("%s: QOS MFP/PMF set to %d", __func__, true);
- }
- }
-#endif /* WLAN_FEATURE_11W */
+ if (add_sta->rmfEnabled)
+ wma_set_mgmt_frame_protection(wma);
if (add_sta->uAPSD) {
status = wma_set_ap_peer_uapsd(wma, add_sta->smesessionId,
@@ -4011,7 +3980,6 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params)
struct wma_target_req *msg;
bool peer_assoc_cnf = false;
struct vdev_up_params param = {0};
- struct pdev_params pdev_param = {0};
int smps_param;
#ifdef FEATURE_WLAN_TDLS
@@ -4126,24 +4094,10 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params)
params->smesessionId, peer, false);
goto out;
}
-#ifdef WLAN_FEATURE_11W
- if (params->rmfEnabled) {
- /* when 802.11w PMF is enabled for hw encr/decr
- use hw MFP Qos bits 0x10 */
- pdev_param.param_id = WMI_PDEV_PARAM_PMF_QOS;
- pdev_param.param_value = true;
- status = wmi_unified_pdev_param_send(wma->wmi_handle,
- &pdev_param,
- WMA_WILDCARD_PDEV_ID);
- if (QDF_IS_STATUS_ERROR(status)) {
- WMA_LOGE("%s: Failed to set QOS MFP/PMF (%d)",
- __func__, status);
- } else {
- WMA_LOGD("%s: QOS MFP/PMF set to %d",
- __func__, true);
- }
- }
-#endif /* WLAN_FEATURE_11W */
+
+ if (params->rmfEnabled)
+ wma_set_mgmt_frame_protection(wma);
+
/*
* Set the PTK in 11r mode because we already have it.
*/
diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c
index 5db8c54b09ba..a9a1522733c9 100644
--- a/core/wma/src/wma_mgmt.c
+++ b/core/wma/src/wma_mgmt.c
@@ -3177,6 +3177,16 @@ int wma_process_rmf_frame(tp_wma_handle wma_handle,
}
return 0;
}
+#else
+static inline int wma_process_rmf_frame(tp_wma_handle wma_handle,
+ struct wma_txrx_node *iface,
+ struct ieee80211_frame *wh,
+ cds_pkt_t *rx_pkt,
+ qdf_nbuf_t wbuf)
+{
+ return 0;
+}
+
#endif
/**
@@ -3285,12 +3295,12 @@ static int wma_mgmt_rx_process(void *handle, uint8_t *data,
tp_wma_handle wma_handle = (tp_wma_handle) handle;
WMI_MGMT_RX_EVENTID_param_tlvs *param_tlvs = NULL;
wmi_mgmt_rx_hdr *hdr = NULL;
- struct wma_txrx_node *iface = NULL;
uint8_t vdev_id = WMA_INVALID_VDEV_ID;
cds_pkt_t *rx_pkt;
qdf_nbuf_t wbuf;
struct ieee80211_frame *wh;
uint8_t mgt_type, mgt_subtype;
+ struct wma_txrx_node *iface = NULL;
int status;
tp_wma_packetdump_cb packetdump_cb;
@@ -3426,7 +3436,6 @@ static int wma_mgmt_rx_process(void *handle, uint8_t *data,
mgt_type = (wh)->i_fc[0] & IEEE80211_FC0_TYPE_MASK;
mgt_subtype = (wh)->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK;
-#ifdef WLAN_FEATURE_11W
if (mgt_type == IEEE80211_FC0_TYPE_MGT &&
(mgt_subtype == IEEE80211_FC0_SUBTYPE_DISASSOC ||
mgt_subtype == IEEE80211_FC0_SUBTYPE_DEAUTH ||
@@ -3448,7 +3457,7 @@ static int wma_mgmt_rx_process(void *handle, uint8_t *data,
}
}
}
-#endif /* WLAN_FEATURE_11W */
+
rx_pkt->pkt_meta.sessionId =
(vdev_id == WMA_INVALID_VDEV_ID ? 0 : vdev_id);