wlan_utility.h 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014
  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_create_elem_fragseq() - Create sequence of element fragments
  183. *
  184. * @inline_frag: Whether to use inline fragmentation, wherein the fragmentation
  185. * is carried out inline within the source buffer and no memmoves/memcopy would
  186. * be required for the lead element.
  187. * @elemid: Element ID
  188. * @elemidext: Element ID extension. This is applicable only if elemid is
  189. * WLAN_ELEMID_EXTN_ELEM, otherwise it is ignored.
  190. * @payloadbuff: Buffer containing the element payload to be fragmented. If
  191. * inline fragmentation is selected, the corresponding element fragment sequence
  192. * will be generated inline into this buffer, and prior to the payload the
  193. * buffer should have two bytes reserved in the beginning for the element ID and
  194. * element length fields to be written, and a third byte reserved after them for
  195. * the element ID extension to be written (if the element ID is
  196. * WLAN_ELEMID_EXTN_ELEM).
  197. * @payloadbuff_maxsize: Maximum size of payloadbuff
  198. * @payloadlen: Length of element payload to be fragmented. Irrespective of
  199. * whether inline fragmentation is to be used or not, this should not include
  200. * the length of the element ID and element length, and if the element ID is
  201. * WLAN_ELEMID_EXTN_ELEM, it should not include the length of the element ID
  202. * extension.
  203. * @fragbuff: The buffer into which the element fragment sequence should be
  204. * generated. This is inapplicable and ignored if inline fragmentation is used.
  205. * @fragbuff_maxsize: The maximum size of fragbuff. This is inapplicable and
  206. * ignored if inline fragmentation is used.
  207. * @fragseqlen: Pointer to location where the length of the fragment sequence
  208. * created should be written. This is the total length of the element fragment
  209. * sequence, inclusive of the header and payload of the leading element and the
  210. * headers and payloads of all subsequent fragments applicable to that element.
  211. * If the element ID is WLAN_ELEMID_EXTN_ELEM, this also includes the length of
  212. * the element ID extension. The caller should ignore this if the function
  213. * returns failure.
  214. *
  215. * Create a sequence of element fragments. In case fragmentation is not required
  216. * for the given element ID and payload length, the function returns an error.
  217. * This function is intended to be used by callers which do not have the ability
  218. * (or for maintainability purposes do not desire the complexity) to inject new
  219. * fragments on the fly where required, when populating the fields in the
  220. * element (which would completely eliminate memory moves/copies). An inline
  221. * mode is available to carry out the fragmentation within the source buffer in
  222. * order to reduce buffer requirements and to eliminate memory copies/moves for
  223. * the lead element. In the inline mode, the source buffer should have bytes
  224. * reserved in the beginning for the element ID, element length, and if
  225. * applicable, the element ID extension. In the inline mode the buffer content
  226. * (if any) after the fragments is moved as well.
  227. *
  228. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  229. * the reason for error in the case of failure
  230. */
  231. QDF_STATUS wlan_create_elem_fragseq(bool inline_frag,
  232. uint8_t elemid,
  233. uint8_t elemidext,
  234. uint8_t *payloadbuff,
  235. qdf_size_t payloadbuff_maxsize,
  236. qdf_size_t payloadlen,
  237. uint8_t *fragbuff,
  238. qdf_size_t fragbuff_maxsize,
  239. qdf_size_t *fragseqlen);
  240. /**
  241. * wlan_get_subelem_fragseq_requirements() - Get requirements related to
  242. * generation of subelement fragment sequence.
  243. *
  244. * @subelemid: Subelement ID
  245. * @payloadlen: Length of subelement payload to be fragmented. Irrespective of
  246. * whether inline fragmentation in wlan_create_subelem_fragseq() is to be used
  247. * or not, this length should not include the length of the subelement ID and
  248. * subelement length.
  249. * @is_frag_required: Pointer to location where the function should update
  250. * whether fragmentation is required or not for the given payload length. The
  251. * caller should ignore this if the function returns failure.
  252. * @required_fragbuff_size: Pointer to location where the function should update
  253. * the required minimum size of the buffer where the fragment sequence created
  254. * would be written, starting from the beginning of the buffer (irrespective of
  255. * whether inline fragmentation in wlan_create_subelem_fragseq() is to be used
  256. * or not). This is the total size of the subelement fragment sequence,
  257. * inclusive of the header and payload of the leading subelement and the headers
  258. * and payloads of all subsequent fragments applicable to that subelement. The
  259. * caller should ignore this if the function returns a value of false for
  260. * is_frag_required, or if the function returns failure.
  261. *
  262. * Get information on requirements related to generation of subelement fragment
  263. * sequence. Currently this includes an indication of whether fragmentation is
  264. * required or not for the given payload length, and if fragmentation is
  265. * applicable, the minimum required size of the buffer where the fragment
  266. * sequence created would be written (irrespective of whether inline
  267. * fragmentation in wlan_create_subelem_fragseq() is to be used or not). Note
  268. * that the subelement ID does not currently play a role in determining the
  269. * requirements, but is added as an argument in case it is required in the
  270. * future.
  271. *
  272. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  273. * the reason for error in the case of failure
  274. */
  275. QDF_STATUS
  276. wlan_get_subelem_fragseq_requirements(uint8_t subelemid,
  277. qdf_size_t payloadlen,
  278. bool *is_frag_required,
  279. qdf_size_t *required_fragbuff_size);
  280. /**
  281. * wlan_create_subelem_fragseq() - Create sequence of subelement fragments
  282. *
  283. * @inline_frag: Whether to use inline fragmentation, wherein the fragmentation
  284. * is carried out inline within the source buffer and no memmoves/memcopy would
  285. * be required for the lead subelement.
  286. * @subelemid: Subelement ID
  287. * @subelemid: Fragment ID to be used for the subelement (this can potentially
  288. * vary across protocol areas)
  289. * @payloadbuff: Buffer containing the subelement payload to be fragmented. If
  290. * inline fragmentation is selected, the corresponding subelement fragment
  291. * sequence will be generated inline into this buffer, and prior to the payload
  292. * the buffer should have two bytes reserved in the beginning for the subelement
  293. * ID and subelement length fields to be written.
  294. * @payloadbuff_maxsize: Maximum size of payloadbuff
  295. * @payloadlen: Length of subelement payload to be fragmented. Irrespective of
  296. * whether inline fragmentation is to be used or not, this should not include
  297. * the length of the subelement ID and subelement length.
  298. * @fragbuff: The buffer into which the subelement fragment sequence should be
  299. * generated. This is inapplicable and ignored if inline fragmentation is used.
  300. * @fragbuff_maxsize: The maximum size of fragbuff. This is inapplicable and
  301. * ignored if inline fragmentation is used.
  302. * @fragseqlen: Pointer to location where the length of the fragment sequence
  303. * created should be written. This is the total length of the subelement
  304. * fragment sequence, inclusive of the header and payload of the leading
  305. * subelement and the headers and payloads of all subsequent fragments
  306. * applicable to that subelement. The caller should ignore this if the function
  307. * returns failure.
  308. *
  309. * Create a sequence of subelement fragments. In case fragmentation is not
  310. * required for the given payload length, the function returns an error. This
  311. * function is intended to be used by callers which do not have the ability (or
  312. * for maintainability purposes do not desire the complexity) to inject new
  313. * fragments on the fly where required, when populating the fields in the
  314. * subelement (which would completely eliminate memory moves/copies). An inline
  315. * mode is available to carry out the fragmentation within the source buffer in
  316. * order to reduce buffer requirements and to eliminate memory copies/moves for
  317. * the lead subelement. In the inline mode, the source buffer should have bytes
  318. * reserved in the beginning for the subelement ID and the subelement length. In
  319. * the inline mode the buffer content (if any) after the fragments is moved as
  320. * well.
  321. *
  322. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  323. * the reason for error in the case of failure
  324. */
  325. QDF_STATUS wlan_create_subelem_fragseq(bool inline_frag,
  326. uint8_t subelemid,
  327. uint8_t subelemfragid,
  328. uint8_t *payloadbuff,
  329. qdf_size_t payloadbuff_maxsize,
  330. qdf_size_t payloadlen,
  331. uint8_t *fragbuff,
  332. qdf_size_t fragbuff_maxsize,
  333. qdf_size_t *fragseqlen);
  334. /**
  335. * wlan_get_elem_fragseq_info() - Get information about element fragment
  336. * sequence
  337. *
  338. * @elembuff: Buffer containing a series of elements to be checked for whether a
  339. * contiguous subset of these elements (starting with the first element in the
  340. * buffer) form an element fragment sequence. The buffer should start with the
  341. * Element ID of the first element. The buffer should not contain any material
  342. * other than elements.
  343. * @elembuff_maxsize: Maximum size of elembuff
  344. * @is_fragseq: Pointer to location of a flag indicating whether this is an
  345. * element fragment sequence or not. The flag will be set to true if elembuff
  346. * contains an element fragment sequence starting with the element present in
  347. * the beginning of the buffer, or the flag will be set to false if the buffer
  348. * contains a single non-fragmented element in the beginning. Please note
  349. * standards related limitation given in function description below.
  350. * @fragseq_totallen: Pointer to location of total length of element fragment
  351. * sequence. If is_fragseq is true, then this is set to the total length of the
  352. * element fragment sequence, inclusive of the header and payload of the leading
  353. * element and the headers and payloads of all subsequent fragments applicable
  354. * to that element. If is_fragseq is false, the caller should ignore this.
  355. * Please note standards related limitation given in function description below.
  356. * @fragseq_payloadlen: Pointer to location of length of payload of element
  357. * fragment sequence. If is_fragseq is true, then this length is set to the
  358. * total size of the element fragment sequence payload, which does not include
  359. * the sizes of the headers of the lead element and subsequent fragments, and
  360. * which (if the lead element's element ID is WLAN_ELEMID_EXTN_ELEM) does not
  361. * include the size of the lead element's element ID extension. If is_fragseq is
  362. * false, the caller should ignore this. Please note standards related
  363. * limitation given in function description below.
  364. *
  365. * Get the following information for a first element present in the beginning of
  366. * a given buffer, and a series of elements after it in the given buffer: a)
  367. * Whether a contiguous subset of these elements starting with the first element
  368. * form an element fragment sequence. b) If they form an element fragment
  369. * sequence, then the total length of this sequence inclusive of headers and
  370. * payloads of all the elements in the sequence. c) If they form an element
  371. * fragment sequence, then the total size of the payloads of all the elements in
  372. * the sequence (not including the element ID extension of the lead element, if
  373. * applicable). While determining this information, the function may return
  374. * errors, including for protocol parsing issues. These protocol parsing issues
  375. * include one in which the first element has a length lesser than 255, but the
  376. * very next element after it is a fragment element (which is not allowed by the
  377. * standard). Separately, please note a limitation arising from the standard
  378. * wherein if the caller passes a truncated maximum buffer size such that the
  379. * buffer ends prematurely just at the end of a potential lead element with
  380. * length 255 or just at the end of a non-lead fragment element with length 255,
  381. * the function will have to conclude that the last successfully parsed element
  382. * is the final one in the non-fragment or fragment sequence, and return results
  383. * accordingly. If another fragment actually exists beyond the given buffer,
  384. * this function cannot detect the condition since there is no provision in the
  385. * standard to indicate a total fragment sequence size in one place in the
  386. * beginning or anywhere else. Hence the caller should take care to provide the
  387. * complete buffer with the max size set accordingly.
  388. *
  389. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  390. * the reason for error in the case of failure
  391. */
  392. QDF_STATUS wlan_get_elem_fragseq_info(uint8_t *elembuff,
  393. qdf_size_t elembuff_maxsize,
  394. bool *is_fragseq,
  395. qdf_size_t *fragseq_totallen,
  396. qdf_size_t *fragseq_payloadlen);
  397. /**
  398. * wlan_defrag_elem_fragseq() - Defragment sequence of element fragments
  399. *
  400. * @inline_defrag: Whether to use inline defragmentation, wherein the
  401. * defragmentation is carried out inline within the source buffer and no
  402. * memmoves/memcopy would be required for the lead element.
  403. * @fragbuff: Source buffer containing the element fragment sequence starting
  404. * with the Element ID of the lead element. The buffer should not contain any
  405. * material other than elements. If inline defragmentation is enabled, the
  406. * corresponding defragmented payload will be generated inline into this buffer
  407. * and the defragmented payload will start after the location of the lead
  408. * element's element ID, element length, and (if the lead element's element ID
  409. * is WLAN_ELEMID_EXTN_ELEM), the element ID extension. This defragmented
  410. * payload will not contain the headers of any of the other fragments in the
  411. * fragment sequence.
  412. * @fragbuff_maxsize: Maximum size of fragbuff. This should be greater than or
  413. * equal to the total size of the element fragment sequence, inclusive of the
  414. * header and payload of the leading element and the headers and payloads of all
  415. * subsequent fragments applicable to that element.
  416. * @defragbuff: The destination buffer into which the defragmented payload
  417. * should be copied. This is inapplicable and ignored if inline_defrag is true.
  418. * The defragmented payload will be copied to the start of the destination
  419. * buffer without including the headers of the lead element and the subsequent
  420. * fragment elements, and (if the lead element's element ID is
  421. * WLAN_ELEMID_EXTN_ELEM), without including the element ID extension.
  422. * @defragbuff_maxsize: Maximum size of defragbuff. This is inapplicable and
  423. * ignored if inline_defrag is true. The size should be large enough to contain
  424. * the entire defragmented payload, otherwise an error will be returned.
  425. * @defragpayload_len: Pointer to the location where the length of the
  426. * defragmented payload should be updated. Irrespective of whether inline_defrag
  427. * is true or false, this will not include the sizes of the headers of the lead
  428. * element and subsequent fragments, and (if the lead element's element ID is
  429. * WLAN_ELEMID_EXTN_ELEM), it will not include the size of the lead element's
  430. * element ID extension. Please note standards related limitation given in
  431. * function description below.
  432. *
  433. * Defragment a sequence of element fragments. If the source buffer does not
  434. * contain an element fragment sequence (in the beginning), an error is
  435. * returned. An inline mode is available to carry out the defragmentation within
  436. * the source buffer in order to reduce buffer requirements and to eliminate
  437. * memory copies/moves for the lead element. In the inline mode, the buffer
  438. * content (if any) after the fragments is moved as well. The contents of the
  439. * defragmented payload are intended for end consumption by control path
  440. * protocol processing code within the driver in a manner uniform with other
  441. * protocol data in byte buffers, and not for onward forwarding to other
  442. * subsystems or for intrusive specialized processing different from other
  443. * protocol data. Hence zero copy methods such as network buffer fragment
  444. * processing, etc. are not used in this use case. Additionally, this API is
  445. * intended for use cases where the nature of the payload is complex and it is
  446. * infeasible for the caller to skip the (un-defragmented) fragment boundaries
  447. * on its own in a scalable and maintainable manner. Separately, please note a
  448. * limitation arising from the standard wherein if the caller passes a truncated
  449. * maximum buffer size such that the buffer ends prematurely just at the end of
  450. * a fragment element with length 255, the function will have to conclude that
  451. * the last successfully parsed fragment element is the final one in the
  452. * fragment sequence, and return results accordingly. If another fragment
  453. * actually exists beyond the given buffer, this function cannot detect the
  454. * condition since there is no provision in the standard to indicate a total
  455. * fragment sequence size in one place in the beginning or anywhere else. Hence
  456. * the caller should take care to provide the complete buffer with the max size
  457. * set accordingly.
  458. *
  459. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  460. * the reason for error in the case of failure
  461. */
  462. QDF_STATUS wlan_defrag_elem_fragseq(bool inline_defrag,
  463. uint8_t *fragbuff,
  464. qdf_size_t fragbuff_maxsize,
  465. uint8_t *defragbuff,
  466. qdf_size_t defragbuff_maxsize,
  467. qdf_size_t *defragpayload_len);
  468. /**
  469. * wlan_get_subelem_fragseq_info() - Get information about subelement fragment
  470. * sequence
  471. *
  472. * @subelemid: Fragment ID applicable for the subelement (this can potentially
  473. * vary across protocol areas)
  474. * @subelembuff: Buffer containing a series of subelements to be checked for
  475. * whether a contiguous subset of these subelements (starting with the first
  476. * subelement in the buffer) form a subelement fragment sequence. The containing
  477. * element is required to have already been defragmented (if applicable). The
  478. * buffer should start with the subelement ID of the first subelement. The
  479. * buffer should not contain any material apart from subelements.
  480. * @subelembuff_maxsize: Maximum size of subelembuff
  481. * @is_fragseq: Pointer to location of a flag indicating whether this is a
  482. * subelement fragment sequence or not. The flag will be set to true if the
  483. * buffer contains a subelement fragment sequence starting with the subelement
  484. * present in the beginning of the buffer, or the flag will be set to false if
  485. * the buffer contains a single non-fragmented subelement in the beginning.
  486. * Please note standards related limitation given in function description below.
  487. * @fragseq_totallen: Pointer to location of total length of subelement fragment
  488. * sequence. If is_fragseq is true, then this is set to the total length of the
  489. * subelement fragment sequence, inclusive of the header and payload of the
  490. * leading subelement and the headers and payloads of all subsequent fragments
  491. * applicable to that subelement. If is_fragseq is false, the caller should
  492. * ignore this. Please note standards related limitation given in function
  493. * description below.
  494. * @fragseq_payloadlen: Pointer to location of length of payload of subelement
  495. * fragment sequence. If is_fragseq is true, then this length is set to the
  496. * total size of the subelement fragment sequence payload, which does not
  497. * include the sizes of the headers of the lead subelement and subsequent
  498. * fragments. If is_fragseq is false, the caller should ignore this. Please note
  499. * standards related limitation given in function description below.
  500. *
  501. * Get the following information for a first subelement present in the beginning
  502. * of a given buffer, and a series of subelements after it in the given buffer:
  503. * a) Whether a contiguous subset of these subelements starting with the first
  504. * subelement form a subelement fragment sequence. b) If they form a subelement
  505. * fragment sequence, then the total length of this sequence inclusive of
  506. * headers and payloads of all the subelements in the sequence. c) If they form
  507. * a subelement fragment sequence, then the total size of the payloads of all
  508. * the subelements in the sequence. While determining this information, the
  509. * function may return errors, including for protocol parsing issues. These
  510. * protocol parsing issues include one in which the first subelement has a
  511. * length lesser than 255, but the very next subelement after it is a fragment
  512. * subelement (which is not allowed by the standard so far). Separately, please
  513. * note a limitation arising from the standard wherein if the caller passes a
  514. * truncated maximum buffer size such that the buffer ends prematurely just at
  515. * the end of a potential lead subelement with length 255 or just at the end of
  516. * a non-lead fragment subelement with length 255, the function will have to
  517. * conclude that the last successfully parsed subelement is the final one in the
  518. * non-fragment or fragment sequence, and return results accordingly. If another
  519. * fragment actually exists beyond the given buffer, this function cannot detect
  520. * the condition since there is no provision in the standard to indicate a total
  521. * fragment sequence size in one place in the beginning or anywhere else. Hence
  522. * the caller should take care to provide the complete buffer with the max size
  523. * set accordingly.
  524. *
  525. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  526. * the reason for error in the case of failure
  527. */
  528. QDF_STATUS wlan_get_subelem_fragseq_info(uint8_t subelemfragid,
  529. uint8_t *subelembuff,
  530. qdf_size_t subelembuff_maxsize,
  531. bool *is_fragseq,
  532. qdf_size_t *fragseq_totallen,
  533. qdf_size_t *fragseq_payloadlen);
  534. /**
  535. * wlan_defrag_subelem_fragseq() - Defragment sequence of subelement fragments
  536. *
  537. * @inline_defrag: Whether to use inline defragmentation, wherein the
  538. * defragmentation is carried out inline within the source buffer and no
  539. * memmoves/memcopy would be required for the lead subelement.
  540. * @subelemid: Fragment ID applicable for the subelement (this can potentially
  541. * vary across protocol areas)
  542. * @fragbuff: Source buffer containing the subelement fragment sequence starting
  543. * with the subelement ID of the lead subelement. The containing element is
  544. * required to have already been defragmented (if applicable). If inline
  545. * defragmentation is enabled, the corresponding defragmented payload will be
  546. * generated inline into this buffer and the defragmented payload will start
  547. * after the location of the lead subelement's subelement ID and subelement
  548. * length. This defragmented payload will not contain the headers of any of the
  549. * other fragments in the fragment sequence.
  550. * @fragbuff_maxsize: Maximum size of fragbuff. This should be greater than or
  551. * equal to the total size of the subelement fragment sequence, inclusive of the
  552. * header and payload of the leading subelement and the headers and payloads of
  553. * all subsequent fragments applicable to that subelement.
  554. * @defragbuff: The destination buffer into which the defragmented payload
  555. * should be copied. This is inapplicable and ignored if inline_defrag is true.
  556. * The defragmented payload will be copied to the start of the destination
  557. * buffer without including the headers of the lead subelement and the
  558. * subsequent fragment subelements.
  559. * @defragbuff_maxsize: Maximum size of defragbuff. This is inapplicable and
  560. * ignored if inline_defrag is true. The size should be large enough to contain
  561. * the entire defragmented payload, otherwise an error will be returned.
  562. * @defragpayload_len: Pointer to the location where the length of the
  563. * defragmented payload should be updated. Irrespective of whether inline_defrag
  564. * is true or false, this will not include the sizes of the headers of the lead
  565. * subelement and subsequent fragments. Please note standards related limitation
  566. * given in function description below.
  567. *
  568. * Defragment a sequence of subelement fragments. If the source buffer does not
  569. * contain a subelement fragment sequence (in the beginning), the function
  570. * returns an error. The containing element is required to have already been
  571. * defragmented. An inline mode is available to carry out the defragmentation
  572. * within the source buffer in order to reduce buffer requirements and to
  573. * eliminate memory copies/moves for the lead subelement. In the inline mode,
  574. * the buffer content (if any) after the fragments is moved as well. The
  575. * contents of the defragmented payload are intended for end consumption by
  576. * control path protocol processing code within the driver in a manner uniform
  577. * with other protocol data in byte buffers, and not for onward forwarding to
  578. * other subsystems or for intrusive specialized processing different from other
  579. * protocol data. Hence zero copy methods such as network buffer fragment
  580. * processing, etc. are not used in this use case. Additionally, this API is
  581. * intended for use cases where the nature of the payload is complex and it is
  582. * infeasible for the caller to skip the (un-defragmented) fragment boundaries
  583. * on its own in a scalable and maintainable manner. Separately, please note a
  584. * limitation arising from the standard wherein if the caller passes a truncated
  585. * maximum buffer size such that the buffer ends prematurely just at the end of
  586. * a fragment subelement with length 255, the function will have to conclude
  587. * that the last successfully parsed fragment subelement is the final one in the
  588. * fragment sequence, and return results accordingly. If another fragment
  589. * actually exists beyond the given buffer, this function cannot detect the
  590. * condition since there is no provision in the standard to indicate a total
  591. * fragment sequence size in one place in the beginning or anywhere else. Hence
  592. * the caller should take care to provide the complete buffer with the max size
  593. * set accordingly.
  594. *
  595. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  596. * the reason for error in the case of failure
  597. */
  598. QDF_STATUS wlan_defrag_subelem_fragseq(bool inline_defrag,
  599. uint8_t subelemfragid,
  600. uint8_t *fragbuff,
  601. qdf_size_t fragbuff_maxsize,
  602. uint8_t *defragbuff,
  603. qdf_size_t defragbuff_maxsize,
  604. qdf_size_t *defragpayload_len);
  605. /**
  606. * wlan_is_emulation_platform() - check if platform is emulation based
  607. * @phy_version - psoc nif phy_version
  608. *
  609. * Return: boolean value based on platform type
  610. */
  611. bool wlan_is_emulation_platform(uint32_t phy_version);
  612. /**
  613. * wlan_get_pdev_id_from_vdev_id() - Helper func to derive pdev id from vdev_id
  614. * @psoc: psoc object
  615. * @vdev_id: vdev identifier
  616. * @dbg_id: object manager debug id
  617. *
  618. * This function is used to derive the pdev id from vdev id for a psoc
  619. *
  620. * Return : pdev_id - +ve integer for success and WLAN_INVALID_PDEV_ID
  621. * for failure
  622. */
  623. uint32_t wlan_get_pdev_id_from_vdev_id(struct wlan_objmgr_psoc *psoc,
  624. uint8_t vdev_id,
  625. wlan_objmgr_ref_dbgid dbg_id);
  626. /**
  627. * wlan_util_is_vdev_active() - Check for vdev active
  628. * @pdev: pdev pointer
  629. * @dbg_id: debug id for ref counting
  630. *
  631. * Return: QDF_STATUS_SUCCESS in case of vdev active
  632. * QDF_STATUS_E_INVAL, if dev is not active
  633. */
  634. QDF_STATUS wlan_util_is_vdev_active(struct wlan_objmgr_pdev *pdev,
  635. wlan_objmgr_ref_dbgid dbg_id);
  636. /**
  637. * wlan_vdev_is_up() - Check for vdev is in UP state
  638. * @vdev: vdev pointer
  639. *
  640. * Return: QDF_STATUS_SUCCESS, if vdev is in up, otherwise QDF_STATUS_E_FAILURE
  641. */
  642. QDF_STATUS wlan_vdev_is_up(struct wlan_objmgr_vdev *vdev);
  643. /**
  644. * wlan_util_pdev_vdevs_deschan_match() - function to check des channel matches
  645. * with other vdevs in pdev
  646. * @pdev: pdev object
  647. * @vdev: vdev object
  648. * @ref_id: object manager ref id
  649. *
  650. * This function checks the vdev desired channel with other vdev channels
  651. *
  652. * Return: QDF_STATUS_SUCCESS, if it matches, otherwise QDF_STATUS_E_FAILURE
  653. */
  654. QDF_STATUS wlan_util_pdev_vdevs_deschan_match(struct wlan_objmgr_pdev *pdev,
  655. struct wlan_objmgr_vdev *vdev,
  656. wlan_objmgr_ref_dbgid dbg_id);
  657. /**
  658. * wlan_util_change_map_index() - function to set/reset given index bit
  659. * @map: bitmpap
  660. * @id: bit index
  661. * @set: 1 for set, 0 of reset
  662. *
  663. * This function set/reset given index bit
  664. *
  665. * Return: void
  666. */
  667. void wlan_util_change_map_index(unsigned long *map, uint8_t id, uint8_t set);
  668. /**
  669. * wlan_util_map_index_is_set() - function to check whether given index bit is
  670. * set
  671. * @map: bitmpap
  672. * @id: bit index
  673. *
  674. * This function checks the given index bit is set
  675. *
  676. * Return: true, if bit is set, otherwise false
  677. */
  678. bool wlan_util_map_index_is_set(unsigned long *map, uint8_t id);
  679. /**
  680. * wlan_util_map_is_any_index_set() - Check if any bit is set in given bitmap
  681. * @map: bitmap
  682. * @nbytes: number of bytes in bitmap
  683. *
  684. * Return: true, if any of the bit is set, otherwise false
  685. */
  686. bool wlan_util_map_is_any_index_set(unsigned long *map, unsigned long nbytes);
  687. /**
  688. * wlan_pdev_chan_change_pending_vdevs() - function to test/set channel change
  689. * pending flag
  690. * @pdev: pdev object
  691. * @vdev_id_map: bitmap to derive channel change vdevs
  692. * @ref_id: object manager ref id
  693. *
  694. * This function test/set channel change pending flag
  695. *
  696. * Return: QDF_STATUS_SUCCESS, if it iterates through all vdevs,
  697. * otherwise QDF_STATUS_E_FAILURE
  698. */
  699. QDF_STATUS wlan_pdev_chan_change_pending_vdevs(struct wlan_objmgr_pdev *pdev,
  700. unsigned long *vdev_id_map,
  701. wlan_objmgr_ref_dbgid dbg_id);
  702. /**
  703. * wlan_pdev_chan_change_pending_vdevs_down() - function to test/set down
  704. * change pending flag
  705. * @pdev: pdev object
  706. * @vdev_id_map: bitmap to derive channel change vdevs
  707. * @ref_id: object manager ref id
  708. *
  709. * This function test/set channel change pending flag
  710. *
  711. * Return: QDF_STATUS_SUCCESS, if it iterates through all vdevs,
  712. * otherwise QDF_STATUS_E_FAILURE
  713. */
  714. QDF_STATUS wlan_pdev_chan_change_pending_vdevs_down(
  715. struct wlan_objmgr_pdev *pdev,
  716. unsigned long *vdev_id_map,
  717. wlan_objmgr_ref_dbgid dbg_id);
  718. /**
  719. * wlan_pdev_chan_change_pending_ap_vdevs_down() - function to test/set channel
  720. * change pending flag for AP VDEVs
  721. * @pdev: pdev object
  722. * @vdev_id_map: bitmap to derive channel change AP vdevs
  723. * @ref_id: object manager ref id
  724. *
  725. * This function test/set channel change pending flag for AP vdevs
  726. *
  727. * Return: QDF_STATUS_SUCCESS, if it iterates through all vdevs,
  728. * otherwise QDF_STATUS_E_FAILURE
  729. */
  730. QDF_STATUS wlan_pdev_chan_change_pending_ap_vdevs_down(
  731. struct wlan_objmgr_pdev *pdev,
  732. unsigned long *vdev_id_map,
  733. wlan_objmgr_ref_dbgid dbg_id);
  734. /**
  735. * wlan_chan_eq() - function to check whether both channels are same
  736. * @chan1: channel1 object
  737. * @chan2: channel2 object
  738. *
  739. * This function checks the chan1 and chan2 are same
  740. *
  741. * Return: QDF_STATUS_SUCCESS, if it matches, otherwise QDF_STATUS_E_FAILURE
  742. */
  743. QDF_STATUS wlan_chan_eq(struct wlan_channel *chan1, struct wlan_channel *chan2);
  744. /**
  745. * wlan_chan_copy() - function to copy channel
  746. * @tgt: target channel object
  747. * @src: src achannel object
  748. *
  749. * This function copies channel data from src to tgt
  750. *
  751. * Return: void
  752. */
  753. void wlan_chan_copy(struct wlan_channel *tgt, struct wlan_channel *src);
  754. /**
  755. * wlan_vdev_get_active_channel() - derives the vdev operating channel
  756. * @vdev: VDEV object
  757. *
  758. * This function checks vdev state and return the channel pointer accordingly
  759. *
  760. * Return: active channel, if vdev chan config is valid
  761. * NULL, if VDEV is in INIT or STOP state
  762. */
  763. struct wlan_channel *wlan_vdev_get_active_channel
  764. (struct wlan_objmgr_vdev *vdev);
  765. /**
  766. * wlan_get_connected_vdev_by_bssid() - check/get any vdev connected on bssid
  767. * @pdev: pdev object
  768. * @bssid: bssid to be checked
  769. * @vdev_id: vdev id
  770. *
  771. * This function will loop through all the vdev in psoc and find/return the
  772. * vdev which is connected to bssid provided.
  773. *
  774. * Return: bool
  775. */
  776. bool wlan_get_connected_vdev_by_bssid(struct wlan_objmgr_pdev *pdev,
  777. uint8_t *bssid, uint8_t *vdev_id);
  778. /**
  779. * wlan_get_connected_vdev_from_psoc_by_bssid() - check/get any vdev
  780. * connected on bssid
  781. * @psoc: psoc object
  782. * @bssid: bssid to be checked
  783. * @vdev_id: vdev id
  784. *
  785. * This function will loop through all the vdev in psoc and find/return the
  786. * vdev which is connected to bssid provided.
  787. *
  788. * Return: bool
  789. */
  790. bool wlan_get_connected_vdev_from_psoc_by_bssid(struct wlan_objmgr_psoc *psoc,
  791. uint8_t *bssid,
  792. uint8_t *vdev_id);
  793. #ifdef WLAN_FEATURE_11BE_MLO
  794. /**
  795. * wlan_get_connected_vdev_by_mld_addr() - check/get any vdev
  796. * connected on mld mac
  797. * @psoc: psoc object
  798. * @mld_mac: mld mac to be checked
  799. * @vdev_id: vdev id
  800. *
  801. * This function will loop through all the vdev in psoc and find/return the
  802. * first vdev which is connected to mld mac provided.
  803. *
  804. * Return: bool
  805. */
  806. bool wlan_get_connected_vdev_by_mld_addr(struct wlan_objmgr_psoc *psoc,
  807. uint8_t *mld_mac, uint8_t *vdev_id);
  808. #endif
  809. /**
  810. * wlan_util_stats_get_rssi() - API to get rssi in dbm
  811. * @db2dbm_enabled: If db2dbm capability is enabled
  812. * @bcn_snr: beacon snr
  813. * @dat_snr: data snr
  814. * @rssi: rssi
  815. *
  816. * This function gets the rssi based on db2dbm support. If this feature is
  817. * present in hw then it means firmware directly sends rssi and no conversion
  818. * is required. If this capability is not present then host needs to convert
  819. * snr to rssi
  820. *
  821. * Return: None
  822. */
  823. void
  824. wlan_util_stats_get_rssi(bool db2dbm_enabled, int32_t bcn_snr, int32_t dat_snr,
  825. int8_t *rssi);
  826. /**
  827. * wlan_util_is_pdev_restart_progress() - Check if any vdev is in restart state
  828. * @pdev: pdev pointer
  829. * @dbg_id: module id
  830. *
  831. * Iterates through all vdevs, checks if any VDEV is in RESTART_PROGRESS
  832. * substate
  833. *
  834. * Return: QDF_STATUS_SUCCESS,if any vdev is in RESTART_PROGRESS substate
  835. * otherwise QDF_STATUS_E_FAILURE
  836. */
  837. QDF_STATUS wlan_util_is_pdev_restart_progress(struct wlan_objmgr_pdev *pdev,
  838. wlan_objmgr_ref_dbgid dbg_id);
  839. /**
  840. * wlan_util_is_pdev_scan_allowed() - Check for vdev is allowed to scan
  841. * @pdev: pdev pointer
  842. * @dbg_id: module id
  843. *
  844. * Iterates through all vdevs, checks if any VDEV is not either in S_INIT or in
  845. * S_UP state
  846. *
  847. * Return: QDF_STATUS_SUCCESS,if scan is allowed, otherwise QDF_STATUS_E_FAILURE
  848. */
  849. QDF_STATUS wlan_util_is_pdev_scan_allowed(struct wlan_objmgr_pdev *pdev,
  850. wlan_objmgr_ref_dbgid dbg_id);
  851. /**
  852. * wlan_util_get_peer_count_for_mode - This api gives vdev mode specific
  853. * peer count`
  854. * @pdev: PDEV object
  855. * @mode: Operation mode.
  856. *
  857. * Return: int- peer count for operating mode
  858. */
  859. uint16_t wlan_util_get_peer_count_for_mode(struct wlan_objmgr_pdev *pdev,
  860. enum QDF_OPMODE mode);
  861. /**
  862. * wlan_minidump_host_data - Data structure type logged in Minidump
  863. * @WLAN_MD_CP_EXT_PDEV - ol_ath_softc_net80211
  864. * @WLAN_MD_CP_EXT_PSOC - ol_ath_soc_softc
  865. * @WLAN_MD_CP_EXT_VDEV - ieee80211vap
  866. * @WLAN_MD_CP_EXT_PEER - ieee80211_node
  867. * @WLAN_MD_DP_SOC - dp_soc
  868. * @WLAN_MD_DP_PDEV - dp_pdev
  869. * @WLAN_MD_DP_VDEV - dp_vdev
  870. * @WLAN_MD_DP_PEER - dp_peer
  871. * @WLAN_MD_DP_SRNG_REO_DEST - dp_srng type for reo dest
  872. * @WLAN_MD_DP_SRNG_REO_EXCEPTION - dp_srng type for reo exception
  873. * @WLAN_MD_DP_SRNG_REO_CMD - dp_srng type for reo cmd
  874. * @WLAN_MD_DP_SRNG_RX_REL - dp_srng type for reo release
  875. * @WLAN_MD_DP_SRNG_REO_REINJECT - dp_srng type for reo reinject
  876. * @WLAN_MD_DP_SRNG_REO_STATUS - dp_srng type for reo status
  877. * @WLAN_MD_DP_SRNG_TCL_DATA - dp_srng type for tcl data
  878. * @WLAN_MD_DP_SRNG_TCL_STATUS - dp_srng type for tcl status
  879. * @WLAN_MD_DP_SRNG_TX_COMP - dp_srng type for tcl comp
  880. * @WLAN_MD_DP_SRNG_WBM_DESC_REL - dp_srng_type for wbm desc rel
  881. * @WLAN_MD_DP_SRNG_WBM_IDLE_LINK - dp_srng type for wbm idle link
  882. * @WLAN_MD_DP_LINK_DESC_BANK - Wbm link_desc_bank
  883. * @WLAN_MD_DP_SRNG_RXDMA_MON_STATUS - dp_srng type for rxdma mon status
  884. * @WLAN_MD_DP_SRNG_RXDMA_MON_BUF - dp_srng type for rxdma mon buf
  885. * @WLAN_MD_DP_SRNG_RXDMA_MON_DST - dp_srng type for rxdma mon dest
  886. * @WLAN_MD_DP_SRNG_RXDMA_MON_DESC - dp_srng type for rxdma mon desc
  887. * @WLAN_MD_DP_SRNG_RXDMA_ERR_DST - dp_srng type for rxdma err dst
  888. * @WLAN_MD_DP_HAL_SOC - hal_soc
  889. * @WLAN_MD_OBJMGR_PSOC - wlan_objmgr_psoc
  890. * @WLAN_MD_OBJMGR_PSOC_TGT_INFO - wlan_objmgr_tgt_psoc_info
  891. * @WLAN_MD_OBJMGR_PDEV - wlan_objmgr_pdev
  892. * @WLAN_MD_OBJMGR_PDEV_MLME - pdev_mlme
  893. * @WLAN_MD_OBJMGR_VDEV - wlan_objmgr_vdev
  894. * @WLAN_MD_OBJMGR_VDEV_MLME -vdev mlme
  895. * @WLAN_MD_OBJMGR_VDEV_SM - wlan_sm
  896. * @WLAN_MD_DP_SRNG_REO2PPE- dp_srng type PPE rx ring
  897. * @WLAN_MD_DP_SRNG_PPE2TCL - dp_srng type for PPE tx ring
  898. * @WLAN_MD_DP_SRNG_PPE_RELEASE - dp_srng type for PPE tx com ring
  899. * @WLAN_MD_DP_SRNG_PPE_WBM2SW_RELEASE - dp_srng type for PPE2TCL tx com ring
  900. * @WLAN_MD_MAX - Max value
  901. */
  902. enum wlan_minidump_host_data {
  903. WLAN_MD_CP_EXT_PDEV,
  904. WLAN_MD_CP_EXT_PSOC,
  905. WLAN_MD_CP_EXT_VDEV,
  906. WLAN_MD_CP_EXT_PEER,
  907. WLAN_MD_DP_SOC,
  908. WLAN_MD_DP_PDEV,
  909. WLAN_MD_DP_VDEV,
  910. WLAN_MD_DP_PEER,
  911. WLAN_MD_DP_SRNG_REO_DEST,
  912. WLAN_MD_DP_SRNG_REO_EXCEPTION,
  913. WLAN_MD_DP_SRNG_REO_CMD,
  914. WLAN_MD_DP_SRNG_RX_REL,
  915. WLAN_MD_DP_SRNG_REO_REINJECT,
  916. WLAN_MD_DP_SRNG_REO_STATUS,
  917. WLAN_MD_DP_SRNG_TCL_DATA,
  918. WLAN_MD_DP_SRNG_TCL_CMD,
  919. WLAN_MD_DP_SRNG_TCL_STATUS,
  920. WLAN_MD_DP_SRNG_TX_COMP,
  921. WLAN_MD_DP_SRNG_WBM_DESC_REL,
  922. WLAN_MD_DP_SRNG_WBM_IDLE_LINK,
  923. WLAN_MD_DP_LINK_DESC_BANK,
  924. WLAN_MD_DP_SRNG_RXDMA_MON_STATUS,
  925. WLAN_MD_DP_SRNG_RXDMA_MON_BUF,
  926. WLAN_MD_DP_SRNG_RXDMA_MON_DST,
  927. WLAN_MD_DP_SRNG_RXDMA_MON_DESC,
  928. WLAN_MD_DP_SRNG_RXDMA_ERR_DST,
  929. WLAN_MD_DP_HAL_SOC,
  930. WLAN_MD_OBJMGR_PSOC,
  931. WLAN_MD_OBJMGR_PSOC_TGT_INFO,
  932. WLAN_MD_OBJMGR_PDEV,
  933. WLAN_MD_OBJMGR_PDEV_MLME,
  934. WLAN_MD_OBJMGR_VDEV,
  935. WLAN_MD_OBJMGR_VDEV_MLME,
  936. WLAN_MD_OBJMGR_VDEV_SM,
  937. WLAN_MD_DP_SRNG_REO2PPE,
  938. WLAN_MD_DP_SRNG_PPE2TCL,
  939. WLAN_MD_DP_SRNG_PPE_RELEASE,
  940. WLAN_MD_DP_SRNG_PPE_WBM2SW_RELEASE,
  941. WLAN_MD_MAX
  942. };
  943. /**
  944. * wlan_minidump_log() - Log memory address to be included in minidump
  945. * @start_addr: Start address of the memory to be dumped
  946. * @size: Size in bytes
  947. * @psoc_obj: Psoc Object
  948. * @type: Type of data structure
  949. * @name: String to identify this entry
  950. */
  951. void wlan_minidump_log(void *start_addr, const size_t size,
  952. void *psoc_obj,
  953. enum wlan_minidump_host_data type,
  954. const char *name);
  955. /**
  956. * wlan_minidump_remove() - Remove memory address from minidump
  957. * @start_addr: Start address of the memory previously added
  958. * @size: Size in bytes
  959. * @psoc_obj: Psoc Object
  960. * @type: Type of data structure
  961. * @name: String to identify this entry
  962. */
  963. void wlan_minidump_remove(void *start_addr, const size_t size,
  964. void *psoc_obj,
  965. enum wlan_minidump_host_data type,
  966. const char *name);
  967. #endif /* _WLAN_UTILITY_H_ */