cdp_txrx_mscs.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. /**
  20. * DOC: cdp_txrx_mscs.h
  21. * Define the host data path MSCS API functions
  22. * called by the host control SW and the OS interface module
  23. */
  24. #ifndef _CDP_TXRX_MSCS_H_
  25. #define _CDP_TXRX_MSCS_H_
  26. #include "cdp_txrx_handle.h"
  27. #ifdef WLAN_SUPPORT_MSCS
  28. /**
  29. * cdp_mscs_peer_lookup_n_get_priority() - find MSCS enabled peer for this mac
  30. * address and validate priority
  31. * @soc: SoC handle
  32. * @src_mac: source mac address of peer
  33. * @dst_mac: destination mac address of peer
  34. * @nbuf: nbuf pointer
  35. *
  36. * This function checks if there is a peer for this mac address with MSCS
  37. * enabled flag set and nbuf priority is valid from user priority bitmap.
  38. *
  39. * Return: 0 for non error case, 1 for failure
  40. */
  41. static inline int
  42. cdp_mscs_peer_lookup_n_get_priority(ol_txrx_soc_handle soc,
  43. uint8_t *src_mac, uint8_t *dst_mac,
  44. qdf_nbuf_t nbuf)
  45. {
  46. if (!soc || !soc->ops || !soc->ops->mscs_ops) {
  47. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  48. "%s invalid instance", __func__);
  49. return 1;
  50. }
  51. if (soc->ops->mscs_ops->mscs_peer_lookup_n_get_priority)
  52. return soc->ops->mscs_ops->mscs_peer_lookup_n_get_priority(soc,
  53. src_mac, dst_mac, nbuf);
  54. return 0;
  55. }
  56. #endif
  57. #endif