qcacmn: Featurize WMI APIs and TLVs that are specific to MCL

In the existing converged component, WMI TLV APIs are implemented in
a generic manner without proper featurization. All the APIs exposed
outside of WMI are implemented in wmi_unified_api.c and all the APIs
forming the CMD or extracting the EVT is implemented in wmi_unified_tlv.c.
Since WIN and MCL have a unified WMI layer in the converged component and
there are features within WIN and MCL that are not common, there exists a
good number of WMI APIs which are specific to WIN but compiled by MCL and
vice-versa. Due to this inadvertent problem, there is a chunk of code and
memory used up by WIN and MCL for features that are not used in their
products.
Featurize WMI APIs and TLVs that are specific to MCL -
- DSRC
- NAN
- P2P
- PMO
- roaming
- concurrency
- STA
- Generic MCL specific WMI (STA)

Change-Id: I03a68b0db30a3aa585b269ab0a1745b37bc7e0b7
CRs-Fixed: 2316935
This commit is contained in:
Qiwei Cai
2018-09-17 19:17:13 +08:00
committed by nshrivas
parent a566dce41a
commit 770c90f8ca
29 changed files with 13591 additions and 12846 deletions

View File

@@ -27,6 +27,28 @@
#define P2P_MAX_NOA_DESC 4
/**
* struct p2p_ps_params - P2P powersave related params
* @opp_ps: opportunistic power save
* @ctwindow: CT window
* @count: count
* @duration: duration
* @interval: interval
* @single_noa_duration: single shot noa duration
* @ps_selection: power save selection
* @session_id: session id
*/
struct p2p_ps_params {
uint8_t opp_ps;
uint32_t ctwindow;
uint8_t count;
uint32_t duration;
uint32_t interval;
uint32_t single_noa_duration;
uint8_t ps_selection;
uint8_t session_id;
};
/**
* struct p2p_roc_req - P2P roc request
* @vdev_id: Vdev id on which this request has come

View File

@@ -36,9 +36,6 @@
#ifdef WLAN_POWER_MANAGEMENT_OFFLOAD
#include "wmi_unified_pmo_api.h"
#endif
#ifdef CONVERGED_P2P_ENABLE
#include "wlan_p2p_public_struct.h"
#endif
#include "wlan_scan_public_structs.h"
#ifdef WLAN_FEATURE_DISA
#include "wlan_disa_public_struct.h"
@@ -46,9 +43,6 @@
#ifdef WLAN_FEATURE_ACTION_OUI
#include "wlan_action_oui_public_struct.h"
#endif
#ifdef WLAN_FEATURE_NAN_CONVERGENCE
#include "nan_public_structs.h"
#endif
#ifdef WLAN_SUPPORT_GREEN_AP
#include "wlan_green_ap_api.h"
#endif
@@ -84,6 +78,30 @@
#include "wmi_unified_ap_api.h"
#endif
#ifdef WLAN_FEATURE_DSRC
#include "wmi_unified_ocb_api.h"
#endif
#ifdef WLAN_FEATURE_NAN_CONVERGENCE
#include "wmi_unified_nan_api.h"
#endif
#ifdef CONVERGED_P2P_ENABLE
#include <wmi_unified_p2p_api.h>
#endif
#ifdef WMI_ROAM_SUPPORT
#include "wmi_unified_roam_api.h"
#endif
#ifdef WMI_CONCURRENCY_SUPPORT
#include "wmi_unified_concurrency_api.h"
#endif
#ifdef WMI_STA_SUPPORT
#include "wmi_unified_sta_api.h"
#endif
typedef qdf_nbuf_t wmi_buf_t;
#define wmi_buf_data(_buf) qdf_nbuf_data(_buf)
@@ -496,13 +514,6 @@ QDF_STATUS wmi_unified_stats_request_send(void *wmi_hdl,
QDF_STATUS wmi_unified_green_ap_ps_send(void *wmi_hdl,
uint32_t value, uint8_t pdev_id);
#ifdef FEATURE_WLAN_D0WOW
QDF_STATUS wmi_unified_d0wow_enable_send(void *wmi_hdl,
uint8_t mac_id);
QDF_STATUS wmi_unified_d0wow_disable_send(void *wmi_hdl,
uint8_t mac_id);
#endif
QDF_STATUS wmi_unified_wow_enable_send(void *wmi_hdl,
struct wow_cmd_params *param,
uint8_t mac_id);
@@ -601,161 +612,11 @@ wmi_unified_set_sta_uapsd_auto_trig_cmd(void *wmi_hdl,
QDF_STATUS wmi_unified_get_temperature(void *wmi_hdl);
QDF_STATUS wmi_unified_set_p2pgo_oppps_req(void *wmi_hdl,
struct p2p_ps_params *oppps);
QDF_STATUS wmi_unified_set_p2pgo_noa_req_cmd(void *wmi_hdl,
struct p2p_ps_params *noa);
#ifdef CONVERGED_P2P_ENABLE
#ifdef FEATURE_P2P_LISTEN_OFFLOAD
QDF_STATUS wmi_unified_p2p_lo_start_cmd(void *wmi_hdl,
struct p2p_lo_start *param);
QDF_STATUS wmi_unified_p2p_lo_stop_cmd(void *wmi_hdl, uint8_t vdev_id);
#endif
#endif
QDF_STATUS wmi_unified_set_smps_params(void *wmi_hdl, uint8_t vdev_id,
int value);
QDF_STATUS wmi_unified_set_mimops(void *wmi_hdl, uint8_t vdev_id, int value);
#ifdef WLAN_FEATURE_DSRC
/**
* wmi_unified_ocb_start_timing_advert() - start sending the timing
* advertisement frames on a channel
* @wmi_handle: pointer to the wmi handle
* @timing_advert: pointer to the timing advertisement struct
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_ocb_start_timing_advert(struct wmi_unified *wmi_handle,
struct ocb_timing_advert_param *timing_advert);
/**
* wmi_unified_ocb_stop_timing_advert() - stop sending the timing
* advertisement frames on a channel
* @wmi_handle: pointer to the wmi handle
* @timing_advert: pointer to the timing advertisement struct
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_ocb_stop_timing_advert(struct wmi_unified *wmi_handle,
struct ocb_timing_advert_param *timing_advert);
/**
* wmi_unified_ocb_set_config() - send the OCB config to the FW
* @wmi_handle: pointer to the wmi handle
* @config: the OCB configuration
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures
*/
QDF_STATUS wmi_unified_ocb_set_config(struct wmi_unified *wmi_handle,
struct ocb_config *config);
/**
* wmi_unified_ocb_get_tsf_timer() - get ocb tsf timer val
* @wmi_handle: pointer to the wmi handle
* @req: request for tsf timer
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_ocb_get_tsf_timer(struct wmi_unified *wmi_handle,
struct ocb_get_tsf_timer_param *req);
/**
* wmi_unified_ocb_set_utc_time_cmd() - get ocb tsf timer val
* @wmi_handle: pointer to the wmi handle
* @vdev_id: vdev id
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_ocb_set_utc_time_cmd(struct wmi_unified *wmi_handle,
struct ocb_utc_param *utc);
/**
* wmi_unified_dcc_get_stats_cmd() - get the DCC channel stats
* @wmi_handle: pointer to the wmi handle
* @get_stats_param: pointer to the dcc stats
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_dcc_get_stats_cmd(struct wmi_unified *wmi_handle,
struct ocb_dcc_get_stats_param *get_stats_param);
/**
* wmi_unified_dcc_clear_stats() - command to clear the DCC stats
* @wmi_handle: pointer to the wmi handle
* @clear_stats_param: parameters to the command
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_dcc_clear_stats(struct wmi_unified *wmi_handle,
struct ocb_dcc_clear_stats_param *clear_stats_param);
/**
* wmi_unified_dcc_update_ndl() - command to update the NDL data
* @wmi_handle: pointer to the wmi handle
* @update_ndl_param: pointer to the request parameters
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures
*/
QDF_STATUS wmi_unified_dcc_update_ndl(struct wmi_unified *wmi_handle,
struct ocb_dcc_update_ndl_param *update_ndl_param);
/**
* wmi_extract_ocb_set_channel_config_resp() - extract status from wmi event
* @wmi_handle: wmi handle
* @evt_buf: pointer to event buffer
* @status: status buffer
*
* Return: QDF_STATUS_SUCCESS on success
*/
QDF_STATUS
wmi_extract_ocb_set_channel_config_resp(struct wmi_unified *wmi_handle,
void *evt_buf,
uint32_t *status);
/**
* wmi_extract_ocb_tsf_timer() - extract tsf timer from wmi event
* @wmi_handle: wmi handle
* @evt_buf: pointer to event buffer
* @resp: tsf timer
*
* Return: QDF_STATUS_SUCCESS on success
*/
QDF_STATUS wmi_extract_ocb_tsf_timer(struct wmi_unified *wmi_handle,
void *evt_buf,
struct ocb_get_tsf_timer_response *resp);
/**
* wmi_extract_dcc_update_ndl_resp() - extract NDL update from wmi event
* @wmi_handle: wmi handle
* @evt_buf: pointer to event buffer
* @resp: ndl update status
*
* Return: QDF_STATUS_SUCCESS on success
*/
QDF_STATUS wmi_extract_dcc_update_ndl_resp(struct wmi_unified *wmi_handle,
void *evt_buf, struct ocb_dcc_update_ndl_response *resp);
/**
* wmi_extract_dcc_stats() - extract DCC stats from wmi event
* @wmi_handle: wmi handle
* @evt_buf: pointer to event buffer
* @resp: DCC stats
*
* Since length of the response is variable, response buffer will be allocated.
* The caller must free the response buffer.
*
* Return: QDF_STATUS_SUCCESS on success
*/
QDF_STATUS wmi_extract_dcc_stats(struct wmi_unified *wmi_handle,
void *evt_buf,
struct ocb_dcc_get_stats_response **response);
#endif
QDF_STATUS wmi_unified_lro_config_cmd(void *wmi_hdl,
struct wmi_lro_config_cmd_t *wmi_lro_cmd);
@@ -765,35 +626,11 @@ QDF_STATUS wmi_unified_set_thermal_mgmt_cmd(void *wmi_hdl,
QDF_STATUS wmi_unified_peer_rate_report_cmd(void *wmi_hdl,
struct wmi_peer_rate_report_params *rate_report_params);
QDF_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);
QDF_STATUS wmi_unified_set_mcc_channel_time_latency_cmd
(void *wmi_hdl,
uint32_t mcc_channel_freq, uint32_t mcc_channel_time_latency);
QDF_STATUS wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd(
void *wmi_hdl, uint32_t mcc_adaptive_scheduler,
uint32_t pdev_id);
#ifdef CONFIG_MCL
QDF_STATUS wmi_unified_bcn_buf_ll_cmd(void *wmi_hdl,
wmi_bcn_send_from_host_cmd_fixed_param *param);
#endif
QDF_STATUS wmi_unified_set_sta_sa_query_param_cmd(void *wmi_hdl,
uint8_t vdev_id, uint32_t max_retries,
uint32_t retry_interval);
QDF_STATUS wmi_unified_set_sta_keep_alive_cmd(void *wmi_hdl,
struct sta_params *params);
QDF_STATUS wmi_unified_vdev_set_gtx_cfg_cmd(void *wmi_hdl, uint32_t if_id,
struct wmi_gtx_config *gtx_info);
QDF_STATUS wmi_unified_process_update_edca_param(void *wmi_hdl,
uint8_t vdev_id, bool mu_edca_param,
struct wmi_host_wme_vparams wmm_vparams[WMI_MAX_NUM_AC]);
@@ -805,81 +642,17 @@ QDF_STATUS wmi_unified_probe_rsp_tmpl_send_cmd(void *wmi_hdl,
QDF_STATUS wmi_unified_setup_install_key_cmd(void *wmi_hdl,
struct set_key_params *key_params);
#ifdef WLAN_FEATURE_DISA
/**
* wmi_unified_encrypt_decrypt_send_cmd() - send encryptdecrypt cmd to fw
* @wmi_hdl: wmi handle
* @params: encrypt/decrypt params
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_encrypt_decrypt_send_cmd(void *wmi_hdl,
struct disa_encrypt_decrypt_req_params *params);
/**
* wmi_extract_encrypt_decrypt_resp_params() -
* extract encrypt decrypt resp params from event buffer
* @wmi_handle: wmi handle
* @evt_buf: pointer to event buffer
* @resp: encrypt decrypt resp params
*
* Return: QDF_STATUS_SUCCESS for success or error code
*/
QDF_STATUS wmi_extract_encrypt_decrypt_resp_params(void *wmi_hdl,
uint8_t *evt_buf,
struct disa_encrypt_decrypt_resp_params *resp);
#endif
QDF_STATUS wmi_unified_p2p_go_set_beacon_ie_cmd(void *wmi_hdl,
uint32_t vdev_id, uint8_t *p2p_ie);
QDF_STATUS wmi_unified_set_gateway_params_cmd(void *wmi_hdl,
struct gateway_update_req_param *req);
QDF_STATUS wmi_unified_set_rssi_monitoring_cmd(void *wmi_hdl,
struct rssi_monitor_param *req);
QDF_STATUS wmi_unified_scan_probe_setoui_cmd(void *wmi_hdl,
struct scan_mac_oui *psetoui);
#ifdef CONFIG_MCL
QDF_STATUS wmi_unified_roam_scan_offload_mode_cmd(void *wmi_hdl,
wmi_start_scan_cmd_fixed_param *scan_cmd_fp,
struct roam_offload_scan_params *roam_req);
#endif
/**
* wmi_unified_roam_mawc_params_cmd() - configure roaming MAWC parameters
* @wmi_hdl: wmi handle
* @params: Parameters to be configured
*
* Pass the MAWC(Motion Aided wireless connectivity) related roaming
* parameters from the host to the target
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_roam_mawc_params_cmd(void *wmi_hdl,
struct wmi_mawc_roam_params *params);
QDF_STATUS wmi_unified_roam_scan_offload_rssi_thresh_cmd(void *wmi_hdl,
struct roam_offload_scan_rssi_params *roam_req);
QDF_STATUS wmi_unified_roam_scan_filter_cmd(void *wmi_hdl,
struct roam_scan_filter_params *roam_req);
#ifdef IPA_OFFLOAD
QDF_STATUS wmi_unified_ipa_offload_control_cmd(void *wmi_hdl,
struct ipa_uc_offload_control_params *ipa_offload);
#endif
QDF_STATUS wmi_unified_plm_stop_cmd(void *wmi_hdl,
const struct plm_req_params *plm);
QDF_STATUS wmi_unified_plm_start_cmd(void *wmi_hdl,
const struct plm_req_params *plm,
uint32_t *gchannel_list);
QDF_STATUS wmi_unified_pno_stop_cmd(void *wmi_hdl, uint8_t vdev_id);
#ifdef FEATURE_WLAN_SCAN_PNO
@@ -890,14 +663,6 @@ QDF_STATUS wmi_unified_pno_start_cmd(void *wmi_hdl,
QDF_STATUS wmi_unified_nlo_mawc_cmd(void *wmi_hdl,
struct nlo_mawc_params *params);
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
QDF_STATUS wmi_unified_set_ric_req_cmd(void *wmi_hdl, void *msg,
uint8_t is_add_ts);
QDF_STATUS wmi_unified_roam_synch_complete_cmd(void *wmi_hdl,
uint8_t vdev_id);
#endif
QDF_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]);
@@ -926,37 +691,11 @@ QDF_STATUS wmi_unified_snr_cmd(void *wmi_hdl, uint8_t vdev_id);
QDF_STATUS wmi_unified_link_status_req_cmd(void *wmi_hdl,
struct link_status_params *link_status);
#ifdef CONFIG_MCL
QDF_STATUS wmi_unified_process_dhcp_ind(void *wmi_hdl,
wmi_peer_set_param_cmd_fixed_param *ta_dhcp_ind);
QDF_STATUS wmi_unified_get_link_speed_cmd(void *wmi_hdl,
wmi_mac_addr peer_macaddr);
#endif
#ifdef WLAN_SUPPORT_GREEN_AP
QDF_STATUS wmi_unified_egap_conf_params_cmd(void *wmi_hdl,
struct wlan_green_ap_egap_params *egap_params);
#endif
QDF_STATUS wmi_unified_fw_profiling_data_cmd(void *wmi_hdl,
uint32_t cmd, uint32_t value1, uint32_t value2);
QDF_STATUS wmi_unified_wow_timer_pattern_cmd(void *wmi_hdl, uint8_t vdev_id,
uint32_t cookie, uint32_t time);
QDF_STATUS wmi_unified_nat_keepalive_en_cmd(void *wmi_hdl, uint8_t vdev_id);
/**
* wmi_unified_set_latency_config_cmd()
* @wmi_handle: wmi handle
* @param: WLM parameters
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_wlm_latency_level_cmd(void *wmi_hdl,
struct wlm_latency_level_param *param);
QDF_STATUS wmi_unified_csa_offload_enable(void *wmi_hdl, uint8_t vdev_id);
#ifdef WLAN_FEATURE_CIF_CFR
@@ -986,75 +725,23 @@ QDF_STATUS wmi_unified_pktlog_wmi_send_cmd(void *wmi_hdl,
uint8_t user_triggered);
#endif
QDF_STATUS wmi_unified_wow_delete_pattern_cmd(void *wmi_hdl, uint8_t ptrn_id,
uint8_t vdev_id);
QDF_STATUS wmi_unified_host_wakeup_ind_to_fw_cmd(void *wmi_hdl);
QDF_STATUS wmi_unified_del_ts_cmd(void *wmi_hdl, uint8_t vdev_id,
uint8_t ac);
QDF_STATUS wmi_unified_aggr_qos_cmd(void *wmi_hdl,
struct aggr_add_ts_param *aggr_qos_rsp_msg);
QDF_STATUS wmi_unified_add_ts_cmd(void *wmi_hdl,
struct add_ts_param *msg);
QDF_STATUS wmi_unified_process_add_periodic_tx_ptrn_cmd(void *wmi_hdl,
struct periodic_tx_pattern *
pAddPeriodicTxPtrnParams,
uint8_t vdev_id);
QDF_STATUS wmi_unified_process_del_periodic_tx_ptrn_cmd(void *wmi_hdl,
uint8_t vdev_id,
uint8_t pattern_id);
QDF_STATUS wmi_unified_stats_ext_req_cmd(void *wmi_hdl,
struct stats_ext_params *preq);
QDF_STATUS wmi_unified_enable_ext_wow_cmd(void *wmi_hdl,
struct ext_wow_params *params);
QDF_STATUS wmi_unified_set_app_type2_params_in_fw_cmd(void *wmi_hdl,
struct app_type2_params *appType2Params);
QDF_STATUS wmi_unified_set_auto_shutdown_timer_cmd(void *wmi_hdl,
uint32_t timer_val);
QDF_STATUS wmi_unified_nan_req_cmd(void *wmi_hdl,
struct nan_req_params *nan_req);
QDF_STATUS wmi_unified_process_dhcpserver_offload_cmd(void *wmi_hdl,
struct dhcp_offload_info_params *params);
QDF_STATUS wmi_unified_process_ch_avoid_update_cmd(void *wmi_hdl);
QDF_STATUS wmi_unified_send_regdomain_info_to_fw_cmd(void *wmi_hdl,
uint32_t reg_dmn, uint16_t regdmn2G,
uint16_t regdmn5G, uint8_t ctl2G,
uint8_t ctl5G);
QDF_STATUS wmi_unified_set_tdls_offchan_mode_cmd(void *wmi_hdl,
struct tdls_channel_switch_params *chan_switch_params);
QDF_STATUS wmi_unified_update_fw_tdls_state_cmd(void *wmi_hdl,
void *tdls_param, uint8_t tdls_state);
QDF_STATUS wmi_unified_update_tdls_peer_state_cmd(void *wmi_hdl,
struct tdls_peer_state_params *peerStateParams,
uint32_t *ch_mhz);
QDF_STATUS wmi_unified_process_fw_mem_dump_cmd(void *wmi_hdl,
struct fw_dump_req_param *mem_dump_req);
QDF_STATUS wmi_unified_process_set_ie_info_cmd(void *wmi_hdl,
struct vdev_ie_info_param *ie_info);
QDF_STATUS wmi_unified_save_fw_version_cmd(void *wmi_hdl,
void *evt_buf);
QDF_STATUS wmi_unified_set_base_macaddr_indicate_cmd(void *wmi_hdl,
uint8_t *custom_addr);
QDF_STATUS wmi_unified_log_supported_evt_cmd(void *wmi_hdl,
uint8_t *event,
uint32_t len);
@@ -1064,65 +751,12 @@ QDF_STATUS wmi_unified_enable_specific_fw_logs_cmd(void *wmi_hdl,
QDF_STATUS wmi_unified_flush_logs_to_fw_cmd(void *wmi_hdl);
QDF_STATUS wmi_unified_pdev_set_pcl_cmd(void *wmi_hdl,
struct wmi_pcl_chan_weights *msg);
QDF_STATUS wmi_unified_soc_set_hw_mode_cmd(void *wmi_hdl,
uint32_t hw_mode_index);
QDF_STATUS wmi_unified_pdev_set_dual_mac_config_cmd(void *wmi_hdl,
struct policy_mgr_dual_mac_config *msg);
QDF_STATUS wmi_unified_set_led_flashing_cmd(void *wmi_hdl,
struct flashing_req_params *flashing);
QDF_STATUS wmi_unified_app_type1_params_in_fw_cmd(void *wmi_hdl,
struct app_type1_params *app_type1_params);
QDF_STATUS wmi_unified_set_ssid_hotlist_cmd(void *wmi_hdl,
struct ssid_hotlist_request_params *request);
QDF_STATUS wmi_unified_unit_test_cmd(void *wmi_hdl,
struct wmi_unit_test_cmd *wmi_utest);
QDF_STATUS wmi_unified_roam_invoke_cmd(void *wmi_hdl,
struct wmi_roam_invoke_cmd *roaminvoke,
uint32_t ch_hz);
QDF_STATUS wmi_unified_roam_scan_offload_cmd(void *wmi_hdl,
uint32_t command, uint32_t vdev_id);
#ifdef CONFIG_MCL
QDF_STATUS wmi_unified_send_roam_scan_offload_ap_cmd(void *wmi_hdl,
struct ap_profile_params *ap_profile);
#endif
QDF_STATUS wmi_unified_roam_scan_offload_scan_period(void *wmi_hdl,
uint32_t scan_period,
uint32_t scan_age,
uint32_t vdev_id);
QDF_STATUS wmi_unified_roam_scan_offload_chan_list_cmd(void *wmi_hdl,
uint8_t chan_count,
uint32_t *chan_list,
uint8_t list_type, uint32_t vdev_id);
QDF_STATUS wmi_unified_roam_scan_offload_rssi_change_cmd(void *wmi_hdl,
uint32_t vdev_id,
int32_t rssi_change_thresh,
uint32_t bcn_rssi_weight,
uint32_t hirssi_delay_btw_scans);
/**
* wmi_unified_set_per_roam_config() - set PER roam config in FW
* @wmi_hdl: wmi handle
* @req_buf: per roam config request buffer
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_set_per_roam_config(void *wmi_hdl,
struct wmi_per_roam_config_req *req_buf);
#ifdef FEATURE_WLAN_APF
/**
* wmi_unified_set_active_apf_mode_cmd() - config active APF mode in FW
@@ -1449,19 +1083,6 @@ QDF_STATUS wmi_extract_vdev_roam_param(void *wmi_hdl, void *evt_buf,
QDF_STATUS wmi_extract_vdev_scan_ev_param(void *wmi_hdl, void *evt_buf,
struct scan_event *param);
#ifdef CONVERGED_TDLS_ENABLE
/**
* wmi_extract_vdev_tdls_ev_param - extract vdev tdls param from event
* @wmi_handle: wmi handle
* @param evt_buf: pointer to event buffer
* @param param: Pointer to hold vdev tdls param
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_extract_vdev_tdls_ev_param(void *wmi_hdl, void *evt_buf,
struct tdls_event_info *param);
#endif
QDF_STATUS wmi_extract_mu_ev_param(void *wmi_hdl, void *evt_buf,
wmi_host_mu_report_event *param);
@@ -1488,14 +1109,6 @@ QDF_STATUS wmi_extract_pdev_generic_buffer_ev_param(void *wmi_hdl,
void *evt_buf,
wmi_host_pdev_generic_buffer_event *param);
#ifdef CONVERGED_P2P_ENABLE
QDF_STATUS wmi_extract_p2p_lo_stop_ev_param(void *wmi_hdl,
void *evt_buf, struct p2p_lo_event *param);
QDF_STATUS wmi_extract_p2p_noa_ev_param(void *wmi_hdl,
void *evt_buf, struct p2p_noa_info *param);
#endif
QDF_STATUS wmi_extract_peer_ratecode_list_ev(void *wmi_hdl, void *evt_buf,
uint8_t *peer_mac, wmi_sa_rate_cap *rate_cap);
@@ -1591,48 +1204,6 @@ QDF_STATUS wmi_extract_vdev_nac_rssi_stats(void *wmi_hdl, void *evt_buf,
QDF_STATUS wmi_unified_send_power_dbg_cmd(void *wmi_hdl,
struct wmi_power_dbg_params *param);
/**
* wmi_unified_send_sar_limit_cmd() - send sar limit cmd to fw
* @wmi_hdl: wmi handle
* @params: sar limit command params
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_send_sar_limit_cmd(void *wmi_hdl,
struct sar_limit_cmd_params *params);
/**
* wmi_unified_get_sar_limit_cmd() - request current SAR limits from FW
* @wmi_hdl: wmi handle
*
* Return: QDF_STATUS_SUCCESS for success or error code
*/
QDF_STATUS wmi_unified_get_sar_limit_cmd(void *wmi_hdl);
/**
* wmi_unified_extract_sar_limit_event() - extract SAR limits from FW event
* @wmi_hdl: wmi handle
* @evt_buf: event buffer received from firmware
* @event: SAR limit event which is to be populated by data extracted from
* the @evt_buf buffer
*
* Return: QDF_STATUS_SUCCESS for success or error code
*/
QDF_STATUS wmi_unified_extract_sar_limit_event(void *wmi_hdl,
uint8_t *evt_buf,
struct sar_limit_event *event);
/**
* wmi_unified_extract_sar2_result_event() - extract SAR limits from FW event
* @handle: wmi handle
* @event: event buffer received from firmware
* @len: length of the event buffer
*
* Return: QDF_STATUS_SUCCESS for success or error code
*/
QDF_STATUS wmi_unified_extract_sar2_result_event(void *handle,
uint8_t *event, uint32_t len);
/**
* wmi_extract_sar_cap_service_ready_ext() - extract SAR cap from
* FW service ready event
@@ -1647,9 +1218,6 @@ QDF_STATUS wmi_extract_sar_cap_service_ready_ext(
uint8_t *evt_buf,
struct wlan_psoc_host_service_ext_param *ext_param);
QDF_STATUS wmi_unified_send_adapt_dwelltime_params_cmd(void *wmi_hdl,
struct wmi_adaptive_dwelltime_params *
wmi_param);
QDF_STATUS wmi_unified_fw_test_cmd(void *wmi_hdl,
struct set_fwtest_params *wmi_fwtest);
@@ -1737,28 +1305,6 @@ wmi_unified_send_action_oui_cmd(void *wmi_hdl,
struct action_oui_request *req);
#endif /* WLAN_FEATURE_ACTION_OUI */
/*
* wmi_unified_set_del_pmkid_cache() - set delete PMKID
* @wmi_hdl: wma handle
* @pmksa: pointer to pmk cache entry
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_set_del_pmkid_cache(void *wmi_hdl,
struct wmi_unified_pmk_cache *pmksa);
#if defined(WLAN_FEATURE_FILS_SK)
/*
* wmi_unified_roam_send_hlp_cmd() -send HLP command info
* @wmi_hdl: wma handle
* @req_buf: Pointer to HLP params
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_roam_send_hlp_cmd(void *wmi_hdl,
struct hlp_params *req_buf);
#endif
/**
* wmi_unified_send_request_get_rcpi_cmd() - command to request rcpi value
* @wmi_hdl: wma handle
@@ -1805,16 +1351,6 @@ void wmi_print_mgmt_event_log(wmi_unified_t wmi, uint32_t count,
#endif /* WMI_INTERFACE_EVENT_LOGGING */
QDF_STATUS wmi_unified_send_dbs_scan_sel_params_cmd(void *wmi_hdl,
struct wmi_dbs_scan_sel_params *wmi_param);
QDF_STATUS wmi_unified_send_limit_off_chan_cmd(void *wmi_hdl,
struct wmi_limit_off_chan_param *wmi_param);
QDF_STATUS wmi_unified_set_arp_stats_req(void *wmi_hdl,
struct set_arp_stats *req_buf);
QDF_STATUS wmi_unified_get_arp_stats_req(void *wmi_hdl,
struct get_arp_stats *req_buf);
/**
* wmi_unified_send_wds_entry_list_cmd() - WMI function to get list of
* wds entries from FW
@@ -1841,125 +1377,6 @@ QDF_STATUS wmi_unified_send_dump_wds_table_cmd(void *wmi_hdl);
QDF_STATUS wmi_extract_wds_entry(void *wmi_hdl, uint8_t *evt_buf,
struct wdsentry *wds_entry, u_int32_t idx);
#ifdef WLAN_FEATURE_NAN_CONVERGENCE
/**
* wmi_unified_ndp_initiator_req_cmd_send - api to send initiator request to FW
* @wmi_hdl: wmi handle
* @req: pointer to request buffer
*
* Return: status of operation
*/
QDF_STATUS wmi_unified_ndp_initiator_req_cmd_send(void *wmi_hdl,
struct nan_datapath_initiator_req *req);
/**
* wmi_unified_ndp_responder_req_cmd_send - api to send responder request to FW
* @wmi_hdl: wmi handle
* @req: pointer to request buffer
*
* Return: status of operation
*/
QDF_STATUS wmi_unified_ndp_responder_req_cmd_send(void *wmi_hdl,
struct nan_datapath_responder_req *req);
/**
* wmi_unified_ndp_end_req_cmd_send - api to send end request to FW
* @wmi_hdl: wmi handle
* @req: pointer to request buffer
*
* Return: status of operation
*/
QDF_STATUS wmi_unified_ndp_end_req_cmd_send(void *wmi_hdl,
struct nan_datapath_end_req *req);
/**
* wmi_extract_ndp_initiator_rsp - api to extract initiator rsp from even buffer
* @wmi_hdl: wmi handle
* @data: event buffer
* @rsp: buffer to populate
*
* Return: status of operation
*/
QDF_STATUS wmi_extract_ndp_initiator_rsp(wmi_unified_t wmi_handle,
uint8_t *data, struct nan_datapath_initiator_rsp *rsp);
/**
* wmi_extract_ndp_ind - api to extract ndp indication struct from even buffer
* @wmi_hdl: wmi handle
* @data: event buffer
* @ind: buffer to populate
*
* Return: status of operation
*/
QDF_STATUS wmi_extract_ndp_ind(wmi_unified_t wmi_handle, uint8_t *data,
struct nan_datapath_indication_event *ind);
/**
* wmi_extract_ndp_confirm - api to extract ndp confim struct from even buffer
* @wmi_hdl: wmi handle
* @data: event buffer
* @ev: buffer to populate
*
* Return: status of operation
*/
QDF_STATUS wmi_extract_ndp_confirm(wmi_unified_t wmi_handle, uint8_t *data,
struct nan_datapath_confirm_event *ev);
/**
* wmi_extract_ndp_responder_rsp - api to extract responder rsp from even buffer
* @wmi_hdl: wmi handle
* @data: event buffer
* @rsp: buffer to populate
*
* Return: status of operation
*/
QDF_STATUS wmi_extract_ndp_responder_rsp(wmi_unified_t wmi_handle,
uint8_t *data, struct nan_datapath_responder_rsp *rsp);
/**
* wmi_extract_ndp_end_rsp - api to extract ndp end rsp from even buffer
* @wmi_hdl: wmi handle
* @data: event buffer
* @rsp: buffer to populate
*
* Return: status of operation
*/
QDF_STATUS wmi_extract_ndp_end_rsp(wmi_unified_t wmi_handle, uint8_t *data,
struct nan_datapath_end_rsp_event *rsp);
/**
* wmi_extract_ndp_end_ind - api to extract ndp end indication from even buffer
* @wmi_hdl: wmi handle
* @data: event buffer
* @ind: buffer to populate
*
* Return: status of operation
*/
QDF_STATUS wmi_extract_ndp_end_ind(wmi_unified_t wmi_handle, uint8_t *data,
struct nan_datapath_end_indication_event **ind);
/**
* wmi_extract_ndp_sch_update - api to extract ndp sch update from event buffer
* @wmi_hdl: wmi handle
* @data: event buffer
* @ind: buffer to populate
*
* Return: status of operation
*/
QDF_STATUS wmi_extract_ndp_sch_update(wmi_unified_t wmi_handle, uint8_t *data,
struct nan_datapath_sch_update_event *ind);
#endif
/**
* wmi_unified_send_btm_config() - Send BTM config to fw
* @wmi_hdl: wmi handle
* @params: pointer to wmi_btm_config
*
* Return: QDF_STATUS
*/
QDF_STATUS wmi_unified_send_btm_config(void *wmi_hdl,
struct wmi_btm_config *params);
/**
* wmi_unified_send_obss_detection_cfg_cmd() - WMI function to send obss
* detection configuration to FW.
@@ -1990,51 +1407,6 @@ QDF_STATUS wmi_unified_extract_obss_detection_info(void *wmi_hdl,
uint8_t *data,
struct wmi_obss_detect_info
*info);
/**
* wmi_unified_send_bss_color_change_enable_cmd() - WMI function to send bss
* color change enable to FW.
* @wmi_hdl: wmi handle
* @vdev_id: vdev ID
* @enable: enable or disable color change handeling within firmware
*
* Send WMI_BSS_COLOR_CHANGE_ENABLE_CMDID parameters to fw,
* thereby firmware updates bss color when AP announces bss color change.
*
* Return: QDF_STATUS
*/
QDF_STATUS wmi_unified_send_bss_color_change_enable_cmd(void *wmi_hdl,
uint32_t vdev_id,
bool enable);
/**
* wmi_unified_send_obss_color_collision_cfg_cmd() - WMI function to send bss
* color collision detection configuration to FW.
* @wmi_hdl: wmi handle
* @cfg: obss color collision detection configuration
*
* Send WMI_OBSS_COLOR_COLLISION_DET_CONFIG_CMDID parameters to fw.
*
* Return: QDF_STATUS
*/
QDF_STATUS wmi_unified_send_obss_color_collision_cfg_cmd(void *wmi_hdl,
struct wmi_obss_color_collision_cfg_param *cfg);
/**
* wmi_unified_extract_obss_color_collision_info() - WMI function to extract
* obss color collision info from FW.
* @wmi_hdl: wmi handle
* @data: event data from firmware
* @info: Pointer to hold bss color collision info
*
* This function is used to extract bss collision info from firmware.
*
* Return: QDF_STATUS
*/
QDF_STATUS wmi_unified_extract_obss_color_collision_info(void *wmi_hdl,
uint8_t *data, struct wmi_obss_color_collision_info *info);
#ifdef WLAN_SUPPORT_GREEN_AP
QDF_STATUS wmi_extract_green_ap_egap_status_info(
@@ -2082,28 +1454,6 @@ wmi_extract_roam_scan_stats_res_evt(wmi_unified_t wmi, void *evt_buf,
QDF_STATUS
wmi_extract_offload_bcn_tx_status_evt(void *wmi_hdl, void *evt_buf,
uint32_t *vdev_id, uint32_t *tx_status);
/**
* wmi_unified_offload_11k_cmd() - send 11k offload command
* @wmi_hdl: wmi handle
* @params: 11k offload params
*
* This function passes the 11k offload command params to FW
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_offload_11k_cmd(void *wmi_hdl,
struct wmi_11k_offload_params *params);
/**
* wmi_unified_invoke_neighbor_report_cmd() - send invoke neighbor report cmd
* @wmi_hdl: wmi handle
* @params: invoke neighbor report params
*
* This function passes the invoke neighbor report command to fw
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_invoke_neighbor_report_cmd(void *wmi_hdl,
struct wmi_invoke_neighbor_report_params *params);
/* wmi_get_ch_width_from_phy_mode() - convert phy mode to channel width
* @wmi_hdl: wmi handle
@@ -2224,4 +1574,48 @@ QDF_STATUS wmi_unified_send_obss_spatial_reuse_set_cmd(void *wmi_handle,
QDF_STATUS wmi_convert_pdev_id_host_to_target(void *wmi_hdl,
uint32_t host_pdev_id,
uint32_t *target_pdev_id);
/**
* wmi_unified_send_bss_color_change_enable_cmd() - WMI function to send bss
* color change enable to FW.
* @wmi_hdl: wmi handle
* @vdev_id: vdev ID
* @enable: enable or disable color change handeling within firmware
*
* Send WMI_BSS_COLOR_CHANGE_ENABLE_CMDID parameters to fw,
* thereby firmware updates bss color when AP announces bss color change.
*
* Return: QDF_STATUS
*/
QDF_STATUS wmi_unified_send_bss_color_change_enable_cmd(void *wmi_hdl,
uint32_t vdev_id,
bool enable);
/**
* wmi_unified_send_obss_color_collision_cfg_cmd() - WMI function to send bss
* color collision detection configuration to FW.
* @wmi_hdl: wmi handle
* @cfg: obss color collision detection configuration
*
* Send WMI_OBSS_COLOR_COLLISION_DET_CONFIG_CMDID parameters to fw.
*
* Return: QDF_STATUS
*/
QDF_STATUS wmi_unified_send_obss_color_collision_cfg_cmd(void *wmi_hdl,
struct wmi_obss_color_collision_cfg_param *cfg);
/**
* wmi_unified_extract_obss_color_collision_info() - WMI function to extract
* obss color collision info from FW.
* @wmi_hdl: wmi handle
* @data: event data from firmware
* @info: Pointer to hold bss color collision info
*
* This function is used to extract bss collision info from firmware.
*
* Return: QDF_STATUS
*/
QDF_STATUS wmi_unified_extract_obss_color_collision_info(void *wmi_hdl,
uint8_t *data, struct wmi_obss_color_collision_info *info);
#endif /* _WMI_UNIFIED_API_H_ */

View File

@@ -0,0 +1,69 @@
/*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: Implement API's specific to concurrency component.
*/
#ifndef _WMI_UNIFIED_CONCURRENCY_API_H_
#define _WMI_UNIFIED_CONCURRENCY_API_H_
/**
* wmi_unified_set_mcc_channel_time_quota_cmd() - set MCC channel time quota
* @wmi: wmi handle
* @adapter_1_chan_number: adapter 1 channel number
* @adapter_1_quota: adapter 1 quota
* @adapter_2_chan_number: adapter 2 channel number
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_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_set_mcc_channel_time_latency_cmd() - set MCC channel time latency
* @wmi: wmi handle
* @mcc_channel: mcc channel
* @mcc_channel_time_latency: MCC channel time latency.
*
* Currently used to set time latency for an MCC vdev/adapter using operating
* channel of it and channel number. The info is provided run time using
* iwpriv command: iwpriv <wlan0 | p2p0> setMccLatency <latency in ms>.
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_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_set_enable_disable_mcc_adaptive_scheduler_cmd() - control mcc
* scheduler
* @wmi_handle: wmi handle
* @mcc_adaptive_scheduler: enable/disable
*
* This function enable/disable mcc adaptive scheduler in fw.
*
* Return: QDF_STATUS_SUCCESS for success or error code
*/
QDF_STATUS wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd(
void *wmi_hdl, uint32_t mcc_adaptive_scheduler,
uint32_t pdev_id);
#endif /* _WMI_UNIFIED_CONCURRENCY_API_H_ */

View File

@@ -0,0 +1,135 @@
/*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: Implement API's specific to NAN component.
*/
#ifndef _WMI_UNIFIED_NAN_API_H_
#define _WMI_UNIFIED_NAN_API_H_
#include <nan_public_structs.h>
/**
* wmi_unified_ndp_initiator_req_cmd_send - api to send initiator request to FW
* @wmi_hdl: wmi handle
* @req: pointer to request buffer
*
* Return: status of operation
*/
QDF_STATUS wmi_unified_ndp_initiator_req_cmd_send(void *wmi_hdl,
struct nan_datapath_initiator_req *req);
/**
* wmi_unified_ndp_responder_req_cmd_send - api to send responder request to FW
* @wmi_hdl: wmi handle
* @req: pointer to request buffer
*
* Return: status of operation
*/
QDF_STATUS wmi_unified_ndp_responder_req_cmd_send(void *wmi_hdl,
struct nan_datapath_responder_req *req);
/**
* wmi_unified_ndp_end_req_cmd_send - api to send end request to FW
* @wmi_hdl: wmi handle
* @req: pointer to request buffer
*
* Return: status of operation
*/
QDF_STATUS wmi_unified_ndp_end_req_cmd_send(void *wmi_hdl,
struct nan_datapath_end_req *req);
/**
* wmi_extract_ndp_initiator_rsp - api to extract initiator rsp from even buffer
* @wmi_hdl: wmi handle
* @data: event buffer
* @rsp: buffer to populate
*
* Return: status of operation
*/
QDF_STATUS wmi_extract_ndp_initiator_rsp(wmi_unified_t wmi_handle,
uint8_t *data, struct nan_datapath_initiator_rsp *rsp);
/**
* wmi_extract_ndp_ind - api to extract ndp indication struct from even buffer
* @wmi_hdl: wmi handle
* @data: event buffer
* @ind: buffer to populate
*
* Return: status of operation
*/
QDF_STATUS wmi_extract_ndp_ind(wmi_unified_t wmi_handle, uint8_t *data,
struct nan_datapath_indication_event *ind);
/**
* wmi_extract_ndp_confirm - api to extract ndp confim struct from even buffer
* @wmi_hdl: wmi handle
* @data: event buffer
* @ev: buffer to populate
*
* Return: status of operation
*/
QDF_STATUS wmi_extract_ndp_confirm(wmi_unified_t wmi_handle, uint8_t *data,
struct nan_datapath_confirm_event *ev);
/**
* wmi_extract_ndp_responder_rsp - api to extract responder rsp from even buffer
* @wmi_hdl: wmi handle
* @data: event buffer
* @rsp: buffer to populate
*
* Return: status of operation
*/
QDF_STATUS wmi_extract_ndp_responder_rsp(wmi_unified_t wmi_handle,
uint8_t *data, struct nan_datapath_responder_rsp *rsp);
/**
* wmi_extract_ndp_end_rsp - api to extract ndp end rsp from even buffer
* @wmi_hdl: wmi handle
* @data: event buffer
* @rsp: buffer to populate
*
* Return: status of operation
*/
QDF_STATUS wmi_extract_ndp_end_rsp(wmi_unified_t wmi_handle, uint8_t *data,
struct nan_datapath_end_rsp_event *rsp);
/**
* wmi_extract_ndp_end_ind - api to extract ndp end indication from even buffer
* @wmi_hdl: wmi handle
* @data: event buffer
* @ind: buffer to populate
*
* Return: status of operation
*/
QDF_STATUS wmi_extract_ndp_end_ind(wmi_unified_t wmi_handle, uint8_t *data,
struct nan_datapath_end_indication_event **ind);
/**
* wmi_extract_ndp_sch_update - api to extract ndp sch update from event buffer
* @wmi_hdl: wmi handle
* @data: event buffer
* @ind: buffer to populate
*
* Return: status of operation
*/
QDF_STATUS wmi_extract_ndp_sch_update(wmi_unified_t wmi_handle, uint8_t *data,
struct nan_datapath_sch_update_event *ind);
#endif /* _WMI_UNIFIED_NAN_API_H_ */

View File

@@ -0,0 +1,159 @@
/*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: Implement API's specific to OCB component.
*/
#ifndef _WMI_UNIFIED_DSRC_API_H_
#define _WMI_UNIFIED_DSRC_API_H_
#include <wlan_ocb_public_structs.h>
/**
* wmi_unified_ocb_start_timing_advert() - start sending the timing
* advertisement frames on a channel
* @wmi_handle: pointer to the wmi handle
* @timing_advert: pointer to the timing advertisement struct
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_ocb_start_timing_advert(struct wmi_unified *wmi_handle,
struct ocb_timing_advert_param *timing_advert);
/**
* wmi_unified_ocb_stop_timing_advert() - stop sending the timing
* advertisement frames on a channel
* @wmi_handle: pointer to the wmi handle
* @timing_advert: pointer to the timing advertisement struct
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_ocb_stop_timing_advert(struct wmi_unified *wmi_handle,
struct ocb_timing_advert_param *timing_advert);
/**
* wmi_unified_ocb_set_config() - send the OCB config to the FW
* @wmi_handle: pointer to the wmi handle
* @config: the OCB configuration
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures
*/
QDF_STATUS wmi_unified_ocb_set_config(struct wmi_unified *wmi_handle,
struct ocb_config *config);
/**
* wmi_unified_ocb_get_tsf_timer() - get ocb tsf timer val
* @wmi_handle: pointer to the wmi handle
* @req: request for tsf timer
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_ocb_get_tsf_timer(struct wmi_unified *wmi_handle,
struct ocb_get_tsf_timer_param *req);
/**
* wmi_unified_ocb_set_utc_time_cmd() - get ocb tsf timer val
* @wmi_handle: pointer to the wmi handle
* @vdev_id: vdev id
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_ocb_set_utc_time_cmd(struct wmi_unified *wmi_handle,
struct ocb_utc_param *utc);
/**
* wmi_unified_dcc_get_stats_cmd() - get the DCC channel stats
* @wmi_handle: pointer to the wmi handle
* @get_stats_param: pointer to the dcc stats
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_dcc_get_stats_cmd(struct wmi_unified *wmi_handle,
struct ocb_dcc_get_stats_param *get_stats_param);
/**
* wmi_unified_dcc_clear_stats() - command to clear the DCC stats
* @wmi_handle: pointer to the wmi handle
* @clear_stats_param: parameters to the command
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_dcc_clear_stats(struct wmi_unified *wmi_handle,
struct ocb_dcc_clear_stats_param *clear_stats_param);
/**
* wmi_unified_dcc_update_ndl() - command to update the NDL data
* @wmi_handle: pointer to the wmi handle
* @update_ndl_param: pointer to the request parameters
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures
*/
QDF_STATUS wmi_unified_dcc_update_ndl(struct wmi_unified *wmi_handle,
struct ocb_dcc_update_ndl_param *update_ndl_param);
/**
* wmi_extract_ocb_set_channel_config_resp() - extract status from wmi event
* @wmi_handle: wmi handle
* @evt_buf: pointer to event buffer
* @status: status buffer
*
* Return: QDF_STATUS_SUCCESS on success
*/
QDF_STATUS
wmi_extract_ocb_set_channel_config_resp(struct wmi_unified *wmi_handle,
void *evt_buf,
uint32_t *status);
/**
* wmi_extract_ocb_tsf_timer() - extract tsf timer from wmi event
* @wmi_handle: wmi handle
* @evt_buf: pointer to event buffer
* @resp: tsf timer
*
* Return: QDF_STATUS_SUCCESS on success
*/
QDF_STATUS wmi_extract_ocb_tsf_timer(struct wmi_unified *wmi_handle,
void *evt_buf,
struct ocb_get_tsf_timer_response *resp);
/**
* wmi_extract_dcc_update_ndl_resp() - extract NDL update from wmi event
* @wmi_handle: wmi handle
* @evt_buf: pointer to event buffer
* @resp: ndl update status
*
* Return: QDF_STATUS_SUCCESS on success
*/
QDF_STATUS wmi_extract_dcc_update_ndl_resp(struct wmi_unified *wmi_handle,
void *evt_buf, struct ocb_dcc_update_ndl_response *resp);
/**
* wmi_extract_dcc_stats() - extract DCC stats from wmi event
* @wmi_handle: wmi handle
* @evt_buf: pointer to event buffer
* @resp: DCC stats
*
* Since length of the response is variable, response buffer will be allocated.
* The caller must free the response buffer.
*
* Return: QDF_STATUS_SUCCESS on success
*/
QDF_STATUS wmi_extract_dcc_stats(struct wmi_unified *wmi_handle,
void *evt_buf,
struct ocb_dcc_get_stats_response **response);
#endif /* _WMI_UNIFIED_DSRC_API_H_ */

View File

@@ -0,0 +1,92 @@
/*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: Implement API's specific to P2P component.
*/
#ifndef _WMI_UNIFIED_P2P_API_H_
#define _WMI_UNIFIED_P2P_API_H_
#include <wlan_p2p_public_struct.h>
/**
* wmi_unified_set_p2pgo_oppps_req() - send p2p go opp power save request to fw
* @wmi_hdl: wmi handle
* @opps: p2p opp power save parameters
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_set_p2pgo_oppps_req(void *wmi_hdl,
struct p2p_ps_params *oppps);
/**
* wmi_unified_set_p2pgo_noa_req_cmd() - send p2p go noa request to fw
* @wmi_hdl: wmi handle
* @noa: p2p power save parameters
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_set_p2pgo_noa_req_cmd(void *wmi_hdl,
struct p2p_ps_params *noa);
/**
* wmi_extract_p2p_noa_ev_param() - extract p2p noa param from event
* @wmi_handle: wmi handle
* @evt_buf: pointer to event buffer
* @param: Pointer to hold p2p noa param
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_extract_p2p_noa_ev_param(void *wmi_hdl,
void *evt_buf,
struct p2p_noa_info *param);
#ifdef FEATURE_P2P_LISTEN_OFFLOAD
/**
* wmi_unified_p2p_lo_start_cmd() - send p2p lo start request to fw
* @wmi_hdl: wmi handle
* @param: p2p listen offload start parameters
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_p2p_lo_start_cmd(void *wmi_hdl,
struct p2p_lo_start *param);
/**
* wmi_unified_p2p_lo_stop_cmd() - send p2p lo stop request to fw
* @wmi_hdl: wmi handle
* @vdev_id: vdev id
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_p2p_lo_stop_cmd(void *wmi_hdl, uint8_t vdev_id);
/**
* wmi_extract_p2p_lo_stop_ev_param() - extract p2p lo stop param from event
* @wmi_handle: wmi handle
* @evt_buf: pointer to event buffer
* @param: Pointer to hold listen offload stop param
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_extract_p2p_lo_stop_ev_param(void *wmi_hdl,
void *evt_buf,
struct p2p_lo_event *param);
#endif /* FEATURE_P2P_LISTEN_OFFLOAD */
#endif /* _WMI_UNIFIED_P2P_API_H_ */

File diff suppressed because it is too large Load Diff

View File

@@ -30,6 +30,26 @@
#include "wlan_pmo_wow_public_struct.h"
#include "wlan_pmo_pkt_filter_public_struct.h"
#ifdef FEATURE_WLAN_D0WOW
/**
* wmi_unified_d0wow_enable_send() - WMI d0 wow enable function
* @param wmi_handle: handle to WMI.
* @mac_id: radio context
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_d0wow_enable_send(void *wmi_hdl, uint8_t mac_id);
/**
* wmi_unified_d0wow_disable_send() - WMI d0 wow disable function
* @param wmi_handle: handle to WMI.
* @mac_id: radio context
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_d0wow_disable_send(void *wmi_hdl, uint8_t mac_id);
#endif /* FEATURE_WLAN_D0WOW */
/**
* wmi_unified_add_wow_wakeup_event_cmd() - Configures wow wakeup events.
* @wmi_handle: wmi handle
@@ -93,6 +113,7 @@ QDF_STATUS wmi_unified_multiple_add_clear_mcbc_filter_cmd(void *wmi_hdl,
uint8_t vdev_id,
struct pmo_mcast_filter_params *filter_param);
#ifdef FEATURE_WLAN_RA_FILTERING
/**
* wmi_unified_wow_sta_ra_filter_cmd() - set RA filter pattern in fw
* @wmi_handle: wmi handle
@@ -101,8 +122,10 @@ QDF_STATUS wmi_unified_multiple_add_clear_mcbc_filter_cmd(void *wmi_hdl,
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_wow_sta_ra_filter_cmd(void *wmi_hdl,
uint8_t vdev_id, uint8_t default_pattern,
uint8_t vdev_id,
uint8_t default_pattern,
uint16_t rate_limit_interval);
#endif
/**
* wmi_unified_enable_enhance_multicast_offload() - enhance multicast offload
@@ -188,6 +211,7 @@ QDF_STATUS wmi_unified_enable_arp_ns_offload_cmd(void *wmi_hdl,
QDF_STATUS wmi_unified_conf_hw_filter_cmd(void *opaque_wmi,
struct pmo_hw_filter_params *req);
#ifdef FEATURE_WLAN_LPHB
/**
* wmi_unified_lphb_config_hbenable_cmd() - enable command of LPHB configuration
* @wmi_handle: wmi handle
@@ -237,6 +261,7 @@ QDF_STATUS wmi_unified_lphb_config_udp_params_cmd(void *wmi_hdl,
*/
QDF_STATUS wmi_unified_lphb_config_udp_pkt_filter_cmd(void *wmi_hdl,
wmi_hb_set_udp_pkt_filter_cmd_fixed_param *lphb_conf_req);
#endif /* FEATURE_WLAN_LPHB */
#ifdef WLAN_FEATURE_PACKET_FILTERING
/**
@@ -248,7 +273,8 @@ QDF_STATUS wmi_unified_lphb_config_udp_pkt_filter_cmd(void *wmi_hdl,
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_enable_disable_packet_filter_cmd(void *wmi_hdl,
uint8_t vdev_id, bool enable);
uint8_t vdev_id,
bool enable);
/**
* wmi_unified_config_packet_filter_cmd() - configure packet filter in target
@@ -263,6 +289,74 @@ QDF_STATUS wmi_unified_enable_disable_packet_filter_cmd(void *wmi_hdl,
QDF_STATUS wmi_unified_config_packet_filter_cmd(void *wmi_hdl,
uint8_t vdev_id, struct pmo_rcv_pkt_fltr_cfg *rcv_filter_param,
uint8_t filter_id, bool enable);
#endif
#endif /* WLAN_FEATURE_PACKET_FILTERING */
/**
* wmi_unified_wow_delete_pattern_cmd() - delete wow pattern in target
* @wmi_handle: wmi handle
* @ptrn_id: pattern id
* @vdev_id: vdev id
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_wow_delete_pattern_cmd(void *wmi_hdl, uint8_t ptrn_id,
uint8_t vdev_id);
/**
* wmi_unified_host_wakeup_ind_to_fw_cmd() - send wakeup ind to fw
* @wmi_handle: wmi handle
*
* Sends host wakeup indication to FW. On receiving this indication,
* FW will come out of WOW.
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_host_wakeup_ind_to_fw_cmd(void *wmi_hdl);
/**
* wmi_unified_wow_timer_pattern_cmd() - set timer pattern tlv, so that
* firmware will wake up host after
* specified time is elapsed
* @wmi_handle: wmi handle
* @vdev_id: vdev id
* @cookie: value to identify reason why host set up wake call.
* @time: time in ms
*
* Return: QDF status
*/
QDF_STATUS wmi_unified_wow_timer_pattern_cmd(void *wmi_hdl, uint8_t vdev_id,
uint32_t cookie, uint32_t time);
#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
/**
* wmi_unified_enable_ext_wow_cmd() - enable ext wow in fw
* @wmi_handle: wmi handle
* @params: ext wow params
*
* Return:QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_enable_ext_wow_cmd(void *wmi_hdl,
struct ext_wow_params *params);
/**
* wmi_unified_set_app_type2_params_in_fw_cmd() - set app type2 params in fw
* @wmi_handle: wmi handle
* @appType2Params: app type2 params
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_set_app_type2_params_in_fw_cmd(void *wmi_hdl,
struct app_type2_params *appType2Params);
/**
* wmi_unified_app_type1_params_in_fw_cmd() - set app type1 params in fw
* @wmi_hdl: wmi handle
* @app_type1_params: app type1 params
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_app_type1_params_in_fw_cmd(void *wmi_hdl,
struct app_type1_params *app_type1_params);
#endif /* WLAN_FEATURE_EXTWOW_SUPPORT */
#endif /* _WMI_UNIFIED_PMO_API_H_ */

View File

@@ -32,10 +32,6 @@
#include "qdf_atomic.h"
#include <wbuff.h>
#ifdef CONVERGED_P2P_ENABLE
#include <wlan_p2p_public_struct.h>
#endif
#ifdef DFS_COMPONENT_ENABLE
#include <wlan_dfs_public_struct.h>
#endif
@@ -418,6 +414,7 @@ QDF_STATUS (*send_set_sta_ps_mode_cmd)(wmi_unified_t wmi_handle,
QDF_STATUS (*send_get_temperature_cmd)(wmi_unified_t wmi_handle);
#ifdef CONVERGED_P2P_ENABLE
QDF_STATUS (*send_set_p2pgo_oppps_req_cmd)(wmi_unified_t wmi_handle,
struct p2p_ps_params *oppps);
@@ -430,7 +427,8 @@ QDF_STATUS (*send_p2p_lo_start_cmd)(wmi_unified_t wmi_handle,
QDF_STATUS (*send_p2p_lo_stop_cmd)(wmi_unified_t wmi_handle,
uint8_t vdev_id);
#endif
#endif /* FEATURE_P2P_LISTEN_OFFLOAD */
#endif /* CONVERGED_P2P_ENABLE */
QDF_STATUS (*send_set_smps_params_cmd)(wmi_unified_t wmi_handle,
uint8_t vdev_id,
@@ -477,7 +475,7 @@ QDF_STATUS (*extract_dcc_update_ndl_resp)(wmi_unified_t wmi_hdl,
QDF_STATUS (*extract_dcc_stats)(wmi_unified_t wmi_hdl,
void *evt_buf,
struct ocb_dcc_get_stats_response **response);
#endif
#endif /* WLAN_FEATURE_DSRC */
QDF_STATUS (*send_lro_config_cmd)(wmi_unified_t wmi_handle,
struct wmi_lro_config_cmd_t *wmi_lro_cmd);
@@ -487,6 +485,7 @@ QDF_STATUS (*send_set_thermal_mgmt_cmd)(wmi_unified_t wmi_handle,
QDF_STATUS (*send_peer_rate_report_cmd)(wmi_unified_t wmi_handle,
struct wmi_peer_rate_report_params *rate_report_params);
#ifdef WMI_CONCURRENCY_SUPPORT
QDF_STATUS (*send_set_mcc_channel_time_quota_cmd)
(wmi_unified_t wmi_handle,
uint32_t adapter_1_chan_freq,
@@ -499,6 +498,7 @@ QDF_STATUS (*send_set_mcc_channel_time_latency_cmd)
QDF_STATUS (*send_set_enable_disable_mcc_adaptive_scheduler_cmd)(
wmi_unified_t wmi_handle, uint32_t mcc_adaptive_scheduler,
uint32_t pdev_id);
#endif /* WMI_CONCURRENCY_SUPPORT */
QDF_STATUS (*send_p2p_go_set_beacon_ie_cmd)(wmi_unified_t wmi_handle,
uint32_t vdev_id, uint8_t *p2p_ie);
@@ -510,29 +510,20 @@ QDF_STATUS (*send_probe_rsp_tmpl_send_cmd)(wmi_unified_t wmi_handle,
QDF_STATUS (*send_setup_install_key_cmd)(wmi_unified_t wmi_handle,
struct set_key_params *key_params);
QDF_STATUS (*send_vdev_set_gtx_cfg_cmd)(wmi_unified_t wmi_handle,
uint32_t if_id,
struct wmi_gtx_config *gtx_info);
QDF_STATUS (*send_set_sta_keep_alive_cmd)(wmi_unified_t wmi_handle,
struct sta_params *params);
QDF_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);
QDF_STATUS (*send_set_gateway_params_cmd)(wmi_unified_t wmi_handle,
struct gateway_update_req_param *req);
QDF_STATUS (*send_set_rssi_monitoring_cmd)(wmi_unified_t wmi_handle,
struct rssi_monitor_param *req);
QDF_STATUS (*send_scan_probe_setoui_cmd)(wmi_unified_t wmi_handle,
struct scan_mac_oui *psetoui);
QDF_STATUS (*send_reset_passpoint_network_list_cmd)(wmi_unified_t wmi_handle,
struct wifi_passpoint_req_param *req);
#ifdef WMI_ROAM_SUPPORT
#ifdef FEATURE_LFR_SUBNET_DETECTION
QDF_STATUS (*send_set_gateway_params_cmd)(wmi_unified_t wmi_handle,
struct gateway_update_req_param *req);
#endif /* FEATURE_LFR_SUBNET_DETECTION */
#ifdef FEATURE_RSSI_MONITOR
QDF_STATUS (*send_set_rssi_monitoring_cmd)(wmi_unified_t wmi_handle,
struct rssi_monitor_param *req);
#endif /* FEATURE_RSSI_MONITOR */
QDF_STATUS (*send_roam_scan_offload_rssi_thresh_cmd)(wmi_unified_t wmi_handle,
struct roam_offload_scan_rssi_params *roam_req);
@@ -542,10 +533,76 @@ QDF_STATUS (*send_roam_mawc_params_cmd)(wmi_unified_t wmi_handle,
QDF_STATUS (*send_roam_scan_filter_cmd)(wmi_unified_t wmi_handle,
struct roam_scan_filter_params *roam_req);
#if defined(WLAN_FEATURE_FILS_SK)
QDF_STATUS (*send_roam_scan_offload_mode_cmd)(wmi_unified_t wmi_handle,
wmi_start_scan_cmd_fixed_param *scan_cmd_fp,
struct roam_offload_scan_params *roam_req);
QDF_STATUS (*send_roam_scan_offload_ap_profile_cmd)(wmi_unified_t wmi_handle,
struct ap_profile_params *ap_profile);
QDF_STATUS (*send_roam_scan_offload_cmd)(wmi_unified_t wmi_handle,
uint32_t command, uint32_t vdev_id);
QDF_STATUS (*send_roam_scan_offload_scan_period_cmd)(wmi_unified_t wmi_handle,
uint32_t scan_period,
uint32_t scan_age,
uint32_t vdev_id);
QDF_STATUS (*send_roam_scan_offload_chan_list_cmd)(wmi_unified_t wmi_handle,
uint8_t chan_count,
uint32_t *chan_list,
uint8_t list_type, uint32_t vdev_id);
QDF_STATUS (*send_roam_scan_offload_rssi_change_cmd)(wmi_unified_t wmi_handle,
uint32_t vdev_id,
int32_t rssi_change_thresh,
uint32_t bcn_rssi_weight,
uint32_t hirssi_delay_btw_scans);
QDF_STATUS (*send_per_roam_config_cmd)(wmi_unified_t wmi_handle,
struct wmi_per_roam_config_req *req_buf);
QDF_STATUS (*send_offload_11k_cmd)(wmi_unified_t wmi_handle,
struct wmi_11k_offload_params *params);
QDF_STATUS (*send_invoke_neighbor_report_cmd)(wmi_unified_t wmi_handle,
struct wmi_invoke_neighbor_report_params *params);
QDF_STATUS (*send_btm_config)(wmi_unified_t wmi_handle,
struct wmi_btm_config *params);
QDF_STATUS (*send_limit_off_chan_cmd)(wmi_unified_t wmi_handle,
struct wmi_limit_off_chan_param *limit_off_chan_param);
#ifdef WLAN_FEATURE_FILS_SK
QDF_STATUS (*send_roam_scan_hlp_cmd) (wmi_unified_t wmi_handle,
struct hlp_params *params);
#endif
#endif /* WLAN_FEATURE_FILS_SK */
#ifdef FEATURE_WLAN_ESE
QDF_STATUS (*send_plm_stop_cmd)(wmi_unified_t wmi_handle,
const struct plm_req_params *plm);
QDF_STATUS (*send_plm_start_cmd)(wmi_unified_t wmi_handle,
const struct plm_req_params *plm,
uint32_t *gchannel_list);
#endif /* FEATURE_WLAN_ESE */
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
QDF_STATUS (*send_set_ric_req_cmd)(wmi_unified_t wmi_handle, void *msg,
uint8_t is_add_ts);
QDF_STATUS (*send_process_roam_synch_complete_cmd)(wmi_unified_t wmi_handle,
uint8_t vdev_id);
QDF_STATUS (*send_roam_invoke_cmd)(wmi_unified_t wmi_handle,
struct wmi_roam_invoke_cmd *roaminvoke,
uint32_t ch_hz);
#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
#endif /* WMI_ROAM_SUPPORT */
QDF_STATUS (*send_scan_probe_setoui_cmd)(wmi_unified_t wmi_handle,
struct scan_mac_oui *psetoui);
QDF_STATUS (*send_set_passpoint_network_list_cmd)(wmi_unified_t wmi_handle,
struct wifi_passpoint_req_param *req);
@@ -578,16 +635,6 @@ QDF_STATUS (*send_stop_extscan_cmd)(wmi_unified_t wmi_handle,
QDF_STATUS (*send_start_extscan_cmd)(wmi_unified_t wmi_handle,
struct wifi_scan_cmd_req_params *pstart);
QDF_STATUS (*send_plm_stop_cmd)(wmi_unified_t wmi_handle,
const struct plm_req_params *plm);
QDF_STATUS (*send_wlm_latency_level_cmd)(wmi_unified_t wmi_handle,
struct wlm_latency_level_param *param);
QDF_STATUS (*send_plm_start_cmd)(wmi_unified_t wmi_handle,
const struct plm_req_params *plm,
uint32_t *gchannel_list);
QDF_STATUS (*send_csa_offload_enable_cmd)(wmi_unified_t wmi_handle,
uint8_t vdev_id);
@@ -604,14 +651,6 @@ QDF_STATUS (*send_ipa_offload_control_cmd)(wmi_unified_t wmi_handle,
struct ipa_uc_offload_control_params *ipa_offload);
#endif
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
QDF_STATUS (*send_set_ric_req_cmd)(wmi_unified_t wmi_handle, void *msg,
uint8_t is_add_ts);
QDF_STATUS (*send_process_roam_synch_complete_cmd)(wmi_unified_t wmi_handle,
uint8_t vdev_id);
#endif
QDF_STATUS (*send_process_ll_stats_clear_cmd)
(wmi_unified_t wmi_handle,
const struct ll_stats_clear_params *clear_req,
@@ -688,6 +727,15 @@ QDF_STATUS (*extract_gtk_rsp_event)(wmi_unified_t wmi_handle,
void *evt_buf,
struct pmo_gtk_rsp_params *gtk_rsp_param, uint32_t len);
QDF_STATUS (*send_wow_delete_pattern_cmd)(wmi_unified_t wmi_handle,
uint8_t ptrn_id,
uint8_t vdev_id);
QDF_STATUS (*send_host_wakeup_ind_to_fw_cmd)(wmi_unified_t wmi_handle);
QDF_STATUS (*send_wow_timer_pattern_cmd)(wmi_unified_t wmi_handle,
uint8_t vdev_id, uint32_t cookie, uint32_t time);
#ifdef FEATURE_WLAN_LPHB
QDF_STATUS (*send_lphb_config_hbenable_cmd)(wmi_unified_t wmi_handle,
wmi_hb_set_enable_cmd_fixed_param *params);
@@ -702,7 +750,7 @@ QDF_STATUS (*send_lphb_config_udp_params_cmd)(wmi_unified_t wmi_handle,
QDF_STATUS (*send_lphb_config_udp_pkt_filter_cmd)(wmi_unified_t wmi_handle,
wmi_hb_set_udp_pkt_filter_cmd_fixed_param *lphb_conf_req);
#endif /* FEATURE_WLAN_LPHB */
#ifdef WLAN_FEATURE_PACKET_FILTERING
QDF_STATUS (*send_enable_disable_packet_filter_cmd)(wmi_unified_t wmi_handle,
uint8_t vdev_id, bool enable);
@@ -713,22 +761,9 @@ QDF_STATUS (*send_config_packet_filter_cmd)(wmi_unified_t wmi_handle,
#endif
#endif /* end of WLAN_POWER_MANAGEMENT_OFFLOAD */
#ifdef CONFIG_MCL
QDF_STATUS (*send_process_dhcp_ind_cmd)(wmi_unified_t wmi_handle,
wmi_peer_set_param_cmd_fixed_param *ta_dhcp_ind);
QDF_STATUS (*send_get_link_speed_cmd)(wmi_unified_t wmi_handle,
wmi_mac_addr peer_macaddr);
QDF_STATUS (*send_bcn_buf_ll_cmd)(wmi_unified_t wmi_handle,
wmi_bcn_send_from_host_cmd_fixed_param * param);
QDF_STATUS (*send_roam_scan_offload_mode_cmd)(wmi_unified_t wmi_handle,
wmi_start_scan_cmd_fixed_param * scan_cmd_fp,
struct roam_offload_scan_params *roam_req);
QDF_STATUS (*send_roam_scan_offload_ap_profile_cmd)(wmi_unified_t wmi_handle,
struct ap_profile_params *ap_profile);
QDF_STATUS (*send_pktlog_wmi_send_cmd)(wmi_unified_t wmi_handle,
WMI_PKTLOG_EVENT pktlog_event,
WMI_CMD_ID cmd_id, uint8_t user_triggered);
@@ -739,11 +774,6 @@ QDF_STATUS (*send_egap_conf_params_cmd)(wmi_unified_t wmi_handle,
struct wlan_green_ap_egap_params *egap_params);
#endif
QDF_STATUS (*send_fw_profiling_cmd)(wmi_unified_t wmi_handle,
uint32_t cmd, uint32_t value1, uint32_t value2);
QDF_STATUS (*send_nat_keepalive_en_cmd)(wmi_unified_t wmi_handle, uint8_t vdev_id);
#ifdef WLAN_FEATURE_CIF_CFR
QDF_STATUS (*send_oem_dma_cfg_cmd)(wmi_unified_t wmi_handle,
wmi_oem_dma_ring_cfg_req_fixed_param *cfg);
@@ -757,11 +787,17 @@ QDF_STATUS
(*send_dfs_phyerr_filter_offload_en_cmd)(wmi_unified_t wmi_handle,
bool dfs_phyerr_filter_offload);
QDF_STATUS (*send_wow_delete_pattern_cmd)(wmi_unified_t wmi_handle, uint8_t ptrn_id,
uint8_t vdev_id);
QDF_STATUS (*send_bss_color_change_enable_cmd)(wmi_unified_t wmi_handle,
uint32_t vdev_id,
bool enable);
QDF_STATUS (*send_host_wakeup_ind_to_fw_cmd)(wmi_unified_t wmi_handle);
QDF_STATUS (*send_obss_color_collision_cfg_cmd)(wmi_unified_t wmi_handle,
struct wmi_obss_color_collision_cfg_param *cfg);
QDF_STATUS (*extract_obss_color_collision_info)(uint8_t *evt_buf,
struct wmi_obss_color_collision_info *info);
#ifdef WMI_STA_SUPPORT
QDF_STATUS (*send_del_ts_cmd)(wmi_unified_t wmi_handle, uint8_t vdev_id,
uint8_t ac);
@@ -780,31 +816,100 @@ QDF_STATUS (*send_process_del_periodic_tx_ptrn_cmd)(wmi_unified_t wmi_handle,
uint8_t vdev_id,
uint8_t pattern_id);
QDF_STATUS (*send_stats_ext_req_cmd)(wmi_unified_t wmi_handle,
struct stats_ext_params *preq);
QDF_STATUS (*send_enable_ext_wow_cmd)(wmi_unified_t wmi_handle,
struct ext_wow_params *params);
QDF_STATUS (*send_set_app_type2_params_in_fw_cmd)(wmi_unified_t wmi_handle,
struct app_type2_params *appType2Params);
QDF_STATUS (*send_set_auto_shutdown_timer_cmd)(wmi_unified_t wmi_handle,
uint32_t timer_val);
#ifdef WLAN_FEATURE_NAN
QDF_STATUS (*send_nan_req_cmd)(wmi_unified_t wmi_handle,
struct nan_req_params *nan_req);
QDF_STATUS (*send_process_dhcpserver_offload_cmd)(wmi_unified_t wmi_handle,
struct dhcp_offload_info_params *params);
#endif
QDF_STATUS (*send_process_ch_avoid_update_cmd)(wmi_unified_t wmi_handle);
QDF_STATUS (*send_regdomain_info_to_fw_cmd)(wmi_unified_t wmi_handle,
uint32_t reg_dmn, uint16_t regdmn2G,
uint16_t regdmn5G, uint8_t ctl2G,
uint8_t ctl5G);
QDF_STATUS (*send_process_set_ie_info_cmd)(wmi_unified_t wmi_handle,
struct vdev_ie_info_param *ie_info);
QDF_STATUS (*send_set_base_macaddr_indicate_cmd)(wmi_unified_t wmi_handle,
uint8_t *custom_addr);
QDF_STATUS (*send_pdev_set_pcl_cmd)(wmi_unified_t wmi_handle,
struct wmi_pcl_chan_weights *msg);
QDF_STATUS (*send_pdev_set_hw_mode_cmd)(wmi_unified_t wmi_handle,
uint32_t hw_mode_index);
#ifdef WLAN_POLICY_MGR_ENABLE
QDF_STATUS (*send_pdev_set_dual_mac_config_cmd)(wmi_unified_t wmi_handle,
struct policy_mgr_dual_mac_config *msg);
#endif
QDF_STATUS (*send_set_led_flashing_cmd)(wmi_unified_t wmi_handle,
struct flashing_req_params *flashing);
QDF_STATUS (*send_set_arp_stats_req_cmd)(wmi_unified_t wmi_handle,
struct set_arp_stats *req_buf);
QDF_STATUS (*send_get_arp_stats_req_cmd)(wmi_unified_t wmi_handle,
struct get_arp_stats *req_buf);
QDF_STATUS (*send_set_del_pmkid_cache_cmd) (wmi_unified_t wmi_handle,
struct wmi_unified_pmk_cache *req_buf);
QDF_STATUS (*send_adapt_dwelltime_params_cmd)(wmi_unified_t wmi_handle,
struct wmi_adaptive_dwelltime_params *dwelltime_params);
QDF_STATUS (*send_dbs_scan_sel_params_cmd)(wmi_unified_t wmi_handle,
struct wmi_dbs_scan_sel_params *dbs_scan_params);
QDF_STATUS (*send_vdev_set_gtx_cfg_cmd)(wmi_unified_t wmi_handle,
uint32_t if_id,
struct wmi_gtx_config *gtx_info);
QDF_STATUS (*send_set_sta_keep_alive_cmd)(wmi_unified_t wmi_handle,
struct sta_params *params);
QDF_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);
QDF_STATUS (*send_fw_profiling_cmd)(wmi_unified_t wmi_handle,
uint32_t cmd, uint32_t value1, uint32_t value2);
QDF_STATUS (*send_nat_keepalive_en_cmd)(wmi_unified_t wmi_handle,
uint8_t vdev_id);
QDF_STATUS (*send_process_dhcp_ind_cmd)(wmi_unified_t wmi_handle,
wmi_peer_set_param_cmd_fixed_param *ta_dhcp_ind);
QDF_STATUS (*send_get_link_speed_cmd)(wmi_unified_t wmi_handle,
wmi_mac_addr peer_macaddr);
QDF_STATUS (*send_wlm_latency_level_cmd)(wmi_unified_t wmi_handle,
struct wlm_latency_level_param *param);
QDF_STATUS (*send_sar_limit_cmd)(wmi_unified_t wmi_handle,
struct sar_limit_cmd_params *params);
QDF_STATUS (*get_sar_limit_cmd)(wmi_unified_t wmi_handle);
QDF_STATUS (*extract_sar_limit_event)(wmi_unified_t wmi_handle,
uint8_t *evt_buf,
struct sar_limit_event *event);
QDF_STATUS (*extract_sar2_result_event)(void *handle,
uint8_t *event,
uint32_t len);
#ifdef WLAN_FEATURE_DISA
QDF_STATUS (*send_encrypt_decrypt_send_cmd)(wmi_unified_t wmi_handle,
struct disa_encrypt_decrypt_req_params *params);
QDF_STATUS (*extract_encrypt_decrypt_resp_event)(wmi_unified_t wmi_handle,
void *evt_buf,
struct disa_encrypt_decrypt_resp_params *resp);
#endif
#ifdef CONVERGED_TDLS_ENABLE
QDF_STATUS (*send_set_tdls_offchan_mode_cmd)(wmi_unified_t wmi_handle,
struct tdls_channel_switch_params *chan_switch_params);
@@ -815,20 +920,40 @@ QDF_STATUS (*send_update_tdls_peer_state_cmd)(wmi_unified_t wmi_handle,
struct tdls_peer_state_params *peerStateParams,
uint32_t *ch_mhz);
QDF_STATUS (*extract_vdev_tdls_ev_param)(wmi_unified_t wmi_handle,
void *evt_buf, struct tdls_event_info *param);
#endif /* CONVERGED_TDLS_ENABLE */
#endif /* WMI_STA_SUPPORT */
QDF_STATUS (*send_stats_ext_req_cmd)(wmi_unified_t wmi_handle,
struct stats_ext_params *preq);
#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
QDF_STATUS (*send_enable_ext_wow_cmd)(wmi_unified_t wmi_handle,
struct ext_wow_params *params);
QDF_STATUS (*send_set_app_type2_params_in_fw_cmd)(wmi_unified_t wmi_handle,
struct app_type2_params *appType2Params);
QDF_STATUS (*send_app_type1_params_in_fw_cmd)(wmi_unified_t wmi_handle,
struct app_type1_params *app_type1_params);
#endif /* WLAN_FEATURE_EXTWOW_SUPPORT */
QDF_STATUS (*send_process_dhcpserver_offload_cmd)(wmi_unified_t wmi_handle,
struct dhcp_offload_info_params *params);
QDF_STATUS (*send_regdomain_info_to_fw_cmd)(wmi_unified_t wmi_handle,
uint32_t reg_dmn, uint16_t regdmn2G,
uint16_t regdmn5G, uint8_t ctl2G,
uint8_t ctl5G);
QDF_STATUS (*send_process_fw_mem_dump_cmd)(wmi_unified_t wmi_handle,
struct fw_dump_req_param *mem_dump_req);
QDF_STATUS (*send_process_set_ie_info_cmd)(wmi_unified_t wmi_handle,
struct vdev_ie_info_param *ie_info);
QDF_STATUS (*save_fw_version_cmd)(wmi_unified_t wmi_handle, void *evt_buf);
QDF_STATUS (*check_and_update_fw_version_cmd)(wmi_unified_t wmi_hdl, void *ev);
QDF_STATUS (*send_set_base_macaddr_indicate_cmd)(wmi_unified_t wmi_handle,
uint8_t *custom_addr);
QDF_STATUS (*send_log_supported_evt_cmd)(wmi_unified_t wmi_handle,
uint8_t *event,
uint32_t len);
@@ -838,59 +963,12 @@ QDF_STATUS (*send_enable_specific_fw_logs_cmd)(wmi_unified_t wmi_handle,
QDF_STATUS (*send_flush_logs_to_fw_cmd)(wmi_unified_t wmi_handle);
QDF_STATUS (*send_pdev_set_pcl_cmd)(wmi_unified_t wmi_handle,
struct wmi_pcl_chan_weights *msg);
QDF_STATUS (*send_pdev_set_hw_mode_cmd)(wmi_unified_t wmi_handle,
uint32_t hw_mode_index);
QDF_STATUS (*send_pdev_set_dual_mac_config_cmd)(wmi_unified_t wmi_handle,
struct policy_mgr_dual_mac_config *msg);
QDF_STATUS (*send_set_led_flashing_cmd)(wmi_unified_t wmi_handle,
struct flashing_req_params *flashing);
QDF_STATUS (*send_app_type1_params_in_fw_cmd)(wmi_unified_t wmi_handle,
struct app_type1_params *app_type1_params);
QDF_STATUS (*send_set_ssid_hotlist_cmd)(wmi_unified_t wmi_handle,
struct ssid_hotlist_request_params *request);
QDF_STATUS (*send_unit_test_cmd)(wmi_unified_t wmi_handle,
struct wmi_unit_test_cmd *wmi_utest);
QDF_STATUS (*send_roam_invoke_cmd)(wmi_unified_t wmi_handle,
struct wmi_roam_invoke_cmd *roaminvoke,
uint32_t ch_hz);
QDF_STATUS (*send_roam_scan_offload_cmd)(wmi_unified_t wmi_handle,
uint32_t command, uint32_t vdev_id);
QDF_STATUS (*send_roam_scan_offload_scan_period_cmd)(wmi_unified_t wmi_handle,
uint32_t scan_period,
uint32_t scan_age,
uint32_t vdev_id);
QDF_STATUS (*send_roam_scan_offload_chan_list_cmd)(wmi_unified_t wmi_handle,
uint8_t chan_count,
uint32_t *chan_list,
uint8_t list_type, uint32_t vdev_id);
QDF_STATUS (*send_roam_scan_offload_rssi_change_cmd)(wmi_unified_t wmi_handle,
uint32_t vdev_id,
int32_t rssi_change_thresh,
uint32_t bcn_rssi_weight,
uint32_t hirssi_delay_btw_scans);
QDF_STATUS (*send_per_roam_config_cmd)(wmi_unified_t wmi_handle,
struct wmi_per_roam_config_req *req_buf);
QDF_STATUS (*send_set_arp_stats_req_cmd)(wmi_unified_t wmi_handle,
struct set_arp_stats *req_buf);
QDF_STATUS (*send_get_arp_stats_req_cmd)(wmi_unified_t wmi_handle,
struct get_arp_stats *req_buf);
#ifdef FEATURE_WLAN_APF
QDF_STATUS
(*send_set_active_apf_mode_cmd)(wmi_unified_t wmi_handle, uint8_t vdev_id,
@@ -1027,8 +1105,6 @@ QDF_STATUS (*send_vdev_spectral_configure_cmd)(wmi_unified_t wmi_handle,
QDF_STATUS (*send_vdev_spectral_enable_cmd)(wmi_unified_t wmi_handle,
struct vdev_spectral_enable_params *param);
QDF_STATUS (*send_set_del_pmkid_cache_cmd) (wmi_unified_t wmi_handle,
struct wmi_unified_pmk_cache *req_buf);
QDF_STATUS (*send_bss_chan_info_request_cmd)(wmi_unified_t wmi_handle,
struct bss_chan_info_request_params *param);
@@ -1298,11 +1374,6 @@ QDF_STATUS (*extract_vdev_roam_param)(wmi_unified_t wmi_handle, void *evt_buf,
QDF_STATUS (*extract_vdev_scan_ev_param)(wmi_unified_t wmi_handle,
void *evt_buf, struct scan_event *param);
#ifdef CONVERGED_TDLS_ENABLE
QDF_STATUS (*extract_vdev_tdls_ev_param)(wmi_unified_t wmi_handle,
void *evt_buf, struct tdls_event_info *param);
#endif
QDF_STATUS (*extract_mu_ev_param)(wmi_unified_t wmi_handle, void *evt_buf,
wmi_host_mu_report_event *param);
@@ -1479,42 +1550,14 @@ QDF_STATUS (*send_power_dbg_cmd)(wmi_unified_t wmi_handle,
QDF_STATUS (*send_multiple_vdev_restart_req_cmd)(wmi_unified_t wmi_handle,
struct multiple_vdev_restart_params *param);
QDF_STATUS (*send_adapt_dwelltime_params_cmd)(wmi_unified_t wmi_handle,
struct wmi_adaptive_dwelltime_params *dwelltime_params);
QDF_STATUS (*send_dbs_scan_sel_params_cmd)(wmi_unified_t wmi_handle,
struct wmi_dbs_scan_sel_params *dbs_scan_params);
QDF_STATUS (*send_fw_test_cmd)(wmi_unified_t wmi_handle,
struct set_fwtest_params *wmi_fwtest);
#ifdef WLAN_FEATURE_DISA
QDF_STATUS (*send_encrypt_decrypt_send_cmd)(wmi_unified_t wmi_handle,
struct disa_encrypt_decrypt_req_params *params);
QDF_STATUS (*extract_encrypt_decrypt_resp_event)(wmi_unified_t wmi_handle,
void *evt_buf,
struct disa_encrypt_decrypt_resp_params *resp);
#endif
#ifdef WLAN_FEATURE_ACTION_OUI
QDF_STATUS (*send_action_oui_cmd)(wmi_unified_t wmi_handle,
struct action_oui_request *req);
#endif /* WLAN_FEATURE_ACTION_OUI */
QDF_STATUS (*send_sar_limit_cmd)(wmi_unified_t wmi_handle,
struct sar_limit_cmd_params *params);
QDF_STATUS (*get_sar_limit_cmd)(wmi_unified_t wmi_handle);
QDF_STATUS (*extract_sar_limit_event)(wmi_unified_t wmi_handle,
uint8_t *evt_buf,
struct sar_limit_event *event);
QDF_STATUS (*extract_sar2_result_event)(void *handle,
uint8_t *event,
uint32_t len);
QDF_STATUS (*send_peer_rx_reorder_queue_setup_cmd)(wmi_unified_t wmi_handle,
struct rx_reorder_queue_setup_params *param);
@@ -1643,11 +1686,7 @@ uint32_t (*convert_pdev_id_target_to_host)(uint32_t pdev_id);
QDF_STATUS (*send_user_country_code_cmd)(wmi_unified_t wmi_handle,
uint8_t pdev_id, struct cc_regdmn_s *rd);
QDF_STATUS (*send_limit_off_chan_cmd)(wmi_unified_t wmi_handle,
struct wmi_limit_off_chan_param *limit_off_chan_param);
QDF_STATUS (*send_wow_timer_pattern_cmd)(wmi_unified_t wmi_handle,
uint8_t vdev_id, uint32_t cookie, uint32_t time);
QDF_STATUS (*send_wds_entry_list_cmd)(wmi_unified_t wmi_handle);
QDF_STATUS (*extract_wds_entry)(wmi_unified_t wmi_handle,
uint8_t *evt_buf,
@@ -1678,8 +1717,6 @@ QDF_STATUS (*extract_ndp_sch_update)(wmi_unified_t wmi_handle,
uint8_t *data, struct nan_datapath_sch_update_event *ind);
#endif /* WLAN_FEATURE_NAN_CONVERGENCE */
QDF_STATUS (*send_btm_config)(wmi_unified_t wmi_handle,
struct wmi_btm_config *params);
QDF_STATUS (*send_obss_detection_cfg_cmd)(wmi_unified_t wmi_handle,
struct wmi_obss_detection_cfg_param *obss_cfg_param);
QDF_STATUS (*extract_obss_detection_info)(uint8_t *evt_buf,
@@ -1708,12 +1745,6 @@ QDF_STATUS
void *evt_buf, uint32_t *vdev_id,
uint32_t *tx_status);
QDF_STATUS (*send_offload_11k_cmd)(wmi_unified_t wmi_handle,
struct wmi_11k_offload_params *params);
QDF_STATUS (*send_invoke_neighbor_report_cmd)(wmi_unified_t wmi_handle,
struct wmi_invoke_neighbor_report_params *params);
void (*wmi_pdev_id_conversion_enable)(wmi_unified_t wmi_handle);
void (*send_time_stamp_sync_cmd)(wmi_unified_t wmi_handle);
void (*wmi_free_allocated_event)(uint32_t cmd_event_id,
@@ -1725,13 +1756,7 @@ int (*wmi_check_and_pad_event)(void *os_handle, void *param_struc_ptr,
int (*wmi_check_command_params)(void *os_handle, void *param_struc_ptr,
uint32_t param_buf_len,
uint32_t wmi_cmd_event_id);
QDF_STATUS (*send_bss_color_change_enable_cmd)(wmi_unified_t wmi_handle,
uint32_t vdev_id,
bool enable);
QDF_STATUS (*send_obss_color_collision_cfg_cmd)(wmi_unified_t wmi_handle,
struct wmi_obss_color_collision_cfg_param *cfg);
QDF_STATUS (*extract_obss_color_collision_info)(uint8_t *evt_buf,
struct wmi_obss_color_collision_info *info);
#ifdef WLAN_SUPPORT_TWT
QDF_STATUS (*send_twt_enable_cmd)(wmi_unified_t wmi_handle,
struct wmi_twt_enable_param *params);
@@ -1989,6 +2014,181 @@ static inline void wmi_ap_attach_tlv(struct wmi_unified *wmi_handle)
}
#endif
#ifdef WLAN_FEATURE_DSRC
void wmi_ocb_attach_tlv(wmi_unified_t wmi_handle);
#else
static inline void wmi_ocb_attach_tlv(wmi_unified_t wmi_handle)
{
}
#endif
#ifdef WLAN_FEATURE_NAN_CONVERGENCE
void wmi_nan_attach_tlv(wmi_unified_t wmi_handle);
#else
static inline void wmi_nan_attach_tlv(wmi_unified_t wmi_handle)
{
}
#endif
#ifdef FEATURE_P2P_LISTEN_OFFLOAD
void wmi_p2p_listen_offload_attach_tlv(wmi_unified_t wmi_handle);
#else
static inline
void wmi_p2p_listen_offload_attach_tlv(wmi_unified_t wmi_handle)
{
}
#endif
#ifdef CONVERGED_P2P_ENABLE
void wmi_p2p_attach_tlv(wmi_unified_t wmi_handle);
#else
static inline void wmi_p2p_attach_tlv(struct wmi_unified *wmi_handle)
{
}
#endif
#ifdef FEATURE_LFR_SUBNET_DETECTION
void wmi_lfr_subnet_detection_attach_tlv(wmi_unified_t wmi_handle);
#else
static inline
void wmi_lfr_subnet_detection_attach_tlv(struct wmi_unified *wmi_handle)
{
}
#endif
#ifdef FEATURE_RSSI_MONITOR
void wmi_rssi_monitor_attach_tlv(wmi_unified_t wmi_handle);
#else
static inline
void wmi_rssi_monitor_attach_tlv(struct wmi_unified *wmi_handle)
{
}
#endif
#ifdef FEATURE_WLAN_ESE
void wmi_ese_attach_tlv(wmi_unified_t wmi_handle);
#else
static inline void wmi_ese_attach_tlv(struct wmi_unified *wmi_handle)
{
}
#endif
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
void wmi_roam_offload_attach_tlv(wmi_unified_t wmi_handle);
#else
static inline
void wmi_roam_offload_attach_tlv(struct wmi_unified *wmi_handle)
{
}
#endif
#ifdef WLAN_FEATURE_FILS_SK
void wmi_fils_sk_attach_tlv(wmi_unified_t wmi_handle);
#else
static inline void wmi_fils_sk_attach_tlv(struct wmi_unified *wmi_handle)
{
}
#endif
#ifdef WMI_ROAM_SUPPORT
void wmi_roam_attach_tlv(struct wmi_unified *wmi_handle);
#else
static inline void wmi_roam_attach_tlv(struct wmi_unified *wmi_handle)
{
}
#endif
#ifdef WMI_CONCURRENCY_SUPPORT
void wmi_concurrency_attach_tlv(struct wmi_unified *wmi_handle);
#else
static inline void wmi_concurrency_attach_tlv(struct wmi_unified *wmi_handle)
{
}
#endif
#ifdef FEATURE_WLAN_D0WOW
void wmi_d0wow_attach_tlv(struct wmi_unified *wmi_handle);
#else
static inline void wmi_d0wow_attach_tlv(struct wmi_unified *wmi_handle)
{
}
#endif
#ifdef FEATURE_WLAN_RA_FILTERING
void wmi_ra_filtering_attach_tlv(struct wmi_unified *wmi_handle);
#else
static inline
void wmi_ra_filtering_attach_tlv(struct wmi_unified *wmi_handle)
{
}
#endif
#ifdef FEATURE_WLAN_LPHB
void wmi_lphb_attach_tlv(struct wmi_unified *wmi_handle);
#else
static inline void wmi_lphb_attach_tlv(struct wmi_unified *wmi_handle)
{
}
#endif
#ifdef WLAN_FEATURE_PACKET_FILTERING
void wmi_packet_filtering_attach_tlv(struct wmi_unified *wmi_handle);
#else
static inline
void wmi_packet_filtering_attach_tlv(struct wmi_unified *wmi_handle)
{
}
#endif
#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
void wmi_extwow_attach_tlv(struct wmi_unified *wmi_handle);
#else
static inline void wmi_extwow_attach_tlv(struct wmi_unified *wmi_handle)
{
}
#endif
#ifdef WLAN_POWER_MANAGEMENT_OFFLOAD
void wmi_pmo_attach_tlv(struct wmi_unified *wmi_handle);
#else
static inline void wmi_pmo_attach_tlv(struct wmi_unified *wmi_handle)
{
}
#endif
#ifdef CONVERGED_TDLS_ENABLE
void wmi_tdls_attach_tlv(struct wmi_unified *wmi_handle);
#else
static inline void wmi_tdls_attach_tlv(struct wmi_unified *wmi_handle)
{
}
#endif
#ifdef WLAN_FEATURE_DISA
void wmi_disa_attach_tlv(struct wmi_unified *wmi_handle);
#else
static inline void wmi_disa_attach_tlv(struct wmi_unified *wmi_handle)
{
}
#endif
#ifdef WLAN_POLICY_MGR_ENABLE
void wmi_policy_mgr_attach_tlv(struct wmi_unified *wmi_handle);
#else
static inline
void wmi_policy_mgr_attach_tlv(struct wmi_unified *wmi_handle)
{
}
#endif
#ifdef WMI_STA_SUPPORT
void wmi_sta_attach_tlv(struct wmi_unified *wmi_handle);
#else
static inline void wmi_sta_attach_tlv(struct wmi_unified *wmi_handle)
{
}
#endif
/**
* wmi_align() - provides word aligned parameter
* @param: parameter to be aligned

View File

@@ -0,0 +1,324 @@
/*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: Implement API's specific to ROAMING component.
*/
#ifndef _WMI_UNIFIED_ROAM_API_H_
#define _WMI_UNIFIED_ROAM_API_H_
#include <wmi_unified_roam_param.h>
#ifdef FEATURE_LFR_SUBNET_DETECTION
/**
* 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: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures;
* error number otherwise
*/
QDF_STATUS wmi_unified_set_gateway_params_cmd(void *wmi_hdl,
struct gateway_update_req_param *req);
#endif
#ifdef FEATURE_RSSI_MONITOR
/**
* 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: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures;
* error number otherwise
*/
QDF_STATUS wmi_unified_set_rssi_monitoring_cmd(void *wmi_hdl,
struct rssi_monitor_param *req);
#endif
/**
* wmi_unified_roam_scan_offload_rssi_thresh_cmd() - set roam scan rssi
* parameters
* @wmi_hdl: wmi handle
* @roam_req: roam rssi related parameters
*
* This function reads the incoming @roam_req and fill in the destination
* WMI structure and send down the roam scan rssi configs down to the firmware
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_roam_scan_offload_rssi_thresh_cmd(void *wmi_hdl,
struct roam_offload_scan_rssi_params *roam_req);
/**
* wmi_unified_roam_mawc_params_cmd() - configure roaming MAWC parameters
* @wmi_hdl: wmi handle
* @params: Parameters to be configured
*
* Pass the MAWC(Motion Aided wireless connectivity) related roaming
* parameters from the host to the target
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_roam_mawc_params_cmd(void *wmi_hdl,
struct wmi_mawc_roam_params *params);
/**
* wmi_unified_roam_scan_filter_cmd() - send roam scan whitelist,
* blacklist and preferred list
* @wmi_hdl: wmi handle
* @roam_req: roam scan lists related parameters
*
* This function reads the incoming @roam_req and fill in the destination
* WMI structure and send down the different roam scan lists down to the fw
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_roam_scan_filter_cmd(void *wmi_hdl,
struct roam_scan_filter_params *roam_req);
#ifdef FEATURE_WLAN_ESE
/**
* wmi_unified_plm_stop_cmd() - plm stop request
* @wmi_hdl: wmi handle
* @plm: plm request parameters
*
* This function request FW to stop PLM.
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_plm_stop_cmd(void *wmi_hdl,
const struct plm_req_params *plm);
/**
* wmi_unified_plm_start_cmd() - plm start request
* @wmi_hdl: wmi handle
* @plm: plm request parameters
*
* This function request FW to start PLM.
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_plm_start_cmd(void *wmi_hdl,
const struct plm_req_params *plm,
uint32_t *gchannel_list);
#endif /* FEATURE_WLAN_ESE */
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
/* 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: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_set_ric_req_cmd(void *wmi_hdl, void *msg,
uint8_t is_add_ts);
/**
* wmi_unified_roam_synch_complete_cmd() - roam synch complete command to fw.
* @wmi_hdl: wmi handle
* @vdev_id: vdev id
*
* This function sends roam synch complete event to fw.
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_roam_synch_complete_cmd(void *wmi_hdl,
uint8_t vdev_id);
/**
* wmi_unified__roam_invoke_cmd() - send roam invoke command to fw.
* @wmi_hdl: wmi handle
* @roaminvoke: roam invoke command
*
* Send roam invoke command to fw for fastreassoc.
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_roam_invoke_cmd(void *wmi_hdl,
struct wmi_roam_invoke_cmd *roaminvoke,
uint32_t ch_hz);
#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
/**
* wmi_unified_roam_scan_offload_mode_cmd() - set roam scan parameters
* @wmi_hdl: wmi handle
* @scan_cmd_fp: scan related parameters
* @roam_req: roam related parameters
*
* This function reads the incoming @roam_req and fill in the destination
* WMI structure and send down the roam scan configs down to the firmware
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_roam_scan_offload_mode_cmd(void *wmi_hdl,
wmi_start_scan_cmd_fixed_param *scan_cmd_fp,
struct roam_offload_scan_params *roam_req);
/**
* wmi_unified_send_roam_scan_offload_ap_cmd() - set roam ap profile in fw
* @wmi_hdl: wmi handle
* @ap_profile: ap profile params
*
* Send WMI_ROAM_AP_PROFILE to firmware
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_send_roam_scan_offload_ap_cmd(void *wmi_hdl,
struct ap_profile_params *ap_profile);
/**
* wmi_unified_roam_scan_offload_cmd() - set roam offload command
* @wmi_hdl: wmi handle
* @command: command
* @vdev_id: vdev id
*
* This function set roam offload command to fw.
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_roam_scan_offload_cmd(void *wmi_hdl,
uint32_t command,
uint32_t vdev_id);
/**
* wmi_unified_roam_scan_offload_scan_period() - set roam offload scan period
* @wmi_handle: wmi handle
* @scan_period: scan period
* @scan_age: scan age
* @vdev_id: vdev id
*
* Send WMI_ROAM_SCAN_PERIOD parameters to fw.
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_roam_scan_offload_scan_period(void *wmi_hdl,
uint32_t scan_period,
uint32_t scan_age,
uint32_t vdev_id);
/**
* wmi_unified_roam_scan_offload_chan_list_cmd() - set roam offload channel list
* @wmi_handle: wmi handle
* @chan_count: channel count
* @chan_list: channel list
* @list_type: list type
* @vdev_id: vdev id
*
* Set roam offload channel list.
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_roam_scan_offload_chan_list_cmd(void *wmi_hdl,
uint8_t chan_count,
uint32_t *chan_list,
uint8_t list_type,
uint32_t vdev_id);
/**
* wmi_unified_roam_scan_offload_rssi_change_cmd() - set roam offload RSSI th
* @wmi_hdl: wmi handle
* @rssi_change_thresh: RSSI Change threshold
* @bcn_rssi_weight: beacon RSSI weight
* @vdev_id: vdev id
*
* Send WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD parameters to fw.
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_roam_scan_offload_rssi_change_cmd(void *wmi_hdl,
uint32_t vdev_id,
int32_t rssi_change_thresh,
uint32_t bcn_rssi_weight,
uint32_t hirssi_delay_btw_scans);
/**
* wmi_unified_set_per_roam_config() - set PER roam config in FW
* @wmi_hdl: wmi handle
* @req_buf: per roam config request buffer
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_set_per_roam_config(void *wmi_hdl,
struct wmi_per_roam_config_req *req_buf);
/**
* wmi_unified_send_limit_off_chan_cmd() - send wmi cmd of limit off channel
* configuration params
* @wmi_hdl: wmi handler
* @limit_off_chan_param: pointer to wmi_limit_off_chan_param
*
* Return: QDF_STATUS_SUCCESS on success and QDF failure reason code on failure
*/
QDF_STATUS wmi_unified_send_limit_off_chan_cmd(void *wmi_hdl,
struct wmi_limit_off_chan_param *wmi_param);
#ifdef WLAN_FEATURE_FILS_SK
/*
* wmi_unified_roam_send_hlp_cmd() -send HLP command info
* @wmi_hdl: wma handle
* @req_buf: Pointer to HLP params
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_roam_send_hlp_cmd(void *wmi_hdl,
struct hlp_params *req_buf);
#endif /* WLAN_FEATURE_FILS_SK */
/**
* wmi_unified_send_btm_config() - Send BTM config to fw
* @wmi_hdl: wmi handle
* @params: pointer to wmi_btm_config
*
* Return: QDF_STATUS
*/
QDF_STATUS wmi_unified_send_btm_config(void *wmi_hdl,
struct wmi_btm_config *params);
/**
* wmi_unified_offload_11k_cmd() - send 11k offload command
* @wmi_hdl: wmi handle
* @params: 11k offload params
*
* This function passes the 11k offload command params to FW
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_offload_11k_cmd(void *wmi_hdl,
struct wmi_11k_offload_params *params);
/**
* wmi_unified_invoke_neighbor_report_cmd() - send invoke neighbor report cmd
* @wmi_hdl: wmi handle
* @params: invoke neighbor report params
*
* This function passes the invoke neighbor report command to fw
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_invoke_neighbor_report_cmd(void *wmi_hdl,
struct wmi_invoke_neighbor_report_params *params);
#endif /* _WMI_UNIFIED_ROAM_API_H_ */

View File

@@ -0,0 +1,579 @@
/*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/*
* This file contains the API definitions for the ROAMING WMI APIs.
*/
#ifndef _WMI_UNIFIED_ROAM_PARAM_H_
#define _WMI_UNIFIED_ROAM_PARAM_H_
/**
* 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 qdf_mac_addr gw_mac_addr;
uint8_t ipv4_addr[QDF_IPV4_ADDR_SIZE];
uint8_t ipv6_addr[QDF_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 roam_offload_scan_rssi_params - structure containing
* parameters for roam offload scan based on RSSI
* @rssi_thresh: rssi threshold
* @rssi_thresh_diff: difference in rssi threshold
* @hi_rssi_scan_max_count: 5G scan max count
* @hi_rssi_scan_rssi_delta: 5G scan rssi change threshold value
* @hi_rssi_scan_rssi_ub: 5G scan upper bound
* @raise_rssi_thresh_5g: flag to determine penalty and boost thresholds
* @session_id: vdev id
* @penalty_threshold_5g: RSSI threshold below which 5GHz RSSI is penalized
* @boost_threshold_5g: RSSI threshold above which 5GHz RSSI is favored
* @raise_factor_5g: factor by which 5GHz RSSI is boosted
* @drop_factor_5g: factor by which 5GHz RSSI is penalized
* @max_raise_rssi_5g: maximum boost that can be applied to a 5GHz RSSI
* @max_drop_rssi_5g: maximum penalty that can be applied to a 5GHz RSSI
* @good_rssi_threshold: RSSI below which roam is kicked in by background
* scan although rssi is still good
* @roam_earlystop_thres_min: Minimum RSSI threshold value for early stop,
* unit is dB above NF
* @roam_earlystop_thres_max: Maximum RSSI threshold value for early stop,
* unit is dB above NF
* @dense_rssi_thresh_offset: dense roam RSSI threshold difference
* @dense_min_aps_cnt: dense roam minimum APs
* @initial_dense_status: dense status detected by host
* @traffic_threshold: dense roam RSSI threshold
* @bg_scan_bad_rssi_thresh: Bad RSSI threshold to perform bg scan
* @roam_bad_rssi_thresh_offset_2g: Offset from Bad RSSI threshold for 2G
* to 5G Roam
* @bg_scan_client_bitmap: Bitmap used to identify the client scans to snoop
* @flags: Flags for Background Roaming
* Bit 0 : BG roaming enabled when we connect to 2G AP only and roaming
* to 5G AP only.
* Bit 1-31: Reserved
*/
struct roam_offload_scan_rssi_params {
int8_t rssi_thresh;
uint8_t rssi_thresh_diff;
uint32_t hi_rssi_scan_max_count;
uint32_t hi_rssi_scan_rssi_delta;
int32_t hi_rssi_scan_rssi_ub;
int raise_rssi_thresh_5g;
uint8_t session_id;
uint32_t penalty_threshold_5g;
uint32_t boost_threshold_5g;
uint8_t raise_factor_5g;
uint8_t drop_factor_5g;
int max_raise_rssi_5g;
int max_drop_rssi_5g;
uint32_t good_rssi_threshold;
uint32_t roam_earlystop_thres_min;
uint32_t roam_earlystop_thres_max;
int dense_rssi_thresh_offset;
int dense_min_aps_cnt;
int initial_dense_status;
int traffic_threshold;
int32_t rssi_thresh_offset_5g;
int8_t bg_scan_bad_rssi_thresh;
uint8_t roam_bad_rssi_thresh_offset_2g;
uint32_t bg_scan_client_bitmap;
uint32_t flags;
};
/**
* struct wmi_mawc_roam_params - Motion Aided wireless connectivity params
* @vdev_id: VDEV on which the parameters should be applied
* @enable: MAWC roaming feature enable/disable
* @traffic_load_threshold: Traffic threshold in kBps for MAWC roaming
* @best_ap_rssi_threshold: AP RSSI Threshold for MAWC roaming
* @rssi_stationary_high_adjust: High RSSI adjustment value to suppress scan
* @rssi_stationary_low_adjust: Low RSSI adjustment value to suppress scan
*/
struct wmi_mawc_roam_params {
uint8_t vdev_id;
bool enable;
uint32_t traffic_load_threshold;
uint32_t best_ap_rssi_threshold;
uint8_t rssi_stationary_high_adjust;
uint8_t rssi_stationary_low_adjust;
};
#define MAX_SSID_ALLOWED_LIST 4
#define MAX_BSSID_AVOID_LIST 16
#define MAX_BSSID_FAVORED 16
#define MAX_RSSI_AVOID_BSSID_LIST 10
/**
* struct rssi_disallow_bssid - Structure holding Rssi based avoid candidate
* @bssid: BSSID of the AP
* @remaining_duration: remaining disallow duration in ms
* @expected_rssi: RSSI at which STA can initate in dBm
*/
struct rssi_disallow_bssid {
struct qdf_mac_addr bssid;
uint32_t remaining_duration;
int8_t expected_rssi;
};
/**
* struct roam_scan_filter_params - Structure holding roaming scan
* parameters
* @op_bitmap: bitmap to determine reason of roaming
* @session_id: vdev id
* @num_bssid_black_list: The number of BSSID's that we should
* avoid connecting to. It is like a
* blacklist of BSSID's.
* @num_ssid_white_list: The number of SSID profiles that are
* in the Whitelist. When roaming, we
* consider the BSSID's with this SSID
* also for roaming apart from the connected one's
* @num_bssid_preferred_list: Number of BSSID's which have a preference over
* others
* @bssid_avoid_list: Blacklist SSID's
* @ssid_allowed_list: Whitelist SSID's
* @bssid_favored: Favorable BSSID's
* @bssid_favored_factor: RSSI to be added to this BSSID to prefer it
* @lca_disallow_config_present: LCA [Last Connected AP] disallow config present
* @disallow_duration: How long LCA AP will be disallowed before it
* can be a roaming candidate again, in seconds
* @rssi_channel_penalization:How much RSSI will be penalized if candidate(s)
* are found in the same channel as disallowed AP's,
* in units of db
* @num_disallowed_aps: How many APs the target should maintain in its
* LCA list
*
* This structure holds all the key parameters related to
* initial connection and roaming connections.
*/
struct roam_scan_filter_params {
uint32_t op_bitmap;
uint8_t session_id;
uint32_t num_bssid_black_list;
uint32_t num_ssid_white_list;
uint32_t num_bssid_preferred_list;
struct qdf_mac_addr bssid_avoid_list[MAX_BSSID_AVOID_LIST];
struct mac_ssid ssid_allowed_list[MAX_SSID_ALLOWED_LIST];
struct qdf_mac_addr bssid_favored[MAX_BSSID_FAVORED];
uint8_t bssid_favored_factor[MAX_BSSID_FAVORED];
uint8_t lca_disallow_config_present;
uint32_t disallow_duration;
uint32_t rssi_channel_penalization;
uint32_t num_disallowed_aps;
uint32_t num_rssi_rejection_ap;
struct rssi_disallow_bssid rssi_rejection_ap[MAX_RSSI_AVOID_BSSID_LIST];
};
#define WMI_CFG_VALID_CHANNEL_LIST_LEN 100
/* Occupied channel list remains static */
#define WMI_CHANNEL_LIST_STATIC 1
/* Occupied channel list can be learnt after init */
#define WMI_CHANNEL_LIST_DYNAMIC_INIT 2
/* Occupied channel list can be learnt after flush */
#define WMI_CHANNEL_LIST_DYNAMIC_FLUSH 3
/* Occupied channel list can be learnt after update */
#define WMI_CHANNEL_LIST_DYNAMIC_UPDATE 4
/**
* 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 qdf_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;
};
/**
* struct ap_profile - Structure ap profile to match candidate
* @flags: flags
* @rssi_threshold: the value of the the candidate AP should higher by this
* threshold than the rssi of the currrently associated AP
* @ssid: ssid vlaue to be matched
* @rsn_authmode: security params to be matched
* @rsn_ucastcipherset: unicast cipher set
* @rsn_mcastcipherset: mcast/group cipher set
* @rsn_mcastmgmtcipherset: mcast/group management frames cipher set
* @rssi_abs_thresh: the value of the candidate AP should higher than this
* absolute RSSI threshold. Zero means no absolute minimum
* RSSI is required. units are the offset from the noise
* floor in dB
*/
struct ap_profile {
uint32_t flags;
uint32_t rssi_threshold;
struct mac_ssid ssid;
uint32_t rsn_authmode;
uint32_t rsn_ucastcipherset;
uint32_t rsn_mcastcipherset;
uint32_t rsn_mcastmgmtcipherset;
uint32_t rssi_abs_thresh;
};
/**
* struct rssi_scoring - rssi scoring param to sortlist selected AP
* @best_rssi_threshold: Roamable AP RSSI equal or better than this threshold,
* full rssi score 100. Units in dBm.
* @good_rssi_threshold: Below threshold, scoring linear percentage between
* rssi_good_pnt and 100. Units in dBm.
* @bad_rssi_threshold: Between good and bad rssi threshold, scoring linear
* % between rssi_bad_pcnt and rssi_good_pct in dBm.
* @good_rssi_pcnt: Used to assigned scoring percentage of each slot between
* best to good rssi threshold. Units in percentage.
* @bad_rssi_pcnt: Used to assigned scoring percentage of each slot between good
* to bad rssi threshold. Unites in percentage.
* @good_bucket_size : bucket size of slot in good zone
* @bad_bucket_size : bucket size of slot in bad zone
* @rssi_pref_5g_rssi_thresh: Below rssi threshold, 5G AP have given preference
* of band percentage. Units in dBm.
*/
struct rssi_scoring {
int32_t best_rssi_threshold;
int32_t good_rssi_threshold;
int32_t bad_rssi_threshold;
uint32_t good_rssi_pcnt;
uint32_t bad_rssi_pcnt;
uint32_t good_bucket_size;
uint32_t bad_bucket_size;
int32_t rssi_pref_5g_rssi_thresh;
};
/**
* struct param_slot_scoring - define % score for differents slots for a
* scoring param.
* @num_slot: number of slots in which the param will be divided.
* Max 15. index 0 is used for 'not_present. Num_slot will
* equally divide 100. e.g, if num_slot = 4 slot 0 = 0-25%, slot
* 1 = 26-50% slot 2 = 51-75%, slot 3 = 76-100%
* @score_pcnt3_to_0: Conatins score percentage for slot 0-3
* BITS 0-7 :- the scoring pcnt when not present
* BITS 8-15 :- SLOT_1
* BITS 16-23 :- SLOT_2
* BITS 24-31 :- SLOT_3
* @score_pcnt7_to_4: Conatins score percentage for slot 4-7
* BITS 0-7 :- SLOT_4
* BITS 8-15 :- SLOT_5
* BITS 16-23 :- SLOT_6
* BITS 24-31 :- SLOT_7
* @score_pcnt11_to_8: Conatins score percentage for slot 8-11
* BITS 0-7 :- SLOT_8
* BITS 8-15 :- SLOT_9
* BITS 16-23 :- SLOT_10
* BITS 24-31 :- SLOT_11
* @score_pcnt15_to_12: Conatins score percentage for slot 12-15
* BITS 0-7 :- SLOT_12
* BITS 8-15 :- SLOT_13
* BITS 16-23 :- SLOT_14
* BITS 24-31 :- SLOT_15
*/
struct param_slot_scoring {
uint32_t num_slot;
uint32_t score_pcnt3_to_0;
uint32_t score_pcnt7_to_4;
uint32_t score_pcnt11_to_8;
uint32_t score_pcnt15_to_12;
};
/**
* struct scoring_param - scoring param to sortlist selected AP
* @disable_bitmap: Each bit will be either allow(0)/disallow(1) to
* considered the roam score param.
* @rssi_weightage: RSSI weightage out of total score in %
* @ht_weightage: HT weightage out of total score in %.
* @vht_weightage: VHT weightage out of total score in %.
* @he_weightaget: 11ax weightage out of total score in %.
* @bw_weightage: Bandwidth weightage out of total score in %.
* @band_weightage: Band(2G/5G) weightage out of total score in %.
* @nss_weightage: NSS(1x1 / 2x2)weightage out of total score in %.
* @esp_qbss_weightage: ESP/QBSS weightage out of total score in %.
* @beamforming_weightage: Beamforming weightage out of total score in %.
* @pcl_weightage: PCL weightage out of total score in %.
* @oce_wan_weightage OCE WAN metrics weightage out of total score in %.
* @bw_index_score: channel BW scoring percentage information.
* BITS 0-7 :- It contains scoring percentage of 20MHz BW
* BITS 8-15 :- It contains scoring percentage of 40MHz BW
* BITS 16-23 :- It contains scoring percentage of 80MHz BW
* BITS 24-31 :- It contains scoring percentage of 1600MHz BW
* The value of each index must be 0-100
* @band_index_score: band scording percentage information.
* BITS 0-7 :- It contains scoring percentage of 2G
* BITS 8-15 :- It contains scoring percentage of 5G
* BITS 16-23 :- reserved
* BITS 24-31 :- reserved
* The value of each index must be 0-100
* @nss_index_score: NSS scoring percentage information.
* BITS 0-7 :- It contains scoring percentage of 1x1
* BITS 8-15 :- It contains scoring percentage of 2x2
* BITS 16-23 :- It contains scoring percentage of 3x3
* BITS 24-31 :- It contains scoring percentage of 4x4
* The value of each index must be 0-100
* @rssi_scoring: RSSI scoring information.
* @esp_qbss_scoring: ESP/QBSS scoring percentage information
* @oce_wan_scoring: OCE WAN metrics percentage information
*/
struct scoring_param {
uint32_t disable_bitmap;
int32_t rssi_weightage;
int32_t ht_weightage;
int32_t vht_weightage;
int32_t he_weightage;
int32_t bw_weightage;
int32_t band_weightage;
int32_t nss_weightage;
int32_t esp_qbss_weightage;
int32_t beamforming_weightage;
int32_t pcl_weightage;
int32_t oce_wan_weightage;
uint32_t bw_index_score;
uint32_t band_index_score;
uint32_t nss_index_score;
struct rssi_scoring rssi_scoring;
struct param_slot_scoring esp_qbss_scoring;
struct param_slot_scoring oce_wan_scoring;
};
/**
* struct ap_profile_params - ap profile params
* @vdev_id: vdev id
* @profile: ap profile to match candidate
* @param: scoring params to short candidate
*/
struct ap_profile_params {
uint8_t vdev_id;
struct ap_profile profile;
struct scoring_param param;
};
/**
* struct wmi_roam_invoke_cmd - roam invoke command
* @vdev_id: vdev id
* @bssid: mac address
* @channel: channel
* @frame_len: frame length, includs mac header, fixed params and ies
* @frame_buf: buffer contaning probe response or beacon
* @is_same_bssid: flag to indicate if roaming is requested for same bssid
*/
struct wmi_roam_invoke_cmd {
uint32_t vdev_id;
uint8_t bssid[IEEE80211_ADDR_LEN];
uint32_t channel;
uint32_t frame_len;
uint8_t *frame_buf;
uint8_t is_same_bssid;
};
/**
* struct wmi_per_roam_config - per based roaming parameters
* @enable: if PER based roaming is enabled/disabled
* @tx_high_rate_thresh: high rate threshold at which PER based
* roam will stop in tx path
* @rx_high_rate_thresh: high rate threshold at which PER based
* roam will stop in rx path
* @tx_low_rate_thresh: rate below which traffic will be considered
* for PER based roaming in Tx path
* @rx_low_rate_thresh: rate below which traffic will be considered
* for PER based roaming in Tx path
* @tx_rate_thresh_percnt: % above which when traffic is below low_rate_thresh
* will be considered for PER based scan in tx path
* @rx_rate_thresh_percnt: % above which when traffic is below low_rate_thresh
* will be considered for PER based scan in rx path
* @per_rest_time: time for which PER based roam will wait once it
* issues a roam scan.
* @tx_per_mon_time: Minimum time required to be considered as valid scenario
* for PER based roam in tx path
* @rx_per_mon_time: Minimum time required to be considered as valid scenario
* for PER based roam in rx path
* @min_candidate_rssi: Minimum RSSI threshold for candidate AP to be used for
* PER based roaming
*/
struct wmi_per_roam_config {
uint32_t enable;
uint32_t tx_high_rate_thresh;
uint32_t rx_high_rate_thresh;
uint32_t tx_low_rate_thresh;
uint32_t rx_low_rate_thresh;
uint32_t tx_rate_thresh_percnt;
uint32_t rx_rate_thresh_percnt;
uint32_t per_rest_time;
uint32_t tx_per_mon_time;
uint32_t rx_per_mon_time;
uint32_t min_candidate_rssi;
};
/**
* struct wmi_per_roam_config_req: PER based roaming config request
* @vdev_id: vdev id on which config needs to be set
* @per_config: PER config
*/
struct wmi_per_roam_config_req {
uint8_t vdev_id;
struct wmi_per_roam_config per_config;
};
/**
* struct wmi_limit_off_chan_param - limit off channel parameters
* @vdev_id: vdev id
* @status: status of the command (enable/disable)
* @max_offchan_time: max off channel time
* @rest_time: home channel time
* @skip_dfs_chans: skip dfs channels during scan
*/
struct wmi_limit_off_chan_param {
uint32_t vdev_id;
bool status;
uint32_t max_offchan_time;
uint32_t rest_time;
bool skip_dfs_chans;
};
#define WMI_MAX_HLP_IE_LEN 2048
/**
* struct hlp_params - HLP info params
* @vdev_id: vdev id
* @hlp_ie_len: HLP IE length
* @hlp_ie: HLP IE
*/
struct hlp_params {
uint8_t vdev_id;
uint32_t hlp_ie_len;
uint8_t hlp_ie[WMI_MAX_HLP_IE_LEN];
};
/**
* struct wmi_btm_config - BSS Transition Management offload params
* @vdev_id: VDEV on which the parameters should be applied
* @btm_offload_config: BTM config
* @btm_solicited_timeout: Timeout value for waiting BTM request
* @btm_max_attempt_cnt: Maximum attempt for sending BTM query to ESS
* @btm_sticky_time: Stick time after roaming to new AP by BTM
*/
struct wmi_btm_config {
uint8_t vdev_id;
uint32_t btm_offload_config;
uint32_t btm_solicited_timeout;
uint32_t btm_max_attempt_cnt;
uint32_t btm_sticky_time;
};
/**
* @time_offset: time offset after 11k offload command to trigger a neighbor
* report request (in seconds)
* @low_rssi_offset: Offset from rssi threshold to trigger a neighbor
* report request (in dBm)
* @bmiss_count_trigger: Number of beacon miss events to trigger neighbor
* report request
* @per_threshold_offset: offset from PER threshold to trigger neighbor
* report request (in %)
* @neighbor_report_cache_timeout: timeout after which new trigger can enable
* sending of a neighbor report request (in seconds)
* @max_neighbor_report_req_cap: max number of neighbor report requests that
* can be sent to the peer in the current session
* @ssid: Current connect SSID info
*/
struct wmi_11k_offload_neighbor_report_params {
uint32_t time_offset;
uint32_t low_rssi_offset;
uint32_t bmiss_count_trigger;
uint32_t per_threshold_offset;
uint32_t neighbor_report_cache_timeout;
uint32_t max_neighbor_report_req_cap;
struct mac_ssid ssid;
};
/**
* struct wmi_11k_offload_params - offload 11k features to FW
* @vdev_id: vdev id
* @offload_11k_bitmask: bitmask to specify offloaded features
* B0: Neighbor Report Request offload
* B1-B31: Reserved
* @neighbor_report_params: neighbor report offload params
*/
struct wmi_11k_offload_params {
uint32_t vdev_id;
uint32_t offload_11k_bitmask;
struct wmi_11k_offload_neighbor_report_params neighbor_report_params;
};
/**
* struct wmi_invoke_neighbor_report_params - Invoke neighbor report request
* from IW to FW
* @vdev_id: vdev id
* @send_resp_to_host: bool to send response to host or not
* @ssid: ssid given from the IW command
*/
struct wmi_invoke_neighbor_report_params {
uint32_t vdev_id;
uint32_t send_resp_to_host;
struct mac_ssid ssid;
};
#endif /* _WMI_UNIFIED_ROAM_PARAM_H_ */

View File

@@ -0,0 +1,461 @@
/*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: Implement API's specific to STA component.
*/
#ifndef _WMI_UNIFIED_STA_API_H_
#define _WMI_UNIFIED_STA_API_H_
#include "wlan_disa_public_struct.h"
#include "wlan_tdls_public_structs.h"
#include "wlan_policy_mgr_public_struct.h"
#include "wmi_unified_sta_param.h"
struct policy_mgr_dual_mac_config;
/**
* 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: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_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_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: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_set_sta_keep_alive_cmd(void *wmi_hdl,
struct sta_params *params);
/**
* 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: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_vdev_set_gtx_cfg_cmd(void *wmi_hdl, uint32_t if_id,
struct wmi_gtx_config *gtx_info);
#ifdef WLAN_FEATURE_DISA
/**
* wmi_unified_encrypt_decrypt_send_cmd() - send encryptdecrypt cmd to fw
* @wmi_hdl: wmi handle
* @params: encrypt/decrypt params
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_encrypt_decrypt_send_cmd(void *wmi_hdl,
struct disa_encrypt_decrypt_req_params *params);
/**
* wmi_extract_encrypt_decrypt_resp_params() -
* extract encrypt decrypt resp params from event buffer
* @wmi_handle: wmi handle
* @evt_buf: pointer to event buffer
* @resp: encrypt decrypt resp params
*
* Return: QDF_STATUS_SUCCESS for success or error code
*/
QDF_STATUS wmi_extract_encrypt_decrypt_resp_params(void *wmi_hdl,
uint8_t *evt_buf,
struct disa_encrypt_decrypt_resp_params *resp);
#endif /* WLAN_FEATURE_DISA */
/**
* wmi_unified_process_dhcp_ind() - process dhcp indication from SME
* @wmi_handle: wmi handle
* @ta_dhcp_ind: DHCP indication parameter
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_process_dhcp_ind(void *wmi_hdl,
wmi_peer_set_param_cmd_fixed_param *ta_dhcp_ind);
/**
* wmi_unified_get_link_speed_cmd() -send command to get linkspeed
* @wmi_handle: wmi handle
* @pLinkSpeed: link speed info
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_get_link_speed_cmd(void *wmi_hdl,
wmi_mac_addr peer_macaddr);
/**
* wmi_unified_fw_profiling_data_cmd() - send FW profiling cmd to WLAN FW
* @wmi_handl: wmi handle
* @cmd: Profiling command index
* @value1: parameter1 value
* @value2: parameter2 value
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_fw_profiling_data_cmd(void *wmi_hdl,
uint32_t cmd, uint32_t value1, uint32_t value2);
/**
* wmi_unified_nat_keepalive_en_cmd() - enable NAT keepalive filter
* @wmi_handle: wmi handle
* @vdev_id: vdev id
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_nat_keepalive_en_cmd(void *wmi_hdl, uint8_t vdev_id);
/**
* wmi_unified_set_latency_config_cmd()
* @wmi_handle: wmi handle
* @param: WLM parameters
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_wlm_latency_level_cmd(void *wmi_hdl,
struct wlm_latency_level_param *param);
/**
* wmi_unified_nan_req_cmd() - to send nan request to target
* @wmi_handle: wmi handle
* @nan_req: request data which will be non-null
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_nan_req_cmd(void *wmi_hdl,
struct nan_req_params *nan_req);
/**
* wmi_unified_process_set_ie_info_cmd() - Function to send IE info to firmware
* @wmi_handle: Pointer to WMi handle
* @ie_data: Pointer for ie data
*
* This function sends IE information to firmware
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_process_set_ie_info_cmd(void *wmi_hdl,
struct vdev_ie_info_param *ie_info);
/**
* wmi_unified_set_base_macaddr_indicate_cmd() - set base mac address in fw
* @wmi_hdl: wmi handle
* @custom_addr: base mac address
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_set_base_macaddr_indicate_cmd(void *wmi_hdl,
uint8_t *custom_addr);
#ifdef CONVERGED_TDLS_ENABLE
/**
* wmi_unified_set_tdls_offchan_mode_cmd() - set tdls off channel mode
* @wmi_handle: wmi handle
* @chan_switch_params: Pointer to tdls channel switch parameter structure
*
* This function sets tdls off channel mode
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures;
* Negative errno otherwise
*/
QDF_STATUS wmi_unified_set_tdls_offchan_mode_cmd(void *wmi_hdl,
struct tdls_channel_switch_params *chan_switch_params);
/**
* wmi_unified_update_fw_tdls_state_cmd() - send enable/disable tdls for a vdev
* @wmi_handle: wmi handle
* @pwmaTdlsparams: TDLS params
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_update_fw_tdls_state_cmd(void *wmi_hdl,
void *tdls_param,
uint8_t tdls_state);
/**
* wmi_unified_update_tdls_peer_state_cmd() - update TDLS peer state
* @wmi_handle: wmi handle
* @peerStateParams: TDLS peer state params
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_update_tdls_peer_state_cmd(void *wmi_hdl,
struct tdls_peer_state_params *peerStateParams,
uint32_t *ch_mhz);
/**
* wmi_extract_vdev_tdls_ev_param - extract vdev tdls param from event
* @wmi_handle: wmi handle
* @param evt_buf: pointer to event buffer
* @param param: Pointer to hold vdev tdls param
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_extract_vdev_tdls_ev_param(void *wmi_hdl, void *evt_buf,
struct tdls_event_info *param);
#endif /* CONVERGED_TDLS_ENABLE */
/**
* wmi_unified_send_sar_limit_cmd() - send sar limit cmd to fw
* @wmi_hdl: wmi handle
* @params: sar limit command params
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_send_sar_limit_cmd(void *wmi_hdl,
struct sar_limit_cmd_params *params);
/**
* wmi_unified_get_sar_limit_cmd() - request current SAR limits from FW
* @wmi_hdl: wmi handle
*
* Return: QDF_STATUS_SUCCESS for success or error code
*/
QDF_STATUS wmi_unified_get_sar_limit_cmd(void *wmi_hdl);
/**
* wmi_unified_extract_sar_limit_event() - extract SAR limits from FW event
* @wmi_hdl: wmi handle
* @evt_buf: event buffer received from firmware
* @event: SAR limit event which is to be populated by data extracted from
* the @evt_buf buffer
*
* Return: QDF_STATUS_SUCCESS for success or error code
*/
QDF_STATUS wmi_unified_extract_sar_limit_event(void *wmi_hdl,
uint8_t *evt_buf,
struct sar_limit_event *event);
/**
* wmi_unified_extract_sar2_result_event() - extract SAR limits from FW event
* @handle: wmi handle
* @event: event buffer received from firmware
* @len: length of the event buffer
*
* Return: QDF_STATUS_SUCCESS for success or error code
*/
QDF_STATUS wmi_unified_extract_sar2_result_event(void *handle,
uint8_t *event, uint32_t len);
/*
* wmi_unified_set_del_pmkid_cache() - set delete PMKID
* @wmi_hdl: wma handle
* @pmksa: pointer to pmk cache entry
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_set_del_pmkid_cache(void *wmi_hdl,
struct wmi_unified_pmk_cache *pmksa);
/**
* wmi_unified_del_ts_cmd() - send DELTS request to fw
* @wmi_handle: wmi handle
* @msg: delts params
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_del_ts_cmd(void *wmi_hdl, uint8_t vdev_id,
uint8_t ac);
/**
* wmi_unified_aggr_qos_cmd() - send aggr qos request to fw
* @wmi_handle: handle to wmi
* @aggr_qos_rsp_msg - combined struct for all ADD_TS requests.
*
* A function to handle WMI_AGGR_QOS_REQ. This will send out
* ADD_TS requestes to firmware in loop for all the ACs with
* active flow.
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_aggr_qos_cmd(void *wmi_hdl,
struct aggr_add_ts_param *aggr_qos_rsp_msg);
/**
* wmi_unified_add_ts_cmd() - send ADDTS request to fw
* @wmi_handle: wmi handle
* @msg: ADDTS params
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_add_ts_cmd(void *wmi_hdl,
struct add_ts_param *msg);
/**
* wmi_unified_process_add_periodic_tx_ptrn_cmd - add periodic tx ptrn
* @wmi_handle: wmi handle
* @pAddPeriodicTxPtrnParams: tx ptrn params
*
* Retrun: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_process_add_periodic_tx_ptrn_cmd(void *wmi_hdl,
struct periodic_tx_pattern *
pAddPeriodicTxPtrnParams,
uint8_t vdev_id);
/**
* wmi_unified_process_del_periodic_tx_ptrn_cmd - del periodic tx ptrn
* @wmi_handle: wmi handle
* @vdev_id: vdev id
* @pattern_id: pattern id
*
* Retrun: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_process_del_periodic_tx_ptrn_cmd(void *wmi_hdl,
uint8_t vdev_id,
uint8_t pattern_id);
/**
* wmi_unified_set_auto_shutdown_timer_cmd() - sets auto shutdown
* timer in firmware
* @wmi_handle: wmi handle
* @timer_val: auto shutdown timer value
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_set_auto_shutdown_timer_cmd(void *wmi_hdl,
uint32_t timer_val);
/**
* wmi_unified_set_led_flashing_cmd() - set led flashing in fw
* @wmi_hdl: wmi handle
* @flashing: flashing request
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_set_led_flashing_cmd(void *wmi_hdl,
struct flashing_req_params *flashing);
/**
* wmi_unified_process_ch_avoid_update_cmd() - handles channel avoid
* update request
* @wmi_handle: wmi handle
* @ch_avoid_update_req: channel avoid update params
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_process_ch_avoid_update_cmd(void *wmi_hdl);
/**
* wmi_unified_pdev_set_pcl_cmd() - Send WMI_SOC_SET_PCL_CMDID to FW
* @wmi_hdl: wmi handle
* @msg: PCL structure containing the PCL and the number of channels
*
* WMI_SOC_SET_PCL_CMDID provides a Preferred Channel List (PCL) to the WLAN
* firmware. The DBS Manager is the consumer of this information in the WLAN
* firmware. The channel list will be used when a Virtual DEVice (VDEV) needs
* to migrate to a new channel without host driver involvement. An example of
* this behavior is Legacy Fast Roaming (LFR 3.0). Generally, the host will
* manage the channel selection without firmware involvement.
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_pdev_set_pcl_cmd(void *wmi_hdl,
struct wmi_pcl_chan_weights *msg);
/**
* wmi_unified_soc_set_hw_mode_cmd() - Send WMI_SOC_SET_HW_MODE_CMDID to FW
* @wmi_hdl: wmi handle
* @msg: Structure containing the following parameters
*
* - hw_mode_index: The HW_Mode field is a enumerated type that is selected
* from the HW_Mode table, which is returned in the WMI_SERVICE_READY_EVENTID.
*
* Provides notification to the WLAN firmware that host driver is requesting a
* HardWare (HW) Mode change. This command is needed to support iHelium in the
* configurations that include the Dual Band Simultaneous (DBS) feature.
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_soc_set_hw_mode_cmd(void *wmi_hdl,
uint32_t hw_mode_index);
#ifdef WLAN_POLICY_MGR_ENABLE
/**
* wmi_unified_pdev_set_dual_mac_config_cmd() - Set dual mac config to FW
* @wmi_hdl: wmi handle
* @msg: Dual MAC config parameters
*
* Configures WLAN firmware with the dual MAC features
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures.
*/
QDF_STATUS wmi_unified_pdev_set_dual_mac_config_cmd(void *wmi_hdl,
struct policy_mgr_dual_mac_config *msg);
#endif /* WLAN_POLICY_MGR_ENABLE */
/**
* wmi_unified_send_adapt_dwelltime_params_cmd() - send wmi cmd of
* adaptive dwelltime configuration params
* @wma_handle: wma handler
* @dwelltime_params: pointer to dwelltime_params
*
* Return: QDF_STATUS_SUCCESS on success and QDF failure reason code for failure
*/
QDF_STATUS wmi_unified_send_adapt_dwelltime_params_cmd(void *wmi_hdl,
struct wmi_adaptive_dwelltime_params *
wmi_param);
/**
* wmi_unified_send_dbs_scan_sel_params_cmd() - send wmi cmd of
* DBS scan selection configuration params
* @wma_handle: wma handler
* @dbs_scan_params: pointer to wmi_dbs_scan_sel_params
*
* Return: QDF_STATUS_SUCCESS on success and QDF failure reason code for failure
*/
QDF_STATUS wmi_unified_send_dbs_scan_sel_params_cmd(void *wmi_hdl,
struct wmi_dbs_scan_sel_params *wmi_param);
/**
* wmi_unified_set_arp_stats_req() - set arp stats request
* @wmi_hdl: wmi handle
* @req_buf: pointer to set_arp_stats
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_set_arp_stats_req(void *wmi_hdl,
struct set_arp_stats *req_buf);
/**
* wmi_unified_get_arp_stats_req() - get arp stats request
* @wmi_hdl: wmi handle
* @req_buf: pointer to get_arp_stats
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_get_arp_stats_req(void *wmi_hdl,
struct get_arp_stats *req_buf);
#endif /* _WMI_UNIFIED_STA_API_H_ */

View File

@@ -0,0 +1,464 @@
/*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/*
* This file contains the API definitions for the STA WMI APIs.
*/
#ifndef _WMI_UNIFIED_STA_PARAM_H_
#define _WMI_UNIFIED_STA_PARAM_H_
/**
* 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 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 wlm_latency_level_param - WLM parameters
* @wlm_latency_level: wlm latency level to set
* 0 - normal, 1 - moderate, 2 - low, 3 - ultralow
* @wlm_latency_flags: wlm latency flags to set
* |31 12| 11 | 10 |9 8|7 6|5 4|3 2| 1 | 0 |
* +------+------+------+------+------+------+------+-----+-----+
* | RSVD | SSLP | CSLP | RSVD | Roam | RSVD | DWLT | DFS | SUP |
* +------+-------------+-------------+-------------------------+
* | WAL | PS | Roam | Scan |
*
* bit 0: Avoid scan request from HLOS if setting
* bit 1: Skip DFS channel SCAN if setting
* bit 2-3: Define policy of dwell time/duration for each foreign channel
* (b2 b3)
* (0 0 ): Default scan dwell time
* (0 1 ): Reserve
* (1 0 ): Shrink off channel dwell time
* (1 1 ): Reserve
* bit 4-5: Reserve for scan
* bit 6-7: Define roaming policy
* (b6 b7)
* (0 0 ): Default roaming behavior, allow roaming in all scenarios
* (0 1 ): Disallow all roaming
* (1 0 ): Allow roaming when final bmissed
* (1 1 ): Reserve
* bit 8-9: Reserve for roaming
* bit 10: Disable css power collapse if setting
* bit 11: Disable sys sleep if setting
* bit 12-31: Reserve for future useage
* @vdev_id: vdev id
*/
struct wlm_latency_level_param {
uint16_t wlm_latency_level;
uint32_t wlm_latency_flags;
uint16_t vdev_id;
};
/**
* 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[];
};
#ifndef CONVERGED_TDLS_ENABLE
/**
* 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[IEEE80211_ADDR_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;
};
#endif
#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[IEEE80211_ADDR_LEN];
uint32_t peerState;
struct tdls_peer_cap_params peerCap;
};
/**
* 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;
uint32_t ie_source;
uint32_t band;
uint8_t *data;
};
#define MAX_SAR_LIMIT_ROWS_SUPPORTED 64
/**
* struct sar_limit_cmd_row - sar limits row
* @band_id: Optional param for frequency band
* See %enum wmi_sar_band_id_flags for possible values
* @chain_id: Optional param for antenna chain id
* @mod_id: Optional param for modulation scheme
* See %enum wmi_sar_mod_id_flags for possible values
* @limit_value: Mandatory param providing power limits in steps of 0.5 dbm
* @validity_bitmap: bitmap of valid optional params in sar_limit_cmd_row struct
* See WMI_SAR_*_VALID_MASK for possible values
*/
struct sar_limit_cmd_row {
uint32_t band_id;
uint32_t chain_id;
uint32_t mod_id;
uint32_t limit_value;
uint32_t validity_bitmap;
};
/**
* struct sar_limit_cmd_params - sar limits params
* @sar_enable: flag to enable SAR
* See %enum wmi_sar_feature_state_flags for possible values
* @num_limit_rows: number of items in sar_limits
* @commit_limits: indicates firmware to start apply new SAR values
* @sar_limit_row_list: pointer to array of sar limit rows
*/
struct sar_limit_cmd_params {
uint32_t sar_enable;
uint32_t num_limit_rows;
uint32_t commit_limits;
struct sar_limit_cmd_row *sar_limit_row_list;
};
/**
* struct sar_limit_event_row - sar limits row
* @band_id: Frequency band.
* See %enum wmi_sar_band_id_flags for possible values
* @chain_id: Chain id
* @mod_id: Modulation scheme
* See %enum wmi_sar_mod_id_flags for possible values
* @limit_value: Power limits in steps of 0.5 dbm that is currently active for
* the given @band_id, @chain_id, and @mod_id
*/
struct sar_limit_event_row {
uint32_t band_id;
uint32_t chain_id;
uint32_t mod_id;
uint32_t limit_value;
};
/**
* struct sar_limit_event - sar limits params
* @sar_enable: Current status of SAR enablement.
* See %enum wmi_sar_feature_state_flags for possible values
* @num_limit_rows: number of items in sar_limits
* @sar_limit_row: array of sar limit rows. Only @num_limit_rows
* should be considered valid.
*/
struct sar_limit_event {
uint32_t sar_enable;
uint32_t num_limit_rows;
struct sar_limit_event_row
sar_limit_row[MAX_SAR_LIMIT_ROWS_SUPPORTED];
};
#define WMI_UNIFIED_MAX_PMKID_LEN 16
#define WMI_UNIFIED_MAX_PMK_LEN 64
/**
* struct wmi_unified_pmk_cache - used to set del pmkid cache
* @tlv_header: TLV header, TLV tag and len; tag equals WMITLV_TAG_ARRAY_UINT32
* @pmk_len: PMK len
* for big-endian hosts, manual endian conversion will be needed to keep
* the array values in their original order in spite of the automatic
* byte-swap applied to WMI messages during download
* @pmk: PMK array
* @pmkid_len: PMK ID Len
* @pmkid: PMK ID Array
* @bssid: BSSID
* @ssid: SSID
* @cache_id: PMK Cache ID
* @cat_flag: whether (bssid) or (ssid,cache_id) is valid
* @action_flag: add/delete the entry
*/
struct wmi_unified_pmk_cache {
uint32_t tlv_header;
uint32_t pmk_len;
uint8_t session_id;
uint8_t pmk[WMI_UNIFIED_MAX_PMK_LEN];
uint32_t pmkid_len;
uint8_t pmkid[WMI_UNIFIED_MAX_PMKID_LEN];
wmi_host_mac_addr bssid;
struct mac_ssid ssid;
uint32_t cache_id;
uint32_t cat_flag;
uint32_t action_flag;
};
#define WMI_QOS_NUM_AC_MAX 4
/**
* 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
* @vdev_id: vdev id
*/
struct aggr_add_ts_param {
uint16_t staIdx;
uint16_t tspecIdx;
struct mac_tspec_ie tspec[WMI_QOS_NUM_AC_MAX];
QDF_STATUS status[WMI_QOS_NUM_AC_MAX];
uint8_t sessionId;
uint8_t vdev_id;
};
#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 qdf_mac_addr mac_address;
uint8_t ucPtrnId;
uint16_t ucPtrnSize;
uint32_t usPtrnIntervalMs;
uint8_t ucPattern[WMI_PERIODIC_TX_PTRN_MAX_SIZE];
};
/**
* 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;
};
#define MAX_NUM_CHAN 128
/**
* struct wmi_pcl_chan_weights - Params to get the valid weighed list
* @pcl_list: Preferred channel list already sorted in the order of preference
* @pcl_len: Length of the PCL
* @saved_chan_list: Valid channel list updated as part of
* WMA_UPDATE_CHAN_LIST_REQ
* @saved_num_chan: Length of the valid channel list
* @weighed_valid_list: Weights of the valid channel list. This will have one
* to one mapping with valid_chan_list. FW expects channel order and size to be
* as per the list provided in WMI_SCAN_CHAN_LIST_CMDID.
* @weight_list: Weights assigned by policy manager
*/
struct wmi_pcl_chan_weights {
uint8_t pcl_list[MAX_NUM_CHAN];
uint32_t pcl_len;
uint8_t saved_chan_list[MAX_NUM_CHAN];
uint32_t saved_num_chan;
uint8_t weighed_valid_list[MAX_NUM_CHAN];
uint8_t weight_list[MAX_NUM_CHAN];
};
/**
* struct wmi_adaptive_dwelltime_params - the adaptive dwelltime params
* @vdev_id: vdev id
* @is_enabled: Adaptive dwell time is enabled/disabled
* @dwelltime_mode: global default adaptive dwell mode
* @lpf_weight: weight to calculate the average low pass
* filter for channel congestion
* @passive_mon_intval: intval to monitor wifi activity in passive scan in msec
* @wifi_act_threshold: % of wifi activity used in passive scan 0-100
*
*/
struct wmi_adaptive_dwelltime_params {
uint32_t vdev_id;
bool is_enabled;
enum scan_dwelltime_adaptive_mode dwelltime_mode;
uint8_t lpf_weight;
uint8_t passive_mon_intval;
uint8_t wifi_act_threshold;
};
#define WMI_SCAN_CLIENT_MAX 7
/**
* struct wmi_dbs_scan_sel_params - DBS scan selection params
* @num_clients: Number of scan clients dutycycle
* @pdev_id: pdev_id for identifying the MAC
* @module_id: scan client module id
* @num_dbs_scans: number of DBS scans
* @num_non_dbs_scans: number of non-DBS scans
*/
struct wmi_dbs_scan_sel_params {
uint32_t num_clients;
uint32_t pdev_id;
uint32_t module_id[WMI_SCAN_CLIENT_MAX];
uint32_t num_dbs_scans[WMI_SCAN_CLIENT_MAX];
uint32_t num_non_dbs_scans[WMI_SCAN_CLIENT_MAX];
};
/**
* struct set_arp_stats - set/reset arp stats
* @vdev_id: session id
* @flag: enable/disable stats
* @pkt_type: type of packet(1 - arp)
* @ip_addr: subnet ipv4 address in case of encrypted packets
* @pkt_type_bitmap: pkt bitmap
* @tcp_src_port: tcp src port for pkt tracking
* @tcp_dst_port: tcp dst port for pkt tracking
* @icmp_ipv4: target ipv4 address to track ping packets
* @reserved: reserved
*/
struct set_arp_stats {
uint32_t vdev_id;
uint8_t flag;
uint8_t pkt_type;
uint32_t ip_addr;
uint32_t pkt_type_bitmap;
uint32_t tcp_src_port;
uint32_t tcp_dst_port;
uint32_t icmp_ipv4;
uint32_t reserved;
};
/**
* struct get_arp_stats - get arp stats from firmware
* @pkt_type: packet type(1 - ARP)
* @vdev_id: session id
*/
struct get_arp_stats {
uint8_t pkt_type;
uint32_t vdev_id;
};
#endif /* _WMI_UNIFIED_STA_PARAM_H_ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,65 @@
/*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: Implement API's specific to concurrency component.
*/
#include <wmi_unified_priv.h>
#include <wmi_unified_concurrency_api.h>
QDF_STATUS wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd(
void *wmi_hdl, uint32_t mcc_adaptive_scheduler,
uint32_t pdev_id)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_set_enable_disable_mcc_adaptive_scheduler_cmd)
return wmi_handle->ops->send_set_enable_disable_mcc_adaptive_scheduler_cmd(wmi_handle,
mcc_adaptive_scheduler, pdev_id);
return QDF_STATUS_E_FAILURE;
}
QDF_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;
if (wmi_handle->ops->send_set_mcc_channel_time_latency_cmd)
return wmi_handle->ops->send_set_mcc_channel_time_latency_cmd(wmi_handle,
mcc_channel_freq,
mcc_channel_time_latency);
return QDF_STATUS_E_FAILURE;
}
QDF_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;
if (wmi_handle->ops->send_set_mcc_channel_time_quota_cmd)
return wmi_handle->ops->send_set_mcc_channel_time_quota_cmd(wmi_handle,
adapter_1_chan_freq,
adapter_1_quota,
adapter_2_chan_freq);
return QDF_STATUS_E_FAILURE;
}

View File

@@ -0,0 +1,242 @@
/*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include <osdep.h>
#include <wmi.h>
#include <wmi_unified_priv.h>
#include <wmi_unified_concurrency_api.h>
/**
* send_set_enable_disable_mcc_adaptive_scheduler_cmd_tlv() -enable/disable
* mcc scheduler
* @wmi_handle: wmi handle
* @mcc_adaptive_scheduler: enable/disable
*
* This function enable/disable mcc adaptive scheduler in fw.
*
* Return: QDF_STATUS_SUCCESS for success or error code
*/
static QDF_STATUS send_set_enable_disable_mcc_adaptive_scheduler_cmd_tlv(
wmi_unified_t wmi_handle, uint32_t mcc_adaptive_scheduler,
uint32_t pdev_id)
{
QDF_STATUS ret;
wmi_buf_t buf = 0;
wmi_resmgr_adaptive_ocs_enable_disable_cmd_fixed_param *cmd = NULL;
uint16_t len =
sizeof(wmi_resmgr_adaptive_ocs_enable_disable_cmd_fixed_param);
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
return QDF_STATUS_E_NOMEM;
}
cmd = (wmi_resmgr_adaptive_ocs_enable_disable_cmd_fixed_param *)
wmi_buf_data(buf);
WMITLV_SET_HDR(&cmd->tlv_header,
WMITLV_TAG_STRUC_wmi_resmgr_adaptive_ocs_enable_disable_cmd_fixed_param,
WMITLV_GET_STRUCT_TLVLEN
(wmi_resmgr_adaptive_ocs_enable_disable_cmd_fixed_param));
cmd->enable = mcc_adaptive_scheduler;
cmd->pdev_id = wmi_handle->ops->convert_pdev_id_host_to_target(pdev_id);
wmi_mtrace(WMI_RESMGR_ADAPTIVE_OCS_ENABLE_DISABLE_CMDID, NO_SESSION, 0);
ret = wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_RESMGR_ADAPTIVE_OCS_ENABLE_DISABLE_CMDID);
if (QDF_IS_STATUS_ERROR(ret)) {
WMI_LOGP("%s: Failed to send enable/disable MCC"
" adaptive scheduler command", __func__);
wmi_buf_free(buf);
}
return ret;
}
/**
* send_set_mcc_channel_time_latency_cmd_tlv() -set MCC channel time latency
* @wmi: wmi handle
* @mcc_channel: mcc channel
* @mcc_channel_time_latency: MCC channel time latency.
*
* Currently used to set time latency for an MCC vdev/adapter using operating
* channel of it and channel number. The info is provided run time using
* iwpriv command: iwpriv <wlan0 | p2p0> setMccLatency <latency in ms>.
*
* Return: CDF status
*/
static QDF_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)
{
QDF_STATUS ret;
wmi_buf_t buf = 0;
wmi_resmgr_set_chan_latency_cmd_fixed_param *cmdTL = NULL;
uint16_t len = 0;
uint8_t *buf_ptr = NULL;
wmi_resmgr_chan_latency chan_latency;
/* Note: we only support MCC time latency for a single channel */
uint32_t num_channels = 1;
uint32_t chan1_freq = mcc_channel_freq;
uint32_t latency_chan1 = mcc_channel_time_latency;
/* If 0ms latency is provided, then FW will set to a default.
* Otherwise, latency must be at least 30ms.
*/
if ((latency_chan1 > 0) &&
(latency_chan1 < WMI_MCC_MIN_NON_ZERO_CHANNEL_LATENCY)) {
WMI_LOGE("%s: Invalid time latency for Channel #1 = %dms "
"Minimum is 30ms (or 0 to use default value by "
"firmware)", __func__, latency_chan1);
return QDF_STATUS_E_INVAL;
}
/* Set WMI CMD for channel time latency here */
len = sizeof(wmi_resmgr_set_chan_latency_cmd_fixed_param) +
WMI_TLV_HDR_SIZE + /*Place holder for chan_time_latency array */
num_channels * sizeof(wmi_resmgr_chan_latency);
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
return QDF_STATUS_E_NOMEM;
}
buf_ptr = (uint8_t *) wmi_buf_data(buf);
cmdTL = (wmi_resmgr_set_chan_latency_cmd_fixed_param *)
wmi_buf_data(buf);
WMITLV_SET_HDR(&cmdTL->tlv_header,
WMITLV_TAG_STRUC_wmi_resmgr_set_chan_latency_cmd_fixed_param,
WMITLV_GET_STRUCT_TLVLEN
(wmi_resmgr_set_chan_latency_cmd_fixed_param));
cmdTL->num_chans = num_channels;
/* Update channel time latency information for home channel(s) */
buf_ptr += sizeof(*cmdTL);
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE,
num_channels * sizeof(wmi_resmgr_chan_latency));
buf_ptr += WMI_TLV_HDR_SIZE;
chan_latency.chan_mhz = chan1_freq;
chan_latency.latency = latency_chan1;
qdf_mem_copy(buf_ptr, &chan_latency, sizeof(chan_latency));
wmi_mtrace(WMI_RESMGR_SET_CHAN_LATENCY_CMDID, NO_SESSION, 0);
ret = wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_RESMGR_SET_CHAN_LATENCY_CMDID);
if (QDF_IS_STATUS_ERROR(ret)) {
WMI_LOGE("%s: Failed to send MCC Channel Time Latency command",
__func__);
wmi_buf_free(buf);
QDF_ASSERT(0);
}
return ret;
}
/**
* send_set_mcc_channel_time_quota_cmd_tlv() -set MCC channel time quota
* @wmi: wmi handle
* @adapter_1_chan_number: adapter 1 channel number
* @adapter_1_quota: adapter 1 quota
* @adapter_2_chan_number: adapter 2 channel number
*
* Return: CDF status
*/
static QDF_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)
{
QDF_STATUS ret;
wmi_buf_t buf = 0;
uint16_t len = 0;
uint8_t *buf_ptr = NULL;
wmi_resmgr_set_chan_time_quota_cmd_fixed_param *cmdTQ = NULL;
wmi_resmgr_chan_time_quota chan_quota;
uint32_t quota_chan1 = adapter_1_quota;
/* Knowing quota of 1st chan., derive quota for 2nd chan. */
uint32_t quota_chan2 = 100 - quota_chan1;
/* Note: setting time quota for MCC requires info for 2 channels */
uint32_t num_channels = 2;
uint32_t chan1_freq = adapter_1_chan_freq;
uint32_t chan2_freq = adapter_2_chan_freq;
WMI_LOGD("%s: freq1:%dMHz, Quota1:%dms, "
"freq2:%dMHz, Quota2:%dms", __func__,
chan1_freq, quota_chan1, chan2_freq,
quota_chan2);
/*
* Perform sanity check on time quota values provided.
*/
if (quota_chan1 < WMI_MCC_MIN_CHANNEL_QUOTA ||
quota_chan1 > WMI_MCC_MAX_CHANNEL_QUOTA) {
WMI_LOGE("%s: Invalid time quota for Channel #1=%dms. Minimum "
"is 20ms & maximum is 80ms", __func__, quota_chan1);
return QDF_STATUS_E_INVAL;
}
/* Set WMI CMD for channel time quota here */
len = sizeof(wmi_resmgr_set_chan_time_quota_cmd_fixed_param) +
WMI_TLV_HDR_SIZE + /* Place holder for chan_time_quota array */
num_channels * sizeof(wmi_resmgr_chan_time_quota);
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
return QDF_STATUS_E_NOMEM;
}
buf_ptr = (uint8_t *) wmi_buf_data(buf);
cmdTQ = (wmi_resmgr_set_chan_time_quota_cmd_fixed_param *)
wmi_buf_data(buf);
WMITLV_SET_HDR(&cmdTQ->tlv_header,
WMITLV_TAG_STRUC_wmi_resmgr_set_chan_time_quota_cmd_fixed_param,
WMITLV_GET_STRUCT_TLVLEN
(wmi_resmgr_set_chan_time_quota_cmd_fixed_param));
cmdTQ->num_chans = num_channels;
/* Update channel time quota information for home channel(s) */
buf_ptr += sizeof(*cmdTQ);
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE,
num_channels * sizeof(wmi_resmgr_chan_time_quota));
buf_ptr += WMI_TLV_HDR_SIZE;
chan_quota.chan_mhz = chan1_freq;
chan_quota.channel_time_quota = quota_chan1;
qdf_mem_copy(buf_ptr, &chan_quota, sizeof(chan_quota));
/* Construct channel and quota record for the 2nd MCC mode. */
buf_ptr += sizeof(chan_quota);
chan_quota.chan_mhz = chan2_freq;
chan_quota.channel_time_quota = quota_chan2;
qdf_mem_copy(buf_ptr, &chan_quota, sizeof(chan_quota));
wmi_mtrace(WMI_RESMGR_SET_CHAN_TIME_QUOTA_CMDID, NO_SESSION, 0);
ret = wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_RESMGR_SET_CHAN_TIME_QUOTA_CMDID);
if (QDF_IS_STATUS_ERROR(ret)) {
WMI_LOGE("Failed to send MCC Channel Time Quota command");
wmi_buf_free(buf);
QDF_ASSERT(0);
}
return ret;
}
void wmi_concurrency_attach_tlv(wmi_unified_t wmi_handle)
{
struct wmi_ops *ops = wmi_handle->ops;
ops->send_set_enable_disable_mcc_adaptive_scheduler_cmd =
send_set_enable_disable_mcc_adaptive_scheduler_cmd_tlv;
ops->send_set_mcc_channel_time_latency_cmd =
send_set_mcc_channel_time_latency_cmd_tlv;
ops->send_set_mcc_channel_time_quota_cmd =
send_set_mcc_channel_time_quota_cmd_tlv;
}

View File

@@ -0,0 +1,131 @@
/*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: Implement API's specific to NAN component.
*/
#include <wmi_unified_priv.h>
#include <wmi_unified_nan_api.h>
QDF_STATUS wmi_unified_ndp_initiator_req_cmd_send(void *wmi_hdl,
struct nan_datapath_initiator_req *req)
{
wmi_unified_t wmi_handle = wmi_hdl;
if (wmi_handle->ops->send_ndp_initiator_req_cmd)
return wmi_handle->ops->send_ndp_initiator_req_cmd(wmi_handle,
req);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_ndp_responder_req_cmd_send(void *wmi_hdl,
struct nan_datapath_responder_req *req)
{
wmi_unified_t wmi_handle = wmi_hdl;
if (wmi_handle->ops->send_ndp_responder_req_cmd)
return wmi_handle->ops->send_ndp_responder_req_cmd(wmi_handle,
req);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_ndp_end_req_cmd_send(void *wmi_hdl,
struct nan_datapath_end_req *req)
{
wmi_unified_t wmi_handle = wmi_hdl;
if (wmi_handle->ops->send_ndp_end_req_cmd)
return wmi_handle->ops->send_ndp_end_req_cmd(wmi_handle,
req);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_extract_ndp_initiator_rsp(wmi_unified_t wmi_handle,
uint8_t *data, struct nan_datapath_initiator_rsp *rsp)
{
if (wmi_handle->ops->extract_ndp_initiator_rsp)
return wmi_handle->ops->extract_ndp_initiator_rsp(wmi_handle,
data, rsp);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_extract_ndp_ind(wmi_unified_t wmi_handle, uint8_t *data,
struct nan_datapath_indication_event *ind)
{
if (wmi_handle->ops->extract_ndp_ind)
return wmi_handle->ops->extract_ndp_ind(wmi_handle,
data, ind);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_extract_ndp_confirm(wmi_unified_t wmi_handle, uint8_t *data,
struct nan_datapath_confirm_event *ev)
{
if (wmi_handle->ops->extract_ndp_confirm)
return wmi_handle->ops->extract_ndp_confirm(wmi_handle,
data, ev);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_extract_ndp_responder_rsp(wmi_unified_t wmi_handle,
uint8_t *data,
struct nan_datapath_responder_rsp *rsp)
{
if (wmi_handle->ops->extract_ndp_responder_rsp)
return wmi_handle->ops->extract_ndp_responder_rsp(wmi_handle,
data, rsp);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_extract_ndp_end_rsp(wmi_unified_t wmi_handle, uint8_t *data,
struct nan_datapath_end_rsp_event *rsp)
{
if (wmi_handle->ops->extract_ndp_end_rsp)
return wmi_handle->ops->extract_ndp_end_rsp(wmi_handle,
data, rsp);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_extract_ndp_end_ind(wmi_unified_t wmi_handle, uint8_t *data,
struct nan_datapath_end_indication_event **ind)
{
if (wmi_handle->ops->extract_ndp_end_ind)
return wmi_handle->ops->extract_ndp_end_ind(wmi_handle,
data, ind);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_extract_ndp_sch_update(wmi_unified_t wmi_handle, uint8_t *data,
struct nan_datapath_sch_update_event *ind)
{
if (wmi_handle->ops->extract_ndp_sch_update)
return wmi_handle->ops->extract_ndp_sch_update(wmi_handle,
data, ind);
return QDF_STATUS_E_FAILURE;
}

View File

@@ -0,0 +1,859 @@
/*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include <osdep.h>
#include <wmi.h>
#include <wmi_unified_priv.h>
#include <nan_public_structs.h>
#include <wmi_unified_nan_api.h>
static QDF_STATUS nan_ndp_initiator_req_tlv(wmi_unified_t wmi_handle,
struct nan_datapath_initiator_req *ndp_req)
{
uint16_t len;
wmi_buf_t buf;
uint8_t *tlv_ptr;
QDF_STATUS status;
wmi_channel *ch_tlv;
wmi_ndp_initiator_req_fixed_param *cmd;
uint32_t passphrase_len, service_name_len;
uint32_t ndp_cfg_len, ndp_app_info_len, pmk_len;
wmi_ndp_transport_ip_param *tcp_ip_param;
/*
* WMI command expects 4 byte alligned len:
* round up ndp_cfg_len and ndp_app_info_len to 4 bytes
*/
ndp_cfg_len = qdf_roundup(ndp_req->ndp_config.ndp_cfg_len, 4);
ndp_app_info_len = qdf_roundup(ndp_req->ndp_info.ndp_app_info_len, 4);
pmk_len = qdf_roundup(ndp_req->pmk.pmk_len, 4);
passphrase_len = qdf_roundup(ndp_req->passphrase.passphrase_len, 4);
service_name_len =
qdf_roundup(ndp_req->service_name.service_name_len, 4);
/* allocated memory for fixed params as well as variable size data */
len = sizeof(*cmd) + sizeof(*ch_tlv) + (5 * WMI_TLV_HDR_SIZE)
+ ndp_cfg_len + ndp_app_info_len + pmk_len
+ passphrase_len + service_name_len;
if (ndp_req->is_ipv6_addr_present)
len += sizeof(*tcp_ip_param);
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
return QDF_STATUS_E_NOMEM;
}
cmd = (wmi_ndp_initiator_req_fixed_param *) wmi_buf_data(buf);
WMITLV_SET_HDR(&cmd->tlv_header,
WMITLV_TAG_STRUC_wmi_ndp_initiator_req_fixed_param,
WMITLV_GET_STRUCT_TLVLEN(
wmi_ndp_initiator_req_fixed_param));
cmd->vdev_id = wlan_vdev_get_id(ndp_req->vdev);
cmd->transaction_id = ndp_req->transaction_id;
cmd->service_instance_id = ndp_req->service_instance_id;
WMI_CHAR_ARRAY_TO_MAC_ADDR(ndp_req->peer_discovery_mac_addr.bytes,
&cmd->peer_discovery_mac_addr);
cmd->ndp_cfg_len = ndp_req->ndp_config.ndp_cfg_len;
cmd->ndp_app_info_len = ndp_req->ndp_info.ndp_app_info_len;
cmd->ndp_channel_cfg = ndp_req->channel_cfg;
cmd->nan_pmk_len = ndp_req->pmk.pmk_len;
cmd->nan_csid = ndp_req->ncs_sk_type;
cmd->nan_passphrase_len = ndp_req->passphrase.passphrase_len;
cmd->nan_servicename_len = ndp_req->service_name.service_name_len;
ch_tlv = (wmi_channel *)&cmd[1];
WMITLV_SET_HDR(ch_tlv, WMITLV_TAG_STRUC_wmi_channel,
WMITLV_GET_STRUCT_TLVLEN(wmi_channel));
ch_tlv->mhz = ndp_req->channel;
tlv_ptr = (uint8_t *)&ch_tlv[1];
WMITLV_SET_HDR(tlv_ptr, WMITLV_TAG_ARRAY_BYTE, ndp_cfg_len);
qdf_mem_copy(&tlv_ptr[WMI_TLV_HDR_SIZE],
ndp_req->ndp_config.ndp_cfg, cmd->ndp_cfg_len);
tlv_ptr = tlv_ptr + WMI_TLV_HDR_SIZE + ndp_cfg_len;
WMITLV_SET_HDR(tlv_ptr, WMITLV_TAG_ARRAY_BYTE, ndp_app_info_len);
qdf_mem_copy(&tlv_ptr[WMI_TLV_HDR_SIZE],
ndp_req->ndp_info.ndp_app_info, cmd->ndp_app_info_len);
tlv_ptr = tlv_ptr + WMI_TLV_HDR_SIZE + ndp_app_info_len;
WMITLV_SET_HDR(tlv_ptr, WMITLV_TAG_ARRAY_BYTE, pmk_len);
qdf_mem_copy(&tlv_ptr[WMI_TLV_HDR_SIZE], ndp_req->pmk.pmk,
cmd->nan_pmk_len);
tlv_ptr = tlv_ptr + WMI_TLV_HDR_SIZE + pmk_len;
WMITLV_SET_HDR(tlv_ptr, WMITLV_TAG_ARRAY_BYTE, passphrase_len);
qdf_mem_copy(&tlv_ptr[WMI_TLV_HDR_SIZE], ndp_req->passphrase.passphrase,
cmd->nan_passphrase_len);
tlv_ptr = tlv_ptr + WMI_TLV_HDR_SIZE + passphrase_len;
WMITLV_SET_HDR(tlv_ptr, WMITLV_TAG_ARRAY_BYTE, service_name_len);
qdf_mem_copy(&tlv_ptr[WMI_TLV_HDR_SIZE],
ndp_req->service_name.service_name,
cmd->nan_servicename_len);
tlv_ptr = tlv_ptr + WMI_TLV_HDR_SIZE + service_name_len;
if (ndp_req->is_ipv6_addr_present) {
tcp_ip_param = (wmi_ndp_transport_ip_param *)tlv_ptr;
WMITLV_SET_HDR(tcp_ip_param,
WMITLV_TAG_STRUC_wmi_ndp_transport_ip_param,
WMITLV_GET_STRUCT_TLVLEN(
wmi_ndp_transport_ip_param));
tcp_ip_param->ipv6_addr_present = true;
qdf_mem_copy(tcp_ip_param->ipv6_intf_addr,
ndp_req->ipv6_addr, WMI_NDP_IPV6_INTF_ADDR_LEN);
}
WMI_LOGD(FL("IPv6 addr present: %d, addr: %pI6"),
ndp_req->is_ipv6_addr_present, ndp_req->ipv6_addr);
WMI_LOGD("vdev_id = %d, transaction_id: %d, service_instance_id: %d, ch: %d, ch_cfg: %d, csid: %d",
cmd->vdev_id, cmd->transaction_id, cmd->service_instance_id,
ch_tlv->mhz, cmd->ndp_channel_cfg, cmd->nan_csid);
WMI_LOGD("peer mac addr: mac_addr31to0: 0x%x, mac_addr47to32: 0x%x",
cmd->peer_discovery_mac_addr.mac_addr31to0,
cmd->peer_discovery_mac_addr.mac_addr47to32);
WMI_LOGD("ndp_config len: %d", cmd->ndp_cfg_len);
QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG,
ndp_req->ndp_config.ndp_cfg,
ndp_req->ndp_config.ndp_cfg_len);
WMI_LOGD("ndp_app_info len: %d", cmd->ndp_app_info_len);
QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG,
ndp_req->ndp_info.ndp_app_info,
ndp_req->ndp_info.ndp_app_info_len);
WMI_LOGD("pmk len: %d", cmd->nan_pmk_len);
QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG,
ndp_req->pmk.pmk, cmd->nan_pmk_len);
WMI_LOGD("pass phrase len: %d", cmd->nan_passphrase_len);
QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG,
ndp_req->passphrase.passphrase,
cmd->nan_passphrase_len);
WMI_LOGD("service name len: %d", cmd->nan_servicename_len);
QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG,
ndp_req->service_name.service_name,
cmd->nan_servicename_len);
WMI_LOGD("sending WMI_NDP_INITIATOR_REQ_CMDID(0x%X)",
WMI_NDP_INITIATOR_REQ_CMDID);
wmi_mtrace(WMI_NDP_INITIATOR_REQ_CMDID, cmd->vdev_id, 0);
status = wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_NDP_INITIATOR_REQ_CMDID);
if (QDF_IS_STATUS_ERROR(status)) {
WMI_LOGE("WMI_NDP_INITIATOR_REQ_CMDID failed, ret: %d", status);
wmi_buf_free(buf);
}
return status;
}
static QDF_STATUS nan_ndp_responder_req_tlv(wmi_unified_t wmi_handle,
struct nan_datapath_responder_req *req)
{
uint16_t len;
wmi_buf_t buf;
uint8_t *tlv_ptr;
QDF_STATUS status;
wmi_ndp_responder_req_fixed_param *cmd;
wmi_ndp_transport_ip_param *tcp_ip_param;
uint32_t passphrase_len, service_name_len;
uint32_t vdev_id = 0, ndp_cfg_len, ndp_app_info_len, pmk_len;
vdev_id = wlan_vdev_get_id(req->vdev);
WMI_LOGD("vdev_id: %d, transaction_id: %d, ndp_rsp %d, ndp_instance_id: %d, ndp_app_info_len: %d",
vdev_id, req->transaction_id,
req->ndp_rsp,
req->ndp_instance_id,
req->ndp_info.ndp_app_info_len);
/*
* WMI command expects 4 byte alligned len:
* round up ndp_cfg_len and ndp_app_info_len to 4 bytes
*/
ndp_cfg_len = qdf_roundup(req->ndp_config.ndp_cfg_len, 4);
ndp_app_info_len = qdf_roundup(req->ndp_info.ndp_app_info_len, 4);
pmk_len = qdf_roundup(req->pmk.pmk_len, 4);
passphrase_len = qdf_roundup(req->passphrase.passphrase_len, 4);
service_name_len =
qdf_roundup(req->service_name.service_name_len, 4);
/* allocated memory for fixed params as well as variable size data */
len = sizeof(*cmd) + 5*WMI_TLV_HDR_SIZE + ndp_cfg_len + ndp_app_info_len
+ pmk_len + passphrase_len + service_name_len;
if (req->is_ipv6_addr_present || req->is_port_present ||
req->is_protocol_present)
len += sizeof(*tcp_ip_param);
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
return QDF_STATUS_E_NOMEM;
}
cmd = (wmi_ndp_responder_req_fixed_param *) wmi_buf_data(buf);
WMITLV_SET_HDR(&cmd->tlv_header,
WMITLV_TAG_STRUC_wmi_ndp_responder_req_fixed_param,
WMITLV_GET_STRUCT_TLVLEN(
wmi_ndp_responder_req_fixed_param));
cmd->vdev_id = vdev_id;
cmd->transaction_id = req->transaction_id;
cmd->ndp_instance_id = req->ndp_instance_id;
cmd->rsp_code = req->ndp_rsp;
cmd->ndp_cfg_len = req->ndp_config.ndp_cfg_len;
cmd->ndp_app_info_len = req->ndp_info.ndp_app_info_len;
cmd->nan_pmk_len = req->pmk.pmk_len;
cmd->nan_csid = req->ncs_sk_type;
cmd->nan_passphrase_len = req->passphrase.passphrase_len;
cmd->nan_servicename_len = req->service_name.service_name_len;
tlv_ptr = (uint8_t *)&cmd[1];
WMITLV_SET_HDR(tlv_ptr, WMITLV_TAG_ARRAY_BYTE, ndp_cfg_len);
qdf_mem_copy(&tlv_ptr[WMI_TLV_HDR_SIZE],
req->ndp_config.ndp_cfg, cmd->ndp_cfg_len);
tlv_ptr = tlv_ptr + WMI_TLV_HDR_SIZE + ndp_cfg_len;
WMITLV_SET_HDR(tlv_ptr, WMITLV_TAG_ARRAY_BYTE, ndp_app_info_len);
qdf_mem_copy(&tlv_ptr[WMI_TLV_HDR_SIZE],
req->ndp_info.ndp_app_info,
req->ndp_info.ndp_app_info_len);
tlv_ptr = tlv_ptr + WMI_TLV_HDR_SIZE + ndp_app_info_len;
WMITLV_SET_HDR(tlv_ptr, WMITLV_TAG_ARRAY_BYTE, pmk_len);
qdf_mem_copy(&tlv_ptr[WMI_TLV_HDR_SIZE], req->pmk.pmk,
cmd->nan_pmk_len);
tlv_ptr = tlv_ptr + WMI_TLV_HDR_SIZE + pmk_len;
WMITLV_SET_HDR(tlv_ptr, WMITLV_TAG_ARRAY_BYTE, passphrase_len);
qdf_mem_copy(&tlv_ptr[WMI_TLV_HDR_SIZE],
req->passphrase.passphrase,
cmd->nan_passphrase_len);
tlv_ptr = tlv_ptr + WMI_TLV_HDR_SIZE + passphrase_len;
WMITLV_SET_HDR(tlv_ptr, WMITLV_TAG_ARRAY_BYTE, service_name_len);
qdf_mem_copy(&tlv_ptr[WMI_TLV_HDR_SIZE],
req->service_name.service_name,
cmd->nan_servicename_len);
tlv_ptr = tlv_ptr + WMI_TLV_HDR_SIZE + service_name_len;
if (req->is_ipv6_addr_present || req->is_port_present ||
req->is_protocol_present) {
tcp_ip_param = (wmi_ndp_transport_ip_param *)tlv_ptr;
WMITLV_SET_HDR(tcp_ip_param,
WMITLV_TAG_STRUC_wmi_ndp_transport_ip_param,
WMITLV_GET_STRUCT_TLVLEN(
wmi_ndp_transport_ip_param));
tcp_ip_param->ipv6_addr_present = req->is_ipv6_addr_present;
qdf_mem_copy(tcp_ip_param->ipv6_intf_addr,
req->ipv6_addr, WMI_NDP_IPV6_INTF_ADDR_LEN);
tcp_ip_param->trans_port_present = req->is_port_present;
tcp_ip_param->transport_port = req->port;
tcp_ip_param->trans_proto_present = req->is_protocol_present;
tcp_ip_param->transport_protocol = req->protocol;
}
WMI_LOGD(FL("IPv6 addr present: %d, addr: %pI6"),
req->is_ipv6_addr_present, req->ipv6_addr);
WMI_LOGD(FL("port: %d present: %d"), req->is_port_present, req->port);
WMI_LOGD(FL("protocol: %d present: %d"),
req->is_protocol_present, req->protocol);
WMI_LOGD("vdev_id = %d, transaction_id: %d, csid: %d",
cmd->vdev_id, cmd->transaction_id, cmd->nan_csid);
WMI_LOGD("ndp_config len: %d",
req->ndp_config.ndp_cfg_len);
QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG,
req->ndp_config.ndp_cfg,
req->ndp_config.ndp_cfg_len);
WMI_LOGD("ndp_app_info len: %d",
req->ndp_info.ndp_app_info_len);
QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG,
req->ndp_info.ndp_app_info,
req->ndp_info.ndp_app_info_len);
WMI_LOGD("pmk len: %d", cmd->nan_pmk_len);
QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG,
req->pmk.pmk, cmd->nan_pmk_len);
WMI_LOGD("pass phrase len: %d", cmd->nan_passphrase_len);
QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG,
req->passphrase.passphrase,
cmd->nan_passphrase_len);
WMI_LOGD("service name len: %d", cmd->nan_servicename_len);
QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG,
req->service_name.service_name,
cmd->nan_servicename_len);
WMI_LOGD("sending WMI_NDP_RESPONDER_REQ_CMDID(0x%X)",
WMI_NDP_RESPONDER_REQ_CMDID);
wmi_mtrace(WMI_NDP_RESPONDER_REQ_CMDID, cmd->vdev_id, 0);
status = wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_NDP_RESPONDER_REQ_CMDID);
if (QDF_IS_STATUS_ERROR(status)) {
WMI_LOGE("WMI_NDP_RESPONDER_REQ_CMDID failed, ret: %d", status);
wmi_buf_free(buf);
}
return status;
}
static QDF_STATUS nan_ndp_end_req_tlv(wmi_unified_t wmi_handle,
struct nan_datapath_end_req *req)
{
uint16_t len;
wmi_buf_t buf;
QDF_STATUS status;
uint32_t ndp_end_req_len, i;
wmi_ndp_end_req *ndp_end_req_lst;
wmi_ndp_end_req_fixed_param *cmd;
/* len of tlv following fixed param */
ndp_end_req_len = sizeof(wmi_ndp_end_req) * req->num_ndp_instances;
/* above comes out to 4 byte alligned already, no need of padding */
len = sizeof(*cmd) + ndp_end_req_len + WMI_TLV_HDR_SIZE;
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
return QDF_STATUS_E_NOMEM;
}
cmd = (wmi_ndp_end_req_fixed_param *) wmi_buf_data(buf);
WMITLV_SET_HDR(&cmd->tlv_header,
WMITLV_TAG_STRUC_wmi_ndp_end_req_fixed_param,
WMITLV_GET_STRUCT_TLVLEN(wmi_ndp_end_req_fixed_param));
cmd->transaction_id = req->transaction_id;
/* set tlv pointer to end of fixed param */
WMITLV_SET_HDR((uint8_t *)&cmd[1], WMITLV_TAG_ARRAY_STRUC,
ndp_end_req_len);
ndp_end_req_lst = (wmi_ndp_end_req *)((uint8_t *)&cmd[1] +
WMI_TLV_HDR_SIZE);
for (i = 0; i < req->num_ndp_instances; i++) {
WMITLV_SET_HDR(&ndp_end_req_lst[i],
WMITLV_TAG_ARRAY_FIXED_STRUC,
(sizeof(*ndp_end_req_lst) - WMI_TLV_HDR_SIZE));
ndp_end_req_lst[i].ndp_instance_id = req->ndp_ids[i];
}
WMI_LOGD("Sending WMI_NDP_END_REQ_CMDID to FW");
wmi_mtrace(WMI_NDP_END_REQ_CMDID, NO_SESSION, 0);
status = wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_NDP_END_REQ_CMDID);
if (QDF_IS_STATUS_ERROR(status)) {
WMI_LOGE("WMI_NDP_END_REQ_CMDID failed, ret: %d", status);
wmi_buf_free(buf);
}
return status;
}
static QDF_STATUS extract_ndp_initiator_rsp_tlv(wmi_unified_t wmi_handle,
uint8_t *data, struct nan_datapath_initiator_rsp *rsp)
{
WMI_NDP_INITIATOR_RSP_EVENTID_param_tlvs *event;
wmi_ndp_initiator_rsp_event_fixed_param *fixed_params;
event = (WMI_NDP_INITIATOR_RSP_EVENTID_param_tlvs *)data;
fixed_params = event->fixed_param;
rsp->vdev =
wlan_objmgr_get_vdev_by_id_from_psoc(wmi_handle->soc->wmi_psoc,
fixed_params->vdev_id,
WLAN_NAN_ID);
if (!rsp->vdev) {
WMI_LOGE("vdev is null");
return QDF_STATUS_E_INVAL;
}
rsp->transaction_id = fixed_params->transaction_id;
rsp->ndp_instance_id = fixed_params->ndp_instance_id;
rsp->status = fixed_params->rsp_status;
rsp->reason = fixed_params->reason_code;
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS extract_ndp_ind_tlv(wmi_unified_t wmi_handle,
uint8_t *data, struct nan_datapath_indication_event *rsp)
{
WMI_NDP_INDICATION_EVENTID_param_tlvs *event;
wmi_ndp_indication_event_fixed_param *fixed_params;
size_t total_array_len;
event = (WMI_NDP_INDICATION_EVENTID_param_tlvs *)data;
fixed_params =
(wmi_ndp_indication_event_fixed_param *)event->fixed_param;
if (fixed_params->ndp_cfg_len > event->num_ndp_cfg) {
WMI_LOGE("FW message ndp cfg length %d larger than TLV hdr %d",
fixed_params->ndp_cfg_len, event->num_ndp_cfg);
return QDF_STATUS_E_INVAL;
}
if (fixed_params->ndp_app_info_len > event->num_ndp_app_info) {
WMI_LOGE("FW message ndp app info length %d more than TLV hdr %d",
fixed_params->ndp_app_info_len,
event->num_ndp_app_info);
return QDF_STATUS_E_INVAL;
}
if (fixed_params->ndp_cfg_len >
(WMI_SVC_MSG_MAX_SIZE - sizeof(*fixed_params))) {
WMI_LOGE("%s: excess wmi buffer: ndp_cfg_len %d",
__func__, fixed_params->ndp_cfg_len);
return QDF_STATUS_E_INVAL;
}
total_array_len = fixed_params->ndp_cfg_len +
sizeof(*fixed_params);
if (fixed_params->ndp_app_info_len >
(WMI_SVC_MSG_MAX_SIZE - total_array_len)) {
WMI_LOGE("%s: excess wmi buffer: ndp_cfg_len %d",
__func__, fixed_params->ndp_app_info_len);
return QDF_STATUS_E_INVAL;
}
total_array_len += fixed_params->ndp_app_info_len;
if (fixed_params->nan_scid_len >
(WMI_SVC_MSG_MAX_SIZE - total_array_len)) {
WMI_LOGE("%s: excess wmi buffer: ndp_cfg_len %d",
__func__, fixed_params->nan_scid_len);
return QDF_STATUS_E_INVAL;
}
rsp->vdev =
wlan_objmgr_get_vdev_by_id_from_psoc(wmi_handle->soc->wmi_psoc,
fixed_params->vdev_id,
WLAN_NAN_ID);
if (!rsp->vdev) {
WMI_LOGE("vdev is null");
return QDF_STATUS_E_INVAL;
}
rsp->service_instance_id = fixed_params->service_instance_id;
rsp->ndp_instance_id = fixed_params->ndp_instance_id;
rsp->role = fixed_params->self_ndp_role;
rsp->policy = fixed_params->accept_policy;
WMI_MAC_ADDR_TO_CHAR_ARRAY(&fixed_params->peer_ndi_mac_addr,
rsp->peer_mac_addr.bytes);
WMI_MAC_ADDR_TO_CHAR_ARRAY(&fixed_params->peer_discovery_mac_addr,
rsp->peer_discovery_mac_addr.bytes);
WMI_LOGD("WMI_NDP_INDICATION_EVENTID(0x%X) received. vdev %d,\n"
"service_instance %d, ndp_instance %d, role %d, policy %d,\n"
"csid: %d, scid_len: %d, peer_addr: %pM, peer_disc_addr: %pM",
WMI_NDP_INDICATION_EVENTID, fixed_params->vdev_id,
fixed_params->service_instance_id,
fixed_params->ndp_instance_id, fixed_params->self_ndp_role,
fixed_params->accept_policy,
fixed_params->nan_csid, fixed_params->nan_scid_len,
rsp->peer_mac_addr.bytes,
rsp->peer_discovery_mac_addr.bytes);
WMI_LOGD("ndp_cfg - %d bytes", fixed_params->ndp_cfg_len);
QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG,
&event->ndp_cfg, fixed_params->ndp_cfg_len);
WMI_LOGD("ndp_app_info - %d bytes",
fixed_params->ndp_app_info_len);
QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG,
&event->ndp_app_info, fixed_params->ndp_app_info_len);
rsp->ndp_config.ndp_cfg_len = fixed_params->ndp_cfg_len;
rsp->ndp_info.ndp_app_info_len = fixed_params->ndp_app_info_len;
rsp->ncs_sk_type = fixed_params->nan_csid;
rsp->scid.scid_len = fixed_params->nan_scid_len;
if (rsp->ndp_config.ndp_cfg_len > NDP_QOS_INFO_LEN)
rsp->ndp_config.ndp_cfg_len = NDP_QOS_INFO_LEN;
qdf_mem_copy(rsp->ndp_config.ndp_cfg, event->ndp_cfg,
rsp->ndp_config.ndp_cfg_len);
if (rsp->ndp_info.ndp_app_info_len > NDP_APP_INFO_LEN)
rsp->ndp_info.ndp_app_info_len = NDP_APP_INFO_LEN;
qdf_mem_copy(rsp->ndp_info.ndp_app_info, event->ndp_app_info,
rsp->ndp_info.ndp_app_info_len);
if (rsp->scid.scid_len > NDP_SCID_BUF_LEN)
rsp->scid.scid_len = NDP_SCID_BUF_LEN;
qdf_mem_copy(rsp->scid.scid, event->ndp_scid, rsp->scid.scid_len);
if (event->ndp_transport_ip_param &&
event->num_ndp_transport_ip_param) {
if (event->ndp_transport_ip_param->ipv6_addr_present) {
rsp->is_ipv6_addr_present = true;
qdf_mem_copy(rsp->ipv6_addr,
event->ndp_transport_ip_param->ipv6_intf_addr,
WMI_NDP_IPV6_INTF_ADDR_LEN);
}
}
WMI_LOGD(FL("IPv6 addr present: %d, addr: %pI6"),
rsp->is_ipv6_addr_present, rsp->ipv6_addr);
WMI_LOGD("scid hex dump:");
QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG,
rsp->scid.scid, rsp->scid.scid_len);
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS extract_ndp_confirm_tlv(wmi_unified_t wmi_handle,
uint8_t *data, struct nan_datapath_confirm_event *rsp)
{
uint8_t i;
WMI_HOST_WLAN_PHY_MODE ch_mode;
WMI_NDP_CONFIRM_EVENTID_param_tlvs *event;
wmi_ndp_confirm_event_fixed_param *fixed_params;
size_t total_array_len;
event = (WMI_NDP_CONFIRM_EVENTID_param_tlvs *) data;
fixed_params = (wmi_ndp_confirm_event_fixed_param *)event->fixed_param;
WMI_LOGD("WMI_NDP_CONFIRM_EVENTID(0x%X) received. vdev %d, ndp_instance %d, rsp_code %d, reason_code: %d, num_active_ndps_on_peer: %d",
WMI_NDP_CONFIRM_EVENTID, fixed_params->vdev_id,
fixed_params->ndp_instance_id, fixed_params->rsp_code,
fixed_params->reason_code,
fixed_params->num_active_ndps_on_peer);
WMI_LOGE("num_ch: %d", fixed_params->num_ndp_channels);
if (fixed_params->ndp_cfg_len > event->num_ndp_cfg) {
WMI_LOGE("FW message ndp cfg length %d larger than TLV hdr %d",
fixed_params->ndp_cfg_len, event->num_ndp_cfg);
return QDF_STATUS_E_INVAL;
}
WMI_LOGD("ndp_cfg - %d bytes", fixed_params->ndp_cfg_len);
if (fixed_params->ndp_app_info_len > event->num_ndp_app_info) {
WMI_LOGE("FW message ndp app info length %d more than TLV hdr %d",
fixed_params->ndp_app_info_len,
event->num_ndp_app_info);
return QDF_STATUS_E_INVAL;
}
WMI_LOGD("ndp_app_info - %d bytes",
fixed_params->ndp_app_info_len);
if (fixed_params->ndp_cfg_len >
(WMI_SVC_MSG_MAX_SIZE - sizeof(*fixed_params))) {
WMI_LOGE("%s: excess wmi buffer: ndp_cfg_len %d",
__func__, fixed_params->ndp_cfg_len);
return QDF_STATUS_E_INVAL;
}
total_array_len = fixed_params->ndp_cfg_len +
sizeof(*fixed_params);
if (fixed_params->ndp_app_info_len >
(WMI_SVC_MSG_MAX_SIZE - total_array_len)) {
WMI_LOGE("%s: excess wmi buffer: ndp_cfg_len %d",
__func__, fixed_params->ndp_app_info_len);
return QDF_STATUS_E_INVAL;
}
if (fixed_params->num_ndp_channels > event->num_ndp_channel_list ||
fixed_params->num_ndp_channels > event->num_nss_list) {
WMI_LOGE(FL("NDP Ch count %d greater than NDP Ch TLV len (%d) or NSS TLV len (%d)"),
fixed_params->num_ndp_channels,
event->num_ndp_channel_list,
event->num_nss_list);
return QDF_STATUS_E_INVAL;
}
rsp->vdev =
wlan_objmgr_get_vdev_by_id_from_psoc(wmi_handle->soc->wmi_psoc,
fixed_params->vdev_id,
WLAN_NAN_ID);
if (!rsp->vdev) {
WMI_LOGE("vdev is null");
return QDF_STATUS_E_INVAL;
}
rsp->ndp_instance_id = fixed_params->ndp_instance_id;
rsp->rsp_code = fixed_params->rsp_code;
rsp->reason_code = fixed_params->reason_code;
rsp->num_active_ndps_on_peer = fixed_params->num_active_ndps_on_peer;
rsp->num_channels = fixed_params->num_ndp_channels;
WMI_MAC_ADDR_TO_CHAR_ARRAY(&fixed_params->peer_ndi_mac_addr,
rsp->peer_ndi_mac_addr.bytes);
rsp->ndp_info.ndp_app_info_len = fixed_params->ndp_app_info_len;
qdf_mem_copy(rsp->ndp_info.ndp_app_info, event->ndp_app_info,
rsp->ndp_info.ndp_app_info_len);
if (rsp->num_channels > NAN_CH_INFO_MAX_CHANNELS) {
WMI_LOGE(FL("too many channels"));
rsp->num_channels = NAN_CH_INFO_MAX_CHANNELS;
}
for (i = 0; i < rsp->num_channels; i++) {
rsp->ch[i].channel = event->ndp_channel_list[i].mhz;
rsp->ch[i].nss = event->nss_list[i];
ch_mode = WMI_GET_CHANNEL_MODE(&event->ndp_channel_list[i]);
rsp->ch[i].ch_width = wmi_get_ch_width_from_phy_mode(wmi_handle,
ch_mode);
WMI_LOGD(FL("ch: %d, ch_mode: %d, nss: %d"),
rsp->ch[i].channel,
rsp->ch[i].ch_width,
rsp->ch[i].nss);
}
if (event->ndp_transport_ip_param &&
event->num_ndp_transport_ip_param) {
if (event->ndp_transport_ip_param->ipv6_addr_present) {
rsp->is_ipv6_addr_present = true;
qdf_mem_copy(rsp->ipv6_addr,
event->ndp_transport_ip_param->ipv6_intf_addr,
WMI_NDP_IPV6_INTF_ADDR_LEN);
}
if (event->ndp_transport_ip_param->trans_port_present) {
rsp->is_port_present = true;
rsp->port =
event->ndp_transport_ip_param->transport_port;
}
if (event->ndp_transport_ip_param->trans_proto_present) {
rsp->is_protocol_present = true;
rsp->protocol =
event->ndp_transport_ip_param->transport_protocol;
}
}
WMI_LOGD(FL("IPv6 addr present: %d, addr: %pI6"),
rsp->is_ipv6_addr_present, rsp->ipv6_addr);
WMI_LOGD(FL("port: %d present: %d"), rsp->port, rsp->is_port_present);
WMI_LOGD(FL("protocol: %d present: %d"),
rsp->protocol, rsp->is_protocol_present);
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS extract_ndp_responder_rsp_tlv(wmi_unified_t wmi_handle,
uint8_t *data, struct nan_datapath_responder_rsp *rsp)
{
WMI_NDP_RESPONDER_RSP_EVENTID_param_tlvs *event;
wmi_ndp_responder_rsp_event_fixed_param *fixed_params;
event = (WMI_NDP_RESPONDER_RSP_EVENTID_param_tlvs *)data;
fixed_params = event->fixed_param;
WMI_LOGD("WMI_NDP_RESPONDER_RSP_EVENTID(0x%X) received. vdev_id: %d, peer_mac_addr: %pM,transaction_id: %d, status_code %d, reason_code: %d, create_peer: %d",
WMI_NDP_RESPONDER_RSP_EVENTID, fixed_params->vdev_id,
rsp->peer_mac_addr.bytes, rsp->transaction_id,
rsp->status, rsp->reason, rsp->create_peer);
rsp->vdev =
wlan_objmgr_get_vdev_by_id_from_psoc(wmi_handle->soc->wmi_psoc,
fixed_params->vdev_id,
WLAN_NAN_ID);
if (!rsp->vdev) {
WMI_LOGE("vdev is null");
return QDF_STATUS_E_INVAL;
}
rsp->transaction_id = fixed_params->transaction_id;
rsp->reason = fixed_params->reason_code;
rsp->status = fixed_params->rsp_status;
rsp->create_peer = fixed_params->create_peer;
WMI_MAC_ADDR_TO_CHAR_ARRAY(&fixed_params->peer_ndi_mac_addr,
rsp->peer_mac_addr.bytes);
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS extract_ndp_end_rsp_tlv(wmi_unified_t wmi_handle,
uint8_t *data, struct nan_datapath_end_rsp_event *rsp)
{
WMI_NDP_END_RSP_EVENTID_param_tlvs *event;
wmi_ndp_end_rsp_event_fixed_param *fixed_params = NULL;
event = (WMI_NDP_END_RSP_EVENTID_param_tlvs *) data;
fixed_params = (wmi_ndp_end_rsp_event_fixed_param *)event->fixed_param;
WMI_LOGD("WMI_NDP_END_RSP_EVENTID(0x%X) received. transaction_id: %d, rsp_status: %d, reason_code: %d",
WMI_NDP_END_RSP_EVENTID, fixed_params->transaction_id,
fixed_params->rsp_status, fixed_params->reason_code);
rsp->vdev = wlan_objmgr_get_vdev_by_opmode_from_psoc(
wmi_handle->soc->wmi_psoc, QDF_NDI_MODE, WLAN_NAN_ID);
if (!rsp->vdev) {
WMI_LOGE("vdev is null");
return QDF_STATUS_E_INVAL;
}
rsp->transaction_id = fixed_params->transaction_id;
rsp->reason = fixed_params->reason_code;
rsp->status = fixed_params->rsp_status;
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS extract_ndp_end_ind_tlv(wmi_unified_t wmi_handle,
uint8_t *data, struct nan_datapath_end_indication_event **rsp)
{
uint32_t i, buf_size;
wmi_ndp_end_indication *ind;
struct qdf_mac_addr peer_addr;
WMI_NDP_END_INDICATION_EVENTID_param_tlvs *event;
event = (WMI_NDP_END_INDICATION_EVENTID_param_tlvs *) data;
ind = event->ndp_end_indication_list;
if (event->num_ndp_end_indication_list == 0) {
WMI_LOGE("Error: Event ignored, 0 ndp instances");
return QDF_STATUS_E_INVAL;
}
WMI_LOGD("number of ndp instances = %d",
event->num_ndp_end_indication_list);
if (event->num_ndp_end_indication_list > ((UINT_MAX - sizeof(**rsp))/
sizeof((*rsp)->ndp_map[0]))) {
WMI_LOGE("num_ndp_end_ind_list %d too large",
event->num_ndp_end_indication_list);
return QDF_STATUS_E_INVAL;
}
buf_size = sizeof(**rsp) + event->num_ndp_end_indication_list *
sizeof((*rsp)->ndp_map[0]);
*rsp = qdf_mem_malloc(buf_size);
if (!(*rsp)) {
WMI_LOGE("Failed to allocate memory");
return QDF_STATUS_E_NOMEM;
}
(*rsp)->num_ndp_ids = event->num_ndp_end_indication_list;
for (i = 0; i < (*rsp)->num_ndp_ids; i++) {
WMI_MAC_ADDR_TO_CHAR_ARRAY(&ind[i].peer_ndi_mac_addr,
peer_addr.bytes);
WMI_LOGD("ind[%d]: type %d, reason_code %d, instance_id %d num_active %d ",
i, ind[i].type, ind[i].reason_code,
ind[i].ndp_instance_id,
ind[i].num_active_ndps_on_peer);
/* Add each instance entry to the list */
(*rsp)->ndp_map[i].ndp_instance_id = ind[i].ndp_instance_id;
(*rsp)->ndp_map[i].vdev_id = ind[i].vdev_id;
WMI_MAC_ADDR_TO_CHAR_ARRAY(&ind[i].peer_ndi_mac_addr,
(*rsp)->ndp_map[i].peer_ndi_mac_addr.bytes);
(*rsp)->ndp_map[i].num_active_ndp_sessions =
ind[i].num_active_ndps_on_peer;
(*rsp)->ndp_map[i].type = ind[i].type;
(*rsp)->ndp_map[i].reason_code = ind[i].reason_code;
}
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS extract_ndp_sch_update_tlv(wmi_unified_t wmi_handle,
uint8_t *data, struct nan_datapath_sch_update_event *ind)
{
uint8_t i;
WMI_HOST_WLAN_PHY_MODE ch_mode;
WMI_NDL_SCHEDULE_UPDATE_EVENTID_param_tlvs *event;
wmi_ndl_schedule_update_fixed_param *fixed_params;
event = (WMI_NDL_SCHEDULE_UPDATE_EVENTID_param_tlvs *)data;
fixed_params = event->fixed_param;
WMI_LOGD(FL("flags: %d, num_ch: %d, num_ndp_instances: %d"),
fixed_params->flags, fixed_params->num_channels,
fixed_params->num_ndp_instances);
if (fixed_params->num_channels > event->num_ndl_channel_list ||
fixed_params->num_channels > event->num_nss_list) {
WMI_LOGE(FL("Channel count %d greater than NDP Ch list TLV len (%d) or NSS list TLV len (%d)"),
fixed_params->num_channels,
event->num_ndl_channel_list,
event->num_nss_list);
return QDF_STATUS_E_INVAL;
}
if (fixed_params->num_ndp_instances > event->num_ndp_instance_list) {
WMI_LOGE(FL("NDP Instance count %d greater than NDP Instancei TLV len %d"),
fixed_params->num_ndp_instances,
event->num_ndp_instance_list);
return QDF_STATUS_E_INVAL;
}
ind->vdev =
wlan_objmgr_get_vdev_by_id_from_psoc(wmi_handle->soc->wmi_psoc,
fixed_params->vdev_id,
WLAN_NAN_ID);
if (!ind->vdev) {
WMI_LOGE("vdev is null");
return QDF_STATUS_E_INVAL;
}
ind->flags = fixed_params->flags;
ind->num_channels = fixed_params->num_channels;
ind->num_ndp_instances = fixed_params->num_ndp_instances;
WMI_MAC_ADDR_TO_CHAR_ARRAY(&fixed_params->peer_macaddr,
ind->peer_addr.bytes);
if (ind->num_ndp_instances > NDP_NUM_INSTANCE_ID) {
WMI_LOGE(FL("uint32 overflow"));
wlan_objmgr_vdev_release_ref(ind->vdev, WLAN_NAN_ID);
return QDF_STATUS_E_INVAL;
}
qdf_mem_copy(ind->ndp_instances, event->ndp_instance_list,
sizeof(uint32_t) * ind->num_ndp_instances);
if (ind->num_channels > NAN_CH_INFO_MAX_CHANNELS) {
WMI_LOGE(FL("too many channels"));
ind->num_channels = NAN_CH_INFO_MAX_CHANNELS;
}
for (i = 0; i < ind->num_channels; i++) {
ind->ch[i].channel = event->ndl_channel_list[i].mhz;
ind->ch[i].nss = event->nss_list[i];
ch_mode = WMI_GET_CHANNEL_MODE(&event->ndl_channel_list[i]);
ind->ch[i].ch_width = wmi_get_ch_width_from_phy_mode(wmi_handle,
ch_mode);
WMI_LOGD(FL("ch: %d, ch_mode: %d, nss: %d"),
ind->ch[i].channel,
ind->ch[i].ch_width,
ind->ch[i].nss);
}
for (i = 0; i < fixed_params->num_ndp_instances; i++)
WMI_LOGD(FL("instance_id[%d]: %d"),
i, event->ndp_instance_list[i]);
return QDF_STATUS_SUCCESS;
}
void wmi_nan_attach_tlv(wmi_unified_t wmi_handle)
{
struct wmi_ops *ops = wmi_handle->ops;
ops->send_ndp_initiator_req_cmd = nan_ndp_initiator_req_tlv;
ops->send_ndp_responder_req_cmd = nan_ndp_responder_req_tlv;
ops->send_ndp_end_req_cmd = nan_ndp_end_req_tlv;
ops->extract_ndp_initiator_rsp = extract_ndp_initiator_rsp_tlv;
ops->extract_ndp_ind = extract_ndp_ind_tlv;
ops->extract_ndp_confirm = extract_ndp_confirm_tlv;
ops->extract_ndp_responder_rsp = extract_ndp_responder_rsp_tlv;
ops->extract_ndp_end_rsp = extract_ndp_end_rsp_tlv;
ops->extract_ndp_end_ind = extract_ndp_end_ind_tlv;
ops->extract_ndp_sch_update = extract_ndp_sch_update_tlv;
}

View File

@@ -0,0 +1,153 @@
/*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: Implement API's specific to DSRC component.
*/
#include <wmi_unified_priv.h>
#include <wlan_ocb_public_structs.h>
#include <wmi_unified_ocb_api.h>
QDF_STATUS wmi_unified_ocb_start_timing_advert(struct wmi_unified *wmi_hdl,
struct ocb_timing_advert_param *timing_advert)
{
if (wmi_hdl->ops->send_ocb_start_timing_advert_cmd)
return wmi_hdl->ops->send_ocb_start_timing_advert_cmd(wmi_hdl,
timing_advert);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_ocb_stop_timing_advert(struct wmi_unified *wmi_hdl,
struct ocb_timing_advert_param *timing_advert)
{
if (wmi_hdl->ops->send_ocb_stop_timing_advert_cmd)
return wmi_hdl->ops->send_ocb_stop_timing_advert_cmd(wmi_hdl,
timing_advert);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_ocb_set_utc_time_cmd(struct wmi_unified *wmi_hdl,
struct ocb_utc_param *utc)
{
if (wmi_hdl->ops->send_ocb_set_utc_time_cmd)
return wmi_hdl->ops->send_ocb_set_utc_time_cmd(wmi_hdl, utc);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_ocb_get_tsf_timer(struct wmi_unified *wmi_hdl,
struct ocb_get_tsf_timer_param *req)
{
if (wmi_hdl->ops->send_ocb_get_tsf_timer_cmd)
return wmi_hdl->ops->send_ocb_get_tsf_timer_cmd(wmi_hdl,
req->vdev_id);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_dcc_get_stats_cmd(struct wmi_unified *wmi_hdl,
struct ocb_dcc_get_stats_param *get_stats_param)
{
if (wmi_hdl->ops->send_dcc_get_stats_cmd)
return wmi_hdl->ops->send_dcc_get_stats_cmd(wmi_hdl,
get_stats_param);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_dcc_clear_stats(struct wmi_unified *wmi_hdl,
struct ocb_dcc_clear_stats_param *clear_stats_param)
{
if (wmi_hdl->ops->send_dcc_clear_stats_cmd)
return wmi_hdl->ops->send_dcc_clear_stats_cmd(wmi_hdl,
clear_stats_param->vdev_id,
clear_stats_param->dcc_stats_bitmap);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_dcc_update_ndl(struct wmi_unified *wmi_hdl,
struct ocb_dcc_update_ndl_param *update_ndl_param)
{
if (wmi_hdl->ops->send_dcc_update_ndl_cmd)
return wmi_hdl->ops->send_dcc_update_ndl_cmd(wmi_hdl,
update_ndl_param);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_ocb_set_config(struct wmi_unified *wmi_hdl,
struct ocb_config *config)
{
if (wmi_hdl->ops->send_ocb_set_config_cmd)
return wmi_hdl->ops->send_ocb_set_config_cmd(wmi_hdl,
config);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS
wmi_extract_ocb_set_channel_config_resp(struct wmi_unified *wmi_hdl,
void *evt_buf,
uint32_t *status)
{
if (wmi_hdl->ops->extract_ocb_chan_config_resp)
return wmi_hdl->ops->extract_ocb_chan_config_resp(wmi_hdl,
evt_buf,
status);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_extract_ocb_tsf_timer(struct wmi_unified *wmi_hdl,
void *evt_buf,
struct ocb_get_tsf_timer_response *resp)
{
if (wmi_hdl->ops->extract_ocb_tsf_timer)
return wmi_hdl->ops->extract_ocb_tsf_timer(wmi_hdl,
evt_buf,
resp);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_extract_dcc_update_ndl_resp(struct wmi_unified *wmi_hdl,
void *evt_buf, struct ocb_dcc_update_ndl_response *resp)
{
if (wmi_hdl->ops->extract_dcc_update_ndl_resp)
return wmi_hdl->ops->extract_dcc_update_ndl_resp(wmi_hdl,
evt_buf,
resp);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_extract_dcc_stats(struct wmi_unified *wmi_hdl,
void *evt_buf,
struct ocb_dcc_get_stats_response **resp)
{
if (wmi_hdl->ops->extract_dcc_stats)
return wmi_hdl->ops->extract_dcc_stats(wmi_hdl,
evt_buf,
resp);
return QDF_STATUS_E_FAILURE;
}

View File

@@ -0,0 +1,791 @@
/*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include <osdep.h>
#include <wmi.h>
#include <wmi_unified_priv.h>
#include <wlan_ocb_public_structs.h>
#include <wmi_unified_ocb_api.h>
/**
* send_ocb_set_utc_time_cmd() - send the UTC time to the firmware
* @wmi_handle: pointer to the wmi handle
* @utc: pointer to the UTC time struct
*
* Return: 0 on succes
*/
static QDF_STATUS send_ocb_set_utc_time_cmd_tlv(wmi_unified_t wmi_handle,
struct ocb_utc_param *utc)
{
QDF_STATUS ret;
wmi_ocb_set_utc_time_cmd_fixed_param *cmd;
uint8_t *buf_ptr;
uint32_t len, i;
wmi_buf_t buf;
len = sizeof(*cmd);
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
return QDF_STATUS_E_NOMEM;
}
buf_ptr = (uint8_t *)wmi_buf_data(buf);
cmd = (wmi_ocb_set_utc_time_cmd_fixed_param *)buf_ptr;
WMITLV_SET_HDR(&cmd->tlv_header,
WMITLV_TAG_STRUC_wmi_ocb_set_utc_time_cmd_fixed_param,
WMITLV_GET_STRUCT_TLVLEN(wmi_ocb_set_utc_time_cmd_fixed_param));
cmd->vdev_id = utc->vdev_id;
for (i = 0; i < SIZE_UTC_TIME; i++)
WMI_UTC_TIME_SET(cmd, i, utc->utc_time[i]);
for (i = 0; i < SIZE_UTC_TIME_ERROR; i++)
WMI_TIME_ERROR_SET(cmd, i, utc->time_error[i]);
wmi_mtrace(WMI_OCB_SET_UTC_TIME_CMDID, cmd->vdev_id, 0);
ret = wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_OCB_SET_UTC_TIME_CMDID);
if (QDF_IS_STATUS_ERROR(ret)) {
WMI_LOGE(FL("Failed to set OCB UTC time"));
wmi_buf_free(buf);
}
return ret;
}
/**
* send_ocb_start_timing_advert_cmd_tlv() - start sending the timing advertisement
* frames on a channel
* @wmi_handle: pointer to the wmi handle
* @timing_advert: pointer to the timing advertisement struct
*
* Return: 0 on succes
*/
static QDF_STATUS send_ocb_start_timing_advert_cmd_tlv(wmi_unified_t wmi_handle,
struct ocb_timing_advert_param *timing_advert)
{
QDF_STATUS ret;
wmi_ocb_start_timing_advert_cmd_fixed_param *cmd;
uint8_t *buf_ptr;
uint32_t len, len_template;
wmi_buf_t buf;
len = sizeof(*cmd) +
WMI_TLV_HDR_SIZE;
len_template = timing_advert->template_length;
/* Add padding to the template if needed */
if (len_template % 4 != 0)
len_template += 4 - (len_template % 4);
len += len_template;
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
return QDF_STATUS_E_NOMEM;
}
buf_ptr = (uint8_t *)wmi_buf_data(buf);
cmd = (wmi_ocb_start_timing_advert_cmd_fixed_param *)buf_ptr;
WMITLV_SET_HDR(&cmd->tlv_header,
WMITLV_TAG_STRUC_wmi_ocb_start_timing_advert_cmd_fixed_param,
WMITLV_GET_STRUCT_TLVLEN(
wmi_ocb_start_timing_advert_cmd_fixed_param));
cmd->vdev_id = timing_advert->vdev_id;
cmd->repeat_rate = timing_advert->repeat_rate;
cmd->channel_freq = timing_advert->chan_freq;
cmd->timestamp_offset = timing_advert->timestamp_offset;
cmd->time_value_offset = timing_advert->time_value_offset;
cmd->timing_advert_template_length = timing_advert->template_length;
buf_ptr += sizeof(*cmd);
/* Add the timing advert template */
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE,
len_template);
qdf_mem_copy(buf_ptr + WMI_TLV_HDR_SIZE,
(uint8_t *)timing_advert->template_value,
timing_advert->template_length);
wmi_mtrace(WMI_OCB_START_TIMING_ADVERT_CMDID, cmd->vdev_id, 0);
ret = wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_OCB_START_TIMING_ADVERT_CMDID);
if (QDF_IS_STATUS_ERROR(ret)) {
WMI_LOGE(FL("Failed to start OCB timing advert"));
wmi_buf_free(buf);
}
return ret;
}
/**
* send_ocb_stop_timing_advert_cmd_tlv() - stop sending the timing advertisement frames
* on a channel
* @wmi_handle: pointer to the wmi handle
* @timing_advert: pointer to the timing advertisement struct
*
* Return: 0 on succes
*/
static QDF_STATUS send_ocb_stop_timing_advert_cmd_tlv(wmi_unified_t wmi_handle,
struct ocb_timing_advert_param *timing_advert)
{
QDF_STATUS ret;
wmi_ocb_stop_timing_advert_cmd_fixed_param *cmd;
uint8_t *buf_ptr;
uint32_t len;
wmi_buf_t buf;
len = sizeof(*cmd);
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
return QDF_STATUS_E_NOMEM;
}
buf_ptr = (uint8_t *)wmi_buf_data(buf);
cmd = (wmi_ocb_stop_timing_advert_cmd_fixed_param *)buf_ptr;
WMITLV_SET_HDR(&cmd->tlv_header,
WMITLV_TAG_STRUC_wmi_ocb_stop_timing_advert_cmd_fixed_param,
WMITLV_GET_STRUCT_TLVLEN(
wmi_ocb_stop_timing_advert_cmd_fixed_param));
cmd->vdev_id = timing_advert->vdev_id;
cmd->channel_freq = timing_advert->chan_freq;
wmi_mtrace(WMI_OCB_STOP_TIMING_ADVERT_CMDID, cmd->vdev_id, 0);
ret = wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_OCB_STOP_TIMING_ADVERT_CMDID);
if (QDF_IS_STATUS_ERROR(ret)) {
WMI_LOGE(FL("Failed to stop OCB timing advert"));
wmi_buf_free(buf);
}
return ret;
}
/**
* send_ocb_get_tsf_timer_cmd_tlv() - get ocb tsf timer val
* @wmi_handle: pointer to the wmi handle
* @request: pointer to the request
*
* Return: 0 on succes
*/
static QDF_STATUS send_ocb_get_tsf_timer_cmd_tlv(wmi_unified_t wmi_handle,
uint8_t vdev_id)
{
QDF_STATUS ret;
wmi_ocb_get_tsf_timer_cmd_fixed_param *cmd;
uint8_t *buf_ptr;
wmi_buf_t buf;
int32_t len;
len = sizeof(*cmd);
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
return QDF_STATUS_E_NOMEM;
}
buf_ptr = (uint8_t *)wmi_buf_data(buf);
cmd = (wmi_ocb_get_tsf_timer_cmd_fixed_param *)buf_ptr;
qdf_mem_zero(cmd, len);
WMITLV_SET_HDR(&cmd->tlv_header,
WMITLV_TAG_STRUC_wmi_ocb_get_tsf_timer_cmd_fixed_param,
WMITLV_GET_STRUCT_TLVLEN(
wmi_ocb_get_tsf_timer_cmd_fixed_param));
cmd->vdev_id = vdev_id;
/* Send the WMI command */
wmi_mtrace(WMI_OCB_GET_TSF_TIMER_CMDID, cmd->vdev_id, 0);
ret = wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_OCB_GET_TSF_TIMER_CMDID);
/* If there is an error, set the completion event */
if (QDF_IS_STATUS_ERROR(ret)) {
WMI_LOGE(FL("Failed to send WMI message: %d"), ret);
wmi_buf_free(buf);
}
return ret;
}
/**
* send_dcc_get_stats_cmd_tlv() - get the DCC channel stats
* @wmi_handle: pointer to the wmi handle
* @get_stats_param: pointer to the dcc stats
*
* Return: 0 on succes
*/
static QDF_STATUS send_dcc_get_stats_cmd_tlv(wmi_unified_t wmi_handle,
struct ocb_dcc_get_stats_param *get_stats_param)
{
QDF_STATUS ret;
wmi_dcc_get_stats_cmd_fixed_param *cmd;
wmi_dcc_channel_stats_request *channel_stats_array;
wmi_buf_t buf;
uint8_t *buf_ptr;
uint32_t len;
uint32_t i;
/* Validate the input */
if (get_stats_param->request_array_len !=
get_stats_param->channel_count * sizeof(*channel_stats_array)) {
WMI_LOGE(FL("Invalid parameter"));
return QDF_STATUS_E_INVAL;
}
/* Allocate memory for the WMI command */
len = sizeof(*cmd) + WMI_TLV_HDR_SIZE +
get_stats_param->request_array_len;
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
return QDF_STATUS_E_NOMEM;
}
buf_ptr = wmi_buf_data(buf);
qdf_mem_zero(buf_ptr, len);
/* Populate the WMI command */
cmd = (wmi_dcc_get_stats_cmd_fixed_param *)buf_ptr;
buf_ptr += sizeof(*cmd);
WMITLV_SET_HDR(&cmd->tlv_header,
WMITLV_TAG_STRUC_wmi_dcc_get_stats_cmd_fixed_param,
WMITLV_GET_STRUCT_TLVLEN(
wmi_dcc_get_stats_cmd_fixed_param));
cmd->vdev_id = get_stats_param->vdev_id;
cmd->num_channels = get_stats_param->channel_count;
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
get_stats_param->request_array_len);
buf_ptr += WMI_TLV_HDR_SIZE;
channel_stats_array = (wmi_dcc_channel_stats_request *)buf_ptr;
qdf_mem_copy(channel_stats_array, get_stats_param->request_array,
get_stats_param->request_array_len);
for (i = 0; i < cmd->num_channels; i++)
WMITLV_SET_HDR(&channel_stats_array[i].tlv_header,
WMITLV_TAG_STRUC_wmi_dcc_channel_stats_request,
WMITLV_GET_STRUCT_TLVLEN(
wmi_dcc_channel_stats_request));
/* Send the WMI command */
wmi_mtrace(WMI_DCC_GET_STATS_CMDID, cmd->vdev_id, 0);
ret = wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_DCC_GET_STATS_CMDID);
if (QDF_IS_STATUS_ERROR(ret)) {
WMI_LOGE(FL("Failed to send WMI message: %d"), ret);
wmi_buf_free(buf);
}
return ret;
}
/**
* send_dcc_clear_stats_cmd_tlv() - command to clear the DCC stats
* @wmi_handle: pointer to the wmi handle
* @vdev_id: vdev id
* @dcc_stats_bitmap: dcc status bitmap
*
* Return: 0 on succes
*/
static QDF_STATUS send_dcc_clear_stats_cmd_tlv(wmi_unified_t wmi_handle,
uint32_t vdev_id, uint32_t dcc_stats_bitmap)
{
QDF_STATUS ret;
wmi_dcc_clear_stats_cmd_fixed_param *cmd;
wmi_buf_t buf;
uint8_t *buf_ptr;
uint32_t len;
/* Allocate memory for the WMI command */
len = sizeof(*cmd);
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
return QDF_STATUS_E_NOMEM;
}
buf_ptr = wmi_buf_data(buf);
qdf_mem_zero(buf_ptr, len);
/* Populate the WMI command */
cmd = (wmi_dcc_clear_stats_cmd_fixed_param *)buf_ptr;
WMITLV_SET_HDR(&cmd->tlv_header,
WMITLV_TAG_STRUC_wmi_dcc_clear_stats_cmd_fixed_param,
WMITLV_GET_STRUCT_TLVLEN(
wmi_dcc_clear_stats_cmd_fixed_param));
cmd->vdev_id = vdev_id;
cmd->dcc_stats_bitmap = dcc_stats_bitmap;
/* Send the WMI command */
wmi_mtrace(WMI_DCC_CLEAR_STATS_CMDID, cmd->vdev_id, 0);
ret = wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_DCC_CLEAR_STATS_CMDID);
if (QDF_IS_STATUS_ERROR(ret)) {
WMI_LOGE(FL("Failed to send the WMI command"));
wmi_buf_free(buf);
}
return ret;
}
/**
* send_dcc_update_ndl_cmd_tlv() - command to update the NDL data
* @wmi_handle: pointer to the wmi handle
* @update_ndl_param: pointer to the request parameters
*
* Return: 0 on success
*/
static QDF_STATUS send_dcc_update_ndl_cmd_tlv(wmi_unified_t wmi_handle,
struct ocb_dcc_update_ndl_param *update_ndl_param)
{
QDF_STATUS qdf_status;
wmi_dcc_update_ndl_cmd_fixed_param *cmd;
wmi_dcc_ndl_chan *ndl_chan_array;
wmi_dcc_ndl_active_state_config *ndl_active_state_array;
uint32_t active_state_count;
wmi_buf_t buf;
uint8_t *buf_ptr;
uint32_t len;
uint32_t i;
/* validate the input */
if (update_ndl_param->dcc_ndl_chan_list_len !=
update_ndl_param->channel_count * sizeof(*ndl_chan_array)) {
WMI_LOGE(FL("Invalid parameter"));
return QDF_STATUS_E_INVAL;
}
active_state_count = 0;
ndl_chan_array = update_ndl_param->dcc_ndl_chan_list;
for (i = 0; i < update_ndl_param->channel_count; i++)
active_state_count +=
WMI_NDL_NUM_ACTIVE_STATE_GET(&ndl_chan_array[i]);
if (update_ndl_param->dcc_ndl_active_state_list_len !=
active_state_count * sizeof(*ndl_active_state_array)) {
WMI_LOGE(FL("Invalid parameter"));
return QDF_STATUS_E_INVAL;
}
/* Allocate memory for the WMI command */
len = sizeof(*cmd) +
WMI_TLV_HDR_SIZE + update_ndl_param->dcc_ndl_chan_list_len +
WMI_TLV_HDR_SIZE +
update_ndl_param->dcc_ndl_active_state_list_len;
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
return QDF_STATUS_E_NOMEM;
}
buf_ptr = wmi_buf_data(buf);
qdf_mem_zero(buf_ptr, len);
/* Populate the WMI command */
cmd = (wmi_dcc_update_ndl_cmd_fixed_param *)buf_ptr;
buf_ptr += sizeof(*cmd);
WMITLV_SET_HDR(&cmd->tlv_header,
WMITLV_TAG_STRUC_wmi_dcc_update_ndl_cmd_fixed_param,
WMITLV_GET_STRUCT_TLVLEN(
wmi_dcc_update_ndl_cmd_fixed_param));
cmd->vdev_id = update_ndl_param->vdev_id;
cmd->num_channel = update_ndl_param->channel_count;
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
update_ndl_param->dcc_ndl_chan_list_len);
buf_ptr += WMI_TLV_HDR_SIZE;
ndl_chan_array = (wmi_dcc_ndl_chan *)buf_ptr;
qdf_mem_copy(ndl_chan_array, update_ndl_param->dcc_ndl_chan_list,
update_ndl_param->dcc_ndl_chan_list_len);
for (i = 0; i < cmd->num_channel; i++)
WMITLV_SET_HDR(&ndl_chan_array[i].tlv_header,
WMITLV_TAG_STRUC_wmi_dcc_ndl_chan,
WMITLV_GET_STRUCT_TLVLEN(
wmi_dcc_ndl_chan));
buf_ptr += update_ndl_param->dcc_ndl_chan_list_len;
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
update_ndl_param->dcc_ndl_active_state_list_len);
buf_ptr += WMI_TLV_HDR_SIZE;
ndl_active_state_array = (wmi_dcc_ndl_active_state_config *)buf_ptr;
qdf_mem_copy(ndl_active_state_array,
update_ndl_param->dcc_ndl_active_state_list,
update_ndl_param->dcc_ndl_active_state_list_len);
for (i = 0; i < active_state_count; i++) {
WMITLV_SET_HDR(&ndl_active_state_array[i].tlv_header,
WMITLV_TAG_STRUC_wmi_dcc_ndl_active_state_config,
WMITLV_GET_STRUCT_TLVLEN(
wmi_dcc_ndl_active_state_config));
}
buf_ptr += update_ndl_param->dcc_ndl_active_state_list_len;
/* Send the WMI command */
wmi_mtrace(WMI_DCC_UPDATE_NDL_CMDID, cmd->vdev_id, 0);
qdf_status = wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_DCC_UPDATE_NDL_CMDID);
/* If there is an error, set the completion event */
if (QDF_IS_STATUS_ERROR(qdf_status)) {
WMI_LOGE(FL("Failed to send WMI message: %d"), qdf_status);
wmi_buf_free(buf);
}
return qdf_status;
}
/**
* send_ocb_set_config_cmd_tlv() - send the OCB config to the FW
* @wmi_handle: pointer to the wmi handle
* @config: the OCB configuration
*
* Return: 0 on success
*/
static QDF_STATUS send_ocb_set_config_cmd_tlv(wmi_unified_t wmi_handle,
struct ocb_config *config)
{
QDF_STATUS ret;
wmi_ocb_set_config_cmd_fixed_param *cmd;
wmi_channel *chan;
wmi_ocb_channel *ocb_chan;
wmi_qos_parameter *qos_param;
wmi_dcc_ndl_chan *ndl_chan;
wmi_dcc_ndl_active_state_config *ndl_active_config;
wmi_ocb_schedule_element *sched_elem;
uint8_t *buf_ptr;
wmi_buf_t buf;
int32_t len;
int32_t i, j, active_state_count;
/*
* Validate the dcc_ndl_chan_list_len and count the number of active
* states. Validate dcc_ndl_active_state_list_len.
*/
active_state_count = 0;
if (config->dcc_ndl_chan_list_len) {
if (!config->dcc_ndl_chan_list ||
config->dcc_ndl_chan_list_len !=
config->channel_count * sizeof(wmi_dcc_ndl_chan)) {
WMI_LOGE(FL("NDL channel is invalid. List len: %d"),
config->dcc_ndl_chan_list_len);
return QDF_STATUS_E_INVAL;
}
for (i = 0, ndl_chan = config->dcc_ndl_chan_list;
i < config->channel_count; ++i, ++ndl_chan)
active_state_count +=
WMI_NDL_NUM_ACTIVE_STATE_GET(ndl_chan);
if (active_state_count) {
if (!config->dcc_ndl_active_state_list ||
config->dcc_ndl_active_state_list_len !=
active_state_count *
sizeof(wmi_dcc_ndl_active_state_config)) {
WMI_LOGE(FL("NDL active state is invalid."));
return QDF_STATUS_E_INVAL;
}
}
}
len = sizeof(*cmd) +
WMI_TLV_HDR_SIZE + config->channel_count *
sizeof(wmi_channel) +
WMI_TLV_HDR_SIZE + config->channel_count *
sizeof(wmi_ocb_channel) +
WMI_TLV_HDR_SIZE + config->channel_count *
sizeof(wmi_qos_parameter) * WMI_MAX_NUM_AC +
WMI_TLV_HDR_SIZE + config->dcc_ndl_chan_list_len +
WMI_TLV_HDR_SIZE + active_state_count *
sizeof(wmi_dcc_ndl_active_state_config) +
WMI_TLV_HDR_SIZE + config->schedule_size *
sizeof(wmi_ocb_schedule_element);
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
return QDF_STATUS_E_NOMEM;
}
buf_ptr = (uint8_t *)wmi_buf_data(buf);
cmd = (wmi_ocb_set_config_cmd_fixed_param *)buf_ptr;
WMITLV_SET_HDR(&cmd->tlv_header,
WMITLV_TAG_STRUC_wmi_ocb_set_config_cmd_fixed_param,
WMITLV_GET_STRUCT_TLVLEN(wmi_ocb_set_config_cmd_fixed_param));
cmd->vdev_id = config->vdev_id;
cmd->channel_count = config->channel_count;
cmd->schedule_size = config->schedule_size;
cmd->flags = config->flags;
buf_ptr += sizeof(*cmd);
/* Add the wmi_channel info */
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
config->channel_count * sizeof(wmi_channel));
buf_ptr += WMI_TLV_HDR_SIZE;
for (i = 0; i < config->channel_count; i++) {
chan = (wmi_channel *)buf_ptr;
WMITLV_SET_HDR(&chan->tlv_header,
WMITLV_TAG_STRUC_wmi_channel,
WMITLV_GET_STRUCT_TLVLEN(wmi_channel));
chan->mhz = config->channels[i].chan_freq;
chan->band_center_freq1 = config->channels[i].chan_freq;
chan->band_center_freq2 = 0;
chan->info = 0;
WMI_SET_CHANNEL_MODE(chan, config->channels[i].ch_mode);
WMI_SET_CHANNEL_MAX_POWER(chan, config->channels[i].max_pwr);
WMI_SET_CHANNEL_MIN_POWER(chan, config->channels[i].min_pwr);
WMI_SET_CHANNEL_MAX_TX_POWER(chan, config->channels[i].max_pwr);
WMI_SET_CHANNEL_REG_POWER(chan, config->channels[i].reg_pwr);
WMI_SET_CHANNEL_ANTENNA_MAX(chan,
config->channels[i].antenna_max);
if (config->channels[i].bandwidth < 10)
WMI_SET_CHANNEL_FLAG(chan, WMI_CHAN_FLAG_QUARTER_RATE);
else if (config->channels[i].bandwidth < 20)
WMI_SET_CHANNEL_FLAG(chan, WMI_CHAN_FLAG_HALF_RATE);
buf_ptr += sizeof(*chan);
}
/* Add the wmi_ocb_channel info */
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
config->channel_count * sizeof(wmi_ocb_channel));
buf_ptr += WMI_TLV_HDR_SIZE;
for (i = 0; i < config->channel_count; i++) {
ocb_chan = (wmi_ocb_channel *)buf_ptr;
WMITLV_SET_HDR(&ocb_chan->tlv_header,
WMITLV_TAG_STRUC_wmi_ocb_channel,
WMITLV_GET_STRUCT_TLVLEN(wmi_ocb_channel));
ocb_chan->bandwidth = config->channels[i].bandwidth;
WMI_CHAR_ARRAY_TO_MAC_ADDR(
config->channels[i].mac_address.bytes,
&ocb_chan->mac_address);
buf_ptr += sizeof(*ocb_chan);
}
/* Add the wmi_qos_parameter info */
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
config->channel_count * sizeof(wmi_qos_parameter)*WMI_MAX_NUM_AC);
buf_ptr += WMI_TLV_HDR_SIZE;
/* WMI_MAX_NUM_AC parameters for each channel */
for (i = 0; i < config->channel_count; i++) {
for (j = 0; j < WMI_MAX_NUM_AC; j++) {
qos_param = (wmi_qos_parameter *)buf_ptr;
WMITLV_SET_HDR(&qos_param->tlv_header,
WMITLV_TAG_STRUC_wmi_qos_parameter,
WMITLV_GET_STRUCT_TLVLEN(wmi_qos_parameter));
qos_param->aifsn =
config->channels[i].qos_params[j].aifsn;
qos_param->cwmin =
config->channels[i].qos_params[j].cwmin;
qos_param->cwmax =
config->channels[i].qos_params[j].cwmax;
buf_ptr += sizeof(*qos_param);
}
}
/* Add the wmi_dcc_ndl_chan (per channel) */
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
config->dcc_ndl_chan_list_len);
buf_ptr += WMI_TLV_HDR_SIZE;
if (config->dcc_ndl_chan_list_len) {
ndl_chan = (wmi_dcc_ndl_chan *)buf_ptr;
qdf_mem_copy(ndl_chan, config->dcc_ndl_chan_list,
config->dcc_ndl_chan_list_len);
for (i = 0; i < config->channel_count; i++)
WMITLV_SET_HDR(&(ndl_chan[i].tlv_header),
WMITLV_TAG_STRUC_wmi_dcc_ndl_chan,
WMITLV_GET_STRUCT_TLVLEN(wmi_dcc_ndl_chan));
buf_ptr += config->dcc_ndl_chan_list_len;
}
/* Add the wmi_dcc_ndl_active_state_config */
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, active_state_count *
sizeof(wmi_dcc_ndl_active_state_config));
buf_ptr += WMI_TLV_HDR_SIZE;
if (active_state_count) {
ndl_active_config = (wmi_dcc_ndl_active_state_config *)buf_ptr;
qdf_mem_copy(ndl_active_config,
config->dcc_ndl_active_state_list,
active_state_count * sizeof(*ndl_active_config));
for (i = 0; i < active_state_count; ++i)
WMITLV_SET_HDR(&(ndl_active_config[i].tlv_header),
WMITLV_TAG_STRUC_wmi_dcc_ndl_active_state_config,
WMITLV_GET_STRUCT_TLVLEN(
wmi_dcc_ndl_active_state_config));
buf_ptr += active_state_count *
sizeof(*ndl_active_config);
}
/* Add the wmi_ocb_schedule_element info */
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
config->schedule_size * sizeof(wmi_ocb_schedule_element));
buf_ptr += WMI_TLV_HDR_SIZE;
for (i = 0; i < config->schedule_size; i++) {
sched_elem = (wmi_ocb_schedule_element *)buf_ptr;
WMITLV_SET_HDR(&sched_elem->tlv_header,
WMITLV_TAG_STRUC_wmi_ocb_schedule_element,
WMITLV_GET_STRUCT_TLVLEN(wmi_ocb_schedule_element));
sched_elem->channel_freq = config->schedule[i].chan_freq;
sched_elem->total_duration = config->schedule[i].total_duration;
sched_elem->guard_interval = config->schedule[i].guard_interval;
buf_ptr += sizeof(*sched_elem);
}
wmi_mtrace(WMI_OCB_SET_CONFIG_CMDID, cmd->vdev_id, 0);
ret = wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_OCB_SET_CONFIG_CMDID);
if (QDF_IS_STATUS_ERROR(ret)) {
WMI_LOGE("Failed to set OCB config");
wmi_buf_free(buf);
}
return ret;
}
/**
* extract_ocb_channel_config_resp_tlv() - extract ocb channel config resp
* @wmi_handle: wmi handle
* @evt_buf: wmi event buffer
* @status: status buffer
*
* Return: QDF_STATUS_SUCCESS on success
*/
static QDF_STATUS extract_ocb_channel_config_resp_tlv(wmi_unified_t wmi_handle,
void *evt_buf,
uint32_t *status)
{
WMI_OCB_SET_CONFIG_RESP_EVENTID_param_tlvs *param_tlvs;
wmi_ocb_set_config_resp_event_fixed_param *fix_param;
param_tlvs = evt_buf;
fix_param = param_tlvs->fixed_param;
*status = fix_param->status;
return QDF_STATUS_SUCCESS;
}
/**
* extract_ocb_tsf_timer_tlv() - extract TSF timer from event buffer
* @wmi_handle: wmi handle
* @evt_buf: wmi event buffer
* @resp: response buffer
*
* Return: QDF_STATUS_SUCCESS on success
*/
static QDF_STATUS extract_ocb_tsf_timer_tlv(wmi_unified_t wmi_handle,
void *evt_buf, struct ocb_get_tsf_timer_response *resp)
{
WMI_OCB_GET_TSF_TIMER_RESP_EVENTID_param_tlvs *param_tlvs;
wmi_ocb_get_tsf_timer_resp_event_fixed_param *fix_param;
param_tlvs = evt_buf;
fix_param = param_tlvs->fixed_param;
resp->vdev_id = fix_param->vdev_id;
resp->timer_high = fix_param->tsf_timer_high;
resp->timer_low = fix_param->tsf_timer_low;
return QDF_STATUS_SUCCESS;
}
/**
* extract_ocb_ndl_resp_tlv() - extract TSF timer from event buffer
* @wmi_handle: wmi handle
* @evt_buf: wmi event buffer
* @resp: response buffer
*
* Return: QDF_STATUS_SUCCESS on success
*/
static QDF_STATUS extract_ocb_ndl_resp_tlv(wmi_unified_t wmi_handle,
void *evt_buf, struct ocb_dcc_update_ndl_response *resp)
{
WMI_DCC_UPDATE_NDL_RESP_EVENTID_param_tlvs *param_tlvs;
wmi_dcc_update_ndl_resp_event_fixed_param *fix_param;
param_tlvs = evt_buf;
fix_param = param_tlvs->fixed_param;
resp->vdev_id = fix_param->vdev_id;
resp->status = fix_param->status;
return QDF_STATUS_SUCCESS;
}
/**
* extract_ocb_dcc_stats_tlv() - extract DCC stats from event buffer
* @wmi_handle: wmi handle
* @evt_buf: wmi event buffer
* @resp: response buffer
*
* Since length of stats is variable, buffer for DCC stats will be allocated
* in this function. The caller must free the buffer.
*
* Return: QDF_STATUS_SUCCESS on success
*/
static QDF_STATUS extract_ocb_dcc_stats_tlv(wmi_unified_t wmi_handle,
void *evt_buf, struct ocb_dcc_get_stats_response **resp)
{
struct ocb_dcc_get_stats_response *response;
WMI_DCC_GET_STATS_RESP_EVENTID_param_tlvs *param_tlvs;
wmi_dcc_get_stats_resp_event_fixed_param *fix_param;
param_tlvs = (WMI_DCC_GET_STATS_RESP_EVENTID_param_tlvs *)evt_buf;
fix_param = param_tlvs->fixed_param;
/* Allocate and populate the response */
if (fix_param->num_channels > ((WMI_SVC_MSG_MAX_SIZE -
sizeof(*fix_param)) / sizeof(wmi_dcc_ndl_stats_per_channel))) {
WMI_LOGE("%s: too many channels:%d", __func__,
fix_param->num_channels);
QDF_ASSERT(0);
*resp = NULL;
return QDF_STATUS_E_INVAL;
}
response = qdf_mem_malloc(sizeof(*response) + fix_param->num_channels *
sizeof(wmi_dcc_ndl_stats_per_channel));
*resp = response;
if (!response)
return QDF_STATUS_E_NOMEM;
response->vdev_id = fix_param->vdev_id;
response->num_channels = fix_param->num_channels;
response->channel_stats_array_len =
fix_param->num_channels *
sizeof(wmi_dcc_ndl_stats_per_channel);
response->channel_stats_array = ((uint8_t *)response) +
sizeof(*response);
qdf_mem_copy(response->channel_stats_array,
param_tlvs->stats_per_channel_list,
response->channel_stats_array_len);
return QDF_STATUS_SUCCESS;
}
void wmi_ocb_attach_tlv(wmi_unified_t wmi_handle)
{
struct wmi_ops *ops = wmi_handle->ops;
ops->send_ocb_set_utc_time_cmd = send_ocb_set_utc_time_cmd_tlv;
ops->send_ocb_get_tsf_timer_cmd = send_ocb_get_tsf_timer_cmd_tlv;
ops->send_dcc_clear_stats_cmd = send_dcc_clear_stats_cmd_tlv;
ops->send_dcc_get_stats_cmd = send_dcc_get_stats_cmd_tlv;
ops->send_dcc_update_ndl_cmd = send_dcc_update_ndl_cmd_tlv;
ops->send_ocb_set_config_cmd = send_ocb_set_config_cmd_tlv;
ops->send_ocb_stop_timing_advert_cmd =
send_ocb_stop_timing_advert_cmd_tlv;
ops->send_ocb_start_timing_advert_cmd =
send_ocb_start_timing_advert_cmd_tlv;
ops->extract_ocb_chan_config_resp =
extract_ocb_channel_config_resp_tlv;
ops->extract_ocb_tsf_timer = extract_ocb_tsf_timer_tlv;
ops->extract_dcc_update_ndl_resp = extract_ocb_ndl_resp_tlv;
ops->extract_dcc_stats = extract_ocb_dcc_stats_tlv;
}

