wlan_utility.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  1. /*
  2. * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. /**
  18. * DOC: Contains mandatory API from legacy
  19. */
  20. #ifndef _WLAN_UTILITY_H_
  21. #define _WLAN_UTILITY_H_
  22. #include <qdf_types.h>
  23. #include <wlan_objmgr_psoc_obj.h>
  24. #include <wlan_objmgr_pdev_obj.h>
  25. #include <wlan_objmgr_vdev_obj.h>
  26. #define TGT_INVALID_SNR (0)
  27. #define TGT_MAX_SNR (TGT_NOISE_FLOOR_DBM * (-1))
  28. #define TGT_NOISE_FLOOR_DBM (-96)
  29. #define TGT_IS_VALID_SNR(x) ((x) >= 0 && (x) < TGT_MAX_SNR)
  30. #define TGT_IS_VALID_RSSI(x) ((x) != 0xFF)
  31. /**
  32. * struct wlan_vdev_ch_check_filter - vdev chan check filter object
  33. * @flag: matches or not
  34. * @vdev: vdev to be checked against all the active vdevs
  35. */
  36. struct wlan_vdev_ch_check_filter {
  37. uint8_t flag;
  38. struct wlan_objmgr_vdev *vdev;
  39. };
  40. /**
  41. * struct wlan_peer_count- vdev connected peer count
  42. * @opmode: QDF mode
  43. * @peer_count: peer count
  44. **/
  45. struct wlan_op_mode_peer_count {
  46. enum QDF_OPMODE opmode;
  47. uint16_t peer_count;
  48. };
  49. /**
  50. * wlan_construct_shortssid() - construct the short ssid with the help of
  51. * shortssid table
  52. * @ssid: pointer to ssid
  53. * @ssid_len: ssid length
  54. *
  55. * return: short ssid length
  56. */
  57. uint32_t wlan_construct_shortssid(uint8_t *ssid, uint8_t ssid_len);
  58. /**
  59. * wlan_chan_to_freq() - converts channel to frequency
  60. * @chan: channel number
  61. *
  62. * @return frequency of the channel
  63. */
  64. uint32_t wlan_chan_to_freq(uint8_t chan);
  65. /**
  66. * wlan_get_320_center_freq() - find center frequencies for 320Mhz channel
  67. * @freq: Primary frequency
  68. * @center_freq1: possible 1st center frequency
  69. * @center_freq2: possible 2nd center frequency
  70. *
  71. * return: void
  72. **/
  73. void
  74. wlan_get_320_center_freq(qdf_freq_t freq,
  75. qdf_freq_t *center_freq1,
  76. qdf_freq_t *center_freq2);
  77. /**
  78. * wlan_freq_to_chan() - converts frequency to channel
  79. * @freq: frequency
  80. *
  81. * Return: channel of frequency
  82. */
  83. uint8_t wlan_freq_to_chan(uint32_t freq);
  84. /**
  85. * wlan_is_ie_valid() - Determine if an IE sequence is valid
  86. * @ie: Pointer to the IE buffer
  87. * @ie_len: Length of the IE buffer @ie
  88. *
  89. * This function validates that the IE sequence is valid by verifying
  90. * that the sum of the lengths of the embedded elements match the
  91. * length of the sequence.
  92. *
  93. * Note well that a 0-length IE sequence is considered valid.
  94. *
  95. * Return: true if the IE sequence is valid, false if it is invalid
  96. */
  97. bool wlan_is_ie_valid(const uint8_t *ie, size_t ie_len);
  98. /**
  99. * wlan_get_ie_ptr_from_eid() - Find out ie from eid
  100. * @eid: element id
  101. * @ie: source ie address
  102. * @ie_len: source ie length
  103. *
  104. * Return: vendor ie address - success
  105. * NULL - failure
  106. */
  107. const uint8_t *wlan_get_ie_ptr_from_eid(uint8_t eid,
  108. const uint8_t *ie,
  109. int ie_len);
  110. /**
  111. * wlan_get_vendor_ie_ptr_from_oui() - Find out vendor ie
  112. * @oui: oui buffer
  113. * @oui_size: oui size
  114. * @ie: source ie address
  115. * @ie_len: source ie length
  116. *
  117. * This function find out vendor ie by pass source ie and vendor oui.
  118. *
  119. * Return: vendor ie address - success
  120. * NULL - failure
  121. */
  122. const uint8_t *wlan_get_vendor_ie_ptr_from_oui(const uint8_t *oui,
  123. uint8_t oui_size,
  124. const uint8_t *ie,
  125. uint16_t ie_len);
  126. /**
  127. * wlan_get_ext_ie_ptr_from_ext_id() - Find out ext ie
  128. * @oui: oui buffer
  129. * @oui_size: oui size
  130. * @ie: source ie address
  131. * @ie_len: source ie length
  132. *
  133. * This function find out ext ie from ext id (passed oui)
  134. *
  135. * Return: vendor ie address - success
  136. * NULL - failure
  137. */
  138. const uint8_t *wlan_get_ext_ie_ptr_from_ext_id(const uint8_t *oui,
  139. uint8_t oui_size,
  140. const uint8_t *ie,
  141. uint16_t ie_len);
  142. /**
  143. * wlan_get_elem_fragseq_requirements() - Get requirements related to generation
  144. * of element fragment sequence.
  145. *
  146. * @elemid: Element ID
  147. * @payloadlen: Length of element payload to be fragmented. Irrespective of
  148. * whether inline fragmentation in wlan_create_elem_fragseq() is to be used or
  149. * not, this length should not include the length of the element ID and element
  150. * length, and if the element ID is WLAN_ELEMID_EXTN_ELEM, it should not include
  151. * the length of the element ID extension.
  152. * @is_frag_required: Pointer to location where the function should update
  153. * whether fragmentation is required or not for the given element ID and payload
  154. * length. The caller should ignore this if the function returns failure.
  155. * @required_fragbuff_size: Pointer to location where the function should update
  156. * the required minimum size of the buffer where the fragment sequence created
  157. * would be written, starting from the beginning of the buffer (irrespective of
  158. * whether inline fragmentation in wlan_create_elem_fragseq() is to be used or
  159. * not). This is the total size of the element fragment sequence, inclusive of
  160. * the header and payload of the leading element and the headers and payloads of
  161. * all subsequent fragments applicable to that element. If the element ID is
  162. * WLAN_ELEMID_EXTN_ELEM, this also includes the length of the element ID
  163. * extension. The caller should ignore this if the function returns a value of
  164. * false for is_frag_required, or if the function returns failure.
  165. *
  166. * Get information on requirements related to generation of element fragment
  167. * sequence. Currently this includes an indication of whether fragmentation is
  168. * required or not for the given element ID and payload length, and if
  169. * fragmentation is applicable, the minimum required size of the buffer where
  170. * the fragment sequence created would be written (irrespective of whether
  171. * inline fragmentation in wlan_create_elem_fragseq() is to be used or not).
  172. *
  173. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  174. * the reason for error in the case of failure
  175. */
  176. QDF_STATUS
  177. wlan_get_elem_fragseq_requirements(uint8_t elemid,
  178. qdf_size_t payloadlen,
  179. bool *is_frag_required,
  180. qdf_size_t *required_fragbuff_size);
  181. /**
  182. * wlan_get_subelem_fragseq_requirements() - Get requirements related to
  183. * generation of subelement fragment sequence.
  184. *
  185. * @subelemid: Subelement ID
  186. * @payloadlen: Length of subelement payload to be fragmented. Irrespective of
  187. * whether inline fragmentation in wlan_create_subelem_fragseq() is to be used
  188. * or not, this length should not include the length of the subelement ID and
  189. * subelement length.
  190. * @is_frag_required: Pointer to location where the function should update
  191. * whether fragmentation is required or not for the given payload length. The
  192. * caller should ignore this if the function returns failure.
  193. * @required_fragbuff_size: Pointer to location where the function should update
  194. * the required minimum size of the buffer where the fragment sequence created
  195. * would be written, starting from the beginning of the buffer (irrespective of
  196. * whether inline fragmentation in wlan_create_subelem_fragseq() is to be used
  197. * or not). This is the total size of the subelement fragment sequence,
  198. * inclusive of the header and payload of the leading subelement and the headers
  199. * and payloads of all subsequent fragments applicable to that subelement. The
  200. * caller should ignore this if the function returns a value of false for
  201. * is_frag_required, or if the function returns failure.
  202. *
  203. * Get information on requirements related to generation of subelement fragment
  204. * sequence. Currently this includes an indication of whether fragmentation is
  205. * required or not for the given payload length, and if fragmentation is
  206. * applicable, the minimum required size of the buffer where the fragment
  207. * sequence created would be written (irrespective of whether inline
  208. * fragmentation in wlan_create_subelem_fragseq() is to be used or not). Note
  209. * that the subelement ID does not currently play a role in determining the
  210. * requirements, but is added as an argument in case it is required in the
  211. * future.
  212. *
  213. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  214. * the reason for error in the case of failure
  215. */
  216. QDF_STATUS
  217. wlan_get_subelem_fragseq_requirements(uint8_t subelemid,
  218. qdf_size_t payloadlen,
  219. bool *is_frag_required,
  220. qdf_size_t *required_fragbuff_size);
  221. /**
  222. * wlan_is_emulation_platform() - check if platform is emulation based
  223. * @phy_version - psoc nif phy_version
  224. *
  225. * Return: boolean value based on platform type
  226. */
  227. bool wlan_is_emulation_platform(uint32_t phy_version);
  228. /**
  229. * wlan_get_pdev_id_from_vdev_id() - Helper func to derive pdev id from vdev_id
  230. * @psoc: psoc object
  231. * @vdev_id: vdev identifier
  232. * @dbg_id: object manager debug id
  233. *
  234. * This function is used to derive the pdev id from vdev id for a psoc
  235. *
  236. * Return : pdev_id - +ve integer for success and WLAN_INVALID_PDEV_ID
  237. * for failure
  238. */
  239. uint32_t wlan_get_pdev_id_from_vdev_id(struct wlan_objmgr_psoc *psoc,
  240. uint8_t vdev_id,
  241. wlan_objmgr_ref_dbgid dbg_id);
  242. /**
  243. * wlan_util_is_vdev_active() - Check for vdev active
  244. * @pdev: pdev pointer
  245. * @dbg_id: debug id for ref counting
  246. *
  247. * Return: QDF_STATUS_SUCCESS in case of vdev active
  248. * QDF_STATUS_E_INVAL, if dev is not active
  249. */
  250. QDF_STATUS wlan_util_is_vdev_active(struct wlan_objmgr_pdev *pdev,
  251. wlan_objmgr_ref_dbgid dbg_id);
  252. /**
  253. * wlan_vdev_is_up() - Check for vdev is in UP state
  254. * @vdev: vdev pointer
  255. *
  256. * Return: QDF_STATUS_SUCCESS, if vdev is in up, otherwise QDF_STATUS_E_FAILURE
  257. */
  258. QDF_STATUS wlan_vdev_is_up(struct wlan_objmgr_vdev *vdev);
  259. /**
  260. * wlan_util_pdev_vdevs_deschan_match() - function to check des channel matches
  261. * with other vdevs in pdev
  262. * @pdev: pdev object
  263. * @vdev: vdev object
  264. * @ref_id: object manager ref id
  265. *
  266. * This function checks the vdev desired channel with other vdev channels
  267. *
  268. * Return: QDF_STATUS_SUCCESS, if it matches, otherwise QDF_STATUS_E_FAILURE
  269. */
  270. QDF_STATUS wlan_util_pdev_vdevs_deschan_match(struct wlan_objmgr_pdev *pdev,
  271. struct wlan_objmgr_vdev *vdev,
  272. wlan_objmgr_ref_dbgid dbg_id);
  273. /**
  274. * wlan_util_change_map_index() - function to set/reset given index bit
  275. * @map: bitmpap
  276. * @id: bit index
  277. * @set: 1 for set, 0 of reset
  278. *
  279. * This function set/reset given index bit
  280. *
  281. * Return: void
  282. */
  283. void wlan_util_change_map_index(unsigned long *map, uint8_t id, uint8_t set);
  284. /**
  285. * wlan_util_map_index_is_set() - function to check whether given index bit is
  286. * set
  287. * @map: bitmpap
  288. * @id: bit index
  289. *
  290. * This function checks the given index bit is set
  291. *
  292. * Return: true, if bit is set, otherwise false
  293. */
  294. bool wlan_util_map_index_is_set(unsigned long *map, uint8_t id);
  295. /**
  296. * wlan_util_map_is_any_index_set() - Check if any bit is set in given bitmap
  297. * @map: bitmap
  298. * @nbytes: number of bytes in bitmap
  299. *
  300. * Return: true, if any of the bit is set, otherwise false
  301. */
  302. bool wlan_util_map_is_any_index_set(unsigned long *map, unsigned long nbytes);
  303. /**
  304. * wlan_pdev_chan_change_pending_vdevs() - function to test/set channel change
  305. * pending flag
  306. * @pdev: pdev object
  307. * @vdev_id_map: bitmap to derive channel change vdevs
  308. * @ref_id: object manager ref id
  309. *
  310. * This function test/set channel change pending flag
  311. *
  312. * Return: QDF_STATUS_SUCCESS, if it iterates through all vdevs,
  313. * otherwise QDF_STATUS_E_FAILURE
  314. */
  315. QDF_STATUS wlan_pdev_chan_change_pending_vdevs(struct wlan_objmgr_pdev *pdev,
  316. unsigned long *vdev_id_map,
  317. wlan_objmgr_ref_dbgid dbg_id);
  318. /**
  319. * wlan_pdev_chan_change_pending_vdevs_down() - function to test/set down
  320. * change pending flag
  321. * @pdev: pdev object
  322. * @vdev_id_map: bitmap to derive channel change vdevs
  323. * @ref_id: object manager ref id
  324. *
  325. * This function test/set channel change pending flag
  326. *
  327. * Return: QDF_STATUS_SUCCESS, if it iterates through all vdevs,
  328. * otherwise QDF_STATUS_E_FAILURE
  329. */
  330. QDF_STATUS wlan_pdev_chan_change_pending_vdevs_down(
  331. struct wlan_objmgr_pdev *pdev,
  332. unsigned long *vdev_id_map,
  333. wlan_objmgr_ref_dbgid dbg_id);
  334. /**
  335. * wlan_pdev_chan_change_pending_ap_vdevs_down() - function to test/set channel
  336. * change pending flag for AP VDEVs
  337. * @pdev: pdev object
  338. * @vdev_id_map: bitmap to derive channel change AP vdevs
  339. * @ref_id: object manager ref id
  340. *
  341. * This function test/set channel change pending flag for AP vdevs
  342. *
  343. * Return: QDF_STATUS_SUCCESS, if it iterates through all vdevs,
  344. * otherwise QDF_STATUS_E_FAILURE
  345. */
  346. QDF_STATUS wlan_pdev_chan_change_pending_ap_vdevs_down(
  347. struct wlan_objmgr_pdev *pdev,
  348. unsigned long *vdev_id_map,
  349. wlan_objmgr_ref_dbgid dbg_id);
  350. /**
  351. * wlan_chan_eq() - function to check whether both channels are same
  352. * @chan1: channel1 object
  353. * @chan2: channel2 object
  354. *
  355. * This function checks the chan1 and chan2 are same
  356. *
  357. * Return: QDF_STATUS_SUCCESS, if it matches, otherwise QDF_STATUS_E_FAILURE
  358. */
  359. QDF_STATUS wlan_chan_eq(struct wlan_channel *chan1, struct wlan_channel *chan2);
  360. /**
  361. * wlan_chan_copy() - function to copy channel
  362. * @tgt: target channel object
  363. * @src: src achannel object
  364. *
  365. * This function copies channel data from src to tgt
  366. *
  367. * Return: void
  368. */
  369. void wlan_chan_copy(struct wlan_channel *tgt, struct wlan_channel *src);
  370. /**
  371. * wlan_vdev_get_active_channel() - derives the vdev operating channel
  372. * @vdev: VDEV object
  373. *
  374. * This function checks vdev state and return the channel pointer accordingly
  375. *
  376. * Return: active channel, if vdev chan config is valid
  377. * NULL, if VDEV is in INIT or STOP state
  378. */
  379. struct wlan_channel *wlan_vdev_get_active_channel
  380. (struct wlan_objmgr_vdev *vdev);
  381. /**
  382. * wlan_get_connected_vdev_by_bssid() - check/get any vdev connected on bssid
  383. * @pdev: pdev object
  384. * @bssid: bssid to be checked
  385. * @vdev_id: vdev id
  386. *
  387. * This function will loop through all the vdev in psoc and find/return the
  388. * vdev which is connected to bssid provided.
  389. *
  390. * Return: bool
  391. */
  392. bool wlan_get_connected_vdev_by_bssid(struct wlan_objmgr_pdev *pdev,
  393. uint8_t *bssid, uint8_t *vdev_id);
  394. /**
  395. * wlan_get_connected_vdev_from_psoc_by_bssid() - check/get any vdev
  396. * connected on bssid
  397. * @psoc: psoc object
  398. * @bssid: bssid to be checked
  399. * @vdev_id: vdev id
  400. *
  401. * This function will loop through all the vdev in psoc and find/return the
  402. * vdev which is connected to bssid provided.
  403. *
  404. * Return: bool
  405. */
  406. bool wlan_get_connected_vdev_from_psoc_by_bssid(struct wlan_objmgr_psoc *psoc,
  407. uint8_t *bssid,
  408. uint8_t *vdev_id);
  409. #ifdef WLAN_FEATURE_11BE_MLO
  410. /**
  411. * wlan_get_connected_vdev_by_mld_addr() - check/get any vdev
  412. * connected on mld mac
  413. * @psoc: psoc object
  414. * @mld_mac: mld mac to be checked
  415. * @vdev_id: vdev id
  416. *
  417. * This function will loop through all the vdev in psoc and find/return the
  418. * first vdev which is connected to mld mac provided.
  419. *
  420. * Return: bool
  421. */
  422. bool wlan_get_connected_vdev_by_mld_addr(struct wlan_objmgr_psoc *psoc,
  423. uint8_t *mld_mac, uint8_t *vdev_id);
  424. #endif
  425. /**
  426. * wlan_util_stats_get_rssi() - API to get rssi in dbm
  427. * @db2dbm_enabled: If db2dbm capability is enabled
  428. * @bcn_snr: beacon snr
  429. * @dat_snr: data snr
  430. * @rssi: rssi
  431. *
  432. * This function gets the rssi based on db2dbm support. If this feature is
  433. * present in hw then it means firmware directly sends rssi and no converstion
  434. * is required. If this capablity is not present then host needs to convert
  435. * snr to rssi
  436. *
  437. * Return: None
  438. */
  439. void
  440. wlan_util_stats_get_rssi(bool db2dbm_enabled, int32_t bcn_snr, int32_t dat_snr,
  441. int8_t *rssi);
  442. /**
  443. * wlan_util_is_pdev_restart_progress() - Check if any vdev is in restart state
  444. * @pdev: pdev pointer
  445. * @dbg_id: module id
  446. *
  447. * Iterates through all vdevs, checks if any VDEV is in RESTART_PROGRESS
  448. * substate
  449. *
  450. * Return: QDF_STATUS_SUCCESS,if any vdev is in RESTART_PROGRESS substate
  451. * otherwise QDF_STATUS_E_FAILURE
  452. */
  453. QDF_STATUS wlan_util_is_pdev_restart_progress(struct wlan_objmgr_pdev *pdev,
  454. wlan_objmgr_ref_dbgid dbg_id);
  455. /**
  456. * wlan_util_is_pdev_scan_allowed() - Check for vdev is allowed to scan
  457. * @pdev: pdev pointer
  458. * @dbg_id: module id
  459. *
  460. * Iterates through all vdevs, checks if any VDEV is not either in S_INIT or in
  461. * S_UP state
  462. *
  463. * Return: QDF_STATUS_SUCCESS,if scan is allowed, otherwise QDF_STATUS_E_FAILURE
  464. */
  465. QDF_STATUS wlan_util_is_pdev_scan_allowed(struct wlan_objmgr_pdev *pdev,
  466. wlan_objmgr_ref_dbgid dbg_id);
  467. /**
  468. * wlan_util_get_peer_count_for_mode - This api gives vdev mode specific
  469. * peer count`
  470. * @pdev: PDEV object
  471. * @mode: Operation mode.
  472. *
  473. * Return: int- peer count for operating mode
  474. */
  475. uint16_t wlan_util_get_peer_count_for_mode(struct wlan_objmgr_pdev *pdev,
  476. enum QDF_OPMODE mode);
  477. /**
  478. * wlan_minidump_host_data - Data structure type logged in Minidump
  479. * @WLAN_MD_CP_EXT_PDEV - ol_ath_softc_net80211
  480. * @WLAN_MD_CP_EXT_PSOC - ol_ath_soc_softc
  481. * @WLAN_MD_CP_EXT_VDEV - ieee80211vap
  482. * @WLAN_MD_CP_EXT_PEER - ieee80211_node
  483. * @WLAN_MD_DP_SOC - dp_soc
  484. * @WLAN_MD_DP_PDEV - dp_pdev
  485. * @WLAN_MD_DP_VDEV - dp_vdev
  486. * @WLAN_MD_DP_PEER - dp_peer
  487. * @WLAN_MD_DP_SRNG_REO_DEST - dp_srng type for reo dest
  488. * @WLAN_MD_DP_SRNG_REO_EXCEPTION - dp_srng type for reo exception
  489. * @WLAN_MD_DP_SRNG_REO_CMD - dp_srng type for reo cmd
  490. * @WLAN_MD_DP_SRNG_RX_REL - dp_srng type for reo release
  491. * @WLAN_MD_DP_SRNG_REO_REINJECT - dp_srng type for reo reinject
  492. * @WLAN_MD_DP_SRNG_REO_STATUS - dp_srng type for reo status
  493. * @WLAN_MD_DP_SRNG_TCL_DATA - dp_srng type for tcl data
  494. * @WLAN_MD_DP_SRNG_TCL_STATUS - dp_srng type for tcl status
  495. * @WLAN_MD_DP_SRNG_TX_COMP - dp_srng type for tcl comp
  496. * @WLAN_MD_DP_SRNG_WBM_DESC_REL - dp_srng_type for wbm desc rel
  497. * @WLAN_MD_DP_SRNG_WBM_IDLE_LINK - dp_srng type for wbm idle link
  498. * @WLAN_MD_DP_LINK_DESC_BANK - Wbm link_desc_bank
  499. * @WLAN_MD_DP_SRNG_RXDMA_MON_STATUS - dp_srng type for rxdma mon status
  500. * @WLAN_MD_DP_SRNG_RXDMA_MON_BUF - dp_srng type for rxdma mon buf
  501. * @WLAN_MD_DP_SRNG_RXDMA_MON_DST - dp_srng type for rxdma mon dest
  502. * @WLAN_MD_DP_SRNG_RXDMA_MON_DESC - dp_srng type for rxdma mon desc
  503. * @WLAN_MD_DP_SRNG_RXDMA_ERR_DST - dp_srng type for rxdma err dst
  504. * @WLAN_MD_DP_HAL_SOC - hal_soc
  505. * @WLAN_MD_OBJMGR_PSOC - wlan_objmgr_psoc
  506. * @WLAN_MD_OBJMGR_PSOC_TGT_INFO - wlan_objmgr_tgt_psoc_info
  507. * @WLAN_MD_OBJMGR_PDEV - wlan_objmgr_pdev
  508. * @WLAN_MD_OBJMGR_PDEV_MLME - pdev_mlme
  509. * @WLAN_MD_OBJMGR_VDEV - wlan_objmgr_vdev
  510. * @WLAN_MD_OBJMGR_VDEV_MLME -vdev mlme
  511. * @WLAN_MD_OBJMGR_VDEV_SM - wlan_sm
  512. * @WLAN_MD_DP_SRNG_REO2PPE- dp_srng type PPE rx ring
  513. * @WLAN_MD_DP_SRNG_PPE2TCL - dp_srng type for PPE tx ring
  514. * @WLAN_MD_DP_SRNG_PPE_RELEASE - dp_srng type for PPE tx com ring
  515. * @WLAN_MD_MAX - Max value
  516. */
  517. enum wlan_minidump_host_data {
  518. WLAN_MD_CP_EXT_PDEV,
  519. WLAN_MD_CP_EXT_PSOC,
  520. WLAN_MD_CP_EXT_VDEV,
  521. WLAN_MD_CP_EXT_PEER,
  522. WLAN_MD_DP_SOC,
  523. WLAN_MD_DP_PDEV,
  524. WLAN_MD_DP_VDEV,
  525. WLAN_MD_DP_PEER,
  526. WLAN_MD_DP_SRNG_REO_DEST,
  527. WLAN_MD_DP_SRNG_REO_EXCEPTION,
  528. WLAN_MD_DP_SRNG_REO_CMD,
  529. WLAN_MD_DP_SRNG_RX_REL,
  530. WLAN_MD_DP_SRNG_REO_REINJECT,
  531. WLAN_MD_DP_SRNG_REO_STATUS,
  532. WLAN_MD_DP_SRNG_TCL_DATA,
  533. WLAN_MD_DP_SRNG_TCL_CMD,
  534. WLAN_MD_DP_SRNG_TCL_STATUS,
  535. WLAN_MD_DP_SRNG_TX_COMP,
  536. WLAN_MD_DP_SRNG_WBM_DESC_REL,
  537. WLAN_MD_DP_SRNG_WBM_IDLE_LINK,
  538. WLAN_MD_DP_LINK_DESC_BANK,
  539. WLAN_MD_DP_SRNG_RXDMA_MON_STATUS,
  540. WLAN_MD_DP_SRNG_RXDMA_MON_BUF,
  541. WLAN_MD_DP_SRNG_RXDMA_MON_DST,
  542. WLAN_MD_DP_SRNG_RXDMA_MON_DESC,
  543. WLAN_MD_DP_SRNG_RXDMA_ERR_DST,
  544. WLAN_MD_DP_HAL_SOC,
  545. WLAN_MD_OBJMGR_PSOC,
  546. WLAN_MD_OBJMGR_PSOC_TGT_INFO,
  547. WLAN_MD_OBJMGR_PDEV,
  548. WLAN_MD_OBJMGR_PDEV_MLME,
  549. WLAN_MD_OBJMGR_VDEV,
  550. WLAN_MD_OBJMGR_VDEV_MLME,
  551. WLAN_MD_OBJMGR_VDEV_SM,
  552. WLAN_MD_DP_SRNG_REO2PPE,
  553. WLAN_MD_DP_SRNG_PPE2TCL,
  554. WLAN_MD_DP_SRNG_PPE_RELEASE,
  555. WLAN_MD_MAX
  556. };
  557. /**
  558. * wlan_minidump_log() - Log memory address to be included in minidump
  559. * @start_addr: Start address of the memory to be dumped
  560. * @size: Size in bytes
  561. * @psoc_obj: Psoc Object
  562. * @type: Type of data structure
  563. * @name: String to identify this entry
  564. */
  565. void wlan_minidump_log(void *start_addr, const size_t size,
  566. void *psoc_obj,
  567. enum wlan_minidump_host_data type,
  568. const char *name);
  569. /**
  570. * wlan_minidump_remove() - Remove memory address from minidump
  571. * @start_addr: Start address of the memory previously added
  572. * @size: Size in bytes
  573. * @psoc_obj: Psoc Object
  574. * @type: Type of data structure
  575. * @name: String to identify this entry
  576. */
  577. void wlan_minidump_remove(void *start_addr, const size_t size,
  578. void *psoc_obj,
  579. enum wlan_minidump_host_data type,
  580. const char *name);
  581. #endif /* _WLAN_UTILITY_H_ */