wlan_osif_features.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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. * DOC: wlan_osif_features.h
  20. *
  21. * Define feature flags to cleanly describe when features
  22. * are present in a given version of the kernel
  23. */
  24. #ifndef _WLAN_OSIF_FEATURES_H_
  25. #define _WLAN_OSIF_FEATURES_H_
  26. #include <linux/version.h>
  27. /*
  28. * CFG80211_11BE_BASIC
  29. * Used to indicate the Linux Kernel contains support for basic 802.11be
  30. * definitions.
  31. *
  32. * These definitions were introduced in Linux Kernel 5.18 via:
  33. * cbc1ca0a9d0a ieee80211: Add EHT (802.11be) definitions
  34. * 2a2c86f15e17 ieee80211: add EHT 1K aggregation definitions
  35. * 5cd5a8a3e2fb cfg80211: Add data structures to capture EHT capabilities
  36. * 3743bec6120a cfg80211: Add support for EHT 320 MHz channel width
  37. * cfb14110acf8 nl80211: add EHT MCS support
  38. * c2b3d7699fb0 nl80211: add support for 320MHz channel limitation
  39. * 31846b657857 cfg80211: add NO-EHT flag to regulatory
  40. * ea05fd3581d3 cfg80211: Support configuration of station EHT capabilities
  41. *
  42. * These definitions were backported to Android Common Kernel 5.15 via:
  43. * https://android-review.googlesource.com/c/kernel/common/+/1996261
  44. * https://android-review.googlesource.com/c/kernel/common/+/1996262
  45. * https://android-review.googlesource.com/c/kernel/common/+/1996263
  46. * https://android-review.googlesource.com/c/kernel/common/+/1996264
  47. * https://android-review.googlesource.com/c/kernel/common/+/1996265
  48. * https://android-review.googlesource.com/c/kernel/common/+/1996266
  49. * https://android-review.googlesource.com/c/kernel/common/+/1996267
  50. * https://android-review.googlesource.com/c/kernel/common/+/1996268
  51. */
  52. #if defined(WLAN_11BE_MLO_FEATURE_ENABLE)
  53. #if (defined(__ANDROID_COMMON_KERNEL__) && \
  54. (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) && \
  55. (LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0))) || \
  56. (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0))
  57. #define CFG80211_11BE_BASIC 1
  58. #endif
  59. #endif
  60. /*
  61. * CFG80211_SA_QUERY_OFFLOAD_SUPPORT
  62. * Used to indicate the Linux Kernel contains support to offload SA Query
  63. * procedures for AP SME device
  64. *
  65. * This feature was introduced in Linux Kernel 5.17 via:
  66. * 47301a74bbfa ("nl80211: Add support to set AP settings flags with single attribute")
  67. * 87c1aec15dee ("nl80211: Add support to offload SA Query procedures for AP SME device")
  68. *
  69. * This feature was backported to Android Common Kernel 5.15 via:
  70. * https://android-review.googlesource.com/c/kernel/common/+/1958439
  71. * https://android-review.googlesource.com/c/kernel/common/+/1958440
  72. */
  73. #if (defined(__ANDROID_COMMON_KERNEL__) && \
  74. (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) && \
  75. (LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0))) || \
  76. (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
  77. #define CFG80211_SA_QUERY_OFFLOAD_SUPPORT 1
  78. #endif
  79. #endif