cdp_txrx_wds.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Copyright (c) 2016-2017 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_wds.h
  20. * @brief Define the host data path WDS API functions
  21. * called by the host control SW and the OS interface module
  22. */
  23. #ifndef _CDP_TXRX_WDS_H_
  24. #define _CDP_TXRX_WDS_H_
  25. #include "cdp_txrx_handle.h"
  26. /**
  27. * @brief set the wds rx filter policy of the device
  28. * @details
  29. * This flag sets the wds rx policy on the vdev. Rx frames not compliant
  30. * with the policy will be dropped.
  31. *
  32. * @param vdev - the data virtual device object
  33. * @param val - the wds rx policy bitmask
  34. * @return - void
  35. */
  36. static inline void
  37. cdp_set_wds_rx_policy(ol_txrx_soc_handle soc,
  38. struct cdp_vdev *vdev,
  39. u_int32_t val)
  40. {
  41. if (!soc || !soc->ops || !soc->ops->wds_ops) {
  42. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  43. "%s invalid instance", __func__);
  44. return;
  45. }
  46. if (soc->ops->wds_ops->txrx_set_wds_rx_policy)
  47. return soc->ops->wds_ops->txrx_set_wds_rx_policy(vdev, val);
  48. return;
  49. }
  50. /**
  51. * @brief set the wds rx filter policy of the device
  52. * @details
  53. * This flag sets the wds rx policy on the vdev. Rx frames not compliant
  54. * with the policy will be dropped.
  55. *
  56. * @param vdev - the data virtual device object
  57. * @param val - the wds rx policy bitmask
  58. * @return - void
  59. */
  60. static inline void
  61. cdp_set_wds_tx_policy_update(ol_txrx_soc_handle soc,
  62. struct cdp_peer *peer,
  63. int wds_tx_ucast, int wds_tx_mcast)
  64. {
  65. if (!soc || !soc->ops || !soc->ops->wds_ops) {
  66. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  67. "%s invalid instance", __func__);
  68. return;
  69. }
  70. if (soc->ops->wds_ops->txrx_wds_peer_tx_policy_update)
  71. return soc->ops->wds_ops->txrx_wds_peer_tx_policy_update(
  72. peer, wds_tx_ucast, wds_tx_mcast);
  73. return;
  74. }
  75. /**
  76. * cdp_vdev_set_wds() - Set/unset wds_enable flag in vdev
  77. * @soc - data path soc handle
  78. * @vdev - data path vap handle
  79. * @val - value to be set in wds_en flag
  80. *
  81. * This flag enables WDS source port learning feature on a vdev
  82. *
  83. * return 1 on success
  84. */
  85. static inline int
  86. cdp_vdev_set_wds(ol_txrx_soc_handle soc, void *vdev, uint32_t val)
  87. {
  88. if (soc->ops->wds_ops->vdev_set_wds)
  89. return soc->ops->wds_ops->vdev_set_wds(vdev, val);
  90. return 0;
  91. }
  92. #endif