From 2fc57e4e2b347acf238813f2fc47ea028cc37d1a Mon Sep 17 00:00:00 2001 From: Srikanth Marepalli Date: Wed, 1 Nov 2023 12:50:04 +0530 Subject: [PATCH] qcacld-3.0: Add support for security scoring Add support for security score. On the basis of score, host will select AP for initial connection and roaming. Change-Id: I041a1b0c1456d7f01dd07e9b282996c56755655e CRs-Fixed: 3782215 --- .../dispatcher/inc/wlan_cm_roam_public_struct.h | 12 +++++++++++- components/wmi/src/wmi_unified_roam_tlv.c | 16 +++++++++++----- core/sme/src/csr/csr_api_roam.c | 4 ++++ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h index 05b4dfc2ec31..2035b9a2e495 100644 --- a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h +++ b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -261,6 +261,14 @@ struct ap_profile { * @rssi_scoring: RSSI scoring information. * @esp_qbss_scoring: ESP/QBSS scoring percentage information * @oce_wan_scoring: OCE WAN metrics percentage information + * @security_weightage: Security(WPA/WPA2/WPA3) weightage out of + * total score in % + * @security_index_score: Security scoring percentage information. + * BITS 0-7 :- It contains scoring percentage of WPA security + * BITS 8-15 :- It contains scoring percentage of WPA2 security + * BITS 16-23 :- It contains scoring percentage of WPA3 security + * BITS 24-31 :- reserved + * The value of each index must be 0-100 */ struct scoring_param { uint32_t disable_bitmap; @@ -288,6 +296,8 @@ struct scoring_param { struct rssi_config_score rssi_scoring; struct per_slot_score esp_qbss_scoring; struct per_slot_score oce_wan_scoring; + int32_t security_weightage; + uint32_t security_index_score; }; /** diff --git a/components/wmi/src/wmi_unified_roam_tlv.c b/components/wmi/src/wmi_unified_roam_tlv.c index 0c6e35797f17..29bf1c2ccf48 100644 --- a/components/wmi/src/wmi_unified_roam_tlv.c +++ b/components/wmi/src/wmi_unified_roam_tlv.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved. - * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -2564,6 +2564,8 @@ send_roam_scan_offload_ap_profile_cmd_tlv(wmi_unified_t wmi_handle, score_param->bw_weightage_pcnt = ap_profile->param.bw_weightage; score_param->band_weightage_pcnt = ap_profile->param.band_weightage; score_param->nss_weightage_pcnt = ap_profile->param.nss_weightage; + score_param->security_weightage_pcnt = + ap_profile->param.security_weightage; score_param->esp_qbss_weightage_pcnt = ap_profile->param.esp_qbss_weightage; score_param->beamforming_weightage_pcnt = @@ -2580,7 +2582,7 @@ send_roam_scan_offload_ap_profile_cmd_tlv(wmi_unified_t wmi_handle, score_param->sae_pk_ap_weightage_pcnt = ap_profile->param.sae_pk_ap_weightage; - wmi_debug("Score params weightage: disable_bitmap %x rssi %d ht %d vht %d he %d BW %d band %d NSS %d ESP %d BF %d PCL %d OCE WAN %d APTX %d roam score algo %d subnet id %d sae-pk %d", + wmi_debug("Score params weightage: disable_bitmap %x rssi %d ht %d vht %d he %d BW %d band %d NSS %d ESP %d BF %d PCL %d OCE WAN %d APTX %d roam score algo %d subnet id %d sae-pk %d security %d", score_param->disable_bitmap, score_param->rssi_weightage_pcnt, score_param->ht_weightage_pcnt, score_param->vht_weightage_pcnt, @@ -2594,18 +2596,22 @@ send_roam_scan_offload_ap_profile_cmd_tlv(wmi_unified_t wmi_handle, score_param->oce_ap_tx_pwr_weightage_pcnt, score_param->vendor_roam_score_algorithm_id, score_param->oce_ap_subnet_id_weightage_pcnt, - score_param->sae_pk_ap_weightage_pcnt); + score_param->sae_pk_ap_weightage_pcnt, + score_param->security_weightage_pcnt); score_param->bw_scoring.score_pcnt = ap_profile->param.bw_index_score; score_param->band_scoring.score_pcnt = ap_profile->param.band_index_score; score_param->nss_scoring.score_pcnt = ap_profile->param.nss_index_score; + score_param->security_scoring.score_pcnt = + ap_profile->param.security_index_score; - wmi_debug("bw_index_score %x band_index_score %x nss_index_score %x", + wmi_debug("bw_index_score %x band_index_score %x nss_index_score %x security_index_score %x", score_param->bw_scoring.score_pcnt, score_param->band_scoring.score_pcnt, - score_param->nss_scoring.score_pcnt); + score_param->nss_scoring.score_pcnt, + score_param->security_scoring.score_pcnt); score_param->rssi_scoring.best_rssi_threshold = (-1) * ap_profile->param.rssi_scoring.best_rssi_threshold; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 02d4ab9c28d5..30ae3af59a1c 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -17569,6 +17569,8 @@ static void csr_update_score_params(struct mac_context *mac_ctx, req_score_params->bw_weightage = weight_config->chan_width_weightage; req_score_params->band_weightage = weight_config->chan_band_weightage; req_score_params->nss_weightage = weight_config->nss_weightage; + req_score_params->security_weightage = + weight_config->security_weightage; req_score_params->esp_qbss_weightage = weight_config->channel_congestion_weightage; req_score_params->beamforming_weightage = @@ -17590,6 +17592,8 @@ static void csr_update_score_params(struct mac_context *mac_ctx, req_score_params->nss_index_score = score_config->nss_weight_per_index; + req_score_params->security_index_score = + score_config->security_weight_per_index; req_score_params->vendor_roam_score_algorithm = score_config->vendor_roam_score_algorithm;