From 07e3dc73abd7d3ee801685d10382216224157616 Mon Sep 17 00:00:00 2001 From: Amruta Kulkarni Date: Tue, 27 Jul 2021 17:09:09 -0700 Subject: [PATCH] qcacld-3.0: Wmi changes for mlo roaming -Extract new wmi struct added as part of MLO roaming changes. - Send EHT and MLO weightage percentage to FW via WMI_ROAM_AP_PROFILE. Change-Id: I6b3f1f62ef6ea323cd1b75f63a5c63c38b000f1f CRs-Fixed: 3010039 --- .../core/src/wlan_cm_roam_offload.c | 20 +++++ .../inc/wlan_cm_roam_public_struct.h | 45 +++++++++++ components/wmi/src/wmi_unified_roam_tlv.c | 75 ++++++++++++++++++- 3 files changed, 138 insertions(+), 2 deletions(-) diff --git a/components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c b/components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c index 05cde46034..db3aa1948f 100644 --- a/components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c +++ b/components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c @@ -910,6 +910,24 @@ cm_roam_fill_11w_params(struct wlan_objmgr_vdev *vdev, } } +#ifdef WLAN_FEATURE_11BE_MLO +static void +cm_update_mlo_score_params(struct scoring_param *req_score_params, + struct weight_cfg *weight_config) +{ + req_score_params->eht_caps_weightage = + weight_config->eht_caps_weightage; + req_score_params->mlo_weightage = + weight_config->mlo_weightage; +} +#else +static void +cm_update_mlo_score_params(struct scoring_param *req_score_params, + struct weight_cfg *weight_config) +{ +} +#endif + static void cm_update_score_params(struct wlan_objmgr_psoc *psoc, struct wlan_mlme_psoc_ext_obj *mlme_obj, struct scoring_param *req_score_params, @@ -962,6 +980,8 @@ static void cm_update_score_params(struct wlan_objmgr_psoc *psoc, req_score_params->sae_pk_ap_weightage = weight_config->sae_pk_ap_weightage; + cm_update_mlo_score_params(req_score_params, weight_config); + /* TODO: update scoring params corresponding to ML scoring */ req_score_params->bw_index_score = score_config->bandwidth_weight_per_index[0]; 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 3622541e38..dea95f7d26 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 @@ -649,6 +649,8 @@ struct ap_profile { * @rssi_scoring: RSSI scoring information. * @esp_qbss_scoring: ESP/QBSS scoring percentage information * @oce_wan_scoring: OCE WAN metrics percentage information + * @eht_caps_weightage: EHT caps weightage out of total score in % + * @mlo_weightage: MLO weightage out of total score in % */ struct scoring_param { uint32_t disable_bitmap; @@ -676,6 +678,10 @@ struct scoring_param { struct rssi_config_score rssi_scoring; struct per_slot_score esp_qbss_scoring; struct per_slot_score oce_wan_scoring; +#ifdef WLAN_FEATURE_11BE_MLO + uint8_t eht_caps_weightage; + uint8_t mlo_weightage; +#endif }; /** @@ -1991,6 +1997,8 @@ struct cm_roam_values_copy { /* This should not be greater than MAX_NUMBER_OF_CONC_CONNECTIONS */ #define MAX_VDEV_SUPPORTED 4 +#define MAX_PN_LEN 8 +#define MAX_KEY_LEN 32 /** * struct cm_ho_fail_ind - ho fail indication to CM @@ -2038,6 +2046,37 @@ struct roam_pmkid_req_event { struct qdf_mac_addr ap_bssid[]; }; +/* + * struct ml_setup_link_param - MLO setup link param + * @vdev_id: vdev id of the link + * @link_id: link id of the link + * @channel: wmi channel + * @flags: link flags + */ +struct ml_setup_link_param { + uint32_t vdev_id; + uint32_t link_id; + wmi_channel channel; + uint32_t flags; +}; + +/* + * struct ml_key_material_param - MLO key material param + * @link_id: key is for which link, when link_id is 0xf, + * means the key is used for all links, like PTK + * @key_idx: key idx + * @key_cipher: key cipher + * @pn: pn + * @key_buff: key buffer + */ +struct ml_key_material_param { + uint32_t link_id; + uint32_t key_idx; + uint32_t key_cipher; + uint8_t pn[MAX_PN_LEN]; + uint8_t key_buff[MAX_KEY_LEN]; +}; + struct roam_offload_synch_ind { uint16_t beaconProbeRespOffset; uint16_t beaconProbeRespLength; @@ -2082,6 +2121,12 @@ struct roam_offload_synch_ind { bool is_ft_im_roam; enum wlan_phymode phy_mode; /*phy mode sent by fw */ wmi_channel chan; +#ifdef WLAN_FEATURE_11BE_MLO + uint8_t num_setup_links; + struct ml_setup_link_param ml_link[WLAN_UMAC_MLO_MAX_VDEVS]; + uint8_t num_ml_key_material; + struct ml_key_material_param ml_key[WLAN_UMAC_MLO_MAX_VDEVS]; +#endif }; /** diff --git a/components/wmi/src/wmi_unified_roam_tlv.c b/components/wmi/src/wmi_unified_roam_tlv.c index debe8db924..5802042881 100644 --- a/components/wmi/src/wmi_unified_roam_tlv.c +++ b/components/wmi/src/wmi_unified_roam_tlv.c @@ -1845,6 +1845,50 @@ wmi_fill_data_synch_event(struct roam_offload_synch_ind *roam_sync_ind, roam_sync_ind->reassoc_req_length); } +#ifdef WLAN_FEATURE_11BE_MLO +static void +wmi_fill_roam_mlo_info(WMI_ROAM_SYNCH_EVENTID_param_tlvs *param_buf, + struct roam_offload_synch_ind *roam_sync_ind) +{ + uint8_t i; + wmi_roam_ml_setup_links_param *setup_links; + wmi_roam_ml_key_material_param *ml_key_param; + + if (param_buf->num_setup_links_param) { + roam_sync_ind->num_setup_links = param_buf->num_setup_links_param; + setup_links = param_buf->setup_links_param; + + for (i = 0; i < roam_sync_ind->num_setup_links; i++) { + roam_sync_ind->ml_link[i].link_id = setup_links->link_id; + roam_sync_ind->ml_link[i].vdev_id = setup_links->vdev_id; + roam_sync_ind->ml_link[i].channel = setup_links->channel; + roam_sync_ind->ml_link[i].flags = setup_links->flags; + setup_links += sizeof(wmi_roam_ml_setup_links_param); + } + } + if (param_buf->num_ml_key_material) { + roam_sync_ind->num_ml_key_material = param_buf->num_ml_key_material; + ml_key_param = param_buf->ml_key_material; + + for (i = 0; i < roam_sync_ind->num_ml_key_material; i++) { + roam_sync_ind->ml_key[i].link_id = ml_key_param->link_id; + roam_sync_ind->ml_key[i].key_idx = ml_key_param->key_ix; + roam_sync_ind->ml_key[i].key_cipher = ml_key_param->key_cipher; + qdf_mem_copy(roam_sync_ind->ml_key[i].pn, + ml_key_param->pn, WMI_MAX_PN_LEN); + qdf_mem_copy(roam_sync_ind->ml_key[i].key_buff, + ml_key_param->key_buff, WMI_MAX_KEY_LEN); + ml_key_param += sizeof(wmi_roam_ml_key_material_param); + } + } +} +#else +static void wmi_fill_roam_mlo_info(WMI_ROAM_SYNCH_EVENTID_param_tlvs *param_buf, + struct roam_offload_synch_ind *roam_sync_ind) +{ +} +#endif + static QDF_STATUS wmi_fill_roam_sync_buffer(struct wlan_objmgr_vdev *vdev, struct rso_config *rso_cfg, @@ -1860,7 +1904,11 @@ wmi_fill_roam_sync_buffer(struct wlan_objmgr_vdev *vdev, QDF_STATUS status = QDF_STATUS_E_FAILURE; uint8_t kck_len; uint8_t kek_len; - +#ifdef WLAN_FEATURE_11BE_MLO + uint8_t i; + wmi_roam_ml_setup_links_param *setup_links; + wmi_roam_ml_key_material_param *ml_key_param; +#endif synch_event = param_buf->fixed_param; roam_sync_ind->roamed_vdev_id = synch_event->vdev_id; roam_sync_ind->auth_status = synch_event->auth_status; @@ -2008,6 +2056,8 @@ wmi_fill_roam_sync_buffer(struct wlan_objmgr_vdev *vdev, qdf_mem_copy(roam_sync_ind->pmkid, pmk_cache_info->pmkid, PMKID_LEN); } + + wmi_fill_roam_mlo_info(param_buf, roam_sync_ind); wlan_cm_free_roam_synch_frame_ind(rso_cfg); return QDF_STATUS_SUCCESS; } @@ -3772,6 +3822,27 @@ send_roam_scan_mode_cmd: return status; } +#ifdef WLAN_FEATURE_11BE_MLO +static void +send_update_mlo_roam_params(wmi_roam_cnd_scoring_param *score_param, + struct ap_profile_params *ap_profile) +{ + score_param->eht_weightage_pcnt = + ap_profile->param.eht_caps_weightage; + score_param->mlo_weightage_pcnt = + ap_profile->param.mlo_weightage; + wmi_debug("11be score params weightage: EHT %d MLO %d", + score_param->eht_weightage_pcnt, + score_param->mlo_weightage_pcnt); +} +#else +static void +send_update_mlo_roam_params(wmi_roam_cnd_scoring_param *score_param, + struct ap_profile_params *ap_profile) +{ +} +#endif + /** * send_roam_scan_offload_ap_profile_cmd_tlv() - set roam ap profile in fw * @wmi_handle: wmi handle @@ -3877,7 +3948,7 @@ send_roam_scan_offload_ap_profile_cmd_tlv(wmi_unified_t wmi_handle, ap_profile->param.vendor_roam_score_algorithm; score_param->sae_pk_ap_weightage_pcnt = ap_profile->param.sae_pk_ap_weightage; - + send_update_mlo_roam_params(score_param, ap_profile); 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", score_param->disable_bitmap, score_param->rssi_weightage_pcnt, score_param->ht_weightage_pcnt,