cdp_txrx_ocb.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Copyright (c) 2016-2017, 2019 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
  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. #ifndef _CDP_TXRX_OCB_H_
  20. #define _CDP_TXRX_OCB_H_
  21. #include <cdp_txrx_mob_def.h>
  22. #include "cdp_txrx_handle.h"
  23. /**
  24. * cdp_set_ocb_chan_info() - set OCB channel info to vdev.
  25. * @soc: data path soc handle
  26. * @vdev_id: vdev_id corresponding to vdev start
  27. * @ocb_set_chan: OCB channel information to be set in vdev.
  28. *
  29. * Return: NONE
  30. */
  31. static inline void
  32. cdp_set_ocb_chan_info(ol_txrx_soc_handle soc, uint8_t vdev_id,
  33. struct ol_txrx_ocb_set_chan ocb_set_chan)
  34. {
  35. if (!soc || !soc->ops || !soc->ops->ocb_ops) {
  36. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  37. "%s invalid instance", __func__);
  38. return;
  39. }
  40. if (soc->ops->ocb_ops->set_ocb_chan_info)
  41. soc->ops->ocb_ops->set_ocb_chan_info(soc, vdev_id,
  42. ocb_set_chan);
  43. }
  44. /**
  45. * cdp_get_ocb_chan_info() - return handle to vdev ocb_channel_info
  46. * @soc: data path soc handle
  47. * @vdev_id: vdev_id corresponding to vdev start
  48. *
  49. * Return: handle to struct ol_txrx_ocb_chan_info
  50. */
  51. static inline struct ol_txrx_ocb_chan_info *
  52. cdp_get_ocb_chan_info(ol_txrx_soc_handle soc, uint8_t vdev_id)
  53. {
  54. if (!soc || !soc->ops || !soc->ops->ocb_ops) {
  55. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  56. "%s invalid instance", __func__);
  57. return NULL;
  58. }
  59. if (soc->ops->ocb_ops->get_ocb_chan_info)
  60. return soc->ops->ocb_ops->get_ocb_chan_info(soc, vdev_id);
  61. return NULL;
  62. }
  63. #endif /* _CDP_TXRX_OCB_H_ */