wmi_unified_api.c 87 KB

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