123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925 |
- /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
- *
- * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
- *
- *
- * 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 was originally distributed by Qualcomm Atheros, Inc.
- * under proprietary terms before Copyright ownership was assigned
- * to the Linux Foundation.
- */
- #include "athdefs.h"
- #include "osapi_linux.h"
- #include "a_types.h"
- #include "a_debug.h"
- #include "ol_if_athvar.h"
- #include "ol_defines.h"
- #include "wmi.h"
- #include "wmi_unified_priv.h"
- #include "wma_api.h"
- #include "wmi_unified_param.h"
- /**
- * wmi_unified_vdev_create_send() - send VDEV create command to fw
- * @wmi_handle: wmi handle
- * @param: pointer to hold vdev create parameter
- * @macaddr: vdev mac address
- *
- * Return: 0 for success or error code
- */
- int32_t wmi_unified_vdev_create_send(void *wmi_hdl,
- uint8_t macaddr[IEEE80211_ADDR_LEN],
- struct vdev_create_params *param)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_vdev_create_cmd)
- return wmi_handle->ops->send_vdev_create_cmd(wmi_handle,
- macaddr, param);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_vdev_delete_send() - send VDEV delete command to fw
- * @wmi_handle: wmi handle
- * @if_id: vdev id
- *
- * Return: 0 for success or error code
- */
- int32_t wmi_unified_vdev_delete_send(void *wmi_hdl,
- uint8_t if_id)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_vdev_delete_cmd)
- return wmi_handle->ops->send_vdev_delete_cmd(wmi_handle,
- if_id);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_vdev_stop_send() - send vdev stop command to fw
- * @wmi: wmi handle
- * @vdev_id: vdev id
- *
- * Return: 0 for success or erro code
- */
- int32_t wmi_unified_vdev_stop_send(void *wmi_hdl,
- uint8_t vdev_id)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_vdev_stop_cmd)
- return wmi_handle->ops->send_vdev_stop_cmd(wmi_handle,
- vdev_id);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_vdev_down_send() - send vdev down command to fw
- * @wmi: wmi handle
- * @vdev_id: vdev id
- *
- * Return: 0 for success or error code
- */
- int32_t wmi_unified_vdev_down_send(void *wmi_hdl, uint8_t vdev_id)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_vdev_down_cmd)
- return wmi_handle->ops->send_vdev_down_cmd(wmi_handle, vdev_id);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_peer_flush_tids_send() - flush peer tids packets in fw
- * @wmi: wmi handle
- * @peer_addr: peer mac address
- * @param: pointer to hold peer flush tid parameter
- *
- * Return: 0 for sucess or error code
- */
- int32_t wmi_unified_peer_flush_tids_send(void *wmi_hdl,
- uint8_t peer_addr[IEEE80211_ADDR_LEN],
- struct peer_flush_params *param)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_peer_flush_tids_cmd)
- return wmi_handle->ops->send_peer_flush_tids_cmd(wmi_handle,
- peer_addr, param);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_peer_delete_send() - send PEER delete command to fw
- * @wmi: wmi handle
- * @peer_addr: peer mac addr
- * @vdev_id: vdev id
- *
- * Return: 0 for success or error code
- */
- int32_t wmi_unified_peer_delete_send(void *wmi_hdl,
- uint8_t
- peer_addr[IEEE80211_ADDR_LEN],
- uint8_t vdev_id)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_peer_delete_cmd)
- return wmi_handle->ops->send_peer_delete_cmd(wmi_handle,
- peer_addr, vdev_id);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_set_peer_param() - set peer parameter in fw
- * @wmi_ctx: wmi handle
- * @peer_addr: peer mac address
- * @param : pointer to hold peer set parameter
- *
- * Return: 0 for success or error code
- */
- int32_t wmi_set_peer_param_send(void *wmi_hdl,
- uint8_t peer_addr[IEEE80211_ADDR_LEN],
- struct peer_set_params *param)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_peer_param_cmd)
- return wmi_handle->ops->send_peer_param_cmd(wmi_handle,
- peer_addr, param);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_vdev_up_send() - send vdev up command in fw
- * @wmi: wmi handle
- * @bssid: bssid
- * @vdev_up_params: pointer to hold vdev up parameter
- *
- * Return: 0 for success or error code
- */
- int32_t wmi_unified_vdev_up_send(void *wmi_hdl,
- uint8_t bssid[IEEE80211_ADDR_LEN],
- struct vdev_up_params *params)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_vdev_up_cmd)
- return wmi_handle->ops->send_vdev_up_cmd(wmi_handle, bssid,
- params);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_peer_create_send() - send peer create command to fw
- * @wmi: wmi handle
- * @peer_addr: peer mac address
- * @peer_type: peer type
- * @vdev_id: vdev id
- *
- * Return: 0 for success or error code
- */
- int32_t wmi_unified_peer_create_send(void *wmi_hdl,
- struct peer_create_params *param)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_peer_create_cmd)
- return wmi_handle->ops->send_peer_create_cmd(wmi_handle, param);
- return CDF_STATUS_E_FAILURE;
- }
- #ifdef FEATURE_GREEN_AP
- /**
- * wmi_unified_green_ap_ps_send() - enable green ap powersave command
- * @wmi_handle: wmi handle
- * @value: value
- * @mac_id: mac id to have radio context
- *
- * Return: 0 for success or error code
- */
- int32_t wmi_unified_green_ap_ps_send(void *wmi_hdl,
- uint32_t value, uint8_t mac_id)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_green_ap_ps_cmd)
- return wmi_handle->ops->send_green_ap_ps_cmd(wmi_handle, value,
- mac_id);
- return CDF_STATUS_E_FAILURE;
- }
- #else
- int32_t wmi_unified_green_ap_ps_send(void *wmi_hdl,
- uint32_t value, uint8_t mac_id)
- {
- return 0;
- }
- #endif /* FEATURE_GREEN_AP */
- /**
- * wmi_unified_pdev_utf_cmd() - send utf command to fw
- * @wmi_handle: wmi handle
- * @param: pointer to pdev_utf_params
- * @mac_id: mac id to have radio context
- *
- * Return: 0 for success or error code
- */
- int32_t
- wmi_unified_pdev_utf_cmd_send(void *wmi_hdl,
- struct pdev_utf_params *param,
- uint8_t mac_id)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_pdev_utf_cmd)
- return wmi_handle->ops->send_pdev_utf_cmd(wmi_handle, param,
- mac_id);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_pdev_set_param() - set pdev parameters
- * @wmi_handle: wmi handle
- * @param: pointer to pdev parameter
- * @mac_id: radio context
- *
- * Return: 0 on success, errno on failure
- */
- int32_t
- wmi_unified_pdev_param_send(void *wmi_hdl,
- struct pdev_params *param,
- uint8_t mac_id)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_pdev_param_cmd)
- return wmi_handle->ops->send_pdev_param_cmd(wmi_handle, param,
- mac_id);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_suspend_send() - WMI suspend function
- * @param wmi_handle : handle to WMI.
- * @param param : pointer to hold suspend parameter
- * @mac_id: radio context
- *
- * Return: 0 on success and -ve on failure.
- */
- int32_t wmi_unified_suspend_send(void *wmi_hdl,
- struct suspend_params *param,
- uint8_t mac_id)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_suspend_cmd)
- return wmi_handle->ops->send_suspend_cmd(wmi_handle, param,
- mac_id);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_resume_send - WMI resume function
- * @param wmi_handle : handle to WMI.
- * @mac_id: radio context
- *
- * Return: 0 on success and -ve on failure.
- */
- int32_t wmi_unified_resume_send(void *wmi_hdl,
- uint8_t mac_id)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_resume_cmd)
- return wmi_handle->ops->send_resume_cmd(wmi_handle,
- mac_id);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_wow_enable_send() - WMI wow enable function
- * @param wmi_handle : handle to WMI.
- * @param param : pointer to hold wow enable parameter
- * @mac_id: radio context
- *
- * Return: 0 on success and -ve on failure.
- */
- int32_t wmi_unified_wow_enable_send(void *wmi_hdl,
- struct wow_cmd_params *param,
- uint8_t mac_id)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_wow_enable_cmd)
- return wmi_handle->ops->send_wow_enable_cmd(wmi_handle, param,
- mac_id);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_ap_ps_cmd_send() - set ap powersave parameters
- * @wma_ctx: wma context
- * @peer_addr: peer mac address
- * @param: pointer to ap_ps parameter structure
- *
- * Return: 0 for success or error code
- */
- int32_t wmi_unified_ap_ps_cmd_send(void *wmi_hdl,
- uint8_t *peer_addr,
- struct ap_ps_params *param)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_set_ap_ps_param_cmd)
- return wmi_handle->ops->send_set_ap_ps_param_cmd(wmi_handle,
- peer_addr,
- param);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_sta_ps_cmd_send() - set sta powersave parameters
- * @wma_ctx: wma context
- * @peer_addr: peer mac address
- * @param: pointer to sta_ps parameter structure
- *
- * Return: 0 for success or error code
- */
- int32_t wmi_unified_sta_ps_cmd_send(void *wmi_hdl,
- struct sta_ps_params *param)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_set_sta_ps_param_cmd)
- return wmi_handle->ops->send_set_sta_ps_param_cmd(wmi_handle,
- param);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_crash_inject() - inject fw crash
- * @wma_handle: wma handle
- * @param: ponirt to crash inject paramter structure
- *
- * Return: 0 for success or return error
- */
- int32_t wmi_crash_inject(void *wmi_hdl,
- struct crash_inject *param)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_crash_inject_cmd)
- return wmi_handle->ops->send_crash_inject_cmd(wmi_handle,
- param);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_dbglog_cmd_send() - set debug log level
- * @param wmi_handle : handle to WMI.
- * @param param : pointer to hold dbglog level parameter
- *
- * Return: 0 on success and -ve on failure.
- */
- int32_t
- wmi_unified_dbglog_cmd_send(void *wmi_hdl,
- struct dbglog_params *dbglog_param)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_dbglog_cmd)
- return wmi_handle->ops->send_dbglog_cmd(wmi_handle,
- dbglog_param);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_vdev_set_param_send() - WMI vdev set parameter function
- * @param wmi_handle : handle to WMI.
- * @param macaddr : MAC address
- * @param param : pointer to hold vdev set parameter
- *
- * Return: 0 on success and -ve on failure.
- */
- int32_t wmi_unified_vdev_set_param_send(void *wmi_hdl,
- struct vdev_set_params *param)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_vdev_set_param_cmd)
- return wmi_handle->ops->send_vdev_set_param_cmd(wmi_handle,
- param);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_stats_request_send() - WMI request stats function
- * @param wmi_handle : handle to WMI.
- * @param macaddr : MAC address
- * @param param : pointer to hold stats request parameter
- *
- * Return: 0 on success and -ve on failure.
- */
- int32_t wmi_unified_stats_request_send(void *wmi_hdl,
- uint8_t macaddr[IEEE80211_ADDR_LEN],
- struct stats_request_params *param)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_stats_request_cmd)
- return wmi_handle->ops->send_stats_request_cmd(wmi_handle,
- macaddr, param);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_stats_request_send() - WMI request stats function
- * @param wmi_handle : handle to WMI.
- * @param macaddr : MAC address
- * @param param : pointer to hold stats request parameter
- *
- * Return: 0 on success and -ve on failure.
- */
- int32_t wmi_unified_packet_log_enable_send(void *wmi_hdl,
- uint8_t macaddr[IEEE80211_ADDR_LEN],
- struct packet_enable_params *param)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_packet_log_enable_cmd)
- return wmi_handle->ops->send_packet_log_enable_cmd(wmi_handle,
- macaddr, param);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_beacon_send_cmd() - WMI beacon send function
- * @param wmi_handle : handle to WMI.
- * @param macaddr : MAC address
- * @param param : pointer to hold beacon send cmd parameter
- *
- * Return: 0 on success and -ve on failure.
- */
- int32_t wmi_unified_beacon_send_cmd(void *wmi_hdl,
- struct beacon_params *param)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_beacon_send_cmd)
- return wmi_handle->ops->send_beacon_send_cmd(wmi_handle,
- param);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_peer_assoc_send() - WMI peer assoc function
- * @param wmi_handle : handle to WMI.
- * @param macaddr : MAC address
- * @param param : pointer to peer assoc parameter
- *
- * Return: 0 on success and -ve on failure.
- */
- int32_t wmi_unified_peer_assoc_send(void *wmi_hdl,
- struct peer_assoc_params *param)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_peer_assoc_cmd)
- return wmi_handle->ops->send_peer_assoc_cmd(wmi_handle,
- param);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_scan_start_cmd_send() - WMI scan start function
- * @param wmi_handle : handle to WMI.
- * @param macaddr : MAC address
- * @param param : pointer to hold scan start cmd parameter
- *
- * Return: 0 on success and -ve on failure.
- */
- int32_t wmi_unified_scan_start_cmd_send(void *wmi_hdl,
- struct scan_start_params *param)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_scan_start_cmd)
- return wmi_handle->ops->send_scan_start_cmd(wmi_handle,
- param);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_scan_stop_cmd_send() - WMI scan start function
- * @param wmi_handle : handle to WMI.
- * @param macaddr : MAC address
- * @param param : pointer to hold scan start cmd parameter
- *
- * Return: 0 on success and -ve on failure.
- */
- int32_t wmi_unified_scan_stop_cmd_send(void *wmi_hdl,
- struct scan_stop_params *param)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_scan_stop_cmd)
- return wmi_handle->ops->send_scan_stop_cmd(wmi_handle,
- param);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_scan_chan_list_cmd_send() - WMI scan channel list function
- * @param wmi_handle : handle to WMI.
- * @param macaddr : MAC address
- * @param param : pointer to hold scan channel list parameter
- *
- * Return: 0 on success and -ve on failure.
- */
- int32_t wmi_unified_scan_chan_list_cmd_send(void *wmi_hdl,
- struct scan_chan_list_params *param)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_scan_chan_list_cmd)
- return wmi_handle->ops->send_scan_chan_list_cmd(wmi_handle,
- param);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_mgmt_unified_cmd_send() - management cmd over wmi layer
- * @wmi_hdl : handle to WMI.
- * @param : pointer to hold mgmt cmd parameter
- *
- * Return: 0 on success and -ve on failure.
- */
- int32_t wmi_mgmt_unified_cmd_send(void *wmi_hdl,
- struct wmi_mgmt_params *param)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_mgmt_cmd)
- return wmi_handle->ops->send_mgmt_cmd(wmi_handle,
- param);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_modem_power_state() - set modem power state to fw
- * @wmi_hdl: wmi handle
- * @param_value: parameter value
- *
- * Return: 0 for success or error code
- */
- int32_t wmi_unified_modem_power_state(void *wmi_hdl,
- uint32_t param_value)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_modem_power_state_cmd)
- return wmi_handle->ops->send_modem_power_state_cmd(wmi_handle,
- param_value);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_set_sta_ps_mode() - set sta powersave params in fw
- * @wmi_hdl: wmi handle
- * @vdev_id: vdev id
- * @val: value
- *
- * Return: 0 for success or error code.
- */
- int32_t wmi_unified_set_sta_ps_mode(void *wmi_hdl,
- uint32_t vdev_id, uint8_t val)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_set_sta_ps_mode_cmd)
- return wmi_handle->ops->send_set_sta_ps_mode_cmd(wmi_handle,
- vdev_id, val);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_set_mimops() - set MIMO powersave
- * @wmi_hdl: wmi handle
- * @vdev_id: vdev id
- * @value: value
- *
- * Return: CDF_STATUS_SUCCESS for success or error code.
- */
- int32_t wmi_unified_set_mimops(void *wmi_hdl, uint8_t vdev_id, int value)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_set_mimops_cmd)
- return wmi_handle->ops->send_set_mimops_cmd(wmi_handle,
- vdev_id, value);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_set_smps_params() - set smps params
- * @wmi_hdl: wmi handle
- * @vdev_id: vdev id
- * @value: value
- *
- * Return: CDF_STATUS_SUCCESS for success or error code.
- */
- int32_t wmi_unified_set_smps_params(void *wmi_hdl, uint8_t vdev_id,
- int value)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_set_smps_params_cmd)
- return wmi_handle->ops->send_set_smps_params_cmd(wmi_handle,
- vdev_id, value);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_set_p2pgo_oppps_req() - send p2p go opp power save request to fw
- * @wmi_hdl: wmi handle
- * @opps: p2p opp power save parameters
- *
- * Return: none
- */
- int32_t 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 CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_set_p2pgo_noa_req_cmd() - send p2p go noa request to fw
- * @wmi_hdl: wmi handle
- * @noa: p2p power save parameters
- *
- * Return: none
- */
- int32_t 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 CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_get_temperature() - get pdev temperature req
- * @wmi_hdl: wmi handle
- *
- * Return: CDF_STATUS_SUCCESS for success or error code.
- */
- int32_t wmi_unified_get_temperature(void *wmi_hdl)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_get_temperature_cmd)
- return wmi_handle->ops->send_get_temperature_cmd(wmi_handle);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_set_sta_uapsd_auto_trig_cmd() - set uapsd auto trigger command
- * @wmi_hdl: wmi handle
- * @end_set_sta_ps_mode_cmd: cmd paramter strcture
- *
- * This function sets the trigger
- * uapsd params such as service interval, delay interval
- * and suspend interval which will be used by the firmware
- * to send trigger frames periodically when there is no
- * traffic on the transmit side.
- *
- * Return: 0 for success or error code.
- */
- int32_t
- wmi_unified_set_sta_uapsd_auto_trig_cmd(void *wmi_hdl,
- struct sta_uapsd_trig_params *param)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_set_sta_uapsd_auto_trig_cmd)
- return wmi_handle->ops->send_set_sta_uapsd_auto_trig_cmd(wmi_handle,
- param);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * 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: 0 on succes
- */
- int32_t wmi_unified_ocb_start_timing_advert(void *wmi_hdl,
- struct ocb_timing_advert_param *timing_advert)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_ocb_start_timing_advert_cmd)
- return wmi_handle->ops->send_ocb_start_timing_advert_cmd(wmi_handle,
- timing_advert);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * 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: 0 on succes
- */
- int32_t wmi_unified_ocb_stop_timing_advert(void *wmi_hdl,
- struct ocb_timing_advert_param *timing_advert)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_ocb_stop_timing_advert_cmd)
- return wmi_handle->ops->send_ocb_stop_timing_advert_cmd(wmi_handle,
- timing_advert);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_ocb_set_utc_time_cmd() - get ocb tsf timer val
- * @wmi_handle: pointer to the wmi handle
- * @vdev_id: vdev id
- *
- * Return: 0 on succes
- */
- int32_t wmi_unified_ocb_set_utc_time_cmd(void *wmi_hdl,
- struct ocb_utc_param *utc)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_ocb_set_utc_time_cmd)
- return wmi_handle->ops->send_ocb_set_utc_time_cmd(wmi_handle,
- utc);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_ocb_get_tsf_timer() - get ocb tsf timer val
- * @wmi_handle: pointer to the wmi handle
- * @vdev_id: vdev id
- *
- * Return: 0 on succes
- */
- int32_t wmi_unified_ocb_get_tsf_timer(void *wmi_hdl,
- uint8_t vdev_id)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_ocb_get_tsf_timer_cmd)
- return wmi_handle->ops->send_ocb_get_tsf_timer_cmd(wmi_handle,
- vdev_id);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * 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: 0 on succes
- */
- int32_t wmi_unified_dcc_get_stats_cmd(void *wmi_hdl,
- struct dcc_get_stats_param *get_stats_param)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_dcc_get_stats_cmd)
- return wmi_handle->ops->send_dcc_get_stats_cmd(wmi_handle,
- get_stats_param);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * 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: 0 on succes
- */
- int32_t wmi_unified_dcc_clear_stats(void *wmi_hdl,
- uint32_t vdev_id, uint32_t dcc_stats_bitmap)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_dcc_clear_stats_cmd)
- return wmi_handle->ops->send_dcc_clear_stats_cmd(wmi_handle,
- vdev_id, dcc_stats_bitmap);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * 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: 0 on success
- */
- int32_t wmi_unified_dcc_update_ndl(void *wmi_hdl,
- struct dcc_update_ndl_param *update_ndl_param)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_dcc_update_ndl_cmd)
- return wmi_handle->ops->send_dcc_update_ndl_cmd(wmi_handle,
- update_ndl_param);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_ocb_set_config() - send the OCB config to the FW
- * @wmi_handle: pointer to the wmi handle
- * @config: the OCB configuration
- *
- * Return: 0 on success
- */
- int32_t wmi_unified_ocb_set_config(void *wmi_hdl,
- struct ocb_config_param *config, uint32_t *ch_mhz)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_ocb_set_config_cmd)
- return wmi_handle->ops->send_ocb_set_config_cmd(wmi_handle,
- config, ch_mhz);
- return CDF_STATUS_E_FAILURE;
- }
|