target_if_dcs.h 2.3 KB

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