utils_mlo.h 27 KB

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