From fef95e2eec1ee1fb123b79e70703813ebcfcfe57 Mon Sep 17 00:00:00 2001 From: Govind Singh Date: Mon, 7 Mar 2016 14:24:22 +0530 Subject: [PATCH] qcacmn: Add tlv formation of wmi scan roam commands in common wmi layer Move tlv formation of wmi scan roaming and management commands from umac to common wmi layer. Change-Id: I99b2651c0054d03e58da697ab7b902b5629eeb4a CRs-Fixed: 983619 --- wmi/inc/wmi_unified_api.h | 207 ++- wmi/inc/wmi_unified_non_tlv.h | 54 +- wmi/inc/wmi_unified_param.h | 1501 +++++++++++++++++++++ wmi/inc/wmi_unified_priv.h | 206 ++- wmi/inc/wmi_unified_tlv.h | 200 ++- wmi/src/wmi_unified_api.c | 743 ++++++++++- wmi/src/wmi_unified_non_tlv.c | 54 +- wmi/src/wmi_unified_tlv.c | 2303 ++++++++++++++++++++++++++++++++- 8 files changed, 4957 insertions(+), 311 deletions(-) diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index 9cce33e293..a8ffc60fe2 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -218,176 +218,281 @@ void wmi_process_fw_event(struct wmi_unified *wmi_handle, wmi_buf_t evt_buf); uint16_t wmi_get_max_msg_len(wmi_unified_t wmi_handle); -int32_t wmi_unified_vdev_create_send(void *wmi_hdl, +CDF_STATUS wmi_unified_vdev_create_send(void *wmi_hdl, uint8_t macaddr[IEEE80211_ADDR_LEN], struct vdev_create_params *param); -int32_t wmi_unified_vdev_delete_send(void *wmi_hdl, +CDF_STATUS wmi_unified_vdev_delete_send(void *wmi_hdl, uint8_t if_id); -int32_t wmi_unified_vdev_start_send(void *wmi_hdl, +CDF_STATUS wmi_unified_vdev_start_send(void *wmi_hdl, uint8_t macaddr[IEEE80211_ADDR_LEN], struct vdev_start_params *param); -int32_t wmi_unified_vdev_restart_send(void *wmi_hdl, +CDF_STATUS wmi_unified_vdev_restart_send(void *wmi_hdl, uint8_t macaddr[IEEE80211_ADDR_LEN], struct vdev_start_params *param); -int32_t wmi_unified_vdev_stop_send(void *wmi_hdl, +CDF_STATUS wmi_unified_vdev_stop_send(void *wmi_hdl, uint8_t vdev_id); -int32_t wmi_unified_vdev_up_send(void *wmi_hdl, +CDF_STATUS wmi_unified_vdev_up_send(void *wmi_hdl, uint8_t bssid[IEEE80211_ADDR_LEN], struct vdev_up_params *params); -int32_t wmi_unified_vdev_down_send(void *wmi_hdl, +CDF_STATUS wmi_unified_vdev_down_send(void *wmi_hdl, uint8_t vdev_id); -int32_t wmi_unified_vdev_set_param_send(void *wmi_hdl, +CDF_STATUS wmi_unified_vdev_set_param_send(void *wmi_hdl, struct vdev_set_params *param); -int32_t wmi_unified_peer_delete_send(void *wmi_hdl, +CDF_STATUS wmi_unified_peer_delete_send(void *wmi_hdl, uint8_t peer_addr[IEEE80211_ADDR_LEN], uint8_t vdev_id); -int32_t wmi_unified_peer_flush_tids_send(void *wmi_hdl, +CDF_STATUS wmi_unified_peer_flush_tids_send(void *wmi_hdl, uint8_t peer_addr[IEEE80211_ADDR_LEN], struct peer_flush_params *param); -int32_t wmi_set_peer_param_send(void *wmi_hdl, +CDF_STATUS wmi_set_peer_param_send(void *wmi_hdl, uint8_t peer_addr[IEEE80211_ADDR_LEN], struct peer_set_params *param); -int32_t wmi_unified_peer_create_send(void *wmi_hdl, +CDF_STATUS wmi_unified_peer_create_send(void *wmi_hdl, struct peer_create_params *param); -int32_t wmi_unified_stats_request_send(void *wmi_hdl, +CDF_STATUS wmi_unified_stats_request_send(void *wmi_hdl, uint8_t macaddr[IEEE80211_ADDR_LEN], struct stats_request_params *param); -int32_t wmi_unified_green_ap_ps_send(void *wmi_hdl, +CDF_STATUS wmi_unified_green_ap_ps_send(void *wmi_hdl, uint32_t value, uint8_t mac_id); -int32_t wmi_unified_wow_enable_send(void *wmi_hdl, +CDF_STATUS wmi_unified_wow_enable_send(void *wmi_hdl, struct wow_cmd_params *param, uint8_t mac_id); -int32_t wmi_unified_packet_log_enable_send(void *wmi_hdl, +CDF_STATUS wmi_unified_packet_log_enable_send(void *wmi_hdl, uint8_t macaddr[IEEE80211_ADDR_LEN], struct packet_enable_params *param); -int32_t wmi_unified_suspend_send(void *wmi_hdl, +CDF_STATUS wmi_unified_suspend_send(void *wmi_hdl, struct suspend_params *param, uint8_t mac_id); -int32_t wmi_unified_resume_send(void *wmi_hdl, +CDF_STATUS wmi_unified_resume_send(void *wmi_hdl, uint8_t mac_id); -int32_t +CDF_STATUS wmi_unified_pdev_param_send(void *wmi_hdl, struct pdev_params *param, uint8_t mac_id); -int32_t wmi_unified_beacon_send_cmd(void *wmi_hdl, +CDF_STATUS wmi_unified_beacon_send_cmd(void *wmi_hdl, struct beacon_params *param); -int32_t wmi_unified_peer_assoc_send(void *wmi_hdl, +CDF_STATUS wmi_unified_peer_assoc_send(void *wmi_hdl, struct peer_assoc_params *param); -int32_t wmi_unified_sta_ps_cmd_send(void *wmi_hdl, +CDF_STATUS wmi_unified_sta_ps_cmd_send(void *wmi_hdl, struct sta_ps_params *param); -int32_t wmi_unified_ap_ps_cmd_send(void *wmi_hdl, +CDF_STATUS wmi_unified_ap_ps_cmd_send(void *wmi_hdl, uint8_t macaddr[IEEE80211_ADDR_LEN], struct ap_ps_params *param); -int32_t wmi_unified_scan_start_cmd_send(void *wmi_hdl, +CDF_STATUS wmi_unified_scan_start_cmd_send(void *wmi_hdl, struct scan_start_params *param); -int32_t wmi_unified_scan_stop_cmd_send(void *wmi_hdl, +CDF_STATUS wmi_unified_scan_stop_cmd_send(void *wmi_hdl, struct scan_stop_params *param); -int32_t wmi_unified_scan_chan_list_cmd_send(void *wmi_hdl, +CDF_STATUS wmi_unified_scan_chan_list_cmd_send(void *wmi_hdl, struct scan_chan_list_params *param); -int32_t wmi_crash_inject(void *wmi_hdl, +CDF_STATUS wmi_crash_inject(void *wmi_hdl, struct crash_inject *param); -int32_t wmi_unified_pdev_utf_cmd_send(void *wmi_hdl, +CDF_STATUS wmi_unified_pdev_utf_cmd_send(void *wmi_hdl, struct pdev_utf_params *param, uint8_t mac_id); -int32_t wmi_unified_dbglog_cmd_send(void *wmi_hdl, +CDF_STATUS wmi_unified_dbglog_cmd_send(void *wmi_hdl, struct dbglog_params *param); -int32_t wmi_mgmt_unified_cmd_send(void *wmi_hdl, +CDF_STATUS wmi_mgmt_unified_cmd_send(void *wmi_hdl, struct wmi_mgmt_params *param); -int32_t wmi_unified_modem_power_state(void *wmi_hdl, +CDF_STATUS wmi_unified_modem_power_state(void *wmi_hdl, uint32_t param_value); -int32_t wmi_unified_set_sta_ps_mode(void *wmi_hdl, +CDF_STATUS wmi_unified_set_sta_ps_mode(void *wmi_hdl, uint32_t vdev_id, uint8_t val); -int32_t +CDF_STATUS wmi_unified_set_sta_uapsd_auto_trig_cmd(void *wmi_hdl, struct sta_uapsd_trig_params *param); -int32_t wmi_unified_get_temperature(void *wmi_hdl); +CDF_STATUS wmi_unified_get_temperature(void *wmi_hdl); -int32_t wmi_unified_set_p2pgo_oppps_req(void *wmi_hdl, +CDF_STATUS wmi_unified_set_p2pgo_oppps_req(void *wmi_hdl, struct p2p_ps_params *oppps); -int32_t wmi_unified_set_p2pgo_noa_req_cmd(void *wmi_hdl, +CDF_STATUS wmi_unified_set_p2pgo_noa_req_cmd(void *wmi_hdl, struct p2p_ps_params *noa); -int32_t wmi_unified_set_smps_params(void *wmi_hdl, uint8_t vdev_id, +CDF_STATUS wmi_unified_set_smps_params(void *wmi_hdl, uint8_t vdev_id, int value); -int32_t wmi_unified_set_mimops(void *wmi_hdl, uint8_t vdev_id, int value); +CDF_STATUS wmi_unified_set_mimops(void *wmi_hdl, uint8_t vdev_id, int value); -int32_t wmi_unified_ocb_set_utc_time(void *wmi_hdl, +CDF_STATUS wmi_unified_ocb_set_utc_time(void *wmi_hdl, struct ocb_utc_param *utc); -int32_t wmi_unified_ocb_start_timing_advert(void *wmi_hdl, +CDF_STATUS wmi_unified_ocb_start_timing_advert(void *wmi_hdl, struct ocb_timing_advert_param *timing_advert); -int32_t wmi_unified_ocb_stop_timing_advert(void *wmi_hdl, +CDF_STATUS wmi_unified_ocb_stop_timing_advert(void *wmi_hdl, struct ocb_timing_advert_param *timing_advert); -int32_t wmi_unified_ocb_set_config(void *wmi_hdl, +CDF_STATUS wmi_unified_ocb_set_config(void *wmi_hdl, struct ocb_config_param *config, uint32_t *ch_mhz); -int32_t wmi_unified_ocb_get_tsf_timer(void *wmi_hdl, +CDF_STATUS wmi_unified_ocb_get_tsf_timer(void *wmi_hdl, uint8_t vdev_id); -int wmi_unified_ocb_start_timing_advert(void *wmi_hdl, - struct ocb_timing_advert_param *timing_advert); - -int32_t wmi_unified_lro_config_cmd(void *wmi_hdl, +CDF_STATUS wmi_unified_lro_config_cmd(void *wmi_hdl, struct wmi_lro_config_cmd_t *wmi_lro_cmd); -int32_t wmi_unified_set_thermal_mgmt_cmd(void *wmi_hdl, +CDF_STATUS wmi_unified_set_thermal_mgmt_cmd(void *wmi_hdl, struct thermal_cmd_params *thermal_info); -int32_t wmi_unified_set_mcc_channel_time_quota_cmd +CDF_STATUS wmi_unified_set_mcc_channel_time_quota_cmd (void *wmi_hdl, uint32_t adapter_1_chan_freq, uint32_t adapter_1_quota, uint32_t adapter_2_chan_freq); -int32_t wmi_unified_set_mcc_channel_time_latency_cmd +CDF_STATUS wmi_unified_set_mcc_channel_time_latency_cmd (void *wmi_hdl, uint32_t mcc_channel_freq, uint32_t mcc_channel_time_latency); -int32_t wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd( +CDF_STATUS wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd( void *wmi_hdl, uint32_t mcc_adaptive_scheduler); + +CDF_STATUS wmi_unified_bcn_buf_ll_cmd(void *wmi_hdl, + wmi_bcn_send_from_host_cmd_fixed_param *param); + +CDF_STATUS wmi_unified_set_sta_sa_query_param_cmd(void *wmi_hdl, + uint8_t vdev_id, uint32_t max_retries, + uint32_t retry_interval); + + +CDF_STATUS wmi_unified_set_sta_keep_alive_cmd(void *wmi_hdl, + struct sta_params *params); + +CDF_STATUS wmi_unified_vdev_set_gtx_cfg_cmd(void *wmi_hdl, uint32_t if_id, + struct wmi_gtx_config *gtx_info); + + +CDF_STATUS wmi_unified_process_update_edca_param(void *wmi_hdl, + uint8_t vdev_id, + wmi_wmm_vparams gwmm_param[WMI_MAX_NUM_AC]); + + +CDF_STATUS wmi_unified_probe_rsp_tmpl_send_cmd(void *wmi_hdl, + uint8_t vdev_id, + struct wmi_probe_resp_params *probe_rsp_info, + uint8_t *frm); + +CDF_STATUS wmi_unified_p2p_go_set_beacon_ie_cmd(void *wmi_hdl, + A_UINT32 vdev_id, uint8_t *p2p_ie); + + +CDF_STATUS wmi_unified_set_gateway_params_cmd(void *wmi_hdl, + struct gateway_update_req_param *req); + +CDF_STATUS wmi_unified_set_rssi_monitoring_cmd(void *wmi_hdl, + struct rssi_monitor_param *req); + +CDF_STATUS wmi_unified_scan_probe_setoui_cmd(void *wmi_hdl, + struct scan_mac_oui *psetoui); + +CDF_STATUS wmi_unified_reset_passpoint_network_list_cmd(void *wmi_hdl, + struct wifi_passpoint_req_param *req); + +CDF_STATUS wmi_unified_set_passpoint_network_list_cmd(void *wmi_hdl, + struct wifi_passpoint_req_param *req); + +CDF_STATUS wmi_unified_set_epno_network_list_cmd(void *wmi_hdl, + struct wifi_enhanched_pno_params *req); + +CDF_STATUS wmi_unified_ipa_offload_control_cmd(void *wmi_hdl, + struct ipa_offload_control_params *ipa_offload); + +CDF_STATUS wmi_unified_extscan_get_capabilities_cmd(void *wmi_hdl, + struct extscan_capabilities_params *pgetcapab); + +CDF_STATUS wmi_unified_extscan_get_cached_results_cmd(void *wmi_hdl, + struct extscan_cached_result_params *pcached_results); + + +CDF_STATUS wmi_unified_extscan_stop_change_monitor_cmd(void *wmi_hdl, + struct extscan_capabilities_reset_params *reset_req); + + +CDF_STATUS wmi_unified_extscan_start_change_monitor_cmd(void *wmi_hdl, + struct extscan_set_sig_changereq_params * + psigchange); + +CDF_STATUS wmi_unified_extscan_stop_hotlist_monitor_cmd(void *wmi_hdl, + struct extscan_bssid_hotlist_reset_params *photlist_reset); + +CDF_STATUS wmi_unified_stop_extscan_cmd(void *wmi_hdl, + struct extscan_stop_req_params *pstopcmd); + +CDF_STATUS wmi_unified_start_extscan_cmd(void *wmi_hdl, + struct wifi_scan_cmd_req_params *pstart); + +CDF_STATUS wmi_unified_plm_stop_cmd(void *wmi_hdl, + const struct plm_req_params *plm); + +CDF_STATUS wmi_unified_plm_start_cmd(void *wmi_hdl, + const struct plm_req_params *plm, + uint32_t *gchannel_list); + +CDF_STATUS wmi_unified_pno_stop_cmd(void *wmi_hdl, uint8_t vdev_id); + +CDF_STATUS wmi_unified_pno_start_cmd(void *wmi_hdl, + struct pno_scan_req_params *pno, + uint32_t *gchannel_freq_list); + +CDF_STATUS wmi_unified_set_ric_req_cmd(void *wmi_hdl, void *msg, + uint8_t is_add_ts); + +CDF_STATUS wmi_unified_process_ll_stats_clear_cmd + (void *wmi_hdl, const struct ll_stats_clear_params *clear_req, + uint8_t addr[IEEE80211_ADDR_LEN]); + +CDF_STATUS wmi_unified_process_ll_stats_set_cmd + (void *wmi_hdl, const struct ll_stats_set_params *set_req); + +CDF_STATUS wmi_unified_process_ll_stats_get_cmd + (void *wmi_hdl, const struct ll_stats_get_params *get_req, + uint8_t addr[IEEE80211_ADDR_LEN]); + +CDF_STATUS wmi_unified_get_stats_cmd(void *wmi_hdl, + struct pe_stats_req *get_stats_param, + uint8_t addr[IEEE80211_ADDR_LEN]); + int32_t wmi_unified_ocb_set_utc_time_cmd(void *wmi_hdl, struct ocb_utc_param *utc); + int32_t wmi_unified_dcc_get_stats_cmd(void *wmi_hdl, struct dcc_get_stats_param *get_stats_param); + int32_t wmi_unified_dcc_clear_stats(void *wmi_hdl, uint32_t vdev_id, uint32_t dcc_stats_bitmap); int32_t wmi_unified_dcc_update_ndl(void *wmi_hdl, diff --git a/wmi/inc/wmi_unified_non_tlv.h b/wmi/inc/wmi_unified_non_tlv.h index 54ba3bf802..2d504cfe84 100644 --- a/wmi/inc/wmi_unified_non_tlv.h +++ b/wmi/inc/wmi_unified_non_tlv.h @@ -31,99 +31,99 @@ #include "ol_defines.h" /* Fix Me: wmi_unified_t structure definition */ -int32_t send_vdev_create_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_vdev_create_cmd_non_tlv(wmi_unified_t wmi_handle, uint8_t macaddr[IEEE80211_ADDR_LEN], struct vdev_create_params *param); -int32_t send_vdev_delete_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_vdev_delete_cmd_non_tlv(wmi_unified_t wmi_handle, uint8_t if_id); -int32_t send_vdev_stop_cmd_non_tlv(wmi_unified_t wmi, +CDF_STATUS send_vdev_stop_cmd_non_tlv(wmi_unified_t wmi, uint8_t vdev_id); -int32_t send_vdev_down_cmd_non_tlv(wmi_unified_t wmi, +CDF_STATUS send_vdev_down_cmd_non_tlv(wmi_unified_t wmi, uint8_t vdev_id); -int32_t send_peer_flush_tids_cmd_non_tlv(wmi_unified_t wmi, +CDF_STATUS send_peer_flush_tids_cmd_non_tlv(wmi_unified_t wmi, uint8_t peer_addr[IEEE80211_ADDR_LEN], struct peer_flush_params *param); -int32_t send_peer_delete_cmd_non_tlv(wmi_unified_t wmi, +CDF_STATUS send_peer_delete_cmd_non_tlv(wmi_unified_t wmi, uint8_t peer_addr[IEEE80211_ADDR_LEN], uint8_t vdev_id); -int32_t send_peer_param_cmd_non_tlv(wmi_unified_t wmi, +CDF_STATUS send_peer_param_cmd_non_tlv(wmi_unified_t wmi, uint8_t peer_addr[IEEE80211_ADDR_LEN], struct peer_set_params *param); -int32_t send_vdev_up_cmd_non_tlv(wmi_unified_t wmi, +CDF_STATUS send_vdev_up_cmd_non_tlv(wmi_unified_t wmi, uint8_t bssid[IEEE80211_ADDR_LEN], struct vdev_up_params *params); -int32_t send_peer_create_cmd_non_tlv(wmi_unified_t wmi, +CDF_STATUS send_peer_create_cmd_non_tlv(wmi_unified_t wmi, struct peer_create_params *param); -int32_t send_green_ap_ps_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_green_ap_ps_cmd_non_tlv(wmi_unified_t wmi_handle, uint32_t value, uint8_t mac_id); -int32_t +CDF_STATUS send_pdev_utf_cmd_non_tlv(wmi_unified_t wmi_handle, struct pdev_utf_params *param, uint8_t mac_id); -int32_t +CDF_STATUS send_pdev_param_cmd_non_tlv(wmi_unified_t wmi_handle, struct pdev_params *param, uint8_t mac_id); -int32_t send_suspend_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_suspend_cmd_non_tlv(wmi_unified_t wmi_handle, struct suspend_params *param, uint8_t mac_id); -int32_t send_resume_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_resume_cmd_non_tlv(wmi_unified_t wmi_handle, uint8_t mac_id); -int32_t send_wow_enable_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_wow_enable_cmd_non_tlv(wmi_unified_t wmi_handle, struct wow_cmd_params *param, uint8_t mac_id); -int32_t send_set_ap_ps_param_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_ap_ps_param_cmd_non_tlv(wmi_unified_t wmi_handle, uint8_t *peer_addr, struct ap_ps_params *param); -int32_t send_set_sta_ps_param_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_sta_ps_param_cmd_non_tlv(wmi_unified_t wmi_handle, struct sta_ps_params *param); -int32_t send_crash_inject_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_crash_inject_cmd_non_tlv(wmi_unified_t wmi_handle, struct crash_inject *param); -int32_t +CDF_STATUS send_dbglog_cmd_non_tlv(wmi_unified_t wmi_handle, struct dbglog_params *dbglog_param); -int32_t send_vdev_set_param_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_vdev_set_param_cmd_non_tlv(wmi_unified_t wmi_handle, struct vdev_set_params *param); -int32_t send_stats_request_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_stats_request_cmd_non_tlv(wmi_unified_t wmi_handle, uint8_t macaddr[IEEE80211_ADDR_LEN], struct stats_request_params *param); -int32_t send_packet_log_enable_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_packet_log_enable_cmd_non_tlv(wmi_unified_t wmi_handle, uint8_t macaddr[IEEE80211_ADDR_LEN], struct packet_enable_params *param); -int32_t send_beacon_send_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_beacon_send_cmd_non_tlv(wmi_unified_t wmi_handle, struct beacon_params *param); -int32_t send_peer_assoc_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_peer_assoc_cmd_non_tlv(wmi_unified_t wmi_handle, struct peer_assoc_params *param); -int32_t send_scan_start_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_scan_start_cmd_non_tlv(wmi_unified_t wmi_handle, struct scan_start_params *param); -int32_t send_scan_stop_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_scan_stop_cmd_non_tlv(wmi_unified_t wmi_handle, struct scan_stop_params *param); -int32_t send_scan_chan_list_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_scan_chan_list_cmd_non_tlv(wmi_unified_t wmi_handle, struct scan_chan_list_params *param); diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 04a0ce8ad4..6bd77173e9 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -40,6 +40,7 @@ #define WMI_SMPS_MASK_LOWER_16BITS 0xFF #define WMI_SMPS_MASK_UPPER_3BITS 0x7 #define WMI_SMPS_PARAM_VALUE_S 29 +#define WMI_MAX_NUM_ARGS 8 /* The size of the utc time in bytes. */ #define WMI_SIZE_UTC_TIME (10) /* The size of the utc time error in bytes. */ @@ -57,6 +58,19 @@ #define WMI_ETH_LEN 64 #define WMI_QOS_NUM_TSPEC_MAX 2 #define WMI_QOS_NUM_AC_MAX 4 +#define WMI_IPV4_ADDR_LEN 4 +#define WMI_KEEP_ALIVE_NULL_PKT 1 +#define WMI_KEEP_ALIVE_UNSOLICIT_ARP_RSP 2 +#ifdef WLAN_NS_OFFLOAD +/* support only one IPv6 offload */ +#define WMI_MAC_NS_OFFLOAD_SIZE 1 +/* Number of target IP V6 addresses for NS offload */ +#define WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA 16 +#define WMI_MAC_IPV6_ADDR_LEN 16 +#define WMI_IPV6_ADDR_VALID 1 +#endif /* WLAN_NS_OFFLOAD */ +#define WMI_EXTSCAN_MAX_HOTLIST_SSIDS 8 +#define WMI_ROAM_MAX_CHANNELS 80 /** * struct vdev_create_params - vdev create cmd parameter * @if_id: interface id @@ -755,5 +769,1492 @@ struct wmi_lro_config_cmd_t { uint32_t toeplitz_hash_ipv4[WMI_LRO_IPV4_SEED_ARR_SZ]; uint32_t toeplitz_hash_ipv6[WMI_LRO_IPV6_SEED_ARR_SZ]; }; + +/** + * struct gtx_config_t - GTX config + * @gtx_rt_mask: for HT and VHT rate masks + * @gtx_usrcfg: host request for GTX mask + * @gtx_threshold: PER Threshold (default: 10%) + * @gtx_margin: PER margin (default: 2%) + * @gtx_tcpstep: TCP step (default: 1) + * @gtx_tpcMin: TCP min (default: 5) + * @gtx_bwmask: BW mask (20/40/80/160 Mhz) + */ +struct wmi_gtx_config { + uint32_t gtx_rt_mask[2]; + uint32_t gtx_usrcfg; + uint32_t gtx_threshold; + uint32_t gtx_margin; + uint32_t gtx_tpcstep; + uint32_t gtx_tpcmin; + uint32_t gtx_bwmask; +}; + +/** + * struct wmi_probe_resp_params - send probe response parameters + * @bssId: BSSID + * @pProbeRespTemplate: probe response template + * @probeRespTemplateLen: probe response template length + * @ucProxyProbeReqValidIEBmap: valid IE bitmap + */ +struct wmi_probe_resp_params { + uint8_t bssId[WMI_ETH_LEN]; + uint8_t *pProbeRespTemplate; + uint32_t probeRespTemplateLen; + uint32_t ucProxyProbeReqValidIEBmap[8]; +}; + +/** + * struct sta_params - sta keep alive parameters + * @vdev_id: vdev id + * @method: keep alive method + * @timeperiod: time to keep alive + * @hostv4addr: host ipv4 address + * @destv4addr: destination ipv4 address + * @destmac: destination mac address + */ +struct sta_params { + uint8_t vdev_id; + uint32_t method; + uint32_t timeperiod; + uint8_t *hostv4addr; + uint8_t *destv4addr; + uint8_t *destmac; +}; + +/** + * struct gateway_update_req_param - gateway parameter update request + * @request_id: request id + * @session_id: session id + * @max_retries: Max ARP/NS retry attempts + * @timeout: Retry interval + * @ipv4_addr_type: on ipv4 network + * @ipv6_addr_type: on ipv6 network + * @gw_mac_addr: gateway mac addr + * @ipv4_addr: ipv4 addr + * @ipv6_addr: ipv6 addr + */ +struct gateway_update_req_param { + uint32_t request_id; + uint32_t session_id; + uint32_t max_retries; + uint32_t timeout; + uint32_t ipv4_addr_type; + uint32_t ipv6_addr_type; + struct cdf_mac_addr gw_mac_addr; + uint8_t ipv4_addr[CDF_IPV4_ADDR_SIZE]; + uint8_t ipv6_addr[CDF_IPV6_ADDR_SIZE]; +}; + +/** + * struct rssi_monitor_param - rssi monitoring + * @request_id: request id + * @session_id: session id + * @min_rssi: minimum rssi + * @max_rssi: maximum rssi + * @control: flag to indicate start or stop + */ +struct rssi_monitor_param { + uint32_t request_id; + uint32_t session_id; + int8_t min_rssi; + int8_t max_rssi; + bool control; +}; + +/** + * struct scan_mac_oui - oui paramters + * @oui: oui parameters + */ +struct scan_mac_oui { + uint8_t oui[WMI_WIFI_SCANNING_MAC_OUI_LENGTH]; +}; + +#define WMI_PASSPOINT_REALM_LEN 256 +#define WMI_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM 16 +#define WMI_PASSPOINT_PLMN_LEN 3 +/** + * struct wifi_passpoint_network_param - passpoint network block + * @id: identifier of this network block + * @realm: null terminated UTF8 encoded realm, 0 if unspecified + * @roaming_consortium_ids: roaming consortium ids to match, 0s if unspecified + * @plmn: mcc/mnc combination as per rules, 0s if unspecified + */ +struct wifi_passpoint_network_param { + uint32_t id; + uint8_t realm[WMI_PASSPOINT_REALM_LEN]; + int64_t roaming_consortium_ids[WMI_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM]; + uint8_t plmn[WMI_PASSPOINT_PLMN_LEN]; +}; + +/** + * struct wifi_passpoint_req_param - passpoint request + * @request_id: request identifier + * @num_networks: number of networks + * @networks: passpoint networks + */ +struct wifi_passpoint_req_param { + uint32_t request_id; + uint32_t session_id; + uint32_t num_networks; + struct wifi_passpoint_network_param networks[]; +}; + +/** + * struct wifi_epno_network - enhanced pno network block + * @ssid: ssid + * @rssi_threshold: threshold for considering this SSID as found, required + * granularity for this threshold is 4dBm to 8dBm + * @flags: WIFI_PNO_FLAG_XXX + * @auth_bit_field: auth bit field for matching WPA IE + */ +struct wifi_epno_network_params { + struct mac_ssid ssid; + int8_t rssi_threshold; + uint8_t flags; + uint8_t auth_bit_field; +}; + +/** + * struct wifi_enhanched_pno_params - enhanced pno network params + * @num_networks: number of ssids + * @networks: PNO networks + */ +struct wifi_enhanched_pno_params { + uint32_t request_id; + uint32_t session_id; + uint32_t num_networks; + struct wifi_epno_network_params networks[]; +}; + +enum { + WMI_AP_RX_DATA_OFFLOAD = 0x00, + WMI_STA_RX_DATA_OFFLOAD = 0x01, +}; + +/** + * enum extscan_report_events_type - extscan report events type + * @EXTSCAN_REPORT_EVENTS_BUFFER_FULL: report only when scan history is % full + * @EXTSCAN_REPORT_EVENTS_EACH_SCAN: report a scan completion event after scan + * @EXTSCAN_REPORT_EVENTS_FULL_RESULTS: forward scan results + * (beacons/probe responses + IEs) + * in real time to HAL, in addition to completion events. + * Note: To keep backward compatibility, + * fire completion events regardless of REPORT_EVENTS_EACH_SCAN. + * @EXTSCAN_REPORT_EVENTS_NO_BATCH: controls batching, + * 0 => batching, 1 => no batching + */ +enum wmi_extscan_report_events_type { + WMI_EXTSCAN_REPORT_EVENTS_BUFFER_FULL = 0x00, + WMI_EXTSCAN_REPORT_EVENTS_EACH_SCAN = 0x01, + WMI_EXTSCAN_REPORT_EVENTS_FULL_RESULTS = 0x02, + WMI_EXTSCAN_REPORT_EVENTS_NO_BATCH = 0x04, +}; + +/** + * struct ipa_offload_control_params - ipa offload parameters + * @offload_type: ipa offload type + * @vdev_id: vdev id + * @enable: ipa offload enable/disable + */ +struct ipa_offload_control_params { + uint32_t offload_type; + uint32_t vdev_id; + uint32_t enable; +}; + +/** + * struct extscan_capabilities_params - ext scan capablities + * @request_id: request_id + * @session_id: session_id + */ +struct extscan_capabilities_params { + uint32_t request_id; + uint8_t session_id; +}; + +/** + * struct extscan_capabilities_reset_params - ext scan capablities reset parameter + * @request_id: request_id + * @session_id: session_id + */ +struct extscan_capabilities_reset_params { + uint32_t request_id; + uint8_t session_id; +}; + +/** + * struct extscan_bssid_hotlist_reset_params - ext scan hotlist reset parameter + * @request_id: request_id + * @session_id: session_id + */ +struct extscan_bssid_hotlist_reset_params { + uint32_t request_id; + uint8_t session_id; +}; + +/** + * struct extscan_stop_req_params - ext scan stop parameter + * @request_id: request_id + * @session_id: session_id + */ +struct extscan_stop_req_params { + uint32_t request_id; + uint8_t session_id; +}; + +/** + * struct ap_threshold_params - ap threshold parameter + * @bssid: mac address + * @low: low threshold + * @high: high threshold + */ +struct ap_threshold_params { + struct cdf_mac_addr bssid; + int32_t low; + int32_t high; +}; + +/** + * struct extscan_set_sig_changereq_params - ext scan channel parameter + * @request_id: mac address + * @session_id: low threshold + * @rssi_sample_size: Number of samples for averaging RSSI + * @lostap_sample_size: Number of missed samples to confirm AP loss + * @min_breaching: Number of APs breaching threshold required for firmware + * @num_ap: no of scanned ap + * @ap: ap threshold parameter + */ +struct extscan_set_sig_changereq_params { + uint32_t request_id; + uint8_t session_id; + uint32_t rssi_sample_size; + uint32_t lostap_sample_size; + uint32_t min_breaching; + uint32_t num_ap; + struct ap_threshold_params ap[WMI_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS]; +}; + +/** + * struct extscan_cached_result_params - ext scan cached parameter + * @request_id: mac address + * @session_id: low threshold + * @flush: cached results flush + */ +struct extscan_cached_result_params { + uint32_t request_id; + uint8_t session_id; + bool flush; +}; + +#ifdef FEATURE_WLAN_SCAN_PNO +/* 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 + * @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 + */ +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; + 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; + uint32_t channel_prediction_full_scan; +#endif +}; + +#endif /* FEATURE_WLAN_SCAN_PNO */ + +#define WMI_WLAN_EXTSCAN_MAX_CHANNELS 36 +#define WMI_WLAN_EXTSCAN_MAX_BUCKETS 16 +#define WMI_WLAN_EXTSCAN_MAX_HOTLIST_APS 128 +#define WMI_WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS 64 +#define WMI_EXTSCAN_MAX_HOTLIST_SSIDS 8 + +/** + * struct wifi_scan_channelspec_params - wifi scan channel parameter + * @channel: Frequency in MHz + * @dwellTimeMs: dwell time + * @flush: cached results flush + * @passive: passive scan + * @chnlClass: channel class + */ +struct wifi_scan_channelspec_params { + uint32_t channel; + uint32_t dwellTimeMs; + bool passive; + uint8_t chnlClass; +}; + +/** + * enum wmi_wifi_band - wifi band + * @WMI_WIFI_BAND_UNSPECIFIED: unspecified band + * @WMI_WIFI_BAND_BG: 2.4 GHz + * @WMI_WIFI_BAND_A: 5 GHz without DFS + * @WMI_WIFI_BAND_ABG: 2.4 GHz + 5 GHz; no DFS + * @WMI_WIFI_BAND_A_DFS_ONLY: 5 GHz DFS only + * @WMI_WIFI_BAND_A_WITH_DFS: 5 GHz with DFS + * @WMI_WIFI_BAND_ABG_WITH_DFS: 2.4 GHz + 5 GHz with DFS + * @WMI_WIFI_BAND_MAX: max range + */ +enum wmi_wifi_band { + WMI_WIFI_BAND_UNSPECIFIED, + WMI_WIFI_BAND_BG = 1, + WMI_WIFI_BAND_A = 2, + WMI_WIFI_BAND_ABG = 3, + WMI_WIFI_BAND_A_DFS_ONLY = 4, + /* 5 is reserved */ + WMI_WIFI_BAND_A_WITH_DFS = 6, + WMI_WIFI_BAND_ABG_WITH_DFS = 7, + /* Keep it last */ + WMI_WIFI_BAND_MAX +}; + +/** + * struct wifi_scan_bucket_params - wifi scan bucket spec + * @bucket: bucket identifier + * @band: wifi band + * @period: Desired period, in millisecond; if this is too + * low, the firmware should choose to generate results as fast as + * it can instead of failing the command byte + * for exponential backoff bucket this is the min_period + * @reportEvents: 0 => normal reporting (reporting rssi history + * only, when rssi history buffer is % full) + * 1 => same as 0 + report a scan completion event after scanning + * this bucket + * 2 => same as 1 + forward scan results + * (beacons/probe responses + IEs) in real time to HAL + * @max_period: if max_period is non zero or different than period, + * then this bucket is an exponential backoff bucket and + * the scan period will grow exponentially as per formula: + * actual_period(N) = period ^ (N/(step_count+1)) to a + * maximum period of max_period + * @exponent: for exponential back off bucket: multiplier: + * new_period = old_period * exponent + * @step_count: for exponential back off bucket, number of scans performed + * at a given period and until the exponent is applied + * @numChannels: channels to scan; these may include DFS channels + * Note that a given channel may appear in multiple buckets + * @min_dwell_time_active: per bucket minimum active dwell time + * @max_dwell_time_active: per bucket maximum active dwell time + * @min_dwell_time_passive: per bucket minimum passive dwell time + * @max_dwell_time_passive: per bucket maximum passive dwell time + * @channels: Channel list + */ +struct wifi_scan_bucket_params { + uint8_t bucket; + enum wmi_wifi_band band; + uint32_t period; + uint32_t reportEvents; + uint32_t max_period; + uint32_t exponent; + uint32_t step_count; + uint32_t numChannels; + uint32_t min_dwell_time_active; + uint32_t max_dwell_time_active; + uint32_t min_dwell_time_passive; + uint32_t max_dwell_time_passive; + struct wifi_scan_channelspec_params channels[WMI_WLAN_EXTSCAN_MAX_CHANNELS]; +}; + +/** + * struct wifi_scan_cmd_req_params - wifi scan command request params + * @basePeriod: base timer period + * @maxAPperScan: max ap per scan + * @report_threshold_percent: report threshold + * in %, when buffer is this much full, wake up host + * @report_threshold_num_scans: report threshold number of scans + * in number of scans, wake up host after these many scans + * @requestId: request id + * @sessionId: session id + * @numBuckets: number of buckets + * @min_dwell_time_active: per bucket minimum active dwell time + * @max_dwell_time_active: per bucket maximum active dwell time + * @min_dwell_time_passive: per bucket minimum passive dwell time + * @max_dwell_time_passive: per bucket maximum passive dwell time + * @configuration_flags: configuration flags + * @buckets: buckets array + */ +struct wifi_scan_cmd_req_params { + uint32_t basePeriod; + uint32_t maxAPperScan; + + uint32_t report_threshold_percent; + uint32_t report_threshold_num_scans; + + uint32_t requestId; + uint8_t sessionId; + uint32_t numBuckets; + + uint32_t min_dwell_time_active; + uint32_t max_dwell_time_active; + uint32_t min_dwell_time_passive; + uint32_t max_dwell_time_passive; + uint32_t configuration_flags; + struct wifi_scan_bucket_params buckets[WMI_WLAN_EXTSCAN_MAX_BUCKETS]; +}; + +#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) +#define WMI_CFG_VALID_CHANNEL_LIST_LEN 100 + +/** + * struct plm_req_params - plm req parameter + * @diag_token: Dialog token + * @meas_token: measurement token + * @num_bursts: total number of bursts + * @burst_int: burst interval in seconds + * @meas_duration:in TU's,STA goes off-ch + * @burst_len: no of times the STA should cycle through PLM ch list + * @desired_tx_pwr: desired tx power + * @mac_addr: MC dest addr + * @plm_num_ch: channel numbers + * @plm_ch_list: channel list + * @session_id: session id + * @enable: enable/disable + */ +struct plm_req_params { + uint16_t diag_token; + uint16_t meas_token; + uint16_t num_bursts; + uint16_t burst_int; + uint16_t meas_duration; + /* no of times the STA should cycle through PLM ch list */ + uint8_t burst_len; + int8_t desired_tx_pwr; + struct cdf_mac_addr mac_addr; + /* no of channels */ + uint8_t plm_num_ch; + /* channel numbers */ + uint8_t plm_ch_list[WMI_CFG_VALID_CHANNEL_LIST_LEN]; + uint8_t session_id; + bool enable; +}; +#endif + + +/** + * struct mac_ts_info_tfc - mac ts info parameters + * @burstSizeDefn: burst size + * @reserved: reserved + * @ackPolicy: ack policy + * @psb: psb + * @aggregation: aggregation + * @accessPolicy: access policy + * @direction: direction + * @tsid: direction + * @trafficType: traffic type + */ +struct mac_ts_info_tfc { +#ifndef ANI_LITTLE_BIT_ENDIAN + uint8_t burstSizeDefn:1; + uint8_t reserved:7; +#else + uint8_t reserved:7; + uint8_t burstSizeDefn:1; +#endif + +#ifndef ANI_LITTLE_BIT_ENDIAN + uint16_t ackPolicy:2; + uint16_t userPrio:3; + uint16_t psb:1; + uint16_t aggregation:1; + uint16_t accessPolicy:2; + uint16_t direction:2; + uint16_t tsid:4; + uint16_t trafficType:1; +#else + uint16_t trafficType:1; + uint16_t tsid:4; + uint16_t direction:2; + uint16_t accessPolicy:2; + uint16_t aggregation:1; + uint16_t psb:1; + uint16_t userPrio:3; + uint16_t ackPolicy:2; +#endif +} cdf_packed; + +/** + * struct mac_ts_info_sch - mac ts info schedule parameters + * @rsvd: reserved + * @schedule: schedule bit + */ +struct mac_ts_info_sch { +#ifndef ANI_LITTLE_BIT_ENDIAN + uint8_t rsvd:7; + uint8_t schedule:1; +#else + uint8_t schedule:1; + uint8_t rsvd:7; +#endif +} cdf_packed; + +/** + * struct mac_ts_info_sch - mac ts info schedule parameters + * @traffic: mac tfc parameter + * @schedule: mac schedule parameters + */ +struct mac_ts_info { + struct mac_ts_info_tfc traffic; + struct mac_ts_info_sch schedule; +} cdf_packed; + +/** + * struct mac_tspec_ie - mac ts spec + * @type: type + * @length: length + * @tsinfo: tsinfo + * @nomMsduSz: nomMsduSz + * @maxMsduSz: maxMsduSz + * @minSvcInterval: minSvcInterval + * @maxSvcInterval: maxSvcInterval + * @inactInterval: inactInterval + * @suspendInterval: suspendInterval + * @svcStartTime: svcStartTime + * @minDataRate: minDataRate + * @meanDataRate: meanDataRate + * @peakDataRate: peakDataRate + * @maxBurstSz: maxBurstSz + * @delayBound: delayBound + * @minPhyRate: minPhyRate + * @surplusBw: surplusBw + * @mediumTime: mediumTime + */ +struct mac_tspec_ie { + uint8_t type; + uint8_t length; + struct mac_ts_info tsinfo; + uint16_t nomMsduSz; + uint16_t maxMsduSz; + uint32_t minSvcInterval; + uint32_t maxSvcInterval; + uint32_t inactInterval; + uint32_t suspendInterval; + uint32_t svcStartTime; + uint32_t minDataRate; + uint32_t meanDataRate; + uint32_t peakDataRate; + uint32_t maxBurstSz; + uint32_t delayBound; + uint32_t minPhyRate; + uint16_t surplusBw; + uint16_t mediumTime; +} cdf_packed; + +/** + * struct add_ts_param - ADDTS related parameters + * @staIdx: station index + * @tspecIdx: TSPEC handler uniquely identifying a TSPEC for a STA in a BSS + * @tspec: tspec value + * @status: CDF status + * @sessionId: session id + * @tsm_interval: TSM interval period passed from lim to WMA + * @setRICparams: RIC parameters + * @sme_session_id: sme session id + */ +struct add_ts_param { + uint16_t staIdx; + uint16_t tspecIdx; + struct mac_tspec_ie tspec; + CDF_STATUS status; + uint8_t sessionId; +#ifdef FEATURE_WLAN_ESE + uint16_t tsm_interval; +#endif /* FEATURE_WLAN_ESE */ +#ifdef WLAN_FEATURE_ROAM_OFFLOAD + uint8_t setRICparams; +#endif /* WLAN_FEATURE_ROAM_OFFLOAD */ + uint8_t sme_session_id; +}; + +/** + * struct delts_req_info - DELTS request parameter + * @tsinfo: ts info + * @tspec: ts spec + * @wmeTspecPresent: wme ts spec flag + * @wsmTspecPresent: wsm ts spec flag + * @lleTspecPresent: lle ts spec flag + */ +struct delts_req_info { + struct mac_ts_info tsinfo; + struct mac_tspec_ie tspec; + uint8_t wmeTspecPresent:1; + uint8_t wsmTspecPresent:1; + uint8_t lleTspecPresent:1; +}; + +/** + * struct del_ts_params - DELTS related parameters + * @staIdx: station index + * @tspecIdx: TSPEC identifier uniquely identifying a TSPEC for a STA in a BSS + * @bssId: BSSID + * @sessionId: session id + * @userPrio: user priority + * @delTsInfo: DELTS info + * @setRICparams: RIC parameters + */ +struct del_ts_params { + uint16_t staIdx; + uint16_t tspecIdx; + uint8_t bssId[WMI_ETH_LEN]; + uint8_t sessionId; + uint8_t userPrio; +#ifdef WLAN_FEATURE_ROAM_OFFLOAD + struct delts_req_info delTsInfo; + uint8_t setRICparams; +#endif /* WLAN_FEATURE_ROAM_OFFLOAD */ +}; + +/** + * struct ll_stats_clear_params - ll stats clear parameter + * @req_id: request id + * @sta_id: sta id + * @stats_clear_mask: stats clear mask + * @stop_req: stop request + */ +struct ll_stats_clear_params { + uint32_t req_id; + uint8_t sta_id; + uint32_t stats_clear_mask; + uint8_t stop_req; +}; + +/** + * struct ll_stats_set_params - ll stats get parameter + * @req_id: request id + * @sta_id: sta id + * @mpdu_size_threshold: mpdu sixe threshold + * @aggressive_statistics_gathering: aggressive_statistics_gathering + */ +struct ll_stats_set_params { + uint32_t req_id; + uint8_t sta_id; + uint32_t mpdu_size_threshold; + uint32_t aggressive_statistics_gathering; +}; + +/** + * struct ll_stats_get_params - ll stats parameter + * @req_id: request id + * @sta_id: sta id + * @param_id_mask: param is mask + */ +struct ll_stats_get_params { + uint32_t req_id; + uint8_t sta_id; + uint32_t param_id_mask; +}; + +/** + * struct pe_stats_req - pe stats parameter + * @msg_type: message type is same as the request type + * @msg_len: length of the entire request + * @sta_id: Per STA stats request must contain valid + * @stats_mask: categories of stats requested + * @session_id: wsm ts spec flag + */ +struct pe_stats_req { + /* Common for all types are requests */ + uint16_t msg_type; + uint16_t msg_len; + uint32_t sta_id; + /* categories of stats requested. look at ePEStatsMask */ + uint32_t stats_mask; + uint8_t session_id; +}; + +/** + * struct link_status_params - link stats parameter + * @msg_type: message type is same as the request type + * @msg_len: length of the entire request + * @link_status: wme ts spec flag + * @session_id: wsm ts spec flag + */ +struct link_status_params { + uint16_t msg_type; + uint16_t msg_len; + uint8_t link_status; + uint8_t session_id; +}; + +/** + * struct dhcp_stop_ind_params - DHCP Stop indication message + * @msgtype: message type is same as the request type + * @msglen: length of the entire request + * @device_mode: Mode of the device(ex:STA, AP) + * @adapter_macaddr: MAC address of the adapter + * @peer_macaddr: MAC address of the connected peer + */ +struct dhcp_stop_ind_params { + uint16_t msgtype; + uint16_t msglen; + uint8_t device_mode; + struct cdf_mac_addr adapter_macaddr; + struct cdf_mac_addr peer_macaddr; +}; + +/** + * struct aggr_add_ts_param - ADDTS parameters + * @staIdx: station index + * @tspecIdx: TSPEC handler uniquely identifying a TSPEC for a STA in a BSS + * @tspec: tspec value + * @status: CDF status + * @sessionId: session id + */ +struct aggr_add_ts_param { + uint16_t staIdx; + uint16_t tspecIdx; + struct mac_tspec_ie tspec[WMI_QOS_NUM_AC_MAX]; + CDF_STATUS status[WMI_QOS_NUM_AC_MAX]; + uint8_t sessionId; +}; + +#define WMI_MAX_FILTER_TEST_DATA_LEN 8 +#define WMI_MAX_NUM_MULTICAST_ADDRESS 240 +#define WMI_MAX_NUM_FILTERS 20 +#define WMI_MAX_NUM_TESTS_PER_FILTER 10 + +/** + * enum packet_filter_type - packet filter type + * @WMI_RCV_FILTER_TYPE_INVALID: invalid type + * @WMI_RCV_FILTER_TYPE_FILTER_PKT: filter packet type + * @WMI_RCV_FILTER_TYPE_BUFFER_PKT: buffer packet type + * @WMI_RCV_FILTER_TYPE_MAX_ENUM_SIZE: max enum size + */ +enum packet_filter_type { + WMI_RCV_FILTER_TYPE_INVALID, + WMI_RCV_FILTER_TYPE_FILTER_PKT, + WMI_RCV_FILTER_TYPE_BUFFER_PKT, + WMI_RCV_FILTER_TYPE_MAX_ENUM_SIZE +}; + +/** + * enum packet_protocol_type - packet protocol type + * @WMI_FILTER_HDR_TYPE_INVALID: invalid type + * @WMI_FILTER_HDR_TYPE_MAC: mac type + * @WMI_FILTER_HDR_TYPE_ARP: trp type + * @WMI_FILTER_HDR_TYPE_IPV4: ipv4 type + * @WMI_FILTER_HDR_TYPE_IPV6: ipv6 type + * @WMI_FILTER_HDR_TYPE_UDP: udp type + * @WMI_FILTER_HDR_TYPE_MAX: max type + */ +enum packet_protocol_type { + WMI_FILTER_HDR_TYPE_INVALID, + WMI_FILTER_HDR_TYPE_MAC, + WMI_FILTER_HDR_TYPE_ARP, + WMI_FILTER_HDR_TYPE_IPV4, + WMI_FILTER_HDR_TYPE_IPV6, + WMI_FILTER_HDR_TYPE_UDP, + WMI_FILTER_HDR_TYPE_MAX +}; + +/** + * enum packet_filter_comp_type - packet filter comparison type + * @WMI_FILTER_CMP_TYPE_INVALID: invalid type + * @WMI_FILTER_CMP_TYPE_EQUAL: type equal + * @WMI_FILTER_CMP_TYPE_MASK_EQUAL: mask equal + * @WMI_FILTER_CMP_TYPE_NOT_EQUAL: type not equal + * @WMI_FILTER_CMP_TYPE_MASK_NOT_EQUAL: mask not equal + * @WMI_FILTER_CMP_TYPE_MAX: max type + */ +enum packet_filter_comp_type { + WMI_FILTER_CMP_TYPE_INVALID, + WMI_FILTER_CMP_TYPE_EQUAL, + WMI_FILTER_CMP_TYPE_MASK_EQUAL, + WMI_FILTER_CMP_TYPE_NOT_EQUAL, + WMI_FILTER_CMP_TYPE_MASK_NOT_EQUAL, + WMI_FILTER_CMP_TYPE_MAX +}; + +/** + * struct rcv_pkt_filter_params - recieve packet filter parameters + * @protocolLayer - protocol layer + * @cmpFlag - comparison flag + * @dataLength - data length + * @dataOffset - data offset + * @reserved - resserved + * @compareData - compare data + * @dataMask - data mask + */ +struct rcv_pkt_filter_params { + enum packet_protocol_type protocolLayer; + enum packet_filter_comp_type cmpFlag; + uint16_t dataLength; + uint8_t dataOffset; + uint8_t reserved; + uint8_t compareData[WMI_MAX_FILTER_TEST_DATA_LEN]; + uint8_t dataMask[WMI_MAX_FILTER_TEST_DATA_LEN]; +}; + +/** + * struct rcv_pkt_filter_config - recieve packet filter info + * @filterId - filter id + * @filterType - filter type + * @numFieldParams - no of fields + * @coalesceTime - reserved parameter + * @self_macaddr - self mac address + * @bssid - Bssid of the connected AP + * @paramsData - data parameter + */ +struct rcv_pkt_filter_config { + uint8_t filterId; + enum packet_filter_type filterType; + uint32_t numFieldParams; + uint32_t coalesceTime; + struct cdf_mac_addr self_macaddr; + struct cdf_mac_addr bssid; + struct rcv_pkt_filter_params paramsData[WMI_MAX_NUM_TESTS_PER_FILTER]; +}; + +/** + * struct vdev_ie_info_param - IE info + * @vdev_id - vdev for which the IE is being sent + * @ie_id - ID of the IE + * @length - length of the IE data + * @data - IE data + * + * This structure is used to store the IE information. + */ +struct vdev_ie_info_param { + uint32_t vdev_id; + uint32_t ie_id; + uint32_t length; + uint8_t *data; +}; + +#define WMI_MAX_NUM_FW_SEGMENTS 4 + +/** + * struct fw_dump_seg_req_param - individual segment details + * @seg_id - segment id. + * @seg_start_addr_lo - lower address of the segment. + * @seg_start_addr_hi - higher address of the segment. + * @seg_length - length of the segment. + * @dst_addr_lo - lower address of the destination buffer. + * @dst_addr_hi - higher address of the destination buffer. + * + * This structure carries the information to firmware about the + * individual segments. This structure is part of firmware memory + * dump request. + */ +struct fw_dump_seg_req_param { + uint8_t seg_id; + uint32_t seg_start_addr_lo; + uint32_t seg_start_addr_hi; + uint32_t seg_length; + uint32_t dst_addr_lo; + uint32_t dst_addr_hi; +}; + +/** + * struct fw_dump_req_param - firmware memory dump request details. + * @request_id - request id. + * @num_seg - requested number of segments. + * @fw_dump_seg_req - individual segment information. + * + * This structure carries information about the firmware + * memory dump request. + */ +struct fw_dump_req_param { + uint32_t request_id; + uint32_t num_seg; + struct fw_dump_seg_req_param segment[WMI_MAX_NUM_FW_SEGMENTS]; +}; + +#define WMI_TDLS_MAX_SUPP_CHANNELS 128 +#define WMI_TDLS_MAX_SUPP_OPER_CLASSES 32 +#define WMI_2_4_GHZ_MAX_FREQ 3000 + +/** + * struct tdls_update_ch_params - channel parameters + * @chanId: ID of the channel + * @pwr: power level + * @dfsSet: is dfs supported or not + * @half_rate: is the channel operating at 10MHz + * @quarter_rate: is the channel operating at 5MHz + */ +struct tdls_update_ch_params { + uint8_t chanId; + uint8_t pwr; + bool dfsSet; + bool half_rate; + bool quarter_rate; +}; + +/** + * struct tdls_peer_cap_params - TDLS peer capablities parameters + * @isPeerResponder: is peer responder or not + * @peerUapsdQueue: peer uapsd queue + * @peerMaxSp: peer max SP value + * @peerBuffStaSupport: peer buffer sta supported or not + * @peerOffChanSupport: peer offchannel support + * @peerCurrOperClass: peer current operating class + * @selfCurrOperClass: self current operating class + * @peerChanLen: peer channel length + * @peerChan: peer channel list + * @peerOperClassLen: peer operating class length + * @peerOperClass: peer operating class + * @prefOffChanNum: peer offchannel number + * @prefOffChanBandwidth: peer offchannel bandwidth + * @opClassForPrefOffChan: operating class for offchannel + */ +struct tdls_peer_cap_params { + uint8_t isPeerResponder; + uint8_t peerUapsdQueue; + uint8_t peerMaxSp; + uint8_t peerBuffStaSupport; + uint8_t peerOffChanSupport; + uint8_t peerCurrOperClass; + uint8_t selfCurrOperClass; + uint8_t peerChanLen; + struct tdls_update_ch_params peerChan[WMI_TDLS_MAX_SUPP_CHANNELS]; + uint8_t peerOperClassLen; + uint8_t peerOperClass[WMI_TDLS_MAX_SUPP_OPER_CLASSES]; + uint8_t prefOffChanNum; + uint8_t prefOffChanBandwidth; + uint8_t opClassForPrefOffChan; +}; + +/** + * struct tdls_peer_state_params - TDLS peer state parameters + * @vdevId: vdev id + * @peerMacAddr: peer mac address + * @peerCap: peer capabality + */ +struct tdls_peer_state_params { + uint32_t vdevId; + uint8_t peerMacAddr[WMI_ETH_LEN]; + uint32_t peerState; + struct tdls_peer_cap_params peerCap; +}; + +/** + * struct wmi_tdls_params - TDLS parameters + * @vdev_id: vdev id + * @tdls_state: TDLS state + * @notification_interval_ms: notification inerval + * @tx_discovery_threshold: tx discovery threshold + * @tx_teardown_threshold: tx teardown threashold + * @rssi_teardown_threshold: RSSI teardown threshold + * @rssi_delta: RSSI delta + * @tdls_options: TDLS options + * @peer_traffic_ind_window: raffic indication window + * @peer_traffic_response_timeout: traffic response timeout + * @puapsd_mask: uapsd mask + * @puapsd_inactivity_time: uapsd inactivity time + * @puapsd_rx_frame_threshold: uapsd rx frame threshold + * @teardown_notification_ms: tdls teardown notification interval + * @tdls_peer_kickout_threshold: tdls packet threshold for + * peer kickout operation + */ +struct wmi_tdls_params { + uint32_t vdev_id; + uint32_t tdls_state; + uint32_t notification_interval_ms; + uint32_t tx_discovery_threshold; + uint32_t tx_teardown_threshold; + int32_t rssi_teardown_threshold; + int32_t rssi_delta; + uint32_t tdls_options; + uint32_t peer_traffic_ind_window; + uint32_t peer_traffic_response_timeout; + uint32_t puapsd_mask; + uint32_t puapsd_inactivity_time; + uint32_t puapsd_rx_frame_threshold; + uint32_t teardown_notification_ms; + uint32_t tdls_peer_kickout_threshold; +}; + +/** + * struct tdls_chan_switch_params - channel switch parameter structure + * @vdev_id: vdev ID + * @peer_mac_addr: Peer mac address + * @tdls_off_ch_bw_offset: Target off-channel bandwitdh offset + * @tdls_off_ch: Target Off Channel + * @oper_class: Operating class for target channel + * @is_responder: Responder or initiator + */ +struct tdls_channel_switch_params { + uint32_t vdev_id; + uint8_t peer_mac_addr[WMI_ETH_LEN]; + uint16_t tdls_off_ch_bw_offset; + uint8_t tdls_off_ch; + uint8_t tdls_sw_mode; + uint8_t oper_class; + uint8_t is_responder; +}; + +/** + * struct dhcp_offload_info_params - dhcp offload parameters + * @vdev_id: request data length + * @dhcpSrvOffloadEnabled: dhcp offload enabled + * @dhcpClientNum: dhcp client no + * @dhcpSrvIP: dhcp server ip + */ +struct dhcp_offload_info_params { + uint32_t vdev_id; + uint32_t dhcpSrvOffloadEnabled; + uint32_t dhcpClientNum; + uint32_t dhcpSrvIP; +}; + +/** + * struct nan_req_params - NAN request params + * @request_data_len: request data length + * @request_data: request data + */ +struct nan_req_params { + uint16_t request_data_len; + uint8_t request_data[]; +}; + + +/** + * struct app_type2_params - app type2parameter + * @vdev_id: vdev id + * @rc4_key: rc4 key + * @rc4_key_len: rc4 key length + * @ip_id: NC id + * @ip_device_ip: NC IP addres + * @ip_server_ip: Push server IP address + * @tcp_src_port: NC TCP port + * @tcp_dst_port: Push server TCP port + * @tcp_seq: tcp sequence + * @tcp_ack_seq: tcp ack sequence + * @keepalive_init: Initial ping interval + * @keepalive_min: Minimum ping interval + * @keepalive_max: Maximum ping interval + * @keepalive_inc: Increment of ping interval + * @gateway_mac: gateway mac address + * @tcp_tx_timeout_val: tcp tx timeout value + * @tcp_rx_timeout_val: tcp rx timeout value + */ +struct app_type2_params { + uint8_t vdev_id; + uint8_t rc4_key[16]; + uint32_t rc4_key_len; + /** ip header parameter */ + uint32_t ip_id; + uint32_t ip_device_ip; + uint32_t ip_server_ip; + /** tcp header parameter */ + uint16_t tcp_src_port; + uint16_t tcp_dst_port; + uint32_t tcp_seq; + uint32_t tcp_ack_seq; + uint32_t keepalive_init; + uint32_t keepalive_min; + uint32_t keepalive_max; + uint32_t keepalive_inc; + struct cdf_mac_addr gateway_mac; + uint32_t tcp_tx_timeout_val; + uint32_t tcp_rx_timeout_val; +}; + +/** + * struct app_type1_params - app type1 parameter + * @vdev_id: vdev id + * @wakee_mac_addr: mac address + * @identification_id: identification id + * @password: password + * @id_length: id length + * @pass_length: password length + */ +struct app_type1_params { + uint8_t vdev_id; + struct cdf_mac_addr wakee_mac_addr; + uint8_t identification_id[8]; + uint8_t password[16]; + uint32_t id_length; + uint32_t pass_length; +}; + +/** + * enum wmi_ext_wow_type - wow type + * @WMI_EXT_WOW_TYPE_APP_TYPE1: only enable wakeup for app type1 + * @WMI_EXT_WOW_TYPE_APP_TYPE2: only enable wakeup for app type2 + * @WMI_EXT_WOW_TYPE_APP_TYPE1_2: enable wakeup for app type1&2 + */ +enum wmi_ext_wow_type { + WMI_EXT_WOW_TYPE_APP_TYPE1, + WMI_EXT_WOW_TYPE_APP_TYPE2, + WMI_EXT_WOW_TYPE_APP_TYPE1_2, +}; + +/** + * struct ext_wow_params - ext wow parameters + * @vdev_id: vdev id + * @type: wow type + * @wakeup_pin_num: wake up gpio no + */ +struct ext_wow_params { + uint8_t vdev_id; + enum wmi_ext_wow_type type; + uint32_t wakeup_pin_num; +}; + +/** + * struct stats_ext_params - ext stats request + * @vdev_id: vdev id + * @request_data_len: request data length + * @request_data: request data + */ +struct stats_ext_params { + uint32_t vdev_id; + uint32_t request_data_len; + uint8_t request_data[]; +}; + +#define WMI_PERIODIC_TX_PTRN_MAX_SIZE 1536 +/** + * struct periodic_tx_pattern - periodic tx pattern + * @mac_address: MAC Address for the adapter + * @ucPtrnId: Pattern ID + * @ucPtrnSize: Pattern size + * @usPtrnIntervalMs: in ms + * @ucPattern: Pattern buffer + */ +struct periodic_tx_pattern { + struct cdf_mac_addr mac_address; + uint8_t ucPtrnId; + uint16_t ucPtrnSize; + uint32_t usPtrnIntervalMs; + uint8_t ucPattern[WMI_PERIODIC_TX_PTRN_MAX_SIZE]; +}; + +#define WMI_GTK_OFFLOAD_KEK_BYTES 16 +#define WMI_GTK_OFFLOAD_KCK_BYTES 16 + +/** + * struct gtk_offload_params - gtk offload parameters + * @ulFlags: optional flags + * @aKCK: Key confirmation key + * @aKEK: key encryption key + * @ullKeyReplayCounter: replay counter + * @bssid: bss id + */ +struct gtk_offload_params { + uint32_t ulFlags; + uint8_t aKCK[WMI_GTK_OFFLOAD_KCK_BYTES]; + uint8_t aKEK[WMI_GTK_OFFLOAD_KEK_BYTES]; + uint64_t ullKeyReplayCounter; + struct cdf_mac_addr bssid; +}; + +/** + * struct flashing_req_params - led flashing parameter + * @reqId: request id + * @pattern_id: pattern identifier. 0: disconnected 1: connected + * @led_x0: led flashing parameter0 + * @led_x1: led flashing parameter1 + */ +struct flashing_req_params { + uint32_t req_id; + uint32_t pattern_id; + uint32_t led_x0; + uint32_t led_x1; +}; + +struct wmi_host_mem_chunk { + uint32_t *vaddr; + uint32_t paddr; + cdf_dma_mem_context(memctx); + uint32_t len; + uint32_t req_id; +}; + +struct target_resource_config { + uint32_t num_vdevs; + uint32_t num_peers; + uint32_t num_active_peers; + uint32_t num_offload_peers; + uint32_t num_offload_reorder_buffs; + uint32_t num_peer_keys; + uint32_t num_tids; + uint32_t ast_skid_limit; + uint32_t tx_chain_mask; + uint32_t rx_chain_mask; + uint32_t rx_timeout_pri[4]; + uint32_t rx_decap_mode; + uint32_t scan_max_pending_req; + uint32_t bmiss_offload_max_vdev; + uint32_t roam_offload_max_vdev; + uint32_t roam_offload_max_ap_profiles; + uint32_t num_mcast_groups; + uint32_t num_mcast_table_elems; + uint32_t mcast2ucast_mode; + uint32_t tx_dbg_log_size; + uint32_t num_wds_entries; + uint32_t dma_burst_size; + uint32_t mac_aggr_delim; + uint32_t rx_skip_defrag_timeout_dup_detection_check; + uint32_t vow_config; + uint32_t gtk_offload_max_vdev; + uint32_t num_msdu_desc; /* Number of msdu desc */ + uint32_t max_frag_entries; + /* End common */ + + /* Added in MCL */ + uint32_t num_tdls_vdevs; + uint32_t num_tdls_conn_table_entries; + uint32_t beacon_tx_offload_max_vdev; + uint32_t num_multicast_filter_entries; + uint32_t num_wow_filters; + uint32_t num_keep_alive_pattern; + uint32_t keep_alive_pattern_size; + uint32_t max_tdls_concurrent_sleep_sta; + uint32_t max_tdls_concurrent_buffer_sta; + uint32_t wmi_send_separate; + uint32_t num_ocb_vdevs; + uint32_t num_ocb_channels; + uint32_t num_ocb_schedules; +}; + +/** + * struct wmi_wifi_start_log - Structure to store the params sent to start/ + * stop logging + * @name: Attribute which indicates the type of logging like per packet + * statistics, connectivity etc. + * @verbose_level: Verbose level which can be 0,1,2,3 + * @flag: Flag field for future use + */ +struct wmi_wifi_start_log { + uint32_t ring_id; + uint32_t verbose_level; + uint32_t flag; +}; + +/** + * struct wmi_pcl_list - Format of PCL + * @pcl_list: List of preferred channels + * @pcl_len: Number of channels in the PCL + */ +struct wmi_pcl_list { + uint8_t pcl_list[128]; + uint32_t pcl_len; +}; + +/** + * struct wmi_hw_mode_params - HW mode params + * @mac0_tx_ss: MAC0 Tx spatial stream + * @mac0_rx_ss: MAC0 Rx spatial stream + * @mac1_tx_ss: MAC1 Tx spatial stream + * @mac1_rx_ss: MAC1 Rx spatial stream + * @mac0_bw: MAC0 bandwidth + * @mac1_bw: MAC1 bandwidth + * @dbs_cap: DBS capabality + * @agile_dfs_cap: Agile DFS capabality + */ +struct wmi_hw_mode_params { + uint8_t mac0_tx_ss; + uint8_t mac0_rx_ss; + uint8_t mac1_tx_ss; + uint8_t mac1_rx_ss; + uint8_t mac0_bw; + uint8_t mac1_bw; + uint8_t dbs_cap; + uint8_t agile_dfs_cap; +}; + +/** + * struct wmi_dual_mac_config - Dual MAC configuration + * @scan_config: Scan configuration + * @fw_mode_config: FW mode configuration + * @set_dual_mac_cb: Callback function to be executed on response to the command + */ +struct wmi_dual_mac_config { + uint32_t scan_config; + uint32_t fw_mode_config; + void *set_dual_mac_cb; +}; + +#ifdef WLAN_NS_OFFLOAD +/** + * struct ns_offload_req_params - ns offload request paramter + * @srcIPv6Addr: src ipv6 address + * @selfIPv6Addr: self ipv6 address + * @targetIPv6Addr: target ipv6 address + * @self_macaddr: self mac address + * @srcIPv6AddrValid: src ipv6 address valid flag + * @targetIPv6AddrValid: target ipv6 address valid flag + * @slotIdx: slot index + */ +struct ns_offload_req_params { + uint8_t srcIPv6Addr[WMI_MAC_IPV6_ADDR_LEN]; + uint8_t selfIPv6Addr[WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][WMI_MAC_IPV6_ADDR_LEN]; + uint8_t targetIPv6Addr[WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][WMI_MAC_IPV6_ADDR_LEN]; + struct cdf_mac_addr self_macaddr; + uint8_t srcIPv6AddrValid; + uint8_t targetIPv6AddrValid[WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA]; + uint8_t slotIdx; +}; +#endif /* WLAN_NS_OFFLOAD */ + +/** + * struct host_offload_req_param - arp offload parameter + * @offloadType: offload type + * @enableOrDisable: enable or disable + * @num_ns_offload_count: offload count + */ +struct host_offload_req_param { + uint8_t offloadType; + uint8_t enableOrDisable; + uint32_t num_ns_offload_count; + union { + uint8_t hostIpv4Addr[WMI_IPV4_ADDR_LEN]; + uint8_t hostIpv6Addr[WMI_MAC_IPV6_ADDR_LEN]; + } params; +#ifdef WLAN_NS_OFFLOAD + struct ns_offload_req_params nsOffloadInfo; +#endif /* WLAN_NS_OFFLOAD */ + struct cdf_mac_addr bssid; +}; + +/** + * struct ssid_hotlist_param - param for SSID Hotlist + * @ssid: SSID which is being hotlisted + * @band: Band in which the given SSID should be scanned + * @rssi_low: Low bound on RSSI + * @rssi_high: High bound on RSSI + */ +struct ssid_hotlist_param { + struct mac_ssid ssid; + uint8_t band; + int32_t rssi_low; + int32_t rssi_high; +}; + +/** + * struct ssid_hotlist_request_params - set SSID hotlist request struct + * @request_id: ID of the request + * @session_id: ID of the session + * @lost_ssid_sample_size: Number of consecutive scans in which the SSID + * must not be seen in order to consider the SSID "lost" + * @ssid_count: Number of valid entries in the @ssids array + * @ssids: Array that defines the SSIDs that are in the hotlist + */ +struct ssid_hotlist_request_params { + uint32_t request_id; + uint8_t session_id; + uint32_t lost_ssid_sample_size; + uint32_t ssid_count; + struct ssid_hotlist_param ssids[WMI_EXTSCAN_MAX_HOTLIST_SSIDS]; +}; + +/** + * struct wmi_unit_test_cmd - unit test command parameters + * @vdev_id: vdev id + * @module_id: module id + * @num_args: number of arguments + * @args: arguments + */ +struct wmi_unit_test_cmd { + uint32_t vdev_id; + WLAN_MODULE_ID module_id; + uint32_t num_args; + uint32_t args[WMI_MAX_NUM_ARGS]; +}; + +/** + * struct wmi_roam_invoke_cmd - roam invoke command + * @vdev_id: vdev id + * @bssid: mac address + * @channel: channel + */ +struct wmi_roam_invoke_cmd { + uint32_t vdev_id; + uint8_t bssid[IEEE80211_ADDR_LEN]; + uint32_t channel; +}; + +/** + * struct ext_scan_setbssi_hotlist_params - set hotlist request + * @requestId: request identifier + * @sessionId: session identifier + * @lost_ap_sample_size: number of samples to confirm AP loss + * @numAp: Number of hotlist APs + * @ap: hotlist APs + */ +struct ext_scan_setbssi_hotlist_params { + uint32_t requestId; + uint8_t sessionId; + + uint32_t lost_ap_sample_size; + uint32_t numAp; + struct ap_threshold_params ap[WMI_WLAN_EXTSCAN_MAX_HOTLIST_APS]; +}; #endif /* _WMI_UNIFIED_PARAM_H_ */ diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index c9c41eaf9f..b1fa046cbf 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -69,168 +69,274 @@ struct fwdebug { #endif /* WLAN_OPEN_SOURCE */ struct wmi_ops { -int32_t (*send_vdev_create_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_vdev_create_cmd)(wmi_unified_t wmi_handle, uint8_t macaddr[IEEE80211_ADDR_LEN], struct vdev_create_params *param); -int32_t (*send_vdev_delete_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_vdev_delete_cmd)(wmi_unified_t wmi_handle, uint8_t if_id); -int32_t (*send_vdev_stop_cmd)(wmi_unified_t wmi, +CDF_STATUS (*send_vdev_stop_cmd)(wmi_unified_t wmi, uint8_t vdev_id); -int32_t (*send_vdev_down_cmd)(wmi_unified_t wmi, +CDF_STATUS (*send_vdev_down_cmd)(wmi_unified_t wmi, uint8_t vdev_id); -int32_t (*send_peer_flush_tids_cmd)(wmi_unified_t wmi, +CDF_STATUS (*send_peer_flush_tids_cmd)(wmi_unified_t wmi, uint8_t peer_addr[IEEE80211_ADDR_LEN], struct peer_flush_params *param); -int32_t (*send_peer_delete_cmd)(wmi_unified_t wmi, +CDF_STATUS (*send_peer_delete_cmd)(wmi_unified_t wmi, uint8_t peer_addr[IEEE80211_ADDR_LEN], uint8_t vdev_id); -int32_t (*send_peer_param_cmd)(wmi_unified_t wmi, +CDF_STATUS (*send_peer_param_cmd)(wmi_unified_t wmi, uint8_t peer_addr[IEEE80211_ADDR_LEN], struct peer_set_params *param); -int32_t (*send_vdev_up_cmd)(wmi_unified_t wmi, +CDF_STATUS (*send_vdev_up_cmd)(wmi_unified_t wmi, uint8_t bssid[IEEE80211_ADDR_LEN], struct vdev_up_params *params); -int32_t (*send_peer_create_cmd)(wmi_unified_t wmi, +CDF_STATUS (*send_peer_create_cmd)(wmi_unified_t wmi, struct peer_create_params *param); -int32_t (*send_green_ap_ps_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_green_ap_ps_cmd)(wmi_unified_t wmi_handle, uint32_t value, uint8_t mac_id); -int32_t +CDF_STATUS (*send_pdev_utf_cmd)(wmi_unified_t wmi_handle, struct pdev_utf_params *param, uint8_t mac_id); -int32_t +CDF_STATUS (*send_pdev_param_cmd)(wmi_unified_t wmi_handle, struct pdev_params *param, uint8_t mac_id); -int32_t (*send_suspend_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_suspend_cmd)(wmi_unified_t wmi_handle, struct suspend_params *param, uint8_t mac_id); -int32_t (*send_resume_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_resume_cmd)(wmi_unified_t wmi_handle, uint8_t mac_id); -int32_t (*send_wow_enable_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_wow_enable_cmd)(wmi_unified_t wmi_handle, struct wow_cmd_params *param, uint8_t mac_id); -int32_t (*send_set_ap_ps_param_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_set_ap_ps_param_cmd)(wmi_unified_t wmi_handle, uint8_t *peer_addr, struct ap_ps_params *param); -int32_t (*send_set_sta_ps_param_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_set_sta_ps_param_cmd)(wmi_unified_t wmi_handle, struct sta_ps_params *param); -int32_t (*send_crash_inject_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_crash_inject_cmd)(wmi_unified_t wmi_handle, struct crash_inject *param); -int32_t +CDF_STATUS (*send_dbglog_cmd)(wmi_unified_t wmi_handle, struct dbglog_params *dbglog_param); -int32_t (*send_vdev_set_param_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_vdev_set_param_cmd)(wmi_unified_t wmi_handle, struct vdev_set_params *param); -int32_t (*send_stats_request_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_stats_request_cmd)(wmi_unified_t wmi_handle, uint8_t macaddr[IEEE80211_ADDR_LEN], struct stats_request_params *param); -int32_t (*send_packet_log_enable_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_packet_log_enable_cmd)(wmi_unified_t wmi_handle, uint8_t macaddr[IEEE80211_ADDR_LEN], struct packet_enable_params *param); -int32_t (*send_beacon_send_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_beacon_send_cmd)(wmi_unified_t wmi_handle, struct beacon_params *param); -int32_t (*send_peer_assoc_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_peer_assoc_cmd)(wmi_unified_t wmi_handle, struct peer_assoc_params *param); -int32_t (*send_scan_start_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_scan_start_cmd)(wmi_unified_t wmi_handle, struct scan_start_params *param); -int32_t (*send_scan_stop_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_scan_stop_cmd)(wmi_unified_t wmi_handle, struct scan_stop_params *param); -int32_t (*send_scan_chan_list_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_scan_chan_list_cmd)(wmi_unified_t wmi_handle, struct scan_chan_list_params *param); -int32_t (*send_mgmt_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_mgmt_cmd)(wmi_unified_t wmi_handle, struct wmi_mgmt_params *param); -int32_t (*send_modem_power_state_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_modem_power_state_cmd)(wmi_unified_t wmi_handle, uint32_t param_value); -int32_t (*send_set_sta_ps_mode_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_set_sta_ps_mode_cmd)(wmi_unified_t wmi_handle, uint32_t vdev_id, uint8_t val); -int32_t (*send_get_temperature_cmd)(wmi_unified_t wmi_handle); +CDF_STATUS (*send_get_temperature_cmd)(wmi_unified_t wmi_handle); -int32_t (*send_set_p2pgo_oppps_req_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_set_p2pgo_oppps_req_cmd)(wmi_unified_t wmi_handle, struct p2p_ps_params *oppps); -int32_t (*send_set_p2pgo_noa_req_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_set_p2pgo_noa_req_cmd)(wmi_unified_t wmi_handle, struct p2p_ps_params *noa); -int32_t (*send_set_smps_params_cmd)(wmi_unified_t wmi_handle, uint8_t vdev_id, - int value); +CDF_STATUS (*send_set_smps_params_cmd)(wmi_unified_t wmi_handle, + uint8_t vdev_id, + int value); -int32_t (*send_set_mimops_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_set_mimops_cmd)(wmi_unified_t wmi_handle, uint8_t vdev_id, int value); -int32_t (*send_set_sta_uapsd_auto_trig_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_set_sta_uapsd_auto_trig_cmd)(wmi_unified_t wmi_handle, struct sta_uapsd_trig_params *param); -int32_t (*send_ocb_set_utc_time_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_ocb_set_utc_time_cmd)(wmi_unified_t wmi_handle, struct ocb_utc_param *utc); -int32_t (*send_ocb_get_tsf_timer_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_ocb_get_tsf_timer_cmd)(wmi_unified_t wmi_handle, uint8_t vdev_id); -int32_t (*send_ocb_start_timing_advert_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_ocb_start_timing_advert_cmd)(wmi_unified_t wmi_handle, struct ocb_timing_advert_param *timing_advert); -int32_t (*send_ocb_stop_timing_advert_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_ocb_stop_timing_advert_cmd)(wmi_unified_t wmi_handle, struct ocb_timing_advert_param *timing_advert); -int32_t (*send_dcc_get_stats_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_dcc_get_stats_cmd)(wmi_unified_t wmi_handle, struct dcc_get_stats_param *get_stats_param); -int32_t (*send_dcc_clear_stats_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_dcc_clear_stats_cmd)(wmi_unified_t wmi_handle, uint32_t vdev_id, uint32_t dcc_stats_bitmap); -int32_t (*send_dcc_update_ndl_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_dcc_update_ndl_cmd)(wmi_unified_t wmi_handle, struct dcc_update_ndl_param *update_ndl_param); -int32_t (*send_ocb_set_config_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_ocb_set_config_cmd)(wmi_unified_t wmi_handle, struct ocb_config_param *config, uint32_t *ch_mhz); -int32_t (*send_lro_config_cmd)(wmi_unified_t wmi_handle, + +CDF_STATUS (*send_lro_config_cmd)(wmi_unified_t wmi_handle, struct wmi_lro_config_cmd_t *wmi_lro_cmd); -int32_t (*send_set_thermal_mgmt_cmd)(wmi_unified_t wmi_handle, +CDF_STATUS (*send_set_thermal_mgmt_cmd)(wmi_unified_t wmi_handle, struct thermal_cmd_params *thermal_info); -int32_t (*send_set_mcc_channel_time_quota_cmd) +CDF_STATUS (*send_set_mcc_channel_time_quota_cmd) (wmi_unified_t wmi_handle, uint32_t adapter_1_chan_freq, uint32_t adapter_1_quota, uint32_t adapter_2_chan_freq); -int32_t (*send_set_mcc_channel_time_latency_cmd) +CDF_STATUS (*send_set_mcc_channel_time_latency_cmd) (wmi_unified_t wmi_handle, uint32_t mcc_channel_freq, uint32_t mcc_channel_time_latency); -int32_t (*send_set_enable_disable_mcc_adaptive_scheduler_cmd)( +CDF_STATUS (*send_set_enable_disable_mcc_adaptive_scheduler_cmd)( wmi_unified_t wmi_handle, uint32_t mcc_adaptive_scheduler); + +CDF_STATUS (*send_p2p_go_set_beacon_ie_cmd)(wmi_unified_t wmi_handle, + A_UINT32 vdev_id, uint8_t *p2p_ie); + +CDF_STATUS (*send_probe_rsp_tmpl_send_cmd)(wmi_unified_t wmi_handle, + uint8_t vdev_id, + struct wmi_probe_resp_params *probe_rsp_info, + uint8_t *frm); + +CDF_STATUS (*send_process_update_edca_param_cmd)(wmi_unified_t wmi_handle, + uint8_t vdev_id, + wmi_wmm_vparams gwmm_param[WMI_MAX_NUM_AC]); + +CDF_STATUS (*send_vdev_set_gtx_cfg_cmd)(wmi_unified_t wmi_handle, + uint32_t if_id, + struct wmi_gtx_config *gtx_info); + +CDF_STATUS (*send_set_sta_keep_alive_cmd)(wmi_unified_t wmi_handle, + struct sta_params *params); + +CDF_STATUS (*send_set_sta_sa_query_param_cmd)(wmi_unified_t wmi_handle, + uint8_t vdev_id, uint32_t max_retries, + uint32_t retry_interval); + +CDF_STATUS (*send_bcn_buf_ll_cmd)(wmi_unified_t wmi_handle, + wmi_bcn_send_from_host_cmd_fixed_param *param); + +CDF_STATUS (*send_set_gateway_params_cmd)(wmi_unified_t wmi_handle, + struct gateway_update_req_param *req); + +CDF_STATUS (*send_set_rssi_monitoring_cmd)(wmi_unified_t wmi_handle, + struct rssi_monitor_param *req); + +CDF_STATUS (*send_scan_probe_setoui_cmd)(wmi_unified_t wmi_handle, + struct scan_mac_oui *psetoui); + +CDF_STATUS (*send_reset_passpoint_network_list_cmd)(wmi_unified_t wmi_handle, + struct wifi_passpoint_req_param *req); + +CDF_STATUS (*send_set_passpoint_network_list_cmd)(wmi_unified_t wmi_handle, + struct wifi_passpoint_req_param *req); + +CDF_STATUS (*send_set_epno_network_list_cmd)(wmi_unified_t wmi_handle, + struct wifi_enhanched_pno_params *req); + +CDF_STATUS (*send_extscan_get_capabilities_cmd)(wmi_unified_t wmi_handle, + struct extscan_capabilities_params *pgetcapab); + +CDF_STATUS (*send_extscan_get_cached_results_cmd)(wmi_unified_t wmi_handle, + struct extscan_cached_result_params *pcached_results); + +CDF_STATUS (*send_extscan_stop_change_monitor_cmd)(wmi_unified_t wmi_handle, + struct extscan_capabilities_reset_params *reset_req); + +CDF_STATUS (*send_extscan_start_change_monitor_cmd)(wmi_unified_t wmi_handle, + struct extscan_set_sig_changereq_params * + psigchange); + +CDF_STATUS (*send_extscan_stop_hotlist_monitor_cmd)(wmi_unified_t wmi_handle, + struct extscan_bssid_hotlist_reset_params *photlist_reset); + +CDF_STATUS (*send_stop_extscan_cmd)(wmi_unified_t wmi_handle, + struct extscan_stop_req_params *pstopcmd); + +CDF_STATUS (*send_start_extscan_cmd)(wmi_unified_t wmi_handle, + struct wifi_scan_cmd_req_params *pstart); + +CDF_STATUS (*send_plm_stop_cmd)(wmi_unified_t wmi_handle, + const struct plm_req_params *plm); + +CDF_STATUS (*send_plm_start_cmd)(wmi_unified_t wmi_handle, + const struct plm_req_params *plm, + uint32_t *gchannel_list); + +CDF_STATUS (*send_csa_offload_enable_cmd)(wmi_unified_t wmi_handle, + uint8_t vdev_id); + +CDF_STATUS (*send_pno_stop_cmd)(wmi_unified_t wmi_handle, uint8_t vdev_id); + +CDF_STATUS (*send_pno_start_cmd)(wmi_unified_t wmi_handle, + struct pno_scan_req_params *pno, + uint32_t *gchannel_freq_list); + +CDF_STATUS (*send_ipa_offload_control_cmd)(wmi_unified_t wmi_handle, + struct ipa_offload_control_params *ipa_offload); + +CDF_STATUS (*send_set_ric_req_cmd)(wmi_unified_t wmi_handle, void *msg, + uint8_t is_add_ts); + +CDF_STATUS (*send_process_ll_stats_clear_cmd) + (wmi_unified_t wmi_handle, + const struct ll_stats_clear_params *clear_req, + uint8_t addr[IEEE80211_ADDR_LEN]); + +CDF_STATUS (*send_process_ll_stats_set_cmd) + (wmi_unified_t wmi_handle, const struct ll_stats_set_params *set_req); + +CDF_STATUS (*send_process_ll_stats_get_cmd) + (wmi_unified_t wmi_handle, const struct ll_stats_get_params *get_req, + uint8_t addr[IEEE80211_ADDR_LEN]); + +CDF_STATUS (*send_get_stats_cmd)(wmi_unified_t wmi_handle, + struct pe_stats_req *get_stats_param, + uint8_t addr[IEEE80211_ADDR_LEN]); }; struct wmi_unified { diff --git a/wmi/inc/wmi_unified_tlv.h b/wmi/inc/wmi_unified_tlv.h index ffd98ec6cf..de8c117e33 100644 --- a/wmi/inc/wmi_unified_tlv.h +++ b/wmi/inc/wmi_unified_tlv.h @@ -31,166 +31,268 @@ #include "wmi_unified_param.h" #include "ol_defines.h" /* Fix Me: wmi_unified_t structure definition */ -int32_t send_vdev_create_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_vdev_create_cmd_tlv(wmi_unified_t wmi_handle, uint8_t macaddr[IEEE80211_ADDR_LEN], struct vdev_create_params *param); -int32_t send_vdev_delete_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_vdev_delete_cmd_tlv(wmi_unified_t wmi_handle, uint8_t if_id); -int32_t send_vdev_stop_cmd_tlv(wmi_unified_t wmi, +CDF_STATUS send_vdev_stop_cmd_tlv(wmi_unified_t wmi, uint8_t vdev_id); -int32_t send_vdev_down_cmd_tlv(wmi_unified_t wmi, +CDF_STATUS send_vdev_down_cmd_tlv(wmi_unified_t wmi, uint8_t vdev_id); -int32_t send_peer_flush_tids_cmd_tlv(wmi_unified_t wmi, +CDF_STATUS send_peer_flush_tids_cmd_tlv(wmi_unified_t wmi, uint8_t peer_addr[IEEE80211_ADDR_LEN], struct peer_flush_params *param); -int32_t send_peer_delete_cmd_tlv(wmi_unified_t wmi, +CDF_STATUS send_peer_delete_cmd_tlv(wmi_unified_t wmi, uint8_t peer_addr[IEEE80211_ADDR_LEN], uint8_t vdev_id); -int32_t send_peer_param_cmd_tlv(wmi_unified_t wmi, +CDF_STATUS send_peer_param_cmd_tlv(wmi_unified_t wmi, uint8_t peer_addr[IEEE80211_ADDR_LEN], struct peer_set_params *param); -int32_t send_vdev_up_cmd_tlv(wmi_unified_t wmi, +CDF_STATUS send_vdev_up_cmd_tlv(wmi_unified_t wmi, uint8_t bssid[IEEE80211_ADDR_LEN], struct vdev_up_params *params); -int32_t send_peer_create_cmd_tlv(wmi_unified_t wmi, +CDF_STATUS send_peer_create_cmd_tlv(wmi_unified_t wmi, struct peer_create_params *param); -int32_t send_green_ap_ps_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_green_ap_ps_cmd_tlv(wmi_unified_t wmi_handle, uint32_t value, uint8_t mac_id); -int32_t +CDF_STATUS send_pdev_utf_cmd_tlv(wmi_unified_t wmi_handle, struct pdev_utf_params *param, uint8_t mac_id); -int32_t +CDF_STATUS send_pdev_param_cmd_tlv(wmi_unified_t wmi_handle, struct pdev_params *param, uint8_t mac_id); -int32_t send_suspend_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_suspend_cmd_tlv(wmi_unified_t wmi_handle, struct suspend_params *param, uint8_t mac_id); -int32_t send_resume_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_resume_cmd_tlv(wmi_unified_t wmi_handle, uint8_t mac_id); -int32_t send_wow_enable_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_wow_enable_cmd_tlv(wmi_unified_t wmi_handle, struct wow_cmd_params *param, uint8_t mac_id); -int32_t send_set_ap_ps_param_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_ap_ps_param_cmd_tlv(wmi_unified_t wmi_handle, uint8_t *peer_addr, struct ap_ps_params *param); -int32_t send_set_sta_ps_param_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_sta_ps_param_cmd_tlv(wmi_unified_t wmi_handle, struct sta_ps_params *param); -int32_t send_crash_inject_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_crash_inject_cmd_tlv(wmi_unified_t wmi_handle, struct crash_inject *param); -int32_t +CDF_STATUS send_dbglog_cmd_tlv(wmi_unified_t wmi_handle, struct dbglog_params *dbglog_param); -int32_t send_vdev_set_param_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_vdev_set_param_cmd_tlv(wmi_unified_t wmi_handle, struct vdev_set_params *param); -int32_t send_stats_request_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_stats_request_cmd_tlv(wmi_unified_t wmi_handle, uint8_t macaddr[IEEE80211_ADDR_LEN], struct stats_request_params *param); -int32_t send_packet_log_enable_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_packet_log_enable_cmd_tlv(wmi_unified_t wmi_handle, uint8_t macaddr[IEEE80211_ADDR_LEN], struct packet_enable_params *param); -int32_t send_beacon_send_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_beacon_send_cmd_tlv(wmi_unified_t wmi_handle, struct beacon_params *param); -int32_t send_peer_assoc_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_peer_assoc_cmd_tlv(wmi_unified_t wmi_handle, struct peer_assoc_params *param); -int32_t send_scan_start_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_scan_start_cmd_tlv(wmi_unified_t wmi_handle, struct scan_start_params *param); -int32_t send_scan_stop_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_scan_stop_cmd_tlv(wmi_unified_t wmi_handle, struct scan_stop_params *param); -int32_t send_scan_chan_list_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_scan_chan_list_cmd_tlv(wmi_unified_t wmi_handle, struct scan_chan_list_params *param); -int32_t send_mgmt_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_mgmt_cmd_tlv(wmi_unified_t wmi_handle, struct wmi_mgmt_params *param); -int32_t send_modem_power_state_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_modem_power_state_cmd_tlv(wmi_unified_t wmi_handle, uint32_t param_value); -int32_t send_set_sta_ps_mode_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_sta_ps_mode_cmd_tlv(wmi_unified_t wmi_handle, uint32_t vdev_id, uint8_t val); -int32_t send_set_sta_uapsd_auto_trig_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_sta_uapsd_auto_trig_cmd_tlv(wmi_unified_t wmi_handle, struct sta_uapsd_trig_params *param); -int32_t send_get_temperature_cmd_tlv(wmi_unified_t wmi_handle); +CDF_STATUS send_get_temperature_cmd_tlv(wmi_unified_t wmi_handle); -int32_t send_set_p2pgo_oppps_req_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_p2pgo_oppps_req_cmd_tlv(wmi_unified_t wmi_handle, struct p2p_ps_params *oppps); -int32_t send_set_p2pgo_noa_req_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_p2pgo_noa_req_cmd_tlv(wmi_unified_t wmi_handle, struct p2p_ps_params *noa); -int32_t send_set_smps_params_cmd_tlv(wmi_unified_t wmi_handle, uint8_t vdev_id, +CDF_STATUS send_set_smps_params_cmd_tlv(wmi_unified_t wmi_handle, + uint8_t vdev_id, int value); -int32_t send_set_mimops_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_mimops_cmd_tlv(wmi_unified_t wmi_handle, uint8_t vdev_id, int value); -int32_t send_ocb_set_utc_time_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_ocb_set_utc_time_cmd_tlv(wmi_unified_t wmi_handle, struct ocb_utc_param *utc); -int send_ocb_start_timing_advert_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_ocb_start_timing_advert_cmd_tlv(wmi_unified_t wmi_handle, struct ocb_timing_advert_param *timing_advert); -int send_ocb_stop_timing_advert_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_ocb_stop_timing_advert_cmd_tlv(wmi_unified_t wmi_handle, struct ocb_timing_advert_param *timing_advert); -int send_ocb_get_tsf_timer_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_ocb_get_tsf_timer_cmd_tlv(wmi_unified_t wmi_handle, uint8_t vdev_id); -int32_t send_dcc_get_stats_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_dcc_get_stats_cmd_tlv(wmi_unified_t wmi_handle, struct dcc_get_stats_param *get_stats_param); -int32_t send_dcc_clear_stats_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_dcc_clear_stats_cmd_tlv(wmi_unified_t wmi_handle, uint32_t vdev_id, uint32_t dcc_stats_bitmap); -int send_dcc_update_ndl_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_dcc_update_ndl_cmd_tlv(wmi_unified_t wmi_handle, struct dcc_update_ndl_param *update_ndl_param); -int32_t send_ocb_set_config_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_ocb_set_config_cmd_tlv(wmi_unified_t wmi_handle, struct ocb_config_param *config, uint32_t *ch_mhz); -int32_t send_lro_config_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_lro_config_cmd_tlv(wmi_unified_t wmi_handle, struct wmi_lro_config_cmd_t *wmi_lro_cmd); -int32_t send_set_thermal_mgmt_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_thermal_mgmt_cmd_tlv(wmi_unified_t wmi_handle, struct thermal_cmd_params *thermal_info); -int32_t send_set_mcc_channel_time_quota_cmd_tlv +CDF_STATUS send_set_mcc_channel_time_quota_cmd_tlv (wmi_unified_t wmi_handle, uint32_t adapter_1_chan_freq, uint32_t adapter_1_quota, uint32_t adapter_2_chan_freq); -int32_t send_set_mcc_channel_time_latency_cmd_tlv +CDF_STATUS send_set_mcc_channel_time_latency_cmd_tlv (wmi_unified_t wmi_handle, uint32_t mcc_channel_freq, uint32_t mcc_channel_time_latency); -int32_t send_set_enable_disable_mcc_adaptive_scheduler_cmd_tlv( +CDF_STATUS send_set_enable_disable_mcc_adaptive_scheduler_cmd_tlv( wmi_unified_t wmi_handle, uint32_t mcc_adaptive_scheduler); + +CDF_STATUS send_p2p_go_set_beacon_ie_cmd_tlv(wmi_unified_t wmi_handle, + A_UINT32 vdev_id, uint8_t *p2p_ie); + +CDF_STATUS send_probe_rsp_tmpl_send_cmd_tlv(wmi_unified_t wmi_handle, + uint8_t vdev_id, + struct wmi_probe_resp_params *probe_rsp_info, + uint8_t *frm); + +CDF_STATUS send_process_update_edca_param_cmd_tlv(wmi_unified_t wmi_handle, + uint8_t vdev_id, + wmi_wmm_vparams gwmm_param[WMI_MAX_NUM_AC]); + +CDF_STATUS send_vdev_set_gtx_cfg_cmd_tlv(wmi_unified_t wmi_handle, + uint32_t if_id, + struct wmi_gtx_config *gtx_info); + +CDF_STATUS send_set_sta_keep_alive_cmd_tlv(wmi_unified_t wmi_handle, + struct sta_params *params); + +CDF_STATUS send_set_sta_sa_query_param_cmd_tlv(wmi_unified_t wmi_handle, + uint8_t vdev_id, uint32_t max_retries, + uint32_t retry_interval); + +CDF_STATUS send_bcn_buf_ll_cmd_tlv(wmi_unified_t wmi_handle, + wmi_bcn_send_from_host_cmd_fixed_param *param); + +CDF_STATUS send_set_gateway_params_cmd_tlv(wmi_unified_t wmi_handle, + struct gateway_update_req_param *req); + +CDF_STATUS send_set_rssi_monitoring_cmd_tlv(wmi_unified_t wmi_handle, + struct rssi_monitor_param *req); + +CDF_STATUS send_ipa_offload_control_cmd_tlv(wmi_unified_t wmi_handle, + struct ipa_offload_control_params *ipa_offload); + +CDF_STATUS send_scan_probe_setoui_cmd_tlv(wmi_unified_t wmi_handle, + struct scan_mac_oui *psetoui); + +CDF_STATUS send_reset_passpoint_network_list_cmd_tlv(wmi_unified_t wmi_handle, + struct wifi_passpoint_req_param *req); + +CDF_STATUS send_set_passpoint_network_list_cmd_tlv(wmi_unified_t wmi_handle, + struct wifi_passpoint_req_param *req); + +CDF_STATUS send_set_ric_req_cmd_tlv(wmi_unified_t wmi_handle, void *msg, + uint8_t is_add_ts); + +CDF_STATUS send_set_epno_network_list_cmd_tlv(wmi_unified_t wmi_handle, + struct wifi_enhanched_pno_params *req); + +CDF_STATUS send_extscan_get_capabilities_cmd_tlv(wmi_unified_t wmi_handle, + struct extscan_capabilities_params *pgetcapab); + +CDF_STATUS send_extscan_get_cached_results_cmd_tlv(wmi_unified_t wmi_handle, + struct extscan_cached_result_params *pcached_results); + +CDF_STATUS send_extscan_stop_change_monitor_cmd_tlv(wmi_unified_t wmi_handle, + struct extscan_capabilities_reset_params *reset_req); + +CDF_STATUS send_extscan_start_change_monitor_cmd_tlv(wmi_unified_t wmi_handle, + struct extscan_set_sig_changereq_params * + psigchange); + +CDF_STATUS send_extscan_stop_hotlist_monitor_cmd_tlv(wmi_unified_t wmi_handle, + struct extscan_bssid_hotlist_reset_params *photlist_reset); + +CDF_STATUS send_stop_extscan_cmd_tlv(wmi_unified_t wmi_handle, + struct extscan_stop_req_params *pstopcmd); + +CDF_STATUS send_start_extscan_cmd_tlv(wmi_unified_t wmi_handle, + struct wifi_scan_cmd_req_params *pstart); + +CDF_STATUS send_plm_stop_cmd_tlv(wmi_unified_t wmi_handle, + const struct plm_req_params *plm); + +CDF_STATUS send_plm_start_cmd_tlv(wmi_unified_t wmi_handle, + const struct plm_req_params *plm, + uint32_t *gchannel_list); + +CDF_STATUS send_pno_stop_cmd_tlv(wmi_unified_t wmi_handle, uint8_t vdev_id); + +CDF_STATUS send_pno_start_cmd_tlv(wmi_unified_t wmi_handle, + struct pno_scan_req_params *pno, + uint32_t *gchannel_freq_list); + +CDF_STATUS send_process_ll_stats_clear_cmd_tlv + (wmi_unified_t wmi_handle, + const struct ll_stats_clear_params *clear_req, + uint8_t addr[IEEE80211_ADDR_LEN]); + +CDF_STATUS send_process_ll_stats_set_cmd_tlv + (wmi_unified_t wmi_handle, const struct ll_stats_set_params *set_req); + +CDF_STATUS send_process_ll_stats_get_cmd_tlv + (wmi_unified_t wmi_handle, const struct ll_stats_get_params *get_req, + uint8_t addr[IEEE80211_ADDR_LEN]); + +CDF_STATUS send_get_stats_cmd_tlv(wmi_unified_t wmi_handle, + struct pe_stats_req *get_stats_param, + uint8_t addr[IEEE80211_ADDR_LEN]); diff --git a/wmi/src/wmi_unified_api.c b/wmi/src/wmi_unified_api.c index 7bcba92191..4f1c4aa543 100644 --- a/wmi/src/wmi_unified_api.c +++ b/wmi/src/wmi_unified_api.c @@ -43,7 +43,7 @@ * * Return: 0 for success or error code */ -int32_t wmi_unified_vdev_create_send(void *wmi_hdl, +CDF_STATUS wmi_unified_vdev_create_send(void *wmi_hdl, uint8_t macaddr[IEEE80211_ADDR_LEN], struct vdev_create_params *param) { @@ -63,7 +63,7 @@ int32_t wmi_unified_vdev_create_send(void *wmi_hdl, * * Return: 0 for success or error code */ -int32_t wmi_unified_vdev_delete_send(void *wmi_hdl, +CDF_STATUS wmi_unified_vdev_delete_send(void *wmi_hdl, uint8_t if_id) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -82,7 +82,7 @@ int32_t wmi_unified_vdev_delete_send(void *wmi_hdl, * * Return: 0 for success or erro code */ -int32_t wmi_unified_vdev_stop_send(void *wmi_hdl, +CDF_STATUS wmi_unified_vdev_stop_send(void *wmi_hdl, uint8_t vdev_id) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -101,7 +101,7 @@ int32_t wmi_unified_vdev_stop_send(void *wmi_hdl, * * Return: 0 for success or error code */ -int32_t wmi_unified_vdev_down_send(void *wmi_hdl, uint8_t vdev_id) +CDF_STATUS wmi_unified_vdev_down_send(void *wmi_hdl, uint8_t vdev_id) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -119,7 +119,7 @@ int32_t wmi_unified_vdev_down_send(void *wmi_hdl, uint8_t vdev_id) * * Return: 0 for sucess or error code */ -int32_t wmi_unified_peer_flush_tids_send(void *wmi_hdl, +CDF_STATUS wmi_unified_peer_flush_tids_send(void *wmi_hdl, uint8_t peer_addr[IEEE80211_ADDR_LEN], struct peer_flush_params *param) { @@ -140,7 +140,7 @@ int32_t wmi_unified_peer_flush_tids_send(void *wmi_hdl, * * Return: 0 for success or error code */ -int32_t wmi_unified_peer_delete_send(void *wmi_hdl, +CDF_STATUS wmi_unified_peer_delete_send(void *wmi_hdl, uint8_t peer_addr[IEEE80211_ADDR_LEN], uint8_t vdev_id) @@ -162,7 +162,7 @@ int32_t wmi_unified_peer_delete_send(void *wmi_hdl, * * Return: 0 for success or error code */ -int32_t wmi_set_peer_param_send(void *wmi_hdl, +CDF_STATUS wmi_set_peer_param_send(void *wmi_hdl, uint8_t peer_addr[IEEE80211_ADDR_LEN], struct peer_set_params *param) { @@ -183,7 +183,7 @@ int32_t wmi_set_peer_param_send(void *wmi_hdl, * * Return: 0 for success or error code */ -int32_t wmi_unified_vdev_up_send(void *wmi_hdl, +CDF_STATUS wmi_unified_vdev_up_send(void *wmi_hdl, uint8_t bssid[IEEE80211_ADDR_LEN], struct vdev_up_params *params) { @@ -205,7 +205,7 @@ int32_t wmi_unified_vdev_up_send(void *wmi_hdl, * * Return: 0 for success or error code */ -int32_t wmi_unified_peer_create_send(void *wmi_hdl, +CDF_STATUS wmi_unified_peer_create_send(void *wmi_hdl, struct peer_create_params *param) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -225,7 +225,7 @@ int32_t wmi_unified_peer_create_send(void *wmi_hdl, * * Return: 0 for success or error code */ -int32_t wmi_unified_green_ap_ps_send(void *wmi_hdl, +CDF_STATUS wmi_unified_green_ap_ps_send(void *wmi_hdl, uint32_t value, uint8_t mac_id) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -237,7 +237,7 @@ int32_t wmi_unified_green_ap_ps_send(void *wmi_hdl, return CDF_STATUS_E_FAILURE; } #else -int32_t wmi_unified_green_ap_ps_send(void *wmi_hdl, +CDF_STATUS wmi_unified_green_ap_ps_send(void *wmi_hdl, uint32_t value, uint8_t mac_id) { return 0; @@ -252,7 +252,7 @@ int32_t wmi_unified_green_ap_ps_send(void *wmi_hdl, * * Return: 0 for success or error code */ -int32_t +CDF_STATUS wmi_unified_pdev_utf_cmd_send(void *wmi_hdl, struct pdev_utf_params *param, uint8_t mac_id) @@ -274,7 +274,7 @@ wmi_unified_pdev_utf_cmd_send(void *wmi_hdl, * * Return: 0 on success, errno on failure */ -int32_t +CDF_STATUS wmi_unified_pdev_param_send(void *wmi_hdl, struct pdev_params *param, uint8_t mac_id) @@ -296,7 +296,7 @@ wmi_unified_pdev_param_send(void *wmi_hdl, * * Return: 0 on success and -ve on failure. */ -int32_t wmi_unified_suspend_send(void *wmi_hdl, +CDF_STATUS wmi_unified_suspend_send(void *wmi_hdl, struct suspend_params *param, uint8_t mac_id) { @@ -316,7 +316,7 @@ int32_t wmi_unified_suspend_send(void *wmi_hdl, * * Return: 0 on success and -ve on failure. */ -int32_t wmi_unified_resume_send(void *wmi_hdl, +CDF_STATUS wmi_unified_resume_send(void *wmi_hdl, uint8_t mac_id) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -336,7 +336,7 @@ int32_t wmi_unified_resume_send(void *wmi_hdl, * * Return: 0 on success and -ve on failure. */ -int32_t wmi_unified_wow_enable_send(void *wmi_hdl, +CDF_STATUS wmi_unified_wow_enable_send(void *wmi_hdl, struct wow_cmd_params *param, uint8_t mac_id) { @@ -357,7 +357,7 @@ int32_t wmi_unified_wow_enable_send(void *wmi_hdl, * * Return: 0 for success or error code */ -int32_t wmi_unified_ap_ps_cmd_send(void *wmi_hdl, +CDF_STATUS wmi_unified_ap_ps_cmd_send(void *wmi_hdl, uint8_t *peer_addr, struct ap_ps_params *param) { @@ -379,7 +379,7 @@ int32_t wmi_unified_ap_ps_cmd_send(void *wmi_hdl, * * Return: 0 for success or error code */ -int32_t wmi_unified_sta_ps_cmd_send(void *wmi_hdl, +CDF_STATUS wmi_unified_sta_ps_cmd_send(void *wmi_hdl, struct sta_ps_params *param) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -398,7 +398,7 @@ int32_t wmi_unified_sta_ps_cmd_send(void *wmi_hdl, * * Return: 0 for success or return error */ -int32_t wmi_crash_inject(void *wmi_hdl, +CDF_STATUS wmi_crash_inject(void *wmi_hdl, struct crash_inject *param) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -417,7 +417,7 @@ int32_t wmi_crash_inject(void *wmi_hdl, * * Return: 0 on success and -ve on failure. */ -int32_t +CDF_STATUS wmi_unified_dbglog_cmd_send(void *wmi_hdl, struct dbglog_params *dbglog_param) { @@ -438,7 +438,7 @@ wmi_unified_dbglog_cmd_send(void *wmi_hdl, * * Return: 0 on success and -ve on failure. */ -int32_t wmi_unified_vdev_set_param_send(void *wmi_hdl, +CDF_STATUS wmi_unified_vdev_set_param_send(void *wmi_hdl, struct vdev_set_params *param) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -458,7 +458,7 @@ int32_t wmi_unified_vdev_set_param_send(void *wmi_hdl, * * Return: 0 on success and -ve on failure. */ -int32_t wmi_unified_stats_request_send(void *wmi_hdl, +CDF_STATUS wmi_unified_stats_request_send(void *wmi_hdl, uint8_t macaddr[IEEE80211_ADDR_LEN], struct stats_request_params *param) { @@ -479,7 +479,7 @@ int32_t wmi_unified_stats_request_send(void *wmi_hdl, * * Return: 0 on success and -ve on failure. */ -int32_t wmi_unified_packet_log_enable_send(void *wmi_hdl, +CDF_STATUS wmi_unified_packet_log_enable_send(void *wmi_hdl, uint8_t macaddr[IEEE80211_ADDR_LEN], struct packet_enable_params *param) { @@ -500,7 +500,7 @@ int32_t wmi_unified_packet_log_enable_send(void *wmi_hdl, * * Return: 0 on success and -ve on failure. */ -int32_t wmi_unified_beacon_send_cmd(void *wmi_hdl, +CDF_STATUS wmi_unified_beacon_send_cmd(void *wmi_hdl, struct beacon_params *param) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -520,7 +520,7 @@ int32_t wmi_unified_beacon_send_cmd(void *wmi_hdl, * * Return: 0 on success and -ve on failure. */ -int32_t wmi_unified_peer_assoc_send(void *wmi_hdl, +CDF_STATUS wmi_unified_peer_assoc_send(void *wmi_hdl, struct peer_assoc_params *param) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -540,7 +540,7 @@ int32_t wmi_unified_peer_assoc_send(void *wmi_hdl, * * Return: 0 on success and -ve on failure. */ -int32_t wmi_unified_scan_start_cmd_send(void *wmi_hdl, +CDF_STATUS wmi_unified_scan_start_cmd_send(void *wmi_hdl, struct scan_start_params *param) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -560,7 +560,7 @@ int32_t wmi_unified_scan_start_cmd_send(void *wmi_hdl, * * Return: 0 on success and -ve on failure. */ -int32_t wmi_unified_scan_stop_cmd_send(void *wmi_hdl, +CDF_STATUS wmi_unified_scan_stop_cmd_send(void *wmi_hdl, struct scan_stop_params *param) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -580,7 +580,7 @@ int32_t wmi_unified_scan_stop_cmd_send(void *wmi_hdl, * * Return: 0 on success and -ve on failure. */ -int32_t wmi_unified_scan_chan_list_cmd_send(void *wmi_hdl, +CDF_STATUS wmi_unified_scan_chan_list_cmd_send(void *wmi_hdl, struct scan_chan_list_params *param) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -599,7 +599,7 @@ int32_t wmi_unified_scan_chan_list_cmd_send(void *wmi_hdl, * * Return: 0 on success and -ve on failure. */ -int32_t wmi_mgmt_unified_cmd_send(void *wmi_hdl, +CDF_STATUS wmi_mgmt_unified_cmd_send(void *wmi_hdl, struct wmi_mgmt_params *param) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -618,7 +618,7 @@ int32_t wmi_mgmt_unified_cmd_send(void *wmi_hdl, * * Return: 0 for success or error code */ -int32_t wmi_unified_modem_power_state(void *wmi_hdl, +CDF_STATUS wmi_unified_modem_power_state(void *wmi_hdl, uint32_t param_value) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -638,7 +638,7 @@ int32_t wmi_unified_modem_power_state(void *wmi_hdl, * * Return: 0 for success or error code. */ -int32_t wmi_unified_set_sta_ps_mode(void *wmi_hdl, +CDF_STATUS wmi_unified_set_sta_ps_mode(void *wmi_hdl, uint32_t vdev_id, uint8_t val) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -658,7 +658,7 @@ int32_t wmi_unified_set_sta_ps_mode(void *wmi_hdl, * * Return: CDF_STATUS_SUCCESS for success or error code. */ -int32_t wmi_unified_set_mimops(void *wmi_hdl, uint8_t vdev_id, int value) +CDF_STATUS wmi_unified_set_mimops(void *wmi_hdl, uint8_t vdev_id, int value) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -677,7 +677,7 @@ int32_t wmi_unified_set_mimops(void *wmi_hdl, uint8_t vdev_id, int value) * * Return: CDF_STATUS_SUCCESS for success or error code. */ -int32_t wmi_unified_set_smps_params(void *wmi_hdl, uint8_t vdev_id, +CDF_STATUS wmi_unified_set_smps_params(void *wmi_hdl, uint8_t vdev_id, int value) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -697,7 +697,7 @@ int32_t wmi_unified_set_smps_params(void *wmi_hdl, uint8_t vdev_id, * * Return: none */ -int32_t wmi_unified_set_p2pgo_oppps_req(void *wmi_hdl, +CDF_STATUS wmi_unified_set_p2pgo_oppps_req(void *wmi_hdl, struct p2p_ps_params *oppps) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -716,7 +716,7 @@ int32_t wmi_unified_set_p2pgo_oppps_req(void *wmi_hdl, * * Return: none */ -int32_t wmi_unified_set_p2pgo_noa_req_cmd(void *wmi_hdl, +CDF_STATUS wmi_unified_set_p2pgo_noa_req_cmd(void *wmi_hdl, struct p2p_ps_params *noa) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -734,7 +734,7 @@ int32_t wmi_unified_set_p2pgo_noa_req_cmd(void *wmi_hdl, * * Return: CDF_STATUS_SUCCESS for success or error code. */ -int32_t wmi_unified_get_temperature(void *wmi_hdl) +CDF_STATUS wmi_unified_get_temperature(void *wmi_hdl) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -757,7 +757,7 @@ int32_t wmi_unified_get_temperature(void *wmi_hdl) * * Return: 0 for success or error code. */ -int32_t +CDF_STATUS wmi_unified_set_sta_uapsd_auto_trig_cmd(void *wmi_hdl, struct sta_uapsd_trig_params *param) { @@ -778,7 +778,7 @@ wmi_unified_set_sta_uapsd_auto_trig_cmd(void *wmi_hdl, * * Return: 0 on succes */ -int32_t wmi_unified_ocb_start_timing_advert(void *wmi_hdl, +CDF_STATUS wmi_unified_ocb_start_timing_advert(void *wmi_hdl, struct ocb_timing_advert_param *timing_advert) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -798,7 +798,7 @@ int32_t wmi_unified_ocb_start_timing_advert(void *wmi_hdl, * * Return: 0 on succes */ -int32_t wmi_unified_ocb_stop_timing_advert(void *wmi_hdl, +CDF_STATUS wmi_unified_ocb_stop_timing_advert(void *wmi_hdl, struct ocb_timing_advert_param *timing_advert) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -817,7 +817,7 @@ int32_t wmi_unified_ocb_stop_timing_advert(void *wmi_hdl, * * Return: 0 on succes */ -int32_t wmi_unified_ocb_set_utc_time_cmd(void *wmi_hdl, +CDF_STATUS wmi_unified_ocb_set_utc_time_cmd(void *wmi_hdl, struct ocb_utc_param *utc) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -836,7 +836,7 @@ int32_t wmi_unified_ocb_set_utc_time_cmd(void *wmi_hdl, * * Return: 0 on succes */ -int32_t wmi_unified_ocb_get_tsf_timer(void *wmi_hdl, +CDF_STATUS wmi_unified_ocb_get_tsf_timer(void *wmi_hdl, uint8_t vdev_id) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -855,7 +855,7 @@ int32_t wmi_unified_ocb_get_tsf_timer(void *wmi_hdl, * * Return: 0 on succes */ -int32_t wmi_unified_dcc_get_stats_cmd(void *wmi_hdl, +CDF_STATUS wmi_unified_dcc_get_stats_cmd(void *wmi_hdl, struct dcc_get_stats_param *get_stats_param) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -874,7 +874,7 @@ int32_t wmi_unified_dcc_get_stats_cmd(void *wmi_hdl, * * Return: 0 on succes */ -int32_t wmi_unified_dcc_clear_stats(void *wmi_hdl, +CDF_STATUS wmi_unified_dcc_clear_stats(void *wmi_hdl, uint32_t vdev_id, uint32_t dcc_stats_bitmap) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -893,7 +893,7 @@ int32_t wmi_unified_dcc_clear_stats(void *wmi_hdl, * * Return: 0 on success */ -int32_t wmi_unified_dcc_update_ndl(void *wmi_hdl, +CDF_STATUS wmi_unified_dcc_update_ndl(void *wmi_hdl, struct dcc_update_ndl_param *update_ndl_param) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -912,7 +912,7 @@ int32_t wmi_unified_dcc_update_ndl(void *wmi_hdl, * * Return: 0 on success */ -int32_t wmi_unified_ocb_set_config(void *wmi_hdl, +CDF_STATUS wmi_unified_ocb_set_config(void *wmi_hdl, struct ocb_config_param *config, uint32_t *ch_mhz) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -933,7 +933,7 @@ int32_t wmi_unified_ocb_set_config(void *wmi_hdl, * * Return: CDF_STATUS_SUCCESS for sucess or error code */ -int32_t wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd( +CDF_STATUS wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd( void *wmi_hdl, uint32_t mcc_adaptive_scheduler) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -957,8 +957,7 @@ int32_t wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd( * * Return: CDF status */ -int32_t wmi_unified_set_mcc_channel_time_latency_cmd - (void *wmi_hdl, +CDF_STATUS wmi_unified_set_mcc_channel_time_latency_cmd(void *wmi_hdl, uint32_t mcc_channel_freq, uint32_t mcc_channel_time_latency) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -980,10 +979,9 @@ int32_t wmi_unified_set_mcc_channel_time_latency_cmd * * Return: CDF status */ -int32_t wmi_unified_set_mcc_channel_time_quota_cmd - (void *wmi_hdl, - uint32_t adapter_1_chan_freq, - uint32_t adapter_1_quota, uint32_t adapter_2_chan_freq) +CDF_STATUS wmi_unified_set_mcc_channel_time_quota_cmd(void *wmi_hdl, + uint32_t adapter_1_chan_freq, + uint32_t adapter_1_quota, uint32_t adapter_2_chan_freq) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -1006,7 +1004,7 @@ int32_t wmi_unified_set_mcc_channel_time_quota_cmd * * Return: CDF_STATUS_SUCCESS for success otherwise failure */ -int32_t wmi_unified_set_thermal_mgmt_cmd(void *wmi_hdl, +CDF_STATUS wmi_unified_set_thermal_mgmt_cmd(void *wmi_hdl, struct thermal_cmd_params *thermal_info) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -1030,7 +1028,7 @@ int32_t wmi_unified_set_thermal_mgmt_cmd(void *wmi_hdl, * * Return: CDF_STATUS_SUCCESS for success otherwise failure */ -int32_t wmi_unified_lro_config_cmd(void *wmi_hdl, +CDF_STATUS wmi_unified_lro_config_cmd(void *wmi_hdl, struct wmi_lro_config_cmd_t *wmi_lro_cmd) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -1041,3 +1039,640 @@ int32_t wmi_unified_lro_config_cmd(void *wmi_hdl, return CDF_STATUS_E_FAILURE; } + +/** + * wmi_unified_bcn_buf_ll_cmd() - prepare and send beacon buffer to fw for LL + * @wmi_hdl: wmi handle + * @param: bcn ll cmd parameter + * + * Return: CDF_STATUS_SUCCESS for success otherwise failure + */ +CDF_STATUS wmi_unified_bcn_buf_ll_cmd(void *wmi_hdl, + wmi_bcn_send_from_host_cmd_fixed_param *param) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_bcn_buf_ll_cmd) + return wmi_handle->ops->send_bcn_buf_ll_cmd(wmi_handle, + param); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_set_sta_sa_query_param_cmd() - set sta sa query parameters + * @wmi_hdl: wmi handle + * @vdev_id: vdev id + * @max_retries: max retries + * @retry_interval: retry interval + * This function sets sta query related parameters in fw. + * + * Return: CDF_STATUS_SUCCESS for success otherwise failure + */ + +CDF_STATUS wmi_unified_set_sta_sa_query_param_cmd(void *wmi_hdl, + uint8_t vdev_id, uint32_t max_retries, + uint32_t retry_interval) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_set_sta_sa_query_param_cmd) + return wmi_handle->ops->send_set_sta_sa_query_param_cmd(wmi_handle, + vdev_id, max_retries, + retry_interval); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_set_sta_keep_alive_cmd() - set sta keep alive parameters + * @wmi_hdl: wmi handle + * @params: sta keep alive parameter + * + * This function sets keep alive related parameters in fw. + * + * Return: none + */ +CDF_STATUS wmi_unified_set_sta_keep_alive_cmd(void *wmi_hdl, + struct sta_params *params) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_set_sta_keep_alive_cmd) + return wmi_handle->ops->send_set_sta_keep_alive_cmd(wmi_handle, + params); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_vdev_set_gtx_cfg_cmd() - set GTX params + * @wmi_hdl: wmi handle + * @if_id: vdev id + * @gtx_info: GTX config params + * + * This function set GTX related params in firmware. + * + * Return: 0 for success or error code + */ +CDF_STATUS wmi_unified_vdev_set_gtx_cfg_cmd(void *wmi_hdl, uint32_t if_id, + struct wmi_gtx_config *gtx_info) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_vdev_set_gtx_cfg_cmd) + return wmi_handle->ops->send_vdev_set_gtx_cfg_cmd(wmi_handle, + if_id, gtx_info); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_process_update_edca_param() - update EDCA params + * @wmi_hdl: wmi handle + * @edca_params: edca parameters + * + * This function updates EDCA parameters to the target + * + * Return: CDF Status + */ +CDF_STATUS wmi_unified_process_update_edca_param(void *wmi_hdl, + uint8_t vdev_id, + wmi_wmm_vparams gwmm_param[WMI_MAX_NUM_AC]) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_process_update_edca_param_cmd) + return wmi_handle->ops->send_process_update_edca_param_cmd(wmi_handle, + vdev_id, gwmm_param); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_probe_rsp_tmpl_send_cmd() - send probe response template to fw + * @wmi_hdl: wmi handle + * @vdev_id: vdev id + * @probe_rsp_info: probe response info + * + * Return: 0 for success or error code + */ +CDF_STATUS wmi_unified_probe_rsp_tmpl_send_cmd(void *wmi_hdl, + uint8_t vdev_id, + struct wmi_probe_resp_params *probe_rsp_info, + uint8_t *frm) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_probe_rsp_tmpl_send_cmd) + return wmi_handle->ops->send_probe_rsp_tmpl_send_cmd(wmi_handle, + vdev_id, probe_rsp_info, + frm); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_p2p_go_set_beacon_ie_cmd() - set beacon IE for p2p go + * @wma_handle: wma handle + * @vdev_id: vdev id + * @p2p_ie: p2p IE + * + * Return: 0 for success or error code + */ +CDF_STATUS wmi_unified_p2p_go_set_beacon_ie_cmd(void *wmi_hdl, + A_UINT32 vdev_id, uint8_t *p2p_ie) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_p2p_go_set_beacon_ie_cmd) + return wmi_handle->ops->send_p2p_go_set_beacon_ie_cmd(wmi_handle, + vdev_id, p2p_ie); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_set_gateway_params_cmd() - set gateway parameters + * @wmi_hdl: wmi handle + * @req: gateway parameter update request structure + * + * This function reads the incoming @req and fill in the destination + * WMI structure and sends down the gateway configs down to the firmware + * + * Return: CDF_STATUS + */ +CDF_STATUS wmi_unified_set_gateway_params_cmd(void *wmi_hdl, + struct gateway_update_req_param *req) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_set_gateway_params_cmd) + return wmi_handle->ops->send_set_gateway_params_cmd(wmi_handle, + req); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_set_rssi_monitoring_cmd() - set rssi monitoring + * @wmi_hdl: wmi handle + * @req: rssi monitoring request structure + * + * This function reads the incoming @req and fill in the destination + * WMI structure and send down the rssi monitoring configs down to the firmware + * + * Return: 0 on success; error number otherwise + */ +CDF_STATUS wmi_unified_set_rssi_monitoring_cmd(void *wmi_hdl, + struct rssi_monitor_param *req) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_pno_start_cmd) + return wmi_handle->ops->send_set_rssi_monitoring_cmd(wmi_handle, + req); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_scan_probe_setoui_cmd() - set scan probe OUI + * @wmi_hdl: wmi handle + * @psetoui: OUI parameters + * + * set scan probe OUI parameters in firmware + * + * Return: CDF status + */ +CDF_STATUS wmi_unified_scan_probe_setoui_cmd(void *wmi_hdl, + struct scan_mac_oui *psetoui) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_scan_probe_setoui_cmd) + return wmi_handle->ops->send_scan_probe_setoui_cmd(wmi_handle, + psetoui); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_reset_passpoint_network_list_cmd() - reset passpoint network list + * @wmi_hdl: wmi handle + * @req: passpoint network request structure + * + * This function sends down WMI command with network id set to wildcard id. + * firmware shall clear all the config entries + * + * Return: CDF_STATUS enumeration + */ +CDF_STATUS wmi_unified_reset_passpoint_network_list_cmd(void *wmi_hdl, + struct wifi_passpoint_req_param *req) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_reset_passpoint_network_list_cmd) + return wmi_handle->ops->send_reset_passpoint_network_list_cmd(wmi_handle, + req); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_set_passpoint_network_list_cmd() - set passpoint network list + * @wmi_hdl: wmi handle + * @req: passpoint network request structure + * + * This function reads the incoming @req and fill in the destination + * WMI structure and send down the passpoint configs down to the firmware + * + * Return: CDF_STATUS enumeration + */ +CDF_STATUS wmi_unified_set_passpoint_network_list_cmd(void *wmi_hdl, + struct wifi_passpoint_req_param *req) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_set_passpoint_network_list_cmd) + return wmi_handle->ops->send_set_passpoint_network_list_cmd(wmi_handle, + req); + + return CDF_STATUS_E_FAILURE; +} + +/** wmi_unified_set_epno_network_list_cmd() - set epno network list + * @wmi_hdl: wmi handle + * @req: epno config params request structure + * + * This function reads the incoming epno config request structure + * and constructs the WMI message to the firmware. + * + * Returns: 0 on success, error number otherwise + */ +CDF_STATUS wmi_unified_set_epno_network_list_cmd(void *wmi_hdl, + struct wifi_enhanched_pno_params *req) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_set_epno_network_list_cmd) + return wmi_handle->ops->send_set_epno_network_list_cmd(wmi_handle, + req); + + return CDF_STATUS_E_FAILURE; +} + +/** wmi_unified_ipa_offload_control_cmd() - ipa offload control parameter + * @wmi_hdl: wmi handle + * @ipa_offload: ipa offload control parameter + * + * Returns: 0 on success, error number otherwise + */ +CDF_STATUS wmi_unified_ipa_offload_control_cmd(void *wmi_hdl, + struct ipa_offload_control_params *ipa_offload) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_ipa_offload_control_cmd) + return wmi_handle->ops->send_ipa_offload_control_cmd(wmi_handle, + ipa_offload); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_extscan_get_capabilities_cmd() - extscan get capabilities + * @wmi_hdl: wmi handle + * @pgetcapab: get capabilities params + * + * This function send request to fw to get extscan capabilities. + * + * Return: CDF status + */ +CDF_STATUS wmi_unified_extscan_get_capabilities_cmd(void *wmi_hdl, + struct extscan_capabilities_params *pgetcapab) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_extscan_get_capabilities_cmd) + return wmi_handle->ops->send_extscan_get_capabilities_cmd(wmi_handle, + pgetcapab); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_extscan_get_cached_results_cmd() - extscan get cached results + * @wmi_hdl: wmi handle + * @pcached_results: cached results parameters + * + * This function send request to fw to get cached results. + * + * Return: CDF status + */ +CDF_STATUS wmi_unified_extscan_get_cached_results_cmd(void *wmi_hdl, + struct extscan_cached_result_params *pcached_results) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_extscan_get_cached_results_cmd) + return wmi_handle->ops->send_extscan_get_cached_results_cmd(wmi_handle, + pcached_results); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_extscan_stop_change_monitor_cmd() - send stop change monitor cmd + * @wmi_hdl: wmi handle + * @reset_req: Reset change request params + * + * This function sends stop change monitor request to fw. + * + * Return: CDF status + */ +CDF_STATUS wmi_unified_extscan_stop_change_monitor_cmd(void *wmi_hdl, + struct extscan_capabilities_reset_params *reset_req) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_extscan_stop_change_monitor_cmd) + return wmi_handle->ops->send_extscan_stop_change_monitor_cmd(wmi_handle, + reset_req); + + return CDF_STATUS_E_FAILURE; +} + + + +/** + * wmi_unified_extscan_start_change_monitor_cmd() - start change monitor cmd + * @wmi_hdl: wmi handle + * @psigchange: change monitor request params + * + * This function sends start change monitor request to fw. + * + * Return: CDF status + */ +CDF_STATUS wmi_unified_extscan_start_change_monitor_cmd(void *wmi_hdl, + struct extscan_set_sig_changereq_params * + psigchange) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_extscan_start_change_monitor_cmd) + return wmi_handle->ops->send_extscan_start_change_monitor_cmd(wmi_handle, + psigchange); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_extscan_stop_hotlist_monitor_cmd() - stop hotlist monitor + * @wmi_hdl: wmi handle + * @photlist_reset: hotlist reset params + * + * This function configures hotlist monitor to stop in fw. + * + * Return: CDF status + */ +CDF_STATUS wmi_unified_extscan_stop_hotlist_monitor_cmd(void *wmi_hdl, + struct extscan_bssid_hotlist_reset_params *photlist_reset) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_extscan_stop_hotlist_monitor_cmd) + return wmi_handle->ops->send_extscan_stop_hotlist_monitor_cmd(wmi_handle, + photlist_reset); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_stop_extscan_cmd() - stop extscan command to fw. + * @wmi_hdl: wmi handle + * @pstopcmd: stop scan command request params + * + * This function sends stop extscan request to fw. + * + * Return: CDF Status. + */ +CDF_STATUS wmi_unified_stop_extscan_cmd(void *wmi_hdl, + struct extscan_stop_req_params *pstopcmd) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_stop_extscan_cmd) + return wmi_handle->ops->send_stop_extscan_cmd(wmi_handle, + pstopcmd); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_start_extscan_cmd() - start extscan command to fw. + * @wmi_hdl: wmi handle + * @pstart: scan command request params + * + * This function sends start extscan request to fw. + * + * Return: CDF Status. + */ +CDF_STATUS wmi_unified_start_extscan_cmd(void *wmi_hdl, + struct wifi_scan_cmd_req_params *pstart) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_start_extscan_cmd) + return wmi_handle->ops->send_start_extscan_cmd(wmi_handle, + pstart); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_plm_stop_cmd() - plm stop request + * @wmi_hdl: wmi handle + * @plm: plm request parameters + * + * This function request FW to stop PLM. + * + * Return: CDF status + */ +CDF_STATUS wmi_unified_plm_stop_cmd(void *wmi_hdl, + const struct plm_req_params *plm) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_plm_stop_cmd) + return wmi_handle->ops->send_plm_stop_cmd(wmi_handle, + plm); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_plm_start_cmd() - plm start request + * @wmi_hdl: wmi handle + * @plm: plm request parameters + * + * This function request FW to start PLM. + * + * Return: CDF status + */ +CDF_STATUS wmi_unified_plm_start_cmd(void *wmi_hdl, + const struct plm_req_params *plm, + uint32_t *gchannel_list) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_plm_start_cmd) + return wmi_handle->ops->send_plm_start_cmd(wmi_handle, + plm, gchannel_list); + + return CDF_STATUS_E_FAILURE; +} + +/** + * send_pno_stop_cmd() - PNO stop request + * @wmi_hdl: wmi handle + * @vdev_id: vdev id + * + * This function request FW to stop ongoing PNO operation. + * + * Return: CDF status + */ +CDF_STATUS wmi_unified_pno_stop_cmd(void *wmi_hdl, uint8_t vdev_id) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_pno_stop_cmd) + return wmi_handle->ops->send_pno_stop_cmd(wmi_handle, + vdev_id); + + return CDF_STATUS_E_FAILURE; +} + +/** + * 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: CDF status + */ +CDF_STATUS wmi_unified_pno_start_cmd(void *wmi_hdl, + struct pno_scan_req_params *pno, + uint32_t *gchannel_freq_list) +{ + 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); + + return CDF_STATUS_E_FAILURE; +} + +/* wmi_unified_set_ric_req_cmd() - set ric request element + * @wmi_hdl: wmi handle + * @msg: message + * @is_add_ts: is addts required + * + * This function sets ric request element for 11r roaming. + * + * Return: none + */ +CDF_STATUS wmi_unified_set_ric_req_cmd(void *wmi_hdl, void *msg, + uint8_t is_add_ts) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_set_ric_req_cmd) + return wmi_handle->ops->send_set_ric_req_cmd(wmi_handle, msg, + is_add_ts); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_process_ll_stats_clear_cmd() - clear link layer stats + * @wmi_hdl: wmi handle + * @clear_req: ll stats clear request command params + * @addr: mac address + * + * Return: CDF_STATUS_SUCCESS for success or error code + */ +CDF_STATUS wmi_unified_process_ll_stats_clear_cmd(void *wmi_hdl, + const struct ll_stats_clear_params *clear_req, + uint8_t addr[IEEE80211_ADDR_LEN]) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_process_ll_stats_clear_cmd) + return wmi_handle->ops->send_process_ll_stats_clear_cmd(wmi_handle, + clear_req, addr); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_process_ll_stats_get_cmd() - link layer stats get request + * @wmi_hdl:wmi handle + * @get_req:ll stats get request command params + * + * Return: CDF_STATUS_SUCCESS for success or error code + */ +CDF_STATUS wmi_unified_process_ll_stats_get_cmd(void *wmi_hdl, + const struct ll_stats_get_params *get_req, + uint8_t addr[IEEE80211_ADDR_LEN]) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_process_ll_stats_get_cmd) + return wmi_handle->ops->send_process_ll_stats_get_cmd(wmi_handle, + get_req, addr); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_get_stats_cmd() - get stats request + * @wmi_hdl: wma handle + * @get_stats_param: stats params + * @addr: mac address + * + * Return: none + */ +CDF_STATUS wmi_unified_get_stats_cmd(void *wmi_hdl, + struct pe_stats_req *get_stats_param, + uint8_t addr[IEEE80211_ADDR_LEN]) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_get_stats_cmd) + return wmi_handle->ops->send_get_stats_cmd(wmi_handle, + get_stats_param, addr); + + return CDF_STATUS_E_FAILURE; +} + +/** + * wmi_unified_process_ll_stats_set_cmd() - link layer stats set request + * @wmi_handle: wmi handle + * @set_req: ll stats set request command params + * + * Return: CDF_STATUS_SUCCESS for success or error code + */ +CDF_STATUS wmi_unified_process_ll_stats_set_cmd(void *wmi_hdl, + const struct ll_stats_set_params *set_req) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_process_ll_stats_set_cmd) + return wmi_handle->ops->send_process_ll_stats_set_cmd(wmi_handle, + set_req); + + return CDF_STATUS_E_FAILURE; +} diff --git a/wmi/src/wmi_unified_non_tlv.c b/wmi/src/wmi_unified_non_tlv.c index cd91fb5a27..7beb5c20b8 100644 --- a/wmi/src/wmi_unified_non_tlv.c +++ b/wmi/src/wmi_unified_non_tlv.c @@ -38,7 +38,7 @@ * * Return: 0 for success or error code */ -int32_t send_vdev_create_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_vdev_create_cmd_non_tlv(wmi_unified_t wmi_handle, uint8_t macaddr[IEEE80211_ADDR_LEN], struct vdev_create_params *param) { @@ -52,7 +52,7 @@ int32_t send_vdev_create_cmd_non_tlv(wmi_unified_t wmi_handle, * * Return: 0 for success or error code */ -int32_t send_vdev_delete_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_vdev_delete_cmd_non_tlv(wmi_unified_t wmi_handle, uint8_t if_id) { return 0; @@ -65,7 +65,7 @@ int32_t send_vdev_delete_cmd_non_tlv(wmi_unified_t wmi_handle, * * Return: 0 for success or erro code */ -int32_t send_vdev_stop_cmd_non_tlv(wmi_unified_t wmi, +CDF_STATUS send_vdev_stop_cmd_non_tlv(wmi_unified_t wmi, uint8_t vdev_id) { return 0; @@ -78,7 +78,7 @@ int32_t send_vdev_stop_cmd_non_tlv(wmi_unified_t wmi, * * Return: 0 for success or error code */ -int32_t send_vdev_down_cmd_non_tlv(wmi_unified_t wmi, uint8_t vdev_id) +CDF_STATUS send_vdev_down_cmd_non_tlv(wmi_unified_t wmi, uint8_t vdev_id) { return 0; } @@ -91,7 +91,7 @@ int32_t send_vdev_down_cmd_non_tlv(wmi_unified_t wmi, uint8_t vdev_id) * * Return: 0 for sucess or error code */ -int32_t send_peer_flush_tids_cmd_non_tlv(wmi_unified_t wmi, +CDF_STATUS send_peer_flush_tids_cmd_non_tlv(wmi_unified_t wmi, uint8_t peer_addr[IEEE80211_ADDR_LEN], struct peer_flush_params *param) { @@ -106,7 +106,7 @@ int32_t send_peer_flush_tids_cmd_non_tlv(wmi_unified_t wmi, * * Return: 0 for success or error code */ -int32_t send_peer_delete_cmd_non_tlv(wmi_unified_t wmi, +CDF_STATUS send_peer_delete_cmd_non_tlv(wmi_unified_t wmi, uint8_t peer_addr[IEEE80211_ADDR_LEN], uint8_t vdev_id) @@ -122,7 +122,7 @@ int32_t send_peer_delete_cmd_non_tlv(wmi_unified_t wmi, * * Return: 0 for success or error code */ -int32_t send_peer_param_cmd_non_tlv(wmi_unified_t wmi, +CDF_STATUS send_peer_param_cmd_non_tlv(wmi_unified_t wmi, uint8_t peer_addr[IEEE80211_ADDR_LEN], struct peer_set_params *param) { @@ -137,7 +137,7 @@ int32_t send_peer_param_cmd_non_tlv(wmi_unified_t wmi, * * Return: 0 for success or error code */ -int32_t send_vdev_up_cmd_non_tlv(wmi_unified_t wmi, +CDF_STATUS send_vdev_up_cmd_non_tlv(wmi_unified_t wmi, uint8_t bssid[IEEE80211_ADDR_LEN], struct vdev_up_params *params) { @@ -153,7 +153,7 @@ int32_t send_vdev_up_cmd_non_tlv(wmi_unified_t wmi, * * Return: 0 for success or error code */ -int32_t send_peer_create_cmd_non_tlv(wmi_unified_t wmi, +CDF_STATUS send_peer_create_cmd_non_tlv(wmi_unified_t wmi, struct peer_create_params *param) { return 0; @@ -167,7 +167,7 @@ int32_t send_peer_create_cmd_non_tlv(wmi_unified_t wmi, * * Return: 0 for success or error code */ -int32_t send_green_ap_ps_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_green_ap_ps_cmd_non_tlv(wmi_unified_t wmi_handle, uint32_t value, uint8_t mac_id) { return 0; @@ -181,7 +181,7 @@ int32_t send_green_ap_ps_cmd_non_tlv(wmi_unified_t wmi_handle, * * Return: 0 for success or error code */ -int32_t +CDF_STATUS send_pdev_utf_cmd_non_tlv(wmi_unified_t wmi_handle, struct pdev_utf_params *param, uint8_t mac_id) @@ -197,7 +197,7 @@ send_pdev_utf_cmd_non_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success, errno on failure */ -int32_t +CDF_STATUS send_pdev_param_cmd_non_tlv(wmi_unified_t wmi_handle, struct pdev_params *param, uint8_t mac_id) @@ -213,7 +213,7 @@ send_pdev_param_cmd_non_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success and -ve on failure. */ -int32_t send_suspend_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_suspend_cmd_non_tlv(wmi_unified_t wmi_handle, struct suspend_params *param, uint8_t mac_id) { @@ -228,7 +228,7 @@ int32_t send_suspend_cmd_non_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success and -ve on failure. */ -int32_t send_resume_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_resume_cmd_non_tlv(wmi_unified_t wmi_handle, uint8_t mac_id) { return 0; @@ -242,7 +242,7 @@ int32_t send_resume_cmd_non_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success and -ve on failure. */ -int32_t send_wow_enable_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_wow_enable_cmd_non_tlv(wmi_unified_t wmi_handle, struct wow_cmd_params *param, uint8_t mac_id) { @@ -257,7 +257,7 @@ int32_t send_wow_enable_cmd_non_tlv(wmi_unified_t wmi_handle, * * Return: 0 for success or error code */ -int32_t send_set_ap_ps_param_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_ap_ps_param_cmd_non_tlv(wmi_unified_t wmi_handle, uint8_t *peer_addr, struct ap_ps_params *param) { @@ -272,7 +272,7 @@ int32_t send_set_ap_ps_param_cmd_non_tlv(wmi_unified_t wmi_handle, * * Return: 0 for success or error code */ -int32_t send_set_sta_ps_param_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_sta_ps_param_cmd_non_tlv(wmi_unified_t wmi_handle, struct sta_ps_params *param) { return 0; @@ -285,7 +285,7 @@ int32_t send_set_sta_ps_param_cmd_non_tlv(wmi_unified_t wmi_handle, * * Return: 0 for success or return error */ -int32_t send_crash_inject_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_crash_inject_cmd_non_tlv(wmi_unified_t wmi_handle, struct crash_inject *param) { return 0; @@ -298,7 +298,7 @@ int32_t send_crash_inject_cmd_non_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success and -ve on failure. */ -int32_t +CDF_STATUS send_dbglog_cmd_non_tlv(wmi_unified_t wmi_handle, struct dbglog_params *dbglog_param) { @@ -313,7 +313,7 @@ send_dbglog_cmd_non_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success and -ve on failure. */ -int32_t send_vdev_set_param_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_vdev_set_param_cmd_non_tlv(wmi_unified_t wmi_handle, struct vdev_set_params *param) { return 0; @@ -327,7 +327,7 @@ int32_t send_vdev_set_param_cmd_non_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success and -ve on failure. */ -int32_t send_stats_request_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_stats_request_cmd_non_tlv(wmi_unified_t wmi_handle, uint8_t macaddr[IEEE80211_ADDR_LEN], struct stats_request_params *param) { @@ -342,7 +342,7 @@ int32_t send_stats_request_cmd_non_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success and -ve on failure. */ -int32_t send_packet_log_enable_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_packet_log_enable_cmd_non_tlv(wmi_unified_t wmi_handle, uint8_t macaddr[IEEE80211_ADDR_LEN], struct packet_enable_params *param) { @@ -357,7 +357,7 @@ int32_t send_packet_log_enable_cmd_non_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success and -ve on failure. */ -int32_t send_beacon_send_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_beacon_send_cmd_non_tlv(wmi_unified_t wmi_handle, struct beacon_params *param) { return 0; @@ -371,7 +371,7 @@ int32_t send_beacon_send_cmd_non_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success and -ve on failure. */ -int32_t send_peer_assoc_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_peer_assoc_cmd_non_tlv(wmi_unified_t wmi_handle, struct peer_assoc_params *param) { return 0; @@ -385,7 +385,7 @@ int32_t send_peer_assoc_cmd_non_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success and -ve on failure. */ -int32_t send_scan_start_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_scan_start_cmd_non_tlv(wmi_unified_t wmi_handle, struct scan_start_params *param) { return 0; @@ -399,7 +399,7 @@ int32_t send_scan_start_cmd_non_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success and -ve on failure. */ -int32_t send_scan_stop_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_scan_stop_cmd_non_tlv(wmi_unified_t wmi_handle, struct scan_stop_params *param) { return 0; @@ -413,7 +413,7 @@ int32_t send_scan_stop_cmd_non_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success and -ve on failure. */ -int32_t send_scan_chan_list_cmd_non_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_scan_chan_list_cmd_non_tlv(wmi_unified_t wmi_handle, struct scan_chan_list_params *param) { return 0; diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index ab1ff8991e..715c3bd0cf 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -40,7 +40,7 @@ * * Return: 0 for success or error code */ -int32_t send_vdev_create_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_vdev_create_cmd_tlv(wmi_unified_t wmi_handle, uint8_t macaddr[IEEE80211_ADDR_LEN], struct vdev_create_params *param) { @@ -83,7 +83,7 @@ int32_t send_vdev_create_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 for success or error code */ -int32_t send_vdev_delete_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_vdev_delete_cmd_tlv(wmi_unified_t wmi_handle, uint8_t if_id) { wmi_vdev_delete_cmd_fixed_param *cmd; @@ -121,7 +121,7 @@ int32_t send_vdev_delete_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 for success or erro code */ -int32_t send_vdev_stop_cmd_tlv(wmi_unified_t wmi, +CDF_STATUS send_vdev_stop_cmd_tlv(wmi_unified_t wmi, uint8_t vdev_id) { wmi_vdev_stop_cmd_fixed_param *cmd; @@ -154,7 +154,7 @@ int32_t send_vdev_stop_cmd_tlv(wmi_unified_t wmi, * * Return: 0 for success or error code */ -int32_t send_vdev_down_cmd_tlv(wmi_unified_t wmi, uint8_t vdev_id) +CDF_STATUS send_vdev_down_cmd_tlv(wmi_unified_t wmi, uint8_t vdev_id) { wmi_vdev_down_cmd_fixed_param *cmd; wmi_buf_t buf; @@ -188,7 +188,7 @@ int32_t send_vdev_down_cmd_tlv(wmi_unified_t wmi, uint8_t vdev_id) * * Return: 0 for sucess or error code */ -int32_t send_peer_flush_tids_cmd_tlv(wmi_unified_t wmi, +CDF_STATUS send_peer_flush_tids_cmd_tlv(wmi_unified_t wmi, uint8_t peer_addr[IEEE80211_ADDR_LEN], struct peer_flush_params *param) { @@ -229,7 +229,7 @@ int32_t send_peer_flush_tids_cmd_tlv(wmi_unified_t wmi, * * Return: 0 for success or error code */ -int32_t send_peer_delete_cmd_tlv(wmi_unified_t wmi, +CDF_STATUS send_peer_delete_cmd_tlv(wmi_unified_t wmi, uint8_t peer_addr[IEEE80211_ADDR_LEN], uint8_t vdev_id) { @@ -267,7 +267,7 @@ int32_t send_peer_delete_cmd_tlv(wmi_unified_t wmi, * * Return: 0 for success or error code */ -int32_t send_peer_param_cmd_tlv(wmi_unified_t wmi, +CDF_STATUS send_peer_param_cmd_tlv(wmi_unified_t wmi, uint8_t peer_addr[IEEE80211_ADDR_LEN], struct peer_set_params *param) { @@ -309,7 +309,7 @@ int32_t send_peer_param_cmd_tlv(wmi_unified_t wmi, * * Return: 0 for success or error code */ -int32_t send_vdev_up_cmd_tlv(wmi_unified_t wmi, +CDF_STATUS send_vdev_up_cmd_tlv(wmi_unified_t wmi, uint8_t bssid[IEEE80211_ADDR_LEN], struct vdev_up_params *params) { @@ -350,7 +350,7 @@ int32_t send_vdev_up_cmd_tlv(wmi_unified_t wmi, * * Return: 0 for success or error code */ -int32_t send_peer_create_cmd_tlv(wmi_unified_t wmi, +CDF_STATUS send_peer_create_cmd_tlv(wmi_unified_t wmi, struct peer_create_params *param) { wmi_peer_create_cmd_fixed_param *cmd; @@ -390,7 +390,7 @@ int32_t send_peer_create_cmd_tlv(wmi_unified_t wmi, * * Return: 0 for success or error code */ -int32_t send_green_ap_ps_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_green_ap_ps_cmd_tlv(wmi_unified_t wmi_handle, uint32_t value, uint8_t mac_id) { wmi_pdev_green_ap_ps_enable_cmd_fixed_param *cmd; @@ -431,7 +431,7 @@ int32_t send_green_ap_ps_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 for success or error code */ -int32_t +CDF_STATUS send_pdev_utf_cmd_tlv(wmi_unified_t wmi_handle, struct pdev_utf_params *param, uint8_t mac_id) @@ -521,7 +521,7 @@ send_pdev_utf_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success, errno on failure */ -int32_t +CDF_STATUS send_pdev_param_cmd_tlv(wmi_unified_t wmi_handle, struct pdev_params *param, uint8_t mac_id) @@ -563,7 +563,7 @@ send_pdev_param_cmd_tlv(wmi_unified_t wmi_handle, * * Return 0 on success and -ve on failure. */ -int32_t send_suspend_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_suspend_cmd_tlv(wmi_unified_t wmi_handle, struct suspend_params *param, uint8_t mac_id) { @@ -607,7 +607,7 @@ int32_t send_suspend_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success and -ve on failure. */ -int32_t send_resume_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_resume_cmd_tlv(wmi_unified_t wmi_handle, uint8_t mac_id) { wmi_buf_t wmibuf; @@ -641,7 +641,7 @@ int32_t send_resume_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success and -ve on failure. */ -int32_t send_wow_enable_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_wow_enable_cmd_tlv(wmi_unified_t wmi_handle, struct wow_cmd_params *param, uint8_t mac_id) { @@ -688,7 +688,7 @@ int32_t send_wow_enable_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 for success or error code */ -int32_t send_set_ap_ps_param_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_ap_ps_param_cmd_tlv(wmi_unified_t wmi_handle, uint8_t *peer_addr, struct ap_ps_params *param) { @@ -729,7 +729,7 @@ int32_t send_set_ap_ps_param_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 for success or error code */ -int32_t send_set_sta_ps_param_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_sta_ps_param_cmd_tlv(wmi_unified_t wmi_handle, struct sta_ps_params *param) { wmi_sta_powersave_param_cmd_fixed_param *cmd; @@ -769,7 +769,7 @@ int32_t send_set_sta_ps_param_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 for success or return error */ -int32_t send_crash_inject_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_crash_inject_cmd_tlv(wmi_unified_t wmi_handle, struct crash_inject *param) { int32_t ret = 0; @@ -809,7 +809,7 @@ int32_t send_crash_inject_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success and -ve on failure. */ -int32_t +CDF_STATUS send_dbglog_cmd_tlv(wmi_unified_t wmi_handle, struct dbglog_params *dbglog_param) { @@ -872,7 +872,7 @@ send_dbglog_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success and -ve on failure. */ -int32_t send_vdev_set_param_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_vdev_set_param_cmd_tlv(wmi_unified_t wmi_handle, struct vdev_set_params *param) { int32_t ret; @@ -913,7 +913,7 @@ int32_t send_vdev_set_param_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success and -ve on failure. */ -int32_t send_stats_request_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_stats_request_cmd_tlv(wmi_unified_t wmi_handle, uint8_t macaddr[IEEE80211_ADDR_LEN], struct stats_request_params *param) { @@ -953,7 +953,7 @@ int32_t send_stats_request_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success and -ve on failure. */ -int32_t send_packet_log_enable_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_packet_log_enable_cmd_tlv(wmi_unified_t wmi_handle, uint8_t macaddr[IEEE80211_ADDR_LEN], struct packet_enable_params *param) { @@ -967,7 +967,7 @@ int32_t send_packet_log_enable_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success and -ve on failure. */ -int32_t send_beacon_send_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_beacon_send_cmd_tlv(wmi_unified_t wmi_handle, struct beacon_params *param) { int32_t ret; @@ -1023,7 +1023,7 @@ int32_t send_beacon_send_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success and -ve on failure. */ -int32_t send_peer_assoc_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_peer_assoc_cmd_tlv(wmi_unified_t wmi_handle, struct peer_assoc_params *param) { wmi_peer_assoc_complete_cmd_fixed_param *cmd; @@ -1127,7 +1127,7 @@ int32_t send_peer_assoc_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success and -ve on failure. */ -int32_t send_scan_start_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_scan_start_cmd_tlv(wmi_unified_t wmi_handle, struct scan_start_params *params) { int32_t ret = 0; @@ -1204,7 +1204,7 @@ int32_t send_scan_start_cmd_tlv(wmi_unified_t wmi_handle, WMITLV_TAG_ARRAY_UINT32, (params->num_chan * sizeof(uint32_t))); buf_ptr += WMI_TLV_HDR_SIZE + (params->num_chan * sizeof(uint32_t)); - if (params->num_ssids > SIR_SCAN_MAX_NUM_SSID) { + if (params->num_ssids > WMI_SCAN_MAX_NUM_SSID) { WMA_LOGE("Invalid value for numSsid"); goto error; } @@ -1256,7 +1256,7 @@ error: * * Return: 0 on success and -ve on failure. */ -int32_t send_scan_stop_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_scan_stop_cmd_tlv(wmi_unified_t wmi_handle, struct scan_stop_params *param) { wmi_stop_scan_cmd_fixed_param *cmd; @@ -1300,7 +1300,7 @@ error: * * Return: 0 on success and -ve on failure. */ -int32_t send_scan_chan_list_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_scan_chan_list_cmd_tlv(wmi_unified_t wmi_handle, struct scan_chan_list_params *chan_list) { wmi_buf_t buf; @@ -1375,7 +1375,7 @@ end: * * Return: 0 on success and -ve on failure. */ -int32_t send_mgmt_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_mgmt_cmd_tlv(wmi_unified_t wmi_handle, struct wmi_mgmt_params *param) { wmi_buf_t buf; @@ -1450,7 +1450,7 @@ err1: * * Return: 0 for success or error code */ -int32_t send_modem_power_state_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_modem_power_state_cmd_tlv(wmi_unified_t wmi_handle, uint32_t param_value) { int ret; @@ -1488,7 +1488,7 @@ int32_t send_modem_power_state_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 for success or error code. */ -int32_t send_set_sta_ps_mode_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_sta_ps_mode_cmd_tlv(wmi_unified_t wmi_handle, uint32_t vdev_id, uint8_t val) { wmi_sta_powersave_mode_cmd_fixed_param *cmd; @@ -1531,7 +1531,7 @@ int32_t send_set_sta_ps_mode_cmd_tlv(wmi_unified_t wmi_handle, * * Return: CDF_STATUS_SUCCESS for success or error code. */ -int32_t send_set_mimops_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_mimops_cmd_tlv(wmi_unified_t wmi_handle, uint8_t vdev_id, int value) { int ret = CDF_STATUS_SUCCESS; @@ -1590,7 +1590,7 @@ int32_t send_set_mimops_cmd_tlv(wmi_unified_t wmi_handle, * * Return: CDF_STATUS_SUCCESS for success or error code. */ -int32_t send_set_smps_params_cmd_tlv(wmi_unified_t wmi_handle, uint8_t vdev_id, +CDF_STATUS send_set_smps_params_cmd_tlv(wmi_unified_t wmi_handle, uint8_t vdev_id, int value) { int ret = CDF_STATUS_SUCCESS; @@ -1634,7 +1634,7 @@ int32_t send_set_smps_params_cmd_tlv(wmi_unified_t wmi_handle, uint8_t vdev_id, * * Return: CDF status */ -int32_t send_set_p2pgo_noa_req_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_p2pgo_noa_req_cmd_tlv(wmi_unified_t wmi_handle, struct p2p_ps_params *noa) { wmi_p2p_set_noa_cmd_fixed_param *cmd; @@ -1702,7 +1702,7 @@ end: * * Return: CDF status */ -int32_t send_set_p2pgo_oppps_req_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_p2pgo_oppps_req_cmd_tlv(wmi_unified_t wmi_handle, struct p2p_ps_params *oppps) { wmi_p2p_set_oppps_cmd_fixed_param *cmd; @@ -1747,7 +1747,7 @@ end: * * Return: CDF_STATUS_SUCCESS for success or error code. */ -int32_t send_get_temperature_cmd_tlv(wmi_unified_t wmi_handle) +CDF_STATUS send_get_temperature_cmd_tlv(wmi_unified_t wmi_handle) { wmi_pdev_get_temperature_cmd_fixed_param *cmd; wmi_buf_t wmi_buf; @@ -1799,7 +1799,7 @@ int32_t send_get_temperature_cmd_tlv(wmi_unified_t wmi_handle) * * Return: 0 for success or error code. */ -int32_t send_set_sta_uapsd_auto_trig_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_sta_uapsd_auto_trig_cmd_tlv(wmi_unified_t wmi_handle, struct sta_uapsd_trig_params *param) { wmi_sta_uapsd_auto_trig_cmd_fixed_param *cmd; @@ -1862,7 +1862,7 @@ int32_t send_set_sta_uapsd_auto_trig_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 on succes */ -int send_ocb_set_utc_time_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_ocb_set_utc_time_cmd_tlv(wmi_unified_t wmi_handle, struct ocb_utc_param *utc) { int32_t ret; @@ -1910,7 +1910,7 @@ int send_ocb_set_utc_time_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 on succes */ -int send_ocb_start_timing_advert_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_ocb_start_timing_advert_cmd_tlv(wmi_unified_t wmi_handle, struct ocb_timing_advert_param *timing_advert) { int32_t ret; @@ -1974,7 +1974,7 @@ int send_ocb_start_timing_advert_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 on succes */ -int send_ocb_stop_timing_advert_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_ocb_stop_timing_advert_cmd_tlv(wmi_unified_t wmi_handle, struct ocb_timing_advert_param *timing_advert) { int32_t ret; @@ -2017,7 +2017,7 @@ int send_ocb_stop_timing_advert_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 on succes */ -int send_ocb_get_tsf_timer_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_ocb_get_tsf_timer_cmd_tlv(wmi_unified_t wmi_handle, uint8_t vdev_id) { CDF_STATUS ret; @@ -2062,7 +2062,7 @@ int send_ocb_get_tsf_timer_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 on succes */ -int send_dcc_get_stats_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_dcc_get_stats_cmd_tlv(wmi_unified_t wmi_handle, struct dcc_get_stats_param *get_stats_param) { int32_t ret; @@ -2138,7 +2138,7 @@ int send_dcc_get_stats_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 on succes */ -int send_dcc_clear_stats_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_dcc_clear_stats_cmd_tlv(wmi_unified_t wmi_handle, uint32_t vdev_id, uint32_t dcc_stats_bitmap) { int32_t ret; @@ -2188,7 +2188,7 @@ int send_dcc_clear_stats_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success */ -int send_dcc_update_ndl_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_dcc_update_ndl_cmd_tlv(wmi_unified_t wmi_handle, struct dcc_update_ndl_param *update_ndl_param) { CDF_STATUS cdf_status; @@ -2294,7 +2294,7 @@ int send_dcc_update_ndl_cmd_tlv(wmi_unified_t wmi_handle, * * Return: 0 on success */ -int send_ocb_set_config_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_ocb_set_config_cmd_tlv(wmi_unified_t wmi_handle, struct ocb_config_param *config, uint32_t *ch_mhz) { int32_t ret; @@ -2504,7 +2504,7 @@ int send_ocb_set_config_cmd_tlv(wmi_unified_t wmi_handle, * * Return: CDF_STATUS_SUCCESS for sucess or error code */ -int32_t send_set_enable_disable_mcc_adaptive_scheduler_cmd_tlv( +CDF_STATUS send_set_enable_disable_mcc_adaptive_scheduler_cmd_tlv( wmi_unified_t wmi_handle, uint32_t mcc_adaptive_scheduler) { int ret = -1; @@ -2549,7 +2549,7 @@ int32_t send_set_enable_disable_mcc_adaptive_scheduler_cmd_tlv( * * Return: CDF status */ -int32_t send_set_mcc_channel_time_latency_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_mcc_channel_time_latency_cmd_tlv(wmi_unified_t wmi_handle, uint32_t mcc_channel_freq, uint32_t mcc_channel_time_latency) { int ret = -1; @@ -2621,7 +2621,7 @@ int32_t send_set_mcc_channel_time_latency_cmd_tlv(wmi_unified_t wmi_handle, * * Return: CDF status */ -int32_t send_set_mcc_channel_time_quota_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_mcc_channel_time_quota_cmd_tlv(wmi_unified_t wmi_handle, uint32_t adapter_1_chan_freq, uint32_t adapter_1_quota, uint32_t adapter_2_chan_freq) { @@ -2707,7 +2707,7 @@ int32_t send_set_mcc_channel_time_quota_cmd_tlv(wmi_unified_t wmi_handle, * * Return: CDF_STATUS_SUCCESS for success otherwise failure */ -int32_t send_set_thermal_mgmt_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_set_thermal_mgmt_cmd_tlv(wmi_unified_t wmi_handle, struct thermal_cmd_params *thermal_info) { wmi_thermal_mgmt_cmd_fixed_param *cmd = NULL; @@ -2760,7 +2760,7 @@ int32_t send_set_thermal_mgmt_cmd_tlv(wmi_unified_t wmi_handle, * * Return: CDF_STATUS_SUCCESS for success otherwise failure */ -int32_t send_lro_config_cmd_tlv(wmi_unified_t wmi_handle, +CDF_STATUS send_lro_config_cmd_tlv(wmi_unified_t wmi_handle, struct wmi_lro_config_cmd_t *wmi_lro_cmd) { wmi_lro_info_cmd_fixed_param *cmd; @@ -2833,6 +2833,2157 @@ int32_t send_lro_config_cmd_tlv(wmi_unified_t wmi_handle, return CDF_STATUS_SUCCESS; } +/** + * send_bcn_buf_ll_cmd_tlv() - prepare and send beacon buffer to fw for LL + * @wmi_handle: wmi handle + * @param: bcn ll cmd parameter + * + * Return: CDF_STATUS_SUCCESS for success otherwise failure + */ +CDF_STATUS send_bcn_buf_ll_cmd_tlv(wmi_unified_t wmi_handle, + wmi_bcn_send_from_host_cmd_fixed_param *param) +{ + wmi_bcn_send_from_host_cmd_fixed_param *cmd; + wmi_buf_t wmi_buf; + CDF_STATUS ret; + + wmi_buf = wmi_buf_alloc(wmi_handle, sizeof(*cmd)); + if (!wmi_buf) { + WMA_LOGE("%s: wmi_buf_alloc failed", __func__); + return CDF_STATUS_E_FAILURE; + } + + cmd = (wmi_bcn_send_from_host_cmd_fixed_param *) wmi_buf_data(wmi_buf); + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_bcn_send_from_host_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_bcn_send_from_host_cmd_fixed_param)); + cmd->vdev_id = param->vdev_id; + cmd->data_len = param->data_len; + cmd->frame_ctrl = param->frame_ctrl; + cmd->frag_ptr = param->frag_ptr; + cmd->dtim_flag = param->dtim_flag; + + ret = wmi_unified_cmd_send(wmi_handle, wmi_buf, sizeof(*cmd), + WMI_PDEV_SEND_BCN_CMDID); + + if (ret != EOK) { + WMA_LOGE("Failed to send WMI_PDEV_SEND_BCN_CMDID command"); + wmi_buf_free(wmi_buf); + } + + return ret; +} + +/** + * send_set_sta_sa_query_param_cmd_tlv() - set sta sa query parameters + * @wmi_handle: wmi handle + * @vdev_id: vdev id + * @max_retries: max retries + * @retry_interval: retry interval + * This function sets sta query related parameters in fw. + * + * Return: CDF_STATUS_SUCCESS for success otherwise failure + */ + +CDF_STATUS send_set_sta_sa_query_param_cmd_tlv(wmi_unified_t wmi_handle, + uint8_t vdev_id, uint32_t max_retries, + uint32_t retry_interval) +{ + wmi_buf_t buf; + WMI_PMF_OFFLOAD_SET_SA_QUERY_CMD_fixed_param *cmd; + int len; + + len = sizeof(*cmd); + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) { + WMA_LOGE(FL("wmi_buf_alloc failed")); + return CDF_STATUS_E_FAILURE; + } + + cmd = (WMI_PMF_OFFLOAD_SET_SA_QUERY_CMD_fixed_param *)wmi_buf_data(buf); + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_WMI_PMF_OFFLOAD_SET_SA_QUERY_CMD_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (WMI_PMF_OFFLOAD_SET_SA_QUERY_CMD_fixed_param)); + + + cmd->vdev_id = vdev_id; + cmd->sa_query_max_retry_count = max_retries; + cmd->sa_query_retry_interval = retry_interval; + + WMA_LOGD(FL("STA sa query: vdev_id:%d interval:%u retry count:%d"), + vdev_id, retry_interval, max_retries); + + if (wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_PMF_OFFLOAD_SET_SA_QUERY_CMDID)) { + WMA_LOGE(FL("Failed to offload STA SA Query")); + cdf_nbuf_free(buf); + return CDF_STATUS_E_FAILURE; + } + + WMA_LOGD(FL("Exit :")); + return 0; +} + +/** + * send_set_sta_keep_alive_cmd_tlv() - set sta keep alive parameters + * @wmi_handle: wmi handle + * @params: sta keep alive parameter + * + * This function sets keep alive related parameters in fw. + * + * Return: CDF status + */ +CDF_STATUS send_set_sta_keep_alive_cmd_tlv(wmi_unified_t wmi_handle, + struct sta_params *params) +{ + wmi_buf_t buf; + WMI_STA_KEEPALIVE_CMD_fixed_param *cmd; + WMI_STA_KEEPALVE_ARP_RESPONSE *arp_rsp; + uint8_t *buf_ptr; + int len; + + WMA_LOGD("%s: Enter", __func__); + + if (params->timeperiod > WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD_STAMAX) { + WMA_LOGE("Invalid period %d Max limit %d", params->timeperiod, + WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD_STAMAX); + return CDF_STATUS_E_FAILURE; + } + + len = sizeof(*cmd) + sizeof(*arp_rsp); + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) { + WMA_LOGE("wmi_buf_alloc failed"); + return CDF_STATUS_E_FAILURE; + } + + cmd = (WMI_STA_KEEPALIVE_CMD_fixed_param *) wmi_buf_data(buf); + buf_ptr = (uint8_t *) cmd; + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_WMI_STA_KEEPALIVE_CMD_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (WMI_STA_KEEPALIVE_CMD_fixed_param)); + cmd->interval = params->timeperiod; + cmd->enable = (params->timeperiod) ? 1 : 0; + cmd->vdev_id = params->vdev_id; + WMA_LOGD("Keep Alive: vdev_id:%d interval:%u method:%d", params->vdev_id, + params->timeperiod, params->method); + arp_rsp = (WMI_STA_KEEPALVE_ARP_RESPONSE *) (buf_ptr + sizeof(*cmd)); + WMITLV_SET_HDR(&arp_rsp->tlv_header, + WMITLV_TAG_STRUC_WMI_STA_KEEPALVE_ARP_RESPONSE, + WMITLV_GET_STRUCT_TLVLEN(WMI_STA_KEEPALVE_ARP_RESPONSE)); + + if (params->method == WMI_KEEP_ALIVE_UNSOLICIT_ARP_RSP) { + if ((NULL == params->hostv4addr) || + (NULL == params->destv4addr) || + (NULL == params->destmac)) { + WMA_LOGE("%s: received null pointer, hostv4addr:%p " + "destv4addr:%p destmac:%p ", __func__, + params->hostv4addr, params->destv4addr, params->destmac); + cdf_nbuf_free(buf); + return CDF_STATUS_E_FAILURE; + } + cmd->method = WMI_STA_KEEPALIVE_METHOD_UNSOLICITED_ARP_RESPONSE; + cdf_mem_copy(&arp_rsp->sender_prot_addr, params->hostv4addr, + WMI_IPV4_ADDR_LEN); + cdf_mem_copy(&arp_rsp->target_prot_addr, params->destv4addr, + WMI_IPV4_ADDR_LEN); + WMI_CHAR_ARRAY_TO_MAC_ADDR(params->destmac, &arp_rsp->dest_mac_addr); + } else { + cmd->method = WMI_STA_KEEPALIVE_METHOD_NULL_FRAME; + } + + if (wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_STA_KEEPALIVE_CMDID)) { + WMA_LOGE("Failed to set KeepAlive"); + cdf_nbuf_free(buf); + } + + WMA_LOGD("%s: Exit", __func__); + return 0; +} + +/** + * send_vdev_set_gtx_cfg_cmd_tlv() - set GTX params + * @wmi_handle: wmi handle + * @if_id: vdev id + * @gtx_info: GTX config params + * + * This function set GTX related params in firmware. + * + * Return: 0 for success or error code + */ +CDF_STATUS send_vdev_set_gtx_cfg_cmd_tlv(wmi_unified_t wmi_handle, uint32_t if_id, + struct wmi_gtx_config *gtx_info) +{ + wmi_vdev_set_gtx_params_cmd_fixed_param *cmd; + wmi_buf_t buf; + int len = sizeof(wmi_vdev_set_gtx_params_cmd_fixed_param); + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) { + WMA_LOGE("%s:wmi_buf_alloc failed", __func__); + return -ENOMEM; + } + cmd = (wmi_vdev_set_gtx_params_cmd_fixed_param *) wmi_buf_data(buf); + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_vdev_set_gtx_params_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_vdev_set_gtx_params_cmd_fixed_param)); + cmd->vdev_id = if_id; + + cmd->gtxRTMask[0] = gtx_info->gtx_rt_mask[0]; + cmd->gtxRTMask[1] = gtx_info->gtx_rt_mask[1]; + cmd->userGtxMask = gtx_info->gtx_usrcfg; + cmd->gtxPERThreshold = gtx_info->gtx_threshold; + cmd->gtxPERMargin = gtx_info->gtx_margin; + cmd->gtxTPCstep = gtx_info->gtx_tpcstep; + cmd->gtxTPCMin = gtx_info->gtx_tpcmin; + cmd->gtxBWMask = gtx_info->gtx_bwmask; + + WMA_LOGD("Setting vdev%d GTX values:htmcs 0x%x, vhtmcs 0x%x, usermask 0x%x, \ + gtxPERThreshold %d, gtxPERMargin %d, gtxTPCstep %d, gtxTPCMin %d, \ + gtxBWMask 0x%x.", if_id, cmd->gtxRTMask[0], cmd->gtxRTMask[1], + cmd->userGtxMask, cmd->gtxPERThreshold, cmd->gtxPERMargin, + cmd->gtxTPCstep, cmd->gtxTPCMin, cmd->gtxBWMask); + + return wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_VDEV_SET_GTX_PARAMS_CMDID); +} + +/** + * send_process_update_edca_param_cmd_tlv() - update EDCA params + * @wmi_handle: wmi handle + * @edca_params: edca parameters + * + * This function updates EDCA parameters to the target + * + * Return: CDF Status + */ +CDF_STATUS send_process_update_edca_param_cmd_tlv(wmi_unified_t wmi_handle, + uint8_t vdev_id, + wmi_wmm_vparams gwmm_param[WMI_MAX_NUM_AC]) +{ + uint8_t *buf_ptr; + wmi_buf_t buf; + wmi_vdev_set_wmm_params_cmd_fixed_param *cmd; + wmi_wmm_vparams *wmm_param, *twmm_param; + int len = sizeof(*cmd); + int ac; + + buf = wmi_buf_alloc(wmi_handle, len); + + if (!buf) { + WMA_LOGE("%s: wmi_buf_alloc failed", __func__); + return CDF_STATUS_E_NOMEM; + } + + buf_ptr = (uint8_t *) wmi_buf_data(buf); + cmd = (wmi_vdev_set_wmm_params_cmd_fixed_param *) buf_ptr; + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_vdev_set_wmm_params_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_vdev_set_wmm_params_cmd_fixed_param)); + cmd->vdev_id = vdev_id; + + for (ac = 0; ac < WMI_MAX_NUM_AC; ac++) { + wmm_param = (wmi_wmm_vparams *) (&cmd->wmm_params[ac]); + twmm_param = (wmi_wmm_vparams *) (&gwmm_param[ac]); + WMITLV_SET_HDR(&wmm_param->tlv_header, + WMITLV_TAG_STRUC_wmi_vdev_set_wmm_params_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN(wmi_wmm_vparams)); + wmm_param->cwmin = twmm_param->cwmin; + wmm_param->cwmax = twmm_param->cwmax; + wmm_param->aifs = twmm_param->aifs; + wmm_param->txoplimit = twmm_param->txoplimit; + wmm_param->acm = twmm_param->acm; + wmm_param->no_ack = twmm_param->no_ack; + } + + if (wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_VDEV_SET_WMM_PARAMS_CMDID)) + goto fail; + + return CDF_STATUS_SUCCESS; + +fail: + wmi_buf_free(buf); + WMA_LOGE("%s: Failed to set WMM Paremeters", __func__); + return CDF_STATUS_E_FAILURE; +} + +/** + * send_probe_rsp_tmpl_send_cmd_tlv() - send probe response template to fw + * @wmi_handle: wmi handle + * @vdev_id: vdev id + * @probe_rsp_info: probe response info + * + * Return: 0 for success or error code + */ +CDF_STATUS send_probe_rsp_tmpl_send_cmd_tlv(wmi_unified_t wmi_handle, + uint8_t vdev_id, + struct wmi_probe_resp_params *probe_rsp_info, + uint8_t *frm) +{ + wmi_prb_tmpl_cmd_fixed_param *cmd; + wmi_bcn_prb_info *bcn_prb_info; + wmi_buf_t wmi_buf; + uint32_t tmpl_len, tmpl_len_aligned, wmi_buf_len; + uint8_t *buf_ptr; + int ret; + + WMA_LOGD(FL("Send probe response template for vdev %d"), vdev_id); + + tmpl_len = probe_rsp_info->probeRespTemplateLen; + tmpl_len_aligned = roundup(tmpl_len, sizeof(A_UINT32)); + + wmi_buf_len = sizeof(wmi_prb_tmpl_cmd_fixed_param) + + sizeof(wmi_bcn_prb_info) + WMI_TLV_HDR_SIZE + + tmpl_len_aligned; + + if (wmi_buf_len > WMI_BEACON_TX_BUFFER_SIZE) { + WMA_LOGE(FL("wmi_buf_len: %d > %d. Can't send wmi cmd"), + wmi_buf_len, WMI_BEACON_TX_BUFFER_SIZE); + return -EINVAL; + } + + wmi_buf = wmi_buf_alloc(wmi_handle, wmi_buf_len); + if (!wmi_buf) { + WMA_LOGE(FL("wmi_buf_alloc failed")); + return -ENOMEM; + } + + buf_ptr = (uint8_t *) wmi_buf_data(wmi_buf); + + cmd = (wmi_prb_tmpl_cmd_fixed_param *) buf_ptr; + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_prb_tmpl_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN(wmi_prb_tmpl_cmd_fixed_param)); + cmd->vdev_id = vdev_id; + cmd->buf_len = tmpl_len; + buf_ptr += sizeof(wmi_prb_tmpl_cmd_fixed_param); + + bcn_prb_info = (wmi_bcn_prb_info *) buf_ptr; + WMITLV_SET_HDR(&bcn_prb_info->tlv_header, + WMITLV_TAG_STRUC_wmi_bcn_prb_info, + WMITLV_GET_STRUCT_TLVLEN(wmi_bcn_prb_info)); + bcn_prb_info->caps = 0; + bcn_prb_info->erp = 0; + buf_ptr += sizeof(wmi_bcn_prb_info); + + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE, tmpl_len_aligned); + buf_ptr += WMI_TLV_HDR_SIZE; + cdf_mem_copy(buf_ptr, frm, tmpl_len); + + ret = wmi_unified_cmd_send(wmi_handle, + wmi_buf, wmi_buf_len, WMI_PRB_TMPL_CMDID); + if (ret) { + WMA_LOGE(FL("Failed to send PRB RSP tmpl: %d"), ret); + wmi_buf_free(wmi_buf); + } + + return ret; +} + +/** + * send_p2p_go_set_beacon_ie_cmd_tlv() - set beacon IE for p2p go + * @wmi_handle: wmi handle + * @vdev_id: vdev id + * @p2p_ie: p2p IE + * + * Return: 0 for success or error code + */ +CDF_STATUS send_p2p_go_set_beacon_ie_cmd_tlv(wmi_unified_t wmi_handle, + A_UINT32 vdev_id, uint8_t *p2p_ie) +{ + int ret; + wmi_p2p_go_set_beacon_ie_fixed_param *cmd; + wmi_buf_t wmi_buf; + uint32_t ie_len, ie_len_aligned, wmi_buf_len; + uint8_t *buf_ptr; + + ie_len = (uint32_t) (p2p_ie[1] + 2); + + /* More than one P2P IE may be included in a single frame. + If multiple P2P IEs are present, the complete P2P attribute + data consists of the concatenation of the P2P Attribute + fields of the P2P IEs. The P2P Attributes field of each + P2P IE may be any length up to the maximum (251 octets). + In this case host sends one P2P IE to firmware so the length + should not exceed more than 251 bytes + */ + if (ie_len > 251) { + WMA_LOGE("%s : invalid p2p ie length %u", __func__, ie_len); + return -EINVAL; + } + + ie_len_aligned = roundup(ie_len, sizeof(A_UINT32)); + + wmi_buf_len = + sizeof(wmi_p2p_go_set_beacon_ie_fixed_param) + ie_len_aligned + + WMI_TLV_HDR_SIZE; + + wmi_buf = wmi_buf_alloc(wmi_handle, wmi_buf_len); + if (!wmi_buf) { + WMA_LOGE("%s : wmi_buf_alloc failed", __func__); + return -ENOMEM; + } + + buf_ptr = (uint8_t *) wmi_buf_data(wmi_buf); + + cmd = (wmi_p2p_go_set_beacon_ie_fixed_param *) buf_ptr; + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_p2p_go_set_beacon_ie_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_p2p_go_set_beacon_ie_fixed_param)); + cmd->vdev_id = vdev_id; + cmd->ie_buf_len = ie_len; + + buf_ptr += sizeof(wmi_p2p_go_set_beacon_ie_fixed_param); + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE, ie_len_aligned); + buf_ptr += WMI_TLV_HDR_SIZE; + cdf_mem_copy(buf_ptr, p2p_ie, ie_len); + + WMA_LOGI("%s: Sending WMI_P2P_GO_SET_BEACON_IE", __func__); + + ret = wmi_unified_cmd_send(wmi_handle, + wmi_buf, wmi_buf_len, + WMI_P2P_GO_SET_BEACON_IE); + if (ret) { + WMA_LOGE("Failed to send bcn tmpl: %d", ret); + wmi_buf_free(wmi_buf); + } + + WMA_LOGI("%s: Successfully sent WMI_P2P_GO_SET_BEACON_IE", __func__); + return ret; +} + +/** + * send_set_gateway_params_cmd_tlv() - set gateway parameters + * @wmi_handle: wmi handle + * @req: gateway parameter update request structure + * + * This function reads the incoming @req and fill in the destination + * WMI structure and sends down the gateway configs down to the firmware + * + * Return: CDF_STATUS + */ +CDF_STATUS send_set_gateway_params_cmd_tlv(wmi_unified_t wmi_handle, + struct gateway_update_req_param *req) +{ + wmi_roam_subnet_change_config_fixed_param *cmd; + wmi_buf_t buf; + int ret; + int len = sizeof(*cmd); + + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) { + WMA_LOGP("%s: wmi_buf_alloc failed", __func__); + return CDF_STATUS_E_NOMEM; + } + + cmd = (wmi_roam_subnet_change_config_fixed_param *) wmi_buf_data(buf); + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_roam_subnet_change_config_fixed_param, + WMITLV_GET_STRUCT_TLVLEN( + wmi_roam_subnet_change_config_fixed_param)); + + cmd->vdev_id = req->session_id; + cdf_mem_copy(&cmd->inet_gw_ip_v4_addr, req->ipv4_addr, + CDF_IPV4_ADDR_SIZE); + cdf_mem_copy(&cmd->inet_gw_ip_v6_addr, req->ipv6_addr, + CDF_IPV6_ADDR_SIZE); + WMI_CHAR_ARRAY_TO_MAC_ADDR(req->gw_mac_addr.bytes, + &cmd->inet_gw_mac_addr); + cmd->max_retries = req->max_retries; + cmd->timeout = req->timeout; + cmd->num_skip_subnet_change_detection_bssid_list = 0; + cmd->flag = 0; + if (req->ipv4_addr_type) + WMI_SET_ROAM_SUBNET_CHANGE_FLAG_IP4_ENABLED(cmd->flag); + + if (req->ipv6_addr_type) + WMI_SET_ROAM_SUBNET_CHANGE_FLAG_IP6_ENABLED(cmd->flag); + + ret = wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_ROAM_SUBNET_CHANGE_CONFIG_CMDID); + if (ret != EOK) { + WMA_LOGE("Failed to send gw config parameter to fw, ret: %d", + ret); + wmi_buf_free(buf); + return CDF_STATUS_E_FAILURE; + } + + return CDF_STATUS_SUCCESS; +} + +/** + * send_set_rssi_monitoring_cmd_tlv() - set rssi monitoring + * @wmi_handle: wmi handle + * @req: rssi monitoring request structure + * + * This function reads the incoming @req and fill in the destination + * WMI structure and send down the rssi monitoring configs down to the firmware + * + * Return: 0 on success; error number otherwise + */ +CDF_STATUS send_set_rssi_monitoring_cmd_tlv(wmi_unified_t wmi_handle, + struct rssi_monitor_param *req) +{ + wmi_rssi_breach_monitor_config_fixed_param *cmd; + wmi_buf_t buf; + int ret, len = sizeof(*cmd); + + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) { + WMA_LOGP("%s: wmi_buf_alloc failed", __func__); + return CDF_STATUS_E_NOMEM; + } + + cmd = (wmi_rssi_breach_monitor_config_fixed_param *) wmi_buf_data(buf); + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_rssi_breach_monitor_config_fixed_param, + WMITLV_GET_STRUCT_TLVLEN( + wmi_rssi_breach_monitor_config_fixed_param)); + + cmd->vdev_id = req->session_id; + cmd->request_id = req->request_id; + cmd->lo_rssi_reenable_hysteresis = 0; + cmd->hi_rssi_reenable_histeresis = 0; + cmd->min_report_interval = 0; + cmd->max_num_report = 1; + if (req->control) { + /* enable one threshold for each min/max */ + cmd->enabled_bitmap = 0x09; + cmd->low_rssi_breach_threshold[0] = req->min_rssi; + cmd->hi_rssi_breach_threshold[0] = req->max_rssi; + } else { + cmd->enabled_bitmap = 0; + cmd->low_rssi_breach_threshold[0] = 0; + cmd->hi_rssi_breach_threshold[0] = 0; + } + + ret = wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_RSSI_BREACH_MONITOR_CONFIG_CMDID); + if (ret != EOK) { + WMA_LOGE("Failed to send WMI_RSSI_BREACH_MONITOR_CONFIG_CMDID"); + wmi_buf_free(buf); + return CDF_STATUS_E_FAILURE; + } + + WMA_LOGI("Sent WMI_RSSI_BREACH_MONITOR_CONFIG_CMDID to FW"); + return CDF_STATUS_SUCCESS; +} + +/** + * send_scan_probe_setoui_cmd_tlv() - set scan probe OUI + * @wmi_handle: wmi handle + * @psetoui: OUI parameters + * + * set scan probe OUI parameters in firmware + * + * Return: CDF status + */ +CDF_STATUS send_scan_probe_setoui_cmd_tlv(wmi_unified_t wmi_handle, + struct scan_mac_oui *psetoui) +{ + wmi_scan_prob_req_oui_cmd_fixed_param *cmd; + wmi_buf_t wmi_buf; + uint32_t len; + uint8_t *buf_ptr; + uint32_t *oui_buf; + + len = sizeof(*cmd); + wmi_buf = wmi_buf_alloc(wmi_handle, len); + if (!wmi_buf) { + WMA_LOGE("%s: wmi_buf_alloc failed", __func__); + return CDF_STATUS_E_NOMEM; + } + buf_ptr = (uint8_t *) wmi_buf_data(wmi_buf); + cmd = (wmi_scan_prob_req_oui_cmd_fixed_param *) buf_ptr; + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_scan_prob_req_oui_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_scan_prob_req_oui_cmd_fixed_param)); + + oui_buf = &cmd->prob_req_oui; + cdf_mem_zero(oui_buf, sizeof(cmd->prob_req_oui)); + *oui_buf = psetoui->oui[0] << 16 | psetoui->oui[1] << 8 + | psetoui->oui[2]; + WMA_LOGD("%s: wmi:oui received from hdd %08x", __func__, + cmd->prob_req_oui); + + if (wmi_unified_cmd_send(wmi_handle, wmi_buf, len, + WMI_SCAN_PROB_REQ_OUI_CMDID)) { + WMA_LOGE("%s: failed to send command", __func__); + cdf_nbuf_free(wmi_buf); + return CDF_STATUS_E_FAILURE; + } + return CDF_STATUS_SUCCESS; +} + +/** + * send_reset_passpoint_network_list_cmd_tlv() - reset passpoint network list + * @wmi_handle: wmi handle + * @req: passpoint network request structure + * + * This function sends down WMI command with network id set to wildcard id. + * firmware shall clear all the config entries + * + * Return: CDF_STATUS enumeration + */ +CDF_STATUS send_reset_passpoint_network_list_cmd_tlv(wmi_unified_t wmi_handle, + struct wifi_passpoint_req_param *req) +{ + wmi_passpoint_config_cmd_fixed_param *cmd; + wmi_buf_t buf; + uint32_t len; + int ret; + + len = sizeof(*cmd); + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) { + WMA_LOGE("%s: Failed allocate wmi buffer", __func__); + return CDF_STATUS_E_NOMEM; + } + + cmd = (wmi_passpoint_config_cmd_fixed_param *) wmi_buf_data(buf); + + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_passpoint_config_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN( + wmi_passpoint_config_cmd_fixed_param)); + cmd->id = WMI_PASSPOINT_NETWORK_ID_WILDCARD; + + ret = wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_PASSPOINT_LIST_CONFIG_CMDID); + if (ret) { + WMA_LOGE("%s: Failed to send reset passpoint network list wmi cmd", + __func__); + wmi_buf_free(buf); + return CDF_STATUS_E_FAILURE; + } + + return CDF_STATUS_SUCCESS; +} + +/** + * send_set_passpoint_network_list_cmd_tlv() - set passpoint network list + * @wmi_handle: wmi handle + * @req: passpoint network request structure + * + * This function reads the incoming @req and fill in the destination + * WMI structure and send down the passpoint configs down to the firmware + * + * Return: CDF_STATUS enumeration + */ +CDF_STATUS send_set_passpoint_network_list_cmd_tlv(wmi_unified_t wmi_handle, + struct wifi_passpoint_req_param *req) +{ + wmi_passpoint_config_cmd_fixed_param *cmd; + u_int8_t i, j, *bytes; + wmi_buf_t buf; + uint32_t len; + int ret; + + len = sizeof(*cmd); + for (i = 0; i < req->num_networks; i++) { + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) { + WMA_LOGE("%s: Failed allocate wmi buffer", __func__); + return CDF_STATUS_E_NOMEM; + } + + cmd = (wmi_passpoint_config_cmd_fixed_param *) + wmi_buf_data(buf); + + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_passpoint_config_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN( + wmi_passpoint_config_cmd_fixed_param)); + cmd->id = req->networks[i].id; + WMA_LOGD("%s: network id: %u", __func__, cmd->id); + cdf_mem_copy(cmd->realm, req->networks[i].realm, + strlen(req->networks[i].realm) + 1); + WMA_LOGD("%s: realm: %s", __func__, cmd->realm); + for (j = 0; j < PASSPOINT_ROAMING_CONSORTIUM_ID_NUM; j++) { + bytes = (uint8_t *) &req->networks[i].roaming_consortium_ids[j]; + WMA_LOGD("index: %d rcids: %02x %02x %02x %02x %02x %02x %02x %02x", + j, bytes[0], bytes[1], bytes[2], bytes[3], + bytes[4], bytes[5], bytes[6], bytes[7]); + + cdf_mem_copy(&cmd->roaming_consortium_ids[j], + &req->networks[i].roaming_consortium_ids[j], + PASSPOINT_ROAMING_CONSORTIUM_ID_LEN); + } + cdf_mem_copy(cmd->plmn, req->networks[i].plmn, + PASSPOINT_PLMN_ID_LEN); + WMA_LOGD("%s: plmn: %02x:%02x:%02x", __func__, + cmd->plmn[0], cmd->plmn[1], cmd->plmn[2]); + + ret = wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_PASSPOINT_LIST_CONFIG_CMDID); + if (ret) { + WMA_LOGE("%s: Failed to send set passpoint network list wmi cmd", + __func__); + wmi_buf_free(buf); + return CDF_STATUS_E_FAILURE; + } + } + + return CDF_STATUS_SUCCESS; +} + +/** send_set_epno_network_list_cmd_tlv() - set epno network list + * @wmi_handle: wmi handle + * @req: epno config params request structure + * + * This function reads the incoming epno config request structure + * and constructs the WMI message to the firmware. + * + * Returns: 0 on success, error number otherwise + */ +CDF_STATUS send_set_epno_network_list_cmd_tlv(wmi_unified_t wmi_handle, + struct wifi_enhanched_pno_params *req) +{ + wmi_nlo_config_cmd_fixed_param *cmd; + nlo_configured_parameters *nlo_list; + u_int8_t i, *buf_ptr; + wmi_buf_t buf; + uint32_t len; + int ret; + + /* TLV place holder for array of structures + * nlo_configured_parameters(nlo_list) */ + len = sizeof(*cmd) + WMI_TLV_HDR_SIZE; + len += sizeof(nlo_configured_parameters) * + CDF_MIN(req->num_networks, WMI_NLO_MAX_SSIDS); + len += WMI_TLV_HDR_SIZE; /* TLV for channel_list */ + len += WMI_TLV_HDR_SIZE; /* TLV for channel prediction cfg*/ + + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) { + WMA_LOGE("%s: Failed allocate wmi buffer", __func__); + return CDF_STATUS_E_NOMEM; + } + + cmd = (wmi_nlo_config_cmd_fixed_param *) wmi_buf_data(buf); + + buf_ptr = (u_int8_t *) cmd; + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_nlo_config_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN( + wmi_nlo_config_cmd_fixed_param)); + cmd->vdev_id = req->session_id; + cmd->flags = WMI_NLO_CONFIG_ENLO; + + buf_ptr += sizeof(wmi_nlo_config_cmd_fixed_param); + + cmd->no_of_ssids = CDF_MIN(req->num_networks, WMI_NLO_MAX_SSIDS); + WMA_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)); + buf_ptr += WMI_TLV_HDR_SIZE; + + nlo_list = (nlo_configured_parameters *) buf_ptr; + for (i = 0; i < cmd->no_of_ssids; i++) { + WMITLV_SET_HDR(&nlo_list[i].tlv_header, + WMITLV_TAG_ARRAY_BYTE, + WMITLV_GET_STRUCT_TLVLEN(nlo_configured_parameters)); + /* Copy ssid and it's length */ + nlo_list[i].ssid.valid = true; + nlo_list[i].ssid.ssid.ssid_len = req->networks[i].ssid.length; + cdf_mem_copy(nlo_list[i].ssid.ssid.ssid, + req->networks[i].ssid.mac_ssid, + nlo_list[i].ssid.ssid.ssid_len); + WMA_LOGD("index: %d ssid: %.*s len: %d", i, + nlo_list[i].ssid.ssid.ssid_len, + (char *) nlo_list[i].ssid.ssid.ssid, + nlo_list[i].ssid.ssid.ssid_len); + + /* Copy rssi threshold */ + nlo_list[i].rssi_cond.valid = true; + nlo_list[i].rssi_cond.rssi = + req->networks[i].rssi_threshold; + WMA_LOGD("RSSI threshold : %d dBm", + nlo_list[i].rssi_cond.rssi); + + /* Copy pno flags */ + nlo_list[i].bcast_nw_type.valid = true; + nlo_list[i].bcast_nw_type.bcast_nw_type = + req->networks[i].flags; + WMA_LOGD("PNO flags (%u)", + nlo_list[i].bcast_nw_type.bcast_nw_type); + + /* Copy auth bit field */ + nlo_list[i].auth_type.valid = true; + nlo_list[i].auth_type.auth_type = + req->networks[i].auth_bit_field; + WMA_LOGD("Auth bit field (%u)", + nlo_list[i].auth_type.auth_type); + } + + buf_ptr += cmd->no_of_ssids * sizeof(nlo_configured_parameters); + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_UINT32, 0); + buf_ptr += WMI_TLV_HDR_SIZE; + + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0); + buf_ptr += WMI_TLV_HDR_SIZE; + ret = wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID); + if (ret) { + WMA_LOGE("%s: Failed to send nlo wmi cmd", __func__); + wmi_buf_free(buf); + return CDF_STATUS_E_FAILURE; + } + + WMA_LOGD("set ePNO list request sent successfully for vdev %d", + req->session_id); + + return CDF_STATUS_SUCCESS; +} + +/** send_ipa_offload_control_cmd_tlv() - ipa offload control parameter + * @wmi_handle: wmi handle + * @ipa_offload: ipa offload control parameter + * + * Returns: 0 on success, error number otherwise + */ +CDF_STATUS send_ipa_offload_control_cmd_tlv(wmi_unified_t wmi_handle, + struct ipa_offload_control_params *ipa_offload) +{ + wmi_ipa_offload_enable_disable_cmd_fixed_param *cmd; + wmi_buf_t wmi_buf; + uint32_t len; + u_int8_t *buf_ptr; + + len = sizeof(*cmd); + wmi_buf = wmi_buf_alloc(wmi_handle, len); + if (!wmi_buf) { + WMA_LOGE("%s: wmi_buf_alloc failed (len=%d)", __func__, len); + return CDF_STATUS_E_NOMEM; + } + + WMA_LOGE("%s: offload_type=%d, enable=%d", __func__, + ipa_offload->offload_type, ipa_offload->enable); + + buf_ptr = (u_int8_t *)wmi_buf_data(wmi_buf); + + cmd = (wmi_ipa_offload_enable_disable_cmd_fixed_param *)buf_ptr; + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUCT_wmi_ipa_offload_enable_disable_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN( + wmi_ipa_offload_enable_disable_cmd_fixed_param)); + + cmd->offload_type = ipa_offload->offload_type; + cmd->vdev_id = ipa_offload->vdev_id; + cmd->enable = ipa_offload->enable; + + if (wmi_unified_cmd_send(wmi_handle, wmi_buf, len, + WMI_IPA_OFFLOAD_ENABLE_DISABLE_CMDID)) { + WMA_LOGE("%s: failed to command", __func__); + wmi_buf_free(wmi_buf); + return CDF_STATUS_E_FAILURE; + } + + return CDF_STATUS_SUCCESS; +} + +/** + * send_extscan_get_capabilities_cmd_tlv() - extscan get capabilities + * @wmi_handle: wmi handle + * @pgetcapab: get capabilities params + * + * This function send request to fw to get extscan capabilities. + * + * Return: CDF status + */ +CDF_STATUS send_extscan_get_capabilities_cmd_tlv(wmi_unified_t wmi_handle, + struct extscan_capabilities_params *pgetcapab) +{ + wmi_extscan_get_capabilities_cmd_fixed_param *cmd; + wmi_buf_t wmi_buf; + uint32_t len; + uint8_t *buf_ptr; + + len = sizeof(*cmd); + wmi_buf = wmi_buf_alloc(wmi_handle, len); + if (!wmi_buf) { + WMA_LOGE("%s: wmi_buf_alloc failed", __func__); + return CDF_STATUS_E_NOMEM; + } + buf_ptr = (uint8_t *) wmi_buf_data(wmi_buf); + + cmd = (wmi_extscan_get_capabilities_cmd_fixed_param *) buf_ptr; + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_extscan_get_capabilities_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_extscan_get_capabilities_cmd_fixed_param)); + + cmd->request_id = pgetcapab->request_id; + + if (wmi_unified_cmd_send(wmi_handle, wmi_buf, len, + WMI_EXTSCAN_GET_CAPABILITIES_CMDID)) { + WMA_LOGE("%s: failed to command", __func__); + cdf_nbuf_free(wmi_buf); + return CDF_STATUS_E_FAILURE; + } + return CDF_STATUS_SUCCESS; +} + +/** + * send_extscan_get_cached_results_cmd_tlv() - extscan get cached results + * @wmi_handle: wmi handle + * @pcached_results: cached results parameters + * + * This function send request to fw to get cached results. + * + * Return: CDF status + */ +CDF_STATUS send_extscan_get_cached_results_cmd_tlv(wmi_unified_t wmi_handle, + struct extscan_cached_result_params *pcached_results) +{ + wmi_extscan_get_cached_results_cmd_fixed_param *cmd; + wmi_buf_t wmi_buf; + uint32_t len; + uint8_t *buf_ptr; + + len = sizeof(*cmd); + wmi_buf = wmi_buf_alloc(wmi_handle, len); + if (!wmi_buf) { + WMA_LOGE("%s: wmi_buf_alloc failed", __func__); + return CDF_STATUS_E_NOMEM; + } + buf_ptr = (uint8_t *) wmi_buf_data(wmi_buf); + + cmd = (wmi_extscan_get_cached_results_cmd_fixed_param *) buf_ptr; + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_extscan_get_cached_results_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_extscan_get_cached_results_cmd_fixed_param)); + + cmd->request_id = pcached_results->request_id; + cmd->vdev_id = pcached_results->session_id; + cmd->control_flags = pcached_results->flush; + + if (wmi_unified_cmd_send(wmi_handle, wmi_buf, len, + WMI_EXTSCAN_GET_CACHED_RESULTS_CMDID)) { + WMA_LOGE("%s: failed to command", __func__); + cdf_nbuf_free(wmi_buf); + return CDF_STATUS_E_FAILURE; + } + return CDF_STATUS_SUCCESS; +} + +/** + * send_extscan_stop_change_monitor_cmd_tlv() - send stop change monitor cmd + * @wmi_handle: wmi handle + * @reset_req: Reset change request params + * + * This function sends stop change monitor request to fw. + * + * Return: CDF status + */ +CDF_STATUS send_extscan_stop_change_monitor_cmd_tlv(wmi_unified_t wmi_handle, + struct extscan_capabilities_reset_params *reset_req) +{ + wmi_extscan_configure_wlan_change_monitor_cmd_fixed_param *cmd; + wmi_buf_t wmi_buf; + uint32_t len; + uint8_t *buf_ptr; + int change_list = 0; + + len = sizeof(*cmd); + + /* reset significant change tlv is set to 0 */ + len += WMI_TLV_HDR_SIZE; + len += change_list * sizeof(wmi_extscan_wlan_change_bssid_param); + wmi_buf = wmi_buf_alloc(wmi_handle, len); + if (!wmi_buf) { + WMA_LOGE("%s: wmi_buf_alloc failed", __func__); + return CDF_STATUS_E_NOMEM; + } + buf_ptr = (uint8_t *) wmi_buf_data(wmi_buf); + + cmd = (wmi_extscan_configure_wlan_change_monitor_cmd_fixed_param *) + buf_ptr; + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_extscan_configure_wlan_change_monitor_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_extscan_configure_wlan_change_monitor_cmd_fixed_param)); + + cmd->request_id = reset_req->request_id; + cmd->vdev_id = reset_req->session_id; + cmd->mode = 0; + + buf_ptr += sizeof(*cmd); + WMITLV_SET_HDR(buf_ptr, + WMITLV_TAG_ARRAY_STRUC, + change_list * + sizeof(wmi_extscan_wlan_change_bssid_param)); + buf_ptr += WMI_TLV_HDR_SIZE + (change_list * + sizeof + (wmi_extscan_wlan_change_bssid_param)); + + if (wmi_unified_cmd_send(wmi_handle, wmi_buf, len, + WMI_EXTSCAN_CONFIGURE_WLAN_CHANGE_MONITOR_CMDID)) { + WMA_LOGE("%s: failed to command", __func__); + cdf_nbuf_free(wmi_buf); + return CDF_STATUS_E_FAILURE; + } + return CDF_STATUS_SUCCESS; +} + +/** + * wmi_get_buf_extscan_change_monitor_cmd() - fill change monitor request + * @wmi_handle: wmi handle + * @psigchange: change monitor request params + * @buf: wmi buffer + * @buf_len: buffer length + * + * This function fills elements of change monitor request buffer. + * + * Return: CDF status + */ +static CDF_STATUS wmi_get_buf_extscan_change_monitor_cmd(wmi_unified_t wmi_handle, + struct extscan_set_sig_changereq_params + *psigchange, wmi_buf_t *buf, int *buf_len) +{ + wmi_extscan_configure_wlan_change_monitor_cmd_fixed_param *cmd; + wmi_extscan_wlan_change_bssid_param *dest_chglist; + uint8_t *buf_ptr; + int j; + int len = sizeof(*cmd); + int numap = psigchange->num_ap; + struct ap_threshold_params *src_ap = psigchange->ap; + + if (!numap) { + WMA_LOGE("%s: Invalid number of bssid's", __func__); + return CDF_STATUS_E_INVAL; + } + len += WMI_TLV_HDR_SIZE; + len += numap * sizeof(wmi_extscan_wlan_change_bssid_param); + + *buf = wmi_buf_alloc(wmi_handle, len); + if (!*buf) { + WMA_LOGP("%s: failed to allocate memory for change monitor cmd", + __func__); + return CDF_STATUS_E_FAILURE; + } + buf_ptr = (uint8_t *) wmi_buf_data(*buf); + cmd = + (wmi_extscan_configure_wlan_change_monitor_cmd_fixed_param *) + buf_ptr; + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_extscan_configure_wlan_change_monitor_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_extscan_configure_wlan_change_monitor_cmd_fixed_param)); + + cmd->request_id = psigchange->request_id; + cmd->vdev_id = psigchange->session_id; + cmd->total_entries = numap; + cmd->mode = 1; + cmd->num_entries_in_page = numap; + cmd->lost_ap_scan_count = psigchange->lostap_sample_size; + cmd->max_rssi_samples = psigchange->rssi_sample_size; + cmd->rssi_averaging_samples = psigchange->rssi_sample_size; + cmd->max_out_of_range_count = psigchange->min_breaching; + + buf_ptr += sizeof(*cmd); + WMITLV_SET_HDR(buf_ptr, + WMITLV_TAG_ARRAY_STRUC, + numap * sizeof(wmi_extscan_wlan_change_bssid_param)); + dest_chglist = (wmi_extscan_wlan_change_bssid_param *) + (buf_ptr + WMI_TLV_HDR_SIZE); + + for (j = 0; j < numap; j++) { + WMITLV_SET_HDR(dest_chglist, + WMITLV_TAG_STRUC_wmi_extscan_bucket_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_extscan_wlan_change_bssid_param)); + + dest_chglist->lower_rssi_limit = src_ap->low; + dest_chglist->upper_rssi_limit = src_ap->high; + WMI_CHAR_ARRAY_TO_MAC_ADDR(src_ap->bssid.bytes, + &dest_chglist->bssid); + + WMA_LOGD("%s: min_rssi %d", __func__, + dest_chglist->lower_rssi_limit); + dest_chglist++; + src_ap++; + } + buf_ptr += WMI_TLV_HDR_SIZE + + (numap * sizeof(wmi_extscan_wlan_change_bssid_param)); + *buf_len = len; + return CDF_STATUS_SUCCESS; +} + +/** + * send_extscan_start_change_monitor_cmd_tlv() - send start change monitor cmd + * @wmi_handle: wmi handle + * @psigchange: change monitor request params + * + * This function sends start change monitor request to fw. + * + * Return: CDF status + */ +CDF_STATUS send_extscan_start_change_monitor_cmd_tlv(wmi_unified_t wmi_handle, + struct extscan_set_sig_changereq_params * + psigchange) +{ + CDF_STATUS cdf_status = CDF_STATUS_SUCCESS; + wmi_buf_t buf; + int len; + + + cdf_status = wmi_get_buf_extscan_change_monitor_cmd(wmi_handle, + psigchange, &buf, + &len); + if (cdf_status != CDF_STATUS_SUCCESS) { + WMA_LOGE("%s: Failed to get buffer for change monitor cmd", + __func__); + return CDF_STATUS_E_FAILURE; + } + if (!buf) { + WMA_LOGE("%s: Failed to get buffer", __func__); + return CDF_STATUS_E_FAILURE; + } + if (wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_EXTSCAN_CONFIGURE_WLAN_CHANGE_MONITOR_CMDID)) { + WMA_LOGE("%s: failed to send command", __func__); + cdf_nbuf_free(buf); + return CDF_STATUS_E_FAILURE; + } + return CDF_STATUS_SUCCESS; +} + +/** + * send_extscan_stop_hotlist_monitor_cmd_tlv() - stop hotlist monitor + * @wmi_handle: wmi handle + * @photlist_reset: hotlist reset params + * + * This function configures hotlist monitor to stop in fw. + * + * Return: CDF status + */ +CDF_STATUS send_extscan_stop_hotlist_monitor_cmd_tlv(wmi_unified_t wmi_handle, + struct extscan_bssid_hotlist_reset_params *photlist_reset) +{ + wmi_extscan_configure_hotlist_monitor_cmd_fixed_param *cmd; + wmi_buf_t wmi_buf; + uint32_t len; + uint8_t *buf_ptr; + int hotlist_entries = 0; + + len = sizeof(*cmd); + + /* reset bssid hotlist with tlv set to 0 */ + len += WMI_TLV_HDR_SIZE; + len += hotlist_entries * sizeof(wmi_extscan_hotlist_entry); + + wmi_buf = wmi_buf_alloc(wmi_handle, len); + if (!wmi_buf) { + WMA_LOGE("%s: wmi_buf_alloc failed", __func__); + return CDF_STATUS_E_NOMEM; + } + + buf_ptr = (uint8_t *) wmi_buf_data(wmi_buf); + cmd = (wmi_extscan_configure_hotlist_monitor_cmd_fixed_param *) + buf_ptr; + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_extscan_configure_hotlist_monitor_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_extscan_configure_hotlist_monitor_cmd_fixed_param)); + + cmd->request_id = photlist_reset->request_id; + cmd->vdev_id = photlist_reset->session_id; + cmd->mode = 0; + + buf_ptr += sizeof(*cmd); + WMITLV_SET_HDR(buf_ptr, + WMITLV_TAG_ARRAY_STRUC, + hotlist_entries * sizeof(wmi_extscan_hotlist_entry)); + buf_ptr += WMI_TLV_HDR_SIZE + + (hotlist_entries * sizeof(wmi_extscan_hotlist_entry)); + + if (wmi_unified_cmd_send(wmi_handle, wmi_buf, len, + WMI_EXTSCAN_CONFIGURE_HOTLIST_MONITOR_CMDID)) { + WMA_LOGE("%s: failed to command", __func__); + cdf_nbuf_free(wmi_buf); + return CDF_STATUS_E_FAILURE; + } + return CDF_STATUS_SUCCESS; +} + +/** + * send_stop_extscan_cmd_tlv() - stop extscan command to fw. + * @wmi_handle: wmi handle + * @pstopcmd: stop scan command request params + * + * This function sends stop extscan request to fw. + * + * Return: CDF Status. + */ +CDF_STATUS send_stop_extscan_cmd_tlv(wmi_unified_t wmi_handle, + struct extscan_stop_req_params *pstopcmd) +{ + wmi_extscan_stop_cmd_fixed_param *cmd; + wmi_buf_t wmi_buf; + uint32_t len; + uint8_t *buf_ptr; + + len = sizeof(*cmd); + wmi_buf = wmi_buf_alloc(wmi_handle, len); + if (!wmi_buf) { + WMA_LOGE("%s: wmi_buf_alloc failed", __func__); + return CDF_STATUS_E_NOMEM; + } + buf_ptr = (uint8_t *) wmi_buf_data(wmi_buf); + cmd = (wmi_extscan_stop_cmd_fixed_param *) buf_ptr; + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_extscan_stop_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_extscan_stop_cmd_fixed_param)); + + cmd->request_id = pstopcmd->request_id; + cmd->vdev_id = pstopcmd->session_id; + + if (wmi_unified_cmd_send(wmi_handle, wmi_buf, len, + WMI_EXTSCAN_STOP_CMDID)) { + WMA_LOGE("%s: failed to command", __func__); + cdf_nbuf_free(wmi_buf); + return CDF_STATUS_E_FAILURE; + } + + return CDF_STATUS_SUCCESS; +} + +/** + * wmi_get_buf_extscan_start_cmd() - Fill extscan start request + * @wmi_handle: wmi handle + * @pstart: scan command request params + * @buf: event buffer + * @buf_len: length of buffer + * + * This function fills individual elements of extscan request and + * TLV for buckets, channel list. + * + * Return: CDF Status. + */ +CDF_STATUS wmi_get_buf_extscan_start_cmd(wmi_unified_t wmi_handle, + struct wifi_scan_cmd_req_params *pstart, + wmi_buf_t *buf, int *buf_len) +{ + wmi_extscan_start_cmd_fixed_param *cmd; + wmi_extscan_bucket *dest_blist; + wmi_extscan_bucket_channel *dest_clist; + struct wifi_scan_bucket_params *src_bucket = pstart->buckets; + struct wifi_scan_channelspec_params *src_channel = src_bucket->channels; + struct wifi_scan_channelspec_params save_channel[WMI_WLAN_EXTSCAN_MAX_CHANNELS]; + + uint8_t *buf_ptr; + int i, k, count = 0; + int len = sizeof(*cmd); + int nbuckets = pstart->numBuckets; + int nchannels = 0; + + /* These TLV's are are NULL by default */ + uint32_t ie_len_with_pad = 0; + int num_ssid = 0; + int num_bssid = 0; + int ie_len = 0; + + uint32_t base_period = pstart->basePeriod; + + /* TLV placeholder for ssid_list (NULL) */ + len += WMI_TLV_HDR_SIZE; + len += num_ssid * sizeof(wmi_ssid); + + /* TLV placeholder for bssid_list (NULL) */ + len += WMI_TLV_HDR_SIZE; + len += num_bssid * sizeof(wmi_mac_addr); + + /* TLV placeholder for ie_data (NULL) */ + len += WMI_TLV_HDR_SIZE; + len += ie_len * sizeof(uint32_t); + + /* TLV placeholder for bucket */ + len += WMI_TLV_HDR_SIZE; + len += nbuckets * sizeof(wmi_extscan_bucket); + + /* TLV channel placeholder */ + len += WMI_TLV_HDR_SIZE; + for (i = 0; i < nbuckets; i++) { + nchannels += src_bucket->numChannels; + src_bucket++; + } + + WMA_LOGD("%s: Total buckets: %d total #of channels is %d", + __func__, nbuckets, nchannels); + len += nchannels * sizeof(wmi_extscan_bucket_channel); + /* Allocate the memory */ + *buf = wmi_buf_alloc(wmi_handle, len); + if (!*buf) { + WMA_LOGP("%s: failed to allocate memory" + " for start extscan cmd", __func__); + return CDF_STATUS_E_NOMEM; + } + buf_ptr = (uint8_t *) wmi_buf_data(*buf); + cmd = (wmi_extscan_start_cmd_fixed_param *) buf_ptr; + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_extscan_start_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_extscan_start_cmd_fixed_param)); + + cmd->request_id = pstart->requestId; + cmd->vdev_id = pstart->sessionId; + cmd->base_period = pstart->basePeriod; + cmd->num_buckets = nbuckets; + cmd->configuration_flags = 0; + if (pstart->configuration_flags & EXTSCAN_LP_EXTENDED_BATCHING) + cmd->configuration_flags |= WMI_EXTSCAN_EXTENDED_BATCHING_EN; + WMA_LOGI("%s: configuration_flags: 0x%x", __func__, + cmd->configuration_flags); + + cmd->min_rest_time = WMA_EXTSCAN_REST_TIME; + cmd->max_rest_time = WMA_EXTSCAN_REST_TIME; + cmd->max_bssids_per_scan_cycle = pstart->maxAPperScan; + + /* The max dwell time is retrieved from the first channel + * of the first bucket and kept common for all channels. + */ + cmd->min_dwell_time_active = pstart->min_dwell_time_active; + cmd->max_dwell_time_active = pstart->max_dwell_time_active; + cmd->min_dwell_time_passive = pstart->min_dwell_time_passive; + cmd->max_dwell_time_passive = pstart->max_dwell_time_passive; + cmd->max_bssids_per_scan_cycle = pstart->maxAPperScan; + cmd->max_table_usage = pstart->report_threshold_percent; + cmd->report_threshold_num_scans = pstart->report_threshold_num_scans; + + cmd->repeat_probe_time = cmd->max_dwell_time_active / + WMA_SCAN_NPROBES_DEFAULT; + cmd->max_scan_time = WMA_EXTSCAN_MAX_SCAN_TIME; + cmd->probe_delay = 0; + cmd->probe_spacing_time = 0; + cmd->idle_time = 0; + cmd->burst_duration = WMA_EXTSCAN_BURST_DURATION; + cmd->scan_ctrl_flags = WMI_SCAN_ADD_BCAST_PROBE_REQ | + WMI_SCAN_ADD_CCK_RATES | + WMI_SCAN_ADD_OFDM_RATES | + WMI_SCAN_ADD_SPOOFED_MAC_IN_PROBE_REQ | + WMI_SCAN_ADD_DS_IE_IN_PROBE_REQ; + cmd->scan_priority = WMI_SCAN_PRIORITY_HIGH; + cmd->num_ssids = 0; + cmd->num_bssid = 0; + cmd->ie_len = 0; + cmd->n_probes = (cmd->repeat_probe_time > 0) ? + cmd->max_dwell_time_active / cmd->repeat_probe_time : 0; + + buf_ptr += sizeof(*cmd); + WMITLV_SET_HDR(buf_ptr, + WMITLV_TAG_ARRAY_FIXED_STRUC, + num_ssid * sizeof(wmi_ssid)); + buf_ptr += WMI_TLV_HDR_SIZE + (num_ssid * sizeof(wmi_ssid)); + + WMITLV_SET_HDR(buf_ptr, + WMITLV_TAG_ARRAY_FIXED_STRUC, + num_bssid * sizeof(wmi_mac_addr)); + buf_ptr += WMI_TLV_HDR_SIZE + (num_bssid * sizeof(wmi_mac_addr)); + + ie_len_with_pad = 0; + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE, + ie_len_with_pad); + buf_ptr += WMI_TLV_HDR_SIZE + ie_len_with_pad; + + WMITLV_SET_HDR(buf_ptr, + WMITLV_TAG_ARRAY_STRUC, + nbuckets * sizeof(wmi_extscan_bucket)); + dest_blist = (wmi_extscan_bucket *) + (buf_ptr + WMI_TLV_HDR_SIZE); + src_bucket = pstart->buckets; + + /* Retrieve scanning information from each bucket and + * channels and send it to the target + */ + for (i = 0; i < nbuckets; i++) { + WMITLV_SET_HDR(dest_blist, + WMITLV_TAG_STRUC_wmi_extscan_bucket_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN(wmi_extscan_bucket)); + + dest_blist->bucket_id = src_bucket->bucket; + dest_blist->base_period_multiplier = + src_bucket->period / base_period; + dest_blist->min_period = src_bucket->period; + dest_blist->max_period = src_bucket->max_period; + dest_blist->exp_backoff = src_bucket->exponent; + dest_blist->exp_max_step_count = src_bucket->step_count; + dest_blist->channel_band = src_bucket->band; + dest_blist->num_channels = src_bucket->numChannels; + dest_blist->notify_extscan_events = 0; + + if (src_bucket->reportEvents & WMI_EXTSCAN_REPORT_EVENTS_EACH_SCAN) + dest_blist->notify_extscan_events = + WMI_EXTSCAN_BUCKET_COMPLETED_EVENT; + + if (src_bucket->reportEvents & + WMI_EXTSCAN_REPORT_EVENTS_FULL_RESULTS) { + dest_blist->forwarding_flags = + WMI_EXTSCAN_FORWARD_FRAME_TO_HOST; + dest_blist->notify_extscan_events |= + WMI_EXTSCAN_BUCKET_COMPLETED_EVENT | + WMI_EXTSCAN_CYCLE_STARTED_EVENT | + WMI_EXTSCAN_CYCLE_COMPLETED_EVENT; + } else { + dest_blist->forwarding_flags = + WMI_EXTSCAN_NO_FORWARDING; + } + + if (src_bucket->reportEvents & WMI_EXTSCAN_REPORT_EVENTS_NO_BATCH) + dest_blist->configuration_flags = 0; + else + dest_blist->configuration_flags = + WMI_EXTSCAN_BUCKET_CACHE_RESULTS; + + WMA_LOGI("%s: ntfy_extscan_events:%u cfg_flags:%u fwd_flags:%u", + __func__, dest_blist->notify_extscan_events, + dest_blist->configuration_flags, + dest_blist->forwarding_flags); + + dest_blist->min_dwell_time_active = + src_bucket->min_dwell_time_active; + dest_blist->max_dwell_time_active = + src_bucket->max_dwell_time_active; + dest_blist->min_dwell_time_passive = + src_bucket->min_dwell_time_passive; + dest_blist->max_dwell_time_passive = + src_bucket->max_dwell_time_passive; + src_channel = src_bucket->channels; + + /* save the channel info to later populate + * the channel TLV + */ + for (k = 0; k < src_bucket->numChannels; k++) { + save_channel[count++].channel = src_channel->channel; + src_channel++; + } + dest_blist++; + src_bucket++; + } + buf_ptr += WMI_TLV_HDR_SIZE + (nbuckets * sizeof(wmi_extscan_bucket)); + WMITLV_SET_HDR(buf_ptr, + WMITLV_TAG_ARRAY_STRUC, + nchannels * sizeof(wmi_extscan_bucket_channel)); + dest_clist = (wmi_extscan_bucket_channel *) + (buf_ptr + WMI_TLV_HDR_SIZE); + + /* Active or passive scan is based on the bucket dwell time + * and channel specific active,passive scans are not + * supported yet + */ + for (i = 0; i < nchannels; i++) { + WMITLV_SET_HDR(dest_clist, + WMITLV_TAG_STRUC_wmi_extscan_bucket_channel_event_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_extscan_bucket_channel)); + dest_clist->channel = save_channel[i].channel; + dest_clist++; + } + buf_ptr += WMI_TLV_HDR_SIZE + + (nchannels * sizeof(wmi_extscan_bucket_channel)); + *buf_len = len; + return CDF_STATUS_SUCCESS; +} + +/** + * send_start_extscan_cmd_tlv() - start extscan command to fw. + * @wmi_handle: wmi handle + * @pstart: scan command request params + * + * This function sends start extscan request to fw. + * + * Return: CDF Status. + */ +CDF_STATUS send_start_extscan_cmd_tlv(wmi_unified_t wmi_handle, + struct wifi_scan_cmd_req_params *pstart) +{ + CDF_STATUS cdf_status = CDF_STATUS_SUCCESS; + wmi_buf_t buf; + int len; + + /* Fill individual elements of extscan request and + * TLV for buckets, channel list. + */ + cdf_status = wmi_get_buf_extscan_start_cmd(wmi_handle, + pstart, &buf, &len); + if (cdf_status != CDF_STATUS_SUCCESS) { + WMA_LOGE("%s: Failed to get buffer for ext scan cmd", __func__); + return CDF_STATUS_E_FAILURE; + } + if (!buf) { + WMA_LOGE("%s:Failed to get buffer" + "for current extscan info", __func__); + return CDF_STATUS_E_FAILURE; + } + if (wmi_unified_cmd_send(wmi_handle, buf, + len, WMI_EXTSCAN_START_CMDID)) { + WMA_LOGE("%s: failed to send command", __func__); + cdf_nbuf_free(buf); + return CDF_STATUS_E_FAILURE; + } + + return CDF_STATUS_SUCCESS; +} + +/** + * send_plm_stop_cmd_tlv() - plm stop request + * @wmi_handle: wmi handle + * @plm: plm request parameters + * + * This function request FW to stop PLM. + * + * Return: CDF status + */ +CDF_STATUS send_plm_stop_cmd_tlv(wmi_unified_t wmi_handle, + const struct plm_req_params *plm) +{ + wmi_vdev_plmreq_stop_cmd_fixed_param *cmd; + int32_t len; + wmi_buf_t buf; + uint8_t *buf_ptr; + int ret; + + len = sizeof(*cmd); + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) { + WMA_LOGE("%s: Failed allocate wmi buffer", __func__); + return CDF_STATUS_E_NOMEM; + } + + cmd = (wmi_vdev_plmreq_stop_cmd_fixed_param *) wmi_buf_data(buf); + + buf_ptr = (uint8_t *) cmd; + + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_vdev_plmreq_stop_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_vdev_plmreq_stop_cmd_fixed_param)); + + cmd->vdev_id = plm->session_id; + + cmd->meas_token = plm->meas_token; + WMA_LOGD("vdev %d meas token %d", cmd->vdev_id, cmd->meas_token); + + ret = wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_VDEV_PLMREQ_STOP_CMDID); + if (ret) { + WMA_LOGE("%s: Failed to send plm stop wmi cmd", __func__); + wmi_buf_free(buf); + return CDF_STATUS_E_FAILURE; + } + + return CDF_STATUS_SUCCESS; +} + +/** + * send_plm_start_cmd_tlv() - plm start request + * @wmi_handle: wmi handle + * @plm: plm request parameters + * + * This function request FW to start PLM. + * + * Return: CDF status + */ +CDF_STATUS send_plm_start_cmd_tlv(wmi_unified_t wmi_handle, + const struct plm_req_params *plm, + uint32_t *gchannel_list) +{ + wmi_vdev_plmreq_start_cmd_fixed_param *cmd; + uint32_t *channel_list; + int32_t len; + wmi_buf_t buf; + uint8_t *buf_ptr; + uint8_t count; + int ret; + + /* TLV place holder for channel_list */ + len = sizeof(*cmd) + WMI_TLV_HDR_SIZE; + len += sizeof(uint32_t) * plm->plm_num_ch; + + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) { + WMA_LOGE("%s: Failed allocate wmi buffer", __func__); + return CDF_STATUS_E_NOMEM; + } + cmd = (wmi_vdev_plmreq_start_cmd_fixed_param *) wmi_buf_data(buf); + + buf_ptr = (uint8_t *) cmd; + + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_vdev_plmreq_start_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_vdev_plmreq_start_cmd_fixed_param)); + + cmd->vdev_id = plm->session_id; + + cmd->meas_token = plm->meas_token; + cmd->dialog_token = plm->diag_token; + cmd->number_bursts = plm->num_bursts; + cmd->burst_interval = WMA_SEC_TO_MSEC(plm->burst_int); + cmd->off_duration = plm->meas_duration; + cmd->burst_cycle = plm->burst_len; + cmd->tx_power = plm->desired_tx_pwr; + WMI_CHAR_ARRAY_TO_MAC_ADDR(plm->mac_addr.bytes, &cmd->dest_mac); + cmd->num_chans = plm->plm_num_ch; + + buf_ptr += sizeof(wmi_vdev_plmreq_start_cmd_fixed_param); + + WMA_LOGD("vdev : %d measu token : %d", cmd->vdev_id, cmd->meas_token); + WMA_LOGD("dialog_token: %d", cmd->dialog_token); + WMA_LOGD("number_bursts: %d", cmd->number_bursts); + WMA_LOGD("burst_interval: %d", cmd->burst_interval); + WMA_LOGD("off_duration: %d", cmd->off_duration); + WMA_LOGD("burst_cycle: %d", cmd->burst_cycle); + WMA_LOGD("tx_power: %d", cmd->tx_power); + WMA_LOGD("Number of channels : %d", cmd->num_chans); + + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_UINT32, + (cmd->num_chans * sizeof(uint32_t))); + + buf_ptr += WMI_TLV_HDR_SIZE; + if (cmd->num_chans) { + channel_list = (uint32_t *) buf_ptr; + for (count = 0; count < cmd->num_chans; count++) { + channel_list[count] = plm->plm_ch_list[count]; + if (channel_list[count] < WMA_NLO_FREQ_THRESH) + channel_list[count] = + gchannel_list[count]; + WMA_LOGD("Ch[%d]: %d MHz", count, channel_list[count]); + } + buf_ptr += cmd->num_chans * sizeof(uint32_t); + } + + ret = wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_VDEV_PLMREQ_START_CMDID); + if (ret) { + WMA_LOGE("%s: Failed to send plm start wmi cmd", __func__); + wmi_buf_free(buf); + return CDF_STATUS_E_FAILURE; + } + + return CDF_STATUS_SUCCESS; +} + +/** + * send_pno_stop_cmd_tlv() - PNO stop request + * @wmi_handle: wmi handle + * @vdev_id: vdev id + * + * This function request FW to stop ongoing PNO operation. + * + * Return: CDF status + */ +CDF_STATUS send_pno_stop_cmd_tlv(wmi_unified_t wmi_handle, uint8_t vdev_id) +{ + wmi_nlo_config_cmd_fixed_param *cmd; + int32_t len = sizeof(*cmd); + wmi_buf_t buf; + uint8_t *buf_ptr; + int ret; + + /* + * TLV place holder for array of structures nlo_configured_parameters + * TLV place holder for array of uint32_t channel_list + * TLV place holder for chnl prediction cfg + */ + len += WMI_TLV_HDR_SIZE + WMI_TLV_HDR_SIZE + WMI_TLV_HDR_SIZE; + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) { + WMA_LOGE("%s: Failed allocate wmi buffer", __func__); + return CDF_STATUS_E_NOMEM; + } + + cmd = (wmi_nlo_config_cmd_fixed_param *) wmi_buf_data(buf); + buf_ptr = (uint8_t *) cmd; + + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_nlo_config_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_nlo_config_cmd_fixed_param)); + + cmd->vdev_id = vdev_id; + cmd->flags = WMI_NLO_CONFIG_STOP; + buf_ptr += sizeof(*cmd); + + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0); + buf_ptr += WMI_TLV_HDR_SIZE; + + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_UINT32, 0); + buf_ptr += WMI_TLV_HDR_SIZE; + + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0); + buf_ptr += WMI_TLV_HDR_SIZE; + + + ret = wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID); + if (ret) { + WMA_LOGE("%s: Failed to send nlo wmi cmd", __func__); + wmi_buf_free(buf); + return CDF_STATUS_E_FAILURE; + } + + return CDF_STATUS_SUCCESS; +} + +/** + * send_pno_start_cmd_tlv() - PNO start request + * @wmi_handle: wmi handle + * @pno: PNO request + * + * This function request FW to start PNO request. + * Request: CDF status + */ +CDF_STATUS send_pno_start_cmd_tlv(wmi_unified_t wmi_handle, + struct pno_scan_req_params *pno, + uint32_t *gchannel_freq_list) +{ + wmi_nlo_config_cmd_fixed_param *cmd; + nlo_configured_parameters *nlo_list; + uint32_t *channel_list; + int32_t len; + wmi_buf_t buf; + uint8_t *buf_ptr; + uint8_t i; + int ret; + + /* + * 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 + */ + len = sizeof(*cmd) + + WMI_TLV_HDR_SIZE + WMI_TLV_HDR_SIZE + WMI_TLV_HDR_SIZE; + + len += sizeof(uint32_t) * CDF_MIN(pno->aNetworks[0].ucChannelCount, + WMI_NLO_MAX_CHAN); + len += sizeof(nlo_configured_parameters) * + CDF_MIN(pno->ucNetworksCount, WMI_NLO_MAX_SSIDS); + len += sizeof(nlo_channel_prediction_cfg); + + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) { + WMA_LOGE("%s: Failed allocate wmi buffer", __func__); + return CDF_STATUS_E_NOMEM; + } + + cmd = (wmi_nlo_config_cmd_fixed_param *) wmi_buf_data(buf); + + buf_ptr = (uint8_t *) cmd; + WMITLV_SET_HDR(&cmd->tlv_header, + 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->flags = WMI_NLO_CONFIG_START | WMI_NLO_CONFIG_SSID_HIDE_EN; + + /* 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; + + /* Copy scan interval */ + cmd->fast_scan_period = pno->fast_scan_period; + cmd->slow_scan_period = pno->slow_scan_period; + cmd->fast_scan_max_cycles = pno->fast_scan_max_cycles; + WMA_LOGD("fast_scan_period: %d msec slow_scan_period: %d msec", + cmd->fast_scan_period, cmd->slow_scan_period); + WMA_LOGD("fast_scan_max_cycles: %d", cmd->fast_scan_max_cycles); + + buf_ptr += sizeof(wmi_nlo_config_cmd_fixed_param); + + cmd->no_of_ssids = CDF_MIN(pno->ucNetworksCount, WMI_NLO_MAX_SSIDS); + WMA_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)); + buf_ptr += WMI_TLV_HDR_SIZE; + + nlo_list = (nlo_configured_parameters *) buf_ptr; + for (i = 0; i < cmd->no_of_ssids; i++) { + WMITLV_SET_HDR(&nlo_list[i].tlv_header, + WMITLV_TAG_ARRAY_BYTE, + WMITLV_GET_STRUCT_TLVLEN + (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; + cdf_mem_copy(nlo_list[i].ssid.ssid.ssid, + pno->aNetworks[i].ssid.mac_ssid, + nlo_list[i].ssid.ssid.ssid_len); + WMA_LOGD("index: %d ssid: %.*s len: %d", i, + nlo_list[i].ssid.ssid.ssid_len, + (char *)nlo_list[i].ssid.ssid.ssid, + nlo_list[i].ssid.ssid.ssid_len); + + /* Copy rssi threshold */ + if (pno->aNetworks[i].rssiThreshold && + pno->aNetworks[i].rssiThreshold > WMI_RSSI_THOLD_DEFAULT) { + nlo_list[i].rssi_cond.valid = true; + nlo_list[i].rssi_cond.rssi = + pno->aNetworks[i].rssiThreshold; + WMA_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; + WMA_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 = CDF_MIN(pno->aNetworks[0].ucChannelCount, + WMI_NLO_MAX_CHAN); + WMA_LOGD("Channel count: %d", cmd->num_of_channels); + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_UINT32, + (cmd->num_of_channels * sizeof(uint32_t))); + buf_ptr += WMI_TLV_HDR_SIZE; + + channel_list = (uint32_t *) buf_ptr; + for (i = 0; i < cmd->num_of_channels; i++) { + channel_list[i] = pno->aNetworks[0].aChannels[i]; + + if (channel_list[i] < WMI_NLO_FREQ_THRESH) + channel_list[i] = gchannel_freq_list[i]; + + WMA_LOGD("Ch[%d]: %d MHz", i, channel_list[i]); + } + buf_ptr += cmd->num_of_channels * sizeof(uint32_t); + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, + sizeof(nlo_channel_prediction_cfg)); + buf_ptr += WMI_TLV_HDR_SIZE; + buf_ptr += WMI_TLV_HDR_SIZE; + /** TODO: Discrete firmware doesn't have command/option to configure + * App IE which comes from wpa_supplicant as of part PNO start request. + */ + ret = wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID); + if (ret) { + WMA_LOGE("%s: Failed to send nlo wmi cmd", __func__); + wmi_buf_free(buf); + return CDF_STATUS_E_FAILURE; + } + + return CDF_STATUS_SUCCESS; +} + +/* send_set_ric_req_cmd_tlv() - set ric request element + * @wmi_handle: wmi handle + * @msg: message + * @is_add_ts: is addts required + * + * This function sets ric request element for 11r roaming. + * + * Return: CDF status + */ +CDF_STATUS send_set_ric_req_cmd_tlv(wmi_unified_t wmi_handle, + void *msg, uint8_t is_add_ts) +{ + wmi_ric_request_fixed_param *cmd; + wmi_ric_tspec *tspec_param; + wmi_buf_t buf; + uint8_t *buf_ptr; + struct mac_tspec_ie *ptspecIE; + int32_t len = sizeof(wmi_ric_request_fixed_param) + + WMI_TLV_HDR_SIZE + sizeof(wmi_ric_tspec); + + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) { + WMA_LOGP("%s: wmi_buf_alloc failed", __func__); + return CDF_STATUS_E_NOMEM; + } + + buf_ptr = (uint8_t *) wmi_buf_data(buf); + + cmd = (wmi_ric_request_fixed_param *) buf_ptr; + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_ric_request_fixed_param, + WMITLV_GET_STRUCT_TLVLEN(wmi_ric_request_fixed_param)); + if (is_add_ts) + cmd->vdev_id = ((struct add_ts_param *) msg)->sessionId; + else + cmd->vdev_id = ((struct del_ts_params *) msg)->sessionId; + cmd->num_ric_request = 1; + cmd->is_add_ric = is_add_ts; + + buf_ptr += sizeof(wmi_ric_request_fixed_param); + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, sizeof(wmi_ric_tspec)); + + buf_ptr += WMI_TLV_HDR_SIZE; + tspec_param = (wmi_ric_tspec *) buf_ptr; + WMITLV_SET_HDR(&tspec_param->tlv_header, + WMITLV_TAG_STRUC_wmi_ric_tspec, + WMITLV_GET_STRUCT_TLVLEN(wmi_ric_tspec)); + + if (is_add_ts) + ptspecIE = &(((struct add_ts_param *) msg)->tspec); + else + ptspecIE = &(((struct del_ts_params *) msg)->delTsInfo.tspec); + + /* Fill the tsinfo in the format expected by firmware */ +#ifndef ANI_LITTLE_BIT_ENDIAN + cdf_mem_copy(((uint8_t *) &tspec_param->ts_info) + 1, + ((uint8_t *) &ptspecIE->tsinfo) + 1, 2); +#else + cdf_mem_copy(((uint8_t *) &tspec_param->ts_info), + ((uint8_t *) &ptspecIE->tsinfo) + 1, 2); +#endif /* ANI_LITTLE_BIT_ENDIAN */ + + tspec_param->nominal_msdu_size = ptspecIE->nomMsduSz; + tspec_param->maximum_msdu_size = ptspecIE->maxMsduSz; + tspec_param->min_service_interval = ptspecIE->minSvcInterval; + tspec_param->max_service_interval = ptspecIE->maxSvcInterval; + tspec_param->inactivity_interval = ptspecIE->inactInterval; + tspec_param->suspension_interval = ptspecIE->suspendInterval; + tspec_param->svc_start_time = ptspecIE->svcStartTime; + tspec_param->min_data_rate = ptspecIE->minDataRate; + tspec_param->mean_data_rate = ptspecIE->meanDataRate; + tspec_param->peak_data_rate = ptspecIE->peakDataRate; + tspec_param->max_burst_size = ptspecIE->maxBurstSz; + tspec_param->delay_bound = ptspecIE->delayBound; + tspec_param->min_phy_rate = ptspecIE->minPhyRate; + tspec_param->surplus_bw_allowance = ptspecIE->surplusBw; + tspec_param->medium_time = 0; + + WMA_LOGI("%s: Set RIC Req is_add_ts:%d", __func__, is_add_ts); + + if (wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_ROAM_SET_RIC_REQUEST_CMDID)) { + WMA_LOGP("%s: Failed to send vdev Set RIC Req command", + __func__); + if (is_add_ts) + ((struct add_ts_param *) msg)->status = + CDF_STATUS_E_FAILURE; + cdf_nbuf_free(buf); + return CDF_STATUS_E_FAILURE; + } + + return CDF_STATUS_SUCCESS; +} + +/** + * send_process_ll_stats_clear_cmd_tlv() - clear link layer stats + * @wmi_handle: wmi handle + * @clear_req: ll stats clear request command params + * + * Return: CDF_STATUS_SUCCESS for success or error code + */ +CDF_STATUS send_process_ll_stats_clear_cmd_tlv(wmi_unified_t wmi_handle, + const struct ll_stats_clear_params *clear_req, + uint8_t addr[IEEE80211_ADDR_LEN]) +{ + wmi_clear_link_stats_cmd_fixed_param *cmd; + int32_t len; + wmi_buf_t buf; + uint8_t *buf_ptr; + int ret; + + len = sizeof(*cmd); + buf = wmi_buf_alloc(wmi_handle, len); + + if (!buf) { + WMA_LOGE("%s: Failed allocate wmi buffer", __func__); + return CDF_STATUS_E_NOMEM; + } + + buf_ptr = (uint8_t *) wmi_buf_data(buf); + cdf_mem_zero(buf_ptr, len); + cmd = (wmi_clear_link_stats_cmd_fixed_param *) buf_ptr; + + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_clear_link_stats_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_clear_link_stats_cmd_fixed_param)); + + cmd->stop_stats_collection_req = clear_req->stop_req; + cmd->vdev_id = clear_req->sta_id; + cmd->stats_clear_req_mask = clear_req->stats_clear_mask; + + WMI_CHAR_ARRAY_TO_MAC_ADDR(addr, + &cmd->peer_macaddr); + + WMA_LOGD("LINK_LAYER_STATS - Clear Request Params"); + WMA_LOGD("StopReq : %d", cmd->stop_stats_collection_req); + WMA_LOGD("Vdev Id : %d", cmd->vdev_id); + WMA_LOGD("Clear Stat Mask : %d", cmd->stats_clear_req_mask); + /* WMA_LOGD("Peer MAC Addr : %pM", + cmd->peer_macaddr); */ + + ret = wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_CLEAR_LINK_STATS_CMDID); + if (ret) { + WMA_LOGE("%s: Failed to send clear link stats req", __func__); + wmi_buf_free(buf); + return CDF_STATUS_E_FAILURE; + } + + WMA_LOGD("Clear Link Layer Stats request sent successfully"); + return CDF_STATUS_SUCCESS; +} + +/** + * send_process_ll_stats_set_cmd_tlv() - link layer stats set request + * @wmi_handle: wmi handle + * @setReq: ll stats set request command params + * + * Return: CDF_STATUS_SUCCESS for success or error code + */ +CDF_STATUS send_process_ll_stats_set_cmd_tlv(wmi_unified_t wmi_handle, + const struct ll_stats_set_params *set_req) +{ + wmi_start_link_stats_cmd_fixed_param *cmd; + int32_t len; + wmi_buf_t buf; + uint8_t *buf_ptr; + int ret; + + len = sizeof(*cmd); + buf = wmi_buf_alloc(wmi_handle, len); + + if (!buf) { + WMA_LOGE("%s: Failed allocate wmi buffer", __func__); + return CDF_STATUS_E_NOMEM; + } + + buf_ptr = (uint8_t *) wmi_buf_data(buf); + cdf_mem_zero(buf_ptr, len); + cmd = (wmi_start_link_stats_cmd_fixed_param *) buf_ptr; + + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_start_link_stats_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_start_link_stats_cmd_fixed_param)); + + cmd->mpdu_size_threshold = set_req->mpdu_size_threshold; + cmd->aggressive_statistics_gathering = + set_req->aggressive_statistics_gathering; + + WMA_LOGD("LINK_LAYER_STATS - Start/Set Request Params"); + WMA_LOGD("MPDU Size Thresh : %d", cmd->mpdu_size_threshold); + WMA_LOGD("Aggressive Gather: %d", cmd->aggressive_statistics_gathering); + + ret = wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_START_LINK_STATS_CMDID); + if (ret) { + WMA_LOGE("%s: Failed to send set link stats request", __func__); + wmi_buf_free(buf); + return CDF_STATUS_E_FAILURE; + } + + return CDF_STATUS_SUCCESS; +} + +/** + * send_process_ll_stats_get_cmd_tlv() - link layer stats get request + * @wmi_handle:wmi handle + * @get_req:ll stats get request command params + * @addr: mac address + * + * Return: CDF_STATUS_SUCCESS for success or error code + */ +CDF_STATUS send_process_ll_stats_get_cmd_tlv(wmi_unified_t wmi_handle, + const struct ll_stats_get_params *get_req, + uint8_t addr[IEEE80211_ADDR_LEN]) +{ + wmi_request_link_stats_cmd_fixed_param *cmd; + int32_t len; + wmi_buf_t buf; + uint8_t *buf_ptr; + int ret; + + len = sizeof(*cmd); + buf = wmi_buf_alloc(wmi_handle, len); + + buf_ptr = (uint8_t *) wmi_buf_data(buf); + cdf_mem_zero(buf_ptr, len); + cmd = (wmi_request_link_stats_cmd_fixed_param *) buf_ptr; + + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_request_link_stats_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_request_link_stats_cmd_fixed_param)); + + cmd->request_id = get_req->req_id; + cmd->stats_type = get_req->param_id_mask; + cmd->vdev_id = get_req->sta_id; + + WMI_CHAR_ARRAY_TO_MAC_ADDR(addr, + &cmd->peer_macaddr); + + WMA_LOGD("LINK_LAYER_STATS - Get Request Params"); + WMA_LOGD("Request ID : %d", cmd->request_id); + WMA_LOGD("Stats Type : %d", cmd->stats_type); + WMA_LOGD("Vdev ID : %d", cmd->vdev_id); + WMA_LOGD("Peer MAC Addr : %pM", addr); + + ret = wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_REQUEST_LINK_STATS_CMDID); + if (ret) { + WMA_LOGE("%s: Failed to send get link stats request", __func__); + wmi_buf_free(buf); + return CDF_STATUS_E_FAILURE; + } + + return CDF_STATUS_SUCCESS; +} + +/** + * send_get_stats_cmd_tlv() - get stats request + * @wmi_handle: wmi handle + * @get_stats_param: stats params + * @addr: mac address + * + * Return: CDF status + */ +CDF_STATUS send_get_stats_cmd_tlv(wmi_unified_t wmi_handle, + struct pe_stats_req *get_stats_param, + uint8_t addr[IEEE80211_ADDR_LEN]) +{ + wmi_buf_t buf; + wmi_request_stats_cmd_fixed_param *cmd; + uint8_t len = sizeof(wmi_request_stats_cmd_fixed_param); + + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) { + WMA_LOGE("%s: Failed to allocate wmi buffer", __func__); + return CDF_STATUS_E_FAILURE; + } + + + cmd = (wmi_request_stats_cmd_fixed_param *) wmi_buf_data(buf); + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_request_stats_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_request_stats_cmd_fixed_param)); + cmd->stats_id = + WMI_REQUEST_PEER_STAT | WMI_REQUEST_PDEV_STAT | + WMI_REQUEST_VDEV_STAT; + cmd->vdev_id = get_stats_param->session_id; + WMI_CHAR_ARRAY_TO_MAC_ADDR(addr, &cmd->peer_macaddr); + WMA_LOGD("STATS REQ VDEV_ID:%d-->", cmd->vdev_id); + if (wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_REQUEST_STATS_CMDID)) { + + WMA_LOGE("%s: Failed to send WMI_REQUEST_STATS_CMDID", + __func__); + wmi_buf_free(buf); + return CDF_STATUS_E_FAILURE; + } + + return CDF_STATUS_SUCCESS; + +} + struct wmi_ops tlv_ops = { .send_vdev_create_cmd = send_vdev_create_cmd_tlv, .send_vdev_delete_cmd = send_vdev_delete_cmd_tlv, @@ -2864,7 +5015,8 @@ struct wmi_ops tlv_ops = { .send_mgmt_cmd = send_mgmt_cmd_tlv, .send_modem_power_state_cmd = send_modem_power_state_cmd_tlv, .send_set_sta_ps_mode_cmd = send_set_sta_ps_mode_cmd_tlv, - .send_set_sta_uapsd_auto_trig_cmd = send_set_sta_uapsd_auto_trig_cmd_tlv, + .send_set_sta_uapsd_auto_trig_cmd = + send_set_sta_uapsd_auto_trig_cmd_tlv, .send_get_temperature_cmd = send_get_temperature_cmd_tlv, .send_set_p2pgo_oppps_req_cmd = send_set_p2pgo_oppps_req_cmd_tlv, .send_set_p2pgo_noa_req_cmd = send_set_p2pgo_noa_req_cmd_tlv, @@ -2877,7 +5029,8 @@ struct wmi_ops tlv_ops = { .send_dcc_update_ndl_cmd = send_dcc_update_ndl_cmd_tlv, .send_ocb_set_config_cmd = send_ocb_set_config_cmd_tlv, .send_ocb_stop_timing_advert_cmd = send_ocb_stop_timing_advert_cmd_tlv, - .send_ocb_start_timing_advert_cmd = send_ocb_start_timing_advert_cmd_tlv, + .send_ocb_start_timing_advert_cmd = + send_ocb_start_timing_advert_cmd_tlv, .send_set_enable_disable_mcc_adaptive_scheduler_cmd = send_set_enable_disable_mcc_adaptive_scheduler_cmd_tlv, .send_set_mcc_channel_time_latency_cmd = @@ -2886,7 +5039,51 @@ struct wmi_ops tlv_ops = { send_set_mcc_channel_time_quota_cmd_tlv, .send_set_thermal_mgmt_cmd = send_set_thermal_mgmt_cmd_tlv, .send_lro_config_cmd = send_lro_config_cmd_tlv, - + .send_bcn_buf_ll_cmd = send_bcn_buf_ll_cmd_tlv, + .send_set_sta_sa_query_param_cmd = send_set_sta_sa_query_param_cmd_tlv, + .send_set_sta_keep_alive_cmd = send_set_sta_keep_alive_cmd_tlv, + .send_vdev_set_gtx_cfg_cmd = send_vdev_set_gtx_cfg_cmd_tlv, + .send_process_update_edca_param_cmd = + send_process_update_edca_param_cmd_tlv, + .send_probe_rsp_tmpl_send_cmd = + send_probe_rsp_tmpl_send_cmd_tlv, + .send_p2p_go_set_beacon_ie_cmd = + send_p2p_go_set_beacon_ie_cmd_tlv, + .send_set_gateway_params_cmd = + send_set_gateway_params_cmd_tlv, + .send_set_rssi_monitoring_cmd = + send_set_rssi_monitoring_cmd_tlv, + .send_scan_probe_setoui_cmd = + send_scan_probe_setoui_cmd_tlv, + .send_reset_passpoint_network_list_cmd = + send_reset_passpoint_network_list_cmd_tlv, + .send_set_passpoint_network_list_cmd = + send_set_passpoint_network_list_cmd_tlv, + .send_set_epno_network_list_cmd = + send_set_epno_network_list_cmd_tlv, + .send_ipa_offload_control_cmd = + send_ipa_offload_control_cmd_tlv, + .send_extscan_get_capabilities_cmd = + send_extscan_get_capabilities_cmd_tlv, + .send_extscan_get_cached_results_cmd = + send_extscan_get_cached_results_cmd_tlv, + .send_extscan_stop_change_monitor_cmd = + send_extscan_stop_change_monitor_cmd_tlv, + .send_extscan_start_change_monitor_cmd = + send_extscan_start_change_monitor_cmd_tlv, + .send_extscan_stop_hotlist_monitor_cmd = + send_extscan_stop_hotlist_monitor_cmd_tlv, + .send_stop_extscan_cmd = send_stop_extscan_cmd_tlv, + .send_start_extscan_cmd = send_start_extscan_cmd_tlv, + .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, + .send_pno_start_cmd = send_pno_start_cmd_tlv, + .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, + .send_process_ll_stats_get_cmd = send_process_ll_stats_get_cmd_tlv, + .send_get_stats_cmd = send_get_stats_cmd_tlv, /* TODO - Add other tlv apis here */ };