cdp_txrx_ctrl_def.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * Copyright (c) 2011-2016,2018-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_ctrl.h
  20. * @brief Define the host data path control API functions
  21. * called by the host control SW and the OS interface module
  22. */
  23. #ifndef _CDP_TXRX_CTRL_DEF_H_
  24. #define _CDP_TXRX_CTRL_DEF_H_
  25. /* TODO: adf need to be replaced with qdf */
  26. /*
  27. * Cleanups -- Might need cleanup
  28. */
  29. #if !QCA_OL_TX_PDEV_LOCK && QCA_NSS_PLATFORM || \
  30. (defined QCA_PARTNER_PLATFORM && QCA_PARTNER_SUPPORT_FAST_TX)
  31. #define VAP_TX_SPIN_LOCK(_x) spin_lock(_x)
  32. #define VAP_TX_SPIN_UNLOCK(_x) spin_unlock(_x)
  33. #else /* QCA_OL_TX_PDEV_LOCK */
  34. #define VAP_TX_SPIN_LOCK(_x)
  35. #define VAP_TX_SPIN_UNLOCK(_x)
  36. #endif /* QCA_OL_TX_PDEV_LOCK */
  37. #if QCA_OL_TX_PDEV_LOCK
  38. void ol_ll_pdev_tx_lock(void *);
  39. void ol_ll_pdev_tx_unlock(void *);
  40. #define OL_TX_LOCK(_x) ol_ll_pdev_tx_lock(_x)
  41. #define OL_TX_UNLOCK(_x) ol_ll_pdev_tx_unlock(_x)
  42. #define OL_TX_PDEV_LOCK(_x) qdf_spin_lock_bh(_x)
  43. #define OL_TX_PDEV_UNLOCK(_x) qdf_spin_unlock_bh(_x)
  44. #else
  45. #define OL_TX_PDEV_LOCK(_x)
  46. #define OL_TX_PDEV_UNLOCK(_x)
  47. #define OL_TX_LOCK(_x)
  48. #define OL_TX_UNLOCK(_x)
  49. #endif /* QCA_OL_TX_PDEV_LOCK */
  50. #if !QCA_OL_TX_PDEV_LOCK
  51. #define OL_TX_FLOW_CTRL_LOCK(_x) qdf_spin_lock_bh(_x)
  52. #define OL_TX_FLOW_CTRL_UNLOCK(_x) qdf_spin_unlock_bh(_x)
  53. #define OL_TX_DESC_LOCK(_x) qdf_spin_lock_bh(_x)
  54. #define OL_TX_DESC_UNLOCK(_x) qdf_spin_unlock_bh(_x)
  55. #define OSIF_VAP_TX_LOCK(_y, _x) spin_lock(&((_x)->tx_lock))
  56. #define OSIF_VAP_TX_UNLOCK(_y, _x) spin_unlock(&((_x)->tx_lock))
  57. #define OL_TX_PEER_LOCK(_x, _id) qdf_spin_lock_bh(&((_x)->peer_lock[_id]))
  58. #define OL_TX_PEER_UNLOCK(_x, _id) qdf_spin_unlock_bh(&((_x)->peer_lock[_id]))
  59. #define OL_TX_PEER_UPDATE_LOCK(_x, _id) \
  60. qdf_spin_lock_bh(&((_x)->peer_lock[_id]))
  61. #define OL_TX_PEER_UPDATE_UNLOCK(_x, _id) \
  62. qdf_spin_unlock_bh(&((_x)->peer_lock[_id]))
  63. #else
  64. #define OSIF_VAP_TX_LOCK(_y, _x) cdp_vdev_tx_lock( \
  65. _y, wlan_vdev_get_id((_x)->ctrl_vdev))
  66. #define OSIF_VAP_TX_UNLOCK(_y, _x) cdp_vdev_tx_unlock( \
  67. _y, wlan_vdev_get_id((_x)->ctrl_vdev))
  68. #define OL_TX_FLOW_CTRL_LOCK(_x)
  69. #define OL_TX_FLOW_CTRL_UNLOCK(_x)
  70. #define OL_TX_DESC_LOCK(_x)
  71. #define OL_TX_DESC_UNLOCK(_x)
  72. #define OL_TX_PEER_LOCK(_x, _id)
  73. #define OL_TX_PEER_UNLOCK(_x, _id)
  74. #define OL_TX_PEER_UPDATE_LOCK(_x, _id) qdf_spin_lock_bh(&((_x)->tx_lock))
  75. #define OL_TX_PEER_UPDATE_UNLOCK(_x, _id) qdf_spin_unlock_bh(&((_x)->tx_lock))
  76. #endif /* !QCA_OL_TX_PDEV_LOCK */
  77. #endif