View File

@@ -0,0 +1,117 @@
/*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: Implement API's specific to P2P component.
*/
#include <wmi_unified_priv.h>
#include <wmi_unified_p2p_api.h>
QDF_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;
if (wmi_handle->ops->send_set_p2pgo_oppps_req_cmd)
return wmi_handle->ops->send_set_p2pgo_oppps_req_cmd(wmi_handle,
oppps);
return QDF_STATUS_E_FAILURE;
}
QDF_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;
if (wmi_handle->ops->send_set_p2pgo_noa_req_cmd)
return wmi_handle->ops->send_set_p2pgo_noa_req_cmd(wmi_handle,
noa);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_extract_p2p_noa_ev_param(void *wmi_hdl, void *evt_buf,
struct p2p_noa_info *param)
{
wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
if (!wmi_handle) {
WMI_LOGE("wmi handle is null");
return QDF_STATUS_E_INVAL;
}
if (wmi_handle->ops->extract_p2p_noa_ev_param)
return wmi_handle->ops->extract_p2p_noa_ev_param(
wmi_handle, evt_buf, param);
return QDF_STATUS_E_FAILURE;
}
#ifdef FEATURE_P2P_LISTEN_OFFLOAD
QDF_STATUS wmi_unified_p2p_lo_start_cmd(void *wmi_hdl,
struct p2p_lo_start *param)
{
wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
if (!wmi_handle) {
WMI_LOGE("wmi handle is null");
return QDF_STATUS_E_INVAL;
}
if (wmi_handle->ops->send_p2p_lo_start_cmd)
return wmi_handle->ops->send_p2p_lo_start_cmd(wmi_handle,
param);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_p2p_lo_stop_cmd(void *wmi_hdl, uint8_t vdev_id)
{
wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
if (!wmi_handle) {
WMI_LOGE("wmi handle is null");
return QDF_STATUS_E_INVAL;
}
if (wmi_handle->ops->send_p2p_lo_stop_cmd)
return wmi_handle->ops->send_p2p_lo_stop_cmd(wmi_handle,
vdev_id);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_extract_p2p_lo_stop_ev_param(void *wmi_hdl, void *evt_buf,
struct p2p_lo_event *param)
{
wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
if (!wmi_handle) {
WMI_LOGE("wmi handle is null");
return QDF_STATUS_E_INVAL;
}
if (wmi_handle->ops->extract_p2p_lo_stop_ev_param)
return wmi_handle->ops->extract_p2p_lo_stop_ev_param(
wmi_handle, evt_buf, param);
return QDF_STATUS_E_FAILURE;
}
#endif /* End of FEATURE_P2P_LISTEN_OFFLOAD*/

View File

@@ -0,0 +1,411 @@
/*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include <osdep.h>
#include <wmi.h>
#include <wmi_unified_priv.h>
#include <wmi_unified_p2p_api.h>
/**
* send_set_p2pgo_noa_req_cmd_tlv() - send p2p go noa request to fw
* @wmi_handle: wmi handle
* @noa: p2p power save parameters
*
* Return: CDF status
*/
static QDF_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;
wmi_p2p_noa_descriptor *noa_discriptor;
wmi_buf_t buf;
uint8_t *buf_ptr;
uint16_t len;
QDF_STATUS status;
uint32_t duration;
WMI_LOGD("%s: Enter", __func__);
len = sizeof(*cmd) + WMI_TLV_HDR_SIZE + sizeof(*noa_discriptor);
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
status = QDF_STATUS_E_FAILURE;
goto end;
}
buf_ptr = (uint8_t *)wmi_buf_data(buf);
cmd = (wmi_p2p_set_noa_cmd_fixed_param *)buf_ptr;
WMITLV_SET_HDR(&cmd->tlv_header,
WMITLV_TAG_STRUC_wmi_p2p_set_noa_cmd_fixed_param,
WMITLV_GET_STRUCT_TLVLEN
(wmi_p2p_set_noa_cmd_fixed_param));
duration = (noa->count == 1) ? noa->single_noa_duration : noa->duration;
cmd->vdev_id = noa->session_id;
cmd->enable = (duration) ? true : false;
cmd->num_noa = 1;
WMITLV_SET_HDR((buf_ptr + sizeof(wmi_p2p_set_noa_cmd_fixed_param)),
WMITLV_TAG_ARRAY_STRUC, sizeof(wmi_p2p_noa_descriptor));
noa_discriptor = (wmi_p2p_noa_descriptor *)(buf_ptr +
sizeof
(wmi_p2p_set_noa_cmd_fixed_param)
+ WMI_TLV_HDR_SIZE);
WMITLV_SET_HDR(&noa_discriptor->tlv_header,
WMITLV_TAG_STRUC_wmi_p2p_noa_descriptor,
WMITLV_GET_STRUCT_TLVLEN(wmi_p2p_noa_descriptor));
noa_discriptor->type_count = noa->count;
noa_discriptor->duration = duration;
noa_discriptor->interval = noa->interval;
noa_discriptor->start_time = 0;
WMI_LOGI("SET P2P GO NOA:vdev_id:%d count:%d duration:%d interval:%d",
cmd->vdev_id, noa->count, noa_discriptor->duration,
noa->interval);
wmi_mtrace(WMI_FWTEST_P2P_SET_NOA_PARAM_CMDID, cmd->vdev_id, 0);
status = wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_FWTEST_P2P_SET_NOA_PARAM_CMDID);
if (QDF_IS_STATUS_ERROR(status)) {
WMI_LOGE("Failed to send WMI_FWTEST_P2P_SET_NOA_PARAM_CMDID");
wmi_buf_free(buf);
}
end:
WMI_LOGD("%s: Exit", __func__);
return status;
}
/**
* send_set_p2pgo_oppps_req_cmd_tlv() - send p2p go opp power save request to fw
* @wmi_handle: wmi handle
* @noa: p2p opp power save parameters
*
* Return: CDF status
*/
static QDF_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;
wmi_buf_t buf;
QDF_STATUS status;
WMI_LOGD("%s: Enter", __func__);
buf = wmi_buf_alloc(wmi_handle, sizeof(*cmd));
if (!buf) {
status = QDF_STATUS_E_FAILURE;
goto end;
}
cmd = (wmi_p2p_set_oppps_cmd_fixed_param *) wmi_buf_data(buf);
WMITLV_SET_HDR(&cmd->tlv_header,
WMITLV_TAG_STRUC_wmi_p2p_set_oppps_cmd_fixed_param,
WMITLV_GET_STRUCT_TLVLEN(
wmi_p2p_set_oppps_cmd_fixed_param));
cmd->vdev_id = oppps->session_id;
if (oppps->ctwindow)
WMI_UNIFIED_OPPPS_ATTR_ENABLED_SET(cmd);
WMI_UNIFIED_OPPPS_ATTR_CTWIN_SET(cmd, oppps->ctwindow);
WMI_LOGI("SET P2P GO OPPPS:vdev_id:%d ctwindow:%d",
cmd->vdev_id, oppps->ctwindow);
wmi_mtrace(WMI_P2P_SET_OPPPS_PARAM_CMDID, cmd->vdev_id, 0);
status = wmi_unified_cmd_send(wmi_handle, buf, sizeof(*cmd),
WMI_P2P_SET_OPPPS_PARAM_CMDID);
if (QDF_IS_STATUS_ERROR(status)) {
WMI_LOGE("Failed to send WMI_P2P_SET_OPPPS_PARAM_CMDID");
wmi_buf_free(buf);
}
end:
WMI_LOGD("%s: Exit", __func__);
return status;
}
/**
* extract_p2p_noa_ev_param_tlv() - extract p2p noa information from event
* @wmi_handle: wmi handle
* @param evt_buf: pointer to event buffer
* @param param: Pointer to hold p2p noa info
*
* Return: QDF_STATUS_SUCCESS for success or error code
*/
static QDF_STATUS extract_p2p_noa_ev_param_tlv(
wmi_unified_t wmi_handle, void *evt_buf,
struct p2p_noa_info *param)
{
WMI_P2P_NOA_EVENTID_param_tlvs *param_tlvs;
wmi_p2p_noa_event_fixed_param *fixed_param;
uint8_t i;
wmi_p2p_noa_info *wmi_noa_info;
uint8_t *buf_ptr;
uint32_t descriptors;
param_tlvs = (WMI_P2P_NOA_EVENTID_param_tlvs *)evt_buf;
if (!param_tlvs) {
WMI_LOGE("%s: Invalid P2P NoA event buffer", __func__);
return QDF_STATUS_E_INVAL;
}
if (!param) {
WMI_LOGE("noa information param is null");
return QDF_STATUS_E_INVAL;
}
fixed_param = param_tlvs->fixed_param;
buf_ptr = (uint8_t *) fixed_param;
buf_ptr += sizeof(wmi_p2p_noa_event_fixed_param);
wmi_noa_info = (wmi_p2p_noa_info *) (buf_ptr);
if (!WMI_UNIFIED_NOA_ATTR_IS_MODIFIED(wmi_noa_info)) {
WMI_LOGE("%s: noa attr is not modified", __func__);
return QDF_STATUS_E_INVAL;
}
param->vdev_id = fixed_param->vdev_id;
param->index =
(uint8_t)WMI_UNIFIED_NOA_ATTR_INDEX_GET(wmi_noa_info);
param->opps_ps =
(uint8_t)WMI_UNIFIED_NOA_ATTR_OPP_PS_GET(wmi_noa_info);
param->ct_window =
(uint8_t)WMI_UNIFIED_NOA_ATTR_CTWIN_GET(wmi_noa_info);
descriptors = WMI_UNIFIED_NOA_ATTR_NUM_DESC_GET(wmi_noa_info);
param->num_desc = (uint8_t)descriptors;
if (param->num_desc > WMI_P2P_MAX_NOA_DESCRIPTORS) {
WMI_LOGE("%s: invalid num desc:%d", __func__,
param->num_desc);
return QDF_STATUS_E_INVAL;
}
WMI_LOGD("%s:index %u, opps_ps %u, ct_window %u, num_descriptors = %u",
__func__,
param->index, param->opps_ps, param->ct_window,
param->num_desc);
for (i = 0; i < param->num_desc; i++) {
param->noa_desc[i].type_count =
(uint8_t)wmi_noa_info->noa_descriptors[i].
type_count;
param->noa_desc[i].duration =
wmi_noa_info->noa_descriptors[i].duration;
param->noa_desc[i].interval =
wmi_noa_info->noa_descriptors[i].interval;
param->noa_desc[i].start_time =
wmi_noa_info->noa_descriptors[i].start_time;
WMI_LOGD("%s:NoA descriptor[%d] type_count %u, duration %u, interval %u, start_time = %u",
__func__, i, param->noa_desc[i].type_count,
param->noa_desc[i].duration,
param->noa_desc[i].interval,
param->noa_desc[i].start_time);
}
return QDF_STATUS_SUCCESS;
}
#ifdef FEATURE_P2P_LISTEN_OFFLOAD
/**
* send_p2p_lo_start_cmd_tlv() - send p2p lo start request to fw
* @wmi_handle: wmi handle
* @param: p2p listen offload start parameters
*
* Return: QDF status
*/
static QDF_STATUS send_p2p_lo_start_cmd_tlv(wmi_unified_t wmi_handle,
struct p2p_lo_start *param)
{
wmi_buf_t buf;
wmi_p2p_lo_start_cmd_fixed_param *cmd;
int32_t len = sizeof(*cmd);
uint8_t *buf_ptr;
QDF_STATUS status;
int device_types_len_aligned;
int probe_resp_len_aligned;
if (!param) {
WMI_LOGE("lo start param is null");
return QDF_STATUS_E_INVAL;
}
WMI_LOGD("%s: vdev_id:%d", __func__, param->vdev_id);
device_types_len_aligned =
qdf_roundup(param->dev_types_len,
sizeof(uint32_t));
probe_resp_len_aligned =
qdf_roundup(param->probe_resp_len,
sizeof(uint32_t));
len += 2 * WMI_TLV_HDR_SIZE + device_types_len_aligned +
probe_resp_len_aligned;
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
return QDF_STATUS_E_NOMEM;
}
cmd = (wmi_p2p_lo_start_cmd_fixed_param *)wmi_buf_data(buf);
buf_ptr = (uint8_t *) wmi_buf_data(buf);
WMITLV_SET_HDR(&cmd->tlv_header,
WMITLV_TAG_STRUC_wmi_p2p_lo_start_cmd_fixed_param,
WMITLV_GET_STRUCT_TLVLEN(wmi_p2p_lo_start_cmd_fixed_param));
cmd->vdev_id = param->vdev_id;
cmd->ctl_flags = param->ctl_flags;
cmd->channel = param->freq;
cmd->period = param->period;
cmd->interval = param->interval;
cmd->count = param->count;
cmd->device_types_len = param->dev_types_len;
cmd->prob_resp_len = param->probe_resp_len;
buf_ptr += sizeof(wmi_p2p_lo_start_cmd_fixed_param);
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE,
device_types_len_aligned);
buf_ptr += WMI_TLV_HDR_SIZE;
qdf_mem_copy(buf_ptr, param->device_types,
param->dev_types_len);
buf_ptr += device_types_len_aligned;
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE,
probe_resp_len_aligned);
buf_ptr += WMI_TLV_HDR_SIZE;
qdf_mem_copy(buf_ptr, param->probe_resp_tmplt,
param->probe_resp_len);
WMI_LOGD("%s: Sending WMI_P2P_LO_START command, channel=%d, period=%d, interval=%d, count=%d", __func__,
cmd->channel, cmd->period, cmd->interval, cmd->count);
wmi_mtrace(WMI_P2P_LISTEN_OFFLOAD_START_CMDID, cmd->vdev_id, 0);
status = wmi_unified_cmd_send(wmi_handle,
buf, len,
WMI_P2P_LISTEN_OFFLOAD_START_CMDID);
if (status != QDF_STATUS_SUCCESS) {
WMI_LOGE("%s: Failed to send p2p lo start: %d",
__func__, status);
wmi_buf_free(buf);
return status;
}
WMI_LOGD("%s: Successfully sent WMI_P2P_LO_START", __func__);
return QDF_STATUS_SUCCESS;
}
/**
* send_p2p_lo_stop_cmd_tlv() - send p2p lo stop request to fw
* @wmi_handle: wmi handle
* @param: p2p listen offload stop parameters
*
* Return: QDF status
*/
static QDF_STATUS send_p2p_lo_stop_cmd_tlv(wmi_unified_t wmi_handle,
uint8_t vdev_id)
{
wmi_buf_t buf;
wmi_p2p_lo_stop_cmd_fixed_param *cmd;
int32_t len;
QDF_STATUS status;
WMI_LOGD("%s: vdev_id:%d", __func__, vdev_id);
len = sizeof(*cmd);
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
return QDF_STATUS_E_NOMEM;
}
cmd = (wmi_p2p_lo_stop_cmd_fixed_param *)wmi_buf_data(buf);
WMITLV_SET_HDR(&cmd->tlv_header,
WMITLV_TAG_STRUC_wmi_p2p_lo_stop_cmd_fixed_param,
WMITLV_GET_STRUCT_TLVLEN(wmi_p2p_lo_stop_cmd_fixed_param));
cmd->vdev_id = vdev_id;
WMI_LOGD("%s: Sending WMI_P2P_LO_STOP command", __func__);
wmi_mtrace(WMI_P2P_LISTEN_OFFLOAD_STOP_CMDID, cmd->vdev_id, 0);
status = wmi_unified_cmd_send(wmi_handle,
buf, len,
WMI_P2P_LISTEN_OFFLOAD_STOP_CMDID);
if (status != QDF_STATUS_SUCCESS) {
WMI_LOGE("%s: Failed to send p2p lo stop: %d",
__func__, status);
wmi_buf_free(buf);
return status;
}
WMI_LOGD("%s: Successfully sent WMI_P2P_LO_STOP", __func__);
return QDF_STATUS_SUCCESS;
}
/**
* extract_p2p_lo_stop_ev_param_tlv() - extract p2p lo stop
* information from event
* @wmi_handle: wmi handle
* @param evt_buf: pointer to event buffer
* @param param: Pointer to hold p2p lo stop event information
*
* Return: QDF_STATUS_SUCCESS for success or error code
*/
static QDF_STATUS extract_p2p_lo_stop_ev_param_tlv(
wmi_unified_t wmi_handle, void *evt_buf,
struct p2p_lo_event *param)
{
WMI_P2P_LISTEN_OFFLOAD_STOPPED_EVENTID_param_tlvs *param_tlvs;
wmi_p2p_lo_stopped_event_fixed_param *lo_param;
param_tlvs = (WMI_P2P_LISTEN_OFFLOAD_STOPPED_EVENTID_param_tlvs *)
evt_buf;
if (!param_tlvs) {
WMI_LOGE("%s: Invalid P2P lo stop event buffer", __func__);
return QDF_STATUS_E_INVAL;
}
if (!param) {
WMI_LOGE("lo stop event param is null");
return QDF_STATUS_E_INVAL;
}
lo_param = param_tlvs->fixed_param;
param->vdev_id = lo_param->vdev_id;
param->reason_code = lo_param->reason;
WMI_LOGD("%s: vdev_id:%d, reason:%d", __func__,
param->vdev_id, param->reason_code);
return QDF_STATUS_SUCCESS;
}
void wmi_p2p_listen_offload_attach_tlv(wmi_unified_t wmi_handle)
{
struct wmi_ops *ops = wmi_handle->ops;
ops->send_p2p_lo_start_cmd = send_p2p_lo_start_cmd_tlv;
ops->send_p2p_lo_stop_cmd = send_p2p_lo_stop_cmd_tlv;
ops->extract_p2p_lo_stop_ev_param =
extract_p2p_lo_stop_ev_param_tlv;
}
#endif /* FEATURE_P2P_LISTEN_OFFLOAD */
void wmi_p2p_attach_tlv(wmi_unified_t wmi_handle)
{
struct wmi_ops *ops = wmi_handle->ops;
ops->send_set_p2pgo_oppps_req_cmd = send_set_p2pgo_oppps_req_cmd_tlv;
ops->send_set_p2pgo_noa_req_cmd = send_set_p2pgo_noa_req_cmd_tlv;
ops->extract_p2p_noa_ev_param = extract_p2p_noa_ev_param_tlv;
wmi_p2p_listen_offload_attach_tlv(wmi_handle);
}

