cdp_txrx_wds.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. * cdp_vdev_set_wds() - Set/unset wds_enable flag in vdev
  60. * @soc - data path soc handle
  61. * @vdev - data path vap handle
  62. * @val - value to be set in wds_en flag
  63. *
  64. * This flag enables WDS source port learning feature on a vdev
  65. *
  66. * return 1 on success
  67. */
  68. static inline int
  69. cdp_vdev_set_wds(ol_txrx_soc_handle soc, void *vdev, uint32_t val)
  70. {
  71. if (soc->ops->wds_ops->vdev_set_wds)
  72. return soc->ops->wds_ops->vdev_set_wds(vdev, val);
  73. return 0;
  74. }
  75. #endif