os_if_nan.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /*
  2. * Copyright (c) 2012-2018 The Linux Foundation. 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: declares nan component os interface APIs
  20. */
  21. #ifndef _OS_IF_NAN_H_
  22. #define _OS_IF_NAN_H_
  23. #include "qdf_types.h"
  24. #include "nan_public_structs.h"
  25. #include "nan_ucfg_api.h"
  26. struct wlan_objmgr_psoc;
  27. struct wlan_objmgr_vdev;
  28. #ifdef WLAN_FEATURE_NAN_CONVERGENCE
  29. /**
  30. * os_if_nan_process_ndp_cmd: os_if api to handle nan request message
  31. * @psoc: pointer to psoc object
  32. * @data: request data. contains vendor cmd tlvs
  33. * @data_len: length of data
  34. *
  35. * Return: status of operation
  36. */
  37. int os_if_nan_process_ndp_cmd(struct wlan_objmgr_psoc *psoc,
  38. const void *data, int data_len);
  39. /**
  40. * os_if_nan_event_handler: os_if handler api for nan response messages
  41. * @psoc: pointer to psoc object
  42. * @vdev: pointer to vdev object
  43. * @type: message type
  44. * @msg: msg buffer
  45. *
  46. * Return: None
  47. */
  48. void os_if_nan_event_handler(struct wlan_objmgr_psoc *psoc,
  49. struct wlan_objmgr_vdev *vdev,
  50. uint32_t type, void *msg);
  51. /**
  52. * os_if_nan_register_hdd_callbacks: os_if api to register hdd callbacks
  53. * @psoc: pointer to psoc object
  54. * @cb_obj: struct pointer containing callbacks
  55. *
  56. * Return: status of operation
  57. */
  58. int os_if_nan_register_hdd_callbacks(struct wlan_objmgr_psoc *psoc,
  59. struct nan_callbacks *cb_obj);
  60. /**
  61. * os_if_nan_register_lim_callbacks: os_if api to register lim callbacks
  62. * @psoc: pointer to psoc object
  63. * @cb_obj: struct pointer containing callbacks
  64. *
  65. * Return: status of operation
  66. */
  67. int os_if_nan_register_lim_callbacks(struct wlan_objmgr_psoc *psoc,
  68. struct nan_callbacks *cb_obj);
  69. /**
  70. * os_if_nan_post_ndi_create_rsp: os_if api to pos ndi create rsp to umac nan
  71. * component
  72. * @psoc: pointer to psoc object
  73. * @vdev_id: vdev id of ndi
  74. * @success: if create was success or failure
  75. *
  76. * Return: None
  77. */
  78. void os_if_nan_post_ndi_create_rsp(struct wlan_objmgr_psoc *psoc,
  79. uint8_t vdev_id, bool success);
  80. /**
  81. * os_if_nan_post_ndi_delete_rsp: os_if api to pos ndi delete rsp to umac nan
  82. * component
  83. * @psoc: pointer to psoc object
  84. * @vdev_id: vdev id of ndi
  85. * @success: if delete was success or failure
  86. *
  87. * Return: None
  88. */
  89. void os_if_nan_post_ndi_delete_rsp(struct wlan_objmgr_psoc *psoc,
  90. uint8_t vdev_id, bool success);
  91. /**
  92. * os_if_nan_ndi_session_end: os_if api to process ndi session end
  93. * component
  94. * @vdev: pointer to vdev deleted
  95. *
  96. * Return: None
  97. */
  98. void os_if_nan_ndi_session_end(struct wlan_objmgr_vdev *vdev);
  99. /**
  100. * os_if_nan_set_ndi_state: os_if api set NDI state
  101. * @vdev: pointer to vdev deleted
  102. * @state: value to set
  103. *
  104. * Return: status of operation
  105. */
  106. static inline QDF_STATUS os_if_nan_set_ndi_state(struct wlan_objmgr_vdev *vdev,
  107. uint32_t state)
  108. {
  109. return ucfg_nan_set_ndi_state(vdev, state);
  110. }
  111. /**
  112. * os_if_nan_set_ndp_create_transaction_id: set ndp create transaction id
  113. * @vdev: pointer to vdev object
  114. * @val: value to set
  115. *
  116. * Return: status of operation
  117. */
  118. static inline QDF_STATUS os_if_nan_set_ndp_create_transaction_id(
  119. struct wlan_objmgr_vdev *vdev,
  120. uint16_t val)
  121. {
  122. return ucfg_nan_set_ndp_create_transaction_id(vdev, val);
  123. }
  124. /**
  125. * os_if_nan_set_ndp_delete_transaction_id: set ndp delete transaction id
  126. * @vdev: pointer to vdev object
  127. * @val: value to set
  128. *
  129. * Return: status of operation
  130. */
  131. static inline QDF_STATUS os_if_nan_set_ndp_delete_transaction_id(
  132. struct wlan_objmgr_vdev *vdev,
  133. uint16_t val)
  134. {
  135. return ucfg_nan_set_ndp_delete_transaction_id(vdev, val);
  136. }
  137. #else
  138. static inline void os_if_nan_post_ndi_create_rsp(struct wlan_objmgr_psoc *psoc,
  139. uint8_t vdev_id, bool success)
  140. {
  141. }
  142. static inline void os_if_nan_post_ndi_delete_rsp(struct wlan_objmgr_psoc *psoc,
  143. uint8_t vdev_id, bool success)
  144. {
  145. }
  146. #endif /* WLAN_FEATURE_NAN_CONVERGENCE */
  147. #endif