utils_mlo.h 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  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 and NSTR capability information in the
  399. * per-STA profiles present in a Basic variant Multi-Link element.
  400. * The partner link information is returned only for those per-STA profiles
  401. * which have a MAC address in the STA Info field.
  402. * The NSTR capability information is returned only for those per-STA profiles
  403. * which are Complete per-STA profiles.
  404. *
  405. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  406. * the reason for error in the case of failure
  407. */
  408. QDF_STATUS
  409. util_get_bvmlie_persta_partner_info(uint8_t *mlieseq,
  410. qdf_size_t mlieseqlen,
  411. struct mlo_partner_info *partner_info);
  412. /**
  413. * util_get_prvmlie_mldid - Get the MLD ID from a given Probe Request
  414. * variant Multi-Link element , of the STA that transmits ML Probe Request
  415. * with the Multi-Link element
  416. *
  417. * @mlieseq: Starting address of the Multi-Link element or Multi-Link element
  418. * fragment sequence
  419. * @mlieseqlen: Total length of the Multi-Link element or Multi-Link element
  420. * fragment sequence
  421. * @mldidfound: Pointer to the location where a boolean status should be
  422. * updated indicating whether the MLD ID was found or not. This should
  423. * be ignored by the caller if the function returns error.
  424. * @mldid: Pointer to the location where the value of the MLD ID
  425. * should be updated. This should be ignored by the caller if the function
  426. * returns error, or if the function indicates that the MLD ID was not
  427. * found.
  428. *
  429. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  430. * the reason for error in the case of failure
  431. */
  432. QDF_STATUS
  433. util_get_prvmlie_mldid(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  434. bool *mldidfound, uint8_t *mldid);
  435. /**
  436. * util_get_prvmlie_persta_link_id() - Get per-STA probe req link information
  437. *
  438. * @mlieseq: Starting address of the Multi-Link element or Multi-Link element
  439. * fragment sequence
  440. * @mlieseqlen: Total length of the Multi-Link element or Multi-Link element
  441. * fragment sequence
  442. * @probereq_info: Pointer to the location where the probe req link information
  443. * should be updated. This should be ignored by the caller if the function
  444. * returns error. Note that success will be returned and the number of links in
  445. * this structure will be reported as 0, if no Link Info is found, or no per-STA
  446. * profile is found.
  447. *
  448. * Get probe req link information in the per-STA profiles present in a Probe req
  449. * variant Multi-Link element.
  450. *
  451. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  452. * the reason for error in the case of failure
  453. */
  454. QDF_STATUS
  455. util_get_prvmlie_persta_link_id(uint8_t *mlieseq,
  456. qdf_size_t mlieseqlen,
  457. struct mlo_probereq_info *probereq_info);
  458. /**
  459. * util_get_rvmlie_mldmacaddr() - Get the MLD MAC address from a given Reconfig
  460. * variant Multi-Link element.
  461. *
  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. * @mldmacaddr: Pointer to the location where the MLD MAC address should be
  467. * updated. This should be ignored by the caller if the function returns error.
  468. * @is_mldmacaddr_found: mld address found or not
  469. *
  470. * Get the MLD MAC address from a given Reconfig variant Multi-Link element
  471. * or element fragment sequence.
  472. *
  473. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  474. * the reason for error in the case of failure
  475. */
  476. QDF_STATUS
  477. util_get_rvmlie_mldmacaddr(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  478. struct qdf_mac_addr *mldmacaddr,
  479. bool *is_mldmacaddr_found);
  480. /**
  481. * util_get_rvmlie_persta_link_info() - Get per-STA reconfig link information
  482. *
  483. * @mlieseq: Starting address of the Multi-Link element or Multi-Link element
  484. * fragment sequence
  485. * @mlieseqlen: Total length of the Multi-Link element or Multi-Link element
  486. * fragment sequence
  487. * @reconfig_info: Pointer to the location where the reconfig link information
  488. * should be updated. This should be ignored by the caller if the function
  489. * returns error. Note that success will be returned and the number of links in
  490. * this structure will be reported as 0, if no Link Info is found, or no per-STA
  491. * profile is found.
  492. *
  493. * Get reconfig link information in the per-STA profiles present in a Reconfig
  494. * variant Multi-Link element.
  495. *
  496. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  497. * the reason for error in the case of failure.
  498. */
  499. QDF_STATUS
  500. util_get_rvmlie_persta_link_info(uint8_t *mlieseq,
  501. qdf_size_t mlieseqlen,
  502. struct ml_rv_info *reconfig_info);
  503. /**
  504. * util_get_pav_mlie_link_info() - Get priority access link information
  505. *
  506. * @mlieseq: Starting address of the Multi-Link element or Multi-Link element
  507. * fragment sequence
  508. * @mlieseqlen: Total length of the Multi-Link element or Multi-Link element
  509. * fragment sequence
  510. * @pa_info: Pointer to the location where the priority access multi link
  511. * information is stored.
  512. *
  513. * Get EPCS priority access information from Priority Access Multi-Link element.
  514. *
  515. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  516. * the reason for error in the case of failure.
  517. */
  518. QDF_STATUS util_get_pav_mlie_link_info(uint8_t *mlieseq,
  519. qdf_size_t mlieseqlen,
  520. struct ml_pa_info *pa_info);
  521. #else
  522. static inline QDF_STATUS
  523. util_gen_link_assoc_req(uint8_t *frame, qdf_size_t frame_len, bool isreassoc,
  524. uint8_t link_id,
  525. struct qdf_mac_addr link_addr,
  526. uint8_t *link_frame,
  527. qdf_size_t link_frame_maxsize,
  528. qdf_size_t *link_frame_len)
  529. {
  530. return QDF_STATUS_E_NOSUPPORT;
  531. }
  532. static inline QDF_STATUS
  533. util_gen_link_assoc_rsp(uint8_t *frame, qdf_size_t frame_len, bool isreassoc,
  534. uint8_t link_id,
  535. struct qdf_mac_addr link_addr,
  536. uint8_t *link_frame,
  537. qdf_size_t link_frame_maxsize,
  538. qdf_size_t *link_frame_len)
  539. {
  540. return QDF_STATUS_E_NOSUPPORT;
  541. }
  542. static inline QDF_STATUS
  543. util_find_mlie(uint8_t *buf, qdf_size_t buflen, uint8_t **mlieseq,
  544. qdf_size_t *mlieseqlen)
  545. {
  546. return QDF_STATUS_E_NOSUPPORT;
  547. }
  548. static inline QDF_STATUS
  549. util_find_mlie_by_variant(uint8_t *buf, qdf_size_t buflen, uint8_t **mlieseq,
  550. qdf_size_t *mlieseqlen)
  551. {
  552. return QDF_STATUS_E_FAILURE;
  553. }
  554. static inline QDF_STATUS
  555. util_get_mlie_variant(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  556. int *variant)
  557. {
  558. return QDF_STATUS_E_NOSUPPORT;
  559. }
  560. static inline QDF_STATUS
  561. util_get_mlie_common_info_len(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  562. uint8_t *commoninfo_len)
  563. {
  564. return QDF_STATUS_E_NOSUPPORT;
  565. }
  566. static inline QDF_STATUS
  567. util_get_bvmlie_bssparamchangecnt(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  568. bool *bssparamchangecntfound,
  569. uint8_t *bssparamchangecnt)
  570. {
  571. return QDF_STATUS_E_NOSUPPORT;
  572. }
  573. static inline QDF_STATUS
  574. util_get_bvmlie_mldmacaddr(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  575. struct qdf_mac_addr *mldmacaddr)
  576. {
  577. return QDF_STATUS_E_NOSUPPORT;
  578. }
  579. static inline QDF_STATUS
  580. util_get_bvmlie_eml_cap(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  581. bool *eml_cap_found,
  582. uint16_t *eml_cap)
  583. {
  584. return QDF_STATUS_E_NOSUPPORT;
  585. }
  586. static inline QDF_STATUS
  587. util_get_bvmlie_msd_cap(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  588. bool *msd_cap_found,
  589. uint16_t *msd_cap)
  590. {
  591. return QDF_STATUS_E_NOSUPPORT;
  592. }
  593. static inline QDF_STATUS
  594. util_get_bvmlie_primary_linkid(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  595. bool *linkidfound, uint8_t *linkid)
  596. {
  597. return QDF_STATUS_E_NOSUPPORT;
  598. }
  599. static inline QDF_STATUS
  600. util_get_bvmlie_persta_partner_info(uint8_t *mlieseq,
  601. qdf_size_t mlieseqlen,
  602. struct mlo_partner_info *partner_info)
  603. {
  604. return QDF_STATUS_E_NOSUPPORT;
  605. }
  606. static inline QDF_STATUS
  607. util_get_prvmlie_persta_link_id(uint8_t *mlieseq,
  608. qdf_size_t mlieseqlen,
  609. struct mlo_probereq_info *probereq_info)
  610. {
  611. return QDF_STATUS_E_NOSUPPORT;
  612. }
  613. static inline QDF_STATUS
  614. util_get_prvmlie_mldid(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  615. bool *mldcapfound, uint8_t *mldcap)
  616. {
  617. return QDF_STATUS_E_NOSUPPORT;
  618. }
  619. static inline QDF_STATUS
  620. util_get_rvmlie_mldmacaddr(uint8_t *mlieseq, qdf_size_t mlieseqlen,
  621. struct qdf_mac_addr *mldmacaddr,
  622. bool *is_mldmacaddr_found)
  623. {
  624. return QDF_STATUS_E_NOSUPPORT;
  625. }
  626. static inline QDF_STATUS
  627. util_get_rvmlie_persta_link_info(uint8_t *mlieseq,
  628. qdf_size_t mlieseqlen,
  629. struct ml_rv_info *reconfig_info)
  630. {
  631. return QDF_STATUS_E_NOSUPPORT;
  632. }
  633. static inline
  634. QDF_STATUS util_get_pav_mlie_link_info(uint8_t *mlieseq,
  635. qdf_size_t mlieseqlen,
  636. struct ml_pa_info *pa_info)
  637. {
  638. return QDF_STATUS_E_NOSUPPORT;
  639. }
  640. #endif /* WLAN_FEATURE_11BE_MLO */
  641. #endif /* _WLAN_UTILS_MLO_H_ */