utils_mlo.h 32 KB

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