cdp_txrx_raw.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Copyright (c) 2016-2017, 2019 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. * @file cdp_txrx_raw.h
  20. * @brief Define the host data path raw mode API functions
  21. * called by the host control SW and the OS interface module
  22. */
  23. #ifndef _CDP_TXRX_RAW_H_
  24. #define _CDP_TXRX_RAW_H_
  25. #include "cdp_txrx_handle.h"
  26. #include "cdp_txrx_ops.h"
  27. /* TODO: adf need to be replaced with qdf */
  28. static inline int cdp_get_nwifi_mode(ol_txrx_soc_handle soc,
  29. uint8_t vdev_id)
  30. {
  31. if (!soc || !soc->ops) {
  32. QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
  33. "%s: Invalid Instance", __func__);
  34. QDF_BUG(0);
  35. return 0;
  36. }
  37. if (!soc->ops->raw_ops ||
  38. !soc->ops->raw_ops->txrx_get_nwifi_mode)
  39. return 0;
  40. return soc->ops->raw_ops->txrx_get_nwifi_mode(soc, vdev_id);
  41. }
  42. /**
  43. * @brief finds the ast entry for the packet
  44. * @details: Finds the ast entry i.e 4th address for the packet based on the
  45. * details in the netbuf.
  46. *
  47. * @param soc - soc handle
  48. * @param vdev_id - id of the data virtual device object
  49. * @param pnbuf - pointer to nbuf
  50. * @param raw_ast - pointer to fill ast information
  51. *
  52. * @return - 0 on success, -1 on error, 1 if more nbufs need to be consumed.
  53. */
  54. static inline QDF_STATUS
  55. cdp_rawsim_get_astentry(ol_txrx_soc_handle soc, uint8_t vdev_id,
  56. qdf_nbuf_t *pnbuf, struct cdp_raw_ast *raw_ast)
  57. {
  58. if (!soc || !soc->ops) {
  59. QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
  60. "%s: Invalid Instance", __func__);
  61. QDF_BUG(0);
  62. return QDF_STATUS_E_FAILURE;
  63. }
  64. if (!soc->ops->raw_ops ||
  65. !soc->ops->raw_ops->rsim_get_astentry)
  66. return QDF_STATUS_E_FAILURE;
  67. return soc->ops->raw_ops->rsim_get_astentry(soc, vdev_id,
  68. pnbuf, raw_ast);
  69. }
  70. #endif