View File

@@ -25,6 +25,32 @@
#include "wmi_unified_pmo_api.h"
#include "wlan_pmo_hw_filter_public_struct.h"
#ifdef FEATURE_WLAN_D0WOW
QDF_STATUS wmi_unified_d0wow_enable_send(void *wmi_hdl,
uint8_t mac_id)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_d0wow_enable_cmd)
return wmi_handle->ops->send_d0wow_enable_cmd(wmi_handle,
mac_id);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_d0wow_disable_send(void *wmi_hdl,
uint8_t mac_id)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_d0wow_disable_cmd)
return wmi_handle->ops->send_d0wow_disable_cmd(wmi_handle,
mac_id);
return QDF_STATUS_E_FAILURE;
}
#endif /* FEATURE_WLAN_D0WOW */
QDF_STATUS wmi_unified_add_wow_wakeup_event_cmd(void *wmi_hdl,
uint32_t vdev_id,
uint32_t *bitmap,
@@ -57,6 +83,21 @@ QDF_STATUS wmi_unified_wow_patterns_to_fw_cmd(void *wmi_hdl,
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_enable_arp_ns_offload_cmd(void *wmi_hdl,
struct pmo_arp_offload_params *arp_offload_req,
struct pmo_ns_offload_params *ns_offload_req,
uint8_t vdev_id)
{
struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
if (wmi_handle->ops->send_enable_arp_ns_offload_cmd)
return wmi_handle->ops->send_enable_arp_ns_offload_cmd(
wmi_handle,
arp_offload_req, ns_offload_req, vdev_id);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_add_clear_mcbc_filter_cmd(void *wmi_hdl,
uint8_t vdev_id,
struct qdf_mac_addr multicast_addr,
@@ -84,22 +125,44 @@ QDF_STATUS wmi_unified_multiple_add_clear_mcbc_filter_cmd(void *wmi_hdl,
return QDF_STATUS_E_FAILURE;
}
#ifdef FEATURE_WLAN_RA_FILTERING
QDF_STATUS wmi_unified_wow_sta_ra_filter_cmd(void *wmi_hdl,
uint8_t vdev_id, uint8_t default_pattern,
uint16_t rate_limit_interval)
QDF_STATUS wmi_unified_conf_hw_filter_cmd(void *opaque_wmi,
struct pmo_hw_filter_params *req)
{
struct wmi_unified *wmi = opaque_wmi;
if (!wmi->ops->send_conf_hw_filter_cmd)
return QDF_STATUS_E_NOSUPPORT;
return wmi->ops->send_conf_hw_filter_cmd(wmi, req);
}
QDF_STATUS wmi_unified_send_gtk_offload_cmd(void *wmi_hdl, uint8_t vdev_id,
struct pmo_gtk_req *params,
bool enable_offload,
uint32_t gtk_offload_opcode)
{
struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
if (wmi_handle->ops->send_wow_sta_ra_filter_cmd)
return wmi_handle->ops->send_wow_sta_ra_filter_cmd(wmi_handle,
vdev_id, default_pattern, rate_limit_interval);
if (wmi_handle->ops->send_gtk_offload_cmd)
return wmi_handle->ops->send_gtk_offload_cmd(wmi_handle,
vdev_id, params, enable_offload,
gtk_offload_opcode);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_process_gtk_offload_getinfo_cmd(void *wmi_hdl,
uint8_t vdev_id,
uint64_t offload_req_opcode)
{
struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
if (wmi_handle->ops->send_process_gtk_offload_getinfo_cmd)
return wmi_handle->ops->send_process_gtk_offload_getinfo_cmd(
wmi_handle, vdev_id, offload_req_opcode);
return QDF_STATUS_E_FAILURE;
}
#endif /* FEATURE_WLAN_RA_FILTERING */
QDF_STATUS wmi_unified_enable_enhance_multicast_offload_cmd(
void *wmi_hdl, uint8_t vdev_id, bool action)
@@ -127,19 +190,22 @@ QDF_STATUS wmi_extract_gtk_rsp_event(void *wmi_hdl, void *evt_buf,
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_process_gtk_offload_getinfo_cmd(void *wmi_hdl,
uint8_t vdev_id,
uint64_t offload_req_opcode)
#ifdef FEATURE_WLAN_RA_FILTERING
QDF_STATUS wmi_unified_wow_sta_ra_filter_cmd(void *wmi_hdl,
uint8_t vdev_id, uint8_t default_pattern,
uint16_t rate_limit_interval)
{
struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
if (wmi_handle->ops->send_process_gtk_offload_getinfo_cmd)
return wmi_handle->ops->send_process_gtk_offload_getinfo_cmd(
wmi_handle, vdev_id, offload_req_opcode);
if (wmi_handle->ops->send_wow_sta_ra_filter_cmd)
return wmi_handle->ops->send_wow_sta_ra_filter_cmd(wmi_handle,
vdev_id, default_pattern, rate_limit_interval);
return QDF_STATUS_E_FAILURE;
}
#endif /* FEATURE_WLAN_RA_FILTERING */
QDF_STATUS wmi_unified_action_frame_patterns_cmd(void *wmi_hdl,
struct pmo_action_wakeup_set_params *action_params)
@@ -153,74 +219,6 @@ QDF_STATUS wmi_unified_action_frame_patterns_cmd(void *wmi_hdl,
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_send_gtk_offload_cmd(void *wmi_hdl, uint8_t vdev_id,
struct pmo_gtk_req *params,
bool enable_offload,
uint32_t gtk_offload_opcode)
{
struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
if (wmi_handle->ops->send_gtk_offload_cmd)
return wmi_handle->ops->send_gtk_offload_cmd(wmi_handle,
vdev_id, params, enable_offload,
gtk_offload_opcode);
return QDF_STATUS_E_FAILURE;
}
#ifdef WLAN_FEATURE_PACKET_FILTERING
QDF_STATUS wmi_unified_enable_disable_packet_filter_cmd(void *wmi_hdl,
uint8_t vdev_id, bool enable)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_enable_disable_packet_filter_cmd)
return wmi_handle->ops->send_enable_disable_packet_filter_cmd(
wmi_handle, vdev_id, enable);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_config_packet_filter_cmd(void *wmi_hdl,
uint8_t vdev_id, struct pmo_rcv_pkt_fltr_cfg *rcv_filter_param,
uint8_t filter_id, bool enable)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_config_packet_filter_cmd)
return wmi_handle->ops->send_config_packet_filter_cmd(
wmi_handle, vdev_id, rcv_filter_param, filter_id, enable);
return QDF_STATUS_E_FAILURE;
}
#endif
QDF_STATUS wmi_unified_enable_arp_ns_offload_cmd(void *wmi_hdl,
struct pmo_arp_offload_params *arp_offload_req,
struct pmo_ns_offload_params *ns_offload_req,
uint8_t vdev_id)
{
struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
if (wmi_handle->ops->send_enable_arp_ns_offload_cmd)
return wmi_handle->ops->send_enable_arp_ns_offload_cmd(
wmi_handle,
arp_offload_req, ns_offload_req, vdev_id);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_conf_hw_filter_cmd(void *opaque_wmi,
struct pmo_hw_filter_params *req)
{
struct wmi_unified *wmi = opaque_wmi;
if (!wmi->ops->send_conf_hw_filter_cmd)
return QDF_STATUS_E_NOSUPPORT;
return wmi->ops->send_conf_hw_filter_cmd(wmi, req);
}
#ifdef FEATURE_WLAN_LPHB
QDF_STATUS wmi_unified_lphb_config_hbenable_cmd(void *wmi_hdl,
wmi_hb_set_enable_cmd_fixed_param *params)
@@ -282,3 +280,104 @@ QDF_STATUS wmi_unified_lphb_config_udp_pkt_filter_cmd(void *wmi_hdl,
return QDF_STATUS_E_FAILURE;
}
#endif /* FEATURE_WLAN_LPHB */
#ifdef WLAN_FEATURE_PACKET_FILTERING
QDF_STATUS wmi_unified_enable_disable_packet_filter_cmd(void *wmi_hdl,
uint8_t vdev_id, bool enable)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_enable_disable_packet_filter_cmd)
return wmi_handle->ops->send_enable_disable_packet_filter_cmd(
wmi_handle, vdev_id, enable);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_config_packet_filter_cmd(void *wmi_hdl,
uint8_t vdev_id, struct pmo_rcv_pkt_fltr_cfg *rcv_filter_param,
uint8_t filter_id, bool enable)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_config_packet_filter_cmd)
return wmi_handle->ops->send_config_packet_filter_cmd(
wmi_handle, vdev_id, rcv_filter_param, filter_id, enable);
return QDF_STATUS_E_FAILURE;
}
#endif /* WLAN_FEATURE_PACKET_FILTERING */
QDF_STATUS wmi_unified_wow_delete_pattern_cmd(void *wmi_hdl, uint8_t ptrn_id,
uint8_t vdev_id)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_wow_delete_pattern_cmd)
return wmi_handle->ops->send_wow_delete_pattern_cmd(wmi_handle,
ptrn_id,
vdev_id);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_host_wakeup_ind_to_fw_cmd(void *wmi_hdl)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_host_wakeup_ind_to_fw_cmd)
return wmi_handle->ops->send_host_wakeup_ind_to_fw_cmd(wmi_handle);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_wow_timer_pattern_cmd(void *wmi_hdl, uint8_t vdev_id,
uint32_t cookie, uint32_t time)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_wow_timer_pattern_cmd)
return wmi_handle->ops->send_wow_timer_pattern_cmd(wmi_handle,
vdev_id, cookie, time);
return QDF_STATUS_E_FAILURE;
}
#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
QDF_STATUS wmi_unified_enable_ext_wow_cmd(void *wmi_hdl,
struct ext_wow_params *params)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_enable_ext_wow_cmd)
return wmi_handle->ops->send_enable_ext_wow_cmd(wmi_handle,
params);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_set_app_type2_params_in_fw_cmd(void *wmi_hdl,
struct app_type2_params *appType2Params)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_set_app_type2_params_in_fw_cmd)
return wmi_handle->ops->send_set_app_type2_params_in_fw_cmd(
wmi_handle, appType2Params);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_app_type1_params_in_fw_cmd(void *wmi_hdl,
struct app_type1_params *app_type1_params)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_app_type1_params_in_fw_cmd)
return wmi_handle->ops->send_app_type1_params_in_fw_cmd(
wmi_handle, app_type1_params);
return QDF_STATUS_E_FAILURE;
}
#endif /* WLAN_FEATURE_EXTWOW_SUPPORT */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,314 @@
/*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include <osdep.h>
#include <wmi.h>
#include <wmi_unified_priv.h>
#include <wmi_unified_roam_param.h>
#include <wmi_unified_roam_api.h>
#ifdef FEATURE_LFR_SUBNET_DETECTION
QDF_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 QDF_STATUS_E_FAILURE;
}
#endif /* FEATURE_LFR_SUBNET_DETECTION */
#ifdef FEATURE_RSSI_MONITOR
QDF_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_set_rssi_monitoring_cmd)
return wmi_handle->ops->send_set_rssi_monitoring_cmd(wmi_handle,
req);
return QDF_STATUS_E_FAILURE;
}
#endif /* FEATURE_RSSI_MONITOR */
QDF_STATUS wmi_unified_roam_scan_offload_rssi_thresh_cmd(void *wmi_hdl,
struct roam_offload_scan_rssi_params
*roam_req)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_roam_scan_offload_rssi_thresh_cmd)
return wmi_handle->ops->send_roam_scan_offload_rssi_thresh_cmd(
wmi_handle, roam_req);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_roam_mawc_params_cmd(
void *wmi_hdl, struct wmi_mawc_roam_params *params)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_roam_mawc_params_cmd)
return wmi_handle->ops->send_roam_mawc_params_cmd(wmi_handle,
params);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_roam_scan_filter_cmd(void *wmi_hdl,
struct roam_scan_filter_params *roam_req)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_roam_scan_filter_cmd)
return wmi_handle->ops->send_roam_scan_filter_cmd(wmi_handle,
roam_req);
return QDF_STATUS_E_FAILURE;
}
#ifdef FEATURE_WLAN_ESE
QDF_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 QDF_STATUS_E_FAILURE;
}
QDF_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 QDF_STATUS_E_FAILURE;
}
#endif /* FEATURE_WLAN_ESE */
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
QDF_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 QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_roam_synch_complete_cmd(void *wmi_hdl,
uint8_t vdev_id)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_process_roam_synch_complete_cmd)
return wmi_handle->ops->send_process_roam_synch_complete_cmd(
wmi_handle, vdev_id);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_roam_invoke_cmd(void *wmi_hdl,
struct wmi_roam_invoke_cmd *roaminvoke,
uint32_t ch_hz)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_roam_invoke_cmd)
return wmi_handle->ops->send_roam_invoke_cmd(wmi_handle,
roaminvoke,
ch_hz);
return QDF_STATUS_E_FAILURE;
}
#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
QDF_STATUS wmi_unified_roam_scan_offload_mode_cmd(void *wmi_hdl,
wmi_start_scan_cmd_fixed_param *scan_cmd_fp,
struct roam_offload_scan_params *roam_req)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_roam_scan_offload_mode_cmd)
return wmi_handle->ops->send_roam_scan_offload_mode_cmd(
wmi_handle, scan_cmd_fp, roam_req);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_send_roam_scan_offload_ap_cmd(void *wmi_hdl,
struct ap_profile_params *ap_profile)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_roam_scan_offload_ap_profile_cmd)
return wmi_handle->ops->send_roam_scan_offload_ap_profile_cmd(
wmi_handle, ap_profile);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_roam_scan_offload_cmd(void *wmi_hdl,
uint32_t command, uint32_t vdev_id)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_roam_scan_offload_cmd)
return wmi_handle->ops->send_roam_scan_offload_cmd(wmi_handle,
command,
vdev_id);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_roam_scan_offload_scan_period(void *wmi_hdl,
uint32_t scan_period,
uint32_t scan_age,
uint32_t vdev_id)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_roam_scan_offload_scan_period_cmd)
return wmi_handle->ops->send_roam_scan_offload_scan_period_cmd(wmi_handle,
scan_period, scan_age, vdev_id);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_roam_scan_offload_chan_list_cmd(void *wmi_hdl,
uint8_t chan_count,
uint32_t *chan_list,
uint8_t list_type, uint32_t vdev_id)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_roam_scan_offload_chan_list_cmd)
return wmi_handle->ops->send_roam_scan_offload_chan_list_cmd(wmi_handle,
chan_count, chan_list,
list_type, vdev_id);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_roam_scan_offload_rssi_change_cmd(void *wmi_hdl,
uint32_t vdev_id,
int32_t rssi_change_thresh,
uint32_t bcn_rssi_weight,
uint32_t hirssi_delay_btw_scans)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_roam_scan_offload_rssi_change_cmd)
return wmi_handle->ops->send_roam_scan_offload_rssi_change_cmd(wmi_handle,
vdev_id, rssi_change_thresh,
bcn_rssi_weight, hirssi_delay_btw_scans);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_set_per_roam_config(void *wmi_hdl,
struct wmi_per_roam_config_req *req_buf)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_per_roam_config_cmd)
return wmi_handle->ops->send_per_roam_config_cmd(wmi_handle,
req_buf);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_send_limit_off_chan_cmd(void *wmi_hdl,
struct wmi_limit_off_chan_param *limit_off_chan_param)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_limit_off_chan_cmd)
return wmi_handle->ops->send_limit_off_chan_cmd(wmi_handle,
limit_off_chan_param);
return QDF_STATUS_E_FAILURE;
}
#ifdef WLAN_FEATURE_FILS_SK
QDF_STATUS wmi_unified_roam_send_hlp_cmd(void *wmi_hdl,
struct hlp_params *req_buf)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_roam_scan_hlp_cmd)
return wmi_handle->ops->send_roam_scan_hlp_cmd(wmi_handle,
req_buf);
return QDF_STATUS_E_FAILURE;
}
#endif /* WLAN_FEATURE_FILS_SK */
QDF_STATUS wmi_unified_send_btm_config(void *wmi_hdl,
struct wmi_btm_config *params)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_btm_config)
return wmi_handle->ops->send_btm_config(wmi_handle,
params);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_offload_11k_cmd(void *wmi_hdl,
struct wmi_11k_offload_params *params)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_offload_11k_cmd)
return wmi_handle->ops->send_offload_11k_cmd(wmi_handle,
params);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_invoke_neighbor_report_cmd(void *wmi_hdl,
struct wmi_invoke_neighbor_report_params *params)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_invoke_neighbor_report_cmd)
return wmi_handle->ops->send_invoke_neighbor_report_cmd(
wmi_handle, params);
return QDF_STATUS_E_FAILURE;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,491 @@
/*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: Implement API's specific to STA component.
*/
#include <wmi.h>
#include "wmi_unified_priv.h"
#include "wmi_unified_sta_api.h"
QDF_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 QDF_STATUS_E_FAILURE;
}
QDF_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 QDF_STATUS_E_FAILURE;
}
QDF_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 QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_process_dhcp_ind(void *wmi_hdl,
wmi_peer_set_param_cmd_fixed_param *ta_dhcp_ind)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_process_dhcp_ind_cmd)
return wmi_handle->ops->send_process_dhcp_ind_cmd(wmi_handle,
ta_dhcp_ind);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_get_link_speed_cmd(void *wmi_hdl,
wmi_mac_addr peer_macaddr)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_get_link_speed_cmd)
return wmi_handle->ops->send_get_link_speed_cmd(wmi_handle,
peer_macaddr);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_fw_profiling_data_cmd(void *wmi_hdl,
uint32_t cmd, uint32_t value1, uint32_t value2)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_fw_profiling_cmd)
return wmi_handle->ops->send_fw_profiling_cmd(wmi_handle,
cmd,
value1,
value2);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_nat_keepalive_en_cmd(void *wmi_hdl, uint8_t vdev_id)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_nat_keepalive_en_cmd)
return wmi_handle->ops->send_nat_keepalive_en_cmd(wmi_handle,
vdev_id);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_wlm_latency_level_cmd(void *wmi_hdl,
struct wlm_latency_level_param *param)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_wlm_latency_level_cmd)
return wmi_handle->ops->send_wlm_latency_level_cmd(wmi_handle,
param);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_nan_req_cmd(void *wmi_hdl,
struct nan_req_params *nan_req)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_nan_req_cmd)
return wmi_handle->ops->send_nan_req_cmd(wmi_handle,
nan_req);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_process_set_ie_info_cmd(void *wmi_hdl,
struct vdev_ie_info_param *ie_info)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_process_set_ie_info_cmd)
return wmi_handle->ops->send_process_set_ie_info_cmd(wmi_handle,
ie_info);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_set_base_macaddr_indicate_cmd(void *wmi_hdl,
uint8_t *custom_addr)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_set_base_macaddr_indicate_cmd)
return wmi_handle->ops->send_set_base_macaddr_indicate_cmd(wmi_handle,
custom_addr);
return QDF_STATUS_E_FAILURE;
}
#ifdef CONVERGED_TDLS_ENABLE
QDF_STATUS wmi_unified_set_tdls_offchan_mode_cmd(void *wmi_hdl,
struct tdls_channel_switch_params *chan_switch_params)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_set_tdls_offchan_mode_cmd)
return wmi_handle->ops->send_set_tdls_offchan_mode_cmd(wmi_handle,
chan_switch_params);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_update_fw_tdls_state_cmd(void *wmi_hdl,
void *tdls_param, uint8_t tdls_state)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_update_fw_tdls_state_cmd)
return wmi_handle->ops->send_update_fw_tdls_state_cmd(wmi_handle,
tdls_param, tdls_state);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_update_tdls_peer_state_cmd(void *wmi_hdl,
struct tdls_peer_state_params *peerStateParams,
uint32_t *ch_mhz)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_update_tdls_peer_state_cmd)
return wmi_handle->ops->send_update_tdls_peer_state_cmd(wmi_handle,
peerStateParams, ch_mhz);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_extract_vdev_tdls_ev_param(void *wmi_hdl, void *evt_buf,
struct tdls_event_info *param)
{
wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
if (wmi_handle->ops->extract_vdev_tdls_ev_param)
return wmi_handle->ops->extract_vdev_tdls_ev_param(wmi_handle,
evt_buf, param);
return QDF_STATUS_E_FAILURE;
}
#endif /* CONVERGED_TDLS_ENABLE */
#ifdef WLAN_FEATURE_DISA
QDF_STATUS wmi_unified_encrypt_decrypt_send_cmd(void *wmi_hdl,
struct disa_encrypt_decrypt_req_params *params)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_encrypt_decrypt_send_cmd)
return wmi_handle->ops->send_encrypt_decrypt_send_cmd(
wmi_handle,
params);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_extract_encrypt_decrypt_resp_params(void *wmi_hdl,
uint8_t *evt_buf,
struct disa_encrypt_decrypt_resp_params *resp)
{
struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
if (wmi_handle->ops->extract_encrypt_decrypt_resp_event)
return wmi_handle->ops->extract_encrypt_decrypt_resp_event(
wmi_handle, evt_buf, resp);
return QDF_STATUS_E_FAILURE;
}
#endif /* WLAN_FEATURE_DISA */
QDF_STATUS wmi_unified_send_sar_limit_cmd(void *wmi_hdl,
struct sar_limit_cmd_params *params)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_sar_limit_cmd)
return wmi_handle->ops->send_sar_limit_cmd(
wmi_handle,
params);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_get_sar_limit_cmd(void *wmi_hdl)
{
wmi_unified_t wmi_handle = wmi_hdl;
if (wmi_handle->ops->get_sar_limit_cmd)
return wmi_handle->ops->get_sar_limit_cmd(wmi_handle);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_extract_sar_limit_event(void *wmi_hdl,
uint8_t *evt_buf,
struct sar_limit_event *event)
{
wmi_unified_t wmi_handle = wmi_hdl;
if (wmi_handle->ops->extract_sar_limit_event)
return wmi_handle->ops->extract_sar_limit_event(wmi_handle,
evt_buf,
event);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_extract_sar2_result_event(void *handle,
uint8_t *event, uint32_t len)
{
wmi_unified_t wmi_handle = handle;
if (wmi_handle->ops->extract_sar2_result_event)
return wmi_handle->ops->extract_sar2_result_event(wmi_handle,
event,
len);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_set_del_pmkid_cache(void *wmi_hdl,
struct wmi_unified_pmk_cache *req_buf)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_set_del_pmkid_cache_cmd)
return wmi_handle->ops->send_set_del_pmkid_cache_cmd(wmi_handle,
req_buf);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_del_ts_cmd(void *wmi_hdl, uint8_t vdev_id,
uint8_t ac)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_del_ts_cmd)
return wmi_handle->ops->send_del_ts_cmd(wmi_handle,
vdev_id, ac);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_aggr_qos_cmd(void *wmi_hdl,
struct aggr_add_ts_param *aggr_qos_rsp_msg)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_aggr_qos_cmd)
return wmi_handle->ops->send_aggr_qos_cmd(wmi_handle,
aggr_qos_rsp_msg);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_add_ts_cmd(void *wmi_hdl,
struct add_ts_param *msg)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_add_ts_cmd)
return wmi_handle->ops->send_add_ts_cmd(wmi_handle,
msg);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_process_add_periodic_tx_ptrn_cmd(void *wmi_hdl,
struct periodic_tx_pattern *
pAddPeriodicTxPtrnParams,
uint8_t vdev_id)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_process_add_periodic_tx_ptrn_cmd)
return wmi_handle->ops->send_process_add_periodic_tx_ptrn_cmd(
wmi_handle,
pAddPeriodicTxPtrnParams,
vdev_id);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_process_del_periodic_tx_ptrn_cmd(void *wmi_hdl,
uint8_t vdev_id,
uint8_t pattern_id)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_process_del_periodic_tx_ptrn_cmd)
return wmi_handle->ops->send_process_del_periodic_tx_ptrn_cmd(
wmi_handle,
vdev_id,
pattern_id);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_set_auto_shutdown_timer_cmd(void *wmi_hdl,
uint32_t timer_val)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_set_auto_shutdown_timer_cmd)
return wmi_handle->ops->send_set_auto_shutdown_timer_cmd(
wmi_handle,
timer_val);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_set_led_flashing_cmd(void *wmi_hdl,
struct flashing_req_params *flashing)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_set_led_flashing_cmd)
return wmi_handle->ops->send_set_led_flashing_cmd(wmi_handle,
flashing);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_process_ch_avoid_update_cmd(void *wmi_hdl)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_process_ch_avoid_update_cmd)
return wmi_handle->ops->send_process_ch_avoid_update_cmd(
wmi_handle);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_pdev_set_pcl_cmd(void *wmi_hdl,
struct wmi_pcl_chan_weights *msg)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_pdev_set_pcl_cmd)
return wmi_handle->ops->send_pdev_set_pcl_cmd(wmi_handle, msg);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_soc_set_hw_mode_cmd(void *wmi_hdl,
uint32_t hw_mode_index)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_pdev_set_hw_mode_cmd)
return wmi_handle->ops->send_pdev_set_hw_mode_cmd(wmi_handle,
hw_mode_index);
return QDF_STATUS_E_FAILURE;
}
#ifdef WLAN_POLICY_MGR_ENABLE
QDF_STATUS wmi_unified_pdev_set_dual_mac_config_cmd(void *wmi_hdl,
struct policy_mgr_dual_mac_config *msg)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_pdev_set_dual_mac_config_cmd)
return wmi_handle->ops->send_pdev_set_dual_mac_config_cmd(
wmi_handle,
msg);
return QDF_STATUS_E_FAILURE;
}
#endif /* WLAN_POLICY_MGR_ENABLE */
QDF_STATUS wmi_unified_send_adapt_dwelltime_params_cmd(void *wmi_hdl,
struct wmi_adaptive_dwelltime_params *dwelltime_params)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_adapt_dwelltime_params_cmd)
return wmi_handle->ops->
send_adapt_dwelltime_params_cmd(wmi_handle,
dwelltime_params);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_send_dbs_scan_sel_params_cmd(void *wmi_hdl,
struct wmi_dbs_scan_sel_params *dbs_scan_params)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_dbs_scan_sel_params_cmd)
return wmi_handle->ops->
send_dbs_scan_sel_params_cmd(wmi_handle,
dbs_scan_params);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_set_arp_stats_req(void *wmi_hdl,
struct set_arp_stats *req_buf)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_set_arp_stats_req_cmd)
return wmi_handle->ops->send_set_arp_stats_req_cmd(wmi_handle,
req_buf);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_get_arp_stats_req(void *wmi_hdl,
struct get_arp_stats *req_buf)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_get_arp_stats_req_cmd)
return wmi_handle->ops->send_get_arp_stats_req_cmd(wmi_handle,
req_buf);
return QDF_STATUS_E_FAILURE;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff