12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043 |
- /*
- * 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;
- }
- /**
- * 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: CDF_STATUS_SUCCESS for sucess or error code
- */
- int32_t wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd(
- void *wmi_hdl, uint32_t mcc_adaptive_scheduler)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- 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);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * 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: CDF status
- */
- int32_t 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 CDF_STATUS_E_FAILURE;
- }
- /**
- * 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: CDF status
- */
- int32_t wmi_unified_set_mcc_channel_time_quota_cmd
- (void *wmi_hdl,
- uint32_t adapter_1_chan_freq,
- uint32_t adapter_1_quota, uint32_t adapter_2_chan_freq)
- {
- 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 CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_set_thermal_mgmt_cmd() - set thermal mgmt command to fw
- * @wmi_handle: Pointer to wmi handle
- * @thermal_info: Thermal command information
- *
- * This function sends the thermal management command
- * to the firmware
- *
- * Return: CDF_STATUS_SUCCESS for success otherwise failure
- */
- int32_t wmi_unified_set_thermal_mgmt_cmd(void *wmi_hdl,
- struct thermal_cmd_params *thermal_info)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_set_thermal_mgmt_cmd)
- return wmi_handle->ops->send_set_thermal_mgmt_cmd(wmi_handle,
- thermal_info);
- return CDF_STATUS_E_FAILURE;
- }
- /**
- * wmi_unified_lro_config_cmd() - process the LRO config command
- * @wmi: Pointer to wmi handle
- * @wmi_lro_cmd: Pointer to LRO configuration parameters
- *
- * This function sends down the LRO configuration parameters to
- * the firmware to enable LRO, sets the TCP flags and sets the
- * seed values for the toeplitz hash generation
- *
- * Return: CDF_STATUS_SUCCESS for success otherwise failure
- */
- int32_t wmi_unified_lro_config_cmd(void *wmi_hdl,
- struct wmi_lro_config_cmd_t *wmi_lro_cmd)
- {
- wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
- if (wmi_handle->ops->send_lro_config_cmd)
- return wmi_handle->ops->send_lro_config_cmd(wmi_handle,
- wmi_lro_cmd);
- return CDF_STATUS_E_FAILURE;
- }
|