cdp_txrx_raw.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 || !soc->ops) {
  40. QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
  41. "%s: Invalid Instance", __func__);
  42. QDF_BUG(0);
  43. return 0;
  44. }
  45. if (!soc->ops->raw_ops ||
  46. !soc->ops->raw_ops->txrx_get_nwifi_mode)
  47. return 0;
  48. return soc->ops->raw_ops->txrx_get_nwifi_mode(vdev);
  49. }
  50. /**
  51. * @brief finds the ast entry for the packet
  52. * @details: Finds the ast entry i.e 4th address for the packet based on the
  53. * details in the netbuf.
  54. *
  55. * @param vdev - the data virtual device object
  56. * @param pnbuf - pointer to nbuf
  57. * @param raw_ast - pointer to fill ast information
  58. *
  59. * @return - 0 on success, -1 on error, 1 if more nbufs need to be consumed.
  60. */
  61. static inline void
  62. cdp_rawsim_get_astentry (ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
  63. qdf_nbuf_t *pnbuf, struct cdp_raw_ast *raw_ast)
  64. {
  65. if (!soc || !soc->ops) {
  66. QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
  67. "%s: Invalid Instance", __func__);
  68. QDF_BUG(0);
  69. return;
  70. }
  71. if (!soc->ops->raw_ops ||
  72. !soc->ops->raw_ops->rsim_get_astentry)
  73. return;
  74. soc->ops->raw_ops->rsim_get_astentry(vdev, pnbuf, raw_ast);
  75. }
  76. #endif