diff options
| author | CNSS_WLAN Service <cnssbldsw@qualcomm.com> | 2017-09-20 23:29:23 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-09-20 23:29:23 -0700 |
| commit | 339cfc36d5912776f3a44ede30a025c0a48d7681 (patch) | |
| tree | 959c514c821153936123ab7583a115576b767379 | |
| parent | 3f46b97e37783088a151c4169576fd8aa67d0020 (diff) | |
| parent | fb1bffdae222e996debc1d4728845550b89d12a4 (diff) | |
Merge "qcacmn: WMI changes to send BSS scoring params from INI to firmware" into wlan-cmn.driver.lnx.1.0
| -rw-r--r-- | wmi/inc/wmi_unified_api.h | 3 | ||||
| -rw-r--r-- | wmi/inc/wmi_unified_param.h | 160 | ||||
| -rw-r--r-- | wmi/inc/wmi_unified_priv.h | 3 | ||||
| -rw-r--r-- | wmi/inc/wmi_unified_tlv.h | 3 | ||||
| -rw-r--r-- | wmi/src/wmi_unified_api.c | 10 | ||||
| -rw-r--r-- | wmi/src/wmi_unified_tlv.c | 142 |
6 files changed, 303 insertions, 18 deletions
diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index a29f78086a74..e69d4bce19a3 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -903,8 +903,7 @@ QDF_STATUS wmi_unified_roam_scan_offload_cmd(void *wmi_hdl, #ifndef WMI_NON_TLV_SUPPORT QDF_STATUS wmi_unified_send_roam_scan_offload_ap_cmd(void *wmi_hdl, - wmi_ap_profile *ap_profile_p, - uint32_t vdev_id); + struct ap_profile_params *ap_profile); #endif QDF_STATUS wmi_unified_roam_scan_offload_scan_period(void *wmi_hdl, diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index db1049286bef..3f8d1472e4e5 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -1975,6 +1975,166 @@ struct roam_offload_scan_rssi_params { }; /** + * struct ap_profile - Structure ap profile to match candidate + * @flags: flags + * @rssi_threshold: the value of the the candidate AP should higher by this + * threshold than the rssi of the currrently associated AP + * @ssid: ssid vlaue to be matched + * @rsn_authmode: security params to be matched + * @rsn_ucastcipherset: unicast cipher set + * @rsn_mcastcipherset: mcast/group cipher set + * @rsn_mcastmgmtcipherset: mcast/group management frames cipher set + * @rssi_abs_thresh: the value of the candidate AP should higher than this + * absolute RSSI threshold. Zero means no absolute minimum + * RSSI is required. units are the offset from the noise + * floor in dB + */ +struct ap_profile { + uint32_t flags; + uint32_t rssi_threshold; + struct mac_ssid ssid; + uint32_t rsn_authmode; + uint32_t rsn_ucastcipherset; + uint32_t rsn_mcastcipherset; + uint32_t rsn_mcastmgmtcipherset; + uint32_t rssi_abs_thresh; +}; + +/** + * struct rssi_scoring - rssi scoring param to sortlist selected AP + * @best_rssi_threshold: Roamable AP RSSI equal or better than this threshold, + * full rssi score 100. Units in dBm. + * @good_rssi_threshold: Below threshold, scoring linear percentage between + * rssi_good_pnt and 100. Units in dBm. + * @bad_rssi_threshold: Between good and bad rssi threshold, scoring linear + * % between rssi_bad_pcnt and rssi_good_pct in dBm. + * @good_rssi_pcnt: Used to assigned scoring percentage of each slot between + * best to good rssi threshold. Units in percentage. + * @bad_rssi_pcnt: Used to assigned scoring percentage of each slot between good + * to bad rssi threshold. Unites in percentage. + * @good_bucket_size : bucket size of slot in good zone + * @bad_bucket_size : bucket size of slot in bad zone + * @rssi_pref_5g_rssi_thresh: Below rssi threshold, 5G AP have given preference + * of band percentage. Units in dBm. + */ +struct rssi_scoring { + int32_t best_rssi_threshold; + int32_t good_rssi_threshold; + int32_t bad_rssi_threshold; + uint32_t good_rssi_pcnt; + uint32_t bad_rssi_pcnt; + uint32_t good_bucket_size; + uint32_t bad_bucket_size; + int32_t rssi_pref_5g_rssi_thresh; +}; + +/** + * struct param_slot_scoring - define % score for differents slots for a + * scoring param. + * @num_slot: number of slots in which the param will be divided. + * Max 15. index 0 is used for 'not_present. Num_slot will + * equally divide 100. e.g, if num_slot = 4 slot 0 = 0-25%, slot + * 1 = 26-50% slot 2 = 51-75%, slot 3 = 76-100% + * @score_pcnt3_to_0: Conatins score percentage for slot 0-3 + * BITS 0-7 :- the scoring pcnt when not present + * BITS 8-15 :- SLOT_1 + * BITS 16-23 :- SLOT_2 + * BITS 24-31 :- SLOT_3 + * @score_pcnt7_to_4: Conatins score percentage for slot 4-7 + * BITS 0-7 :- SLOT_4 + * BITS 8-15 :- SLOT_5 + * BITS 16-23 :- SLOT_6 + * BITS 24-31 :- SLOT_7 + * @score_pcnt11_to_8: Conatins score percentage for slot 8-11 + * BITS 0-7 :- SLOT_8 + * BITS 8-15 :- SLOT_9 + * BITS 16-23 :- SLOT_10 + * BITS 24-31 :- SLOT_11 + * @score_pcnt15_to_12: Conatins score percentage for slot 12-15 + * BITS 0-7 :- SLOT_12 + * BITS 8-15 :- SLOT_13 + * BITS 16-23 :- SLOT_14 + * BITS 24-31 :- SLOT_15 + */ +struct param_slot_scoring { + uint32_t num_slot; + uint32_t score_pcnt3_to_0; + uint32_t score_pcnt7_to_4; + uint32_t score_pcnt11_to_8; + uint32_t score_pcnt15_to_12; +}; + +/** + * struct scoring_param - scoring param to sortlist selected AP + * @disable_bitmap: Each bit will be either allow(0)/disallow(1) to + * considered the roam score param. + * @rssi_weightage: RSSI weightage out of total score in % + * @ht_weightage: HT weightage out of total score in %. + * @vht_weightage: VHT weightage out of total score in %. + * @he_weightaget: 11ax weightage out of total score in %. + * @bw_weightage: Bandwidth weightage out of total score in %. + * @band_weightage: Band(2G/5G) weightage out of total score in %. + * @nss_weightage: NSS(1x1 / 2x2)weightage out of total score in %. + * @esp_qbss_weightage: ESP/QBSS weightage out of total score in %. + * @beamforming_weightage: Beamforming weightage out of total score in %. + * @pcl_weightage: PCL weightage out of total score in %. + * @oce_wan_weightage OCE WAN metrics weightage out of total score in %. + * @bw_index_score: channel BW scoring percentage information. + * BITS 0-7 :- It contains scoring percentage of 20MHz BW + * BITS 8-15 :- It contains scoring percentage of 40MHz BW + * BITS 16-23 :- It contains scoring percentage of 80MHz BW + * BITS 24-31 :- It contains scoring percentage of 1600MHz BW + * The value of each index must be 0-100 + * @band_index_score: band scording percentage information. + * BITS 0-7 :- It contains scoring percentage of 2G + * BITS 8-15 :- It contains scoring percentage of 5G + * BITS 16-23 :- reserved + * BITS 24-31 :- reserved + * The value of each index must be 0-100 + * @nss_index_score: NSS scoring percentage information. + * BITS 0-7 :- It contains scoring percentage of 1x1 + * BITS 8-15 :- It contains scoring percentage of 2x2 + * BITS 16-23 :- It contains scoring percentage of 3x3 + * BITS 24-31 :- It contains scoring percentage of 4x4 + * The value of each index must be 0-100 + * @rssi_scoring: RSSI scoring information. + * @esp_qbss_scoring: ESP/QBSS scoring percentage information + * @oce_wan_scoring: OCE WAN metrics percentage information +*/ +struct scoring_param { + uint32_t disable_bitmap; + int32_t rssi_weightage; + int32_t ht_weightage; + int32_t vht_weightage; + int32_t he_weightage; + int32_t bw_weightage; + int32_t band_weightage; + int32_t nss_weightage; + int32_t esp_qbss_weightage; + int32_t beamforming_weightage; + int32_t pcl_weightage; + int32_t oce_wan_weightage; + uint32_t bw_index_score; + uint32_t band_index_score; + uint32_t nss_index_score; + struct rssi_scoring rssi_scoring; + struct param_slot_scoring esp_qbss_scoring; + struct param_slot_scoring oce_wan_scoring; +}; + +/** + * struct ap_profile_params - ap profile params + * @vdev_id: vdev id + * @profile: ap profile to match candidate + * @param: scoring params to short candidate + */ +struct ap_profile_params { + uint8_t vdev_id; + struct ap_profile profile; + struct scoring_param param; +}; + +/** * struct wifi_epno_network - enhanced pno network block * @ssid: ssid * @rssi_threshold: threshold for considering this SSID as found, required diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index 4ede6958b416..d605fd3cd9d0 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -529,8 +529,7 @@ QDF_STATUS (*send_roam_scan_offload_mode_cmd)(wmi_unified_t wmi_handle, struct roam_offload_scan_params *roam_req); QDF_STATUS (*send_roam_scan_offload_ap_profile_cmd)(wmi_unified_t wmi_handle, - wmi_ap_profile * ap_profile_p, - uint32_t vdev_id); + struct ap_profile_params *ap_profile); QDF_STATUS (*send_pktlog_wmi_send_cmd)(wmi_unified_t wmi_handle, WMI_PKTLOG_EVENT pktlog_event, diff --git a/wmi/inc/wmi_unified_tlv.h b/wmi/inc/wmi_unified_tlv.h index b8887e278b7d..24641af52405 100644 --- a/wmi/inc/wmi_unified_tlv.h +++ b/wmi/inc/wmi_unified_tlv.h @@ -595,8 +595,7 @@ QDF_STATUS send_roam_scan_offload_cmd_tlv(wmi_unified_t wmi_handle, uint32_t command, uint32_t vdev_id); QDF_STATUS send_roam_scan_offload_ap_profile_cmd_tlv(wmi_unified_t wmi_handle, - wmi_ap_profile *ap_profile_p, - uint32_t vdev_id); + struct ap_profile_params *ap_profile); QDF_STATUS send_roam_scan_offload_scan_period_cmd_tlv(wmi_unified_t wmi_handle, uint32_t scan_period, diff --git a/wmi/src/wmi_unified_api.c b/wmi/src/wmi_unified_api.c index dd16036cdde0..06e60b0984c1 100644 --- a/wmi/src/wmi_unified_api.c +++ b/wmi/src/wmi_unified_api.c @@ -3441,22 +3441,20 @@ QDF_STATUS wmi_unified_roam_scan_offload_cmd(void *wmi_hdl, /** * wmi_unified_send_roam_scan_offload_ap_cmd() - set roam ap profile in fw * @wmi_hdl: wmi handle - * @ap_profile_p: ap profile - * @vdev_id: vdev id + * @ap_profile: ap profile params * * Send WMI_ROAM_AP_PROFILE to firmware * * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure */ QDF_STATUS wmi_unified_send_roam_scan_offload_ap_cmd(void *wmi_hdl, - wmi_ap_profile *ap_profile_p, - uint32_t vdev_id) + struct ap_profile_params *ap_profile) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; if (wmi_handle->ops->send_roam_scan_offload_ap_profile_cmd) - return wmi_handle->ops->send_roam_scan_offload_ap_profile_cmd(wmi_handle, - ap_profile_p, vdev_id); + return wmi_handle->ops->send_roam_scan_offload_ap_profile_cmd( + wmi_handle, ap_profile); return QDF_STATUS_E_FAILURE; } diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 3b902a9bdb7f..e96627d07b58 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -11584,17 +11584,18 @@ error: * Return: CDF status */ QDF_STATUS send_roam_scan_offload_ap_profile_cmd_tlv(wmi_unified_t wmi_handle, - wmi_ap_profile *ap_profile_p, - uint32_t vdev_id) + struct ap_profile_params *ap_profile) { wmi_buf_t buf = NULL; QDF_STATUS status; int len; uint8_t *buf_ptr; wmi_roam_ap_profile_fixed_param *roam_ap_profile_fp; + wmi_roam_cnd_scoring_param *score_param; + wmi_ap_profile *profile; len = sizeof(wmi_roam_ap_profile_fixed_param) + sizeof(wmi_ap_profile); - + len += sizeof(*score_param); buf = wmi_buf_alloc(wmi_handle, len); if (!buf) { WMI_LOGE("%s : wmi_buf_alloc failed", __func__); @@ -11608,14 +11609,143 @@ QDF_STATUS send_roam_scan_offload_ap_profile_cmd_tlv(wmi_unified_t wmi_handle, WMITLV_GET_STRUCT_TLVLEN (wmi_roam_ap_profile_fixed_param)); /* fill in threshold values */ - roam_ap_profile_fp->vdev_id = vdev_id; + roam_ap_profile_fp->vdev_id = ap_profile->vdev_id; roam_ap_profile_fp->id = 0; buf_ptr += sizeof(wmi_roam_ap_profile_fixed_param); - qdf_mem_copy(buf_ptr, ap_profile_p, sizeof(wmi_ap_profile)); - WMITLV_SET_HDR(buf_ptr, + profile = (wmi_ap_profile *)buf_ptr; + WMITLV_SET_HDR(&profile->tlv_header, WMITLV_TAG_STRUC_wmi_ap_profile, WMITLV_GET_STRUCT_TLVLEN(wmi_ap_profile)); + profile->flags = ap_profile->profile.flags; + profile->rssi_threshold = ap_profile->profile.rssi_threshold; + profile->ssid.ssid_len = ap_profile->profile.ssid.length; + qdf_mem_copy(profile->ssid.ssid, ap_profile->profile.ssid.mac_ssid, + profile->ssid.ssid_len); + profile->rsn_authmode = ap_profile->profile.rsn_authmode; + profile->rsn_ucastcipherset = ap_profile->profile.rsn_ucastcipherset; + profile->rsn_mcastcipherset = ap_profile->profile.rsn_mcastcipherset; + profile->rsn_mcastmgmtcipherset = + ap_profile->profile.rsn_mcastmgmtcipherset; + profile->rssi_abs_thresh = ap_profile->profile.rssi_abs_thresh; + + WMI_LOGD("AP profile: flags %x rssi_threshold %d ssid:%.*s authmode %d uc cipher %d mc cipher %d mc mgmt cipher %d rssi abs thresh %d", + profile->flags, profile->rssi_threshold, + profile->ssid.ssid_len, ap_profile->profile.ssid.mac_ssid, + profile->rsn_authmode, profile->rsn_ucastcipherset, + profile->rsn_mcastcipherset, profile->rsn_mcastmgmtcipherset, + profile->rssi_abs_thresh); + + buf_ptr += sizeof(wmi_ap_profile); + + score_param = (wmi_roam_cnd_scoring_param *)buf_ptr; + WMITLV_SET_HDR(&score_param->tlv_header, + WMITLV_TAG_STRUC_wmi_roam_cnd_scoring_param, + WMITLV_GET_STRUCT_TLVLEN(wmi_roam_cnd_scoring_param)); + score_param->disable_bitmap = ap_profile->param.disable_bitmap; + score_param->rssi_weightage_pcnt = + ap_profile->param.rssi_weightage; + score_param->ht_weightage_pcnt = ap_profile->param.ht_weightage; + score_param->vht_weightage_pcnt = ap_profile->param.vht_weightage; + score_param->he_weightage_pcnt = ap_profile->param.he_weightage; + 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->esp_qbss_weightage_pcnt = + ap_profile->param.esp_qbss_weightage; + score_param->beamforming_weightage_pcnt = + ap_profile->param.beamforming_weightage; + score_param->pcl_weightage_pcnt = ap_profile->param.pcl_weightage; + score_param->oce_wan_weightage_pcnt = + ap_profile->param.oce_wan_weightage; + + WMI_LOGD("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", + score_param->disable_bitmap, score_param->rssi_weightage_pcnt, + score_param->ht_weightage_pcnt, + score_param->vht_weightage_pcnt, + score_param->he_weightage_pcnt, score_param->bw_weightage_pcnt, + score_param->band_weightage_pcnt, + score_param->nss_weightage_pcnt, + score_param->esp_qbss_weightage_pcnt, + score_param->beamforming_weightage_pcnt, + score_param->pcl_weightage_pcnt, + score_param->oce_wan_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; + + WMI_LOGD("Params index score bitmask: bw_index_score %x band_index_score %x nss_index_score %x", + score_param->bw_scoring.score_pcnt, + score_param->band_scoring.score_pcnt, + score_param->nss_scoring.score_pcnt); + + score_param->rssi_scoring.best_rssi_threshold = + (-1) * ap_profile->param.rssi_scoring.best_rssi_threshold; + score_param->rssi_scoring.good_rssi_threshold = + (-1) * ap_profile->param.rssi_scoring.good_rssi_threshold; + score_param->rssi_scoring.bad_rssi_threshold = + (-1) * ap_profile->param.rssi_scoring.bad_rssi_threshold; + score_param->rssi_scoring.good_rssi_pcnt = + ap_profile->param.rssi_scoring.good_rssi_pcnt; + score_param->rssi_scoring.bad_rssi_pcnt = + ap_profile->param.rssi_scoring.bad_rssi_pcnt; + score_param->rssi_scoring.good_bucket_size = + ap_profile->param.rssi_scoring.good_bucket_size; + score_param->rssi_scoring.bad_bucket_size = + ap_profile->param.rssi_scoring.bad_bucket_size; + score_param->rssi_scoring.rssi_pref_5g_rssi_thresh = + (-1) * ap_profile->param.rssi_scoring.rssi_pref_5g_rssi_thresh; + + WMI_LOGD("Rssi scoring threshold: best RSSI %d good RSSI %d bad RSSI %d prefer 5g threshold %d", + score_param->rssi_scoring.best_rssi_threshold, + score_param->rssi_scoring.good_rssi_threshold, + score_param->rssi_scoring.bad_rssi_threshold, + score_param->rssi_scoring.rssi_pref_5g_rssi_thresh); + WMI_LOGD("Good RSSI score for each slot %d bad RSSI score for each slot %d good bucket %d bad bucket %d", + score_param->rssi_scoring.good_rssi_pcnt, + score_param->rssi_scoring.bad_rssi_pcnt, + score_param->rssi_scoring.good_bucket_size, + score_param->rssi_scoring.bad_bucket_size); + + score_param->esp_qbss_scoring.num_slot = + ap_profile->param.esp_qbss_scoring.num_slot; + score_param->esp_qbss_scoring.score_pcnt3_to_0 = + ap_profile->param.esp_qbss_scoring.score_pcnt3_to_0; + score_param->esp_qbss_scoring.score_pcnt7_to_4 = + ap_profile->param.esp_qbss_scoring.score_pcnt7_to_4; + score_param->esp_qbss_scoring.score_pcnt11_to_8 = + ap_profile->param.esp_qbss_scoring.score_pcnt11_to_8; + score_param->esp_qbss_scoring.score_pcnt15_to_12 = + ap_profile->param.esp_qbss_scoring.score_pcnt15_to_12; + + WMI_LOGD("ESP QBSS index weight: slots %d weight 0to3 %x weight 4to7 %x weight 8to11 %x weight 12to15 %x", + score_param->esp_qbss_scoring.num_slot, + score_param->esp_qbss_scoring.score_pcnt3_to_0, + score_param->esp_qbss_scoring.score_pcnt7_to_4, + score_param->esp_qbss_scoring.score_pcnt11_to_8, + score_param->esp_qbss_scoring.score_pcnt15_to_12); + + score_param->oce_wan_scoring.num_slot = + ap_profile->param.oce_wan_scoring.num_slot; + score_param->oce_wan_scoring.score_pcnt3_to_0 = + ap_profile->param.oce_wan_scoring.score_pcnt3_to_0; + score_param->oce_wan_scoring.score_pcnt7_to_4 = + ap_profile->param.oce_wan_scoring.score_pcnt7_to_4; + score_param->oce_wan_scoring.score_pcnt11_to_8 = + ap_profile->param.oce_wan_scoring.score_pcnt11_to_8; + score_param->oce_wan_scoring.score_pcnt15_to_12 = + ap_profile->param.oce_wan_scoring.score_pcnt15_to_12; + + WMI_LOGD("OCE WAN index weight: slots %d weight 0to3 %x weight 4to7 %x weight 8to11 %x weight 12to15 %x", + score_param->oce_wan_scoring.num_slot, + score_param->oce_wan_scoring.score_pcnt3_to_0, + score_param->oce_wan_scoring.score_pcnt7_to_4, + score_param->oce_wan_scoring.score_pcnt11_to_8, + score_param->oce_wan_scoring.score_pcnt15_to_12); + status = wmi_unified_cmd_send(wmi_handle, buf, len, WMI_ROAM_AP_PROFILE); if (QDF_IS_STATUS_ERROR(status)) { |
