target_if_ipa.c 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright (c) 2018, 2020 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021, 2023 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: Target interface file for disa component to
  21. * Implement api's which shall be used by ipa component
  22. * in target if internally.
  23. */
  24. #include <target_if.h>
  25. #include <qdf_status.h>
  26. #include <wmi_unified_api.h>
  27. #include <wmi_unified_priv.h>
  28. #include <wmi_unified_param.h>
  29. #include <target_if_ipa.h>
  30. #include <wlan_objmgr_psoc_obj.h>
  31. /**
  32. * target_if_ipa_uc_offload_control_req() - send IPA offload control to FW
  33. * @psoc: pointer to PSOC object
  34. * @req: IPA UC offload enable/disable control param
  35. *
  36. * Return: QDF_STATUS_SUCCESS on success
  37. */
  38. static QDF_STATUS
  39. target_if_ipa_uc_offload_control_req(struct wlan_objmgr_psoc *psoc,
  40. struct ipa_uc_offload_control_params *req)
  41. {
  42. return wmi_unified_ipa_offload_control_cmd(
  43. get_wmi_unified_hdl_from_psoc(psoc), req);
  44. }
  45. /**
  46. * target_if_ipa_intrabss_control_req() - Send IPA intra-BSS control request
  47. * @psoc: psoc object
  48. * @req: IPA intra bss enable/disable control param
  49. *
  50. * Return: QDF_STATUS_SUCCESS on success
  51. */
  52. static QDF_STATUS
  53. target_if_ipa_intrabss_control_req(struct wlan_objmgr_psoc *psoc,
  54. struct ipa_intrabss_control_params *req)
  55. {
  56. struct vdev_set_params param = {0};
  57. wmi_unified_t wmi_handle;
  58. wmi_handle = (wmi_unified_t)get_wmi_unified_hdl_from_psoc(psoc);
  59. if (!wmi_handle)
  60. return QDF_STATUS_E_FAILURE;
  61. param.vdev_id = req->vdev_id;
  62. param.param_id = wmi_vdev_param_intra_bss_fwd;
  63. param.param_value = req->enable;
  64. return wmi_unified_vdev_set_param_send(wmi_handle, &param);
  65. }
  66. QDF_STATUS
  67. target_if_ipa_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
  68. {
  69. struct wlan_lmac_if_ipa_tx_ops *ipa_ops;
  70. if (!tx_ops) {
  71. target_if_err("tx ops is NULL!");
  72. return QDF_STATUS_E_INVAL;
  73. }
  74. ipa_ops = &tx_ops->ipa_ops;
  75. ipa_ops->ipa_uc_offload_control_req =
  76. target_if_ipa_uc_offload_control_req;
  77. ipa_ops->ipa_intrabss_control_req = target_if_ipa_intrabss_control_req;
  78. return QDF_STATUS_SUCCESS;
  79. }