qcacld-3.0: Update scan result APIs to map MDID in PMK cache

PMK stale entry will be updated in driver by framework after
disconnection with AP. Since there is no connected profile
in driver no MDID is associated. On new PMKSA addition in
driver it will check for cached entry based on MDID and
remove older one. This commit associates MDID to the cache
entry from the scan result if no connected profile is
present.

Change-Id: I9e8362387a53f622b9c52c4ba994939cabf244aa
CRs-Fixed: 3030376
This commit is contained in:
Sai Pavan Akhil Remella
2021-09-20 17:03:32 +05:30
committed by Madan Koyyalamudi
parent 70f7e5b8db
commit 41300fcf7c
4 changed files with 41 additions and 25 deletions

View File

@@ -630,7 +630,7 @@ QDF_STATUS sme_roam_set_psk_pmk(mac_handle_t mac_handle,
* *
* Return: QDF_STATUS -status whether MDID is set or not * Return: QDF_STATUS -status whether MDID is set or not
*/ */
QDF_STATUS sme_set_pmk_cache_ft(mac_handle_t mac_handle, uint8_t session_id, QDF_STATUS sme_set_pmk_cache_ft(mac_handle_t mac_handle, uint8_t vdev_id,
struct wlan_crypto_pmksa *pmk_cache); struct wlan_crypto_pmksa *pmk_cache);
#else #else
static inline static inline
@@ -661,7 +661,7 @@ QDF_STATUS sme_roam_set_psk_pmk(mac_handle_t mac_handle,
} }
static inline static inline
QDF_STATUS sme_set_pmk_cache_ft(mac_handle_t mac_handle, uint8_t session_id, QDF_STATUS sme_set_pmk_cache_ft(mac_handle_t mac_handle, uint8_t vdev_id,
struct wlan_crypto_pmksa *pmk_cache) struct wlan_crypto_pmksa *pmk_cache)
{ {
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;

View File

@@ -3468,7 +3468,7 @@ QDF_STATUS sme_roam_set_psk_pmk(mac_handle_t mac_handle,
return status; return status;
} }
QDF_STATUS sme_set_pmk_cache_ft(mac_handle_t mac_handle, uint8_t session_id, QDF_STATUS sme_set_pmk_cache_ft(mac_handle_t mac_handle, uint8_t vdev_id,
struct wlan_crypto_pmksa *pmk_cache) struct wlan_crypto_pmksa *pmk_cache)
{ {
QDF_STATUS status = QDF_STATUS_E_FAILURE; QDF_STATUS status = QDF_STATUS_E_FAILURE;
@@ -3476,7 +3476,7 @@ QDF_STATUS sme_set_pmk_cache_ft(mac_handle_t mac_handle, uint8_t session_id,
status = sme_acquire_global_lock(&mac->sme); status = sme_acquire_global_lock(&mac->sme);
if (QDF_IS_STATUS_SUCCESS(status)) { if (QDF_IS_STATUS_SUCCESS(status)) {
status = csr_set_pmk_cache_ft(mac, session_id, pmk_cache); status = csr_set_pmk_cache_ft(mac, vdev_id, pmk_cache);
sme_release_global_lock(&mac->sme); sme_release_global_lock(&mac->sme);
} }
return status; return status;

View File

@@ -5669,18 +5669,18 @@ QDF_STATUS csr_roam_set_psk_pmk(struct mac_context *mac,
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
QDF_STATUS csr_set_pmk_cache_ft(struct mac_context *mac, uint32_t session_id, QDF_STATUS csr_set_pmk_cache_ft(struct mac_context *mac, uint8_t vdev_id,
struct wlan_crypto_pmksa *pmk_cache) struct wlan_crypto_pmksa *pmk_cache)
{ {
struct wlan_objmgr_vdev *vdev; struct wlan_objmgr_vdev *vdev;
int32_t akm; int32_t akm;
if (!CSR_IS_SESSION_VALID(mac, session_id)) { if (!CSR_IS_SESSION_VALID(mac, vdev_id)) {
sme_err("session %d not found", session_id); sme_err("session %d not found", vdev_id);
return QDF_STATUS_E_INVAL; return QDF_STATUS_E_INVAL;
} }
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac->psoc, session_id, vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac->psoc, vdev_id,
WLAN_LEGACY_SME_ID); WLAN_LEGACY_SME_ID);
if (!vdev) { if (!vdev) {
sme_err("vdev is NULL"); sme_err("vdev is NULL");
@@ -5701,31 +5701,47 @@ QDF_STATUS csr_set_pmk_cache_ft(struct mac_context *mac, uint32_t session_id,
QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FILS_SHA384) || QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FILS_SHA384) ||
QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_IEEE8021X_SHA384)) { QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_IEEE8021X_SHA384)) {
sme_debug("Auth type: %x update the MDID in cache", akm); sme_debug("Auth type: %x update the MDID in cache", akm);
cm_update_pmk_cache_ft(mac->psoc, session_id); cm_update_pmk_cache_ft(mac->psoc, vdev_id);
} else { } else {
struct cm_roam_values_copy src_cfg; struct cm_roam_values_copy src_cfg;
QDF_STATUS status = QDF_STATUS_E_FAILURE; struct scan_filter *scan_filter;
tCsrScanResultInfo *scan_res; qdf_list_t *list = NULL;
struct scan_cache_node *first_node = NULL;
struct rsn_mdie *mdie = NULL;
qdf_list_node_t *cur_node = NULL;
scan_res = qdf_mem_malloc(sizeof(tCsrScanResultInfo)); scan_filter = qdf_mem_malloc(sizeof(*scan_filter));
if (!scan_res) if (!scan_filter)
return QDF_STATUS_E_NOMEM; return QDF_STATUS_E_NOMEM;
scan_filter->num_of_bssid = 1;
status = csr_scan_get_result_for_bssid(mac, &pmk_cache->bssid, qdf_mem_copy(scan_filter->bssid_list[0].bytes,
scan_res); &pmk_cache->bssid, sizeof(struct qdf_mac_addr));
if (QDF_IS_STATUS_SUCCESS(status) && list = wlan_scan_get_result(mac->pdev, scan_filter);
scan_res->BssDescriptor.mdiePresent) { qdf_mem_free(scan_filter);
if (!list || (list && !qdf_list_size(list))) {
sme_debug("Scan list is empty");
goto err;
}
qdf_list_peek_front(list, &cur_node);
first_node = qdf_container_of(cur_node,
struct scan_cache_node,
node);
if (first_node && first_node->entry)
mdie = (struct rsn_mdie *)
util_scan_entry_mdie(first_node->entry);
if (mdie) {
sme_debug("Update MDID in cache from scan_res"); sme_debug("Update MDID in cache from scan_res");
src_cfg.bool_value = true; src_cfg.bool_value = true;
src_cfg.uint_value = src_cfg.uint_value =
(scan_res->BssDescriptor.mdie[0] | (mdie->mobility_domain[0] |
(scan_res->BssDescriptor.mdie[1] << 8)); (mdie->mobility_domain[1] << 8));
wlan_cm_roam_cfg_set_value(mac->psoc, session_id, wlan_cm_roam_cfg_set_value(mac->psoc, vdev_id,
MOBILITY_DOMAIN, &src_cfg); MOBILITY_DOMAIN, &src_cfg);
cm_update_pmk_cache_ft(mac->psoc, session_id); cm_update_pmk_cache_ft(mac->psoc, vdev_id);
} }
qdf_mem_free(scan_res); err:
scan_res = NULL; if (list)
wlan_scan_purge_results(list);
} }
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }

View File

@@ -404,7 +404,7 @@ QDF_STATUS csr_roam_set_psk_pmk(struct mac_context *mac,
* *
* Return QDF_STATUS - usually it succeed unless session_id is not found * Return QDF_STATUS - usually it succeed unless session_id is not found
*/ */
QDF_STATUS csr_set_pmk_cache_ft(struct mac_context *mac, uint32_t session_id, QDF_STATUS csr_set_pmk_cache_ft(struct mac_context *mac, uint8_t vdev_id,
struct wlan_crypto_pmksa *pmk_cache); struct wlan_crypto_pmksa *pmk_cache);
#endif #endif