cdp_txrx_mscs.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (c) 2020 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_mscs.h
  20. * @brief Define the host data path MSCS API functions
  21. * called by the host control SW and the OS interface module
  22. */
  23. #ifndef _CDP_TXRX_MSCS_H_
  24. #define _CDP_TXRX_MSCS_H_
  25. #include "cdp_txrx_handle.h"
  26. #ifdef WLAN_SUPPORT_MSCS
  27. /**
  28. * @brief find MSCS enabled peer for this mac address and validate priority
  29. * @details
  30. * This function checks if there is a peer for this mac adress with MSCS
  31. * enabled flag set and nbuf priority is valid from user priority bitmap.
  32. *
  33. * @param peer_mac - mac address of peer
  34. * @param nbuf - nbuf pointer
  35. * @return - 0 for non error case, 1 for failure
  36. */
  37. static inline int
  38. cdp_mscs_peer_lookup_n_get_priority(ol_txrx_soc_handle soc,
  39. uint8_t *peer_mac,
  40. qdf_nbuf_t nbuf)
  41. {
  42. if (!soc || !soc->ops || !soc->ops->mscs_ops) {
  43. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  44. "%s invalid instance", __func__);
  45. return 1;
  46. }
  47. if (soc->ops->mscs_ops->mscs_peer_lookup_n_get_priority)
  48. soc->ops->mscs_ops->mscs_peer_lookup_n_get_priority(soc,
  49. peer_mac, nbuf);
  50. return 0;
  51. }
  52. #endif
  53. #endif