osif_twt_internal.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /*
  2. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * DOC: osif_twt_internal.h
  20. *
  21. * WLAN Host Device Driver file for TWT (Target Wake Time) support.
  22. *
  23. */
  24. #ifndef _OSIF_TWT_INTERNAL_H_
  25. #define _OSIF_TWT_INTERNAL_H_
  26. #if defined(WLAN_SUPPORT_TWT) && defined(WLAN_TWT_CONV_SUPPORTED)
  27. /**
  28. * struct twt_conc_context: TWT concurrency args
  29. * @psoc: pointer to psoc
  30. */
  31. struct twt_conc_context {
  32. struct wlan_objmgr_psoc *psoc;
  33. };
  34. /**
  35. * osif_twt_send_requestor_enable_cmd() - Send TWT requestor enable command to
  36. * target
  37. * @psoc: pointer to global psoc structure
  38. * @pdev_id: pdev id
  39. *
  40. * Return: errno
  41. */
  42. int osif_twt_send_requestor_enable_cmd(struct wlan_objmgr_psoc *psoc,
  43. uint8_t pdev_id);
  44. /**
  45. * osif_twt_send_responder_enable_cmd() - Send TWT responder enable command to
  46. * target
  47. * @psoc: pointer to global psoc structure
  48. * @pdev_id: pdev id
  49. *
  50. * Return: errno
  51. */
  52. int osif_twt_send_responder_enable_cmd(struct wlan_objmgr_psoc *psoc,
  53. uint8_t pdev_id);
  54. /**
  55. * osif_twt_send_requestor_disable_cmd() - Send TWT requestor disable command
  56. * to target
  57. * @psoc: pointer to global psoc structure
  58. * @pdev_id: pdev id
  59. * @reason: disable reason code
  60. *
  61. * Return: errno
  62. */
  63. int osif_twt_send_requestor_disable_cmd(struct wlan_objmgr_psoc *psoc,
  64. uint8_t pdev_id, uint32_t reason);
  65. /**
  66. * osif_twt_send_responder_disable_cmd() - Send TWT responder disable command
  67. * to target
  68. * @psoc: pointer to global psoc structure
  69. * @pdev_id: pdev id
  70. * @reason: disable reason code
  71. *
  72. * Return: errno
  73. */
  74. int osif_twt_send_responder_disable_cmd(struct wlan_objmgr_psoc *psoc,
  75. uint8_t pdev_id, uint32_t reason);
  76. /**
  77. * osif_twt_concurrency_update_handler() - Handle TWT concurrency scenario
  78. * @psoc: pointer to global psoc structure
  79. * @pdev: pointer to pdev
  80. *
  81. * Return: none
  82. */
  83. void osif_twt_concurrency_update_handler(struct wlan_objmgr_psoc *psoc,
  84. struct wlan_objmgr_pdev *pdev);
  85. /**
  86. * osif_twt_teardown_in_ps_disable() - Send TWT teardown if power save
  87. * mode is disabled
  88. *
  89. * @psoc: pointer to global psoc structure
  90. * @mac_addr: Peer MAC Address
  91. * @vdev_id: vdev_id
  92. */
  93. void osif_twt_teardown_in_ps_disable(struct wlan_objmgr_psoc *psoc,
  94. struct qdf_mac_addr *mac_addr,
  95. uint8_t vdev_id);
  96. #else
  97. static inline
  98. int osif_twt_send_requestor_disable_cmd(struct wlan_objmgr_psoc *psoc,
  99. uint8_t pdev_id, uint32_t reason)
  100. {
  101. return 0;
  102. }
  103. static inline
  104. int osif_twt_send_requestor_enable_cmd(struct wlan_objmgr_psoc *psoc,
  105. uint8_t pdev_id)
  106. {
  107. return 0;
  108. }
  109. static inline
  110. int osif_twt_send_responder_enable_cmd(struct wlan_objmgr_psoc *psoc,
  111. uint8_t pdev_id)
  112. {
  113. return 0;
  114. }
  115. static inline
  116. void osif_twt_concurrency_update_handler(struct wlan_objmgr_psoc *psoc,
  117. struct wlan_objmgr_pdev *pdev)
  118. {
  119. }
  120. static inline
  121. void osif_twt_teardown_in_ps_disable(struct wlan_objmgr_psoc *psoc,
  122. struct qdf_mac_addr *mac_addr,
  123. uint8_t vdev_id)
  124. {
  125. }
  126. #endif
  127. #endif /* _OSIF_TWT_INTERNAL_H_ */