utils_mlo.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Copyright (c) 2021, The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021 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_mlo_mgr_public_structs.h"
  23. #include <wlan_cm_ucfg_api.h>
  24. #include <wlan_objmgr_vdev_obj.h>
  25. #ifdef WLAN_FEATURE_11BE_MLO
  26. #define FC0_IEEE_MGMT_FRM 0x10
  27. #define FC1_IEEE_MGMT_FRM 0x00
  28. /**
  29. * util_gen_link_assoc_rsp - Generate link association response
  30. *
  31. * @frame: association response frame ptr
  32. * @len: length of assoc rsp frame
  33. * @link_addr: link mac addr
  34. * @new_ie: Generated Link assoc rsp
  35. *
  36. * Return: true if vdev is a link vdev, false otherwise
  37. */
  38. QDF_STATUS
  39. util_gen_link_assoc_rsp(uint8_t *frame, qdf_size_t len,
  40. struct qdf_mac_addr link_addr, uint8_t *new_ie);
  41. /**
  42. * util_find_mlie - Find the first Multi-Link element or the start of the first
  43. * Multi-Link element fragment sequence in a given buffer containing elements,
  44. * if a Multi-Link element or element fragment sequence exists in the given
  45. * buffer.
  46. *
  47. * @buf: Buffer to be searched for the Multi-Link element or the start of the
  48. * Multi-Link element fragment sequence
  49. * @buflen: Length of the buffer
  50. * @mlieseq: Pointer to location where the starting address of the Multi-Link
  51. * element or Multi-Link element fragment sequence should be updated if found
  52. * in the given buffer. The value NULL will be updated to this location if the
  53. * element or element fragment sequence is not found. This should be ignored by
  54. * the caller if the function returns error.
  55. * @mlieseqlen: Pointer to location where the total length of the Multi-Link
  56. * element or Multi-Link element fragment sequence should be updated if found
  57. * in the given buffer. This should be ignored by the caller if the function
  58. * returns error, or if the function indicates that the element or element
  59. * fragment sequence was not found by providing a starting address of NULL.
  60. *
  61. * Return: QDF_STATUS_SUCCESS in the case of success, QDF_STATUS value giving
  62. * the reason for error in the case of failure
  63. */
  64. QDF_STATUS
  65. util_find_mlie(uint8_t *buf, qdf_size_t buflen, uint8_t **mlieseq,
  66. qdf_size_t *mlieseqlen);
  67. #else
  68. static inline QDF_STATUS
  69. util_gen_link_assoc_rsp(uint8_t *frame, qdf_size_t len,
  70. struct qdf_mac_addr link_addr, uint8_t *new_ie)
  71. {
  72. return QDF_STATUS_E_NOSUPPORT;
  73. }
  74. static inline QDF_STATUS
  75. util_find_mlie(uint8_t *buf, qdf_size_t buflen, uint8_t **mlieseq,
  76. qdf_size_t *mlieseqlen)
  77. {
  78. return QDF_STATUS_E_NOSUPPORT;
  79. }
  80. #endif /* WLAN_FEATURE_11BE_MLO */
  81. #endif /* _WLAN_UTILS_MLO_H_ */