wlan_p2p_api.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. /**
  20. * DOC: Contains p2p public data structure definitions
  21. */
  22. #ifndef _WLAN_P2P_API_H_
  23. #define _WLAN_P2P_API_H_
  24. #include <qdf_types.h>
  25. #include <wlan_objmgr_vdev_obj.h>
  26. /**
  27. * wlan_p2p_check_oui_and_force_1x1() - Function to get P2P client device
  28. * attributes from assoc request frames
  29. * @assoc_ie: pointer to assoc request frame IEs
  30. * @ie_len: length of the assoc request frame IE
  31. *
  32. * When assoc request is received from P2P STA device, this function checks
  33. * for specific OUI present in the P2P device info attribute. The caller should
  34. * take care of checking if this is called only in P2P GO mode.
  35. *
  36. * Return: True if OUI is present, else false.
  37. */
  38. bool wlan_p2p_check_oui_and_force_1x1(uint8_t *assoc_ie, uint32_t ie_len);
  39. /**
  40. * wlan_p2p_cleanup_roc_by_vdev() - Cleanup roc request by vdev
  41. * @vdev: pointer to vdev object
  42. * @sync: whether to wait for complete event
  43. *
  44. * This function call P2P API to cleanup roc request by vdev
  45. *
  46. * Return: QDF_STATUS_SUCCESS - in case of success
  47. */
  48. QDF_STATUS wlan_p2p_cleanup_roc_by_vdev(struct wlan_objmgr_vdev *vdev,
  49. bool sync);
  50. /**
  51. * wlan_p2p_status_connect() - Update P2P connection status
  52. * @vdev: vdev context
  53. *
  54. * Updates P2P connection status by up layer when connecting.
  55. *
  56. * Return: QDF_STATUS_SUCCESS - in case of success
  57. */
  58. QDF_STATUS wlan_p2p_status_connect(struct wlan_objmgr_vdev *vdev);
  59. /**
  60. * wlan_p2p_is_action_frame_of_p2p_type() - Given action frame is p2p type or
  61. * not
  62. * @data_buf: data buffer address
  63. * @length: buffer length
  64. *
  65. * Return: bool
  66. */
  67. bool wlan_p2p_is_action_frame_of_p2p_type(uint8_t *data_buf, uint32_t length);
  68. /**
  69. * wlan_p2p_abort_scan() - Abort on going scan on p2p interfaces
  70. * @pdev: pdev object
  71. *
  72. * This function triggers an abort scan request to scan component to abort the
  73. * ongoing scan request on p2p vdevs.
  74. *
  75. * Return: QDF_STATUS_SUCCESS - in case of success
  76. */
  77. QDF_STATUS wlan_p2p_abort_scan(struct wlan_objmgr_pdev *pdev);
  78. #ifdef WLAN_FEATURE_P2P_P2P_STA
  79. /**
  80. * wlan_p2p_check_and_force_scc_go_plus_go() - Check and do force scc for
  81. * go plus go
  82. * @psoc: psoc object
  83. * @vdev: vdev object
  84. *
  85. * This function checks whether force scc is enabled or not. If it
  86. * is enabled then it will do force scc to remaining p2p go vdev if
  87. * user has initiated CSA to current vdev.
  88. *
  89. * Return: status
  90. */
  91. QDF_STATUS
  92. wlan_p2p_check_and_force_scc_go_plus_go(struct wlan_objmgr_psoc *psoc,
  93. struct wlan_objmgr_vdev *vdev);
  94. #else
  95. static inline QDF_STATUS
  96. wlan_p2p_check_and_force_scc_go_plus_go(struct wlan_objmgr_psoc *psoc,
  97. struct wlan_objmgr_vdev *vdev)
  98. {
  99. return QDF_STATUS_SUCCESS;
  100. }
  101. #endif
  102. #endif