wlan_osif_features.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. /*
  2. * Copyright (c) 2022-2023 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(__ANDROID_COMMON_KERNEL__) && \
  53. (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) && \
  54. (LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0))) || \
  55. (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0))
  56. #define CFG80211_11BE_BASIC 1
  57. #endif
  58. /*
  59. * CFG80211_SA_QUERY_OFFLOAD_SUPPORT
  60. * Used to indicate the Linux Kernel contains support to offload SA Query
  61. * procedures for AP SME device
  62. *
  63. * This feature was introduced in Linux Kernel 5.17 via:
  64. * 47301a74bbfa ("nl80211: Add support to set AP settings flags with single attribute")
  65. * 87c1aec15dee ("nl80211: Add support to offload SA Query procedures for AP SME device")
  66. *
  67. * This feature was backported to Android Common Kernel 5.15 via:
  68. * https://android-review.googlesource.com/c/kernel/common/+/1958439
  69. * https://android-review.googlesource.com/c/kernel/common/+/1958440
  70. */
  71. #if (defined(__ANDROID_COMMON_KERNEL__) && \
  72. (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) && \
  73. (LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0))) || \
  74. (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
  75. #define CFG80211_SA_QUERY_OFFLOAD_SUPPORT 1
  76. #endif
  77. /*
  78. * CFG80211_SINGLE_NETDEV_MULTI_LINK_SUPPORT
  79. * Used to indicate the Linux Kernel contains support for single netdevice multi
  80. * link support.
  81. *
  82. * This feature was merged into wireless-next via below commits:
  83. * 7b0a0e3c3 wifi: cfg80211: do some rework towards MLO link APIs
  84. * 0f7594489 wifi: cfg80211: mlme: get BSS entry outside cfg80211_mlme_assoc()
  85. * 9ecff10e8 wifi: nl80211: refactor BSS lookup in nl80211_associate()
  86. * 0f48b8b88 wifi: ieee80211: add definitions for multi-link element
  87. * 325839da9 wifi: cfg80211: simplify cfg80211_mlme_auth() prototype
  88. * d648c2302 wifi: nl80211: support MLO in auth/assoc
  89. *
  90. * This feature was backported to Android Common Kernel 5.15 via:
  91. * https://android-review.googlesource.com/c/kernel/common/+/2123895
  92. * https://android-review.googlesource.com/c/kernel/common/+/2115618
  93. * https://android-review.googlesource.com/c/kernel/common/+/2115620
  94. * https://android-review.googlesource.com/c/kernel/common/+/2121347
  95. * https://android-review.googlesource.com/c/kernel/common/+/2121348
  96. * https://android-review.googlesource.com/c/kernel/common/+/2121349
  97. * https://android-review.googlesource.com/c/kernel/common/+/2121350
  98. * https://android-review.googlesource.com/c/kernel/common/+/2121351
  99. * https://android-review.googlesource.com/c/kernel/common/+/2123452
  100. * https://android-review.googlesource.com/c/kernel/common/+/2123454
  101. * https://android-review.googlesource.com/c/kernel/common/+/2115621
  102. *
  103. */
  104. #if (defined(__ANDROID_COMMON_KERNEL__) && \
  105. (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) && \
  106. (defined IEEE80211_MLD_MAX_NUM_LINKS))
  107. #define CFG80211_SINGLE_NETDEV_MULTI_LINK_SUPPORT 1
  108. #endif
  109. /**
  110. * CFG80211_SAE_AUTH_TA_ADDR_SUPPORT
  111. * Used to indicate the Linux Kernel contains support for ML SAE auth with link
  112. * address as the transmitter address
  113. *
  114. * TODO: These changes are currently in internal review once upstreamed and
  115. * backported to 5.15 need to add the respective commit-ids
  116. */
  117. #if (defined(__ANDROID_COMMON_KERNEL__) && \
  118. (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) && \
  119. (defined CFG80211_EXTERNAL_AUTH_TA_SUPPORT))
  120. #define CFG80211_SAE_AUTH_TA_ADDR_SUPPORT 1
  121. #endif
  122. /*
  123. * CFG80211_MULTI_AKM_CONNECT_SUPPORT
  124. * used to indicate the Linux kernel contains support for multi AKM connect
  125. * support
  126. *
  127. * This feature was backported to Android Common Kernel 5.15 via:
  128. * https://android-review.googlesource.com/c/kernel/common/+/2115619
  129. */
  130. #if (defined(__ANDROID_COMMON_KERNEL__) && \
  131. (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) && \
  132. (LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)))
  133. #define CFG80211_MULTI_AKM_CONNECT_SUPPORT 1
  134. #endif
  135. /*
  136. * WLAN_MLD_AP_STA_CONNECT_SUPPORT
  137. * Used to indicate Linux Kernel supports ML connection on SAP.
  138. */
  139. #if (defined(__ANDROID_COMMON_KERNEL__) && \
  140. (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) && \
  141. (defined CFG80211_MLD_AP_STA_CONNECT_SUPPORT))
  142. #define WLAN_MLD_AP_STA_CONNECT_SUPPORT 1
  143. #endif
  144. /*
  145. * WLAN_MLD_AP_OWE_INFO_SUPPORT
  146. * Used to indicate Linux Kernel supports ML OWE connection
  147. * on SAP
  148. */
  149. #if (defined(__ANDROID_COMMON_KERNEL__) && \
  150. (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) && \
  151. (defined CFG80211_MLD_AP_OWE_INFO_SUPPORT))
  152. #define WLAN_MLD_AP_OWE_INFO_SUPPORT 1
  153. #endif
  154. /*
  155. * CFG80211_TX_CONTROL_PORT_LINK_SUPPORT
  156. * Used to indicate Linux kernel contains support for TX control port from
  157. * specific link ID
  158. *
  159. * This feature was introduced in Linux Kernel 6.0 via:
  160. * 9b6bf4d6120a wifi: nl80211: set BSS to NULL if IS_ERR()
  161. * 45aaf17c0c34 wifi: nl80211: check MLO support in authenticate
  162. * d2bc52498b6b wifi: nl80211: Support MLD parameters in nl80211_set_station()
  163. * 67207bab9341 wifi: cfg80211/mac80211: Support control port TX from specific link
  164. * 69c3f2d30c35 wifi: nl80211: allow link ID in set_wiphy with frequency
  165. * fa2ca639c4e6 wifi: nl80211: advertise MLO support
  166. * e3d331c9b620 wifi: cfg80211: set country_elem to NULL
  167. * 34d76a14f8f7 wifi: nl80211: reject link specific elements on assoc link
  168. * df35f3164ec1 wifi: nl80211: reject fragmented and non-inheritance elements
  169. * ff5c4dc4cd78 wifi: nl80211: fix some attribute policy entries
  170. * 7464f665158e wifi: cfg80211: add cfg80211_get_iftype_ext_capa()
  171. * 8876c67e6296 wifi: nl80211: require MLD address on link STA add/modify
  172. * 9dd1953846c7 wifi: nl80211/mac80211: clarify link ID in control port TX
  173. * 00b3d8401019 wifi: cfg80211/nl80211: move rx management data into a struct
  174. * 6074c9e57471 wifi: cfg80211: report link ID in NL80211_CMD_FRAME
  175. * 95f498bb49f7 wifi: nl80211: add MLO link ID to the NL80211_CMD_FRAME TX API
  176. * 1e0b3b0b6cb5 wifi: mac80211: Align with Draft P802.11be_D1.5
  177. * 062e8e02dfd4 wifi: mac80211: Align with Draft P802.11be_D2.0
  178. * d776763f4808 wifi: cfg80211: debugfs: fix return type in ht40allow_map_read()
  179. * 64e966d1e84b wifi: cfg80211: fix MCS divisor value
  180. * 4e9c3af39820 wifi: nl80211: add EML/MLD capabilities to per-iftype capabilities
  181. * 80b0ed70a271 wifi: nl80211: add RX and TX timestamp attributes
  182. * ea7d50c925ce wifi: cfg80211: add a function for reporting TX status with hardware timestamps
  183. * 1ff715ffa0ec wifi: cfg80211: add hardware timestamps to frame RX info
  184. *
  185. * This feature was backported to Android Common Kernel 5.15.74 via:
  186. * https://android-review.googlesource.com/c/kernel/common/+/2253173
  187. * https://android-review.googlesource.com/c/kernel/common/+/2253174
  188. * https://android-review.googlesource.com/c/kernel/common/+/2253175
  189. * https://android-review.googlesource.com/c/kernel/common/+/2253176
  190. * https://android-review.googlesource.com/c/kernel/common/+/2253177
  191. * https://android-review.googlesource.com/c/kernel/common/+/2253178
  192. * https://android-review.googlesource.com/c/kernel/common/+/2253179
  193. * https://android-review.googlesource.com/c/kernel/common/+/2253180
  194. * https://android-review.googlesource.com/c/kernel/common/+/2253181
  195. * https://android-review.googlesource.com/c/kernel/common/+/2253182
  196. * https://android-review.googlesource.com/c/kernel/common/+/2253183
  197. * https://android-review.googlesource.com/c/kernel/common/+/2253184
  198. * https://android-review.googlesource.com/c/kernel/common/+/2253185
  199. * https://android-review.googlesource.com/c/kernel/common/+/2253186
  200. * https://android-review.googlesource.com/c/kernel/common/+/2253187
  201. * https://android-review.googlesource.com/c/kernel/common/+/2253188
  202. * https://android-review.googlesource.com/c/kernel/common/+/2253189
  203. * https://android-review.googlesource.com/c/kernel/common/+/2253190
  204. * https://android-review.googlesource.com/c/kernel/common/+/2253191
  205. * https://android-review.googlesource.com/c/kernel/common/+/2253192
  206. * https://android-review.googlesource.com/c/kernel/common/+/2253193
  207. * https://android-review.googlesource.com/c/kernel/common/+/2253194
  208. * https://android-review.googlesource.com/c/kernel/common/+/2267469
  209. * https://android-review.googlesource.com/c/kernel/common/+/2267204
  210. * https://android-review.googlesource.com/c/kernel/common/+/2267210
  211. */
  212. #if (defined(__ANDROID_COMMON_KERNEL__) && \
  213. (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 74)) || \
  214. (defined IEEE80211_EHT_OPER_INFO_PRESENT))
  215. #define CFG80211_TX_CONTROL_PORT_LINK_SUPPORT 1
  216. #endif
  217. /*
  218. * CFG80211_EXTERNAL_AUTH_MLO_SUPPORT
  219. * Used to indicate Linux kernel contains support for ML external auth
  220. *
  221. * TODO: Corresponding Linux kernel changes are still under wirless-next
  222. * will add the commit-ID when available.
  223. */
  224. /*
  225. * TODO: will add this check when available.
  226. * #if (defined(__ANDROID_COMMON_KERNEL__) && \
  227. * (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) && \
  228. * (defined CFG80211_EXTERNAL_AUTH_MLO_SUPPORT))
  229. */
  230. #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) || \
  231. (defined CFG80211_EXTERNAL_AUTH_MLO_SUPPORT))
  232. #define WLAN_EXTERNAL_AUTH_MLO_SUPPORT
  233. #endif
  234. /*
  235. * CFG80211_TID_LINK_MAP_SUPPORT
  236. * Used to indicate Linux kernel contains support to get the TID to link map
  237. * status and response event.
  238. *
  239. * TODO: Corresponding Linux kernel support check changes are still under review
  240. * will add the commit-ID when available
  241. */
  242. #if (defined CFG80211_TID_LINK_MAP_SUPPORT)
  243. #define WLAN_TID_LINK_MAP_SUPPORT
  244. #endif
  245. #endif