From 0a35a6afb86e73dce57795825488a35e1fc62d6c Mon Sep 17 00:00:00 2001 From: Himanshu Batra Date: Fri, 28 Jun 2019 15:42:40 +0530 Subject: [PATCH] qcacmn: Replace void * wmi_hdl with abstract type (6/10) Replace void * wmi handle with abstract type handles provided by wmi component Change-Id: I503438fbaf3bc2d475798bc908a70902d11881af CRs-Fixed: 2482568 --- .../src/target_if_direct_buf_rx_main.c | 2 +- wmi/inc/wmi_unified_concurrency_api.h | 25 +-- wmi/inc/wmi_unified_dbr_api.h | 18 +- wmi/inc/wmi_unified_dfs_api.h | 34 ++-- wmi/inc/wmi_unified_extscan_api.h | 152 +++++++++++++--- wmi/src/wmi_unified_concurrency_api.c | 20 +- wmi/src/wmi_unified_dbr_api.c | 18 +- wmi/src/wmi_unified_dfs_api.c | 25 +-- wmi/src/wmi_unified_extscan_api.c | 171 ++++-------------- 9 files changed, 223 insertions(+), 242 deletions(-) diff --git a/target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.c b/target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.c index b3714c9085..8d57d5a730 100644 --- a/target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.c +++ b/target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.c @@ -562,7 +562,7 @@ static QDF_STATUS target_if_dbr_cfg_tgt(struct wlan_objmgr_pdev *pdev, { QDF_STATUS status; struct wlan_objmgr_psoc *psoc; - void *wmi_hdl; + wmi_unified_t wmi_hdl; struct direct_buf_rx_cfg_req dbr_cfg_req = {0}; struct direct_buf_rx_ring_cfg *dbr_ring_cfg; struct direct_buf_rx_ring_cap *dbr_ring_cap; diff --git a/wmi/inc/wmi_unified_concurrency_api.h b/wmi/inc/wmi_unified_concurrency_api.h index 3e2d06d356..2f2e968ed4 100644 --- a/wmi/inc/wmi_unified_concurrency_api.h +++ b/wmi/inc/wmi_unified_concurrency_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2019 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 @@ -24,22 +24,22 @@ /** * wmi_unified_set_mcc_channel_time_quota_cmd() - set MCC channel time quota - * @wmi: wmi handle - * @adapter_1_chan_number: adapter 1 channel number + * @wmi_handle: wmi handle + * @adapter_1_chan_freq: adapter 1 channel number * @adapter_1_quota: adapter 1 quota - * @adapter_2_chan_number: adapter 2 channel number + * @adapter_2_chan_freq: 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, +QDF_STATUS wmi_unified_set_mcc_channel_time_quota_cmd( + wmi_unified_t wmi_handle, uint32_t adapter_1_chan_freq, uint32_t adapter_1_quota, uint32_t adapter_2_chan_freq); /** * wmi_unified_set_mcc_channel_time_latency_cmd() - set MCC channel time latency - * @wmi: wmi handle - * @mcc_channel: mcc channel + * @wmi_handle: wmi handle + * @mcc_channel_freq: mcc channel freq * @mcc_channel_time_latency: MCC channel time latency. * * Currently used to set time latency for an MCC vdev/adapter using operating @@ -48,8 +48,8 @@ QDF_STATUS wmi_unified_set_mcc_channel_time_quota_cmd * * 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, +QDF_STATUS wmi_unified_set_mcc_channel_time_latency_cmd( + wmi_unified_t wmi_handle, uint32_t mcc_channel_freq, uint32_t mcc_channel_time_latency); /** @@ -57,13 +57,14 @@ QDF_STATUS wmi_unified_set_mcc_channel_time_latency_cmd * scheduler * @wmi_handle: wmi handle * @mcc_adaptive_scheduler: enable/disable + * @pdev_id: pdev id * * 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); + wmi_unified_t wmi_handle, uint32_t mcc_adaptive_scheduler, + uint32_t pdev_id); #endif /* _WMI_UNIFIED_CONCURRENCY_API_H_ */ diff --git a/wmi/inc/wmi_unified_dbr_api.h b/wmi/inc/wmi_unified_dbr_api.h index 484d85ee1a..2f77a1b926 100644 --- a/wmi/inc/wmi_unified_dbr_api.h +++ b/wmi/inc/wmi_unified_dbr_api.h @@ -30,32 +30,32 @@ typedef struct wmi_unified *wmi_unified_t; /** * wmi_unified_dbr_ring_cfg: Configure direct buffer rx rings - * @wmi_hdl: WMI handle + * @wmi_handle: WMI handle * @cfg: pointer to direct buffer rx config request * * Return: QDF status of operation */ -QDF_STATUS wmi_unified_dbr_ring_cfg(void *wmi_hdl, - struct direct_buf_rx_cfg_req *cfg); +QDF_STATUS wmi_unified_dbr_ring_cfg(wmi_unified_t wmi_handle, + struct direct_buf_rx_cfg_req *cfg); /** * wmi_extract_dbr_buf_release_fixed : Extract direct buffer rx fixed param * from buffer release event - * @wmi_hdl: WMI handle + * @wmi_handle: WMI handle * @evt_buf: Event buffer * @param: Pointer to direct buffer rx response struct * * Return: QDF status of operation */ QDF_STATUS wmi_extract_dbr_buf_release_fixed( - void *wmi_hdl, + wmi_unified_t wmi_handle, uint8_t *evt_buf, struct direct_buf_rx_rsp *param); /** * wmi_extract_dbr_buf_release_entry: Extract direct buffer rx buffer tlv * - * @wmi_hdl: WMI handle + * @wmi_handle: WMI handle * @evt_buf: Event buffer * @idx: Index of the module for which capability is received * @param: Pointer to direct buffer rx entry @@ -63,14 +63,14 @@ QDF_STATUS wmi_extract_dbr_buf_release_fixed( * Return: QDF status of operation */ QDF_STATUS wmi_extract_dbr_buf_release_entry( - void *wmi_hdl, + wmi_unified_t wmi_handle, uint8_t *evt_buf, uint8_t idx, struct direct_buf_rx_entry *param); /** * wmi_extract_dbr_buf_metadata: Extract direct buffer metadata * - * @wmi_hdl: WMI handle + * @wmi_handle: WMI handle * @evt_buf: Event buffer * @idx: Index of the module for which capability is received * @param: Pointer to direct buffer metadata @@ -78,7 +78,7 @@ QDF_STATUS wmi_extract_dbr_buf_release_entry( * Return: QDF status of operation */ QDF_STATUS wmi_extract_dbr_buf_metadata( - void *wmi_hdl, + wmi_unified_t wmi_handle, uint8_t *evt_buf, uint8_t idx, struct direct_buf_rx_metadata *param); diff --git a/wmi/inc/wmi_unified_dfs_api.h b/wmi/inc/wmi_unified_dfs_api.h index 932da83cb7..cf8ccca9ee 100644 --- a/wmi/inc/wmi_unified_dfs_api.h +++ b/wmi/inc/wmi_unified_dfs_api.h @@ -28,14 +28,15 @@ /** * wmi_extract_dfs_cac_complete_event() - function to handle cac complete event - * @handle: wma handle + * @wmi_handle: wmi handle * @event_buf: event buffer * @vdev_id: vdev id * @len: length of buffer * * Return: 0 for success or error code */ -QDF_STATUS wmi_extract_dfs_cac_complete_event(void *wmi_hdl, +QDF_STATUS wmi_extract_dfs_cac_complete_event( + wmi_unified_t wmi_handle, uint8_t *evt_buf, uint32_t *vdev_id, uint32_t len); @@ -43,27 +44,27 @@ QDF_STATUS wmi_extract_dfs_cac_complete_event(void *wmi_hdl, /** * wmi_extract_dfs_ocac_complete_event() - function to handle off channel * CAC complete event - * @handle: wmi handle + * @wmi_handle: wmi handle * @event_buf: event buffer - * @vdev_adfs_complete_status: off channel cac complete params + * @param: off channel cac complete params * * Return: 0 for success or error code */ QDF_STATUS -wmi_extract_dfs_ocac_complete_event(void *wmi_hdl, uint8_t *evt_buf, +wmi_extract_dfs_ocac_complete_event(wmi_unified_t wmi_handle, uint8_t *evt_buf, struct vdev_adfs_complete_status *param); /** * wmi_extract_dfs_radar_detection_event() - function to handle radar event - * @handle: wma handle + * @wmi_handle: wmi handle * @event_buf: event buffer * @radar_found: radar found event info - * @vdev_id: vdev id * @len: length of buffer * * Return: 0 for success or error code */ -QDF_STATUS wmi_extract_dfs_radar_detection_event(void *wmi_hdl, +QDF_STATUS wmi_extract_dfs_radar_detection_event( + wmi_unified_t wmi_handle, uint8_t *evt_buf, struct radar_found_info *radar_found, uint32_t len); @@ -71,14 +72,15 @@ QDF_STATUS wmi_extract_dfs_radar_detection_event(void *wmi_hdl, #ifdef QCA_MCL_DFS_SUPPORT /** * wmi_extract_wlan_radar_event_info() - function to handle radar pulse event. - * @wmi_hdl: wmi handle + * @wmi_handle: wmi handle * @evt_buf: event buffer * @wlan_radar_event: pointer to radar event info structure * @len: length of buffer * * Return: QDF_STATUS */ -QDF_STATUS wmi_extract_wlan_radar_event_info(void *wmi_hdl, +QDF_STATUS wmi_extract_wlan_radar_event_info( + wmi_unified_t wmi_handle, uint8_t *evt_buf, struct radar_event_info *wlan_radar_event, uint32_t len); @@ -87,38 +89,38 @@ QDF_STATUS wmi_extract_wlan_radar_event_info(void *wmi_hdl, #if defined(WLAN_DFS_FULL_OFFLOAD) && defined(QCA_DFS_NOL_OFFLOAD) /** * wmi_send_usenol_pdev_param() - function to send usenol pdev param. - * @wmi_hdl: wmi handle + * @wmi_handle: wmi handle * @usenol: value of usenol * @pdev: pointer to objmgr_pdev structure * * Return: QDF_STATUS */ -QDF_STATUS wmi_send_usenol_pdev_param(void *wmi_hdl, bool usenol, +QDF_STATUS wmi_send_usenol_pdev_param(wmi_unified_t wmi_handle, bool usenol, struct wlan_objmgr_pdev *pdev); /** * wmi_send_subchan_marking_pdev_param() - Function to send subchannel * marking pdev param. - * @wmi_hdl: WMI handle. + * @wmi_handle: WMI handle. * @subchanmark: Value of use subchannel marking. * @pdev: Pointer to objmgr_pdev structure. * * Return: QDF_STATUS */ QDF_STATUS -wmi_send_subchan_marking_pdev_param(void *wmi_hdl, +wmi_send_subchan_marking_pdev_param(wmi_unified_t wmi_handle, bool subchanmark, struct wlan_objmgr_pdev *pdev); #else static inline QDF_STATUS -wmi_send_usenol_pdev_param(void *wmi_hdl, bool usenol, +wmi_send_usenol_pdev_param(wmi_unified_t wmi_hdl, bool usenol, struct wlan_objmgr_pdev *pdev) { return QDF_STATUS_SUCCESS; } static inline QDF_STATUS -wmi_send_subchan_marking_pdev_param(void *wmi_hdl, +wmi_send_subchan_marking_pdev_param(wmi_unified_t wmi_handle, bool subchanmark, struct wlan_objmgr_pdev *pdev) { diff --git a/wmi/inc/wmi_unified_extscan_api.h b/wmi/inc/wmi_unified_extscan_api.h index 12e6e93ebd..102efbceb4 100644 --- a/wmi/inc/wmi_unified_extscan_api.h +++ b/wmi/inc/wmi_unified_extscan_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2019 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 @@ -19,47 +19,151 @@ #ifndef _WMI_UNIFIED_EXTSCAN_API_H_ #define _WMI_UNIFIED_EXTSCAN_API_H_ -QDF_STATUS wmi_unified_reset_passpoint_network_list_cmd(void *wmi_hdl, - struct wifi_passpoint_req_param *req); +/** + * wmi_unified_reset_passpoint_network_list_cmd() - reset passpoint network list + * @wmi_handle: wmi handle + * @req: passpoint network request structure + * + * This function sends down WMI command with network id set to wildcard id. + * firmware shall clear all the config entries + * + * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure + */ +QDF_STATUS wmi_unified_reset_passpoint_network_list_cmd( + wmi_unified_t wmi_handle, + struct wifi_passpoint_req_param *req); -QDF_STATUS wmi_unified_set_passpoint_network_list_cmd(void *wmi_hdl, - struct wifi_passpoint_req_param *req); +/** + * wmi_unified_set_passpoint_network_list_cmd() - set passpoint network list + * @wmi_handle: wmi handle + * @req: passpoint network request structure + * + * This function reads the incoming @req and fill in the destination + * WMI structure and send down the passpoint configs down to the firmware + * + * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure + */ -QDF_STATUS wmi_unified_set_epno_network_list_cmd(void *wmi_hdl, +QDF_STATUS wmi_unified_set_passpoint_network_list_cmd( + wmi_unified_t wmi_handle, + struct wifi_passpoint_req_param *req); + +/** wmi_unified_set_epno_network_list_cmd() - set epno network list + * @wmi_handle: wmi handle + * @req: epno config params request structure + * + * This function reads the incoming epno config request structure + * and constructs the WMI message to the firmware. + * + * Returns: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures, + * error number otherwise + */ +QDF_STATUS wmi_unified_set_epno_network_list_cmd( + wmi_unified_t wmi_handle, struct wifi_enhanced_pno_params *req); -QDF_STATUS wmi_unified_extscan_get_capabilities_cmd(void *wmi_hdl, - struct extscan_capabilities_params *pgetcapab); +/** + * wmi_unified_extscan_get_capabilities_cmd() - extscan get capabilities + * @wmi_handle: wmi handle + * @pgetcapab: get capabilities params + * + * This function send request to fw to get extscan capabilities. + * + * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure + */ +QDF_STATUS wmi_unified_extscan_get_capabilities_cmd( + wmi_unified_t wmi_handle, + struct extscan_capabilities_params *pgetcapab); -QDF_STATUS wmi_unified_extscan_get_cached_results_cmd(void *wmi_hdl, - struct extscan_cached_result_params *pcached_results); +/** + * wmi_unified_extscan_get_cached_results_cmd() - extscan get cached results + * @wmi_handle: wmi handle + * @pcached_results: cached results parameters + * + * This function send request to fw to get cached results. + * + * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure + */ +QDF_STATUS wmi_unified_extscan_get_cached_results_cmd( + wmi_unified_t wmi_handle, + struct extscan_cached_result_params *pcached_results); -QDF_STATUS wmi_unified_extscan_stop_change_monitor_cmd(void *wmi_hdl, - struct extscan_capabilities_reset_params *reset_req); +/** + * wmi_unified_extscan_stop_change_monitor_cmd() - send stop change monitor cmd + * @wmi_handle: wmi handle + * @reset_req: Reset change request params + * + * This function sends stop change monitor request to fw. + * + * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure + */ +QDF_STATUS wmi_unified_extscan_stop_change_monitor_cmd( + wmi_unified_t wmi_handle, + struct extscan_capabilities_reset_params *reset_req); -QDF_STATUS wmi_unified_extscan_start_change_monitor_cmd(void *wmi_hdl, - struct extscan_set_sig_changereq_params * - psigchange); +/** + * wmi_unified_extscan_start_change_monitor_cmd() - start change monitor cmd + * @wmi_handle: wmi handle + * @psigchange: change monitor request params + * + * This function sends start change monitor request to fw. + * + * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure + */ +QDF_STATUS wmi_unified_extscan_start_change_monitor_cmd( + wmi_unified_t wmi_handle, + struct extscan_set_sig_changereq_params *psigchange); -QDF_STATUS wmi_unified_extscan_stop_hotlist_monitor_cmd(void *wmi_hdl, - struct extscan_bssid_hotlist_reset_params *photlist_reset); +/** + * wmi_unified_extscan_stop_hotlist_monitor_cmd() - stop hotlist monitor + * @wmi_handle: wmi handle + * @photlist_reset: hotlist reset params + * + * This function configures hotlist monitor to stop in fw. + * + * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure + */ +QDF_STATUS wmi_unified_extscan_stop_hotlist_monitor_cmd( + wmi_unified_t wmi_handle, + struct extscan_bssid_hotlist_reset_params *photlist_reset); /** * wmi_unified_extscan_start_hotlist_monitor_cmd() - start hotlist monitor - * @wmi_hdl: wmi handle + * @wmi_handle: wmi handle * @params: hotlist params * * This function configures hotlist monitor to start in fw. * * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure */ -QDF_STATUS wmi_unified_extscan_start_hotlist_monitor_cmd(void *wmi_hdl, - struct extscan_bssid_hotlist_set_params *params); +QDF_STATUS wmi_unified_extscan_start_hotlist_monitor_cmd( + wmi_unified_t wmi_handle, + struct extscan_bssid_hotlist_set_params *params); -QDF_STATUS wmi_unified_stop_extscan_cmd(void *wmi_hdl, - struct extscan_stop_req_params *pstopcmd); +/** + * wmi_unified_stop_extscan_cmd() - stop extscan command to fw. + * @wmi_handle: wmi handle + * @pstopcmd: stop scan command request params + * + * This function sends stop extscan request to fw. + * + * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure. + */ +QDF_STATUS wmi_unified_stop_extscan_cmd( + wmi_unified_t wmi_handle, + struct extscan_stop_req_params *pstopcmd); -QDF_STATUS wmi_unified_start_extscan_cmd(void *wmi_hdl, - struct wifi_scan_cmd_req_params *pstart); +/** + * wmi_unified_start_extscan_cmd() - start extscan command to fw. + * @wmi_handle: wmi handle + * @pstart: scan command request params + * + * This function sends start extscan request to fw. + * + * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure. + */ +QDF_STATUS wmi_unified_start_extscan_cmd( + wmi_unified_t wmi_handle, + struct wifi_scan_cmd_req_params *pstart); #endif /* _WMI_UNIFIED_EXTSCAN_API_H_ */ diff --git a/wmi/src/wmi_unified_concurrency_api.c b/wmi/src/wmi_unified_concurrency_api.c index 783fba1988..b8dde1163b 100644 --- a/wmi/src/wmi_unified_concurrency_api.c +++ b/wmi/src/wmi_unified_concurrency_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2019 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 @@ -23,11 +23,9 @@ #include QDF_STATUS wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd( - void *wmi_hdl, uint32_t mcc_adaptive_scheduler, + wmi_unified_t wmi_handle, 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); @@ -35,11 +33,10 @@ QDF_STATUS wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd( return QDF_STATUS_E_FAILURE; } -QDF_STATUS wmi_unified_set_mcc_channel_time_latency_cmd(void *wmi_hdl, +QDF_STATUS wmi_unified_set_mcc_channel_time_latency_cmd( + wmi_unified_t wmi_handle, 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, @@ -48,12 +45,11 @@ QDF_STATUS wmi_unified_set_mcc_channel_time_latency_cmd(void *wmi_hdl, 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) +QDF_STATUS wmi_unified_set_mcc_channel_time_quota_cmd( + wmi_unified_t wmi_handle, + uint32_t adapter_1_chan_freq, + uint32_t adapter_1_quota, uint32_t adapter_2_chan_freq) { - 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, diff --git a/wmi/src/wmi_unified_dbr_api.c b/wmi/src/wmi_unified_dbr_api.c index 6d73ae6e22..c59633ed53 100644 --- a/wmi/src/wmi_unified_dbr_api.c +++ b/wmi/src/wmi_unified_dbr_api.c @@ -19,11 +19,9 @@ #include "wmi_unified_priv.h" #include "qdf_module.h" -QDF_STATUS wmi_unified_dbr_ring_cfg(void *wmi_hdl, - struct direct_buf_rx_cfg_req *cfg) +QDF_STATUS wmi_unified_dbr_ring_cfg(wmi_unified_t wmi_handle, + struct direct_buf_rx_cfg_req *cfg) { - wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; - if (wmi_handle->ops->send_dbr_cfg_cmd) return wmi_handle->ops->send_dbr_cfg_cmd(wmi_handle, cfg); @@ -31,12 +29,10 @@ QDF_STATUS wmi_unified_dbr_ring_cfg(void *wmi_hdl, } QDF_STATUS wmi_extract_dbr_buf_release_fixed( - void *wmi_hdl, + wmi_unified_t wmi_handle, uint8_t *evt_buf, struct direct_buf_rx_rsp *param) { - wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; - if (wmi_handle->ops->extract_dbr_buf_release_fixed) return wmi_handle->ops->extract_dbr_buf_release_fixed( wmi_handle, @@ -46,12 +42,10 @@ QDF_STATUS wmi_extract_dbr_buf_release_fixed( } QDF_STATUS wmi_extract_dbr_buf_release_entry( - void *wmi_hdl, + wmi_unified_t wmi_handle, uint8_t *evt_buf, uint8_t idx, struct direct_buf_rx_entry *param) { - wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; - if (wmi_handle->ops->extract_dbr_buf_release_entry) return wmi_handle->ops->extract_dbr_buf_release_entry( wmi_handle, @@ -61,12 +55,10 @@ QDF_STATUS wmi_extract_dbr_buf_release_entry( } QDF_STATUS wmi_extract_dbr_buf_metadata( - void *wmi_hdl, + wmi_unified_t wmi_handle, uint8_t *evt_buf, uint8_t idx, struct direct_buf_rx_metadata *param) { - wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl; - if (wmi_handle->ops->extract_dbr_buf_metadata) return wmi_handle->ops->extract_dbr_buf_metadata( wmi_handle, diff --git a/wmi/src/wmi_unified_dfs_api.c b/wmi/src/wmi_unified_dfs_api.c index 0fec950d44..b7568f98ad 100644 --- a/wmi/src/wmi_unified_dfs_api.c +++ b/wmi/src/wmi_unified_dfs_api.c @@ -30,13 +30,12 @@ #include #include -QDF_STATUS wmi_extract_dfs_cac_complete_event(void *wmi_hdl, +QDF_STATUS wmi_extract_dfs_cac_complete_event( + wmi_unified_t wmi_handle, uint8_t *evt_buf, uint32_t *vdev_id, uint32_t len) { - struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl; - if (wmi_handle && wmi_handle->ops->extract_dfs_cac_complete_event) return wmi_handle->ops->extract_dfs_cac_complete_event( wmi_handle, evt_buf, vdev_id, len); @@ -46,12 +45,10 @@ QDF_STATUS wmi_extract_dfs_cac_complete_event(void *wmi_hdl, qdf_export_symbol(wmi_extract_dfs_cac_complete_event); QDF_STATUS -wmi_extract_dfs_ocac_complete_event(void *wmi_hdl, +wmi_extract_dfs_ocac_complete_event(wmi_unified_t wmi_handle, uint8_t *evt_buf, struct vdev_adfs_complete_status *param) { - struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl; - if (wmi_handle && wmi_handle->ops->extract_dfs_ocac_complete_event) return wmi_handle->ops->extract_dfs_ocac_complete_event( wmi_handle, evt_buf, param); @@ -61,13 +58,12 @@ wmi_extract_dfs_ocac_complete_event(void *wmi_hdl, qdf_export_symbol(wmi_extract_dfs_ocac_complete_event); -QDF_STATUS wmi_extract_dfs_radar_detection_event(void *wmi_hdl, +QDF_STATUS wmi_extract_dfs_radar_detection_event( + wmi_unified_t wmi_handle, uint8_t *evt_buf, struct radar_found_info *radar_found, uint32_t len) { - struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl; - if (wmi_handle && wmi_handle->ops->extract_dfs_radar_detection_event) return wmi_handle->ops->extract_dfs_radar_detection_event( wmi_handle, evt_buf, radar_found, len); @@ -76,13 +72,12 @@ QDF_STATUS wmi_extract_dfs_radar_detection_event(void *wmi_hdl, } #ifdef QCA_MCL_DFS_SUPPORT -QDF_STATUS wmi_extract_wlan_radar_event_info(void *wmi_hdl, +QDF_STATUS wmi_extract_wlan_radar_event_info( + wmi_unified_t wmi_handle, uint8_t *evt_buf, struct radar_event_info *wlan_radar_event, uint32_t len) { - struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl; - if (wmi_handle->ops->extract_wlan_radar_event_info) return wmi_handle->ops->extract_wlan_radar_event_info( wmi_handle, evt_buf, wlan_radar_event, len); @@ -93,12 +88,11 @@ qdf_export_symbol(wmi_extract_dfs_radar_detection_event); #endif #if defined(WLAN_DFS_FULL_OFFLOAD) && defined(QCA_DFS_NOL_OFFLOAD) -QDF_STATUS wmi_send_usenol_pdev_param(void *wmi_hdl, bool usenol, +QDF_STATUS wmi_send_usenol_pdev_param(wmi_unified_t wmi_handle, bool usenol, struct wlan_objmgr_pdev *pdev) { struct pdev_params pparam; int pdev_idx; - struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl; pdev_idx = lmac_get_pdev_idx(pdev); if (pdev_idx < 0) @@ -112,13 +106,12 @@ QDF_STATUS wmi_send_usenol_pdev_param(void *wmi_hdl, bool usenol, } QDF_STATUS -wmi_send_subchan_marking_pdev_param(void *wmi_hdl, +wmi_send_subchan_marking_pdev_param(wmi_unified_t wmi_handle, bool subchanmark, struct wlan_objmgr_pdev *pdev) { struct pdev_params pparam; int pdev_idx; - struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl; pdev_idx = lmac_get_pdev_idx(pdev); if (pdev_idx < 0) diff --git a/wmi/src/wmi_unified_extscan_api.c b/wmi/src/wmi_unified_extscan_api.c index abb131bd55..f0e86f1361 100644 --- a/wmi/src/wmi_unified_extscan_api.c +++ b/wmi/src/wmi_unified_extscan_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2019 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 @@ -18,21 +18,10 @@ #include "wmi_unified_priv.h" -/** - * wmi_unified_reset_passpoint_network_list_cmd() - reset passpoint network list - * @wmi_hdl: wmi handle - * @req: passpoint network request structure - * - * This function sends down WMI command with network id set to wildcard id. - * firmware shall clear all the config entries - * - * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure - */ -QDF_STATUS wmi_unified_reset_passpoint_network_list_cmd(void *wmi_hdl, - struct wifi_passpoint_req_param *req) +QDF_STATUS wmi_unified_reset_passpoint_network_list_cmd( + wmi_unified_t wmi_handle, + struct wifi_passpoint_req_param *req) { - wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; - if (wmi_handle->ops->send_reset_passpoint_network_list_cmd) return wmi_handle->ops->send_reset_passpoint_network_list_cmd(wmi_handle, req); @@ -40,21 +29,10 @@ QDF_STATUS wmi_unified_reset_passpoint_network_list_cmd(void *wmi_hdl, return QDF_STATUS_E_FAILURE; } -/** - * wmi_unified_set_passpoint_network_list_cmd() - set passpoint network list - * @wmi_hdl: wmi handle - * @req: passpoint network request structure - * - * This function reads the incoming @req and fill in the destination - * WMI structure and send down the passpoint configs down to the firmware - * - * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure - */ -QDF_STATUS wmi_unified_set_passpoint_network_list_cmd(void *wmi_hdl, - struct wifi_passpoint_req_param *req) +QDF_STATUS wmi_unified_set_passpoint_network_list_cmd( + wmi_unified_t wmi_handle, + struct wifi_passpoint_req_param *req) { - wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; - if (wmi_handle->ops->send_set_passpoint_network_list_cmd) return wmi_handle->ops->send_set_passpoint_network_list_cmd(wmi_handle, req); @@ -62,21 +40,10 @@ QDF_STATUS wmi_unified_set_passpoint_network_list_cmd(void *wmi_hdl, return QDF_STATUS_E_FAILURE; } -/** wmi_unified_set_epno_network_list_cmd() - set epno network list - * @wmi_hdl: wmi handle - * @req: epno config params request structure - * - * This function reads the incoming epno config request structure - * and constructs the WMI message to the firmware. - * - * Returns: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures, - * error number otherwise - */ -QDF_STATUS wmi_unified_set_epno_network_list_cmd(void *wmi_hdl, +QDF_STATUS wmi_unified_set_epno_network_list_cmd( + wmi_unified_t wmi_handle, struct wifi_enhanced_pno_params *req) { - wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; - if (wmi_handle->ops->send_set_epno_network_list_cmd) return wmi_handle->ops->send_set_epno_network_list_cmd(wmi_handle, req); @@ -84,20 +51,10 @@ QDF_STATUS wmi_unified_set_epno_network_list_cmd(void *wmi_hdl, return QDF_STATUS_E_FAILURE; } -/** - * wmi_unified_extscan_get_capabilities_cmd() - extscan get capabilities - * @wmi_hdl: wmi handle - * @pgetcapab: get capabilities params - * - * This function send request to fw to get extscan capabilities. - * - * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure - */ -QDF_STATUS wmi_unified_extscan_get_capabilities_cmd(void *wmi_hdl, - struct extscan_capabilities_params *pgetcapab) +QDF_STATUS wmi_unified_extscan_get_capabilities_cmd( + wmi_unified_t wmi_handle, + struct extscan_capabilities_params *pgetcapab) { - wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; - if (wmi_handle->ops->send_extscan_get_capabilities_cmd) return wmi_handle->ops->send_extscan_get_capabilities_cmd(wmi_handle, pgetcapab); @@ -105,20 +62,10 @@ QDF_STATUS wmi_unified_extscan_get_capabilities_cmd(void *wmi_hdl, return QDF_STATUS_E_FAILURE; } -/** - * wmi_unified_extscan_get_cached_results_cmd() - extscan get cached results - * @wmi_hdl: wmi handle - * @pcached_results: cached results parameters - * - * This function send request to fw to get cached results. - * - * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure - */ -QDF_STATUS wmi_unified_extscan_get_cached_results_cmd(void *wmi_hdl, - struct extscan_cached_result_params *pcached_results) +QDF_STATUS wmi_unified_extscan_get_cached_results_cmd( + wmi_unified_t wmi_handle, + struct extscan_cached_result_params *pcached_results) { - wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; - if (wmi_handle->ops->send_extscan_get_cached_results_cmd) return wmi_handle->ops->send_extscan_get_cached_results_cmd(wmi_handle, pcached_results); @@ -126,20 +73,10 @@ QDF_STATUS wmi_unified_extscan_get_cached_results_cmd(void *wmi_hdl, return QDF_STATUS_E_FAILURE; } -/** - * wmi_unified_extscan_stop_change_monitor_cmd() - send stop change monitor cmd - * @wmi_hdl: wmi handle - * @reset_req: Reset change request params - * - * This function sends stop change monitor request to fw. - * - * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure - */ -QDF_STATUS wmi_unified_extscan_stop_change_monitor_cmd(void *wmi_hdl, - struct extscan_capabilities_reset_params *reset_req) +QDF_STATUS wmi_unified_extscan_stop_change_monitor_cmd( + wmi_unified_t wmi_handle, + struct extscan_capabilities_reset_params *reset_req) { - wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; - if (wmi_handle->ops->send_extscan_stop_change_monitor_cmd) return wmi_handle->ops->send_extscan_stop_change_monitor_cmd(wmi_handle, reset_req); @@ -147,23 +84,10 @@ QDF_STATUS wmi_unified_extscan_stop_change_monitor_cmd(void *wmi_hdl, return QDF_STATUS_E_FAILURE; } - - -/** - * wmi_unified_extscan_start_change_monitor_cmd() - start change monitor cmd - * @wmi_hdl: wmi handle - * @psigchange: change monitor request params - * - * This function sends start change monitor request to fw. - * - * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure - */ -QDF_STATUS wmi_unified_extscan_start_change_monitor_cmd(void *wmi_hdl, - struct extscan_set_sig_changereq_params * - psigchange) +QDF_STATUS wmi_unified_extscan_start_change_monitor_cmd( + wmi_unified_t wmi_handle, + struct extscan_set_sig_changereq_params *psigchange) { - wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; - if (wmi_handle->ops->send_extscan_start_change_monitor_cmd) return wmi_handle->ops->send_extscan_start_change_monitor_cmd(wmi_handle, psigchange); @@ -171,20 +95,10 @@ QDF_STATUS wmi_unified_extscan_start_change_monitor_cmd(void *wmi_hdl, return QDF_STATUS_E_FAILURE; } -/** - * wmi_unified_extscan_stop_hotlist_monitor_cmd() - stop hotlist monitor - * @wmi_hdl: wmi handle - * @photlist_reset: hotlist reset params - * - * This function configures hotlist monitor to stop in fw. - * - * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure - */ -QDF_STATUS wmi_unified_extscan_stop_hotlist_monitor_cmd(void *wmi_hdl, - struct extscan_bssid_hotlist_reset_params *photlist_reset) +QDF_STATUS wmi_unified_extscan_stop_hotlist_monitor_cmd( + wmi_unified_t wmi_handle, + struct extscan_bssid_hotlist_reset_params *photlist_reset) { - wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; - if (wmi_handle->ops->send_extscan_stop_hotlist_monitor_cmd) return wmi_handle->ops->send_extscan_stop_hotlist_monitor_cmd(wmi_handle, photlist_reset); @@ -192,11 +106,10 @@ QDF_STATUS wmi_unified_extscan_stop_hotlist_monitor_cmd(void *wmi_hdl, return QDF_STATUS_E_FAILURE; } -QDF_STATUS wmi_unified_extscan_start_hotlist_monitor_cmd(void *wmi_hdl, +QDF_STATUS wmi_unified_extscan_start_hotlist_monitor_cmd( + wmi_unified_t wmi_handle, struct extscan_bssid_hotlist_set_params *params) { - wmi_unified_t wmi_handle = wmi_hdl; - if (wmi_handle->ops->send_extscan_start_hotlist_monitor_cmd) return wmi_handle->ops->send_extscan_start_hotlist_monitor_cmd(wmi_handle, params); @@ -204,20 +117,10 @@ QDF_STATUS wmi_unified_extscan_start_hotlist_monitor_cmd(void *wmi_hdl, return QDF_STATUS_E_FAILURE; } -/** - * wmi_unified_stop_extscan_cmd() - stop extscan command to fw. - * @wmi_hdl: wmi handle - * @pstopcmd: stop scan command request params - * - * This function sends stop extscan request to fw. - * - * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure. - */ -QDF_STATUS wmi_unified_stop_extscan_cmd(void *wmi_hdl, - struct extscan_stop_req_params *pstopcmd) +QDF_STATUS wmi_unified_stop_extscan_cmd( + wmi_unified_t wmi_handle, + struct extscan_stop_req_params *pstopcmd) { - wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; - if (wmi_handle->ops->send_stop_extscan_cmd) return wmi_handle->ops->send_stop_extscan_cmd(wmi_handle, pstopcmd); @@ -225,20 +128,10 @@ QDF_STATUS wmi_unified_stop_extscan_cmd(void *wmi_hdl, return QDF_STATUS_E_FAILURE; } -/** - * wmi_unified_start_extscan_cmd() - start extscan command to fw. - * @wmi_hdl: wmi handle - * @pstart: scan command request params - * - * This function sends start extscan request to fw. - * - * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure. - */ -QDF_STATUS wmi_unified_start_extscan_cmd(void *wmi_hdl, - struct wifi_scan_cmd_req_params *pstart) +QDF_STATUS wmi_unified_start_extscan_cmd( + wmi_unified_t wmi_handle, + struct wifi_scan_cmd_req_params *pstart) { - wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; - if (wmi_handle->ops->send_start_extscan_cmd) return wmi_handle->ops->send_start_extscan_cmd(wmi_handle, pstart);