cdp_txrx_raw.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (c) 2016-2017, 2019, 2021 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. /**
  20. * DOC: cdp_txrx_raw.h
  21. * Define the host data path raw mode API functions
  22. * called by the host control SW and the OS interface module
  23. */
  24. #ifndef _CDP_TXRX_RAW_H_
  25. #define _CDP_TXRX_RAW_H_
  26. #include "cdp_txrx_handle.h"
  27. #include "cdp_txrx_ops.h"
  28. #include <cdp_txrx_cmn.h>
  29. /**
  30. * cdp_rawsim_get_astentry() - finds the ast entry for the packet
  31. * @soc: soc handle
  32. * @vdev_id: id of the data virtual device object
  33. * @pnbuf: pointer to nbuf
  34. * @raw_ast: pointer to fill ast information
  35. *
  36. * Finds the ast entry i.e 4th address for the packet based on the
  37. * details in the netbuf.
  38. *
  39. * Return: 0 on success, -1 on error, 1 if more nbufs need to be consumed.
  40. */
  41. static inline QDF_STATUS
  42. cdp_rawsim_get_astentry(ol_txrx_soc_handle soc, uint8_t vdev_id,
  43. qdf_nbuf_t *pnbuf, struct cdp_raw_ast *raw_ast)
  44. {
  45. if (!soc || !soc->ops) {
  46. dp_cdp_debug("Invalid Instance");
  47. QDF_BUG(0);
  48. return QDF_STATUS_E_FAILURE;
  49. }
  50. if (!soc->ops->raw_ops ||
  51. !soc->ops->raw_ops->rsim_get_astentry)
  52. return QDF_STATUS_E_FAILURE;
  53. return soc->ops->raw_ops->rsim_get_astentry(soc, vdev_id,
  54. pnbuf, raw_ast);
  55. }
  56. #endif