qcacld-3.0: Fill the pmf info for TDLS peer

Fill the pfm info of the TDLS peer before sending the peer assoc
command to FW.

Change-Id: I4e336c345c0fb8f063157b3e3a780efa777f1a74
CRs-Fixed: 2535832
This commit is contained in:
Bala Venkatesh
2019-10-18 16:05:03 +05:30
committed by nshrivas
parent 0c91350afc
commit ce98442c2a
9 changed files with 47 additions and 52 deletions

View File

@@ -307,6 +307,7 @@ static QDF_STATUS tdls_pe_update_peer(struct tdls_update_peer_request *req)
&update_peer->vht_cap,
sizeof(update_peer->vht_cap));
addstareq->supported_rates_length = update_peer->supported_rates_len;
addstareq->is_pmf = update_peer->is_pmf;
qdf_mem_copy(&addstareq->supported_rates,
update_peer->supported_rates,
update_peer->supported_rates_len);

View File

@@ -769,6 +769,7 @@ struct tdls_update_peer_params {
uint8_t supported_oper_classes_len;
uint8_t supported_oper_classes[WLAN_MAX_SUPP_OPER_CLASSES];
bool is_qos_wmm_sta;
bool is_pmf;
};
struct tdls_update_peer_request {
@@ -1302,6 +1303,7 @@ struct tdls_add_sta_req {
struct vhtcap vht_cap;
uint8_t uapsd_queues;
uint8_t max_sp;
bool is_pmf;
};
/**

View File

@@ -636,9 +636,7 @@ static bool is_mgmt_protected(uint32_t vdev_id,
return false;
}
if (LIM_IS_AP_ROLE(session)) {
sta_ds = dph_lookup_hash_entry(mac_ctx,
(uint8_t *)peer_mac_addr, &aid,
sta_ds = dph_lookup_hash_entry(mac_ctx, (uint8_t *)peer_mac_addr, &aid,
&session->dph.dphHashTable);
if (sta_ds) {
/* rmfenabled will be set at the time of addbss.
@@ -651,10 +649,6 @@ static bool is_mgmt_protected(uint32_t vdev_id,
if (sta_ds->rmfEnabled && sta_ds->is_key_installed)
protected = true;
}
} else if (session->limRmfEnabled &&
session->is_key_installed) {
protected = true;
}
return protected;
}

View File

@@ -1591,21 +1591,17 @@ lim_drop_unprotected_action_frame(struct mac_context *mac, struct pe_session *pe
tpDphHashNode sta;
bool rmfConnection = false;
if (LIM_IS_AP_ROLE(pe_session)) {
sta =
dph_lookup_hash_entry(mac, pHdr->sa, &aid,
sta = dph_lookup_hash_entry(mac, pHdr->sa, &aid,
&pe_session->dph.dphHashTable);
if (sta)
if (sta->rmfEnabled)
rmfConnection = true;
} else if (pe_session->limRmfEnabled)
if (sta && sta->rmfEnabled)
rmfConnection = true;
if (rmfConnection && (pHdr->fc.wep == 0)) {
pe_err("Dropping unprotected Action category: %d frame since RMF is enabled",
category);
return true;
} else
}
return false;
}
#endif

View File

@@ -1171,14 +1171,12 @@ void lim_process_mlm_set_keys_cnf(struct mac_context *mac, uint32_t *msg_buf)
if (eSIR_SME_SUCCESS == pMlmSetKeysCnf->resultCode) {
if (pMlmSetKeysCnf->key_len_nonzero)
pe_session->is_key_installed = 1;
if (LIM_IS_AP_ROLE(pe_session)) {
sta_ds = dph_lookup_hash_entry(mac,
pMlmSetKeysCnf->peer_macaddr.bytes,
&aid, &pe_session->dph.dphHashTable);
if (sta_ds && pMlmSetKeysCnf->key_len_nonzero)
sta_ds->is_key_installed = 1;
}
}
pe_debug("is_key_installed = %d", pe_session->is_key_installed);
lim_send_sme_set_context_rsp(mac,

View File

@@ -2431,6 +2431,7 @@ static void lim_tdls_update_hash_node_info(struct mac_context *mac,
} else if (add_sta_req->tdls_oper == TDLS_OPER_UPDATE) {
lim_tdls_populate_dot11f_ht_caps(mac, NULL,
add_sta_req, &htCap);
sta->rmfEnabled = add_sta_req->is_pmf;
}
htCaps = &htCap;
if (htCaps->present) {

View File

@@ -5293,8 +5293,6 @@ lim_set_protected_bit(struct mac_context *mac,
uint16_t aid;
tpDphHashNode sta;
if (LIM_IS_AP_ROLE(pe_session)) {
sta = dph_lookup_hash_entry(mac, peer, &aid,
&pe_session->dph.dphHashTable);
if (sta) {
@@ -5308,10 +5306,6 @@ lim_set_protected_bit(struct mac_context *mac,
if (sta->rmfEnabled && sta->is_key_installed)
pMacHdr->fc.wep = 1;
}
} else if (pe_session->limRmfEnabled &&
pe_session->is_key_installed) {
pMacHdr->fc.wep = 1;
}
} /*** end lim_set_protected_bit() ***/
#endif

View File

@@ -4242,6 +4242,8 @@ static void wma_add_tdls_sta(tp_wma_handle wma, tpAddStaParams add_sta)
WMA_LOGD("%s: changeSta, calling wma_send_peer_assoc",
__func__);
if (add_sta->rmfEnabled)
wma_set_peer_pmf_status(wma, add_sta->staMac, true);
ret =
wma_send_peer_assoc(wma, add_sta->nwType, add_sta);
@@ -4445,6 +4447,7 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params)
params->supportedRates.supportedMCSSet,
SIR_MAC_MAX_SUPPORTED_MCS_SET);
ret = wma_send_peer_assoc(wma,
iface->nwType,
(tAddStaParams *) iface->addBssStaContext);
@@ -4455,8 +4458,10 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params)
goto out;
}
if (params->rmfEnabled)
if (params->rmfEnabled) {
wma_set_mgmt_frame_protection(wma);
wma_set_peer_pmf_status(wma, params->bssId, true);
}
/*
* Set the PTK in 11r mode because we already have it.

View File

@@ -418,6 +418,10 @@ wlan_cfg80211_tdls_extract_params(struct tdls_update_peer_params *req_info,
if (params->ht_capa || params->vht_capa ||
(params->sta_flags_set & BIT(NL80211_STA_FLAG_WME)))
req_info->is_qos_wmm_sta = true;
if (params->sta_flags_set & BIT(NL80211_STA_FLAG_MFP)) {
osif_debug("TDLS peer pmf capable");
req_info->is_pmf = 1;
}
}
int wlan_cfg80211_tdls_update_peer(struct wlan_objmgr_vdev *vdev,