osif_twt_internal.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. #else
  86. static inline
  87. int osif_twt_send_requestor_disable_cmd(struct wlan_objmgr_psoc *psoc,
  88. uint8_t pdev_id, uint32_t reason)
  89. {
  90. return 0;
  91. }
  92. static inline
  93. int osif_twt_send_requestor_enable_cmd(struct wlan_objmgr_psoc *psoc,
  94. uint8_t pdev_id)
  95. {
  96. return 0;
  97. }
  98. static inline
  99. int osif_twt_send_responder_enable_cmd(struct wlan_objmgr_psoc *psoc,
  100. uint8_t pdev_id)
  101. {
  102. return 0;
  103. }
  104. static inline
  105. void osif_twt_concurrency_update_handler(struct wlan_objmgr_psoc *psoc,
  106. struct wlan_objmgr_pdev *pdev)
  107. {
  108. }
  109. #endif
  110. #endif /* _OSIF_TWT_INTERNAL_H_ */