diff options
| -rw-r--r-- | wmi/inc/wmi_unified_param.h | 19 | ||||
| -rw-r--r-- | wmi/src/wmi_unified_tlv.c | 48 |
2 files changed, 66 insertions, 1 deletions
diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 6591ba25c451..a8bfe340a352 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -2059,6 +2059,17 @@ struct pno_nw_type { }; /** + * struct connected_pno_band_rssi_pref - BSS preference based on band + * and RSSI + * @band: band preference + * @rssi_pref: RSSI preference + */ +struct cpno_band_rssi_pref { + int8_t band; + int8_t rssi; +}; + +/** * struct pno_scan_req_params - PNO Scan request structure * @enable: flag to enable or disable * @modePNO: PNO Mode @@ -2085,6 +2096,10 @@ struct pno_nw_type { * @mac_addr_mask: MAC address mask used with randomization, bits that * are 0 in the mask should be randomized, bits that are 1 should * be taken from the @mac_addr + * @relative_rssi_set: Flag to check whether realtive_rssi is set or not + * @relative_rssi: Relative rssi threshold, used for connected pno + * @band_rssi_pref: Band and RSSI preference that can be given to one BSS + * over the other BSS * @ie_whitelist: set to true for enabling ie whitelisting * @probe_req_ie_bitmap: contains IEs to be included in probe req * @num_vendor_oui: number of vendor OUIs @@ -2121,6 +2136,10 @@ struct pno_scan_req_params { uint8_t mac_addr[QDF_MAC_ADDR_SIZE]; uint8_t mac_addr_mask[QDF_MAC_ADDR_SIZE]; + bool relative_rssi_set; + int8_t relative_rssi; + struct cpno_band_rssi_pref band_rssi_pref; + /* probe req ie whitelisting attrs */ bool ie_whitelist; uint32_t probe_req_ie_bitmap[PROBE_REQ_BITMAP_LEN]; diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index c094a2c6f450..03083a9954c4 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -6068,16 +6068,19 @@ QDF_STATUS send_pno_start_cmd_tlv(wmi_unified_t wmi_handle, uint8_t *buf_ptr; uint8_t i; int ret; + connected_nlo_rssi_params *nlo_relative_rssi; + connected_nlo_bss_band_rssi_pref *nlo_band_rssi; /* * TLV place holder for array nlo_configured_parameters(nlo_list) * TLV place holder for array of uint32_t channel_list * TLV place holder for chnnl prediction cfg * TLV place holder for array of wmi_vendor_oui + * TLV place holder for array of connected_nlo_bss_band_rssi_pref */ len = sizeof(*cmd) + WMI_TLV_HDR_SIZE + WMI_TLV_HDR_SIZE + WMI_TLV_HDR_SIZE + - WMI_TLV_HDR_SIZE; + WMI_TLV_HDR_SIZE + WMI_TLV_HDR_SIZE; len += sizeof(uint32_t) * QDF_MIN(pno->aNetworks[0].ucChannelCount, WMI_NLO_MAX_CHAN); @@ -6086,6 +6089,8 @@ QDF_STATUS send_pno_start_cmd_tlv(wmi_unified_t wmi_handle, len += sizeof(nlo_channel_prediction_cfg); len += sizeof(enlo_candidate_score_params); len += sizeof(wmi_vendor_oui) * pno->num_vendor_oui; + len += sizeof(connected_nlo_rssi_params); + len += sizeof(connected_nlo_bss_band_rssi_pref); buf = wmi_buf_alloc(wmi_handle, len); if (!buf) { @@ -6207,6 +6212,8 @@ QDF_STATUS send_pno_start_cmd_tlv(wmi_unified_t wmi_handle, for (i = 0; i < PROBE_REQ_BITMAP_LEN; i++) cmd->ie_bitmap[i] = pno->probe_req_ie_bitmap[i]; } + if (pno->relative_rssi_set) + cmd->flags |= WMI_NLO_CONFIG_ENABLE_CNLO_RSSI_CONFIG; WMI_LOGI("pno flags = %x", cmd->flags); /* ie white list */ @@ -6220,6 +6227,45 @@ QDF_STATUS send_pno_start_cmd_tlv(wmi_unified_t wmi_handle, buf_ptr += cmd->num_vendor_oui * sizeof(wmi_vendor_oui); } + /* + * Firmware calculation using connected PNO params: + * New AP's RSSI >= (Connected AP's RSSI + relative_rssi +/- rssi_pref) + * deduction of rssi_pref for chosen band_pref and + * addition of rssi_pref for remaining bands (other than chosen band). + */ + nlo_relative_rssi = (connected_nlo_rssi_params *) buf_ptr; + WMITLV_SET_HDR(&nlo_relative_rssi->tlv_header, + WMITLV_TAG_STRUC_wmi_connected_nlo_rssi_params, + WMITLV_GET_STRUCT_TLVLEN(connected_nlo_rssi_params)); + nlo_relative_rssi->relative_rssi = pno->relative_rssi; + WMI_LOGI("relative_rssi %d", nlo_relative_rssi->relative_rssi); + buf_ptr += sizeof(*nlo_relative_rssi); + + /* + * As of now Kernel and Host supports one band and rssi preference. + * Firmware supports array of band and rssi preferences + */ + cmd->num_cnlo_band_pref = 1; + WMITLV_SET_HDR(buf_ptr, + WMITLV_TAG_ARRAY_STRUC, + cmd->num_cnlo_band_pref * + sizeof(connected_nlo_bss_band_rssi_pref)); + buf_ptr += WMI_TLV_HDR_SIZE; + + nlo_band_rssi = (connected_nlo_bss_band_rssi_pref *) buf_ptr; + for (i = 0; i < cmd->num_cnlo_band_pref; i++) { + WMITLV_SET_HDR(&nlo_band_rssi[i].tlv_header, + WMITLV_TAG_STRUC_wmi_connected_nlo_bss_band_rssi_pref, + WMITLV_GET_STRUCT_TLVLEN( + connected_nlo_bss_band_rssi_pref)); + nlo_band_rssi[i].band = pno->band_rssi_pref.band; + nlo_band_rssi[i].rssi_pref = pno->band_rssi_pref.rssi; + WMI_LOGI("band_pref %d, rssi_pref %d", + nlo_band_rssi[i].band, + nlo_band_rssi[i].rssi_pref); + } + buf_ptr += cmd->num_cnlo_band_pref * sizeof(*nlo_band_rssi); + ret = wmi_unified_cmd_send(wmi_handle, buf, len, WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID); if (ret) { |
