cdp_txrx_raw.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file cdp_txrx_raw.h
  28. * @brief Define the host data path raw mode API functions
  29. * called by the host control SW and the OS interface module
  30. */
  31. #ifndef _CDP_TXRX_RAW_H_
  32. #define _CDP_TXRX_RAW_H_
  33. #include "cdp_txrx_handle.h"
  34. #include "cdp_txrx_ops.h"
  35. /* TODO: adf need to be replaced with qdf */
  36. static inline int cdp_get_nwifi_mode(ol_txrx_soc_handle soc,
  37. struct cdp_vdev *vdev)
  38. {
  39. if (soc->ops->raw_ops->txrx_get_nwifi_mode)
  40. return soc->ops->raw_ops->txrx_get_nwifi_mode(vdev);
  41. return 0;
  42. }
  43. /**
  44. * @brief finds the ast entry for the packet
  45. * @details: Finds the ast entry i.e 4th address for the packet based on the
  46. * details in the netbuf.
  47. *
  48. * @param vdev - 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 void
  55. cdp_rawsim_get_astentry (ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
  56. qdf_nbuf_t *pnbuf, struct cdp_raw_ast *raw_ast)
  57. {
  58. if (!soc || !soc->ops || !soc->ops->raw_ops)
  59. return;
  60. if (soc->ops->raw_ops->rsim_get_astentry)
  61. soc->ops->raw_ops->rsim_get_astentry(vdev, pnbuf, raw_ast);
  62. return;
  63. }
  64. #endif