wmi_unified_api.c 86 KB

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