utils_mlo.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715
  1. /*
  2. * Copyright (c) 2021, The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2024 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 MLO manager containing util public api's
  19. */
  20. #ifndef _WLAN_UTILS_MLO_H_
  21. #define _WLAN_UTILS_MLO_H_
  22. #include <wlan_cmn_ieee80211.h>
  23. #include "wlan_mlo_mgr_public_structs.h"
  24. #include <wlan_cm_ucfg_api.h>
  25. #include <wlan_objmgr_vdev_obj.h>
  26. #include <wlan_mlo_epcs.h>
  27. #ifdef WLAN_FEATURE_11BE_MLO
  28. #define MLO_LINKSPECIFIC_ASSOC_REQ_FC0 0x00
  29. #define MLO_LINKSPECIFIC_ASSOC_REQ_FC1 0x00
  30. #define MLO_LINKSPECIFIC_ASSOC_RESP_FC0 0x10
  31. #define MLO_LINKSPECIFIC_ASSOC_RESP_FC1 0x00
  32. #define MLO_LINKSPECIFIC_PROBE_RESP_FC0 0x50
  33. #define MLO_LINKSPECIFIC_PROBE_RESP_FC1 0x00
  34. /**
  35. * util_gen_link_assoc_req() - Generate link specific assoc request
  36. * @frame: Pointer to original association request. This should not contain the
  37. * 802.11 header, and must start from the fixed fields in the association
  38. * request. This is required due to some caller semantics built into the end to
  39. * end design.
  40. * @frame_len: Length of original association request
  41. * @isreassoc: Whether this is a re-association request
  42. * @link_id: Link ID for secondary links
  43. * @link_addr: Secondary link's MAC address
  44. * @link_frame: Generated secondary link specific association request. Note that
  45. * this will start from the 802.11 header (unlike the original association
  46. * request). This should be ignored in the case of failure.
  47. * @link_frame_maxsize: Maximum size of generated secondary link specific
  48. * association request
  49. * @link_frame_len: Pointer to location where populated length of generated
  50. * secondary link specific association request should be written. This should be
  51. * ignored in the case of failure.
  52. *
  53. * Generate a link specific logically equivalent association request for the
  54. * secondary link from the original association request containing a Multi-Link
  55. * element. This applies to both association and re-association requests.
  56. * Currently, only two link MLO is supported.
  57. *
  58. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  59. * the reason for error in the case of failure.
  60. */
  61. QDF_STATUS
  62. util_gen_link_assoc_req(uint8_t *frame, qdf_size_t frame_len, bool isreassoc,
  63. uint8_t link_id,
  64. struct qdf_mac_addr link_addr,
  65. uint8_t *link_frame,
  66. qdf_size_t link_frame_maxsize,
  67. qdf_size_t *link_frame_len);
  68. /**
  69. * util_gen_link_assoc_rsp() - Generate link specific assoc response
  70. * @frame: Pointer to original association response. This should not contain the
  71. * 802.11 header, and must start from the fixed fields in the association
  72. * response. This is required due to some caller semantics built into the end to
  73. * end design.
  74. * @frame_len: Length of original association response
  75. * @isreassoc: Whether this is a re-association response
  76. * @link_id: Link ID for secondary links
  77. * @link_addr: Secondary link's MAC address
  78. * @link_frame: Generated secondary link specific association response. Note
  79. * that this will start from the 802.11 header (unlike the original association
  80. * response). This should be ignored in the case of failure.
  81. * @link_frame_maxsize: Maximum size of generated secondary link specific
  82. * association response
  83. * @link_frame_len: Pointer to location where populated length of generated
  84. * secondary link specific association response should be written. This should
  85. * be ignored in the case of failure.
  86. *
  87. * Generate a link specific logically equivalent association response for the
  88. * secondary link from the original association response containing a Multi-Link
  89. * element. This applies to both association and re-association responses.
  90. * Currently, only two link MLO is supported.
  91. *
  92. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  93. * the reason for error in the case of failure.
  94. */
  95. QDF_STATUS
  96. util_gen_link_assoc_rsp(uint8_t *frame, qdf_size_t frame_len, bool isreassoc,
  97. uint8_t link_id,
  98. struct qdf_mac_addr link_addr,
  99. uint8_t *link_frame,
  100. qdf_size_t link_frame_maxsize,
  101. qdf_size_t *link_frame_len);
  102. /**
  103. * util_gen_link_probe_rsp() - Generate link specific probe response
  104. * @frame: Pointer to original probe response. This should not contain the
  105. * 802.11 header, and must start from the fixed fields in the probe
  106. * response. This is required due to some caller semantics built into the end to
  107. * end design.
  108. * @frame_len: Length of original probe response
  109. * @link_addr: Secondary link's MAC address
  110. * @link_id: Link ID for secondary links
  111. * @link_frame: Generated secondary link specific probe response. Note
  112. * that this will start from the 802.11 header (unlike the original probe
  113. * response). This should be ignored in the case of failure.
  114. * @link_frame_maxsize: Maximum size of generated secondary link specific
  115. * probe response
  116. * @link_frame_len: Pointer to location where populated length of generated
  117. * secondary link specific probe response should be written. This should
  118. * be ignored in the case of failure.
  119. *
  120. * Generate a link specific logically equivalent probe response for the
  121. * secondary link from the original probe response containing a Multi-Link
  122. * element. This applies to both probe responses.
  123. * Currently, only two link MLO is supported.
  124. *
  125. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  126. * the reason for error in the case of failure.
  127. */
  128. QDF_STATUS
  129. util_gen_link_probe_rsp(uint8_t *frame, qdf_size_t frame_len,
  130. uint8_t link_id,
  131. struct qdf_mac_addr link_addr,
  132. uint8_t *link_frame,
  133. qdf_size_t link_frame_maxsize,
  134. qdf_size_t *link_frame_len);
  135. /**
  136. * util_find_mlie - Find the first Multi-Link element or the start of the first
  137. * Multi-Link element fragment sequence in a given buffer containing elements,
  138. * if a Multi-Link element or element fragment sequence exists in the given
  139. * buffer.
  140. *
  141. * @buf: Buffer to be searched for the Multi-Link element or the start of the
  142. * Multi-Link element fragment sequence
  143. * @buflen: Length of the buffer
  144. * @mlieseq: Pointer to location where the starting address of the Multi-Link
  145. * element or Multi-Link element fragment sequence should be updated if found
  146. * in the given buffer. The value NULL will be updated to this location if the
  147. * element or element fragment sequence is not found. This should be ignored by
  148. * the caller if the function returns error.
  149. * @mlieseqlen: Pointer to location where the total length of the Multi-Link
  150. * element or Multi-Link element fragment sequence should be updated if found
  151. * in the given buffer. This should be ignored by the caller if the function
  152. * returns error, or if the function indicates that the element or element
  153. * fragment sequence was not found by providing a starting address of NULL.
  154. *
  155. * Find the first Multi-Link element or the start of the first Multi-Link
  156. * element fragment sequence in a given buffer containing elements, if a
  157. * Multi-Link element or element fragment sequence exists in the given buffer.
  158. * The buffer should contain only 802.11 Information elements, and thus should
  159. * not contain other information like 802.11 header, 802.11 frame body
  160. * components like fields that are not elements (e.g. Capability Information
  161. * field, Beacon Interval field), etc.
  162. *
  163. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  164. * the reason for error in the case of failure
  165. */
  166. QDF_STATUS
  167. util_find_mlie(uint8_t *buf, qdf_size_t buflen, uint8_t **mlieseq,
  168. qdf_size_t *mlieseqlen);
  169. /**
  170. * util_find_mlie_by_variant - Find the first Multi-Link element or the start of
  171. * the first Multi-Link element fragment sequence in a given buffer containing
  172. * elements based on variant, if a Multi-Link element or element fragment
  173. * sequence exists in the given buffer.
  174. *
  175. * @buf: Buffer to be searched for the Multi-Link element or the start of the
  176. * Multi-Link element fragment sequence
  177. * @buflen: Length of the buffer
  178. * @mlieseq: Based on the variant, pointer to location where the starting
  179. * address of the Multi-Link element or Multi-Link element fragment sequence
  180. * should be updated if found in the given buffer. The value NULL will be
  181. * updated to this location if the element or element fragment sequence is not
  182. * found. This should be ignored by the caller if the function returns error.
  183. * @mlieseqlen: Pointer to location where the total length of the Multi-Link
  184. * element or Multi-Link element fragment sequence should be updated if found
  185. * in the given buffer. This should be ignored by the caller if the function
  186. * returns error, or if the function indicates that the element or element
  187. * fragment sequence was not found by providing a starting address of NULL.
  188. * @variant: Multi-Link element variant. The value should be interpreted by the
  189. * caller as a member of enum wlan_ml_variant. (This enum is not directly used
  190. * as an argument, so that non-MLO code that happens to call this function does
  191. * not need to be aware of the definition of the enum, though such a call would
  192. * ultimately result in an error).
  193. *
  194. * Based on variant, find the Multi-Link element or the start of the Multi-Link
  195. * element fragment sequence in a given buffer containing elements, if a
  196. * Multi-Link element or element fragment sequence exists in the given buffer.
  197. * The buffer should contain only 802.11 Information elements, and thus should
  198. * not contain other information like 802.11 header, 802.11 frame body
  199. * components like fields that are not elements (e.g. Capability Information
  200. * field, Beacon Interval field), etc.
  201. *
  202. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  203. * the reason for error in the case of failure
  204. */
  205. QDF_STATUS
  206. util_find_mlie_by_variant(uint8_t *buf, qdf_size_t buflen, uint8_t **mlieseq,
  207. qdf_size_t *mlieseqlen, int variant);
  208. /**
  209. * util_get_mlie_variant() - Get ML IE variant
  210. * @mlieseq: Starting address of the Multi-Link element or Multi-Link element
  211. * fragment sequence
  212. * @mlieseqlen: Total length of the Multi-Link element or Multi-Link element
  213. * fragment sequence
  214. * @variant: Pointer to the location where the value of the variant should be
  215. * updated. On success, the value should be interpreted by the caller as a
  216. * member of enum wlan_ml_variant. (This enum is not directly used as an
  217. * argument, so that non-MLO code that happens to call this function does not
  218. * need to be aware of the definition of the enum, though such a call would
  219. * ultimately result in an error). The value should be ignored by the caller if
  220. * the function returns error.
  221. *
  222. * Get the variant of the given Multi-Link element or element fragment sequence.
  223. *
  224. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  225. * the reason for error in the case of failure
  226. */
  227. QDF_STATUS
  228. util_get_mlie_variant(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  229. int *variant);
  230. /**
  231. * util_get_bvmlie_mldmacaddr() - Get the MLD MAC address
  232. * @mlieseq: Starting address of the Multi-Link element or Multi-Link element
  233. * fragment sequence
  234. * @mlieseqlen: Total length of the Multi-Link element or Multi-Link element
  235. * fragment sequence
  236. * @mldmacaddr: Pointer to the location where the MLD MAC address should be
  237. * updated. This should be ignored by the caller if the function returns error.
  238. *
  239. * Get the MLD MAC address from a given Basic variant Multi-Link element
  240. * or element fragment sequence.
  241. *
  242. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  243. * the reason for error in the case of failure
  244. */
  245. QDF_STATUS
  246. util_get_bvmlie_mldmacaddr(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  247. struct qdf_mac_addr *mldmacaddr);
  248. /**
  249. * util_get_bvmlie_eml_cap() - Get the EML capabilities
  250. * @mlieseq: Starting address of the Multi-Link element or Multi-Link element
  251. * fragment sequence
  252. * @mlieseqlen: Total length of the Multi-Link element or Multi-Link element
  253. * fragment sequence
  254. * @eml_cap_found: Pointer to the location where a boolean status should be
  255. * updated indicating whether the EML cabalility was found or not. This should
  256. * be ignored by the caller if the function returns error.
  257. * @eml_cap: Pointer to the location where the EML capabilities should be
  258. * updated. This should be ignored by the caller if the function indicates
  259. * that the EML capability was not found.
  260. *
  261. * Get the EML capabilities from a given Basic variant Multi-Link element or
  262. * element fragment sequence.
  263. *
  264. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  265. * the reason for error in the case of failure
  266. */
  267. QDF_STATUS
  268. util_get_bvmlie_eml_cap(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  269. bool *eml_cap_found,
  270. uint16_t *eml_cap);
  271. /**
  272. * util_get_bvmlie_msd_cap() - Get the MSD capabilities for Basic variant
  273. * MLO IE
  274. * @mlieseq: Starting address of the Multi-Link element or Multi-Link element
  275. * fragment sequence
  276. * @mlieseqlen: Total length of the Multi-Link element or Multi-Link element
  277. * fragment sequence
  278. * @msd_cap_found: Pointer to the location where a boolean status should be
  279. * updated indicating whether the MSD cabalility was found or not. This should
  280. * be ignored by the caller if the function returns error.
  281. * @msd_cap: Pointer to the location where the MSD capabilities should be
  282. * updated. This should be ignored by the caller if the function indicates
  283. * that the MSD capability was not found.
  284. *
  285. * Get the MSD capabilities from a given Basic variant Multi-Link element or
  286. * element fragment sequence.
  287. *
  288. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  289. * the reason for error in the case of failure
  290. */
  291. QDF_STATUS
  292. util_get_bvmlie_msd_cap(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  293. bool *msd_cap_found, uint16_t *msd_cap);
  294. /**
  295. * util_get_bvmlie_primary_linkid() - Get the link identifier
  296. * @mlieseq: Starting address of the Multi-Link element or Multi-Link element
  297. * fragment sequence
  298. * @mlieseqlen: Total length of the Multi-Link element or Multi-Link element
  299. * fragment sequence
  300. * @linkidfound: Pointer to the location where a boolean status should be
  301. * updated indicating whether the link identifier was found or not. This should
  302. * be ignored by the caller if the function returns error.
  303. * @linkid: Pointer to the location where the value of the link identifier
  304. * should be updated. This should be ignored by the caller if the function
  305. * returns error, or if the function indicates that the link identifier was not
  306. * found.
  307. *
  308. * Get the link identifier from a given Basic variant Multi-Link element or
  309. * element fragment sequence, of the AP that transmits the Multi-Link
  310. * element/element fragment sequence or the nontransmitted BSSID in the same
  311. * multiple BSSID set as the AP that transmits the Multi-Link element/element
  312. * fragment sequence and that is affiliated with the MLD that is described in
  313. * the Multi-Link element.
  314. *
  315. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  316. * the reason for error in the case of failure
  317. */
  318. QDF_STATUS
  319. util_get_bvmlie_primary_linkid(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  320. bool *linkidfound, uint8_t *linkid);
  321. /**
  322. * util_get_mlie_common_info_len() - Get the MLD common info len
  323. * @mlieseq: Starting address of the Multi-Link element or Multi-Link element
  324. * fragment sequence
  325. * @mlieseqlen: Total length of the Multi-Link element or Multi-Link element
  326. * fragment sequence
  327. * @commoninfo_len: Pointer to the location where the value of the MLD common
  328. * info len should be updated. This should be ignored by the caller if the
  329. * function returns error.
  330. *
  331. * Get the MLD common info len from Multi-Link element transmitted by the AP.
  332. *
  333. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  334. * the reason for error in the case of failure
  335. */
  336. QDF_STATUS
  337. util_get_mlie_common_info_len(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  338. uint8_t *commoninfo_len);
  339. /**
  340. * util_get_bvmlie_bssparamchangecnt() - Get the MLD BSS PARAM Change Count
  341. * @mlieseq: Starting address of the Multi-Link element or Multi-Link element
  342. * fragment sequence
  343. * @mlieseqlen: Total length of the Multi-Link element or Multi-Link element
  344. * fragment sequence
  345. * @bssparamchangecntfound: Pointer to the location where a boolean status
  346. * should be updated indicating whether the MLD BSS PARAM Change Count was
  347. * found or not. This should be ignored by the caller if the function
  348. * returns error.
  349. * @bssparamchangecnt: Pointer to the location where the value of the MLD BSS
  350. * PARAM Change Count should be updated. This should be ignored by the caller
  351. * if the function returns error, or if the function indicates that the MLD
  352. * BSS PARAM Change Count was not found.
  353. *
  354. * Get the MLD BSS PARAM Change Count from Multi-Link element transmitted
  355. * by the AP.
  356. *
  357. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  358. * the reason for error in the case of failure
  359. */
  360. QDF_STATUS
  361. util_get_bvmlie_bssparamchangecnt(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  362. bool *bssparamchangecntfound,
  363. uint8_t *bssparamchangecnt);
  364. /**
  365. * util_get_bvmlie_mldcap() - Get the MLD capabilities
  366. * @mlieseq: Starting address of the Multi-Link element or Multi-Link element
  367. * fragment sequence
  368. * @mlieseqlen: Total length of the Multi-Link element or Multi-Link element
  369. * fragment sequence
  370. * @mldcapfound: Pointer to the location where a boolean status should be
  371. * updated indicating whether the MLD capabilities was found or not. This should
  372. * be ignored by the caller if the function returns error.
  373. * @mldcap: Pointer to the location where the value of the MLD capabilities
  374. * should be updated. This should be ignored by the caller if the function
  375. * returns error, or if the function indicates that the MLD capabilities was not
  376. * found.
  377. *
  378. * Get the MLD capabilities from a given Basic variant Multi-Link element or
  379. * element fragment sequence, of the AP that transmits the Multi-Link
  380. * element/element fragment sequence or the nontransmitted BSSID in the same
  381. * multiple BSSID set as the AP that transmits the Multi-Link element/element
  382. * fragment sequence and that is affiliated with the MLD that is described in
  383. * the Multi-Link element.
  384. *
  385. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  386. * the reason for error in the case of failure
  387. */
  388. QDF_STATUS
  389. util_get_bvmlie_mldcap(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  390. bool *mldcapfound, uint16_t *mldcap);
  391. /**
  392. * util_get_bvmlie_ext_mld_cap_op_info() - Get Ext MLD Capabilities and
  393. * operation
  394. * @mlie_seq: Starting address of the Multi-Link element or Multi-Link element
  395. * fragment sequence
  396. * @mlie_seqlen: Total length of the Multi-Link element or Multi-Link element
  397. * fragment sequence
  398. * @ext_mld_cap_found: Pointer to the location where a boolean status should be
  399. * updated indicating whether the Ext MLD capabilities was found or not.
  400. * This should be ignored by the caller if the function returns error.
  401. * @ext_mld_cap: Pointer to the location where the value of the Ext MLD
  402. * capabilities should be updated. This should be ignored by the caller if the
  403. * function returns error, or if the function indicates that the MLD
  404. * capabilities was not found.
  405. *
  406. * Get the Ext MLD capabilities from a given Basic variant Multi-Link element or
  407. * element fragment sequence, of the AP that transmits the Multi-Link element/
  408. * element fragment sequence or the non-transmitted BSSID in the same
  409. * multiple BSSID set as the AP that transmits the Multi-Link element/element
  410. * fragment sequence and that is affiliated with the MLD that is described in
  411. * the Multi-Link element.
  412. *
  413. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  414. * the reason for error in the case of failure
  415. */
  416. QDF_STATUS
  417. util_get_bvmlie_ext_mld_cap_op_info(uint8_t *mlie_seq, qdf_size_t mlie_seqlen,
  418. bool *ext_mld_cap_found,
  419. uint16_t *ext_mld_cap);
  420. /**
  421. * util_get_bvmlie_persta_partner_info() - Get per-STA partner link information
  422. * @mlieseq: Starting address of the Multi-Link element or Multi-Link element
  423. * fragment sequence
  424. * @mlieseqlen: Total length of the Multi-Link element or Multi-Link element
  425. * fragment sequence
  426. * @partner_info: Pointer to the location where the partner link information
  427. * should be updated. This should be ignored by the caller if the function
  428. * returns error. Note that success will be returned and the number of links in
  429. * this structure will be reported as 0, if no Link Info is found, or no per-STA
  430. * profile is found, or if none of the per-STA profiles includes a MAC address
  431. * in the STA Info field (assuming no errors are encountered).
  432. *
  433. * Get partner link information and NSTR capability information in the
  434. * per-STA profiles present in a Basic variant Multi-Link element.
  435. * The partner link information is returned only for those per-STA profiles
  436. * which have a MAC address in the STA Info field.
  437. * The NSTR capability information is returned only for those per-STA profiles
  438. * which are Complete per-STA profiles.
  439. *
  440. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  441. * the reason for error in the case of failure
  442. */
  443. QDF_STATUS
  444. util_get_bvmlie_persta_partner_info(uint8_t *mlieseq,
  445. qdf_size_t mlieseqlen,
  446. struct mlo_partner_info *partner_info);
  447. /**
  448. * util_get_prvmlie_mldid - Get the MLD ID from a given Probe Request
  449. * variant Multi-Link element , of the STA that transmits ML Probe Request
  450. * with the Multi-Link element
  451. *
  452. * @mlieseq: Starting address of the Multi-Link element or Multi-Link element
  453. * fragment sequence
  454. * @mlieseqlen: Total length of the Multi-Link element or Multi-Link element
  455. * fragment sequence
  456. * @mldidfound: Pointer to the location where a boolean status should be
  457. * updated indicating whether the MLD ID was found or not. This should
  458. * be ignored by the caller if the function returns error.
  459. * @mldid: Pointer to the location where the value of the MLD ID
  460. * should be updated. This should be ignored by the caller if the function
  461. * returns error, or if the function indicates that the MLD ID was not
  462. * found.
  463. *
  464. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  465. * the reason for error in the case of failure
  466. */
  467. QDF_STATUS
  468. util_get_prvmlie_mldid(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  469. bool *mldidfound, uint8_t *mldid);
  470. /**
  471. * util_get_prvmlie_persta_link_id() - Get per-STA probe req link information
  472. *
  473. * @mlieseq: Starting address of the Multi-Link element or Multi-Link element
  474. * fragment sequence
  475. * @mlieseqlen: Total length of the Multi-Link element or Multi-Link element
  476. * fragment sequence
  477. * @probereq_info: Pointer to the location where the probe req link information
  478. * should be updated. This should be ignored by the caller if the function
  479. * returns error. Note that success will be returned and the number of links in
  480. * this structure will be reported as 0, if no Link Info is found, or no per-STA
  481. * profile is found.
  482. *
  483. * Get probe req link information in the per-STA profiles present in a Probe req
  484. * variant Multi-Link element.
  485. *
  486. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  487. * the reason for error in the case of failure
  488. */
  489. QDF_STATUS
  490. util_get_prvmlie_persta_link_id(uint8_t *mlieseq,
  491. qdf_size_t mlieseqlen,
  492. struct mlo_probereq_info *probereq_info);
  493. /**
  494. * util_get_rvmlie_mldmacaddr() - Get the MLD MAC address from a given Reconfig
  495. * variant Multi-Link element.
  496. *
  497. * @mlieseq: Starting address of the Multi-Link element or Multi-Link element
  498. * fragment sequence
  499. * @mlieseqlen: Total length of the Multi-Link element or Multi-Link element
  500. * fragment sequence
  501. * @mldmacaddr: Pointer to the location where the MLD MAC address should be
  502. * updated. This should be ignored by the caller if the function returns error.
  503. * @is_mldmacaddr_found: mld address found or not
  504. *
  505. * Get the MLD MAC address from a given Reconfig variant Multi-Link element
  506. * or element fragment sequence.
  507. *
  508. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  509. * the reason for error in the case of failure
  510. */
  511. QDF_STATUS
  512. util_get_rvmlie_mldmacaddr(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  513. struct qdf_mac_addr *mldmacaddr,
  514. bool *is_mldmacaddr_found);
  515. /**
  516. * util_get_rvmlie_persta_link_info() - Get per-STA reconfig link information
  517. *
  518. * @mlieseq: Starting address of the Multi-Link element or Multi-Link element
  519. * fragment sequence
  520. * @mlieseqlen: Total length of the Multi-Link element or Multi-Link element
  521. * fragment sequence
  522. * @reconfig_info: Pointer to the location where the reconfig link information
  523. * should be updated. This should be ignored by the caller if the function
  524. * returns error. Note that success will be returned and the number of links in
  525. * this structure will be reported as 0, if no Link Info is found, or no per-STA
  526. * profile is found.
  527. *
  528. * Get reconfig link information in the per-STA profiles present in a Reconfig
  529. * variant Multi-Link element.
  530. *
  531. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  532. * the reason for error in the case of failure.
  533. */
  534. QDF_STATUS
  535. util_get_rvmlie_persta_link_info(uint8_t *mlieseq,
  536. qdf_size_t mlieseqlen,
  537. struct ml_rv_info *reconfig_info);
  538. /**
  539. * util_get_pav_mlie_link_info() - Get priority access link information
  540. *
  541. * @mlieseq: Starting address of the Multi-Link element or Multi-Link element
  542. * fragment sequence
  543. * @mlieseqlen: Total length of the Multi-Link element or Multi-Link element
  544. * fragment sequence
  545. * @pa_info: Pointer to the location where the priority access multi link
  546. * information is stored.
  547. *
  548. * Get EPCS priority access information from Priority Access Multi-Link element.
  549. *
  550. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  551. * the reason for error in the case of failure.
  552. */
  553. QDF_STATUS util_get_pav_mlie_link_info(uint8_t *mlieseq,
  554. qdf_size_t mlieseqlen,
  555. struct ml_pa_info *pa_info);
  556. #else
  557. static inline QDF_STATUS
  558. util_gen_link_assoc_req(uint8_t *frame, qdf_size_t frame_len, bool isreassoc,
  559. uint8_t link_id,
  560. struct qdf_mac_addr link_addr,
  561. uint8_t *link_frame,
  562. qdf_size_t link_frame_maxsize,
  563. qdf_size_t *link_frame_len)
  564. {
  565. return QDF_STATUS_E_NOSUPPORT;
  566. }
  567. static inline QDF_STATUS
  568. util_gen_link_assoc_rsp(uint8_t *frame, qdf_size_t frame_len, bool isreassoc,
  569. uint8_t link_id,
  570. struct qdf_mac_addr link_addr,
  571. uint8_t *link_frame,
  572. qdf_size_t link_frame_maxsize,
  573. qdf_size_t *link_frame_len)
  574. {
  575. return QDF_STATUS_E_NOSUPPORT;
  576. }
  577. static inline QDF_STATUS
  578. util_find_mlie(uint8_t *buf, qdf_size_t buflen, uint8_t **mlieseq,
  579. qdf_size_t *mlieseqlen)
  580. {
  581. return QDF_STATUS_E_NOSUPPORT;
  582. }
  583. static inline QDF_STATUS
  584. util_find_mlie_by_variant(uint8_t *buf, qdf_size_t buflen, uint8_t **mlieseq,
  585. qdf_size_t *mlieseqlen)
  586. {
  587. return QDF_STATUS_E_FAILURE;
  588. }
  589. static inline QDF_STATUS
  590. util_get_mlie_variant(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  591. int *variant)
  592. {
  593. return QDF_STATUS_E_NOSUPPORT;
  594. }
  595. static inline QDF_STATUS
  596. util_get_mlie_common_info_len(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  597. uint8_t *commoninfo_len)
  598. {
  599. return QDF_STATUS_E_NOSUPPORT;
  600. }
  601. static inline QDF_STATUS
  602. util_get_bvmlie_bssparamchangecnt(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  603. bool *bssparamchangecntfound,
  604. uint8_t *bssparamchangecnt)
  605. {
  606. return QDF_STATUS_E_NOSUPPORT;
  607. }
  608. static inline QDF_STATUS
  609. util_get_bvmlie_mldmacaddr(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  610. struct qdf_mac_addr *mldmacaddr)
  611. {
  612. return QDF_STATUS_E_NOSUPPORT;
  613. }
  614. static inline QDF_STATUS
  615. util_get_bvmlie_eml_cap(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  616. bool *eml_cap_found,
  617. uint16_t *eml_cap)
  618. {
  619. return QDF_STATUS_E_NOSUPPORT;
  620. }
  621. static inline QDF_STATUS
  622. util_get_bvmlie_msd_cap(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  623. bool *msd_cap_found,
  624. uint16_t *msd_cap)
  625. {
  626. return QDF_STATUS_E_NOSUPPORT;
  627. }
  628. static inline QDF_STATUS
  629. util_get_bvmlie_primary_linkid(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  630. bool *linkidfound, uint8_t *linkid)
  631. {
  632. return QDF_STATUS_E_NOSUPPORT;
  633. }
  634. static inline QDF_STATUS
  635. util_get_bvmlie_persta_partner_info(uint8_t *mlieseq,
  636. qdf_size_t mlieseqlen,
  637. struct mlo_partner_info *partner_info)
  638. {
  639. return QDF_STATUS_E_NOSUPPORT;
  640. }
  641. static inline QDF_STATUS
  642. util_get_prvmlie_persta_link_id(uint8_t *mlieseq,
  643. qdf_size_t mlieseqlen,
  644. struct mlo_probereq_info *probereq_info)
  645. {
  646. return QDF_STATUS_E_NOSUPPORT;
  647. }
  648. static inline QDF_STATUS
  649. util_get_prvmlie_mldid(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  650. bool *mldcapfound, uint8_t *mldcap)
  651. {
  652. return QDF_STATUS_E_NOSUPPORT;
  653. }
  654. static inline QDF_STATUS
  655. util_get_rvmlie_mldmacaddr(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  656. struct qdf_mac_addr *mldmacaddr,
  657. bool *is_mldmacaddr_found)
  658. {
  659. return QDF_STATUS_E_NOSUPPORT;
  660. }
  661. static inline QDF_STATUS
  662. util_get_rvmlie_persta_link_info(uint8_t *mlieseq,
  663. qdf_size_t mlieseqlen,
  664. struct ml_rv_info *reconfig_info)
  665. {
  666. return QDF_STATUS_E_NOSUPPORT;
  667. }
  668. static inline
  669. QDF_STATUS util_get_pav_mlie_link_info(uint8_t *mlieseq,
  670. qdf_size_t mlieseqlen,
  671. struct ml_pa_info *pa_info)
  672. {
  673. return QDF_STATUS_E_NOSUPPORT;
  674. }
  675. #endif /* WLAN_FEATURE_11BE_MLO */
  676. #endif /* _WLAN_UTILS_MLO_H_ */