diff options
| author | Sreelakshmi Konamki <skonam@codeaurora.org> | 2017-02-08 10:44:18 +0530 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2017-02-28 19:56:53 -0800 |
| commit | dbeecbf54bd5bf12f331abf80c0fe680f8adc3d2 (patch) | |
| tree | 88fe63568b09c532aa07afc8d8cc4dfcf80392ac /wmi/src | |
| parent | 35068ec59e24de3e73a988fb4dbc900917785da1 (diff) | |
qcacmn: Add support for PNO scan in connected state
qcacld-2.0 to qcacmn propagation
Add changes to support PNO scan in connected state to find better Ap's
based on rssi threshold, band and rssi preference.
Change-Id: I0744297cc5269f0fe37613247c911102e293d8e9
CRs-Fixed: 2000342
Diffstat (limited to 'wmi/src')
| -rw-r--r-- | wmi/src/wmi_unified_tlv.c | 48 |
1 files changed, 47 insertions, 1 deletions
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) { |
