cdp_txrx_wds.h 3.1 KB

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