wmi_unified_api.c 87 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241
  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. QDF_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 QDF_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. QDF_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 QDF_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. QDF_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 QDF_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. QDF_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 QDF_STATUS_E_FAILURE;
  99. }
  100. /**
  101. * wmi_unified_vdev_start_send() - send vdev start command to fw
  102. * @wmi: wmi handle
  103. * @vdev_id: vdev id
  104. *
  105. * Return: 0 for success or error code
  106. */
  107. QDF_STATUS wmi_unified_vdev_start_send(void *wmi_hdl,
  108. struct vdev_start_params *req)
  109. {
  110. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  111. if (wmi_handle->ops->send_vdev_start_cmd)
  112. return wmi_handle->ops->send_vdev_start_cmd(wmi_handle, req);
  113. return QDF_STATUS_E_FAILURE;
  114. }
  115. /**
  116. * wmi_unified_hidden_ssid_vdev_restart_send() - restart vdev to set hidden ssid
  117. * @wmi: wmi handle
  118. * @restart_params: vdev restart params
  119. *
  120. * Return: 0 for success or error code
  121. */
  122. QDF_STATUS wmi_unified_hidden_ssid_vdev_restart_send(void *wmi_hdl,
  123. struct hidden_ssid_vdev_restart_params *restart_params)
  124. {
  125. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  126. if (wmi_handle->ops->send_hidden_ssid_vdev_restart_cmd)
  127. return wmi_handle->ops->send_hidden_ssid_vdev_restart_cmd(
  128. wmi_handle, restart_params);
  129. return QDF_STATUS_E_FAILURE;
  130. }
  131. /**
  132. * wmi_unified_peer_flush_tids_send() - flush peer tids packets in fw
  133. * @wmi: wmi handle
  134. * @peer_addr: peer mac address
  135. * @param: pointer to hold peer flush tid parameter
  136. *
  137. * Return: 0 for sucess or error code
  138. */
  139. QDF_STATUS wmi_unified_peer_flush_tids_send(void *wmi_hdl,
  140. uint8_t peer_addr[IEEE80211_ADDR_LEN],
  141. struct peer_flush_params *param)
  142. {
  143. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  144. if (wmi_handle->ops->send_peer_flush_tids_cmd)
  145. return wmi_handle->ops->send_peer_flush_tids_cmd(wmi_handle,
  146. peer_addr, param);
  147. return QDF_STATUS_E_FAILURE;
  148. }
  149. /**
  150. * wmi_unified_peer_delete_send() - send PEER delete command to fw
  151. * @wmi: wmi handle
  152. * @peer_addr: peer mac addr
  153. * @vdev_id: vdev id
  154. *
  155. * Return: 0 for success or error code
  156. */
  157. QDF_STATUS wmi_unified_peer_delete_send(void *wmi_hdl,
  158. uint8_t
  159. peer_addr[IEEE80211_ADDR_LEN],
  160. uint8_t vdev_id)
  161. {
  162. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  163. if (wmi_handle->ops->send_peer_delete_cmd)
  164. return wmi_handle->ops->send_peer_delete_cmd(wmi_handle,
  165. peer_addr, vdev_id);
  166. return QDF_STATUS_E_FAILURE;
  167. }
  168. /**
  169. * wmi_set_peer_param() - set peer parameter in fw
  170. * @wmi_ctx: wmi handle
  171. * @peer_addr: peer mac address
  172. * @param : pointer to hold peer set parameter
  173. *
  174. * Return: 0 for success or error code
  175. */
  176. QDF_STATUS wmi_set_peer_param_send(void *wmi_hdl,
  177. uint8_t peer_addr[IEEE80211_ADDR_LEN],
  178. struct peer_set_params *param)
  179. {
  180. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  181. if (wmi_handle->ops->send_peer_param_cmd)
  182. return wmi_handle->ops->send_peer_param_cmd(wmi_handle,
  183. peer_addr, param);
  184. return QDF_STATUS_E_FAILURE;
  185. }
  186. /**
  187. * wmi_unified_vdev_up_send() - send vdev up command in fw
  188. * @wmi: wmi handle
  189. * @bssid: bssid
  190. * @vdev_up_params: pointer to hold vdev up parameter
  191. *
  192. * Return: 0 for success or error code
  193. */
  194. QDF_STATUS wmi_unified_vdev_up_send(void *wmi_hdl,
  195. uint8_t bssid[IEEE80211_ADDR_LEN],
  196. struct vdev_up_params *params)
  197. {
  198. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  199. if (wmi_handle->ops->send_vdev_up_cmd)
  200. return wmi_handle->ops->send_vdev_up_cmd(wmi_handle, bssid,
  201. params);
  202. return QDF_STATUS_E_FAILURE;
  203. }
  204. /**
  205. * wmi_unified_peer_create_send() - send peer create command to fw
  206. * @wmi: wmi handle
  207. * @peer_addr: peer mac address
  208. * @peer_type: peer type
  209. * @vdev_id: vdev id
  210. *
  211. * Return: 0 for success or error code
  212. */
  213. QDF_STATUS wmi_unified_peer_create_send(void *wmi_hdl,
  214. struct peer_create_params *param)
  215. {
  216. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  217. if (wmi_handle->ops->send_peer_create_cmd)
  218. return wmi_handle->ops->send_peer_create_cmd(wmi_handle, param);
  219. return QDF_STATUS_E_FAILURE;
  220. }
  221. #ifdef FEATURE_GREEN_AP
  222. /**
  223. * wmi_unified_green_ap_ps_send() - enable green ap powersave command
  224. * @wmi_handle: wmi handle
  225. * @value: value
  226. * @mac_id: mac id to have radio context
  227. *
  228. * Return: 0 for success or error code
  229. */
  230. QDF_STATUS wmi_unified_green_ap_ps_send(void *wmi_hdl,
  231. uint32_t value, uint8_t mac_id)
  232. {
  233. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  234. if (wmi_handle->ops->send_green_ap_ps_cmd)
  235. return wmi_handle->ops->send_green_ap_ps_cmd(wmi_handle, value,
  236. mac_id);
  237. return QDF_STATUS_E_FAILURE;
  238. }
  239. #else
  240. QDF_STATUS wmi_unified_green_ap_ps_send(void *wmi_hdl,
  241. uint32_t value, uint8_t mac_id)
  242. {
  243. return 0;
  244. }
  245. #endif /* FEATURE_GREEN_AP */
  246. /**
  247. * wmi_unified_pdev_utf_cmd() - send utf command to fw
  248. * @wmi_handle: wmi handle
  249. * @param: pointer to pdev_utf_params
  250. * @mac_id: mac id to have radio context
  251. *
  252. * Return: 0 for success or error code
  253. */
  254. QDF_STATUS
  255. wmi_unified_pdev_utf_cmd_send(void *wmi_hdl,
  256. struct pdev_utf_params *param,
  257. uint8_t mac_id)
  258. {
  259. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  260. if (wmi_handle->ops->send_pdev_utf_cmd)
  261. return wmi_handle->ops->send_pdev_utf_cmd(wmi_handle, param,
  262. mac_id);
  263. return QDF_STATUS_E_FAILURE;
  264. }
  265. /**
  266. * wmi_unified_pdev_set_param() - set pdev parameters
  267. * @wmi_handle: wmi handle
  268. * @param: pointer to pdev parameter
  269. * @mac_id: radio context
  270. *
  271. * Return: 0 on success, errno on failure
  272. */
  273. QDF_STATUS
  274. wmi_unified_pdev_param_send(void *wmi_hdl,
  275. struct pdev_params *param,
  276. uint8_t mac_id)
  277. {
  278. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  279. if (wmi_handle->ops->send_pdev_param_cmd)
  280. return wmi_handle->ops->send_pdev_param_cmd(wmi_handle, param,
  281. mac_id);
  282. return QDF_STATUS_E_FAILURE;
  283. }
  284. /**
  285. * wmi_unified_suspend_send() - WMI suspend function
  286. * @param wmi_handle : handle to WMI.
  287. * @param param : pointer to hold suspend parameter
  288. * @mac_id: radio context
  289. *
  290. * Return: 0 on success and -ve on failure.
  291. */
  292. QDF_STATUS wmi_unified_suspend_send(void *wmi_hdl,
  293. struct suspend_params *param,
  294. uint8_t mac_id)
  295. {
  296. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  297. if (wmi_handle->ops->send_suspend_cmd)
  298. return wmi_handle->ops->send_suspend_cmd(wmi_handle, param,
  299. mac_id);
  300. return QDF_STATUS_E_FAILURE;
  301. }
  302. /**
  303. * wmi_unified_resume_send - WMI resume function
  304. * @param wmi_handle : handle to WMI.
  305. * @mac_id: radio context
  306. *
  307. * Return: 0 on success and -ve on failure.
  308. */
  309. QDF_STATUS wmi_unified_resume_send(void *wmi_hdl,
  310. uint8_t mac_id)
  311. {
  312. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  313. if (wmi_handle->ops->send_resume_cmd)
  314. return wmi_handle->ops->send_resume_cmd(wmi_handle,
  315. mac_id);
  316. return QDF_STATUS_E_FAILURE;
  317. }
  318. /**
  319. * wmi_unified_wow_enable_send() - WMI wow enable function
  320. * @param wmi_handle : handle to WMI.
  321. * @param param : pointer to hold wow enable parameter
  322. * @mac_id: radio context
  323. *
  324. * Return: 0 on success and -ve on failure.
  325. */
  326. QDF_STATUS wmi_unified_wow_enable_send(void *wmi_hdl,
  327. struct wow_cmd_params *param,
  328. uint8_t mac_id)
  329. {
  330. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  331. if (wmi_handle->ops->send_wow_enable_cmd)
  332. return wmi_handle->ops->send_wow_enable_cmd(wmi_handle, param,
  333. mac_id);
  334. return QDF_STATUS_E_FAILURE;
  335. }
  336. /**
  337. * wmi_unified_ap_ps_cmd_send() - set ap powersave parameters
  338. * @wma_ctx: wma context
  339. * @peer_addr: peer mac address
  340. * @param: pointer to ap_ps parameter structure
  341. *
  342. * Return: 0 for success or error code
  343. */
  344. QDF_STATUS wmi_unified_ap_ps_cmd_send(void *wmi_hdl,
  345. uint8_t *peer_addr,
  346. struct ap_ps_params *param)
  347. {
  348. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  349. if (wmi_handle->ops->send_set_ap_ps_param_cmd)
  350. return wmi_handle->ops->send_set_ap_ps_param_cmd(wmi_handle,
  351. peer_addr,
  352. param);
  353. return QDF_STATUS_E_FAILURE;
  354. }
  355. /**
  356. * wmi_unified_sta_ps_cmd_send() - set sta powersave parameters
  357. * @wma_ctx: wma context
  358. * @peer_addr: peer mac address
  359. * @param: pointer to sta_ps parameter structure
  360. *
  361. * Return: 0 for success or error code
  362. */
  363. QDF_STATUS wmi_unified_sta_ps_cmd_send(void *wmi_hdl,
  364. struct sta_ps_params *param)
  365. {
  366. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  367. if (wmi_handle->ops->send_set_sta_ps_param_cmd)
  368. return wmi_handle->ops->send_set_sta_ps_param_cmd(wmi_handle,
  369. param);
  370. return QDF_STATUS_E_FAILURE;
  371. }
  372. /**
  373. * wmi_crash_inject() - inject fw crash
  374. * @wma_handle: wma handle
  375. * @param: ponirt to crash inject paramter structure
  376. *
  377. * Return: 0 for success or return error
  378. */
  379. QDF_STATUS wmi_crash_inject(void *wmi_hdl,
  380. struct crash_inject *param)
  381. {
  382. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  383. if (wmi_handle->ops->send_crash_inject_cmd)
  384. return wmi_handle->ops->send_crash_inject_cmd(wmi_handle,
  385. param);
  386. return QDF_STATUS_E_FAILURE;
  387. }
  388. /**
  389. * wmi_unified_dbglog_cmd_send() - set debug log level
  390. * @param wmi_handle : handle to WMI.
  391. * @param param : pointer to hold dbglog level parameter
  392. *
  393. * Return: 0 on success and -ve on failure.
  394. */
  395. QDF_STATUS
  396. wmi_unified_dbglog_cmd_send(void *wmi_hdl,
  397. struct dbglog_params *dbglog_param)
  398. {
  399. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  400. if (wmi_handle->ops->send_dbglog_cmd)
  401. return wmi_handle->ops->send_dbglog_cmd(wmi_handle,
  402. dbglog_param);
  403. return QDF_STATUS_E_FAILURE;
  404. }
  405. /**
  406. * wmi_unified_vdev_set_param_send() - WMI vdev set parameter function
  407. * @param wmi_handle : handle to WMI.
  408. * @param macaddr : MAC address
  409. * @param param : pointer to hold vdev set parameter
  410. *
  411. * Return: 0 on success and -ve on failure.
  412. */
  413. QDF_STATUS wmi_unified_vdev_set_param_send(void *wmi_hdl,
  414. struct vdev_set_params *param)
  415. {
  416. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  417. if (wmi_handle->ops->send_vdev_set_param_cmd)
  418. return wmi_handle->ops->send_vdev_set_param_cmd(wmi_handle,
  419. param);
  420. return QDF_STATUS_E_FAILURE;
  421. }
  422. /**
  423. * wmi_unified_stats_request_send() - WMI request stats function
  424. * @param wmi_handle : handle to WMI.
  425. * @param macaddr : MAC address
  426. * @param param : pointer to hold stats request parameter
  427. *
  428. * Return: 0 on success and -ve on failure.
  429. */
  430. QDF_STATUS wmi_unified_stats_request_send(void *wmi_hdl,
  431. uint8_t macaddr[IEEE80211_ADDR_LEN],
  432. struct stats_request_params *param)
  433. {
  434. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  435. if (wmi_handle->ops->send_stats_request_cmd)
  436. return wmi_handle->ops->send_stats_request_cmd(wmi_handle,
  437. macaddr, param);
  438. return QDF_STATUS_E_FAILURE;
  439. }
  440. /**
  441. * wmi_unified_stats_request_send() - WMI request stats function
  442. * @param wmi_handle : handle to WMI.
  443. * @param macaddr : MAC address
  444. * @param param : pointer to hold stats request parameter
  445. *
  446. * Return: 0 on success and -ve on failure.
  447. */
  448. QDF_STATUS wmi_unified_packet_log_enable_send(void *wmi_hdl,
  449. uint8_t macaddr[IEEE80211_ADDR_LEN],
  450. struct packet_enable_params *param)
  451. {
  452. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  453. if (wmi_handle->ops->send_packet_log_enable_cmd)
  454. return wmi_handle->ops->send_packet_log_enable_cmd(wmi_handle,
  455. macaddr, param);
  456. return QDF_STATUS_E_FAILURE;
  457. }
  458. /**
  459. * wmi_unified_beacon_send_cmd() - WMI beacon send function
  460. * @param wmi_handle : handle to WMI.
  461. * @param macaddr : MAC address
  462. * @param param : pointer to hold beacon send cmd parameter
  463. *
  464. * Return: 0 on success and -ve on failure.
  465. */
  466. QDF_STATUS wmi_unified_beacon_send_cmd(void *wmi_hdl,
  467. struct beacon_params *param)
  468. {
  469. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  470. if (wmi_handle->ops->send_beacon_send_cmd)
  471. return wmi_handle->ops->send_beacon_send_cmd(wmi_handle,
  472. param);
  473. return QDF_STATUS_E_FAILURE;
  474. }
  475. /**
  476. * wmi_unified_peer_assoc_send() - WMI peer assoc function
  477. * @param wmi_handle : handle to WMI.
  478. * @param macaddr : MAC address
  479. * @param param : pointer to peer assoc parameter
  480. *
  481. * Return: 0 on success and -ve on failure.
  482. */
  483. QDF_STATUS wmi_unified_peer_assoc_send(void *wmi_hdl,
  484. struct peer_assoc_params *param)
  485. {
  486. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  487. if (wmi_handle->ops->send_peer_assoc_cmd)
  488. return wmi_handle->ops->send_peer_assoc_cmd(wmi_handle,
  489. param);
  490. return QDF_STATUS_E_FAILURE;
  491. }
  492. /**
  493. * wmi_unified_scan_start_cmd_send() - WMI scan start function
  494. * @param wmi_handle : handle to WMI.
  495. * @param macaddr : MAC address
  496. * @param param : pointer to hold scan start cmd parameter
  497. *
  498. * Return: 0 on success and -ve on failure.
  499. */
  500. QDF_STATUS wmi_unified_scan_start_cmd_send(void *wmi_hdl,
  501. struct scan_start_params *param)
  502. {
  503. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  504. if (wmi_handle->ops->send_scan_start_cmd)
  505. return wmi_handle->ops->send_scan_start_cmd(wmi_handle,
  506. param);
  507. return QDF_STATUS_E_FAILURE;
  508. }
  509. /**
  510. * wmi_unified_scan_stop_cmd_send() - WMI scan start function
  511. * @param wmi_handle : handle to WMI.
  512. * @param macaddr : MAC address
  513. * @param param : pointer to hold scan start cmd parameter
  514. *
  515. * Return: 0 on success and -ve on failure.
  516. */
  517. QDF_STATUS wmi_unified_scan_stop_cmd_send(void *wmi_hdl,
  518. struct scan_stop_params *param)
  519. {
  520. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  521. if (wmi_handle->ops->send_scan_stop_cmd)
  522. return wmi_handle->ops->send_scan_stop_cmd(wmi_handle,
  523. param);
  524. return QDF_STATUS_E_FAILURE;
  525. }
  526. /**
  527. * wmi_unified_scan_chan_list_cmd_send() - WMI scan channel list function
  528. * @param wmi_handle : handle to WMI.
  529. * @param macaddr : MAC address
  530. * @param param : pointer to hold scan channel list parameter
  531. *
  532. * Return: 0 on success and -ve on failure.
  533. */
  534. QDF_STATUS wmi_unified_scan_chan_list_cmd_send(void *wmi_hdl,
  535. struct scan_chan_list_params *param)
  536. {
  537. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  538. if (wmi_handle->ops->send_scan_chan_list_cmd)
  539. return wmi_handle->ops->send_scan_chan_list_cmd(wmi_handle,
  540. param);
  541. return QDF_STATUS_E_FAILURE;
  542. }
  543. /**
  544. * wmi_mgmt_unified_cmd_send() - management cmd over wmi layer
  545. * @wmi_hdl : handle to WMI.
  546. * @param : pointer to hold mgmt cmd parameter
  547. *
  548. * Return: 0 on success and -ve on failure.
  549. */
  550. QDF_STATUS wmi_mgmt_unified_cmd_send(void *wmi_hdl,
  551. struct wmi_mgmt_params *param)
  552. {
  553. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  554. if (wmi_handle->ops->send_mgmt_cmd)
  555. return wmi_handle->ops->send_mgmt_cmd(wmi_handle,
  556. param);
  557. return QDF_STATUS_E_FAILURE;
  558. }
  559. /**
  560. * wmi_unified_modem_power_state() - set modem power state to fw
  561. * @wmi_hdl: wmi handle
  562. * @param_value: parameter value
  563. *
  564. * Return: 0 for success or error code
  565. */
  566. QDF_STATUS wmi_unified_modem_power_state(void *wmi_hdl,
  567. uint32_t param_value)
  568. {
  569. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  570. if (wmi_handle->ops->send_modem_power_state_cmd)
  571. return wmi_handle->ops->send_modem_power_state_cmd(wmi_handle,
  572. param_value);
  573. return QDF_STATUS_E_FAILURE;
  574. }
  575. /**
  576. * wmi_unified_set_sta_ps_mode() - set sta powersave params in fw
  577. * @wmi_hdl: wmi handle
  578. * @vdev_id: vdev id
  579. * @val: value
  580. *
  581. * Return: 0 for success or error code.
  582. */
  583. QDF_STATUS wmi_unified_set_sta_ps_mode(void *wmi_hdl,
  584. uint32_t vdev_id, uint8_t val)
  585. {
  586. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  587. if (wmi_handle->ops->send_set_sta_ps_mode_cmd)
  588. return wmi_handle->ops->send_set_sta_ps_mode_cmd(wmi_handle,
  589. vdev_id, val);
  590. return QDF_STATUS_E_FAILURE;
  591. }
  592. /**
  593. * wmi_set_mimops() - set MIMO powersave
  594. * @wmi_hdl: wmi handle
  595. * @vdev_id: vdev id
  596. * @value: value
  597. *
  598. * Return: QDF_STATUS_SUCCESS for success or error code.
  599. */
  600. QDF_STATUS wmi_unified_set_mimops(void *wmi_hdl, uint8_t vdev_id, int value)
  601. {
  602. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  603. if (wmi_handle->ops->send_set_mimops_cmd)
  604. return wmi_handle->ops->send_set_mimops_cmd(wmi_handle,
  605. vdev_id, value);
  606. return QDF_STATUS_E_FAILURE;
  607. }
  608. /**
  609. * wmi_set_smps_params() - set smps params
  610. * @wmi_hdl: wmi handle
  611. * @vdev_id: vdev id
  612. * @value: value
  613. *
  614. * Return: QDF_STATUS_SUCCESS for success or error code.
  615. */
  616. QDF_STATUS wmi_unified_set_smps_params(void *wmi_hdl, uint8_t vdev_id,
  617. int value)
  618. {
  619. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  620. if (wmi_handle->ops->send_set_smps_params_cmd)
  621. return wmi_handle->ops->send_set_smps_params_cmd(wmi_handle,
  622. vdev_id, value);
  623. return QDF_STATUS_E_FAILURE;
  624. }
  625. /**
  626. * wmi_set_p2pgo_oppps_req() - send p2p go opp power save request to fw
  627. * @wmi_hdl: wmi handle
  628. * @opps: p2p opp power save parameters
  629. *
  630. * Return: none
  631. */
  632. QDF_STATUS wmi_unified_set_p2pgo_oppps_req(void *wmi_hdl,
  633. struct p2p_ps_params *oppps)
  634. {
  635. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  636. if (wmi_handle->ops->send_set_p2pgo_oppps_req_cmd)
  637. return wmi_handle->ops->send_set_p2pgo_oppps_req_cmd(wmi_handle,
  638. oppps);
  639. return QDF_STATUS_E_FAILURE;
  640. }
  641. /**
  642. * wmi_unified_set_p2pgo_noa_req_cmd() - send p2p go noa request to fw
  643. * @wmi_hdl: wmi handle
  644. * @noa: p2p power save parameters
  645. *
  646. * Return: none
  647. */
  648. QDF_STATUS wmi_unified_set_p2pgo_noa_req_cmd(void *wmi_hdl,
  649. struct p2p_ps_params *noa)
  650. {
  651. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  652. if (wmi_handle->ops->send_set_p2pgo_noa_req_cmd)
  653. return wmi_handle->ops->send_set_p2pgo_noa_req_cmd(wmi_handle,
  654. noa);
  655. return QDF_STATUS_E_FAILURE;
  656. }
  657. /**
  658. * wmi_get_temperature() - get pdev temperature req
  659. * @wmi_hdl: wmi handle
  660. *
  661. * Return: QDF_STATUS_SUCCESS for success or error code.
  662. */
  663. QDF_STATUS wmi_unified_get_temperature(void *wmi_hdl)
  664. {
  665. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  666. if (wmi_handle->ops->send_get_temperature_cmd)
  667. return wmi_handle->ops->send_get_temperature_cmd(wmi_handle);
  668. return QDF_STATUS_E_FAILURE;
  669. }
  670. /**
  671. * wmi_unified_set_sta_uapsd_auto_trig_cmd() - set uapsd auto trigger command
  672. * @wmi_hdl: wmi handle
  673. * @end_set_sta_ps_mode_cmd: cmd paramter strcture
  674. *
  675. * This function sets the trigger
  676. * uapsd params such as service interval, delay interval
  677. * and suspend interval which will be used by the firmware
  678. * to send trigger frames periodically when there is no
  679. * traffic on the transmit side.
  680. *
  681. * Return: 0 for success or error code.
  682. */
  683. QDF_STATUS
  684. wmi_unified_set_sta_uapsd_auto_trig_cmd(void *wmi_hdl,
  685. struct sta_uapsd_trig_params *param)
  686. {
  687. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  688. if (wmi_handle->ops->send_set_sta_uapsd_auto_trig_cmd)
  689. return wmi_handle->ops->send_set_sta_uapsd_auto_trig_cmd(wmi_handle,
  690. param);
  691. return QDF_STATUS_E_FAILURE;
  692. }
  693. /**
  694. * wmi_unified_ocb_start_timing_advert() - start sending the timing advertisement
  695. * frames on a channel
  696. * @wmi_handle: pointer to the wmi handle
  697. * @timing_advert: pointer to the timing advertisement struct
  698. *
  699. * Return: 0 on succes
  700. */
  701. QDF_STATUS wmi_unified_ocb_start_timing_advert(void *wmi_hdl,
  702. struct ocb_timing_advert_param *timing_advert)
  703. {
  704. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  705. if (wmi_handle->ops->send_ocb_start_timing_advert_cmd)
  706. return wmi_handle->ops->send_ocb_start_timing_advert_cmd(wmi_handle,
  707. timing_advert);
  708. return QDF_STATUS_E_FAILURE;
  709. }
  710. /**
  711. * wmi_unified_ocb_stop_timing_advert() - stop sending the timing advertisement
  712. * frames on a channel
  713. * @wmi_handle: pointer to the wmi handle
  714. * @timing_advert: pointer to the timing advertisement struct
  715. *
  716. * Return: 0 on succes
  717. */
  718. QDF_STATUS wmi_unified_ocb_stop_timing_advert(void *wmi_hdl,
  719. struct ocb_timing_advert_param *timing_advert)
  720. {
  721. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  722. if (wmi_handle->ops->send_ocb_stop_timing_advert_cmd)
  723. return wmi_handle->ops->send_ocb_stop_timing_advert_cmd(wmi_handle,
  724. timing_advert);
  725. return QDF_STATUS_E_FAILURE;
  726. }
  727. /**
  728. * wmi_unified_ocb_set_utc_time_cmd() - get ocb tsf timer val
  729. * @wmi_handle: pointer to the wmi handle
  730. * @vdev_id: vdev id
  731. *
  732. * Return: 0 on succes
  733. */
  734. QDF_STATUS wmi_unified_ocb_set_utc_time_cmd(void *wmi_hdl,
  735. struct ocb_utc_param *utc)
  736. {
  737. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  738. if (wmi_handle->ops->send_ocb_set_utc_time_cmd)
  739. return wmi_handle->ops->send_ocb_set_utc_time_cmd(wmi_handle,
  740. utc);
  741. return QDF_STATUS_E_FAILURE;
  742. }
  743. /**
  744. * wmi_unified_ocb_get_tsf_timer() - get ocb tsf timer val
  745. * @wmi_handle: pointer to the wmi handle
  746. * @vdev_id: vdev id
  747. *
  748. * Return: 0 on succes
  749. */
  750. QDF_STATUS wmi_unified_ocb_get_tsf_timer(void *wmi_hdl,
  751. uint8_t vdev_id)
  752. {
  753. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  754. if (wmi_handle->ops->send_ocb_get_tsf_timer_cmd)
  755. return wmi_handle->ops->send_ocb_get_tsf_timer_cmd(wmi_handle,
  756. vdev_id);
  757. return QDF_STATUS_E_FAILURE;
  758. }
  759. /**
  760. * wmi_unified_dcc_get_stats_cmd() - get the DCC channel stats
  761. * @wmi_handle: pointer to the wmi handle
  762. * @get_stats_param: pointer to the dcc stats
  763. *
  764. * Return: 0 on succes
  765. */
  766. QDF_STATUS wmi_unified_dcc_get_stats_cmd(void *wmi_hdl,
  767. struct dcc_get_stats_param *get_stats_param)
  768. {
  769. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  770. if (wmi_handle->ops->send_dcc_get_stats_cmd)
  771. return wmi_handle->ops->send_dcc_get_stats_cmd(wmi_handle,
  772. get_stats_param);
  773. return QDF_STATUS_E_FAILURE;
  774. }
  775. /**
  776. * wmi_unified_dcc_clear_stats() - command to clear the DCC stats
  777. * @wmi_handle: pointer to the wmi handle
  778. * @clear_stats_param: parameters to the command
  779. *
  780. * Return: 0 on succes
  781. */
  782. QDF_STATUS wmi_unified_dcc_clear_stats(void *wmi_hdl,
  783. uint32_t vdev_id, uint32_t dcc_stats_bitmap)
  784. {
  785. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  786. if (wmi_handle->ops->send_dcc_clear_stats_cmd)
  787. return wmi_handle->ops->send_dcc_clear_stats_cmd(wmi_handle,
  788. vdev_id, dcc_stats_bitmap);
  789. return QDF_STATUS_E_FAILURE;
  790. }
  791. /**
  792. * wmi_unified_dcc_update_ndl() - command to update the NDL data
  793. * @wmi_handle: pointer to the wmi handle
  794. * @update_ndl_param: pointer to the request parameters
  795. *
  796. * Return: 0 on success
  797. */
  798. QDF_STATUS wmi_unified_dcc_update_ndl(void *wmi_hdl,
  799. struct dcc_update_ndl_param *update_ndl_param)
  800. {
  801. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  802. if (wmi_handle->ops->send_dcc_update_ndl_cmd)
  803. return wmi_handle->ops->send_dcc_update_ndl_cmd(wmi_handle,
  804. update_ndl_param);
  805. return QDF_STATUS_E_FAILURE;
  806. }
  807. /**
  808. * wmi_unified_ocb_set_config() - send the OCB config to the FW
  809. * @wmi_handle: pointer to the wmi handle
  810. * @config: the OCB configuration
  811. *
  812. * Return: 0 on success
  813. */
  814. QDF_STATUS wmi_unified_ocb_set_config(void *wmi_hdl,
  815. struct ocb_config_param *config, uint32_t *ch_mhz)
  816. {
  817. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  818. if (wmi_handle->ops->send_ocb_set_config_cmd)
  819. return wmi_handle->ops->send_ocb_set_config_cmd(wmi_handle,
  820. config, ch_mhz);
  821. return QDF_STATUS_E_FAILURE;
  822. }
  823. /**
  824. * wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd() - control mcc scheduler
  825. * @wmi_handle: wmi handle
  826. * @mcc_adaptive_scheduler: enable/disable
  827. *
  828. * This function enable/disable mcc adaptive scheduler in fw.
  829. *
  830. * Return: QDF_STATUS_SUCCESS for sucess or error code
  831. */
  832. QDF_STATUS wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd(
  833. void *wmi_hdl, uint32_t mcc_adaptive_scheduler)
  834. {
  835. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  836. if (wmi_handle->ops->send_set_enable_disable_mcc_adaptive_scheduler_cmd)
  837. return wmi_handle->ops->send_set_enable_disable_mcc_adaptive_scheduler_cmd(wmi_handle,
  838. mcc_adaptive_scheduler);
  839. return QDF_STATUS_E_FAILURE;
  840. }
  841. /**
  842. * wmi_unified_set_mcc_channel_time_latency_cmd() - set MCC channel time latency
  843. * @wmi: wmi handle
  844. * @mcc_channel: mcc channel
  845. * @mcc_channel_time_latency: MCC channel time latency.
  846. *
  847. * Currently used to set time latency for an MCC vdev/adapter using operating
  848. * channel of it and channel number. The info is provided run time using
  849. * iwpriv command: iwpriv <wlan0 | p2p0> setMccLatency <latency in ms>.
  850. *
  851. * Return: CDF status
  852. */
  853. QDF_STATUS wmi_unified_set_mcc_channel_time_latency_cmd(void *wmi_hdl,
  854. uint32_t mcc_channel_freq, uint32_t mcc_channel_time_latency)
  855. {
  856. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  857. if (wmi_handle->ops->send_set_mcc_channel_time_latency_cmd)
  858. return wmi_handle->ops->send_set_mcc_channel_time_latency_cmd(wmi_handle,
  859. mcc_channel_freq,
  860. mcc_channel_time_latency);
  861. return QDF_STATUS_E_FAILURE;
  862. }
  863. /**
  864. * wmi_unified_set_mcc_channel_time_quota_cmd() - set MCC channel time quota
  865. * @wmi: wmi handle
  866. * @adapter_1_chan_number: adapter 1 channel number
  867. * @adapter_1_quota: adapter 1 quota
  868. * @adapter_2_chan_number: adapter 2 channel number
  869. *
  870. * Return: CDF status
  871. */
  872. QDF_STATUS wmi_unified_set_mcc_channel_time_quota_cmd(void *wmi_hdl,
  873. uint32_t adapter_1_chan_freq,
  874. uint32_t adapter_1_quota, uint32_t adapter_2_chan_freq)
  875. {
  876. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  877. if (wmi_handle->ops->send_set_mcc_channel_time_quota_cmd)
  878. return wmi_handle->ops->send_set_mcc_channel_time_quota_cmd(wmi_handle,
  879. adapter_1_chan_freq,
  880. adapter_1_quota,
  881. adapter_2_chan_freq);
  882. return QDF_STATUS_E_FAILURE;
  883. }
  884. /**
  885. * wmi_unified_set_thermal_mgmt_cmd() - set thermal mgmt command to fw
  886. * @wmi_handle: Pointer to wmi handle
  887. * @thermal_info: Thermal command information
  888. *
  889. * This function sends the thermal management command
  890. * to the firmware
  891. *
  892. * Return: QDF_STATUS_SUCCESS for success otherwise failure
  893. */
  894. QDF_STATUS wmi_unified_set_thermal_mgmt_cmd(void *wmi_hdl,
  895. struct thermal_cmd_params *thermal_info)
  896. {
  897. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  898. if (wmi_handle->ops->send_set_thermal_mgmt_cmd)
  899. return wmi_handle->ops->send_set_thermal_mgmt_cmd(wmi_handle,
  900. thermal_info);
  901. return QDF_STATUS_E_FAILURE;
  902. }
  903. /**
  904. * wmi_unified_lro_config_cmd() - process the LRO config command
  905. * @wmi: Pointer to wmi handle
  906. * @wmi_lro_cmd: Pointer to LRO configuration parameters
  907. *
  908. * This function sends down the LRO configuration parameters to
  909. * the firmware to enable LRO, sets the TCP flags and sets the
  910. * seed values for the toeplitz hash generation
  911. *
  912. * Return: QDF_STATUS_SUCCESS for success otherwise failure
  913. */
  914. QDF_STATUS wmi_unified_lro_config_cmd(void *wmi_hdl,
  915. struct wmi_lro_config_cmd_t *wmi_lro_cmd)
  916. {
  917. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  918. if (wmi_handle->ops->send_lro_config_cmd)
  919. return wmi_handle->ops->send_lro_config_cmd(wmi_handle,
  920. wmi_lro_cmd);
  921. return QDF_STATUS_E_FAILURE;
  922. }
  923. /**
  924. * wmi_unified_bcn_buf_ll_cmd() - prepare and send beacon buffer to fw for LL
  925. * @wmi_hdl: wmi handle
  926. * @param: bcn ll cmd parameter
  927. *
  928. * Return: QDF_STATUS_SUCCESS for success otherwise failure
  929. */
  930. QDF_STATUS wmi_unified_bcn_buf_ll_cmd(void *wmi_hdl,
  931. wmi_bcn_send_from_host_cmd_fixed_param *param)
  932. {
  933. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  934. if (wmi_handle->ops->send_bcn_buf_ll_cmd)
  935. return wmi_handle->ops->send_bcn_buf_ll_cmd(wmi_handle,
  936. param);
  937. return QDF_STATUS_E_FAILURE;
  938. }
  939. /**
  940. * wmi_unified_set_sta_sa_query_param_cmd() - set sta sa query parameters
  941. * @wmi_hdl: wmi handle
  942. * @vdev_id: vdev id
  943. * @max_retries: max retries
  944. * @retry_interval: retry interval
  945. * This function sets sta query related parameters in fw.
  946. *
  947. * Return: QDF_STATUS_SUCCESS for success otherwise failure
  948. */
  949. QDF_STATUS wmi_unified_set_sta_sa_query_param_cmd(void *wmi_hdl,
  950. uint8_t vdev_id, uint32_t max_retries,
  951. uint32_t retry_interval)
  952. {
  953. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  954. if (wmi_handle->ops->send_set_sta_sa_query_param_cmd)
  955. return wmi_handle->ops->send_set_sta_sa_query_param_cmd(wmi_handle,
  956. vdev_id, max_retries,
  957. retry_interval);
  958. return QDF_STATUS_E_FAILURE;
  959. }
  960. /**
  961. * wmi_unified_set_sta_keep_alive_cmd() - set sta keep alive parameters
  962. * @wmi_hdl: wmi handle
  963. * @params: sta keep alive parameter
  964. *
  965. * This function sets keep alive related parameters in fw.
  966. *
  967. * Return: none
  968. */
  969. QDF_STATUS wmi_unified_set_sta_keep_alive_cmd(void *wmi_hdl,
  970. struct sta_params *params)
  971. {
  972. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  973. if (wmi_handle->ops->send_set_sta_keep_alive_cmd)
  974. return wmi_handle->ops->send_set_sta_keep_alive_cmd(wmi_handle,
  975. params);
  976. return QDF_STATUS_E_FAILURE;
  977. }
  978. /**
  979. * wmi_unified_vdev_set_gtx_cfg_cmd() - set GTX params
  980. * @wmi_hdl: wmi handle
  981. * @if_id: vdev id
  982. * @gtx_info: GTX config params
  983. *
  984. * This function set GTX related params in firmware.
  985. *
  986. * Return: 0 for success or error code
  987. */
  988. QDF_STATUS wmi_unified_vdev_set_gtx_cfg_cmd(void *wmi_hdl, uint32_t if_id,
  989. struct wmi_gtx_config *gtx_info)
  990. {
  991. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  992. if (wmi_handle->ops->send_vdev_set_gtx_cfg_cmd)
  993. return wmi_handle->ops->send_vdev_set_gtx_cfg_cmd(wmi_handle,
  994. if_id, gtx_info);
  995. return QDF_STATUS_E_FAILURE;
  996. }
  997. /**
  998. * wmi_unified_process_update_edca_param() - update EDCA params
  999. * @wmi_hdl: wmi handle
  1000. * @edca_params: edca parameters
  1001. *
  1002. * This function updates EDCA parameters to the target
  1003. *
  1004. * Return: CDF Status
  1005. */
  1006. QDF_STATUS wmi_unified_process_update_edca_param(void *wmi_hdl,
  1007. uint8_t vdev_id,
  1008. wmi_wmm_vparams gwmm_param[WMI_MAX_NUM_AC])
  1009. {
  1010. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1011. if (wmi_handle->ops->send_process_update_edca_param_cmd)
  1012. return wmi_handle->ops->send_process_update_edca_param_cmd(wmi_handle,
  1013. vdev_id, gwmm_param);
  1014. return QDF_STATUS_E_FAILURE;
  1015. }
  1016. /**
  1017. * wmi_unified_probe_rsp_tmpl_send_cmd() - send probe response template to fw
  1018. * @wmi_hdl: wmi handle
  1019. * @vdev_id: vdev id
  1020. * @probe_rsp_info: probe response info
  1021. *
  1022. * Return: 0 for success or error code
  1023. */
  1024. QDF_STATUS wmi_unified_probe_rsp_tmpl_send_cmd(void *wmi_hdl,
  1025. uint8_t vdev_id,
  1026. struct wmi_probe_resp_params *probe_rsp_info,
  1027. uint8_t *frm)
  1028. {
  1029. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1030. if (wmi_handle->ops->send_probe_rsp_tmpl_send_cmd)
  1031. return wmi_handle->ops->send_probe_rsp_tmpl_send_cmd(wmi_handle,
  1032. vdev_id, probe_rsp_info,
  1033. frm);
  1034. return QDF_STATUS_E_FAILURE;
  1035. }
  1036. /**
  1037. * wmi_unified_p2p_go_set_beacon_ie_cmd() - set beacon IE for p2p go
  1038. * @wma_handle: wma handle
  1039. * @vdev_id: vdev id
  1040. * @p2p_ie: p2p IE
  1041. *
  1042. * Return: 0 for success or error code
  1043. */
  1044. QDF_STATUS wmi_unified_p2p_go_set_beacon_ie_cmd(void *wmi_hdl,
  1045. A_UINT32 vdev_id, uint8_t *p2p_ie)
  1046. {
  1047. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1048. if (wmi_handle->ops->send_p2p_go_set_beacon_ie_cmd)
  1049. return wmi_handle->ops->send_p2p_go_set_beacon_ie_cmd(wmi_handle,
  1050. vdev_id, p2p_ie);
  1051. return QDF_STATUS_E_FAILURE;
  1052. }
  1053. /**
  1054. * wmi_unified_set_gateway_params_cmd() - set gateway parameters
  1055. * @wmi_hdl: wmi handle
  1056. * @req: gateway parameter update request structure
  1057. *
  1058. * This function reads the incoming @req and fill in the destination
  1059. * WMI structure and sends down the gateway configs down to the firmware
  1060. *
  1061. * Return: QDF_STATUS
  1062. */
  1063. QDF_STATUS wmi_unified_set_gateway_params_cmd(void *wmi_hdl,
  1064. struct gateway_update_req_param *req)
  1065. {
  1066. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1067. if (wmi_handle->ops->send_set_gateway_params_cmd)
  1068. return wmi_handle->ops->send_set_gateway_params_cmd(wmi_handle,
  1069. req);
  1070. return QDF_STATUS_E_FAILURE;
  1071. }
  1072. /**
  1073. * wmi_unified_set_rssi_monitoring_cmd() - set rssi monitoring
  1074. * @wmi_hdl: wmi handle
  1075. * @req: rssi monitoring request structure
  1076. *
  1077. * This function reads the incoming @req and fill in the destination
  1078. * WMI structure and send down the rssi monitoring configs down to the firmware
  1079. *
  1080. * Return: 0 on success; error number otherwise
  1081. */
  1082. QDF_STATUS wmi_unified_set_rssi_monitoring_cmd(void *wmi_hdl,
  1083. struct rssi_monitor_param *req)
  1084. {
  1085. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1086. if (wmi_handle->ops->send_pno_start_cmd)
  1087. return wmi_handle->ops->send_set_rssi_monitoring_cmd(wmi_handle,
  1088. req);
  1089. return QDF_STATUS_E_FAILURE;
  1090. }
  1091. /**
  1092. * wmi_unified_scan_probe_setoui_cmd() - set scan probe OUI
  1093. * @wmi_hdl: wmi handle
  1094. * @psetoui: OUI parameters
  1095. *
  1096. * set scan probe OUI parameters in firmware
  1097. *
  1098. * Return: CDF status
  1099. */
  1100. QDF_STATUS wmi_unified_scan_probe_setoui_cmd(void *wmi_hdl,
  1101. struct scan_mac_oui *psetoui)
  1102. {
  1103. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1104. if (wmi_handle->ops->send_scan_probe_setoui_cmd)
  1105. return wmi_handle->ops->send_scan_probe_setoui_cmd(wmi_handle,
  1106. psetoui);
  1107. return QDF_STATUS_E_FAILURE;
  1108. }
  1109. /**
  1110. * wmi_unified_reset_passpoint_network_list_cmd() - reset passpoint network list
  1111. * @wmi_hdl: wmi handle
  1112. * @req: passpoint network request structure
  1113. *
  1114. * This function sends down WMI command with network id set to wildcard id.
  1115. * firmware shall clear all the config entries
  1116. *
  1117. * Return: QDF_STATUS enumeration
  1118. */
  1119. QDF_STATUS wmi_unified_reset_passpoint_network_list_cmd(void *wmi_hdl,
  1120. struct wifi_passpoint_req_param *req)
  1121. {
  1122. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1123. if (wmi_handle->ops->send_reset_passpoint_network_list_cmd)
  1124. return wmi_handle->ops->send_reset_passpoint_network_list_cmd(wmi_handle,
  1125. req);
  1126. return QDF_STATUS_E_FAILURE;
  1127. }
  1128. /**
  1129. * wmi_unified_set_passpoint_network_list_cmd() - set passpoint network list
  1130. * @wmi_hdl: wmi handle
  1131. * @req: passpoint network request structure
  1132. *
  1133. * This function reads the incoming @req and fill in the destination
  1134. * WMI structure and send down the passpoint configs down to the firmware
  1135. *
  1136. * Return: QDF_STATUS enumeration
  1137. */
  1138. QDF_STATUS wmi_unified_set_passpoint_network_list_cmd(void *wmi_hdl,
  1139. struct wifi_passpoint_req_param *req)
  1140. {
  1141. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1142. if (wmi_handle->ops->send_set_passpoint_network_list_cmd)
  1143. return wmi_handle->ops->send_set_passpoint_network_list_cmd(wmi_handle,
  1144. req);
  1145. return QDF_STATUS_E_FAILURE;
  1146. }
  1147. /** wmi_unified_set_epno_network_list_cmd() - set epno network list
  1148. * @wmi_hdl: wmi handle
  1149. * @req: epno config params request structure
  1150. *
  1151. * This function reads the incoming epno config request structure
  1152. * and constructs the WMI message to the firmware.
  1153. *
  1154. * Returns: 0 on success, error number otherwise
  1155. */
  1156. QDF_STATUS wmi_unified_set_epno_network_list_cmd(void *wmi_hdl,
  1157. struct wifi_enhanched_pno_params *req)
  1158. {
  1159. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1160. if (wmi_handle->ops->send_set_epno_network_list_cmd)
  1161. return wmi_handle->ops->send_set_epno_network_list_cmd(wmi_handle,
  1162. req);
  1163. return QDF_STATUS_E_FAILURE;
  1164. }
  1165. /**
  1166. * wmi_unified_roam_scan_offload_mode_cmd() - set roam scan parameters
  1167. * @wmi_hdl: wmi handle
  1168. * @scan_cmd_fp: scan related parameters
  1169. * @roam_req: roam related parameters
  1170. *
  1171. * This function reads the incoming @roam_req and fill in the destination
  1172. * WMI structure and send down the roam scan configs down to the firmware
  1173. *
  1174. * Return: QDF_STATUS enumeration
  1175. */
  1176. QDF_STATUS wmi_unified_roam_scan_offload_mode_cmd(void *wmi_hdl,
  1177. wmi_start_scan_cmd_fixed_param *scan_cmd_fp,
  1178. struct roam_offload_scan_params *roam_req)
  1179. {
  1180. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1181. if (wmi_handle->ops->send_roam_scan_offload_mode_cmd)
  1182. return wmi_handle->ops->send_roam_scan_offload_mode_cmd(
  1183. wmi_handle, scan_cmd_fp, roam_req);
  1184. return QDF_STATUS_E_FAILURE;
  1185. }
  1186. /**
  1187. * wmi_unified_roam_scan_offload_rssi_thresh_cmd() - set roam scan rssi
  1188. * parameters
  1189. * @wmi_hdl: wmi handle
  1190. * @roam_req: roam rssi related parameters
  1191. *
  1192. * This function reads the incoming @roam_req and fill in the destination
  1193. * WMI structure and send down the roam scan rssi configs down to the firmware
  1194. *
  1195. * Return: QDF_STATUS enumeration
  1196. */
  1197. QDF_STATUS wmi_unified_roam_scan_offload_rssi_thresh_cmd(void *wmi_hdl,
  1198. struct roam_offload_scan_rssi_params
  1199. *roam_req)
  1200. {
  1201. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1202. if (wmi_handle->ops->send_roam_scan_offload_rssi_thresh_cmd)
  1203. return wmi_handle->ops->send_roam_scan_offload_rssi_thresh_cmd(
  1204. wmi_handle, roam_req);
  1205. return QDF_STATUS_E_FAILURE;
  1206. }
  1207. /**
  1208. * wmi_unified_roam_scan_filter_cmd() - send roam scan whitelist,
  1209. * blacklist and preferred list
  1210. * @wmi_hdl: wmi handle
  1211. * @roam_req: roam scan lists related parameters
  1212. *
  1213. * This function reads the incoming @roam_req and fill in the destination
  1214. * WMI structure and send down the different roam scan lists down to the fw
  1215. *
  1216. * Return: QDF_STATUS enumeration
  1217. */
  1218. QDF_STATUS wmi_unified_roam_scan_filter_cmd(void *wmi_hdl,
  1219. struct roam_scan_filter_params *roam_req)
  1220. {
  1221. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1222. if (wmi_handle->ops->send_roam_scan_filter_cmd)
  1223. return wmi_handle->ops->send_roam_scan_filter_cmd(
  1224. wmi_handle, roam_req);
  1225. return QDF_STATUS_E_FAILURE;
  1226. }
  1227. /** wmi_unified_ipa_offload_control_cmd() - ipa offload control parameter
  1228. * @wmi_hdl: wmi handle
  1229. * @ipa_offload: ipa offload control parameter
  1230. *
  1231. * Returns: 0 on success, error number otherwise
  1232. */
  1233. QDF_STATUS wmi_unified_ipa_offload_control_cmd(void *wmi_hdl,
  1234. struct ipa_offload_control_params *ipa_offload)
  1235. {
  1236. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1237. if (wmi_handle->ops->send_ipa_offload_control_cmd)
  1238. return wmi_handle->ops->send_ipa_offload_control_cmd(wmi_handle,
  1239. ipa_offload);
  1240. return QDF_STATUS_E_FAILURE;
  1241. }
  1242. /**
  1243. * wmi_unified_extscan_get_capabilities_cmd() - extscan get capabilities
  1244. * @wmi_hdl: wmi handle
  1245. * @pgetcapab: get capabilities params
  1246. *
  1247. * This function send request to fw to get extscan capabilities.
  1248. *
  1249. * Return: CDF status
  1250. */
  1251. QDF_STATUS wmi_unified_extscan_get_capabilities_cmd(void *wmi_hdl,
  1252. struct extscan_capabilities_params *pgetcapab)
  1253. {
  1254. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1255. if (wmi_handle->ops->send_extscan_get_capabilities_cmd)
  1256. return wmi_handle->ops->send_extscan_get_capabilities_cmd(wmi_handle,
  1257. pgetcapab);
  1258. return QDF_STATUS_E_FAILURE;
  1259. }
  1260. /**
  1261. * wmi_unified_extscan_get_cached_results_cmd() - extscan get cached results
  1262. * @wmi_hdl: wmi handle
  1263. * @pcached_results: cached results parameters
  1264. *
  1265. * This function send request to fw to get cached results.
  1266. *
  1267. * Return: CDF status
  1268. */
  1269. QDF_STATUS wmi_unified_extscan_get_cached_results_cmd(void *wmi_hdl,
  1270. struct extscan_cached_result_params *pcached_results)
  1271. {
  1272. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1273. if (wmi_handle->ops->send_extscan_get_cached_results_cmd)
  1274. return wmi_handle->ops->send_extscan_get_cached_results_cmd(wmi_handle,
  1275. pcached_results);
  1276. return QDF_STATUS_E_FAILURE;
  1277. }
  1278. /**
  1279. * wmi_unified_extscan_stop_change_monitor_cmd() - send stop change monitor cmd
  1280. * @wmi_hdl: wmi handle
  1281. * @reset_req: Reset change request params
  1282. *
  1283. * This function sends stop change monitor request to fw.
  1284. *
  1285. * Return: CDF status
  1286. */
  1287. QDF_STATUS wmi_unified_extscan_stop_change_monitor_cmd(void *wmi_hdl,
  1288. struct extscan_capabilities_reset_params *reset_req)
  1289. {
  1290. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1291. if (wmi_handle->ops->send_extscan_stop_change_monitor_cmd)
  1292. return wmi_handle->ops->send_extscan_stop_change_monitor_cmd(wmi_handle,
  1293. reset_req);
  1294. return QDF_STATUS_E_FAILURE;
  1295. }
  1296. /**
  1297. * wmi_unified_extscan_start_change_monitor_cmd() - start change monitor cmd
  1298. * @wmi_hdl: wmi handle
  1299. * @psigchange: change monitor request params
  1300. *
  1301. * This function sends start change monitor request to fw.
  1302. *
  1303. * Return: CDF status
  1304. */
  1305. QDF_STATUS wmi_unified_extscan_start_change_monitor_cmd(void *wmi_hdl,
  1306. struct extscan_set_sig_changereq_params *
  1307. psigchange)
  1308. {
  1309. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1310. if (wmi_handle->ops->send_extscan_start_change_monitor_cmd)
  1311. return wmi_handle->ops->send_extscan_start_change_monitor_cmd(wmi_handle,
  1312. psigchange);
  1313. return QDF_STATUS_E_FAILURE;
  1314. }
  1315. /**
  1316. * wmi_unified_extscan_stop_hotlist_monitor_cmd() - stop hotlist monitor
  1317. * @wmi_hdl: wmi handle
  1318. * @photlist_reset: hotlist reset params
  1319. *
  1320. * This function configures hotlist monitor to stop in fw.
  1321. *
  1322. * Return: CDF status
  1323. */
  1324. QDF_STATUS wmi_unified_extscan_stop_hotlist_monitor_cmd(void *wmi_hdl,
  1325. struct extscan_bssid_hotlist_reset_params *photlist_reset)
  1326. {
  1327. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1328. if (wmi_handle->ops->send_extscan_stop_hotlist_monitor_cmd)
  1329. return wmi_handle->ops->send_extscan_stop_hotlist_monitor_cmd(wmi_handle,
  1330. photlist_reset);
  1331. return QDF_STATUS_E_FAILURE;
  1332. }
  1333. /**
  1334. * wmi_unified_stop_extscan_cmd() - stop extscan command to fw.
  1335. * @wmi_hdl: wmi handle
  1336. * @pstopcmd: stop scan command request params
  1337. *
  1338. * This function sends stop extscan request to fw.
  1339. *
  1340. * Return: CDF Status.
  1341. */
  1342. QDF_STATUS wmi_unified_stop_extscan_cmd(void *wmi_hdl,
  1343. struct extscan_stop_req_params *pstopcmd)
  1344. {
  1345. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1346. if (wmi_handle->ops->send_stop_extscan_cmd)
  1347. return wmi_handle->ops->send_stop_extscan_cmd(wmi_handle,
  1348. pstopcmd);
  1349. return QDF_STATUS_E_FAILURE;
  1350. }
  1351. /**
  1352. * wmi_unified_start_extscan_cmd() - start extscan command to fw.
  1353. * @wmi_hdl: wmi handle
  1354. * @pstart: scan command request params
  1355. *
  1356. * This function sends start extscan request to fw.
  1357. *
  1358. * Return: CDF Status.
  1359. */
  1360. QDF_STATUS wmi_unified_start_extscan_cmd(void *wmi_hdl,
  1361. struct wifi_scan_cmd_req_params *pstart)
  1362. {
  1363. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1364. if (wmi_handle->ops->send_start_extscan_cmd)
  1365. return wmi_handle->ops->send_start_extscan_cmd(wmi_handle,
  1366. pstart);
  1367. return QDF_STATUS_E_FAILURE;
  1368. }
  1369. /**
  1370. * wmi_unified_plm_stop_cmd() - plm stop request
  1371. * @wmi_hdl: wmi handle
  1372. * @plm: plm request parameters
  1373. *
  1374. * This function request FW to stop PLM.
  1375. *
  1376. * Return: CDF status
  1377. */
  1378. QDF_STATUS wmi_unified_plm_stop_cmd(void *wmi_hdl,
  1379. const struct plm_req_params *plm)
  1380. {
  1381. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1382. if (wmi_handle->ops->send_plm_stop_cmd)
  1383. return wmi_handle->ops->send_plm_stop_cmd(wmi_handle,
  1384. plm);
  1385. return QDF_STATUS_E_FAILURE;
  1386. }
  1387. /**
  1388. * wmi_unified_plm_start_cmd() - plm start request
  1389. * @wmi_hdl: wmi handle
  1390. * @plm: plm request parameters
  1391. *
  1392. * This function request FW to start PLM.
  1393. *
  1394. * Return: CDF status
  1395. */
  1396. QDF_STATUS wmi_unified_plm_start_cmd(void *wmi_hdl,
  1397. const struct plm_req_params *plm,
  1398. uint32_t *gchannel_list)
  1399. {
  1400. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1401. if (wmi_handle->ops->send_plm_start_cmd)
  1402. return wmi_handle->ops->send_plm_start_cmd(wmi_handle,
  1403. plm, gchannel_list);
  1404. return QDF_STATUS_E_FAILURE;
  1405. }
  1406. /**
  1407. * send_pno_stop_cmd() - PNO stop request
  1408. * @wmi_hdl: wmi handle
  1409. * @vdev_id: vdev id
  1410. *
  1411. * This function request FW to stop ongoing PNO operation.
  1412. *
  1413. * Return: CDF status
  1414. */
  1415. QDF_STATUS wmi_unified_pno_stop_cmd(void *wmi_hdl, uint8_t vdev_id)
  1416. {
  1417. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1418. if (wmi_handle->ops->send_pno_stop_cmd)
  1419. return wmi_handle->ops->send_pno_stop_cmd(wmi_handle,
  1420. vdev_id);
  1421. return QDF_STATUS_E_FAILURE;
  1422. }
  1423. /**
  1424. * wmi_unified_pno_start_cmd() - PNO start request
  1425. * @wmi_hdl: wmi handle
  1426. * @pno: PNO request
  1427. * @gchannel_freq_list: channel frequency list
  1428. *
  1429. * This function request FW to start PNO request.
  1430. * Request: CDF status
  1431. */
  1432. QDF_STATUS wmi_unified_pno_start_cmd(void *wmi_hdl,
  1433. struct pno_scan_req_params *pno,
  1434. uint32_t *gchannel_freq_list)
  1435. {
  1436. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1437. if (wmi_handle->ops->send_pno_start_cmd)
  1438. return wmi_handle->ops->send_pno_start_cmd(wmi_handle,
  1439. pno, gchannel_freq_list);
  1440. return QDF_STATUS_E_FAILURE;
  1441. }
  1442. /* wmi_unified_set_ric_req_cmd() - set ric request element
  1443. * @wmi_hdl: wmi handle
  1444. * @msg: message
  1445. * @is_add_ts: is addts required
  1446. *
  1447. * This function sets ric request element for 11r roaming.
  1448. *
  1449. * Return: none
  1450. */
  1451. QDF_STATUS wmi_unified_set_ric_req_cmd(void *wmi_hdl, void *msg,
  1452. uint8_t is_add_ts)
  1453. {
  1454. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1455. if (wmi_handle->ops->send_set_ric_req_cmd)
  1456. return wmi_handle->ops->send_set_ric_req_cmd(wmi_handle, msg,
  1457. is_add_ts);
  1458. return QDF_STATUS_E_FAILURE;
  1459. }
  1460. /**
  1461. * wmi_unified_process_ll_stats_clear_cmd() - clear link layer stats
  1462. * @wmi_hdl: wmi handle
  1463. * @clear_req: ll stats clear request command params
  1464. * @addr: mac address
  1465. *
  1466. * Return: QDF_STATUS_SUCCESS for success or error code
  1467. */
  1468. QDF_STATUS wmi_unified_process_ll_stats_clear_cmd(void *wmi_hdl,
  1469. const struct ll_stats_clear_params *clear_req,
  1470. uint8_t addr[IEEE80211_ADDR_LEN])
  1471. {
  1472. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1473. if (wmi_handle->ops->send_process_ll_stats_clear_cmd)
  1474. return wmi_handle->ops->send_process_ll_stats_clear_cmd(wmi_handle,
  1475. clear_req, addr);
  1476. return QDF_STATUS_E_FAILURE;
  1477. }
  1478. /**
  1479. * wmi_unified_process_ll_stats_get_cmd() - link layer stats get request
  1480. * @wmi_hdl:wmi handle
  1481. * @get_req:ll stats get request command params
  1482. *
  1483. * Return: QDF_STATUS_SUCCESS for success or error code
  1484. */
  1485. QDF_STATUS wmi_unified_process_ll_stats_get_cmd(void *wmi_hdl,
  1486. const struct ll_stats_get_params *get_req,
  1487. uint8_t addr[IEEE80211_ADDR_LEN])
  1488. {
  1489. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1490. if (wmi_handle->ops->send_process_ll_stats_get_cmd)
  1491. return wmi_handle->ops->send_process_ll_stats_get_cmd(wmi_handle,
  1492. get_req, addr);
  1493. return QDF_STATUS_E_FAILURE;
  1494. }
  1495. /**
  1496. * wmi_unified_get_stats_cmd() - get stats request
  1497. * @wmi_hdl: wma handle
  1498. * @get_stats_param: stats params
  1499. * @addr: mac address
  1500. *
  1501. * Return: none
  1502. */
  1503. QDF_STATUS wmi_unified_get_stats_cmd(void *wmi_hdl,
  1504. struct pe_stats_req *get_stats_param,
  1505. uint8_t addr[IEEE80211_ADDR_LEN])
  1506. {
  1507. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1508. if (wmi_handle->ops->send_get_stats_cmd)
  1509. return wmi_handle->ops->send_get_stats_cmd(wmi_handle,
  1510. get_stats_param, addr);
  1511. return QDF_STATUS_E_FAILURE;
  1512. }
  1513. /**
  1514. * wmi_unified_process_ll_stats_set_cmd() - link layer stats set request
  1515. * @wmi_handle: wmi handle
  1516. * @set_req: ll stats set request command params
  1517. *
  1518. * Return: QDF_STATUS_SUCCESS for success or error code
  1519. */
  1520. QDF_STATUS wmi_unified_process_ll_stats_set_cmd(void *wmi_hdl,
  1521. const struct ll_stats_set_params *set_req)
  1522. {
  1523. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1524. if (wmi_handle->ops->send_process_ll_stats_set_cmd)
  1525. return wmi_handle->ops->send_process_ll_stats_set_cmd(wmi_handle,
  1526. set_req);
  1527. return QDF_STATUS_E_FAILURE;
  1528. }
  1529. /**
  1530. * wmi_unified_snr_request_cmd() - send request to fw to get RSSI stats
  1531. * @wmi_handle: wmi handle
  1532. * @rssi_req: get RSSI request
  1533. *
  1534. * Return: CDF status
  1535. */
  1536. QDF_STATUS wmi_unified_snr_request_cmd(void *wmi_hdl)
  1537. {
  1538. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1539. if (wmi_handle->ops->send_snr_request_cmd)
  1540. return wmi_handle->ops->send_snr_request_cmd(wmi_handle);
  1541. return QDF_STATUS_E_FAILURE;
  1542. }
  1543. /**
  1544. * wmi_unified_snr_cmd() - get RSSI from fw
  1545. * @wmi_handle: wmi handle
  1546. * @vdev_id: vdev id
  1547. *
  1548. * Return: CDF status
  1549. */
  1550. QDF_STATUS wmi_unified_snr_cmd(void *wmi_hdl, uint8_t vdev_id)
  1551. {
  1552. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1553. if (wmi_handle->ops->send_snr_cmd)
  1554. return wmi_handle->ops->send_snr_cmd(wmi_handle,
  1555. vdev_id);
  1556. return QDF_STATUS_E_FAILURE;
  1557. }
  1558. /**
  1559. * wmi_unified_link_status_req_cmd() - process link status request from UMAC
  1560. * @wmi_handle: wmi handle
  1561. * @link_status: get link params
  1562. *
  1563. * Return: CDF status
  1564. */
  1565. QDF_STATUS wmi_unified_link_status_req_cmd(void *wmi_hdl,
  1566. struct link_status_params *link_status)
  1567. {
  1568. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1569. if (wmi_handle->ops->send_link_status_req_cmd)
  1570. return wmi_handle->ops->send_link_status_req_cmd(wmi_handle,
  1571. link_status);
  1572. return QDF_STATUS_E_FAILURE;
  1573. }
  1574. #ifdef FEATURE_WLAN_LPHB
  1575. /**
  1576. * wmi_unified_lphb_config_hbenable_cmd() - enable command of LPHB configuration requests
  1577. * @wmi_handle: wmi handle
  1578. * @lphb_conf_req: configuration info
  1579. *
  1580. * Return: CDF status
  1581. */
  1582. QDF_STATUS wmi_unified_lphb_config_hbenable_cmd(void *wmi_hdl,
  1583. wmi_hb_set_enable_cmd_fixed_param *params)
  1584. {
  1585. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1586. if (wmi_handle->ops->send_lphb_config_hbenable_cmd)
  1587. return wmi_handle->ops->send_lphb_config_hbenable_cmd(wmi_handle,
  1588. params);
  1589. return QDF_STATUS_E_FAILURE;
  1590. }
  1591. /**
  1592. * wmi_unified_lphb_config_tcp_params_cmd() - set tcp params of LPHB configuration requests
  1593. * @wmi_handle: wmi handle
  1594. * @lphb_conf_req: lphb config request
  1595. *
  1596. * Return: CDF status
  1597. */
  1598. QDF_STATUS wmi_unified_lphb_config_tcp_params_cmd(void *wmi_hdl,
  1599. wmi_hb_set_tcp_params_cmd_fixed_param *lphb_conf_req)
  1600. {
  1601. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1602. if (wmi_handle->ops->send_lphb_config_tcp_params_cmd)
  1603. return wmi_handle->ops->send_lphb_config_tcp_params_cmd(wmi_handle,
  1604. lphb_conf_req);
  1605. return QDF_STATUS_E_FAILURE;
  1606. }
  1607. /**
  1608. * wmi_unified_lphb_config_tcp_pkt_filter_cmd() - configure tcp packet filter command of LPHB
  1609. * @wmi_handle: wmi handle
  1610. * @lphb_conf_req: lphb config request
  1611. *
  1612. * Return: CDF status
  1613. */
  1614. QDF_STATUS wmi_unified_lphb_config_tcp_pkt_filter_cmd(void *wmi_hdl,
  1615. wmi_hb_set_tcp_pkt_filter_cmd_fixed_param *g_hb_tcp_filter_fp)
  1616. {
  1617. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1618. if (wmi_handle->ops->send_lphb_config_tcp_pkt_filter_cmd)
  1619. return wmi_handle->ops->send_lphb_config_tcp_pkt_filter_cmd(wmi_handle,
  1620. g_hb_tcp_filter_fp);
  1621. return QDF_STATUS_E_FAILURE;
  1622. }
  1623. /**
  1624. * wmi_unified_lphb_config_udp_params_cmd() - configure udp param command of LPHB
  1625. * @wmi_handle: wmi handle
  1626. * @lphb_conf_req: lphb config request
  1627. *
  1628. * Return: CDF status
  1629. */
  1630. QDF_STATUS wmi_unified_lphb_config_udp_params_cmd(void *wmi_hdl,
  1631. wmi_hb_set_udp_params_cmd_fixed_param *lphb_conf_req)
  1632. {
  1633. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1634. if (wmi_handle->ops->send_lphb_config_udp_params_cmd)
  1635. return wmi_handle->ops->send_lphb_config_udp_params_cmd(wmi_handle,
  1636. lphb_conf_req);
  1637. return QDF_STATUS_E_FAILURE;
  1638. }
  1639. /**
  1640. * wmi_unified_lphb_config_udp_pkt_filter_cmd() - configure udp pkt filter command of LPHB
  1641. * @wmi_handle: wmi handle
  1642. * @lphb_conf_req: lphb config request
  1643. *
  1644. * Return: CDF status
  1645. */
  1646. QDF_STATUS wmi_unified_lphb_config_udp_pkt_filter_cmd(void *wmi_hdl,
  1647. wmi_hb_set_udp_pkt_filter_cmd_fixed_param *lphb_conf_req)
  1648. {
  1649. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1650. if (wmi_handle->ops->send_lphb_config_udp_pkt_filter_cmd)
  1651. return wmi_handle->ops->send_lphb_config_udp_pkt_filter_cmd(wmi_handle,
  1652. lphb_conf_req);
  1653. return QDF_STATUS_E_FAILURE;
  1654. }
  1655. #endif /* FEATURE_WLAN_LPHB */
  1656. /**
  1657. * wmi_unified_process_dhcp_ind() - process dhcp indication from SME
  1658. * @wmi_handle: wmi handle
  1659. * @ta_dhcp_ind: DHCP indication parameter
  1660. *
  1661. * Return: CDF Status
  1662. */
  1663. QDF_STATUS wmi_unified_process_dhcp_ind(void *wmi_hdl,
  1664. wmi_peer_set_param_cmd_fixed_param *ta_dhcp_ind)
  1665. {
  1666. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1667. if (wmi_handle->ops->send_process_dhcp_ind_cmd)
  1668. return wmi_handle->ops->send_process_dhcp_ind_cmd(wmi_handle,
  1669. ta_dhcp_ind);
  1670. return QDF_STATUS_E_FAILURE;
  1671. }
  1672. /**
  1673. * wmi_unified_get_link_speed_cmd() -send command to get linkspeed
  1674. * @wmi_handle: wmi handle
  1675. * @pLinkSpeed: link speed info
  1676. *
  1677. * Return: CDF status
  1678. */
  1679. QDF_STATUS wmi_unified_get_link_speed_cmd(void *wmi_hdl,
  1680. wmi_mac_addr peer_macaddr)
  1681. {
  1682. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1683. if (wmi_handle->ops->send_get_link_speed_cmd)
  1684. return wmi_handle->ops->send_get_link_speed_cmd(wmi_handle,
  1685. peer_macaddr);
  1686. return QDF_STATUS_E_FAILURE;
  1687. }
  1688. /**
  1689. * wmi_unified_egap_conf_params_cmd() - send wmi cmd of egap configuration params
  1690. * @wmi_handle: wmi handler
  1691. * @egap_params: pointer to egap_params
  1692. *
  1693. * Return: 0 for success, otherwise appropriate error code
  1694. */
  1695. QDF_STATUS wmi_unified_egap_conf_params_cmd(void *wmi_hdl,
  1696. wmi_ap_ps_egap_param_cmd_fixed_param *egap_params)
  1697. {
  1698. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1699. if (wmi_handle->ops->send_egap_conf_params_cmd)
  1700. return wmi_handle->ops->send_egap_conf_params_cmd(wmi_handle,
  1701. egap_params);
  1702. return QDF_STATUS_E_FAILURE;
  1703. }
  1704. /**
  1705. * wmi_unified_fw_profiling_data_cmd() - send FW profiling cmd to WLAN FW
  1706. * @wmi_handl: wmi handle
  1707. * @cmd: Profiling command index
  1708. * @value1: parameter1 value
  1709. * @value2: parameter2 value
  1710. *
  1711. * Return: 0 for success else error code
  1712. */
  1713. QDF_STATUS wmi_unified_fw_profiling_data_cmd(void *wmi_hdl,
  1714. uint32_t cmd, uint32_t value1, uint32_t value2)
  1715. {
  1716. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1717. if (wmi_handle->ops->send_fw_profiling_cmd)
  1718. return wmi_handle->ops->send_fw_profiling_cmd(wmi_handle,
  1719. cmd, value1, value2);
  1720. return QDF_STATUS_E_FAILURE;
  1721. }
  1722. #ifdef FEATURE_WLAN_RA_FILTERING
  1723. /**
  1724. * wmi_unified_wow_sta_ra_filter_cmd() - set RA filter pattern in fw
  1725. * @wmi_handle: wmi handle
  1726. * @vdev_id: vdev id
  1727. *
  1728. * Return: CDF status
  1729. */
  1730. QDF_STATUS wmi_unified_wow_sta_ra_filter_cmd(void *wmi_hdl,
  1731. uint8_t vdev_id, uint8_t default_pattern,
  1732. uint16_t rate_limit_interval)
  1733. {
  1734. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1735. if (wmi_handle->ops->send_wow_sta_ra_filter_cmd)
  1736. return wmi_handle->ops->send_wow_sta_ra_filter_cmd(wmi_handle,
  1737. vdev_id, default_pattern, default_pattern);
  1738. return QDF_STATUS_E_FAILURE;
  1739. }
  1740. #endif /* FEATURE_WLAN_RA_FILTERING */
  1741. /**
  1742. * wmi_unified_nat_keepalive_en_cmd() - enable NAT keepalive filter
  1743. * @wmi_handle: wmi handle
  1744. * @vdev_id: vdev id
  1745. *
  1746. * Return: 0 for success or error code
  1747. */
  1748. QDF_STATUS wmi_unified_nat_keepalive_en_cmd(void *wmi_hdl, uint8_t vdev_id)
  1749. {
  1750. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1751. if (wmi_handle->ops->send_nat_keepalive_en_cmd)
  1752. return wmi_handle->ops->send_nat_keepalive_en_cmd(wmi_handle,
  1753. vdev_id);
  1754. return QDF_STATUS_E_FAILURE;
  1755. }
  1756. /**
  1757. * wmi_unified_csa_offload_enable() - send CSA offload enable command
  1758. * @wmi_hdl: wmi handle
  1759. * @vdev_id: vdev id
  1760. *
  1761. * Return: 0 for success or error code
  1762. */
  1763. QDF_STATUS wmi_unified_csa_offload_enable(void *wmi_hdl, uint8_t vdev_id)
  1764. {
  1765. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1766. if (wmi_handle->ops->send_csa_offload_enable_cmd)
  1767. return wmi_handle->ops->send_csa_offload_enable_cmd(wmi_handle,
  1768. vdev_id);
  1769. return QDF_STATUS_E_FAILURE;
  1770. }
  1771. /**
  1772. * wmi_unified_start_oem_data_cmd() - start OEM data request to target
  1773. * @wmi_handle: wmi handle
  1774. * @startOemDataReq: start request params
  1775. *
  1776. * Return: CDF status
  1777. */
  1778. QDF_STATUS wmi_unified_start_oem_data_cmd(void *wmi_hdl,
  1779. uint8_t data_len,
  1780. uint8_t *data)
  1781. {
  1782. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1783. if (wmi_handle->ops->send_start_oem_data_cmd)
  1784. return wmi_handle->ops->send_start_oem_data_cmd(wmi_handle,
  1785. data_len, data);
  1786. return QDF_STATUS_E_FAILURE;
  1787. }
  1788. /**
  1789. * wmi_unified_dfs_phyerr_filter_offload_en_cmd() - enable dfs phyerr filter
  1790. * @wmi_handle: wmi handle
  1791. * @dfs_phyerr_filter_offload: is dfs phyerr filter offload
  1792. *
  1793. * Send WMI_DFS_PHYERR_FILTER_ENA_CMDID or
  1794. * WMI_DFS_PHYERR_FILTER_DIS_CMDID command
  1795. * to firmware based on phyerr filtering
  1796. * offload status.
  1797. *
  1798. * Return: 1 success, 0 failure
  1799. */
  1800. QDF_STATUS
  1801. wmi_unified_dfs_phyerr_filter_offload_en_cmd(void *wmi_hdl,
  1802. bool dfs_phyerr_filter_offload)
  1803. {
  1804. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1805. if (wmi_handle->ops->send_dfs_phyerr_filter_offload_en_cmd)
  1806. return wmi_handle->ops->send_dfs_phyerr_filter_offload_en_cmd(wmi_handle,
  1807. dfs_phyerr_filter_offload);
  1808. return QDF_STATUS_E_FAILURE;
  1809. }
  1810. #if !defined(REMOVE_PKT_LOG)
  1811. /**
  1812. * wmi_unified_pktlog_wmi_send_cmd() - send pktlog enable/disable command to target
  1813. * @wmi_handle: wmi handle
  1814. * @pktlog_event: pktlog event
  1815. * @cmd_id: pktlog cmd id
  1816. *
  1817. * Return: CDF status
  1818. */
  1819. QDF_STATUS wmi_unified_pktlog_wmi_send_cmd(void *wmi_hdl,
  1820. WMI_PKTLOG_EVENT pktlog_event,
  1821. WMI_CMD_ID cmd_id)
  1822. {
  1823. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1824. if (wmi_handle->ops->send_pktlog_wmi_send_cmd)
  1825. return wmi_handle->ops->send_pktlog_wmi_send_cmd(wmi_handle,
  1826. pktlog_event, pktlog_event);
  1827. return QDF_STATUS_E_FAILURE;
  1828. }
  1829. #endif /* REMOVE_PKT_LOG */
  1830. /**
  1831. * wmi_unified_add_wow_wakeup_event_cmd() - Configures wow wakeup events.
  1832. * @wmi_handle: wmi handle
  1833. * @vdev_id: vdev id
  1834. * @bitmap: Event bitmap
  1835. * @enable: enable/disable
  1836. *
  1837. * Return: CDF status
  1838. */
  1839. QDF_STATUS wmi_unified_add_wow_wakeup_event_cmd(void *wmi_hdl,
  1840. uint32_t vdev_id,
  1841. uint32_t bitmap,
  1842. bool enable)
  1843. {
  1844. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1845. if (wmi_handle->ops->send_add_wow_wakeup_event_cmd)
  1846. return wmi_handle->ops->send_add_wow_wakeup_event_cmd(wmi_handle,
  1847. vdev_id, vdev_id, vdev_id);
  1848. return QDF_STATUS_E_FAILURE;
  1849. }
  1850. /**
  1851. * wmi_unified_wow_patterns_to_fw_cmd() - Sends WOW patterns to FW.
  1852. * @wmi_handle: wmi handle
  1853. * @vdev_id: vdev id
  1854. * @ptrn_id: pattern id
  1855. * @ptrn: pattern
  1856. * @ptrn_len: pattern length
  1857. * @ptrn_offset: pattern offset
  1858. * @mask: mask
  1859. * @mask_len: mask length
  1860. * @user: true for user configured pattern and false for default pattern
  1861. * @default_patterns: default patterns
  1862. *
  1863. * Return: CDF status
  1864. */
  1865. QDF_STATUS wmi_unified_wow_patterns_to_fw_cmd(void *wmi_hdl,
  1866. uint8_t vdev_id, uint8_t ptrn_id,
  1867. const uint8_t *ptrn, uint8_t ptrn_len,
  1868. uint8_t ptrn_offset, const uint8_t *mask,
  1869. uint8_t mask_len, bool user,
  1870. uint8_t default_patterns)
  1871. {
  1872. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1873. if (wmi_handle->ops->send_wow_patterns_to_fw_cmd)
  1874. return wmi_handle->ops->send_wow_patterns_to_fw_cmd(wmi_handle,
  1875. vdev_id, ptrn_id, ptrn,
  1876. ptrn_len, ptrn_offset, mask,
  1877. mask_len, user, default_patterns);
  1878. return QDF_STATUS_E_FAILURE;
  1879. }
  1880. /**
  1881. * wmi_unified_wow_delete_pattern_cmd() - delete wow pattern in target
  1882. * @wmi_handle: wmi handle
  1883. * @ptrn_id: pattern id
  1884. * @vdev_id: vdev id
  1885. *
  1886. * Return: CDF status
  1887. */
  1888. QDF_STATUS wmi_unified_wow_delete_pattern_cmd(void *wmi_hdl, uint8_t ptrn_id,
  1889. uint8_t vdev_id)
  1890. {
  1891. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1892. if (wmi_handle->ops->send_wow_delete_pattern_cmd)
  1893. return wmi_handle->ops->send_wow_delete_pattern_cmd(wmi_handle,
  1894. ptrn_id, vdev_id);
  1895. return QDF_STATUS_E_FAILURE;
  1896. }
  1897. /**
  1898. * wmi_unified_host_wakeup_ind_to_fw_cmd() - send wakeup ind to fw
  1899. * @wmi_handle: wmi handle
  1900. *
  1901. * Sends host wakeup indication to FW. On receiving this indication,
  1902. * FW will come out of WOW.
  1903. *
  1904. * Return: CDF status
  1905. */
  1906. QDF_STATUS wmi_unified_host_wakeup_ind_to_fw_cmd(void *wmi_hdl)
  1907. {
  1908. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1909. if (wmi_handle->ops->send_host_wakeup_ind_to_fw_cmd)
  1910. return wmi_handle->ops->send_host_wakeup_ind_to_fw_cmd(wmi_handle);
  1911. return QDF_STATUS_E_FAILURE;
  1912. }
  1913. /**
  1914. * wmi_unified_del_ts_cmd() - send DELTS request to fw
  1915. * @wmi_handle: wmi handle
  1916. * @msg: delts params
  1917. *
  1918. * Return: CDF status
  1919. */
  1920. QDF_STATUS wmi_unified_del_ts_cmd(void *wmi_hdl, uint8_t vdev_id,
  1921. uint8_t ac)
  1922. {
  1923. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1924. if (wmi_handle->ops->send_del_ts_cmd)
  1925. return wmi_handle->ops->send_del_ts_cmd(wmi_handle,
  1926. vdev_id, ac);
  1927. return QDF_STATUS_E_FAILURE;
  1928. }
  1929. /**
  1930. * wmi_unified_aggr_qos_cmd() - send aggr qos request to fw
  1931. * @wmi_handle: handle to wmi
  1932. * @aggr_qos_rsp_msg - combined struct for all ADD_TS requests.
  1933. *
  1934. * A function to handle WMI_AGGR_QOS_REQ. This will send out
  1935. * ADD_TS requestes to firmware in loop for all the ACs with
  1936. * active flow.
  1937. *
  1938. * Return: CDF status
  1939. */
  1940. QDF_STATUS wmi_unified_aggr_qos_cmd(void *wmi_hdl,
  1941. struct aggr_add_ts_param *aggr_qos_rsp_msg)
  1942. {
  1943. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1944. if (wmi_handle->ops->send_aggr_qos_cmd)
  1945. return wmi_handle->ops->send_aggr_qos_cmd(wmi_handle,
  1946. aggr_qos_rsp_msg);
  1947. return QDF_STATUS_E_FAILURE;
  1948. }
  1949. /**
  1950. * wmi_unified_add_ts_cmd() - send ADDTS request to fw
  1951. * @wmi_handle: wmi handle
  1952. * @msg: ADDTS params
  1953. *
  1954. * Return: CDF status
  1955. */
  1956. QDF_STATUS wmi_unified_add_ts_cmd(void *wmi_hdl,
  1957. struct add_ts_param *msg)
  1958. {
  1959. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1960. if (wmi_handle->ops->send_add_ts_cmd)
  1961. return wmi_handle->ops->send_add_ts_cmd(wmi_handle,
  1962. msg);
  1963. return QDF_STATUS_E_FAILURE;
  1964. }
  1965. /**
  1966. * wmi_unified_enable_disable_packet_filter_cmd() - enable/disable packet filter in target
  1967. * @wmi_handle: wmi handle
  1968. * @vdev_id: vdev id
  1969. * @enable: Flag to enable/disable packet filter
  1970. *
  1971. * Return: 0 for success or error code
  1972. */
  1973. QDF_STATUS wmi_unified_enable_disable_packet_filter_cmd(void *wmi_hdl,
  1974. uint8_t vdev_id, bool enable)
  1975. {
  1976. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1977. if (wmi_handle->ops->send_enable_disable_packet_filter_cmd)
  1978. return wmi_handle->ops->send_enable_disable_packet_filter_cmd(wmi_handle,
  1979. vdev_id, vdev_id);
  1980. return QDF_STATUS_E_FAILURE;
  1981. }
  1982. /**
  1983. * wmi_unified_config_packet_filter_cmd() - configure packet filter in target
  1984. * @wmi_handle: wmi handle
  1985. * @vdev_id: vdev id
  1986. * @rcv_filter_param: Packet filter parameters
  1987. * @filter_id: Filter id
  1988. * @enable: Flag to add/delete packet filter configuration
  1989. *
  1990. * Return: 0 for success or error code
  1991. */
  1992. QDF_STATUS wmi_unified_config_packet_filter_cmd(void *wmi_hdl,
  1993. uint8_t vdev_id, struct rcv_pkt_filter_config *rcv_filter_param,
  1994. uint8_t filter_id, bool enable)
  1995. {
  1996. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1997. if (wmi_handle->ops->send_config_packet_filter_cmd)
  1998. return wmi_handle->ops->send_config_packet_filter_cmd(wmi_handle,
  1999. vdev_id, rcv_filter_param,
  2000. filter_id, enable);
  2001. return QDF_STATUS_E_FAILURE;
  2002. }
  2003. /**
  2004. * wmi_unified_add_clear_mcbc_filter_cmd() - set mcast filter command to fw
  2005. * @wmi_handle: wmi handle
  2006. * @vdev_id: vdev id
  2007. * @multicastAddr: mcast address
  2008. * @clearList: clear list flag
  2009. *
  2010. * Return: 0 for success or error code
  2011. */
  2012. QDF_STATUS wmi_unified_add_clear_mcbc_filter_cmd(void *wmi_hdl,
  2013. uint8_t vdev_id,
  2014. struct qdf_mac_addr multicast_addr,
  2015. bool clearList)
  2016. {
  2017. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2018. if (wmi_handle->ops->send_add_clear_mcbc_filter_cmd)
  2019. return wmi_handle->ops->send_add_clear_mcbc_filter_cmd(wmi_handle,
  2020. vdev_id, multicast_addr, clearList);
  2021. return QDF_STATUS_E_FAILURE;
  2022. }
  2023. /**
  2024. * wmi_unified_send_gtk_offload_cmd() - send GTK offload command to fw
  2025. * @wmi_handle: wmi handle
  2026. * @vdev_id: vdev id
  2027. * @params: GTK offload parameters
  2028. *
  2029. * Return: CDF status
  2030. */
  2031. QDF_STATUS wmi_unified_send_gtk_offload_cmd(void *wmi_hdl, uint8_t vdev_id,
  2032. struct gtk_offload_params *params,
  2033. bool enable_offload,
  2034. uint32_t gtk_offload_opcode)
  2035. {
  2036. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2037. if (wmi_handle->ops->send_gtk_offload_cmd)
  2038. return wmi_handle->ops->send_gtk_offload_cmd(wmi_handle,
  2039. vdev_id, params,
  2040. enable_offload, gtk_offload_opcode);
  2041. return QDF_STATUS_E_FAILURE;
  2042. }
  2043. /**
  2044. * wmi_unified_process_gtk_offload_getinfo_cmd() - send GTK offload cmd to fw
  2045. * @wmi_handle: wmi handle
  2046. * @params: GTK offload params
  2047. *
  2048. * Return: CDF status
  2049. */
  2050. QDF_STATUS wmi_unified_process_gtk_offload_getinfo_cmd(void *wmi_hdl,
  2051. uint8_t vdev_id,
  2052. uint64_t offload_req_opcode)
  2053. {
  2054. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2055. if (wmi_handle->ops->send_process_gtk_offload_getinfo_cmd)
  2056. return wmi_handle->ops->send_process_gtk_offload_getinfo_cmd(wmi_handle,
  2057. vdev_id,
  2058. offload_req_opcode);
  2059. return QDF_STATUS_E_FAILURE;
  2060. }
  2061. /**
  2062. * wmi_unified_process_add_periodic_tx_ptrn_cmd - add periodic tx ptrn
  2063. * @wmi_handle: wmi handle
  2064. * @pAddPeriodicTxPtrnParams: tx ptrn params
  2065. *
  2066. * Retrun: CDF status
  2067. */
  2068. QDF_STATUS wmi_unified_process_add_periodic_tx_ptrn_cmd(void *wmi_hdl,
  2069. struct periodic_tx_pattern *
  2070. pAddPeriodicTxPtrnParams,
  2071. uint8_t vdev_id)
  2072. {
  2073. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2074. if (wmi_handle->ops->send_process_add_periodic_tx_ptrn_cmd)
  2075. return wmi_handle->ops->send_process_add_periodic_tx_ptrn_cmd(wmi_handle,
  2076. pAddPeriodicTxPtrnParams,
  2077. vdev_id);
  2078. return QDF_STATUS_E_FAILURE;
  2079. }
  2080. /**
  2081. * wmi_unified_process_del_periodic_tx_ptrn_cmd - del periodic tx ptrn
  2082. * @wmi_handle: wmi handle
  2083. * @vdev_id: vdev id
  2084. * @pattern_id: pattern id
  2085. *
  2086. * Retrun: CDF status
  2087. */
  2088. QDF_STATUS wmi_unified_process_del_periodic_tx_ptrn_cmd(void *wmi_hdl,
  2089. uint8_t vdev_id,
  2090. uint8_t pattern_id)
  2091. {
  2092. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2093. if (wmi_handle->ops->send_process_del_periodic_tx_ptrn_cmd)
  2094. return wmi_handle->ops->send_process_del_periodic_tx_ptrn_cmd(wmi_handle,
  2095. vdev_id,
  2096. pattern_id);
  2097. return QDF_STATUS_E_FAILURE;
  2098. }
  2099. /**
  2100. * wmi_unified_stats_ext_req_cmd() - request ext stats from fw
  2101. * @wmi_handle: wmi handle
  2102. * @preq: stats ext params
  2103. *
  2104. * Return: CDF status
  2105. */
  2106. QDF_STATUS wmi_unified_stats_ext_req_cmd(void *wmi_hdl,
  2107. struct stats_ext_params *preq)
  2108. {
  2109. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2110. if (wmi_handle->ops->send_stats_ext_req_cmd)
  2111. return wmi_handle->ops->send_stats_ext_req_cmd(wmi_handle,
  2112. preq);
  2113. return QDF_STATUS_E_FAILURE;
  2114. }
  2115. /**
  2116. * wmi_unified_enable_ext_wow_cmd() - enable ext wow in fw
  2117. * @wmi_handle: wmi handle
  2118. * @params: ext wow params
  2119. *
  2120. * Return:0 for success or error code
  2121. */
  2122. QDF_STATUS wmi_unified_enable_ext_wow_cmd(void *wmi_hdl,
  2123. struct ext_wow_params *params)
  2124. {
  2125. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2126. if (wmi_handle->ops->send_enable_ext_wow_cmd)
  2127. return wmi_handle->ops->send_enable_ext_wow_cmd(wmi_handle,
  2128. params);
  2129. return QDF_STATUS_E_FAILURE;
  2130. }
  2131. /**
  2132. * wmi_unified_set_app_type2_params_in_fw_cmd() - set app type2 params in fw
  2133. * @wmi_handle: wmi handle
  2134. * @appType2Params: app type2 params
  2135. *
  2136. * Return: CDF status
  2137. */
  2138. QDF_STATUS wmi_unified_set_app_type2_params_in_fw_cmd(void *wmi_hdl,
  2139. struct app_type2_params *appType2Params)
  2140. {
  2141. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2142. if (wmi_handle->ops->send_set_app_type2_params_in_fw_cmd)
  2143. return wmi_handle->ops->send_set_app_type2_params_in_fw_cmd(wmi_handle,
  2144. appType2Params);
  2145. return QDF_STATUS_E_FAILURE;
  2146. }
  2147. /**
  2148. * wmi_unified_set_auto_shutdown_timer_cmd() - sets auto shutdown timer in firmware
  2149. * @wmi_handle: wmi handle
  2150. * @timer_val: auto shutdown timer value
  2151. *
  2152. * Return: CDF status
  2153. */
  2154. QDF_STATUS wmi_unified_set_auto_shutdown_timer_cmd(void *wmi_hdl,
  2155. uint32_t timer_val)
  2156. {
  2157. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2158. if (wmi_handle->ops->send_set_auto_shutdown_timer_cmd)
  2159. return wmi_handle->ops->send_set_auto_shutdown_timer_cmd(wmi_handle,
  2160. timer_val);
  2161. return QDF_STATUS_E_FAILURE;
  2162. }
  2163. /**
  2164. * wmi_unified_nan_req_cmd() - to send nan request to target
  2165. * @wmi_handle: wmi handle
  2166. * @nan_req: request data which will be non-null
  2167. *
  2168. * Return: CDF status
  2169. */
  2170. QDF_STATUS wmi_unified_nan_req_cmd(void *wmi_hdl,
  2171. struct nan_req_params *nan_req)
  2172. {
  2173. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2174. if (wmi_handle->ops->send_nan_req_cmd)
  2175. return wmi_handle->ops->send_nan_req_cmd(wmi_handle,
  2176. nan_req);
  2177. return QDF_STATUS_E_FAILURE;
  2178. }
  2179. /**
  2180. * wmi_unified_process_dhcpserver_offload_cmd() - enable DHCP server offload
  2181. * @wmi_handle: wmi handle
  2182. * @pDhcpSrvOffloadInfo: DHCP server offload info
  2183. *
  2184. * Return: 0 for success or error code
  2185. */
  2186. QDF_STATUS wmi_unified_process_dhcpserver_offload_cmd(void *wmi_hdl,
  2187. struct dhcp_offload_info_params *pDhcpSrvOffloadInfo)
  2188. {
  2189. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2190. if (wmi_handle->ops->send_process_dhcpserver_offload_cmd)
  2191. return wmi_handle->ops->send_process_dhcpserver_offload_cmd(wmi_handle,
  2192. pDhcpSrvOffloadInfo);
  2193. return QDF_STATUS_E_FAILURE;
  2194. }
  2195. /**
  2196. * wmi_unified_process_ch_avoid_update_cmd() - handles channel avoid update request
  2197. * @wmi_handle: wmi handle
  2198. * @ch_avoid_update_req: channel avoid update params
  2199. *
  2200. * Return: CDF status
  2201. */
  2202. QDF_STATUS wmi_unified_process_ch_avoid_update_cmd(void *wmi_hdl)
  2203. {
  2204. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2205. if (wmi_handle->ops->send_process_ch_avoid_update_cmd)
  2206. return wmi_handle->ops->send_process_ch_avoid_update_cmd(wmi_handle);
  2207. return QDF_STATUS_E_FAILURE;
  2208. }
  2209. /**
  2210. * wmi_unified_send_regdomain_info_to_fw_cmd() - send regdomain info to fw
  2211. * @wmi_handle: wmi handle
  2212. * @reg_dmn: reg domain
  2213. * @regdmn2G: 2G reg domain
  2214. * @regdmn5G: 5G reg domain
  2215. * @ctl2G: 2G test limit
  2216. * @ctl5G: 5G test limit
  2217. *
  2218. * Return: none
  2219. */
  2220. QDF_STATUS wmi_unified_send_regdomain_info_to_fw_cmd(void *wmi_hdl,
  2221. uint32_t reg_dmn, uint16_t regdmn2G,
  2222. uint16_t regdmn5G, int8_t ctl2G,
  2223. int8_t ctl5G)
  2224. {
  2225. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2226. if (wmi_handle->ops->send_regdomain_info_to_fw_cmd)
  2227. return wmi_handle->ops->send_regdomain_info_to_fw_cmd(wmi_handle,
  2228. reg_dmn, regdmn2G,
  2229. regdmn5G, ctl2G,
  2230. ctl5G);
  2231. return QDF_STATUS_E_FAILURE;
  2232. }
  2233. /**
  2234. * wmi_unified_set_tdls_offchan_mode_cmd() - set tdls off channel mode
  2235. * @wmi_handle: wmi handle
  2236. * @chan_switch_params: Pointer to tdls channel switch parameter structure
  2237. *
  2238. * This function sets tdls off channel mode
  2239. *
  2240. * Return: 0 on success; Negative errno otherwise
  2241. */
  2242. QDF_STATUS wmi_unified_set_tdls_offchan_mode_cmd(void *wmi_hdl,
  2243. struct tdls_channel_switch_params *chan_switch_params)
  2244. {
  2245. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2246. if (wmi_handle->ops->send_set_tdls_offchan_mode_cmd)
  2247. return wmi_handle->ops->send_set_tdls_offchan_mode_cmd(wmi_handle,
  2248. chan_switch_params);
  2249. return QDF_STATUS_E_FAILURE;
  2250. }
  2251. /**
  2252. * wmi_unified_update_fw_tdls_state_cmd() - send enable/disable tdls for a vdev
  2253. * @wmi_handle: wmi handle
  2254. * @pwmaTdlsparams: TDLS params
  2255. *
  2256. * Return: 0 for sucess or error code
  2257. */
  2258. QDF_STATUS wmi_unified_update_fw_tdls_state_cmd(void *wmi_hdl,
  2259. void *tdls_param, uint8_t tdls_state)
  2260. {
  2261. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2262. if (wmi_handle->ops->send_update_fw_tdls_state_cmd)
  2263. return wmi_handle->ops->send_update_fw_tdls_state_cmd(wmi_handle,
  2264. tdls_param, tdls_state);
  2265. return QDF_STATUS_E_FAILURE;
  2266. }
  2267. /**
  2268. * wmi_unified_update_tdls_peer_state_cmd() - update TDLS peer state
  2269. * @wmi_handle: wmi handle
  2270. * @peerStateParams: TDLS peer state params
  2271. *
  2272. * Return: 0 for success or error code
  2273. */
  2274. QDF_STATUS wmi_unified_update_tdls_peer_state_cmd(void *wmi_hdl,
  2275. struct tdls_peer_state_params *peerStateParams,
  2276. uint32_t *ch_mhz)
  2277. {
  2278. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2279. if (wmi_handle->ops->send_update_tdls_peer_state_cmd)
  2280. return wmi_handle->ops->send_update_tdls_peer_state_cmd(wmi_handle,
  2281. peerStateParams, ch_mhz);
  2282. return QDF_STATUS_E_FAILURE;
  2283. }
  2284. /**
  2285. * wmi_unified_process_fw_mem_dump_cmd() - Function to request fw memory dump from
  2286. * firmware
  2287. * @wmi_handle: Pointer to wmi handle
  2288. * @mem_dump_req: Pointer for mem_dump_req
  2289. *
  2290. * This function sends memory dump request to firmware
  2291. *
  2292. * Return: QDF_STATUS_SUCCESS for success otherwise failure
  2293. *
  2294. */
  2295. QDF_STATUS wmi_unified_process_fw_mem_dump_cmd(void *wmi_hdl,
  2296. struct fw_dump_req_param *mem_dump_req)
  2297. {
  2298. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2299. if (wmi_handle->ops->send_process_fw_mem_dump_cmd)
  2300. return wmi_handle->ops->send_process_fw_mem_dump_cmd(wmi_handle,
  2301. mem_dump_req);
  2302. return QDF_STATUS_E_FAILURE;
  2303. }
  2304. /**
  2305. * wmi_unified_process_set_ie_info_cmd() - Function to send IE info to firmware
  2306. * @wmi_handle: Pointer to WMi handle
  2307. * @ie_data: Pointer for ie data
  2308. *
  2309. * This function sends IE information to firmware
  2310. *
  2311. * Return: QDF_STATUS_SUCCESS for success otherwise failure
  2312. *
  2313. */
  2314. QDF_STATUS wmi_unified_process_set_ie_info_cmd(void *wmi_hdl,
  2315. struct vdev_ie_info_param *ie_info)
  2316. {
  2317. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2318. if (wmi_handle->ops->send_process_set_ie_info_cmd)
  2319. return wmi_handle->ops->send_process_set_ie_info_cmd(wmi_handle,
  2320. ie_info);
  2321. return QDF_STATUS_E_FAILURE;
  2322. }
  2323. /**
  2324. * wmi_unified_send_init_cmd() - wmi init command
  2325. * @wmi_handle: pointer to wmi handle
  2326. * @res_cfg: resource config
  2327. * @num_mem_chunks: no of mem chunck
  2328. * @mem_chunk: pointer to mem chunck structure
  2329. *
  2330. * This function sends IE information to firmware
  2331. *
  2332. * Return: QDF_STATUS_SUCCESS for success otherwise failure
  2333. *
  2334. */
  2335. QDF_STATUS wmi_unified_send_init_cmd(void *wmi_hdl,
  2336. wmi_resource_config *res_cfg,
  2337. uint8_t num_mem_chunks, struct wmi_host_mem_chunk *mem_chunk,
  2338. bool action)
  2339. {
  2340. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2341. if (wmi_handle->ops->send_init_cmd)
  2342. return wmi_handle->ops->send_init_cmd(wmi_handle,
  2343. res_cfg, num_mem_chunks, mem_chunk, action);
  2344. return QDF_STATUS_E_FAILURE;
  2345. }
  2346. /**
  2347. * wmi_unified_send_saved_init_cmd() - wmi init command
  2348. * @wmi_handle: pointer to wmi handle
  2349. *
  2350. * This function sends IE information to firmware
  2351. *
  2352. * Return: QDF_STATUS_SUCCESS for success otherwise failure
  2353. *
  2354. */
  2355. QDF_STATUS wmi_unified_send_saved_init_cmd(void *wmi_hdl)
  2356. {
  2357. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2358. if (wmi_handle->ops->send_saved_init_cmd)
  2359. return wmi_handle->ops->send_saved_init_cmd(wmi_handle);
  2360. return QDF_STATUS_E_FAILURE;
  2361. }
  2362. /**
  2363. * wmi_unified_save_fw_version_cmd() - save fw version
  2364. * @wmi_handle: pointer to wmi handle
  2365. * @res_cfg: resource config
  2366. * @num_mem_chunks: no of mem chunck
  2367. * @mem_chunk: pointer to mem chunck structure
  2368. *
  2369. * This function sends IE information to firmware
  2370. *
  2371. * Return: QDF_STATUS_SUCCESS for success otherwise failure
  2372. *
  2373. */
  2374. QDF_STATUS wmi_unified_save_fw_version_cmd(void *wmi_hdl,
  2375. void *evt_buf)
  2376. {
  2377. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2378. if (wmi_handle->ops->save_fw_version_cmd)
  2379. return wmi_handle->ops->save_fw_version_cmd(wmi_handle,
  2380. evt_buf);
  2381. return QDF_STATUS_E_FAILURE;
  2382. }
  2383. /**
  2384. * send_set_base_macaddr_indicate_cmd() - set base mac address in fw
  2385. * @wmi_hdl: wmi handle
  2386. * @custom_addr: base mac address
  2387. *
  2388. * Return: 0 for success or error code
  2389. */
  2390. QDF_STATUS wmi_unified_set_base_macaddr_indicate_cmd(void *wmi_hdl,
  2391. uint8_t *custom_addr)
  2392. {
  2393. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2394. if (wmi_handle->ops->send_set_base_macaddr_indicate_cmd)
  2395. return wmi_handle->ops->send_set_base_macaddr_indicate_cmd(wmi_handle,
  2396. custom_addr);
  2397. return QDF_STATUS_E_FAILURE;
  2398. }
  2399. /**
  2400. * wmi_unified_log_supported_evt_cmd() - Enable/Disable FW diag/log events
  2401. * @wmi_hdl: wmi handle
  2402. * @event: Event received from FW
  2403. * @len: Length of the event
  2404. *
  2405. * Enables the low frequency events and disables the high frequency
  2406. * events. Bit 17 indicates if the event if low/high frequency.
  2407. * 1 - high frequency, 0 - low frequency
  2408. *
  2409. * Return: 0 on successfully enabling/disabling the events
  2410. */
  2411. QDF_STATUS wmi_unified_log_supported_evt_cmd(void *wmi_hdl,
  2412. uint8_t *event,
  2413. uint32_t len)
  2414. {
  2415. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2416. if (wmi_handle->ops->send_log_supported_evt_cmd)
  2417. return wmi_handle->ops->send_log_supported_evt_cmd(wmi_handle,
  2418. event, len);
  2419. return QDF_STATUS_E_FAILURE;
  2420. }
  2421. /**
  2422. * wmi_unified_enable_specific_fw_logs_cmd() - Start/Stop logging of diag log id
  2423. * @wmi_hdl: wmi handle
  2424. * @start_log: Start logging related parameters
  2425. *
  2426. * Send the command to the FW based on which specific logging of diag
  2427. * event/log id can be started/stopped
  2428. *
  2429. * Return: None
  2430. */
  2431. QDF_STATUS wmi_unified_enable_specific_fw_logs_cmd(void *wmi_hdl,
  2432. struct wmi_wifi_start_log *start_log)
  2433. {
  2434. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2435. if (wmi_handle->ops->send_enable_specific_fw_logs_cmd)
  2436. return wmi_handle->ops->send_enable_specific_fw_logs_cmd(wmi_handle,
  2437. start_log);
  2438. return QDF_STATUS_E_FAILURE;
  2439. }
  2440. /**
  2441. * wmi_unified_flush_logs_to_fw_cmd() - Send log flush command to FW
  2442. * @wmi_hdl: WMI handle
  2443. *
  2444. * This function is used to send the flush command to the FW,
  2445. * that will flush the fw logs that are residue in the FW
  2446. *
  2447. * Return: None
  2448. */
  2449. QDF_STATUS wmi_unified_flush_logs_to_fw_cmd(void *wmi_hdl)
  2450. {
  2451. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2452. if (wmi_handle->ops->send_flush_logs_to_fw_cmd)
  2453. return wmi_handle->ops->send_flush_logs_to_fw_cmd(wmi_handle);
  2454. return QDF_STATUS_E_FAILURE;
  2455. }
  2456. /**
  2457. * wmi_unified_soc_set_pcl_cmd() - Send WMI_SOC_SET_PCL_CMDID to FW
  2458. * @wmi_hdl: wmi handle
  2459. * @msg: PCL structure containing the PCL and the number of channels
  2460. *
  2461. * WMI_SOC_SET_PCL_CMDID provides a Preferred Channel List (PCL) to the WLAN
  2462. * firmware. The DBS Manager is the consumer of this information in the WLAN
  2463. * firmware. The channel list will be used when a Virtual DEVice (VDEV) needs
  2464. * to migrate to a new channel without host driver involvement. An example of
  2465. * this behavior is Legacy Fast Roaming (LFR 3.0). Generally, the host will
  2466. * manage the channel selection without firmware involvement.
  2467. *
  2468. * Return: Success if the cmd is sent successfully to the firmware
  2469. */
  2470. QDF_STATUS wmi_unified_soc_set_pcl_cmd(void *wmi_hdl,
  2471. struct wmi_pcl_list *msg)
  2472. {
  2473. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2474. if (wmi_handle->ops->send_soc_set_pcl_cmd)
  2475. return wmi_handle->ops->send_soc_set_pcl_cmd(wmi_handle, msg);
  2476. return QDF_STATUS_E_FAILURE;
  2477. }
  2478. /**
  2479. * wmi_unified_soc_set_hw_mode_cmd() - Send WMI_SOC_SET_HW_MODE_CMDID to FW
  2480. * @wmi_hdl: wmi handle
  2481. * @msg: Structure containing the following parameters
  2482. *
  2483. * - hw_mode_index: The HW_Mode field is a enumerated type that is selected
  2484. * from the HW_Mode table, which is returned in the WMI_SERVICE_READY_EVENTID.
  2485. *
  2486. * Provides notification to the WLAN firmware that host driver is requesting a
  2487. * HardWare (HW) Mode change. This command is needed to support iHelium in the
  2488. * configurations that include the Dual Band Simultaneous (DBS) feature.
  2489. *
  2490. * Return: Success if the cmd is sent successfully to the firmware
  2491. */
  2492. QDF_STATUS wmi_unified_soc_set_hw_mode_cmd(void *wmi_hdl,
  2493. uint32_t hw_mode_index)
  2494. {
  2495. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2496. if (wmi_handle->ops->send_soc_set_hw_mode_cmd)
  2497. return wmi_handle->ops->send_soc_set_hw_mode_cmd(wmi_handle,
  2498. hw_mode_index);
  2499. return QDF_STATUS_E_FAILURE;
  2500. }
  2501. /**
  2502. * wmi_unified_soc_set_dual_mac_config_cmd() - Set dual mac config to FW
  2503. * @wmi_hdl: wmi handle
  2504. * @msg: Dual MAC config parameters
  2505. *
  2506. * Configures WLAN firmware with the dual MAC features
  2507. *
  2508. * Return: QDF_STATUS. 0 on success.
  2509. */
  2510. QDF_STATUS wmi_unified_soc_set_dual_mac_config_cmd(void *wmi_hdl,
  2511. struct wmi_dual_mac_config *msg)
  2512. {
  2513. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2514. if (wmi_handle->ops->send_soc_set_dual_mac_config_cmd)
  2515. return wmi_handle->ops->send_soc_set_dual_mac_config_cmd(wmi_handle,
  2516. msg);
  2517. return QDF_STATUS_E_FAILURE;
  2518. }
  2519. /**
  2520. * wmi_unified_enable_arp_ns_offload_cmd() - enable ARP NS offload
  2521. * @wmi_hdl: wmi handle
  2522. * @param: offload request
  2523. * @arp_only: flag
  2524. *
  2525. * To configure ARP NS off load data to firmware
  2526. * when target goes to wow mode.
  2527. *
  2528. * Return: CDF Status
  2529. */
  2530. QDF_STATUS wmi_unified_enable_arp_ns_offload_cmd(void *wmi_hdl,
  2531. struct host_offload_req_param *param, bool arp_only,
  2532. uint8_t vdev_id)
  2533. {
  2534. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2535. if (wmi_handle->ops->send_enable_arp_ns_offload_cmd)
  2536. return wmi_handle->ops->send_enable_arp_ns_offload_cmd(wmi_handle,
  2537. param, arp_only,
  2538. vdev_id);
  2539. return QDF_STATUS_E_FAILURE;
  2540. }
  2541. /**
  2542. * wmi_unified_set_led_flashing_cmd() - set led flashing in fw
  2543. * @wmi_hdl: wmi handle
  2544. * @flashing: flashing request
  2545. *
  2546. * Return: CDF status
  2547. */
  2548. QDF_STATUS wmi_unified_set_led_flashing_cmd(void *wmi_hdl,
  2549. struct flashing_req_params *flashing)
  2550. {
  2551. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2552. if (wmi_handle->ops->send_set_led_flashing_cmd)
  2553. return wmi_handle->ops->send_set_led_flashing_cmd(wmi_handle,
  2554. flashing);
  2555. return QDF_STATUS_E_FAILURE;
  2556. }
  2557. /**
  2558. * wmi_unified_app_type1_params_in_fw_cmd() - set app type1 params in fw
  2559. * @wmi_hdl: wmi handle
  2560. * @appType1Params: app type1 params
  2561. *
  2562. * Return: CDF status
  2563. */
  2564. QDF_STATUS wmi_unified_app_type1_params_in_fw_cmd(void *wmi_hdl,
  2565. struct app_type1_params *app_type1_params)
  2566. {
  2567. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2568. if (wmi_handle->ops->send_app_type1_params_in_fw_cmd)
  2569. return wmi_handle->ops->send_app_type1_params_in_fw_cmd(wmi_handle,
  2570. app_type1_params);
  2571. return QDF_STATUS_E_FAILURE;
  2572. }
  2573. /**
  2574. * wmi_unified_set_ssid_hotlist_cmd() - Handle an SSID hotlist set request
  2575. * @wmi_hdl: wmi handle
  2576. * @request: SSID hotlist set request
  2577. *
  2578. * Return: QDF_STATUS enumeration
  2579. */
  2580. QDF_STATUS
  2581. wmi_unified_set_ssid_hotlist_cmd(void *wmi_hdl,
  2582. struct ssid_hotlist_request_params *request)
  2583. {
  2584. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2585. if (wmi_handle->ops->send_set_ssid_hotlist_cmd)
  2586. return wmi_handle->ops->send_set_ssid_hotlist_cmd(wmi_handle,
  2587. request);
  2588. return QDF_STATUS_E_FAILURE;
  2589. }
  2590. /**
  2591. * wmi_unified_roam_synch_complete_cmd() - roam synch complete command to fw.
  2592. * @wmi_hdl: wmi handle
  2593. * @vdev_id: vdev id
  2594. *
  2595. * This function sends roam synch complete event to fw.
  2596. *
  2597. * Return: CDF STATUS
  2598. */
  2599. QDF_STATUS wmi_unified_roam_synch_complete_cmd(void *wmi_hdl,
  2600. uint8_t vdev_id)
  2601. {
  2602. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2603. if (wmi_handle->ops->send_process_roam_synch_complete_cmd)
  2604. return wmi_handle->ops->send_process_roam_synch_complete_cmd(wmi_handle,
  2605. vdev_id);
  2606. return QDF_STATUS_E_FAILURE;
  2607. }
  2608. /**
  2609. * wmi_unified_unit_test_cmd() - send unit test command to fw.
  2610. * @wmi_hdl: wmi handle
  2611. * @wmi_utest: unit test command
  2612. *
  2613. * This function send unit test command to fw.
  2614. *
  2615. * Return: CDF STATUS
  2616. */
  2617. QDF_STATUS wmi_unified_unit_test_cmd(void *wmi_hdl,
  2618. struct wmi_unit_test_cmd *wmi_utest)
  2619. {
  2620. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2621. if (wmi_handle->ops->send_unit_test_cmd)
  2622. return wmi_handle->ops->send_unit_test_cmd(wmi_handle,
  2623. wmi_utest);
  2624. return QDF_STATUS_E_FAILURE;
  2625. }
  2626. /**
  2627. * wmi_unified__roam_invoke_cmd() - send roam invoke command to fw.
  2628. * @wmi_hdl: wmi handle
  2629. * @roaminvoke: roam invoke command
  2630. *
  2631. * Send roam invoke command to fw for fastreassoc.
  2632. *
  2633. * Return: none
  2634. */
  2635. QDF_STATUS wmi_unified_roam_invoke_cmd(void *wmi_hdl,
  2636. struct wmi_roam_invoke_cmd *roaminvoke,
  2637. uint32_t ch_hz)
  2638. {
  2639. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2640. if (wmi_handle->ops->send_roam_invoke_cmd)
  2641. return wmi_handle->ops->send_roam_invoke_cmd(wmi_handle,
  2642. roaminvoke, ch_hz);
  2643. return QDF_STATUS_E_FAILURE;
  2644. }
  2645. /**
  2646. * wmi_unified_roam_scan_offload_cmd() - set roam offload command
  2647. * @wmi_hdl: wmi handle
  2648. * @command: command
  2649. * @vdev_id: vdev id
  2650. *
  2651. * This function set roam offload command to fw.
  2652. *
  2653. * Return: CDF status
  2654. */
  2655. QDF_STATUS wmi_unified_roam_scan_offload_cmd(void *wmi_hdl,
  2656. uint32_t command, uint32_t vdev_id)
  2657. {
  2658. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2659. if (wmi_handle->ops->send_roam_scan_offload_cmd)
  2660. return wmi_handle->ops->send_roam_scan_offload_cmd(wmi_handle,
  2661. command, vdev_id);
  2662. return QDF_STATUS_E_FAILURE;
  2663. }
  2664. /**
  2665. * wmi_unified_send_roam_scan_offload_ap_cmd() - set roam ap profile in fw
  2666. * @wmi_hdl: wmi handle
  2667. * @ap_profile_p: ap profile
  2668. * @vdev_id: vdev id
  2669. *
  2670. * Send WMI_ROAM_AP_PROFILE to firmware
  2671. *
  2672. * Return: CDF status
  2673. */
  2674. QDF_STATUS wmi_unified_send_roam_scan_offload_ap_cmd(void *wmi_hdl,
  2675. wmi_ap_profile *ap_profile_p,
  2676. uint32_t vdev_id)
  2677. {
  2678. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2679. if (wmi_handle->ops->send_roam_scan_offload_ap_profile_cmd)
  2680. return wmi_handle->ops->send_roam_scan_offload_ap_profile_cmd(wmi_handle,
  2681. ap_profile_p, vdev_id);
  2682. return QDF_STATUS_E_FAILURE;
  2683. }
  2684. /**
  2685. * wmi_unified_roam_scan_offload_scan_period() - set roam offload scan period
  2686. * @wmi_handle: wmi handle
  2687. * @scan_period: scan period
  2688. * @scan_age: scan age
  2689. * @vdev_id: vdev id
  2690. *
  2691. * Send WMI_ROAM_SCAN_PERIOD parameters to fw.
  2692. *
  2693. * Return: CDF status
  2694. */
  2695. QDF_STATUS wmi_unified_roam_scan_offload_scan_period(void *wmi_hdl,
  2696. uint32_t scan_period,
  2697. uint32_t scan_age,
  2698. uint32_t vdev_id)
  2699. {
  2700. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2701. if (wmi_handle->ops->send_roam_scan_offload_scan_period_cmd)
  2702. return wmi_handle->ops->send_roam_scan_offload_scan_period_cmd(wmi_handle,
  2703. scan_period, scan_age, vdev_id);
  2704. return QDF_STATUS_E_FAILURE;
  2705. }
  2706. /**
  2707. * wmi_unified_roam_scan_offload_chan_list_cmd() - set roam offload channel list
  2708. * @wmi_handle: wmi handle
  2709. * @chan_count: channel count
  2710. * @chan_list: channel list
  2711. * @list_type: list type
  2712. * @vdev_id: vdev id
  2713. *
  2714. * Set roam offload channel list.
  2715. *
  2716. * Return: CDF status
  2717. */
  2718. QDF_STATUS wmi_unified_roam_scan_offload_chan_list_cmd(void *wmi_hdl,
  2719. uint8_t chan_count,
  2720. uint8_t *chan_list,
  2721. uint8_t list_type, uint32_t vdev_id)
  2722. {
  2723. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2724. if (wmi_handle->ops->send_roam_scan_offload_chan_list_cmd)
  2725. return wmi_handle->ops->send_roam_scan_offload_chan_list_cmd(wmi_handle,
  2726. chan_count, chan_list,
  2727. list_type, vdev_id);
  2728. return QDF_STATUS_E_FAILURE;
  2729. }
  2730. /**
  2731. * wmi_unified_roam_scan_offload_rssi_change_cmd() - set roam offload RSSI th
  2732. * @wmi_hdl: wmi handle
  2733. * @rssi_change_thresh: RSSI Change threshold
  2734. * @bcn_rssi_weight: beacon RSSI weight
  2735. * @vdev_id: vdev id
  2736. *
  2737. * Send WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD parameters to fw.
  2738. *
  2739. * Return: CDF status
  2740. */
  2741. QDF_STATUS wmi_unified_roam_scan_offload_rssi_change_cmd(void *wmi_hdl,
  2742. uint32_t vdev_id,
  2743. int32_t rssi_change_thresh,
  2744. uint32_t bcn_rssi_weight,
  2745. uint32_t hirssi_delay_btw_scans)
  2746. {
  2747. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2748. if (wmi_handle->ops->send_roam_scan_offload_rssi_change_cmd)
  2749. return wmi_handle->ops->send_roam_scan_offload_rssi_change_cmd(wmi_handle,
  2750. vdev_id, rssi_change_thresh,
  2751. bcn_rssi_weight, hirssi_delay_btw_scans);
  2752. return QDF_STATUS_E_FAILURE;
  2753. }
  2754. /**
  2755. * wmi_unified_get_buf_extscan_hotlist_cmd() - prepare hotlist command
  2756. * @wmi_hdl: wmi handle
  2757. * @photlist: hotlist command params
  2758. * @buf_len: buffer length
  2759. *
  2760. * This function fills individual elements for hotlist request and
  2761. * TLV for bssid entries
  2762. *
  2763. * Return: CDF Status.
  2764. */
  2765. QDF_STATUS wmi_unified_get_buf_extscan_hotlist_cmd(void *wmi_hdl,
  2766. struct ext_scan_setbssi_hotlist_params *
  2767. photlist, int *buf_len)
  2768. {
  2769. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  2770. if (wmi_handle->ops->send_get_buf_extscan_hotlist_cmd)
  2771. return wmi_handle->ops->send_get_buf_extscan_hotlist_cmd(wmi_handle,
  2772. photlist, buf_len);
  2773. return QDF_STATUS_E_FAILURE;
  2774. }