target_if_dcs.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright (c) 2020, The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. /**
  18. * DOC: target_if_dcs.h
  19. *
  20. * This header file provide declarations required for Rx and Tx events from
  21. * firmware
  22. */
  23. #ifndef __TARGET_IF_DCS_H__
  24. #define __TARGET_IF_DCS_H__
  25. #include <target_if.h>
  26. #include <wlan_lmac_if_def.h>
  27. /**
  28. * target_if_dcs_get_rx_ops() - get rx ops
  29. * @psoc: pointer to psoc context
  30. *
  31. * API to retrieve the dcs rx ops from the psoc context
  32. *
  33. * Return: pointer to rx ops
  34. */
  35. static inline struct wlan_target_if_dcs_rx_ops *
  36. target_if_dcs_get_rx_ops(struct wlan_objmgr_psoc *psoc)
  37. {
  38. struct wlan_lmac_if_rx_ops *rx_ops;
  39. rx_ops = wlan_psoc_get_lmac_if_rxops(psoc);
  40. if (!rx_ops) {
  41. target_if_err("rx_ops is NULL");
  42. return NULL;
  43. }
  44. return &rx_ops->dcs_rx_ops;
  45. }
  46. /**
  47. * target_if_dcs_get_tx_ops() - get tx ops
  48. * @psoc: pointer to psoc context
  49. *
  50. * API to retrieve the dcs tx ops from the psoc context
  51. *
  52. * Return: pointer to tx ops
  53. */
  54. static inline struct wlan_target_if_dcs_tx_ops *
  55. target_if_dcs_get_tx_ops(struct wlan_objmgr_psoc *psoc)
  56. {
  57. struct wlan_lmac_if_tx_ops *tx_ops;
  58. tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
  59. if (!tx_ops) {
  60. target_if_err("tx_ops is NULL");
  61. return NULL;
  62. }
  63. return &tx_ops->dcs_tx_ops;
  64. }
  65. /**
  66. * target_if_dcs_register_tx_ops() - register dcs target_if tx ops functions
  67. * @tx_ops: pointer to target_if tx ops
  68. *
  69. * API to register dcs tx ops
  70. *
  71. * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
  72. */
  73. QDF_STATUS
  74. target_if_dcs_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
  75. #endif /* __TARGET_IF_DCS_H__ */