utils_mlo.h 28 KB

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