wmi_unified_11be_tlv.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * Copyright (c) 2021, The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef _WMI_UNIFIED_11BE_TLV_H_
  17. #define _WMI_UNIFIED_11BE_TLV_H_
  18. #ifdef WLAN_FEATURE_11BE_MLO
  19. /**
  20. * vdev_create_mlo_params_size() - Get MLO params size in vdev create
  21. *
  22. * Return: size of MLO params in vdev create
  23. */
  24. size_t vdev_create_mlo_params_size(void);
  25. /**
  26. * vdev_create_add_mlo_params() - Add MLO params in vdev create cmd
  27. * @buf_ptr: pointer to vdev create buffer.
  28. * @param: ponter to vdev create request param
  29. *
  30. * Return: pointer to new offset of vdev create buffer
  31. */
  32. uint8_t *vdev_create_add_mlo_params(uint8_t *buf_ptr,
  33. struct vdev_create_params *param);
  34. /**
  35. * vdev_start_mlo_params_size() - Get MLO params size in vdev start
  36. * @req: Vdev start request params
  37. *
  38. * Return: size of MLO params in vdev start
  39. */
  40. size_t vdev_start_mlo_params_size(struct vdev_start_params *req);
  41. /**
  42. * vdev_start_add_mlo_params() - Add MLO params in vdev start cmd
  43. * @buf_ptr: pointer to vdev start buffer.
  44. * @req: ponter to vdev create request param
  45. *
  46. * Return: pointer to new offset of cmd buffer
  47. */
  48. uint8_t *vdev_start_add_mlo_params(uint8_t *buf_ptr,
  49. struct vdev_start_params *req);
  50. /**
  51. * vdev_start_add_ml_partner_links() - Add MLO partner links in vdev start cmd
  52. * @buf_ptr: pointer to vdev start cmd buffer.
  53. * @req: ponter to vdev start request param
  54. *
  55. * Return: pointer to new offset of cmd buffer
  56. */
  57. uint8_t *vdev_start_add_ml_partner_links(uint8_t *buf_ptr,
  58. struct vdev_start_params *req);
  59. #else
  60. static uint8_t *vdev_create_add_mlo_params(uint8_t *buf_ptr,
  61. struct vdev_create_params *param)
  62. {
  63. WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0);
  64. return buf_ptr + WMI_TLV_HDR_SIZE;
  65. }
  66. static size_t vdev_create_mlo_params_size(void)
  67. {
  68. return WMI_TLV_HDR_SIZE;
  69. }
  70. static uint8_t *vdev_start_add_mlo_params(uint8_t *buf_ptr,
  71. struct vdev_start_params *req)
  72. {
  73. WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0);
  74. return buf_ptr + WMI_TLV_HDR_SIZE;
  75. }
  76. static size_t vdev_start_mlo_params_size(struct vdev_start_params *req)
  77. {
  78. return WMI_TLV_HDR_SIZE;
  79. }
  80. static uint8_t *vdev_start_add_ml_partner_links(uint8_t *buf_ptr,
  81. struct vdev_start_params *req)
  82. {
  83. WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0);
  84. return buf_ptr + WMI_TLV_HDR_SIZE;
  85. }
  86. #endif /*WLAN_FEATURE_11BE_MLO*/
  87. #endif /*_WMI_UNIFIED_11BE_TLV_H_*/