wmi_unified_api.c 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678
  1. /*
  2. * Copyright (c) 2016 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. #include "athdefs.h"
  27. #include "osapi_linux.h"
  28. #include "a_types.h"
  29. #include "a_debug.h"
  30. #include "ol_if_athvar.h"
  31. #include "ol_defines.h"
  32. #include "wmi.h"
  33. #include "wmi_unified_priv.h"
  34. #include "wma_api.h"
  35. #include "wmi_unified_param.h"
  36. /**
  37. * wmi_unified_vdev_create_send() - send VDEV create command to fw
  38. * @wmi_handle: wmi handle
  39. * @param: pointer to hold vdev create parameter
  40. * @macaddr: vdev mac address
  41. *
  42. * Return: 0 for success or error code
  43. */
  44. CDF_STATUS wmi_unified_vdev_create_send(void *wmi_hdl,
  45. uint8_t macaddr[IEEE80211_ADDR_LEN],
  46. struct vdev_create_params *param)
  47. {
  48. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  49. if (wmi_handle->ops->send_vdev_create_cmd)
  50. return wmi_handle->ops->send_vdev_create_cmd(wmi_handle,
  51. macaddr, param);
  52. return CDF_STATUS_E_FAILURE;
  53. }
  54. /**
  55. * wmi_unified_vdev_delete_send() - send VDEV delete command to fw
  56. * @wmi_handle: wmi handle
  57. * @if_id: vdev id
  58. *
  59. * Return: 0 for success or error code
  60. */
  61. CDF_STATUS wmi_unified_vdev_delete_send(void *wmi_hdl,
  62. uint8_t if_id)
  63. {
  64. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  65. if (wmi_handle->ops->send_vdev_delete_cmd)
  66. return wmi_handle->ops->send_vdev_delete_cmd(wmi_handle,
  67. if_id);
  68. return CDF_STATUS_E_FAILURE;
  69. }
  70. /**
  71. * wmi_unified_vdev_stop_send() - send vdev stop command to fw
  72. * @wmi: wmi handle
  73. * @vdev_id: vdev id
  74. *
  75. * Return: 0 for success or erro code
  76. */
  77. CDF_STATUS wmi_unified_vdev_stop_send(void *wmi_hdl,
  78. uint8_t vdev_id)
  79. {
  80. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  81. if (wmi_handle->ops->send_vdev_stop_cmd)
  82. return wmi_handle->ops->send_vdev_stop_cmd(wmi_handle,
  83. vdev_id);
  84. return CDF_STATUS_E_FAILURE;
  85. }
  86. /**
  87. * wmi_unified_vdev_down_send() - send vdev down command to fw
  88. * @wmi: wmi handle
  89. * @vdev_id: vdev id
  90. *
  91. * Return: 0 for success or error code
  92. */
  93. CDF_STATUS wmi_unified_vdev_down_send(void *wmi_hdl, uint8_t vdev_id)
  94. {
  95. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  96. if (wmi_handle->ops->send_vdev_down_cmd)
  97. return wmi_handle->ops->send_vdev_down_cmd(wmi_handle, vdev_id);
  98. return CDF_STATUS_E_FAILURE;
  99. }
  100. /**
  101. * wmi_unified_peer_flush_tids_send() - flush peer tids packets in fw
  102. * @wmi: wmi handle
  103. * @peer_addr: peer mac address
  104. * @param: pointer to hold peer flush tid parameter
  105. *
  106. * Return: 0 for sucess or error code
  107. */
  108. CDF_STATUS wmi_unified_peer_flush_tids_send(void *wmi_hdl,
  109. uint8_t peer_addr[IEEE80211_ADDR_LEN],
  110. struct peer_flush_params *param)
  111. {
  112. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  113. if (wmi_handle->ops->send_peer_flush_tids_cmd)
  114. return wmi_handle->ops->send_peer_flush_tids_cmd(wmi_handle,
  115. peer_addr, param);
  116. return CDF_STATUS_E_FAILURE;
  117. }
  118. /**
  119. * wmi_unified_peer_delete_send() - send PEER delete command to fw
  120. * @wmi: wmi handle
  121. * @peer_addr: peer mac addr
  122. * @vdev_id: vdev id
  123. *
  124. * Return: 0 for success or error code
  125. */
  126. CDF_STATUS wmi_unified_peer_delete_send(void *wmi_hdl,
  127. uint8_t
  128. peer_addr[IEEE80211_ADDR_LEN],
  129. uint8_t vdev_id)
  130. {
  131. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  132. if (wmi_handle->ops->send_peer_delete_cmd)
  133. return wmi_handle->ops->send_peer_delete_cmd(wmi_handle,
  134. peer_addr, vdev_id);
  135. return CDF_STATUS_E_FAILURE;
  136. }
  137. /**
  138. * wmi_set_peer_param() - set peer parameter in fw
  139. * @wmi_ctx: wmi handle
  140. * @peer_addr: peer mac address
  141. * @param : pointer to hold peer set parameter
  142. *
  143. * Return: 0 for success or error code
  144. */
  145. CDF_STATUS wmi_set_peer_param_send(void *wmi_hdl,
  146. uint8_t peer_addr[IEEE80211_ADDR_LEN],
  147. struct peer_set_params *param)
  148. {
  149. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  150. if (wmi_handle->ops->send_peer_param_cmd)
  151. return wmi_handle->ops->send_peer_param_cmd(wmi_handle,
  152. peer_addr, param);
  153. return CDF_STATUS_E_FAILURE;
  154. }
  155. /**
  156. * wmi_unified_vdev_up_send() - send vdev up command in fw
  157. * @wmi: wmi handle
  158. * @bssid: bssid
  159. * @vdev_up_params: pointer to hold vdev up parameter
  160. *
  161. * Return: 0 for success or error code
  162. */
  163. CDF_STATUS wmi_unified_vdev_up_send(void *wmi_hdl,
  164. uint8_t bssid[IEEE80211_ADDR_LEN],
  165. struct vdev_up_params *params)
  166. {
  167. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  168. if (wmi_handle->ops->send_vdev_up_cmd)
  169. return wmi_handle->ops->send_vdev_up_cmd(wmi_handle, bssid,
  170. params);
  171. return CDF_STATUS_E_FAILURE;
  172. }
  173. /**
  174. * wmi_unified_peer_create_send() - send peer create command to fw
  175. * @wmi: wmi handle
  176. * @peer_addr: peer mac address
  177. * @peer_type: peer type
  178. * @vdev_id: vdev id
  179. *
  180. * Return: 0 for success or error code
  181. */
  182. CDF_STATUS wmi_unified_peer_create_send(void *wmi_hdl,
  183. struct peer_create_params *param)
  184. {
  185. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  186. if (wmi_handle->ops->send_peer_create_cmd)
  187. return wmi_handle->ops->send_peer_create_cmd(wmi_handle, param);
  188. return CDF_STATUS_E_FAILURE;
  189. }
  190. #ifdef FEATURE_GREEN_AP
  191. /**
  192. * wmi_unified_green_ap_ps_send() - enable green ap powersave command
  193. * @wmi_handle: wmi handle
  194. * @value: value
  195. * @mac_id: mac id to have radio context
  196. *
  197. * Return: 0 for success or error code
  198. */
  199. CDF_STATUS wmi_unified_green_ap_ps_send(void *wmi_hdl,
  200. uint32_t value, uint8_t mac_id)
  201. {
  202. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  203. if (wmi_handle->ops->send_green_ap_ps_cmd)
  204. return wmi_handle->ops->send_green_ap_ps_cmd(wmi_handle, value,
  205. mac_id);
  206. return CDF_STATUS_E_FAILURE;
  207. }
  208. #else
  209. CDF_STATUS wmi_unified_green_ap_ps_send(void *wmi_hdl,
  210. uint32_t value, uint8_t mac_id)
  211. {
  212. return 0;
  213. }
  214. #endif /* FEATURE_GREEN_AP */
  215. /**
  216. * wmi_unified_pdev_utf_cmd() - send utf command to fw
  217. * @wmi_handle: wmi handle
  218. * @param: pointer to pdev_utf_params
  219. * @mac_id: mac id to have radio context
  220. *
  221. * Return: 0 for success or error code
  222. */
  223. CDF_STATUS
  224. wmi_unified_pdev_utf_cmd_send(void *wmi_hdl,
  225. struct pdev_utf_params *param,
  226. uint8_t mac_id)
  227. {
  228. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  229. if (wmi_handle->ops->send_pdev_utf_cmd)
  230. return wmi_handle->ops->send_pdev_utf_cmd(wmi_handle, param,
  231. mac_id);
  232. return CDF_STATUS_E_FAILURE;
  233. }
  234. /**
  235. * wmi_unified_pdev_set_param() - set pdev parameters
  236. * @wmi_handle: wmi handle
  237. * @param: pointer to pdev parameter
  238. * @mac_id: radio context
  239. *
  240. * Return: 0 on success, errno on failure
  241. */
  242. CDF_STATUS
  243. wmi_unified_pdev_param_send(void *wmi_hdl,
  244. struct pdev_params *param,
  245. uint8_t mac_id)
  246. {
  247. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  248. if (wmi_handle->ops->send_pdev_param_cmd)
  249. return wmi_handle->ops->send_pdev_param_cmd(wmi_handle, param,
  250. mac_id);
  251. return CDF_STATUS_E_FAILURE;
  252. }
  253. /**
  254. * wmi_unified_suspend_send() - WMI suspend function
  255. * @param wmi_handle : handle to WMI.
  256. * @param param : pointer to hold suspend parameter
  257. * @mac_id: radio context
  258. *
  259. * Return: 0 on success and -ve on failure.
  260. */
  261. CDF_STATUS wmi_unified_suspend_send(void *wmi_hdl,
  262. struct suspend_params *param,
  263. uint8_t mac_id)
  264. {
  265. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  266. if (wmi_handle->ops->send_suspend_cmd)
  267. return wmi_handle->ops->send_suspend_cmd(wmi_handle, param,
  268. mac_id);
  269. return CDF_STATUS_E_FAILURE;
  270. }
  271. /**
  272. * wmi_unified_resume_send - WMI resume function
  273. * @param wmi_handle : handle to WMI.
  274. * @mac_id: radio context
  275. *
  276. * Return: 0 on success and -ve on failure.
  277. */
  278. CDF_STATUS wmi_unified_resume_send(void *wmi_hdl,
  279. uint8_t mac_id)
  280. {
  281. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  282. if (wmi_handle->ops->send_resume_cmd)
  283. return wmi_handle->ops->send_resume_cmd(wmi_handle,
  284. mac_id);
  285. return CDF_STATUS_E_FAILURE;
  286. }
  287. /**
  288. * wmi_unified_wow_enable_send() - WMI wow enable function
  289. * @param wmi_handle : handle to WMI.
  290. * @param param : pointer to hold wow enable parameter
  291. * @mac_id: radio context
  292. *
  293. * Return: 0 on success and -ve on failure.
  294. */
  295. CDF_STATUS wmi_unified_wow_enable_send(void *wmi_hdl,
  296. struct wow_cmd_params *param,
  297. uint8_t mac_id)
  298. {
  299. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  300. if (wmi_handle->ops->send_wow_enable_cmd)
  301. return wmi_handle->ops->send_wow_enable_cmd(wmi_handle, param,
  302. mac_id);
  303. return CDF_STATUS_E_FAILURE;
  304. }
  305. /**
  306. * wmi_unified_ap_ps_cmd_send() - set ap powersave parameters
  307. * @wma_ctx: wma context
  308. * @peer_addr: peer mac address
  309. * @param: pointer to ap_ps parameter structure
  310. *
  311. * Return: 0 for success or error code
  312. */
  313. CDF_STATUS wmi_unified_ap_ps_cmd_send(void *wmi_hdl,
  314. uint8_t *peer_addr,
  315. struct ap_ps_params *param)
  316. {
  317. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  318. if (wmi_handle->ops->send_set_ap_ps_param_cmd)
  319. return wmi_handle->ops->send_set_ap_ps_param_cmd(wmi_handle,
  320. peer_addr,
  321. param);
  322. return CDF_STATUS_E_FAILURE;
  323. }
  324. /**
  325. * wmi_unified_sta_ps_cmd_send() - set sta powersave parameters
  326. * @wma_ctx: wma context
  327. * @peer_addr: peer mac address
  328. * @param: pointer to sta_ps parameter structure
  329. *
  330. * Return: 0 for success or error code
  331. */
  332. CDF_STATUS wmi_unified_sta_ps_cmd_send(void *wmi_hdl,
  333. struct sta_ps_params *param)
  334. {
  335. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  336. if (wmi_handle->ops->send_set_sta_ps_param_cmd)
  337. return wmi_handle->ops->send_set_sta_ps_param_cmd(wmi_handle,
  338. param);
  339. return CDF_STATUS_E_FAILURE;
  340. }
  341. /**
  342. * wmi_crash_inject() - inject fw crash
  343. * @wma_handle: wma handle
  344. * @param: ponirt to crash inject paramter structure
  345. *
  346. * Return: 0 for success or return error
  347. */
  348. CDF_STATUS wmi_crash_inject(void *wmi_hdl,
  349. struct crash_inject *param)
  350. {
  351. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  352. if (wmi_handle->ops->send_crash_inject_cmd)
  353. return wmi_handle->ops->send_crash_inject_cmd(wmi_handle,
  354. param);
  355. return CDF_STATUS_E_FAILURE;
  356. }
  357. /**
  358. * wmi_unified_dbglog_cmd_send() - set debug log level
  359. * @param wmi_handle : handle to WMI.
  360. * @param param : pointer to hold dbglog level parameter
  361. *
  362. * Return: 0 on success and -ve on failure.
  363. */
  364. CDF_STATUS
  365. wmi_unified_dbglog_cmd_send(void *wmi_hdl,
  366. struct dbglog_params *dbglog_param)
  367. {
  368. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  369. if (wmi_handle->ops->send_dbglog_cmd)
  370. return wmi_handle->ops->send_dbglog_cmd(wmi_handle,
  371. dbglog_param);
  372. return CDF_STATUS_E_FAILURE;
  373. }
  374. /**
  375. * wmi_unified_vdev_set_param_send() - WMI vdev set parameter function
  376. * @param wmi_handle : handle to WMI.
  377. * @param macaddr : MAC address
  378. * @param param : pointer to hold vdev set parameter
  379. *
  380. * Return: 0 on success and -ve on failure.
  381. */
  382. CDF_STATUS wmi_unified_vdev_set_param_send(void *wmi_hdl,
  383. struct vdev_set_params *param)
  384. {
  385. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  386. if (wmi_handle->ops->send_vdev_set_param_cmd)
  387. return wmi_handle->ops->send_vdev_set_param_cmd(wmi_handle,
  388. param);
  389. return CDF_STATUS_E_FAILURE;
  390. }
  391. /**
  392. * wmi_unified_stats_request_send() - WMI request stats function
  393. * @param wmi_handle : handle to WMI.
  394. * @param macaddr : MAC address
  395. * @param param : pointer to hold stats request parameter
  396. *
  397. * Return: 0 on success and -ve on failure.
  398. */
  399. CDF_STATUS wmi_unified_stats_request_send(void *wmi_hdl,
  400. uint8_t macaddr[IEEE80211_ADDR_LEN],
  401. struct stats_request_params *param)
  402. {
  403. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  404. if (wmi_handle->ops->send_stats_request_cmd)
  405. return wmi_handle->ops->send_stats_request_cmd(wmi_handle,
  406. macaddr, param);
  407. return CDF_STATUS_E_FAILURE;
  408. }
  409. /**
  410. * wmi_unified_stats_request_send() - WMI request stats function
  411. * @param wmi_handle : handle to WMI.
  412. * @param macaddr : MAC address
  413. * @param param : pointer to hold stats request parameter
  414. *
  415. * Return: 0 on success and -ve on failure.
  416. */
  417. CDF_STATUS wmi_unified_packet_log_enable_send(void *wmi_hdl,
  418. uint8_t macaddr[IEEE80211_ADDR_LEN],
  419. struct packet_enable_params *param)
  420. {
  421. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  422. if (wmi_handle->ops->send_packet_log_enable_cmd)
  423. return wmi_handle->ops->send_packet_log_enable_cmd(wmi_handle,
  424. macaddr, param);
  425. return CDF_STATUS_E_FAILURE;
  426. }
  427. /**
  428. * wmi_unified_beacon_send_cmd() - WMI beacon send function
  429. * @param wmi_handle : handle to WMI.
  430. * @param macaddr : MAC address
  431. * @param param : pointer to hold beacon send cmd parameter
  432. *
  433. * Return: 0 on success and -ve on failure.
  434. */
  435. CDF_STATUS wmi_unified_beacon_send_cmd(void *wmi_hdl,
  436. struct beacon_params *param)
  437. {
  438. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  439. if (wmi_handle->ops->send_beacon_send_cmd)
  440. return wmi_handle->ops->send_beacon_send_cmd(wmi_handle,
  441. param);
  442. return CDF_STATUS_E_FAILURE;
  443. }
  444. /**
  445. * wmi_unified_peer_assoc_send() - WMI peer assoc function
  446. * @param wmi_handle : handle to WMI.
  447. * @param macaddr : MAC address
  448. * @param param : pointer to peer assoc parameter
  449. *
  450. * Return: 0 on success and -ve on failure.
  451. */
  452. CDF_STATUS wmi_unified_peer_assoc_send(void *wmi_hdl,
  453. struct peer_assoc_params *param)
  454. {
  455. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  456. if (wmi_handle->ops->send_peer_assoc_cmd)
  457. return wmi_handle->ops->send_peer_assoc_cmd(wmi_handle,
  458. param);
  459. return CDF_STATUS_E_FAILURE;
  460. }
  461. /**
  462. * wmi_unified_scan_start_cmd_send() - WMI scan start function
  463. * @param wmi_handle : handle to WMI.
  464. * @param macaddr : MAC address
  465. * @param param : pointer to hold scan start cmd parameter
  466. *
  467. * Return: 0 on success and -ve on failure.
  468. */
  469. CDF_STATUS wmi_unified_scan_start_cmd_send(void *wmi_hdl,
  470. struct scan_start_params *param)
  471. {
  472. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  473. if (wmi_handle->ops->send_scan_start_cmd)
  474. return wmi_handle->ops->send_scan_start_cmd(wmi_handle,
  475. param);
  476. return CDF_STATUS_E_FAILURE;
  477. }
  478. /**
  479. * wmi_unified_scan_stop_cmd_send() - WMI scan start function
  480. * @param wmi_handle : handle to WMI.
  481. * @param macaddr : MAC address
  482. * @param param : pointer to hold scan start cmd parameter
  483. *
  484. * Return: 0 on success and -ve on failure.
  485. */
  486. CDF_STATUS wmi_unified_scan_stop_cmd_send(void *wmi_hdl,
  487. struct scan_stop_params *param)
  488. {
  489. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  490. if (wmi_handle->ops->send_scan_stop_cmd)
  491. return wmi_handle->ops->send_scan_stop_cmd(wmi_handle,
  492. param);
  493. return CDF_STATUS_E_FAILURE;
  494. }
  495. /**
  496. * wmi_unified_scan_chan_list_cmd_send() - WMI scan channel list function
  497. * @param wmi_handle : handle to WMI.
  498. * @param macaddr : MAC address
  499. * @param param : pointer to hold scan channel list parameter
  500. *
  501. * Return: 0 on success and -ve on failure.
  502. */
  503. CDF_STATUS wmi_unified_scan_chan_list_cmd_send(void *wmi_hdl,
  504. struct scan_chan_list_params *param)
  505. {
  506. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  507. if (wmi_handle->ops->send_scan_chan_list_cmd)
  508. return wmi_handle->ops->send_scan_chan_list_cmd(wmi_handle,
  509. param);
  510. return CDF_STATUS_E_FAILURE;
  511. }
  512. /**
  513. * wmi_mgmt_unified_cmd_send() - management cmd over wmi layer
  514. * @wmi_hdl : handle to WMI.
  515. * @param : pointer to hold mgmt cmd parameter
  516. *
  517. * Return: 0 on success and -ve on failure.
  518. */
  519. CDF_STATUS wmi_mgmt_unified_cmd_send(void *wmi_hdl,
  520. struct wmi_mgmt_params *param)
  521. {
  522. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  523. if (wmi_handle->ops->send_mgmt_cmd)
  524. return wmi_handle->ops->send_mgmt_cmd(wmi_handle,
  525. param);
  526. return CDF_STATUS_E_FAILURE;
  527. }
  528. /**
  529. * wmi_unified_modem_power_state() - set modem power state to fw
  530. * @wmi_hdl: wmi handle
  531. * @param_value: parameter value
  532. *
  533. * Return: 0 for success or error code
  534. */
  535. CDF_STATUS wmi_unified_modem_power_state(void *wmi_hdl,
  536. uint32_t param_value)
  537. {
  538. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  539. if (wmi_handle->ops->send_modem_power_state_cmd)
  540. return wmi_handle->ops->send_modem_power_state_cmd(wmi_handle,
  541. param_value);
  542. return CDF_STATUS_E_FAILURE;
  543. }
  544. /**
  545. * wmi_unified_set_sta_ps_mode() - set sta powersave params in fw
  546. * @wmi_hdl: wmi handle
  547. * @vdev_id: vdev id
  548. * @val: value
  549. *
  550. * Return: 0 for success or error code.
  551. */
  552. CDF_STATUS wmi_unified_set_sta_ps_mode(void *wmi_hdl,
  553. uint32_t vdev_id, uint8_t val)
  554. {
  555. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  556. if (wmi_handle->ops->send_set_sta_ps_mode_cmd)
  557. return wmi_handle->ops->send_set_sta_ps_mode_cmd(wmi_handle,
  558. vdev_id, val);
  559. return CDF_STATUS_E_FAILURE;
  560. }
  561. /**
  562. * wmi_set_mimops() - set MIMO powersave
  563. * @wmi_hdl: wmi handle
  564. * @vdev_id: vdev id
  565. * @value: value
  566. *
  567. * Return: CDF_STATUS_SUCCESS for success or error code.
  568. */
  569. CDF_STATUS wmi_unified_set_mimops(void *wmi_hdl, uint8_t vdev_id, int value)
  570. {
  571. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  572. if (wmi_handle->ops->send_set_mimops_cmd)
  573. return wmi_handle->ops->send_set_mimops_cmd(wmi_handle,
  574. vdev_id, value);
  575. return CDF_STATUS_E_FAILURE;
  576. }
  577. /**
  578. * wmi_set_smps_params() - set smps params
  579. * @wmi_hdl: wmi handle
  580. * @vdev_id: vdev id
  581. * @value: value
  582. *
  583. * Return: CDF_STATUS_SUCCESS for success or error code.
  584. */
  585. CDF_STATUS wmi_unified_set_smps_params(void *wmi_hdl, uint8_t vdev_id,
  586. int value)
  587. {
  588. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  589. if (wmi_handle->ops->send_set_smps_params_cmd)
  590. return wmi_handle->ops->send_set_smps_params_cmd(wmi_handle,
  591. vdev_id, value);
  592. return CDF_STATUS_E_FAILURE;
  593. }
  594. /**
  595. * wmi_set_p2pgo_oppps_req() - send p2p go opp power save request to fw
  596. * @wmi_hdl: wmi handle
  597. * @opps: p2p opp power save parameters
  598. *
  599. * Return: none
  600. */
  601. CDF_STATUS wmi_unified_set_p2pgo_oppps_req(void *wmi_hdl,
  602. struct p2p_ps_params *oppps)
  603. {
  604. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  605. if (wmi_handle->ops->send_set_p2pgo_oppps_req_cmd)
  606. return wmi_handle->ops->send_set_p2pgo_oppps_req_cmd(wmi_handle,
  607. oppps);
  608. return CDF_STATUS_E_FAILURE;
  609. }
  610. /**
  611. * wmi_unified_set_p2pgo_noa_req_cmd() - send p2p go noa request to fw
  612. * @wmi_hdl: wmi handle
  613. * @noa: p2p power save parameters
  614. *
  615. * Return: none
  616. */
  617. CDF_STATUS wmi_unified_set_p2pgo_noa_req_cmd(void *wmi_hdl,
  618. struct p2p_ps_params *noa)
  619. {
  620. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  621. if (wmi_handle->ops->send_set_p2pgo_noa_req_cmd)
  622. return wmi_handle->ops->send_set_p2pgo_noa_req_cmd(wmi_handle,
  623. noa);
  624. return CDF_STATUS_E_FAILURE;
  625. }
  626. /**
  627. * wmi_get_temperature() - get pdev temperature req
  628. * @wmi_hdl: wmi handle
  629. *
  630. * Return: CDF_STATUS_SUCCESS for success or error code.
  631. */
  632. CDF_STATUS wmi_unified_get_temperature(void *wmi_hdl)
  633. {
  634. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  635. if (wmi_handle->ops->send_get_temperature_cmd)
  636. return wmi_handle->ops->send_get_temperature_cmd(wmi_handle);
  637. return CDF_STATUS_E_FAILURE;
  638. }
  639. /**
  640. * wmi_unified_set_sta_uapsd_auto_trig_cmd() - set uapsd auto trigger command
  641. * @wmi_hdl: wmi handle
  642. * @end_set_sta_ps_mode_cmd: cmd paramter strcture
  643. *
  644. * This function sets the trigger
  645. * uapsd params such as service interval, delay interval
  646. * and suspend interval which will be used by the firmware
  647. * to send trigger frames periodically when there is no
  648. * traffic on the transmit side.
  649. *
  650. * Return: 0 for success or error code.
  651. */
  652. CDF_STATUS
  653. wmi_unified_set_sta_uapsd_auto_trig_cmd(void *wmi_hdl,
  654. struct sta_uapsd_trig_params *param)
  655. {
  656. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  657. if (wmi_handle->ops->send_set_sta_uapsd_auto_trig_cmd)
  658. return wmi_handle->ops->send_set_sta_uapsd_auto_trig_cmd(wmi_handle,
  659. param);
  660. return CDF_STATUS_E_FAILURE;
  661. }
  662. /**
  663. * wmi_unified_ocb_start_timing_advert() - start sending the timing advertisement
  664. * frames on a channel
  665. * @wmi_handle: pointer to the wmi handle
  666. * @timing_advert: pointer to the timing advertisement struct
  667. *
  668. * Return: 0 on succes
  669. */
  670. CDF_STATUS wmi_unified_ocb_start_timing_advert(void *wmi_hdl,
  671. struct ocb_timing_advert_param *timing_advert)
  672. {
  673. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  674. if (wmi_handle->ops->send_ocb_start_timing_advert_cmd)
  675. return wmi_handle->ops->send_ocb_start_timing_advert_cmd(wmi_handle,
  676. timing_advert);
  677. return CDF_STATUS_E_FAILURE;
  678. }
  679. /**
  680. * wmi_unified_ocb_stop_timing_advert() - stop sending the timing advertisement
  681. * frames on a channel
  682. * @wmi_handle: pointer to the wmi handle
  683. * @timing_advert: pointer to the timing advertisement struct
  684. *
  685. * Return: 0 on succes
  686. */
  687. CDF_STATUS wmi_unified_ocb_stop_timing_advert(void *wmi_hdl,
  688. struct ocb_timing_advert_param *timing_advert)
  689. {
  690. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  691. if (wmi_handle->ops->send_ocb_stop_timing_advert_cmd)
  692. return wmi_handle->ops->send_ocb_stop_timing_advert_cmd(wmi_handle,
  693. timing_advert);
  694. return CDF_STATUS_E_FAILURE;
  695. }
  696. /**
  697. * wmi_unified_ocb_set_utc_time_cmd() - get ocb tsf timer val
  698. * @wmi_handle: pointer to the wmi handle
  699. * @vdev_id: vdev id
  700. *
  701. * Return: 0 on succes
  702. */
  703. CDF_STATUS wmi_unified_ocb_set_utc_time_cmd(void *wmi_hdl,
  704. struct ocb_utc_param *utc)
  705. {
  706. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  707. if (wmi_handle->ops->send_ocb_set_utc_time_cmd)
  708. return wmi_handle->ops->send_ocb_set_utc_time_cmd(wmi_handle,
  709. utc);
  710. return CDF_STATUS_E_FAILURE;
  711. }
  712. /**
  713. * wmi_unified_ocb_get_tsf_timer() - get ocb tsf timer val
  714. * @wmi_handle: pointer to the wmi handle
  715. * @vdev_id: vdev id
  716. *
  717. * Return: 0 on succes
  718. */
  719. CDF_STATUS wmi_unified_ocb_get_tsf_timer(void *wmi_hdl,
  720. uint8_t vdev_id)
  721. {
  722. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  723. if (wmi_handle->ops->send_ocb_get_tsf_timer_cmd)
  724. return wmi_handle->ops->send_ocb_get_tsf_timer_cmd(wmi_handle,
  725. vdev_id);
  726. return CDF_STATUS_E_FAILURE;
  727. }
  728. /**
  729. * wmi_unified_dcc_get_stats_cmd() - get the DCC channel stats
  730. * @wmi_handle: pointer to the wmi handle
  731. * @get_stats_param: pointer to the dcc stats
  732. *
  733. * Return: 0 on succes
  734. */
  735. CDF_STATUS wmi_unified_dcc_get_stats_cmd(void *wmi_hdl,
  736. struct dcc_get_stats_param *get_stats_param)
  737. {
  738. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  739. if (wmi_handle->ops->send_dcc_get_stats_cmd)
  740. return wmi_handle->ops->send_dcc_get_stats_cmd(wmi_handle,
  741. get_stats_param);
  742. return CDF_STATUS_E_FAILURE;
  743. }
  744. /**
  745. * wmi_unified_dcc_clear_stats() - command to clear the DCC stats
  746. * @wmi_handle: pointer to the wmi handle
  747. * @clear_stats_param: parameters to the command
  748. *
  749. * Return: 0 on succes
  750. */
  751. CDF_STATUS wmi_unified_dcc_clear_stats(void *wmi_hdl,
  752. uint32_t vdev_id, uint32_t dcc_stats_bitmap)
  753. {
  754. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  755. if (wmi_handle->ops->send_dcc_clear_stats_cmd)
  756. return wmi_handle->ops->send_dcc_clear_stats_cmd(wmi_handle,
  757. vdev_id, dcc_stats_bitmap);
  758. return CDF_STATUS_E_FAILURE;
  759. }
  760. /**
  761. * wmi_unified_dcc_update_ndl() - command to update the NDL data
  762. * @wmi_handle: pointer to the wmi handle
  763. * @update_ndl_param: pointer to the request parameters
  764. *
  765. * Return: 0 on success
  766. */
  767. CDF_STATUS wmi_unified_dcc_update_ndl(void *wmi_hdl,
  768. struct dcc_update_ndl_param *update_ndl_param)
  769. {
  770. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  771. if (wmi_handle->ops->send_dcc_update_ndl_cmd)
  772. return wmi_handle->ops->send_dcc_update_ndl_cmd(wmi_handle,
  773. update_ndl_param);
  774. return CDF_STATUS_E_FAILURE;
  775. }
  776. /**
  777. * wmi_unified_ocb_set_config() - send the OCB config to the FW
  778. * @wmi_handle: pointer to the wmi handle
  779. * @config: the OCB configuration
  780. *
  781. * Return: 0 on success
  782. */
  783. CDF_STATUS wmi_unified_ocb_set_config(void *wmi_hdl,
  784. struct ocb_config_param *config, uint32_t *ch_mhz)
  785. {
  786. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  787. if (wmi_handle->ops->send_ocb_set_config_cmd)
  788. return wmi_handle->ops->send_ocb_set_config_cmd(wmi_handle,
  789. config, ch_mhz);
  790. return CDF_STATUS_E_FAILURE;
  791. }
  792. /**
  793. * wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd() - control mcc scheduler
  794. * @wmi_handle: wmi handle
  795. * @mcc_adaptive_scheduler: enable/disable
  796. *
  797. * This function enable/disable mcc adaptive scheduler in fw.
  798. *
  799. * Return: CDF_STATUS_SUCCESS for sucess or error code
  800. */
  801. CDF_STATUS wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd(
  802. void *wmi_hdl, uint32_t mcc_adaptive_scheduler)
  803. {
  804. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  805. if (wmi_handle->ops->send_set_enable_disable_mcc_adaptive_scheduler_cmd)
  806. return wmi_handle->ops->send_set_enable_disable_mcc_adaptive_scheduler_cmd(wmi_handle,
  807. mcc_adaptive_scheduler);
  808. return CDF_STATUS_E_FAILURE;
  809. }
  810. /**
  811. * wmi_unified_set_mcc_channel_time_latency_cmd() - set MCC channel time latency
  812. * @wmi: wmi handle
  813. * @mcc_channel: mcc channel
  814. * @mcc_channel_time_latency: MCC channel time latency.
  815. *
  816. * Currently used to set time latency for an MCC vdev/adapter using operating
  817. * channel of it and channel number. The info is provided run time using
  818. * iwpriv command: iwpriv <wlan0 | p2p0> setMccLatency <latency in ms>.
  819. *
  820. * Return: CDF status
  821. */
  822. CDF_STATUS wmi_unified_set_mcc_channel_time_latency_cmd(void *wmi_hdl,
  823. uint32_t mcc_channel_freq, uint32_t mcc_channel_time_latency)
  824. {
  825. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  826. if (wmi_handle->ops->send_set_mcc_channel_time_latency_cmd)
  827. return wmi_handle->ops->send_set_mcc_channel_time_latency_cmd(wmi_handle,
  828. mcc_channel_freq,
  829. mcc_channel_time_latency);
  830. return CDF_STATUS_E_FAILURE;
  831. }
  832. /**
  833. * wmi_unified_set_mcc_channel_time_quota_cmd() - set MCC channel time quota
  834. * @wmi: wmi handle
  835. * @adapter_1_chan_number: adapter 1 channel number
  836. * @adapter_1_quota: adapter 1 quota
  837. * @adapter_2_chan_number: adapter 2 channel number
  838. *
  839. * Return: CDF status
  840. */
  841. CDF_STATUS wmi_unified_set_mcc_channel_time_quota_cmd(void *wmi_hdl,
  842. uint32_t adapter_1_chan_freq,
  843. uint32_t adapter_1_quota, uint32_t adapter_2_chan_freq)
  844. {
  845. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  846. if (wmi_handle->ops->send_set_mcc_channel_time_quota_cmd)
  847. return wmi_handle->ops->send_set_mcc_channel_time_quota_cmd(wmi_handle,
  848. adapter_1_chan_freq,
  849. adapter_1_quota,
  850. adapter_2_chan_freq);
  851. return CDF_STATUS_E_FAILURE;
  852. }
  853. /**
  854. * wmi_unified_set_thermal_mgmt_cmd() - set thermal mgmt command to fw
  855. * @wmi_handle: Pointer to wmi handle
  856. * @thermal_info: Thermal command information
  857. *
  858. * This function sends the thermal management command
  859. * to the firmware
  860. *
  861. * Return: CDF_STATUS_SUCCESS for success otherwise failure
  862. */
  863. CDF_STATUS wmi_unified_set_thermal_mgmt_cmd(void *wmi_hdl,
  864. struct thermal_cmd_params *thermal_info)
  865. {
  866. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  867. if (wmi_handle->ops->send_set_thermal_mgmt_cmd)
  868. return wmi_handle->ops->send_set_thermal_mgmt_cmd(wmi_handle,
  869. thermal_info);
  870. return CDF_STATUS_E_FAILURE;
  871. }
  872. /**
  873. * wmi_unified_lro_config_cmd() - process the LRO config command
  874. * @wmi: Pointer to wmi handle
  875. * @wmi_lro_cmd: Pointer to LRO configuration parameters
  876. *
  877. * This function sends down the LRO configuration parameters to
  878. * the firmware to enable LRO, sets the TCP flags and sets the
  879. * seed values for the toeplitz hash generation
  880. *
  881. * Return: CDF_STATUS_SUCCESS for success otherwise failure
  882. */
  883. CDF_STATUS wmi_unified_lro_config_cmd(void *wmi_hdl,
  884. struct wmi_lro_config_cmd_t *wmi_lro_cmd)
  885. {
  886. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  887. if (wmi_handle->ops->send_lro_config_cmd)
  888. return wmi_handle->ops->send_lro_config_cmd(wmi_handle,
  889. wmi_lro_cmd);
  890. return CDF_STATUS_E_FAILURE;
  891. }
  892. /**
  893. * wmi_unified_bcn_buf_ll_cmd() - prepare and send beacon buffer to fw for LL
  894. * @wmi_hdl: wmi handle
  895. * @param: bcn ll cmd parameter
  896. *
  897. * Return: CDF_STATUS_SUCCESS for success otherwise failure
  898. */
  899. CDF_STATUS wmi_unified_bcn_buf_ll_cmd(void *wmi_hdl,
  900. wmi_bcn_send_from_host_cmd_fixed_param *param)
  901. {
  902. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  903. if (wmi_handle->ops->send_bcn_buf_ll_cmd)
  904. return wmi_handle->ops->send_bcn_buf_ll_cmd(wmi_handle,
  905. param);
  906. return CDF_STATUS_E_FAILURE;
  907. }
  908. /**
  909. * wmi_unified_set_sta_sa_query_param_cmd() - set sta sa query parameters
  910. * @wmi_hdl: wmi handle
  911. * @vdev_id: vdev id
  912. * @max_retries: max retries
  913. * @retry_interval: retry interval
  914. * This function sets sta query related parameters in fw.
  915. *
  916. * Return: CDF_STATUS_SUCCESS for success otherwise failure
  917. */
  918. CDF_STATUS wmi_unified_set_sta_sa_query_param_cmd(void *wmi_hdl,
  919. uint8_t vdev_id, uint32_t max_retries,
  920. uint32_t retry_interval)
  921. {
  922. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  923. if (wmi_handle->ops->send_set_sta_sa_query_param_cmd)
  924. return wmi_handle->ops->send_set_sta_sa_query_param_cmd(wmi_handle,
  925. vdev_id, max_retries,
  926. retry_interval);
  927. return CDF_STATUS_E_FAILURE;
  928. }
  929. /**
  930. * wmi_unified_set_sta_keep_alive_cmd() - set sta keep alive parameters
  931. * @wmi_hdl: wmi handle
  932. * @params: sta keep alive parameter
  933. *
  934. * This function sets keep alive related parameters in fw.
  935. *
  936. * Return: none
  937. */
  938. CDF_STATUS wmi_unified_set_sta_keep_alive_cmd(void *wmi_hdl,
  939. struct sta_params *params)
  940. {
  941. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  942. if (wmi_handle->ops->send_set_sta_keep_alive_cmd)
  943. return wmi_handle->ops->send_set_sta_keep_alive_cmd(wmi_handle,
  944. params);
  945. return CDF_STATUS_E_FAILURE;
  946. }
  947. /**
  948. * wmi_unified_vdev_set_gtx_cfg_cmd() - set GTX params
  949. * @wmi_hdl: wmi handle
  950. * @if_id: vdev id
  951. * @gtx_info: GTX config params
  952. *
  953. * This function set GTX related params in firmware.
  954. *
  955. * Return: 0 for success or error code
  956. */
  957. CDF_STATUS wmi_unified_vdev_set_gtx_cfg_cmd(void *wmi_hdl, uint32_t if_id,
  958. struct wmi_gtx_config *gtx_info)
  959. {
  960. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  961. if (wmi_handle->ops->send_vdev_set_gtx_cfg_cmd)
  962. return wmi_handle->ops->send_vdev_set_gtx_cfg_cmd(wmi_handle,
  963. if_id, gtx_info);
  964. return CDF_STATUS_E_FAILURE;
  965. }
  966. /**
  967. * wmi_unified_process_update_edca_param() - update EDCA params
  968. * @wmi_hdl: wmi handle
  969. * @edca_params: edca parameters
  970. *
  971. * This function updates EDCA parameters to the target
  972. *
  973. * Return: CDF Status
  974. */
  975. CDF_STATUS wmi_unified_process_update_edca_param(void *wmi_hdl,
  976. uint8_t vdev_id,
  977. wmi_wmm_vparams gwmm_param[WMI_MAX_NUM_AC])
  978. {
  979. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  980. if (wmi_handle->ops->send_process_update_edca_param_cmd)
  981. return wmi_handle->ops->send_process_update_edca_param_cmd(wmi_handle,
  982. vdev_id, gwmm_param);
  983. return CDF_STATUS_E_FAILURE;
  984. }
  985. /**
  986. * wmi_unified_probe_rsp_tmpl_send_cmd() - send probe response template to fw
  987. * @wmi_hdl: wmi handle
  988. * @vdev_id: vdev id
  989. * @probe_rsp_info: probe response info
  990. *
  991. * Return: 0 for success or error code
  992. */
  993. CDF_STATUS wmi_unified_probe_rsp_tmpl_send_cmd(void *wmi_hdl,
  994. uint8_t vdev_id,
  995. struct wmi_probe_resp_params *probe_rsp_info,
  996. uint8_t *frm)
  997. {
  998. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  999. if (wmi_handle->ops->send_probe_rsp_tmpl_send_cmd)
  1000. return wmi_handle->ops->send_probe_rsp_tmpl_send_cmd(wmi_handle,
  1001. vdev_id, probe_rsp_info,
  1002. frm);
  1003. return CDF_STATUS_E_FAILURE;
  1004. }
  1005. /**
  1006. * wmi_unified_p2p_go_set_beacon_ie_cmd() - set beacon IE for p2p go
  1007. * @wma_handle: wma handle
  1008. * @vdev_id: vdev id
  1009. * @p2p_ie: p2p IE
  1010. *
  1011. * Return: 0 for success or error code
  1012. */
  1013. CDF_STATUS wmi_unified_p2p_go_set_beacon_ie_cmd(void *wmi_hdl,
  1014. A_UINT32 vdev_id, uint8_t *p2p_ie)
  1015. {
  1016. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1017. if (wmi_handle->ops->send_p2p_go_set_beacon_ie_cmd)
  1018. return wmi_handle->ops->send_p2p_go_set_beacon_ie_cmd(wmi_handle,
  1019. vdev_id, p2p_ie);
  1020. return CDF_STATUS_E_FAILURE;
  1021. }
  1022. /**
  1023. * wmi_unified_set_gateway_params_cmd() - set gateway parameters
  1024. * @wmi_hdl: wmi handle
  1025. * @req: gateway parameter update request structure
  1026. *
  1027. * This function reads the incoming @req and fill in the destination
  1028. * WMI structure and sends down the gateway configs down to the firmware
  1029. *
  1030. * Return: CDF_STATUS
  1031. */
  1032. CDF_STATUS wmi_unified_set_gateway_params_cmd(void *wmi_hdl,
  1033. struct gateway_update_req_param *req)
  1034. {
  1035. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1036. if (wmi_handle->ops->send_set_gateway_params_cmd)
  1037. return wmi_handle->ops->send_set_gateway_params_cmd(wmi_handle,
  1038. req);
  1039. return CDF_STATUS_E_FAILURE;
  1040. }
  1041. /**
  1042. * wmi_unified_set_rssi_monitoring_cmd() - set rssi monitoring
  1043. * @wmi_hdl: wmi handle
  1044. * @req: rssi monitoring request structure
  1045. *
  1046. * This function reads the incoming @req and fill in the destination
  1047. * WMI structure and send down the rssi monitoring configs down to the firmware
  1048. *
  1049. * Return: 0 on success; error number otherwise
  1050. */
  1051. CDF_STATUS wmi_unified_set_rssi_monitoring_cmd(void *wmi_hdl,
  1052. struct rssi_monitor_param *req)
  1053. {
  1054. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1055. if (wmi_handle->ops->send_pno_start_cmd)
  1056. return wmi_handle->ops->send_set_rssi_monitoring_cmd(wmi_handle,
  1057. req);
  1058. return CDF_STATUS_E_FAILURE;
  1059. }
  1060. /**
  1061. * wmi_unified_scan_probe_setoui_cmd() - set scan probe OUI
  1062. * @wmi_hdl: wmi handle
  1063. * @psetoui: OUI parameters
  1064. *
  1065. * set scan probe OUI parameters in firmware
  1066. *
  1067. * Return: CDF status
  1068. */
  1069. CDF_STATUS wmi_unified_scan_probe_setoui_cmd(void *wmi_hdl,
  1070. struct scan_mac_oui *psetoui)
  1071. {
  1072. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1073. if (wmi_handle->ops->send_scan_probe_setoui_cmd)
  1074. return wmi_handle->ops->send_scan_probe_setoui_cmd(wmi_handle,
  1075. psetoui);
  1076. return CDF_STATUS_E_FAILURE;
  1077. }
  1078. /**
  1079. * wmi_unified_reset_passpoint_network_list_cmd() - reset passpoint network list
  1080. * @wmi_hdl: wmi handle
  1081. * @req: passpoint network request structure
  1082. *
  1083. * This function sends down WMI command with network id set to wildcard id.
  1084. * firmware shall clear all the config entries
  1085. *
  1086. * Return: CDF_STATUS enumeration
  1087. */
  1088. CDF_STATUS wmi_unified_reset_passpoint_network_list_cmd(void *wmi_hdl,
  1089. struct wifi_passpoint_req_param *req)
  1090. {
  1091. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1092. if (wmi_handle->ops->send_reset_passpoint_network_list_cmd)
  1093. return wmi_handle->ops->send_reset_passpoint_network_list_cmd(wmi_handle,
  1094. req);
  1095. return CDF_STATUS_E_FAILURE;
  1096. }
  1097. /**
  1098. * wmi_unified_set_passpoint_network_list_cmd() - set passpoint network list
  1099. * @wmi_hdl: wmi handle
  1100. * @req: passpoint network request structure
  1101. *
  1102. * This function reads the incoming @req and fill in the destination
  1103. * WMI structure and send down the passpoint configs down to the firmware
  1104. *
  1105. * Return: CDF_STATUS enumeration
  1106. */
  1107. CDF_STATUS wmi_unified_set_passpoint_network_list_cmd(void *wmi_hdl,
  1108. struct wifi_passpoint_req_param *req)
  1109. {
  1110. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1111. if (wmi_handle->ops->send_set_passpoint_network_list_cmd)
  1112. return wmi_handle->ops->send_set_passpoint_network_list_cmd(wmi_handle,
  1113. req);
  1114. return CDF_STATUS_E_FAILURE;
  1115. }
  1116. /** wmi_unified_set_epno_network_list_cmd() - set epno network list
  1117. * @wmi_hdl: wmi handle
  1118. * @req: epno config params request structure
  1119. *
  1120. * This function reads the incoming epno config request structure
  1121. * and constructs the WMI message to the firmware.
  1122. *
  1123. * Returns: 0 on success, error number otherwise
  1124. */
  1125. CDF_STATUS wmi_unified_set_epno_network_list_cmd(void *wmi_hdl,
  1126. struct wifi_enhanched_pno_params *req)
  1127. {
  1128. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1129. if (wmi_handle->ops->send_set_epno_network_list_cmd)
  1130. return wmi_handle->ops->send_set_epno_network_list_cmd(wmi_handle,
  1131. req);
  1132. return CDF_STATUS_E_FAILURE;
  1133. }
  1134. /** wmi_unified_ipa_offload_control_cmd() - ipa offload control parameter
  1135. * @wmi_hdl: wmi handle
  1136. * @ipa_offload: ipa offload control parameter
  1137. *
  1138. * Returns: 0 on success, error number otherwise
  1139. */
  1140. CDF_STATUS wmi_unified_ipa_offload_control_cmd(void *wmi_hdl,
  1141. struct ipa_offload_control_params *ipa_offload)
  1142. {
  1143. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1144. if (wmi_handle->ops->send_ipa_offload_control_cmd)
  1145. return wmi_handle->ops->send_ipa_offload_control_cmd(wmi_handle,
  1146. ipa_offload);
  1147. return CDF_STATUS_E_FAILURE;
  1148. }
  1149. /**
  1150. * wmi_unified_extscan_get_capabilities_cmd() - extscan get capabilities
  1151. * @wmi_hdl: wmi handle
  1152. * @pgetcapab: get capabilities params
  1153. *
  1154. * This function send request to fw to get extscan capabilities.
  1155. *
  1156. * Return: CDF status
  1157. */
  1158. CDF_STATUS wmi_unified_extscan_get_capabilities_cmd(void *wmi_hdl,
  1159. struct extscan_capabilities_params *pgetcapab)
  1160. {
  1161. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1162. if (wmi_handle->ops->send_extscan_get_capabilities_cmd)
  1163. return wmi_handle->ops->send_extscan_get_capabilities_cmd(wmi_handle,
  1164. pgetcapab);
  1165. return CDF_STATUS_E_FAILURE;
  1166. }
  1167. /**
  1168. * wmi_unified_extscan_get_cached_results_cmd() - extscan get cached results
  1169. * @wmi_hdl: wmi handle
  1170. * @pcached_results: cached results parameters
  1171. *
  1172. * This function send request to fw to get cached results.
  1173. *
  1174. * Return: CDF status
  1175. */
  1176. CDF_STATUS wmi_unified_extscan_get_cached_results_cmd(void *wmi_hdl,
  1177. struct extscan_cached_result_params *pcached_results)
  1178. {
  1179. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1180. if (wmi_handle->ops->send_extscan_get_cached_results_cmd)
  1181. return wmi_handle->ops->send_extscan_get_cached_results_cmd(wmi_handle,
  1182. pcached_results);
  1183. return CDF_STATUS_E_FAILURE;
  1184. }
  1185. /**
  1186. * wmi_unified_extscan_stop_change_monitor_cmd() - send stop change monitor cmd
  1187. * @wmi_hdl: wmi handle
  1188. * @reset_req: Reset change request params
  1189. *
  1190. * This function sends stop change monitor request to fw.
  1191. *
  1192. * Return: CDF status
  1193. */
  1194. CDF_STATUS wmi_unified_extscan_stop_change_monitor_cmd(void *wmi_hdl,
  1195. struct extscan_capabilities_reset_params *reset_req)
  1196. {
  1197. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1198. if (wmi_handle->ops->send_extscan_stop_change_monitor_cmd)
  1199. return wmi_handle->ops->send_extscan_stop_change_monitor_cmd(wmi_handle,
  1200. reset_req);
  1201. return CDF_STATUS_E_FAILURE;
  1202. }
  1203. /**
  1204. * wmi_unified_extscan_start_change_monitor_cmd() - start change monitor cmd
  1205. * @wmi_hdl: wmi handle
  1206. * @psigchange: change monitor request params
  1207. *
  1208. * This function sends start change monitor request to fw.
  1209. *
  1210. * Return: CDF status
  1211. */
  1212. CDF_STATUS wmi_unified_extscan_start_change_monitor_cmd(void *wmi_hdl,
  1213. struct extscan_set_sig_changereq_params *
  1214. psigchange)
  1215. {
  1216. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1217. if (wmi_handle->ops->send_extscan_start_change_monitor_cmd)
  1218. return wmi_handle->ops->send_extscan_start_change_monitor_cmd(wmi_handle,
  1219. psigchange);
  1220. return CDF_STATUS_E_FAILURE;
  1221. }
  1222. /**
  1223. * wmi_unified_extscan_stop_hotlist_monitor_cmd() - stop hotlist monitor
  1224. * @wmi_hdl: wmi handle
  1225. * @photlist_reset: hotlist reset params
  1226. *
  1227. * This function configures hotlist monitor to stop in fw.
  1228. *
  1229. * Return: CDF status
  1230. */
  1231. CDF_STATUS wmi_unified_extscan_stop_hotlist_monitor_cmd(void *wmi_hdl,
  1232. struct extscan_bssid_hotlist_reset_params *photlist_reset)
  1233. {
  1234. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1235. if (wmi_handle->ops->send_extscan_stop_hotlist_monitor_cmd)
  1236. return wmi_handle->ops->send_extscan_stop_hotlist_monitor_cmd(wmi_handle,
  1237. photlist_reset);
  1238. return CDF_STATUS_E_FAILURE;
  1239. }
  1240. /**
  1241. * wmi_unified_stop_extscan_cmd() - stop extscan command to fw.
  1242. * @wmi_hdl: wmi handle
  1243. * @pstopcmd: stop scan command request params
  1244. *
  1245. * This function sends stop extscan request to fw.
  1246. *
  1247. * Return: CDF Status.
  1248. */
  1249. CDF_STATUS wmi_unified_stop_extscan_cmd(void *wmi_hdl,
  1250. struct extscan_stop_req_params *pstopcmd)
  1251. {
  1252. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1253. if (wmi_handle->ops->send_stop_extscan_cmd)
  1254. return wmi_handle->ops->send_stop_extscan_cmd(wmi_handle,
  1255. pstopcmd);
  1256. return CDF_STATUS_E_FAILURE;
  1257. }
  1258. /**
  1259. * wmi_unified_start_extscan_cmd() - start extscan command to fw.
  1260. * @wmi_hdl: wmi handle
  1261. * @pstart: scan command request params
  1262. *
  1263. * This function sends start extscan request to fw.
  1264. *
  1265. * Return: CDF Status.
  1266. */
  1267. CDF_STATUS wmi_unified_start_extscan_cmd(void *wmi_hdl,
  1268. struct wifi_scan_cmd_req_params *pstart)
  1269. {
  1270. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1271. if (wmi_handle->ops->send_start_extscan_cmd)
  1272. return wmi_handle->ops->send_start_extscan_cmd(wmi_handle,
  1273. pstart);
  1274. return CDF_STATUS_E_FAILURE;
  1275. }
  1276. /**
  1277. * wmi_unified_plm_stop_cmd() - plm stop request
  1278. * @wmi_hdl: wmi handle
  1279. * @plm: plm request parameters
  1280. *
  1281. * This function request FW to stop PLM.
  1282. *
  1283. * Return: CDF status
  1284. */
  1285. CDF_STATUS wmi_unified_plm_stop_cmd(void *wmi_hdl,
  1286. const struct plm_req_params *plm)
  1287. {
  1288. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1289. if (wmi_handle->ops->send_plm_stop_cmd)
  1290. return wmi_handle->ops->send_plm_stop_cmd(wmi_handle,
  1291. plm);
  1292. return CDF_STATUS_E_FAILURE;
  1293. }
  1294. /**
  1295. * wmi_unified_plm_start_cmd() - plm start request
  1296. * @wmi_hdl: wmi handle
  1297. * @plm: plm request parameters
  1298. *
  1299. * This function request FW to start PLM.
  1300. *
  1301. * Return: CDF status
  1302. */
  1303. CDF_STATUS wmi_unified_plm_start_cmd(void *wmi_hdl,
  1304. const struct plm_req_params *plm,
  1305. uint32_t *gchannel_list)
  1306. {
  1307. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1308. if (wmi_handle->ops->send_plm_start_cmd)
  1309. return wmi_handle->ops->send_plm_start_cmd(wmi_handle,
  1310. plm, gchannel_list);
  1311. return CDF_STATUS_E_FAILURE;
  1312. }
  1313. /**
  1314. * send_pno_stop_cmd() - PNO stop request
  1315. * @wmi_hdl: wmi handle
  1316. * @vdev_id: vdev id
  1317. *
  1318. * This function request FW to stop ongoing PNO operation.
  1319. *
  1320. * Return: CDF status
  1321. */
  1322. CDF_STATUS wmi_unified_pno_stop_cmd(void *wmi_hdl, uint8_t vdev_id)
  1323. {
  1324. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1325. if (wmi_handle->ops->send_pno_stop_cmd)
  1326. return wmi_handle->ops->send_pno_stop_cmd(wmi_handle,
  1327. vdev_id);
  1328. return CDF_STATUS_E_FAILURE;
  1329. }
  1330. /**
  1331. * wmi_unified_pno_start_cmd() - PNO start request
  1332. * @wmi_hdl: wmi handle
  1333. * @pno: PNO request
  1334. * @gchannel_freq_list: channel frequency list
  1335. *
  1336. * This function request FW to start PNO request.
  1337. * Request: CDF status
  1338. */
  1339. CDF_STATUS wmi_unified_pno_start_cmd(void *wmi_hdl,
  1340. struct pno_scan_req_params *pno,
  1341. uint32_t *gchannel_freq_list)
  1342. {
  1343. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1344. if (wmi_handle->ops->send_pno_start_cmd)
  1345. return wmi_handle->ops->send_pno_start_cmd(wmi_handle,
  1346. pno, gchannel_freq_list);
  1347. return CDF_STATUS_E_FAILURE;
  1348. }
  1349. /* wmi_unified_set_ric_req_cmd() - set ric request element
  1350. * @wmi_hdl: wmi handle
  1351. * @msg: message
  1352. * @is_add_ts: is addts required
  1353. *
  1354. * This function sets ric request element for 11r roaming.
  1355. *
  1356. * Return: none
  1357. */
  1358. CDF_STATUS wmi_unified_set_ric_req_cmd(void *wmi_hdl, void *msg,
  1359. uint8_t is_add_ts)
  1360. {
  1361. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1362. if (wmi_handle->ops->send_set_ric_req_cmd)
  1363. return wmi_handle->ops->send_set_ric_req_cmd(wmi_handle, msg,
  1364. is_add_ts);
  1365. return CDF_STATUS_E_FAILURE;
  1366. }
  1367. /**
  1368. * wmi_unified_process_ll_stats_clear_cmd() - clear link layer stats
  1369. * @wmi_hdl: wmi handle
  1370. * @clear_req: ll stats clear request command params
  1371. * @addr: mac address
  1372. *
  1373. * Return: CDF_STATUS_SUCCESS for success or error code
  1374. */
  1375. CDF_STATUS wmi_unified_process_ll_stats_clear_cmd(void *wmi_hdl,
  1376. const struct ll_stats_clear_params *clear_req,
  1377. uint8_t addr[IEEE80211_ADDR_LEN])
  1378. {
  1379. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1380. if (wmi_handle->ops->send_process_ll_stats_clear_cmd)
  1381. return wmi_handle->ops->send_process_ll_stats_clear_cmd(wmi_handle,
  1382. clear_req, addr);
  1383. return CDF_STATUS_E_FAILURE;
  1384. }
  1385. /**
  1386. * wmi_unified_process_ll_stats_get_cmd() - link layer stats get request
  1387. * @wmi_hdl:wmi handle
  1388. * @get_req:ll stats get request command params
  1389. *
  1390. * Return: CDF_STATUS_SUCCESS for success or error code
  1391. */
  1392. CDF_STATUS wmi_unified_process_ll_stats_get_cmd(void *wmi_hdl,
  1393. const struct ll_stats_get_params *get_req,
  1394. uint8_t addr[IEEE80211_ADDR_LEN])
  1395. {
  1396. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1397. if (wmi_handle->ops->send_process_ll_stats_get_cmd)
  1398. return wmi_handle->ops->send_process_ll_stats_get_cmd(wmi_handle,
  1399. get_req, addr);
  1400. return CDF_STATUS_E_FAILURE;
  1401. }
  1402. /**
  1403. * wmi_unified_get_stats_cmd() - get stats request
  1404. * @wmi_hdl: wma handle
  1405. * @get_stats_param: stats params
  1406. * @addr: mac address
  1407. *
  1408. * Return: none
  1409. */
  1410. CDF_STATUS wmi_unified_get_stats_cmd(void *wmi_hdl,
  1411. struct pe_stats_req *get_stats_param,
  1412. uint8_t addr[IEEE80211_ADDR_LEN])
  1413. {
  1414. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1415. if (wmi_handle->ops->send_get_stats_cmd)
  1416. return wmi_handle->ops->send_get_stats_cmd(wmi_handle,
  1417. get_stats_param, addr);
  1418. return CDF_STATUS_E_FAILURE;
  1419. }
  1420. /**
  1421. * wmi_unified_process_ll_stats_set_cmd() - link layer stats set request
  1422. * @wmi_handle: wmi handle
  1423. * @set_req: ll stats set request command params
  1424. *
  1425. * Return: CDF_STATUS_SUCCESS for success or error code
  1426. */
  1427. CDF_STATUS wmi_unified_process_ll_stats_set_cmd(void *wmi_hdl,
  1428. const struct ll_stats_set_params *set_req)
  1429. {
  1430. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  1431. if (wmi_handle->ops->send_process_ll_stats_set_cmd)
  1432. return wmi_handle->ops->send_process_ll_stats_set_cmd(wmi_handle,
  1433. set_req);
  1434. return CDF_STATUS_E_FAILURE;
  1435. }