wmi_unified_api.c 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680
  1. /*
  2. * Copyright (c) 2016 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. #include "athdefs.h"
  27. #include "osapi_linux.h"
  28. #include "a_types.h"
  29. #include "a_debug.h"
  30. #include "ol_if_athvar.h"
  31. #include "ol_defines.h"
  32. #include "wmi.h"
  33. #include "wmi_unified_priv.h"
  34. #include "wma_api.h"
  35. #include "wmi_unified_param.h"
  36. /**
  37. * wmi_unified_vdev_create_send() - send VDEV create command to fw
  38. * @wmi_handle: wmi handle
  39. * @param: pointer to hold vdev create parameter
  40. * @macaddr: vdev mac address
  41. *
  42. * Return: 0 for success or error code
  43. */
  44. CDF_STATUS wmi_unified_vdev_create_send(void *wmi_hdl,
  45. uint8_t macaddr[IEEE80211_ADDR_LEN],
  46. struct vdev_create_params *param)
  47. {
  48. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  49. if (wmi_handle->ops->send_vdev_create_cmd)
  50. return wmi_handle->ops->send_vdev_create_cmd(wmi_handle,
  51. macaddr, param);
  52. return CDF_STATUS_E_FAILURE;
  53. }
  54. /**
  55. * wmi_unified_vdev_delete_send() - send VDEV delete command to fw
  56. * @wmi_handle: wmi handle
  57. * @if_id: vdev id
  58. *
  59. * Return: 0 for success or error code
  60. */
  61. CDF_STATUS wmi_unified_vdev_delete_send(void *wmi_hdl,
  62. uint8_t if_id)
  63. {
  64. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  65. if (wmi_handle->ops->send_vdev_delete_cmd)
  66. return wmi_handle->ops->send_vdev_delete_cmd(wmi_handle,
  67. if_id);
  68. return CDF_STATUS_E_FAILURE;
  69. }
  70. /**
  71. * wmi_unified_vdev_stop_send() - send vdev stop command to fw
  72. * @wmi: wmi handle
  73. * @vdev_id: vdev id
  74. *
  75. * Return: 0 for success or erro code
  76. */
  77. CDF_STATUS wmi_unified_vdev_stop_send(void *wmi_hdl,
  78. uint8_t vdev_id)
  79. {
  80. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  81. if (wmi_handle->ops->send_vdev_stop_cmd)
  82. return wmi_handle->ops->send_vdev_stop_cmd(wmi_handle,
  83. vdev_id);
  84. return CDF_STATUS_E_FAILURE;
  85. }
  86. /**
  87. * wmi_unified_vdev_down_send() - send vdev down command to fw
  88. * @wmi: wmi handle
  89. * @vdev_id: vdev id
  90. *
  91. * Return: 0 for success or error code
  92. */
  93. CDF_STATUS wmi_unified_vdev_down_send(void *wmi_hdl, uint8_t vdev_id)
  94. {
  95. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  96. if (wmi_handle->ops->send_vdev_down_cmd)
  97. return wmi_handle->ops->send_vdev_down_cmd(wmi_handle, vdev_id);
  98. return CDF_STATUS_E_FAILURE;
  99. }
  100. /**
  101. * wmi_unified_peer_flush_tids_send() - flush peer tids packets in fw
  102. * @wmi: wmi handle
  103. * @peer_addr: peer mac address
  104. * @param: pointer to hold peer flush tid parameter
  105. *
  106. * Return: 0 for sucess or error code
  107. */
  108. CDF_STATUS wmi_unified_peer_flush_tids_send(void *wmi_hdl,
  109. uint8_t peer_addr[IEEE80211_ADDR_LEN],
  110. struct peer_flush_params *param)
  111. {
  112. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  113. if (wmi_handle->ops->send_peer_flush_tids_cmd)
  114. return wmi_handle->ops->send_peer_flush_tids_cmd(wmi_handle,
  115. peer_addr, param);
  116. return CDF_STATUS_E_FAILURE;
  117. }
  118. /**
  119. * wmi_unified_peer_delete_send() - send PEER delete command to fw
  120. * @wmi: wmi handle
  121. * @peer_addr: peer mac addr
  122. * @vdev_id: vdev id
  123. *
  124. * Return: 0 for success or error code
  125. */
  126. CDF_STATUS wmi_unified_peer_delete_send(void *wmi_hdl,
  127. uint8_t
  128. peer_addr[IEEE80211_ADDR_LEN],
  129. uint8_t vdev_id)
  130. {
  131. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  132. if (wmi_handle->ops->send_peer_delete_cmd)
  133. return wmi_handle->ops->send_peer_delete_cmd(wmi_handle,
  134. peer_addr, vdev_id);
  135. return CDF_STATUS_E_FAILURE;
  136. }
  137. /**
  138. * wmi_set_peer_param() - set peer parameter in fw
  139. * @wmi_ctx: wmi handle
  140. * @peer_addr: peer mac address
  141. * @param : pointer to hold peer set parameter
  142. *
  143. * Return: 0 for success or error code
  144. */
  145. CDF_STATUS wmi_set_peer_param_send(void *wmi_hdl,
  146. uint8_t peer_addr[IEEE80211_ADDR_LEN],
  147. struct peer_set_params *param)
  148. {
  149. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  150. if (wmi_handle->ops->send_peer_param_cmd)
  151. return wmi_handle->ops->send_peer_param_cmd(wmi_handle,
  152. peer_addr, param);
  153. return CDF_STATUS_E_FAILURE;
  154. }
  155. /**
  156. * wmi_unified_vdev_up_send() - send vdev up command in fw
  157. * @wmi: wmi handle
  158. * @bssid: bssid
  159. * @vdev_up_params: pointer to hold vdev up parameter
  160. *
  161. * Return: 0 for success or error code
  162. */
  163. CDF_STATUS wmi_unified_vdev_up_send(void *wmi_hdl,
  164. uint8_t bssid[IEEE80211_ADDR_LEN],
  165. struct vdev_up_params *params)
  166. {
  167. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  168. if (wmi_handle->ops->send_vdev_up_cmd)
  169. return wmi_handle->ops->send_vdev_up_cmd(wmi_handle, bssid,
  170. params);
  171. return CDF_STATUS_E_FAILURE;
  172. }
  173. /**
  174. * wmi_unified_peer_create_send() - send peer create command to fw
  175. * @wmi: wmi handle
  176. * @peer_addr: peer mac address
  177. * @peer_type: peer type
  178. * @vdev_id: vdev id
  179. *
  180. * Return: 0 for success or error code
  181. */
  182. CDF_STATUS wmi_unified_peer_create_send(void *wmi_hdl,
  183. struct peer_create_params *param)
  184. {
  185. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  186. if (wmi_handle->ops->send_peer_create_cmd)
  187. return wmi_handle->ops->send_peer_create_cmd(wmi_handle, param);
  188. return CDF_STATUS_E_FAILURE;
  189. }
  190. #ifdef FEATURE_GREEN_AP
  191. /**
  192. * wmi_unified_green_ap_ps_send() - enable green ap powersave command
  193. * @wmi_handle: wmi handle
  194. * @value: value
  195. * @mac_id: mac id to have radio context
  196. *
  197. * Return: 0 for success or error code
  198. */
  199. CDF_STATUS wmi_unified_green_ap_ps_send(void *wmi_hdl,
  200. uint32_t value, uint8_t mac_id)
  201. {
  202. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  203. if (wmi_handle->ops->send_green_ap_ps_cmd)
  204. return wmi_handle->ops->send_green_ap_ps_cmd(wmi_handle, value,
  205. mac_id);
  206. return CDF_STATUS_E_FAILURE;
  207. }
  208. #else
  209. CDF_STATUS wmi_unified_green_ap_ps_send(void *wmi_hdl,
  210. uint32_t value, uint8_t mac_id)
  211. {
  212. return 0;
  213. }
  214. #endif /* FEATURE_GREEN_AP */
  215. /**
  216. * wmi_unified_pdev_utf_cmd() - send utf command to fw
  217. * @wmi_handle: wmi handle
  218. * @param: pointer to pdev_utf_params
  219. * @mac_id: mac id to have radio context
  220. *
  221. * Return: 0 for success or error code
  222. */
  223. CDF_STATUS
  224. wmi_unified_pdev_utf_cmd_send(void *wmi_hdl,
  225. struct pdev_utf_params *param,
  226. uint8_t mac_id)
  227. {
  228. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  229. if (wmi_handle->ops->send_pdev_utf_cmd)
  230. return wmi_handle->ops->send_pdev_utf_cmd(wmi_handle, param,
  231. mac_id);
  232. return CDF_STATUS_E_FAILURE;
  233. }
  234. /**
  235. * wmi_unified_pdev_set_param() - set pdev parameters
  236. * @wmi_handle: wmi handle
  237. * @param: pointer to pdev parameter
  238. * @mac_id: radio context
  239. *
  240. * Return: 0 on success, errno on failure
  241. */
  242. CDF_STATUS
  243. wmi_unified_pdev_param_send(void *wmi_hdl,
  244. struct pdev_params *param,
  245. uint8_t mac_id)
  246. {
  247. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  248. if (wmi_handle->ops->send_pdev_param_cmd)
  249. return wmi_handle->ops->send_pdev_param_cmd(wmi_handle, param,
  250. mac_id);
  251. return CDF_STATUS_E_FAILURE;
  252. }
  253. /**
  254. * wmi_unified_suspend_send() - WMI suspend function
  255. * @param wmi_handle : handle to WMI.
  256. * @param param : pointer to hold suspend parameter
  257. * @mac_id: radio context
  258. *
  259. * Return: 0 on success and -ve on failure.
  260. */
  261. CDF_STATUS wmi_unified_suspend_send(void *wmi_hdl,
  262. struct suspend_params *param,
  263. uint8_t mac_id)
  264. {
  265. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  266. if (wmi_handle->ops->send_suspend_cmd)
  267. return wmi_handle->ops->send_suspend_cmd(wmi_handle, param,
  268. mac_id);
  269. return CDF_STATUS_E_FAILURE;
  270. }
  271. /**
  272. * wmi_unified_resume_send - WMI resume function
  273. * @param wmi_handle : handle to WMI.
  274. * @mac_id: radio context
  275. *
  276. * Return: 0 on success and -ve on failure.
  277. */
  278. CDF_STATUS wmi_unified_resume_send(void *wmi_hdl,
  279. uint8_t mac_id)
  280. {
  281. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  282. if (wmi_handle->ops->send_resume_cmd)
  283. return wmi_handle->ops->send_resume_cmd(wmi_handle,
  284. mac_id);
  285. return CDF_STATUS_E_FAILURE;
  286. }
  287. /**
  288. * wmi_unified_wow_enable_send() - WMI wow enable function
  289. * @param wmi_handle : handle to WMI.
  290. * @param param : pointer to hold wow enable parameter
  291. * @mac_id: radio context
  292. *
  293. * Return: 0 on success and -ve on failure.
  294. */
  295. CDF_STATUS wmi_unified_wow_enable_send(void *wmi_hdl,
  296. struct wow_cmd_params *param,
  297. uint8_t mac_id)
  298. {
  299. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  300. if (wmi_handle->ops->send_wow_enable_cmd)
  301. return wmi_handle->ops->send_wow_enable_cmd(wmi_handle, param,
  302. mac_id);
  303. return CDF_STATUS_E_FAILURE;
  304. }
  305. /**
  306. * wmi_unified_ap_ps_cmd_send() - set ap powersave parameters
  307. * @wma_ctx: wma context
  308. * @peer_addr: peer mac address
  309. * @param: pointer to ap_ps parameter structure
  310. *
  311. * Return: 0 for success or error code
  312. */
  313. CDF_STATUS wmi_unified_ap_ps_cmd_send(void *wmi_hdl,
  314. uint8_t *peer_addr,
  315. struct ap_ps_params *param)
  316. {
  317. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  318. if (wmi_handle->ops->send_set_ap_ps_param_cmd)
  319. return wmi_handle->ops->send_set_ap_ps_param_cmd(wmi_handle,
  320. peer_addr,
  321. param);
  322. return CDF_STATUS_E_FAILURE;
  323. }
  324. /**
  325. * wmi_unified_sta_ps_cmd_send() - set sta powersave parameters
  326. * @wma_ctx: wma context
  327. * @peer_addr: peer mac address
  328. * @param: pointer to sta_ps parameter structure
  329. *
  330. * Return: 0 for success or error code
  331. */
  332. CDF_STATUS wmi_unified_sta_ps_cmd_send(void *wmi_hdl,
  333. struct sta_ps_params *param)
  334. {
  335. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  336. if (wmi_handle->ops->send_set_sta_ps_param_cmd)
  337. return wmi_handle->ops->send_set_sta_ps_param_cmd(wmi_handle,
  338. param);
  339. return CDF_STATUS_E_FAILURE;
  340. }
  341. /**
  342. * wmi_crash_inject() - inject fw crash
  343. * @wma_handle: wma handle
  344. * @param: ponirt to crash inject paramter structure
  345. *
  346. * Return: 0 for success or return error
  347. */
  348. CDF_STATUS wmi_crash_inject(void *wmi_hdl,
  349. struct crash_inject *param)
  350. {
  351. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  352. if (wmi_handle->ops->send_crash_inject_cmd)
  353. return wmi_handle->ops->send_crash_inject_cmd(wmi_handle,
  354. param);
  355. return CDF_STATUS_E_FAILURE;
  356. }
  357. /**
  358. * wmi_unified_dbglog_cmd_send() - set debug log level
  359. * @param wmi_handle : handle to WMI.
  360. * @param param : pointer to hold dbglog level parameter
  361. *
  362. * Return: 0 on success and -ve on failure.
  363. */
  364. CDF_STATUS
  365. wmi_unified_dbglog_cmd_send(void *wmi_hdl,
  366. struct dbglog_params *dbglog_param)
  367. {
  368. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  369. if (wmi_handle->ops->send_dbglog_cmd)
  370. return wmi_handle->ops->send_dbglog_cmd(wmi_handle,
  371. dbglog_param);
  372. return CDF_STATUS_E_FAILURE;
  373. }
  374. /**
  375. * wmi_unified_vdev_set_param_send() - WMI vdev set parameter function
  376. * @param wmi_handle : handle to WMI.
  377. * @param macaddr : MAC address
  378. * @param param : pointer to hold vdev set parameter
  379. *
  380. * Return: 0 on success and -ve on failure.
  381. */
  382. CDF_STATUS wmi_unified_vdev_set_param_send(void *wmi_hdl,
  383. struct vdev_set_params *param)
  384. {
  385. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  386. if (wmi_handle->ops->send_vdev_set_param_cmd)
  387. return wmi_handle->ops->send_vdev_set_param_cmd(wmi_handle,
  388. param);
  389. return CDF_STATUS_E_FAILURE;
  390. }
  391. /**
  392. * wmi_unified_stats_request_send() - WMI request stats function
  393. * @param wmi_handle : handle to WMI.
  394. * @param macaddr : MAC address
  395. * @param param : pointer to hold stats request parameter
  396. *
  397. * Return: 0 on success and -ve on failure.
  398. */
  399. CDF_STATUS wmi_unified_stats_request_send(void *wmi_hdl,
  400. uint8_t macaddr[IEEE80211_ADDR_LEN],
  401. struct stats_request_params *param)
  402. {
  403. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  404. if (wmi_handle->ops->send_stats_request_cmd)
  405. return wmi_handle->ops->send_stats_request_cmd(wmi_handle,
  406. macaddr, param);
  407. return CDF_STATUS_E_FAILURE;
  408. }
  409. /**
  410. * wmi_unified_stats_request_send() - WMI request stats function
  411. * @param wmi_handle : handle to WMI.
  412. * @param macaddr : MAC address
  413. * @param param : pointer to hold stats request parameter
  414. *
  415. * Return: 0 on success and -ve on failure.
  416. */
  417. CDF_STATUS wmi_unified_packet_log_enable_send(void *wmi_hdl,
  418. uint8_t macaddr[IEEE80211_ADDR_LEN],
  419. struct packet_enable_params *param)
  420. {
  421. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  422. if (wmi_handle->ops->send_packet_log_enable_cmd)
  423. return wmi_handle->ops->send_packet_log_enable_cmd(wmi_handle,
  424. macaddr, param);
  425. return CDF_STATUS_E_FAILURE;
  426. }
  427. /**
  428. * wmi_unified_beacon_send_cmd() - WMI beacon send function
  429. * @param wmi_handle : handle to WMI.
  430. * @param macaddr : MAC address
  431. * @param param : pointer to hold beacon send cmd parameter
  432. *
  433. * Return: 0 on success and -ve on failure.
  434. */
  435. CDF_STATUS wmi_unified_beacon_send_cmd(void *wmi_hdl,
  436. struct beacon_params *param)
  437. {
  438. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  439. if (wmi_handle->ops->send_beacon_send_cmd)
  440. return wmi_handle->ops->send_beacon_send_cmd(wmi_handle,
  441. param);
  442. return CDF_STATUS_E_FAILURE;
  443. }
  444. /**
  445. * wmi_unified_peer_assoc_send() - WMI peer assoc function
  446. * @param wmi_handle : handle to WMI.
  447. * @param macaddr : MAC address
  448. * @param param : pointer to peer assoc parameter
  449. *
  450. * Return: 0 on success and -ve on failure.
  451. */
  452. CDF_STATUS wmi_unified_peer_assoc_send(void *wmi_hdl,
  453. struct peer_assoc_params *param)
  454. {
  455. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  456. if (wmi_handle->ops->send_peer_assoc_cmd)
  457. return wmi_handle->ops->send_peer_assoc_cmd(wmi_handle,
  458. param);
  459. return CDF_STATUS_E_FAILURE;
  460. }
  461. /**
  462. * wmi_unified_scan_start_cmd_send() - WMI scan start function
  463. * @param wmi_handle : handle to WMI.
  464. * @param macaddr : MAC address
  465. * @param param : pointer to hold scan start cmd parameter
  466. *
  467. * Return: 0 on success and -ve on failure.
  468. */
  469. CDF_STATUS wmi_unified_scan_start_cmd_send(void *wmi_hdl,
  470. struct scan_start_params *param)
  471. {
  472. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  473. if (wmi_handle->ops->send_scan_start_cmd)
  474. return wmi_handle->ops->send_scan_start_cmd(wmi_handle,
  475. param);
  476. return CDF_STATUS_E_FAILURE;
  477. }
  478. /**
  479. * wmi_unified_scan_stop_cmd_send() - WMI scan start function
  480. * @param wmi_handle : handle to WMI.
  481. * @param macaddr : MAC address
  482. * @param param : pointer to hold scan start cmd parameter
  483. *
  484. * Return: 0 on success and -ve on failure.
  485. */
  486. CDF_STATUS wmi_unified_scan_stop_cmd_send(void *wmi_hdl,
  487. struct scan_stop_params *param)
  488. {
  489. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  490. if (wmi_handle->ops->send_scan_stop_cmd)
  491. return wmi_handle->ops->send_scan_stop_cmd(wmi_handle,
  492. param);
  493. return CDF_STATUS_E_FAILURE;
  494. }
  495. /**
  496. * wmi_unified_scan_chan_list_cmd_send() - WMI scan channel list function
  497. * @param wmi_handle : handle to WMI.
  498. * @param macaddr : MAC address
  499. * @param param : pointer to hold scan channel list parameter
  500. *
  501. * Return: 0 on success and -ve on failure.
  502. */
  503. CDF_STATUS wmi_unified_scan_chan_list_cmd_send(void *wmi_hdl,
  504. struct scan_chan_list_params *param)
  505. {
  506. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  507. if (wmi_handle->ops->send_scan_chan_list_cmd)
  508. return wmi_handle->ops->send_scan_chan_list_cmd(wmi_handle,
  509. param);
  510. return CDF_STATUS_E_FAILURE;
  511. }
  512. /**
  513. * wmi_mgmt_unified_cmd_send() - management cmd over wmi layer
  514. * @wmi_hdl : handle to WMI.
  515. * @param : pointer to hold mgmt cmd parameter
  516. *
  517. * Return: 0 on success and -ve on failure.
  518. */
  519. CDF_STATUS wmi_mgmt_unified_cmd_send(void *wmi_hdl,
  520. struct wmi_mgmt_params *param)
  521. {
  522. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  523. if (wmi_handle->ops->send_mgmt_cmd)
  524. return wmi_handle->ops->send_mgmt_cmd(wmi_handle,
  525. param);
  526. return CDF_STATUS_E_FAILURE;
  527. }
  528. /**
  529. * wmi_unified_modem_power_state() - set modem power state to fw
  530. * @wmi_hdl: wmi handle
  531. * @param_value: parameter value
  532. *
  533. * Return: 0 for success or error code
  534. */
  535. CDF_STATUS wmi_unified_modem_power_state(void *wmi_hdl,
  536. uint32_t param_value)
  537. {
  538. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  539. if (wmi_handle->ops->send_modem_power_state_cmd)
  540. return wmi_handle->ops->send_modem_power_state_cmd(wmi_handle,
  541. param_value);
  542. return CDF_STATUS_E_FAILURE;
  543. }
  544. /**
  545. * wmi_unified_set_sta_ps_mode() - set sta powersave params in fw
  546. * @wmi_hdl: wmi handle
  547. * @vdev_id: vdev id
  548. * @val: value
  549. *
  550. * Return: 0 for success or error code.
  551. */
  552. CDF_STATUS wmi_unified_set_sta_ps_mode(void *wmi_hdl,
  553. uint32_t vdev_id, uint8_t val)
  554. {
  555. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  556. if (wmi_handle->ops->send_set_sta_ps_mode_cmd)
  557. return wmi_handle->ops->send_set_sta_ps_mode_cmd(wmi_handle,
  558. vdev_id, val);
  559. return CDF_STATUS_E_FAILURE;
  560. }
  561. /**
  562. * wmi_set_mimops() - set MIMO powersave
  563. * @wmi_hdl: wmi handle
  564. * @vdev_id: vdev id
  565. * @value: value
  566. *
  567. * Return: CDF_STATUS_SUCCESS for success or error code.
  568. */
  569. CDF_STATUS wmi_unified_set_mimops(void *wmi_hdl, uint8_t vdev_id, int value)
  570. {
  571. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  572. if (wmi_handle->ops->send_set_mimops_cmd)
  573. return wmi_handle->ops->send_set_mimops_cmd(wmi_handle,
  574. vdev_id, value);
  575. return CDF_STATUS_E_FAILURE;
  576. }
  577. /**
  578. * wmi_set_smps_params() - set smps params
  579. * @wmi_hdl: wmi handle
  580. * @vdev_id: vdev id
  581. * @value: value
  582. *
  583. * Return: CDF_STATUS_SUCCESS for success or error code.
  584. */
  585. CDF_STATUS wmi_unified_set_smps_params(void *wmi_hdl, uint8_t vdev_id,
  586. int value)
  587. {
  588. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  589. if (wmi_handle->ops->send_set_smps_params_cmd)
  590. return wmi_handle->ops->send_set_smps_params_cmd(wmi_handle,
  591. vdev_id, value);
  592. return CDF_STATUS_E_FAILURE;
  593. }
  594. /**
  595. * wmi_set_p2pgo_oppps_req() - send p2p go opp power save request to fw
  596. * @wmi_hdl: wmi handle
  597. * @opps: p2p opp power save parameters
  598. *
  599. * Return: none
  600. */
  601. CDF_STATUS wmi_unified_set_p2pgo_oppps_req(void *wmi_hdl,
  602. struct p2p_ps_params *oppps)
  603. {
  604. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  605. if (wmi_handle->ops->send_set_p2pgo_oppps_req_cmd)
  606. return wmi_handle->ops->send_set_p2pgo_oppps_req_cmd(wmi_handle,
  607. oppps);
  608. return CDF_STATUS_E_FAILURE;
  609. }
  610. /**
  611. * wmi_unified_set_p2pgo_noa_req_cmd() - send p2p go noa request to fw
  612. * @wmi_hdl: wmi handle
  613. * @noa: p2p power save parameters
  614. *
  615. * Return: none
  616. */
  617. CDF_STATUS wmi_unified_set_p2pgo_noa_req_cmd(void *wmi_hdl,
  618. struct p2p_ps_params *noa)
  619. {
  620. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  621. if (wmi_handle->ops->send_set_p2pgo_noa_req_cmd)
  622. return wmi_handle->ops->send_set_p2pgo_noa_req_cmd(wmi_handle,
  623. noa);
  624. return CDF_STATUS_E_FAILURE;
  625. }
  626. /**
  627. * wmi_get_temperature() - get pdev temperature req
  628. * @wmi_hdl: wmi handle
  629. *
  630. * Return: CDF_STATUS_SUCCESS for success or error code.
  631. */
  632. CDF_STATUS wmi_unified_get_temperature(void *wmi_hdl)
  633. {
  634. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  635. if (wmi_handle->ops->send_get_temperature_cmd)
  636. return wmi_handle->ops->send_get_temperature_cmd(wmi_handle);
  637. return CDF_STATUS_E_FAILURE;
  638. }
  639. /**
  640. * wmi_unified_set_sta_uapsd_auto_trig_cmd() - set uapsd auto trigger command
  641. * @wmi_hdl: wmi handle
  642. * @end_set_sta_ps_mode_cmd: cmd paramter strcture
  643. *
  644. * This function sets the trigger
  645. * uapsd params such as service interval, delay interval
  646. * and suspend interval which will be used by the firmware
  647. * to send trigger frames periodically when there is no
  648. * traffic on the transmit side.
  649. *
  650. * Return: 0 for success or error code.
  651. */
  652. CDF_STATUS
  653. wmi_unified_set_sta_uapsd_auto_trig_cmd(void *wmi_hdl,
  654. struct sta_uapsd_trig_params *param)
  655. {
  656. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  657. if (wmi_handle->ops->send_set_sta_uapsd_auto_trig_cmd)
  658. return wmi_handle->ops->send_set_sta_uapsd_auto_trig_cmd(wmi_handle,
  659. param);
  660. return CDF_STATUS_E_FAILURE;
  661. }
  662. /**
  663. * wmi_unified_ocb_start_timing_advert() - start sending the timing advertisement
  664. * frames on a channel
  665. * @wmi_handle: pointer to the wmi handle
  666. * @timing_advert: pointer to the timing advertisement struct
  667. *
  668. * Return: 0 on succes
  669. */
  670. CDF_STATUS wmi_unified_ocb_start_timing_advert(void *wmi_hdl,
  671. struct ocb_timing_advert_param *timing_advert)
  672. {
  673. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  674. if (wmi_handle->ops->send_ocb_start_timing_advert_cmd)
  675. return wmi_handle->ops->send_ocb_start_timing_advert_cmd(wmi_handle,
  676. timing_advert);
  677. return CDF_STATUS_E_FAILURE;
  678. }
  679. /**
  680. * wmi_unified_ocb_stop_timing_advert() - stop sending the timing advertisement
  681. * frames on a channel
  682. * @wmi_handle: pointer to the wmi handle
  683. * @timing_advert: pointer to the timing advertisement struct
  684. *
  685. * Return: 0 on succes
  686. */
  687. CDF_STATUS wmi_unified_ocb_stop_timing_advert(void *wmi_hdl,
  688. struct ocb_timing_advert_param *timing_advert)
  689. {
  690. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  691. if (wmi_handle->ops->send_ocb_stop_timing_advert_cmd)
  692. return wmi_handle->ops->send_ocb_stop_timing_advert_cmd(wmi_handle,
  693. timing_advert);
  694. return CDF_STATUS_E_FAILURE;
  695. }
  696. /**
  697. * wmi_unified_ocb_set_utc_time_cmd() - get ocb tsf timer val
  698. * @wmi_handle: pointer to the wmi handle
  699. * @vdev_id: vdev id
  700. *
  701. * Return: 0 on succes
  702. */
  703. CDF_STATUS wmi_unified_ocb_set_utc_time_cmd(void *wmi_hdl,
  704. struct ocb_utc_param *utc)
  705. {
  706. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  707. if (wmi_handle->ops->send_ocb_set_utc_time_cmd)
  708. return wmi_handle->ops->send_ocb_set_utc_time_cmd(wmi_handle,
  709. utc);
  710. return CDF_STATUS_E_FAILURE;
  711. }
  712. /**
  713. * wmi_unified_ocb_get_tsf_timer() - get ocb tsf timer val
  714. * @wmi_handle: pointer to the wmi handle
  715. * @vdev_id: vdev id
  716. *
  717. * Return: 0 on succes
  718. */
  719. CDF_STATUS wmi_unified_ocb_get_tsf_timer(void *wmi_hdl,
  720. uint8_t vdev_id)
  721. {
  722. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  723. if (wmi_handle->ops->send_ocb_get_tsf_timer_cmd)
  724. return wmi_handle->ops->send_ocb_get_tsf_timer_cmd(wmi_handle,
  725. vdev_id);
  726. return CDF_STATUS_E_FAILURE;
  727. }
  728. /**
  729. * wmi_unified_dcc_get_stats_cmd() - get the DCC channel stats
  730. * @wmi_handle: pointer to the wmi handle
  731. * @get_stats_param: pointer to the dcc stats
  732. *
  733. * Return: 0 on succes
  734. */
  735. CDF_STATUS wmi_unified_dcc_get_stats_cmd(void *wmi_hdl,
  736. struct dcc_get_stats_param *get_stats_param)
  737. {
  738. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  739. if (wmi_handle->ops->send_dcc_get_stats_cmd)
  740. return wmi_handle->ops->send_dcc_get_stats_cmd(wmi_handle,
  741. get_stats_param);
  742. return CDF_STATUS_E_FAILURE;
  743. }
  744. /**
  745. * wmi_unified_dcc_clear_stats() - command to clear the DCC stats
  746. * @wmi_handle: pointer to the wmi handle
  747. * @clear_stats_param: parameters to the command
  748. *
  749. * Return: 0 on succes
  750. */
  751. CDF_STATUS wmi_unified_dcc_clear_stats(void *wmi_hdl,
  752. uint32_t vdev_id, uint32_t dcc_stats_bitmap)
  753. {
  754. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  755. if (wmi_handle->ops->send_dcc_clear_stats_cmd)
  756. return wmi_handle->ops->send_dcc_clear_stats_cmd(wmi_handle,
  757. vdev_id, dcc_stats_bitmap);
  758. return CDF_STATUS_E_FAILURE;
  759. }
  760. /**
  761. * wmi_unified_dcc_update_ndl() - command to update the NDL data
  762. * @wmi_handle: pointer to the wmi handle
  763. * @update_ndl_param: pointer to the request parameters
  764. *
  765. * Return: 0 on success
  766. */
  767. CDF_STATUS wmi_unified_dcc_update_ndl(void *wmi_hdl,
  768. struct dcc_update_ndl_param *update_ndl_param)
  769. {
  770. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  771. if (wmi_handle->ops->send_dcc_update_ndl_cmd)
  772. return wmi_handle->ops->send_dcc_update_ndl_cmd(wmi_handle,
  773. update_ndl_param);
  774. return CDF_STATUS_E_FAILURE;
  775. }
  776. /**
  777. * wmi_unified_ocb_set_config() - send the OCB config to the FW
  778. * @wmi_handle: pointer to the wmi handle
  779. * @config: the OCB configuration
  780. *
  781. * Return: 0 on success
  782. */
  783. CDF_STATUS wmi_unified_ocb_set_config(void *wmi_hdl,
  784. struct ocb_config_param *config, uint32_t *ch_mhz)
  785. {
  786. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  787. if (wmi_handle->ops->send_ocb_set_config_cmd)
  788. return wmi_handle->ops->send_ocb_set_config_cmd(wmi_handle,
  789. config, ch_mhz);
  790. return CDF_STATUS_E_FAILURE;
  791. }
  792. /**
  793. * wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd() - control mcc scheduler
  794. * @wmi_handle: wmi handle
  795. * @mcc_adaptive_scheduler: enable/disable
  796. *
  797. * This function enable/disable mcc adaptive scheduler in fw.
  798. *
  799. * Return: CDF_STATUS_SUCCESS for sucess or error code
  800. */
  801. CDF_STATUS wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd(
  802. void *wmi_hdl, uint32_t mcc_adaptive_scheduler)
  803. {
  804. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  805. if (wmi_handle->ops->send_set_enable_disable_mcc_adaptive_scheduler_cmd)
  806. return wmi_handle->ops->send_set_enable_disable_mcc_adaptive_scheduler_cmd(wmi_handle,
  807. mcc_adaptive_scheduler);
  808. return CDF_STATUS_E_FAILURE;
  809. }
  810. /**
  811. * wmi_unified_set_mcc_channel_time_latency_cmd() - set MCC channel time latency
  812. * @wmi: wmi handle
  813. * @mcc_channel: mcc channel
  814. * @mcc_channel_time_latency: MCC channel time latency.
  815. *
  816. * Currently used to set time latency for an MCC vdev/adapter using operating
  817. * channel of it and channel number. The info is provided run time using
  818. * iwpriv command: iwpriv <wlan0 | p2p0> setMccLatency <latency in ms>.
  819. *
  820. * Return: CDF status
  821. */
  822. CDF_STATUS wmi_unified_set_mcc_channel_time_latency_cmd(void *wmi_hdl,
  823. uint32_t mcc_channel_freq, uint32_t mcc_channel_time_latency)
  824. {
  825. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  826. if (wmi_handle->ops->send_set_mcc_channel_time_latency_cmd)
  827. return wmi_handle->ops->send_set_mcc_channel_time_latency_cmd(wmi_handle,
  828. mcc_channel_freq,
  829. mcc_channel_time_latency);
  830. return CDF_STATUS_E_FAILURE;
  831. }
  832. /**
  833. * wmi_unified_set_mcc_channel_time_quota_cmd() - set MCC channel time quota
  834. * @wmi: wmi handle
  835. * @adapter_1_chan_number: adapter 1 channel number
  836. * @adapter_1_quota: adapter 1 quota
  837. * @adapter_2_chan_number: adapter 2 channel number
  838. *
  839. * Return: CDF status
  840. */
  841. CDF_STATUS wmi_unified_set_mcc_channel_time_quota_cmd(void *wmi_hdl,
  842. uint32_t adapter_1_chan_freq,
  843. uint32_t adapter_1_quota, uint32_t adapter_2_chan_freq)
  844. {
  845. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  846. if (wmi_handle->ops->send_set_mcc_channel_time_quota_cmd)
  847. return wmi_handle->ops->send_set_mcc_channel_time_quota_cmd(wmi_handle,
  848. adapter_1_chan_freq,
  849. adapter_1_quota,
  850. adapter_2_chan_freq);
  851. return CDF_STATUS_E_FAILURE;
  852. }
  853. /**
  854. * wmi_unified_set_thermal_mgmt_cmd() - set thermal mgmt command to fw
  855. * @wmi_handle: Pointer to wmi handle
  856. * @thermal_info: Thermal command information
  857. *
  858. * This function sends the thermal management command
  859. * to the firmware
  860. *
  861. * Return: CDF_STATUS_SUCCESS for success otherwise failure
  862. */
  863. CDF_STATUS wmi_unified_set_thermal_mgmt_cmd(void *wmi_hdl,
  864. struct thermal_cmd_params *thermal_info)
  865. {
  866. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  867. if (wmi_handle->ops->send_set_thermal_mgmt_cmd)
  868. return wmi_handle->ops->send_set_thermal_mgmt_cmd(wmi_handle,
  869. thermal_info);
  870. return CDF_STATUS_E_FAILURE;
  871. }
  872. /**
  873. * wmi_unified_lro_config_cmd() - process the LRO config command
  874. * @wmi: Pointer to wmi handle
  875. * @wmi_lro_cmd: Pointer to LRO configuration parameters
  876. *
  877. * This function sends down the LRO configuration parameters to
  878. * the firmware to enable LRO, sets the TCP flags and sets the
  879. * seed values for the toeplitz hash generation
  880. *
  881. * Return: CDF_STATUS_SUCCESS for success otherwise failure
  882. */
  883. CDF_STATUS wmi_unified_lro_config_cmd(void *wmi_hdl,
  884. struct wmi_lro_config_cmd_t *wmi_lro_cmd)
  885. {
  886. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  887. if (wmi_handle->ops->send_lro_config_cmd)
  888. return wmi_handle->ops->send_lro_config_cmd(wmi_handle,
  889. wmi_lro_cmd);
  890. return CDF_STATUS_E_FAILURE;
  891. }
  892. /**
  893. * wmi_unified_bcn_buf_ll_cmd() - prepare and send beacon buffer to fw for LL
  894. * @wmi_hdl: wmi handle
  895. * @param: bcn ll cmd parameter
  896. *
  897. * Return: CDF_STATUS_SUCCESS for success otherwise failure
  898. */
  899. CDF_STATUS wmi_unified_bcn_buf_ll_cmd(void *wmi_hdl,
  900. wmi_bcn_send_from_host_cmd_fixed_param *param)
  901. {
  902. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  903. if (wmi_handle->ops->send_bcn_buf_ll_cmd)
  904. return wmi_handle->ops->send_bcn_buf_ll_cmd(wmi_handle,
  905. param);
  906. return CDF_STATUS_E_FAILURE;
  907. }
  908. /**
  909. * wmi_unified_set_sta_sa_query_param_cmd() - set sta sa query parameters
  910. * @wmi_hdl: wmi handle
  911. * @vdev_id: vdev id
  912. * @max_retries: max retries
  913. * @retry_interval: retry interval
  914. * This function sets sta query related parameters in fw.
  915. *
  916. * Return: CDF_STATUS_SUCCESS for success otherwise failure
  917. */
  918. CDF_STATUS wmi_unified_set_sta_sa_query_param_cmd(void *wmi_hdl,
  919. uint8_t vdev_id, uint32_t max_retries,
  920. uint32_t retry_interval)
  921. {
  922. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  923. if (wmi_handle->ops->send_set_sta_sa_query_param_cmd)
  924. return wmi_handle->ops->send_set_sta_sa_query_param_cmd(wmi_handle,
  925. vdev_id, max_retries,
  926. retry_interval);
  927. return CDF_STATUS_E_FAILURE;
  928. }
  929. /**
  930. * wmi_unified_set_sta_keep_alive_cmd() - set sta keep alive parameters
  931. * @wmi_hdl: wmi handle
  932. * @params: sta keep alive parameter
  933. *
  934. * This function sets keep alive related parameters in fw.
  935. *
  936. * Return: none
  937. */
  938. CDF_STATUS wmi_unified_set_sta_keep_alive_cmd(void *wmi_hdl,
  939. struct sta_params *params)
  940. {
  941. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  942. if (wmi_handle->ops->send_set_sta_keep_alive_cmd)
  943. return wmi_handle->ops->send_set_sta_keep_alive_cmd(wmi_handle,
  944. params);
  945. return CDF_STATUS_E_FAILURE;
  946. }
  947. /**
  948. * wmi_unified_vdev_set_gtx_cfg_cmd() - set GTX params
  949. * @wmi_hdl: wmi handle
  950. * @if_id: vdev id
  951. * @gtx_info: GTX config params
  952. *
  953. * This function set GTX related params in firmware.
  954. *
  955. * Return: 0 for success or error code
  956. */
  957. CDF_STATUS wmi_unified_vdev_set_gtx_cfg_cmd(void *wmi_hdl, uint32_t if_id,
  958. struct wmi_gtx_config *gtx_info)
  959. {
  960. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  961. if (wmi_handle->ops->send_vdev_set_gtx_cfg_cmd)
  962. return wmi_handle->ops->send_vdev_set_gtx_cfg_cmd(wmi_handle,
  963. if_id, gtx_info);
  964. return CDF_STATUS_E_FAILURE;
  965. }
  966. /**
  967. * wmi_unified_process_update_edca_param() - update EDCA params
  968. * @wmi_hdl: wmi handle
  969. * @edca_params: edca parameters
  970. *
  971. * This function updates EDCA parameters to the target
  972. *
  973. * Return: CDF Status
  974. */
  975. CDF_STATUS wmi_unified_process_update_edca_param(void *wmi_hdl,
  976. uint8_t vdev_id,
  977. wmi_wmm_vparams gwmm_param[WMI_MAX_NUM_AC])
  978. {
  979. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  980. if (wmi_handle->ops->send_process_update_edca_param_cmd)
  981. return wmi_handle->ops->send_process_update_edca_param_cmd(wmi_handle,
  982. vdev_id, gwmm_param);
  983. return CDF_STATUS_E_FAILURE;
  984. }
  985. /**
  986. * wmi_unified_probe_rsp_tmpl_send_cmd() - send probe response template to fw
  987. * @wmi_hdl: wmi handle
  988. * @vdev_id: vdev id
  989. * @probe_rsp_info: probe response info
  990. *
  991. * Return: 0 for success or error code
  992. */
  993. CDF_STATUS wmi_unified_probe_rsp_tmpl_send_cmd(void *wmi_hdl,
  994. uint8_t vdev_id,
  995. struct wmi_probe_resp_params *probe_rsp_info,
  996. uint8_t *frm)
  997. {
  998. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  999. if (wmi_handle->ops->send_probe_rsp_tmpl_send_cmd)
  1000. return wmi_handle->ops->send_probe_rsp_tmpl_send_cmd(wmi_handle,
  1001. vdev_id, probe_rsp_info,
  1002. frm);
  1003. return CDF_STATUS_E_FAILURE;
  1004. }
  1005. /**
  1006. * wmi_unified_p2p_go_set_beacon_ie_cmd() - set beacon IE for p2p go
  1007. * @wma_handle: wma handle
  1008. * @vdev_id: vdev id
  1009. * @p2p_ie: p2p IE
  1010. *
  1011. * Return: 0 for success or error code
  1012. */
  1013. CDF_STATUS wmi_unified_p2p_go_set_beacon_ie_cmd(void *wmi_hdl,
  1014. A_UINT32 vdev_id, uint8_t *p2p_ie)
  1015. {
  1016. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1017. if (wmi_handle->ops->send_p2p_go_set_beacon_ie_cmd)
  1018. return wmi_handle->ops->send_p2p_go_set_beacon_ie_cmd(wmi_handle,
  1019. vdev_id, p2p_ie);
  1020. return CDF_STATUS_E_FAILURE;
  1021. }
  1022. /**
  1023. * wmi_unified_set_gateway_params_cmd() - set gateway parameters
  1024. * @wmi_hdl: wmi handle
  1025. * @req: gateway parameter update request structure
  1026. *
  1027. * This function reads the incoming @req and fill in the destination
  1028. * WMI structure and sends down the gateway configs down to the firmware
  1029. *
  1030. * Return: CDF_STATUS
  1031. */
  1032. CDF_STATUS wmi_unified_set_gateway_params_cmd(void *wmi_hdl,
  1033. struct gateway_update_req_param *req)
  1034. {
  1035. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1036. if (wmi_handle->ops->send_set_gateway_params_cmd)
  1037. return wmi_handle->ops->send_set_gateway_params_cmd(wmi_handle,
  1038. req);
  1039. return CDF_STATUS_E_FAILURE;
  1040. }
  1041. /**
  1042. * wmi_unified_set_rssi_monitoring_cmd() - set rssi monitoring
  1043. * @wmi_hdl: wmi handle
  1044. * @req: rssi monitoring request structure
  1045. *
  1046. * This function reads the incoming @req and fill in the destination
  1047. * WMI structure and send down the rssi monitoring configs down to the firmware
  1048. *
  1049. * Return: 0 on success; error number otherwise
  1050. */
  1051. CDF_STATUS wmi_unified_set_rssi_monitoring_cmd(void *wmi_hdl,
  1052. struct rssi_monitor_param *req)
  1053. {
  1054. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1055. if (wmi_handle->ops->send_pno_start_cmd)
  1056. return wmi_handle->ops->send_set_rssi_monitoring_cmd(wmi_handle,
  1057. req);
  1058. return CDF_STATUS_E_FAILURE;
  1059. }
  1060. /**
  1061. * wmi_unified_scan_probe_setoui_cmd() - set scan probe OUI
  1062. * @wmi_hdl: wmi handle
  1063. * @psetoui: OUI parameters
  1064. *
  1065. * set scan probe OUI parameters in firmware
  1066. *
  1067. * Return: CDF status
  1068. */
  1069. CDF_STATUS wmi_unified_scan_probe_setoui_cmd(void *wmi_hdl,
  1070. struct scan_mac_oui *psetoui)
  1071. {
  1072. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1073. if (wmi_handle->ops->send_scan_probe_setoui_cmd)
  1074. return wmi_handle->ops->send_scan_probe_setoui_cmd(wmi_handle,
  1075. psetoui);
  1076. return CDF_STATUS_E_FAILURE;
  1077. }
  1078. /**
  1079. * wmi_unified_reset_passpoint_network_list_cmd() - reset passpoint network list
  1080. * @wmi_hdl: wmi handle
  1081. * @req: passpoint network request structure
  1082. *
  1083. * This function sends down WMI command with network id set to wildcard id.
  1084. * firmware shall clear all the config entries
  1085. *
  1086. * Return: CDF_STATUS enumeration
  1087. */
  1088. CDF_STATUS wmi_unified_reset_passpoint_network_list_cmd(void *wmi_hdl,
  1089. struct wifi_passpoint_req_param *req)
  1090. {
  1091. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1092. if (wmi_handle->ops->send_reset_passpoint_network_list_cmd)
  1093. return wmi_handle->ops->send_reset_passpoint_network_list_cmd(wmi_handle,
  1094. req);
  1095. return CDF_STATUS_E_FAILURE;
  1096. }
  1097. /**
  1098. * wmi_unified_set_passpoint_network_list_cmd() - set passpoint network list
  1099. * @wmi_hdl: wmi handle
  1100. * @req: passpoint network request structure
  1101. *
  1102. * This function reads the incoming @req and fill in the destination
  1103. * WMI structure and send down the passpoint configs down to the firmware
  1104. *
  1105. * Return: CDF_STATUS enumeration
  1106. */
  1107. CDF_STATUS wmi_unified_set_passpoint_network_list_cmd(void *wmi_hdl,
  1108. struct wifi_passpoint_req_param *req)
  1109. {
  1110. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1111. if (wmi_handle->ops->send_set_passpoint_network_list_cmd)
  1112. return wmi_handle->ops->send_set_passpoint_network_list_cmd(wmi_handle,
  1113. req);
  1114. return CDF_STATUS_E_FAILURE;
  1115. }
  1116. /** wmi_unified_set_epno_network_list_cmd() - set epno network list
  1117. * @wmi_hdl: wmi handle
  1118. * @req: epno config params request structure
  1119. *
  1120. * This function reads the incoming epno config request structure
  1121. * and constructs the WMI message to the firmware.
  1122. *
  1123. * Returns: 0 on success, error number otherwise
  1124. */
  1125. CDF_STATUS wmi_unified_set_epno_network_list_cmd(void *wmi_hdl,
  1126. struct wifi_enhanched_pno_params *req)
  1127. {
  1128. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1129. if (wmi_handle->ops->send_set_epno_network_list_cmd)
  1130. return wmi_handle->ops->send_set_epno_network_list_cmd(wmi_handle,
  1131. req);
  1132. return CDF_STATUS_E_FAILURE;
  1133. }
  1134. /** wmi_unified_ipa_offload_control_cmd() - ipa offload control parameter
  1135. * @wmi_hdl: wmi handle
  1136. * @ipa_offload: ipa offload control parameter
  1137. *
  1138. * Returns: 0 on success, error number otherwise
  1139. */
  1140. CDF_STATUS wmi_unified_ipa_offload_control_cmd(void *wmi_hdl,
  1141. struct ipa_offload_control_params *ipa_offload)
  1142. {
  1143. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1144. if (wmi_handle->ops->send_ipa_offload_control_cmd)
  1145. return wmi_handle->ops->send_ipa_offload_control_cmd(wmi_handle,
  1146. ipa_offload);
  1147. return CDF_STATUS_E_FAILURE;
  1148. }
  1149. /**
  1150. * wmi_unified_extscan_get_capabilities_cmd() - extscan get capabilities
  1151. * @wmi_hdl: wmi handle
  1152. * @pgetcapab: get capabilities params
  1153. *
  1154. * This function send request to fw to get extscan capabilities.
  1155. *
  1156. * Return: CDF status
  1157. */
  1158. CDF_STATUS wmi_unified_extscan_get_capabilities_cmd(void *wmi_hdl,
  1159. struct extscan_capabilities_params *pgetcapab)
  1160. {
  1161. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1162. if (wmi_handle->ops->send_extscan_get_capabilities_cmd)
  1163. return wmi_handle->ops->send_extscan_get_capabilities_cmd(wmi_handle,
  1164. pgetcapab);
  1165. return CDF_STATUS_E_FAILURE;
  1166. }
  1167. /**
  1168. * wmi_unified_extscan_get_cached_results_cmd() - extscan get cached results
  1169. * @wmi_hdl: wmi handle
  1170. * @pcached_results: cached results parameters
  1171. *
  1172. * This function send request to fw to get cached results.
  1173. *
  1174. * Return: CDF status
  1175. */
  1176. CDF_STATUS wmi_unified_extscan_get_cached_results_cmd(void *wmi_hdl,
  1177. struct extscan_cached_result_params *pcached_results)
  1178. {
  1179. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1180. if (wmi_handle->ops->send_extscan_get_cached_results_cmd)
  1181. return wmi_handle->ops->send_extscan_get_cached_results_cmd(wmi_handle,
  1182. pcached_results);
  1183. return CDF_STATUS_E_FAILURE;
  1184. }
  1185. /**
  1186. * wmi_unified_extscan_stop_change_monitor_cmd() - send stop change monitor cmd
  1187. * @wmi_hdl: wmi handle
  1188. * @reset_req: Reset change request params
  1189. *
  1190. * This function sends stop change monitor request to fw.
  1191. *
  1192. * Return: CDF status
  1193. */
  1194. CDF_STATUS wmi_unified_extscan_stop_change_monitor_cmd(void *wmi_hdl,
  1195. struct extscan_capabilities_reset_params *reset_req)
  1196. {
  1197. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1198. if (wmi_handle->ops->send_extscan_stop_change_monitor_cmd)
  1199. return wmi_handle->ops->send_extscan_stop_change_monitor_cmd(wmi_handle,
  1200. reset_req);
  1201. return CDF_STATUS_E_FAILURE;
  1202. }
  1203. /**
  1204. * wmi_unified_extscan_start_change_monitor_cmd() - start change monitor cmd
  1205. * @wmi_hdl: wmi handle
  1206. * @psigchange: change monitor request params
  1207. *
  1208. * This function sends start change monitor request to fw.
  1209. *
  1210. * Return: CDF status
  1211. */
  1212. CDF_STATUS wmi_unified_extscan_start_change_monitor_cmd(void *wmi_hdl,
  1213. struct extscan_set_sig_changereq_params *
  1214. psigchange)
  1215. {
  1216. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1217. if (wmi_handle->ops->send_extscan_start_change_monitor_cmd)
  1218. return wmi_handle->ops->send_extscan_start_change_monitor_cmd(wmi_handle,
  1219. psigchange);
  1220. return CDF_STATUS_E_FAILURE;
  1221. }
  1222. /**
  1223. * wmi_unified_extscan_stop_hotlist_monitor_cmd() - stop hotlist monitor
  1224. * @wmi_hdl: wmi handle
  1225. * @photlist_reset: hotlist reset params
  1226. *
  1227. * This function configures hotlist monitor to stop in fw.
  1228. *
  1229. * Return: CDF status
  1230. */
  1231. CDF_STATUS wmi_unified_extscan_stop_hotlist_monitor_cmd(void *wmi_hdl,
  1232. struct extscan_bssid_hotlist_reset_params *photlist_reset)
  1233. {
  1234. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1235. if (wmi_handle->ops->send_extscan_stop_hotlist_monitor_cmd)
  1236. return wmi_handle->ops->send_extscan_stop_hotlist_monitor_cmd(wmi_handle,
  1237. photlist_reset);
  1238. return CDF_STATUS_E_FAILURE;
  1239. }
  1240. /**
  1241. * wmi_unified_stop_extscan_cmd() - stop extscan command to fw.
  1242. * @wmi_hdl: wmi handle
  1243. * @pstopcmd: stop scan command request params
  1244. *
  1245. * This function sends stop extscan request to fw.
  1246. *
  1247. * Return: CDF Status.
  1248. */
  1249. CDF_STATUS wmi_unified_stop_extscan_cmd(void *wmi_hdl,
  1250. struct extscan_stop_req_params *pstopcmd)
  1251. {
  1252. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1253. if (wmi_handle->ops->send_stop_extscan_cmd)
  1254. return wmi_handle->ops->send_stop_extscan_cmd(wmi_handle,
  1255. pstopcmd);
  1256. return CDF_STATUS_E_FAILURE;
  1257. }
  1258. /**
  1259. * wmi_unified_start_extscan_cmd() - start extscan command to fw.
  1260. * @wmi_hdl: wmi handle
  1261. * @pstart: scan command request params
  1262. *
  1263. * This function sends start extscan request to fw.
  1264. *
  1265. * Return: CDF Status.
  1266. */
  1267. CDF_STATUS wmi_unified_start_extscan_cmd(void *wmi_hdl,
  1268. struct wifi_scan_cmd_req_params *pstart)
  1269. {
  1270. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1271. if (wmi_handle->ops->send_start_extscan_cmd)
  1272. return wmi_handle->ops->send_start_extscan_cmd(wmi_handle,
  1273. pstart);
  1274. return CDF_STATUS_E_FAILURE;
  1275. }
  1276. /**
  1277. * wmi_unified_plm_stop_cmd() - plm stop request
  1278. * @wmi_hdl: wmi handle
  1279. * @plm: plm request parameters
  1280. *
  1281. * This function request FW to stop PLM.
  1282. *
  1283. * Return: CDF status
  1284. */
  1285. CDF_STATUS wmi_unified_plm_stop_cmd(void *wmi_hdl,
  1286. const struct plm_req_params *plm)
  1287. {
  1288. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1289. if (wmi_handle->ops->send_plm_stop_cmd)
  1290. return wmi_handle->ops->send_plm_stop_cmd(wmi_handle,
  1291. plm);
  1292. return CDF_STATUS_E_FAILURE;
  1293. }
  1294. /**
  1295. * wmi_unified_plm_start_cmd() - plm start request
  1296. * @wmi_hdl: wmi handle
  1297. * @plm: plm request parameters
  1298. *
  1299. * This function request FW to start PLM.
  1300. *
  1301. * Return: CDF status
  1302. */
  1303. CDF_STATUS wmi_unified_plm_start_cmd(void *wmi_hdl,
  1304. const struct plm_req_params *plm,
  1305. uint32_t *gchannel_list)
  1306. {
  1307. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1308. if (wmi_handle->ops->send_plm_start_cmd)
  1309. return wmi_handle->ops->send_plm_start_cmd(wmi_handle,
  1310. plm, gchannel_list);
  1311. return CDF_STATUS_E_FAILURE;
  1312. }
  1313. /**
  1314. * send_pno_stop_cmd() - PNO stop request
  1315. * @wmi_hdl: wmi handle
  1316. * @vdev_id: vdev id
  1317. *
  1318. * This function request FW to stop ongoing PNO operation.
  1319. *
  1320. * Return: CDF status
  1321. */
  1322. CDF_STATUS wmi_unified_pno_stop_cmd(void *wmi_hdl, uint8_t vdev_id)
  1323. {
  1324. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1325. if (wmi_handle->ops->send_pno_stop_cmd)
  1326. return wmi_handle->ops->send_pno_stop_cmd(wmi_handle,
  1327. vdev_id);
  1328. return CDF_STATUS_E_FAILURE;
  1329. }
  1330. /**
  1331. * wmi_unified_pno_start_cmd() - PNO start request
  1332. * @wmi_hdl: wmi handle
  1333. * @pno: PNO request
  1334. * @gchannel_freq_list: channel frequency list
  1335. *
  1336. * This function request FW to start PNO request.
  1337. * Request: CDF status
  1338. */
  1339. CDF_STATUS wmi_unified_pno_start_cmd(void *wmi_hdl,
  1340. struct pno_scan_req_params *pno,
  1341. uint32_t *gchannel_freq_list)
  1342. {
  1343. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1344. if (wmi_handle->ops->send_pno_start_cmd)
  1345. return wmi_handle->ops->send_pno_start_cmd(wmi_handle,
  1346. pno, gchannel_freq_list);
  1347. return CDF_STATUS_E_FAILURE;
  1348. }
  1349. /* wmi_unified_set_ric_req_cmd() - set ric request element
  1350. * @wmi_hdl: wmi handle
  1351. * @msg: message
  1352. * @is_add_ts: is addts required
  1353. *
  1354. * This function sets ric request element for 11r roaming.
  1355. *
  1356. * Return: none
  1357. */
  1358. CDF_STATUS wmi_unified_set_ric_req_cmd(void *wmi_hdl, void *msg,
  1359. uint8_t is_add_ts)
  1360. {
  1361. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1362. if (wmi_handle->ops->send_set_ric_req_cmd)
  1363. return wmi_handle->ops->send_set_ric_req_cmd(wmi_handle, msg,
  1364. is_add_ts);
  1365. return CDF_STATUS_E_FAILURE;
  1366. }
  1367. /**
  1368. * wmi_unified_process_ll_stats_clear_cmd() - clear link layer stats
  1369. * @wmi_hdl: wmi handle
  1370. * @clear_req: ll stats clear request command params
  1371. * @addr: mac address
  1372. *
  1373. * Return: CDF_STATUS_SUCCESS for success or error code
  1374. */
  1375. CDF_STATUS wmi_unified_process_ll_stats_clear_cmd(void *wmi_hdl,
  1376. const struct ll_stats_clear_params *clear_req,
  1377. uint8_t addr[IEEE80211_ADDR_LEN])
  1378. {
  1379. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1380. if (wmi_handle->ops->send_process_ll_stats_clear_cmd)
  1381. return wmi_handle->ops->send_process_ll_stats_clear_cmd(wmi_handle,
  1382. clear_req, addr);
  1383. return CDF_STATUS_E_FAILURE;
  1384. }
  1385. /**
  1386. * wmi_unified_process_ll_stats_get_cmd() - link layer stats get request
  1387. * @wmi_hdl:wmi handle
  1388. * @get_req:ll stats get request command params
  1389. *
  1390. * Return: CDF_STATUS_SUCCESS for success or error code
  1391. */
  1392. CDF_STATUS wmi_unified_process_ll_stats_get_cmd(void *wmi_hdl,
  1393. const struct ll_stats_get_params *get_req,
  1394. uint8_t addr[IEEE80211_ADDR_LEN])
  1395. {
  1396. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1397. if (wmi_handle->ops->send_process_ll_stats_get_cmd)
  1398. return wmi_handle->ops->send_process_ll_stats_get_cmd(wmi_handle,
  1399. get_req, addr);
  1400. return CDF_STATUS_E_FAILURE;
  1401. }
  1402. /**
  1403. * wmi_unified_get_stats_cmd() - get stats request
  1404. * @wmi_hdl: wma handle
  1405. * @get_stats_param: stats params
  1406. * @addr: mac address
  1407. *
  1408. * Return: none
  1409. */
  1410. CDF_STATUS wmi_unified_get_stats_cmd(void *wmi_hdl,
  1411. struct pe_stats_req *get_stats_param,
  1412. uint8_t addr[IEEE80211_ADDR_LEN])
  1413. {
  1414. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1415. if (wmi_handle->ops->send_get_stats_cmd)
  1416. return wmi_handle->ops->send_get_stats_cmd(wmi_handle,
  1417. get_stats_param, addr);
  1418. return CDF_STATUS_E_FAILURE;
  1419. }
  1420. /**
  1421. * wmi_unified_process_ll_stats_set_cmd() - link layer stats set request
  1422. * @wmi_handle: wmi handle
  1423. * @set_req: ll stats set request command params
  1424. *
  1425. * Return: CDF_STATUS_SUCCESS for success or error code
  1426. */
  1427. CDF_STATUS wmi_unified_process_ll_stats_set_cmd(void *wmi_hdl,
  1428. const struct ll_stats_set_params *set_req)
  1429. {
  1430. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1431. if (wmi_handle->ops->send_process_ll_stats_set_cmd)
  1432. return wmi_handle->ops->send_process_ll_stats_set_cmd(wmi_handle,
  1433. set_req);
  1434. return CDF_STATUS_E_FAILURE;
  1435. }
  1436. /**
  1437. * wmi_unified_snr_request_cmd() - send request to fw to get RSSI stats
  1438. * @wmi_handle: wmi handle
  1439. * @rssi_req: get RSSI request
  1440. *
  1441. * Return: CDF status
  1442. */
  1443. CDF_STATUS wmi_unified_snr_request_cmd(void *wmi_hdl)
  1444. {
  1445. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1446. if (wmi_handle->ops->send_snr_request_cmd)
  1447. return wmi_handle->ops->send_snr_request_cmd(wmi_handle);
  1448. return CDF_STATUS_E_FAILURE;
  1449. }
  1450. /**
  1451. * wmi_unified_snr_cmd() - get RSSI from fw
  1452. * @wmi_handle: wmi handle
  1453. * @vdev_id: vdev id
  1454. *
  1455. * Return: CDF status
  1456. */
  1457. CDF_STATUS wmi_unified_snr_cmd(void *wmi_hdl, uint8_t vdev_id)
  1458. {
  1459. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1460. if (wmi_handle->ops->send_snr_cmd)
  1461. return wmi_handle->ops->send_snr_cmd(wmi_handle,
  1462. vdev_id);
  1463. return CDF_STATUS_E_FAILURE;
  1464. }
  1465. /**
  1466. * wmi_unified_link_status_req_cmd() - process link status request from UMAC
  1467. * @wmi_handle: wmi handle
  1468. * @link_status: get link params
  1469. *
  1470. * Return: CDF status
  1471. */
  1472. CDF_STATUS wmi_unified_link_status_req_cmd(void *wmi_hdl,
  1473. struct link_status_params *link_status)
  1474. {
  1475. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1476. if (wmi_handle->ops->send_link_status_req_cmd)
  1477. return wmi_handle->ops->send_link_status_req_cmd(wmi_handle,
  1478. link_status);
  1479. return CDF_STATUS_E_FAILURE;
  1480. }
  1481. #ifdef FEATURE_WLAN_LPHB
  1482. /**
  1483. * wmi_unified_lphb_config_hbenable_cmd() - enable command of LPHB configuration requests
  1484. * @wmi_handle: wmi handle
  1485. * @lphb_conf_req: configuration info
  1486. *
  1487. * Return: CDF status
  1488. */
  1489. CDF_STATUS wmi_unified_lphb_config_hbenable_cmd(void *wmi_hdl,
  1490. wmi_hb_set_enable_cmd_fixed_param *params)
  1491. {
  1492. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1493. if (wmi_handle->ops->send_lphb_config_hbenable_cmd)
  1494. return wmi_handle->ops->send_lphb_config_hbenable_cmd(wmi_handle,
  1495. params);
  1496. return CDF_STATUS_E_FAILURE;
  1497. }
  1498. /**
  1499. * wmi_unified_lphb_config_tcp_params_cmd() - set tcp params of LPHB configuration requests
  1500. * @wmi_handle: wmi handle
  1501. * @lphb_conf_req: lphb config request
  1502. *
  1503. * Return: CDF status
  1504. */
  1505. CDF_STATUS wmi_unified_lphb_config_tcp_params_cmd(void *wmi_hdl,
  1506. wmi_hb_set_tcp_params_cmd_fixed_param *lphb_conf_req)
  1507. {
  1508. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1509. if (wmi_handle->ops->send_lphb_config_tcp_params_cmd)
  1510. return wmi_handle->ops->send_lphb_config_tcp_params_cmd(wmi_handle,
  1511. lphb_conf_req);
  1512. return CDF_STATUS_E_FAILURE;
  1513. }
  1514. /**
  1515. * wmi_unified_lphb_config_tcp_pkt_filter_cmd() - configure tcp packet filter command of LPHB
  1516. * @wmi_handle: wmi handle
  1517. * @lphb_conf_req: lphb config request
  1518. *
  1519. * Return: CDF status
  1520. */
  1521. CDF_STATUS wmi_unified_lphb_config_tcp_pkt_filter_cmd(void *wmi_hdl,
  1522. wmi_hb_set_tcp_pkt_filter_cmd_fixed_param *g_hb_tcp_filter_fp)
  1523. {
  1524. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1525. if (wmi_handle->ops->send_lphb_config_tcp_pkt_filter_cmd)
  1526. return wmi_handle->ops->send_lphb_config_tcp_pkt_filter_cmd(wmi_handle,
  1527. g_hb_tcp_filter_fp);
  1528. return CDF_STATUS_E_FAILURE;
  1529. }
  1530. /**
  1531. * wmi_unified_lphb_config_udp_params_cmd() - configure udp param command of LPHB
  1532. * @wmi_handle: wmi handle
  1533. * @lphb_conf_req: lphb config request
  1534. *
  1535. * Return: CDF status
  1536. */
  1537. CDF_STATUS wmi_unified_lphb_config_udp_params_cmd(void *wmi_hdl,
  1538. wmi_hb_set_udp_params_cmd_fixed_param *lphb_conf_req)
  1539. {
  1540. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1541. if (wmi_handle->ops->send_lphb_config_udp_params_cmd)
  1542. return wmi_handle->ops->send_lphb_config_udp_params_cmd(wmi_handle,
  1543. lphb_conf_req);
  1544. return CDF_STATUS_E_FAILURE;
  1545. }
  1546. /**
  1547. * wmi_unified_lphb_config_udp_pkt_filter_cmd() - configure udp pkt filter command of LPHB
  1548. * @wmi_handle: wmi handle
  1549. * @lphb_conf_req: lphb config request
  1550. *
  1551. * Return: CDF status
  1552. */
  1553. CDF_STATUS wmi_unified_lphb_config_udp_pkt_filter_cmd(void *wmi_hdl,
  1554. wmi_hb_set_udp_pkt_filter_cmd_fixed_param *lphb_conf_req)
  1555. {
  1556. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1557. if (wmi_handle->ops->send_lphb_config_udp_pkt_filter_cmd)
  1558. return wmi_handle->ops->send_lphb_config_udp_pkt_filter_cmd(wmi_handle,
  1559. lphb_conf_req);
  1560. return CDF_STATUS_E_FAILURE;
  1561. }
  1562. #endif /* FEATURE_WLAN_LPHB */
  1563. /**
  1564. * wmi_unified_process_dhcp_ind() - process dhcp indication from SME
  1565. * @wmi_handle: wmi handle
  1566. * @ta_dhcp_ind: DHCP indication parameter
  1567. *
  1568. * Return: CDF Status
  1569. */
  1570. CDF_STATUS wmi_unified_process_dhcp_ind(void *wmi_hdl,
  1571. wmi_peer_set_param_cmd_fixed_param *ta_dhcp_ind)
  1572. {
  1573. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1574. if (wmi_handle->ops->send_process_dhcp_ind_cmd)
  1575. return wmi_handle->ops->send_process_dhcp_ind_cmd(wmi_handle,
  1576. ta_dhcp_ind);
  1577. return CDF_STATUS_E_FAILURE;
  1578. }
  1579. /**
  1580. * wmi_unified_get_link_speed_cmd() -send command to get linkspeed
  1581. * @wmi_handle: wmi handle
  1582. * @pLinkSpeed: link speed info
  1583. *
  1584. * Return: CDF status
  1585. */
  1586. CDF_STATUS wmi_unified_get_link_speed_cmd(void *wmi_hdl,
  1587. wmi_mac_addr peer_macaddr)
  1588. {
  1589. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1590. if (wmi_handle->ops->send_get_link_speed_cmd)
  1591. return wmi_handle->ops->send_get_link_speed_cmd(wmi_handle,
  1592. peer_macaddr);
  1593. return CDF_STATUS_E_FAILURE;
  1594. }
  1595. /**
  1596. * wmi_unified_egap_conf_params_cmd() - send wmi cmd of egap configuration params
  1597. * @wmi_handle: wmi handler
  1598. * @egap_params: pointer to egap_params
  1599. *
  1600. * Return: 0 for success, otherwise appropriate error code
  1601. */
  1602. CDF_STATUS wmi_unified_egap_conf_params_cmd(void *wmi_hdl,
  1603. wmi_ap_ps_egap_param_cmd_fixed_param *egap_params)
  1604. {
  1605. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1606. if (wmi_handle->ops->send_egap_conf_params_cmd)
  1607. return wmi_handle->ops->send_egap_conf_params_cmd(wmi_handle,
  1608. egap_params);
  1609. return CDF_STATUS_E_FAILURE;
  1610. }
  1611. /**
  1612. * wmi_unified_fw_profiling_data_cmd() - send FW profiling cmd to WLAN FW
  1613. * @wmi_handl: wmi handle
  1614. * @cmd: Profiling command index
  1615. * @value1: parameter1 value
  1616. * @value2: parameter2 value
  1617. *
  1618. * Return: 0 for success else error code
  1619. */
  1620. CDF_STATUS wmi_unified_fw_profiling_data_cmd(void *wmi_hdl,
  1621. uint32_t cmd, uint32_t value1, uint32_t value2)
  1622. {
  1623. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1624. if (wmi_handle->ops->send_fw_profiling_cmd)
  1625. return wmi_handle->ops->send_fw_profiling_cmd(wmi_handle,
  1626. cmd, value1, value2);
  1627. return CDF_STATUS_E_FAILURE;
  1628. }
  1629. #ifdef FEATURE_WLAN_RA_FILTERING
  1630. /**
  1631. * wmi_unified_wow_sta_ra_filter_cmd() - set RA filter pattern in fw
  1632. * @wmi_handle: wmi handle
  1633. * @vdev_id: vdev id
  1634. *
  1635. * Return: CDF status
  1636. */
  1637. CDF_STATUS wmi_unified_wow_sta_ra_filter_cmd(void *wmi_hdl,
  1638. uint8_t vdev_id, uint8_t default_pattern,
  1639. uint16_t rate_limit_interval)
  1640. {
  1641. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1642. if (wmi_handle->ops->send_wow_sta_ra_filter_cmd)
  1643. return wmi_handle->ops->send_wow_sta_ra_filter_cmd(wmi_handle,
  1644. vdev_id, default_pattern, default_pattern);
  1645. return CDF_STATUS_E_FAILURE;
  1646. }
  1647. #endif /* FEATURE_WLAN_RA_FILTERING */
  1648. /**
  1649. * wmi_unified_nat_keepalive_en_cmd() - enable NAT keepalive filter
  1650. * @wmi_handle: wmi handle
  1651. * @vdev_id: vdev id
  1652. *
  1653. * Return: 0 for success or error code
  1654. */
  1655. CDF_STATUS wmi_unified_nat_keepalive_en_cmd(void *wmi_hdl, uint8_t vdev_id)
  1656. {
  1657. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1658. if (wmi_handle->ops->send_nat_keepalive_en_cmd)
  1659. return wmi_handle->ops->send_nat_keepalive_en_cmd(wmi_handle,
  1660. vdev_id);
  1661. return CDF_STATUS_E_FAILURE;
  1662. }
  1663. /**
  1664. * wmi_unified_csa_offload_enable() - send CSA offload enable command
  1665. * @wmi_hdl: wmi handle
  1666. * @vdev_id: vdev id
  1667. *
  1668. * Return: 0 for success or error code
  1669. */
  1670. CDF_STATUS wmi_unified_csa_offload_enable(void *wmi_hdl, uint8_t vdev_id)
  1671. {
  1672. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1673. if (wmi_handle->ops->send_csa_offload_enable_cmd)
  1674. return wmi_handle->ops->send_csa_offload_enable_cmd(wmi_handle,
  1675. vdev_id);
  1676. return CDF_STATUS_E_FAILURE;
  1677. }
  1678. /**
  1679. * wmi_unified_start_oem_data_cmd() - start OEM data request to target
  1680. * @wmi_handle: wmi handle
  1681. * @startOemDataReq: start request params
  1682. *
  1683. * Return: CDF status
  1684. */
  1685. CDF_STATUS wmi_unified_start_oem_data_cmd(void *wmi_hdl,
  1686. uint8_t data_len,
  1687. uint8_t *data)
  1688. {
  1689. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1690. if (wmi_handle->ops->send_start_oem_data_cmd)
  1691. return wmi_handle->ops->send_start_oem_data_cmd(wmi_handle,
  1692. data_len, data);
  1693. return CDF_STATUS_E_FAILURE;
  1694. }
  1695. /**
  1696. * wmi_unified_dfs_phyerr_filter_offload_en_cmd() - enable dfs phyerr filter
  1697. * @wmi_handle: wmi handle
  1698. * @dfs_phyerr_filter_offload: is dfs phyerr filter offload
  1699. *
  1700. * Send WMI_DFS_PHYERR_FILTER_ENA_CMDID or
  1701. * WMI_DFS_PHYERR_FILTER_DIS_CMDID command
  1702. * to firmware based on phyerr filtering
  1703. * offload status.
  1704. *
  1705. * Return: 1 success, 0 failure
  1706. */
  1707. CDF_STATUS
  1708. wmi_unified_dfs_phyerr_filter_offload_en_cmd(void *wmi_hdl,
  1709. bool dfs_phyerr_filter_offload)
  1710. {
  1711. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1712. if (wmi_handle->ops->send_dfs_phyerr_filter_offload_en_cmd)
  1713. return wmi_handle->ops->send_dfs_phyerr_filter_offload_en_cmd(wmi_handle,
  1714. dfs_phyerr_filter_offload);
  1715. return CDF_STATUS_E_FAILURE;
  1716. }
  1717. #if !defined(REMOVE_PKT_LOG)
  1718. /**
  1719. * wmi_unified_pktlog_wmi_send_cmd() - send pktlog enable/disable command to target
  1720. * @wmi_handle: wmi handle
  1721. * @pktlog_event: pktlog event
  1722. * @cmd_id: pktlog cmd id
  1723. *
  1724. * Return: CDF status
  1725. */
  1726. CDF_STATUS wmi_unified_pktlog_wmi_send_cmd(void *wmi_hdl,
  1727. WMI_PKTLOG_EVENT pktlog_event,
  1728. WMI_CMD_ID cmd_id)
  1729. {
  1730. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1731. if (wmi_handle->ops->send_pktlog_wmi_send_cmd)
  1732. return wmi_handle->ops->send_pktlog_wmi_send_cmd(wmi_handle,
  1733. pktlog_event, pktlog_event);
  1734. return CDF_STATUS_E_FAILURE;
  1735. }
  1736. #endif /* REMOVE_PKT_LOG */
  1737. /**
  1738. * wmi_unified_add_wow_wakeup_event_cmd() - Configures wow wakeup events.
  1739. * @wmi_handle: wmi handle
  1740. * @vdev_id: vdev id
  1741. * @bitmap: Event bitmap
  1742. * @enable: enable/disable
  1743. *
  1744. * Return: CDF status
  1745. */
  1746. CDF_STATUS wmi_unified_add_wow_wakeup_event_cmd(void *wmi_hdl,
  1747. uint32_t vdev_id,
  1748. uint32_t bitmap,
  1749. bool enable)
  1750. {
  1751. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1752. if (wmi_handle->ops->send_add_wow_wakeup_event_cmd)
  1753. return wmi_handle->ops->send_add_wow_wakeup_event_cmd(wmi_handle,
  1754. vdev_id, vdev_id, vdev_id);
  1755. return CDF_STATUS_E_FAILURE;
  1756. }
  1757. /**
  1758. * wmi_unified_wow_patterns_to_fw_cmd() - Sends WOW patterns to FW.
  1759. * @wmi_handle: wmi handle
  1760. * @vdev_id: vdev id
  1761. * @ptrn_id: pattern id
  1762. * @ptrn: pattern
  1763. * @ptrn_len: pattern length
  1764. * @ptrn_offset: pattern offset
  1765. * @mask: mask
  1766. * @mask_len: mask length
  1767. * @user: true for user configured pattern and false for default pattern
  1768. * @default_patterns: default patterns
  1769. *
  1770. * Return: CDF status
  1771. */
  1772. CDF_STATUS wmi_unified_wow_patterns_to_fw_cmd(void *wmi_hdl,
  1773. uint8_t vdev_id, uint8_t ptrn_id,
  1774. const uint8_t *ptrn, uint8_t ptrn_len,
  1775. uint8_t ptrn_offset, const uint8_t *mask,
  1776. uint8_t mask_len, bool user,
  1777. uint8_t default_patterns)
  1778. {
  1779. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1780. if (wmi_handle->ops->send_wow_patterns_to_fw_cmd)
  1781. return wmi_handle->ops->send_wow_patterns_to_fw_cmd(wmi_handle,
  1782. vdev_id, ptrn_id, ptrn,
  1783. ptrn_len, ptrn_offset, mask,
  1784. mask_len, user, default_patterns);
  1785. return CDF_STATUS_E_FAILURE;
  1786. }
  1787. /**
  1788. * wmi_unified_wow_delete_pattern_cmd() - delete wow pattern in target
  1789. * @wmi_handle: wmi handle
  1790. * @ptrn_id: pattern id
  1791. * @vdev_id: vdev id
  1792. *
  1793. * Return: CDF status
  1794. */
  1795. CDF_STATUS wmi_unified_wow_delete_pattern_cmd(void *wmi_hdl, uint8_t ptrn_id,
  1796. uint8_t vdev_id)
  1797. {
  1798. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1799. if (wmi_handle->ops->send_wow_delete_pattern_cmd)
  1800. return wmi_handle->ops->send_wow_delete_pattern_cmd(wmi_handle,
  1801. ptrn_id, vdev_id);
  1802. return CDF_STATUS_E_FAILURE;
  1803. }
  1804. /**
  1805. * wmi_unified_host_wakeup_ind_to_fw_cmd() - send wakeup ind to fw
  1806. * @wmi_handle: wmi handle
  1807. *
  1808. * Sends host wakeup indication to FW. On receiving this indication,
  1809. * FW will come out of WOW.
  1810. *
  1811. * Return: CDF status
  1812. */
  1813. CDF_STATUS wmi_unified_host_wakeup_ind_to_fw_cmd(void *wmi_hdl)
  1814. {
  1815. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1816. if (wmi_handle->ops->send_host_wakeup_ind_to_fw_cmd)
  1817. return wmi_handle->ops->send_host_wakeup_ind_to_fw_cmd(wmi_handle);
  1818. return CDF_STATUS_E_FAILURE;
  1819. }
  1820. /**
  1821. * wmi_unified_del_ts_cmd() - send DELTS request to fw
  1822. * @wmi_handle: wmi handle
  1823. * @msg: delts params
  1824. *
  1825. * Return: CDF status
  1826. */
  1827. CDF_STATUS wmi_unified_del_ts_cmd(void *wmi_hdl, uint8_t vdev_id,
  1828. uint8_t ac)
  1829. {
  1830. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1831. if (wmi_handle->ops->send_del_ts_cmd)
  1832. return wmi_handle->ops->send_del_ts_cmd(wmi_handle,
  1833. vdev_id, ac);
  1834. return CDF_STATUS_E_FAILURE;
  1835. }
  1836. /**
  1837. * wmi_unified_aggr_qos_cmd() - send aggr qos request to fw
  1838. * @wmi_handle: handle to wmi
  1839. * @aggr_qos_rsp_msg - combined struct for all ADD_TS requests.
  1840. *
  1841. * A function to handle WMA_AGGR_QOS_REQ. This will send out
  1842. * ADD_TS requestes to firmware in loop for all the ACs with
  1843. * active flow.
  1844. *
  1845. * Return: CDF status
  1846. */
  1847. CDF_STATUS wmi_unified_aggr_qos_cmd(void *wmi_hdl,
  1848. struct aggr_add_ts_param *aggr_qos_rsp_msg)
  1849. {
  1850. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1851. if (wmi_handle->ops->send_aggr_qos_cmd)
  1852. return wmi_handle->ops->send_aggr_qos_cmd(wmi_handle,
  1853. aggr_qos_rsp_msg);
  1854. return CDF_STATUS_E_FAILURE;
  1855. }
  1856. /**
  1857. * wmi_unified_add_ts_cmd() - send ADDTS request to fw
  1858. * @wmi_handle: wmi handle
  1859. * @msg: ADDTS params
  1860. *
  1861. * Return: CDF status
  1862. */
  1863. CDF_STATUS wmi_unified_add_ts_cmd(void *wmi_hdl,
  1864. struct add_ts_param *msg)
  1865. {
  1866. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1867. if (wmi_handle->ops->send_add_ts_cmd)
  1868. return wmi_handle->ops->send_add_ts_cmd(wmi_handle,
  1869. msg);
  1870. return CDF_STATUS_E_FAILURE;
  1871. }
  1872. /**
  1873. * wmi_unified_enable_disable_packet_filter_cmd() - enable/disable packet filter in target
  1874. * @wmi_handle: wmi handle
  1875. * @vdev_id: vdev id
  1876. * @enable: Flag to enable/disable packet filter
  1877. *
  1878. * Return: 0 for success or error code
  1879. */
  1880. CDF_STATUS wmi_unified_enable_disable_packet_filter_cmd(void *wmi_hdl,
  1881. uint8_t vdev_id, bool enable)
  1882. {
  1883. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1884. if (wmi_handle->ops->send_enable_disable_packet_filter_cmd)
  1885. return wmi_handle->ops->send_enable_disable_packet_filter_cmd(wmi_handle,
  1886. vdev_id, vdev_id);
  1887. return CDF_STATUS_E_FAILURE;
  1888. }
  1889. /**
  1890. * wmi_unified_config_packet_filter_cmd() - configure packet filter in target
  1891. * @wmi_handle: wmi handle
  1892. * @vdev_id: vdev id
  1893. * @rcv_filter_param: Packet filter parameters
  1894. * @filter_id: Filter id
  1895. * @enable: Flag to add/delete packet filter configuration
  1896. *
  1897. * Return: 0 for success or error code
  1898. */
  1899. CDF_STATUS wmi_unified_config_packet_filter_cmd(void *wmi_hdl,
  1900. uint8_t vdev_id, struct rcv_pkt_filter_config *rcv_filter_param,
  1901. uint8_t filter_id, bool enable)
  1902. {
  1903. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1904. if (wmi_handle->ops->send_config_packet_filter_cmd)
  1905. return wmi_handle->ops->send_config_packet_filter_cmd(wmi_handle,
  1906. vdev_id, rcv_filter_param,
  1907. filter_id, enable);
  1908. return CDF_STATUS_E_FAILURE;
  1909. }
  1910. /**
  1911. * wmi_unified_add_clear_mcbc_filter_cmd() - set mcast filter command to fw
  1912. * @wmi_handle: wmi handle
  1913. * @vdev_id: vdev id
  1914. * @multicastAddr: mcast address
  1915. * @clearList: clear list flag
  1916. *
  1917. * Return: 0 for success or error code
  1918. */
  1919. CDF_STATUS wmi_unified_add_clear_mcbc_filter_cmd(void *wmi_hdl,
  1920. uint8_t vdev_id,
  1921. struct cdf_mac_addr multicast_addr,
  1922. bool clearList)
  1923. {
  1924. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1925. if (wmi_handle->ops->send_add_clear_mcbc_filter_cmd)
  1926. return wmi_handle->ops->send_add_clear_mcbc_filter_cmd(wmi_handle,
  1927. vdev_id, multicast_addr, clearList);
  1928. return CDF_STATUS_E_FAILURE;
  1929. }
  1930. /**
  1931. * wmi_unified_send_gtk_offload_cmd() - send GTK offload command to fw
  1932. * @wmi_handle: wmi handle
  1933. * @vdev_id: vdev id
  1934. * @params: GTK offload parameters
  1935. *
  1936. * Return: CDF status
  1937. */
  1938. CDF_STATUS wmi_unified_send_gtk_offload_cmd(void *wmi_hdl, uint8_t vdev_id,
  1939. struct gtk_offload_params *params,
  1940. bool enable_offload,
  1941. uint32_t gtk_offload_opcode)
  1942. {
  1943. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1944. if (wmi_handle->ops->send_gtk_offload_cmd)
  1945. return wmi_handle->ops->send_gtk_offload_cmd(wmi_handle,
  1946. vdev_id, params,
  1947. enable_offload, gtk_offload_opcode);
  1948. return CDF_STATUS_E_FAILURE;
  1949. }
  1950. /**
  1951. * wmi_unified_process_gtk_offload_getinfo_cmd() - send GTK offload cmd to fw
  1952. * @wmi_handle: wmi handle
  1953. * @params: GTK offload params
  1954. *
  1955. * Return: CDF status
  1956. */
  1957. CDF_STATUS wmi_unified_process_gtk_offload_getinfo_cmd(void *wmi_hdl,
  1958. uint8_t vdev_id,
  1959. uint64_t offload_req_opcode)
  1960. {
  1961. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1962. if (wmi_handle->ops->send_process_gtk_offload_getinfo_cmd)
  1963. return wmi_handle->ops->send_process_gtk_offload_getinfo_cmd(wmi_handle,
  1964. vdev_id,
  1965. offload_req_opcode);
  1966. return CDF_STATUS_E_FAILURE;
  1967. }
  1968. /**
  1969. * wmi_unified_process_add_periodic_tx_ptrn_cmd - add periodic tx ptrn
  1970. * @wmi_handle: wmi handle
  1971. * @pAddPeriodicTxPtrnParams: tx ptrn params
  1972. *
  1973. * Retrun: CDF status
  1974. */
  1975. CDF_STATUS wmi_unified_process_add_periodic_tx_ptrn_cmd(void *wmi_hdl,
  1976. struct periodic_tx_pattern *
  1977. pAddPeriodicTxPtrnParams,
  1978. uint8_t vdev_id)
  1979. {
  1980. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1981. if (wmi_handle->ops->send_process_add_periodic_tx_ptrn_cmd)
  1982. return wmi_handle->ops->send_process_add_periodic_tx_ptrn_cmd(wmi_handle,
  1983. pAddPeriodicTxPtrnParams,
  1984. vdev_id);
  1985. return CDF_STATUS_E_FAILURE;
  1986. }
  1987. /**
  1988. * wmi_unified_process_del_periodic_tx_ptrn_cmd - del periodic tx ptrn
  1989. * @wmi_handle: wmi handle
  1990. * @vdev_id: vdev id
  1991. * @pattern_id: pattern id
  1992. *
  1993. * Retrun: CDF status
  1994. */
  1995. CDF_STATUS wmi_unified_process_del_periodic_tx_ptrn_cmd(void *wmi_hdl,
  1996. uint8_t vdev_id,
  1997. uint8_t pattern_id)
  1998. {
  1999. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2000. if (wmi_handle->ops->send_process_del_periodic_tx_ptrn_cmd)
  2001. return wmi_handle->ops->send_process_del_periodic_tx_ptrn_cmd(wmi_handle,
  2002. vdev_id,
  2003. pattern_id);
  2004. return CDF_STATUS_E_FAILURE;
  2005. }
  2006. /**
  2007. * wmi_unified_stats_ext_req_cmd() - request ext stats from fw
  2008. * @wmi_handle: wmi handle
  2009. * @preq: stats ext params
  2010. *
  2011. * Return: CDF status
  2012. */
  2013. CDF_STATUS wmi_unified_stats_ext_req_cmd(void *wmi_hdl,
  2014. struct stats_ext_params *preq)
  2015. {
  2016. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2017. if (wmi_handle->ops->send_stats_ext_req_cmd)
  2018. return wmi_handle->ops->send_stats_ext_req_cmd(wmi_handle,
  2019. preq);
  2020. return CDF_STATUS_E_FAILURE;
  2021. }
  2022. /**
  2023. * wmi_unified_enable_ext_wow_cmd() - enable ext wow in fw
  2024. * @wmi_handle: wmi handle
  2025. * @params: ext wow params
  2026. *
  2027. * Return:0 for success or error code
  2028. */
  2029. CDF_STATUS wmi_unified_enable_ext_wow_cmd(void *wmi_hdl,
  2030. struct ext_wow_params *params)
  2031. {
  2032. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2033. if (wmi_handle->ops->send_enable_ext_wow_cmd)
  2034. return wmi_handle->ops->send_enable_ext_wow_cmd(wmi_handle,
  2035. params);
  2036. return CDF_STATUS_E_FAILURE;
  2037. }
  2038. /**
  2039. * wmi_unified_set_app_type2_params_in_fw_cmd() - set app type2 params in fw
  2040. * @wmi_handle: wmi handle
  2041. * @appType2Params: app type2 params
  2042. *
  2043. * Return: CDF status
  2044. */
  2045. CDF_STATUS wmi_unified_set_app_type2_params_in_fw_cmd(void *wmi_hdl,
  2046. struct app_type2_params *appType2Params)
  2047. {
  2048. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2049. if (wmi_handle->ops->send_set_app_type2_params_in_fw_cmd)
  2050. return wmi_handle->ops->send_set_app_type2_params_in_fw_cmd(wmi_handle,
  2051. appType2Params);
  2052. return CDF_STATUS_E_FAILURE;
  2053. }
  2054. /**
  2055. * wmi_unified_set_auto_shutdown_timer_cmd() - sets auto shutdown timer in firmware
  2056. * @wmi_handle: wmi handle
  2057. * @timer_val: auto shutdown timer value
  2058. *
  2059. * Return: CDF status
  2060. */
  2061. CDF_STATUS wmi_unified_set_auto_shutdown_timer_cmd(void *wmi_hdl,
  2062. uint32_t timer_val)
  2063. {
  2064. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2065. if (wmi_handle->ops->send_set_auto_shutdown_timer_cmd)
  2066. return wmi_handle->ops->send_set_auto_shutdown_timer_cmd(wmi_handle,
  2067. timer_val);
  2068. return CDF_STATUS_E_FAILURE;
  2069. }
  2070. /**
  2071. * wmi_unified_nan_req_cmd() - to send nan request to target
  2072. * @wmi_handle: wmi handle
  2073. * @nan_req: request data which will be non-null
  2074. *
  2075. * Return: CDF status
  2076. */
  2077. CDF_STATUS wmi_unified_nan_req_cmd(void *wmi_hdl,
  2078. struct nan_req_params *nan_req)
  2079. {
  2080. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2081. if (wmi_handle->ops->send_nan_req_cmd)
  2082. return wmi_handle->ops->send_nan_req_cmd(wmi_handle,
  2083. nan_req);
  2084. return CDF_STATUS_E_FAILURE;
  2085. }
  2086. /**
  2087. * wmi_unified_process_dhcpserver_offload_cmd() - enable DHCP server offload
  2088. * @wmi_handle: wmi handle
  2089. * @pDhcpSrvOffloadInfo: DHCP server offload info
  2090. *
  2091. * Return: 0 for success or error code
  2092. */
  2093. CDF_STATUS wmi_unified_process_dhcpserver_offload_cmd(void *wmi_hdl,
  2094. struct dhcp_offload_info_params *pDhcpSrvOffloadInfo)
  2095. {
  2096. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2097. if (wmi_handle->ops->send_process_dhcpserver_offload_cmd)
  2098. return wmi_handle->ops->send_process_dhcpserver_offload_cmd(wmi_handle,
  2099. pDhcpSrvOffloadInfo);
  2100. return CDF_STATUS_E_FAILURE;
  2101. }
  2102. /**
  2103. * wmi_unified_process_ch_avoid_update_cmd() - handles channel avoid update request
  2104. * @wmi_handle: wmi handle
  2105. * @ch_avoid_update_req: channel avoid update params
  2106. *
  2107. * Return: CDF status
  2108. */
  2109. CDF_STATUS wmi_unified_process_ch_avoid_update_cmd(void *wmi_hdl)
  2110. {
  2111. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2112. if (wmi_handle->ops->send_process_ch_avoid_update_cmd)
  2113. return wmi_handle->ops->send_process_ch_avoid_update_cmd(wmi_handle);
  2114. return CDF_STATUS_E_FAILURE;
  2115. }
  2116. /**
  2117. * wmi_unified_send_regdomain_info_to_fw_cmd() - send regdomain info to fw
  2118. * @wmi_handle: wmi handle
  2119. * @reg_dmn: reg domain
  2120. * @regdmn2G: 2G reg domain
  2121. * @regdmn5G: 5G reg domain
  2122. * @ctl2G: 2G test limit
  2123. * @ctl5G: 5G test limit
  2124. *
  2125. * Return: none
  2126. */
  2127. CDF_STATUS wmi_unified_send_regdomain_info_to_fw_cmd(void *wmi_hdl,
  2128. uint32_t reg_dmn, uint16_t regdmn2G,
  2129. uint16_t regdmn5G, int8_t ctl2G,
  2130. int8_t ctl5G)
  2131. {
  2132. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2133. if (wmi_handle->ops->send_regdomain_info_to_fw_cmd)
  2134. return wmi_handle->ops->send_regdomain_info_to_fw_cmd(wmi_handle,
  2135. reg_dmn, regdmn2G,
  2136. regdmn5G, ctl2G,
  2137. ctl5G);
  2138. return CDF_STATUS_E_FAILURE;
  2139. }
  2140. /**
  2141. * wmi_unified_set_tdls_offchan_mode_cmd() - set tdls off channel mode
  2142. * @wmi_handle: wmi handle
  2143. * @chan_switch_params: Pointer to tdls channel switch parameter structure
  2144. *
  2145. * This function sets tdls off channel mode
  2146. *
  2147. * Return: 0 on success; Negative errno otherwise
  2148. */
  2149. CDF_STATUS wmi_unified_set_tdls_offchan_mode_cmd(void *wmi_hdl,
  2150. struct tdls_channel_switch_params *chan_switch_params)
  2151. {
  2152. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2153. if (wmi_handle->ops->send_set_tdls_offchan_mode_cmd)
  2154. return wmi_handle->ops->send_set_tdls_offchan_mode_cmd(wmi_handle,
  2155. chan_switch_params);
  2156. return CDF_STATUS_E_FAILURE;
  2157. }
  2158. /**
  2159. * wmi_unified_update_fw_tdls_state_cmd() - send enable/disable tdls for a vdev
  2160. * @wmi_handle: wmi handle
  2161. * @pwmaTdlsparams: TDLS params
  2162. *
  2163. * Return: 0 for sucess or error code
  2164. */
  2165. CDF_STATUS wmi_unified_update_fw_tdls_state_cmd(void *wmi_hdl,
  2166. void *tdls_param, uint8_t tdls_state)
  2167. {
  2168. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2169. if (wmi_handle->ops->send_update_fw_tdls_state_cmd)
  2170. return wmi_handle->ops->send_update_fw_tdls_state_cmd(wmi_handle,
  2171. tdls_param, tdls_state);
  2172. return CDF_STATUS_E_FAILURE;
  2173. }
  2174. /**
  2175. * wmi_unified_update_tdls_peer_state_cmd() - update TDLS peer state
  2176. * @wmi_handle: wmi handle
  2177. * @peerStateParams: TDLS peer state params
  2178. *
  2179. * Return: 0 for success or error code
  2180. */
  2181. CDF_STATUS wmi_unified_update_tdls_peer_state_cmd(void *wmi_hdl,
  2182. struct tdls_peer_state_params *peerStateParams,
  2183. uint32_t *ch_mhz)
  2184. {
  2185. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2186. if (wmi_handle->ops->send_update_tdls_peer_state_cmd)
  2187. return wmi_handle->ops->send_update_tdls_peer_state_cmd(wmi_handle,
  2188. peerStateParams, ch_mhz);
  2189. return CDF_STATUS_E_FAILURE;
  2190. }
  2191. /**
  2192. * wmi_unified_process_fw_mem_dump_cmd() - Function to request fw memory dump from
  2193. * firmware
  2194. * @wmi_handle: Pointer to wmi handle
  2195. * @mem_dump_req: Pointer for mem_dump_req
  2196. *
  2197. * This function sends memory dump request to firmware
  2198. *
  2199. * Return: CDF_STATUS_SUCCESS for success otherwise failure
  2200. *
  2201. */
  2202. CDF_STATUS wmi_unified_process_fw_mem_dump_cmd(void *wmi_hdl,
  2203. struct fw_dump_req_param *mem_dump_req)
  2204. {
  2205. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2206. if (wmi_handle->ops->send_process_fw_mem_dump_cmd)
  2207. return wmi_handle->ops->send_process_fw_mem_dump_cmd(wmi_handle,
  2208. mem_dump_req);
  2209. return CDF_STATUS_E_FAILURE;
  2210. }
  2211. /**
  2212. * wmi_unified_process_set_ie_info_cmd() - Function to send IE info to firmware
  2213. * @wmi_handle: Pointer to WMi handle
  2214. * @ie_data: Pointer for ie data
  2215. *
  2216. * This function sends IE information to firmware
  2217. *
  2218. * Return: CDF_STATUS_SUCCESS for success otherwise failure
  2219. *
  2220. */
  2221. CDF_STATUS wmi_unified_process_set_ie_info_cmd(void *wmi_hdl,
  2222. struct vdev_ie_info_param *ie_info)
  2223. {
  2224. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2225. if (wmi_handle->ops->send_process_set_ie_info_cmd)
  2226. return wmi_handle->ops->send_process_set_ie_info_cmd(wmi_handle,
  2227. ie_info);
  2228. return CDF_STATUS_E_FAILURE;
  2229. }
  2230. /**
  2231. * wmi_unified_send_init_cmd() - wmi init command
  2232. * @wmi_handle: pointer to wmi handle
  2233. * @res_cfg: resource config
  2234. * @num_mem_chunks: no of mem chunck
  2235. * @mem_chunk: pointer to mem chunck structure
  2236. *
  2237. * This function sends IE information to firmware
  2238. *
  2239. * Return: CDF_STATUS_SUCCESS for success otherwise failure
  2240. *
  2241. */
  2242. CDF_STATUS wmi_unified_send_init_cmd(void *wmi_hdl,
  2243. wmi_resource_config *res_cfg,
  2244. uint8_t num_mem_chunks, struct wmi_host_mem_chunk *mem_chunk,
  2245. bool action)
  2246. {
  2247. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2248. if (wmi_handle->ops->send_init_cmd)
  2249. return wmi_handle->ops->send_init_cmd(wmi_handle,
  2250. res_cfg, num_mem_chunks, mem_chunk, action);
  2251. return CDF_STATUS_E_FAILURE;
  2252. }
  2253. /**
  2254. * wmi_unified_send_saved_init_cmd() - wmi init command
  2255. * @wmi_handle: pointer to wmi handle
  2256. *
  2257. * This function sends IE information to firmware
  2258. *
  2259. * Return: CDF_STATUS_SUCCESS for success otherwise failure
  2260. *
  2261. */
  2262. CDF_STATUS wmi_unified_send_saved_init_cmd(void *wmi_hdl)
  2263. {
  2264. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2265. if (wmi_handle->ops->send_saved_init_cmd)
  2266. return wmi_handle->ops->send_saved_init_cmd(wmi_handle);
  2267. return CDF_STATUS_E_FAILURE;
  2268. }
  2269. /**
  2270. * wmi_unified_save_fw_version_cmd() - save fw version
  2271. * @wmi_handle: pointer to wmi handle
  2272. * @res_cfg: resource config
  2273. * @num_mem_chunks: no of mem chunck
  2274. * @mem_chunk: pointer to mem chunck structure
  2275. *
  2276. * This function sends IE information to firmware
  2277. *
  2278. * Return: CDF_STATUS_SUCCESS for success otherwise failure
  2279. *
  2280. */
  2281. CDF_STATUS wmi_unified_save_fw_version_cmd(void *wmi_hdl,
  2282. void *evt_buf)
  2283. {
  2284. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2285. if (wmi_handle->ops->save_fw_version_cmd)
  2286. return wmi_handle->ops->save_fw_version_cmd(wmi_handle,
  2287. evt_buf);
  2288. return CDF_STATUS_E_FAILURE;
  2289. }