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 /** 20 * DOC: wlan_osif_features.h 21 * 22 * Define feature flags to cleanly describe when features 23 * are present in a given version of the kernel 24 */ 25 26 #ifndef _WLAN_OSIF_FEATURES_H_ 27 #define _WLAN_OSIF_FEATURES_H_ 28 29 #include <linux/version.h> 30 31 /* 32 * CFG80211_11BE_BASIC 33 * Used to indicate the Linux Kernel contains support for basic 802.11be 34 * definitions. 35 * 36 * These definitions were introduced in Linux Kernel 5.18 via: 37 * cbc1ca0a9d0a ieee80211: Add EHT (802.11be) definitions 38 * 2a2c86f15e17 ieee80211: add EHT 1K aggregation definitions 39 * 5cd5a8a3e2fb cfg80211: Add data structures to capture EHT capabilities 40 * 3743bec6120a cfg80211: Add support for EHT 320 MHz channel width 41 * cfb14110acf8 nl80211: add EHT MCS support 42 * c2b3d7699fb0 nl80211: add support for 320MHz channel limitation 43 * 31846b657857 cfg80211: add NO-EHT flag to regulatory 44 * ea05fd3581d3 cfg80211: Support configuration of station EHT capabilities 45 * 46 * These definitions were backported to Android Common Kernel 5.15 via: 47 * https://android-review.googlesource.com/c/kernel/common/+/1996261 48 * https://android-review.googlesource.com/c/kernel/common/+/1996262 49 * https://android-review.googlesource.com/c/kernel/common/+/1996263 50 * https://android-review.googlesource.com/c/kernel/common/+/1996264 51 * https://android-review.googlesource.com/c/kernel/common/+/1996265 52 * https://android-review.googlesource.com/c/kernel/common/+/1996266 53 * https://android-review.googlesource.com/c/kernel/common/+/1996267 54 * https://android-review.googlesource.com/c/kernel/common/+/1996268 55 */ 56 57 #if defined(WLAN_11BE_MLO_FEATURE_ENABLE) 58 #if (defined(__ANDROID_COMMON_KERNEL__) && \ 59 (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) && \ 60 (LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0))) || \ 61 (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) 62 #define CFG80211_11BE_BASIC 1 63 #endif 64 #endif 65 /* 66 * CFG80211_SA_QUERY_OFFLOAD_SUPPORT 67 * Used to indicate the Linux Kernel contains support to offload SA Query 68 * procedures for AP SME device 69 * 70 * This feature was introduced in Linux Kernel 5.17 via: 71 * 47301a74bbfa ("nl80211: Add support to set AP settings flags with single attribute") 72 * 87c1aec15dee ("nl80211: Add support to offload SA Query procedures for AP SME device") 73 * 74 * This feature was backported to Android Common Kernel 5.15 via: 75 * https://android-review.googlesource.com/c/kernel/common/+/1958439 76 * https://android-review.googlesource.com/c/kernel/common/+/1958440 77 */ 78 79 #if (defined(__ANDROID_COMMON_KERNEL__) && \ 80 (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) && \ 81 (LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0))) || \ 82 (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)) 83 #define CFG80211_SA_QUERY_OFFLOAD_SUPPORT 1 84 #endif 85 86 /* 87 * CFG80211_SINGLE_NETDEV_MULTI_LINK_SUPPORT 88 * Used to indicate the Linux Kernel contains support for single netdevice multi 89 * link support. 90 * 91 * This feature was merged into wireless-next via below commits: 92 * 7b0a0e3c3 wifi: cfg80211: do some rework towards MLO link APIs 93 * 0f7594489 wifi: cfg80211: mlme: get BSS entry outside cfg80211_mlme_assoc() 94 * 9ecff10e8 wifi: nl80211: refactor BSS lookup in nl80211_associate() 95 * 0f48b8b88 wifi: ieee80211: add definitions for multi-link element 96 * 325839da9 wifi: cfg80211: simplify cfg80211_mlme_auth() prototype 97 * d648c2302 wifi: nl80211: support MLO in auth/assoc 98 * 99 * This feature was backported to Android Common Kernel 5.15 via: 100 * https://android-review.googlesource.com/c/kernel/common/+/2123895 101 * https://android-review.googlesource.com/c/kernel/common/+/2115618 102 * https://android-review.googlesource.com/c/kernel/common/+/2115620 103 * https://android-review.googlesource.com/c/kernel/common/+/2121347 104 * https://android-review.googlesource.com/c/kernel/common/+/2121348 105 * https://android-review.googlesource.com/c/kernel/common/+/2121349 106 * https://android-review.googlesource.com/c/kernel/common/+/2121350 107 * https://android-review.googlesource.com/c/kernel/common/+/2121351 108 * https://android-review.googlesource.com/c/kernel/common/+/2123452 109 * https://android-review.googlesource.com/c/kernel/common/+/2123454 110 * https://android-review.googlesource.com/c/kernel/common/+/2115621 111 * 112 */ 113 #if (defined(__ANDROID_COMMON_KERNEL__) && \ 114 (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) && \ 115 (defined IEEE80211_MLD_MAX_NUM_LINKS)) 116 #define CFG80211_SINGLE_NETDEV_MULTI_LINK_SUPPORT 1 117 #endif 118 #endif 119