diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index 7e285e6b5e4f..68b0226492f4 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -654,8 +654,7 @@ QDF_STATUS wmi_unified_pno_stop_cmd(void *wmi_hdl, uint8_t vdev_id); #ifdef FEATURE_WLAN_SCAN_PNO QDF_STATUS wmi_unified_pno_start_cmd(void *wmi_hdl, - struct pno_scan_req_params *pno, - uint32_t *gchannel_freq_list); + struct pno_scan_req_params *pno); #endif QDF_STATUS wmi_unified_set_ric_req_cmd(void *wmi_hdl, void *msg, diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 9abe79bffa2c..3c36788be366 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -2081,105 +2081,6 @@ struct extscan_cached_result_params { bool flush; }; -/* Set PNO */ -#define WMI_PNO_MAX_NETW_CHANNELS 26 -#define WMI_PNO_MAX_NETW_CHANNELS_EX 60 -#define WMI_PNO_MAX_SUPP_NETWORKS 16 - -/* - * size based of dot11 declaration without extra IEs as we will not carry those - * for PNO - */ -#define WMI_PNO_MAX_PB_REQ_SIZE 450 - -#define WMI_PNO_24G_DEFAULT_CH 1 -#define WMI_PNO_5G_DEFAULT_CH 36 - -/** - * enum pno_mode - pno mode types - * @WMI_PNO_MODE_IMMEDIATE: immidiate mode - * @WMI_PNO_MODE_ON_SUSPEND: suspend on mode - * @WMI_PNO_MODE_ON_RESUME: resume on mode - * @WMI_PNO_MODE_MAX: max range - */ -enum pno_mode { - WMI_PNO_MODE_IMMEDIATE, - WMI_PNO_MODE_ON_SUSPEND, - WMI_PNO_MODE_ON_RESUME, - WMI_PNO_MODE_MAX -}; - -/** - * struct pno_nw_type - pno nw type - * @ssid: mac ssid - * @authentication: authentication type - * @encryption: encryption type - * @bcastNetwType: broadcast nw type - * @ucChannelCount: uc channel count - * @aChannels: pno channel - * @rssiThreshold: rssi threshold - */ -struct pno_nw_type { - struct mac_ssid ssid; - uint32_t authentication; - uint32_t encryption; - uint32_t bcastNetwType; - uint8_t ucChannelCount; - uint8_t aChannels[WMI_PNO_MAX_NETW_CHANNELS_EX]; - int32_t rssiThreshold; -}; - -/** - * struct pno_scan_req_params - PNO Scan request structure - * @enable: flag to enable or disable - * @modePNO: PNO Mode - * @ucNetworksCount: Number of networks - * @aNetworks: Preferred network list - * @sessionId: Session identifier - * @fast_scan_period: Fast Scan period - * @slow_scan_period: Slow scan period - * @delay_start_time: delay in seconds to use before starting the first scan - * @fast_scan_max_cycles: Fast scan max cycles - * @us24GProbeTemplateLen: 2.4G probe template length - * @p24GProbeTemplate: 2.4G probe template - * @us5GProbeTemplateLen: 5G probe template length - * @p5GProbeTemplate: 5G probe template - * @pno_channel_prediction: PNO channel prediction feature status - * @top_k_num_of_channels: top K number of channels are used for tanimoto - * distance calculation. - * @stationary_thresh: threshold value to determine that the STA is stationary. - * @pnoscan_adaptive_dwell_mode: adaptive dwelltime mode for pno scan - * @channel_prediction_full_scan: periodic timer upon which a full scan needs - * to be triggered. - */ -struct pno_scan_req_params { - uint8_t enable; - enum pno_mode modePNO; - uint8_t ucNetworksCount; - struct pno_nw_type aNetworks[WMI_PNO_MAX_SUPP_NETWORKS]; - uint8_t sessionId; - uint32_t fast_scan_period; - uint32_t slow_scan_period; - uint32_t delay_start_time; - uint8_t fast_scan_max_cycles; - uint32_t active_min_time; - uint32_t active_max_time; - uint32_t passive_min_time; - uint32_t passive_max_time; - uint16_t us24GProbeTemplateLen; - uint8_t p24GProbeTemplate[WMI_PNO_MAX_PB_REQ_SIZE]; - uint16_t us5GProbeTemplateLen; - uint8_t p5GProbeTemplate[WMI_PNO_MAX_PB_REQ_SIZE]; -#ifdef FEATURE_WLAN_SCAN_PNO - bool pno_channel_prediction; - uint8_t top_k_num_of_channels; - uint8_t stationary_thresh; - enum wmi_dwelltime_adaptive_mode pnoscan_adaptive_dwell_mode; - uint32_t channel_prediction_full_scan; -#endif -}; - - #define WMI_WLAN_EXTSCAN_MAX_CHANNELS 36 #define WMI_WLAN_EXTSCAN_MAX_BUCKETS 16 #define WMI_WLAN_EXTSCAN_MAX_HOTLIST_APS 128 diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index a38524ae6bcf..c3d3318a12e8 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -455,11 +455,8 @@ QDF_STATUS (*send_csa_offload_enable_cmd)(wmi_unified_t wmi_handle, QDF_STATUS (*send_pno_stop_cmd)(wmi_unified_t wmi_handle, uint8_t vdev_id); -#ifdef FEATURE_WLAN_SCAN_PNO QDF_STATUS (*send_pno_start_cmd)(wmi_unified_t wmi_handle, - struct pno_scan_req_params *pno, - uint32_t *gchannel_freq_list); -#endif + struct pno_scan_req_params *pno); QDF_STATUS (*send_ipa_offload_control_cmd)(wmi_unified_t wmi_handle, struct ipa_offload_control_params *ipa_offload); diff --git a/wmi/src/wmi_unified_api.c b/wmi/src/wmi_unified_api.c index 2a9cce6bed3e..9ea40e0ea84f 100644 --- a/wmi/src/wmi_unified_api.c +++ b/wmi/src/wmi_unified_api.c @@ -1950,21 +1950,19 @@ QDF_STATUS wmi_unified_pno_stop_cmd(void *wmi_hdl, uint8_t vdev_id) * wmi_unified_pno_start_cmd() - PNO start request * @wmi_hdl: wmi handle * @pno: PNO request - * @gchannel_freq_list: channel frequency list * * This function request FW to start PNO request. * Request: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure */ #ifdef FEATURE_WLAN_SCAN_PNO QDF_STATUS wmi_unified_pno_start_cmd(void *wmi_hdl, - struct pno_scan_req_params *pno, - uint32_t *gchannel_freq_list) + struct pno_scan_req_params *pno) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; if (wmi_handle->ops->send_pno_start_cmd) return wmi_handle->ops->send_pno_start_cmd(wmi_handle, - pno, gchannel_freq_list); + pno); return QDF_STATUS_E_FAILURE; } diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index a1bc4e058eb0..e853f29fa3ff 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -30,10 +30,10 @@ #include "wmi_version.h" #include "wmi_unified_priv.h" #include "wmi_version_whitelist.h" - #ifdef CONVERGED_P2P_ENABLE #include "wlan_p2p_public_struct.h" #endif +#include /* copy_vdev_create_pdev_id() - copy pdev from host params to target command * buffer. @@ -6891,8 +6891,7 @@ static void wmi_set_pno_channel_prediction(uint8_t *buf_ptr, * Request: CDF status */ static QDF_STATUS send_pno_start_cmd_tlv(wmi_unified_t wmi_handle, - struct pno_scan_req_params *pno, - uint32_t *gchannel_freq_list) + struct pno_scan_req_params *pno) { wmi_nlo_config_cmd_fixed_param *cmd; nlo_configured_parameters *nlo_list; @@ -6911,10 +6910,10 @@ static QDF_STATUS send_pno_start_cmd_tlv(wmi_unified_t wmi_handle, len = sizeof(*cmd) + WMI_TLV_HDR_SIZE + WMI_TLV_HDR_SIZE + WMI_TLV_HDR_SIZE; - len += sizeof(uint32_t) * QDF_MIN(pno->aNetworks[0].ucChannelCount, + len += sizeof(uint32_t) * QDF_MIN(pno->networks_list[0].channel_cnt, WMI_NLO_MAX_CHAN); len += sizeof(nlo_configured_parameters) * - QDF_MIN(pno->ucNetworksCount, WMI_NLO_MAX_SSIDS); + QDF_MIN(pno->networks_cnt, WMI_NLO_MAX_SSIDS); len += sizeof(nlo_channel_prediction_cfg); buf = wmi_buf_alloc(wmi_handle, len); @@ -6930,16 +6929,16 @@ static QDF_STATUS send_pno_start_cmd_tlv(wmi_unified_t wmi_handle, WMITLV_TAG_STRUC_wmi_nlo_config_cmd_fixed_param, WMITLV_GET_STRUCT_TLVLEN (wmi_nlo_config_cmd_fixed_param)); - cmd->vdev_id = pno->sessionId; + cmd->vdev_id = pno->vdev_id; cmd->flags = WMI_NLO_CONFIG_START | WMI_NLO_CONFIG_SSID_HIDE_EN; #ifdef FEATURE_WLAN_SCAN_PNO WMI_SCAN_SET_DWELL_MODE(cmd->flags, - pno->pnoscan_adaptive_dwell_mode); + pno->adaptive_dwell_mode); #endif /* Current FW does not support min-max range for dwell time */ - cmd->active_dwell_time = pno->active_max_time; - cmd->passive_dwell_time = pno->passive_max_time; + cmd->active_dwell_time = pno->active_dwell_time; + cmd->passive_dwell_time = pno->passive_dwell_time; /* Copy scan interval */ cmd->fast_scan_period = pno->fast_scan_period; @@ -6952,7 +6951,7 @@ static QDF_STATUS send_pno_start_cmd_tlv(wmi_unified_t wmi_handle, buf_ptr += sizeof(wmi_nlo_config_cmd_fixed_param); - cmd->no_of_ssids = QDF_MIN(pno->ucNetworksCount, WMI_NLO_MAX_SSIDS); + cmd->no_of_ssids = QDF_MIN(pno->networks_cnt, WMI_NLO_MAX_SSIDS); WMI_LOGD("SSID count : %d", cmd->no_of_ssids); WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, cmd->no_of_ssids * sizeof(nlo_configured_parameters)); @@ -6966,9 +6965,10 @@ static QDF_STATUS send_pno_start_cmd_tlv(wmi_unified_t wmi_handle, (nlo_configured_parameters)); /* Copy ssid and it's length */ nlo_list[i].ssid.valid = true; - nlo_list[i].ssid.ssid.ssid_len = pno->aNetworks[i].ssid.length; + nlo_list[i].ssid.ssid.ssid_len = + pno->networks_list[i].ssid.length; qdf_mem_copy(nlo_list[i].ssid.ssid.ssid, - pno->aNetworks[i].ssid.mac_ssid, + pno->networks_list[i].ssid.ssid, nlo_list[i].ssid.ssid.ssid_len); WMI_LOGD("index: %d ssid: %.*s len: %d", i, nlo_list[i].ssid.ssid.ssid_len, @@ -6976,24 +6976,25 @@ static QDF_STATUS send_pno_start_cmd_tlv(wmi_unified_t wmi_handle, nlo_list[i].ssid.ssid.ssid_len); /* Copy rssi threshold */ - if (pno->aNetworks[i].rssiThreshold && - pno->aNetworks[i].rssiThreshold > WMI_RSSI_THOLD_DEFAULT) { + if (pno->networks_list[i].rssi_thresh && + pno->networks_list[i].rssi_thresh > + WMI_RSSI_THOLD_DEFAULT) { nlo_list[i].rssi_cond.valid = true; nlo_list[i].rssi_cond.rssi = - pno->aNetworks[i].rssiThreshold; + pno->networks_list[i].rssi_thresh; WMI_LOGD("RSSI threshold : %d dBm", nlo_list[i].rssi_cond.rssi); } nlo_list[i].bcast_nw_type.valid = true; nlo_list[i].bcast_nw_type.bcast_nw_type = - pno->aNetworks[i].bcastNetwType; + pno->networks_list[i].bc_new_type; WMI_LOGI("Broadcast NW type (%u)", nlo_list[i].bcast_nw_type.bcast_nw_type); } buf_ptr += cmd->no_of_ssids * sizeof(nlo_configured_parameters); /* Copy channel info */ - cmd->num_of_channels = QDF_MIN(pno->aNetworks[0].ucChannelCount, + cmd->num_of_channels = QDF_MIN(pno->networks_list[0].channel_cnt, WMI_NLO_MAX_CHAN); WMI_LOGD("Channel count: %d", cmd->num_of_channels); WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_UINT32, @@ -7002,10 +7003,12 @@ static QDF_STATUS send_pno_start_cmd_tlv(wmi_unified_t wmi_handle, channel_list = (uint32_t *) buf_ptr; for (i = 0; i < cmd->num_of_channels; i++) { - channel_list[i] = pno->aNetworks[0].aChannels[i]; + channel_list[i] = pno->networks_list[0].channels[i]; if (channel_list[i] < WMI_NLO_FREQ_THRESH) - channel_list[i] = gchannel_freq_list[i]; + channel_list[i] = + wlan_chan_to_freq(pno-> + networks_list[0].channels[i]); WMI_LOGD("Ch[%d]: %d MHz", i, channel_list[i]); } @@ -16939,9 +16942,7 @@ struct wmi_ops tlv_ops = { .send_plm_stop_cmd = send_plm_stop_cmd_tlv, .send_plm_start_cmd = send_plm_start_cmd_tlv, .send_pno_stop_cmd = send_pno_stop_cmd_tlv, -#ifdef FEATURE_WLAN_SCAN_PNO .send_pno_start_cmd = send_pno_start_cmd_tlv, -#endif .send_set_ric_req_cmd = send_set_ric_req_cmd_tlv, .send_process_ll_stats_clear_cmd = send_process_ll_stats_clear_cmd_tlv, .send_process_ll_stats_set_cmd = send_process_ll_stats_set_cmd_tlv,