wlan_p2p_api.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright (c) 2019-2020 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: This file contains P2P public API's exposed.
  20. */
  21. #include "wlan_p2p_api.h"
  22. #include <wlan_objmgr_psoc_obj.h>
  23. #include "wlan_p2p_public_struct.h"
  24. #include "../../core/src/wlan_p2p_main.h"
  25. #include "../../core/src/wlan_p2p_roc.h"
  26. bool wlan_p2p_check_oui_and_force_1x1(uint8_t *assoc_ie, uint32_t assoc_ie_len)
  27. {
  28. if (!assoc_ie || !assoc_ie_len)
  29. return false;
  30. return p2p_check_oui_and_force_1x1(assoc_ie, assoc_ie_len);
  31. }
  32. QDF_STATUS wlan_p2p_cleanup_roc_by_vdev(struct wlan_objmgr_vdev *vdev)
  33. {
  34. struct p2p_soc_priv_obj *p2p_soc_obj;
  35. struct wlan_objmgr_psoc *psoc;
  36. p2p_debug("vdev:%pK", vdev);
  37. if (!vdev) {
  38. p2p_debug("null vdev");
  39. return QDF_STATUS_E_INVAL;
  40. }
  41. psoc = wlan_vdev_get_psoc(vdev);
  42. if (!psoc) {
  43. p2p_err("null psoc");
  44. return QDF_STATUS_E_INVAL;
  45. }
  46. p2p_soc_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc,
  47. WLAN_UMAC_COMP_P2P);
  48. if (!p2p_soc_obj) {
  49. p2p_err("p2p soc context is NULL");
  50. return QDF_STATUS_E_FAILURE;
  51. }
  52. return p2p_cleanup_roc_sync(p2p_soc_obj, vdev);
  53. }
  54. QDF_STATUS wlan_p2p_status_connect(struct wlan_objmgr_vdev *vdev)
  55. {
  56. if (!vdev) {
  57. p2p_err("vdev is NULL");
  58. return QDF_STATUS_E_INVAL;
  59. }
  60. return p2p_status_connect(vdev);
  61. }