From deb25905e468443884f7f2a251d9f678f8f315bf Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 31 2019 09:14:52 +0000 Subject: import kmod-redhat-iwlwifi-4.18.0_107_dup8.0-5.el8_0 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..747b29b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/iwlwifi-redhat-4.18.0_107_dup8.0.tar.bz2 diff --git a/.kmod-redhat-iwlwifi.metadata b/.kmod-redhat-iwlwifi.metadata new file mode 100644 index 0000000..1a404a5 --- /dev/null +++ b/.kmod-redhat-iwlwifi.metadata @@ -0,0 +1 @@ +65cd7444152865e1540c1d13d91b408bc02e7270 SOURCES/iwlwifi-redhat-4.18.0_107_dup8.0.tar.bz2 diff --git a/SOURCES/0000-add-back-rate_name-items-rs_sta_dbgfs_drv_tx_stats_read.patch b/SOURCES/0000-add-back-rate_name-items-rs_sta_dbgfs_drv_tx_stats_read.patch new file mode 100644 index 0000000..7877a61 --- /dev/null +++ b/SOURCES/0000-add-back-rate_name-items-rs_sta_dbgfs_drv_tx_stats_read.patch @@ -0,0 +1,13 @@ +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rs.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rs.c 2019-09-06 15:44:18.960188182 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rs.c 2019-09-06 15:49:50.211936156 +0200 +@@ -3888,6 +3888,8 @@ + [IWL_RATE_MCS_7_INDEX] = "MCS7", + [IWL_RATE_MCS_8_INDEX] = "MCS8", + [IWL_RATE_MCS_9_INDEX] = "MCS9", ++ [IWL_RATE_MCS_10_INDEX] = "MCS10", ++ [IWL_RATE_MCS_11_INDEX] = "MCS11", + }; + + char *buff, *pos, *endpos; diff --git a/SOURCES/0000-add-iwlwifi_backport_compat-h.patch b/SOURCES/0000-add-iwlwifi_backport_compat-h.patch new file mode 100644 index 0000000..84ed584 --- /dev/null +++ b/SOURCES/0000-add-iwlwifi_backport_compat-h.patch @@ -0,0 +1,11 @@ +Index: src/drivers/net/wireless/intel/iwlwifi/iwl-backport-compat.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ src/drivers/net/wireless/intel/iwlwifi/iwl-backport-compat.h 2019-06-27 19:04:27.668762767 +0200 +@@ -0,0 +1,6 @@ ++#ifndef IWL_BACKPORT_COMPAT_H ++#define IWL_BACKPORT_COMPAT_H ++ ++ ++ ++#endif /* IWL_BACKPORT_COMPAT_H */ diff --git a/SOURCES/0000-bump-module-version.patch b/SOURCES/0000-bump-module-version.patch new file mode 100644 index 0000000..77ba0eb --- /dev/null +++ b/SOURCES/0000-bump-module-version.patch @@ -0,0 +1,36 @@ +Index: src/drivers/net/wireless/intel/iwlwifi/iwl-drv.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/iwl-drv.c 2019-09-06 19:04:21.667401871 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/iwl-drv.c 2019-09-06 19:24:21.498781984 +0200 +@@ -89,6 +89,7 @@ + MODULE_DESCRIPTION(DRV_DESCRIPTION); + MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR); + MODULE_LICENSE("GPL"); ++MODULE_VERSION("4.18.0-107_dup8.0"); + + #ifdef CONFIG_IWLWIFI_DEBUGFS + static struct dentry *iwl_dbgfs_root; +Index: src/drivers/net/wireless/intel/iwlwifi/dvm/main.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/dvm/main.c 2019-06-27 14:54:04.115678555 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/dvm/main.c 2019-09-06 19:25:01.896353376 +0200 +@@ -55,6 +55,7 @@ + MODULE_DESCRIPTION(DRV_DESCRIPTION); + MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR); + MODULE_LICENSE("GPL"); ++MODULE_VERSION("4.18.0-107_dup8.0"); + + /* Please keep this array *SORTED* by hex value. + * Access is done through binary search. +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-09-06 19:04:21.306410478 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-09-06 19:25:25.922098470 +0200 +@@ -88,6 +88,7 @@ + MODULE_DESCRIPTION(DRV_DESCRIPTION); + MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR); + MODULE_LICENSE("GPL"); ++MODULE_VERSION("4.18.0-107_dup8.0"); + + static const struct iwl_op_mode_ops iwl_mvm_ops; + static const struct iwl_op_mode_ops iwl_mvm_ops_mq; diff --git a/SOURCES/0000-define-IEEE80211_MAX_AMPDU_BUF_HT.patch b/SOURCES/0000-define-IEEE80211_MAX_AMPDU_BUF_HT.patch new file mode 100644 index 0000000..bb1632d --- /dev/null +++ b/SOURCES/0000-define-IEEE80211_MAX_AMPDU_BUF_HT.patch @@ -0,0 +1,25 @@ +Index: src/drivers/net/wireless/intel/iwlwifi/iwl-backport-compat.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/iwl-backport-compat.h 2019-09-06 15:58:07.846046124 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/iwl-backport-compat.h 2019-09-06 15:58:12.144977964 +0200 +@@ -1,6 +1,6 @@ + #ifndef IWL_BACKPORT_COMPAT_H + #define IWL_BACKPORT_COMPAT_H + +- ++#define IEEE80211_MAX_AMPDU_BUF_HT 0x40 + + #endif /* IWL_BACKPORT_COMPAT_H */ +Index: src/drivers/net/wireless/intel/iwlwifi/cfg/22000.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/cfg/22000.c 2019-09-06 15:58:11.358990426 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/cfg/22000.c 2019-09-06 15:58:40.846522899 +0200 +@@ -55,6 +55,8 @@ + #include + #include "iwl-config.h" + ++#include "iwl-backport-compat.h" ++ + /* Highest firmware API version supported */ + #define IWL_22000_UCODE_API_MAX 48 + diff --git a/SOURCES/0000-fixup-firmware-modinfo.patch b/SOURCES/0000-fixup-firmware-modinfo.patch new file mode 100644 index 0000000..562a78c --- /dev/null +++ b/SOURCES/0000-fixup-firmware-modinfo.patch @@ -0,0 +1,193 @@ +Index: src/drivers/net/wireless/intel/iwlwifi/cfg/22000.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/cfg/22000.c 2019-09-11 11:44:00.988069947 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/cfg/22000.c 2019-09-18 19:31:28.670553012 +0200 +@@ -123,6 +123,37 @@ + #define IWL_22000_TY_A_GF_A_MODULE_FIRMWARE(api) \ + IWL_22000_TY_A_GF_A_FW_PRE __stringify(api) ".ucode" + ++#define IWL_22000_HR_MODULE_FIRMWARE_DUP(api) \ ++ "iwlwifi_dup8.0/" IWL_22000_HR_FW_PRE __stringify(api) ".ucode" ++#define IWL_22000_JF_MODULE_FIRMWARE_DUP(api) \ ++ "iwlwifi_dup8.0/" IWL_22000_JF_FW_PRE __stringify(api) ".ucode" ++#define IWL_22000_HR_A_F0_QNJ_MODULE_FIRMWARE_DUP(api) \ ++ "iwlwifi_dup8.0/" IWL_22000_HR_A_F0_FW_PRE __stringify(api) ".ucode" ++#define IWL_22000_HR_B_F0_QNJ_MODULE_FIRMWARE_DUP(api) \ ++ "iwlwifi_dup8.0/" IWL_22000_HR_B_F0_FW_PRE __stringify(api) ".ucode" ++#define IWL_22000_QU_B_HR_B_MODULE_FIRMWARE_DUP(api) \ ++ "iwlwifi_dup8.0/" IWL_22000_QU_B_HR_B_FW_PRE __stringify(api) ".ucode" ++#define IWL_22000_HR_B_QNJ_MODULE_FIRMWARE_DUP(api) \ ++ "iwlwifi_dup8.0/" IWL_22000_HR_B_FW_PRE __stringify(api) ".ucode" ++#define IWL_22000_HR_A0_QNJ_MODULE_FIRMWARE_DUP(api) \ ++ "iwlwifi_dup8.0/" IWL_22000_HR_A0_FW_PRE __stringify(api) ".ucode" ++#define IWL_QUZ_A_HR_B_MODULE_FIRMWARE_DUP(api) \ ++ "iwlwifi_dup8.0/" IWL_QUZ_A_HR_B_FW_PRE __stringify(api) ".ucode" ++#define IWL_QU_B_JF_B_MODULE_FIRMWARE_DUP(api) \ ++ "iwlwifi_dup8.0/" IWL_QU_B_JF_B_FW_PRE __stringify(api) ".ucode" ++#define IWL_QNJ_B_JF_B_MODULE_FIRMWARE_DUP(api) \ ++ "iwlwifi_dup8.0/" IWL_QNJ_B_JF_B_FW_PRE __stringify(api) ".ucode" ++#define IWL_CC_A_MODULE_FIRMWARE_DUP(api) \ ++ "iwlwifi_dup8.0/" IWL_CC_A_FW_PRE __stringify(api) ".ucode" ++#define IWL_22000_SO_A_JF_B_MODULE_FIRMWARE_DUP(api) \ ++ "iwlwifi_dup8.0/" IWL_22000_SO_A_JF_B_FW_PRE __stringify(api) ".ucode" ++#define IWL_22000_SO_A_HR_B_MODULE_FIRMWARE_DUP(api) \ ++ "iwlwifi_dup8.0/" IWL_22000_SO_A_HR_B_FW_PRE __stringify(api) ".ucode" ++#define IWL_22000_SO_A_GF_A_MODULE_FIRMWARE_DUP(api) \ ++ "iwlwifi_dup8.0/" IWL_22000_SO_A_GF_A_FW_PRE __stringify(api) ".ucode" ++#define IWL_22000_TY_A_GF_A_MODULE_FIRMWARE_DUP(api) \ ++ "iwlwifi_dup8.0/" IWL_22000_TY_A_GF_A_FW_PRE __stringify(api) ".ucode" ++ + static const struct iwl_base_params iwl_22000_base_params = { + .eeprom_size = OTP_LOW_IMAGE_SIZE_32K, + .num_of_queues = 512, +@@ -463,3 +494,21 @@ + MODULE_FIRMWARE(IWL_22000_SO_A_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); + MODULE_FIRMWARE(IWL_22000_SO_A_GF_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); + MODULE_FIRMWARE(IWL_22000_TY_A_GF_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); ++ ++MODULE_FIRMWARE(IWL_22000_HR_MODULE_FIRMWARE_DUP(IWL_22000_UCODE_API_MAX)); ++MODULE_FIRMWARE(IWL_22000_JF_MODULE_FIRMWARE_DUP(IWL_22000_UCODE_API_MAX)); ++MODULE_FIRMWARE(IWL_22000_HR_A_F0_QNJ_MODULE_FIRMWARE_DUP(IWL_22000_UCODE_API_MAX)); ++MODULE_FIRMWARE(IWL_22000_HR_B_F0_QNJ_MODULE_FIRMWARE_DUP(IWL_22000_UCODE_API_MAX)); ++MODULE_FIRMWARE(IWL_22000_HR_B_QNJ_MODULE_FIRMWARE_DUP(IWL_22000_UCODE_API_MAX)); ++MODULE_FIRMWARE(IWL_22000_HR_A0_QNJ_MODULE_FIRMWARE_DUP(IWL_22000_UCODE_API_MAX)); ++MODULE_FIRMWARE(IWL_QU_B_JF_B_MODULE_FIRMWARE_DUP(IWL_22000_UCODE_API_MAX)); ++MODULE_FIRMWARE(IWL_QUZ_A_HR_B_MODULE_FIRMWARE_DUP(IWL_22000_UCODE_API_MAX)); ++MODULE_FIRMWARE(IWL_QNJ_B_JF_B_MODULE_FIRMWARE_DUP(IWL_22000_UCODE_API_MAX)); ++MODULE_FIRMWARE(IWL_CC_A_MODULE_FIRMWARE_DUP(IWL_22000_UCODE_API_MAX)); ++MODULE_FIRMWARE(IWL_22000_SO_A_JF_B_MODULE_FIRMWARE_DUP(IWL_22000_UCODE_API_MAX)); ++MODULE_FIRMWARE(IWL_22000_SO_A_HR_B_MODULE_FIRMWARE_DUP(IWL_22000_UCODE_API_MAX)); ++MODULE_FIRMWARE(IWL_22000_SO_A_GF_A_MODULE_FIRMWARE_DUP(IWL_22000_UCODE_API_MAX)); ++MODULE_FIRMWARE(IWL_22000_TY_A_GF_A_MODULE_FIRMWARE_DUP(IWL_22000_UCODE_API_MAX)); ++ ++/* This is the API version shipped in the DUP firmware package */ ++MODULE_FIRMWARE(IWL_CC_A_MODULE_FIRMWARE_DUP(46)); +Index: src/drivers/net/wireless/intel/iwlwifi/cfg/7000.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/cfg/7000.c 2019-09-11 11:42:01.185512147 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/cfg/7000.c 2019-09-18 19:41:05.379265522 +0200 +@@ -94,18 +94,23 @@ + + #define IWL7260_FW_PRE "iwlwifi-7260-" + #define IWL7260_MODULE_FIRMWARE(api) IWL7260_FW_PRE __stringify(api) ".ucode" ++#define IWL7260_MODULE_FIRMWARE_DUP(api) "iwlwifi_dup8.0/" IWL7260_FW_PRE __stringify(api) ".ucode" + + #define IWL3160_FW_PRE "iwlwifi-3160-" + #define IWL3160_MODULE_FIRMWARE(api) IWL3160_FW_PRE __stringify(api) ".ucode" ++#define IWL3160_MODULE_FIRMWARE_DUP(api) "iwlwifi_dup8.0/" IWL3160_FW_PRE __stringify(api) ".ucode" + + #define IWL3168_FW_PRE "iwlwifi-3168-" + #define IWL3168_MODULE_FIRMWARE(api) IWL3168_FW_PRE __stringify(api) ".ucode" ++#define IWL3168_MODULE_FIRMWARE_DUP(api) "iwlwifi_dup8.0/" IWL3168_FW_PRE __stringify(api) ".ucode" + + #define IWL7265_FW_PRE "iwlwifi-7265-" + #define IWL7265_MODULE_FIRMWARE(api) IWL7265_FW_PRE __stringify(api) ".ucode" ++#define IWL7265_MODULE_FIRMWARE_DUP(api) "iwlwifi_dup8.0/" IWL7265_FW_PRE __stringify(api) ".ucode" + + #define IWL7265D_FW_PRE "iwlwifi-7265D-" + #define IWL7265D_MODULE_FIRMWARE(api) IWL7265D_FW_PRE __stringify(api) ".ucode" ++#define IWL7265D_MODULE_FIRMWARE_DUP(api) "iwlwifi_dup8.0/" IWL7265D_FW_PRE __stringify(api) ".ucode" + + static const struct iwl_base_params iwl7000_base_params = { + .eeprom_size = OTP_LOW_IMAGE_SIZE_16K, +@@ -356,3 +361,22 @@ + MODULE_FIRMWARE(IWL3168_MODULE_FIRMWARE(IWL3168_UCODE_API_MAX)); + MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7265_UCODE_API_MAX)); + MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7265D_UCODE_API_MAX)); ++ ++MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE_DUP(IWL7260_UCODE_API_MAX)); ++MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE_DUP(IWL7260_UCODE_API_MAX)); ++MODULE_FIRMWARE(IWL3168_MODULE_FIRMWARE_DUP(IWL3168_UCODE_API_MAX)); ++MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE_DUP(IWL7265_UCODE_API_MAX)); ++MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE_DUP(IWL7265D_UCODE_API_MAX)); ++ ++/* Those are API versions shipped in the DUP firmware package */ ++MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE_DUP(16)); ++ ++MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE_DUP(16)); ++ ++MODULE_FIRMWARE(IWL3168_MODULE_FIRMWARE_DUP(22)); ++MODULE_FIRMWARE(IWL3168_MODULE_FIRMWARE_DUP(27)); ++ ++MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE_DUP(16)); ++ ++MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE_DUP(22)); ++MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE_DUP(27)); +Index: src/drivers/net/wireless/intel/iwlwifi/cfg/9000.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/cfg/9000.c 2019-09-11 11:42:01.185512147 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/cfg/9000.c 2019-09-18 19:42:56.264864334 +0200 +@@ -80,6 +80,11 @@ + #define IWL9260_MODULE_FIRMWARE(api) \ + IWL9260_FW_PRE __stringify(api) ".ucode" + ++#define IWL9000_MODULE_FIRMWARE_DUP(api) \ ++ "iwlwifi_dup8.0/" IWL9000_FW_PRE __stringify(api) ".ucode" ++#define IWL9260_MODULE_FIRMWARE_DUP(api) \ ++ "iwlwifi_dup8.0/" IWL9260_FW_PRE __stringify(api) ".ucode" ++ + static const struct iwl_base_params iwl9000_base_params = { + .eeprom_size = OTP_LOW_IMAGE_SIZE_32K, + .num_of_queues = 31, +@@ -324,3 +329,22 @@ + + MODULE_FIRMWARE(IWL9000_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX)); + MODULE_FIRMWARE(IWL9260_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX)); ++ ++MODULE_FIRMWARE(IWL9000_MODULE_FIRMWARE_DUP(IWL9000_UCODE_API_MAX)); ++MODULE_FIRMWARE(IWL9260_MODULE_FIRMWARE_DUP(IWL9000_UCODE_API_MAX)); ++ ++/* Those are the API versions shipped in the DUP firmware package */ ++MODULE_FIRMWARE(IWL9000_MODULE_FIRMWARE_DUP(33)); ++MODULE_FIRMWARE(IWL9260_MODULE_FIRMWARE_DUP(33)); ++ ++MODULE_FIRMWARE(IWL9000_MODULE_FIRMWARE_DUP(34)); ++MODULE_FIRMWARE(IWL9260_MODULE_FIRMWARE_DUP(34)); ++ ++MODULE_FIRMWARE(IWL9000_MODULE_FIRMWARE_DUP(38)); ++MODULE_FIRMWARE(IWL9260_MODULE_FIRMWARE_DUP(38)); ++ ++MODULE_FIRMWARE(IWL9000_MODULE_FIRMWARE_DUP(41)); ++MODULE_FIRMWARE(IWL9260_MODULE_FIRMWARE_DUP(41)); ++ ++MODULE_FIRMWARE(IWL9000_MODULE_FIRMWARE_DUP(43)); ++MODULE_FIRMWARE(IWL9260_MODULE_FIRMWARE_DUP(43)); +Index: src/drivers/net/wireless/intel/iwlwifi/cfg/8000.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/cfg/8000.c 2019-09-11 11:42:01.185512147 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/cfg/8000.c 2019-09-18 19:37:07.172275588 +0200 +@@ -87,10 +87,14 @@ + #define IWL8000_FW_PRE "iwlwifi-8000C-" + #define IWL8000_MODULE_FIRMWARE(api) \ + IWL8000_FW_PRE __stringify(api) ".ucode" ++#define IWL8000_MODULE_FIRMWARE_DUP(api) \ ++ "iwlwifi_dup8.0/" IWL8000_FW_PRE __stringify(api) ".ucode" + + #define IWL8265_FW_PRE "iwlwifi-8265-" + #define IWL8265_MODULE_FIRMWARE(api) \ + IWL8265_FW_PRE __stringify(api) ".ucode" ++#define IWL8265_MODULE_FIRMWARE_DUP(api) \ ++ "iwlwifi_dup8.0/" IWL8265_FW_PRE __stringify(api) ".ucode" + + #define DEFAULT_NVM_FILE_FAMILY_8000C "nvmData-8000C" + +@@ -217,3 +221,19 @@ + + MODULE_FIRMWARE(IWL8000_MODULE_FIRMWARE(IWL8000_UCODE_API_MAX)); + MODULE_FIRMWARE(IWL8265_MODULE_FIRMWARE(IWL8265_UCODE_API_MAX)); ++ ++MODULE_FIRMWARE(IWL8000_MODULE_FIRMWARE_DUP(IWL8000_UCODE_API_MAX)); ++MODULE_FIRMWARE(IWL8265_MODULE_FIRMWARE_DUP(IWL8265_UCODE_API_MAX)); ++ ++/* Those are API versions shipped with the DUP firmware package */ ++MODULE_FIRMWARE(IWL8000_MODULE_FIRMWARE_DUP(22)); ++MODULE_FIRMWARE(IWL8265_MODULE_FIRMWARE_DUP(22)); ++ ++MODULE_FIRMWARE(IWL8000_MODULE_FIRMWARE_DUP(27)); ++MODULE_FIRMWARE(IWL8265_MODULE_FIRMWARE_DUP(27)); ++ ++MODULE_FIRMWARE(IWL8000_MODULE_FIRMWARE_DUP(31)); ++MODULE_FIRMWARE(IWL8265_MODULE_FIRMWARE_DUP(31)); ++ ++MODULE_FIRMWARE(IWL8000_MODULE_FIRMWARE_DUP(34)); ++MODULE_FIRMWARE(IWL8265_MODULE_FIRMWARE_DUP(34)); diff --git a/SOURCES/0000-no-cap_he-check-iwl_mvm_max_amsdu_size.patch b/SOURCES/0000-no-cap_he-check-iwl_mvm_max_amsdu_size.patch new file mode 100644 index 0000000..3ce90df --- /dev/null +++ b/SOURCES/0000-no-cap_he-check-iwl_mvm_max_amsdu_size.patch @@ -0,0 +1,15 @@ +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/tx.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/tx.c 2019-09-08 16:01:05.053436496 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/tx.c 2019-09-08 16:01:05.781427123 +0200 +@@ -870,10 +870,6 @@ + band == NL80211_BAND_5GHZ) + lmac = IWL_LMAC_5G_INDEX; + +- /* For HE redirect to trigger based fifos */ +- if (sta->he_cap.has_he && !WARN_ON(!iwl_mvm_has_new_tx_api(mvm))) +- ac += 4; +- + txf = iwl_mvm_mac_ac_to_tx_fifo(mvm, ac); + + /* diff --git a/SOURCES/0000-use-DUP-firmware-files.patch b/SOURCES/0000-use-DUP-firmware-files.patch new file mode 100644 index 0000000..0be3944 --- /dev/null +++ b/SOURCES/0000-use-DUP-firmware-files.patch @@ -0,0 +1,39 @@ +Index: src/drivers/net/wireless/intel/iwlwifi/iwl-drv.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/iwl-drv.c 2019-09-08 16:01:11.062359133 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/iwl-drv.c 2019-09-08 16:01:21.332226910 +0200 +@@ -115,6 +115,7 @@ + struct device *dev; + + int fw_index; /* firmware we're trying to load */ ++ bool fw_dup; /* tru to load firmware from DUP */ + char firmware_name[64]; /* name of firmware file to load */ + + struct completion request_firmware_complete; +@@ -227,9 +228,15 @@ + + if (first) { + drv->fw_index = cfg->ucode_api_max; ++ drv->fw_dup = true; + sprintf(tag, "%d", drv->fw_index); + } else { +- drv->fw_index--; ++ if (drv->fw_dup) { ++ drv->fw_dup = false; ++ } else { ++ drv->fw_dup = true; ++ drv->fw_index--; ++ } + sprintf(tag, "%d", drv->fw_index); + } + +@@ -251,7 +258,8 @@ + return -ENOENT; + } + +- snprintf(drv->firmware_name, sizeof(drv->firmware_name), "%s%s.ucode", ++ snprintf(drv->firmware_name, sizeof(drv->firmware_name), "%s%s%s.ucode", ++ drv->fw_dup ? "iwlwifi_dup8.0/" : "", + cfg->fw_name_pre, tag); + + IWL_DEBUG_FW_INFO(drv, "attempting to load firmware '%s'\n", diff --git a/SOURCES/0001-Revert-netlink-make-validation-more-configurable-for.patch b/SOURCES/0001-Revert-netlink-make-validation-more-configurable-for.patch new file mode 100644 index 0000000..79e3c65 --- /dev/null +++ b/SOURCES/0001-Revert-netlink-make-validation-more-configurable-for.patch @@ -0,0 +1,28 @@ +From 7ebbaa13b06672b7a2b20292d11bb57218f3c9d1 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 11 Jul 2019 18:31:34 +0200 +Subject: [PATCH] Revert "netlink: make validation more configurable for future + strictness" + +--- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +index 44e87a41d244..6e00161fdb92 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +@@ -4470,8 +4470,8 @@ static int __iwl_mvm_mac_testmode_cmd(struct iwl_mvm *mvm, + int err; + u32 noa_duration; + +- err = nla_parse_deprecated(tb, IWL_MVM_TM_ATTR_MAX, data, len, +- iwl_mvm_tm_policy, NULL); ++ err = nla_parse(tb, IWL_MVM_TM_ATTR_MAX, data, len, iwl_mvm_tm_policy, ++ NULL); + if (err) + return err; + +-- +2.13.6 + diff --git a/SOURCES/0002-Revert-iwlwifi-mvm-fix-merge-damage-in-iwl_mvm_vif_d.patch b/SOURCES/0002-Revert-iwlwifi-mvm-fix-merge-damage-in-iwl_mvm_vif_d.patch new file mode 100644 index 0000000..ed5512d --- /dev/null +++ b/SOURCES/0002-Revert-iwlwifi-mvm-fix-merge-damage-in-iwl_mvm_vif_d.patch @@ -0,0 +1,31 @@ +From 1151781dfad20d53bf37122d1043657ce6235a59 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 11 Jul 2019 18:29:15 +0200 +Subject: [PATCH] Revert "iwlwifi: mvm: fix merge damage in + iwl_mvm_vif_dbgfs_register()" + +This reverts commit d156e67d3f58c5d3c7ebe1bec80657db534f32d4. +--- + drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c +index f043eefabb4e..83118cb94882 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c +@@ -779,6 +779,12 @@ void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif) + return; + } + ++ if (!mvmvif->dbgfs_dir) { ++ IWL_ERR(mvm, "Failed to create debugfs directory under %pd\n", ++ dbgfs_dir); ++ return; ++ } ++ + if (iwlmvm_mod_params.power_scheme != IWL_POWER_SCHEME_CAM && + ((vif->type == NL80211_IFTYPE_STATION && !vif->p2p) || + (vif->type == NL80211_IFTYPE_STATION && vif->p2p))) +-- +2.13.6 + diff --git a/SOURCES/0003-Revert-iwlwifi-mvm-fix-pointer-reference-when-settin.patch b/SOURCES/0003-Revert-iwlwifi-mvm-fix-pointer-reference-when-settin.patch new file mode 100644 index 0000000..ef4d2a6 --- /dev/null +++ b/SOURCES/0003-Revert-iwlwifi-mvm-fix-pointer-reference-when-settin.patch @@ -0,0 +1,41 @@ +From 83afe9f6493cf209160320e80b451a49c935a536 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 11 Jul 2019 18:33:58 +0200 +Subject: [PATCH] Revert "iwlwifi: mvm: fix pointer reference when setting HE + QAM thres" + +This reverts commit 0bfefe2f41dd5bd60c7b695e450fc3a931875980. +--- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +index 6e00161fdb92..6bbd30c2ee61 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +@@ -2348,18 +2348,16 @@ static void iwl_mvm_cfg_he_sta(struct iwl_mvm *mvm, + + /* Set the PPE thresholds accordingly */ + if (low_th >= 0 && high_th >= 0) { +- struct iwl_he_pkt_ext *pkt_ext = +- (struct iwl_he_pkt_ext *)&sta_ctxt_cmd.pkt_ext; ++ u8 ***pkt_ext_qam = ++ (void *)sta_ctxt_cmd.pkt_ext.pkt_ext_qam_th; + + for (i = 0; i < MAX_HE_SUPP_NSS; i++) { + u8 bw; + + for (bw = 0; bw < MAX_HE_CHANNEL_BW_INDX; + bw++) { +- pkt_ext->pkt_ext_qam_th[i][bw][0] = +- low_th; +- pkt_ext->pkt_ext_qam_th[i][bw][1] = +- high_th; ++ pkt_ext_qam[i][bw][0] = low_th; ++ pkt_ext_qam[i][bw][1] = high_th; + } + } + +-- +2.13.6 + diff --git a/SOURCES/0004-Revert-iwlwifi-remove-unnecessary-goto-out-in-iwl_pa.patch b/SOURCES/0004-Revert-iwlwifi-remove-unnecessary-goto-out-in-iwl_pa.patch new file mode 100644 index 0000000..56b4eb7 --- /dev/null +++ b/SOURCES/0004-Revert-iwlwifi-remove-unnecessary-goto-out-in-iwl_pa.patch @@ -0,0 +1,30 @@ +From 910c002de243c4fa4c053e61dbccd7cf2352fe74 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 11 Jul 2019 18:34:36 +0200 +Subject: [PATCH] Revert "iwlwifi: remove unnecessary goto out in + iwl_parse_nvm_mcc_info()" + +This reverts commit a2a120a9cdf13fa96b68f9d16f50d05e5a2c510e. +--- + drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +index d87a6bb3e456..2a879e0b331f 100644 +--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c ++++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +@@ -1188,8 +1188,10 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, + */ + copy_rd = kmemdup(regd, struct_size(regd, reg_rules, valid_rules), + GFP_KERNEL); +- if (!copy_rd) ++ if (!copy_rd) { + copy_rd = ERR_PTR(-ENOMEM); ++ goto out; ++ } + + out: + kfree(regdb_ptrs); +-- +2.13.6 + diff --git a/SOURCES/0005-Revert-iwlwifi-Use-struct_size-in-kzalloc.patch b/SOURCES/0005-Revert-iwlwifi-Use-struct_size-in-kzalloc.patch new file mode 100644 index 0000000..f411fcd --- /dev/null +++ b/SOURCES/0005-Revert-iwlwifi-Use-struct_size-in-kzalloc.patch @@ -0,0 +1,51 @@ +From ba8ead2d7e896f57ea37bad77dd653cc0c7c81f1 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 11 Jul 2019 18:34:59 +0200 +Subject: [PATCH] Revert "iwlwifi: Use struct_size() in kzalloc" + +This reverts commit 78d722b1bdd96b31bbe886a2cb2e69ce7b350347. +--- + drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +index 2a879e0b331f..f3ada226c008 100644 +--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c ++++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +@@ -1081,6 +1081,7 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, + u32 reg_rule_flags, prev_reg_rule_flags = 0; + const u16 *nvm_chan; + struct ieee80211_regdomain *regd, *copy_rd; ++ int size_of_regd, regd_to_copy; + struct ieee80211_reg_rule *rule; + struct regdb_ptrs *regdb_ptrs; + enum nl80211_band band; +@@ -1110,7 +1111,11 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, + num_of_ch); + + /* build a regdomain rule for every valid channel */ +- regd = kzalloc(struct_size(regd, reg_rules, num_of_ch), GFP_KERNEL); ++ size_of_regd = ++ sizeof(struct ieee80211_regdomain) + ++ num_of_ch * sizeof(struct ieee80211_reg_rule); ++ ++ regd = kzalloc(size_of_regd, GFP_KERNEL); + if (!regd) + return ERR_PTR(-ENOMEM); + +@@ -1186,8 +1191,10 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, + * Narrow down regdom for unused regulatory rules to prevent hole + * between reg rules to wmm rules. + */ +- copy_rd = kmemdup(regd, struct_size(regd, reg_rules, valid_rules), +- GFP_KERNEL); ++ regd_to_copy = sizeof(struct ieee80211_regdomain) + ++ valid_rules * sizeof(struct ieee80211_reg_rule); ++ ++ copy_rd = kmemdup(regd, regd_to_copy, GFP_KERNEL); + if (!copy_rd) { + copy_rd = ERR_PTR(-ENOMEM); + goto out; +-- +2.13.6 + diff --git a/SOURCES/0006-Revert-mac80211-update-HE-IEs-to-D3.3.patch b/SOURCES/0006-Revert-mac80211-update-HE-IEs-to-D3.3.patch new file mode 100644 index 0000000..380f68c --- /dev/null +++ b/SOURCES/0006-Revert-mac80211-update-HE-IEs-to-D3.3.patch @@ -0,0 +1,206 @@ +From 0f89f208e7a2437b5d7ff440db091c94d2ce3ac2 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 11 Jul 2019 18:39:53 +0200 +Subject: [PATCH] Revert "mac80211: update HE IEs to D3.3" + +This reverts commit 77ff2c6b49843b01adef1f80abb091753e4c9c65. +--- + drivers/net/wireless/intel/iwlwifi/fw/api/mac.h | 26 +--------- + drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 58 ++++++++++++++-------- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 42 ---------------- + include/linux/ieee80211.h | 22 +++----- + 4 files changed, 46 insertions(+), 102 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/fw/api/mac.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/api/mac.h 2019-06-27 14:54:04.121678482 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/api/mac.h 2019-07-11 18:41:11.521146562 +0200 +@@ -7,7 +7,7 @@ + * + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2017 Intel Deutschland GmbH +- * Copyright(c) 2018 - 2019 Intel Corporation ++ * Copyright(c) 2018 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as +@@ -29,7 +29,7 @@ + * + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2017 Intel Deutschland GmbH +- * Copyright(c) 2018 - 2019 Intel Corporation ++ * Copyright(c) 2018 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -433,28 +433,6 @@ + __le16 mu_time; + } __packed; /* AC_QOS_DOT11AX_API_S */ + +-/** +- * enum iwl_he_pkt_ext_constellations - PPE constellation indices +- * @IWL_HE_PKT_EXT_BPSK: BPSK +- * @IWL_HE_PKT_EXT_QPSK: QPSK +- * @IWL_HE_PKT_EXT_16QAM: 16-QAM +- * @IWL_HE_PKT_EXT_64QAM: 64-QAM +- * @IWL_HE_PKT_EXT_256QAM: 256-QAM +- * @IWL_HE_PKT_EXT_1024QAM: 1024-QAM +- * @IWL_HE_PKT_EXT_RESERVED: reserved value +- * @IWL_HE_PKT_EXT_NONE: not defined +- */ +-enum iwl_he_pkt_ext_constellations { +- IWL_HE_PKT_EXT_BPSK = 0, +- IWL_HE_PKT_EXT_QPSK, +- IWL_HE_PKT_EXT_16QAM, +- IWL_HE_PKT_EXT_64QAM, +- IWL_HE_PKT_EXT_256QAM, +- IWL_HE_PKT_EXT_1024QAM, +- IWL_HE_PKT_EXT_RESERVED, +- IWL_HE_PKT_EXT_NONE, +-}; +- + #define MAX_HE_SUPP_NSS 2 + #define MAX_HE_CHANNEL_BW_INDX 4 + +Index: src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-07-11 18:41:04.030243005 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-07-11 18:41:11.522146549 +0200 +@@ -497,6 +497,7 @@ + IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8, + .mac_cap_info[2] = + IEEE80211_HE_MAC_CAP2_32BIT_BA_BITMAP | ++ IEEE80211_HE_MAC_CAP2_MU_CASCADING | + IEEE80211_HE_MAC_CAP2_ACK_EN, + .mac_cap_info[3] = + IEEE80211_HE_MAC_CAP3_OMI_CONTROL | +@@ -507,9 +508,7 @@ + .mac_cap_info[5] = + IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B40 | + IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B41 | +- IEEE80211_HE_MAC_CAP5_UL_2x996_TONE_RU | +- IEEE80211_HE_MAC_CAP5_HE_DYNAMIC_SM_PS | +- IEEE80211_HE_MAC_CAP5_HT_VHT_TRIG_FRAME_RX, ++ IEEE80211_HE_MAC_CAP5_UL_2x996_TONE_RU, + .phy_cap_info[0] = + IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G | + IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G | +@@ -517,13 +516,18 @@ + .phy_cap_info[1] = + IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK | + IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A | +- IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD, ++ IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD | ++ IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS, + .phy_cap_info[2] = +- IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US, ++ IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US | ++ IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ | ++ IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ | ++ IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO | ++ IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO, + .phy_cap_info[3] = +- IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_NO_DCM | ++ IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_BPSK | + IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_1 | +- IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_NO_DCM | ++ IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_BPSK | + IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_1, + .phy_cap_info[4] = + IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE | +@@ -531,8 +535,16 @@ + IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_8, + .phy_cap_info[5] = + IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_2 | +- IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2, ++ IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2 | ++ IEEE80211_HE_PHY_CAP5_NG16_SU_FEEDBACK | ++ IEEE80211_HE_PHY_CAP5_NG16_MU_FEEDBACK, + .phy_cap_info[6] = ++ IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_42_SU | ++ IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_75_MU | ++ IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMER_FB | ++ IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMER_FB | ++ IEEE80211_HE_PHY_CAP6_TRIG_CQI_FB | ++ IEEE80211_HE_PHY_CAP6_PARTIAL_BANDWIDTH_DL_MUMIMO | + IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT, + .phy_cap_info[7] = + IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_AR | +@@ -543,12 +555,11 @@ + IEEE80211_HE_PHY_CAP8_20MHZ_IN_40MHZ_HE_PPDU_IN_2G | + IEEE80211_HE_PHY_CAP8_20MHZ_IN_160MHZ_HE_PPDU | + IEEE80211_HE_PHY_CAP8_80MHZ_IN_160MHZ_HE_PPDU | +- IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_2x996, ++ IEEE80211_HE_PHY_CAP8_DCM_MAX_BW_160_OR_80P80_MHZ, + .phy_cap_info[9] = + IEEE80211_HE_PHY_CAP9_NON_TRIGGERED_CQI_FEEDBACK | + IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_COMP_SIGB | +- IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_NON_COMP_SIGB | +- IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_RESERVED, ++ IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_NON_COMP_SIGB, + }, + /* + * Set default Tx/Rx HE MCS NSS Support field. +@@ -582,26 +593,28 @@ + IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8, + .mac_cap_info[2] = + IEEE80211_HE_MAC_CAP2_BSR | ++ IEEE80211_HE_MAC_CAP2_MU_CASCADING | + IEEE80211_HE_MAC_CAP2_ACK_EN, + .mac_cap_info[3] = + IEEE80211_HE_MAC_CAP3_OMI_CONTROL | + IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2, + .mac_cap_info[4] = + IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU, +- .mac_cap_info[5] = +- IEEE80211_HE_MAC_CAP5_UL_2x996_TONE_RU, + .phy_cap_info[0] = + IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G | + IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G | + IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G, + .phy_cap_info[1] = +- IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD, ++ IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD | ++ IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS, + .phy_cap_info[2] = +- IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US, ++ IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US | ++ IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ | ++ IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ, + .phy_cap_info[3] = +- IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_NO_DCM | ++ IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_BPSK | + IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_1 | +- IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_NO_DCM | ++ IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_BPSK | + IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_1, + .phy_cap_info[4] = + IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE | +@@ -609,8 +622,12 @@ + IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_8, + .phy_cap_info[5] = + IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_2 | +- IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2, ++ IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2 | ++ IEEE80211_HE_PHY_CAP5_NG16_SU_FEEDBACK | ++ IEEE80211_HE_PHY_CAP5_NG16_MU_FEEDBACK, + .phy_cap_info[6] = ++ IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_42_SU | ++ IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_75_MU | + IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT, + .phy_cap_info[7] = + IEEE80211_HE_PHY_CAP7_HE_SU_MU_PPDU_4XLTF_AND_08_US_GI | +@@ -620,11 +637,10 @@ + IEEE80211_HE_PHY_CAP8_20MHZ_IN_40MHZ_HE_PPDU_IN_2G | + IEEE80211_HE_PHY_CAP8_20MHZ_IN_160MHZ_HE_PPDU | + IEEE80211_HE_PHY_CAP8_80MHZ_IN_160MHZ_HE_PPDU | +- IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_2x996, ++ IEEE80211_HE_PHY_CAP8_DCM_MAX_BW_160_OR_80P80_MHZ, + .phy_cap_info[9] = + IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_COMP_SIGB | +- IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_NON_COMP_SIGB | +- IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_RESERVED, ++ IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_NON_COMP_SIGB, + }, + /* + * Set default Tx/Rx HE MCS NSS Support field. diff --git a/SOURCES/0007-Revert-iwlwifi-mvm-report-FTM-start-time-TSF-when-ap.patch b/SOURCES/0007-Revert-iwlwifi-mvm-report-FTM-start-time-TSF-when-ap.patch new file mode 100644 index 0000000..0a24c96 --- /dev/null +++ b/SOURCES/0007-Revert-iwlwifi-mvm-report-FTM-start-time-TSF-when-ap.patch @@ -0,0 +1,55 @@ +From 49be6e27c80189463bf9940c42e49c8c803effee Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 25 Jul 2019 13:48:10 +0200 +Subject: [PATCH 1/7] Revert "iwlwifi: mvm: report FTM start time TSF when + applicable" + +This reverts commit cec2d4f6b4e3f7dba2f3281464d835d7003aaa6f. +--- + .../net/wireless/intel/iwlwifi/mvm/ftm-initiator.c | 20 +++----------------- + 1 file changed, 3 insertions(+), 17 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +index fec38a47696e..b15a4db7198e 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +@@ -187,24 +187,12 @@ static void iwl_mvm_ftm_cmd(struct iwl_mvm *mvm, struct ieee80211_vif *vif, + for (i = 0; i < ETH_ALEN; i++) + cmd->macaddr_mask[i] = ~req->mac_addr_mask[i]; + +- if (vif->bss_conf.assoc) { ++ if (vif->bss_conf.assoc) + memcpy(cmd->range_req_bssid, vif->bss_conf.bssid, ETH_ALEN); +- +- /* AP's TSF is only relevant if associated */ +- for (i = 0; i < req->n_peers; i++) { +- if (req->peers[i].report_ap_tsf) { +- struct iwl_mvm_vif *mvmvif = +- iwl_mvm_vif_from_mac80211(vif); +- +- cmd->tsf_mac_id = cpu_to_le32(mvmvif->id); +- return; +- } +- } +- } else { ++ else + eth_broadcast_addr(cmd->range_req_bssid); +- } + +- /* Don't report AP's TSF */ ++ /* TODO: fill in tsf_mac_id if needed */ + cmd->tsf_mac_id = cpu_to_le32(0xff); + } + +@@ -539,8 +527,6 @@ void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) + fw_ap = (void *)&fw_resp_v6->ap[i]; + + result.final = fw_resp->ap[i].last_burst; +- result.ap_tsf = le32_to_cpu(fw_ap->start_tsf); +- result.ap_tsf_valid = 1; + } else { + /* the first part is the same for old and new APIs */ + fw_ap = (void *)&fw_resp_v5->ap[i]; +-- +2.13.6 + diff --git a/SOURCES/0008-Revert-iwlwifi-mvm-support-rtt-confidence-indication.patch b/SOURCES/0008-Revert-iwlwifi-mvm-support-rtt-confidence-indication.patch new file mode 100644 index 0000000..0c5da83 --- /dev/null +++ b/SOURCES/0008-Revert-iwlwifi-mvm-support-rtt-confidence-indication.patch @@ -0,0 +1,168 @@ +From 1f462c5d0f105c46b47db26c8a44c37a5c1028f2 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 25 Jul 2019 13:52:10 +0200 +Subject: [PATCH 2/7] Revert "iwlwifi: mvm: support rtt confidence indication" + +This reverts commit 957a67c828e741ef7e09f69075edd3d5a6148e2c. +--- + .../net/wireless/intel/iwlwifi/fw/api/location.h | 77 +--------------------- + .../net/wireless/intel/iwlwifi/mvm/ftm-initiator.c | 13 +--- + 2 files changed, 3 insertions(+), 87 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/location.h b/drivers/net/wireless/intel/iwlwifi/fw/api/location.h +index 8d78b0e671c0..5dddb21c1c4d 100644 +--- a/drivers/net/wireless/intel/iwlwifi/fw/api/location.h ++++ b/drivers/net/wireless/intel/iwlwifi/fw/api/location.h +@@ -675,59 +675,6 @@ struct iwl_tof_range_rsp_ap_entry_ntfy_v3 { + } __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_3 */ + + /** +- * struct iwl_tof_range_rsp_ap_entry_ntfy_v4 - AP parameters (response) +- * @bssid: BSSID of the AP +- * @measure_status: current APs measurement status, one of +- * &enum iwl_tof_entry_status. +- * @measure_bw: Current AP Bandwidth: 0 20MHz, 1 40MHz, 2 80MHz +- * @rtt: The Round Trip Time that took for the last measurement for +- * current AP [pSec] +- * @rtt_variance: The Variance of the RTT values measured for current AP +- * @rtt_spread: The Difference between the maximum and the minimum RTT +- * values measured for current AP in the current session [pSec] +- * @rssi: RSSI as uploaded in the Channel Estimation notification +- * @rssi_spread: The Difference between the maximum and the minimum RSSI values +- * measured for current AP in the current session +- * @last_burst: 1 if no more FTM sessions are scheduled for this responder +- * @refusal_period: refusal period in case of +- * @IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE [sec] +- * @timestamp: The GP2 Clock [usec] where Channel Estimation notification was +- * uploaded by the LMAC +- * @start_tsf: measurement start time in TSF of the mac specified in the range +- * request +- * @rx_rate_n_flags: rate and flags of the last FTM frame received from this +- * responder +- * @tx_rate_n_flags: rate and flags of the last ack sent to this responder +- * @t2t3_initiator: as calculated from the algo in the initiator +- * @t1t4_responder: as calculated from the algo in the responder +- * @common_calib: Calib val that was used in for this AP measurement +- * @specific_calib: val that was used in for this AP measurement +- * @papd_calib_output: The result of the tof papd calibration that was injected +- * into the algorithm. +- */ +-struct iwl_tof_range_rsp_ap_entry_ntfy_v4 { +- u8 bssid[ETH_ALEN]; +- u8 measure_status; +- u8 measure_bw; +- __le32 rtt; +- __le32 rtt_variance; +- __le32 rtt_spread; +- s8 rssi; +- u8 rssi_spread; +- u8 last_burst; +- u8 refusal_period; +- __le32 timestamp; +- __le32 start_tsf; +- __le32 rx_rate_n_flags; +- __le32 tx_rate_n_flags; +- __le32 t2t3_initiator; +- __le32 t1t4_responder; +- __le16 common_calib; +- __le16 specific_calib; +- __le32 papd_calib_output; +-} __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_4 */ +- +-/** + * struct iwl_tof_range_rsp_ap_entry_ntfy - AP parameters (response) + * @bssid: BSSID of the AP + * @measure_status: current APs measurement status, one of +@@ -757,8 +704,6 @@ struct iwl_tof_range_rsp_ap_entry_ntfy_v4 { + * @specific_calib: val that was used in for this AP measurement + * @papd_calib_output: The result of the tof papd calibration that was injected + * into the algorithm. +- * @rttConfidence: a value between 0 - 31 that represents the rtt accuracy. +- * @reserved: for alignment + */ + struct iwl_tof_range_rsp_ap_entry_ntfy { + u8 bssid[ETH_ALEN]; +@@ -780,9 +725,7 @@ struct iwl_tof_range_rsp_ap_entry_ntfy { + __le16 common_calib; + __le16 specific_calib; + __le32 papd_calib_output; +- u8 rttConfidence; +- u8 reserved[3]; +-} __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_5 */ ++} __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_4 */ + + /** + * enum iwl_tof_response_status - tof response status +@@ -818,22 +761,6 @@ struct iwl_tof_range_rsp_ntfy_v5 { + } __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_5 */ + + /** +- * struct iwl_tof_range_rsp_ntfy_v6 - ranging response notification +- * @request_id: A Token ID of the corresponding Range request +- * @num_of_aps: Number of APs results +- * @last_report: 1 if no more FTM sessions are scheduled, 0 otherwise. +- * @reserved: reserved +- * @ap: per-AP data +- */ +-struct iwl_tof_range_rsp_ntfy_v6 { +- u8 request_id; +- u8 num_of_aps; +- u8 last_report; +- u8 reserved; +- struct iwl_tof_range_rsp_ap_entry_ntfy_v4 ap[IWL_MVM_TOF_MAX_APS]; +-} __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_6 */ +- +-/** + * struct iwl_tof_range_rsp_ntfy - ranging response notification + * @request_id: A Token ID of the corresponding Range request + * @num_of_aps: Number of APs results +@@ -847,7 +774,7 @@ struct iwl_tof_range_rsp_ntfy { + u8 last_report; + u8 reserved; + struct iwl_tof_range_rsp_ap_entry_ntfy ap[IWL_MVM_TOF_MAX_APS]; +-} __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_7 */ ++} __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_6 */ + + #define IWL_MVM_TOF_MCSI_BUF_SIZE (245) + /** +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +index b15a4db7198e..94132cfd1f56 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +@@ -480,7 +480,6 @@ void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) + { + struct iwl_rx_packet *pkt = rxb_addr(rxb); + struct iwl_tof_range_rsp_ntfy_v5 *fw_resp_v5 = (void *)pkt->data; +- struct iwl_tof_range_rsp_ntfy_v6 *fw_resp_v6 = (void *)pkt->data; + struct iwl_tof_range_rsp_ntfy *fw_resp = (void *)pkt->data; + int i; + bool new_api = fw_has_api(&mvm->fw->ucode_capa, +@@ -520,12 +519,7 @@ void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) + int peer_idx; + + if (new_api) { +- if (fw_has_api(&mvm->fw->ucode_capa, +- IWL_UCODE_TLV_API_FTM_RTT_ACCURACY)) +- fw_ap = &fw_resp->ap[i]; +- else +- fw_ap = (void *)&fw_resp_v6->ap[i]; +- ++ fw_ap = &fw_resp->ap[i]; + result.final = fw_resp->ap[i].last_burst; + } else { + /* the first part is the same for old and new APIs */ +@@ -594,11 +588,6 @@ void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) + mvm->ftm_initiator.req, + &result, GFP_KERNEL); + +- if (fw_has_api(&mvm->fw->ucode_capa, +- IWL_UCODE_TLV_API_FTM_RTT_ACCURACY)) +- IWL_DEBUG_INFO(mvm, "RTT confidence: %hhu\n", +- fw_ap->rttConfidence); +- + iwl_mvm_debug_range_resp(mvm, i, &result); + } + +-- +2.13.6 + diff --git a/SOURCES/0009-Revert-iwlwifi-fix-64-bit-division.patch b/SOURCES/0009-Revert-iwlwifi-fix-64-bit-division.patch new file mode 100644 index 0000000..812ab48 --- /dev/null +++ b/SOURCES/0009-Revert-iwlwifi-fix-64-bit-division.patch @@ -0,0 +1,28 @@ +From 55be0dbc4aa21b2584afd83a676b0baed9934c2b Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 25 Jul 2019 13:52:20 +0200 +Subject: [PATCH 3/7] Revert "iwlwifi: fix 64-bit division" + +This reverts commit 688cd8bd2c0fa9dc88e5ced55a73ddc79edf875d. +--- + drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +index 94132cfd1f56..e9822a3ec373 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +@@ -460,7 +460,9 @@ static int iwl_mvm_ftm_range_resp_valid(struct iwl_mvm *mvm, u8 request_id, + static void iwl_mvm_debug_range_resp(struct iwl_mvm *mvm, u8 index, + struct cfg80211_pmsr_result *res) + { +- s64 rtt_avg = div_s64(res->ftm.rtt_avg * 100, 6666); ++ s64 rtt_avg = res->ftm.rtt_avg * 100; ++ ++ do_div(rtt_avg, 6666); + + IWL_DEBUG_INFO(mvm, "entry %d\n", index); + IWL_DEBUG_INFO(mvm, "\tstatus: %d\n", res->status); +-- +2.13.6 + diff --git a/SOURCES/0010-Revert-iwlwifi-mvm-add-debug-prints-for-FTM.patch b/SOURCES/0010-Revert-iwlwifi-mvm-add-debug-prints-for-FTM.patch new file mode 100644 index 0000000..c55fab1 --- /dev/null +++ b/SOURCES/0010-Revert-iwlwifi-mvm-add-debug-prints-for-FTM.patch @@ -0,0 +1,65 @@ +From a5c259eba75a77abe8ae7c2f3661d8e523a655a1 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 25 Jul 2019 13:52:32 +0200 +Subject: [PATCH 4/7] Revert "iwlwifi: mvm: add debug prints for FTM" + +This reverts commit 937b10c0de68c56512fb8cd484af3c0b356fc09e. +--- + .../net/wireless/intel/iwlwifi/mvm/ftm-initiator.c | 27 ---------------------- + 1 file changed, 27 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +index e9822a3ec373..c1d9703ab40c 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +@@ -457,27 +457,6 @@ static int iwl_mvm_ftm_range_resp_valid(struct iwl_mvm *mvm, u8 request_id, + return 0; + } + +-static void iwl_mvm_debug_range_resp(struct iwl_mvm *mvm, u8 index, +- struct cfg80211_pmsr_result *res) +-{ +- s64 rtt_avg = res->ftm.rtt_avg * 100; +- +- do_div(rtt_avg, 6666); +- +- IWL_DEBUG_INFO(mvm, "entry %d\n", index); +- IWL_DEBUG_INFO(mvm, "\tstatus: %d\n", res->status); +- IWL_DEBUG_INFO(mvm, "\tBSSID: %pM\n", res->addr); +- IWL_DEBUG_INFO(mvm, "\thost time: %llu\n", res->host_time); +- IWL_DEBUG_INFO(mvm, "\tburst index: %hhu\n", res->ftm.burst_index); +- IWL_DEBUG_INFO(mvm, "\tsuccess num: %u\n", res->ftm.num_ftmr_successes); +- IWL_DEBUG_INFO(mvm, "\trssi: %d\n", res->ftm.rssi_avg); +- IWL_DEBUG_INFO(mvm, "\trssi spread: %hhu\n", res->ftm.rssi_spread); +- IWL_DEBUG_INFO(mvm, "\trtt: %lld\n", res->ftm.rtt_avg); +- IWL_DEBUG_INFO(mvm, "\trtt var: %llu\n", res->ftm.rtt_variance); +- IWL_DEBUG_INFO(mvm, "\trtt spread: %llu\n", res->ftm.rtt_spread); +- IWL_DEBUG_INFO(mvm, "\tdistance: %lld\n", rtt_avg); +-} +- + void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) + { + struct iwl_rx_packet *pkt = rxb_addr(rxb); +@@ -511,10 +490,6 @@ void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) + last_in_batch = fw_resp_v5->last_in_batch; + } + +- IWL_DEBUG_INFO(mvm, "Range response received\n"); +- IWL_DEBUG_INFO(mvm, "request id: %lld, num of entries: %hhu\n", +- mvm->ftm_initiator.req->cookie, num_of_aps); +- + for (i = 0; i < num_of_aps && i < IWL_MVM_TOF_MAX_APS; i++) { + struct cfg80211_pmsr_result result = {}; + struct iwl_tof_range_rsp_ap_entry_ntfy *fw_ap; +@@ -589,8 +564,6 @@ void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) + cfg80211_pmsr_report(mvm->ftm_initiator.req_wdev, + mvm->ftm_initiator.req, + &result, GFP_KERNEL); +- +- iwl_mvm_debug_range_resp(mvm, i, &result); + } + + if (last_in_batch) { +-- +2.13.6 + diff --git a/SOURCES/0011-Revert-iwlwifi-mvm-add-support-for-new-FTM-fw-API.patch b/SOURCES/0011-Revert-iwlwifi-mvm-add-support-for-new-FTM-fw-API.patch new file mode 100644 index 0000000..c51ce5a --- /dev/null +++ b/SOURCES/0011-Revert-iwlwifi-mvm-add-support-for-new-FTM-fw-API.patch @@ -0,0 +1,736 @@ +From 02a377d13809d6f5c67d03107a9e97b593ecb48d Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 25 Jul 2019 13:53:09 +0200 +Subject: [PATCH 5/7] Revert "iwlwifi: mvm: add support for new FTM fw API" + +This reverts commit ff418feeec0fefb8373567c1e4e32b631587f454. +--- + .../net/wireless/intel/iwlwifi/fw/api/location.h | 181 +---------- + drivers/net/wireless/intel/iwlwifi/fw/file.h | 2 - + .../net/wireless/intel/iwlwifi/mvm/ftm-initiator.c | 338 ++++++--------------- + 3 files changed, 95 insertions(+), 426 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/location.h b/drivers/net/wireless/intel/iwlwifi/fw/api/location.h +index 5dddb21c1c4d..10cac5f987e7 100644 +--- a/drivers/net/wireless/intel/iwlwifi/fw/api/location.h ++++ b/drivers/net/wireless/intel/iwlwifi/fw/api/location.h +@@ -324,7 +324,7 @@ enum iwl_tof_location_query { + }; + + /** +- * struct iwl_tof_range_req_ap_entry_v2 - AP configuration parameters ++ * struct iwl_tof_range_req_ap_entry - AP configuration parameters + * @channel_num: Current AP Channel + * @bandwidth: Current AP Bandwidth. One of iwl_tof_bandwidth. + * @tsf_delta_direction: TSF relatively to the subject AP +@@ -357,7 +357,7 @@ enum iwl_tof_location_query { + * @notify_mcsi: &enum iwl_tof_mcsi_ntfy. + * @reserved: For alignment and future use + */ +-struct iwl_tof_range_req_ap_entry_v2 { ++struct iwl_tof_range_req_ap_entry { + u8 channel_num; + u8 bandwidth; + u8 tsf_delta_direction; +@@ -376,62 +376,6 @@ struct iwl_tof_range_req_ap_entry_v2 { + u8 algo_type; + u8 notify_mcsi; + __le16 reserved; +-} __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_2 */ +- +-/** +- * enum iwl_initiator_ap_flags - per responder FTM configuration flags +- * @IWL_INITIATOR_AP_FLAGS_ASAP: Request for ASAP measurement. +- * @IWL_INITIATOR_AP_FLAGS_LCI_REQUEST: Request for LCI information +- * @IWL_INITIATOR_AP_FLAGS_CIVIC_REQUEST: Request for CIVIC information +- * @IWL_INITIATOR_AP_FLAGS_DYN_ACK: Send HT/VHT ack for FTM frames. If not set, +- * 20Mhz dup acks will be sent. +- * @IWL_INITIATOR_AP_FLAGS_ALGO_LR: Use LR algo type for rtt calculation. +- * Default algo type is ML. +- * @IWL_INITIATOR_AP_FLAGS_ALGO_FFT: Use FFT algo type for rtt calculation. +- * Default algo type is ML. +- * @IWL_INITIATOR_AP_FLAGS_MCSI_REPORT: Send the MCSI for each FTM frame to the +- * driver. +- */ +-enum iwl_initiator_ap_flags { +- IWL_INITIATOR_AP_FLAGS_ASAP = BIT(1), +- IWL_INITIATOR_AP_FLAGS_LCI_REQUEST = BIT(2), +- IWL_INITIATOR_AP_FLAGS_CIVIC_REQUEST = BIT(3), +- IWL_INITIATOR_AP_FLAGS_DYN_ACK = BIT(4), +- IWL_INITIATOR_AP_FLAGS_ALGO_LR = BIT(5), +- IWL_INITIATOR_AP_FLAGS_ALGO_FFT = BIT(6), +- IWL_INITIATOR_AP_FLAGS_MCSI_REPORT = BIT(8), +-}; +- +-/** +- * struct iwl_tof_range_req_ap_entry - AP configuration parameters +- * @initiator_ap_flags: see &enum iwl_initiator_ap_flags. +- * @channel_num: AP Channel number +- * @bandwidth: AP bandwidth. One of iwl_tof_bandwidth. +- * @ctrl_ch_position: Coding of the control channel position relative to the +- * center frequency, see iwl_mvm_get_ctrl_pos(). +- * @ftmr_max_retries: Max number of retries to send the FTMR in case of no +- * reply from the AP. +- * @bssid: AP's BSSID +- * @burst_period: Recommended value to be sent to the AP. Measurement +- * periodicity In units of 100ms. ignored if num_of_bursts_exp = 0 +- * @samples_per_burst: the number of FTMs pairs in single Burst (1-31); +- * @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of +- * the number of measurement iterations (min 2^0 = 1, max 2^14) +- * @reserved: For alignment and future use +- * @tsf_delta: not in use +- */ +-struct iwl_tof_range_req_ap_entry { +- __le32 initiator_ap_flags; +- u8 channel_num; +- u8 bandwidth; +- u8 ctrl_ch_position; +- u8 ftmr_max_retries; +- u8 bssid[ETH_ALEN]; +- __le16 burst_period; +- u8 samples_per_burst; +- u8 num_of_bursts; +- __le16 reserved; +- __le32 tsf_delta; + } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_3 */ + + /** +@@ -461,12 +405,10 @@ enum iwl_tof_response_mode { + * @IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_A: use antenna A fo TX ACKs during FTM + * @IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_B: use antenna B fo TX ACKs during FTM + * @IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_C: use antenna C fo TX ACKs during FTM +- * @IWL_TOF_INITIATOR_FLAGS_MACADDR_RANDOM: use random mac address for FTM + * @IWL_TOF_INITIATOR_FLAGS_SPECIFIC_CALIB: use the specific calib value from + * the range request command + * @IWL_TOF_INITIATOR_FLAGS_COMMON_CALIB: use the common calib value from the + * ragne request command +- * @IWL_TOF_INITIATOR_FLAGS_NON_ASAP_SUPPORT: support non-asap measurements + */ + enum iwl_tof_initiator_flags { + IWL_TOF_INITIATOR_FLAGS_FAST_ALGO_DISABLED = BIT(0), +@@ -476,17 +418,15 @@ enum iwl_tof_initiator_flags { + IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_A = BIT(4), + IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_B = BIT(5), + IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_C = BIT(6), +- IWL_TOF_INITIATOR_FLAGS_MACADDR_RANDOM = BIT(7), + IWL_TOF_INITIATOR_FLAGS_SPECIFIC_CALIB = BIT(15), + IWL_TOF_INITIATOR_FLAGS_COMMON_CALIB = BIT(16), +- IWL_TOF_INITIATOR_FLAGS_NON_ASAP_SUPPORT = BIT(20), + }; /* LOCATION_RANGE_REQ_CMD_API_S_VER_5 */ + + #define IWL_MVM_TOF_MAX_APS 5 + #define IWL_MVM_TOF_MAX_TWO_SIDED_APS 5 + + /** +- * struct iwl_tof_range_req_cmd_v5 - start measurement cmd ++ * struct iwl_tof_range_req_cmd - start measurement cmd + * @initiator_flags: see flags @ iwl_tof_initiator_flags + * @request_id: A Token incremented per request. The same Token will be + * sent back in the range response +@@ -514,7 +454,7 @@ enum iwl_tof_initiator_flags { + * @specific_calib: The specific calib value to inject to this measurement calc + * @ap: per-AP request data + */ +-struct iwl_tof_range_req_cmd_v5 { ++struct iwl_tof_range_req_cmd { + __le32 initiator_flags; + u8 request_id; + u8 initiator; +@@ -531,42 +471,10 @@ struct iwl_tof_range_req_cmd_v5 { + u8 ftm_tx_chains; + __le16 common_calib; + __le16 specific_calib; +- struct iwl_tof_range_req_ap_entry_v2 ap[IWL_MVM_TOF_MAX_APS]; ++ struct iwl_tof_range_req_ap_entry ap[IWL_MVM_TOF_MAX_APS]; + } __packed; + /* LOCATION_RANGE_REQ_CMD_API_S_VER_5 */ + +-/** +- * struct iwl_tof_range_req_cmd - start measurement cmd +- * @initiator_flags: see flags @ iwl_tof_initiator_flags +- * @request_id: A Token incremented per request. The same Token will be +- * sent back in the range response +- * @num_of_ap: Number of APs to measure (error if > IWL_MVM_TOF_MAX_APS) +- * @range_req_bssid: ranging request BSSID +- * @macaddr_mask: Bits set to 0 shall be copied from the MAC address template. +- * Bits set to 1 shall be randomized by the UMAC +- * @macaddr_template: MAC address template to use for non-randomized bits +- * @req_timeout_ms: Requested timeout of the response in units of milliseconds. +- * This is the session time for completing the measurement. +- * @tsf_mac_id: report the measurement start time for each ap in terms of the +- * TSF of this mac id. 0xff to disable TSF reporting. +- * @common_calib: The common calib value to inject to this measurement calc +- * @specific_calib: The specific calib value to inject to this measurement calc +- * @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v2. +- */ +-struct iwl_tof_range_req_cmd { +- __le32 initiator_flags; +- u8 request_id; +- u8 num_of_ap; +- u8 range_req_bssid[ETH_ALEN]; +- u8 macaddr_mask[ETH_ALEN]; +- u8 macaddr_template[ETH_ALEN]; +- __le32 req_timeout_ms; +- __le32 tsf_mac_id; +- __le16 common_calib; +- __le16 specific_calib; +- struct iwl_tof_range_req_ap_entry ap[IWL_MVM_TOF_MAX_APS]; +-} __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_7 */ +- + /* + * enum iwl_tof_range_request_status - status of the sent request + * @IWL_TOF_RANGE_REQUEST_STATUS_SUCCESSFUL - FW successfully received the +@@ -626,7 +534,7 @@ enum iwl_tof_entry_status { + }; /* LOCATION_RANGE_RSP_AP_ENTRY_NTFY_API_S_VER_2 */ + + /** +- * struct iwl_tof_range_rsp_ap_entry_ntfy_v3 - AP parameters (response) ++ * struct iwl_tof_range_rsp_ap_entry_ntfy - AP parameters (response) + * @bssid: BSSID of the AP + * @measure_status: current APs measurement status, one of + * &enum iwl_tof_entry_status. +@@ -653,7 +561,7 @@ enum iwl_tof_entry_status { + * @papd_calib_output: The result of the tof papd calibration that was injected + * into the algorithm. + */ +-struct iwl_tof_range_rsp_ap_entry_ntfy_v3 { ++struct iwl_tof_range_rsp_ap_entry_ntfy { + u8 bssid[ETH_ALEN]; + u8 measure_status; + u8 measure_bw; +@@ -675,59 +583,6 @@ struct iwl_tof_range_rsp_ap_entry_ntfy_v3 { + } __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_3 */ + + /** +- * struct iwl_tof_range_rsp_ap_entry_ntfy - AP parameters (response) +- * @bssid: BSSID of the AP +- * @measure_status: current APs measurement status, one of +- * &enum iwl_tof_entry_status. +- * @measure_bw: Current AP Bandwidth: 0 20MHz, 1 40MHz, 2 80MHz +- * @rtt: The Round Trip Time that took for the last measurement for +- * current AP [pSec] +- * @rtt_variance: The Variance of the RTT values measured for current AP +- * @rtt_spread: The Difference between the maximum and the minimum RTT +- * values measured for current AP in the current session [pSec] +- * @rssi: RSSI as uploaded in the Channel Estimation notification +- * @rssi_spread: The Difference between the maximum and the minimum RSSI values +- * measured for current AP in the current session +- * @last_burst: 1 if no more FTM sessions are scheduled for this responder +- * @refusal_period: refusal period in case of +- * @IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE [sec] +- * @timestamp: The GP2 Clock [usec] where Channel Estimation notification was +- * uploaded by the LMAC +- * @start_tsf: measurement start time in TSF of the mac specified in the range +- * request +- * @rx_rate_n_flags: rate and flags of the last FTM frame received from this +- * responder +- * @tx_rate_n_flags: rate and flags of the last ack sent to this responder +- * @t2t3_initiator: as calculated from the algo in the initiator +- * @t1t4_responder: as calculated from the algo in the responder +- * @common_calib: Calib val that was used in for this AP measurement +- * @specific_calib: val that was used in for this AP measurement +- * @papd_calib_output: The result of the tof papd calibration that was injected +- * into the algorithm. +- */ +-struct iwl_tof_range_rsp_ap_entry_ntfy { +- u8 bssid[ETH_ALEN]; +- u8 measure_status; +- u8 measure_bw; +- __le32 rtt; +- __le32 rtt_variance; +- __le32 rtt_spread; +- s8 rssi; +- u8 rssi_spread; +- u8 last_burst; +- u8 refusal_period; +- __le32 timestamp; +- __le32 start_tsf; +- __le32 rx_rate_n_flags; +- __le32 tx_rate_n_flags; +- __le32 t2t3_initiator; +- __le32 t1t4_responder; +- __le16 common_calib; +- __le16 specific_calib; +- __le32 papd_calib_output; +-} __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_4 */ +- +-/** + * enum iwl_tof_response_status - tof response status + * + * @IWL_TOF_RESPONSE_SUCCESS: successful range. +@@ -744,7 +599,7 @@ enum iwl_tof_response_status { + }; /* LOCATION_RNG_RSP_STATUS */ + + /** +- * struct iwl_tof_range_rsp_ntfy_v5 - ranging response notification ++ * struct iwl_tof_range_rsp_ntfy - ranging response notification + * @request_id: A Token ID of the corresponding Range request + * @request_status: status of current measurement session, one of + * &enum iwl_tof_response_status. +@@ -752,29 +607,13 @@ enum iwl_tof_response_status { + * @num_of_aps: Number of APs to measure (error if > IWL_MVM_TOF_MAX_APS) + * @ap: per-AP data + */ +-struct iwl_tof_range_rsp_ntfy_v5 { ++struct iwl_tof_range_rsp_ntfy { + u8 request_id; + u8 request_status; + u8 last_in_batch; + u8 num_of_aps; +- struct iwl_tof_range_rsp_ap_entry_ntfy_v3 ap[IWL_MVM_TOF_MAX_APS]; +-} __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_5 */ +- +-/** +- * struct iwl_tof_range_rsp_ntfy - ranging response notification +- * @request_id: A Token ID of the corresponding Range request +- * @num_of_aps: Number of APs results +- * @last_report: 1 if no more FTM sessions are scheduled, 0 otherwise. +- * @reserved: reserved +- * @ap: per-AP data +- */ +-struct iwl_tof_range_rsp_ntfy { +- u8 request_id; +- u8 num_of_aps; +- u8 last_report; +- u8 reserved; + struct iwl_tof_range_rsp_ap_entry_ntfy ap[IWL_MVM_TOF_MAX_APS]; +-} __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_6 */ ++} __packed; + + #define IWL_MVM_TOF_MCSI_BUF_SIZE (245) + /** +diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h +index de9243d30135..c26cf2a2ea02 100644 +--- a/drivers/net/wireless/intel/iwlwifi/fw/file.h ++++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h +@@ -9,7 +9,6 @@ + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 - 2017 Intel Deutschland GmbH + * Copyright(c) 2018 Intel Corporation +- * Copyright(c) 2019 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as +@@ -33,7 +32,6 @@ + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 - 2017 Intel Deutschland GmbH + * Copyright(c) 2018 Intel Corporation +- * Copyright(c) 2019 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +index c1d9703ab40c..eb6f084a0f8a 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +@@ -132,225 +132,92 @@ iwl_ftm_range_request_status_to_err(enum iwl_tof_range_request_status s) + } + } + +-static void iwl_mvm_ftm_cmd_v5(struct iwl_mvm *mvm, struct ieee80211_vif *vif, +- struct iwl_tof_range_req_cmd_v5 *cmd, +- struct cfg80211_pmsr_request *req) +-{ +- int i; +- +- cmd->request_id = req->cookie; +- cmd->num_of_ap = req->n_peers; +- +- /* use maximum for "no timeout" or bigger than what we can do */ +- if (!req->timeout || req->timeout > 255 * 100) +- cmd->req_timeout = 255; +- else +- cmd->req_timeout = DIV_ROUND_UP(req->timeout, 100); +- +- /* +- * We treat it always as random, since if not we'll +- * have filled our local address there instead. +- */ +- cmd->macaddr_random = 1; +- memcpy(cmd->macaddr_template, req->mac_addr, ETH_ALEN); +- for (i = 0; i < ETH_ALEN; i++) +- cmd->macaddr_mask[i] = ~req->mac_addr_mask[i]; +- +- if (vif->bss_conf.assoc) +- memcpy(cmd->range_req_bssid, vif->bss_conf.bssid, ETH_ALEN); +- else +- eth_broadcast_addr(cmd->range_req_bssid); +-} +- +-static void iwl_mvm_ftm_cmd(struct iwl_mvm *mvm, struct ieee80211_vif *vif, +- struct iwl_tof_range_req_cmd *cmd, +- struct cfg80211_pmsr_request *req) +-{ +- int i; +- +- cmd->initiator_flags = +- cpu_to_le32(IWL_TOF_INITIATOR_FLAGS_MACADDR_RANDOM | +- IWL_TOF_INITIATOR_FLAGS_NON_ASAP_SUPPORT); +- cmd->request_id = req->cookie; +- cmd->num_of_ap = req->n_peers; +- +- /* +- * Use a large value for "no timeout". Don't use the maximum value +- * because of fw limitations. +- */ +- if (req->timeout) +- cmd->req_timeout_ms = cpu_to_le32(req->timeout); +- else +- cmd->req_timeout_ms = cpu_to_le32(0xfffff); +- +- memcpy(cmd->macaddr_template, req->mac_addr, ETH_ALEN); +- for (i = 0; i < ETH_ALEN; i++) +- cmd->macaddr_mask[i] = ~req->mac_addr_mask[i]; +- +- if (vif->bss_conf.assoc) +- memcpy(cmd->range_req_bssid, vif->bss_conf.bssid, ETH_ALEN); +- else +- eth_broadcast_addr(cmd->range_req_bssid); +- +- /* TODO: fill in tsf_mac_id if needed */ +- cmd->tsf_mac_id = cpu_to_le32(0xff); +-} +- +-static int iwl_mvm_ftm_target_chandef(struct iwl_mvm *mvm, +- struct cfg80211_pmsr_request_peer *peer, +- u8 *channel, u8 *bandwidth, +- u8 *ctrl_ch_position) +-{ +- u32 freq = peer->chandef.chan->center_freq; +- +- *channel = ieee80211_frequency_to_channel(freq); +- +- switch (peer->chandef.width) { +- case NL80211_CHAN_WIDTH_20_NOHT: +- *bandwidth = IWL_TOF_BW_20_LEGACY; +- break; +- case NL80211_CHAN_WIDTH_20: +- *bandwidth = IWL_TOF_BW_20_HT; +- break; +- case NL80211_CHAN_WIDTH_40: +- *bandwidth = IWL_TOF_BW_40; +- break; +- case NL80211_CHAN_WIDTH_80: +- *bandwidth = IWL_TOF_BW_80; +- break; +- default: +- IWL_ERR(mvm, "Unsupported BW in FTM request (%d)\n", +- peer->chandef.width); +- return -EINVAL; +- } +- +- *ctrl_ch_position = (peer->chandef.width > NL80211_CHAN_WIDTH_20) ? +- iwl_mvm_get_ctrl_pos(&peer->chandef) : 0; +- +- return 0; +-} +- +-static int +-iwl_mvm_ftm_put_target_v2(struct iwl_mvm *mvm, +- struct cfg80211_pmsr_request_peer *peer, +- struct iwl_tof_range_req_ap_entry_v2 *target) +-{ +- int ret; +- +- ret = iwl_mvm_ftm_target_chandef(mvm, peer, &target->channel_num, +- &target->bandwidth, +- &target->ctrl_ch_position); +- if (ret) +- return ret; +- +- memcpy(target->bssid, peer->addr, ETH_ALEN); +- target->burst_period = +- cpu_to_le16(peer->ftm.burst_period); +- target->samples_per_burst = peer->ftm.ftms_per_burst; +- target->num_of_bursts = peer->ftm.num_bursts_exp; +- target->measure_type = 0; /* regular two-sided FTM */ +- target->retries_per_sample = peer->ftm.ftmr_retries; +- target->asap_mode = peer->ftm.asap; +- target->enable_dyn_ack = IWL_MVM_FTM_INITIATOR_DYNACK; +- +- if (peer->ftm.request_lci) +- target->location_req |= IWL_TOF_LOC_LCI; +- if (peer->ftm.request_civicloc) +- target->location_req |= IWL_TOF_LOC_CIVIC; +- +- target->algo_type = IWL_MVM_FTM_INITIATOR_ALGO; +- +- return 0; +-} +- +-#define FTM_PUT_FLAG(flag) (target->initiator_ap_flags |= \ +- cpu_to_le32(IWL_INITIATOR_AP_FLAGS_##flag)) +- +-static int iwl_mvm_ftm_put_target(struct iwl_mvm *mvm, +- struct cfg80211_pmsr_request_peer *peer, +- struct iwl_tof_range_req_ap_entry *target) +-{ +- int ret; +- +- ret = iwl_mvm_ftm_target_chandef(mvm, peer, &target->channel_num, +- &target->bandwidth, +- &target->ctrl_ch_position); +- if (ret) +- return ret; +- +- memcpy(target->bssid, peer->addr, ETH_ALEN); +- target->burst_period = +- cpu_to_le16(peer->ftm.burst_period); +- target->samples_per_burst = peer->ftm.ftms_per_burst; +- target->num_of_bursts = peer->ftm.num_bursts_exp; +- target->ftmr_max_retries = peer->ftm.ftmr_retries; +- target->initiator_ap_flags = cpu_to_le32(0); +- +- if (peer->ftm.asap) +- FTM_PUT_FLAG(ASAP); +- +- if (peer->ftm.request_lci) +- FTM_PUT_FLAG(LCI_REQUEST); +- +- if (peer->ftm.request_civicloc) +- FTM_PUT_FLAG(CIVIC_REQUEST); +- +- if (IWL_MVM_FTM_INITIATOR_DYNACK) +- FTM_PUT_FLAG(DYN_ACK); +- +- if (IWL_MVM_FTM_INITIATOR_ALGO == IWL_TOF_ALGO_TYPE_LINEAR_REG) +- FTM_PUT_FLAG(ALGO_LR); +- else if (IWL_MVM_FTM_INITIATOR_ALGO == IWL_TOF_ALGO_TYPE_FFT) +- FTM_PUT_FLAG(ALGO_FFT); +- +- return 0; +-} +- + int iwl_mvm_ftm_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif, + struct cfg80211_pmsr_request *req) + { +- struct iwl_tof_range_req_cmd_v5 cmd_v5; +- struct iwl_tof_range_req_cmd cmd; +- bool new_api = fw_has_api(&mvm->fw->ucode_capa, +- IWL_UCODE_TLV_API_FTM_NEW_RANGE_REQ); +- u8 num_of_ap; ++ struct iwl_tof_range_req_cmd cmd = { ++ .request_id = req->cookie, ++ .req_timeout = DIV_ROUND_UP(req->timeout, 100), ++ .num_of_ap = req->n_peers, ++ /* ++ * We treat it always as random, since if not we'll ++ * have filled our local address there instead. ++ */ ++ .macaddr_random = 1, ++ }; + struct iwl_host_cmd hcmd = { + .id = iwl_cmd_id(TOF_RANGE_REQ_CMD, LOCATION_GROUP, 0), ++ .data[0] = &cmd, ++ .len[0] = sizeof(cmd), + .dataflags[0] = IWL_HCMD_DFL_DUP, + }; + u32 status = 0; + int err, i; + ++ /* use maximum for "no timeout" or bigger than what we can do */ ++ if (!req->timeout || req->timeout > 255 * 100) ++ cmd.req_timeout = 255; ++ + lockdep_assert_held(&mvm->mutex); + + if (mvm->ftm_initiator.req) + return -EBUSY; + +- if (new_api) { +- iwl_mvm_ftm_cmd(mvm, vif, &cmd, req); +- hcmd.data[0] = &cmd; +- hcmd.len[0] = sizeof(cmd); +- num_of_ap = cmd.num_of_ap; +- } else { +- iwl_mvm_ftm_cmd_v5(mvm, vif, &cmd_v5, req); +- hcmd.data[0] = &cmd_v5; +- hcmd.len[0] = sizeof(cmd_v5); +- num_of_ap = cmd_v5.num_of_ap; +- } ++ memcpy(cmd.macaddr_template, req->mac_addr, ETH_ALEN); ++ for (i = 0; i < ETH_ALEN; i++) ++ cmd.macaddr_mask[i] = ~req->mac_addr_mask[i]; + +- for (i = 0; i < num_of_ap; i++) { ++ for (i = 0; i < cmd.num_of_ap; i++) { + struct cfg80211_pmsr_request_peer *peer = &req->peers[i]; ++ struct iwl_tof_range_req_ap_entry *cmd_target = &cmd.ap[i]; ++ u32 freq = peer->chandef.chan->center_freq; + +- if (new_api) +- err = iwl_mvm_ftm_put_target(mvm, peer, &cmd.ap[i]); +- else +- err = iwl_mvm_ftm_put_target_v2(mvm, peer, +- &cmd_v5.ap[i]); +- +- if (err) +- return err; ++ cmd_target->channel_num = ieee80211_frequency_to_channel(freq); ++ switch (peer->chandef.width) { ++ case NL80211_CHAN_WIDTH_20_NOHT: ++ cmd_target->bandwidth = IWL_TOF_BW_20_LEGACY; ++ break; ++ case NL80211_CHAN_WIDTH_20: ++ cmd_target->bandwidth = IWL_TOF_BW_20_HT; ++ break; ++ case NL80211_CHAN_WIDTH_40: ++ cmd_target->bandwidth = IWL_TOF_BW_40; ++ break; ++ case NL80211_CHAN_WIDTH_80: ++ cmd_target->bandwidth = IWL_TOF_BW_80; ++ break; ++ default: ++ IWL_ERR(mvm, "Unsupported BW in FTM request (%d)\n", ++ peer->chandef.width); ++ return -EINVAL; ++ } ++ cmd_target->ctrl_ch_position = ++ (peer->chandef.width > NL80211_CHAN_WIDTH_20) ? ++ iwl_mvm_get_ctrl_pos(&peer->chandef) : 0; ++ ++ memcpy(cmd_target->bssid, peer->addr, ETH_ALEN); ++ cmd_target->measure_type = 0; /* regular two-sided FTM */ ++ cmd_target->num_of_bursts = peer->ftm.num_bursts_exp; ++ cmd_target->burst_period = ++ cpu_to_le16(peer->ftm.burst_period); ++ cmd_target->samples_per_burst = peer->ftm.ftms_per_burst; ++ cmd_target->retries_per_sample = peer->ftm.ftmr_retries; ++ cmd_target->asap_mode = peer->ftm.asap; ++ cmd_target->enable_dyn_ack = IWL_MVM_FTM_INITIATOR_DYNACK; ++ ++ if (peer->ftm.request_lci) ++ cmd_target->location_req |= IWL_TOF_LOC_LCI; ++ if (peer->ftm.request_civicloc) ++ cmd_target->location_req |= IWL_TOF_LOC_CIVIC; ++ ++ cmd_target->algo_type = IWL_MVM_FTM_INITIATOR_ALGO; + } + ++ if (vif->bss_conf.assoc) ++ memcpy(cmd.range_req_bssid, vif->bss_conf.bssid, ETH_ALEN); ++ else ++ eth_broadcast_addr(cmd.range_req_bssid); ++ + err = iwl_mvm_send_cmd_status(mvm, &hcmd, &status); + if (!err && status) { + IWL_ERR(mvm, "FTM range request command failure, status: %u\n", +@@ -438,34 +305,11 @@ static void iwl_mvm_ftm_get_lci_civic(struct iwl_mvm *mvm, + } + } + +-static int iwl_mvm_ftm_range_resp_valid(struct iwl_mvm *mvm, u8 request_id, +- u8 num_of_aps) +-{ +- lockdep_assert_held(&mvm->mutex); +- +- if (request_id != (u8)mvm->ftm_initiator.req->cookie) { +- IWL_ERR(mvm, "Request ID mismatch, got %u, active %u\n", +- request_id, (u8)mvm->ftm_initiator.req->cookie); +- return -EINVAL; +- } +- +- if (num_of_aps > mvm->ftm_initiator.req->n_peers) { +- IWL_ERR(mvm, "FTM range response invalid\n"); +- return -EINVAL; +- } +- +- return 0; +-} +- + void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) + { + struct iwl_rx_packet *pkt = rxb_addr(rxb); +- struct iwl_tof_range_rsp_ntfy_v5 *fw_resp_v5 = (void *)pkt->data; + struct iwl_tof_range_rsp_ntfy *fw_resp = (void *)pkt->data; + int i; +- bool new_api = fw_has_api(&mvm->fw->ucode_capa, +- IWL_UCODE_TLV_API_FTM_NEW_RANGE_REQ); +- u8 num_of_aps, last_in_batch; + + lockdep_assert_held(&mvm->mutex); + +@@ -474,46 +318,28 @@ void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) + return; + } + +- if (new_api) { +- if (iwl_mvm_ftm_range_resp_valid(mvm, fw_resp->request_id, +- fw_resp->num_of_aps)) +- return; +- +- num_of_aps = fw_resp->num_of_aps; +- last_in_batch = fw_resp->last_report; +- } else { +- if (iwl_mvm_ftm_range_resp_valid(mvm, fw_resp_v5->request_id, +- fw_resp_v5->num_of_aps)) +- return; ++ if (fw_resp->request_id != (u8)mvm->ftm_initiator.req->cookie) { ++ IWL_ERR(mvm, "Request ID mismatch, got %u, active %u\n", ++ fw_resp->request_id, ++ (u8)mvm->ftm_initiator.req->cookie); ++ return; ++ } + +- num_of_aps = fw_resp_v5->num_of_aps; +- last_in_batch = fw_resp_v5->last_in_batch; ++ if (fw_resp->num_of_aps > mvm->ftm_initiator.req->n_peers) { ++ IWL_ERR(mvm, "FTM range response invalid\n"); ++ return; + } + +- for (i = 0; i < num_of_aps && i < IWL_MVM_TOF_MAX_APS; i++) { ++ for (i = 0; i < fw_resp->num_of_aps && i < IWL_MVM_TOF_MAX_APS; i++) { ++ struct iwl_tof_range_rsp_ap_entry_ntfy *fw_ap = &fw_resp->ap[i]; + struct cfg80211_pmsr_result result = {}; +- struct iwl_tof_range_rsp_ap_entry_ntfy *fw_ap; + int peer_idx; + +- if (new_api) { +- fw_ap = &fw_resp->ap[i]; +- result.final = fw_resp->ap[i].last_burst; +- } else { +- /* the first part is the same for old and new APIs */ +- fw_ap = (void *)&fw_resp_v5->ap[i]; +- /* +- * FIXME: the firmware needs to report this, we don't +- * even know the number of bursts the responder picked +- * (if we asked it to) +- */ +- result.final = 0; +- } +- + peer_idx = iwl_mvm_ftm_find_peer(mvm->ftm_initiator.req, + fw_ap->bssid); + if (peer_idx < 0) { + IWL_WARN(mvm, +- "Unknown address (%pM, target #%d) in FTM response\n", ++ "Unknown address (%pM, target #%d) in FTM response.\n", + fw_ap->bssid, i); + continue; + } +@@ -548,6 +374,12 @@ void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) + result.type = NL80211_PMSR_TYPE_FTM; + result.ftm.burst_index = mvm->ftm_initiator.responses[peer_idx]; + mvm->ftm_initiator.responses[peer_idx]++; ++ /* ++ * FIXME: the firmware needs to report this, we don't even know ++ * the number of bursts the responder picked (if we asked ++ * it to) ++ */ ++ result.final = 0; + result.ftm.rssi_avg = fw_ap->rssi; + result.ftm.rssi_avg_valid = 1; + result.ftm.rssi_spread = fw_ap->rssi_spread; +@@ -566,7 +398,7 @@ void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) + &result, GFP_KERNEL); + } + +- if (last_in_batch) { ++ if (fw_resp->last_in_batch) { + cfg80211_pmsr_complete(mvm->ftm_initiator.req_wdev, + mvm->ftm_initiator.req, + GFP_KERNEL); +-- +2.13.6 + diff --git a/SOURCES/0012-Revert-iwlwifi-mvm-support-FTM-initiator.patch b/SOURCES/0012-Revert-iwlwifi-mvm-support-FTM-initiator.patch new file mode 100644 index 0000000..b1f3001 --- /dev/null +++ b/SOURCES/0012-Revert-iwlwifi-mvm-support-FTM-initiator.patch @@ -0,0 +1,706 @@ +From 41894a94e16d1db4a08db235fe74040e7870d201 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 25 Jul 2019 13:53:34 +0200 +Subject: [PATCH 6/7] Revert "iwlwifi: mvm: support FTM initiator" + +This reverts commit fc36ffda326706b21f70a4aff0c77d9bc94c4f0a. +--- + .../net/wireless/intel/iwlwifi/fw/api/location.h | 10 +- + drivers/net/wireless/intel/iwlwifi/mvm/Makefile | 3 +- + drivers/net/wireless/intel/iwlwifi/mvm/constants.h | 1 - + .../net/wireless/intel/iwlwifi/mvm/ftm-initiator.c | 459 --------------------- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 56 +-- + drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 16 - + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 7 - + include/linux/ieee80211.h | 2 - + 8 files changed, 4 insertions(+), 550 deletions(-) + delete mode 100644 drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c + +Index: src/drivers/net/wireless/intel/iwlwifi/fw/api/location.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/api/location.h 2019-07-25 13:55:50.467603040 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/api/location.h 2019-07-25 13:56:03.737424284 +0200 +@@ -7,7 +7,6 @@ + * + * Copyright(c) 2015 - 2017 Intel Deutschland GmbH + * Copyright (C) 2018 Intel Corporation +- * Copyright (C) 2019 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as +@@ -29,7 +28,6 @@ + * + * Copyright(c) 2015 - 2017 Intel Deutschland GmbH + * Copyright (C) 2018 Intel Corporation +- * Copyright (C) 2019 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -405,10 +403,7 @@ + * @IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_A: use antenna A fo TX ACKs during FTM + * @IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_B: use antenna B fo TX ACKs during FTM + * @IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_C: use antenna C fo TX ACKs during FTM +- * @IWL_TOF_INITIATOR_FLAGS_SPECIFIC_CALIB: use the specific calib value from +- * the range request command +- * @IWL_TOF_INITIATOR_FLAGS_COMMON_CALIB: use the common calib value from the +- * ragne request command ++ * @IWL_TOF_INITIATOR_FLAGS_MINDELTA_NO_PREF: no preference for minDeltaFTM + */ + enum iwl_tof_initiator_flags { + IWL_TOF_INITIATOR_FLAGS_FAST_ALGO_DISABLED = BIT(0), +@@ -418,8 +413,7 @@ + IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_A = BIT(4), + IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_B = BIT(5), + IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_C = BIT(6), +- IWL_TOF_INITIATOR_FLAGS_SPECIFIC_CALIB = BIT(15), +- IWL_TOF_INITIATOR_FLAGS_COMMON_CALIB = BIT(16), ++ IWL_TOF_INITIATOR_FLAGS_MINDELTA_NO_PREF = BIT(7), + }; /* LOCATION_RANGE_REQ_CMD_API_S_VER_5 */ + + #define IWL_MVM_TOF_MAX_APS 5 +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/Makefile +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/Makefile 2019-06-27 14:54:04.131678361 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/Makefile 2019-07-25 13:56:03.737424284 +0200 +@@ -4,8 +4,7 @@ + iwlmvm-y += utils.o rx.o rxmq.o tx.o binding.o quota.o sta.o sf.o + iwlmvm-y += scan.o time-event.o rs.o rs-fw.o + iwlmvm-y += power.o coex.o +-iwlmvm-y += tt.o offloading.o tdls.o +-iwlmvm-y += ftm-responder.o ftm-initiator.o ++iwlmvm-y += tt.o offloading.o tdls.o ftm-responder.o + iwlmvm-$(CONFIG_IWLWIFI_DEBUGFS) += debugfs.o debugfs-vif.o + iwlmvm-$(CONFIG_IWLWIFI_LEDS) += led.o + iwlmvm-$(CONFIG_PM) += d3.o +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/constants.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/constants.h 2019-06-27 14:54:04.132678349 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/constants.h 2019-07-25 13:56:03.737424284 +0200 +@@ -65,7 +65,6 @@ + #define __MVM_CONSTANTS_H + + #include +-#include "fw-api.h" + + #define IWL_MVM_UAPSD_NOAGG_BSSIDS_NUM 20 + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c 2019-07-25 13:55:50.468603026 +0200 ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 +@@ -1,459 +0,0 @@ +-/****************************************************************************** +- * +- * This file is provided under a dual BSD/GPLv2 license. When using or +- * redistributing this file, you may do so under either license. +- * +- * GPL LICENSE SUMMARY +- * +- * Copyright(c) 2015 - 2017 Intel Deutschland GmbH +- * Copyright (C) 2018 Intel Corporation +- * Copyright (C) 2019 Intel Corporation +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of version 2 of the GNU General Public License as +- * published by the Free Software Foundation. +- * +- * This program is distributed in the hope that it will be useful, but +- * WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * General Public License for more details. +- * +- * The full GNU General Public License is included in this distribution +- * in the file called COPYING. +- * +- * Contact Information: +- * Intel Linux Wireless +- * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 +- * +- * BSD LICENSE +- * +- * Copyright(c) 2015 - 2017 Intel Deutschland GmbH +- * Copyright (C) 2018 Intel Corporation +- * Copyright (C) 2019 Intel Corporation +- * All rights reserved. +- * +- * Redistribution and use in source and binary forms, with or without +- * modification, are permitted provided that the following conditions +- * are met: +- * +- * * Redistributions of source code must retain the above copyright +- * notice, this list of conditions and the following disclaimer. +- * * Redistributions in binary form must reproduce the above copyright +- * notice, this list of conditions and the following disclaimer in +- * the documentation and/or other materials provided with the +- * distribution. +- * * Neither the name Intel Corporation nor the names of its +- * contributors may be used to endorse or promote products derived +- * from this software without specific prior written permission. +- * +- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- * +- *****************************************************************************/ +-#include +-#include +-#include +-#include "mvm.h" +-#include "iwl-io.h" +-#include "iwl-prph.h" +-#include "constants.h" +- +-struct iwl_mvm_loc_entry { +- struct list_head list; +- u8 addr[ETH_ALEN]; +- u8 lci_len, civic_len; +- u8 buf[]; +-}; +- +-static void iwl_mvm_ftm_reset(struct iwl_mvm *mvm) +-{ +- struct iwl_mvm_loc_entry *e, *t; +- +- mvm->ftm_initiator.req = NULL; +- mvm->ftm_initiator.req_wdev = NULL; +- memset(mvm->ftm_initiator.responses, 0, +- sizeof(mvm->ftm_initiator.responses)); +- list_for_each_entry_safe(e, t, &mvm->ftm_initiator.loc_list, list) { +- list_del(&e->list); +- kfree(e); +- } +-} +- +-void iwl_mvm_ftm_restart(struct iwl_mvm *mvm) +-{ +- struct cfg80211_pmsr_result result = { +- .status = NL80211_PMSR_STATUS_FAILURE, +- .final = 1, +- .host_time = ktime_get_boot_ns(), +- .type = NL80211_PMSR_TYPE_FTM, +- }; +- int i; +- +- lockdep_assert_held(&mvm->mutex); +- +- if (!mvm->ftm_initiator.req) +- return; +- +- for (i = 0; i < mvm->ftm_initiator.req->n_peers; i++) { +- memcpy(result.addr, mvm->ftm_initiator.req->peers[i].addr, +- ETH_ALEN); +- result.ftm.burst_index = mvm->ftm_initiator.responses[i]; +- +- cfg80211_pmsr_report(mvm->ftm_initiator.req_wdev, +- mvm->ftm_initiator.req, +- &result, GFP_KERNEL); +- } +- +- cfg80211_pmsr_complete(mvm->ftm_initiator.req_wdev, +- mvm->ftm_initiator.req, GFP_KERNEL); +- iwl_mvm_ftm_reset(mvm); +-} +- +-static int +-iwl_ftm_range_request_status_to_err(enum iwl_tof_range_request_status s) +-{ +- switch (s) { +- case IWL_TOF_RANGE_REQUEST_STATUS_SUCCESS: +- return 0; +- case IWL_TOF_RANGE_REQUEST_STATUS_BUSY: +- return -EBUSY; +- default: +- WARN_ON_ONCE(1); +- return -EIO; +- } +-} +- +-int iwl_mvm_ftm_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif, +- struct cfg80211_pmsr_request *req) +-{ +- struct iwl_tof_range_req_cmd cmd = { +- .request_id = req->cookie, +- .req_timeout = DIV_ROUND_UP(req->timeout, 100), +- .num_of_ap = req->n_peers, +- /* +- * We treat it always as random, since if not we'll +- * have filled our local address there instead. +- */ +- .macaddr_random = 1, +- }; +- struct iwl_host_cmd hcmd = { +- .id = iwl_cmd_id(TOF_RANGE_REQ_CMD, LOCATION_GROUP, 0), +- .data[0] = &cmd, +- .len[0] = sizeof(cmd), +- .dataflags[0] = IWL_HCMD_DFL_DUP, +- }; +- u32 status = 0; +- int err, i; +- +- /* use maximum for "no timeout" or bigger than what we can do */ +- if (!req->timeout || req->timeout > 255 * 100) +- cmd.req_timeout = 255; +- +- lockdep_assert_held(&mvm->mutex); +- +- if (mvm->ftm_initiator.req) +- return -EBUSY; +- +- memcpy(cmd.macaddr_template, req->mac_addr, ETH_ALEN); +- for (i = 0; i < ETH_ALEN; i++) +- cmd.macaddr_mask[i] = ~req->mac_addr_mask[i]; +- +- for (i = 0; i < cmd.num_of_ap; i++) { +- struct cfg80211_pmsr_request_peer *peer = &req->peers[i]; +- struct iwl_tof_range_req_ap_entry *cmd_target = &cmd.ap[i]; +- u32 freq = peer->chandef.chan->center_freq; +- +- cmd_target->channel_num = ieee80211_frequency_to_channel(freq); +- switch (peer->chandef.width) { +- case NL80211_CHAN_WIDTH_20_NOHT: +- cmd_target->bandwidth = IWL_TOF_BW_20_LEGACY; +- break; +- case NL80211_CHAN_WIDTH_20: +- cmd_target->bandwidth = IWL_TOF_BW_20_HT; +- break; +- case NL80211_CHAN_WIDTH_40: +- cmd_target->bandwidth = IWL_TOF_BW_40; +- break; +- case NL80211_CHAN_WIDTH_80: +- cmd_target->bandwidth = IWL_TOF_BW_80; +- break; +- default: +- IWL_ERR(mvm, "Unsupported BW in FTM request (%d)\n", +- peer->chandef.width); +- return -EINVAL; +- } +- cmd_target->ctrl_ch_position = +- (peer->chandef.width > NL80211_CHAN_WIDTH_20) ? +- iwl_mvm_get_ctrl_pos(&peer->chandef) : 0; +- +- memcpy(cmd_target->bssid, peer->addr, ETH_ALEN); +- cmd_target->measure_type = 0; /* regular two-sided FTM */ +- cmd_target->num_of_bursts = peer->ftm.num_bursts_exp; +- cmd_target->burst_period = +- cpu_to_le16(peer->ftm.burst_period); +- cmd_target->samples_per_burst = peer->ftm.ftms_per_burst; +- cmd_target->retries_per_sample = peer->ftm.ftmr_retries; +- cmd_target->asap_mode = peer->ftm.asap; +- cmd_target->enable_dyn_ack = IWL_MVM_FTM_INITIATOR_DYNACK; +- +- if (peer->ftm.request_lci) +- cmd_target->location_req |= IWL_TOF_LOC_LCI; +- if (peer->ftm.request_civicloc) +- cmd_target->location_req |= IWL_TOF_LOC_CIVIC; +- +- cmd_target->algo_type = IWL_MVM_FTM_INITIATOR_ALGO; +- } +- +- if (vif->bss_conf.assoc) +- memcpy(cmd.range_req_bssid, vif->bss_conf.bssid, ETH_ALEN); +- else +- eth_broadcast_addr(cmd.range_req_bssid); +- +- err = iwl_mvm_send_cmd_status(mvm, &hcmd, &status); +- if (!err && status) { +- IWL_ERR(mvm, "FTM range request command failure, status: %u\n", +- status); +- err = iwl_ftm_range_request_status_to_err(status); +- } +- +- if (!err) { +- mvm->ftm_initiator.req = req; +- mvm->ftm_initiator.req_wdev = ieee80211_vif_to_wdev(vif); +- } +- +- return err; +-} +- +-void iwl_mvm_ftm_abort(struct iwl_mvm *mvm, struct cfg80211_pmsr_request *req) +-{ +- struct iwl_tof_range_abort_cmd cmd = { +- .request_id = req->cookie, +- }; +- +- lockdep_assert_held(&mvm->mutex); +- +- if (req != mvm->ftm_initiator.req) +- return; +- +- if (iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(TOF_RANGE_ABORT_CMD, +- LOCATION_GROUP, 0), +- 0, sizeof(cmd), &cmd)) +- IWL_ERR(mvm, "failed to abort FTM process\n"); +-} +- +-static int iwl_mvm_ftm_find_peer(struct cfg80211_pmsr_request *req, +- const u8 *addr) +-{ +- int i; +- +- for (i = 0; i < req->n_peers; i++) { +- struct cfg80211_pmsr_request_peer *peer = &req->peers[i]; +- +- if (ether_addr_equal_unaligned(peer->addr, addr)) +- return i; +- } +- +- return -ENOENT; +-} +- +-static u64 iwl_mvm_ftm_get_host_time(struct iwl_mvm *mvm, __le32 fw_gp2_ts) +-{ +- u32 gp2_ts = le32_to_cpu(fw_gp2_ts); +- u32 curr_gp2, diff; +- u64 now_from_boot_ns; +- +- iwl_mvm_get_sync_time(mvm, &curr_gp2, &now_from_boot_ns); +- +- if (curr_gp2 >= gp2_ts) +- diff = curr_gp2 - gp2_ts; +- else +- diff = curr_gp2 + (U32_MAX - gp2_ts + 1); +- +- return now_from_boot_ns - (u64)diff * 1000; +-} +- +-static void iwl_mvm_ftm_get_lci_civic(struct iwl_mvm *mvm, +- struct cfg80211_pmsr_result *res) +-{ +- struct iwl_mvm_loc_entry *entry; +- +- list_for_each_entry(entry, &mvm->ftm_initiator.loc_list, list) { +- if (!ether_addr_equal_unaligned(res->addr, entry->addr)) +- continue; +- +- if (entry->lci_len) { +- res->ftm.lci_len = entry->lci_len; +- res->ftm.lci = entry->buf; +- } +- +- if (entry->civic_len) { +- res->ftm.civicloc_len = entry->civic_len; +- res->ftm.civicloc = entry->buf + entry->lci_len; +- } +- +- /* we found the entry we needed */ +- break; +- } +-} +- +-void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) +-{ +- struct iwl_rx_packet *pkt = rxb_addr(rxb); +- struct iwl_tof_range_rsp_ntfy *fw_resp = (void *)pkt->data; +- int i; +- +- lockdep_assert_held(&mvm->mutex); +- +- if (!mvm->ftm_initiator.req) { +- IWL_ERR(mvm, "Got FTM response but have no request?\n"); +- return; +- } +- +- if (fw_resp->request_id != (u8)mvm->ftm_initiator.req->cookie) { +- IWL_ERR(mvm, "Request ID mismatch, got %u, active %u\n", +- fw_resp->request_id, +- (u8)mvm->ftm_initiator.req->cookie); +- return; +- } +- +- if (fw_resp->num_of_aps > mvm->ftm_initiator.req->n_peers) { +- IWL_ERR(mvm, "FTM range response invalid\n"); +- return; +- } +- +- for (i = 0; i < fw_resp->num_of_aps && i < IWL_MVM_TOF_MAX_APS; i++) { +- struct iwl_tof_range_rsp_ap_entry_ntfy *fw_ap = &fw_resp->ap[i]; +- struct cfg80211_pmsr_result result = {}; +- int peer_idx; +- +- peer_idx = iwl_mvm_ftm_find_peer(mvm->ftm_initiator.req, +- fw_ap->bssid); +- if (peer_idx < 0) { +- IWL_WARN(mvm, +- "Unknown address (%pM, target #%d) in FTM response.\n", +- fw_ap->bssid, i); +- continue; +- } +- +- switch (fw_ap->measure_status) { +- case IWL_TOF_ENTRY_SUCCESS: +- result.status = NL80211_PMSR_STATUS_SUCCESS; +- break; +- case IWL_TOF_ENTRY_TIMING_MEASURE_TIMEOUT: +- result.status = NL80211_PMSR_STATUS_TIMEOUT; +- break; +- case IWL_TOF_ENTRY_NO_RESPONSE: +- result.status = NL80211_PMSR_STATUS_FAILURE; +- result.ftm.failure_reason = +- NL80211_PMSR_FTM_FAILURE_NO_RESPONSE; +- break; +- case IWL_TOF_ENTRY_REQUEST_REJECTED: +- result.status = NL80211_PMSR_STATUS_FAILURE; +- result.ftm.failure_reason = +- NL80211_PMSR_FTM_FAILURE_PEER_BUSY; +- result.ftm.busy_retry_time = fw_ap->refusal_period; +- break; +- default: +- result.status = NL80211_PMSR_STATUS_FAILURE; +- result.ftm.failure_reason = +- NL80211_PMSR_FTM_FAILURE_UNSPECIFIED; +- break; +- } +- memcpy(result.addr, fw_ap->bssid, ETH_ALEN); +- result.host_time = iwl_mvm_ftm_get_host_time(mvm, +- fw_ap->timestamp); +- result.type = NL80211_PMSR_TYPE_FTM; +- result.ftm.burst_index = mvm->ftm_initiator.responses[peer_idx]; +- mvm->ftm_initiator.responses[peer_idx]++; +- /* +- * FIXME: the firmware needs to report this, we don't even know +- * the number of bursts the responder picked (if we asked +- * it to) +- */ +- result.final = 0; +- result.ftm.rssi_avg = fw_ap->rssi; +- result.ftm.rssi_avg_valid = 1; +- result.ftm.rssi_spread = fw_ap->rssi_spread; +- result.ftm.rssi_spread_valid = 1; +- result.ftm.rtt_avg = (s32)le32_to_cpu(fw_ap->rtt); +- result.ftm.rtt_avg_valid = 1; +- result.ftm.rtt_variance = le32_to_cpu(fw_ap->rtt_variance); +- result.ftm.rtt_variance_valid = 1; +- result.ftm.rtt_spread = le32_to_cpu(fw_ap->rtt_spread); +- result.ftm.rtt_spread_valid = 1; +- +- iwl_mvm_ftm_get_lci_civic(mvm, &result); +- +- cfg80211_pmsr_report(mvm->ftm_initiator.req_wdev, +- mvm->ftm_initiator.req, +- &result, GFP_KERNEL); +- } +- +- if (fw_resp->last_in_batch) { +- cfg80211_pmsr_complete(mvm->ftm_initiator.req_wdev, +- mvm->ftm_initiator.req, +- GFP_KERNEL); +- iwl_mvm_ftm_reset(mvm); +- } +-} +- +-void iwl_mvm_ftm_lc_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) +-{ +- struct iwl_rx_packet *pkt = rxb_addr(rxb); +- const struct ieee80211_mgmt *mgmt = (void *)pkt->data; +- size_t len = iwl_rx_packet_payload_len(pkt); +- struct iwl_mvm_loc_entry *entry; +- const u8 *ies, *lci, *civic, *msr_ie; +- size_t ies_len, lci_len = 0, civic_len = 0; +- size_t baselen = IEEE80211_MIN_ACTION_SIZE + +- sizeof(mgmt->u.action.u.ftm); +- static const u8 rprt_type_lci = IEEE80211_SPCT_MSR_RPRT_TYPE_LCI; +- static const u8 rprt_type_civic = IEEE80211_SPCT_MSR_RPRT_TYPE_CIVIC; +- +- if (len <= baselen) +- return; +- +- lockdep_assert_held(&mvm->mutex); +- +- ies = mgmt->u.action.u.ftm.variable; +- ies_len = len - baselen; +- +- msr_ie = cfg80211_find_ie_match(WLAN_EID_MEASURE_REPORT, ies, ies_len, +- &rprt_type_lci, 1, 4); +- if (msr_ie) { +- lci = msr_ie + 2; +- lci_len = msr_ie[1]; +- } +- +- msr_ie = cfg80211_find_ie_match(WLAN_EID_MEASURE_REPORT, ies, ies_len, +- &rprt_type_civic, 1, 4); +- if (msr_ie) { +- civic = msr_ie + 2; +- civic_len = msr_ie[1]; +- } +- +- entry = kmalloc(sizeof(*entry) + lci_len + civic_len, GFP_KERNEL); +- if (!entry) +- return; +- +- memcpy(entry->addr, mgmt->bssid, ETH_ALEN); +- +- entry->lci_len = lci_len; +- if (lci_len) +- memcpy(entry->buf, lci, lci_len); +- +- entry->civic_len = civic_len; +- if (civic_len) +- memcpy(entry->buf + lci_len, civic, civic_len); +- +- list_add_tail(&entry->list, &mvm->ftm_initiator.loc_list); +-} +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-07-25 13:34:40.887336660 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-07-25 13:56:03.738424271 +0200 +@@ -184,29 +184,6 @@ + }; + #endif + +-static const struct cfg80211_pmsr_capabilities iwl_mvm_pmsr_capa = { +- .max_peers = IWL_MVM_TOF_MAX_APS, +- .report_ap_tsf = 1, +- .randomize_mac_addr = 1, +- +- .ftm = { +- .supported = 1, +- .asap = 1, +- .non_asap = 1, +- .request_lci = 1, +- .request_civicloc = 1, +- .max_bursts_exponent = -1, /* all supported */ +- .max_ftms_per_burst = 0, /* no limits */ +- .bandwidths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | +- BIT(NL80211_CHAN_WIDTH_20) | +- BIT(NL80211_CHAN_WIDTH_40) | +- BIT(NL80211_CHAN_WIDTH_80), +- .preambles = BIT(NL80211_PREAMBLE_LEGACY) | +- BIT(NL80211_PREAMBLE_HT) | +- BIT(NL80211_PREAMBLE_VHT), +- }, +-}; +- + void iwl_mvm_ref(struct iwl_mvm *mvm, enum iwl_mvm_ref_type ref_type) + { + if (!iwl_mvm_is_d0i3_supported(mvm)) +@@ -573,11 +550,9 @@ + } + + if (fw_has_capa(&mvm->fw->ucode_capa, +- IWL_UCODE_TLV_CAPA_FTM_CALIBRATED)) { ++ IWL_UCODE_TLV_CAPA_FTM_CALIBRATED)) + wiphy_ext_feature_set(hw->wiphy, + NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER); +- hw->wiphy->pmsr_capa = &iwl_mvm_pmsr_capa; +- } + + ieee80211_hw_set(hw, SINGLE_SCAN_ON_ALL_BANDS); + hw->wiphy->features |= +@@ -1220,8 +1195,6 @@ + iwl_mvm_cleanup_roc_te(mvm); + ieee80211_remain_on_channel_expired(mvm->hw); + +- iwl_mvm_ftm_restart(mvm); +- + /* + * cleanup all interfaces, even inactive ones, as some might have + * gone down during the HW restart +@@ -5066,31 +5039,6 @@ + return 0; + } + +-static int iwl_mvm_start_pmsr(struct ieee80211_hw *hw, +- struct ieee80211_vif *vif, +- struct cfg80211_pmsr_request *request) +-{ +- struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); +- int ret; +- +- mutex_lock(&mvm->mutex); +- ret = iwl_mvm_ftm_start(mvm, vif, request); +- mutex_unlock(&mvm->mutex); +- +- return ret; +-} +- +-static void iwl_mvm_abort_pmsr(struct ieee80211_hw *hw, +- struct ieee80211_vif *vif, +- struct cfg80211_pmsr_request *request) +-{ +- struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); +- +- mutex_lock(&mvm->mutex); +- iwl_mvm_ftm_abort(mvm, request); +- mutex_unlock(&mvm->mutex); +-} +- + static bool iwl_mvm_can_hw_csum(struct sk_buff *skb) + { + u8 protocol = ip_hdr(skb)->protocol; +@@ -5196,8 +5144,6 @@ + .get_survey = iwl_mvm_mac_get_survey, + .sta_statistics = iwl_mvm_mac_sta_statistics, + .get_ftm_responder_stats = iwl_mvm_mac_get_ftm_responder_stats, +- .start_pmsr = iwl_mvm_start_pmsr, +- .abort_pmsr = iwl_mvm_abort_pmsr, + + .can_aggregate_in_amsdu = iwl_mvm_mac_can_aggregate, + #ifdef CONFIG_IWLWIFI_DEBUGFS +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-06-27 14:54:04.136678301 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-07-25 13:56:03.739424257 +0200 +@@ -1154,12 +1154,6 @@ + struct ieee80211_cipher_scheme cs[IWL_UCODE_MAX_CS]; + + struct cfg80211_ftm_responder_stats ftm_resp_stats; +- struct { +- struct cfg80211_pmsr_request *req; +- struct wireless_dev *req_wdev; +- struct list_head loc_list; +- int responses[IWL_MVM_TOF_MAX_APS]; +- } ftm_initiator; + + struct ieee80211_vif *nan_vif; + #define IWL_MAX_BAID 32 +@@ -2077,16 +2071,6 @@ + void iwl_mvm_ftm_responder_stats(struct iwl_mvm *mvm, + struct iwl_rx_cmd_buffer *rxb); + +-/* FTM initiator */ +-void iwl_mvm_ftm_restart(struct iwl_mvm *mvm); +-void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, +- struct iwl_rx_cmd_buffer *rxb); +-void iwl_mvm_ftm_lc_notif(struct iwl_mvm *mvm, +- struct iwl_rx_cmd_buffer *rxb); +-int iwl_mvm_ftm_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif, +- struct cfg80211_pmsr_request *request); +-void iwl_mvm_ftm_abort(struct iwl_mvm *mvm, struct cfg80211_pmsr_request *req); +- + /* TDLS */ + + /* +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-07-25 13:55:50.589601396 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-07-25 13:56:03.739424257 +0200 +@@ -302,12 +302,6 @@ + RX_HANDLER_SYNC), + RX_HANDLER_GRP(LOCATION_GROUP, TOF_RESPONDER_STATS, + iwl_mvm_ftm_responder_stats, RX_HANDLER_ASYNC_LOCKED), +- +- RX_HANDLER_GRP(LOCATION_GROUP, TOF_RANGE_RESPONSE_NOTIF, +- iwl_mvm_ftm_range_resp, RX_HANDLER_ASYNC_LOCKED), +- RX_HANDLER_GRP(LOCATION_GROUP, TOF_LC_NOTIF, +- iwl_mvm_ftm_lc_notif, RX_HANDLER_ASYNC_LOCKED), +- + RX_HANDLER_GRP(DEBUG_GROUP, MFU_ASSERT_DUMP_NTF, + iwl_mvm_mfu_assert_dump_notif, RX_HANDLER_SYNC), + RX_HANDLER_GRP(PROT_OFFLOAD_GROUP, STORED_BEACON_NTF, +@@ -706,7 +700,6 @@ + INIT_LIST_HEAD(&mvm->aux_roc_te_list); + INIT_LIST_HEAD(&mvm->async_handlers_list); + spin_lock_init(&mvm->time_event_lock); +- INIT_LIST_HEAD(&mvm->ftm_initiator.loc_list); + + INIT_WORK(&mvm->async_handlers_wk, iwl_mvm_async_handlers_wk); + INIT_WORK(&mvm->roc_done_wk, iwl_mvm_roc_done_wk); diff --git a/SOURCES/0013-Revert-iwlwifi-mvm-support-FTM-responder.patch b/SOURCES/0013-Revert-iwlwifi-mvm-support-FTM-responder.patch new file mode 100644 index 0000000..ae4819d --- /dev/null +++ b/SOURCES/0013-Revert-iwlwifi-mvm-support-FTM-responder.patch @@ -0,0 +1,534 @@ +From 98d3e208e4ec5731aa4a310adfc6d59685e6d6b2 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 25 Jul 2019 13:54:10 +0200 +Subject: [PATCH 7/7] Revert "iwlwifi: mvm: support FTM responder" + +This reverts commit b73f9a4ae77d448eb501f746d3bbe1b737f38681. +--- + drivers/net/wireless/intel/iwlwifi/fw/file.h | 6 - + drivers/net/wireless/intel/iwlwifi/mvm/Makefile | 2 +- + .../net/wireless/intel/iwlwifi/mvm/ftm-responder.c | 244 --------------------- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 92 +------- + drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 9 - + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 2 - + 6 files changed, 5 insertions(+), 350 deletions(-) + delete mode 100644 drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c + +Index: src/drivers/net/wireless/intel/iwlwifi/fw/file.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/file.h 2019-07-25 13:55:50.467603040 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/file.h 2019-07-25 13:56:30.727060711 +0200 +@@ -394,15 +394,12 @@ + * capability. + * @IWL_UCODE_TLV_CAPA_CSI_REPORTING: firmware is capable of being configured + * to report the CSI information with (certain) RX frames +- * @IWL_UCODE_TLV_CAPA_FTM_CALIBRATED: has FTM calibrated and thus supports both +- * initiator and responder + * + * @IWL_UCODE_TLV_CAPA_MLME_OFFLOAD: supports MLME offload + * + * @NUM_IWL_UCODE_TLV_CAPA: number of bits used + */ + enum iwl_ucode_tlv_capa { +- /* set 0 */ + IWL_UCODE_TLV_CAPA_D0I3_SUPPORT = (__force iwl_ucode_tlv_capa_t)0, + IWL_UCODE_TLV_CAPA_LAR_SUPPORT = (__force iwl_ucode_tlv_capa_t)1, + IWL_UCODE_TLV_CAPA_UMAC_SCAN = (__force iwl_ucode_tlv_capa_t)2, +@@ -424,8 +421,6 @@ + IWL_UCODE_TLV_CAPA_LAR_MULTI_MCC = (__force iwl_ucode_tlv_capa_t)29, + IWL_UCODE_TLV_CAPA_BT_COEX_RRC = (__force iwl_ucode_tlv_capa_t)30, + IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT = (__force iwl_ucode_tlv_capa_t)31, +- +- /* set 1 */ + IWL_UCODE_TLV_CAPA_STA_PM_NOTIF = (__force iwl_ucode_tlv_capa_t)38, + IWL_UCODE_TLV_CAPA_BINDING_CDB_SUPPORT = (__force iwl_ucode_tlv_capa_t)39, + IWL_UCODE_TLV_CAPA_CDB_SUPPORT = (__force iwl_ucode_tlv_capa_t)40, +@@ -459,7 +454,6 @@ + IWL_UCODE_TLV_CAPA_MCC_UPDATE_11AX_SUPPORT = (__force iwl_ucode_tlv_capa_t)89, + IWL_UCODE_TLV_CAPA_CSI_REPORTING = (__force iwl_ucode_tlv_capa_t)90, + +- /* set 3 */ + IWL_UCODE_TLV_CAPA_MLME_OFFLOAD = (__force iwl_ucode_tlv_capa_t)96, + + NUM_IWL_UCODE_TLV_CAPA +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/Makefile +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/Makefile 2019-07-25 13:56:03.737424284 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/Makefile 2019-07-25 13:56:30.728060698 +0200 +@@ -4,7 +4,7 @@ + iwlmvm-y += utils.o rx.o rxmq.o tx.o binding.o quota.o sta.o sf.o + iwlmvm-y += scan.o time-event.o rs.o rs-fw.o + iwlmvm-y += power.o coex.o +-iwlmvm-y += tt.o offloading.o tdls.o ftm-responder.o ++iwlmvm-y += tt.o offloading.o tdls.o + iwlmvm-$(CONFIG_IWLWIFI_DEBUGFS) += debugfs.o debugfs-vif.o + iwlmvm-$(CONFIG_IWLWIFI_LEDS) += led.o + iwlmvm-$(CONFIG_PM) += d3.o +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c 2019-06-27 14:54:04.133678337 +0200 ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 +@@ -1,244 +0,0 @@ +-/****************************************************************************** +- * +- * This file is provided under a dual BSD/GPLv2 license. When using or +- * redistributing this file, you may do so under either license. +- * +- * GPL LICENSE SUMMARY +- * +- * Copyright(c) 2015 - 2017 Intel Deutschland GmbH +- * Copyright (C) 2018 Intel Corporation +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of version 2 of the GNU General Public License as +- * published by the Free Software Foundation. +- * +- * This program is distributed in the hope that it will be useful, but +- * WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * General Public License for more details. +- * +- * The full GNU General Public License is included in this distribution +- * in the file called COPYING. +- * +- * Contact Information: +- * Intel Linux Wireless +- * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 +- * +- * BSD LICENSE +- * +- * Copyright(c) 2015 - 2017 Intel Deutschland GmbH +- * Copyright (C) 2018 Intel Corporation +- * All rights reserved. +- * +- * Redistribution and use in source and binary forms, with or without +- * modification, are permitted provided that the following conditions +- * are met: +- * +- * * Redistributions of source code must retain the above copyright +- * notice, this list of conditions and the following disclaimer. +- * * Redistributions in binary form must reproduce the above copyright +- * notice, this list of conditions and the following disclaimer in +- * the documentation and/or other materials provided with the +- * distribution. +- * * Neither the name Intel Corporation nor the names of its +- * contributors may be used to endorse or promote products derived +- * from this software without specific prior written permission. +- * +- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- * +- *****************************************************************************/ +-#include +-#include +-#include "mvm.h" +-#include "constants.h" +- +-static int +-iwl_mvm_ftm_responder_cmd(struct iwl_mvm *mvm, +- struct ieee80211_vif *vif, +- struct cfg80211_chan_def *chandef) +-{ +- struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); +- struct iwl_tof_responder_config_cmd cmd = { +- .channel_num = chandef->chan->hw_value, +- .cmd_valid_fields = +- cpu_to_le32(IWL_TOF_RESPONDER_CMD_VALID_CHAN_INFO | +- IWL_TOF_RESPONDER_CMD_VALID_BSSID | +- IWL_TOF_RESPONDER_CMD_VALID_STA_ID), +- .sta_id = mvmvif->bcast_sta.sta_id, +- }; +- +- lockdep_assert_held(&mvm->mutex); +- +- switch (chandef->width) { +- case NL80211_CHAN_WIDTH_20_NOHT: +- cmd.bandwidth = IWL_TOF_BW_20_LEGACY; +- break; +- case NL80211_CHAN_WIDTH_20: +- cmd.bandwidth = IWL_TOF_BW_20_HT; +- break; +- case NL80211_CHAN_WIDTH_40: +- cmd.bandwidth = IWL_TOF_BW_40; +- cmd.ctrl_ch_position = iwl_mvm_get_ctrl_pos(chandef); +- break; +- case NL80211_CHAN_WIDTH_80: +- cmd.bandwidth = IWL_TOF_BW_80; +- cmd.ctrl_ch_position = iwl_mvm_get_ctrl_pos(chandef); +- break; +- default: +- WARN_ON(1); +- return -EINVAL; +- } +- +- memcpy(cmd.bssid, vif->addr, ETH_ALEN); +- +- return iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(TOF_RESPONDER_CONFIG_CMD, +- LOCATION_GROUP, 0), +- 0, sizeof(cmd), &cmd); +-} +- +-static int +-iwl_mvm_ftm_responder_dyn_cfg_cmd(struct iwl_mvm *mvm, +- struct ieee80211_vif *vif, +- struct ieee80211_ftm_responder_params *params) +-{ +- struct iwl_tof_responder_dyn_config_cmd cmd = { +- .lci_len = cpu_to_le32(params->lci_len + 2), +- .civic_len = cpu_to_le32(params->civicloc_len + 2), +- }; +- u8 data[IWL_LCI_CIVIC_IE_MAX_SIZE] = {0}; +- struct iwl_host_cmd hcmd = { +- .id = iwl_cmd_id(TOF_RESPONDER_DYN_CONFIG_CMD, +- LOCATION_GROUP, 0), +- .data[0] = &cmd, +- .len[0] = sizeof(cmd), +- .data[1] = &data, +- /* .len[1] set later */ +- /* may not be able to DMA from stack */ +- .dataflags[1] = IWL_HCMD_DFL_DUP, +- }; +- u32 aligned_lci_len = ALIGN(params->lci_len + 2, 4); +- u32 aligned_civicloc_len = ALIGN(params->civicloc_len + 2, 4); +- u8 *pos = data; +- +- lockdep_assert_held(&mvm->mutex); +- +- if (aligned_lci_len + aligned_civicloc_len > sizeof(data)) { +- IWL_ERR(mvm, "LCI/civicloc data too big (%zd + %zd)\n", +- params->lci_len, params->civicloc_len); +- return -ENOBUFS; +- } +- +- pos[0] = WLAN_EID_MEASURE_REPORT; +- pos[1] = params->lci_len; +- memcpy(pos + 2, params->lci, params->lci_len); +- +- pos += aligned_lci_len; +- pos[0] = WLAN_EID_MEASURE_REPORT; +- pos[1] = params->civicloc_len; +- memcpy(pos + 2, params->civicloc, params->civicloc_len); +- +- hcmd.len[1] = aligned_lci_len + aligned_civicloc_len; +- +- return iwl_mvm_send_cmd(mvm, &hcmd); +-} +- +-int iwl_mvm_ftm_start_responder(struct iwl_mvm *mvm, struct ieee80211_vif *vif) +-{ +- struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); +- struct ieee80211_ftm_responder_params *params; +- struct ieee80211_chanctx_conf ctx, *pctx; +- u16 *phy_ctxt_id; +- struct iwl_mvm_phy_ctxt *phy_ctxt; +- int ret; +- +- params = vif->bss_conf.ftmr_params; +- +- lockdep_assert_held(&mvm->mutex); +- +- if (WARN_ON_ONCE(!vif->bss_conf.ftm_responder)) +- return -EINVAL; +- +- if (vif->p2p || vif->type != NL80211_IFTYPE_AP || +- !mvmvif->ap_ibss_active) { +- IWL_ERR(mvm, "Cannot start responder, not in AP mode\n"); +- return -EIO; +- } +- +- rcu_read_lock(); +- pctx = rcu_dereference(vif->chanctx_conf); +- /* Copy the ctx to unlock the rcu and send the phy ctxt. We don't care +- * about changes in the ctx after releasing the lock because the driver +- * is still protected by the mutex. */ +- ctx = *pctx; +- phy_ctxt_id = (u16 *)pctx->drv_priv; +- rcu_read_unlock(); +- +- phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id]; +- ret = iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &ctx.def, +- ctx.rx_chains_static, +- ctx.rx_chains_dynamic); +- if (ret) +- return ret; +- +- ret = iwl_mvm_ftm_responder_cmd(mvm, vif, &ctx.def); +- if (ret) +- return ret; +- +- if (params) +- ret = iwl_mvm_ftm_responder_dyn_cfg_cmd(mvm, vif, params); +- +- return ret; +-} +- +-void iwl_mvm_ftm_restart_responder(struct iwl_mvm *mvm, +- struct ieee80211_vif *vif) +-{ +- if (!vif->bss_conf.ftm_responder) +- return; +- +- iwl_mvm_ftm_start_responder(mvm, vif); +-} +- +-void iwl_mvm_ftm_responder_stats(struct iwl_mvm *mvm, +- struct iwl_rx_cmd_buffer *rxb) +-{ +- struct iwl_rx_packet *pkt = rxb_addr(rxb); +- struct iwl_ftm_responder_stats *resp = (void *)pkt->data; +- struct cfg80211_ftm_responder_stats *stats = &mvm->ftm_resp_stats; +- u32 flags = le32_to_cpu(resp->flags); +- +- if (resp->success_ftm == resp->ftm_per_burst) +- stats->success_num++; +- else if (resp->success_ftm >= 2) +- stats->partial_num++; +- else +- stats->failed_num++; +- +- if ((flags & FTM_RESP_STAT_ASAP_REQ) && +- (flags & FTM_RESP_STAT_ASAP_RESP)) +- stats->asap_num++; +- +- if (flags & FTM_RESP_STAT_NON_ASAP_RESP) +- stats->non_asap_num++; +- +- stats->total_duration_ms += le32_to_cpu(resp->duration) / USEC_PER_MSEC; +- +- if (flags & FTM_RESP_STAT_TRIGGER_UNKNOWN) +- stats->unknown_triggers_num++; +- +- if (flags & FTM_RESP_STAT_DUP) +- stats->reschedule_requests_num++; +- +- if (flags & FTM_RESP_STAT_NON_ASAP_OUT_WIN) +- stats->out_of_window_triggers_num++; +-} +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-07-25 13:56:03.738424271 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-07-25 13:56:30.729060684 +0200 +@@ -549,11 +549,6 @@ + hw->wiphy->n_cipher_suites++; + } + +- if (fw_has_capa(&mvm->fw->ucode_capa, +- IWL_UCODE_TLV_CAPA_FTM_CALIBRATED)) +- wiphy_ext_feature_set(hw->wiphy, +- NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER); +- + ieee80211_hw_set(hw, SINGLE_SCAN_ON_ALL_BANDS); + hw->wiphy->features |= + NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR | +@@ -1760,9 +1755,6 @@ + IEEE80211_VIF_SUPPORTS_CQM_RSSI); + } + +- if (vif->bss_conf.ftm_responder) +- memset(&mvm->ftm_resp_stats, 0, sizeof(mvm->ftm_resp_stats)); +- + iwl_mvm_vif_dbgfs_clean(mvm, vif); + + /* +@@ -2711,8 +2703,6 @@ + if (iwl_mvm_phy_ctx_count(mvm) > 1) + iwl_mvm_teardown_tdls_peers(mvm); + +- iwl_mvm_ftm_restart_responder(mvm, vif); +- + goto out_unlock; + + out_quota_failed: +@@ -2821,15 +2811,6 @@ + bss_conf->txpower); + iwl_mvm_set_tx_power(mvm, vif, bss_conf->txpower); + } +- +- if (changes & BSS_CHANGED_FTM_RESPONDER) { +- int ret = iwl_mvm_ftm_start_responder(mvm, vif); +- +- if (ret) +- IWL_WARN(mvm, "Failed to enable FTM responder (%d)\n", +- ret); +- } +- + } + + static void iwl_mvm_bss_info_changed(struct ieee80211_hw *hw, +@@ -3950,43 +3931,11 @@ + return 0; + } + +-struct iwl_mvm_ftm_responder_iter_data { +- bool responder; +- struct ieee80211_chanctx_conf *ctx; +-}; +- +-static void iwl_mvm_ftm_responder_chanctx_iter(void *_data, u8 *mac, +- struct ieee80211_vif *vif) +-{ +- struct iwl_mvm_ftm_responder_iter_data *data = _data; +- +- if (rcu_access_pointer(vif->chanctx_conf) == data->ctx && +- vif->type == NL80211_IFTYPE_AP && vif->bss_conf.ftmr_params) +- data->responder = true; +-} +- +-static bool iwl_mvm_is_ftm_responder_chanctx(struct iwl_mvm *mvm, +- struct ieee80211_chanctx_conf *ctx) +-{ +- struct iwl_mvm_ftm_responder_iter_data data = { +- .responder = false, +- .ctx = ctx, +- }; +- +- ieee80211_iterate_active_interfaces_atomic(mvm->hw, +- IEEE80211_IFACE_ITER_NORMAL, +- iwl_mvm_ftm_responder_chanctx_iter, +- &data); +- return data.responder; +-} +- + static int __iwl_mvm_add_chanctx(struct iwl_mvm *mvm, + struct ieee80211_chanctx_conf *ctx) + { + u16 *phy_ctxt_id = (u16 *)ctx->drv_priv; + struct iwl_mvm_phy_ctxt *phy_ctxt; +- bool responder = iwl_mvm_is_ftm_responder_chanctx(mvm, ctx); +- struct cfg80211_chan_def *def = responder ? &ctx->def : &ctx->min_def; + int ret; + + lockdep_assert_held(&mvm->mutex); +@@ -3999,7 +3948,7 @@ + goto out; + } + +- ret = iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, def, ++ ret = iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &ctx->min_def, + ctx->rx_chains_static, + ctx->rx_chains_dynamic); + if (ret) { +@@ -4054,8 +4003,6 @@ + struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); + u16 *phy_ctxt_id = (u16 *)ctx->drv_priv; + struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id]; +- bool responder = iwl_mvm_is_ftm_responder_chanctx(mvm, ctx); +- struct cfg80211_chan_def *def = responder ? &ctx->def : &ctx->min_def; + + if (WARN_ONCE((phy_ctxt->ref > 1) && + (changed & ~(IEEE80211_CHANCTX_CHANGE_WIDTH | +@@ -4070,17 +4017,17 @@ + + /* we are only changing the min_width, may be a noop */ + if (changed == IEEE80211_CHANCTX_CHANGE_MIN_WIDTH) { +- if (phy_ctxt->width == def->width) ++ if (phy_ctxt->width == ctx->min_def.width) + goto out_unlock; + + /* we are just toggling between 20_NOHT and 20 */ + if (phy_ctxt->width <= NL80211_CHAN_WIDTH_20 && +- def->width <= NL80211_CHAN_WIDTH_20) ++ ctx->min_def.width <= NL80211_CHAN_WIDTH_20) + goto out_unlock; + } + + iwl_mvm_bt_coex_vif_change(mvm); +- iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, def, ++ iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &ctx->min_def, + ctx->rx_chains_static, + ctx->rx_chains_dynamic); + +@@ -5010,35 +4957,6 @@ + mutex_unlock(&mvm->mutex); + } + +-static int +-iwl_mvm_mac_get_ftm_responder_stats(struct ieee80211_hw *hw, +- struct ieee80211_vif *vif, +- struct cfg80211_ftm_responder_stats *stats) +-{ +- struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); +- struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); +- +- if (vif->p2p || vif->type != NL80211_IFTYPE_AP || +- !mvmvif->ap_ibss_active || !vif->bss_conf.ftm_responder) +- return -EINVAL; +- +- mutex_lock(&mvm->mutex); +- *stats = mvm->ftm_resp_stats; +- mutex_unlock(&mvm->mutex); +- +- stats->filled = BIT(NL80211_FTM_STATS_SUCCESS_NUM) | +- BIT(NL80211_FTM_STATS_PARTIAL_NUM) | +- BIT(NL80211_FTM_STATS_FAILED_NUM) | +- BIT(NL80211_FTM_STATS_ASAP_NUM) | +- BIT(NL80211_FTM_STATS_NON_ASAP_NUM) | +- BIT(NL80211_FTM_STATS_TOTAL_DURATION_MSEC) | +- BIT(NL80211_FTM_STATS_UNKNOWN_TRIGGERS_NUM) | +- BIT(NL80211_FTM_STATS_RESCHEDULE_REQUESTS_NUM) | +- BIT(NL80211_FTM_STATS_OUT_OF_WINDOW_TRIGGERS_NUM); +- +- return 0; +-} +- + static bool iwl_mvm_can_hw_csum(struct sk_buff *skb) + { + u8 protocol = ip_hdr(skb)->protocol; +@@ -5143,8 +5061,6 @@ + #endif + .get_survey = iwl_mvm_mac_get_survey, + .sta_statistics = iwl_mvm_mac_sta_statistics, +- .get_ftm_responder_stats = iwl_mvm_mac_get_ftm_responder_stats, +- + .can_aggregate_in_amsdu = iwl_mvm_mac_can_aggregate, + #ifdef CONFIG_IWLWIFI_DEBUGFS + .sta_add_debugfs = iwl_mvm_sta_add_debugfs, +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-07-25 13:56:03.739424257 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-07-25 13:56:30.730060671 +0200 +@@ -1153,8 +1153,6 @@ + u32 ciphers[IWL_MVM_NUM_CIPHERS]; + struct ieee80211_cipher_scheme cs[IWL_UCODE_MAX_CS]; + +- struct cfg80211_ftm_responder_stats ftm_resp_stats; +- + struct ieee80211_vif *nan_vif; + #define IWL_MAX_BAID 32 + struct iwl_mvm_baid_data __rcu *baid_map[IWL_MAX_BAID]; +@@ -2064,13 +2062,6 @@ + int iwl_mvm_sf_update(struct iwl_mvm *mvm, struct ieee80211_vif *vif, + bool added_vif); + +-/* FTM responder */ +-int iwl_mvm_ftm_start_responder(struct iwl_mvm *mvm, struct ieee80211_vif *vif); +-void iwl_mvm_ftm_restart_responder(struct iwl_mvm *mvm, +- struct ieee80211_vif *vif); +-void iwl_mvm_ftm_responder_stats(struct iwl_mvm *mvm, +- struct iwl_rx_cmd_buffer *rxb); +- + /* TDLS */ + + /* +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-07-25 13:56:03.739424257 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-07-25 13:56:30.731060658 +0200 +@@ -300,8 +300,6 @@ + RX_HANDLER_ASYNC_LOCKED), + RX_HANDLER(MFUART_LOAD_NOTIFICATION, iwl_mvm_rx_mfuart_notif, + RX_HANDLER_SYNC), +- RX_HANDLER_GRP(LOCATION_GROUP, TOF_RESPONDER_STATS, +- iwl_mvm_ftm_responder_stats, RX_HANDLER_ASYNC_LOCKED), + RX_HANDLER_GRP(DEBUG_GROUP, MFU_ASSERT_DUMP_NTF, + iwl_mvm_mfu_assert_dump_notif, RX_HANDLER_SYNC), + RX_HANDLER_GRP(PROT_OFFLOAD_GROUP, STORED_BEACON_NTF, diff --git a/SOURCES/0014-Revert-iwlwifi-mvm-support-HE-context-cmd-API-change.patch b/SOURCES/0014-Revert-iwlwifi-mvm-support-HE-context-cmd-API-change.patch new file mode 100644 index 0000000..a33072a --- /dev/null +++ b/SOURCES/0014-Revert-iwlwifi-mvm-support-HE-context-cmd-API-change.patch @@ -0,0 +1,163 @@ +From 77ecb39916fce76f52040bfb5ef278c4f11b7aa7 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 25 Jul 2019 14:43:25 +0200 +Subject: [PATCH 1/3] Revert "iwlwifi: mvm: support HE context cmd API change" + +This reverts commit d14ae796f8498933fb4437efe83f7b3423b1793f. +--- + drivers/net/wireless/intel/iwlwifi/fw/api/mac.h | 77 +---------------------- + drivers/net/wireless/intel/iwlwifi/fw/file.h | 2 - + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 12 +--- + 3 files changed, 2 insertions(+), 89 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/fw/api/mac.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/api/mac.h 2019-07-25 13:58:41.795295113 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/api/mac.h 2019-07-25 14:52:00.107779877 +0200 +@@ -520,66 +520,6 @@ + #define IWL_HE_HTC_LINK_ADAP_BOTH (3 << IWL_HE_HTC_LINK_ADAP_POS) + + /** +- * struct iwl_he_sta_context_cmd_v1 - configure FW to work with HE AP +- * @sta_id: STA id +- * @tid_limit: max num of TIDs in TX HE-SU multi-TID agg +- * 0 - bad value, 1 - multi-tid not supported, 2..8 - tid limit +- * @reserved1: reserved byte for future use +- * @reserved2: reserved byte for future use +- * @flags: see %iwl_11ax_sta_ctxt_flags +- * @ref_bssid_addr: reference BSSID used by the AP +- * @reserved0: reserved 2 bytes for aligning the ref_bssid_addr field to 8 bytes +- * @htc_flags: which features are supported in HTC +- * @frag_flags: frag support in A-MSDU +- * @frag_level: frag support level +- * @frag_max_num: max num of "open" MSDUs in the receiver (in power of 2) +- * @frag_min_size: min frag size (except last frag) +- * @pkt_ext: optional, exists according to PPE-present bit in the HE-PHY capa +- * @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame +- * @htc_trig_based_pkt_ext: default PE in 4us units +- * @frame_time_rts_th: HE duration RTS threshold, in units of 32us +- * @rand_alloc_ecwmin: random CWmin = 2**ECWmin-1 +- * @rand_alloc_ecwmax: random CWmax = 2**ECWmax-1 +- * @reserved3: reserved byte for future use +- * @trig_based_txf: MU EDCA Parameter set for the trigger based traffic queues +- */ +-struct iwl_he_sta_context_cmd_v1 { +- u8 sta_id; +- u8 tid_limit; +- u8 reserved1; +- u8 reserved2; +- __le32 flags; +- +- /* The below fields are set via Multiple BSSID IE */ +- u8 ref_bssid_addr[6]; +- __le16 reserved0; +- +- /* The below fields are set via HE-capabilities IE */ +- __le32 htc_flags; +- +- u8 frag_flags; +- u8 frag_level; +- u8 frag_max_num; +- u8 frag_min_size; +- +- /* The below fields are set via PPE thresholds element */ +- struct iwl_he_pkt_ext pkt_ext; +- +- /* The below fields are set via HE-Operation IE */ +- u8 bss_color; +- u8 htc_trig_based_pkt_ext; +- __le16 frame_time_rts_th; +- +- /* Random access parameter set (i.e. RAPS) */ +- u8 rand_alloc_ecwmin; +- u8 rand_alloc_ecwmax; +- __le16 reserved3; +- +- /* The below fields are set via MU EDCA parameter set element */ +- struct iwl_he_backoff_conf trig_based_txf[AC_NUM]; +-} __packed; /* STA_CONTEXT_DOT11AX_API_S_VER_1 */ +- +-/** + * struct iwl_he_sta_context_cmd - configure FW to work with HE AP + * @sta_id: STA id + * @tid_limit: max num of TIDs in TX HE-SU multi-TID agg +@@ -602,14 +542,6 @@ + * @rand_alloc_ecwmax: random CWmax = 2**ECWmax-1 + * @reserved3: reserved byte for future use + * @trig_based_txf: MU EDCA Parameter set for the trigger based traffic queues +- * @max_bssid_indicator: indicator of the max bssid supported on the associated +- * bss +- * @bssid_index: index of the associated VAP +- * @ema_ap: AP supports enhanced Multi BSSID advertisement +- * @profile_periodicity: number of Beacon periods that are needed to receive the +- * complete VAPs info +- * @bssid_count: actual number of VAPs in the MultiBSS Set +- * @reserved4: alignment + */ + struct iwl_he_sta_context_cmd { + u8 sta_id; +@@ -645,14 +577,7 @@ + + /* The below fields are set via MU EDCA parameter set element */ + struct iwl_he_backoff_conf trig_based_txf[AC_NUM]; +- +- u8 max_bssid_indicator; +- u8 bssid_index; +- u8 ema_ap; +- u8 profile_periodicity; +- u8 bssid_count; +- u8 reserved4[3]; +-} __packed; /* STA_CONTEXT_DOT11AX_API_S_VER_2 */ ++} __packed; /* STA_CONTEXT_DOT11AX_API_S */ + + /** + * struct iwl_he_monitor_cmd - configure air sniffer for HE +Index: src/drivers/net/wireless/intel/iwlwifi/fw/file.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/file.h 2019-07-25 13:58:42.137290506 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/file.h 2019-07-25 14:52:00.108779863 +0200 +@@ -282,8 +282,6 @@ + * @IWL_UCODE_TLV_API_SCAN_OFFLOAD_CHANS: This ucode supports v2 of + * SCAN_OFFLOAD_PROFILE_MATCH_RESULTS_S and v3 of + * SCAN_OFFLOAD_PROFILES_QUERY_RSP_S. +- * @IWL_UCODE_TLV_API_MBSSID_HE: This ucode supports v2 of +- * STA_CONTEXT_DOT11AX_API_S + * + * @NUM_IWL_UCODE_TLV_API: number of bits used + */ +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-07-25 13:58:42.139290479 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-07-25 14:52:00.109779849 +0200 +@@ -2182,10 +2182,6 @@ + .frame_time_rts_th = + cpu_to_le16(vif->bss_conf.frame_time_rts_th), + }; +- int size = fw_has_api(&mvm->fw->ucode_capa, +- IWL_UCODE_TLV_API_MBSSID_HE) ? +- sizeof(sta_ctxt_cmd) : +- sizeof(struct iwl_he_sta_context_cmd_v1); + struct ieee80211_sta *sta; + u32 flags; + int i; +@@ -2371,19 +2367,13 @@ + flags |= STA_CTXT_HE_REF_BSSID_VALID; + ether_addr_copy(sta_ctxt_cmd.ref_bssid_addr, + vif->bss_conf.transmitter_bssid); +- sta_ctxt_cmd.max_bssid_indicator = +- vif->bss_conf.bssid_indicator; +- sta_ctxt_cmd.bssid_index = vif->bss_conf.bssid_index; +- sta_ctxt_cmd.ema_ap = vif->bss_conf.ema_ap; +- sta_ctxt_cmd.profile_periodicity = +- vif->bss_conf.profile_periodicity; + } + + sta_ctxt_cmd.flags = cpu_to_le32(flags); + + if (iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(STA_HE_CTXT_CMD, + DATA_PATH_GROUP, 0), +- 0, size, &sta_ctxt_cmd)) ++ 0, sizeof(sta_ctxt_cmd), &sta_ctxt_cmd)) + IWL_ERR(mvm, "Failed to config FW to work HE!\n"); + } + diff --git a/SOURCES/0015-Revert-iwlwifi-mvm-support-multiple-BSSID.patch b/SOURCES/0015-Revert-iwlwifi-mvm-support-multiple-BSSID.patch new file mode 100644 index 0000000..a0077a3 --- /dev/null +++ b/SOURCES/0015-Revert-iwlwifi-mvm-support-multiple-BSSID.patch @@ -0,0 +1,45 @@ +From c852a74acaa2d2595752b5110c9e49ce49fc137e Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 25 Jul 2019 14:49:22 +0200 +Subject: [PATCH 2/3] Revert "iwlwifi: mvm: support multiple BSSID" + +This reverts commit 918cbf39ac008b8079748a04be69930068c7c7c5. +--- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 10 +--------- + 1 file changed, 1 insertion(+), 9 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-07-25 14:52:00.109779849 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-07-25 14:52:10.765633766 +0200 +@@ -397,7 +397,6 @@ + + const static u8 he_if_types_ext_capa_sta[] = { + [0] = WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING, +- [2] = WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT, + [7] = WLAN_EXT_CAPA8_OPMODE_NOTIF, + [9] = WLAN_EXT_CAPA10_TWT_REQUESTER_SUPPORT, + }; +@@ -706,9 +705,6 @@ + hw->wiphy->iftype_ext_capab = he_iftypes_ext_capa; + hw->wiphy->num_iftype_ext_capab = + ARRAY_SIZE(he_iftypes_ext_capa); +- +- ieee80211_hw_set(hw, SUPPORTS_MULTI_BSSID); +- ieee80211_hw_set(hw, SUPPORTS_ONLY_HE_MULTI_BSSID); + } + + mvm->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD; +@@ -2363,11 +2359,7 @@ + (vif->bss_conf.uora_ocw_range >> 3) & 0x7; + } + +- if (vif->bss_conf.nontransmitted) { +- flags |= STA_CTXT_HE_REF_BSSID_VALID; +- ether_addr_copy(sta_ctxt_cmd.ref_bssid_addr, +- vif->bss_conf.transmitter_bssid); +- } ++ /* TODO: support Multi BSSID IE */ + + sta_ctxt_cmd.flags = cpu_to_le32(flags); + diff --git a/SOURCES/0016-Revert-iwlwifi-mvm-advertise-support-for-TWT-in-the-.patch b/SOURCES/0016-Revert-iwlwifi-mvm-advertise-support-for-TWT-in-the-.patch new file mode 100644 index 0000000..e906802 --- /dev/null +++ b/SOURCES/0016-Revert-iwlwifi-mvm-advertise-support-for-TWT-in-the-.patch @@ -0,0 +1,66 @@ +From b51d74dc1f62cae3bbc1ac9549bcf0a958d44847 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 25 Jul 2019 14:51:22 +0200 +Subject: [PATCH 3/3] Revert "iwlwifi: mvm: advertise support for TWT in the + Extended Capability IE" + +This reverts commit 7360f99e0b99e325ae945eb39a3407215403d4d2. +--- + drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 3 ++- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 22 ---------------------- + 2 files changed, 2 insertions(+), 23 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-07-25 13:58:41.795295113 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-07-25 14:52:20.098505819 +0200 +@@ -587,7 +587,8 @@ + .has_he = true, + .he_cap_elem = { + .mac_cap_info[0] = +- IEEE80211_HE_MAC_CAP0_HTC_HE, ++ IEEE80211_HE_MAC_CAP0_HTC_HE | ++ IEEE80211_HE_MAC_CAP0_TWT_RES, + .mac_cap_info[1] = + IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US | + IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8, +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-07-25 14:52:10.765633766 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-07-25 14:52:20.099505805 +0200 +@@ -395,21 +395,6 @@ + return ret; + } + +-const static u8 he_if_types_ext_capa_sta[] = { +- [0] = WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING, +- [7] = WLAN_EXT_CAPA8_OPMODE_NOTIF, +- [9] = WLAN_EXT_CAPA10_TWT_REQUESTER_SUPPORT, +-}; +- +-const static struct wiphy_iftype_ext_capab he_iftypes_ext_capa[] = { +- { +- .iftype = NL80211_IFTYPE_STATION, +- .extended_capabilities = he_if_types_ext_capa_sta, +- .extended_capabilities_mask = he_if_types_ext_capa_sta, +- .extended_capabilities_len = sizeof(he_if_types_ext_capa_sta), +- }, +-}; +- + int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) + { + struct ieee80211_hw *hw = mvm->hw; +@@ -700,13 +685,6 @@ + NL80211_EXT_FEATURE_OCE_PROBE_REQ_HIGH_TX_RATE); + } + +- if (mvm->nvm_data->sku_cap_11ax_enable && +- !iwlwifi_mod_params.disable_11ax) { +- hw->wiphy->iftype_ext_capab = he_iftypes_ext_capa; +- hw->wiphy->num_iftype_ext_capab = +- ARRAY_SIZE(he_iftypes_ext_capa); +- } +- + mvm->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD; + + #ifdef CONFIG_PM_SLEEP diff --git a/SOURCES/0017-Revert-iwlwifi-mvm-limit-AMSDU-size-to-8K.patch b/SOURCES/0017-Revert-iwlwifi-mvm-limit-AMSDU-size-to-8K.patch new file mode 100644 index 0000000..9c41219 --- /dev/null +++ b/SOURCES/0017-Revert-iwlwifi-mvm-limit-AMSDU-size-to-8K.patch @@ -0,0 +1,31 @@ +From 1f907a5638fe2bb8d4f23c258e89bf2527070a02 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 25 Jul 2019 15:35:52 +0200 +Subject: [PATCH 1/7] Revert "iwlwifi: mvm: limit AMSDU size to 8K" + +This reverts commit 679bff239f51388a61a3cb4a512bc3a1d6e66d74. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rs.c | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rs.c b/drivers/net/wireless/intel/iwlwifi/mvm/rs.c +index 63fdb4e68e9d..fb56b84bd088 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/rs.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/rs.c +@@ -1764,12 +1764,7 @@ static void rs_set_amsdu_len(struct iwl_mvm *mvm, struct ieee80211_sta *sta, + else + mvmsta->amsdu_enabled = 0xFFFF; + +- if (mvmsta->vif->bss_conf.he_support && +- !iwlwifi_mod_params.disable_11ax) +- mvmsta->max_amsdu_len = sta->max_amsdu_len; +- else +- mvmsta->max_amsdu_len = min_t(int, sta->max_amsdu_len, 8500); +- ++ mvmsta->max_amsdu_len = sta->max_amsdu_len; + sta->max_rc_amsdu_len = mvmsta->max_amsdu_len; + + for (i = 0; i < IWL_MAX_TID_COUNT; i++) { +-- +2.13.6 + diff --git a/SOURCES/0018-Revert-iwlwifi-mvm-bring-back-mvm-GSO-code.patch b/SOURCES/0018-Revert-iwlwifi-mvm-bring-back-mvm-GSO-code.patch new file mode 100644 index 0000000..2efcb50 --- /dev/null +++ b/SOURCES/0018-Revert-iwlwifi-mvm-bring-back-mvm-GSO-code.patch @@ -0,0 +1,275 @@ +From 3aa78b629f25d741b8cfe9af2b982b34078e098a Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 25 Jul 2019 15:37:32 +0200 +Subject: [PATCH 2/7] Revert "iwlwifi: mvm: bring back mvm GSO code" + +This reverts commit 08f7d8b69aaf137db8ee0a2d7c9e6cd6383ae250. +--- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 1 + + drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 224 +--------------------- + 2 files changed, 2 insertions(+), 223 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +index 471d83facb4a..b75ec60aa3d6 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +@@ -739,6 +739,7 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) + } + + hw->netdev_features |= mvm->cfg->features; ++ hw->netdev_features &= ~(NETIF_F_TSO | NETIF_F_TSO6); + if (!iwl_mvm_is_csum_supported(mvm)) { + hw->netdev_features &= ~(IWL_TX_CSUM_NETIF_FLAGS | + NETIF_F_RXCSUM); +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c +index 0c2aabc842f9..43d29335db57 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c +@@ -814,197 +814,6 @@ unsigned int iwl_mvm_max_amsdu_size(struct iwl_mvm *mvm, + mvm->fwrt.smem_cfg.lmac[lmac].txfifo_size[txf] - 256); + } + +-#ifdef CONFIG_INET +- +-static int +-iwl_mvm_tx_tso_segment(struct sk_buff *skb, unsigned int num_subframes, +- netdev_features_t netdev_flags, +- struct sk_buff_head *mpdus_skb) +-{ +- struct sk_buff *tmp, *next; +- struct ieee80211_hdr *hdr = (void *)skb->data; +- char cb[sizeof(skb->cb)]; +- u16 i = 0; +- unsigned int tcp_payload_len; +- unsigned int mss = skb_shinfo(skb)->gso_size; +- bool ipv4 = (skb->protocol == htons(ETH_P_IP)); +- u16 ip_base_id = ipv4 ? ntohs(ip_hdr(skb)->id) : 0; +- +- skb_shinfo(skb)->gso_size = num_subframes * mss; +- memcpy(cb, skb->cb, sizeof(cb)); +- +- next = skb_gso_segment(skb, netdev_flags); +- skb_shinfo(skb)->gso_size = mss; +- if (WARN_ON_ONCE(IS_ERR(next))) +- return -EINVAL; +- else if (next) +- consume_skb(skb); +- +- while (next) { +- tmp = next; +- next = tmp->next; +- +- memcpy(tmp->cb, cb, sizeof(tmp->cb)); +- /* +- * Compute the length of all the data added for the A-MSDU. +- * This will be used to compute the length to write in the TX +- * command. We have: SNAP + IP + TCP for n -1 subframes and +- * ETH header for n subframes. +- */ +- tcp_payload_len = skb_tail_pointer(tmp) - +- skb_transport_header(tmp) - +- tcp_hdrlen(tmp) + tmp->data_len; +- +- if (ipv4) +- ip_hdr(tmp)->id = htons(ip_base_id + i * num_subframes); +- +- if (tcp_payload_len > mss) { +- skb_shinfo(tmp)->gso_size = mss; +- } else { +- if (ieee80211_is_data_qos(hdr->frame_control)) { +- u8 *qc; +- +- if (ipv4) +- ip_send_check(ip_hdr(tmp)); +- +- qc = ieee80211_get_qos_ctl((void *)tmp->data); +- *qc &= ~IEEE80211_QOS_CTL_A_MSDU_PRESENT; +- } +- skb_shinfo(tmp)->gso_size = 0; +- } +- +- tmp->prev = NULL; +- tmp->next = NULL; +- +- __skb_queue_tail(mpdus_skb, tmp); +- i++; +- } +- +- return 0; +-} +- +-static int iwl_mvm_tx_tso(struct iwl_mvm *mvm, struct sk_buff *skb, +- struct ieee80211_tx_info *info, +- struct ieee80211_sta *sta, +- struct sk_buff_head *mpdus_skb) +-{ +- struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); +- struct ieee80211_hdr *hdr = (void *)skb->data; +- unsigned int mss = skb_shinfo(skb)->gso_size; +- unsigned int num_subframes, tcp_payload_len, subf_len, max_amsdu_len; +- u16 snap_ip_tcp, pad; +- unsigned int dbg_max_amsdu_len; +- netdev_features_t netdev_flags = NETIF_F_CSUM_MASK | NETIF_F_SG; +- u8 tid; +- +- snap_ip_tcp = 8 + skb_transport_header(skb) - skb_network_header(skb) + +- tcp_hdrlen(skb); +- +- dbg_max_amsdu_len = READ_ONCE(mvm->max_amsdu_len); +- +- if (!mvmsta->max_amsdu_len || +- !ieee80211_is_data_qos(hdr->frame_control) || +- (!mvmsta->amsdu_enabled && !dbg_max_amsdu_len)) +- return iwl_mvm_tx_tso_segment(skb, 1, netdev_flags, mpdus_skb); +- +- /* +- * Do not build AMSDU for IPv6 with extension headers. +- * ask stack to segment and checkum the generated MPDUs for us. +- */ +- if (skb->protocol == htons(ETH_P_IPV6) && +- ((struct ipv6hdr *)skb_network_header(skb))->nexthdr != +- IPPROTO_TCP) { +- netdev_flags &= ~NETIF_F_CSUM_MASK; +- return iwl_mvm_tx_tso_segment(skb, 1, netdev_flags, mpdus_skb); +- } +- +- tid = ieee80211_get_tid(hdr); +- if (WARN_ON_ONCE(tid >= IWL_MAX_TID_COUNT)) +- return -EINVAL; +- +- /* +- * No need to lock amsdu_in_ampdu_allowed since it can't be modified +- * during an BA session. +- */ +- if (info->flags & IEEE80211_TX_CTL_AMPDU && +- !mvmsta->tid_data[tid].amsdu_in_ampdu_allowed) +- return iwl_mvm_tx_tso_segment(skb, 1, netdev_flags, mpdus_skb); +- +- if (iwl_mvm_vif_low_latency(iwl_mvm_vif_from_mac80211(mvmsta->vif)) || +- !(mvmsta->amsdu_enabled & BIT(tid))) +- return iwl_mvm_tx_tso_segment(skb, 1, netdev_flags, mpdus_skb); +- +- max_amsdu_len = iwl_mvm_max_amsdu_size(mvm, sta, tid); +- +- if (unlikely(dbg_max_amsdu_len)) +- max_amsdu_len = min_t(unsigned int, max_amsdu_len, +- dbg_max_amsdu_len); +- +- /* +- * Limit A-MSDU in A-MPDU to 4095 bytes when VHT is not +- * supported. This is a spec requirement (IEEE 802.11-2015 +- * section 8.7.3 NOTE 3). +- */ +- if (info->flags & IEEE80211_TX_CTL_AMPDU && +- !sta->vht_cap.vht_supported) +- max_amsdu_len = min_t(unsigned int, max_amsdu_len, 4095); +- +- /* Sub frame header + SNAP + IP header + TCP header + MSS */ +- subf_len = sizeof(struct ethhdr) + snap_ip_tcp + mss; +- pad = (4 - subf_len) & 0x3; +- +- /* +- * If we have N subframes in the A-MSDU, then the A-MSDU's size is +- * N * subf_len + (N - 1) * pad. +- */ +- num_subframes = (max_amsdu_len + pad) / (subf_len + pad); +- +- if (sta->max_amsdu_subframes && +- num_subframes > sta->max_amsdu_subframes) +- num_subframes = sta->max_amsdu_subframes; +- +- tcp_payload_len = skb_tail_pointer(skb) - skb_transport_header(skb) - +- tcp_hdrlen(skb) + skb->data_len; +- +- /* +- * Make sure we have enough TBs for the A-MSDU: +- * 2 for each subframe +- * 1 more for each fragment +- * 1 more for the potential data in the header +- */ +- if ((num_subframes * 2 + skb_shinfo(skb)->nr_frags + 1) > +- mvm->trans->max_skb_frags) +- num_subframes = 1; +- +- if (num_subframes > 1) +- *ieee80211_get_qos_ctl(hdr) |= IEEE80211_QOS_CTL_A_MSDU_PRESENT; +- +- /* This skb fits in one single A-MSDU */ +- if (num_subframes * mss >= tcp_payload_len) { +- __skb_queue_tail(mpdus_skb, skb); +- return 0; +- } +- +- /* +- * Trick the segmentation function to make it +- * create SKBs that can fit into one A-MSDU. +- */ +- return iwl_mvm_tx_tso_segment(skb, num_subframes, netdev_flags, +- mpdus_skb); +-} +-#else /* CONFIG_INET */ +-static int iwl_mvm_tx_tso(struct iwl_mvm *mvm, struct sk_buff *skb, +- struct ieee80211_tx_info *info, +- struct ieee80211_sta *sta, +- struct sk_buff_head *mpdus_skb) +-{ +- /* Impossible to get TSO with CONFIG_INET */ +- WARN_ON(1); +- +- return -1; +-} +-#endif +- + /* Check if there are any timed-out TIDs on a given shared TXQ */ + static bool iwl_mvm_txq_should_update(struct iwl_mvm *mvm, int txq_id) + { +@@ -1203,9 +1012,6 @@ int iwl_mvm_tx_skb(struct iwl_mvm *mvm, struct sk_buff *skb, + { + struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); + struct ieee80211_tx_info info; +- struct sk_buff_head mpdus_skbs; +- unsigned int payload_len; +- int ret; + + if (WARN_ON_ONCE(!mvmsta)) + return -1; +@@ -1215,35 +1021,7 @@ int iwl_mvm_tx_skb(struct iwl_mvm *mvm, struct sk_buff *skb, + + memcpy(&info, skb->cb, sizeof(info)); + +- if (!skb_is_gso(skb)) +- return iwl_mvm_tx_mpdu(mvm, skb, &info, sta); +- +- payload_len = skb_tail_pointer(skb) - skb_transport_header(skb) - +- tcp_hdrlen(skb) + skb->data_len; +- +- if (payload_len <= skb_shinfo(skb)->gso_size) +- return iwl_mvm_tx_mpdu(mvm, skb, &info, sta); +- +- __skb_queue_head_init(&mpdus_skbs); +- +- ret = iwl_mvm_tx_tso(mvm, skb, &info, sta, &mpdus_skbs); +- if (ret) +- return ret; +- +- if (WARN_ON(skb_queue_empty(&mpdus_skbs))) +- return ret; +- +- while (!skb_queue_empty(&mpdus_skbs)) { +- skb = __skb_dequeue(&mpdus_skbs); +- +- ret = iwl_mvm_tx_mpdu(mvm, skb, &info, sta); +- if (ret) { +- __skb_queue_purge(&mpdus_skbs); +- return ret; +- } +- } +- +- return 0; ++ return iwl_mvm_tx_mpdu(mvm, skb, &info, sta); + } + + static void iwl_mvm_check_ratid_empty(struct iwl_mvm *mvm, +-- +2.13.6 + diff --git a/SOURCES/0019-Revert-iwlwifi-mvm-support-mac80211-AMSDU.patch b/SOURCES/0019-Revert-iwlwifi-mvm-support-mac80211-AMSDU.patch new file mode 100644 index 0000000..dc828c7 --- /dev/null +++ b/SOURCES/0019-Revert-iwlwifi-mvm-support-mac80211-AMSDU.patch @@ -0,0 +1,431 @@ +From 37359a82e85dab864b3aee0058f6deacc6448c21 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 25 Jul 2019 15:37:39 +0200 +Subject: [PATCH 3/7] Revert "iwlwifi: mvm: support mac80211 AMSDU" + +This reverts commit 438af9698b0f161286c6e5d24255c3c231988b39. +--- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 33 ---- + drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 3 - + drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c | 14 -- + drivers/net/wireless/intel/iwlwifi/mvm/rs.c | 14 -- + drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 229 +++++++++++++++++++++- + 5 files changed, 226 insertions(+), 67 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-07-31 18:50:33.492326106 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-07-31 18:50:40.636230724 +0200 +@@ -429,8 +429,6 @@ + ieee80211_hw_set(hw, SUPPORTS_VHT_EXT_NSS_BW); + ieee80211_hw_set(hw, BUFF_MMPDU_TXQ); + ieee80211_hw_set(hw, STA_MMPDU_TXQ); +- ieee80211_hw_set(hw, TX_AMSDU); +- ieee80211_hw_set(hw, TX_FRAG_LIST); + + if (iwl_mvm_has_tlc_offload(mvm)) { + ieee80211_hw_set(hw, TX_AMPDU_SETUP_IN_HW); +@@ -476,7 +474,6 @@ + + hw->uapsd_queues = IWL_MVM_UAPSD_QUEUES; + hw->uapsd_max_sp_len = IWL_UAPSD_MAX_SP; +- hw->max_tx_fragments = mvm->trans->max_skb_frags; + + BUILD_BUG_ON(ARRAY_SIZE(mvm->ciphers) < ARRAY_SIZE(mvm_ciphers) + 6); + memcpy(mvm->ciphers, mvm_ciphers, sizeof(mvm_ciphers)); +@@ -739,7 +736,6 @@ + } + + hw->netdev_features |= mvm->cfg->features; +- hw->netdev_features &= ~(NETIF_F_TSO | NETIF_F_TSO6); + if (!iwl_mvm_is_csum_supported(mvm)) { + hw->netdev_features &= ~(IWL_TX_CSUM_NETIF_FLAGS | + NETIF_F_RXCSUM); +@@ -3169,8 +3165,6 @@ + iwl_mvm_tdls_check_trigger(mvm, vif, sta->addr, + NL80211_TDLS_SETUP); + } +- +- sta->max_rc_amsdu_len = 1; + } else if (old_state == IEEE80211_STA_NONE && + new_state == IEEE80211_STA_AUTH) { + /* +@@ -4918,32 +4912,6 @@ + mutex_unlock(&mvm->mutex); + } + +-static bool iwl_mvm_can_hw_csum(struct sk_buff *skb) +-{ +- u8 protocol = ip_hdr(skb)->protocol; +- +- if (!IS_ENABLED(CONFIG_INET)) +- return false; +- +- return protocol == IPPROTO_TCP || protocol == IPPROTO_UDP; +-} +- +-static bool iwl_mvm_mac_can_aggregate(struct ieee80211_hw *hw, +- struct sk_buff *head, +- struct sk_buff *skb) +-{ +- struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); +- +- /* For now don't aggregate IPv6 in AMSDU */ +- if (skb->protocol != htons(ETH_P_IP)) +- return false; +- +- if (!iwl_mvm_is_csum_supported(mvm)) +- return true; +- +- return iwl_mvm_can_hw_csum(skb) == iwl_mvm_can_hw_csum(head); +-} +- + const struct ieee80211_ops iwl_mvm_hw_ops = { + .tx = iwl_mvm_mac_tx, + .wake_tx_queue = iwl_mvm_mac_wake_tx_queue, +@@ -5022,7 +4990,6 @@ + #endif + .get_survey = iwl_mvm_mac_get_survey, + .sta_statistics = iwl_mvm_mac_sta_statistics, +- .can_aggregate_in_amsdu = iwl_mvm_mac_can_aggregate, + #ifdef CONFIG_IWLWIFI_DEBUGFS + .sta_add_debugfs = iwl_mvm_sta_add_debugfs, + #endif +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-07-25 15:31:29.301154126 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-07-31 18:50:40.637230710 +0200 +@@ -1553,9 +1553,6 @@ + struct ieee80211_tx_info *info, + struct ieee80211_sta *sta, __le16 fc); + void iwl_mvm_mac_itxq_xmit(struct ieee80211_hw *hw, struct ieee80211_txq *txq); +-unsigned int iwl_mvm_max_amsdu_size(struct iwl_mvm *mvm, +- struct ieee80211_sta *sta, +- unsigned int tid); + + #ifdef CONFIG_IWLWIFI_DEBUG + const char *iwl_mvm_get_tx_fail_reason(u32 status); +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c 2019-06-27 14:54:04.138678277 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c 2019-07-31 18:50:40.638230697 +0200 +@@ -346,26 +346,12 @@ + + if (flags & IWL_TLC_NOTIF_FLAG_AMSDU) { + u16 size = le32_to_cpu(notif->amsdu_size); +- int i; + + if (WARN_ON(sta->max_amsdu_len < size)) + goto out; + + mvmsta->amsdu_enabled = le32_to_cpu(notif->amsdu_enabled); + mvmsta->max_amsdu_len = size; +- sta->max_rc_amsdu_len = mvmsta->max_amsdu_len; +- +- for (i = 0; i < IWL_MAX_TID_COUNT; i++) { +- if (mvmsta->amsdu_enabled & BIT(i)) +- sta->max_tid_amsdu_len[i] = +- iwl_mvm_max_amsdu_size(mvm, sta, i); +- else +- /* +- * Not so elegant, but this will effectively +- * prevent AMSDU on this TID +- */ +- sta->max_tid_amsdu_len[i] = 1; +- } + + IWL_DEBUG_RATE(mvm, + "AMSDU update. AMSDU size: %d, AMSDU selected size: %d, AMSDU TID bitmap 0x%X\n", +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rs.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rs.c 2019-07-31 18:50:25.238436309 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rs.c 2019-07-31 18:50:40.639230684 +0200 +@@ -1751,7 +1751,6 @@ + enum rs_action scale_action) + { + struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); +- int i; + + /* + * In case TLC offload is not active amsdu_enabled is either 0xFFFF +@@ -1765,19 +1764,6 @@ + mvmsta->amsdu_enabled = 0xFFFF; + + mvmsta->max_amsdu_len = sta->max_amsdu_len; +- sta->max_rc_amsdu_len = mvmsta->max_amsdu_len; +- +- for (i = 0; i < IWL_MAX_TID_COUNT; i++) { +- if (mvmsta->amsdu_enabled) +- sta->max_tid_amsdu_len[i] = +- iwl_mvm_max_amsdu_size(mvm, sta, i); +- else +- /* +- * Not so elegant, but this will effectively +- * prevent AMSDU on this TID +- */ +- sta->max_tid_amsdu_len[i] = 1; +- } + } + + /* +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/tx.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/tx.c 2019-07-31 18:50:33.494326080 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/tx.c 2019-07-31 18:50:40.639230684 +0200 +@@ -785,8 +785,78 @@ + return 0; + } + +-unsigned int iwl_mvm_max_amsdu_size(struct iwl_mvm *mvm, +- struct ieee80211_sta *sta, unsigned int tid) ++#ifdef CONFIG_INET ++ ++static int ++iwl_mvm_tx_tso_segment(struct sk_buff *skb, unsigned int num_subframes, ++ netdev_features_t netdev_flags, ++ struct sk_buff_head *mpdus_skb) ++{ ++ struct sk_buff *tmp, *next; ++ struct ieee80211_hdr *hdr = (void *)skb->data; ++ char cb[sizeof(skb->cb)]; ++ u16 i = 0; ++ unsigned int tcp_payload_len; ++ unsigned int mss = skb_shinfo(skb)->gso_size; ++ bool ipv4 = (skb->protocol == htons(ETH_P_IP)); ++ u16 ip_base_id = ipv4 ? ntohs(ip_hdr(skb)->id) : 0; ++ ++ skb_shinfo(skb)->gso_size = num_subframes * mss; ++ memcpy(cb, skb->cb, sizeof(cb)); ++ ++ next = skb_gso_segment(skb, netdev_flags); ++ skb_shinfo(skb)->gso_size = mss; ++ if (WARN_ON_ONCE(IS_ERR(next))) ++ return -EINVAL; ++ else if (next) ++ consume_skb(skb); ++ ++ while (next) { ++ tmp = next; ++ next = tmp->next; ++ ++ memcpy(tmp->cb, cb, sizeof(tmp->cb)); ++ /* ++ * Compute the length of all the data added for the A-MSDU. ++ * This will be used to compute the length to write in the TX ++ * command. We have: SNAP + IP + TCP for n -1 subframes and ++ * ETH header for n subframes. ++ */ ++ tcp_payload_len = skb_tail_pointer(tmp) - ++ skb_transport_header(tmp) - ++ tcp_hdrlen(tmp) + tmp->data_len; ++ ++ if (ipv4) ++ ip_hdr(tmp)->id = htons(ip_base_id + i * num_subframes); ++ ++ if (tcp_payload_len > mss) { ++ skb_shinfo(tmp)->gso_size = mss; ++ } else { ++ if (ieee80211_is_data_qos(hdr->frame_control)) { ++ u8 *qc; ++ ++ if (ipv4) ++ ip_send_check(ip_hdr(tmp)); ++ ++ qc = ieee80211_get_qos_ctl((void *)tmp->data); ++ *qc &= ~IEEE80211_QOS_CTL_A_MSDU_PRESENT; ++ } ++ skb_shinfo(tmp)->gso_size = 0; ++ } ++ ++ tmp->prev = NULL; ++ tmp->next = NULL; ++ ++ __skb_queue_tail(mpdus_skb, tmp); ++ i++; ++ } ++ ++ return 0; ++} ++ ++static unsigned int iwl_mvm_max_amsdu_size(struct iwl_mvm *mvm, ++ struct ieee80211_sta *sta, ++ unsigned int tid) + { + struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); + enum nl80211_band band = mvmsta->vif->bss_conf.chandef.chan->band; +@@ -814,6 +884,128 @@ + mvm->fwrt.smem_cfg.lmac[lmac].txfifo_size[txf] - 256); + } + ++static int iwl_mvm_tx_tso(struct iwl_mvm *mvm, struct sk_buff *skb, ++ struct ieee80211_tx_info *info, ++ struct ieee80211_sta *sta, ++ struct sk_buff_head *mpdus_skb) ++{ ++ struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); ++ struct ieee80211_hdr *hdr = (void *)skb->data; ++ unsigned int mss = skb_shinfo(skb)->gso_size; ++ unsigned int num_subframes, tcp_payload_len, subf_len, max_amsdu_len; ++ u16 snap_ip_tcp, pad; ++ unsigned int dbg_max_amsdu_len; ++ netdev_features_t netdev_flags = NETIF_F_CSUM_MASK | NETIF_F_SG; ++ u8 tid; ++ ++ snap_ip_tcp = 8 + skb_transport_header(skb) - skb_network_header(skb) + ++ tcp_hdrlen(skb); ++ ++ dbg_max_amsdu_len = READ_ONCE(mvm->max_amsdu_len); ++ ++ if (!mvmsta->max_amsdu_len || ++ !ieee80211_is_data_qos(hdr->frame_control) || ++ (!mvmsta->amsdu_enabled && !dbg_max_amsdu_len)) ++ return iwl_mvm_tx_tso_segment(skb, 1, netdev_flags, mpdus_skb); ++ ++ /* ++ * Do not build AMSDU for IPv6 with extension headers. ++ * ask stack to segment and checkum the generated MPDUs for us. ++ */ ++ if (skb->protocol == htons(ETH_P_IPV6) && ++ ((struct ipv6hdr *)skb_network_header(skb))->nexthdr != ++ IPPROTO_TCP) { ++ netdev_flags &= ~NETIF_F_CSUM_MASK; ++ return iwl_mvm_tx_tso_segment(skb, 1, netdev_flags, mpdus_skb); ++ } ++ ++ tid = ieee80211_get_tid(hdr); ++ if (WARN_ON_ONCE(tid >= IWL_MAX_TID_COUNT)) ++ return -EINVAL; ++ ++ /* ++ * No need to lock amsdu_in_ampdu_allowed since it can't be modified ++ * during an BA session. ++ */ ++ if (info->flags & IEEE80211_TX_CTL_AMPDU && ++ !mvmsta->tid_data[tid].amsdu_in_ampdu_allowed) ++ return iwl_mvm_tx_tso_segment(skb, 1, netdev_flags, mpdus_skb); ++ ++ if (iwl_mvm_vif_low_latency(iwl_mvm_vif_from_mac80211(mvmsta->vif)) || ++ !(mvmsta->amsdu_enabled & BIT(tid))) ++ return iwl_mvm_tx_tso_segment(skb, 1, netdev_flags, mpdus_skb); ++ ++ max_amsdu_len = iwl_mvm_max_amsdu_size(mvm, sta, tid); ++ ++ if (unlikely(dbg_max_amsdu_len)) ++ max_amsdu_len = min_t(unsigned int, max_amsdu_len, ++ dbg_max_amsdu_len); ++ ++ /* ++ * Limit A-MSDU in A-MPDU to 4095 bytes when VHT is not ++ * supported. This is a spec requirement (IEEE 802.11-2015 ++ * section 8.7.3 NOTE 3). ++ */ ++ if (info->flags & IEEE80211_TX_CTL_AMPDU && ++ !sta->vht_cap.vht_supported) ++ max_amsdu_len = min_t(unsigned int, max_amsdu_len, 4095); ++ ++ /* Sub frame header + SNAP + IP header + TCP header + MSS */ ++ subf_len = sizeof(struct ethhdr) + snap_ip_tcp + mss; ++ pad = (4 - subf_len) & 0x3; ++ ++ /* ++ * If we have N subframes in the A-MSDU, then the A-MSDU's size is ++ * N * subf_len + (N - 1) * pad. ++ */ ++ num_subframes = (max_amsdu_len + pad) / (subf_len + pad); ++ ++ if (sta->max_amsdu_subframes && ++ num_subframes > sta->max_amsdu_subframes) ++ num_subframes = sta->max_amsdu_subframes; ++ ++ tcp_payload_len = skb_tail_pointer(skb) - skb_transport_header(skb) - ++ tcp_hdrlen(skb) + skb->data_len; ++ ++ /* ++ * Make sure we have enough TBs for the A-MSDU: ++ * 2 for each subframe ++ * 1 more for each fragment ++ * 1 more for the potential data in the header ++ */ ++ if ((num_subframes * 2 + skb_shinfo(skb)->nr_frags + 1) > ++ mvm->trans->max_skb_frags) ++ num_subframes = 1; ++ ++ if (num_subframes > 1) ++ *ieee80211_get_qos_ctl(hdr) |= IEEE80211_QOS_CTL_A_MSDU_PRESENT; ++ ++ /* This skb fits in one single A-MSDU */ ++ if (num_subframes * mss >= tcp_payload_len) { ++ __skb_queue_tail(mpdus_skb, skb); ++ return 0; ++ } ++ ++ /* ++ * Trick the segmentation function to make it ++ * create SKBs that can fit into one A-MSDU. ++ */ ++ return iwl_mvm_tx_tso_segment(skb, num_subframes, netdev_flags, ++ mpdus_skb); ++} ++#else /* CONFIG_INET */ ++static int iwl_mvm_tx_tso(struct iwl_mvm *mvm, struct sk_buff *skb, ++ struct ieee80211_tx_info *info, ++ struct ieee80211_sta *sta, ++ struct sk_buff_head *mpdus_skb) ++{ ++ /* Impossible to get TSO with CONFIG_INET */ ++ WARN_ON(1); ++ ++ return -1; ++} ++#endif ++ + /* Check if there are any timed-out TIDs on a given shared TXQ */ + static bool iwl_mvm_txq_should_update(struct iwl_mvm *mvm, int txq_id) + { +@@ -1012,6 +1204,9 @@ + { + struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); + struct ieee80211_tx_info info; ++ struct sk_buff_head mpdus_skbs; ++ unsigned int payload_len; ++ int ret; + + if (WARN_ON_ONCE(!mvmsta)) + return -1; +@@ -1021,7 +1216,35 @@ + + memcpy(&info, skb->cb, sizeof(info)); + +- return iwl_mvm_tx_mpdu(mvm, skb, &info, sta); ++ if (!skb_is_gso(skb)) ++ return iwl_mvm_tx_mpdu(mvm, skb, &info, sta); ++ ++ payload_len = skb_tail_pointer(skb) - skb_transport_header(skb) - ++ tcp_hdrlen(skb) + skb->data_len; ++ ++ if (payload_len <= skb_shinfo(skb)->gso_size) ++ return iwl_mvm_tx_mpdu(mvm, skb, &info, sta); ++ ++ __skb_queue_head_init(&mpdus_skbs); ++ ++ ret = iwl_mvm_tx_tso(mvm, skb, &info, sta, &mpdus_skbs); ++ if (ret) ++ return ret; ++ ++ if (WARN_ON(skb_queue_empty(&mpdus_skbs))) ++ return ret; ++ ++ while (!skb_queue_empty(&mpdus_skbs)) { ++ skb = __skb_dequeue(&mpdus_skbs); ++ ++ ret = iwl_mvm_tx_mpdu(mvm, skb, &info, sta); ++ if (ret) { ++ __skb_queue_purge(&mpdus_skbs); ++ return ret; ++ } ++ } ++ ++ return 0; + } + + static void iwl_mvm_check_ratid_empty(struct iwl_mvm *mvm, diff --git a/SOURCES/0020-Revert-iwlwifi-mvm-remove-redundant-condition.patch b/SOURCES/0020-Revert-iwlwifi-mvm-remove-redundant-condition.patch new file mode 100644 index 0000000..f966433 --- /dev/null +++ b/SOURCES/0020-Revert-iwlwifi-mvm-remove-redundant-condition.patch @@ -0,0 +1,32 @@ +From a1e09a08fc21c3c17dc24f0d3413f8322c9c313f Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 25 Jul 2019 15:50:40 +0200 +Subject: [PATCH 4/7] Revert "iwlwifi: mvm: remove redundant condition" + +This reverts commit f992c61d59fb2eb1a234890ef92f378a47ebe20b. +--- + drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +index f545a737a92d..e3a35434a439 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +@@ -793,9 +793,11 @@ static int iwl_mvm_sta_alloc_queue_tvqm(struct iwl_mvm *mvm, + if (queue < 0) + return queue; + +- mvmtxq->txq_id = queue; +- mvm->tvqm_info[queue].txq_tid = tid; +- mvm->tvqm_info[queue].sta_id = mvmsta->sta_id; ++ if (sta) { ++ mvmtxq->txq_id = queue; ++ mvm->tvqm_info[queue].txq_tid = tid; ++ mvm->tvqm_info[queue].sta_id = mvmsta->sta_id; ++ } + + IWL_DEBUG_TX_QUEUES(mvm, "Allocated queue is %d\n", queue); + +-- +2.13.6 + diff --git a/SOURCES/0021-Revert-iwlwifi-mvm-stop-static-queues-correctly.patch b/SOURCES/0021-Revert-iwlwifi-mvm-stop-static-queues-correctly.patch new file mode 100644 index 0000000..e7cab4a --- /dev/null +++ b/SOURCES/0021-Revert-iwlwifi-mvm-stop-static-queues-correctly.patch @@ -0,0 +1,46 @@ +From 3335a827ae30b9575209c9c06e5086239da6fcd0 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 25 Jul 2019 19:33:04 +0200 +Subject: [PATCH 5/7] Revert "iwlwifi: mvm: stop static queues correctly" + +This reverts commit 99944b73069d8bcea573c07df8dc8d4f33e78586. +--- + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 15 --------------- + 1 file changed, 15 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +index dfc94882316c..41fc17807a43 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +@@ -1103,12 +1103,6 @@ static void iwl_mvm_async_cb(struct iwl_op_mode *op_mode, + iwl_trans_block_txq_ptrs(mvm->trans, false); + } + +-static int iwl_mvm_is_static_queue(struct iwl_mvm *mvm, int queue) +-{ +- return queue == mvm->aux_queue || queue == mvm->probe_queue || +- queue == mvm->p2p_dev_queue || queue == mvm->snif_queue; +-} +- + static void iwl_mvm_queue_state_change(struct iwl_op_mode *op_mode, + int hw_queue, bool start) + { +@@ -1135,15 +1129,6 @@ static void iwl_mvm_queue_state_change(struct iwl_op_mode *op_mode, + goto out; + mvmsta = iwl_mvm_sta_from_mac80211(sta); + +- if (iwl_mvm_is_static_queue(mvm, hw_queue)) { +- if (!start) +- ieee80211_stop_queues(mvm->hw); +- else if (mvmsta->sta_state != IEEE80211_STA_NOTEXIST) +- ieee80211_wake_queues(mvm->hw); +- +- goto out; +- } +- + if (iwl_mvm_has_new_tx_api(mvm)) { + int tid = mvm->tvqm_info[hw_queue].txq_tid; + +-- +2.13.6 + diff --git a/SOURCES/0022-Revert-iwlwifi-mvm-remove-buggy-and-unnecessary-hw_q.patch b/SOURCES/0022-Revert-iwlwifi-mvm-remove-buggy-and-unnecessary-hw_q.patch new file mode 100644 index 0000000..576c3c0 --- /dev/null +++ b/SOURCES/0022-Revert-iwlwifi-mvm-remove-buggy-and-unnecessary-hw_q.patch @@ -0,0 +1,69 @@ +From d724bb52e36359a8673cf30de2a93caf701743bd Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Tue, 30 Jul 2019 14:33:29 +0200 +Subject: [PATCH 6/7] Revert "iwlwifi: mvm: remove buggy and unnecessary + hw_queue initialization" + +This reverts commit 3f7fbc8cc11e2a305247a908bc67bb5f571fbf00. +--- + drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 36 +++++++++++++++++++++-- + 1 file changed, 33 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +index 53c217af13c8..0bd800a278a6 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +@@ -262,7 +262,9 @@ int iwl_mvm_mac_ctxt_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif) + .preferred_tsf = NUM_TSF_IDS, + .found_vif = false, + }; +- int ret, i; ++ u32 ac; ++ int ret, i, queue_limit; ++ unsigned long used_hw_queues; + + lockdep_assert_held(&mvm->mutex); + +@@ -339,9 +341,37 @@ int iwl_mvm_mac_ctxt_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif) + INIT_LIST_HEAD(&mvmvif->time_event_data.list); + mvmvif->time_event_data.id = TE_MAX; + +- /* No need to allocate data queues to P2P Device MAC and NAN.*/ +- if (vif->type == NL80211_IFTYPE_P2P_DEVICE) ++ /* No need to allocate data queues to P2P Device MAC.*/ ++ if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { ++ for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) ++ vif->hw_queue[ac] = IEEE80211_INVAL_HW_QUEUE; ++ + return 0; ++ } ++ ++ /* ++ * queues in mac80211 almost entirely independent of ++ * the ones here - no real limit ++ */ ++ queue_limit = IEEE80211_MAX_QUEUES; ++ ++ /* ++ * Find available queues, and allocate them to the ACs. When in ++ * DQA-mode they aren't really used, and this is done only so the ++ * mac80211 ieee80211_check_queues() function won't fail ++ */ ++ for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { ++ u8 queue = find_first_zero_bit(&used_hw_queues, queue_limit); ++ ++ if (queue >= queue_limit) { ++ IWL_ERR(mvm, "Failed to allocate queue\n"); ++ ret = -EIO; ++ goto exit_fail; ++ } ++ ++ __set_bit(queue, &used_hw_queues); ++ vif->hw_queue[ac] = queue; ++ } + + /* Allocate the CAB queue for softAP and GO interfaces */ + if (vif->type == NL80211_IFTYPE_AP || +-- +2.13.6 + diff --git a/SOURCES/0023-Revert-iwlwifi-mvm-support-mac80211-TXQs-model.patch b/SOURCES/0023-Revert-iwlwifi-mvm-support-mac80211-TXQs-model.patch new file mode 100644 index 0000000..3684e7f --- /dev/null +++ b/SOURCES/0023-Revert-iwlwifi-mvm-support-mac80211-TXQs-model.patch @@ -0,0 +1,1642 @@ +From fd89017061fc9e11c32ba2bada6fb175d5894417 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Wed, 31 Jul 2019 18:48:56 +0200 +Subject: [PATCH 7/7] Revert "iwlwifi: mvm: support mac80211 TXQs model" + +This reverts commit cfbc6c4c5b91c7725ef14465b98ac347d31f2334. +--- + drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 8 +- + drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 5 +- + drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 72 ++++- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 143 ++------- + drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 53 +--- + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 87 +++--- + drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 360 +++++++++++++--------- + drivers/net/wireless/intel/iwlwifi/mvm/sta.h | 4 + + drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 69 ++++- + 9 files changed, 442 insertions(+), 359 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/d3.c 2019-06-27 14:54:04.132678349 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/d3.c 2019-07-31 18:51:11.751815280 +0200 +@@ -2231,6 +2231,7 @@ + + file->private_data = inode->i_private; + ++ ieee80211_stop_queues(mvm->hw); + synchronize_net(); + + mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_D3; +@@ -2245,9 +2246,10 @@ + rtnl_unlock(); + if (err > 0) + err = -EINVAL; +- if (err) ++ if (err) { ++ ieee80211_wake_queues(mvm->hw); + return err; +- ++ } + mvm->d3_test_active = true; + mvm->keep_vif = NULL; + return 0; +@@ -2327,6 +2329,8 @@ + mvm->hw, IEEE80211_IFACE_ITER_NORMAL, + iwl_mvm_d3_test_disconn_work_iter, mvm->keep_vif); + ++ ieee80211_wake_queues(mvm->hw); ++ + return 0; + } + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/fw.c 2019-06-27 14:54:04.134678325 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/fw.c 2019-07-31 18:51:11.752815267 +0200 +@@ -308,7 +308,7 @@ + struct iwl_notification_wait alive_wait; + struct iwl_mvm_alive_data alive_data = {}; + const struct fw_img *fw; +- int ret; ++ int ret, i; + enum iwl_ucode_type old_type = mvm->fwrt.cur_fw_img; + static const u16 alive_cmd[] = { MVM_ALIVE }; + +@@ -390,6 +390,9 @@ + mvm->queue_info[IWL_MVM_DQA_CMD_QUEUE].tid_bitmap = + BIT(IWL_MAX_TID_COUNT + 2); + ++ for (i = 0; i < IEEE80211_MAX_QUEUES; i++) ++ atomic_set(&mvm->mac80211_queue_stop_count[i], 0); ++ + set_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status); + #ifdef CONFIG_IWLWIFI_DEBUGFS + iwl_fw_set_dbg_rec_on(&mvm->fwrt); +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c 2019-07-31 18:51:06.045891463 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c 2019-07-31 18:51:11.752815267 +0200 +@@ -97,6 +97,11 @@ + bool found_vif; + }; + ++struct iwl_mvm_hw_queues_iface_iterator_data { ++ struct ieee80211_vif *exclude_vif; ++ unsigned long used_hw_queues; ++}; ++ + static void iwl_mvm_mac_tsf_id_iter(void *_data, u8 *mac, + struct ieee80211_vif *vif) + { +@@ -203,6 +208,61 @@ + data->preferred_tsf = NUM_TSF_IDS; + } + ++/* ++ * Get the mask of the queues used by the vif ++ */ ++u32 iwl_mvm_mac_get_queues_mask(struct ieee80211_vif *vif) ++{ ++ u32 qmask = 0, ac; ++ ++ if (vif->type == NL80211_IFTYPE_P2P_DEVICE) ++ return BIT(IWL_MVM_OFFCHANNEL_QUEUE); ++ ++ for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { ++ if (vif->hw_queue[ac] != IEEE80211_INVAL_HW_QUEUE) ++ qmask |= BIT(vif->hw_queue[ac]); ++ } ++ ++ if (vif->type == NL80211_IFTYPE_AP || ++ vif->type == NL80211_IFTYPE_ADHOC) ++ qmask |= BIT(vif->cab_queue); ++ ++ return qmask; ++} ++ ++static void iwl_mvm_iface_hw_queues_iter(void *_data, u8 *mac, ++ struct ieee80211_vif *vif) ++{ ++ struct iwl_mvm_hw_queues_iface_iterator_data *data = _data; ++ ++ /* exclude the given vif */ ++ if (vif == data->exclude_vif) ++ return; ++ ++ data->used_hw_queues |= iwl_mvm_mac_get_queues_mask(vif); ++} ++ ++unsigned long iwl_mvm_get_used_hw_queues(struct iwl_mvm *mvm, ++ struct ieee80211_vif *exclude_vif) ++{ ++ struct iwl_mvm_hw_queues_iface_iterator_data data = { ++ .exclude_vif = exclude_vif, ++ .used_hw_queues = ++ BIT(IWL_MVM_OFFCHANNEL_QUEUE) | ++ BIT(mvm->aux_queue) | ++ BIT(IWL_MVM_DQA_GCAST_QUEUE), ++ }; ++ ++ lockdep_assert_held(&mvm->mutex); ++ ++ /* mark all VIF used hw queues */ ++ ieee80211_iterate_active_interfaces_atomic( ++ mvm->hw, IEEE80211_IFACE_ITER_RESUME_ALL, ++ iwl_mvm_iface_hw_queues_iter, &data); ++ ++ return data.used_hw_queues; ++} ++ + static void iwl_mvm_mac_iface_iterator(void *_data, u8 *mac, + struct ieee80211_vif *vif) + { +@@ -300,6 +360,8 @@ + mvm->hw, IEEE80211_IFACE_ITER_RESUME_ALL, + iwl_mvm_mac_iface_iterator, &data); + ++ used_hw_queues = iwl_mvm_get_used_hw_queues(mvm, vif); ++ + /* + * In the case we're getting here during resume, it's similar to + * firmware restart, and with RESUME_ALL the iterator will find +@@ -354,6 +416,9 @@ + * the ones here - no real limit + */ + queue_limit = IEEE80211_MAX_QUEUES; ++ BUILD_BUG_ON(IEEE80211_MAX_QUEUES > ++ BITS_PER_BYTE * ++ sizeof(mvm->hw_queue_to_mac80211[0])); + + /* + * Find available queues, and allocate them to the ACs. When in +@@ -381,6 +446,9 @@ + * queue value (when queue is enabled). + */ + mvmvif->cab_queue = IWL_MVM_DQA_GCAST_QUEUE; ++ vif->cab_queue = IWL_MVM_DQA_GCAST_QUEUE; ++ } else { ++ vif->cab_queue = IEEE80211_INVAL_HW_QUEUE; + } + + mvmvif->bcast_sta.sta_id = IWL_MVM_INVALID_STA; +@@ -394,6 +462,8 @@ + + exit_fail: + memset(mvmvif, 0, sizeof(struct iwl_mvm_vif)); ++ memset(vif->hw_queue, IEEE80211_INVAL_HW_QUEUE, sizeof(vif->hw_queue)); ++ vif->cab_queue = IEEE80211_INVAL_HW_QUEUE; + return ret; + } + +@@ -1120,7 +1190,7 @@ + + if (!fw_has_api(&mvm->fw->ucode_capa, + IWL_UCODE_TLV_API_STA_TYPE)) +- ctxt_ap->mcast_qid = cpu_to_le32(mvmvif->cab_queue); ++ ctxt_ap->mcast_qid = cpu_to_le32(vif->cab_queue); + + /* + * Only set the beacon time when the MAC is being added, when we +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-07-31 18:50:40.636230724 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-07-31 18:51:11.753815253 +0200 +@@ -414,6 +414,7 @@ + ieee80211_hw_set(hw, SIGNAL_DBM); + ieee80211_hw_set(hw, SPECTRUM_MGMT); + ieee80211_hw_set(hw, REPORTS_TX_ACK_STATUS); ++ ieee80211_hw_set(hw, QUEUE_CONTROL); + ieee80211_hw_set(hw, WANT_MONITOR_VIF); + ieee80211_hw_set(hw, SUPPORTS_PS); + ieee80211_hw_set(hw, SUPPORTS_DYNAMIC_PS); +@@ -427,8 +428,6 @@ + ieee80211_hw_set(hw, NEEDS_UNIQUE_STA_ADDR); + ieee80211_hw_set(hw, DEAUTH_NEED_MGD_TX_PREP); + ieee80211_hw_set(hw, SUPPORTS_VHT_EXT_NSS_BW); +- ieee80211_hw_set(hw, BUFF_MMPDU_TXQ); +- ieee80211_hw_set(hw, STA_MMPDU_TXQ); + + if (iwl_mvm_has_tlc_offload(mvm)) { + ieee80211_hw_set(hw, TX_AMPDU_SETUP_IN_HW); +@@ -539,7 +538,6 @@ + hw->sta_data_size = sizeof(struct iwl_mvm_sta); + hw->vif_data_size = sizeof(struct iwl_mvm_vif); + hw->chanctx_data_size = sizeof(u16); +- hw->txq_data_size = sizeof(struct iwl_mvm_txq); + + hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | + BIT(NL80211_IFTYPE_P2P_CLIENT) | +@@ -785,6 +783,7 @@ + goto out; + + __skb_queue_tail(&mvm->d0i3_tx, skb); ++ ieee80211_stop_queues(mvm->hw); + + /* trigger wakeup */ + iwl_mvm_ref(mvm, IWL_MVM_REF_TX); +@@ -804,15 +803,13 @@ + struct ieee80211_sta *sta = control->sta; + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); + struct ieee80211_hdr *hdr = (void *)skb->data; +- bool offchannel = IEEE80211_SKB_CB(skb)->flags & +- IEEE80211_TX_CTL_TX_OFFCHAN; + + if (iwl_mvm_is_radio_killed(mvm)) { + IWL_DEBUG_DROP(mvm, "Dropping - RF/CT KILL\n"); + goto drop; + } + +- if (offchannel && ++ if (info->hw_queue == IWL_MVM_OFFCHANNEL_QUEUE && + !test_bit(IWL_MVM_STATUS_ROC_RUNNING, &mvm->status) && + !test_bit(IWL_MVM_STATUS_ROC_AUX_RUNNING, &mvm->status)) + goto drop; +@@ -825,8 +822,8 @@ + sta = NULL; + + /* If there is no sta, and it's not offchannel - send through AP */ +- if (!sta && info->control.vif->type == NL80211_IFTYPE_STATION && +- !offchannel) { ++ if (info->control.vif->type == NL80211_IFTYPE_STATION && ++ info->hw_queue != IWL_MVM_OFFCHANNEL_QUEUE && !sta) { + struct iwl_mvm_vif *mvmvif = + iwl_mvm_vif_from_mac80211(info->control.vif); + u8 ap_sta_id = READ_ONCE(mvmvif->ap_sta_id); +@@ -854,107 +851,6 @@ + ieee80211_free_txskb(hw, skb); + } + +-void iwl_mvm_mac_itxq_xmit(struct ieee80211_hw *hw, struct ieee80211_txq *txq) +-{ +- struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); +- struct iwl_mvm_txq *mvmtxq = iwl_mvm_txq_from_mac80211(txq); +- struct sk_buff *skb = NULL; +- +- /* +- * No need for threads to be pending here, they can leave the first +- * taker all the work. +- * +- * mvmtxq->tx_request logic: +- * +- * If 0, no one is currently TXing, set to 1 to indicate current thread +- * will now start TX and other threads should quit. +- * +- * If 1, another thread is currently TXing, set to 2 to indicate to +- * that thread that there was another request. Since that request may +- * have raced with the check whether the queue is empty, the TXing +- * thread should check the queue's status one more time before leaving. +- * This check is done in order to not leave any TX hanging in the queue +- * until the next TX invocation (which may not even happen). +- * +- * If 2, another thread is currently TXing, and it will already double +- * check the queue, so do nothing. +- */ +-#if 0 /* Not in RHEL */ +- if (atomic_fetch_add_unless(&mvmtxq->tx_request, 1, 2)) +-#else +- if (__atomic_add_unless(&mvmtxq->tx_request, 1, 2)) +-#endif +- return; +- +- +- rcu_read_lock(); +- do { +- while (likely(!mvmtxq->stopped && +- (mvm->trans->system_pm_mode == +- IWL_PLAT_PM_MODE_DISABLED))) { +- skb = ieee80211_tx_dequeue(hw, txq); +- +- if (!skb) { +- if (txq->sta) +- IWL_DEBUG_TX(mvm, +- "TXQ of sta %pM tid %d is now empty\n", +- txq->sta->addr, +- txq->tid); +- break; +- } +- +- if (!txq->sta) +- iwl_mvm_tx_skb_non_sta(mvm, skb); +- else +- iwl_mvm_tx_skb(mvm, skb, txq->sta); +- } +- } while (atomic_dec_return(&mvmtxq->tx_request)); +- rcu_read_unlock(); +-} +- +-static void iwl_mvm_mac_wake_tx_queue(struct ieee80211_hw *hw, +- struct ieee80211_txq *txq) +-{ +- struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); +- struct iwl_mvm_txq *mvmtxq = iwl_mvm_txq_from_mac80211(txq); +- +- /* +- * Please note that racing is handled very carefully here: +- * mvmtxq->txq_id is updated during allocation, and mvmtxq->list is +- * deleted afterwards. +- * This means that if: +- * mvmtxq->txq_id != INVALID_QUEUE && list_empty(&mvmtxq->list): +- * queue is allocated and we can TX. +- * mvmtxq->txq_id != INVALID_QUEUE && !list_empty(&mvmtxq->list): +- * a race, should defer the frame. +- * mvmtxq->txq_id == INVALID_QUEUE && list_empty(&mvmtxq->list): +- * need to allocate the queue and defer the frame. +- * mvmtxq->txq_id == INVALID_QUEUE && !list_empty(&mvmtxq->list): +- * queue is already scheduled for allocation, no need to allocate, +- * should defer the frame. +- */ +- +- /* If the queue is allocated TX and return. */ +- if (!txq->sta || mvmtxq->txq_id != IWL_MVM_INVALID_QUEUE) { +- /* +- * Check that list is empty to avoid a race where txq_id is +- * already updated, but the queue allocation work wasn't +- * finished +- */ +- if (unlikely(txq->sta && !list_empty(&mvmtxq->list))) +- return; +- +- iwl_mvm_mac_itxq_xmit(hw, txq); +- return; +- } +- +- /* The list is being deleted only after the queue is fully allocated. */ +- if (!list_empty(&mvmtxq->list)) +- return; +- +- list_add_tail(&mvmtxq->list, &mvm->add_stream_txqs); +- schedule_work(&mvm->add_stream_wk); +-} + + #define CHECK_BA_TRIGGER(_mvm, _trig, _tid_bm, _tid, _fmt...) \ + do { \ +@@ -1172,6 +1068,7 @@ + + iwl_mvm_reset_phy_ctxts(mvm); + memset(mvm->fw_key_table, 0, sizeof(mvm->fw_key_table)); ++ memset(mvm->sta_deferred_frames, 0, sizeof(mvm->sta_deferred_frames)); + memset(&mvm->last_bt_notif, 0, sizeof(mvm->last_bt_notif)); + memset(&mvm->last_bt_ci_cmd, 0, sizeof(mvm->last_bt_ci_cmd)); + +@@ -3086,6 +2983,32 @@ + peer_addr, action); + } + ++static void iwl_mvm_purge_deferred_tx_frames(struct iwl_mvm *mvm, ++ struct iwl_mvm_sta *mvm_sta) ++{ ++ struct iwl_mvm_tid_data *tid_data; ++ struct sk_buff *skb; ++ int i; ++ ++ spin_lock_bh(&mvm_sta->lock); ++ for (i = 0; i <= IWL_MAX_TID_COUNT; i++) { ++ tid_data = &mvm_sta->tid_data[i]; ++ ++ while ((skb = __skb_dequeue(&tid_data->deferred_tx_frames))) { ++ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); ++ ++ /* ++ * The first deferred frame should've stopped the MAC ++ * queues, so we should never get a second deferred ++ * frame for the RA/TID. ++ */ ++ iwl_mvm_start_mac_queues(mvm, BIT(info->hw_queue)); ++ ieee80211_free_txskb(mvm->hw, skb); ++ } ++ } ++ spin_unlock_bh(&mvm_sta->lock); ++} ++ + static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, +@@ -3119,6 +3042,7 @@ + */ + if (old_state == IEEE80211_STA_NONE && + new_state == IEEE80211_STA_NOTEXIST) { ++ iwl_mvm_purge_deferred_tx_frames(mvm, mvm_sta); + flush_work(&mvm->add_stream_wk); + + /* +@@ -4914,7 +4838,6 @@ + + const struct ieee80211_ops iwl_mvm_hw_ops = { + .tx = iwl_mvm_mac_tx, +- .wake_tx_queue = iwl_mvm_mac_wake_tx_queue, + .ampdu_action = iwl_mvm_mac_ampdu_action, + .start = iwl_mvm_mac_start, + .reconfig_complete = iwl_mvm_mac_reconfig_complete, +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-07-31 18:50:40.637230710 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-07-31 18:51:11.753815253 +0200 +@@ -805,39 +805,6 @@ + u8 values[ACPI_GEO_TABLE_SIZE]; + }; + +-struct iwl_mvm_txq { +- struct list_head list; +- u16 txq_id; +- atomic_t tx_request; +- bool stopped; +-}; +- +-static inline struct iwl_mvm_txq * +-iwl_mvm_txq_from_mac80211(struct ieee80211_txq *txq) +-{ +- return (void *)txq->drv_priv; +-} +- +-static inline struct iwl_mvm_txq * +-iwl_mvm_txq_from_tid(struct ieee80211_sta *sta, u8 tid) +-{ +- if (tid == IWL_MAX_TID_COUNT) +- tid = IEEE80211_NUM_TIDS; +- +- return (void *)sta->txq[tid]->drv_priv; +-} +- +-/** +- * struct iwl_mvm_tvqm_txq_info - maps TVQM hw queue to tid +- * +- * @sta_id: sta id +- * @txq_tid: txq tid +- */ +-struct iwl_mvm_tvqm_txq_info { +- u8 sta_id; +- u8 txq_tid; +-}; +- + struct iwl_mvm_dqa_txq_info { + u8 ra_sta_id; /* The RA this queue is mapped to, if exists */ + bool reserved; /* Is this the TXQ reserved for a STA */ +@@ -900,13 +867,13 @@ + u64 on_time_scan; + } radio_stats, accu_radio_stats; + +- struct list_head add_stream_txqs; +- union { +- struct iwl_mvm_dqa_txq_info queue_info[IWL_MAX_HW_QUEUES]; +- struct iwl_mvm_tvqm_txq_info tvqm_info[IWL_MAX_TVQM_QUEUES]; +- }; ++ u16 hw_queue_to_mac80211[IWL_MAX_TVQM_QUEUES]; ++ ++ struct iwl_mvm_dqa_txq_info queue_info[IWL_MAX_HW_QUEUES]; + struct work_struct add_stream_wk; /* To add streams to queues */ + ++ atomic_t mac80211_queue_stop_count[IEEE80211_MAX_QUEUES]; ++ + const char *nvm_file_name; + struct iwl_nvm_data *nvm_data; + /* NVM sections */ +@@ -920,6 +887,7 @@ + /* data related to data path */ + struct iwl_rx_phy_info last_phy_info; + struct ieee80211_sta __rcu *fw_id_to_mac_id[IWL_MVM_STATION_COUNT]; ++ unsigned long sta_deferred_frames[BITS_TO_LONGS(IWL_MVM_STATION_COUNT)]; + u8 rx_ba_sessions; + + /* configured by mac80211 */ +@@ -1552,8 +1520,6 @@ + void iwl_mvm_set_tx_cmd_rate(struct iwl_mvm *mvm, struct iwl_tx_cmd *tx_cmd, + struct ieee80211_tx_info *info, + struct ieee80211_sta *sta, __le16 fc); +-void iwl_mvm_mac_itxq_xmit(struct ieee80211_hw *hw, struct ieee80211_txq *txq); +- + #ifdef CONFIG_IWLWIFI_DEBUG + const char *iwl_mvm_get_tx_fail_reason(u32 status); + #else +@@ -1684,6 +1650,7 @@ + int iwl_mvm_mac_ctxt_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif, + bool force_assoc_off, const u8 *bssid_override); + int iwl_mvm_mac_ctxt_remove(struct iwl_mvm *mvm, struct ieee80211_vif *vif); ++u32 iwl_mvm_mac_get_queues_mask(struct ieee80211_vif *vif); + int iwl_mvm_mac_ctxt_beacon_changed(struct iwl_mvm *mvm, + struct ieee80211_vif *vif); + int iwl_mvm_mac_ctxt_send_beacon(struct iwl_mvm *mvm, +@@ -1710,6 +1677,8 @@ + struct iwl_rx_cmd_buffer *rxb); + void iwl_mvm_mac_ctxt_recalc_tsf_id(struct iwl_mvm *mvm, + struct ieee80211_vif *vif); ++unsigned long iwl_mvm_get_used_hw_queues(struct iwl_mvm *mvm, ++ struct ieee80211_vif *exclude_vif); + void iwl_mvm_probe_resp_data_notif(struct iwl_mvm *mvm, + struct iwl_rx_cmd_buffer *rxb); + void iwl_mvm_channel_switch_noa_notif(struct iwl_mvm *mvm, +@@ -2020,6 +1989,10 @@ + iwl_fw_dump_conf_clear(&mvm->fwrt); + } + ++/* Stop/start all mac queues in a given bitmap */ ++void iwl_mvm_start_mac_queues(struct iwl_mvm *mvm, unsigned long mq); ++void iwl_mvm_stop_mac_queues(struct iwl_mvm *mvm, unsigned long mq); ++ + /* Re-configure the SCD for a queue that has already been configured */ + int iwl_mvm_reconfig_scd(struct iwl_mvm *mvm, int queue, int fifo, int sta_id, + int tid, int frame_limit, u16 ssn); +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-07-31 18:50:59.172983228 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-07-31 18:51:11.754815240 +0200 +@@ -707,7 +707,6 @@ + INIT_DELAYED_WORK(&mvm->tdls_cs.dwork, iwl_mvm_tdls_ch_switch_work); + INIT_DELAYED_WORK(&mvm->scan_timeout_dwork, iwl_mvm_scan_timeout_wk); + INIT_WORK(&mvm->add_stream_wk, iwl_mvm_add_new_dqa_stream_wk); +- INIT_LIST_HEAD(&mvm->add_stream_txqs); + + spin_lock_init(&mvm->d0i3_tx_lock); + spin_lock_init(&mvm->refs_lock); +@@ -1091,6 +1090,24 @@ + iwl_mvm_rx_common(mvm, rxb, pkt); + } + ++void iwl_mvm_stop_mac_queues(struct iwl_mvm *mvm, unsigned long mq) ++{ ++ int q; ++ ++ if (WARN_ON_ONCE(!mq)) ++ return; ++ ++ for_each_set_bit(q, &mq, IEEE80211_MAX_QUEUES) { ++ if (atomic_inc_return(&mvm->mac80211_queue_stop_count[q]) > 1) { ++ IWL_DEBUG_TX_QUEUES(mvm, ++ "mac80211 %d already stopped\n", q); ++ continue; ++ } ++ ++ ieee80211_stop_queue(mvm->hw, q); ++ } ++} ++ + static void iwl_mvm_async_cb(struct iwl_op_mode *op_mode, + const struct iwl_device_cmd *cmd) + { +@@ -1103,66 +1120,38 @@ + iwl_trans_block_txq_ptrs(mvm->trans, false); + } + +-static void iwl_mvm_queue_state_change(struct iwl_op_mode *op_mode, +- int hw_queue, bool start) ++static void iwl_mvm_stop_sw_queue(struct iwl_op_mode *op_mode, int hw_queue) + { + struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); +- struct ieee80211_sta *sta; +- struct ieee80211_txq *txq; +- struct iwl_mvm_txq *mvmtxq; +- int i; +- unsigned long tid_bitmap; +- struct iwl_mvm_sta *mvmsta; +- u8 sta_id; +- +- sta_id = iwl_mvm_has_new_tx_api(mvm) ? +- mvm->tvqm_info[hw_queue].sta_id : +- mvm->queue_info[hw_queue].ra_sta_id; +- +- if (WARN_ON_ONCE(sta_id >= ARRAY_SIZE(mvm->fw_id_to_mac_id))) +- return; ++ unsigned long mq = mvm->hw_queue_to_mac80211[hw_queue]; + +- rcu_read_lock(); +- +- sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); +- if (IS_ERR_OR_NULL(sta)) +- goto out; +- mvmsta = iwl_mvm_sta_from_mac80211(sta); +- +- if (iwl_mvm_has_new_tx_api(mvm)) { +- int tid = mvm->tvqm_info[hw_queue].txq_tid; +- +- tid_bitmap = BIT(tid); +- } else { +- tid_bitmap = mvm->queue_info[hw_queue].tid_bitmap; +- } ++ iwl_mvm_stop_mac_queues(mvm, mq); ++} + +- for_each_set_bit(i, &tid_bitmap, IWL_MAX_TID_COUNT + 1) { +- int tid = i; ++void iwl_mvm_start_mac_queues(struct iwl_mvm *mvm, unsigned long mq) ++{ ++ int q; + +- if (tid == IWL_MAX_TID_COUNT) +- tid = IEEE80211_NUM_TIDS; ++ if (WARN_ON_ONCE(!mq)) ++ return; + +- txq = sta->txq[tid]; +- mvmtxq = iwl_mvm_txq_from_mac80211(txq); +- mvmtxq->stopped = !start; ++ for_each_set_bit(q, &mq, IEEE80211_MAX_QUEUES) { ++ if (atomic_dec_return(&mvm->mac80211_queue_stop_count[q]) > 0) { ++ IWL_DEBUG_TX_QUEUES(mvm, ++ "mac80211 %d still stopped\n", q); ++ continue; ++ } + +- if (start && mvmsta->sta_state != IEEE80211_STA_NOTEXIST) +- iwl_mvm_mac_itxq_xmit(mvm->hw, txq); ++ ieee80211_wake_queue(mvm->hw, q); + } +- +-out: +- rcu_read_unlock(); +-} +- +-static void iwl_mvm_stop_sw_queue(struct iwl_op_mode *op_mode, int hw_queue) +-{ +- iwl_mvm_queue_state_change(op_mode, hw_queue, false); + } + + static void iwl_mvm_wake_sw_queue(struct iwl_op_mode *op_mode, int hw_queue) + { +- iwl_mvm_queue_state_change(op_mode, hw_queue, true); ++ struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); ++ unsigned long mq = mvm->hw_queue_to_mac80211[hw_queue]; ++ ++ iwl_mvm_start_mac_queues(mvm, mq); + } + + static void iwl_mvm_set_rfkill_state(struct iwl_mvm *mvm) +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/sta.c 2019-07-31 18:50:53.312061481 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/sta.c 2019-07-31 18:51:11.755815227 +0200 +@@ -353,16 +353,24 @@ + &cmd, &status); + } + +-static int iwl_mvm_disable_txq(struct iwl_mvm *mvm, struct ieee80211_sta *sta, +- int queue, u8 tid, u8 flags) ++static int iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, ++ int mac80211_queue, u8 tid, u8 flags) + { + struct iwl_scd_txq_cfg_cmd cmd = { + .scd_queue = queue, + .action = SCD_CFG_DISABLE_QUEUE, + }; ++ bool remove_mac_queue = mac80211_queue != IEEE80211_INVAL_HW_QUEUE; + int ret; + ++ if (WARN_ON(remove_mac_queue && mac80211_queue >= IEEE80211_MAX_QUEUES)) ++ return -EINVAL; ++ + if (iwl_mvm_has_new_tx_api(mvm)) { ++ if (remove_mac_queue) ++ mvm->hw_queue_to_mac80211[queue] &= ++ ~BIT(mac80211_queue); ++ + iwl_trans_txq_free(mvm->trans, queue); + + return 0; +@@ -373,15 +381,36 @@ + + mvm->queue_info[queue].tid_bitmap &= ~BIT(tid); + ++ /* ++ * If there is another TID with the same AC - don't remove the MAC queue ++ * from the mapping ++ */ ++ if (tid < IWL_MAX_TID_COUNT) { ++ unsigned long tid_bitmap = ++ mvm->queue_info[queue].tid_bitmap; ++ int ac = tid_to_mac80211_ac[tid]; ++ int i; ++ ++ for_each_set_bit(i, &tid_bitmap, IWL_MAX_TID_COUNT) { ++ if (tid_to_mac80211_ac[i] == ac) ++ remove_mac_queue = false; ++ } ++ } ++ ++ if (remove_mac_queue) ++ mvm->hw_queue_to_mac80211[queue] &= ++ ~BIT(mac80211_queue); ++ + cmd.action = mvm->queue_info[queue].tid_bitmap ? + SCD_CFG_ENABLE_QUEUE : SCD_CFG_DISABLE_QUEUE; + if (cmd.action == SCD_CFG_DISABLE_QUEUE) + mvm->queue_info[queue].status = IWL_MVM_QUEUE_FREE; + + IWL_DEBUG_TX_QUEUES(mvm, +- "Disabling TXQ #%d tids=0x%x\n", ++ "Disabling TXQ #%d tids=0x%x (mac80211 map:0x%x)\n", + queue, +- mvm->queue_info[queue].tid_bitmap); ++ mvm->queue_info[queue].tid_bitmap, ++ mvm->hw_queue_to_mac80211[queue]); + + /* If the queue is still enabled - nothing left to do in this func */ + if (cmd.action == SCD_CFG_ENABLE_QUEUE) +@@ -391,19 +420,15 @@ + cmd.tid = mvm->queue_info[queue].txq_tid; + + /* Make sure queue info is correct even though we overwrite it */ +- WARN(mvm->queue_info[queue].tid_bitmap, +- "TXQ #%d info out-of-sync - tids=0x%x\n", +- queue, mvm->queue_info[queue].tid_bitmap); ++ WARN(mvm->queue_info[queue].tid_bitmap || ++ mvm->hw_queue_to_mac80211[queue], ++ "TXQ #%d info out-of-sync - mac map=0x%x, tids=0x%x\n", ++ queue, mvm->hw_queue_to_mac80211[queue], ++ mvm->queue_info[queue].tid_bitmap); + + /* If we are here - the queue is freed and we can zero out these vals */ + mvm->queue_info[queue].tid_bitmap = 0; +- +- if (sta) { +- struct iwl_mvm_txq *mvmtxq = +- iwl_mvm_txq_from_tid(sta, tid); +- +- mvmtxq->txq_id = IWL_MVM_INVALID_QUEUE; +- } ++ mvm->hw_queue_to_mac80211[queue] = 0; + + /* Regardless if this is a reserved TXQ for a STA - mark it as false */ + mvm->queue_info[queue].reserved = false; +@@ -489,14 +514,9 @@ + spin_lock_bh(&mvmsta->lock); + /* Unmap MAC queues and TIDs from this queue */ + for_each_set_bit(tid, &tid_bitmap, IWL_MAX_TID_COUNT + 1) { +- struct iwl_mvm_txq *mvmtxq = +- iwl_mvm_txq_from_tid(sta, tid); +- + if (mvmsta->tid_data[tid].state == IWL_AGG_ON) + disable_agg_tids |= BIT(tid); + mvmsta->tid_data[tid].txq_id = IWL_MVM_INVALID_QUEUE; +- +- mvmtxq->txq_id = IWL_MVM_INVALID_QUEUE; + } + + mvmsta->tfd_queue_msk &= ~BIT(queue); /* Don't use this queue anymore */ +@@ -518,11 +538,10 @@ + } + + static int iwl_mvm_free_inactive_queue(struct iwl_mvm *mvm, int queue, +- struct ieee80211_sta *old_sta, + u8 new_sta_id) + { + struct iwl_mvm_sta *mvmsta; +- u8 sta_id, tid; ++ u8 txq_curr_ac, sta_id, tid; + unsigned long disable_agg_tids = 0; + bool same_sta; + int ret; +@@ -532,6 +551,7 @@ + if (WARN_ON(iwl_mvm_has_new_tx_api(mvm))) + return -EINVAL; + ++ txq_curr_ac = mvm->queue_info[queue].mac80211_ac; + sta_id = mvm->queue_info[queue].ra_sta_id; + tid = mvm->queue_info[queue].txq_tid; + +@@ -547,7 +567,9 @@ + iwl_mvm_invalidate_sta_queue(mvm, queue, + disable_agg_tids, false); + +- ret = iwl_mvm_disable_txq(mvm, old_sta, queue, tid, 0); ++ ret = iwl_mvm_disable_txq(mvm, queue, ++ mvmsta->vif->hw_queue[txq_curr_ac], ++ tid, 0); + if (ret) { + IWL_ERR(mvm, + "Failed to free inactive queue %d (ret=%d)\n", +@@ -637,15 +659,16 @@ + * in such a case, otherwise - if no redirection required - it does nothing, + * unless the %force param is true. + */ +-static int iwl_mvm_redirect_queue(struct iwl_mvm *mvm, int queue, int tid, +- int ac, int ssn, unsigned int wdg_timeout, +- bool force, struct iwl_mvm_txq *txq) ++static int iwl_mvm_scd_queue_redirect(struct iwl_mvm *mvm, int queue, int tid, ++ int ac, int ssn, unsigned int wdg_timeout, ++ bool force) + { + struct iwl_scd_txq_cfg_cmd cmd = { + .scd_queue = queue, + .action = SCD_CFG_DISABLE_QUEUE, + }; + bool shared_queue; ++ unsigned long mq; + int ret; + + if (WARN_ON(iwl_mvm_has_new_tx_api(mvm))) +@@ -669,14 +692,14 @@ + cmd.sta_id = mvm->queue_info[queue].ra_sta_id; + cmd.tx_fifo = iwl_mvm_ac_to_tx_fifo[mvm->queue_info[queue].mac80211_ac]; + cmd.tid = mvm->queue_info[queue].txq_tid; ++ mq = mvm->hw_queue_to_mac80211[queue]; + shared_queue = hweight16(mvm->queue_info[queue].tid_bitmap) > 1; + + IWL_DEBUG_TX_QUEUES(mvm, "Redirecting TXQ #%d to FIFO #%d\n", + queue, iwl_mvm_ac_to_tx_fifo[ac]); + +- /* Stop the queue and wait for it to empty */ +- txq->stopped = true; +- ++ /* Stop MAC queues and wait for this queue to empty */ ++ iwl_mvm_stop_mac_queues(mvm, mq); + ret = iwl_trans_wait_tx_queues_empty(mvm->trans, BIT(queue)); + if (ret) { + IWL_ERR(mvm, "Error draining queue %d before reconfig\n", +@@ -717,8 +740,8 @@ + iwl_trans_txq_set_shared_mode(mvm->trans, queue, true); + + out: +- /* Continue using the queue */ +- txq->stopped = false; ++ /* Continue using the MAC queues */ ++ iwl_mvm_start_mac_queues(mvm, mq); + + return ret; + } +@@ -743,7 +766,7 @@ + return -ENOSPC; + } + +-static int iwl_mvm_tvqm_enable_txq(struct iwl_mvm *mvm, ++static int iwl_mvm_tvqm_enable_txq(struct iwl_mvm *mvm, int mac80211_queue, + u8 sta_id, u8 tid, unsigned int timeout) + { + int queue, size = max_t(u32, IWL_DEFAULT_QUEUE_SIZE, +@@ -768,7 +791,10 @@ + IWL_DEBUG_TX_QUEUES(mvm, "Enabling TXQ #%d for sta %d tid %d\n", + queue, sta_id, tid); + +- IWL_DEBUG_TX_QUEUES(mvm, "Enabling TXQ #%d\n", queue); ++ mvm->hw_queue_to_mac80211[queue] |= BIT(mac80211_queue); ++ IWL_DEBUG_TX_QUEUES(mvm, ++ "Enabling TXQ #%d (mac80211 map:0x%x)\n", ++ queue, mvm->hw_queue_to_mac80211[queue]); + + return queue; + } +@@ -778,10 +804,9 @@ + int tid) + { + struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); +- struct iwl_mvm_txq *mvmtxq = +- iwl_mvm_txq_from_tid(sta, tid); + unsigned int wdg_timeout = + iwl_mvm_get_wd_timeout(mvm, mvmsta->vif, false, false); ++ u8 mac_queue = mvmsta->vif->hw_queue[ac]; + int queue = -1; + + lockdep_assert_held(&mvm->mutex); +@@ -789,16 +814,11 @@ + IWL_DEBUG_TX_QUEUES(mvm, + "Allocating queue for sta %d on tid %d\n", + mvmsta->sta_id, tid); +- queue = iwl_mvm_tvqm_enable_txq(mvm, mvmsta->sta_id, tid, wdg_timeout); ++ queue = iwl_mvm_tvqm_enable_txq(mvm, mac_queue, mvmsta->sta_id, tid, ++ wdg_timeout); + if (queue < 0) + return queue; + +- if (sta) { +- mvmtxq->txq_id = queue; +- mvm->tvqm_info[queue].txq_tid = tid; +- mvm->tvqm_info[queue].sta_id = mvmsta->sta_id; +- } +- + IWL_DEBUG_TX_QUEUES(mvm, "Allocated queue is %d\n", queue); + + spin_lock_bh(&mvmsta->lock); +@@ -808,9 +828,8 @@ + return 0; + } + +-static bool iwl_mvm_update_txq_mapping(struct iwl_mvm *mvm, +- struct ieee80211_sta *sta, +- int queue, u8 sta_id, u8 tid) ++static bool iwl_mvm_update_txq_mapping(struct iwl_mvm *mvm, int queue, ++ int mac80211_queue, u8 sta_id, u8 tid) + { + bool enable_queue = true; + +@@ -825,6 +844,14 @@ + if (mvm->queue_info[queue].tid_bitmap) + enable_queue = false; + ++ if (mac80211_queue != IEEE80211_INVAL_HW_QUEUE) { ++ WARN(mac80211_queue >= ++ BITS_PER_BYTE * sizeof(mvm->hw_queue_to_mac80211[0]), ++ "cannot track mac80211 queue %d (queue %d, sta %d, tid %d)\n", ++ mac80211_queue, queue, sta_id, tid); ++ mvm->hw_queue_to_mac80211[queue] |= BIT(mac80211_queue); ++ } ++ + mvm->queue_info[queue].tid_bitmap |= BIT(tid); + mvm->queue_info[queue].ra_sta_id = sta_id; + +@@ -838,22 +865,16 @@ + mvm->queue_info[queue].txq_tid = tid; + } + +- if (sta) { +- struct iwl_mvm_txq *mvmtxq = +- iwl_mvm_txq_from_tid(sta, tid); +- +- mvmtxq->txq_id = queue; +- } +- + IWL_DEBUG_TX_QUEUES(mvm, +- "Enabling TXQ #%d tids=0x%x\n", +- queue, mvm->queue_info[queue].tid_bitmap); ++ "Enabling TXQ #%d tids=0x%x (mac80211 map:0x%x)\n", ++ queue, mvm->queue_info[queue].tid_bitmap, ++ mvm->hw_queue_to_mac80211[queue]); + + return enable_queue; + } + +-static bool iwl_mvm_enable_txq(struct iwl_mvm *mvm, struct ieee80211_sta *sta, +- int queue, u16 ssn, ++static bool iwl_mvm_enable_txq(struct iwl_mvm *mvm, int queue, ++ int mac80211_queue, u16 ssn, + const struct iwl_trans_txq_scd_cfg *cfg, + unsigned int wdg_timeout) + { +@@ -873,7 +894,8 @@ + return false; + + /* Send the enabling command if we need to */ +- if (!iwl_mvm_update_txq_mapping(mvm, sta, queue, cfg->sta_id, cfg->tid)) ++ if (!iwl_mvm_update_txq_mapping(mvm, queue, mac80211_queue, ++ cfg->sta_id, cfg->tid)) + return false; + + inc_ssn = iwl_trans_txq_enable_cfg(mvm->trans, queue, ssn, +@@ -966,10 +988,9 @@ + + ssn = IEEE80211_SEQ_TO_SN(mvmsta->tid_data[tid].seq_number); + +- ret = iwl_mvm_redirect_queue(mvm, queue, tid, +- tid_to_mac80211_ac[tid], ssn, +- wdg_timeout, true, +- iwl_mvm_txq_from_tid(sta, tid)); ++ ret = iwl_mvm_scd_queue_redirect(mvm, queue, tid, ++ tid_to_mac80211_ac[tid], ssn, ++ wdg_timeout, true); + if (ret) { + IWL_ERR(mvm, "Failed to redirect TXQ %d\n", queue); + return; +@@ -1046,9 +1067,11 @@ + * Remove the ones that did. + */ + for_each_set_bit(tid, &tid_bitmap, IWL_MAX_TID_COUNT + 1) { ++ int mac_queue = mvmsta->vif->hw_queue[tid_to_mac80211_ac[tid]]; + u16 tid_bitmap; + + mvmsta->tid_data[tid].txq_id = IWL_MVM_INVALID_QUEUE; ++ mvm->hw_queue_to_mac80211[queue] &= ~BIT(mac_queue); + mvm->queue_info[queue].tid_bitmap &= ~BIT(tid); + + tid_bitmap = mvm->queue_info[queue].tid_bitmap; +@@ -1081,6 +1104,10 @@ + * sure all TIDs have existing corresponding mac queues enabled + */ + tid_bitmap = mvm->queue_info[queue].tid_bitmap; ++ for_each_set_bit(tid, &tid_bitmap, IWL_MAX_TID_COUNT + 1) { ++ mvm->hw_queue_to_mac80211[queue] |= ++ BIT(mvmsta->vif->hw_queue[tid_to_mac80211_ac[tid]]); ++ } + + /* If the queue is marked as shared - "unshare" it */ + if (hweight16(mvm->queue_info[queue].tid_bitmap) == 1 && +@@ -1108,7 +1135,6 @@ + unsigned long unshare_queues = 0; + unsigned long changetid_queues = 0; + int i, ret, free_queue = -ENOSPC; +- struct ieee80211_sta *queue_owner = NULL; + + lockdep_assert_held(&mvm->mutex); + +@@ -1174,14 +1200,13 @@ + inactive_tid_bitmap, + &unshare_queues, + &changetid_queues); +- if (ret >= 0 && free_queue < 0) { +- queue_owner = sta; ++ if (ret >= 0 && free_queue < 0) + free_queue = ret; +- } + /* only unlock sta lock - we still need the queue info lock */ + spin_unlock_bh(&mvmsta->lock); + } + ++ rcu_read_unlock(); + + /* Reconfigure queues requiring reconfiguation */ + for_each_set_bit(i, &unshare_queues, IWL_MAX_HW_QUEUES) +@@ -1190,21 +1215,18 @@ + iwl_mvm_change_queue_tid(mvm, i); + + if (free_queue >= 0 && alloc_for_sta != IWL_MVM_INVALID_STA) { +- ret = iwl_mvm_free_inactive_queue(mvm, free_queue, queue_owner, ++ ret = iwl_mvm_free_inactive_queue(mvm, free_queue, + alloc_for_sta); +- if (ret) { +- rcu_read_unlock(); ++ if (ret) + return ret; +- } + } + +- rcu_read_unlock(); +- + return free_queue; + } + + static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm, +- struct ieee80211_sta *sta, u8 ac, int tid) ++ struct ieee80211_sta *sta, u8 ac, int tid, ++ struct ieee80211_hdr *hdr) + { + struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); + struct iwl_trans_txq_scd_cfg cfg = { +@@ -1215,6 +1237,7 @@ + }; + unsigned int wdg_timeout = + iwl_mvm_get_wd_timeout(mvm, mvmsta->vif, false, false); ++ u8 mac_queue = mvmsta->vif->hw_queue[ac]; + int queue = -1; + unsigned long disable_agg_tids = 0; + enum iwl_mvm_agg_state queue_state; +@@ -1233,7 +1256,12 @@ + ssn = IEEE80211_SEQ_TO_SN(mvmsta->tid_data[tid].seq_number); + spin_unlock_bh(&mvmsta->lock); + +- if (tid == IWL_MAX_TID_COUNT) { ++ /* ++ * Non-QoS, QoS NDP and MGMT frames should go to a MGMT queue, if one ++ * exists ++ */ ++ if (!ieee80211_is_data_qos(hdr->frame_control) || ++ ieee80211_is_qos_nullfunc(hdr->frame_control)) { + queue = iwl_mvm_find_free_queue(mvm, mvmsta->sta_id, + IWL_MVM_DQA_MIN_MGMT_QUEUE, + IWL_MVM_DQA_MAX_MGMT_QUEUE); +@@ -1312,7 +1340,8 @@ + } + } + +- inc_ssn = iwl_mvm_enable_txq(mvm, sta, queue, ssn, &cfg, wdg_timeout); ++ inc_ssn = iwl_mvm_enable_txq(mvm, queue, mac_queue, ++ ssn, &cfg, wdg_timeout); + + /* + * Mark queue as shared in transport if shared +@@ -1354,9 +1383,8 @@ + } + } else { + /* Redirect queue, if needed */ +- ret = iwl_mvm_redirect_queue(mvm, queue, tid, ac, ssn, +- wdg_timeout, false, +- iwl_mvm_txq_from_tid(sta, tid)); ++ ret = iwl_mvm_scd_queue_redirect(mvm, queue, tid, ac, ssn, ++ wdg_timeout, false); + if (ret) + goto out_err; + } +@@ -1364,7 +1392,7 @@ + return 0; + + out_err: +- iwl_mvm_disable_txq(mvm, sta, queue, tid, 0); ++ iwl_mvm_disable_txq(mvm, queue, mac_queue, tid, 0); + + return ret; + } +@@ -1377,34 +1405,87 @@ + return tid_to_mac80211_ac[tid]; + } + ++static void iwl_mvm_tx_deferred_stream(struct iwl_mvm *mvm, ++ struct ieee80211_sta *sta, int tid) ++{ ++ struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); ++ struct iwl_mvm_tid_data *tid_data = &mvmsta->tid_data[tid]; ++ struct sk_buff *skb; ++ struct ieee80211_hdr *hdr; ++ struct sk_buff_head deferred_tx; ++ u8 mac_queue; ++ bool no_queue = false; /* Marks if there is a problem with the queue */ ++ u8 ac; ++ ++ lockdep_assert_held(&mvm->mutex); ++ ++ skb = skb_peek(&tid_data->deferred_tx_frames); ++ if (!skb) ++ return; ++ hdr = (void *)skb->data; ++ ++ ac = iwl_mvm_tid_to_ac_queue(tid); ++ mac_queue = IEEE80211_SKB_CB(skb)->hw_queue; ++ ++ if (tid_data->txq_id == IWL_MVM_INVALID_QUEUE && ++ iwl_mvm_sta_alloc_queue(mvm, sta, ac, tid, hdr)) { ++ IWL_ERR(mvm, ++ "Can't alloc TXQ for sta %d tid %d - dropping frame\n", ++ mvmsta->sta_id, tid); ++ ++ /* ++ * Mark queue as problematic so later the deferred traffic is ++ * freed, as we can do nothing with it ++ */ ++ no_queue = true; ++ } ++ ++ __skb_queue_head_init(&deferred_tx); ++ ++ /* Disable bottom-halves when entering TX path */ ++ local_bh_disable(); ++ spin_lock(&mvmsta->lock); ++ skb_queue_splice_init(&tid_data->deferred_tx_frames, &deferred_tx); ++ mvmsta->deferred_traffic_tid_map &= ~BIT(tid); ++ spin_unlock(&mvmsta->lock); ++ ++ while ((skb = __skb_dequeue(&deferred_tx))) ++ if (no_queue || iwl_mvm_tx_skb(mvm, skb, sta)) ++ ieee80211_free_txskb(mvm->hw, skb); ++ local_bh_enable(); ++ ++ /* Wake queue */ ++ iwl_mvm_start_mac_queues(mvm, BIT(mac_queue)); ++} ++ + void iwl_mvm_add_new_dqa_stream_wk(struct work_struct *wk) + { + struct iwl_mvm *mvm = container_of(wk, struct iwl_mvm, + add_stream_wk); ++ struct ieee80211_sta *sta; ++ struct iwl_mvm_sta *mvmsta; ++ unsigned long deferred_tid_traffic; ++ int sta_id, tid; + + mutex_lock(&mvm->mutex); + + iwl_mvm_inactivity_check(mvm, IWL_MVM_INVALID_STA); + +- while (!list_empty(&mvm->add_stream_txqs)) { +- struct iwl_mvm_txq *mvmtxq; +- struct ieee80211_txq *txq; +- u8 tid; +- +- mvmtxq = list_first_entry(&mvm->add_stream_txqs, +- struct iwl_mvm_txq, list); +- +- txq = container_of((void *)mvmtxq, struct ieee80211_txq, +- drv_priv); +- tid = txq->tid; +- if (tid == IEEE80211_NUM_TIDS) +- tid = IWL_MAX_TID_COUNT; +- +- iwl_mvm_sta_alloc_queue(mvm, txq->sta, txq->ac, tid); +- list_del_init(&mvmtxq->list); +- local_bh_disable(); +- iwl_mvm_mac_itxq_xmit(mvm->hw, txq); +- local_bh_enable(); ++ /* Go over all stations with deferred traffic */ ++ for_each_set_bit(sta_id, mvm->sta_deferred_frames, ++ IWL_MVM_STATION_COUNT) { ++ clear_bit(sta_id, mvm->sta_deferred_frames); ++ sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], ++ lockdep_is_held(&mvm->mutex)); ++ if (IS_ERR_OR_NULL(sta)) ++ continue; ++ ++ mvmsta = iwl_mvm_sta_from_mac80211(sta); ++ deferred_tid_traffic = mvmsta->deferred_traffic_tid_map; ++ ++ for_each_set_bit(tid, &deferred_tid_traffic, ++ IWL_MAX_TID_COUNT + 1) ++ iwl_mvm_tx_deferred_stream(mvm, sta, tid); + } + + mutex_unlock(&mvm->mutex); +@@ -1460,11 +1541,10 @@ + * Note that re-enabling aggregations isn't done in this function. + */ + static void iwl_mvm_realloc_queues_after_restart(struct iwl_mvm *mvm, +- struct ieee80211_sta *sta) ++ struct iwl_mvm_sta *mvm_sta) + { +- struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta); +- unsigned int wdg = +- iwl_mvm_get_wd_timeout(mvm, mvm_sta->vif, false, false); ++ unsigned int wdg_timeout = ++ iwl_mvm_get_wd_timeout(mvm, mvm_sta->vif, false, false); + int i; + struct iwl_trans_txq_scd_cfg cfg = { + .sta_id = mvm_sta->sta_id, +@@ -1480,18 +1560,23 @@ + struct iwl_mvm_tid_data *tid_data = &mvm_sta->tid_data[i]; + int txq_id = tid_data->txq_id; + int ac; ++ u8 mac_queue; + + if (txq_id == IWL_MVM_INVALID_QUEUE) + continue; + ++ skb_queue_head_init(&tid_data->deferred_tx_frames); ++ + ac = tid_to_mac80211_ac[i]; ++ mac_queue = mvm_sta->vif->hw_queue[ac]; + + if (iwl_mvm_has_new_tx_api(mvm)) { + IWL_DEBUG_TX_QUEUES(mvm, + "Re-mapping sta %d tid %d\n", + mvm_sta->sta_id, i); +- txq_id = iwl_mvm_tvqm_enable_txq(mvm, mvm_sta->sta_id, +- i, wdg); ++ txq_id = iwl_mvm_tvqm_enable_txq(mvm, mac_queue, ++ mvm_sta->sta_id, ++ i, wdg_timeout); + tid_data->txq_id = txq_id; + + /* +@@ -1514,7 +1599,8 @@ + "Re-mapping sta %d tid %d to queue %d\n", + mvm_sta->sta_id, i, txq_id); + +- iwl_mvm_enable_txq(mvm, sta, txq_id, seq, &cfg, wdg); ++ iwl_mvm_enable_txq(mvm, txq_id, mac_queue, seq, &cfg, ++ wdg_timeout); + mvm->queue_info[txq_id].status = IWL_MVM_QUEUE_READY; + } + } +@@ -1604,7 +1690,7 @@ + if (ret) + goto err; + +- iwl_mvm_realloc_queues_after_restart(mvm, sta); ++ iwl_mvm_realloc_queues_after_restart(mvm, mvm_sta); + sta_update = true; + sta_flags = iwl_mvm_has_new_tx_api(mvm) ? 0 : STA_MODIFY_QUEUES; + goto update_fw; +@@ -1637,17 +1723,9 @@ + * frames until the queue is allocated + */ + mvm_sta->tid_data[i].txq_id = IWL_MVM_INVALID_QUEUE; ++ skb_queue_head_init(&mvm_sta->tid_data[i].deferred_tx_frames); + } +- +- for (i = 0; i < ARRAY_SIZE(sta->txq); i++) { +- struct iwl_mvm_txq *mvmtxq = +- iwl_mvm_txq_from_mac80211(sta->txq[i]); +- +- mvmtxq->txq_id = IWL_MVM_INVALID_QUEUE; +- INIT_LIST_HEAD(&mvmtxq->list); +- atomic_set(&mvmtxq->tx_request, 0); +- } +- ++ mvm_sta->deferred_traffic_tid_map = 0; + mvm_sta->agg_tids = 0; + + if (iwl_mvm_has_new_rx_api(mvm) && +@@ -1782,9 +1860,9 @@ + + static void iwl_mvm_disable_sta_queues(struct iwl_mvm *mvm, + struct ieee80211_vif *vif, +- struct ieee80211_sta *sta) ++ struct iwl_mvm_sta *mvm_sta) + { +- struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta); ++ int ac; + int i; + + lockdep_assert_held(&mvm->mutex); +@@ -1793,17 +1871,11 @@ + if (mvm_sta->tid_data[i].txq_id == IWL_MVM_INVALID_QUEUE) + continue; + +- iwl_mvm_disable_txq(mvm, sta, mvm_sta->tid_data[i].txq_id, i, +- 0); ++ ac = iwl_mvm_tid_to_ac_queue(i); ++ iwl_mvm_disable_txq(mvm, mvm_sta->tid_data[i].txq_id, ++ vif->hw_queue[ac], i, 0); + mvm_sta->tid_data[i].txq_id = IWL_MVM_INVALID_QUEUE; + } +- +- for (i = 0; i < ARRAY_SIZE(sta->txq); i++) { +- struct iwl_mvm_txq *mvmtxq = +- iwl_mvm_txq_from_mac80211(sta->txq[i]); +- +- mvmtxq->txq_id = IWL_MVM_INVALID_QUEUE; +- } + } + + int iwl_mvm_wait_sta_queues_empty(struct iwl_mvm *mvm, +@@ -1865,7 +1937,7 @@ + + ret = iwl_mvm_drain_sta(mvm, mvm_sta, false); + +- iwl_mvm_disable_sta_queues(mvm, vif, sta); ++ iwl_mvm_disable_sta_queues(mvm, vif, mvm_sta); + + /* If there is a TXQ still marked as reserved - free it */ + if (mvm_sta->reserved_queue != IEEE80211_INVAL_HW_QUEUE) { +@@ -1971,7 +2043,7 @@ + + if (iwl_mvm_has_new_tx_api(mvm)) { + int tvqm_queue = +- iwl_mvm_tvqm_enable_txq(mvm, sta_id, ++ iwl_mvm_tvqm_enable_txq(mvm, *queue, sta_id, + IWL_MAX_TID_COUNT, + wdg_timeout); + *queue = tvqm_queue; +@@ -1984,7 +2056,7 @@ + .frame_limit = IWL_FRAME_LIMIT, + }; + +- iwl_mvm_enable_txq(mvm, NULL, *queue, 0, &cfg, wdg_timeout); ++ iwl_mvm_enable_txq(mvm, *queue, *queue, 0, &cfg, wdg_timeout); + } + } + +@@ -2062,7 +2134,8 @@ + + lockdep_assert_held(&mvm->mutex); + +- iwl_mvm_disable_txq(mvm, NULL, mvm->snif_queue, IWL_MAX_TID_COUNT, 0); ++ iwl_mvm_disable_txq(mvm, mvm->snif_queue, mvm->snif_queue, ++ IWL_MAX_TID_COUNT, 0); + ret = iwl_mvm_rm_sta_common(mvm, mvm->snif_sta.sta_id); + if (ret) + IWL_WARN(mvm, "Failed sending remove station\n"); +@@ -2123,7 +2196,8 @@ + + bsta->tfd_queue_msk |= BIT(queue); + +- iwl_mvm_enable_txq(mvm, NULL, queue, 0, &cfg, wdg_timeout); ++ iwl_mvm_enable_txq(mvm, queue, vif->hw_queue[0], 0, ++ &cfg, wdg_timeout); + } + + if (vif->type == NL80211_IFTYPE_ADHOC) +@@ -2142,7 +2216,8 @@ + * to firmware so enable queue here - after the station was added + */ + if (iwl_mvm_has_new_tx_api(mvm)) { +- queue = iwl_mvm_tvqm_enable_txq(mvm, bsta->sta_id, ++ queue = iwl_mvm_tvqm_enable_txq(mvm, vif->hw_queue[0], ++ bsta->sta_id, + IWL_MAX_TID_COUNT, + wdg_timeout); + +@@ -2180,7 +2255,7 @@ + return; + } + +- iwl_mvm_disable_txq(mvm, NULL, queue, IWL_MAX_TID_COUNT, 0); ++ iwl_mvm_disable_txq(mvm, queue, vif->hw_queue[0], IWL_MAX_TID_COUNT, 0); + if (iwl_mvm_has_new_tx_api(mvm)) + return; + +@@ -2304,8 +2379,10 @@ + * Note that this is done here as we want to avoid making DQA + * changes in mac80211 layer. + */ +- if (vif->type == NL80211_IFTYPE_ADHOC) +- mvmvif->cab_queue = IWL_MVM_DQA_GCAST_QUEUE; ++ if (vif->type == NL80211_IFTYPE_ADHOC) { ++ vif->cab_queue = IWL_MVM_DQA_GCAST_QUEUE; ++ mvmvif->cab_queue = vif->cab_queue; ++ } + + /* + * While in previous FWs we had to exclude cab queue from TFD queue +@@ -2313,9 +2390,9 @@ + */ + if (!iwl_mvm_has_new_tx_api(mvm) && + fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_STA_TYPE)) { +- iwl_mvm_enable_txq(mvm, NULL, mvmvif->cab_queue, 0, &cfg, +- timeout); +- msta->tfd_queue_msk |= BIT(mvmvif->cab_queue); ++ iwl_mvm_enable_txq(mvm, vif->cab_queue, vif->cab_queue, 0, ++ &cfg, timeout); ++ msta->tfd_queue_msk |= BIT(vif->cab_queue); + } + ret = iwl_mvm_add_int_sta_common(mvm, msta, maddr, + mvmvif->id, mvmvif->color); +@@ -2332,14 +2409,15 @@ + * tfd_queue_mask. + */ + if (iwl_mvm_has_new_tx_api(mvm)) { +- int queue = iwl_mvm_tvqm_enable_txq(mvm, msta->sta_id, ++ int queue = iwl_mvm_tvqm_enable_txq(mvm, vif->cab_queue, ++ msta->sta_id, + 0, + timeout); + mvmvif->cab_queue = queue; + } else if (!fw_has_api(&mvm->fw->ucode_capa, + IWL_UCODE_TLV_API_STA_TYPE)) +- iwl_mvm_enable_txq(mvm, NULL, mvmvif->cab_queue, 0, &cfg, +- timeout); ++ iwl_mvm_enable_txq(mvm, vif->cab_queue, vif->cab_queue, 0, ++ &cfg, timeout); + + return 0; + } +@@ -2410,7 +2488,8 @@ + + iwl_mvm_flush_sta(mvm, &mvmvif->mcast_sta, true, 0); + +- iwl_mvm_disable_txq(mvm, NULL, mvmvif->cab_queue, 0, 0); ++ iwl_mvm_disable_txq(mvm, mvmvif->cab_queue, vif->cab_queue, ++ 0, 0); + + ret = iwl_mvm_rm_sta_common(mvm, mvmvif->mcast_sta.sta_id); + if (ret) +@@ -2946,7 +3025,8 @@ + } + + if (alloc_queue) +- iwl_mvm_enable_txq(mvm, sta, queue, ssn, ++ iwl_mvm_enable_txq(mvm, queue, ++ vif->hw_queue[tid_to_mac80211_ac[tid]], ssn, + &cfg, wdg_timeout); + + /* Send ADD_STA command to enable aggs only if the queue isn't shared */ +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/sta.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/sta.h 2019-06-27 14:54:04.140678253 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/sta.h 2019-07-31 18:51:11.756815213 +0200 +@@ -297,6 +297,7 @@ + + /** + * struct iwl_mvm_tid_data - holds the states for each RA / TID ++ * @deferred_tx_frames: deferred TX frames for this RA/TID + * @seq_number: the next WiFi sequence number to use + * @next_reclaimed: the WiFi sequence number of the next packet to be acked. + * This is basically (last acked packet++). +@@ -317,6 +318,7 @@ + * tpt_meas_start + */ + struct iwl_mvm_tid_data { ++ struct sk_buff_head deferred_tx_frames; + u16 seq_number; + u16 next_reclaimed; + /* The rest is Tx AGG related */ +@@ -425,6 +427,8 @@ + struct iwl_mvm_key_pn __rcu *ptk_pn[4]; + struct iwl_mvm_rxq_dup_data *dup_data; + ++ u16 deferred_traffic_tid_map; ++ + u8 reserved_queue; + + /* Temporary, until the new TLC will control the Tx protection */ +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/tx.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/tx.c 2019-07-31 18:50:40.639230684 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/tx.c 2019-07-31 18:51:11.756815213 +0200 +@@ -605,12 +605,11 @@ + } + + static int iwl_mvm_get_ctrl_vif_queue(struct iwl_mvm *mvm, +- struct ieee80211_tx_info *info, +- struct ieee80211_hdr *hdr) ++ struct ieee80211_tx_info *info, __le16 fc) + { +- struct iwl_mvm_vif *mvmvif = +- iwl_mvm_vif_from_mac80211(info->control.vif); +- __le16 fc = hdr->frame_control; ++ struct iwl_mvm_vif *mvmvif; ++ ++ mvmvif = iwl_mvm_vif_from_mac80211(info->control.vif); + + switch (info->control.vif->type) { + case NL80211_IFTYPE_AP: +@@ -629,9 +628,7 @@ + (!ieee80211_is_bufferable_mmpdu(fc) || + ieee80211_is_deauth(fc) || ieee80211_is_disassoc(fc))) + return mvm->probe_queue; +- +- if (!ieee80211_has_order(fc) && !ieee80211_is_probe_req(fc) && +- is_multicast_ether_addr(hdr->addr1)) ++ if (info->hw_queue == info->control.vif->cab_queue) + return mvmvif->cab_queue; + + WARN_ONCE(info->control.vif->type != NL80211_IFTYPE_ADHOC, +@@ -640,6 +637,8 @@ + case NL80211_IFTYPE_P2P_DEVICE: + if (ieee80211_is_mgmt(fc)) + return mvm->p2p_dev_queue; ++ if (info->hw_queue == info->control.vif->cab_queue) ++ return mvmvif->cab_queue; + + WARN_ON_ONCE(1); + return mvm->p2p_dev_queue; +@@ -717,8 +716,6 @@ + u8 sta_id; + int hdrlen = ieee80211_hdrlen(hdr->frame_control); + __le16 fc = hdr->frame_control; +- bool offchannel = IEEE80211_SKB_CB(skb)->flags & +- IEEE80211_TX_CTL_TX_OFFCHAN; + int queue = -1; + + if (IWL_MVM_NON_TRANSMITTING_AP && ieee80211_is_probe_resp(fc)) +@@ -729,6 +726,11 @@ + if (WARN_ON_ONCE(info.flags & IEEE80211_TX_CTL_AMPDU)) + return -1; + ++ if (WARN_ON_ONCE(info.flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM && ++ (!info.control.vif || ++ info.hw_queue != info.control.vif->cab_queue))) ++ return -1; ++ + if (info.control.vif) { + struct iwl_mvm_vif *mvmvif = + iwl_mvm_vif_from_mac80211(info.control.vif); +@@ -741,12 +743,14 @@ + else + sta_id = mvmvif->mcast_sta.sta_id; + +- queue = iwl_mvm_get_ctrl_vif_queue(mvm, &info, hdr); ++ queue = iwl_mvm_get_ctrl_vif_queue(mvm, &info, ++ hdr->frame_control); ++ + } else if (info.control.vif->type == NL80211_IFTYPE_MONITOR) { + queue = mvm->snif_queue; + sta_id = mvm->snif_sta.sta_id; + } else if (info.control.vif->type == NL80211_IFTYPE_STATION && +- offchannel) { ++ info.hw_queue == IWL_MVM_OFFCHANNEL_QUEUE) { + /* + * IWL_MVM_OFFCHANNEL_QUEUE is used for ROC packets + * that can be used in 2 different types of vifs, P2P & +@@ -760,10 +764,8 @@ + } + } + +- if (queue < 0) { +- IWL_ERR(mvm, "No queue was found. Dropping TX\n"); ++ if (queue < 0) + return -1; +- } + + if (unlikely(ieee80211_is_probe_resp(fc))) + iwl_mvm_probe_resp_set_noa(mvm, skb); +@@ -1006,6 +1008,34 @@ + } + #endif + ++static void iwl_mvm_tx_add_stream(struct iwl_mvm *mvm, ++ struct iwl_mvm_sta *mvm_sta, u8 tid, ++ struct sk_buff *skb) ++{ ++ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); ++ u8 mac_queue = info->hw_queue; ++ struct sk_buff_head *deferred_tx_frames; ++ ++ lockdep_assert_held(&mvm_sta->lock); ++ ++ mvm_sta->deferred_traffic_tid_map |= BIT(tid); ++ set_bit(mvm_sta->sta_id, mvm->sta_deferred_frames); ++ ++ deferred_tx_frames = &mvm_sta->tid_data[tid].deferred_tx_frames; ++ ++ skb_queue_tail(deferred_tx_frames, skb); ++ ++ /* ++ * The first deferred frame should've stopped the MAC queues, so we ++ * should never get a second deferred frame for the RA/TID. ++ * In case of GSO the first packet may have been split, so don't warn. ++ */ ++ if (skb_queue_len(deferred_tx_frames) == 1) { ++ iwl_mvm_stop_mac_queues(mvm, BIT(mac_queue)); ++ schedule_work(&mvm->add_stream_wk); ++ } ++} ++ + /* Check if there are any timed-out TIDs on a given shared TXQ */ + static bool iwl_mvm_txq_should_update(struct iwl_mvm *mvm, int txq_id) + { +@@ -1076,7 +1106,7 @@ + __le16 fc; + u16 seq_number = 0; + u8 tid = IWL_MAX_TID_COUNT; +- u16 txq_id; ++ u16 txq_id = info->hw_queue; + bool is_ampdu = false; + int hdrlen; + +@@ -1145,7 +1175,14 @@ + + WARN_ON_ONCE(info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM); + ++ /* Check if TXQ needs to be allocated or re-activated */ + if (WARN_ONCE(txq_id == IWL_MVM_INVALID_QUEUE, "Invalid TXQ id")) { ++ iwl_mvm_tx_add_stream(mvm, mvmsta, tid, skb); ++ ++ /* ++ * The frame is now deferred, and the worker scheduled ++ * will re-allocate it, so we can free it for now. ++ */ + iwl_trans_free_tx_cmd(mvm->trans, dev_cmd); + spin_unlock(&mvmsta->lock); + return 0; diff --git a/SOURCES/0024-Revert-iwlwifi-nvm-parse-advertise-IEEE80211_VHT_EXT.patch b/SOURCES/0024-Revert-iwlwifi-nvm-parse-advertise-IEEE80211_VHT_EXT.patch new file mode 100644 index 0000000..7a1825b --- /dev/null +++ b/SOURCES/0024-Revert-iwlwifi-nvm-parse-advertise-IEEE80211_VHT_EXT.patch @@ -0,0 +1,46 @@ +From 0b4775b7b2489601ee91d3a61bb939e62954f16d Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 1 Aug 2019 13:51:44 +0200 +Subject: [PATCH 1/4] Revert "iwlwifi: nvm-parse: advertise + IEEE80211_VHT_EXT_NSS_BW_CAPABLE in VHT" + +This reverts commit 5be4b5d930e44e96548472865fecb29a9c5a3bb0. +--- + drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +index 3a5a7dbab9ab..290ef2726f47 100644 +--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c ++++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +@@ -8,7 +8,7 @@ + * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 - 2017 Intel Deutschland GmbH +- * Copyright(c) 2018 - 2019 Intel Corporation ++ * Copyright(c) 2018 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as +@@ -31,7 +31,7 @@ + * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 - 2017 Intel Deutschland GmbH +- * Copyright(c) 2018 - 2019 Intel Corporation ++ * Copyright(c) 2018 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -478,9 +478,6 @@ static void iwl_init_vht_hw_capab(const struct iwl_cfg *cfg, + } + + vht_cap->vht_mcs.tx_mcs_map = vht_cap->vht_mcs.rx_mcs_map; +- +- vht_cap->vht_mcs.tx_highest |= +- cpu_to_le16(IEEE80211_VHT_EXT_NSS_BW_CAPABLE); + } + + static struct ieee80211_sband_iftype_data iwl_he_capa[] = { +-- +2.13.6 + diff --git a/SOURCES/0025-Revert-iwlwifi-mvm-set-HW-capability-VHT_EXT_NSS_BW.patch b/SOURCES/0025-Revert-iwlwifi-mvm-set-HW-capability-VHT_EXT_NSS_BW.patch new file mode 100644 index 0000000..313272c --- /dev/null +++ b/SOURCES/0025-Revert-iwlwifi-mvm-set-HW-capability-VHT_EXT_NSS_BW.patch @@ -0,0 +1,25 @@ +From 5ab76e5fae28344a68281b7bf0484af49e8bc014 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 1 Aug 2019 13:52:12 +0200 +Subject: [PATCH 2/4] Revert "iwlwifi: mvm: set HW capability VHT_EXT_NSS_BW" + +This reverts commit e2fae4db474b0545a4afba2c1382e0daa51375cf. +--- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +index 65f77b06c252..1cc0801461b6 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +@@ -427,7 +427,6 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) + ieee80211_hw_set(hw, SUPPORTS_AMSDU_IN_AMPDU); + ieee80211_hw_set(hw, NEEDS_UNIQUE_STA_ADDR); + ieee80211_hw_set(hw, DEAUTH_NEED_MGD_TX_PREP); +- ieee80211_hw_set(hw, SUPPORTS_VHT_EXT_NSS_BW); + + if (iwl_mvm_has_tlc_offload(mvm)) { + ieee80211_hw_set(hw, TX_AMPDU_SETUP_IN_HW); +-- +2.13.6 + diff --git a/SOURCES/0026-Revert-iwlwifi-mvm-config-mac-ctxt-to-HE-before-TLC.patch b/SOURCES/0026-Revert-iwlwifi-mvm-config-mac-ctxt-to-HE-before-TLC.patch new file mode 100644 index 0000000..4877a45 --- /dev/null +++ b/SOURCES/0026-Revert-iwlwifi-mvm-config-mac-ctxt-to-HE-before-TLC.patch @@ -0,0 +1,45 @@ +From d48db5470be29664cb44b51e822a55c1b4aae61f Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 1 Aug 2019 14:14:21 +0200 +Subject: [PATCH 3/4] Revert "iwlwifi: mvm: config mac ctxt to HE before TLC" + +This reverts commit 95dd8ac154b48451e3ce926cd3af4c7eb42b781e. +--- + drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 3 ++- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 4 ---- + 2 files changed, 2 insertions(+), 5 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c 2019-07-31 18:53:33.747919402 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c 2019-08-01 14:25:56.840586377 +0200 +@@ -776,7 +776,8 @@ + if (vif->probe_req_reg && vif->bss_conf.assoc && vif->p2p) + cmd.filter_flags |= cpu_to_le32(MAC_FILTER_IN_PROBE_REQUEST); + +- if (vif->bss_conf.he_support && !iwlwifi_mod_params.disable_11ax) { ++ if (vif->bss_conf.assoc && vif->bss_conf.he_support && ++ !iwlwifi_mod_params.disable_11ax) { + cmd.filter_flags |= cpu_to_le32(MAC_FILTER_IN_11AX); + if (vif->bss_conf.twt_requester) + ctxt_sta->data_policy |= cpu_to_le32(TWT_SUPPORTED); +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-08-01 14:25:51.083659124 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-08-01 14:25:56.841586365 +0200 +@@ -3100,15 +3100,11 @@ + } else if (old_state == IEEE80211_STA_AUTH && + new_state == IEEE80211_STA_ASSOC) { + if (vif->type == NL80211_IFTYPE_AP) { +- vif->bss_conf.he_support = sta->he_cap.has_he; + mvmvif->ap_assoc_sta_count++; + iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); + if (vif->bss_conf.he_support && + !iwlwifi_mod_params.disable_11ax) + iwl_mvm_cfg_he_sta(mvm, vif, mvm_sta->sta_id); +- } else if (vif->type == NL80211_IFTYPE_STATION) { +- vif->bss_conf.he_support = sta->he_cap.has_he; +- iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); + } + + iwl_mvm_rs_rate_init(mvm, sta, mvmvif->phy_ctxt->channel->band, diff --git a/SOURCES/0027-Revert-iwlwifi-mvm-send-the-STA_HE_CTXT-command-in-A.patch b/SOURCES/0027-Revert-iwlwifi-mvm-send-the-STA_HE_CTXT-command-in-A.patch new file mode 100644 index 0000000..44948d7 --- /dev/null +++ b/SOURCES/0027-Revert-iwlwifi-mvm-send-the-STA_HE_CTXT-command-in-A.patch @@ -0,0 +1,25 @@ +From 1f187d76562086f95e2b1bd70f83b80225036edd Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 1 Aug 2019 14:14:26 +0200 +Subject: [PATCH 4/4] Revert "iwlwifi: mvm: send the STA_HE_CTXT command in AP + mode" + +This reverts commit 1abb08cc133bb25acbc5654450d2ed3b2ad80b73. +--- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 3 --- + 1 file changed, 3 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-08-01 14:25:56.841586365 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-08-01 14:26:11.117405971 +0200 +@@ -3102,9 +3102,6 @@ + if (vif->type == NL80211_IFTYPE_AP) { + mvmvif->ap_assoc_sta_count++; + iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); +- if (vif->bss_conf.he_support && +- !iwlwifi_mod_params.disable_11ax) +- iwl_mvm_cfg_he_sta(mvm, vif, mvm_sta->sta_id); + } + + iwl_mvm_rs_rate_init(mvm, sta, mvmvif->phy_ctxt->channel->band, diff --git a/SOURCES/0028-Revert-iwlwifi-trust-calling-function.patch b/SOURCES/0028-Revert-iwlwifi-trust-calling-function.patch new file mode 100644 index 0000000..967dcfa --- /dev/null +++ b/SOURCES/0028-Revert-iwlwifi-trust-calling-function.patch @@ -0,0 +1,31 @@ +From e7a8266afda457bb661675b67779a38731362c2c Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Mon, 5 Aug 2019 22:51:41 +0200 +Subject: [PATCH 1/2] Revert "iwlwifi: trust calling function" + +This reverts commit 5dcfcc01b7c686f509d214467a2ab0de08284551. +--- + drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +index 290ef2726f47..6d14689b8ff6 100644 +--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c ++++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +@@ -665,7 +665,12 @@ static struct ieee80211_sband_iftype_data iwl_he_capa[] = { + static void iwl_init_he_hw_capab(struct ieee80211_supported_band *sband, + u8 tx_chains, u8 rx_chains) + { +- sband->iftype_data = iwl_he_capa; ++ if (sband->band == NL80211_BAND_2GHZ || ++ sband->band == NL80211_BAND_5GHZ) ++ sband->iftype_data = iwl_he_capa; ++ else ++ return; ++ + sband->n_iftype_data = ARRAY_SIZE(iwl_he_capa); + + /* If not 2x2, we need to indicate 1x1 in the Midamble RX Max NSTS */ +-- +2.13.6 + diff --git a/SOURCES/0029-Revert-iwlwifi-split-HE-capabilities-between-AP-and-.patch b/SOURCES/0029-Revert-iwlwifi-split-HE-capabilities-between-AP-and-.patch new file mode 100644 index 0000000..422dc5b --- /dev/null +++ b/SOURCES/0029-Revert-iwlwifi-split-HE-capabilities-between-AP-and-.patch @@ -0,0 +1,330 @@ +From 5a532e3f0a2790c193a2e83e5ea7b32a43a4770d Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Mon, 5 Aug 2019 22:54:17 +0200 +Subject: [PATCH 2/2] Revert "iwlwifi: split HE capabilities between AP and + STA" + +This reverts commit 57a3a454f30368f9b52ef406feff09571448e84e. +--- + drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 290 +++++++-------------- + 1 file changed, 101 insertions(+), 189 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +index 6d14689b8ff6..bc122d88b423 100644 +--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c ++++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +@@ -480,185 +480,101 @@ static void iwl_init_vht_hw_capab(const struct iwl_cfg *cfg, + vht_cap->vht_mcs.tx_mcs_map = vht_cap->vht_mcs.rx_mcs_map; + } + +-static struct ieee80211_sband_iftype_data iwl_he_capa[] = { +- { +- .types_mask = BIT(NL80211_IFTYPE_STATION), +- .he_cap = { +- .has_he = true, +- .he_cap_elem = { +- .mac_cap_info[0] = +- IEEE80211_HE_MAC_CAP0_HTC_HE | +- IEEE80211_HE_MAC_CAP0_TWT_REQ, +- .mac_cap_info[1] = +- IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US | +- IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8, +- .mac_cap_info[2] = +- IEEE80211_HE_MAC_CAP2_32BIT_BA_BITMAP | +- IEEE80211_HE_MAC_CAP2_MU_CASCADING | +- IEEE80211_HE_MAC_CAP2_ACK_EN, +- .mac_cap_info[3] = +- IEEE80211_HE_MAC_CAP3_OMI_CONTROL | +- IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2, +- .mac_cap_info[4] = +- IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU | +- IEEE80211_HE_MAC_CAP4_MULTI_TID_AGG_TX_QOS_B39, +- .mac_cap_info[5] = +- IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B40 | +- IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B41 | +- IEEE80211_HE_MAC_CAP5_UL_2x996_TONE_RU, +- .phy_cap_info[0] = +- IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G | +- IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G | +- IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G, +- .phy_cap_info[1] = +- IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK | +- IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A | +- IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD | +- IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS, +- .phy_cap_info[2] = +- IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US | +- IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ | +- IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ | +- IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO | +- IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO, +- .phy_cap_info[3] = +- IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_BPSK | +- IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_1 | +- IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_BPSK | +- IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_1, +- .phy_cap_info[4] = +- IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE | +- IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_8 | +- IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_8, +- .phy_cap_info[5] = +- IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_2 | +- IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2 | +- IEEE80211_HE_PHY_CAP5_NG16_SU_FEEDBACK | +- IEEE80211_HE_PHY_CAP5_NG16_MU_FEEDBACK, +- .phy_cap_info[6] = +- IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_42_SU | +- IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_75_MU | +- IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMER_FB | +- IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMER_FB | +- IEEE80211_HE_PHY_CAP6_TRIG_CQI_FB | +- IEEE80211_HE_PHY_CAP6_PARTIAL_BANDWIDTH_DL_MUMIMO | +- IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT, +- .phy_cap_info[7] = +- IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_AR | +- IEEE80211_HE_PHY_CAP7_HE_SU_MU_PPDU_4XLTF_AND_08_US_GI | +- IEEE80211_HE_PHY_CAP7_MAX_NC_1, +- .phy_cap_info[8] = +- IEEE80211_HE_PHY_CAP8_HE_ER_SU_PPDU_4XLTF_AND_08_US_GI | +- IEEE80211_HE_PHY_CAP8_20MHZ_IN_40MHZ_HE_PPDU_IN_2G | +- IEEE80211_HE_PHY_CAP8_20MHZ_IN_160MHZ_HE_PPDU | +- IEEE80211_HE_PHY_CAP8_80MHZ_IN_160MHZ_HE_PPDU | +- IEEE80211_HE_PHY_CAP8_DCM_MAX_BW_160_OR_80P80_MHZ, +- .phy_cap_info[9] = +- IEEE80211_HE_PHY_CAP9_NON_TRIGGERED_CQI_FEEDBACK | +- IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_COMP_SIGB | +- IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_NON_COMP_SIGB, +- }, +- /* +- * Set default Tx/Rx HE MCS NSS Support field. +- * Indicate support for up to 2 spatial streams and all +- * MCS, without any special cases +- */ +- .he_mcs_nss_supp = { +- .rx_mcs_80 = cpu_to_le16(0xfffa), +- .tx_mcs_80 = cpu_to_le16(0xfffa), +- .rx_mcs_160 = cpu_to_le16(0xfffa), +- .tx_mcs_160 = cpu_to_le16(0xfffa), +- .rx_mcs_80p80 = cpu_to_le16(0xffff), +- .tx_mcs_80p80 = cpu_to_le16(0xffff), +- }, +- /* +- * Set default PPE thresholds, with PPET16 set to 0, +- * PPET8 set to 7 +- */ +- .ppe_thres = {0x61, 0x1c, 0xc7, 0x71}, ++static struct ieee80211_sband_iftype_data iwl_he_capa = { ++ .types_mask = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP), ++ .he_cap = { ++ .has_he = true, ++ .he_cap_elem = { ++ .mac_cap_info[0] = ++ IEEE80211_HE_MAC_CAP0_HTC_HE | ++ IEEE80211_HE_MAC_CAP0_TWT_REQ, ++ .mac_cap_info[1] = ++ IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US | ++ IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8, ++ .mac_cap_info[2] = ++ IEEE80211_HE_MAC_CAP2_32BIT_BA_BITMAP | ++ IEEE80211_HE_MAC_CAP2_MU_CASCADING | ++ IEEE80211_HE_MAC_CAP2_ACK_EN, ++ .mac_cap_info[3] = ++ IEEE80211_HE_MAC_CAP3_OMI_CONTROL | ++ IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2, ++ .mac_cap_info[4] = ++ IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU | ++ IEEE80211_HE_MAC_CAP4_MULTI_TID_AGG_TX_QOS_B39, ++ .mac_cap_info[5] = ++ IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B40 | ++ IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B41 | ++ IEEE80211_HE_MAC_CAP5_UL_2x996_TONE_RU, ++ .phy_cap_info[0] = ++ IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G | ++ IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G | ++ IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G, ++ .phy_cap_info[1] = ++ IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK | ++ IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A | ++ IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD | ++ IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS, ++ .phy_cap_info[2] = ++ IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US | ++ IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ | ++ IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ | ++ IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO | ++ IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO, ++ .phy_cap_info[3] = ++ IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_BPSK | ++ IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_1 | ++ IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_BPSK | ++ IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_1, ++ .phy_cap_info[4] = ++ IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE | ++ IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_8 | ++ IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_8, ++ .phy_cap_info[5] = ++ IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_2 | ++ IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2 | ++ IEEE80211_HE_PHY_CAP5_NG16_SU_FEEDBACK | ++ IEEE80211_HE_PHY_CAP5_NG16_MU_FEEDBACK, ++ .phy_cap_info[6] = ++ IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_42_SU | ++ IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_75_MU | ++ IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMER_FB | ++ IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMER_FB | ++ IEEE80211_HE_PHY_CAP6_TRIG_CQI_FB | ++ IEEE80211_HE_PHY_CAP6_PARTIAL_BANDWIDTH_DL_MUMIMO | ++ IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT, ++ .phy_cap_info[7] = ++ IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_AR | ++ IEEE80211_HE_PHY_CAP7_HE_SU_MU_PPDU_4XLTF_AND_08_US_GI | ++ IEEE80211_HE_PHY_CAP7_MAX_NC_1, ++ .phy_cap_info[8] = ++ IEEE80211_HE_PHY_CAP8_HE_ER_SU_PPDU_4XLTF_AND_08_US_GI | ++ IEEE80211_HE_PHY_CAP8_20MHZ_IN_40MHZ_HE_PPDU_IN_2G | ++ IEEE80211_HE_PHY_CAP8_20MHZ_IN_160MHZ_HE_PPDU | ++ IEEE80211_HE_PHY_CAP8_80MHZ_IN_160MHZ_HE_PPDU | ++ IEEE80211_HE_PHY_CAP8_DCM_MAX_BW_160_OR_80P80_MHZ, ++ .phy_cap_info[9] = ++ IEEE80211_HE_PHY_CAP9_NON_TRIGGERED_CQI_FEEDBACK | ++ IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_COMP_SIGB | ++ IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_NON_COMP_SIGB, + }, +- }, +- { +- .types_mask = BIT(NL80211_IFTYPE_AP), +- .he_cap = { +- .has_he = true, +- .he_cap_elem = { +- .mac_cap_info[0] = +- IEEE80211_HE_MAC_CAP0_HTC_HE | +- IEEE80211_HE_MAC_CAP0_TWT_RES, +- .mac_cap_info[1] = +- IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US | +- IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8, +- .mac_cap_info[2] = +- IEEE80211_HE_MAC_CAP2_BSR | +- IEEE80211_HE_MAC_CAP2_MU_CASCADING | +- IEEE80211_HE_MAC_CAP2_ACK_EN, +- .mac_cap_info[3] = +- IEEE80211_HE_MAC_CAP3_OMI_CONTROL | +- IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2, +- .mac_cap_info[4] = +- IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU, +- .phy_cap_info[0] = +- IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G | +- IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G | +- IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G, +- .phy_cap_info[1] = +- IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD | +- IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS, +- .phy_cap_info[2] = +- IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US | +- IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ | +- IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ, +- .phy_cap_info[3] = +- IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_BPSK | +- IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_1 | +- IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_BPSK | +- IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_1, +- .phy_cap_info[4] = +- IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE | +- IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_8 | +- IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_8, +- .phy_cap_info[5] = +- IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_2 | +- IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2 | +- IEEE80211_HE_PHY_CAP5_NG16_SU_FEEDBACK | +- IEEE80211_HE_PHY_CAP5_NG16_MU_FEEDBACK, +- .phy_cap_info[6] = +- IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_42_SU | +- IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_75_MU | +- IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT, +- .phy_cap_info[7] = +- IEEE80211_HE_PHY_CAP7_HE_SU_MU_PPDU_4XLTF_AND_08_US_GI | +- IEEE80211_HE_PHY_CAP7_MAX_NC_1, +- .phy_cap_info[8] = +- IEEE80211_HE_PHY_CAP8_HE_ER_SU_PPDU_4XLTF_AND_08_US_GI | +- IEEE80211_HE_PHY_CAP8_20MHZ_IN_40MHZ_HE_PPDU_IN_2G | +- IEEE80211_HE_PHY_CAP8_20MHZ_IN_160MHZ_HE_PPDU | +- IEEE80211_HE_PHY_CAP8_80MHZ_IN_160MHZ_HE_PPDU | +- IEEE80211_HE_PHY_CAP8_DCM_MAX_BW_160_OR_80P80_MHZ, +- .phy_cap_info[9] = +- IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_COMP_SIGB | +- IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_NON_COMP_SIGB, +- }, +- /* +- * Set default Tx/Rx HE MCS NSS Support field. +- * Indicate support for up to 2 spatial streams and all +- * MCS, without any special cases +- */ +- .he_mcs_nss_supp = { +- .rx_mcs_80 = cpu_to_le16(0xfffa), +- .tx_mcs_80 = cpu_to_le16(0xfffa), +- .rx_mcs_160 = cpu_to_le16(0xfffa), +- .tx_mcs_160 = cpu_to_le16(0xfffa), +- .rx_mcs_80p80 = cpu_to_le16(0xffff), +- .tx_mcs_80p80 = cpu_to_le16(0xffff), +- }, +- /* +- * Set default PPE thresholds, with PPET16 set to 0, +- * PPET8 set to 7 +- */ +- .ppe_thres = {0x61, 0x1c, 0xc7, 0x71}, ++ /* ++ * Set default Tx/Rx HE MCS NSS Support field. Indicate support ++ * for up to 2 spatial streams and all MCS, without any special ++ * cases ++ */ ++ .he_mcs_nss_supp = { ++ .rx_mcs_80 = cpu_to_le16(0xfffa), ++ .tx_mcs_80 = cpu_to_le16(0xfffa), ++ .rx_mcs_160 = cpu_to_le16(0xfffa), ++ .tx_mcs_160 = cpu_to_le16(0xfffa), ++ .rx_mcs_80p80 = cpu_to_le16(0xffff), ++ .tx_mcs_80p80 = cpu_to_le16(0xffff), + }, ++ /* ++ * Set default PPE thresholds, with PPET16 set to 0, PPET8 set ++ * to 7 ++ */ ++ .ppe_thres = {0x61, 0x1c, 0xc7, 0x71}, + }, + }; + +@@ -667,24 +583,20 @@ static void iwl_init_he_hw_capab(struct ieee80211_supported_band *sband, + { + if (sband->band == NL80211_BAND_2GHZ || + sband->band == NL80211_BAND_5GHZ) +- sband->iftype_data = iwl_he_capa; ++ sband->iftype_data = &iwl_he_capa; + else + return; + +- sband->n_iftype_data = ARRAY_SIZE(iwl_he_capa); ++ sband->n_iftype_data = 1; + + /* If not 2x2, we need to indicate 1x1 in the Midamble RX Max NSTS */ + if ((tx_chains & rx_chains) != ANT_AB) { +- int i; +- +- for (i = 0; i < sband->n_iftype_data; i++) { +- iwl_he_capa[i].he_cap.he_cap_elem.phy_cap_info[1] &= +- ~IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS; +- iwl_he_capa[i].he_cap.he_cap_elem.phy_cap_info[2] &= +- ~IEEE80211_HE_PHY_CAP2_MIDAMBLE_RX_TX_MAX_NSTS; +- iwl_he_capa[i].he_cap.he_cap_elem.phy_cap_info[7] &= +- ~IEEE80211_HE_PHY_CAP7_MAX_NC_MASK; +- } ++ iwl_he_capa.he_cap.he_cap_elem.phy_cap_info[1] &= ++ ~IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS; ++ iwl_he_capa.he_cap.he_cap_elem.phy_cap_info[2] &= ++ ~IEEE80211_HE_PHY_CAP2_MIDAMBLE_RX_TX_MAX_NSTS; ++ iwl_he_capa.he_cap.he_cap_elem.phy_cap_info[7] &= ++ ~IEEE80211_HE_PHY_CAP7_MAX_NC_MASK; + } + } + +-- +2.13.6 + diff --git a/SOURCES/0030-Revert-wireless-align-to-draft-11ax-D3.0.patch b/SOURCES/0030-Revert-wireless-align-to-draft-11ax-D3.0.patch new file mode 100644 index 0000000..95cff6e --- /dev/null +++ b/SOURCES/0030-Revert-wireless-align-to-draft-11ax-D3.0.patch @@ -0,0 +1,128 @@ +From fa85f5e990b991cb794bc53be62f7947bfe7850a Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 16:07:45 +0200 +Subject: [PATCH 01/43] Revert "wireless: align to draft 11ax D3.0" + +This reverts commit add7453ad62f05c8f1a48675bb4dfed52e6ac878. +--- + drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 51 ++++++---------------- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 4 ++ + 2 files changed, 17 insertions(+), 38 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-09-05 14:40:03.470473054 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-09-06 01:25:40.500355788 +0200 +@@ -486,40 +486,30 @@ + .has_he = true, + .he_cap_elem = { + .mac_cap_info[0] = +- IEEE80211_HE_MAC_CAP0_HTC_HE | +- IEEE80211_HE_MAC_CAP0_TWT_REQ, ++ IEEE80211_HE_MAC_CAP0_HTC_HE, + .mac_cap_info[1] = + IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US | +- IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8, ++ IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_QOS_8, + .mac_cap_info[2] = + IEEE80211_HE_MAC_CAP2_32BIT_BA_BITMAP | +- IEEE80211_HE_MAC_CAP2_MU_CASCADING | + IEEE80211_HE_MAC_CAP2_ACK_EN, + .mac_cap_info[3] = +- IEEE80211_HE_MAC_CAP3_OMI_CONTROL | +- IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2, +- .mac_cap_info[4] = +- IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU | +- IEEE80211_HE_MAC_CAP4_MULTI_TID_AGG_TX_QOS_B39, +- .mac_cap_info[5] = +- IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B40 | +- IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B41 | +- IEEE80211_HE_MAC_CAP5_UL_2x996_TONE_RU, ++ IEEE80211_HE_MAC_CAP3_GRP_ADDR_MULTI_STA_BA_DL_MU | ++ IEEE80211_HE_MAC_CAP3_MAX_A_AMPDU_LEN_EXP_VHT_2, ++ .mac_cap_info[4] = IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU, + .phy_cap_info[0] = ++ IEEE80211_HE_PHY_CAP0_DUAL_BAND | + IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G | + IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G | + IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G, + .phy_cap_info[1] = +- IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK | + IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A | + IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD | +- IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS, ++ IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_MAX_NSTS, + .phy_cap_info[2] = + IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US | + IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ | +- IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ | +- IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO | +- IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO, ++ IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ, + .phy_cap_info[3] = + IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_BPSK | + IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_1 | +@@ -531,31 +521,18 @@ + IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_8, + .phy_cap_info[5] = + IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_2 | +- IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2 | +- IEEE80211_HE_PHY_CAP5_NG16_SU_FEEDBACK | +- IEEE80211_HE_PHY_CAP5_NG16_MU_FEEDBACK, ++ IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2, + .phy_cap_info[6] = +- IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_42_SU | +- IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_75_MU | +- IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMER_FB | +- IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMER_FB | +- IEEE80211_HE_PHY_CAP6_TRIG_CQI_FB | +- IEEE80211_HE_PHY_CAP6_PARTIAL_BANDWIDTH_DL_MUMIMO | + IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT, + .phy_cap_info[7] = + IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_AR | + IEEE80211_HE_PHY_CAP7_HE_SU_MU_PPDU_4XLTF_AND_08_US_GI | +- IEEE80211_HE_PHY_CAP7_MAX_NC_1, ++ IEEE80211_HE_PHY_CAP7_MAX_NC_7, + .phy_cap_info[8] = + IEEE80211_HE_PHY_CAP8_HE_ER_SU_PPDU_4XLTF_AND_08_US_GI | + IEEE80211_HE_PHY_CAP8_20MHZ_IN_40MHZ_HE_PPDU_IN_2G | + IEEE80211_HE_PHY_CAP8_20MHZ_IN_160MHZ_HE_PPDU | +- IEEE80211_HE_PHY_CAP8_80MHZ_IN_160MHZ_HE_PPDU | +- IEEE80211_HE_PHY_CAP8_DCM_MAX_BW_160_OR_80P80_MHZ, +- .phy_cap_info[9] = +- IEEE80211_HE_PHY_CAP9_NON_TRIGGERED_CQI_FEEDBACK | +- IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_COMP_SIGB | +- IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_NON_COMP_SIGB, ++ IEEE80211_HE_PHY_CAP8_80MHZ_IN_160MHZ_HE_PPDU, + }, + /* + * Set default Tx/Rx HE MCS NSS Support field. Indicate support +@@ -592,11 +569,9 @@ + /* If not 2x2, we need to indicate 1x1 in the Midamble RX Max NSTS */ + if ((tx_chains & rx_chains) != ANT_AB) { + iwl_he_capa.he_cap.he_cap_elem.phy_cap_info[1] &= +- ~IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS; ++ ~IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_MAX_NSTS; + iwl_he_capa.he_cap.he_cap_elem.phy_cap_info[2] &= +- ~IEEE80211_HE_PHY_CAP2_MIDAMBLE_RX_TX_MAX_NSTS; +- iwl_he_capa.he_cap.he_cap_elem.phy_cap_info[7] &= +- ~IEEE80211_HE_PHY_CAP7_MAX_NC_MASK; ++ ~IEEE80211_HE_PHY_CAP2_MIDAMBLE_RX_MAX_NSTS; + } + } + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-05 14:40:03.378474238 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-06 01:25:40.501355775 +0200 +@@ -2090,6 +2090,10 @@ + sta_ctxt_cmd.htc_flags |= + cpu_to_le32(IWL_HE_HTC_LINK_ADAP_BOTH); + } ++ if (sta->he_cap.he_cap_elem.mac_cap_info[2] & ++ IEEE80211_HE_MAC_CAP2_UL_MU_RESP_SCHED) ++ sta_ctxt_cmd.htc_flags |= ++ cpu_to_le32(IWL_HE_HTC_UL_MU_RESP_SCHED); + if (sta->he_cap.he_cap_elem.mac_cap_info[2] & IEEE80211_HE_MAC_CAP2_BSR) + sta_ctxt_cmd.htc_flags |= cpu_to_le32(IWL_HE_HTC_BSR_SUPP); + if (sta->he_cap.he_cap_elem.mac_cap_info[3] & diff --git a/SOURCES/0031-Revert-iwlwifi-add-module-parameter-to-disable-802.1.patch b/SOURCES/0031-Revert-iwlwifi-add-module-parameter-to-disable-802.1.patch new file mode 100644 index 0000000..26004f7 --- /dev/null +++ b/SOURCES/0031-Revert-iwlwifi-add-module-parameter-to-disable-802.1.patch @@ -0,0 +1,92 @@ +From f3623b10c8d9adac4a7e777a05972c934ac50560 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 16:15:33 +0200 +Subject: [PATCH 02/43] Revert "iwlwifi: add module parameter to disable + 802.11ax" + +This reverts commit 230ba6c5a9df33bbd6ad5980a3f8dc446c3e881f. +--- + drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 4 ---- + drivers/net/wireless/intel/iwlwifi/iwl-modparams.h | 4 ---- + drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 4 ++-- + drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 3 +-- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 3 +-- + 5 files changed, 4 insertions(+), 14 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/iwl-drv.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/iwl-drv.c 2019-06-27 14:54:04.129678386 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/iwl-drv.c 2019-09-06 01:25:40.743352688 +0200 +@@ -1860,7 +1860,3 @@ + 0444); + MODULE_PARM_DESC(remove_when_gone, + "Remove dev from PCIe bus if it is deemed inaccessible (default: false)"); +- +-module_param_named(disable_11ax, iwlwifi_mod_params.disable_11ax, bool, +- S_IRUGO); +-MODULE_PARM_DESC(disable_11ax, "Disable HE capabilities (default: false)"); +Index: src/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h 2019-06-27 14:54:04.130678374 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h 2019-09-06 01:25:40.743352688 +0200 +@@ -144,10 +144,6 @@ + bool lar_disable; + bool fw_monitor; + bool disable_11ac; +- /** +- * @disable_11ax: disable HE capabilities, default = false +- */ +- bool disable_11ax; + bool remove_when_gone; + bool enable_ini; + }; +Index: src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-09-06 01:25:40.500355788 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-09-06 01:25:40.744352675 +0200 +@@ -595,7 +595,7 @@ + iwl_init_ht_hw_capab(cfg, data, &sband->ht_cap, NL80211_BAND_2GHZ, + tx_chains, rx_chains); + +- if (data->sku_cap_11ax_enable && !iwlwifi_mod_params.disable_11ax) ++ if (data->sku_cap_11ax_enable) + iwl_init_he_hw_capab(sband, tx_chains, rx_chains); + + sband = &data->bands[NL80211_BAND_5GHZ]; +@@ -610,7 +610,7 @@ + iwl_init_vht_hw_capab(cfg, data, &sband->vht_cap, + tx_chains, rx_chains); + +- if (data->sku_cap_11ax_enable && !iwlwifi_mod_params.disable_11ax) ++ if (data->sku_cap_11ax_enable) + iwl_init_he_hw_capab(sband, tx_chains, rx_chains); + + if (n_channels != n_used) +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c 2019-09-05 14:40:03.330474856 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c 2019-09-06 01:25:40.745352663 +0200 +@@ -776,8 +776,7 @@ + if (vif->probe_req_reg && vif->bss_conf.assoc && vif->p2p) + cmd.filter_flags |= cpu_to_le32(MAC_FILTER_IN_PROBE_REQUEST); + +- if (vif->bss_conf.assoc && vif->bss_conf.he_support && +- !iwlwifi_mod_params.disable_11ax) { ++ if (vif->bss_conf.assoc && vif->bss_conf.he_support) + cmd.filter_flags |= cpu_to_le32(MAC_FILTER_IN_11AX); + if (vif->bss_conf.twt_requester) + ctxt_sta->data_policy |= cpu_to_le32(TWT_SUPPORTED); +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-06 01:25:40.501355775 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-06 01:25:40.745352663 +0200 +@@ -2258,8 +2258,7 @@ + * added. + */ + if (changes & BSS_CHANGED_ASSOC && bss_conf->assoc) { +- if (vif->bss_conf.he_support && +- !iwlwifi_mod_params.disable_11ax) ++ if (vif->bss_conf.he_support) + iwl_mvm_cfg_he_sta(mvm, vif, mvmvif->ap_sta_id); + + iwl_mvm_mac_ctxt_recalc_tsf_id(mvm, vif); diff --git a/SOURCES/0032-Revert-iwlwifi-mvm-limit-TLC-according-to-our-HE-cap.patch b/SOURCES/0032-Revert-iwlwifi-mvm-limit-TLC-according-to-our-HE-cap.patch new file mode 100644 index 0000000..9736263 --- /dev/null +++ b/SOURCES/0032-Revert-iwlwifi-mvm-limit-TLC-according-to-our-HE-cap.patch @@ -0,0 +1,71 @@ +From f6fa861cd23ef48520a150969c39f5315cda5165 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 16:52:26 +0200 +Subject: [PATCH 03/43] Revert "iwlwifi: mvm: limit TLC according to our HE + capabilities" + +This reverts commit 529281bdf0fc6af56d15957e5b823cb1de564b82. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c | 34 ++++---------------------- + 1 file changed, 5 insertions(+), 29 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c 2019-09-05 14:40:03.011478963 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c 2019-09-06 01:25:40.953350009 +0200 +@@ -230,43 +230,19 @@ + + static void + rs_fw_he_set_enabled_rates(const struct ieee80211_sta *sta, +- struct ieee80211_supported_band *sband, ++ const struct ieee80211_sta_he_cap *he_cap, + struct iwl_tlc_config_cmd *cmd) + { +- const struct ieee80211_sta_he_cap *he_cap = &sta->he_cap; +- u16 mcs_160 = le16_to_cpu(he_cap->he_mcs_nss_supp.rx_mcs_160); +- u16 mcs_80 = le16_to_cpu(he_cap->he_mcs_nss_supp.rx_mcs_80); +- u16 tx_mcs_80 = +- le16_to_cpu(sband->iftype_data->he_cap.he_mcs_nss_supp.tx_mcs_80); +- u16 tx_mcs_160 = +- le16_to_cpu(sband->iftype_data->he_cap.he_mcs_nss_supp.tx_mcs_160); ++ u16 mcs_160 = le16_to_cpu(sta->he_cap.he_mcs_nss_supp.rx_mcs_160); ++ u16 mcs_80 = le16_to_cpu(sta->he_cap.he_mcs_nss_supp.rx_mcs_80); + int i; + + for (i = 0; i < sta->rx_nss && i < MAX_NSS; i++) { + u16 _mcs_160 = (mcs_160 >> (2 * i)) & 0x3; + u16 _mcs_80 = (mcs_80 >> (2 * i)) & 0x3; +- u16 _tx_mcs_160 = (tx_mcs_160 >> (2 * i)) & 0x3; +- u16 _tx_mcs_80 = (tx_mcs_80 >> (2 * i)) & 0x3; + +- /* If one side doesn't support - mark both as not supporting */ +- if (_mcs_80 == IEEE80211_HE_MCS_NOT_SUPPORTED || +- _tx_mcs_80 == IEEE80211_HE_MCS_NOT_SUPPORTED) { +- _mcs_80 = IEEE80211_HE_MCS_NOT_SUPPORTED; +- _tx_mcs_80 = IEEE80211_HE_MCS_NOT_SUPPORTED; +- } +- if (_mcs_80 > _tx_mcs_80) +- _mcs_80 = _tx_mcs_80; + cmd->ht_rates[i][0] = + cpu_to_le16(rs_fw_he_ieee80211_mcs_to_rs_mcs(_mcs_80)); +- +- /* If one side doesn't support - mark both as not supporting */ +- if (_mcs_160 == IEEE80211_HE_MCS_NOT_SUPPORTED || +- _tx_mcs_160 == IEEE80211_HE_MCS_NOT_SUPPORTED) { +- _mcs_160 = IEEE80211_HE_MCS_NOT_SUPPORTED; +- _tx_mcs_160 = IEEE80211_HE_MCS_NOT_SUPPORTED; +- } +- if (_mcs_160 > _tx_mcs_160) +- _mcs_160 = _tx_mcs_160; + cmd->ht_rates[i][1] = + cpu_to_le16(rs_fw_he_ieee80211_mcs_to_rs_mcs(_mcs_160)); + } +@@ -295,7 +271,7 @@ + /* HT/VHT rates */ + if (he_cap && he_cap->has_he) { + cmd->mode = IWL_TLC_MNG_MODE_HE; +- rs_fw_he_set_enabled_rates(sta, sband, cmd); ++ rs_fw_he_set_enabled_rates(sta, he_cap, cmd); + } else if (vht_cap && vht_cap->vht_supported) { + cmd->mode = IWL_TLC_MNG_MODE_VHT; + rs_fw_vht_set_enabled_rates(sta, vht_cap, cmd); diff --git a/SOURCES/0033-Revert-iwlwifi-rs-consider-LDPC-capability-in-case-o.patch b/SOURCES/0033-Revert-iwlwifi-rs-consider-LDPC-capability-in-case-o.patch new file mode 100644 index 0000000..e9b7fef --- /dev/null +++ b/SOURCES/0033-Revert-iwlwifi-rs-consider-LDPC-capability-in-case-o.patch @@ -0,0 +1,64 @@ +From 490affbc4f7ffa0df7827f805be8cd2de63dc7cb Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 16:53:03 +0200 +Subject: [PATCH 04/43] Revert "iwlwifi: rs: consider LDPC capability in case + of HE" + +This reverts commit befebbb30af00386bb1579efcdf1bb2d0c574593. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c | 16 +++++----------- + 1 file changed, 5 insertions(+), 11 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c 2019-09-06 01:25:40.953350009 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c 2019-09-06 01:25:41.121347866 +0200 +@@ -116,9 +116,8 @@ + return supp; + } + +-static u16 rs_fw_get_config_flags(struct iwl_mvm *mvm, +- struct ieee80211_sta *sta, +- struct ieee80211_supported_band *sband) ++static u16 rs_fw_set_config_flags(struct iwl_mvm *mvm, ++ struct ieee80211_sta *sta) + { + struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap; + struct ieee80211_sta_vht_cap *vht_cap = &sta->vht_cap; +@@ -148,12 +147,6 @@ + (vht_ena && (vht_cap->cap & IEEE80211_VHT_CAP_RXLDPC)))) + flags |= IWL_TLC_MNG_CFG_FLAGS_LDPC_MSK; + +- /* consider our LDPC support in case of HE */ +- if (sband->iftype_data && sband->iftype_data->he_cap.has_he && +- !(sband->iftype_data->he_cap.he_cap_elem.phy_cap_info[1] & +- IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD)) +- flags &= ~IWL_TLC_MNG_CFG_FLAGS_LDPC_MSK; +- + if (he_cap && he_cap->has_he && + (he_cap->he_cap_elem.phy_cap_info[3] & + IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_MASK)) +@@ -376,13 +369,13 @@ + struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); + struct iwl_lq_sta_rs_fw *lq_sta = &mvmsta->lq_sta.rs_fw; + u32 cmd_id = iwl_cmd_id(TLC_MNG_CONFIG_CMD, DATA_PATH_GROUP, 0); +- struct ieee80211_supported_band *sband = hw->wiphy->bands[band]; ++ struct ieee80211_supported_band *sband; + u16 max_amsdu_len = rs_fw_get_max_amsdu_len(sta); + struct iwl_tlc_config_cmd cfg_cmd = { + .sta_id = mvmsta->sta_id, + .max_ch_width = update ? + rs_fw_bw_from_sta_bw(sta) : RATE_MCS_CHAN_WIDTH_20, +- .flags = cpu_to_le16(rs_fw_get_config_flags(mvm, sta, sband)), ++ .flags = cpu_to_le16(rs_fw_set_config_flags(mvm, sta)), + .chains = rs_fw_set_active_chains(iwl_mvm_get_valid_tx_ant(mvm)), + .sgi_ch_width_supp = rs_fw_sgi_cw_support(sta), + .max_mpdu_len = cpu_to_le16(max_amsdu_len), +@@ -395,6 +388,7 @@ + #ifdef CONFIG_IWLWIFI_DEBUGFS + iwl_mvm_reset_frame_stats(mvm); + #endif ++ sband = hw->wiphy->bands[band]; + rs_fw_set_supp_rates(sta, sband, &cfg_cmd); + + /* diff --git a/SOURCES/0034-Revert-iwlwifi-mvm-fix-HE-radiotap-data4-for-HE-TB-P.patch b/SOURCES/0034-Revert-iwlwifi-mvm-fix-HE-radiotap-data4-for-HE-TB-P.patch new file mode 100644 index 0000000..5d745b0 --- /dev/null +++ b/SOURCES/0034-Revert-iwlwifi-mvm-fix-HE-radiotap-data4-for-HE-TB-P.patch @@ -0,0 +1,54 @@ +From 561fda1e84ed74901a9e95ce348318de9d800071 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 17:39:33 +0200 +Subject: [PATCH 05/43] Revert "iwlwifi: mvm: fix HE radiotap data4 for HE-TB + PPDUs" + +This reverts commit 2286a99c32344c41bf2d046e74d20d5c1839026e. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 18 ++++-------------- + 1 file changed, 4 insertions(+), 14 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-06-27 14:54:04.139678265 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:41.303345545 +0200 +@@ -1109,6 +1109,7 @@ + case IWL_RX_PHY_INFO_TYPE_HE_TB: + /* HE common */ + he->data1 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_LDPC_XSYMSEG_KNOWN | ++ IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE_KNOWN | + IEEE80211_RADIOTAP_HE_DATA1_DOPPLER_KNOWN | + IEEE80211_RADIOTAP_HE_DATA1_BSS_COLOR_KNOWN); + he->data2 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRE_FEC_PAD_KNOWN | +@@ -1128,6 +1129,9 @@ + he->data3 |= le16_encode_bits(le32_get_bits(phy_data->d0, + IWL_RX_PHY_DATA0_HE_LDPC_EXT_SYM), + IEEE80211_RADIOTAP_HE_DATA3_LDPC_XSYMSEG); ++ he->data4 |= le16_encode_bits(le32_get_bits(phy_data->d0, ++ IWL_RX_PHY_DATA0_HE_SPATIAL_REUSE_MASK), ++ IEEE80211_RADIOTAP_HE_DATA4_SU_MU_SPTL_REUSE); + he->data5 |= le16_encode_bits(le32_get_bits(phy_data->d0, + IWL_RX_PHY_DATA0_HE_PRE_FEC_PAD_MASK), + IEEE80211_RADIOTAP_HE_DATA5_PRE_FEC_PAD); +@@ -1146,20 +1150,6 @@ + break; + } + +- switch (phy_data->info_type) { +- case IWL_RX_PHY_INFO_TYPE_HE_MU_EXT: +- case IWL_RX_PHY_INFO_TYPE_HE_MU: +- case IWL_RX_PHY_INFO_TYPE_HE_SU: +- he->data1 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE_KNOWN); +- he->data4 |= le16_encode_bits(le32_get_bits(phy_data->d0, +- IWL_RX_PHY_DATA0_HE_SPATIAL_REUSE_MASK), +- IEEE80211_RADIOTAP_HE_DATA4_SU_MU_SPTL_REUSE); +- break; +- default: +- /* nothing here */ +- break; +- } +- + switch (phy_data->info_type) { + case IWL_RX_PHY_INFO_TYPE_HE_MU_EXT: + he_mu->flags1 |= diff --git a/SOURCES/0035-Revert-iwlwifi-mvm-radiotap-remove-UL_DL-bit-in-HE-T.patch b/SOURCES/0035-Revert-iwlwifi-mvm-radiotap-remove-UL_DL-bit-in-HE-T.patch new file mode 100644 index 0000000..25af405 --- /dev/null +++ b/SOURCES/0035-Revert-iwlwifi-mvm-radiotap-remove-UL_DL-bit-in-HE-T.patch @@ -0,0 +1,39 @@ +From 7bb5884d5829f80853f441a7e7869b569a7a1f17 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 17:39:38 +0200 +Subject: [PATCH 06/43] Revert "iwlwifi: mvm: radiotap: remove UL_DL bit in HE + TRIG_BASED" + +This reverts commit 7969454b37f25d38a48bdbd9932e8aa49ed2ed77. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:41.303345545 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:41.483343249 +0200 +@@ -1109,6 +1109,7 @@ + case IWL_RX_PHY_INFO_TYPE_HE_TB: + /* HE common */ + he->data1 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_LDPC_XSYMSEG_KNOWN | ++ IEEE80211_RADIOTAP_HE_DATA1_UL_DL_KNOWN | + IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE_KNOWN | + IEEE80211_RADIOTAP_HE_DATA1_DOPPLER_KNOWN | + IEEE80211_RADIOTAP_HE_DATA1_BSS_COLOR_KNOWN); +@@ -1119,13 +1120,9 @@ + he->data3 |= le16_encode_bits(le32_get_bits(phy_data->d0, + IWL_RX_PHY_DATA0_HE_BSS_COLOR_MASK), + IEEE80211_RADIOTAP_HE_DATA3_BSS_COLOR); +- if (phy_data->info_type != IWL_RX_PHY_INFO_TYPE_HE_TB && +- phy_data->info_type != IWL_RX_PHY_INFO_TYPE_HE_TB_EXT) { +- he->data1 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_UL_DL_KNOWN); +- he->data3 |= le16_encode_bits(le32_get_bits(phy_data->d0, ++ he->data3 |= le16_encode_bits(le32_get_bits(phy_data->d0, + IWL_RX_PHY_DATA0_HE_UPLINK), +- IEEE80211_RADIOTAP_HE_DATA3_UL_DL); +- } ++ IEEE80211_RADIOTAP_HE_DATA3_UL_DL); + he->data3 |= le16_encode_bits(le32_get_bits(phy_data->d0, + IWL_RX_PHY_DATA0_HE_LDPC_EXT_SYM), + IEEE80211_RADIOTAP_HE_DATA3_LDPC_XSYMSEG); diff --git a/SOURCES/0036-Revert-iwlwifi-mvm-report-all-NO_DATA-events-to-mac8.patch b/SOURCES/0036-Revert-iwlwifi-mvm-report-all-NO_DATA-events-to-mac8.patch new file mode 100644 index 0000000..629c0a0 --- /dev/null +++ b/SOURCES/0036-Revert-iwlwifi-mvm-report-all-NO_DATA-events-to-mac8.patch @@ -0,0 +1,147 @@ +From 4b37b55e8a1c275e1627aa29b195db94b0cac963 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:11:20 +0200 +Subject: [PATCH 07/43] Revert "iwlwifi: mvm: report all NO_DATA events to + mac80211" + +This reverts commit d47cdb884a9901a137edaa66e9866c98048e909c. +--- + drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 8 +++---- + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 6 +++--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 31 ++++++++++----------------- + 3 files changed, 18 insertions(+), 27 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-09-05 14:40:03.194476607 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-09-06 01:25:41.666340915 +0200 +@@ -8,7 +8,7 @@ + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 - 2017 Intel Deutschland GmbH +- * Copyright(c) 2018 - 2019 Intel Corporation ++ * Copyright(c) 2018 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as +@@ -31,7 +31,7 @@ + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 - 2017 Intel Deutschland GmbH +- * Copyright(c) 2018 - 2019 Intel Corporation ++ * Copyright(c) 2018 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -1606,8 +1606,8 @@ + struct iwl_rx_cmd_buffer *rxb); + void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi, + struct iwl_rx_cmd_buffer *rxb, int queue); +-void iwl_mvm_rx_monitor_no_data(struct iwl_mvm *mvm, struct napi_struct *napi, +- struct iwl_rx_cmd_buffer *rxb, int queue); ++void iwl_mvm_rx_monitor_ndp(struct iwl_mvm *mvm, struct napi_struct *napi, ++ struct iwl_rx_cmd_buffer *rxb, int queue); + void iwl_mvm_rx_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi, + struct iwl_rx_cmd_buffer *rxb, int queue); + int iwl_mvm_notify_rx_queue(struct iwl_mvm *mvm, u32 rxq_mask, +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-09-05 14:40:03.194476607 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-09-06 01:25:41.666340915 +0200 +@@ -8,7 +8,7 @@ + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 - 2017 Intel Deutschland GmbH +- * Copyright(c) 2018 - 2019 Intel Corporation ++ * Copyright(c) 2018 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as +@@ -31,7 +31,7 @@ + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 - 2017 Intel Deutschland GmbH +- * Copyright(c) 2018 - 2019 Intel Corporation ++ * Copyright(c) 2018 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -1085,7 +1085,7 @@ + else if (cmd == WIDE_ID(LEGACY_GROUP, FRAME_RELEASE)) + iwl_mvm_rx_frame_release(mvm, napi, rxb, 0); + else if (cmd == WIDE_ID(DATA_PATH_GROUP, RX_NO_DATA_NOTIF)) +- iwl_mvm_rx_monitor_no_data(mvm, napi, rxb, 0); ++ iwl_mvm_rx_monitor_ndp(mvm, napi, rxb, 0); + else + iwl_mvm_rx_common(mvm, rxb, pkt); + } +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:41.483343249 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:41.666340915 +0200 +@@ -8,7 +8,7 @@ + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2015 - 2017 Intel Deutschland GmbH +- * Copyright(c) 2018 - 2019 Intel Corporation ++ * Copyright(c) 2018 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as +@@ -31,7 +31,7 @@ + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2015 - 2017 Intel Deutschland GmbH +- * Copyright(c) 2018 - 2019 Intel Corporation ++ * Copyright(c) 2018 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -1686,8 +1686,8 @@ + rcu_read_unlock(); + } + +-void iwl_mvm_rx_monitor_no_data(struct iwl_mvm *mvm, struct napi_struct *napi, +- struct iwl_rx_cmd_buffer *rxb, int queue) ++void iwl_mvm_rx_monitor_ndp(struct iwl_mvm *mvm, struct napi_struct *napi, ++ struct iwl_rx_cmd_buffer *rxb, int queue) + { + struct ieee80211_rx_status *rx_status; + struct iwl_rx_packet *pkt = rxb_addr(rxb); +@@ -1708,6 +1708,10 @@ + if (unlikely(test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))) + return; + ++ /* Currently only NDP type is supported */ ++ if (info_type != RX_NO_DATA_INFO_TYPE_NDP) ++ return; ++ + energy_a = (rssi & RX_NO_DATA_CHAIN_A_MSK) >> RX_NO_DATA_CHAIN_A_POS; + energy_b = (rssi & RX_NO_DATA_CHAIN_B_MSK) >> RX_NO_DATA_CHAIN_B_POS; + channel = (rssi & RX_NO_DATA_CHANNEL_MSK) >> RX_NO_DATA_CHANNEL_POS; +@@ -1729,22 +1733,9 @@ + + /* 0-length PSDU */ + rx_status->flag |= RX_FLAG_NO_PSDU; +- +- switch (info_type) { +- case RX_NO_DATA_INFO_TYPE_NDP: +- rx_status->zero_length_psdu_type = +- IEEE80211_RADIOTAP_ZERO_LEN_PSDU_SOUNDING; +- break; +- case RX_NO_DATA_INFO_TYPE_MU_UNMATCHED: +- case RX_NO_DATA_INFO_TYPE_HE_TB_UNMATCHED: +- rx_status->zero_length_psdu_type = +- IEEE80211_RADIOTAP_ZERO_LEN_PSDU_NOT_CAPTURED; +- break; +- default: +- rx_status->zero_length_psdu_type = +- IEEE80211_RADIOTAP_ZERO_LEN_PSDU_VENDOR; +- break; +- } ++ /* currently this is the only type for which we get this notif */ ++ rx_status->zero_length_psdu_type = ++ IEEE80211_RADIOTAP_ZERO_LEN_PSDU_SOUNDING; + + /* This may be overridden by iwl_mvm_rx_he() to HE_RU */ + switch (rate_n_flags & RATE_MCS_CHAN_WIDTH_MSK) { diff --git a/SOURCES/0037-Revert-iwlwifi-mvm-fix-the-spatial-reuse-parsing-for.patch b/SOURCES/0037-Revert-iwlwifi-mvm-fix-the-spatial-reuse-parsing-for.patch new file mode 100644 index 0000000..24e0921 --- /dev/null +++ b/SOURCES/0037-Revert-iwlwifi-mvm-fix-the-spatial-reuse-parsing-for.patch @@ -0,0 +1,36 @@ +From 13d40dd19e04e63ec8bdaae9f41927d87608aefd Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:17:11 +0200 +Subject: [PATCH 08/43] Revert "iwlwifi: mvm: fix the spatial reuse parsing for + HE_TRIG PPDUs" + +This reverts commit a197e6d10ce26bdf4e7b8941321fb924b38ece02. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:41.666340915 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:41.856338491 +0200 +@@ -1090,16 +1090,16 @@ + IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE2_KNOWN | + IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE3_KNOWN | + IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE4_KNOWN); +- he->data4 |= le16_encode_bits(le32_get_bits(phy_data->d2, ++ he->data4 |= le16_encode_bits(le32_get_bits(phy_data->d0, + IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE1), + IEEE80211_RADIOTAP_HE_DATA4_TB_SPTL_REUSE1); +- he->data4 |= le16_encode_bits(le32_get_bits(phy_data->d2, ++ he->data4 |= le16_encode_bits(le32_get_bits(phy_data->d0, + IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE2), + IEEE80211_RADIOTAP_HE_DATA4_TB_SPTL_REUSE2); +- he->data4 |= le16_encode_bits(le32_get_bits(phy_data->d2, ++ he->data4 |= le16_encode_bits(le32_get_bits(phy_data->d0, + IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE3), + IEEE80211_RADIOTAP_HE_DATA4_TB_SPTL_REUSE3); +- he->data4 |= le16_encode_bits(le32_get_bits(phy_data->d2, ++ he->data4 |= le16_encode_bits(le32_get_bits(phy_data->d0, + IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE4), + IEEE80211_RADIOTAP_HE_DATA4_TB_SPTL_REUSE4); + /* fall through */ diff --git a/SOURCES/0038-Revert-iwlwifi-mvm-clean-up-NO_PSDU-case.patch b/SOURCES/0038-Revert-iwlwifi-mvm-clean-up-NO_PSDU-case.patch new file mode 100644 index 0000000..11284a1 --- /dev/null +++ b/SOURCES/0038-Revert-iwlwifi-mvm-clean-up-NO_PSDU-case.patch @@ -0,0 +1,35 @@ +From f42afed74bd0869fed5a8cf2e99c4e06211f0e38 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:19:04 +0200 +Subject: [PATCH 09/43] Revert "iwlwifi: mvm: clean up NO_PSDU case" + +This reverts commit ed714460a0ecd1d382a4cda1247fd6eb2666de28. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:41.856338491 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:42.023336361 +0200 +@@ -274,7 +274,10 @@ + struct ieee80211_sta *sta, + bool csi) + { +- if (iwl_mvm_check_pn(mvm, skb, queue, sta)) ++ struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb); ++ ++ if (!(rx_status->flag & RX_FLAG_NO_PSDU) && ++ iwl_mvm_check_pn(mvm, skb, queue, sta)) + kfree_skb(skb); + else + ieee80211_rx_napi(mvm->hw, sta, skb, napi); +@@ -1814,7 +1817,7 @@ + rx_status->rate_idx = rate; + } + +- ieee80211_rx_napi(mvm->hw, sta, skb, napi); ++ iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta, false); + out: + rcu_read_unlock(); + } diff --git a/SOURCES/0039-Revert-iwlwifi-mvm-don-t-hide-HE-radiotap-data-in-SK.patch b/SOURCES/0039-Revert-iwlwifi-mvm-don-t-hide-HE-radiotap-data-in-SK.patch new file mode 100644 index 0000000..783c39d --- /dev/null +++ b/SOURCES/0039-Revert-iwlwifi-mvm-don-t-hide-HE-radiotap-data-in-SK.patch @@ -0,0 +1,118 @@ +From 9ecf5349a3dc266355c9ae1fd74ad711515097e8 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:19:11 +0200 +Subject: [PATCH 10/43] Revert "iwlwifi: mvm: don't hide HE radiotap data in + SKB" + +This reverts commit 3619b088a87905a28d51b10172ff1e923c692cd7. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 47 +++++++-------------------- + 1 file changed, 11 insertions(+), 36 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:42.023336361 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:42.203334065 +0200 +@@ -66,37 +66,11 @@ + #include "mvm.h" + #include "fw-api.h" + +-static void *iwl_mvm_skb_get_hdr(struct sk_buff *skb) +-{ +- struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb); +- u8 *data = skb->data; +- +- /* Alignment concerns */ +- BUILD_BUG_ON(sizeof(struct ieee80211_radiotap_he) % 4); +- BUILD_BUG_ON(sizeof(struct ieee80211_radiotap_he_mu) % 4); +- BUILD_BUG_ON(sizeof(struct ieee80211_radiotap_lsig) % 4); +- BUILD_BUG_ON(sizeof(struct ieee80211_vendor_radiotap) % 4); +- +- if (rx_status->flag & RX_FLAG_RADIOTAP_HE) +- data += sizeof(struct ieee80211_radiotap_he); +- if (rx_status->flag & RX_FLAG_RADIOTAP_HE_MU) +- data += sizeof(struct ieee80211_radiotap_he_mu); +- if (rx_status->flag & RX_FLAG_RADIOTAP_LSIG) +- data += sizeof(struct ieee80211_radiotap_lsig); +- if (rx_status->flag & RX_FLAG_RADIOTAP_VENDOR_DATA) { +- struct ieee80211_vendor_radiotap *radiotap = (void *)data; +- +- data += sizeof(*radiotap) + radiotap->len + radiotap->pad; +- } +- +- return data; +-} +- + static inline int iwl_mvm_check_pn(struct iwl_mvm *mvm, struct sk_buff *skb, + int queue, struct ieee80211_sta *sta) + { + struct iwl_mvm_sta *mvmsta; +- struct ieee80211_hdr *hdr = iwl_mvm_skb_get_hdr(skb); ++ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; + struct ieee80211_rx_status *stats = IEEE80211_SKB_RXCB(skb); + struct iwl_mvm_key_pn *ptk_pn; + int res; +@@ -239,15 +213,12 @@ + { + struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb); + struct ieee80211_vendor_radiotap *radiotap; +- const int size = sizeof(*radiotap) + sizeof(__le16); ++ int size = sizeof(*radiotap) + sizeof(__le16); + + if (!mvm->cur_aid) + return; + +- /* ensure alignment */ +- BUILD_BUG_ON((size + 2) % 4); +- +- radiotap = skb_put(skb, size + 2); ++ radiotap = skb_put(skb, size); + radiotap->align = 1; + /* Intel OUI */ + radiotap->oui[0] = 0xf6; +@@ -257,12 +228,10 @@ + radiotap->subns = 1; + radiotap->present = 0x1; + radiotap->len = size - sizeof(*radiotap); +- radiotap->pad = 2; ++ radiotap->pad = 0; + + /* fill the data now */ + memcpy(radiotap->data, &mvm->cur_aid, sizeof(mvm->cur_aid)); +- /* and clear the padding */ +- memset(radiotap->data + sizeof(__le16), 0, radiotap->pad); + + rx_status->flag |= RX_FLAG_RADIOTAP_VENDOR_DATA; + } +@@ -710,7 +679,7 @@ + struct sk_buff *skb, + struct iwl_rx_mpdu_desc *desc) + { +- struct ieee80211_hdr *hdr = iwl_mvm_skb_get_hdr(skb); ++ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; + struct iwl_mvm_sta *mvm_sta; + struct iwl_mvm_baid_data *baid_data; + struct iwl_mvm_reorder_buffer *buffer; +@@ -1218,16 +1187,22 @@ + .flags2 = cpu_to_le16(IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW_KNOWN | + IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_KNOWN), + }; ++ unsigned int radiotap_len = 0; + + he = skb_put_data(skb, &known, sizeof(known)); ++ radiotap_len += sizeof(known); + rx_status->flag |= RX_FLAG_RADIOTAP_HE; + + if (phy_data->info_type == IWL_RX_PHY_INFO_TYPE_HE_MU || + phy_data->info_type == IWL_RX_PHY_INFO_TYPE_HE_MU_EXT) { + he_mu = skb_put_data(skb, &mu_known, sizeof(mu_known)); ++ radiotap_len += sizeof(mu_known); + rx_status->flag |= RX_FLAG_RADIOTAP_HE_MU; + } + ++ /* temporarily hide the radiotap data */ ++ __skb_pull(skb, radiotap_len); ++ + /* report the AMPDU-EOF bit on single frames */ + if (!queue && !(phy_info & IWL_RX_MPDU_PHY_AMPDU)) { + rx_status->flag |= RX_FLAG_AMPDU_DETAILS; diff --git a/SOURCES/0040-Revert-iwlwifi-mvm-add-HE-TB-PPDU-SIG-A-BW-to-radiot.patch b/SOURCES/0040-Revert-iwlwifi-mvm-add-HE-TB-PPDU-SIG-A-BW-to-radiot.patch new file mode 100644 index 0000000..d9370c9 --- /dev/null +++ b/SOURCES/0040-Revert-iwlwifi-mvm-add-HE-TB-PPDU-SIG-A-BW-to-radiot.patch @@ -0,0 +1,57 @@ +From 7178e4273a222597d37155c0070e3e3530433f91 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:19:35 +0200 +Subject: [PATCH 11/43] Revert "iwlwifi: mvm: add HE TB PPDU SIG-A BW to + radiotap" + +This reverts commit 74cf15cb69c0beb6cdaae3ff43f5231232a1f1b0. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 21 ++++++--------------- + 1 file changed, 6 insertions(+), 15 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:42.203334065 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:42.372331909 +0200 +@@ -976,7 +976,6 @@ + * the TSF/timers are not be transmitted in HE-MU. + */ + u8 ru = le32_get_bits(phy_data->d1, IWL_RX_PHY_DATA1_HE_RU_ALLOC_MASK); +- u32 he_type = rate_n_flags & RATE_MCS_HE_TYPE_MSK; + u8 offs = 0; + + rx_status->bw = RATE_INFO_BW_HE_RU; +@@ -1019,27 +1018,19 @@ + he->data2 |= + cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_SEC); + ++ if (he_mu) { + #define CHECK_BW(bw) \ + BUILD_BUG_ON(IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_ ## bw ## MHZ != \ +- RATE_MCS_CHAN_WIDTH_##bw >> RATE_MCS_CHAN_WIDTH_POS); \ +- BUILD_BUG_ON(IEEE80211_RADIOTAP_HE_DATA6_TB_PPDU_BW_ ## bw ## MHZ != \ + RATE_MCS_CHAN_WIDTH_##bw >> RATE_MCS_CHAN_WIDTH_POS) +- CHECK_BW(20); +- CHECK_BW(40); +- CHECK_BW(80); +- CHECK_BW(160); +- +- if (he_mu) ++ CHECK_BW(20); ++ CHECK_BW(40); ++ CHECK_BW(80); ++ CHECK_BW(160); + he_mu->flags2 |= + le16_encode_bits(FIELD_GET(RATE_MCS_CHAN_WIDTH_MSK, + rate_n_flags), + IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW); +- else if (he_type == RATE_MCS_HE_TYPE_TRIG) +- he->data6 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA6_TB_PPDU_BW_KNOWN) | +- le16_encode_bits(FIELD_GET(RATE_MCS_CHAN_WIDTH_MSK, +- rate_n_flags), +- IEEE80211_RADIOTAP_HE_DATA6_TB_PPDU_BW); ++ } + } + + static void iwl_mvm_decode_he_phy_data(struct iwl_mvm *mvm, diff --git a/SOURCES/0041-Revert-iwlwifi-iwlmvm-ignore-HE-PPDU-type-regarding-.patch b/SOURCES/0041-Revert-iwlwifi-iwlmvm-ignore-HE-PPDU-type-regarding-.patch new file mode 100644 index 0000000..5e4b3b2 --- /dev/null +++ b/SOURCES/0041-Revert-iwlwifi-iwlmvm-ignore-HE-PPDU-type-regarding-.patch @@ -0,0 +1,47 @@ +From b02d8c6f4a9feb8a39172c21b5262b8234dff7fc Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:20:43 +0200 +Subject: [PATCH 12/43] Revert "iwlwifi: iwlmvm: ignore HE PPDU type regarding + EOF" + +This reverts commit 937c2652768f931ac2f8ce0aa35476ccb0a603d0. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:42.372331909 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:42.536329818 +0200 +@@ -1194,12 +1194,14 @@ + /* temporarily hide the radiotap data */ + __skb_pull(skb, radiotap_len); + +- /* report the AMPDU-EOF bit on single frames */ +- if (!queue && !(phy_info & IWL_RX_MPDU_PHY_AMPDU)) { +- rx_status->flag |= RX_FLAG_AMPDU_DETAILS; +- rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN; +- if (phy_data->d0 & cpu_to_le32(IWL_RX_PHY_DATA0_HE_DELIM_EOF)) +- rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT; ++ if (phy_data->info_type == IWL_RX_PHY_INFO_TYPE_HE_SU) { ++ /* report the AMPDU-EOF bit on single frames */ ++ if (!queue && !(phy_info & IWL_RX_MPDU_PHY_AMPDU)) { ++ rx_status->flag |= RX_FLAG_AMPDU_DETAILS; ++ rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN; ++ if (phy_data->d0 & cpu_to_le32(IWL_RX_PHY_DATA0_HE_DELIM_EOF)) ++ rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT; ++ } + } + + if (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD) +@@ -1212,7 +1214,9 @@ + bool toggle_bit = phy_info & IWL_RX_MPDU_PHY_AMPDU_TOGGLE; + + /* toggle is switched whenever new aggregation starts */ +- if (toggle_bit != mvm->ampdu_toggle) { ++ if (toggle_bit != mvm->ampdu_toggle && ++ (he_type == RATE_MCS_HE_TYPE_MU || ++ he_type == RATE_MCS_HE_TYPE_SU)) { + rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN; + if (phy_data->d0 & cpu_to_le32(IWL_RX_PHY_DATA0_HE_DELIM_EOF)) + rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT; diff --git a/SOURCES/0042-Revert-iwlwifi-mvm-add-L-SIG-length-to-radiotap.patch b/SOURCES/0042-Revert-iwlwifi-mvm-add-L-SIG-length-to-radiotap.patch new file mode 100644 index 0000000..d999e38 --- /dev/null +++ b/SOURCES/0042-Revert-iwlwifi-mvm-add-L-SIG-length-to-radiotap.patch @@ -0,0 +1,216 @@ +From 5c2adb768dcc1275a47d35b61bffe8abdf225f9c Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:45:21 +0200 +Subject: [PATCH 13/43] Revert "iwlwifi: mvm: add L-SIG length to radiotap" + +This reverts commit 6721039d5b8adfd57291c54e96eaa9f54da23753. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 96 ++++++++++----------------- + 1 file changed, 36 insertions(+), 60 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:42.536329818 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:42.700327726 +0200 +@@ -904,7 +904,6 @@ + } + + struct iwl_mvm_rx_phy_data { +- enum iwl_rx_phy_info_type info_type; + __le32 d0, d1, d2, d3; + __le16 d4; + }; +@@ -1040,13 +1039,19 @@ + struct ieee80211_rx_status *rx_status, + u32 rate_n_flags, int queue) + { +- switch (phy_data->info_type) { ++ enum iwl_rx_phy_info_type info_type; ++ ++ info_type = le32_get_bits(phy_data->d1, IWL_RX_PHY_DATA1_INFO_TYPE_MASK); ++ ++ switch (info_type) { + case IWL_RX_PHY_INFO_TYPE_NONE: + case IWL_RX_PHY_INFO_TYPE_CCK: + case IWL_RX_PHY_INFO_TYPE_OFDM_LGCY: ++ return; + case IWL_RX_PHY_INFO_TYPE_HT: + case IWL_RX_PHY_INFO_TYPE_VHT_SU: + case IWL_RX_PHY_INFO_TYPE_VHT_MU: ++ /* TODO: we have LSIG-LEN, where do we put it? */ + return; + case IWL_RX_PHY_INFO_TYPE_HE_TB_EXT: + he->data1 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE_KNOWN | +@@ -1110,7 +1115,7 @@ + break; + } + +- switch (phy_data->info_type) { ++ switch (info_type) { + case IWL_RX_PHY_INFO_TYPE_HE_MU_EXT: + he_mu->flags1 |= + le16_encode_bits(le16_get_bits(phy_data->d4, +@@ -1154,7 +1159,7 @@ + } + + static void iwl_mvm_rx_he(struct iwl_mvm *mvm, struct sk_buff *skb, +- struct iwl_mvm_rx_phy_data *phy_data, ++ struct iwl_rx_mpdu_desc *desc, + u32 rate_n_flags, u16 phy_info, int queue) + { + struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb); +@@ -1179,13 +1184,33 @@ + IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_KNOWN), + }; + unsigned int radiotap_len = 0; ++ struct iwl_mvm_rx_phy_data phy_data = { ++ .d4 = desc->phy_data4, ++ }; ++ enum iwl_rx_phy_info_type info_type = IWL_RX_PHY_INFO_TYPE_NONE; ++ ++ if (mvm->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) { ++ phy_data.d0 = desc->v3.phy_data0; ++ phy_data.d1 = desc->v3.phy_data1; ++ phy_data.d2 = desc->v3.phy_data2; ++ phy_data.d3 = desc->v3.phy_data3; ++ } else { ++ phy_data.d0 = desc->v1.phy_data0; ++ phy_data.d1 = desc->v1.phy_data1; ++ phy_data.d2 = desc->v1.phy_data2; ++ phy_data.d3 = desc->v1.phy_data3; ++ } ++ ++ if (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD) ++ info_type = le32_get_bits(phy_data.d1, ++ IWL_RX_PHY_DATA1_INFO_TYPE_MASK); + + he = skb_put_data(skb, &known, sizeof(known)); + radiotap_len += sizeof(known); + rx_status->flag |= RX_FLAG_RADIOTAP_HE; + +- if (phy_data->info_type == IWL_RX_PHY_INFO_TYPE_HE_MU || +- phy_data->info_type == IWL_RX_PHY_INFO_TYPE_HE_MU_EXT) { ++ if (info_type == IWL_RX_PHY_INFO_TYPE_HE_MU || ++ info_type == IWL_RX_PHY_INFO_TYPE_HE_MU_EXT) { + he_mu = skb_put_data(skb, &mu_known, sizeof(mu_known)); + radiotap_len += sizeof(mu_known); + rx_status->flag |= RX_FLAG_RADIOTAP_HE_MU; +@@ -1194,18 +1219,18 @@ + /* temporarily hide the radiotap data */ + __skb_pull(skb, radiotap_len); + +- if (phy_data->info_type == IWL_RX_PHY_INFO_TYPE_HE_SU) { ++ if (info_type == IWL_RX_PHY_INFO_TYPE_HE_SU) { + /* report the AMPDU-EOF bit on single frames */ + if (!queue && !(phy_info & IWL_RX_MPDU_PHY_AMPDU)) { + rx_status->flag |= RX_FLAG_AMPDU_DETAILS; + rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN; +- if (phy_data->d0 & cpu_to_le32(IWL_RX_PHY_DATA0_HE_DELIM_EOF)) ++ if (phy_data.d0 & cpu_to_le32(IWL_RX_PHY_DATA0_HE_DELIM_EOF)) + rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT; + } + } + + if (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD) +- iwl_mvm_decode_he_phy_data(mvm, phy_data, he, he_mu, rx_status, ++ iwl_mvm_decode_he_phy_data(mvm, &phy_data, he, he_mu, rx_status, + rate_n_flags, queue); + + /* update aggregation data for monitor sake on default queue */ +@@ -1218,7 +1243,7 @@ + (he_type == RATE_MCS_HE_TYPE_MU || + he_type == RATE_MCS_HE_TYPE_SU)) { + rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN; +- if (phy_data->d0 & cpu_to_le32(IWL_RX_PHY_DATA0_HE_DELIM_EOF)) ++ if (phy_data.d0 & cpu_to_le32(IWL_RX_PHY_DATA0_HE_DELIM_EOF)) + rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT; + } + } +@@ -1305,33 +1330,6 @@ + IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE); + } + +-static void iwl_mvm_decode_lsig(struct sk_buff *skb, +- struct iwl_mvm_rx_phy_data *phy_data) +-{ +- struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb); +- struct ieee80211_radiotap_lsig *lsig; +- +- switch (phy_data->info_type) { +- case IWL_RX_PHY_INFO_TYPE_HT: +- case IWL_RX_PHY_INFO_TYPE_VHT_SU: +- case IWL_RX_PHY_INFO_TYPE_VHT_MU: +- case IWL_RX_PHY_INFO_TYPE_HE_TB_EXT: +- case IWL_RX_PHY_INFO_TYPE_HE_SU: +- case IWL_RX_PHY_INFO_TYPE_HE_MU: +- case IWL_RX_PHY_INFO_TYPE_HE_MU_EXT: +- case IWL_RX_PHY_INFO_TYPE_HE_TB: +- lsig = skb_put(skb, sizeof(*lsig)); +- lsig->data1 = cpu_to_le16(IEEE80211_RADIOTAP_LSIG_DATA1_LENGTH_KNOWN); +- lsig->data2 = le16_encode_bits(le32_get_bits(phy_data->d1, +- IWL_RX_PHY_DATA1_LSIG_LEN_MASK), +- IEEE80211_RADIOTAP_LSIG_DATA2_LENGTH); +- rx_status->flag |= RX_FLAG_RADIOTAP_LSIG; +- break; +- default: +- break; +- } +-} +- + void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi, + struct iwl_rx_cmd_buffer *rxb, int queue) + { +@@ -1346,10 +1344,6 @@ + struct sk_buff *skb; + u8 crypt_len = 0, channel, energy_a, energy_b; + size_t desc_size; +- struct iwl_mvm_rx_phy_data phy_data = { +- .d4 = desc->phy_data4, +- .info_type = IWL_RX_PHY_INFO_TYPE_NONE, +- }; + bool csi = false; + + if (unlikely(test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))) +@@ -1362,11 +1356,6 @@ + energy_a = desc->v3.energy_a; + energy_b = desc->v3.energy_b; + desc_size = sizeof(*desc); +- +- phy_data.d0 = desc->v3.phy_data0; +- phy_data.d1 = desc->v3.phy_data1; +- phy_data.d2 = desc->v3.phy_data2; +- phy_data.d3 = desc->v3.phy_data3; + } else { + rate_n_flags = le32_to_cpu(desc->v1.rate_n_flags); + channel = desc->v1.channel; +@@ -1374,18 +1363,8 @@ + energy_a = desc->v1.energy_a; + energy_b = desc->v1.energy_b; + desc_size = IWL_RX_DESC_SIZE_V1; +- +- phy_data.d0 = desc->v1.phy_data0; +- phy_data.d1 = desc->v1.phy_data1; +- phy_data.d2 = desc->v1.phy_data2; +- phy_data.d3 = desc->v1.phy_data3; + } + +- if (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD) +- phy_data.info_type = +- le32_get_bits(phy_data.d1, +- IWL_RX_PHY_DATA1_INFO_TYPE_MASK); +- + hdr = (void *)(pkt->data + desc_size); + /* Dont use dev_alloc_skb(), we'll have enough headroom once + * ieee80211_hdr pulled. +@@ -1424,10 +1403,7 @@ + } + + if (rate_n_flags & RATE_MCS_HE_MSK) +- iwl_mvm_rx_he(mvm, skb, &phy_data, rate_n_flags, +- phy_info, queue); +- +- iwl_mvm_decode_lsig(skb, &phy_data); ++ iwl_mvm_rx_he(mvm, skb, desc, rate_n_flags, phy_info, queue); + + rx_status = IEEE80211_SKB_RXCB(skb); + diff --git a/SOURCES/0043-Revert-iwlwifi-mvm-change-PHY-data-RX-for-HE-radiota.patch b/SOURCES/0043-Revert-iwlwifi-mvm-change-PHY-data-RX-for-HE-radiota.patch new file mode 100644 index 0000000..42c3605 --- /dev/null +++ b/SOURCES/0043-Revert-iwlwifi-mvm-change-PHY-data-RX-for-HE-radiota.patch @@ -0,0 +1,759 @@ +From 31fdae686b7a84c5e47e9ab298dfdbaec1ccaeb9 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:45:30 +0200 +Subject: [PATCH 14/43] Revert "iwlwifi: mvm: change PHY data RX for HE + radiotap" + +This reverts commit bdf180c8d375ee75493d79ae384dd1f9686fc974. +--- + drivers/net/wireless/intel/iwlwifi/fw/api/rx.h | 190 +++++-------- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 367 +++++++++++++------------ + 2 files changed, 261 insertions(+), 296 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h 2019-06-27 14:54:04.122678470 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h 2019-09-06 01:25:42.865325621 +0200 +@@ -343,98 +343,66 @@ + IWL_RX_MPDU_PHY_PHY_INDEX_MASK = 0xf0, + }; + +-/* TSF overload low dword */ +-enum iwl_rx_phy_data0 { +- /* info type: HE any */ +- IWL_RX_PHY_DATA0_HE_BEAM_CHNG = 0x00000001, +- IWL_RX_PHY_DATA0_HE_UPLINK = 0x00000002, +- IWL_RX_PHY_DATA0_HE_BSS_COLOR_MASK = 0x000000fc, +- IWL_RX_PHY_DATA0_HE_SPATIAL_REUSE_MASK = 0x00000f00, +- /* 1 bit reserved */ +- IWL_RX_PHY_DATA0_HE_TXOP_DUR_MASK = 0x000fe000, +- IWL_RX_PHY_DATA0_HE_LDPC_EXT_SYM = 0x00100000, +- IWL_RX_PHY_DATA0_HE_PRE_FEC_PAD_MASK = 0x00600000, +- IWL_RX_PHY_DATA0_HE_PE_DISAMBIG = 0x00800000, +- IWL_RX_PHY_DATA0_HE_DOPPLER = 0x01000000, ++/* ++ * enum iwl_rx_he_phy - HE PHY data ++ */ ++enum iwl_rx_he_phy { ++ IWL_RX_HE_PHY_BEAM_CHNG = BIT(0), ++ IWL_RX_HE_PHY_UPLINK = BIT(1), ++ IWL_RX_HE_PHY_BSS_COLOR_MASK = 0xfc, ++ IWL_RX_HE_PHY_SPATIAL_REUSE_MASK = 0xf00, ++ IWL_RX_HE_PHY_SU_EXT_BW10 = BIT(12), ++ IWL_RX_HE_PHY_TXOP_DUR_MASK = 0xfe000, ++ IWL_RX_HE_PHY_LDPC_EXT_SYM = BIT(20), ++ IWL_RX_HE_PHY_PRE_FEC_PAD_MASK = 0x600000, ++ IWL_RX_HE_PHY_PE_DISAMBIG = BIT(23), ++ IWL_RX_HE_PHY_DOPPLER = BIT(24), + /* 6 bits reserved */ +- IWL_RX_PHY_DATA0_HE_DELIM_EOF = 0x80000000, +-}; +- +-enum iwl_rx_phy_info_type { +- IWL_RX_PHY_INFO_TYPE_NONE = 0, +- IWL_RX_PHY_INFO_TYPE_CCK = 1, +- IWL_RX_PHY_INFO_TYPE_OFDM_LGCY = 2, +- IWL_RX_PHY_INFO_TYPE_HT = 3, +- IWL_RX_PHY_INFO_TYPE_VHT_SU = 4, +- IWL_RX_PHY_INFO_TYPE_VHT_MU = 5, +- IWL_RX_PHY_INFO_TYPE_HE_SU = 6, +- IWL_RX_PHY_INFO_TYPE_HE_MU = 7, +- IWL_RX_PHY_INFO_TYPE_HE_TB = 8, +- IWL_RX_PHY_INFO_TYPE_HE_MU_EXT = 9, +- IWL_RX_PHY_INFO_TYPE_HE_TB_EXT = 10, +-}; ++ IWL_RX_HE_PHY_DELIM_EOF = BIT(31), + +-/* TSF overload high dword */ +-enum iwl_rx_phy_data1 { +- /* +- * check this first - if TSF overload is set, +- * see &enum iwl_rx_phy_info_type +- */ +- IWL_RX_PHY_DATA1_INFO_TYPE_MASK = 0xf0000000, +- +- /* info type: HT/VHT/HE any */ +- IWL_RX_PHY_DATA1_LSIG_LEN_MASK = 0x0fff0000, +- +- /* info type: HE MU/MU-EXT */ +- IWL_RX_PHY_DATA1_HE_MU_SIGB_COMPRESSION = 0x00000001, +- IWL_RX_PHY_DATA1_HE_MU_SIBG_SYM_OR_USER_NUM_MASK = 0x0000001e, +- +- /* info type: HE any */ +- IWL_RX_PHY_DATA1_HE_LTF_NUM_MASK = 0x000000e0, +- IWL_RX_PHY_DATA1_HE_RU_ALLOC_SEC80 = 0x00000100, ++ /* second dword - common data */ ++ IWL_RX_HE_PHY_HE_LTF_NUM_MASK = 0xe000000000ULL, ++ IWL_RX_HE_PHY_RU_ALLOC_SEC80 = BIT_ULL(32 + 8), + /* trigger encoded */ +- IWL_RX_PHY_DATA1_HE_RU_ALLOC_MASK = 0x0000fe00, +- +- /* info type: HE TB/TX-EXT */ +- IWL_RX_PHY_DATA1_HE_TB_PILOT_TYPE = 0x00000001, +- IWL_RX_PHY_DATA1_HE_TB_LOW_SS_MASK = 0x0000000e, ++ IWL_RX_HE_PHY_RU_ALLOC_MASK = 0xfe0000000000ULL, ++ IWL_RX_HE_PHY_INFO_TYPE_MASK = 0xf000000000000000ULL, ++ IWL_RX_HE_PHY_INFO_TYPE_SU = 0x0, /* TSF low valid (first DW) */ ++ IWL_RX_HE_PHY_INFO_TYPE_MU = 0x1, /* TSF low/high valid (both DWs) */ ++ IWL_RX_HE_PHY_INFO_TYPE_MU_EXT_INFO = 0x2, /* same + SIGB-common0/1/2 valid */ ++ IWL_RX_HE_PHY_INFO_TYPE_TB = 0x3, /* TSF low/high valid (both DWs) */ ++ ++ /* second dword - MU data */ ++ IWL_RX_HE_PHY_MU_SIGB_COMPRESSION = BIT_ULL(32 + 0), ++ IWL_RX_HE_PHY_MU_SIBG_SYM_OR_USER_NUM_MASK = 0x1e00000000ULL, ++ IWL_RX_HE_PHY_MU_SIGB_MCS_MASK = 0xf000000000000ULL, ++ IWL_RX_HE_PHY_MU_SIGB_DCM = BIT_ULL(32 + 21), ++ IWL_RX_HE_PHY_MU_PREAMBLE_PUNC_TYPE_MASK = 0xc0000000000000ULL, ++ ++ /* second dword - TB data */ ++ IWL_RX_HE_PHY_TB_PILOT_TYPE = BIT_ULL(32 + 0), ++ IWL_RX_HE_PHY_TB_LOW_SS_MASK = 0xe00000000ULL + }; + +-/* goes into Metadata DW 7 */ +-enum iwl_rx_phy_data2 { +- /* info type: HE MU-EXT */ ++enum iwl_rx_he_sigb_common0 { + /* the a1/a2/... is what the PHY/firmware calls the values */ +- IWL_RX_PHY_DATA2_HE_MU_EXT_CH1_RU0 = 0x000000ff, /* a1 */ +- IWL_RX_PHY_DATA2_HE_MU_EXT_CH1_RU2 = 0x0000ff00, /* a2 */ +- IWL_RX_PHY_DATA2_HE_MU_EXT_CH2_RU0 = 0x00ff0000, /* b1 */ +- IWL_RX_PHY_DATA2_HE_MU_EXT_CH2_RU2 = 0xff000000, /* b2 */ +- +- /* info type: HE TB-EXT */ +- IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE1 = 0x0000000f, +- IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE2 = 0x000000f0, +- IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE3 = 0x00000f00, +- IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE4 = 0x0000f000, ++ IWL_RX_HE_SIGB_COMMON0_CH1_RU0 = 0x000000ff, /* a1 */ ++ IWL_RX_HE_SIGB_COMMON0_CH1_RU2 = 0x0000ff00, /* a2 */ ++ IWL_RX_HE_SIGB_COMMON0_CH2_RU0 = 0x00ff0000, /* b1 */ ++ IWL_RX_HE_SIGB_COMMON0_CH2_RU2 = 0xff000000, /* b2 */ + }; + +-/* goes into Metadata DW 8 */ +-enum iwl_rx_phy_data3 { +- /* info type: HE MU-EXT */ +- IWL_RX_PHY_DATA3_HE_MU_EXT_CH1_RU1 = 0x000000ff, /* c1 */ +- IWL_RX_PHY_DATA3_HE_MU_EXT_CH1_RU3 = 0x0000ff00, /* c2 */ +- IWL_RX_PHY_DATA3_HE_MU_EXT_CH2_RU1 = 0x00ff0000, /* d1 */ +- IWL_RX_PHY_DATA3_HE_MU_EXT_CH2_RU3 = 0xff000000, /* d2 */ ++enum iwl_rx_he_sigb_common1 { ++ IWL_RX_HE_SIGB_COMMON1_CH1_RU1 = 0x000000ff, /* c1 */ ++ IWL_RX_HE_SIGB_COMMON1_CH1_RU3 = 0x0000ff00, /* c2 */ ++ IWL_RX_HE_SIGB_COMMON1_CH2_RU1 = 0x00ff0000, /* d1 */ ++ IWL_RX_HE_SIGB_COMMON1_CH2_RU3 = 0xff000000, /* d2 */ + }; + +-/* goes into Metadata DW 4 high 16 bits */ +-enum iwl_rx_phy_data4 { +- /* info type: HE MU-EXT */ +- IWL_RX_PHY_DATA4_HE_MU_EXT_CH1_CTR_RU = 0x0001, +- IWL_RX_PHY_DATA4_HE_MU_EXT_CH2_CTR_RU = 0x0002, +- IWL_RX_PHY_DATA4_HE_MU_EXT_CH1_CRC_OK = 0x0004, +- IWL_RX_PHY_DATA4_HE_MU_EXT_CH2_CRC_OK = 0x0008, +- IWL_RX_PHY_DATA4_HE_MU_EXT_SIGB_MCS_MASK = 0x00f0, +- IWL_RX_PHY_DATA4_HE_MU_EXT_SIGB_DCM = 0x0100, +- IWL_RX_PHY_DATA4_HE_MU_EXT_PREAMBLE_PUNC_TYPE_MASK = 0x0600, ++enum iwl_rx_he_sigb_common2 { ++ IWL_RX_HE_SIGB_COMMON2_CH1_CTR_RU = 0x0001, ++ IWL_RX_HE_SIGB_COMMON2_CH2_CTR_RU = 0x0002, ++ IWL_RX_HE_SIGB_COMMON2_CH1_CRC_OK = 0x0004, ++ IWL_RX_HE_SIGB_COMMON2_CH2_CRC_OK = 0x0008, + }; + + /** +@@ -449,9 +417,9 @@ + __le32 rss_hash; + + /** +- * @phy_data2: depends on info type (see @phy_data1) ++ * @sigb_common0: for HE sniffer, HE-SIG-B common part 0 + */ +- __le32 phy_data2; ++ __le32 sigb_common0; + }; + + /* DW8 - carries filter_match only when rpa_en == 1 */ +@@ -462,9 +430,9 @@ + __le32 filter_match; + + /** +- * @phy_data3: depends on info type (see @phy_data1) ++ * @sigb_common1: for HE sniffer, HE-SIG-B common part 1 + */ +- __le32 phy_data3; ++ __le32 sigb_common1; + }; + + /* DW9 */ +@@ -502,19 +470,12 @@ + * %IWL_RX_MPDU_PHY_TSF_OVERLOAD isn't set + */ + __le64 tsf_on_air_rise; +- +- struct { +- /** +- * @phy_data0: depends on info_type, see @phy_data1 +- */ +- __le32 phy_data0; +- /** +- * @phy_data1: valid only if +- * %IWL_RX_MPDU_PHY_TSF_OVERLOAD is set, +- * see &enum iwl_rx_phy_data1. +- */ +- __le32 phy_data1; +- }; ++ /** ++ * @he_phy_data: ++ * HE PHY data, see &enum iwl_rx_he_phy, valid ++ * only if %IWL_RX_MPDU_PHY_TSF_OVERLOAD is set ++ */ ++ __le64 he_phy_data; + }; + } __packed; + +@@ -530,9 +491,9 @@ + __le32 filter_match; + + /** +- * @phy_data2: depends on info type (see @phy_data1) ++ * @sigb_common0: for HE sniffer, HE-SIG-B common part 0 + */ +- __le32 phy_data2; ++ __le32 sigb_common0; + }; + + /* DW8 - carries rss_hash only when rpa_en == 1 */ +@@ -543,9 +504,9 @@ + __le32 rss_hash; + + /** +- * @phy_data3: depends on info type (see @phy_data1) ++ * @sigb_common1: for HE sniffer, HE-SIG-B common part 1 + */ +- __le32 phy_data3; ++ __le32 sigb_common1; + }; + /* DW9 */ + /** +@@ -593,19 +554,12 @@ + * %IWL_RX_MPDU_PHY_TSF_OVERLOAD isn't set + */ + __le64 tsf_on_air_rise; +- +- struct { +- /** +- * @phy_data0: depends on info_type, see @phy_data1 +- */ +- __le32 phy_data0; +- /** +- * @phy_data1: valid only if +- * %IWL_RX_MPDU_PHY_TSF_OVERLOAD is set, +- * see &enum iwl_rx_phy_data1. +- */ +- __le32 phy_data1; +- }; ++ /** ++ * @he_phy_data: ++ * HE PHY data, see &enum iwl_rx_he_phy, valid ++ * only if %IWL_RX_MPDU_PHY_TSF_OVERLOAD is set ++ */ ++ __le64 he_phy_data; + }; + /* DW16 & DW17 */ + /** +@@ -657,9 +611,9 @@ + __le16 l3l4_flags; + + /** +- * @phy_data4: depends on info type, see phy_data1 ++ * @sigb_common2: for HE sniffer, HE-SIG-B common part 2 + */ +- __le16 phy_data4; ++ __le16 sigb_common2; + }; + /* DW5 */ + /** +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:42.700327726 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:42.865325621 +0200 +@@ -903,65 +903,68 @@ + ether_addr_copy(addr, mac_addr); + } + +-struct iwl_mvm_rx_phy_data { +- __le32 d0, d1, d2, d3; +- __le16 d4; +-}; +- +-static void iwl_mvm_decode_he_mu_ext(struct iwl_mvm *mvm, +- struct iwl_mvm_rx_phy_data *phy_data, +- u32 rate_n_flags, +- struct ieee80211_radiotap_he_mu *he_mu) ++static void iwl_mvm_decode_he_sigb(struct iwl_mvm *mvm, ++ struct iwl_rx_mpdu_desc *desc, ++ u32 rate_n_flags, ++ struct ieee80211_radiotap_he_mu *he_mu) + { +- u32 phy_data2 = le32_to_cpu(phy_data->d2); +- u32 phy_data3 = le32_to_cpu(phy_data->d3); +- u16 phy_data4 = le16_to_cpu(phy_data->d4); ++ u32 sigb0, sigb1; ++ u16 sigb2; + +- if (FIELD_GET(IWL_RX_PHY_DATA4_HE_MU_EXT_CH1_CRC_OK, phy_data4)) { ++ if (mvm->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) { ++ sigb0 = le32_to_cpu(desc->v3.sigb_common0); ++ sigb1 = le32_to_cpu(desc->v3.sigb_common1); ++ } else { ++ sigb0 = le32_to_cpu(desc->v1.sigb_common0); ++ sigb1 = le32_to_cpu(desc->v1.sigb_common1); ++ } ++ ++ sigb2 = le16_to_cpu(desc->sigb_common2); ++ ++ if (FIELD_GET(IWL_RX_HE_SIGB_COMMON2_CH1_CRC_OK, sigb2)) { + he_mu->flags1 |= + cpu_to_le16(IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH1_RU_KNOWN | + IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH1_CTR_26T_RU_KNOWN); + + he_mu->flags1 |= +- le16_encode_bits(FIELD_GET(IWL_RX_PHY_DATA4_HE_MU_EXT_CH1_CTR_RU, +- phy_data4), ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_SIGB_COMMON2_CH1_CTR_RU, ++ sigb2), + IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH1_CTR_26T_RU); + +- he_mu->ru_ch1[0] = FIELD_GET(IWL_RX_PHY_DATA2_HE_MU_EXT_CH1_RU0, +- phy_data2); +- he_mu->ru_ch1[1] = FIELD_GET(IWL_RX_PHY_DATA3_HE_MU_EXT_CH1_RU1, +- phy_data3); +- he_mu->ru_ch1[2] = FIELD_GET(IWL_RX_PHY_DATA2_HE_MU_EXT_CH1_RU2, +- phy_data2); +- he_mu->ru_ch1[3] = FIELD_GET(IWL_RX_PHY_DATA3_HE_MU_EXT_CH1_RU3, +- phy_data3); ++ he_mu->ru_ch1[0] = FIELD_GET(IWL_RX_HE_SIGB_COMMON0_CH1_RU0, ++ sigb0); ++ he_mu->ru_ch1[1] = FIELD_GET(IWL_RX_HE_SIGB_COMMON1_CH1_RU1, ++ sigb1); ++ he_mu->ru_ch1[2] = FIELD_GET(IWL_RX_HE_SIGB_COMMON0_CH1_RU2, ++ sigb0); ++ he_mu->ru_ch1[3] = FIELD_GET(IWL_RX_HE_SIGB_COMMON1_CH1_RU3, ++ sigb1); + } + +- if (FIELD_GET(IWL_RX_PHY_DATA4_HE_MU_EXT_CH2_CRC_OK, phy_data4) && ++ if (FIELD_GET(IWL_RX_HE_SIGB_COMMON2_CH2_CRC_OK, sigb2) && + (rate_n_flags & RATE_MCS_CHAN_WIDTH_MSK) != RATE_MCS_CHAN_WIDTH_20) { + he_mu->flags1 |= + cpu_to_le16(IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH2_RU_KNOWN | + IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH2_CTR_26T_RU_KNOWN); + + he_mu->flags2 |= +- le16_encode_bits(FIELD_GET(IWL_RX_PHY_DATA4_HE_MU_EXT_CH2_CTR_RU, +- phy_data4), ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_SIGB_COMMON2_CH2_CTR_RU, ++ sigb2), + IEEE80211_RADIOTAP_HE_MU_FLAGS2_CH2_CTR_26T_RU); + +- he_mu->ru_ch2[0] = FIELD_GET(IWL_RX_PHY_DATA2_HE_MU_EXT_CH2_RU0, +- phy_data2); +- he_mu->ru_ch2[1] = FIELD_GET(IWL_RX_PHY_DATA3_HE_MU_EXT_CH2_RU1, +- phy_data3); +- he_mu->ru_ch2[2] = FIELD_GET(IWL_RX_PHY_DATA2_HE_MU_EXT_CH2_RU2, +- phy_data2); +- he_mu->ru_ch2[3] = FIELD_GET(IWL_RX_PHY_DATA3_HE_MU_EXT_CH2_RU3, +- phy_data3); ++ he_mu->ru_ch2[0] = FIELD_GET(IWL_RX_HE_SIGB_COMMON0_CH2_RU0, ++ sigb0); ++ he_mu->ru_ch2[1] = FIELD_GET(IWL_RX_HE_SIGB_COMMON1_CH2_RU1, ++ sigb1); ++ he_mu->ru_ch2[2] = FIELD_GET(IWL_RX_HE_SIGB_COMMON0_CH2_RU2, ++ sigb0); ++ he_mu->ru_ch2[3] = FIELD_GET(IWL_RX_HE_SIGB_COMMON1_CH2_RU3, ++ sigb1); + } + } + + static void +-iwl_mvm_decode_he_phy_ru_alloc(struct iwl_mvm_rx_phy_data *phy_data, +- u32 rate_n_flags, ++iwl_mvm_decode_he_phy_ru_alloc(u64 he_phy_data, u32 rate_n_flags, + struct ieee80211_radiotap_he *he, + struct ieee80211_radiotap_he_mu *he_mu, + struct ieee80211_rx_status *rx_status) +@@ -974,7 +977,7 @@ + * happen though as management frames where we need + * the TSF/timers are not be transmitted in HE-MU. + */ +- u8 ru = le32_get_bits(phy_data->d1, IWL_RX_PHY_DATA1_HE_RU_ALLOC_MASK); ++ u8 ru = FIELD_GET(IWL_RX_HE_PHY_RU_ALLOC_MASK, he_phy_data); + u8 offs = 0; + + rx_status->bw = RATE_INFO_BW_HE_RU; +@@ -1013,7 +1016,7 @@ + IEEE80211_RADIOTAP_HE_DATA2_RU_OFFSET); + he->data2 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_KNOWN | + IEEE80211_RADIOTAP_HE_DATA2_RU_OFFSET_KNOWN); +- if (phy_data->d1 & cpu_to_le32(IWL_RX_PHY_DATA1_HE_RU_ALLOC_SEC80)) ++ if (he_phy_data & IWL_RX_HE_PHY_RU_ALLOC_SEC80) + he->data2 |= + cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_SEC); + +@@ -1033,124 +1036,105 @@ + } + + static void iwl_mvm_decode_he_phy_data(struct iwl_mvm *mvm, +- struct iwl_mvm_rx_phy_data *phy_data, ++ struct iwl_rx_mpdu_desc *desc, + struct ieee80211_radiotap_he *he, + struct ieee80211_radiotap_he_mu *he_mu, + struct ieee80211_rx_status *rx_status, +- u32 rate_n_flags, int queue) ++ u64 he_phy_data, u32 rate_n_flags, ++ int queue) + { +- enum iwl_rx_phy_info_type info_type; +- +- info_type = le32_get_bits(phy_data->d1, IWL_RX_PHY_DATA1_INFO_TYPE_MASK); +- +- switch (info_type) { +- case IWL_RX_PHY_INFO_TYPE_NONE: +- case IWL_RX_PHY_INFO_TYPE_CCK: +- case IWL_RX_PHY_INFO_TYPE_OFDM_LGCY: +- return; +- case IWL_RX_PHY_INFO_TYPE_HT: +- case IWL_RX_PHY_INFO_TYPE_VHT_SU: +- case IWL_RX_PHY_INFO_TYPE_VHT_MU: +- /* TODO: we have LSIG-LEN, where do we put it? */ +- return; +- case IWL_RX_PHY_INFO_TYPE_HE_TB_EXT: +- he->data1 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE2_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE3_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE4_KNOWN); +- he->data4 |= le16_encode_bits(le32_get_bits(phy_data->d0, +- IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE1), +- IEEE80211_RADIOTAP_HE_DATA4_TB_SPTL_REUSE1); +- he->data4 |= le16_encode_bits(le32_get_bits(phy_data->d0, +- IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE2), +- IEEE80211_RADIOTAP_HE_DATA4_TB_SPTL_REUSE2); +- he->data4 |= le16_encode_bits(le32_get_bits(phy_data->d0, +- IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE3), +- IEEE80211_RADIOTAP_HE_DATA4_TB_SPTL_REUSE3); +- he->data4 |= le16_encode_bits(le32_get_bits(phy_data->d0, +- IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE4), +- IEEE80211_RADIOTAP_HE_DATA4_TB_SPTL_REUSE4); +- /* fall through */ +- case IWL_RX_PHY_INFO_TYPE_HE_SU: +- case IWL_RX_PHY_INFO_TYPE_HE_MU: +- case IWL_RX_PHY_INFO_TYPE_HE_MU_EXT: +- case IWL_RX_PHY_INFO_TYPE_HE_TB: +- /* HE common */ +- he->data1 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_LDPC_XSYMSEG_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA1_UL_DL_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA1_DOPPLER_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA1_BSS_COLOR_KNOWN); +- he->data2 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRE_FEC_PAD_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA2_PE_DISAMBIG_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA2_TXOP_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA2_NUM_LTF_SYMS_KNOWN); +- he->data3 |= le16_encode_bits(le32_get_bits(phy_data->d0, +- IWL_RX_PHY_DATA0_HE_BSS_COLOR_MASK), +- IEEE80211_RADIOTAP_HE_DATA3_BSS_COLOR); +- he->data3 |= le16_encode_bits(le32_get_bits(phy_data->d0, +- IWL_RX_PHY_DATA0_HE_UPLINK), +- IEEE80211_RADIOTAP_HE_DATA3_UL_DL); +- he->data3 |= le16_encode_bits(le32_get_bits(phy_data->d0, +- IWL_RX_PHY_DATA0_HE_LDPC_EXT_SYM), +- IEEE80211_RADIOTAP_HE_DATA3_LDPC_XSYMSEG); +- he->data4 |= le16_encode_bits(le32_get_bits(phy_data->d0, +- IWL_RX_PHY_DATA0_HE_SPATIAL_REUSE_MASK), +- IEEE80211_RADIOTAP_HE_DATA4_SU_MU_SPTL_REUSE); +- he->data5 |= le16_encode_bits(le32_get_bits(phy_data->d0, +- IWL_RX_PHY_DATA0_HE_PRE_FEC_PAD_MASK), +- IEEE80211_RADIOTAP_HE_DATA5_PRE_FEC_PAD); +- he->data5 |= le16_encode_bits(le32_get_bits(phy_data->d0, +- IWL_RX_PHY_DATA0_HE_PE_DISAMBIG), +- IEEE80211_RADIOTAP_HE_DATA5_PE_DISAMBIG); +- he->data5 |= le16_encode_bits(le32_get_bits(phy_data->d1, +- IWL_RX_PHY_DATA1_HE_LTF_NUM_MASK), +- IEEE80211_RADIOTAP_HE_DATA5_NUM_LTF_SYMS); +- he->data6 |= le16_encode_bits(le32_get_bits(phy_data->d0, +- IWL_RX_PHY_DATA0_HE_TXOP_DUR_MASK), +- IEEE80211_RADIOTAP_HE_DATA6_TXOP); +- he->data6 |= le16_encode_bits(le32_get_bits(phy_data->d0, +- IWL_RX_PHY_DATA0_HE_DOPPLER), +- IEEE80211_RADIOTAP_HE_DATA6_DOPPLER); +- break; +- } ++ u32 he_type = rate_n_flags & RATE_MCS_HE_TYPE_MSK; ++ bool sigb_data; ++ u16 d1known = IEEE80211_RADIOTAP_HE_DATA1_LDPC_XSYMSEG_KNOWN | ++ IEEE80211_RADIOTAP_HE_DATA1_UL_DL_KNOWN | ++ IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE_KNOWN | ++ IEEE80211_RADIOTAP_HE_DATA1_DOPPLER_KNOWN | ++ IEEE80211_RADIOTAP_HE_DATA1_BSS_COLOR_KNOWN; ++ u16 d2known = IEEE80211_RADIOTAP_HE_DATA2_PRE_FEC_PAD_KNOWN | ++ IEEE80211_RADIOTAP_HE_DATA2_PE_DISAMBIG_KNOWN | ++ IEEE80211_RADIOTAP_HE_DATA2_TXOP_KNOWN; ++ ++ he->data1 |= cpu_to_le16(d1known); ++ he->data2 |= cpu_to_le16(d2known); ++ he->data3 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_BSS_COLOR_MASK, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_DATA3_BSS_COLOR); ++ he->data3 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_UPLINK, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_DATA3_UL_DL); ++ he->data3 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_LDPC_EXT_SYM, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_DATA3_LDPC_XSYMSEG); ++ he->data4 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SPATIAL_REUSE_MASK, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_DATA4_SU_MU_SPTL_REUSE); ++ he->data5 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_PRE_FEC_PAD_MASK, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_DATA5_PRE_FEC_PAD); ++ he->data5 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_PE_DISAMBIG, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_DATA5_PE_DISAMBIG); ++ he->data6 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_TXOP_DUR_MASK, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_DATA6_TXOP); ++ he->data6 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_DOPPLER, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_DATA6_DOPPLER); + +- switch (info_type) { +- case IWL_RX_PHY_INFO_TYPE_HE_MU_EXT: ++ switch (he_type) { ++ case RATE_MCS_HE_TYPE_MU: + he_mu->flags1 |= +- le16_encode_bits(le16_get_bits(phy_data->d4, +- IWL_RX_PHY_DATA4_HE_MU_EXT_SIGB_DCM), ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIGB_DCM, ++ he_phy_data), + IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_DCM); + he_mu->flags1 |= +- le16_encode_bits(le16_get_bits(phy_data->d4, +- IWL_RX_PHY_DATA4_HE_MU_EXT_SIGB_MCS_MASK), ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIGB_MCS_MASK, ++ he_phy_data), + IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_MCS); + he_mu->flags2 |= +- le16_encode_bits(le16_get_bits(phy_data->d4, +- IWL_RX_PHY_DATA4_HE_MU_EXT_PREAMBLE_PUNC_TYPE_MASK), +- IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW); +- iwl_mvm_decode_he_mu_ext(mvm, phy_data, rate_n_flags, he_mu); +- /* fall through */ +- case IWL_RX_PHY_INFO_TYPE_HE_MU: ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIBG_SYM_OR_USER_NUM_MASK, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_SYMS_USERS); + he_mu->flags2 |= +- le16_encode_bits(le32_get_bits(phy_data->d1, +- IWL_RX_PHY_DATA1_HE_MU_SIBG_SYM_OR_USER_NUM_MASK), +- IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_SYMS_USERS); +- he_mu->flags2 |= +- le16_encode_bits(le32_get_bits(phy_data->d1, +- IWL_RX_PHY_DATA1_HE_MU_SIGB_COMPRESSION), ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIGB_COMPRESSION, ++ he_phy_data), + IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_COMP); ++ he_mu->flags2 |= ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_PREAMBLE_PUNC_TYPE_MASK, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW); ++ ++ sigb_data = FIELD_GET(IWL_RX_HE_PHY_INFO_TYPE_MASK, ++ he_phy_data) == ++ IWL_RX_HE_PHY_INFO_TYPE_MU_EXT_INFO; ++ if (sigb_data) ++ iwl_mvm_decode_he_sigb(mvm, desc, rate_n_flags, he_mu); + /* fall through */ +- case IWL_RX_PHY_INFO_TYPE_HE_TB: +- case IWL_RX_PHY_INFO_TYPE_HE_TB_EXT: +- iwl_mvm_decode_he_phy_ru_alloc(phy_data, rate_n_flags, +- he, he_mu, rx_status); ++ case RATE_MCS_HE_TYPE_TRIG: ++ he->data2 |= ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_NUM_LTF_SYMS_KNOWN); ++ he->data5 |= ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_HE_LTF_NUM_MASK, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_DATA5_NUM_LTF_SYMS); ++ break; ++ case RATE_MCS_HE_TYPE_SU: ++ case RATE_MCS_HE_TYPE_EXT_SU: ++ he->data1 |= ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_BEAM_CHANGE_KNOWN); ++ he->data3 |= ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_BEAM_CHNG, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_DATA3_BEAM_CHANGE); + break; +- case IWL_RX_PHY_INFO_TYPE_HE_SU: +- he->data1 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_BEAM_CHANGE_KNOWN); +- he->data3 |= le16_encode_bits(le32_get_bits(phy_data->d0, +- IWL_RX_PHY_DATA0_HE_BEAM_CHNG), +- IEEE80211_RADIOTAP_HE_DATA3_BEAM_CHANGE); ++ } ++ ++ switch (FIELD_GET(IWL_RX_HE_PHY_INFO_TYPE_MASK, he_phy_data)) { ++ case IWL_RX_HE_PHY_INFO_TYPE_MU: ++ case IWL_RX_HE_PHY_INFO_TYPE_MU_EXT_INFO: ++ case IWL_RX_HE_PHY_INFO_TYPE_TB: ++ iwl_mvm_decode_he_phy_ru_alloc(he_phy_data, rate_n_flags, ++ he, he_mu, rx_status); + break; + default: + /* nothing */ +@@ -1163,6 +1147,9 @@ + u32 rate_n_flags, u16 phy_info, int queue) + { + struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb); ++ /* this is invalid e.g. because puncture type doesn't allow 0b11 */ ++#define HE_PHY_DATA_INVAL ((u64)-1) ++ u64 he_phy_data = HE_PHY_DATA_INVAL; + struct ieee80211_radiotap_he *he = NULL; + struct ieee80211_radiotap_he_mu *he_mu = NULL; + u32 he_type = rate_n_flags & RATE_MCS_HE_TYPE_MSK; +@@ -1184,66 +1171,54 @@ + IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_KNOWN), + }; + unsigned int radiotap_len = 0; +- struct iwl_mvm_rx_phy_data phy_data = { +- .d4 = desc->phy_data4, +- }; +- enum iwl_rx_phy_info_type info_type = IWL_RX_PHY_INFO_TYPE_NONE; +- +- if (mvm->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) { +- phy_data.d0 = desc->v3.phy_data0; +- phy_data.d1 = desc->v3.phy_data1; +- phy_data.d2 = desc->v3.phy_data2; +- phy_data.d3 = desc->v3.phy_data3; +- } else { +- phy_data.d0 = desc->v1.phy_data0; +- phy_data.d1 = desc->v1.phy_data1; +- phy_data.d2 = desc->v1.phy_data2; +- phy_data.d3 = desc->v1.phy_data3; +- } +- +- if (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD) +- info_type = le32_get_bits(phy_data.d1, +- IWL_RX_PHY_DATA1_INFO_TYPE_MASK); + + he = skb_put_data(skb, &known, sizeof(known)); + radiotap_len += sizeof(known); + rx_status->flag |= RX_FLAG_RADIOTAP_HE; + +- if (info_type == IWL_RX_PHY_INFO_TYPE_HE_MU || +- info_type == IWL_RX_PHY_INFO_TYPE_HE_MU_EXT) { +- he_mu = skb_put_data(skb, &mu_known, sizeof(mu_known)); +- radiotap_len += sizeof(mu_known); +- rx_status->flag |= RX_FLAG_RADIOTAP_HE_MU; ++ if (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD) { ++ if (mvm->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) ++ he_phy_data = le64_to_cpu(desc->v3.he_phy_data); ++ else ++ he_phy_data = le64_to_cpu(desc->v1.he_phy_data); ++ ++ if (he_type == RATE_MCS_HE_TYPE_MU) { ++ he_mu = skb_put_data(skb, &mu_known, sizeof(mu_known)); ++ radiotap_len += sizeof(mu_known); ++ rx_status->flag |= RX_FLAG_RADIOTAP_HE_MU; ++ } + } + + /* temporarily hide the radiotap data */ + __skb_pull(skb, radiotap_len); + +- if (info_type == IWL_RX_PHY_INFO_TYPE_HE_SU) { ++ if (he_phy_data != HE_PHY_DATA_INVAL && ++ he_type == RATE_MCS_HE_TYPE_SU) { + /* report the AMPDU-EOF bit on single frames */ + if (!queue && !(phy_info & IWL_RX_MPDU_PHY_AMPDU)) { + rx_status->flag |= RX_FLAG_AMPDU_DETAILS; + rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN; +- if (phy_data.d0 & cpu_to_le32(IWL_RX_PHY_DATA0_HE_DELIM_EOF)) ++ if (FIELD_GET(IWL_RX_HE_PHY_DELIM_EOF, he_phy_data)) + rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT; + } + } + +- if (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD) +- iwl_mvm_decode_he_phy_data(mvm, &phy_data, he, he_mu, rx_status, +- rate_n_flags, queue); ++ if (he_phy_data != HE_PHY_DATA_INVAL) ++ iwl_mvm_decode_he_phy_data(mvm, desc, he, he_mu, rx_status, ++ he_phy_data, rate_n_flags, queue); + + /* update aggregation data for monitor sake on default queue */ +- if (!queue && (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD) && +- (phy_info & IWL_RX_MPDU_PHY_AMPDU)) { ++ if (!queue && (phy_info & IWL_RX_MPDU_PHY_AMPDU)) { + bool toggle_bit = phy_info & IWL_RX_MPDU_PHY_AMPDU_TOGGLE; + + /* toggle is switched whenever new aggregation starts */ + if (toggle_bit != mvm->ampdu_toggle && ++ he_phy_data != HE_PHY_DATA_INVAL && + (he_type == RATE_MCS_HE_TYPE_MU || + he_type == RATE_MCS_HE_TYPE_SU)) { + rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN; +- if (phy_data.d0 & cpu_to_le32(IWL_RX_PHY_DATA0_HE_DELIM_EOF)) ++ if (FIELD_GET(IWL_RX_HE_PHY_DELIM_EOF, ++ he_phy_data)) + rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT; + } + } +@@ -1326,8 +1301,44 @@ + break; + } + +- he->data5 |= le16_encode_bits(ltf, +- IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE); ++ he->data5 |= le16_encode_bits(ltf, IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE); ++ ++ if (he_type == RATE_MCS_HE_TYPE_SU || ++ he_type == RATE_MCS_HE_TYPE_EXT_SU) { ++ u16 val; ++ ++ /* LTF syms correspond to streams */ ++ he->data2 |= ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_NUM_LTF_SYMS_KNOWN); ++ switch (rx_status->nss) { ++ case 1: ++ val = 0; ++ break; ++ case 2: ++ val = 1; ++ break; ++ case 3: ++ case 4: ++ val = 2; ++ break; ++ case 5: ++ case 6: ++ val = 3; ++ break; ++ case 7: ++ case 8: ++ val = 4; ++ break; ++ default: ++ WARN_ONCE(1, "invalid nss: %d\n", ++ rx_status->nss); ++ val = 0; ++ } ++ ++ he->data5 |= ++ le16_encode_bits(val, ++ IEEE80211_RADIOTAP_HE_DATA5_NUM_LTF_SYMS); ++ } + } + + void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi, diff --git a/SOURCES/0044-Revert-iwlwifi-mvm-remove-set-but-not-used-variable-.patch b/SOURCES/0044-Revert-iwlwifi-mvm-remove-set-but-not-used-variable-.patch new file mode 100644 index 0000000..f08b011 --- /dev/null +++ b/SOURCES/0044-Revert-iwlwifi-mvm-remove-set-but-not-used-variable-.patch @@ -0,0 +1,28 @@ +From dc7e4b317630effc7dd55b714820c158db9addf5 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:45:43 +0200 +Subject: [PATCH 15/43] Revert "iwlwifi: mvm: remove set but not used variable + 'he_phy_data'" + +This reverts commit 41c4588b06180aaa46dfc1a7d435befbbf269a93. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:42.865325621 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:43.040323389 +0200 +@@ -1464,6 +1464,12 @@ + /* update aggregation data for monitor sake on default queue */ + if (!queue && (phy_info & IWL_RX_MPDU_PHY_AMPDU)) { + bool toggle_bit = phy_info & IWL_RX_MPDU_PHY_AMPDU_TOGGLE; ++ u64 he_phy_data; ++ ++ if (mvm->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) ++ he_phy_data = le64_to_cpu(desc->v3.he_phy_data); ++ else ++ he_phy_data = le64_to_cpu(desc->v1.he_phy_data); + + rx_status->flag |= RX_FLAG_AMPDU_DETAILS; + /* diff --git a/SOURCES/0045-Revert-iwlwifi-mvm-show-more-HE-radiotap-data-for-TB.patch b/SOURCES/0045-Revert-iwlwifi-mvm-show-more-HE-radiotap-data-for-TB.patch new file mode 100644 index 0000000..1114c98 --- /dev/null +++ b/SOURCES/0045-Revert-iwlwifi-mvm-show-more-HE-radiotap-data-for-TB.patch @@ -0,0 +1,108 @@ +From 60ebb3bcd2e41735bd3ac849e7cee373022d3804 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:45:50 +0200 +Subject: [PATCH 16/43] Revert "iwlwifi: mvm: show more HE radiotap data for TB + PPDUs" + +This reverts commit 69f3ca8ed33dd39937ba0ea0c6643d78663db46a. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 67 ++++++++++++++------------- + 1 file changed, 36 insertions(+), 31 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:43.040323389 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:43.205321284 +0200 +@@ -1045,41 +1045,16 @@ + { + u32 he_type = rate_n_flags & RATE_MCS_HE_TYPE_MSK; + bool sigb_data; +- u16 d1known = IEEE80211_RADIOTAP_HE_DATA1_LDPC_XSYMSEG_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA1_UL_DL_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA1_DOPPLER_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA1_BSS_COLOR_KNOWN; +- u16 d2known = IEEE80211_RADIOTAP_HE_DATA2_PRE_FEC_PAD_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA2_PE_DISAMBIG_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA2_TXOP_KNOWN; + +- he->data1 |= cpu_to_le16(d1known); +- he->data2 |= cpu_to_le16(d2known); ++ he->data1 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_BSS_COLOR_KNOWN); + he->data3 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_BSS_COLOR_MASK, + he_phy_data), + IEEE80211_RADIOTAP_HE_DATA3_BSS_COLOR); +- he->data3 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_UPLINK, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_DATA3_UL_DL); +- he->data3 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_LDPC_EXT_SYM, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_DATA3_LDPC_XSYMSEG); +- he->data4 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SPATIAL_REUSE_MASK, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_DATA4_SU_MU_SPTL_REUSE); +- he->data5 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_PRE_FEC_PAD_MASK, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_DATA5_PRE_FEC_PAD); +- he->data5 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_PE_DISAMBIG, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_DATA5_PE_DISAMBIG); ++ ++ he->data2 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_TXOP_KNOWN); + he->data6 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_TXOP_DUR_MASK, + he_phy_data), + IEEE80211_RADIOTAP_HE_DATA6_TXOP); +- he->data6 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_DOPPLER, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_DATA6_DOPPLER); + + switch (he_type) { + case RATE_MCS_HE_TYPE_MU: +@@ -1109,8 +1084,7 @@ + IWL_RX_HE_PHY_INFO_TYPE_MU_EXT_INFO; + if (sigb_data) + iwl_mvm_decode_he_sigb(mvm, desc, rate_n_flags, he_mu); +- /* fall through */ +- case RATE_MCS_HE_TYPE_TRIG: ++ + he->data2 |= + cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_NUM_LTF_SYMS_KNOWN); + he->data5 |= +@@ -1129,6 +1103,37 @@ + break; + } + ++ if (he_type != RATE_MCS_HE_TYPE_TRIG) { ++ u16 d1known = IEEE80211_RADIOTAP_HE_DATA1_LDPC_XSYMSEG_KNOWN | ++ IEEE80211_RADIOTAP_HE_DATA1_UL_DL_KNOWN | ++ IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE_KNOWN | ++ IEEE80211_RADIOTAP_HE_DATA1_DOPPLER_KNOWN; ++ u16 d2known = IEEE80211_RADIOTAP_HE_DATA2_PRE_FEC_PAD_KNOWN | ++ IEEE80211_RADIOTAP_HE_DATA2_PE_DISAMBIG_KNOWN; ++ ++ he->data1 |= cpu_to_le16(d1known); ++ he->data2 |= cpu_to_le16(d2known); ++ ++ he->data3 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_UPLINK, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_DATA3_UL_DL); ++ he->data3 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_LDPC_EXT_SYM, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_DATA3_LDPC_XSYMSEG); ++ he->data4 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SPATIAL_REUSE_MASK, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_DATA4_SU_MU_SPTL_REUSE); ++ he->data5 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_PRE_FEC_PAD_MASK, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_DATA5_PRE_FEC_PAD); ++ he->data5 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_PE_DISAMBIG, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_DATA5_PE_DISAMBIG); ++ he->data6 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_DOPPLER, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_DATA6_DOPPLER); ++ } ++ + switch (FIELD_GET(IWL_RX_HE_PHY_INFO_TYPE_MASK, he_phy_data)) { + case IWL_RX_HE_PHY_INFO_TYPE_MU: + case IWL_RX_HE_PHY_INFO_TYPE_MU_EXT_INFO: diff --git a/SOURCES/0046-Revert-iwlwifi-mvm-decode-HE-information-for-MU-with.patch b/SOURCES/0046-Revert-iwlwifi-mvm-decode-HE-information-for-MU-with.patch new file mode 100644 index 0000000..c99218f --- /dev/null +++ b/SOURCES/0046-Revert-iwlwifi-mvm-decode-HE-information-for-MU-with.patch @@ -0,0 +1,46 @@ +From b712a47190ab9b19b44c22a357b3d7921710226e Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:46:00 +0200 +Subject: [PATCH 17/43] Revert "iwlwifi: mvm: decode HE information for MU + (without ext info)" + +This reverts commit 8a07e8d4b7361d3eb522b1306e33f50e4836e340. +--- + drivers/net/wireless/intel/iwlwifi/fw/api/rx.h | 8 ++++---- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 3 +-- + 2 files changed, 5 insertions(+), 6 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h 2019-09-06 01:25:42.865325621 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h 2019-09-06 01:25:43.369319192 +0200 +@@ -366,10 +366,10 @@ + /* trigger encoded */ + IWL_RX_HE_PHY_RU_ALLOC_MASK = 0xfe0000000000ULL, + IWL_RX_HE_PHY_INFO_TYPE_MASK = 0xf000000000000000ULL, +- IWL_RX_HE_PHY_INFO_TYPE_SU = 0x0, /* TSF low valid (first DW) */ +- IWL_RX_HE_PHY_INFO_TYPE_MU = 0x1, /* TSF low/high valid (both DWs) */ +- IWL_RX_HE_PHY_INFO_TYPE_MU_EXT_INFO = 0x2, /* same + SIGB-common0/1/2 valid */ +- IWL_RX_HE_PHY_INFO_TYPE_TB = 0x3, /* TSF low/high valid (both DWs) */ ++ IWL_RX_HE_PHY_INFO_TYPE_SU = 0x0, ++ IWL_RX_HE_PHY_INFO_TYPE_MU = 0x1, ++ IWL_RX_HE_PHY_INFO_TYPE_MU_EXT_INFO = 0x2, ++ IWL_RX_HE_PHY_INFO_TYPE_TB_EXT_INFO = 0x3, + + /* second dword - MU data */ + IWL_RX_HE_PHY_MU_SIGB_COMPRESSION = BIT_ULL(32 + 0), +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:43.205321284 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:43.370319180 +0200 +@@ -1135,9 +1135,8 @@ + } + + switch (FIELD_GET(IWL_RX_HE_PHY_INFO_TYPE_MASK, he_phy_data)) { +- case IWL_RX_HE_PHY_INFO_TYPE_MU: + case IWL_RX_HE_PHY_INFO_TYPE_MU_EXT_INFO: +- case IWL_RX_HE_PHY_INFO_TYPE_TB: ++ case IWL_RX_HE_PHY_INFO_TYPE_TB_EXT_INFO: + iwl_mvm_decode_he_phy_ru_alloc(he_phy_data, rate_n_flags, + he, he_mu, rx_status); + break; diff --git a/SOURCES/0047-Revert-iwlwifi-mvm-add-more-information-to-HE-radiot.patch b/SOURCES/0047-Revert-iwlwifi-mvm-add-more-information-to-HE-radiot.patch new file mode 100644 index 0000000..3a9914e --- /dev/null +++ b/SOURCES/0047-Revert-iwlwifi-mvm-add-more-information-to-HE-radiot.patch @@ -0,0 +1,84 @@ +From 1235f5e955960b66e022f0aca5703b9dfc68ef30 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:46:08 +0200 +Subject: [PATCH 18/43] Revert "iwlwifi: mvm: add more information to HE + radiotap" + +This reverts commit fed3c4ea6f8f12cb73010c969070f7dbed46ff3f. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 35 +++------------------------ + 1 file changed, 4 insertions(+), 31 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:43.370319180 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:43.541316998 +0200 +@@ -1044,7 +1044,6 @@ + int queue) + { + u32 he_type = rate_n_flags & RATE_MCS_HE_TYPE_MSK; +- bool sigb_data; + + he->data1 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_BSS_COLOR_KNOWN); + he->data3 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_BSS_COLOR_MASK, +@@ -1056,8 +1055,9 @@ + he_phy_data), + IEEE80211_RADIOTAP_HE_DATA6_TXOP); + +- switch (he_type) { +- case RATE_MCS_HE_TYPE_MU: ++ if (he_mu) { ++ bool sigb_data; ++ + he_mu->flags1 |= + le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIGB_DCM, + he_phy_data), +@@ -1091,28 +1091,13 @@ + le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_HE_LTF_NUM_MASK, + he_phy_data), + IEEE80211_RADIOTAP_HE_DATA5_NUM_LTF_SYMS); +- break; +- case RATE_MCS_HE_TYPE_SU: +- case RATE_MCS_HE_TYPE_EXT_SU: +- he->data1 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_BEAM_CHANGE_KNOWN); +- he->data3 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_BEAM_CHNG, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_DATA3_BEAM_CHANGE); +- break; + } + + if (he_type != RATE_MCS_HE_TYPE_TRIG) { + u16 d1known = IEEE80211_RADIOTAP_HE_DATA1_LDPC_XSYMSEG_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA1_UL_DL_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA1_DOPPLER_KNOWN; +- u16 d2known = IEEE80211_RADIOTAP_HE_DATA2_PRE_FEC_PAD_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA2_PE_DISAMBIG_KNOWN; ++ IEEE80211_RADIOTAP_HE_DATA1_UL_DL_KNOWN; + + he->data1 |= cpu_to_le16(d1known); +- he->data2 |= cpu_to_le16(d2known); + + he->data3 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_UPLINK, + he_phy_data), +@@ -1120,18 +1105,6 @@ + he->data3 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_LDPC_EXT_SYM, + he_phy_data), + IEEE80211_RADIOTAP_HE_DATA3_LDPC_XSYMSEG); +- he->data4 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SPATIAL_REUSE_MASK, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_DATA4_SU_MU_SPTL_REUSE); +- he->data5 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_PRE_FEC_PAD_MASK, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_DATA5_PRE_FEC_PAD); +- he->data5 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_PE_DISAMBIG, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_DATA5_PE_DISAMBIG); +- he->data6 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_DOPPLER, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_DATA6_DOPPLER); + } + + switch (FIELD_GET(IWL_RX_HE_PHY_INFO_TYPE_MASK, he_phy_data)) { diff --git a/SOURCES/0048-Revert-iwlwifi-mvm-add-LDPC-XSYM-to-HE-radiotap-data.patch b/SOURCES/0048-Revert-iwlwifi-mvm-add-LDPC-XSYM-to-HE-radiotap-data.patch new file mode 100644 index 0000000..d1f06ea --- /dev/null +++ b/SOURCES/0048-Revert-iwlwifi-mvm-add-LDPC-XSYM-to-HE-radiotap-data.patch @@ -0,0 +1,38 @@ +From a25f92136344bc8586f99ba71b524570f2a8c18a Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:46:15 +0200 +Subject: [PATCH 19/43] Revert "iwlwifi: mvm: add LDPC-XSYM to HE radiotap + data" + +This reverts commit 750f43774eb43aa36465c2df5874dbeafb67c9bd. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 16 +++++----------- + 1 file changed, 5 insertions(+), 11 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:43.541316998 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:43.709314856 +0200 +@@ -1094,17 +1094,11 @@ + } + + if (he_type != RATE_MCS_HE_TYPE_TRIG) { +- u16 d1known = IEEE80211_RADIOTAP_HE_DATA1_LDPC_XSYMSEG_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA1_UL_DL_KNOWN; +- +- he->data1 |= cpu_to_le16(d1known); +- +- he->data3 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_UPLINK, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_DATA3_UL_DL); +- he->data3 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_LDPC_EXT_SYM, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_DATA3_LDPC_XSYMSEG); ++ he->data1 |= ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_UL_DL_KNOWN); ++ if (FIELD_GET(IWL_RX_HE_PHY_UPLINK, he_phy_data)) ++ he->data3 |= ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA3_UL_DL); + } + + switch (FIELD_GET(IWL_RX_HE_PHY_INFO_TYPE_MASK, he_phy_data)) { diff --git a/SOURCES/0049-Revert-iwlwifi-mvm-add-TXOP-to-HE-radiotap-data.patch b/SOURCES/0049-Revert-iwlwifi-mvm-add-TXOP-to-HE-radiotap-data.patch new file mode 100644 index 0000000..57578b8 --- /dev/null +++ b/SOURCES/0049-Revert-iwlwifi-mvm-add-TXOP-to-HE-radiotap-data.patch @@ -0,0 +1,26 @@ +From 62a3de9ef101ff11c6214783901a89a82751cb41 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:46:22 +0200 +Subject: [PATCH 20/43] Revert "iwlwifi: mvm: add TXOP to HE radiotap data" + +This reverts commit 2b1476345fb6c837fae608c4fd9fddb48059c612. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 5 ----- + 1 file changed, 5 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:43.709314856 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:43.872312776 +0200 +@@ -1050,11 +1050,6 @@ + he_phy_data), + IEEE80211_RADIOTAP_HE_DATA3_BSS_COLOR); + +- he->data2 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_TXOP_KNOWN); +- he->data6 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_TXOP_DUR_MASK, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_DATA6_TXOP); +- + if (he_mu) { + bool sigb_data; + diff --git a/SOURCES/0050-Revert-iwlwifi-mvm-move-HE-MU-LTF_NUM-parsing-to-he_.patch b/SOURCES/0050-Revert-iwlwifi-mvm-move-HE-MU-LTF_NUM-parsing-to-he_.patch new file mode 100644 index 0000000..81fad3d --- /dev/null +++ b/SOURCES/0050-Revert-iwlwifi-mvm-move-HE-MU-LTF_NUM-parsing-to-he_.patch @@ -0,0 +1,74 @@ +From f29430ff87e1ed63de31f76d4d6e5e07567649f3 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:46:30 +0200 +Subject: [PATCH 21/43] Revert "iwlwifi: mvm: move HE-MU LTF_NUM parsing to + he_phy_data parsing" + +This reverts commit 42d8a9d5783e4efdbdf746b139dc98e2b64f3ce3. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 35 +++++++++++++++++++-------- + 1 file changed, 25 insertions(+), 10 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:43.872312776 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:44.039310646 +0200 +@@ -1079,13 +1079,6 @@ + IWL_RX_HE_PHY_INFO_TYPE_MU_EXT_INFO; + if (sigb_data) + iwl_mvm_decode_he_sigb(mvm, desc, rate_n_flags, he_mu); +- +- he->data2 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_NUM_LTF_SYMS_KNOWN); +- he->data5 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_HE_LTF_NUM_MASK, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_DATA5_NUM_LTF_SYMS); + } + + if (he_type != RATE_MCS_HE_TYPE_TRIG) { +@@ -1269,8 +1262,9 @@ + + he->data5 |= le16_encode_bits(ltf, IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE); + +- if (he_type == RATE_MCS_HE_TYPE_SU || +- he_type == RATE_MCS_HE_TYPE_EXT_SU) { ++ switch (he_type) { ++ case RATE_MCS_HE_TYPE_SU: ++ case RATE_MCS_HE_TYPE_EXT_SU: { + u16 val; + + /* LTF syms correspond to streams */ +@@ -1300,10 +1294,31 @@ + rx_status->nss); + val = 0; + } +- + he->data5 |= + le16_encode_bits(val, + IEEE80211_RADIOTAP_HE_DATA5_NUM_LTF_SYMS); ++ } ++ break; ++ case RATE_MCS_HE_TYPE_MU: { ++ u16 val; ++ ++ if (he_phy_data == HE_PHY_DATA_INVAL) ++ break; ++ ++ val = FIELD_GET(IWL_RX_HE_PHY_HE_LTF_NUM_MASK, ++ he_phy_data); ++ ++ he->data2 |= ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_NUM_LTF_SYMS_KNOWN); ++ he->data5 |= ++ cpu_to_le16(FIELD_PREP( ++ IEEE80211_RADIOTAP_HE_DATA5_NUM_LTF_SYMS, ++ val)); ++ } ++ break; ++ case RATE_MCS_HE_TYPE_TRIG: ++ /* not supported */ ++ break; + } + } + diff --git a/SOURCES/0051-Revert-iwlwifi-mvm-clean-up-HE-radiotap-RU-allocatio.patch b/SOURCES/0051-Revert-iwlwifi-mvm-clean-up-HE-radiotap-RU-allocatio.patch new file mode 100644 index 0000000..4587006 --- /dev/null +++ b/SOURCES/0051-Revert-iwlwifi-mvm-clean-up-HE-radiotap-RU-allocatio.patch @@ -0,0 +1,216 @@ +From a93e24f4eaf087b32f3e81022d4e907224632a73 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:46:38 +0200 +Subject: [PATCH 22/43] Revert "iwlwifi: mvm: clean up HE radiotap RU + allocation parsing" + +This reverts commit ffe9d734b8b556737c87acaa08666d0a6c1686ab. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 166 ++++++++++++-------------- + 1 file changed, 77 insertions(+), 89 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:44.039310646 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:44.206308516 +0200 +@@ -963,83 +963,10 @@ + } + } + +-static void +-iwl_mvm_decode_he_phy_ru_alloc(u64 he_phy_data, u32 rate_n_flags, +- struct ieee80211_radiotap_he *he, +- struct ieee80211_radiotap_he_mu *he_mu, +- struct ieee80211_rx_status *rx_status) +-{ +- /* +- * Unfortunately, we have to leave the mac80211 data +- * incorrect for the case that we receive an HE-MU +- * transmission and *don't* have the HE phy data (due +- * to the bits being used for TSF). This shouldn't +- * happen though as management frames where we need +- * the TSF/timers are not be transmitted in HE-MU. +- */ +- u8 ru = FIELD_GET(IWL_RX_HE_PHY_RU_ALLOC_MASK, he_phy_data); +- u8 offs = 0; +- +- rx_status->bw = RATE_INFO_BW_HE_RU; +- +- he->data1 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_BW_RU_ALLOC_KNOWN); +- +- switch (ru) { +- case 0 ... 36: +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_26; +- offs = ru; +- break; +- case 37 ... 52: +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_52; +- offs = ru - 37; +- break; +- case 53 ... 60: +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_106; +- offs = ru - 53; +- break; +- case 61 ... 64: +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_242; +- offs = ru - 61; +- break; +- case 65 ... 66: +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_484; +- offs = ru - 65; +- break; +- case 67: +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_996; +- break; +- case 68: +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_2x996; +- break; +- } +- he->data2 |= le16_encode_bits(offs, +- IEEE80211_RADIOTAP_HE_DATA2_RU_OFFSET); +- he->data2 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA2_RU_OFFSET_KNOWN); +- if (he_phy_data & IWL_RX_HE_PHY_RU_ALLOC_SEC80) +- he->data2 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_SEC); +- +- if (he_mu) { +-#define CHECK_BW(bw) \ +- BUILD_BUG_ON(IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_ ## bw ## MHZ != \ +- RATE_MCS_CHAN_WIDTH_##bw >> RATE_MCS_CHAN_WIDTH_POS) +- CHECK_BW(20); +- CHECK_BW(40); +- CHECK_BW(80); +- CHECK_BW(160); +- he_mu->flags2 |= +- le16_encode_bits(FIELD_GET(RATE_MCS_CHAN_WIDTH_MSK, +- rate_n_flags), +- IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW); +- } +-} +- + static void iwl_mvm_decode_he_phy_data(struct iwl_mvm *mvm, + struct iwl_rx_mpdu_desc *desc, + struct ieee80211_radiotap_he *he, + struct ieee80211_radiotap_he_mu *he_mu, +- struct ieee80211_rx_status *rx_status, + u64 he_phy_data, u32 rate_n_flags, + int queue) + { +@@ -1088,17 +1015,6 @@ + he->data3 |= + cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA3_UL_DL); + } +- +- switch (FIELD_GET(IWL_RX_HE_PHY_INFO_TYPE_MASK, he_phy_data)) { +- case IWL_RX_HE_PHY_INFO_TYPE_MU_EXT_INFO: +- case IWL_RX_HE_PHY_INFO_TYPE_TB_EXT_INFO: +- iwl_mvm_decode_he_phy_ru_alloc(he_phy_data, rate_n_flags, +- he, he_mu, rx_status); +- break; +- default: +- /* nothing */ +- break; +- } + } + + static void iwl_mvm_rx_he(struct iwl_mvm *mvm, struct sk_buff *skb, +@@ -1163,8 +1079,8 @@ + } + + if (he_phy_data != HE_PHY_DATA_INVAL) +- iwl_mvm_decode_he_phy_data(mvm, desc, he, he_mu, rx_status, +- he_phy_data, rate_n_flags, queue); ++ iwl_mvm_decode_he_phy_data(mvm, desc, he, he_mu, he_phy_data, ++ rate_n_flags, queue); + + /* update aggregation data for monitor sake on default queue */ + if (!queue && (phy_info & IWL_RX_MPDU_PHY_AMPDU)) { +@@ -1188,12 +1104,84 @@ + rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_106; + } + +- /* actually data is filled in mac80211 */ +- if (he_type == RATE_MCS_HE_TYPE_SU || +- he_type == RATE_MCS_HE_TYPE_EXT_SU) ++ if (he_phy_data != HE_PHY_DATA_INVAL && ++ (FIELD_GET(IWL_RX_HE_PHY_INFO_TYPE_MASK, he_phy_data) == ++ IWL_RX_HE_PHY_INFO_TYPE_MU_EXT_INFO || ++ FIELD_GET(IWL_RX_HE_PHY_INFO_TYPE_MASK, he_phy_data) == ++ IWL_RX_HE_PHY_INFO_TYPE_TB_EXT_INFO)) { ++ /* ++ * Unfortunately, we have to leave the mac80211 data ++ * incorrect for the case that we receive an HE-MU ++ * transmission and *don't* have the HE phy data (due ++ * to the bits being used for TSF). This shouldn't ++ * happen though as management frames where we need ++ * the TSF/timers are not be transmitted in HE-MU. ++ */ ++ u8 ru = FIELD_GET(IWL_RX_HE_PHY_RU_ALLOC_MASK, he_phy_data); ++ u8 offs = 0; ++ ++ rx_status->bw = RATE_INFO_BW_HE_RU; ++ + he->data1 |= + cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_BW_RU_ALLOC_KNOWN); + ++ switch (ru) { ++ case 0 ... 36: ++ rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_26; ++ offs = ru; ++ break; ++ case 37 ... 52: ++ rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_52; ++ offs = ru - 37; ++ break; ++ case 53 ... 60: ++ rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_106; ++ offs = ru - 53; ++ break; ++ case 61 ... 64: ++ rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_242; ++ offs = ru - 61; ++ break; ++ case 65 ... 66: ++ rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_484; ++ offs = ru - 65; ++ break; ++ case 67: ++ rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_996; ++ break; ++ case 68: ++ rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_2x996; ++ break; ++ } ++ he->data2 |= ++ le16_encode_bits(offs, ++ IEEE80211_RADIOTAP_HE_DATA2_RU_OFFSET); ++ he->data2 |= ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_KNOWN | ++ IEEE80211_RADIOTAP_HE_DATA2_RU_OFFSET_KNOWN); ++ if (he_phy_data & IWL_RX_HE_PHY_RU_ALLOC_SEC80) ++ he->data2 |= ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_SEC); ++ ++ if (he_mu) { ++#define CHECK_BW(bw) \ ++ BUILD_BUG_ON(IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_ ## bw ## MHZ != \ ++ RATE_MCS_CHAN_WIDTH_##bw >> RATE_MCS_CHAN_WIDTH_POS) ++ CHECK_BW(20); ++ CHECK_BW(40); ++ CHECK_BW(80); ++ CHECK_BW(160); ++ he->data2 |= ++ le16_encode_bits(FIELD_GET(RATE_MCS_CHAN_WIDTH_MSK, ++ rate_n_flags), ++ IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW); ++ } ++ } else if (he_type == RATE_MCS_HE_TYPE_SU || ++ he_type == RATE_MCS_HE_TYPE_EXT_SU) { ++ he->data1 |= ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_BW_RU_ALLOC_KNOWN); ++ } ++ + stbc = (rate_n_flags & RATE_MCS_STBC_MSK) >> RATE_MCS_STBC_POS; + rx_status->nss = + ((rate_n_flags & RATE_VHT_MCS_NSS_MSK) >> diff --git a/SOURCES/0052-Revert-iwlwifi-mvm-pull-some-he_phy_data-decoding-in.patch b/SOURCES/0052-Revert-iwlwifi-mvm-pull-some-he_phy_data-decoding-in.patch new file mode 100644 index 0000000..626b536 --- /dev/null +++ b/SOURCES/0052-Revert-iwlwifi-mvm-pull-some-he_phy_data-decoding-in.patch @@ -0,0 +1,148 @@ +From a88d3a6f3ceecd318bfe4b27ca6ccd37787389a2 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:46:46 +0200 +Subject: [PATCH 23/43] Revert "iwlwifi: mvm: pull some he_phy_data decoding + into a separate function" + +This reverts commit 59b8cf0cfb5ac508e362ae1ddf0dfb91744856fb. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 105 +++++++++++--------------- + 1 file changed, 46 insertions(+), 59 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:44.206308516 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:44.369306437 +0200 +@@ -963,60 +963,6 @@ + } + } + +-static void iwl_mvm_decode_he_phy_data(struct iwl_mvm *mvm, +- struct iwl_rx_mpdu_desc *desc, +- struct ieee80211_radiotap_he *he, +- struct ieee80211_radiotap_he_mu *he_mu, +- u64 he_phy_data, u32 rate_n_flags, +- int queue) +-{ +- u32 he_type = rate_n_flags & RATE_MCS_HE_TYPE_MSK; +- +- he->data1 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_BSS_COLOR_KNOWN); +- he->data3 |= le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_BSS_COLOR_MASK, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_DATA3_BSS_COLOR); +- +- if (he_mu) { +- bool sigb_data; +- +- he_mu->flags1 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIGB_DCM, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_DCM); +- he_mu->flags1 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIGB_MCS_MASK, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_MCS); +- he_mu->flags2 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIBG_SYM_OR_USER_NUM_MASK, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_SYMS_USERS); +- he_mu->flags2 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIGB_COMPRESSION, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_COMP); +- he_mu->flags2 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_PREAMBLE_PUNC_TYPE_MASK, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW); +- +- sigb_data = FIELD_GET(IWL_RX_HE_PHY_INFO_TYPE_MASK, +- he_phy_data) == +- IWL_RX_HE_PHY_INFO_TYPE_MU_EXT_INFO; +- if (sigb_data) +- iwl_mvm_decode_he_sigb(mvm, desc, rate_n_flags, he_mu); +- } +- +- if (he_type != RATE_MCS_HE_TYPE_TRIG) { +- he->data1 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_UL_DL_KNOWN); +- if (FIELD_GET(IWL_RX_HE_PHY_UPLINK, he_phy_data)) +- he->data3 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA3_UL_DL); +- } +-} +- + static void iwl_mvm_rx_he(struct iwl_mvm *mvm, struct sk_buff *skb, + struct iwl_rx_mpdu_desc *desc, + u32 rate_n_flags, u16 phy_info, int queue) +@@ -1046,6 +992,7 @@ + IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_KNOWN), + }; + unsigned int radiotap_len = 0; ++ bool sigb_data = false; + + he = skb_put_data(skb, &known, sizeof(known)); + radiotap_len += sizeof(known); +@@ -1069,18 +1016,58 @@ + + if (he_phy_data != HE_PHY_DATA_INVAL && + he_type == RATE_MCS_HE_TYPE_SU) { +- /* report the AMPDU-EOF bit on single frames */ ++ he->data1 |= ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_UL_DL_KNOWN); ++ if (FIELD_GET(IWL_RX_HE_PHY_UPLINK, he_phy_data)) ++ he->data3 |= ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA3_UL_DL); ++ + if (!queue && !(phy_info & IWL_RX_MPDU_PHY_AMPDU)) { + rx_status->flag |= RX_FLAG_AMPDU_DETAILS; + rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN; + if (FIELD_GET(IWL_RX_HE_PHY_DELIM_EOF, he_phy_data)) + rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT; + } +- } ++ } else if (he_phy_data != HE_PHY_DATA_INVAL && he_mu) { ++ he_mu->flags1 |= ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIGB_DCM, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_DCM); ++ he_mu->flags1 |= ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIGB_MCS_MASK, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_MCS); ++ he_mu->flags2 |= ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIBG_SYM_OR_USER_NUM_MASK, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_SYMS_USERS); ++ he_mu->flags2 |= ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIGB_COMPRESSION, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_COMP); ++ he_mu->flags2 |= ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_PREAMBLE_PUNC_TYPE_MASK, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW); + +- if (he_phy_data != HE_PHY_DATA_INVAL) +- iwl_mvm_decode_he_phy_data(mvm, desc, he, he_mu, he_phy_data, +- rate_n_flags, queue); ++ sigb_data = FIELD_GET(IWL_RX_HE_PHY_INFO_TYPE_MASK, ++ he_phy_data) == ++ IWL_RX_HE_PHY_INFO_TYPE_MU_EXT_INFO; ++ if (sigb_data) ++ iwl_mvm_decode_he_sigb(mvm, desc, rate_n_flags, he_mu); ++ } ++ if (he_phy_data != HE_PHY_DATA_INVAL && ++ (he_type == RATE_MCS_HE_TYPE_SU || ++ he_type == RATE_MCS_HE_TYPE_MU)) { ++ u8 bss_color = FIELD_GET(IWL_RX_HE_PHY_BSS_COLOR_MASK, ++ he_phy_data); ++ ++ if (bss_color) { ++ he->data1 |= ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_BSS_COLOR_KNOWN); ++ he->data3 |= cpu_to_le16(bss_color); ++ } ++ } + + /* update aggregation data for monitor sake on default queue */ + if (!queue && (phy_info & IWL_RX_MPDU_PHY_AMPDU)) { diff --git a/SOURCES/0053-Revert-iwlwifi-mvm-put-HE-SIG-B-symbols-users-data-c.patch b/SOURCES/0053-Revert-iwlwifi-mvm-put-HE-SIG-B-symbols-users-data-c.patch new file mode 100644 index 0000000..b58bfc2 --- /dev/null +++ b/SOURCES/0053-Revert-iwlwifi-mvm-put-HE-SIG-B-symbols-users-data-c.patch @@ -0,0 +1,37 @@ +From 9c06dcda83c311ffcda2f3fe983bcd8c5cd458a1 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:46:53 +0200 +Subject: [PATCH 24/43] Revert "iwlwifi: mvm: put HE SIG-B symbols/users data + correctly" + +This reverts commit eb89c0fb9191e6ebd8f1af52624f1aa034b707b6. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:44.369306437 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:44.531304371 +0200 +@@ -1030,6 +1030,10 @@ + } + } else if (he_phy_data != HE_PHY_DATA_INVAL && he_mu) { + he_mu->flags1 |= ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIBG_SYM_OR_USER_NUM_MASK, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_SYMS_USERS); ++ he_mu->flags1 |= + le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIGB_DCM, + he_phy_data), + IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_DCM); +@@ -1038,10 +1042,6 @@ + he_phy_data), + IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_MCS); + he_mu->flags2 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIBG_SYM_OR_USER_NUM_MASK, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_SYMS_USERS); +- he_mu->flags2 |= + le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIGB_COMPRESSION, + he_phy_data), + IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_COMP); diff --git a/SOURCES/0054-Revert-iwlwifi-mvm-minor-cleanups-to-HE-radiotap-cod.patch b/SOURCES/0054-Revert-iwlwifi-mvm-minor-cleanups-to-HE-radiotap-cod.patch new file mode 100644 index 0000000..56d0a5f --- /dev/null +++ b/SOURCES/0054-Revert-iwlwifi-mvm-minor-cleanups-to-HE-radiotap-cod.patch @@ -0,0 +1,47 @@ +From 4f2b4c2c38836f9a20ac16ad0ddc8f273b1997a6 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:47:02 +0200 +Subject: [PATCH 25/43] Revert "iwlwifi: mvm: minor cleanups to HE radiotap + code" + +This reverts commit f9fe579386a84878eea9217c8e825a7d11335feb. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:44.531304371 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:44.696302266 +0200 +@@ -973,8 +973,9 @@ + u64 he_phy_data = HE_PHY_DATA_INVAL; + struct ieee80211_radiotap_he *he = NULL; + struct ieee80211_radiotap_he_mu *he_mu = NULL; +- u32 he_type = rate_n_flags & RATE_MCS_HE_TYPE_MSK; ++ u32 he_type = 0xffffffff; + u8 stbc, ltf; ++ + static const struct ieee80211_radiotap_he known = { + .data1 = cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_DATA_MCS_KNOWN | + IEEE80211_RADIOTAP_HE_DATA1_DATA_DCM_KNOWN | +@@ -998,14 +999,18 @@ + radiotap_len += sizeof(known); + rx_status->flag |= RX_FLAG_RADIOTAP_HE; + ++ he_type = rate_n_flags & RATE_MCS_HE_TYPE_MSK; ++ + if (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD) { +- if (mvm->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) ++ if (mvm->trans->cfg->device_family >= ++ IWL_DEVICE_FAMILY_22560) + he_phy_data = le64_to_cpu(desc->v3.he_phy_data); + else + he_phy_data = le64_to_cpu(desc->v1.he_phy_data); + + if (he_type == RATE_MCS_HE_TYPE_MU) { +- he_mu = skb_put_data(skb, &mu_known, sizeof(mu_known)); ++ he_mu = skb_put_data(skb, &mu_known, ++ sizeof(mu_known)); + radiotap_len += sizeof(mu_known); + rx_status->flag |= RX_FLAG_RADIOTAP_HE_MU; + } diff --git a/SOURCES/0055-Revert-iwlwifi-mvm-remove-unnecessary-overload-varia.patch b/SOURCES/0055-Revert-iwlwifi-mvm-remove-unnecessary-overload-varia.patch new file mode 100644 index 0000000..4e7d67d --- /dev/null +++ b/SOURCES/0055-Revert-iwlwifi-mvm-remove-unnecessary-overload-varia.patch @@ -0,0 +1,42 @@ +From 4edf3a23bf91859531bcfaa54451c8c39e60bb0b Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:47:12 +0200 +Subject: [PATCH 26/43] Revert "iwlwifi: mvm: remove unnecessary overload + variable" + +This reverts commit 07f62bb953e83f070df068589b391f74cc06ccca. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:44.696302266 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:44.863300136 +0200 +@@ -993,6 +993,7 @@ + IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_KNOWN), + }; + unsigned int radiotap_len = 0; ++ bool overload = phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD; + bool sigb_data = false; + + he = skb_put_data(skb, &known, sizeof(known)); +@@ -1019,8 +1020,7 @@ + /* temporarily hide the radiotap data */ + __skb_pull(skb, radiotap_len); + +- if (he_phy_data != HE_PHY_DATA_INVAL && +- he_type == RATE_MCS_HE_TYPE_SU) { ++ if (overload && he_type == RATE_MCS_HE_TYPE_SU) { + he->data1 |= + cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_UL_DL_KNOWN); + if (FIELD_GET(IWL_RX_HE_PHY_UPLINK, he_phy_data)) +@@ -1033,7 +1033,7 @@ + if (FIELD_GET(IWL_RX_HE_PHY_DELIM_EOF, he_phy_data)) + rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT; + } +- } else if (he_phy_data != HE_PHY_DATA_INVAL && he_mu) { ++ } else if (overload && he_mu && he_phy_data != HE_PHY_DATA_INVAL) { + he_mu->flags1 |= + le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIBG_SYM_OR_USER_NUM_MASK, + he_phy_data), diff --git a/SOURCES/0056-Revert-iwlwifi-mvm-report-RU-offset-is-known.patch b/SOURCES/0056-Revert-iwlwifi-mvm-report-RU-offset-is-known.patch new file mode 100644 index 0000000..1c44a66 --- /dev/null +++ b/SOURCES/0056-Revert-iwlwifi-mvm-report-RU-offset-is-known.patch @@ -0,0 +1,24 @@ +From fc0bd30f367a3d76537c618b74d74c6e624162ee Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:47:32 +0200 +Subject: [PATCH 27/43] Revert "iwlwifi: mvm: report RU offset is known" + +This reverts commit a76938f35e4cfb9bc40a405220ec040f6b45d09c. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:44.863300136 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:45.032297980 +0200 +@@ -1149,8 +1149,7 @@ + le16_encode_bits(offs, + IEEE80211_RADIOTAP_HE_DATA2_RU_OFFSET); + he->data2 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA2_RU_OFFSET_KNOWN); ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_KNOWN); + if (he_phy_data & IWL_RX_HE_PHY_RU_ALLOC_SEC80) + he->data2 |= + cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_SEC); diff --git a/SOURCES/0057-Revert-iwlwifi-mvm-decode-HE-TB-PPDU-data.patch b/SOURCES/0057-Revert-iwlwifi-mvm-decode-HE-TB-PPDU-data.patch new file mode 100644 index 0000000..880a594 --- /dev/null +++ b/SOURCES/0057-Revert-iwlwifi-mvm-decode-HE-TB-PPDU-data.patch @@ -0,0 +1,135 @@ +From 302d708fad6d37c7c42760f0a8a9f7398dec5d01 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:47:48 +0200 +Subject: [PATCH 28/43] Revert "iwlwifi: mvm: decode HE TB PPDU data" + +This reverts commit 764f9de5027149518b1633e5846b21b9fb882363. +--- + drivers/net/wireless/intel/iwlwifi/fw/api/rx.h | 21 ++++++-------- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 38 ++++++++++++-------------- + 2 files changed, 25 insertions(+), 34 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h 2019-09-06 01:25:43.369319192 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h 2019-09-06 01:25:45.197295875 +0200 +@@ -360,27 +360,22 @@ + /* 6 bits reserved */ + IWL_RX_HE_PHY_DELIM_EOF = BIT(31), + +- /* second dword - common data */ ++ /* second dword - MU data */ ++ IWL_RX_HE_PHY_SIGB_COMPRESSION = BIT_ULL(32 + 0), ++ IWL_RX_HE_PHY_SIBG_SYM_OR_USER_NUM_MASK = 0x1e00000000ULL, + IWL_RX_HE_PHY_HE_LTF_NUM_MASK = 0xe000000000ULL, + IWL_RX_HE_PHY_RU_ALLOC_SEC80 = BIT_ULL(32 + 8), + /* trigger encoded */ + IWL_RX_HE_PHY_RU_ALLOC_MASK = 0xfe0000000000ULL, ++ IWL_RX_HE_PHY_SIGB_MCS_MASK = 0xf000000000000ULL, ++ /* 1 bit reserved */ ++ IWL_RX_HE_PHY_SIGB_DCM = BIT_ULL(32 + 21), ++ IWL_RX_HE_PHY_PREAMBLE_PUNC_TYPE_MASK = 0xc0000000000000ULL, ++ /* 4 bits reserved */ + IWL_RX_HE_PHY_INFO_TYPE_MASK = 0xf000000000000000ULL, + IWL_RX_HE_PHY_INFO_TYPE_SU = 0x0, + IWL_RX_HE_PHY_INFO_TYPE_MU = 0x1, + IWL_RX_HE_PHY_INFO_TYPE_MU_EXT_INFO = 0x2, +- IWL_RX_HE_PHY_INFO_TYPE_TB_EXT_INFO = 0x3, +- +- /* second dword - MU data */ +- IWL_RX_HE_PHY_MU_SIGB_COMPRESSION = BIT_ULL(32 + 0), +- IWL_RX_HE_PHY_MU_SIBG_SYM_OR_USER_NUM_MASK = 0x1e00000000ULL, +- IWL_RX_HE_PHY_MU_SIGB_MCS_MASK = 0xf000000000000ULL, +- IWL_RX_HE_PHY_MU_SIGB_DCM = BIT_ULL(32 + 21), +- IWL_RX_HE_PHY_MU_PREAMBLE_PUNC_TYPE_MASK = 0xc0000000000000ULL, +- +- /* second dword - TB data */ +- IWL_RX_HE_PHY_TB_PILOT_TYPE = BIT_ULL(32 + 0), +- IWL_RX_HE_PHY_TB_LOW_SS_MASK = 0xe00000000ULL + }; + + enum iwl_rx_he_sigb_common0 { +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:45.032297980 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:45.197295875 +0200 +@@ -1035,23 +1035,23 @@ + } + } else if (overload && he_mu && he_phy_data != HE_PHY_DATA_INVAL) { + he_mu->flags1 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIBG_SYM_OR_USER_NUM_MASK, +- he_phy_data), ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SIBG_SYM_OR_USER_NUM_MASK, ++ he_phy_data), + IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_SYMS_USERS); + he_mu->flags1 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIGB_DCM, +- he_phy_data), ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SIGB_DCM, ++ he_phy_data), + IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_DCM); + he_mu->flags1 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIGB_MCS_MASK, +- he_phy_data), ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SIGB_MCS_MASK, ++ he_phy_data), + IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_MCS); + he_mu->flags2 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_SIGB_COMPRESSION, +- he_phy_data), ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SIGB_COMPRESSION, ++ he_phy_data), + IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_COMP); + he_mu->flags2 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_MU_PREAMBLE_PUNC_TYPE_MASK, ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_PREAMBLE_PUNC_TYPE_MASK, + he_phy_data), + IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW); + +@@ -1096,18 +1096,15 @@ + rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_106; + } + +- if (he_phy_data != HE_PHY_DATA_INVAL && +- (FIELD_GET(IWL_RX_HE_PHY_INFO_TYPE_MASK, he_phy_data) == +- IWL_RX_HE_PHY_INFO_TYPE_MU_EXT_INFO || +- FIELD_GET(IWL_RX_HE_PHY_INFO_TYPE_MASK, he_phy_data) == +- IWL_RX_HE_PHY_INFO_TYPE_TB_EXT_INFO)) { ++ if (he_mu) { + /* + * Unfortunately, we have to leave the mac80211 data + * incorrect for the case that we receive an HE-MU +- * transmission and *don't* have the HE phy data (due +- * to the bits being used for TSF). This shouldn't +- * happen though as management frames where we need +- * the TSF/timers are not be transmitted in HE-MU. ++ * transmission and *don't* have the he_mu pointer, ++ * i.e. we don't have the phy data (due to the bits ++ * being used for TSF). This shouldn't happen though ++ * as management frames where we need the TSF/timers ++ * are not be transmitted in HE-MU, I think. + */ + u8 ru = FIELD_GET(IWL_RX_HE_PHY_RU_ALLOC_MASK, he_phy_data); + u8 offs = 0; +@@ -1150,11 +1147,10 @@ + IEEE80211_RADIOTAP_HE_DATA2_RU_OFFSET); + he->data2 |= + cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_KNOWN); +- if (he_phy_data & IWL_RX_HE_PHY_RU_ALLOC_SEC80) ++ if (he_phy_data & IWL_RX_HE_PHY_RU_ALLOC_SEC80) { + he->data2 |= + cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_SEC); + +- if (he_mu) { + #define CHECK_BW(bw) \ + BUILD_BUG_ON(IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_ ## bw ## MHZ != \ + RATE_MCS_CHAN_WIDTH_##bw >> RATE_MCS_CHAN_WIDTH_POS) +@@ -1162,7 +1158,7 @@ + CHECK_BW(40); + CHECK_BW(80); + CHECK_BW(160); +- he->data2 |= ++ he_mu->flags2 |= + le16_encode_bits(FIELD_GET(RATE_MCS_CHAN_WIDTH_MSK, + rate_n_flags), + IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW); diff --git a/SOURCES/0058-Revert-iwlwifi-mvm-remove-channel-2-from-HE-radiotap.patch b/SOURCES/0058-Revert-iwlwifi-mvm-remove-channel-2-from-HE-radiotap.patch new file mode 100644 index 0000000..e5ca68a --- /dev/null +++ b/SOURCES/0058-Revert-iwlwifi-mvm-remove-channel-2-from-HE-radiotap.patch @@ -0,0 +1,42 @@ +From 7f696e8cbeeb5bafe6de1534d9882cf696e8e937 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:48:00 +0200 +Subject: [PATCH 29/43] Revert "iwlwifi: mvm: remove channel 2 from HE radiotap + if not applicable" + +This reverts commit 317bc55fa82fbb7f1fe20170e50e0553af1bd69c. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:45.197295875 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:45.376293592 +0200 +@@ -905,7 +905,6 @@ + + static void iwl_mvm_decode_he_sigb(struct iwl_mvm *mvm, + struct iwl_rx_mpdu_desc *desc, +- u32 rate_n_flags, + struct ieee80211_radiotap_he_mu *he_mu) + { + u32 sigb0, sigb1; +@@ -941,8 +940,7 @@ + sigb1); + } + +- if (FIELD_GET(IWL_RX_HE_SIGB_COMMON2_CH2_CRC_OK, sigb2) && +- (rate_n_flags & RATE_MCS_CHAN_WIDTH_MSK) != RATE_MCS_CHAN_WIDTH_20) { ++ if (FIELD_GET(IWL_RX_HE_SIGB_COMMON2_CH2_CRC_OK, sigb2)) { + he_mu->flags1 |= + cpu_to_le16(IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH2_RU_KNOWN | + IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH2_CTR_26T_RU_KNOWN); +@@ -1059,7 +1057,7 @@ + he_phy_data) == + IWL_RX_HE_PHY_INFO_TYPE_MU_EXT_INFO; + if (sigb_data) +- iwl_mvm_decode_he_sigb(mvm, desc, rate_n_flags, he_mu); ++ iwl_mvm_decode_he_sigb(mvm, desc, he_mu); + } + if (he_phy_data != HE_PHY_DATA_INVAL && + (he_type == RATE_MCS_HE_TYPE_SU || diff --git a/SOURCES/0059-Revert-iwlwifi-mvm-report-of-LTF-symbols-for-extende.patch b/SOURCES/0059-Revert-iwlwifi-mvm-report-of-LTF-symbols-for-extende.patch new file mode 100644 index 0000000..3caeabd --- /dev/null +++ b/SOURCES/0059-Revert-iwlwifi-mvm-report-of-LTF-symbols-for-extende.patch @@ -0,0 +1,33 @@ +From 188d325434e417458beb25f7cd1922c7b358a96f Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:48:50 +0200 +Subject: [PATCH 30/43] Revert "iwlwifi: mvm: report # of LTF symbols for + extended range SU PPDUs" + +This reverts commit 925bc2b189ec05a2993d3870f4c9c7edaf60d088. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:45.376293592 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:45.550291373 +0200 +@@ -1236,8 +1236,7 @@ + he->data5 |= le16_encode_bits(ltf, IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE); + + switch (he_type) { +- case RATE_MCS_HE_TYPE_SU: +- case RATE_MCS_HE_TYPE_EXT_SU: { ++ case RATE_MCS_HE_TYPE_SU: { + u16 val; + + /* LTF syms correspond to streams */ +@@ -1289,6 +1288,7 @@ + val)); + } + break; ++ case RATE_MCS_HE_TYPE_EXT_SU: + case RATE_MCS_HE_TYPE_TRIG: + /* not supported */ + break; diff --git a/SOURCES/0060-Revert-iwlwifi-mvm-properly-decode-HE-GI-duration.patch b/SOURCES/0060-Revert-iwlwifi-mvm-properly-decode-HE-GI-duration.patch new file mode 100644 index 0000000..a24922e --- /dev/null +++ b/SOURCES/0060-Revert-iwlwifi-mvm-properly-decode-HE-GI-duration.patch @@ -0,0 +1,56 @@ +From 7d0e51654368bcd06c4945beee388012001bad6e Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:48:58 +0200 +Subject: [PATCH 31/43] Revert "iwlwifi: mvm: properly decode HE GI duration" + +This reverts commit 93cc712a7993194c5682978d46f859b8d288ed53. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 22 ++++++---------------- + 1 file changed, 6 insertions(+), 16 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:45.550291373 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:45.716289255 +0200 +@@ -1197,35 +1197,25 @@ + switch ((rate_n_flags & RATE_MCS_HE_GI_LTF_MSK) >> + RATE_MCS_HE_GI_LTF_POS) { + case 0: +- if (he_type == RATE_MCS_HE_TYPE_TRIG) +- rx_status->he_gi = NL80211_RATE_INFO_HE_GI_1_6; +- else +- rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8; ++ rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8; + if (he_type == RATE_MCS_HE_TYPE_MU) + ltf = IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_4X; + else + ltf = IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_1X; + break; + case 1: +- if (he_type == RATE_MCS_HE_TYPE_TRIG) +- rx_status->he_gi = NL80211_RATE_INFO_HE_GI_1_6; +- else +- rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8; ++ rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8; + ltf = IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_2X; + break; + case 2: +- if (he_type == RATE_MCS_HE_TYPE_TRIG) { +- rx_status->he_gi = NL80211_RATE_INFO_HE_GI_3_2; ++ rx_status->he_gi = NL80211_RATE_INFO_HE_GI_1_6; ++ if (he_type == RATE_MCS_HE_TYPE_TRIG) + ltf = IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_4X; +- } else { +- rx_status->he_gi = NL80211_RATE_INFO_HE_GI_1_6; ++ else + ltf = IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_2X; +- } + break; + case 3: +- if ((he_type == RATE_MCS_HE_TYPE_SU || +- he_type == RATE_MCS_HE_TYPE_EXT_SU) && +- rate_n_flags & RATE_MCS_SGI_MSK) ++ if (rate_n_flags & RATE_MCS_SGI_MSK) + rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8; + else + rx_status->he_gi = NL80211_RATE_INFO_HE_GI_3_2; diff --git a/SOURCES/0061-Revert-iwlwifi-mvm-put-LTF-symbol-size-into-HE-radio.patch b/SOURCES/0061-Revert-iwlwifi-mvm-put-LTF-symbol-size-into-HE-radio.patch new file mode 100644 index 0000000..1542189 --- /dev/null +++ b/SOURCES/0061-Revert-iwlwifi-mvm-put-LTF-symbol-size-into-HE-radio.patch @@ -0,0 +1,58 @@ +From 9e4d7a8c370f44f61540b26d5f76b916f791872d Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:49:04 +0200 +Subject: [PATCH 32/43] Revert "iwlwifi: mvm: put LTF symbol size into HE + radiotap" + +This reverts commit de8da23060843b07ad291ad3bdea173b58d86a3d. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 14 +------------- + 1 file changed, 1 insertion(+), 13 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:45.716289255 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:45.881287151 +0200 +@@ -972,7 +972,7 @@ + struct ieee80211_radiotap_he *he = NULL; + struct ieee80211_radiotap_he_mu *he_mu = NULL; + u32 he_type = 0xffffffff; +- u8 stbc, ltf; ++ u8 stbc; + + static const struct ieee80211_radiotap_he known = { + .data1 = cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_DATA_MCS_KNOWN | +@@ -1198,33 +1198,21 @@ + RATE_MCS_HE_GI_LTF_POS) { + case 0: + rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8; +- if (he_type == RATE_MCS_HE_TYPE_MU) +- ltf = IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_4X; +- else +- ltf = IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_1X; + break; + case 1: + rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8; +- ltf = IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_2X; + break; + case 2: + rx_status->he_gi = NL80211_RATE_INFO_HE_GI_1_6; +- if (he_type == RATE_MCS_HE_TYPE_TRIG) +- ltf = IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_4X; +- else +- ltf = IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_2X; + break; + case 3: + if (rate_n_flags & RATE_MCS_SGI_MSK) + rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8; + else + rx_status->he_gi = NL80211_RATE_INFO_HE_GI_3_2; +- ltf = IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_4X; + break; + } + +- he->data5 |= le16_encode_bits(ltf, IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE); +- + switch (he_type) { + case RATE_MCS_HE_TYPE_SU: { + u16 val; diff --git a/SOURCES/0062-Revert-iwlwifi-RX-API-remove-unnecessary-anonymous-s.patch b/SOURCES/0062-Revert-iwlwifi-RX-API-remove-unnecessary-anonymous-s.patch new file mode 100644 index 0000000..242c7d3 --- /dev/null +++ b/SOURCES/0062-Revert-iwlwifi-RX-API-remove-unnecessary-anonymous-s.patch @@ -0,0 +1,51 @@ +From b39f8acf83fb9483287cb6e79acb5afbd99f0db9 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:51:49 +0200 +Subject: [PATCH 33/43] Revert "iwlwifi: RX API: remove unnecessary anonymous + struct" + +This reverts commit 838f4c73a353be28222593babeeac9edca1b1be0. +--- + drivers/net/wireless/intel/iwlwifi/fw/api/rx.h | 28 ++++++++++++++------------ + 1 file changed, 15 insertions(+), 13 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h 2019-09-06 01:25:45.197295875 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h 2019-09-06 01:25:46.052284970 +0200 +@@ -594,21 +594,23 @@ + */ + u8 mac_phy_idx; + /* DW4 - carries csum data only when rpa_en == 1 */ +- /** +- * @raw_csum: raw checksum (alledgedly unreliable) +- */ +- __le16 raw_csum; +- +- union { ++ struct { + /** +- * @l3l4_flags: &enum iwl_rx_l3l4_flags ++ * @raw_csum: raw checksum (alledgedly unreliable) + */ +- __le16 l3l4_flags; ++ __le16 raw_csum; + +- /** +- * @sigb_common2: for HE sniffer, HE-SIG-B common part 2 +- */ +- __le16 sigb_common2; ++ union { ++ /** ++ * @l3l4_flags: &enum iwl_rx_l3l4_flags ++ */ ++ __le16 l3l4_flags; ++ ++ /** ++ * @sigb_common2: for HE sniffer, HE-SIG-B common part 2 ++ */ ++ __le16 sigb_common2; ++ }; + }; + /* DW5 */ + /** diff --git a/SOURCES/0063-Revert-iwlwifi-mvm-implement-extended-HE-MU-sniffer-.patch b/SOURCES/0063-Revert-iwlwifi-mvm-implement-extended-HE-MU-sniffer-.patch new file mode 100644 index 0000000..e957946 --- /dev/null +++ b/SOURCES/0063-Revert-iwlwifi-mvm-implement-extended-HE-MU-sniffer-.patch @@ -0,0 +1,370 @@ +From e01e8ffcfe71bd1400e53c94438287552991e85f Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:51:55 +0200 +Subject: [PATCH 34/43] Revert "iwlwifi: mvm: implement extended HE-MU sniffer + API" + +This reverts commit dabf9844385885e50c05a08ebc312d46017eb261. +--- + drivers/net/wireless/intel/iwlwifi/fw/api/rx.h | 117 +++++---------------- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 140 +++++-------------------- + 2 files changed, 51 insertions(+), 206 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h 2019-09-06 01:25:46.052284970 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h 2019-09-06 01:25:46.216282878 +0200 +@@ -371,33 +371,7 @@ + /* 1 bit reserved */ + IWL_RX_HE_PHY_SIGB_DCM = BIT_ULL(32 + 21), + IWL_RX_HE_PHY_PREAMBLE_PUNC_TYPE_MASK = 0xc0000000000000ULL, +- /* 4 bits reserved */ +- IWL_RX_HE_PHY_INFO_TYPE_MASK = 0xf000000000000000ULL, +- IWL_RX_HE_PHY_INFO_TYPE_SU = 0x0, +- IWL_RX_HE_PHY_INFO_TYPE_MU = 0x1, +- IWL_RX_HE_PHY_INFO_TYPE_MU_EXT_INFO = 0x2, +-}; +- +-enum iwl_rx_he_sigb_common0 { +- /* the a1/a2/... is what the PHY/firmware calls the values */ +- IWL_RX_HE_SIGB_COMMON0_CH1_RU0 = 0x000000ff, /* a1 */ +- IWL_RX_HE_SIGB_COMMON0_CH1_RU2 = 0x0000ff00, /* a2 */ +- IWL_RX_HE_SIGB_COMMON0_CH2_RU0 = 0x00ff0000, /* b1 */ +- IWL_RX_HE_SIGB_COMMON0_CH2_RU2 = 0xff000000, /* b2 */ +-}; +- +-enum iwl_rx_he_sigb_common1 { +- IWL_RX_HE_SIGB_COMMON1_CH1_RU1 = 0x000000ff, /* c1 */ +- IWL_RX_HE_SIGB_COMMON1_CH1_RU3 = 0x0000ff00, /* c2 */ +- IWL_RX_HE_SIGB_COMMON1_CH2_RU1 = 0x00ff0000, /* d1 */ +- IWL_RX_HE_SIGB_COMMON1_CH2_RU3 = 0xff000000, /* d2 */ +-}; +- +-enum iwl_rx_he_sigb_common2 { +- IWL_RX_HE_SIGB_COMMON2_CH1_CTR_RU = 0x0001, +- IWL_RX_HE_SIGB_COMMON2_CH2_CTR_RU = 0x0002, +- IWL_RX_HE_SIGB_COMMON2_CH1_CRC_OK = 0x0004, +- IWL_RX_HE_SIGB_COMMON2_CH2_CRC_OK = 0x0008, ++ /* 8 bits reserved */ + }; + + /** +@@ -405,31 +379,15 @@ + */ + struct iwl_rx_mpdu_desc_v1 { + /* DW7 - carries rss_hash only when rpa_en == 1 */ +- union { +- /** +- * @rss_hash: RSS hash value +- */ +- __le32 rss_hash; +- +- /** +- * @sigb_common0: for HE sniffer, HE-SIG-B common part 0 +- */ +- __le32 sigb_common0; +- }; +- ++ /** ++ * @rss_hash: RSS hash value ++ */ ++ __le32 rss_hash; + /* DW8 - carries filter_match only when rpa_en == 1 */ +- union { +- /** +- * @filter_match: filter match value +- */ +- __le32 filter_match; +- +- /** +- * @sigb_common1: for HE sniffer, HE-SIG-B common part 1 +- */ +- __le32 sigb_common1; +- }; +- ++ /** ++ * @filter_match: filter match value ++ */ ++ __le32 filter_match; + /* DW9 */ + /** + * @rate_n_flags: RX rate/flags encoding +@@ -479,30 +437,15 @@ + */ + struct iwl_rx_mpdu_desc_v3 { + /* DW7 - carries filter_match only when rpa_en == 1 */ +- union { +- /** +- * @filter_match: filter match value +- */ +- __le32 filter_match; +- +- /** +- * @sigb_common0: for HE sniffer, HE-SIG-B common part 0 +- */ +- __le32 sigb_common0; +- }; +- ++ /** ++ * @filter_match: filter match value ++ */ ++ __le32 filter_match; + /* DW8 - carries rss_hash only when rpa_en == 1 */ +- union { +- /** +- * @rss_hash: RSS hash value +- */ +- __le32 rss_hash; +- +- /** +- * @sigb_common1: for HE sniffer, HE-SIG-B common part 1 +- */ +- __le32 sigb_common1; +- }; ++ /** ++ * @rss_hash: RSS hash value ++ */ ++ __le32 rss_hash; + /* DW9 */ + /** + * @partial_hash: 31:0 ip/tcp header hash +@@ -594,24 +537,14 @@ + */ + u8 mac_phy_idx; + /* DW4 - carries csum data only when rpa_en == 1 */ +- struct { +- /** +- * @raw_csum: raw checksum (alledgedly unreliable) +- */ +- __le16 raw_csum; +- +- union { +- /** +- * @l3l4_flags: &enum iwl_rx_l3l4_flags +- */ +- __le16 l3l4_flags; +- +- /** +- * @sigb_common2: for HE sniffer, HE-SIG-B common part 2 +- */ +- __le16 sigb_common2; +- }; +- }; ++ /** ++ * @raw_csum: raw checksum (alledgedly unreliable) ++ */ ++ __le16 raw_csum; ++ /** ++ * @l3l4_flags: &enum iwl_rx_l3l4_flags ++ */ ++ __le16 l3l4_flags; + /* DW5 */ + /** + * @status: &enum iwl_rx_mpdu_status +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:45.881287151 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:46.216282878 +0200 +@@ -903,64 +903,6 @@ + ether_addr_copy(addr, mac_addr); + } + +-static void iwl_mvm_decode_he_sigb(struct iwl_mvm *mvm, +- struct iwl_rx_mpdu_desc *desc, +- struct ieee80211_radiotap_he_mu *he_mu) +-{ +- u32 sigb0, sigb1; +- u16 sigb2; +- +- if (mvm->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) { +- sigb0 = le32_to_cpu(desc->v3.sigb_common0); +- sigb1 = le32_to_cpu(desc->v3.sigb_common1); +- } else { +- sigb0 = le32_to_cpu(desc->v1.sigb_common0); +- sigb1 = le32_to_cpu(desc->v1.sigb_common1); +- } +- +- sigb2 = le16_to_cpu(desc->sigb_common2); +- +- if (FIELD_GET(IWL_RX_HE_SIGB_COMMON2_CH1_CRC_OK, sigb2)) { +- he_mu->flags1 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH1_RU_KNOWN | +- IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH1_CTR_26T_RU_KNOWN); +- +- he_mu->flags1 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_SIGB_COMMON2_CH1_CTR_RU, +- sigb2), +- IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH1_CTR_26T_RU); +- +- he_mu->ru_ch1[0] = FIELD_GET(IWL_RX_HE_SIGB_COMMON0_CH1_RU0, +- sigb0); +- he_mu->ru_ch1[1] = FIELD_GET(IWL_RX_HE_SIGB_COMMON1_CH1_RU1, +- sigb1); +- he_mu->ru_ch1[2] = FIELD_GET(IWL_RX_HE_SIGB_COMMON0_CH1_RU2, +- sigb0); +- he_mu->ru_ch1[3] = FIELD_GET(IWL_RX_HE_SIGB_COMMON1_CH1_RU3, +- sigb1); +- } +- +- if (FIELD_GET(IWL_RX_HE_SIGB_COMMON2_CH2_CRC_OK, sigb2)) { +- he_mu->flags1 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH2_RU_KNOWN | +- IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH2_CTR_26T_RU_KNOWN); +- +- he_mu->flags2 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_SIGB_COMMON2_CH2_CTR_RU, +- sigb2), +- IEEE80211_RADIOTAP_HE_MU_FLAGS2_CH2_CTR_26T_RU); +- +- he_mu->ru_ch2[0] = FIELD_GET(IWL_RX_HE_SIGB_COMMON0_CH2_RU0, +- sigb0); +- he_mu->ru_ch2[1] = FIELD_GET(IWL_RX_HE_SIGB_COMMON1_CH2_RU1, +- sigb1); +- he_mu->ru_ch2[2] = FIELD_GET(IWL_RX_HE_SIGB_COMMON0_CH2_RU2, +- sigb0); +- he_mu->ru_ch2[3] = FIELD_GET(IWL_RX_HE_SIGB_COMMON1_CH2_RU3, +- sigb1); +- } +-} +- + static void iwl_mvm_rx_he(struct iwl_mvm *mvm, struct sk_buff *skb, + struct iwl_rx_mpdu_desc *desc, + u32 rate_n_flags, u16 phy_info, int queue) +@@ -987,12 +929,10 @@ + IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_DCM_KNOWN | + IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_SYMS_USERS_KNOWN | + IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_COMP_KNOWN), +- .flags2 = cpu_to_le16(IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW_KNOWN | +- IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_KNOWN), ++ .flags2 = cpu_to_le16(IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW_KNOWN), + }; + unsigned int radiotap_len = 0; + bool overload = phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD; +- bool sigb_data = false; + + he = skb_put_data(skb, &known, sizeof(known)); + radiotap_len += sizeof(known); +@@ -1050,26 +990,17 @@ + IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_COMP); + he_mu->flags2 |= + le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_PREAMBLE_PUNC_TYPE_MASK, +- he_phy_data), ++ he_phy_data), + IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW); ++ } + +- sigb_data = FIELD_GET(IWL_RX_HE_PHY_INFO_TYPE_MASK, +- he_phy_data) == +- IWL_RX_HE_PHY_INFO_TYPE_MU_EXT_INFO; +- if (sigb_data) +- iwl_mvm_decode_he_sigb(mvm, desc, he_mu); +- } +- if (he_phy_data != HE_PHY_DATA_INVAL && +- (he_type == RATE_MCS_HE_TYPE_SU || +- he_type == RATE_MCS_HE_TYPE_MU)) { +- u8 bss_color = FIELD_GET(IWL_RX_HE_PHY_BSS_COLOR_MASK, +- he_phy_data); +- +- if (bss_color) { +- he->data1 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_BSS_COLOR_KNOWN); +- he->data3 |= cpu_to_le16(bss_color); +- } ++ if (he_phy_data != HE_PHY_DATA_INVAL) { ++ he->data1 |= ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_BSS_COLOR_KNOWN); ++ he->data3 |= ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_BSS_COLOR_MASK, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_DATA3_BSS_COLOR); + } + + /* update aggregation data for monitor sake on default queue */ +@@ -1093,7 +1024,6 @@ + rx_status->bw = RATE_INFO_BW_HE_RU; + rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_106; + } +- + if (he_mu) { + /* + * Unfortunately, we have to leave the mac80211 data +@@ -1109,9 +1039,6 @@ + + rx_status->bw = RATE_INFO_BW_HE_RU; + +- he->data1 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_BW_RU_ALLOC_KNOWN); +- + switch (ru) { + case 0 ... 36: + rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_26; +@@ -1145,24 +1072,10 @@ + IEEE80211_RADIOTAP_HE_DATA2_RU_OFFSET); + he->data2 |= + cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_KNOWN); +- if (he_phy_data & IWL_RX_HE_PHY_RU_ALLOC_SEC80) { ++ if (he_phy_data & IWL_RX_HE_PHY_RU_ALLOC_SEC80) + he->data2 |= + cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_SEC); +- +-#define CHECK_BW(bw) \ +- BUILD_BUG_ON(IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_ ## bw ## MHZ != \ +- RATE_MCS_CHAN_WIDTH_##bw >> RATE_MCS_CHAN_WIDTH_POS) +- CHECK_BW(20); +- CHECK_BW(40); +- CHECK_BW(80); +- CHECK_BW(160); +- he_mu->flags2 |= +- le16_encode_bits(FIELD_GET(RATE_MCS_CHAN_WIDTH_MSK, +- rate_n_flags), +- IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW); +- } +- } else if (he_type == RATE_MCS_HE_TYPE_SU || +- he_type == RATE_MCS_HE_TYPE_EXT_SU) { ++ } else { + he->data1 |= + cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_BW_RU_ALLOC_KNOWN); + } +@@ -1330,21 +1243,6 @@ + + rx_status = IEEE80211_SKB_RXCB(skb); + +- /* This may be overridden by iwl_mvm_rx_he() to HE_RU */ +- switch (rate_n_flags & RATE_MCS_CHAN_WIDTH_MSK) { +- case RATE_MCS_CHAN_WIDTH_20: +- break; +- case RATE_MCS_CHAN_WIDTH_40: +- rx_status->bw = RATE_INFO_BW_40; +- break; +- case RATE_MCS_CHAN_WIDTH_80: +- rx_status->bw = RATE_INFO_BW_80; +- break; +- case RATE_MCS_CHAN_WIDTH_160: +- rx_status->bw = RATE_INFO_BW_160; +- break; +- } +- + if (rate_n_flags & RATE_MCS_HE_MSK) + iwl_mvm_rx_he(mvm, skb, desc, rate_n_flags, phy_info, queue); + +@@ -1522,6 +1420,20 @@ + } + } + ++ switch (rate_n_flags & RATE_MCS_CHAN_WIDTH_MSK) { ++ case RATE_MCS_CHAN_WIDTH_20: ++ break; ++ case RATE_MCS_CHAN_WIDTH_40: ++ rx_status->bw = RATE_INFO_BW_40; ++ break; ++ case RATE_MCS_CHAN_WIDTH_80: ++ rx_status->bw = RATE_INFO_BW_80; ++ break; ++ case RATE_MCS_CHAN_WIDTH_160: ++ rx_status->bw = RATE_INFO_BW_160; ++ break; ++ } ++ + if (!(rate_n_flags & RATE_MCS_CCK_MSK) && + rate_n_flags & RATE_MCS_SGI_MSK) + rx_status->enc_flags |= RX_ENC_FLAG_SHORT_GI; diff --git a/SOURCES/0064-Revert-iwlwifi-mvm-move-he-RX-handling-to-a-separate.patch b/SOURCES/0064-Revert-iwlwifi-mvm-move-he-RX-handling-to-a-separate.patch new file mode 100644 index 0000000..0e2405b --- /dev/null +++ b/SOURCES/0064-Revert-iwlwifi-mvm-move-he-RX-handling-to-a-separate.patch @@ -0,0 +1,24 @@ +From 14f32cc48eb034f122b8bd7d107c839279e97fae Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:52:17 +0200 +Subject: [PATCH 35/43] Revert "iwlwifi: mvm: move he RX handling to a separate + function" + +This reverts commit 4799ea53a57854b0b35f73703d9bfabf15bfd4f7. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:46.216282878 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:46.393280620 +0200 +@@ -1075,7 +1075,7 @@ + if (he_phy_data & IWL_RX_HE_PHY_RU_ALLOC_SEC80) + he->data2 |= + cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_SEC); +- } else { ++ } else if (he) { + he->data1 |= + cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_BW_RU_ALLOC_KNOWN); + } diff --git a/SOURCES/0065-Revert-iwlwifi-iwlmvm-fix-typo-when-checking-for-TX-.patch b/SOURCES/0065-Revert-iwlwifi-iwlmvm-fix-typo-when-checking-for-TX-.patch new file mode 100644 index 0000000..25019a7 --- /dev/null +++ b/SOURCES/0065-Revert-iwlwifi-iwlmvm-fix-typo-when-checking-for-TX-.patch @@ -0,0 +1,24 @@ +From eb5bb4763d7653ed5def1b827c8777d2efa621c6 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:53:16 +0200 +Subject: [PATCH 36/43] Revert "iwlwifi: iwlmvm: fix typo when checking for TX + Beamforming" + +This reverts commit caf3216f6554b4699f0e84852ba4b1f47769a2de. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:46.393280620 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:46.568278388 +0200 +@@ -1104,7 +1104,7 @@ + + he->data1 |= cpu_to_le16(he_type >> RATE_MCS_HE_TYPE_POS); + +- if (rate_n_flags & RATE_MCS_BF_MSK) ++ if (rate_n_flags & RATE_MCS_BF_POS) + he->data5 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA5_TXBF); + + switch ((rate_n_flags & RATE_MCS_HE_GI_LTF_MSK) >> diff --git a/SOURCES/0066-Revert-iwlwifi-mvm-move-he-RX-handling-to-a-separate.patch b/SOURCES/0066-Revert-iwlwifi-mvm-move-he-RX-handling-to-a-separate.patch new file mode 100644 index 0000000..f123bec --- /dev/null +++ b/SOURCES/0066-Revert-iwlwifi-mvm-move-he-RX-handling-to-a-separate.patch @@ -0,0 +1,653 @@ +From 5e0d3511c1ef2ec98f93491b5f6da2b16051c8aa Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:53:20 +0200 +Subject: [PATCH 37/43] Revert "iwlwifi: mvm: move he RX handling to a separate + function" + +This reverts commit c630b477caf78998cdcd5766956817d8721c23c9. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 582 +++++++++++++------------- + 1 file changed, 296 insertions(+), 286 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:46.568278388 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:46.739276207 +0200 +@@ -903,289 +903,6 @@ + ether_addr_copy(addr, mac_addr); + } + +-static void iwl_mvm_rx_he(struct iwl_mvm *mvm, struct sk_buff *skb, +- struct iwl_rx_mpdu_desc *desc, +- u32 rate_n_flags, u16 phy_info, int queue) +-{ +- struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb); +- /* this is invalid e.g. because puncture type doesn't allow 0b11 */ +-#define HE_PHY_DATA_INVAL ((u64)-1) +- u64 he_phy_data = HE_PHY_DATA_INVAL; +- struct ieee80211_radiotap_he *he = NULL; +- struct ieee80211_radiotap_he_mu *he_mu = NULL; +- u32 he_type = 0xffffffff; +- u8 stbc; +- +- static const struct ieee80211_radiotap_he known = { +- .data1 = cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_DATA_MCS_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA1_DATA_DCM_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA1_STBC_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA1_CODING_KNOWN), +- .data2 = cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_GI_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA2_TXBF_KNOWN), +- }; +- static const struct ieee80211_radiotap_he_mu mu_known = { +- .flags1 = cpu_to_le16(IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_MCS_KNOWN | +- IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_DCM_KNOWN | +- IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_SYMS_USERS_KNOWN | +- IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_COMP_KNOWN), +- .flags2 = cpu_to_le16(IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW_KNOWN), +- }; +- unsigned int radiotap_len = 0; +- bool overload = phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD; +- +- he = skb_put_data(skb, &known, sizeof(known)); +- radiotap_len += sizeof(known); +- rx_status->flag |= RX_FLAG_RADIOTAP_HE; +- +- he_type = rate_n_flags & RATE_MCS_HE_TYPE_MSK; +- +- if (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD) { +- if (mvm->trans->cfg->device_family >= +- IWL_DEVICE_FAMILY_22560) +- he_phy_data = le64_to_cpu(desc->v3.he_phy_data); +- else +- he_phy_data = le64_to_cpu(desc->v1.he_phy_data); +- +- if (he_type == RATE_MCS_HE_TYPE_MU) { +- he_mu = skb_put_data(skb, &mu_known, +- sizeof(mu_known)); +- radiotap_len += sizeof(mu_known); +- rx_status->flag |= RX_FLAG_RADIOTAP_HE_MU; +- } +- } +- +- /* temporarily hide the radiotap data */ +- __skb_pull(skb, radiotap_len); +- +- if (overload && he_type == RATE_MCS_HE_TYPE_SU) { +- he->data1 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_UL_DL_KNOWN); +- if (FIELD_GET(IWL_RX_HE_PHY_UPLINK, he_phy_data)) +- he->data3 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA3_UL_DL); +- +- if (!queue && !(phy_info & IWL_RX_MPDU_PHY_AMPDU)) { +- rx_status->flag |= RX_FLAG_AMPDU_DETAILS; +- rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN; +- if (FIELD_GET(IWL_RX_HE_PHY_DELIM_EOF, he_phy_data)) +- rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT; +- } +- } else if (overload && he_mu && he_phy_data != HE_PHY_DATA_INVAL) { +- he_mu->flags1 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SIBG_SYM_OR_USER_NUM_MASK, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_SYMS_USERS); +- he_mu->flags1 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SIGB_DCM, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_DCM); +- he_mu->flags1 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SIGB_MCS_MASK, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_MCS); +- he_mu->flags2 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SIGB_COMPRESSION, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_COMP); +- he_mu->flags2 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_PREAMBLE_PUNC_TYPE_MASK, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW); +- } +- +- if (he_phy_data != HE_PHY_DATA_INVAL) { +- he->data1 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_BSS_COLOR_KNOWN); +- he->data3 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_BSS_COLOR_MASK, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_DATA3_BSS_COLOR); +- } +- +- /* update aggregation data for monitor sake on default queue */ +- if (!queue && (phy_info & IWL_RX_MPDU_PHY_AMPDU)) { +- bool toggle_bit = phy_info & IWL_RX_MPDU_PHY_AMPDU_TOGGLE; +- +- /* toggle is switched whenever new aggregation starts */ +- if (toggle_bit != mvm->ampdu_toggle && +- he_phy_data != HE_PHY_DATA_INVAL && +- (he_type == RATE_MCS_HE_TYPE_MU || +- he_type == RATE_MCS_HE_TYPE_SU)) { +- rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN; +- if (FIELD_GET(IWL_RX_HE_PHY_DELIM_EOF, +- he_phy_data)) +- rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT; +- } +- } +- +- if (he_type == RATE_MCS_HE_TYPE_EXT_SU && +- rate_n_flags & RATE_MCS_HE_106T_MSK) { +- rx_status->bw = RATE_INFO_BW_HE_RU; +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_106; +- } +- if (he_mu) { +- /* +- * Unfortunately, we have to leave the mac80211 data +- * incorrect for the case that we receive an HE-MU +- * transmission and *don't* have the he_mu pointer, +- * i.e. we don't have the phy data (due to the bits +- * being used for TSF). This shouldn't happen though +- * as management frames where we need the TSF/timers +- * are not be transmitted in HE-MU, I think. +- */ +- u8 ru = FIELD_GET(IWL_RX_HE_PHY_RU_ALLOC_MASK, he_phy_data); +- u8 offs = 0; +- +- rx_status->bw = RATE_INFO_BW_HE_RU; +- +- switch (ru) { +- case 0 ... 36: +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_26; +- offs = ru; +- break; +- case 37 ... 52: +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_52; +- offs = ru - 37; +- break; +- case 53 ... 60: +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_106; +- offs = ru - 53; +- break; +- case 61 ... 64: +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_242; +- offs = ru - 61; +- break; +- case 65 ... 66: +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_484; +- offs = ru - 65; +- break; +- case 67: +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_996; +- break; +- case 68: +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_2x996; +- break; +- } +- he->data2 |= +- le16_encode_bits(offs, +- IEEE80211_RADIOTAP_HE_DATA2_RU_OFFSET); +- he->data2 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_KNOWN); +- if (he_phy_data & IWL_RX_HE_PHY_RU_ALLOC_SEC80) +- he->data2 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_SEC); +- } else if (he) { +- he->data1 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_BW_RU_ALLOC_KNOWN); +- } +- +- stbc = (rate_n_flags & RATE_MCS_STBC_MSK) >> RATE_MCS_STBC_POS; +- rx_status->nss = +- ((rate_n_flags & RATE_VHT_MCS_NSS_MSK) >> +- RATE_VHT_MCS_NSS_POS) + 1; +- rx_status->rate_idx = rate_n_flags & RATE_VHT_MCS_RATE_CODE_MSK; +- rx_status->encoding = RX_ENC_HE; +- rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT; +- if (rate_n_flags & RATE_MCS_BF_MSK) +- rx_status->enc_flags |= RX_ENC_FLAG_BF; +- +- rx_status->he_dcm = +- !!(rate_n_flags & RATE_HE_DUAL_CARRIER_MODE_MSK); +- +-#define CHECK_TYPE(F) \ +- BUILD_BUG_ON(IEEE80211_RADIOTAP_HE_DATA1_FORMAT_ ## F != \ +- (RATE_MCS_HE_TYPE_ ## F >> RATE_MCS_HE_TYPE_POS)) +- +- CHECK_TYPE(SU); +- CHECK_TYPE(EXT_SU); +- CHECK_TYPE(MU); +- CHECK_TYPE(TRIG); +- +- he->data1 |= cpu_to_le16(he_type >> RATE_MCS_HE_TYPE_POS); +- +- if (rate_n_flags & RATE_MCS_BF_POS) +- he->data5 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA5_TXBF); +- +- switch ((rate_n_flags & RATE_MCS_HE_GI_LTF_MSK) >> +- RATE_MCS_HE_GI_LTF_POS) { +- case 0: +- rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8; +- break; +- case 1: +- rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8; +- break; +- case 2: +- rx_status->he_gi = NL80211_RATE_INFO_HE_GI_1_6; +- break; +- case 3: +- if (rate_n_flags & RATE_MCS_SGI_MSK) +- rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8; +- else +- rx_status->he_gi = NL80211_RATE_INFO_HE_GI_3_2; +- break; +- } +- +- switch (he_type) { +- case RATE_MCS_HE_TYPE_SU: { +- u16 val; +- +- /* LTF syms correspond to streams */ +- he->data2 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_NUM_LTF_SYMS_KNOWN); +- switch (rx_status->nss) { +- case 1: +- val = 0; +- break; +- case 2: +- val = 1; +- break; +- case 3: +- case 4: +- val = 2; +- break; +- case 5: +- case 6: +- val = 3; +- break; +- case 7: +- case 8: +- val = 4; +- break; +- default: +- WARN_ONCE(1, "invalid nss: %d\n", +- rx_status->nss); +- val = 0; +- } +- he->data5 |= +- le16_encode_bits(val, +- IEEE80211_RADIOTAP_HE_DATA5_NUM_LTF_SYMS); +- } +- break; +- case RATE_MCS_HE_TYPE_MU: { +- u16 val; +- +- if (he_phy_data == HE_PHY_DATA_INVAL) +- break; +- +- val = FIELD_GET(IWL_RX_HE_PHY_HE_LTF_NUM_MASK, +- he_phy_data); +- +- he->data2 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_NUM_LTF_SYMS_KNOWN); +- he->data5 |= +- cpu_to_le16(FIELD_PREP( +- IEEE80211_RADIOTAP_HE_DATA5_NUM_LTF_SYMS, +- val)); +- } +- break; +- case RATE_MCS_HE_TYPE_EXT_SU: +- case RATE_MCS_HE_TYPE_TRIG: +- /* not supported */ +- break; +- } +-} +- + void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi, + struct iwl_rx_cmd_buffer *rxb, int queue) + { +@@ -1199,6 +916,12 @@ + struct ieee80211_sta *sta = NULL; + struct sk_buff *skb; + u8 crypt_len = 0, channel, energy_a, energy_b; ++ struct ieee80211_radiotap_he *he = NULL; ++ struct ieee80211_radiotap_he_mu *he_mu = NULL; ++ u32 he_type = 0xffffffff; ++ /* this is invalid e.g. because puncture type doesn't allow 0b11 */ ++#define HE_PHY_DATA_INVAL ((u64)-1) ++ u64 he_phy_data = HE_PHY_DATA_INVAL; + size_t desc_size; + bool csi = false; + +@@ -1243,8 +966,48 @@ + + rx_status = IEEE80211_SKB_RXCB(skb); + +- if (rate_n_flags & RATE_MCS_HE_MSK) +- iwl_mvm_rx_he(mvm, skb, desc, rate_n_flags, phy_info, queue); ++ if (rate_n_flags & RATE_MCS_HE_MSK) { ++ static const struct ieee80211_radiotap_he known = { ++ .data1 = cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_DATA_MCS_KNOWN | ++ IEEE80211_RADIOTAP_HE_DATA1_DATA_DCM_KNOWN | ++ IEEE80211_RADIOTAP_HE_DATA1_STBC_KNOWN | ++ IEEE80211_RADIOTAP_HE_DATA1_CODING_KNOWN), ++ .data2 = cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_GI_KNOWN | ++ IEEE80211_RADIOTAP_HE_DATA2_TXBF_KNOWN), ++ }; ++ static const struct ieee80211_radiotap_he_mu mu_known = { ++ .flags1 = cpu_to_le16(IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_MCS_KNOWN | ++ IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_DCM_KNOWN | ++ IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_SYMS_USERS_KNOWN | ++ IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_COMP_KNOWN), ++ .flags2 = cpu_to_le16(IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW_KNOWN), ++ }; ++ unsigned int radiotap_len = 0; ++ ++ he = skb_put_data(skb, &known, sizeof(known)); ++ radiotap_len += sizeof(known); ++ rx_status->flag |= RX_FLAG_RADIOTAP_HE; ++ ++ he_type = rate_n_flags & RATE_MCS_HE_TYPE_MSK; ++ ++ if (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD) { ++ if (mvm->trans->cfg->device_family >= ++ IWL_DEVICE_FAMILY_22560) ++ he_phy_data = le64_to_cpu(desc->v3.he_phy_data); ++ else ++ he_phy_data = le64_to_cpu(desc->v1.he_phy_data); ++ ++ if (he_type == RATE_MCS_HE_TYPE_MU) { ++ he_mu = skb_put_data(skb, &mu_known, ++ sizeof(mu_known)); ++ radiotap_len += sizeof(mu_known); ++ rx_status->flag |= RX_FLAG_RADIOTAP_HE_MU; ++ } ++ } ++ ++ /* temporarily hide the radiotap data */ ++ __skb_pull(skb, radiotap_len); ++ } + + rx_status = IEEE80211_SKB_RXCB(skb); + +@@ -1281,6 +1044,65 @@ + rx_status->mactime = tsf_on_air_rise; + /* TSF as indicated by the firmware is at INA time */ + rx_status->flag |= RX_FLAG_MACTIME_PLCP_START; ++ } else if (he_type == RATE_MCS_HE_TYPE_SU) { ++ u64 he_phy_data; ++ ++ if (mvm->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) ++ he_phy_data = le64_to_cpu(desc->v3.he_phy_data); ++ else ++ he_phy_data = le64_to_cpu(desc->v1.he_phy_data); ++ ++ he->data1 |= ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_UL_DL_KNOWN); ++ if (FIELD_GET(IWL_RX_HE_PHY_UPLINK, ++ he_phy_data)) ++ he->data3 |= ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA3_UL_DL); ++ ++ if (!queue && !(phy_info & IWL_RX_MPDU_PHY_AMPDU)) { ++ rx_status->ampdu_reference = mvm->ampdu_ref; ++ mvm->ampdu_ref++; ++ ++ rx_status->flag |= RX_FLAG_AMPDU_DETAILS; ++ rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN; ++ if (FIELD_GET(IWL_RX_HE_PHY_DELIM_EOF, ++ he_phy_data)) ++ rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT; ++ } ++ } else if (he_mu && he_phy_data != HE_PHY_DATA_INVAL) { ++ he_mu->flags1 |= ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SIBG_SYM_OR_USER_NUM_MASK, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_SYMS_USERS); ++ he_mu->flags1 |= ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SIGB_DCM, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_DCM); ++ he_mu->flags1 |= ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SIGB_MCS_MASK, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_MCS); ++ he_mu->flags2 |= ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SIGB_COMPRESSION, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_COMP); ++ he_mu->flags2 |= ++ le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_PREAMBLE_PUNC_TYPE_MASK, ++ he_phy_data), ++ IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW); ++ } ++ ++ if (he_phy_data != HE_PHY_DATA_INVAL && ++ (he_type == RATE_MCS_HE_TYPE_SU || ++ he_type == RATE_MCS_HE_TYPE_MU)) { ++ u8 bss_color = FIELD_GET(IWL_RX_HE_PHY_BSS_COLOR_MASK, ++ he_phy_data); ++ ++ if (bss_color) { ++ he->data1 |= ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_BSS_COLOR_KNOWN); ++ he->data3 |= cpu_to_le16(bss_color); ++ } + } + + rx_status->device_timestamp = gp2_on_air_rise; +@@ -1312,6 +1134,16 @@ + if (mvm->ampdu_ref == 0) + mvm->ampdu_ref++; + mvm->ampdu_toggle = toggle_bit; ++ ++ if (he_phy_data != HE_PHY_DATA_INVAL && ++ (he_type == RATE_MCS_HE_TYPE_MU || ++ he_type == RATE_MCS_HE_TYPE_SU)) { ++ rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN; ++ if (FIELD_GET(IWL_RX_HE_PHY_DELIM_EOF, ++ he_phy_data)) ++ rx_status->flag |= ++ RX_FLAG_AMPDU_EOF_BIT; ++ } + } + rx_status->ampdu_reference = mvm->ampdu_ref; + } +@@ -1434,6 +1266,70 @@ + break; + } + ++ if (he_type == RATE_MCS_HE_TYPE_EXT_SU && ++ rate_n_flags & RATE_MCS_HE_106T_MSK) { ++ rx_status->bw = RATE_INFO_BW_HE_RU; ++ rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_106; ++ } ++ ++ if (rate_n_flags & RATE_MCS_HE_MSK && ++ phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD && ++ he_type == RATE_MCS_HE_TYPE_MU) { ++ /* ++ * Unfortunately, we have to leave the mac80211 data ++ * incorrect for the case that we receive an HE-MU ++ * transmission and *don't* have the he_mu pointer, ++ * i.e. we don't have the phy data (due to the bits ++ * being used for TSF). This shouldn't happen though ++ * as management frames where we need the TSF/timers ++ * are not be transmitted in HE-MU, I think. ++ */ ++ u8 ru = FIELD_GET(IWL_RX_HE_PHY_RU_ALLOC_MASK, he_phy_data); ++ u8 offs = 0; ++ ++ rx_status->bw = RATE_INFO_BW_HE_RU; ++ ++ switch (ru) { ++ case 0 ... 36: ++ rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_26; ++ offs = ru; ++ break; ++ case 37 ... 52: ++ rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_52; ++ offs = ru - 37; ++ break; ++ case 53 ... 60: ++ rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_106; ++ offs = ru - 53; ++ break; ++ case 61 ... 64: ++ rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_242; ++ offs = ru - 61; ++ break; ++ case 65 ... 66: ++ rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_484; ++ offs = ru - 65; ++ break; ++ case 67: ++ rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_996; ++ break; ++ case 68: ++ rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_2x996; ++ break; ++ } ++ he->data2 |= ++ le16_encode_bits(offs, ++ IEEE80211_RADIOTAP_HE_DATA2_RU_OFFSET); ++ he->data2 |= ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_KNOWN); ++ if (he_phy_data & IWL_RX_HE_PHY_RU_ALLOC_SEC80) ++ he->data2 |= ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_SEC); ++ } else if (he) { ++ he->data1 |= ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_BW_RU_ALLOC_KNOWN); ++ } ++ + if (!(rate_n_flags & RATE_MCS_CCK_MSK) && + rate_n_flags & RATE_MCS_SGI_MSK) + rx_status->enc_flags |= RX_ENC_FLAG_SHORT_GI; +@@ -1458,7 +1354,120 @@ + rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT; + if (rate_n_flags & RATE_MCS_BF_MSK) + rx_status->enc_flags |= RX_ENC_FLAG_BF; +- } else if (!(rate_n_flags & RATE_MCS_HE_MSK)) { ++ } else if (he) { ++ u8 stbc = (rate_n_flags & RATE_MCS_STBC_MSK) >> ++ RATE_MCS_STBC_POS; ++ rx_status->nss = ++ ((rate_n_flags & RATE_VHT_MCS_NSS_MSK) >> ++ RATE_VHT_MCS_NSS_POS) + 1; ++ rx_status->rate_idx = rate_n_flags & RATE_VHT_MCS_RATE_CODE_MSK; ++ rx_status->encoding = RX_ENC_HE; ++ rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT; ++ if (rate_n_flags & RATE_MCS_BF_MSK) ++ rx_status->enc_flags |= RX_ENC_FLAG_BF; ++ ++ rx_status->he_dcm = ++ !!(rate_n_flags & RATE_HE_DUAL_CARRIER_MODE_MSK); ++ ++#define CHECK_TYPE(F) \ ++ BUILD_BUG_ON(IEEE80211_RADIOTAP_HE_DATA1_FORMAT_ ## F != \ ++ (RATE_MCS_HE_TYPE_ ## F >> RATE_MCS_HE_TYPE_POS)) ++ ++ CHECK_TYPE(SU); ++ CHECK_TYPE(EXT_SU); ++ CHECK_TYPE(MU); ++ CHECK_TYPE(TRIG); ++ ++ he->data1 |= cpu_to_le16(he_type >> RATE_MCS_HE_TYPE_POS); ++ ++ if (rate_n_flags & RATE_MCS_BF_POS) ++ he->data5 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA5_TXBF); ++ ++ switch ((rate_n_flags & RATE_MCS_HE_GI_LTF_MSK) >> ++ RATE_MCS_HE_GI_LTF_POS) { ++ case 0: ++ rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8; ++ break; ++ case 1: ++ rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8; ++ break; ++ case 2: ++ rx_status->he_gi = NL80211_RATE_INFO_HE_GI_1_6; ++ break; ++ case 3: ++ if (rate_n_flags & RATE_MCS_SGI_MSK) ++ rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8; ++ else ++ rx_status->he_gi = NL80211_RATE_INFO_HE_GI_3_2; ++ break; ++ } ++ ++ switch (he_type) { ++ case RATE_MCS_HE_TYPE_SU: { ++ u16 val; ++ ++ /* LTF syms correspond to streams */ ++ he->data2 |= ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_NUM_LTF_SYMS_KNOWN); ++ switch (rx_status->nss) { ++ case 1: ++ val = 0; ++ break; ++ case 2: ++ val = 1; ++ break; ++ case 3: ++ case 4: ++ val = 2; ++ break; ++ case 5: ++ case 6: ++ val = 3; ++ break; ++ case 7: ++ case 8: ++ val = 4; ++ break; ++ default: ++ WARN_ONCE(1, "invalid nss: %d\n", ++ rx_status->nss); ++ val = 0; ++ } ++ he->data5 |= ++ le16_encode_bits(val, ++ IEEE80211_RADIOTAP_HE_DATA5_NUM_LTF_SYMS); ++ } ++ break; ++ case RATE_MCS_HE_TYPE_MU: { ++ u16 val; ++ u64 he_phy_data; ++ ++ if (mvm->trans->cfg->device_family >= ++ IWL_DEVICE_FAMILY_22560) ++ he_phy_data = le64_to_cpu(desc->v3.he_phy_data); ++ else ++ he_phy_data = le64_to_cpu(desc->v1.he_phy_data); ++ ++ if (he_phy_data == HE_PHY_DATA_INVAL) ++ break; ++ ++ val = FIELD_GET(IWL_RX_HE_PHY_HE_LTF_NUM_MASK, ++ he_phy_data); ++ ++ he->data2 |= ++ cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_NUM_LTF_SYMS_KNOWN); ++ he->data5 |= ++ cpu_to_le16(FIELD_PREP( ++ IEEE80211_RADIOTAP_HE_DATA5_NUM_LTF_SYMS, ++ val)); ++ } ++ break; ++ case RATE_MCS_HE_TYPE_EXT_SU: ++ case RATE_MCS_HE_TYPE_TRIG: ++ /* not supported yet */ ++ break; ++ } ++ } else { + int rate = iwl_mvm_legacy_rate_to_mac80211_idx(rate_n_flags, + rx_status->band); + +@@ -1469,6 +1478,7 @@ + goto out; + } + rx_status->rate_idx = rate; ++ + } + + /* management stuff on default queue */ diff --git a/SOURCES/0067-Revert-iwlwifi-mvm-add-support-for-RX_AMPDU_EOF-bit-.patch b/SOURCES/0067-Revert-iwlwifi-mvm-add-support-for-RX_AMPDU_EOF-bit-.patch new file mode 100644 index 0000000..55c7998 --- /dev/null +++ b/SOURCES/0067-Revert-iwlwifi-mvm-add-support-for-RX_AMPDU_EOF-bit-.patch @@ -0,0 +1,25 @@ +From 1ddc8e8538b0b2c4b48bef0628f723337f8c6c35 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:53:35 +0200 +Subject: [PATCH 38/43] Revert "iwlwifi: mvm: add support for RX_AMPDU_EOF bit + for HE SU" + +This reverts commit 621f3f57050a71b05411f3665ef6b105a25af672. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:46.739276207 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:46.907274064 +0200 +@@ -1136,8 +1136,7 @@ + mvm->ampdu_toggle = toggle_bit; + + if (he_phy_data != HE_PHY_DATA_INVAL && +- (he_type == RATE_MCS_HE_TYPE_MU || +- he_type == RATE_MCS_HE_TYPE_SU)) { ++ he_type == RATE_MCS_HE_TYPE_MU) { + rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN; + if (FIELD_GET(IWL_RX_HE_PHY_DELIM_EOF, + he_phy_data)) diff --git a/SOURCES/0068-Revert-iwlwifi-mvm-add-bss-color-to-radiotap.patch b/SOURCES/0068-Revert-iwlwifi-mvm-add-bss-color-to-radiotap.patch new file mode 100644 index 0000000..889d181 --- /dev/null +++ b/SOURCES/0068-Revert-iwlwifi-mvm-add-bss-color-to-radiotap.patch @@ -0,0 +1,35 @@ +From 009083504f40025e38bcbbd25ccd17c206c23e40 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Thu, 5 Sep 2019 18:53:49 +0200 +Subject: [PATCH 39/43] Revert "iwlwifi: mvm: add bss color to radiotap" + +This reverts commit bd6fc6552b053fcb7bef8c1665adb8011d2b7eaa. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 14 -------------- + 1 file changed, 14 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:46.907274064 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:47.083271819 +0200 +@@ -1091,20 +1091,6 @@ + he_phy_data), + IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW); + } +- +- if (he_phy_data != HE_PHY_DATA_INVAL && +- (he_type == RATE_MCS_HE_TYPE_SU || +- he_type == RATE_MCS_HE_TYPE_MU)) { +- u8 bss_color = FIELD_GET(IWL_RX_HE_PHY_BSS_COLOR_MASK, +- he_phy_data); +- +- if (bss_color) { +- he->data1 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_BSS_COLOR_KNOWN); +- he->data3 |= cpu_to_le16(bss_color); +- } +- } +- + rx_status->device_timestamp = gp2_on_air_rise; + rx_status->band = channel > 14 ? NL80211_BAND_5GHZ : + NL80211_BAND_2GHZ; diff --git a/SOURCES/0069-Revert-iwlwifi-support-new-rx_mpdu_desc-api.patch b/SOURCES/0069-Revert-iwlwifi-support-new-rx_mpdu_desc-api.patch new file mode 100644 index 0000000..d133955 --- /dev/null +++ b/SOURCES/0069-Revert-iwlwifi-support-new-rx_mpdu_desc-api.patch @@ -0,0 +1,503 @@ +From 90c061a4ac143f50225054e38f8a715e499312b7 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 01:13:04 +0200 +Subject: [PATCH 40/43] Revert "iwlwifi: support new rx_mpdu_desc api" + +This reverts commit 18ead597daa17a557249cf4b2f494361d836ed52. +--- + drivers/net/wireless/intel/iwlwifi/fw/api/rx.h | 179 ++++++----------------- + drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 8 +- + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 6 +- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 95 +++--------- + 4 files changed, 71 insertions(+), 217 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h 2019-09-06 01:25:46.216282878 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h 2019-09-06 01:25:47.252269663 +0200 +@@ -375,94 +375,78 @@ + }; + + /** +- * struct iwl_rx_mpdu_desc_v1 - RX MPDU descriptor ++ * struct iwl_rx_mpdu_desc - RX MPDU descriptor + */ +-struct iwl_rx_mpdu_desc_v1 { +- /* DW7 - carries rss_hash only when rpa_en == 1 */ ++struct iwl_rx_mpdu_desc { ++ /* DW2 */ + /** +- * @rss_hash: RSS hash value ++ * @mpdu_len: MPDU length + */ +- __le32 rss_hash; +- /* DW8 - carries filter_match only when rpa_en == 1 */ ++ __le16 mpdu_len; + /** +- * @filter_match: filter match value ++ * @mac_flags1: &enum iwl_rx_mpdu_mac_flags1 + */ +- __le32 filter_match; +- /* DW9 */ ++ u8 mac_flags1; + /** +- * @rate_n_flags: RX rate/flags encoding ++ * @mac_flags2: &enum iwl_rx_mpdu_mac_flags2 + */ +- __le32 rate_n_flags; +- /* DW10 */ ++ u8 mac_flags2; ++ /* DW3 */ + /** +- * @energy_a: energy chain A ++ * @amsdu_info: &enum iwl_rx_mpdu_amsdu_info + */ +- u8 energy_a; ++ u8 amsdu_info; + /** +- * @energy_b: energy chain B ++ * @phy_info: &enum iwl_rx_mpdu_phy_info + */ +- u8 energy_b; ++ __le16 phy_info; + /** +- * @channel: channel number ++ * @mac_phy_idx: MAC/PHY index + */ +- u8 channel; ++ u8 mac_phy_idx; ++ /* DW4 - carries csum data only when rpa_en == 1 */ + /** +- * @mac_context: MAC context mask ++ * @raw_csum: raw checksum (alledgedly unreliable) + */ +- u8 mac_context; +- /* DW11 */ ++ __le16 raw_csum; + /** +- * @gp2_on_air_rise: GP2 timer value on air rise (INA) ++ * @l3l4_flags: &enum iwl_rx_l3l4_flags + */ +- __le32 gp2_on_air_rise; +- /* DW12 & DW13 */ +- union { +- /** +- * @tsf_on_air_rise: +- * TSF value on air rise (INA), only valid if +- * %IWL_RX_MPDU_PHY_TSF_OVERLOAD isn't set +- */ +- __le64 tsf_on_air_rise; +- /** +- * @he_phy_data: +- * HE PHY data, see &enum iwl_rx_he_phy, valid +- * only if %IWL_RX_MPDU_PHY_TSF_OVERLOAD is set +- */ +- __le64 he_phy_data; +- }; +-} __packed; +- +-/** +- * struct iwl_rx_mpdu_desc_v3 - RX MPDU descriptor +- */ +-struct iwl_rx_mpdu_desc_v3 { +- /* DW7 - carries filter_match only when rpa_en == 1 */ ++ __le16 l3l4_flags; ++ /* DW5 */ + /** +- * @filter_match: filter match value ++ * @status: &enum iwl_rx_mpdu_status + */ +- __le32 filter_match; +- /* DW8 - carries rss_hash only when rpa_en == 1 */ ++ __le16 status; + /** +- * @rss_hash: RSS hash value ++ * @hash_filter: hash filter value + */ +- __le32 rss_hash; +- /* DW9 */ ++ u8 hash_filter; + /** +- * @partial_hash: 31:0 ip/tcp header hash +- * w/o some fields (such as IP SRC addr) ++ * @sta_id_flags: &enum iwl_rx_mpdu_sta_id_flags + */ +- __le32 partial_hash; +- /* DW10 */ ++ u8 sta_id_flags; ++ /* DW6 */ + /** +- * @raw_xsum: raw xsum value ++ * @reorder_data: &enum iwl_rx_mpdu_reorder_data + */ +- __le32 raw_xsum; +- /* DW11 */ ++ __le32 reorder_data; ++ /* DW7 - carries rss_hash only when rpa_en == 1 */ ++ /** ++ * @rss_hash: RSS hash value ++ */ ++ __le32 rss_hash; ++ /* DW8 - carries filter_match only when rpa_en == 1 */ ++ /** ++ * @filter_match: filter match value ++ */ ++ __le32 filter_match; ++ /* DW9 */ + /** + * @rate_n_flags: RX rate/flags encoding + */ + __le32 rate_n_flags; +- /* DW12 */ ++ /* DW10 */ + /** + * @energy_a: energy chain A + */ +@@ -479,12 +463,12 @@ + * @mac_context: MAC context mask + */ + u8 mac_context; +- /* DW13 */ ++ /* DW11 */ + /** + * @gp2_on_air_rise: GP2 timer value on air rise (INA) + */ + __le32 gp2_on_air_rise; +- /* DW14 & DW15 */ ++ /* DW12 & DW13 */ + union { + /** + * @tsf_on_air_rise: +@@ -499,78 +483,7 @@ + */ + __le64 he_phy_data; + }; +- /* DW16 & DW17 */ +- /** +- * @reserved: reserved +- */ +- __le32 reserved[2]; +-} __packed; /* RX_MPDU_RES_START_API_S_VER_3 */ +- +-/** +- * struct iwl_rx_mpdu_desc - RX MPDU descriptor +- */ +-struct iwl_rx_mpdu_desc { +- /* DW2 */ +- /** +- * @mpdu_len: MPDU length +- */ +- __le16 mpdu_len; +- /** +- * @mac_flags1: &enum iwl_rx_mpdu_mac_flags1 +- */ +- u8 mac_flags1; +- /** +- * @mac_flags2: &enum iwl_rx_mpdu_mac_flags2 +- */ +- u8 mac_flags2; +- /* DW3 */ +- /** +- * @amsdu_info: &enum iwl_rx_mpdu_amsdu_info +- */ +- u8 amsdu_info; +- /** +- * @phy_info: &enum iwl_rx_mpdu_phy_info +- */ +- __le16 phy_info; +- /** +- * @mac_phy_idx: MAC/PHY index +- */ +- u8 mac_phy_idx; +- /* DW4 - carries csum data only when rpa_en == 1 */ +- /** +- * @raw_csum: raw checksum (alledgedly unreliable) +- */ +- __le16 raw_csum; +- /** +- * @l3l4_flags: &enum iwl_rx_l3l4_flags +- */ +- __le16 l3l4_flags; +- /* DW5 */ +- /** +- * @status: &enum iwl_rx_mpdu_status +- */ +- __le16 status; +- /** +- * @hash_filter: hash filter value +- */ +- u8 hash_filter; +- /** +- * @sta_id_flags: &enum iwl_rx_mpdu_sta_id_flags +- */ +- u8 sta_id_flags; +- /* DW6 */ +- /** +- * @reorder_data: &enum iwl_rx_mpdu_reorder_data +- */ +- __le32 reorder_data; +- +- union { +- struct iwl_rx_mpdu_desc_v1 v1; +- struct iwl_rx_mpdu_desc_v3 v3; +- }; +-} __packed; /* RX_MPDU_RES_START_API_S_VER_3 */ +- +-#define IWL_RX_DESC_SIZE_V1 offsetofend(struct iwl_rx_mpdu_desc, v1) ++} __packed; + + #define RX_NO_DATA_CHAIN_A_POS 0 + #define RX_NO_DATA_CHAIN_A_MSK (0xff << RX_NO_DATA_CHAIN_A_POS) +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c 2019-06-27 14:54:04.133678337 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c 2019-09-06 01:25:47.253269650 +0200 +@@ -1141,10 +1141,6 @@ + struct iwl_rx_mpdu_desc *desc; + int bin_len = count / 2; + int ret = -EINVAL; +- size_t mpdu_cmd_hdr_size = +- (mvm->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) ? +- sizeof(struct iwl_rx_mpdu_desc) : +- IWL_RX_DESC_SIZE_V1; + + if (!iwl_mvm_firmware_running(mvm)) + return -EIO; +@@ -1163,7 +1159,7 @@ + goto out; + + /* avoid invalid memory access */ +- if (bin_len < sizeof(*pkt) + mpdu_cmd_hdr_size) ++ if (bin_len < sizeof(*pkt) + sizeof(*desc)) + goto out; + + /* check this is RX packet */ +@@ -1174,7 +1170,7 @@ + /* check the length in metadata matches actual received length */ + desc = (void *)pkt->data; + if (le16_to_cpu(desc->mpdu_len) != +- (bin_len - mpdu_cmd_hdr_size - sizeof(*pkt))) ++ (bin_len - sizeof(*desc) - sizeof(*pkt))) + goto out; + + local_bh_disable(); +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-09-06 01:25:41.666340915 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-09-06 01:25:47.253269650 +0200 +@@ -663,11 +663,7 @@ + + if (iwl_mvm_has_new_rx_api(mvm)) { + op_mode->ops = &iwl_mvm_ops_mq; +- trans->rx_mpdu_cmd_hdr_size = +- (trans->cfg->device_family >= +- IWL_DEVICE_FAMILY_22560) ? +- sizeof(struct iwl_rx_mpdu_desc) : +- IWL_RX_DESC_SIZE_V1; ++ trans->rx_mpdu_cmd_hdr_size = sizeof(struct iwl_rx_mpdu_desc); + } else { + op_mode->ops = &iwl_mvm_ops; + trans->rx_mpdu_cmd_hdr_size = +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:47.083271819 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:47.254269638 +0200 +@@ -253,14 +253,15 @@ + } + + static void iwl_mvm_get_signal_strength(struct iwl_mvm *mvm, +- struct ieee80211_rx_status *rx_status, +- u32 rate_n_flags, int energy_a, +- int energy_b) ++ struct iwl_rx_mpdu_desc *desc, ++ struct ieee80211_rx_status *rx_status) + { +- int max_energy; +- u32 rate_flags = rate_n_flags; ++ int energy_a, energy_b, max_energy; ++ u32 rate_flags = le32_to_cpu(desc->rate_n_flags); + ++ energy_a = desc->energy_a; + energy_a = energy_a ? -energy_a : S8_MIN; ++ energy_b = desc->energy_b; + energy_b = energy_b ? -energy_b : S8_MIN; + max_energy = max(energy_a, energy_b); + +@@ -412,8 +413,7 @@ + tid = IWL_MAX_TID_COUNT; + + /* If this wasn't a part of an A-MSDU the sub-frame index will be 0 */ +- sub_frame_idx = desc->amsdu_info & +- IWL_RX_MPDU_AMSDU_SUBFRAME_IDX_MASK; ++ sub_frame_idx = desc->amsdu_info & IWL_RX_MPDU_AMSDU_SUBFRAME_IDX_MASK; + + if (unlikely(ieee80211_has_retry(hdr->frame_control) && + dup_data->last_seq[tid] == hdr->seq_ctrl && +@@ -909,42 +909,24 @@ + struct ieee80211_rx_status *rx_status; + struct iwl_rx_packet *pkt = rxb_addr(rxb); + struct iwl_rx_mpdu_desc *desc = (void *)pkt->data; +- struct ieee80211_hdr *hdr; ++ struct ieee80211_hdr *hdr = (void *)(pkt->data + sizeof(*desc)); + u32 len = le16_to_cpu(desc->mpdu_len); +- u32 rate_n_flags, gp2_on_air_rise; ++ u32 rate_n_flags = le32_to_cpu(desc->rate_n_flags); + u16 phy_info = le16_to_cpu(desc->phy_info); + struct ieee80211_sta *sta = NULL; + struct sk_buff *skb; +- u8 crypt_len = 0, channel, energy_a, energy_b; ++ u8 crypt_len = 0; + struct ieee80211_radiotap_he *he = NULL; + struct ieee80211_radiotap_he_mu *he_mu = NULL; + u32 he_type = 0xffffffff; + /* this is invalid e.g. because puncture type doesn't allow 0b11 */ + #define HE_PHY_DATA_INVAL ((u64)-1) + u64 he_phy_data = HE_PHY_DATA_INVAL; +- size_t desc_size; + bool csi = false; + + if (unlikely(test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))) + return; + +- if (mvm->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) { +- rate_n_flags = le32_to_cpu(desc->v3.rate_n_flags); +- channel = desc->v3.channel; +- gp2_on_air_rise = le32_to_cpu(desc->v3.gp2_on_air_rise); +- energy_a = desc->v3.energy_a; +- energy_b = desc->v3.energy_b; +- desc_size = sizeof(*desc); +- } else { +- rate_n_flags = le32_to_cpu(desc->v1.rate_n_flags); +- channel = desc->v1.channel; +- gp2_on_air_rise = le32_to_cpu(desc->v1.gp2_on_air_rise); +- energy_a = desc->v1.energy_a; +- energy_b = desc->v1.energy_b; +- desc_size = IWL_RX_DESC_SIZE_V1; +- } +- +- hdr = (void *)(pkt->data + desc_size); + /* Dont use dev_alloc_skb(), we'll have enough headroom once + * ieee80211_hdr pulled. + */ +@@ -991,11 +973,8 @@ + he_type = rate_n_flags & RATE_MCS_HE_TYPE_MSK; + + if (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD) { +- if (mvm->trans->cfg->device_family >= +- IWL_DEVICE_FAMILY_22560) +- he_phy_data = le64_to_cpu(desc->v3.he_phy_data); +- else +- he_phy_data = le64_to_cpu(desc->v1.he_phy_data); ++ he_phy_data = ++ le64_to_cpu(desc->he_phy_data); + + if (he_type == RATE_MCS_HE_TYPE_MU) { + he_mu = skb_put_data(skb, &mu_known, +@@ -1009,8 +988,6 @@ + __skb_pull(skb, radiotap_len); + } + +- rx_status = IEEE80211_SKB_RXCB(skb); +- + if (iwl_mvm_rx_crypto(mvm, hdr, rx_status, phy_info, desc, + le32_to_cpu(pkt->len_n_flags), queue, + &crypt_len)) { +@@ -1034,28 +1011,14 @@ + rx_status->enc_flags |= RX_ENC_FLAG_SHORTPRE; + + if (likely(!(phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD))) { +- u64 tsf_on_air_rise; +- +- if (mvm->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) +- tsf_on_air_rise = le64_to_cpu(desc->v3.tsf_on_air_rise); +- else +- tsf_on_air_rise = le64_to_cpu(desc->v1.tsf_on_air_rise); +- +- rx_status->mactime = tsf_on_air_rise; ++ rx_status->mactime = le64_to_cpu(desc->tsf_on_air_rise); + /* TSF as indicated by the firmware is at INA time */ + rx_status->flag |= RX_FLAG_MACTIME_PLCP_START; + } else if (he_type == RATE_MCS_HE_TYPE_SU) { +- u64 he_phy_data; +- +- if (mvm->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) +- he_phy_data = le64_to_cpu(desc->v3.he_phy_data); +- else +- he_phy_data = le64_to_cpu(desc->v1.he_phy_data); +- + he->data1 |= + cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_UL_DL_KNOWN); + if (FIELD_GET(IWL_RX_HE_PHY_UPLINK, +- he_phy_data)) ++ le64_to_cpu(desc->he_phy_data))) + he->data3 |= + cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA3_UL_DL); + +@@ -1066,7 +1029,7 @@ + rx_status->flag |= RX_FLAG_AMPDU_DETAILS; + rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN; + if (FIELD_GET(IWL_RX_HE_PHY_DELIM_EOF, +- he_phy_data)) ++ le64_to_cpu(desc->he_phy_data))) + rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT; + } + } else if (he_mu && he_phy_data != HE_PHY_DATA_INVAL) { +@@ -1091,23 +1054,16 @@ + he_phy_data), + IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW); + } +- rx_status->device_timestamp = gp2_on_air_rise; +- rx_status->band = channel > 14 ? NL80211_BAND_5GHZ : +- NL80211_BAND_2GHZ; +- rx_status->freq = ieee80211_channel_to_frequency(channel, ++ rx_status->device_timestamp = le32_to_cpu(desc->gp2_on_air_rise); ++ rx_status->band = desc->channel > 14 ? NL80211_BAND_5GHZ : ++ NL80211_BAND_2GHZ; ++ rx_status->freq = ieee80211_channel_to_frequency(desc->channel, + rx_status->band); +- iwl_mvm_get_signal_strength(mvm, rx_status, rate_n_flags, energy_a, +- energy_b); ++ iwl_mvm_get_signal_strength(mvm, desc, rx_status); + + /* update aggregation data for monitor sake on default queue */ + if (!queue && (phy_info & IWL_RX_MPDU_PHY_AMPDU)) { + bool toggle_bit = phy_info & IWL_RX_MPDU_PHY_AMPDU_TOGGLE; +- u64 he_phy_data; +- +- if (mvm->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) +- he_phy_data = le64_to_cpu(desc->v3.he_phy_data); +- else +- he_phy_data = le64_to_cpu(desc->v1.he_phy_data); + + rx_status->flag |= RX_FLAG_AMPDU_DETAILS; + /* +@@ -1125,7 +1081,7 @@ + he_type == RATE_MCS_HE_TYPE_MU) { + rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN; + if (FIELD_GET(IWL_RX_HE_PHY_DELIM_EOF, +- he_phy_data)) ++ le64_to_cpu(desc->he_phy_data))) + rx_status->flag |= + RX_FLAG_AMPDU_EOF_BIT; + } +@@ -1425,19 +1381,12 @@ + break; + case RATE_MCS_HE_TYPE_MU: { + u16 val; +- u64 he_phy_data; +- +- if (mvm->trans->cfg->device_family >= +- IWL_DEVICE_FAMILY_22560) +- he_phy_data = le64_to_cpu(desc->v3.he_phy_data); +- else +- he_phy_data = le64_to_cpu(desc->v1.he_phy_data); + + if (he_phy_data == HE_PHY_DATA_INVAL) + break; + + val = FIELD_GET(IWL_RX_HE_PHY_HE_LTF_NUM_MASK, +- he_phy_data); ++ le64_to_cpu(desc->he_phy_data)); + + he->data2 |= + cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_NUM_LTF_SYMS_KNOWN); diff --git a/SOURCES/0070-Revert-iwlwifi-mvm-add-radiotap-data-for-HE.patch b/SOURCES/0070-Revert-iwlwifi-mvm-add-radiotap-data-for-HE.patch new file mode 100644 index 0000000..788d603 --- /dev/null +++ b/SOURCES/0070-Revert-iwlwifi-mvm-add-radiotap-data-for-HE.patch @@ -0,0 +1,235 @@ +From 1eebf4ab32c4f817b1fa5fadbec1445c5dec2fb9 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 01:14:17 +0200 +Subject: [PATCH 41/43] Revert "iwlwifi: mvm: add radiotap data for HE" + +This reverts commit e5721e3f770f0ca527c6232c7d19e8cabd1f79b8. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 155 +------------------------- + 1 file changed, 4 insertions(+), 151 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:47.254269638 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:47.447267176 +0200 +@@ -916,8 +916,6 @@ + struct ieee80211_sta *sta = NULL; + struct sk_buff *skb; + u8 crypt_len = 0; +- struct ieee80211_radiotap_he *he = NULL; +- struct ieee80211_radiotap_he_mu *he_mu = NULL; + u32 he_type = 0xffffffff; + /* this is invalid e.g. because puncture type doesn't allow 0b11 */ + #define HE_PHY_DATA_INVAL ((u64)-1) +@@ -949,43 +947,10 @@ + rx_status = IEEE80211_SKB_RXCB(skb); + + if (rate_n_flags & RATE_MCS_HE_MSK) { +- static const struct ieee80211_radiotap_he known = { +- .data1 = cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_DATA_MCS_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA1_DATA_DCM_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA1_STBC_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA1_CODING_KNOWN), +- .data2 = cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_GI_KNOWN | +- IEEE80211_RADIOTAP_HE_DATA2_TXBF_KNOWN), +- }; +- static const struct ieee80211_radiotap_he_mu mu_known = { +- .flags1 = cpu_to_le16(IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_MCS_KNOWN | +- IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_DCM_KNOWN | +- IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_SYMS_USERS_KNOWN | +- IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_COMP_KNOWN), +- .flags2 = cpu_to_le16(IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW_KNOWN), +- }; +- unsigned int radiotap_len = 0; +- +- he = skb_put_data(skb, &known, sizeof(known)); +- radiotap_len += sizeof(known); +- rx_status->flag |= RX_FLAG_RADIOTAP_HE; +- +- he_type = rate_n_flags & RATE_MCS_HE_TYPE_MSK; +- +- if (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD) { ++ if (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD) + he_phy_data = + le64_to_cpu(desc->he_phy_data); +- +- if (he_type == RATE_MCS_HE_TYPE_MU) { +- he_mu = skb_put_data(skb, &mu_known, +- sizeof(mu_known)); +- radiotap_len += sizeof(mu_known); +- rx_status->flag |= RX_FLAG_RADIOTAP_HE_MU; +- } +- } +- +- /* temporarily hide the radiotap data */ +- __skb_pull(skb, radiotap_len); ++ he_type = rate_n_flags & RATE_MCS_HE_TYPE_MSK; + } + + if (iwl_mvm_rx_crypto(mvm, hdr, rx_status, phy_info, desc, +@@ -1015,13 +980,6 @@ + /* TSF as indicated by the firmware is at INA time */ + rx_status->flag |= RX_FLAG_MACTIME_PLCP_START; + } else if (he_type == RATE_MCS_HE_TYPE_SU) { +- he->data1 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_UL_DL_KNOWN); +- if (FIELD_GET(IWL_RX_HE_PHY_UPLINK, +- le64_to_cpu(desc->he_phy_data))) +- he->data3 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA3_UL_DL); +- + if (!queue && !(phy_info & IWL_RX_MPDU_PHY_AMPDU)) { + rx_status->ampdu_reference = mvm->ampdu_ref; + mvm->ampdu_ref++; +@@ -1032,28 +990,8 @@ + le64_to_cpu(desc->he_phy_data))) + rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT; + } +- } else if (he_mu && he_phy_data != HE_PHY_DATA_INVAL) { +- he_mu->flags1 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SIBG_SYM_OR_USER_NUM_MASK, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_SYMS_USERS); +- he_mu->flags1 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SIGB_DCM, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_DCM); +- he_mu->flags1 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SIGB_MCS_MASK, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_MCS); +- he_mu->flags2 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SIGB_COMPRESSION, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_COMP); +- he_mu->flags2 |= +- le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_PREAMBLE_PUNC_TYPE_MASK, +- he_phy_data), +- IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW); + } ++ + rx_status->device_timestamp = le32_to_cpu(desc->gp2_on_air_rise); + rx_status->band = desc->channel > 14 ? NL80211_BAND_5GHZ : + NL80211_BAND_2GHZ; +@@ -1258,17 +1196,6 @@ + rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_2x996; + break; + } +- he->data2 |= +- le16_encode_bits(offs, +- IEEE80211_RADIOTAP_HE_DATA2_RU_OFFSET); +- he->data2 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_KNOWN); +- if (he_phy_data & IWL_RX_HE_PHY_RU_ALLOC_SEC80) +- he->data2 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_SEC); +- } else if (he) { +- he->data1 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_BW_RU_ALLOC_KNOWN); + } + + if (!(rate_n_flags & RATE_MCS_CCK_MSK) && +@@ -1295,7 +1222,7 @@ + rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT; + if (rate_n_flags & RATE_MCS_BF_MSK) + rx_status->enc_flags |= RX_ENC_FLAG_BF; +- } else if (he) { ++ } else if (rate_n_flags & RATE_MCS_HE_MSK) { + u8 stbc = (rate_n_flags & RATE_MCS_STBC_MSK) >> + RATE_MCS_STBC_POS; + rx_status->nss = +@@ -1310,20 +1237,6 @@ + rx_status->he_dcm = + !!(rate_n_flags & RATE_HE_DUAL_CARRIER_MODE_MSK); + +-#define CHECK_TYPE(F) \ +- BUILD_BUG_ON(IEEE80211_RADIOTAP_HE_DATA1_FORMAT_ ## F != \ +- (RATE_MCS_HE_TYPE_ ## F >> RATE_MCS_HE_TYPE_POS)) +- +- CHECK_TYPE(SU); +- CHECK_TYPE(EXT_SU); +- CHECK_TYPE(MU); +- CHECK_TYPE(TRIG); +- +- he->data1 |= cpu_to_le16(he_type >> RATE_MCS_HE_TYPE_POS); +- +- if (rate_n_flags & RATE_MCS_BF_POS) +- he->data5 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA5_TXBF); +- + switch ((rate_n_flags & RATE_MCS_HE_GI_LTF_MSK) >> + RATE_MCS_HE_GI_LTF_POS) { + case 0: +@@ -1342,65 +1255,6 @@ + rx_status->he_gi = NL80211_RATE_INFO_HE_GI_3_2; + break; + } +- +- switch (he_type) { +- case RATE_MCS_HE_TYPE_SU: { +- u16 val; +- +- /* LTF syms correspond to streams */ +- he->data2 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_NUM_LTF_SYMS_KNOWN); +- switch (rx_status->nss) { +- case 1: +- val = 0; +- break; +- case 2: +- val = 1; +- break; +- case 3: +- case 4: +- val = 2; +- break; +- case 5: +- case 6: +- val = 3; +- break; +- case 7: +- case 8: +- val = 4; +- break; +- default: +- WARN_ONCE(1, "invalid nss: %d\n", +- rx_status->nss); +- val = 0; +- } +- he->data5 |= +- le16_encode_bits(val, +- IEEE80211_RADIOTAP_HE_DATA5_NUM_LTF_SYMS); +- } +- break; +- case RATE_MCS_HE_TYPE_MU: { +- u16 val; +- +- if (he_phy_data == HE_PHY_DATA_INVAL) +- break; +- +- val = FIELD_GET(IWL_RX_HE_PHY_HE_LTF_NUM_MASK, +- le64_to_cpu(desc->he_phy_data)); +- +- he->data2 |= +- cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA2_NUM_LTF_SYMS_KNOWN); +- he->data5 |= +- cpu_to_le16(FIELD_PREP( +- IEEE80211_RADIOTAP_HE_DATA5_NUM_LTF_SYMS, +- val)); +- } +- break; +- case RATE_MCS_HE_TYPE_EXT_SU: +- case RATE_MCS_HE_TYPE_TRIG: +- /* not supported yet */ +- break; +- } + } else { + int rate = iwl_mvm_legacy_rate_to_mac80211_idx(rate_n_flags, + rx_status->band); +@@ -1412,7 +1266,6 @@ + goto out; + } + rx_status->rate_idx = rate; +- + } + + /* management stuff on default queue */ diff --git a/SOURCES/0071-Revert-iwlwifi-mvm-set-MAC_FILTER_IN_11AX-in-AP-mode.patch b/SOURCES/0071-Revert-iwlwifi-mvm-set-MAC_FILTER_IN_11AX-in-AP-mode.patch new file mode 100644 index 0000000..e90039b --- /dev/null +++ b/SOURCES/0071-Revert-iwlwifi-mvm-set-MAC_FILTER_IN_11AX-in-AP-mode.patch @@ -0,0 +1,25 @@ +From 87d5d91b6ab374c905a0a4a0620d2a2830fe7942 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 01:20:48 +0200 +Subject: [PATCH 42/43] Revert "iwlwifi: mvm: set MAC_FILTER_IN_11AX in AP + mode" + +This reverts commit 3b5ee8dd8bb1a0f820eb5c85e31f92a2897bfa3d. +--- + drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 3 --- + 1 file changed, 3 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c 2019-09-06 01:25:40.745352663 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c 2019-09-06 01:25:47.620264969 +0200 +@@ -1181,9 +1181,6 @@ + IWL_DEBUG_HC(mvm, "No need to receive beacons\n"); + } + +- if (vif->bss_conf.he_support && !iwlwifi_mod_params.disable_11ax) +- cmd->filter_flags |= cpu_to_le32(MAC_FILTER_IN_11AX); +- + ctxt_ap->bi = cpu_to_le32(vif->bss_conf.beacon_int); + ctxt_ap->dtim_interval = cpu_to_le32(vif->bss_conf.beacon_int * + vif->bss_conf.dtim_period); diff --git a/SOURCES/0072-Revert-iwlwifi-add-support-for-IEEE802.11ax.patch b/SOURCES/0072-Revert-iwlwifi-add-support-for-IEEE802.11ax.patch new file mode 100644 index 0000000..d0ae34c --- /dev/null +++ b/SOURCES/0072-Revert-iwlwifi-add-support-for-IEEE802.11ax.patch @@ -0,0 +1,972 @@ +From d574baf35b78dc94ba2fbe6273c20b8ed7c20a90 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 01:23:19 +0200 +Subject: [PATCH 43/43] Revert "iwlwifi: add support for IEEE802.11ax" + +This reverts commit 514c30696fbc2598a088f8c5e201d305d157b99a. +--- + drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 103 ----------- + drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 7 - + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 203 +-------------------- + drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 +- + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 1 - + drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c | 44 +---- + drivers/net/wireless/intel/iwlwifi/mvm/rs.c | 39 +--- + drivers/net/wireless/intel/iwlwifi/mvm/rs.h | 21 +-- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 122 +------------ + drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 8 +- + drivers/net/wireless/intel/iwlwifi/mvm/sta.h | 6 +- + 11 files changed, 22 insertions(+), 534 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-09-06 01:25:40.744352675 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-09-06 01:26:14.205925854 +0200 +@@ -480,101 +480,6 @@ + vht_cap->vht_mcs.tx_mcs_map = vht_cap->vht_mcs.rx_mcs_map; + } + +-static struct ieee80211_sband_iftype_data iwl_he_capa = { +- .types_mask = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP), +- .he_cap = { +- .has_he = true, +- .he_cap_elem = { +- .mac_cap_info[0] = +- IEEE80211_HE_MAC_CAP0_HTC_HE, +- .mac_cap_info[1] = +- IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US | +- IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_QOS_8, +- .mac_cap_info[2] = +- IEEE80211_HE_MAC_CAP2_32BIT_BA_BITMAP | +- IEEE80211_HE_MAC_CAP2_ACK_EN, +- .mac_cap_info[3] = +- IEEE80211_HE_MAC_CAP3_GRP_ADDR_MULTI_STA_BA_DL_MU | +- IEEE80211_HE_MAC_CAP3_MAX_A_AMPDU_LEN_EXP_VHT_2, +- .mac_cap_info[4] = IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU, +- .phy_cap_info[0] = +- IEEE80211_HE_PHY_CAP0_DUAL_BAND | +- IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G | +- IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G | +- IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G, +- .phy_cap_info[1] = +- IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A | +- IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD | +- IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_MAX_NSTS, +- .phy_cap_info[2] = +- IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US | +- IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ | +- IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ, +- .phy_cap_info[3] = +- IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_BPSK | +- IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_1 | +- IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_BPSK | +- IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_1, +- .phy_cap_info[4] = +- IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE | +- IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_8 | +- IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_8, +- .phy_cap_info[5] = +- IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_2 | +- IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2, +- .phy_cap_info[6] = +- IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT, +- .phy_cap_info[7] = +- IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_AR | +- IEEE80211_HE_PHY_CAP7_HE_SU_MU_PPDU_4XLTF_AND_08_US_GI | +- IEEE80211_HE_PHY_CAP7_MAX_NC_7, +- .phy_cap_info[8] = +- IEEE80211_HE_PHY_CAP8_HE_ER_SU_PPDU_4XLTF_AND_08_US_GI | +- IEEE80211_HE_PHY_CAP8_20MHZ_IN_40MHZ_HE_PPDU_IN_2G | +- IEEE80211_HE_PHY_CAP8_20MHZ_IN_160MHZ_HE_PPDU | +- IEEE80211_HE_PHY_CAP8_80MHZ_IN_160MHZ_HE_PPDU, +- }, +- /* +- * Set default Tx/Rx HE MCS NSS Support field. Indicate support +- * for up to 2 spatial streams and all MCS, without any special +- * cases +- */ +- .he_mcs_nss_supp = { +- .rx_mcs_80 = cpu_to_le16(0xfffa), +- .tx_mcs_80 = cpu_to_le16(0xfffa), +- .rx_mcs_160 = cpu_to_le16(0xfffa), +- .tx_mcs_160 = cpu_to_le16(0xfffa), +- .rx_mcs_80p80 = cpu_to_le16(0xffff), +- .tx_mcs_80p80 = cpu_to_le16(0xffff), +- }, +- /* +- * Set default PPE thresholds, with PPET16 set to 0, PPET8 set +- * to 7 +- */ +- .ppe_thres = {0x61, 0x1c, 0xc7, 0x71}, +- }, +-}; +- +-static void iwl_init_he_hw_capab(struct ieee80211_supported_band *sband, +- u8 tx_chains, u8 rx_chains) +-{ +- if (sband->band == NL80211_BAND_2GHZ || +- sband->band == NL80211_BAND_5GHZ) +- sband->iftype_data = &iwl_he_capa; +- else +- return; +- +- sband->n_iftype_data = 1; +- +- /* If not 2x2, we need to indicate 1x1 in the Midamble RX Max NSTS */ +- if ((tx_chains & rx_chains) != ANT_AB) { +- iwl_he_capa.he_cap.he_cap_elem.phy_cap_info[1] &= +- ~IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_MAX_NSTS; +- iwl_he_capa.he_cap.he_cap_elem.phy_cap_info[2] &= +- ~IEEE80211_HE_PHY_CAP2_MIDAMBLE_RX_MAX_NSTS; +- } +-} +- + static void iwl_init_sbands(struct device *dev, const struct iwl_cfg *cfg, + struct iwl_nvm_data *data, + const void *nvm_ch_flags, u8 tx_chains, +@@ -595,9 +500,6 @@ + iwl_init_ht_hw_capab(cfg, data, &sband->ht_cap, NL80211_BAND_2GHZ, + tx_chains, rx_chains); + +- if (data->sku_cap_11ax_enable) +- iwl_init_he_hw_capab(sband, tx_chains, rx_chains); +- + sband = &data->bands[NL80211_BAND_5GHZ]; + sband->band = NL80211_BAND_5GHZ; + sband->bitrates = &iwl_cfg80211_rates[RATES_52_OFFS]; +@@ -610,9 +512,6 @@ + iwl_init_vht_hw_capab(cfg, data, &sband->vht_cap, + tx_chains, rx_chains); + +- if (data->sku_cap_11ax_enable) +- iwl_init_he_hw_capab(sband, tx_chains, rx_chains); +- + if (n_channels != n_used) + IWL_ERR_DEV(dev, "NVM: used only %d of %d channels\n", + n_used, n_channels); +@@ -1388,8 +1287,6 @@ + !!(mac_flags & NVM_MAC_SKU_FLAGS_802_11AC_ENABLED); + nvm->sku_cap_11n_enable = + !!(mac_flags & NVM_MAC_SKU_FLAGS_802_11N_ENABLED); +- nvm->sku_cap_11ax_enable = +- !!(mac_flags & NVM_MAC_SKU_FLAGS_802_11AX_ENABLED); + nvm->sku_cap_band_24ghz_enable = + !!(mac_flags & NVM_MAC_SKU_FLAGS_BAND_2_4_ENABLED); + nvm->sku_cap_band_52ghz_enable = +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c 2019-09-06 01:25:47.620264969 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c 2019-09-06 01:26:14.205925854 +0200 +@@ -776,13 +776,6 @@ + if (vif->probe_req_reg && vif->bss_conf.assoc && vif->p2p) + cmd.filter_flags |= cpu_to_le32(MAC_FILTER_IN_PROBE_REQUEST); + +- if (vif->bss_conf.assoc && vif->bss_conf.he_support) +- cmd.filter_flags |= cpu_to_le32(MAC_FILTER_IN_11AX); +- if (vif->bss_conf.twt_requester) +- ctxt_sta->data_policy |= cpu_to_le32(TWT_SUPPORTED); +- } +- +- + return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd); + } + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-06 01:25:40.745352663 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-06 01:27:04.186288327 +0200 +@@ -31,7 +31,6 @@ + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 - 2017 Intel Deutschland GmbH +- * Copyright(c) 2018 - 2019 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -914,7 +913,7 @@ + enum ieee80211_ampdu_mlme_action action = params->action; + u16 tid = params->tid; + u16 *ssn = ¶ms->ssn; +- u16 buf_size = params->buf_size; ++ u8 buf_size = params->buf_size; + bool amsdu = params->amsdu; + u16 timeout = params->timeout; + +@@ -2010,240 +2009,6 @@ + iwl_mvm_mu_mimo_iface_iterator, notif); + } + +-static u8 iwl_mvm_he_get_ppe_val(u8 *ppe, u8 ppe_pos_bit) +-{ +- u8 byte_num = ppe_pos_bit / 8; +- u8 bit_num = ppe_pos_bit % 8; +- u8 residue_bits; +- u8 res; +- +- if (bit_num <= 5) +- return (ppe[byte_num] >> bit_num) & +- (BIT(IEEE80211_PPE_THRES_INFO_PPET_SIZE) - 1); +- +- /* +- * If bit_num > 5, we have to combine bits with next byte. +- * Calculate how many bits we need to take from current byte (called +- * here "residue_bits"), and add them to bits from next byte. +- */ +- +- residue_bits = 8 - bit_num; +- +- res = (ppe[byte_num + 1] & +- (BIT(IEEE80211_PPE_THRES_INFO_PPET_SIZE - residue_bits) - 1)) << +- residue_bits; +- res += (ppe[byte_num] >> bit_num) & (BIT(residue_bits) - 1); +- +- return res; +-} +- +-static void iwl_mvm_cfg_he_sta(struct iwl_mvm *mvm, +- struct ieee80211_vif *vif, u8 sta_id) +-{ +- struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); +- struct iwl_he_sta_context_cmd sta_ctxt_cmd = { +- .sta_id = sta_id, +- .tid_limit = IWL_MAX_TID_COUNT, +- .bss_color = vif->bss_conf.bss_color, +- .htc_trig_based_pkt_ext = vif->bss_conf.htc_trig_based_pkt_ext, +- .frame_time_rts_th = +- cpu_to_le16(vif->bss_conf.frame_time_rts_th), +- }; +- struct ieee80211_sta *sta; +- u32 flags; +- int i; +- +- rcu_read_lock(); +- +- sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_ctxt_cmd.sta_id]); +- if (IS_ERR(sta)) { +- rcu_read_unlock(); +- WARN(1, "Can't find STA to configure HE\n"); +- return; +- } +- +- if (!sta->he_cap.has_he) { +- rcu_read_unlock(); +- return; +- } +- +- flags = 0; +- +- /* HTC flags */ +- if (sta->he_cap.he_cap_elem.mac_cap_info[0] & +- IEEE80211_HE_MAC_CAP0_HTC_HE) +- sta_ctxt_cmd.htc_flags |= cpu_to_le32(IWL_HE_HTC_SUPPORT); +- if ((sta->he_cap.he_cap_elem.mac_cap_info[1] & +- IEEE80211_HE_MAC_CAP1_LINK_ADAPTATION) || +- (sta->he_cap.he_cap_elem.mac_cap_info[2] & +- IEEE80211_HE_MAC_CAP2_LINK_ADAPTATION)) { +- u8 link_adap = +- ((sta->he_cap.he_cap_elem.mac_cap_info[2] & +- IEEE80211_HE_MAC_CAP2_LINK_ADAPTATION) << 1) + +- (sta->he_cap.he_cap_elem.mac_cap_info[1] & +- IEEE80211_HE_MAC_CAP1_LINK_ADAPTATION); +- +- if (link_adap == 2) +- sta_ctxt_cmd.htc_flags |= +- cpu_to_le32(IWL_HE_HTC_LINK_ADAP_UNSOLICITED); +- else if (link_adap == 3) +- sta_ctxt_cmd.htc_flags |= +- cpu_to_le32(IWL_HE_HTC_LINK_ADAP_BOTH); +- } +- if (sta->he_cap.he_cap_elem.mac_cap_info[2] & +- IEEE80211_HE_MAC_CAP2_UL_MU_RESP_SCHED) +- sta_ctxt_cmd.htc_flags |= +- cpu_to_le32(IWL_HE_HTC_UL_MU_RESP_SCHED); +- if (sta->he_cap.he_cap_elem.mac_cap_info[2] & IEEE80211_HE_MAC_CAP2_BSR) +- sta_ctxt_cmd.htc_flags |= cpu_to_le32(IWL_HE_HTC_BSR_SUPP); +- if (sta->he_cap.he_cap_elem.mac_cap_info[3] & +- IEEE80211_HE_MAC_CAP3_OMI_CONTROL) +- sta_ctxt_cmd.htc_flags |= cpu_to_le32(IWL_HE_HTC_OMI_SUPP); +- if (sta->he_cap.he_cap_elem.mac_cap_info[4] & IEEE80211_HE_MAC_CAP4_BQR) +- sta_ctxt_cmd.htc_flags |= cpu_to_le32(IWL_HE_HTC_BQR_SUPP); +- +- /* +- * Initialize the PPE thresholds to "None" (7), as described in Table +- * 9-262ac of 80211.ax/D3.0. +- */ +- memset(&sta_ctxt_cmd.pkt_ext, 7, sizeof(sta_ctxt_cmd.pkt_ext)); +- +- /* If PPE Thresholds exist, parse them into a FW-familiar format. */ +- if (sta->he_cap.he_cap_elem.phy_cap_info[6] & +- IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT) { +- u8 nss = (sta->he_cap.ppe_thres[0] & +- IEEE80211_PPE_THRES_NSS_MASK) + 1; +- u8 ru_index_bitmap = +- (sta->he_cap.ppe_thres[0] & +- IEEE80211_PPE_THRES_RU_INDEX_BITMASK_MASK) >> +- IEEE80211_PPE_THRES_RU_INDEX_BITMASK_POS; +- u8 *ppe = &sta->he_cap.ppe_thres[0]; +- u8 ppe_pos_bit = 7; /* Starting after PPE header */ +- +- /* +- * FW currently supports only nss == MAX_HE_SUPP_NSS +- * +- * If nss > MAX: we can ignore values we don't support +- * If nss < MAX: we can set zeros in other streams +- */ +- if (nss > MAX_HE_SUPP_NSS) { +- IWL_INFO(mvm, "Got NSS = %d - trimming to %d\n", nss, +- MAX_HE_SUPP_NSS); +- nss = MAX_HE_SUPP_NSS; +- } +- +- for (i = 0; i < nss; i++) { +- u8 ru_index_tmp = ru_index_bitmap << 1; +- u8 bw; +- +- for (bw = 0; bw < MAX_HE_CHANNEL_BW_INDX; bw++) { +- ru_index_tmp >>= 1; +- if (!(ru_index_tmp & 1)) +- continue; +- +- sta_ctxt_cmd.pkt_ext.pkt_ext_qam_th[i][bw][1] = +- iwl_mvm_he_get_ppe_val(ppe, +- ppe_pos_bit); +- ppe_pos_bit += +- IEEE80211_PPE_THRES_INFO_PPET_SIZE; +- sta_ctxt_cmd.pkt_ext.pkt_ext_qam_th[i][bw][0] = +- iwl_mvm_he_get_ppe_val(ppe, +- ppe_pos_bit); +- ppe_pos_bit += +- IEEE80211_PPE_THRES_INFO_PPET_SIZE; +- } +- } +- +- flags |= STA_CTXT_HE_PACKET_EXT; +- } else if ((sta->he_cap.he_cap_elem.phy_cap_info[9] & +- IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_MASK) != +- IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_RESERVED) { +- int low_th = -1; +- int high_th = -1; +- +- /* Take the PPE thresholds from the nominal padding info */ +- switch (sta->he_cap.he_cap_elem.phy_cap_info[9] & +- IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_MASK) { +- case IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_0US: +- low_th = IWL_HE_PKT_EXT_NONE; +- high_th = IWL_HE_PKT_EXT_NONE; +- break; +- case IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_8US: +- low_th = IWL_HE_PKT_EXT_BPSK; +- high_th = IWL_HE_PKT_EXT_NONE; +- break; +- case IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_16US: +- low_th = IWL_HE_PKT_EXT_NONE; +- high_th = IWL_HE_PKT_EXT_BPSK; +- break; +- } +- +- /* Set the PPE thresholds accordingly */ +- if (low_th >= 0 && high_th >= 0) { +- u8 ***pkt_ext_qam = +- (void *)sta_ctxt_cmd.pkt_ext.pkt_ext_qam_th; +- +- for (i = 0; i < MAX_HE_SUPP_NSS; i++) { +- u8 bw; +- +- for (bw = 0; bw < MAX_HE_CHANNEL_BW_INDX; +- bw++) { +- pkt_ext_qam[i][bw][0] = low_th; +- pkt_ext_qam[i][bw][1] = high_th; +- } +- } +- +- flags |= STA_CTXT_HE_PACKET_EXT; +- } +- } +- rcu_read_unlock(); +- +- /* Mark MU EDCA as enabled, unless none detected on some AC */ +- flags |= STA_CTXT_HE_MU_EDCA_CW; +- for (i = 0; i < AC_NUM; i++) { +- struct ieee80211_he_mu_edca_param_ac_rec *mu_edca = +- &mvmvif->queue_params[i].mu_edca_param_rec; +- +- if (!mvmvif->queue_params[i].mu_edca) { +- flags &= ~STA_CTXT_HE_MU_EDCA_CW; +- break; +- } +- +- sta_ctxt_cmd.trig_based_txf[i].cwmin = +- cpu_to_le16(mu_edca->ecw_min_max & 0xf); +- sta_ctxt_cmd.trig_based_txf[i].cwmax = +- cpu_to_le16((mu_edca->ecw_min_max & 0xf0) >> 4); +- sta_ctxt_cmd.trig_based_txf[i].aifsn = +- cpu_to_le16(mu_edca->aifsn); +- sta_ctxt_cmd.trig_based_txf[i].mu_time = +- cpu_to_le16(mu_edca->mu_edca_timer); +- } +- +- if (vif->bss_conf.multi_sta_back_32bit) +- flags |= STA_CTXT_HE_32BIT_BA_BITMAP; +- +- if (vif->bss_conf.ack_enabled) +- flags |= STA_CTXT_HE_ACK_ENABLED; +- +- if (vif->bss_conf.uora_exists) { +- flags |= STA_CTXT_HE_TRIG_RND_ALLOC; +- +- sta_ctxt_cmd.rand_alloc_ecwmin = +- vif->bss_conf.uora_ocw_range & 0x7; +- sta_ctxt_cmd.rand_alloc_ecwmax = +- (vif->bss_conf.uora_ocw_range >> 3) & 0x7; +- } +- +- /* TODO: support Multi BSSID IE */ +- +- sta_ctxt_cmd.flags = cpu_to_le32(flags); +- +- if (iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(STA_HE_CTXT_CMD, +- DATA_PATH_GROUP, 0), +- 0, sizeof(sta_ctxt_cmd), &sta_ctxt_cmd)) +- IWL_ERR(mvm, "Failed to config FW to work HE!\n"); +-} +- + static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm, + struct ieee80211_vif *vif, + struct ieee80211_bss_conf *bss_conf, +@@ -2257,12 +2022,8 @@ + * beacon interval, which was not known when the station interface was + * added. + */ +- if (changes & BSS_CHANGED_ASSOC && bss_conf->assoc) { +- if (vif->bss_conf.he_support) +- iwl_mvm_cfg_he_sta(mvm, vif, mvmvif->ap_sta_id); +- ++ if (changes & BSS_CHANGED_ASSOC && bss_conf->assoc) + iwl_mvm_mac_ctxt_recalc_tsf_id(mvm, vif); +- } + + /* Update MU EDCA params */ + if (changes & BSS_CHANGED_QOS && mvmvif->associated && +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-09-06 01:25:47.817262456 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-09-06 01:26:14.207925829 +0200 +@@ -696,7 +696,7 @@ + struct iwl_mvm_reorder_buffer { + u16 head_sn; + u16 num_stored; +- u16 buf_size; ++ u8 buf_size; + int queue; + u16 last_amsdu; + u8 last_sub_index; +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-09-06 01:25:47.817262456 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-09-06 01:26:14.207925829 +0200 +@@ -444,7 +444,6 @@ + HCMD_NAME(DQA_ENABLE_CMD), + HCMD_NAME(UPDATE_MU_GROUPS_CMD), + HCMD_NAME(TRIGGER_RX_QUEUES_NOTIF_CMD), +- HCMD_NAME(STA_HE_CTXT_CMD), + HCMD_NAME(RFH_QUEUE_CONFIG_CMD), + HCMD_NAME(TLC_MNG_CONFIG_CMD), + HCMD_NAME(CHEST_COLLECTOR_FILTER_CONFIG_CMD), +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c 2019-09-06 01:25:41.121347866 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c 2019-09-06 01:26:14.208925816 +0200 +@@ -204,43 +204,6 @@ + } + } + +-static u16 rs_fw_he_ieee80211_mcs_to_rs_mcs(u16 mcs) +-{ +- switch (mcs) { +- case IEEE80211_HE_MCS_SUPPORT_0_7: +- return BIT(IWL_TLC_MNG_HT_RATE_MCS7 + 1) - 1; +- case IEEE80211_HE_MCS_SUPPORT_0_9: +- return BIT(IWL_TLC_MNG_HT_RATE_MCS9 + 1) - 1; +- case IEEE80211_HE_MCS_SUPPORT_0_11: +- return BIT(IWL_TLC_MNG_HT_RATE_MCS11 + 1) - 1; +- case IEEE80211_HE_MCS_NOT_SUPPORTED: +- return 0; +- } +- +- WARN(1, "invalid HE MCS %d\n", mcs); +- return 0; +-} +- +-static void +-rs_fw_he_set_enabled_rates(const struct ieee80211_sta *sta, +- const struct ieee80211_sta_he_cap *he_cap, +- struct iwl_tlc_config_cmd *cmd) +-{ +- u16 mcs_160 = le16_to_cpu(sta->he_cap.he_mcs_nss_supp.rx_mcs_160); +- u16 mcs_80 = le16_to_cpu(sta->he_cap.he_mcs_nss_supp.rx_mcs_80); +- int i; +- +- for (i = 0; i < sta->rx_nss && i < MAX_NSS; i++) { +- u16 _mcs_160 = (mcs_160 >> (2 * i)) & 0x3; +- u16 _mcs_80 = (mcs_80 >> (2 * i)) & 0x3; +- +- cmd->ht_rates[i][0] = +- cpu_to_le16(rs_fw_he_ieee80211_mcs_to_rs_mcs(_mcs_80)); +- cmd->ht_rates[i][1] = +- cpu_to_le16(rs_fw_he_ieee80211_mcs_to_rs_mcs(_mcs_160)); +- } +-} +- + static void rs_fw_set_supp_rates(struct ieee80211_sta *sta, + struct ieee80211_supported_band *sband, + struct iwl_tlc_config_cmd *cmd) +@@ -250,7 +213,6 @@ + unsigned long supp; /* must be unsigned long for for_each_set_bit */ + const struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap; + const struct ieee80211_sta_vht_cap *vht_cap = &sta->vht_cap; +- const struct ieee80211_sta_he_cap *he_cap = &sta->he_cap; + + /* non HT rates */ + supp = 0; +@@ -261,11 +223,7 @@ + cmd->non_ht_rates = cpu_to_le16(supp); + cmd->mode = IWL_TLC_MNG_MODE_NON_HT; + +- /* HT/VHT rates */ +- if (he_cap && he_cap->has_he) { +- cmd->mode = IWL_TLC_MNG_MODE_HE; +- rs_fw_he_set_enabled_rates(sta, he_cap, cmd); +- } else if (vht_cap && vht_cap->vht_supported) { ++ if (vht_cap && vht_cap->vht_supported) { + cmd->mode = IWL_TLC_MNG_MODE_VHT; + rs_fw_vht_set_enabled_rates(sta, vht_cap, cmd); + } else if (ht_cap && ht_cap->ht_supported) { +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rs.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rs.c 2019-09-05 14:40:03.011478963 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rs.c 2019-09-06 01:26:14.208925816 +0200 +@@ -352,8 +352,7 @@ + idx += 1; + if ((idx >= IWL_FIRST_HT_RATE) && (idx <= IWL_LAST_HT_RATE)) + return idx; +- } else if (rate_n_flags & RATE_MCS_VHT_MSK || +- rate_n_flags & RATE_MCS_HE_MSK) { ++ } else if (rate_n_flags & RATE_MCS_VHT_MSK) { + idx = rate_n_flags & RATE_VHT_MCS_RATE_CODE_MSK; + idx += IWL_RATE_MCS_0_INDEX; + +@@ -362,9 +361,6 @@ + idx++; + if ((idx >= IWL_FIRST_VHT_RATE) && (idx <= IWL_LAST_VHT_RATE)) + return idx; +- if ((rate_n_flags & RATE_MCS_HE_MSK) && +- (idx <= IWL_LAST_HE_RATE)) +- return idx; + } else { + /* legacy rate format, search for match in table */ + +@@ -509,8 +505,6 @@ + [LQ_HT_MIMO2] = "HT MIMO", + [LQ_VHT_SISO] = "VHT SISO", + [LQ_VHT_MIMO2] = "VHT MIMO", +- [LQ_HE_SISO] = "HE SISO", +- [LQ_HE_MIMO2] = "HE MIMO", + }; + + if (type < LQ_NONE || type >= LQ_MAX) +@@ -895,8 +889,7 @@ + + /* Legacy */ + if (!(ucode_rate & RATE_MCS_HT_MSK) && +- !(ucode_rate & RATE_MCS_VHT_MSK) && +- !(ucode_rate & RATE_MCS_HE_MSK)) { ++ !(ucode_rate & RATE_MCS_VHT_MSK)) { + if (num_of_ant == 1) { + if (band == NL80211_BAND_5GHZ) + rate->type = LQ_LEGACY_A; +@@ -907,7 +900,7 @@ + return 0; + } + +- /* HT, VHT or HE */ ++ /* HT or VHT */ + if (ucode_rate & RATE_MCS_SGI_MSK) + rate->sgi = true; + if (ucode_rate & RATE_MCS_LDPC_MSK) +@@ -949,24 +942,10 @@ + } else { + WARN_ON_ONCE(1); + } +- } else if (ucode_rate & RATE_MCS_HE_MSK) { +- nss = ((ucode_rate & RATE_VHT_MCS_NSS_MSK) >> +- RATE_VHT_MCS_NSS_POS) + 1; +- +- if (nss == 1) { +- rate->type = LQ_HE_SISO; +- WARN_ONCE(!rate->stbc && !rate->bfer && num_of_ant != 1, +- "stbc %d bfer %d", rate->stbc, rate->bfer); +- } else if (nss == 2) { +- rate->type = LQ_HE_MIMO2; +- WARN_ON_ONCE(num_of_ant != 2); +- } else { +- WARN_ON_ONCE(1); +- } + } + + WARN_ON_ONCE(rate->bw == RATE_MCS_CHAN_WIDTH_80 && +- !is_he(rate) && !is_vht(rate)); ++ !is_vht(rate)); + + return 0; + } +@@ -3647,8 +3626,7 @@ + u8 ant = (rate & RATE_MCS_ANT_ABC_MSK) >> RATE_MCS_ANT_POS; + + if (!(rate & RATE_MCS_HT_MSK) && +- !(rate & RATE_MCS_VHT_MSK) && +- !(rate & RATE_MCS_HE_MSK)) { ++ !(rate & RATE_MCS_VHT_MSK)) { + int index = iwl_hwrate_to_plcp_idx(rate); + + return scnprintf(buf, bufsz, "Legacy | ANT: %s Rate: %s Mbps\n", +@@ -3667,11 +3645,6 @@ + mcs = rate & RATE_HT_MCS_INDEX_MSK; + nss = ((rate & RATE_HT_MCS_NSS_MSK) + >> RATE_HT_MCS_NSS_POS) + 1; +- } else if (rate & RATE_MCS_HE_MSK) { +- type = "HE"; +- mcs = rate & RATE_VHT_MCS_RATE_CODE_MSK; +- nss = ((rate & RATE_VHT_MCS_NSS_MSK) +- >> RATE_VHT_MCS_NSS_POS) + 1; + } else { + type = "Unknown"; /* shouldn't happen */ + } +@@ -3933,8 +3906,6 @@ + [IWL_RATE_MCS_7_INDEX] = "MCS7", + [IWL_RATE_MCS_8_INDEX] = "MCS8", + [IWL_RATE_MCS_9_INDEX] = "MCS9", +- [IWL_RATE_MCS_10_INDEX] = "MCS10", +- [IWL_RATE_MCS_11_INDEX] = "MCS11", + }; + + char *buff, *pos, *endpos; +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rs.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rs.h 2019-09-06 01:25:47.819262431 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rs.h 2019-09-06 01:26:14.208925816 +0200 +@@ -133,13 +133,8 @@ + + #define LINK_QUAL_AGG_FRAME_LIMIT_DEF (63) + #define LINK_QUAL_AGG_FRAME_LIMIT_MAX (63) +-/* +- * FIXME - various places in firmware API still use u8, +- * e.g. LQ command and SCD config command. +- * This should be 256 instead. +- */ +-#define LINK_QUAL_AGG_FRAME_LIMIT_GEN2_DEF (255) +-#define LINK_QUAL_AGG_FRAME_LIMIT_GEN2_MAX (255) ++#define LINK_QUAL_AGG_FRAME_LIMIT_GEN2_DEF (64) ++#define LINK_QUAL_AGG_FRAME_LIMIT_GEN2_MAX (64) + #define LINK_QUAL_AGG_FRAME_LIMIT_MIN (0) + + #define LQ_SIZE 2 /* 2 mode tables: "Active" and "Search" */ +@@ -156,8 +151,6 @@ + LQ_HT_MIMO2, + LQ_VHT_SISO, /* VHT types */ + LQ_VHT_MIMO2, +- LQ_HE_SISO, /* HE types */ +- LQ_HE_MIMO2, + LQ_MAX, + }; + +@@ -179,16 +172,11 @@ + #define is_type_ht_mimo2(type) ((type) == LQ_HT_MIMO2) + #define is_type_vht_siso(type) ((type) == LQ_VHT_SISO) + #define is_type_vht_mimo2(type) ((type) == LQ_VHT_MIMO2) +-#define is_type_he_siso(type) ((type) == LQ_HE_SISO) +-#define is_type_he_mimo2(type) ((type) == LQ_HE_MIMO2) +-#define is_type_siso(type) (is_type_ht_siso(type) || is_type_vht_siso(type) || \ +- is_type_he_siso(type)) +-#define is_type_mimo2(type) (is_type_ht_mimo2(type) || \ +- is_type_vht_mimo2(type) || is_type_he_mimo2(type)) ++#define is_type_siso(type) (is_type_ht_siso(type) || is_type_vht_siso(type)) ++#define is_type_mimo2(type) (is_type_ht_mimo2(type) || is_type_vht_mimo2(type)) + #define is_type_mimo(type) (is_type_mimo2(type)) + #define is_type_ht(type) (is_type_ht_siso(type) || is_type_ht_mimo2(type)) + #define is_type_vht(type) (is_type_vht_siso(type) || is_type_vht_mimo2(type)) +-#define is_type_he(type) (is_type_he_siso(type) || is_type_he_mimo2(type)) + #define is_type_a_band(type) ((type) == LQ_LEGACY_A) + #define is_type_g_band(type) ((type) == LQ_LEGACY_G) + +@@ -202,7 +190,6 @@ + #define is_mimo(rate) is_type_mimo((rate)->type) + #define is_ht(rate) is_type_ht((rate)->type) + #define is_vht(rate) is_type_vht((rate)->type) +-#define is_he(rate) is_type_he((rate)->type) + #define is_a_band(rate) is_type_a_band((rate)->type) + #define is_g_band(rate) is_type_g_band((rate)->type) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:25:47.447267176 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 01:26:14.209925803 +0200 +@@ -8,7 +8,6 @@ + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2015 - 2017 Intel Deutschland GmbH +- * Copyright(c) 2018 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as +@@ -31,7 +30,6 @@ + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2015 - 2017 Intel Deutschland GmbH +- * Copyright(c) 2018 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -916,10 +914,6 @@ + struct ieee80211_sta *sta = NULL; + struct sk_buff *skb; + u8 crypt_len = 0; +- u32 he_type = 0xffffffff; +- /* this is invalid e.g. because puncture type doesn't allow 0b11 */ +-#define HE_PHY_DATA_INVAL ((u64)-1) +- u64 he_phy_data = HE_PHY_DATA_INVAL; + bool csi = false; + + if (unlikely(test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))) +@@ -946,13 +940,6 @@ + + rx_status = IEEE80211_SKB_RXCB(skb); + +- if (rate_n_flags & RATE_MCS_HE_MSK) { +- if (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD) +- he_phy_data = +- le64_to_cpu(desc->he_phy_data); +- he_type = rate_n_flags & RATE_MCS_HE_TYPE_MSK; +- } +- + if (iwl_mvm_rx_crypto(mvm, hdr, rx_status, phy_info, desc, + le32_to_cpu(pkt->len_n_flags), queue, + &crypt_len)) { +@@ -979,19 +966,7 @@ + rx_status->mactime = le64_to_cpu(desc->tsf_on_air_rise); + /* TSF as indicated by the firmware is at INA time */ + rx_status->flag |= RX_FLAG_MACTIME_PLCP_START; +- } else if (he_type == RATE_MCS_HE_TYPE_SU) { +- if (!queue && !(phy_info & IWL_RX_MPDU_PHY_AMPDU)) { +- rx_status->ampdu_reference = mvm->ampdu_ref; +- mvm->ampdu_ref++; +- +- rx_status->flag |= RX_FLAG_AMPDU_DETAILS; +- rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN; +- if (FIELD_GET(IWL_RX_HE_PHY_DELIM_EOF, +- le64_to_cpu(desc->he_phy_data))) +- rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT; +- } + } +- + rx_status->device_timestamp = le32_to_cpu(desc->gp2_on_air_rise); + rx_status->band = desc->channel > 14 ? NL80211_BAND_5GHZ : + NL80211_BAND_2GHZ; +@@ -1014,15 +989,6 @@ + if (mvm->ampdu_ref == 0) + mvm->ampdu_ref++; + mvm->ampdu_toggle = toggle_bit; +- +- if (he_phy_data != HE_PHY_DATA_INVAL && +- he_type == RATE_MCS_HE_TYPE_MU) { +- rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN; +- if (FIELD_GET(IWL_RX_HE_PHY_DELIM_EOF, +- le64_to_cpu(desc->he_phy_data))) +- rx_status->flag |= +- RX_FLAG_AMPDU_EOF_BIT; +- } + } + rx_status->ampdu_reference = mvm->ampdu_ref; + } +@@ -1131,6 +1097,7 @@ + } + } + ++ /* Set up the HT phy flags */ + switch (rate_n_flags & RATE_MCS_CHAN_WIDTH_MSK) { + case RATE_MCS_CHAN_WIDTH_20: + break; +@@ -1145,59 +1112,6 @@ + break; + } + +- if (he_type == RATE_MCS_HE_TYPE_EXT_SU && +- rate_n_flags & RATE_MCS_HE_106T_MSK) { +- rx_status->bw = RATE_INFO_BW_HE_RU; +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_106; +- } +- +- if (rate_n_flags & RATE_MCS_HE_MSK && +- phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD && +- he_type == RATE_MCS_HE_TYPE_MU) { +- /* +- * Unfortunately, we have to leave the mac80211 data +- * incorrect for the case that we receive an HE-MU +- * transmission and *don't* have the he_mu pointer, +- * i.e. we don't have the phy data (due to the bits +- * being used for TSF). This shouldn't happen though +- * as management frames where we need the TSF/timers +- * are not be transmitted in HE-MU, I think. +- */ +- u8 ru = FIELD_GET(IWL_RX_HE_PHY_RU_ALLOC_MASK, he_phy_data); +- u8 offs = 0; +- +- rx_status->bw = RATE_INFO_BW_HE_RU; +- +- switch (ru) { +- case 0 ... 36: +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_26; +- offs = ru; +- break; +- case 37 ... 52: +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_52; +- offs = ru - 37; +- break; +- case 53 ... 60: +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_106; +- offs = ru - 53; +- break; +- case 61 ... 64: +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_242; +- offs = ru - 61; +- break; +- case 65 ... 66: +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_484; +- offs = ru - 65; +- break; +- case 67: +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_996; +- break; +- case 68: +- rx_status->he_ru = NL80211_RATE_INFO_HE_RU_ALLOC_2x996; +- break; +- } +- } +- + if (!(rate_n_flags & RATE_MCS_CCK_MSK) && + rate_n_flags & RATE_MCS_SGI_MSK) + rx_status->enc_flags |= RX_ENC_FLAG_SHORT_GI; +@@ -1222,39 +1136,6 @@ + rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT; + if (rate_n_flags & RATE_MCS_BF_MSK) + rx_status->enc_flags |= RX_ENC_FLAG_BF; +- } else if (rate_n_flags & RATE_MCS_HE_MSK) { +- u8 stbc = (rate_n_flags & RATE_MCS_STBC_MSK) >> +- RATE_MCS_STBC_POS; +- rx_status->nss = +- ((rate_n_flags & RATE_VHT_MCS_NSS_MSK) >> +- RATE_VHT_MCS_NSS_POS) + 1; +- rx_status->rate_idx = rate_n_flags & RATE_VHT_MCS_RATE_CODE_MSK; +- rx_status->encoding = RX_ENC_HE; +- rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT; +- if (rate_n_flags & RATE_MCS_BF_MSK) +- rx_status->enc_flags |= RX_ENC_FLAG_BF; +- +- rx_status->he_dcm = +- !!(rate_n_flags & RATE_HE_DUAL_CARRIER_MODE_MSK); +- +- switch ((rate_n_flags & RATE_MCS_HE_GI_LTF_MSK) >> +- RATE_MCS_HE_GI_LTF_POS) { +- case 0: +- rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8; +- break; +- case 1: +- rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8; +- break; +- case 2: +- rx_status->he_gi = NL80211_RATE_INFO_HE_GI_1_6; +- break; +- case 3: +- if (rate_n_flags & RATE_MCS_SGI_MSK) +- rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8; +- else +- rx_status->he_gi = NL80211_RATE_INFO_HE_GI_3_2; +- break; +- } + } else { + int rate = iwl_mvm_legacy_rate_to_mac80211_idx(rate_n_flags, + rx_status->band); +@@ -1266,6 +1147,7 @@ + goto out; + } + rx_status->rate_idx = rate; ++ + } + + /* management stuff on default queue */ +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/sta.c 2019-09-06 01:25:47.820262418 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/sta.c 2019-09-06 01:26:14.209925803 +0200 +@@ -2555,7 +2555,7 @@ + + static void iwl_mvm_init_reorder_buffer(struct iwl_mvm *mvm, + struct iwl_mvm_baid_data *data, +- u16 ssn, u16 buf_size) ++ u16 ssn, u8 buf_size) + { + int i; + +@@ -2582,7 +2582,7 @@ + } + + int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta, +- int tid, u16 ssn, bool start, u16 buf_size, u16 timeout) ++ int tid, u16 ssn, bool start, u8 buf_size, u16 timeout) + { + struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta); + struct iwl_mvm_add_sta_cmd cmd = {}; +@@ -2644,7 +2644,7 @@ + if (start) { + cmd.add_immediate_ba_tid = (u8) tid; + cmd.add_immediate_ba_ssn = cpu_to_le16(ssn); +- cmd.rx_ba_window = cpu_to_le16(buf_size); ++ cmd.rx_ba_window = cpu_to_le16((u16)buf_size); + } else { + cmd.remove_immediate_ba_tid = (u8) tid; + } +@@ -2930,7 +2930,7 @@ + } + + int iwl_mvm_sta_tx_agg_oper(struct iwl_mvm *mvm, struct ieee80211_vif *vif, +- struct ieee80211_sta *sta, u16 tid, u16 buf_size, ++ struct ieee80211_sta *sta, u16 tid, u8 buf_size, + bool amsdu) + { + struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/sta.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/sta.h 2019-09-06 01:25:47.821262405 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/sta.h 2019-09-06 01:26:14.209925803 +0200 +@@ -411,7 +411,7 @@ + u32 tfd_queue_msk; + u32 mac_id_n_color; + u16 tid_disable_agg; +- u16 max_agg_bufsize; ++ u8 max_agg_bufsize; + enum iwl_sta_type sta_type; + enum ieee80211_sta_state sta_state; + bool bt_reduced_txpower; +@@ -518,11 +518,11 @@ + + /* AMPDU */ + int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta, +- int tid, u16 ssn, bool start, u16 buf_size, u16 timeout); ++ int tid, u16 ssn, bool start, u8 buf_size, u16 timeout); + int iwl_mvm_sta_tx_agg_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif, + struct ieee80211_sta *sta, u16 tid, u16 *ssn); + int iwl_mvm_sta_tx_agg_oper(struct iwl_mvm *mvm, struct ieee80211_vif *vif, +- struct ieee80211_sta *sta, u16 tid, u16 buf_size, ++ struct ieee80211_sta *sta, u16 tid, u8 buf_size, + bool amsdu); + int iwl_mvm_sta_tx_agg_stop(struct iwl_mvm *mvm, struct ieee80211_vif *vif, + struct ieee80211_sta *sta, u16 tid); diff --git a/SOURCES/0073-Revert-iwlwifi-mvm-update-firmware-when-MU-EDCA-para.patch b/SOURCES/0073-Revert-iwlwifi-mvm-update-firmware-when-MU-EDCA-para.patch new file mode 100644 index 0000000..f9e8f76 --- /dev/null +++ b/SOURCES/0073-Revert-iwlwifi-mvm-update-firmware-when-MU-EDCA-para.patch @@ -0,0 +1,31 @@ +From f7108086dcf7153e099939fb776223c8fc46be96 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 01:31:37 +0200 +Subject: [PATCH] Revert "iwlwifi: mvm: update firmware when MU EDCA params + change" + +This reverts commit 40ecdd01d46e67fddff4407f7c37554d9640d1ea. +--- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +index 4ca17549d94a..170179539baa 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +@@ -2025,12 +2025,6 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm, + if (changes & BSS_CHANGED_ASSOC && bss_conf->assoc) + iwl_mvm_mac_ctxt_recalc_tsf_id(mvm, vif); + +- /* Update MU EDCA params */ +- if (changes & BSS_CHANGED_QOS && mvmvif->associated && +- bss_conf->assoc && vif->bss_conf.he_support && +- !iwlwifi_mod_params.disable_11ax) +- iwl_mvm_cfg_he_sta(mvm, vif, mvmvif->ap_sta_id); +- + /* + * If we're not associated yet, take the (new) BSSID before associating + * so the firmware knows. If we're already associated, then use the old +-- +2.13.6 + diff --git a/SOURCES/0074-Revert-iwlwifi-mvm-report-delayed-beacon-count-to-FW.patch b/SOURCES/0074-Revert-iwlwifi-mvm-report-delayed-beacon-count-to-FW.patch new file mode 100644 index 0000000..6ce9c2f --- /dev/null +++ b/SOURCES/0074-Revert-iwlwifi-mvm-report-delayed-beacon-count-to-FW.patch @@ -0,0 +1,25 @@ +From 077242276a3c90947250db737df49a10bf9d37bb Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 01:37:40 +0200 +Subject: [PATCH 1/6] Revert "iwlwifi: mvm: report delayed beacon count to FW" + +This reverts commit 9cfcf71ce6ec80e1f233757e24a7b3a9181453a6. +--- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 4 ---- + 1 file changed, 4 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-06 01:36:14.011209680 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-06 01:45:48.986807002 +0200 +@@ -4100,10 +4100,6 @@ + + lockdep_assert_held(&mvm->mutex); + +- if (chsw->delay) +- cmd.cs_delayed_bcn_count = +- DIV_ROUND_UP(chsw->delay, vif->bss_conf.beacon_int); +- + return iwl_mvm_send_cmd_pdu(mvm, + WIDE_ID(MAC_CONF_GROUP, + CHANNEL_SWITCH_TIME_EVENT_CMD), diff --git a/SOURCES/0075-Revert-iwlwifi-mvm-track-changes-in-beacon-count-dur.patch b/SOURCES/0075-Revert-iwlwifi-mvm-track-changes-in-beacon-count-dur.patch new file mode 100644 index 0000000..1b4c9ae --- /dev/null +++ b/SOURCES/0075-Revert-iwlwifi-mvm-track-changes-in-beacon-count-dur.patch @@ -0,0 +1,58 @@ +From 866f912283b38bb8429ae5d0ce11e4f0575f6d84 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 01:40:46 +0200 +Subject: [PATCH 2/6] Revert "iwlwifi: mvm: track changes in beacon count + during channel switch" + +This reverts commit 81b4e44e41e651735dd185f78a8fe2f4d53c61d4. +--- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 15 --------------- + drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 -- + 2 files changed, 17 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-06 01:45:48.986807002 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-06 01:45:49.284803166 +0200 +@@ -4197,9 +4197,6 @@ + iwl_mvm_schedule_csa_period(mvm, vif, + vif->bss_conf.beacon_int, + apply_time); +- +- mvmvif->csa_count = chsw->count; +- mvmvif->csa_misbehave = false; + break; + default: + break; +@@ -4238,18 +4235,6 @@ + if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_CS_MODIFY)) + return; + +- if (chsw->count >= mvmvif->csa_count && chsw->block_tx) { +- if (mvmvif->csa_misbehave) { +- /* Second time, give up on this AP*/ +- iwl_mvm_abort_channel_switch(hw, vif); +- ieee80211_chswitch_done(vif, false); +- mvmvif->csa_misbehave = false; +- return; +- } +- mvmvif->csa_misbehave = true; +- } +- mvmvif->csa_count = chsw->count; +- + IWL_DEBUG_MAC80211(mvm, "Modify CSA on mac %d\n", mvmvif->id); + + WARN_ON(iwl_mvm_send_cmd_pdu(mvm, +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-09-06 01:36:13.968210234 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-09-06 01:45:49.284803166 +0200 +@@ -490,8 +490,6 @@ + bool csa_countdown; + bool csa_failed; + u16 csa_target_freq; +- u16 csa_count; +- u16 csa_misbehave; + struct delayed_work csa_work; + + /* Indicates that we are waiting for a beacon on a new channel */ diff --git a/SOURCES/0076-Revert-iwlwifi-mvm-disconnect-in-case-of-bad-channel.patch b/SOURCES/0076-Revert-iwlwifi-mvm-disconnect-in-case-of-bad-channel.patch new file mode 100644 index 0000000..f363de2 --- /dev/null +++ b/SOURCES/0076-Revert-iwlwifi-mvm-disconnect-in-case-of-bad-channel.patch @@ -0,0 +1,320 @@ +From af78069a8e25027e8ea2d3cb3fdbe545b398db34 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 01:44:00 +0200 +Subject: [PATCH 3/6] Revert "iwlwifi: mvm: disconnect in case of bad channel + switch parameters" + +This reverts commit f67806140220caa3d4337e6c60989b520e13f9a8. +--- + drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 7 +- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 171 +++++++++------------ + drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 1 - + .../net/wireless/intel/iwlwifi/mvm/time-event.c | 5 +- + 4 files changed, 77 insertions(+), 107 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c 2019-09-06 01:36:13.967210247 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c 2019-09-06 01:45:49.470800771 +0200 +@@ -8,7 +8,7 @@ + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH + * Copyright(c) 2015 - 2017 Intel Deutschland GmbH +- * Copyright(c) 2018 - 2019 Intel Corporation ++ * Copyright(c) 2018 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as +@@ -31,7 +31,7 @@ + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH + * Copyright(c) 2015 - 2017 Intel Deutschland GmbH +- * Copyright(c) 2018 - 2019 Intel Corporation ++ * Copyright(c) 2018 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -1631,7 +1631,6 @@ + + rcu_read_lock(); + vif = rcu_dereference(mvm->vif_id_to_mac[mac_id]); +- mvmvif = iwl_mvm_vif_from_mac80211(vif); + + switch (vif->type) { + case NL80211_IFTYPE_AP: +@@ -1640,6 +1639,7 @@ + csa_vif != vif)) + goto out_unlock; + ++ mvmvif = iwl_mvm_vif_from_mac80211(csa_vif); + csa_id = FW_CMD_ID_AND_COLOR(mvmvif->id, mvmvif->color); + if (WARN(csa_id != id_n_color, + "channel switch noa notification on unexpected vif (csa_vif=%d, notif=%d)", +@@ -1660,7 +1660,6 @@ + return; + case NL80211_IFTYPE_STATION: + iwl_mvm_csa_client_absent(mvm, vif); +- cancel_delayed_work(&mvmvif->csa_work); + ieee80211_chswitch_done(vif, true); + break; + default: +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-06 01:45:49.284803166 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-06 01:45:49.471800758 +0200 +@@ -1337,91 +1337,6 @@ + return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, len, &cmd); + } + +-static int iwl_mvm_post_channel_switch(struct ieee80211_hw *hw, +- struct ieee80211_vif *vif) +-{ +- struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); +- struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); +- int ret; +- +- mutex_lock(&mvm->mutex); +- +- if (mvmvif->csa_failed) { +- mvmvif->csa_failed = false; +- ret = -EIO; +- goto out_unlock; +- } +- +- if (vif->type == NL80211_IFTYPE_STATION) { +- struct iwl_mvm_sta *mvmsta; +- +- mvmvif->csa_bcn_pending = false; +- mvmsta = iwl_mvm_sta_from_staid_protected(mvm, +- mvmvif->ap_sta_id); +- +- if (WARN_ON(!mvmsta)) { +- ret = -EIO; +- goto out_unlock; +- } +- +- iwl_mvm_sta_modify_disable_tx(mvm, mvmsta, false); +- +- iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); +- +- ret = iwl_mvm_enable_beacon_filter(mvm, vif, 0); +- if (ret) +- goto out_unlock; +- +- iwl_mvm_stop_session_protection(mvm, vif); +- } +- +- mvmvif->ps_disabled = false; +- +- ret = iwl_mvm_power_update_ps(mvm); +- +-out_unlock: +- mutex_unlock(&mvm->mutex); +- +- return ret; +-} +- +-static void iwl_mvm_abort_channel_switch(struct ieee80211_hw *hw, +- struct ieee80211_vif *vif) +-{ +- struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); +- struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); +- struct iwl_chan_switch_te_cmd cmd = { +- .mac_id = cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, +- mvmvif->color)), +- .action = cpu_to_le32(FW_CTXT_ACTION_REMOVE), +- }; +- +- IWL_DEBUG_MAC80211(mvm, "Abort CSA on mac %d\n", mvmvif->id); +- +- mutex_lock(&mvm->mutex); +- WARN_ON(iwl_mvm_send_cmd_pdu(mvm, +- WIDE_ID(MAC_CONF_GROUP, +- CHANNEL_SWITCH_TIME_EVENT_CMD), +- 0, sizeof(cmd), &cmd)); +- mutex_unlock(&mvm->mutex); +- +- WARN_ON(iwl_mvm_post_channel_switch(hw, vif)); +-} +- +-static void iwl_mvm_channel_switch_disconnect_wk(struct work_struct *wk) +-{ +- struct iwl_mvm *mvm; +- struct iwl_mvm_vif *mvmvif; +- struct ieee80211_vif *vif; +- +- mvmvif = container_of(wk, struct iwl_mvm_vif, csa_work.work); +- vif = container_of((void *)mvmvif, struct ieee80211_vif, drv_priv); +- mvm = mvmvif->mvm; +- +- iwl_mvm_abort_channel_switch(mvm->hw, vif); +- ieee80211_chswitch_done(vif, false); +-} +- + static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw, + struct ieee80211_vif *vif) + { +@@ -1548,8 +1463,6 @@ + } + + iwl_mvm_tcm_add_vif(mvm, vif); +- INIT_DELAYED_WORK(&mvmvif->csa_work, +- iwl_mvm_channel_switch_disconnect_wk); + + if (vif->type == NL80211_IFTYPE_MONITOR) + mvm->monitor_on = true; +@@ -4106,7 +4019,6 @@ + 0, sizeof(cmd), &cmd); + } + +-#define IWL_MAX_CSA_BLOCK_TX 1500 + static int iwl_mvm_pre_channel_switch(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_channel_switch *chsw) +@@ -4171,18 +4083,8 @@ + ((vif->bss_conf.beacon_int * (chsw->count - 1) - + IWL_MVM_CHANNEL_SWITCH_TIME_CLIENT) * 1024); + +- if (chsw->block_tx) { ++ if (chsw->block_tx) + iwl_mvm_csa_client_absent(mvm, vif); +- /* +- * In case of undetermined / long time with immediate +- * quiet monitor status to gracefully disconnect +- */ +- if (!chsw->count || +- chsw->count * vif->bss_conf.beacon_int > +- IWL_MAX_CSA_BLOCK_TX) +- schedule_delayed_work(&mvmvif->csa_work, +- msecs_to_jiffies(IWL_MAX_CSA_BLOCK_TX)); +- } + + if (mvmvif->bf_data.bf_enabled) { + ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0); +@@ -4217,6 +4119,54 @@ + return ret; + } + ++static int iwl_mvm_post_channel_switch(struct ieee80211_hw *hw, ++ struct ieee80211_vif *vif) ++{ ++ struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); ++ struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); ++ int ret; ++ ++ mutex_lock(&mvm->mutex); ++ ++ if (mvmvif->csa_failed) { ++ mvmvif->csa_failed = false; ++ ret = -EIO; ++ goto out_unlock; ++ } ++ ++ if (vif->type == NL80211_IFTYPE_STATION) { ++ struct iwl_mvm_sta *mvmsta; ++ ++ mvmvif->csa_bcn_pending = false; ++ mvmsta = iwl_mvm_sta_from_staid_protected(mvm, ++ mvmvif->ap_sta_id); ++ ++ if (WARN_ON(!mvmsta)) { ++ ret = -EIO; ++ goto out_unlock; ++ } ++ ++ iwl_mvm_sta_modify_disable_tx(mvm, mvmsta, false); ++ ++ iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); ++ ++ ret = iwl_mvm_enable_beacon_filter(mvm, vif, 0); ++ if (ret) ++ goto out_unlock; ++ ++ iwl_mvm_stop_session_protection(mvm, vif); ++ } ++ ++ mvmvif->ps_disabled = false; ++ ++ ret = iwl_mvm_power_update_ps(mvm); ++ ++out_unlock: ++ mutex_unlock(&mvm->mutex); ++ ++ return ret; ++} ++ + static void iwl_mvm_channel_switch_rx_beacon(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_channel_switch *chsw) +@@ -4243,6 +4193,29 @@ + CMD_ASYNC, sizeof(cmd), &cmd)); + } + ++static void iwl_mvm_abort_channel_switch(struct ieee80211_hw *hw, ++ struct ieee80211_vif *vif) ++{ ++ struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); ++ struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); ++ struct iwl_chan_switch_te_cmd cmd = { ++ .mac_id = cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, ++ mvmvif->color)), ++ .action = cpu_to_le32(FW_CTXT_ACTION_REMOVE), ++ }; ++ ++ IWL_DEBUG_MAC80211(mvm, "Abort CSA on mac %d\n", mvmvif->id); ++ ++ mutex_lock(&mvm->mutex); ++ WARN_ON(iwl_mvm_send_cmd_pdu(mvm, ++ WIDE_ID(MAC_CONF_GROUP, ++ CHANNEL_SWITCH_TIME_EVENT_CMD), ++ 0, sizeof(cmd), &cmd)); ++ mutex_unlock(&mvm->mutex); ++ ++ WARN_ON(iwl_mvm_post_channel_switch(hw, vif)); ++} ++ + static void iwl_mvm_flush_no_vif(struct iwl_mvm *mvm, u32 queues, bool drop) + { + int i; +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-09-06 01:45:49.284803166 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-09-06 01:45:49.471800758 +0200 +@@ -490,7 +490,6 @@ + bool csa_countdown; + bool csa_failed; + u16 csa_target_freq; +- struct delayed_work csa_work; + + /* Indicates that we are waiting for a beacon on a new channel */ + bool csa_bcn_pending; +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c 2019-06-27 14:54:04.140678253 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c 2019-09-06 01:45:49.472800745 +0200 +@@ -8,7 +8,7 @@ + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2017 Intel Deutschland GmbH +- * Copyright(c) 2018 - 2019 Intel Corporation ++ * Copyright(c) 2018 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as +@@ -31,7 +31,7 @@ + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2017 Intel Deutschland GmbH +- * Copyright(c) 2018 - 2019 Intel Corporation ++ * Copyright(c) 2018 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -234,7 +234,6 @@ + break; + } + iwl_mvm_csa_client_absent(mvm, te_data->vif); +- cancel_delayed_work(&mvmvif->csa_work); + ieee80211_chswitch_done(te_data->vif, true); + break; + default: diff --git a/SOURCES/0077-Revert-iwlwifi-mvm-notify-FW-on-quiet-mode-in-CSA.patch b/SOURCES/0077-Revert-iwlwifi-mvm-notify-FW-on-quiet-mode-in-CSA.patch new file mode 100644 index 0000000..d9183e9 --- /dev/null +++ b/SOURCES/0077-Revert-iwlwifi-mvm-notify-FW-on-quiet-mode-in-CSA.patch @@ -0,0 +1,30 @@ +From a6926232ac2d027a9cb7edc5c1880944fed31bb9 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 01:44:14 +0200 +Subject: [PATCH 4/6] Revert "iwlwifi: mvm: notify FW on quiet mode in CSA" + +This reverts commit 77738865eb629e51e4135e9234016301da04c356. +--- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 -- + 1 file changed, 2 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-06 01:45:49.471800758 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-06 01:45:49.666798248 +0200 +@@ -4008,7 +4008,6 @@ + .action = cpu_to_le32(FW_CTXT_ACTION_ADD), + .tsf = cpu_to_le32(chsw->timestamp), + .cs_count = chsw->count, +- .cs_mode = chsw->block_tx, + }; + + lockdep_assert_held(&mvm->mutex); +@@ -4179,7 +4178,6 @@ + .action = cpu_to_le32(FW_CTXT_ACTION_MODIFY), + .tsf = cpu_to_le32(chsw->timestamp), + .cs_count = chsw->count, +- .cs_mode = chsw->block_tx, + }; + + if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_CS_MODIFY)) diff --git a/SOURCES/0078-Revert-iwlwifi-mvm-track-CSA-beacons.patch b/SOURCES/0078-Revert-iwlwifi-mvm-track-CSA-beacons.patch new file mode 100644 index 0000000..611de53 --- /dev/null +++ b/SOURCES/0078-Revert-iwlwifi-mvm-track-CSA-beacons.patch @@ -0,0 +1,92 @@ +From 1cc8caa4a0763344aaed1b7cbefd5f7e999db91b Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 01:44:58 +0200 +Subject: [PATCH 5/6] Revert "iwlwifi: mvm: track CSA beacons" + +This reverts commit c37763d22d07049cc13a088d8622d25d2a7d48de. +--- + drivers/net/wireless/intel/iwlwifi/fw/file.h | 2 -- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 29 ++--------------------- + 2 files changed, 2 insertions(+), 29 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/fw/file.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/file.h 2019-09-06 01:36:11.332244171 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/file.h 2019-09-06 01:45:49.833796098 +0200 +@@ -363,7 +363,6 @@ + * IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD: firmware supports CSA command + * @IWL_UCODE_TLV_CAPA_ULTRA_HB_CHANNELS: firmware supports ultra high band + * (6 GHz). +- * @IWL_UCODE_TLV_CAPA_CS_MODIFY: firmware supports modify action CSA command + * @IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE: extended DTS measurement + * @IWL_UCODE_TLV_CAPA_SHORT_PM_TIMEOUTS: supports short PM timeouts + * @IWL_UCODE_TLV_CAPA_BT_MPLUT_SUPPORT: supports bt-coex Multi-priority LUT +@@ -429,7 +428,6 @@ + IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD = (__force iwl_ucode_tlv_capa_t)46, + IWL_UCODE_TLV_CAPA_ULTRA_HB_CHANNELS = (__force iwl_ucode_tlv_capa_t)48, + IWL_UCODE_TLV_CAPA_FTM_CALIBRATED = (__force iwl_ucode_tlv_capa_t)47, +- IWL_UCODE_TLV_CAPA_CS_MODIFY = (__force iwl_ucode_tlv_capa_t)49, + + /* set 2 */ + IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE = (__force iwl_ucode_tlv_capa_t)64, +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-06 01:45:49.666798248 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-06 01:45:49.834796085 +0200 +@@ -8,7 +8,7 @@ + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 - 2017 Intel Deutschland GmbH +- * Copyright(c) 2018 - 2019 Intel Corporation ++ * Copyright(c) 2018 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as +@@ -31,6 +31,7 @@ + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 - 2017 Intel Deutschland GmbH ++ * Copyright(c) 2018 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -4166,31 +4167,6 @@ + return ret; + } + +-static void iwl_mvm_channel_switch_rx_beacon(struct ieee80211_hw *hw, +- struct ieee80211_vif *vif, +- struct ieee80211_channel_switch *chsw) +-{ +- struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); +- struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); +- struct iwl_chan_switch_te_cmd cmd = { +- .mac_id = cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, +- mvmvif->color)), +- .action = cpu_to_le32(FW_CTXT_ACTION_MODIFY), +- .tsf = cpu_to_le32(chsw->timestamp), +- .cs_count = chsw->count, +- }; +- +- if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_CS_MODIFY)) +- return; +- +- IWL_DEBUG_MAC80211(mvm, "Modify CSA on mac %d\n", mvmvif->id); +- +- WARN_ON(iwl_mvm_send_cmd_pdu(mvm, +- WIDE_ID(MAC_CONF_GROUP, +- CHANNEL_SWITCH_TIME_EVENT_CMD), +- CMD_ASYNC, sizeof(cmd), &cmd)); +-} +- + static void iwl_mvm_abort_channel_switch(struct ieee80211_hw *hw, + struct ieee80211_vif *vif) + { +@@ -4590,7 +4566,6 @@ + .pre_channel_switch = iwl_mvm_pre_channel_switch, + .post_channel_switch = iwl_mvm_post_channel_switch, + .abort_channel_switch = iwl_mvm_abort_channel_switch, +- .channel_switch_rx_beacon = iwl_mvm_channel_switch_rx_beacon, + + .tdls_channel_switch = iwl_mvm_tdls_channel_switch, + .tdls_cancel_channel_switch = iwl_mvm_tdls_cancel_channel_switch, diff --git a/SOURCES/0079-Revert-iwlwifi-mvm-implement-CSA-abort.patch b/SOURCES/0079-Revert-iwlwifi-mvm-implement-CSA-abort.patch new file mode 100644 index 0000000..ca6c98f --- /dev/null +++ b/SOURCES/0079-Revert-iwlwifi-mvm-implement-CSA-abort.patch @@ -0,0 +1,52 @@ +From 809ebadf870b7291ce9d0e80d5fb4bbba9c83e2a Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 01:45:07 +0200 +Subject: [PATCH 6/6] Revert "iwlwifi: mvm: implement CSA abort" + +This reverts commit 792211266379ea6885d97c55b8d73e1bfecb7d54. +--- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 24 ----------------------- + 1 file changed, 24 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-06 01:45:49.834796085 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-06 01:45:50.011793806 +0200 +@@ -4167,29 +4167,6 @@ + return ret; + } + +-static void iwl_mvm_abort_channel_switch(struct ieee80211_hw *hw, +- struct ieee80211_vif *vif) +-{ +- struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); +- struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); +- struct iwl_chan_switch_te_cmd cmd = { +- .mac_id = cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, +- mvmvif->color)), +- .action = cpu_to_le32(FW_CTXT_ACTION_REMOVE), +- }; +- +- IWL_DEBUG_MAC80211(mvm, "Abort CSA on mac %d\n", mvmvif->id); +- +- mutex_lock(&mvm->mutex); +- WARN_ON(iwl_mvm_send_cmd_pdu(mvm, +- WIDE_ID(MAC_CONF_GROUP, +- CHANNEL_SWITCH_TIME_EVENT_CMD), +- 0, sizeof(cmd), &cmd)); +- mutex_unlock(&mvm->mutex); +- +- WARN_ON(iwl_mvm_post_channel_switch(hw, vif)); +-} +- + static void iwl_mvm_flush_no_vif(struct iwl_mvm *mvm, u32 queues, bool drop) + { + int i; +@@ -4565,7 +4542,6 @@ + .channel_switch = iwl_mvm_channel_switch, + .pre_channel_switch = iwl_mvm_pre_channel_switch, + .post_channel_switch = iwl_mvm_post_channel_switch, +- .abort_channel_switch = iwl_mvm_abort_channel_switch, + + .tdls_channel_switch = iwl_mvm_tdls_channel_switch, + .tdls_cancel_channel_switch = iwl_mvm_tdls_cancel_channel_switch, diff --git a/SOURCES/0080-Revert-iwlwifi-nvm-parse-use-struct_size-in-kzalloc.patch b/SOURCES/0080-Revert-iwlwifi-nvm-parse-use-struct_size-in-kzalloc.patch new file mode 100644 index 0000000..b00a742 --- /dev/null +++ b/SOURCES/0080-Revert-iwlwifi-nvm-parse-use-struct_size-in-kzalloc.patch @@ -0,0 +1,48 @@ +From 2d91368aef2a73d37acdea30cd7086356e81ccc5 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 01:50:55 +0200 +Subject: [PATCH 1/7] Revert "iwlwifi: nvm-parse: use struct_size() in + kzalloc()" + +This reverts commit 6b367c9f88b0813f6a557e688b665324499a159e. +--- + drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-09-06 01:47:45.924301459 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-09-06 01:54:58.093737377 +0200 +@@ -748,13 +748,15 @@ + const __le16 *ch_section; + + if (cfg->nvm_type != IWL_NVM_EXT) +- data = kzalloc(struct_size(data, channels, +- IWL_NVM_NUM_CHANNELS), +- GFP_KERNEL); ++ data = kzalloc(sizeof(*data) + ++ sizeof(struct ieee80211_channel) * ++ IWL_NVM_NUM_CHANNELS, ++ GFP_KERNEL); + else +- data = kzalloc(struct_size(data, channels, +- IWL_NVM_NUM_CHANNELS_EXT), +- GFP_KERNEL); ++ data = kzalloc(sizeof(*data) + ++ sizeof(struct ieee80211_channel) * ++ IWL_NVM_NUM_CHANNELS_EXT, ++ GFP_KERNEL); + if (!data) + return NULL; + +@@ -1256,7 +1258,9 @@ + if (empty_otp) + IWL_INFO(trans, "OTP is empty\n"); + +- nvm = kzalloc(struct_size(nvm, channels, IWL_NUM_CHANNELS), GFP_KERNEL); ++ nvm = kzalloc(sizeof(*nvm) + ++ sizeof(struct ieee80211_channel) * IWL_NUM_CHANNELS, ++ GFP_KERNEL); + if (!nvm) { + ret = -ENOMEM; + goto out; diff --git a/SOURCES/0081-Revert-iwlwifi-support-new-NVM-response-API.patch b/SOURCES/0081-Revert-iwlwifi-support-new-NVM-response-API.patch new file mode 100644 index 0000000..764f639 --- /dev/null +++ b/SOURCES/0081-Revert-iwlwifi-support-new-NVM-response-API.patch @@ -0,0 +1,248 @@ +From f374231a3a0dcfb8c2c6d33b853b17700d899cc0 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 01:52:09 +0200 +Subject: [PATCH 4/7] Revert "iwlwifi: support new NVM response API" + +This reverts commit 2785ce008e3b52b5a8f9a5bef68b8306d3e37b86. +--- + .../net/wireless/intel/iwlwifi/fw/api/nvm-reg.h | 39 +++--------------- + drivers/net/wireless/intel/iwlwifi/fw/file.h | 3 -- + drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 46 ++++++---------------- + 3 files changed, 19 insertions(+), 69 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h 2019-06-27 14:54:04.121678482 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h 2019-09-06 01:58:30.665000571 +0200 +@@ -8,7 +8,7 @@ + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 - 2017 Intel Deutschland GmbH +- * Copyright(C) 2018 - 2019 Intel Corporation ++ * Copyright (C) 2018 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as +@@ -31,7 +31,7 @@ + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 - 2017 Intel Deutschland GmbH +- * Copyright(C) 2018 - 2019 Intel Corporation ++ * Copyright (C) 2018 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -233,8 +233,7 @@ + __le32 rx_chains; + } __packed; /* REGULATORY_NVM_GET_INFO_PHY_SKU_SECTION_S_VER_1 */ + +-#define IWL_NUM_CHANNELS_V1 51 +-#define IWL_NUM_CHANNELS 110 ++#define IWL_NUM_CHANNELS (51) + + /** + * struct iwl_nvm_get_info_regulatory - regulatory information +@@ -242,39 +241,13 @@ + * @channel_profile: regulatory data of this channel + * @reserved: reserved + */ +-struct iwl_nvm_get_info_regulatory_v1 { ++struct iwl_nvm_get_info_regulatory { + __le32 lar_enabled; +- __le16 channel_profile[IWL_NUM_CHANNELS_V1]; ++ __le16 channel_profile[IWL_NUM_CHANNELS]; + __le16 reserved; + } __packed; /* REGULATORY_NVM_GET_INFO_REGULATORY_S_VER_1 */ + + /** +- * struct iwl_nvm_get_info_regulatory - regulatory information +- * @lar_enabled: is LAR enabled +- * @n_channels: number of valid channels in the array +- * @channel_profile: regulatory data of this channel +- */ +-struct iwl_nvm_get_info_regulatory { +- __le32 lar_enabled; +- __le32 n_channels; +- __le32 channel_profile[IWL_NUM_CHANNELS]; +-} __packed; /* REGULATORY_NVM_GET_INFO_REGULATORY_S_VER_2 */ +- +-/** +- * struct iwl_nvm_get_info_rsp_v3 - response to get NVM data +- * @general: general NVM data +- * @mac_sku: data relating to MAC sku +- * @phy_sku: data relating to PHY sku +- * @regulatory: regulatory data +- */ +-struct iwl_nvm_get_info_rsp_v3 { +- struct iwl_nvm_get_info_general general; +- struct iwl_nvm_get_info_sku mac_sku; +- struct iwl_nvm_get_info_phy phy_sku; +- struct iwl_nvm_get_info_regulatory_v1 regulatory; +-} __packed; /* REGULATORY_NVM_GET_INFO_RSP_API_S_VER_3 */ +- +-/** + * struct iwl_nvm_get_info_rsp - response to get NVM data + * @general: general NVM data + * @mac_sku: data relating to MAC sku +@@ -286,7 +259,7 @@ + struct iwl_nvm_get_info_sku mac_sku; + struct iwl_nvm_get_info_phy phy_sku; + struct iwl_nvm_get_info_regulatory regulatory; +-} __packed; /* REGULATORY_NVM_GET_INFO_RSP_API_S_VER_4 */ ++} __packed; /* REGULATORY_NVM_GET_INFO_RSP_API_S_VER_3 */ + + /** + * struct iwl_nvm_access_complete_cmd - NVM_ACCESS commands are completed +Index: src/drivers/net/wireless/intel/iwlwifi/fw/file.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/file.h 2019-09-06 01:47:46.211297764 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/file.h 2019-09-06 01:58:30.666000559 +0200 +@@ -275,8 +275,6 @@ + * version of the beacon notification. + * @IWL_UCODE_TLV_API_BEACON_FILTER_V4: This ucode supports v4 of + * BEACON_FILTER_CONFIG_API_S_VER_4. +- * @IWL_UCODE_TLV_API_REGULATORY_NVM_INFO: This ucode supports v4 of +- * REGULATORY_NVM_GET_INFO_RSP_API_S. + * @IWL_UCODE_TLV_API_FTM_NEW_RANGE_REQ: This ucode supports v7 of + * LOCATION_RANGE_REQ_CMD_API_S and v6 of LOCATION_RANGE_RESP_NTFY_API_S. + * @IWL_UCODE_TLV_API_SCAN_OFFLOAD_CHANS: This ucode supports v2 of +@@ -308,7 +306,6 @@ + IWL_UCODE_TLV_API_REDUCE_TX_POWER = (__force iwl_ucode_tlv_api_t)45, + IWL_UCODE_TLV_API_SHORT_BEACON_NOTIF = (__force iwl_ucode_tlv_api_t)46, + IWL_UCODE_TLV_API_BEACON_FILTER_V4 = (__force iwl_ucode_tlv_api_t)47, +- IWL_UCODE_TLV_API_REGULATORY_NVM_INFO = (__force iwl_ucode_tlv_api_t)48, + IWL_UCODE_TLV_API_FTM_NEW_RANGE_REQ = (__force iwl_ucode_tlv_api_t)49, + IWL_UCODE_TLV_API_SCAN_OFFLOAD_CHANS = (__force iwl_ucode_tlv_api_t)50, + IWL_UCODE_TLV_API_MBSSID_HE = (__force iwl_ucode_tlv_api_t)52, +Index: src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-09-06 01:57:27.386815264 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-09-06 01:58:30.666000559 +0200 +@@ -226,7 +226,7 @@ + }; + + static inline void iwl_nvm_print_channel_flags(struct device *dev, u32 level, +- int chan, u32 flags) ++ int chan, u16 flags) + { + #define CHECK_AND_PRINT_I(x) \ + ((flags & NVM_CHANNEL_##x) ? " " #x : "") +@@ -257,7 +257,7 @@ + } + + static u32 iwl_get_channel_flags(u8 ch_num, int ch_idx, bool is_5ghz, +- u32 nvm_flags, const struct iwl_cfg *cfg) ++ u16 nvm_flags, const struct iwl_cfg *cfg) + { + u32 flags = IEEE80211_CHAN_NO_HT40; + +@@ -301,13 +301,13 @@ + + static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg, + struct iwl_nvm_data *data, +- const void * const nvm_ch_flags, +- u32 sbands_flags, bool v4) ++ const __le16 * const nvm_ch_flags, ++ u32 sbands_flags) + { + int ch_idx; + int n_channels = 0; + struct ieee80211_channel *channel; +- u32 ch_flags; ++ u16 ch_flags; + int num_of_ch, num_2ghz_channels = NUM_2GHZ_CHANNELS; + const u16 *nvm_chan; + +@@ -325,12 +325,7 @@ + for (ch_idx = 0; ch_idx < num_of_ch; ch_idx++) { + bool is_5ghz = (ch_idx >= num_2ghz_channels); + +- if (v4) +- ch_flags = +- __le32_to_cpup((__le32 *)nvm_ch_flags + ch_idx); +- else +- ch_flags = +- __le16_to_cpup((__le16 *)nvm_ch_flags + ch_idx); ++ ch_flags = __le16_to_cpup(nvm_ch_flags + ch_idx); + + if (is_5ghz && !data->sku_cap_band_52ghz_enable) + continue; +@@ -482,15 +477,15 @@ + + static void iwl_init_sbands(struct device *dev, const struct iwl_cfg *cfg, + struct iwl_nvm_data *data, +- const void *nvm_ch_flags, u8 tx_chains, +- u8 rx_chains, u32 sbands_flags, bool v4) ++ const __le16 *nvm_ch_flags, u8 tx_chains, ++ u8 rx_chains, u32 sbands_flags) + { + int n_channels; + int n_used = 0; + struct ieee80211_supported_band *sband; + + n_channels = iwl_init_channel_map(dev, cfg, data, nvm_ch_flags, +- sbands_flags, v4); ++ sbands_flags); + sband = &data->bands[NL80211_BAND_2GHZ]; + sband->band = NL80211_BAND_2GHZ; + sband->bitrates = &iwl_cfg80211_rates[RATES_24_OFFS]; +@@ -823,7 +818,7 @@ + sbands_flags |= IWL_NVM_SBANDS_FLAGS_NO_WIDE_IN_5GHZ; + + iwl_init_sbands(dev, cfg, data, ch_section, tx_chains, rx_chains, +- sbands_flags, false); ++ sbands_flags); + data->calib_version = 255; + + return data; +@@ -1214,6 +1209,7 @@ + const struct iwl_fw *fw) + { + struct iwl_nvm_get_info cmd = {}; ++ struct iwl_nvm_get_info_rsp *rsp; + struct iwl_nvm_data *nvm; + struct iwl_host_cmd hcmd = { + .flags = CMD_WANT_SKB | CMD_SEND_IN_RFKILL, +@@ -1228,24 +1224,12 @@ + bool empty_otp; + u32 mac_flags; + u32 sbands_flags = 0; +- /* +- * All the values in iwl_nvm_get_info_rsp v4 are the same as +- * in v3, except for the channel profile part of the +- * regulatory. So we can just access the new struct, with the +- * exception of the latter. +- */ +- struct iwl_nvm_get_info_rsp *rsp; +- struct iwl_nvm_get_info_rsp_v3 *rsp_v3; +- bool v4 = fw_has_api(&fw->ucode_capa, +- IWL_UCODE_TLV_API_REGULATORY_NVM_INFO); +- size_t rsp_size = v4 ? sizeof(*rsp) : sizeof(*rsp_v3); +- void *channel_profile; + + ret = iwl_trans_send_cmd(trans, &hcmd); + if (ret) + return ERR_PTR(ret); + +- if (WARN(iwl_rx_packet_payload_len(hcmd.resp_pkt) != rsp_size, ++ if (WARN(iwl_rx_packet_payload_len(hcmd.resp_pkt) != sizeof(*rsp), + "Invalid payload len in NVM response from FW %d", + iwl_rx_packet_payload_len(hcmd.resp_pkt))) { + ret = -EINVAL; +@@ -1307,15 +1291,11 @@ + sbands_flags |= IWL_NVM_SBANDS_FLAGS_LAR; + } + +- rsp_v3 = (void *)rsp; +- channel_profile = v4 ? (void *)rsp->regulatory.channel_profile : +- (void *)rsp_v3->regulatory.channel_profile; +- + iwl_init_sbands(trans->dev, trans->cfg, nvm, + channel_profile, + nvm->valid_tx_ant & fw->valid_tx_ant, + nvm->valid_rx_ant & fw->valid_rx_ant, +- sbands_flags, v4); ++ sbands_flags); + + iwl_free_resp(&hcmd); + return nvm; diff --git a/SOURCES/0082-Revert-iwlwifi-add-support-for-6-7-GHz-channels.patch b/SOURCES/0082-Revert-iwlwifi-add-support-for-6-7-GHz-channels.patch new file mode 100644 index 0000000..32d9d0e --- /dev/null +++ b/SOURCES/0082-Revert-iwlwifi-add-support-for-6-7-GHz-channels.patch @@ -0,0 +1,211 @@ +From 74cd2cdf235fbba685e8518b87a1035bc580cb60 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 01:53:36 +0200 +Subject: [PATCH 5/7] Revert "iwlwifi: add support for 6-7 GHz channels" + +This reverts commit b15ef67c0e6b51be0f37985261ca53f9b477e816. +--- + drivers/net/wireless/intel/iwlwifi/cfg/22000.c | 2 - + drivers/net/wireless/intel/iwlwifi/iwl-config.h | 4 +- + drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 74 +++++++++------------- + 3 files changed, 31 insertions(+), 49 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/cfg/22000.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/cfg/22000.c 2019-06-27 14:54:04.111678603 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/cfg/22000.c 2019-09-06 01:58:30.872997894 +0200 +@@ -432,14 +432,12 @@ + const struct iwl_cfg iwlax210_2ax_cfg_so_gf_a0 = { + .name = "Intel(R) Wi-Fi 7 AX211 160MHz", + .fw_name_pre = IWL_22000_SO_A_GF_A_FW_PRE, +- .uhb_supported = true, + IWL_DEVICE_AX210, + }; + + const struct iwl_cfg iwlax210_2ax_cfg_ty_gf_a0 = { + .name = "Intel(R) Wi-Fi 7 AX210 160MHz", + .fw_name_pre = IWL_22000_TY_A_GF_A_FW_PRE, +- .uhb_supported = true, + IWL_DEVICE_AX210, + }; + +Index: src/drivers/net/wireless/intel/iwlwifi/iwl-config.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/iwl-config.h 2019-06-27 14:54:04.127678410 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/iwl-config.h 2019-09-06 01:58:30.872997894 +0200 +@@ -383,7 +383,6 @@ + * @bisr_workaround: BISR hardware workaround (for 22260 series devices) + * @min_txq_size: minimum number of slots required in a TX queue + * @umac_prph_offset: offset to add to UMAC periphery address +- * @uhb_supported: ultra high band channels supported + * @min_256_ba_txq_size: minimum number of slots required in a TX queue which + * supports 256 BA aggregation + * +@@ -436,8 +435,7 @@ + gen2:1, + cdb:1, + dbgc_supported:1, +- bisr_workaround:1, +- uhb_supported:1; ++ bisr_workaround:1; + u8 valid_tx_ant; + u8 valid_rx_ant; + u8 non_shared_ant; +Index: src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-09-06 01:58:30.666000559 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-09-06 01:58:30.873997881 +0200 +@@ -130,7 +130,7 @@ + /* + * These are the channel numbers in the order that they are stored in the NVM + */ +-static const u16 iwl_nvm_channels[] = { ++static const u8 iwl_nvm_channels[] = { + /* 2.4 GHz */ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + /* 5 GHz */ +@@ -139,7 +139,7 @@ + 149, 153, 157, 161, 165 + }; + +-static const u16 iwl_ext_nvm_channels[] = { ++static const u8 iwl_ext_nvm_channels[] = { + /* 2.4 GHz */ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + /* 5 GHz */ +@@ -148,27 +148,14 @@ + 149, 153, 157, 161, 165, 169, 173, 177, 181 + }; + +-static const u16 iwl_uhb_nvm_channels[] = { +- /* 2.4 GHz */ +- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, +- /* 5 GHz */ +- 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, +- 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, +- 149, 153, 157, 161, 165, 169, 173, 177, 181, +- /* 6-7 GHz */ +- 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 233, 237, 241, +- 245, 249, 253, 257, 261, 265, 269, 273, 277, 281, 285, 289, 293, 297, +- 301, 305, 309, 313, 317, 321, 325, 329, 333, 337, 341, 345, 349, 353, +- 357, 361, 365, 369, 373, 377, 381, 385, 389, 393, 397, 401, 405, 409, +- 413, 417, 421 +-}; +- + #define IWL_NVM_NUM_CHANNELS ARRAY_SIZE(iwl_nvm_channels) + #define IWL_NVM_NUM_CHANNELS_EXT ARRAY_SIZE(iwl_ext_nvm_channels) +-#define IWL_NVM_NUM_CHANNELS_UHB ARRAY_SIZE(iwl_uhb_nvm_channels) + #define NUM_2GHZ_CHANNELS 14 ++#define NUM_2GHZ_CHANNELS_EXT 14 + #define FIRST_2GHZ_HT_MINUS 5 + #define LAST_2GHZ_HT_PLUS 9 ++#define LAST_5GHZ_HT 165 ++#define LAST_5GHZ_HT_FAMILY_8000 181 + #define N_HW_ADDR_MASK 0xF + + /* rate data (static) */ +@@ -260,13 +247,17 @@ + u16 nvm_flags, const struct iwl_cfg *cfg) + { + u32 flags = IEEE80211_CHAN_NO_HT40; ++ u32 last_5ghz_ht = LAST_5GHZ_HT; ++ ++ if (cfg->nvm_type == IWL_NVM_EXT) ++ last_5ghz_ht = LAST_5GHZ_HT_FAMILY_8000; + + if (!is_5ghz && (nvm_flags & NVM_CHANNEL_40MHZ)) { + if (ch_num <= LAST_2GHZ_HT_PLUS) + flags &= ~IEEE80211_CHAN_NO_HT40PLUS; + if (ch_num >= FIRST_2GHZ_HT_MINUS) + flags &= ~IEEE80211_CHAN_NO_HT40MINUS; +- } else if (nvm_flags & NVM_CHANNEL_40MHZ) { ++ } else if (ch_num <= last_5ghz_ht && (nvm_flags & NVM_CHANNEL_40MHZ)) { + if ((ch_idx - NUM_2GHZ_CHANNELS) % 2 == 0) + flags &= ~IEEE80211_CHAN_NO_HT40PLUS; + else +@@ -308,18 +299,17 @@ + int n_channels = 0; + struct ieee80211_channel *channel; + u16 ch_flags; +- int num_of_ch, num_2ghz_channels = NUM_2GHZ_CHANNELS; +- const u16 *nvm_chan; ++ int num_of_ch, num_2ghz_channels; ++ const u8 *nvm_chan; + +- if (cfg->uhb_supported) { +- num_of_ch = IWL_NVM_NUM_CHANNELS_UHB; +- nvm_chan = iwl_uhb_nvm_channels; +- } else if (cfg->nvm_type == IWL_NVM_EXT) { +- num_of_ch = IWL_NVM_NUM_CHANNELS_EXT; +- nvm_chan = iwl_ext_nvm_channels; +- } else { ++ if (cfg->nvm_type != IWL_NVM_EXT) { + num_of_ch = IWL_NVM_NUM_CHANNELS; +- nvm_chan = iwl_nvm_channels; ++ nvm_chan = &iwl_nvm_channels[0]; ++ num_2ghz_channels = NUM_2GHZ_CHANNELS; ++ } else { ++ num_of_ch = IWL_NVM_NUM_CHANNELS_EXT; ++ nvm_chan = &iwl_ext_nvm_channels[0]; ++ num_2ghz_channels = NUM_2GHZ_CHANNELS_EXT; + } + + for (ch_idx = 0; ch_idx < num_of_ch; ch_idx++) { +@@ -825,11 +815,15 @@ + } + IWL_EXPORT_SYMBOL(iwl_parse_nvm_data); + +-static u32 iwl_nvm_get_regdom_bw_flags(const u16 *nvm_chan, ++static u32 iwl_nvm_get_regdom_bw_flags(const u8 *nvm_chan, + int ch_idx, u16 nvm_flags, + const struct iwl_cfg *cfg) + { + u32 flags = NL80211_RRF_NO_HT40; ++ u32 last_5ghz_ht = LAST_5GHZ_HT; ++ ++ if (cfg->nvm_type == IWL_NVM_EXT) ++ last_5ghz_ht = LAST_5GHZ_HT_FAMILY_8000; + + if (ch_idx < NUM_2GHZ_CHANNELS && + (nvm_flags & NVM_CHANNEL_40MHZ)) { +@@ -837,7 +831,8 @@ + flags &= ~NL80211_RRF_NO_HT40PLUS; + if (nvm_chan[ch_idx] >= FIRST_2GHZ_HT_MINUS) + flags &= ~NL80211_RRF_NO_HT40MINUS; +- } else if (nvm_flags & NVM_CHANNEL_40MHZ) { ++ } else if (nvm_chan[ch_idx] <= last_5ghz_ht && ++ (nvm_flags & NVM_CHANNEL_40MHZ)) { + if ((ch_idx - NUM_2GHZ_CHANNELS) % 2 == 0) + flags &= ~NL80211_RRF_NO_HT40PLUS; + else +@@ -881,7 +876,8 @@ + int ch_idx; + u16 ch_flags; + u32 reg_rule_flags, prev_reg_rule_flags = 0; +- const u16 *nvm_chan; ++ const u8 *nvm_chan = cfg->nvm_type == IWL_NVM_EXT ? ++ iwl_ext_nvm_channels : iwl_nvm_channels; + struct ieee80211_regdomain *regd, *copy_rd; + int size_of_regd, regd_to_copy; + struct ieee80211_reg_rule *rule; +@@ -890,18 +886,8 @@ + int center_freq, prev_center_freq = 0; + int valid_rules = 0; + bool new_rule; +- int max_num_ch; +- +- if (cfg->uhb_supported) { +- max_num_ch = IWL_NVM_NUM_CHANNELS_UHB; +- nvm_chan = iwl_uhb_nvm_channels; +- } else if (cfg->nvm_type == IWL_NVM_EXT) { +- max_num_ch = IWL_NVM_NUM_CHANNELS_EXT; +- nvm_chan = iwl_ext_nvm_channels; +- } else { +- max_num_ch = IWL_NVM_NUM_CHANNELS; +- nvm_chan = iwl_nvm_channels; +- } ++ int max_num_ch = cfg->nvm_type == IWL_NVM_EXT ? ++ IWL_NVM_NUM_CHANNELS_EXT : IWL_NVM_NUM_CHANNELS; + + if (WARN_ON(num_of_ch > max_num_ch)) + num_of_ch = max_num_ch; diff --git a/SOURCES/0083-Revert-iwlwifi-use-kmemdup-in-iwl_parse_nvm_mcc_info.patch b/SOURCES/0083-Revert-iwlwifi-use-kmemdup-in-iwl_parse_nvm_mcc_info.patch new file mode 100644 index 0000000..7003cc8 --- /dev/null +++ b/SOURCES/0083-Revert-iwlwifi-use-kmemdup-in-iwl_parse_nvm_mcc_info.patch @@ -0,0 +1,30 @@ +From a594e9d1d06ddfb6dd3a20a181bf5f0be6481bff Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 01:53:44 +0200 +Subject: [PATCH 6/7] Revert "iwlwifi: use kmemdup in iwl_parse_nvm_mcc_info()" + +This reverts commit af84282e2b48143894383d4d6d7812d72e292be9. +--- + drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-09-06 01:58:30.873997881 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-09-06 01:58:31.063995435 +0200 +@@ -982,12 +982,14 @@ + regd_to_copy = sizeof(struct ieee80211_regdomain) + + valid_rules * sizeof(struct ieee80211_reg_rule); + +- copy_rd = kmemdup(regd, regd_to_copy, GFP_KERNEL); ++ copy_rd = kzalloc(regd_to_copy, GFP_KERNEL); + if (!copy_rd) { + copy_rd = ERR_PTR(-ENOMEM); + goto out; + } + ++ memcpy(copy_rd, regd, regd_to_copy); ++ + out: + kfree(regdb_ptrs); + kfree(regd); diff --git a/SOURCES/0084-Revert-cfg80211-make-wmm_rule-part-of-the-reg_rule-s.patch b/SOURCES/0084-Revert-cfg80211-make-wmm_rule-part-of-the-reg_rule-s.patch new file mode 100644 index 0000000..b461236 --- /dev/null +++ b/SOURCES/0084-Revert-cfg80211-make-wmm_rule-part-of-the-reg_rule-s.patch @@ -0,0 +1,115 @@ +From a10ba457727c6da7a599619faeb440521eb467d4 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 01:54:25 +0200 +Subject: [PATCH 7/7] Revert "cfg80211: make wmm_rule part of the reg_rule + structure" + +This reverts commit 38cb87ee47fb825f6c9d645c019f75b3905c0ab2. +--- + drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 50 +++++++++++++++++++--- + include/net/cfg80211.h | 4 +- + include/net/regulatory.h | 4 +- + 3 files changed, 49 insertions(+), 9 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-09-06 01:58:31.263992860 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-09-06 01:58:39.281889631 +0200 +@@ -879,12 +879,15 @@ + const u8 *nvm_chan = cfg->nvm_type == IWL_NVM_EXT ? + iwl_ext_nvm_channels : iwl_nvm_channels; + struct ieee80211_regdomain *regd, *copy_rd; +- int size_of_regd, regd_to_copy; ++ int size_of_regd, regd_to_copy, wmms_to_copy; ++ int size_of_wmms = 0; + struct ieee80211_reg_rule *rule; ++ struct ieee80211_wmm_rule *wmm_rule, *d_wmm, *s_wmm; + struct regdb_ptrs *regdb_ptrs; + enum nl80211_band band; + int center_freq, prev_center_freq = 0; +- int valid_rules = 0; ++ int valid_rules = 0, n_wmms = 0; ++ int i; + bool new_rule; + int max_num_ch = cfg->nvm_type == IWL_NVM_EXT ? + IWL_NVM_NUM_CHANNELS_EXT : IWL_NVM_NUM_CHANNELS; +@@ -903,7 +906,11 @@ + sizeof(struct ieee80211_regdomain) + + num_of_ch * sizeof(struct ieee80211_reg_rule); + +- regd = kzalloc(size_of_regd, GFP_KERNEL); ++ if (geo_info & GEO_WMM_ETSI_5GHZ_INFO) ++ size_of_wmms = ++ num_of_ch * sizeof(struct ieee80211_wmm_rule); ++ ++ regd = kzalloc(size_of_regd + size_of_wmms, GFP_KERNEL); + if (!regd) + return ERR_PTR(-ENOMEM); + +@@ -917,6 +924,8 @@ + regd->alpha2[0] = fw_mcc >> 8; + regd->alpha2[1] = fw_mcc & 0xff; + ++ wmm_rule = (struct ieee80211_wmm_rule *)((u8 *)regd + size_of_regd); ++ + for (ch_idx = 0; ch_idx < num_of_ch; ch_idx++) { + ch_flags = (u16)__le32_to_cpup(channels + ch_idx); + band = (ch_idx < NUM_2GHZ_CHANNELS) ? +@@ -970,10 +979,26 @@ + band == NL80211_BAND_2GHZ) + continue; + +- reg_query_regdb_wmm(regd->alpha2, center_freq, rule); ++ if (!reg_query_regdb_wmm(regd->alpha2, center_freq, ++ ®db_ptrs[n_wmms].token, wmm_rule)) { ++ /* Add only new rules */ ++ for (i = 0; i < n_wmms; i++) { ++ if (regdb_ptrs[i].token == ++ regdb_ptrs[n_wmms].token) { ++ rule->wmm_rule = regdb_ptrs[i].rule; ++ break; ++ } ++ } ++ if (i == n_wmms) { ++ rule->wmm_rule = wmm_rule; ++ regdb_ptrs[n_wmms++].rule = wmm_rule; ++ wmm_rule++; ++ } ++ } + } + + regd->n_reg_rules = valid_rules; ++ regd->n_wmm_rules = n_wmms; + + /* + * Narrow down regdom for unused regulatory rules to prevent hole +@@ -982,13 +1007,28 @@ + regd_to_copy = sizeof(struct ieee80211_regdomain) + + valid_rules * sizeof(struct ieee80211_reg_rule); + +- copy_rd = kzalloc(regd_to_copy, GFP_KERNEL); ++ wmms_to_copy = sizeof(struct ieee80211_wmm_rule) * n_wmms; ++ ++ copy_rd = kzalloc(regd_to_copy + wmms_to_copy, GFP_KERNEL); + if (!copy_rd) { + copy_rd = ERR_PTR(-ENOMEM); + goto out; + } + + memcpy(copy_rd, regd, regd_to_copy); ++ memcpy((u8 *)copy_rd + regd_to_copy, (u8 *)regd + size_of_regd, ++ wmms_to_copy); ++ ++ d_wmm = (struct ieee80211_wmm_rule *)((u8 *)copy_rd + regd_to_copy); ++ s_wmm = (struct ieee80211_wmm_rule *)((u8 *)regd + size_of_regd); ++ ++ for (i = 0; i < regd->n_reg_rules; i++) { ++ if (!regd->reg_rules[i].wmm_rule) ++ continue; ++ ++ copy_rd->reg_rules[i].wmm_rule = d_wmm + ++ (regd->reg_rules[i].wmm_rule - s_wmm); ++ } + + out: + kfree(regdb_ptrs); diff --git a/SOURCES/0085-Revert-iwlwifi-Use-correct-channel_profile-iniwl_get.patch b/SOURCES/0085-Revert-iwlwifi-Use-correct-channel_profile-iniwl_get.patch new file mode 100644 index 0000000..482f677 --- /dev/null +++ b/SOURCES/0085-Revert-iwlwifi-Use-correct-channel_profile-iniwl_get.patch @@ -0,0 +1,24 @@ +From 9b259b74b866cd46fd0b24ca31c4a56f338c97b9 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 02:03:06 +0200 +Subject: [PATCH 1/7] Revert "iwlwifi: Use correct channel_profile + iniwl_get_nvm" + +This reverts commit 14cf9bc6085dfd5bff61db917d6d20f558979f27. +--- + drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-09-06 02:01:41.057549311 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c 2019-09-06 02:17:21.397442652 +0200 +@@ -1320,7 +1320,7 @@ + } + + iwl_init_sbands(trans->dev, trans->cfg, nvm, +- channel_profile, ++ rsp->regulatory.channel_profile, + nvm->valid_tx_ant & fw->valid_tx_ant, + nvm->valid_rx_ant & fw->valid_rx_ant, + sbands_flags); diff --git a/SOURCES/0086-Revert-iwlwifi-mvm-report-all-NO_DATA-events-to-mac8.patch b/SOURCES/0086-Revert-iwlwifi-mvm-report-all-NO_DATA-events-to-mac8.patch new file mode 100644 index 0000000..719f076 --- /dev/null +++ b/SOURCES/0086-Revert-iwlwifi-mvm-report-all-NO_DATA-events-to-mac8.patch @@ -0,0 +1,31 @@ +From be24a91b5235ebb5b78b2bca72b4b553a883cd25 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 02:05:32 +0200 +Subject: [PATCH 2/7] Revert "iwlwifi: mvm: report all NO_DATA events to + mac80211" + +This reverts commit d47cdb884a9901a137edaa66e9866c98048e909c. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 2 ++ + 1 file changed, 2 insertions(+) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 02:01:40.560555710 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 02:17:21.577440335 +0200 +@@ -8,6 +8,7 @@ + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2015 - 2017 Intel Deutschland GmbH ++ * Copyright(c) 2018 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as +@@ -30,6 +31,7 @@ + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2015 - 2017 Intel Deutschland GmbH ++ * Copyright(c) 2018 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without diff --git a/SOURCES/0087-Revert-iwlwifi-mvm-add-read-debugfs-for-he_sniffer_p.patch b/SOURCES/0087-Revert-iwlwifi-mvm-add-read-debugfs-for-he_sniffer_p.patch new file mode 100644 index 0000000..34bb7d5 --- /dev/null +++ b/SOURCES/0087-Revert-iwlwifi-mvm-add-read-debugfs-for-he_sniffer_p.patch @@ -0,0 +1,95 @@ +From 2cc08d0bf6d1a756ba1484b7f4fff97328034ccc Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 02:08:03 +0200 +Subject: [PATCH 3/7] Revert "iwlwifi: mvm: add read debugfs for + he_sniffer_params" + +This reverts commit 8bf52e0ab3d6c4c64295250382fcff2d9d3fed6a. +--- + drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 25 ++---------------------- + drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 1 - + 2 files changed, 2 insertions(+), 24 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c 2019-09-06 02:01:40.436557307 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c 2019-09-06 02:17:21.739438249 +0200 +@@ -1783,7 +1783,6 @@ + + struct iwl_mvm_sniffer_apply { + struct iwl_mvm *mvm; +- u8 *bssid; + u16 aid; + }; + +@@ -1793,8 +1792,6 @@ + struct iwl_mvm_sniffer_apply *apply = data; + + apply->mvm->cur_aid = cpu_to_le16(apply->aid); +- memcpy(apply->mvm->cur_bssid, apply->bssid, +- sizeof(apply->mvm->cur_bssid)); + + return true; + } +@@ -1827,7 +1824,6 @@ + he_mon_cmd.aid = cpu_to_le16(aid); + + apply.aid = aid; +- apply.bssid = (void *)he_mon_cmd.bssid; + + mutex_lock(&mvm->mutex); + +@@ -1857,23 +1853,6 @@ + } + + static ssize_t +-iwl_dbgfs_he_sniffer_params_read(struct file *file, char __user *user_buf, +- size_t count, loff_t *ppos) +-{ +- struct iwl_mvm *mvm = file->private_data; +- u8 buf[32]; +- int len; +- +- len = scnprintf(buf, sizeof(buf), +- "%d %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx\n", +- le16_to_cpu(mvm->cur_aid), mvm->cur_bssid[0], +- mvm->cur_bssid[1], mvm->cur_bssid[2], mvm->cur_bssid[3], +- mvm->cur_bssid[4], mvm->cur_bssid[5]); +- +- return simple_read_from_buffer(user_buf, count, ppos, buf, len); +-} +- +-static ssize_t + iwl_dbgfs_uapsd_noagg_bssids_read(struct file *file, char __user *user_buf, + size_t count, loff_t *ppos) + { +@@ -1943,7 +1922,7 @@ + MVM_DEBUGFS_READ_FILE_OPS(sar_geo_profile); + #endif + +-MVM_DEBUGFS_READ_WRITE_FILE_OPS(he_sniffer_params, 32); ++MVM_DEBUGFS_WRITE_FILE_OPS(he_sniffer_params, 32); + + static ssize_t iwl_dbgfs_mem_read(struct file *file, char __user *user_buf, + size_t count, loff_t *ppos) +@@ -2130,7 +2109,7 @@ + #ifdef CONFIG_ACPI + MVM_DEBUGFS_ADD_FILE(sar_geo_profile, dbgfs_dir, 0400); + #endif +- MVM_DEBUGFS_ADD_FILE(he_sniffer_params, mvm->debugfs_dir, 0600); ++ MVM_DEBUGFS_ADD_FILE(he_sniffer_params, mvm->debugfs_dir, 0200); + + debugfs_create_bool("enable_scan_iteration_notif", 0600, + mvm->debugfs_dir, &mvm->scan_iter_notif_enabled); +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-09-06 02:01:40.729553534 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-09-06 02:17:21.740438236 +0200 +@@ -1135,7 +1135,6 @@ + + /* sniffer data to include in radiotap */ + __le16 cur_aid; +- u8 cur_bssid[ETH_ALEN]; + + #ifdef CONFIG_ACPI + struct iwl_mvm_sar_profile sar_profiles[ACPI_SAR_PROFILE_NUM]; diff --git a/SOURCES/0088-Revert-iwlwifi-mvm-include-configured-sniffer-AID-in.patch b/SOURCES/0088-Revert-iwlwifi-mvm-include-configured-sniffer-AID-in.patch new file mode 100644 index 0000000..8367e13 --- /dev/null +++ b/SOURCES/0088-Revert-iwlwifi-mvm-include-configured-sniffer-AID-in.patch @@ -0,0 +1,194 @@ +From 17ca0052ed9bc2267a6bf80c5e539299f59db930 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 02:09:49 +0200 +Subject: [PATCH 4/7] Revert "iwlwifi: mvm: include configured sniffer AID in + radiotap" + +This reverts commit 9bf13bee2d74a3b7bc0a59b1af7ad5f0a37f2176. +--- + drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 44 +---------------------- + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 -- + drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 4 --- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 39 +++----------------- + 4 files changed, 5 insertions(+), 84 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c 2019-09-06 02:17:21.739438249 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c 2019-09-06 02:17:21.908436074 +0200 +@@ -1781,33 +1781,11 @@ + return ret ?: count; + } + +-struct iwl_mvm_sniffer_apply { +- struct iwl_mvm *mvm; +- u16 aid; +-}; +- +-static bool iwl_mvm_sniffer_apply(struct iwl_notif_wait_data *notif_data, +- struct iwl_rx_packet *pkt, void *data) +-{ +- struct iwl_mvm_sniffer_apply *apply = data; +- +- apply->mvm->cur_aid = cpu_to_le16(apply->aid); +- +- return true; +-} +- + static ssize_t + iwl_dbgfs_he_sniffer_params_write(struct iwl_mvm *mvm, char *buf, +- size_t count, loff_t *ppos) ++ size_t count, loff_t *ppos) + { +- struct iwl_notification_wait wait; + struct iwl_he_monitor_cmd he_mon_cmd = {}; +- struct iwl_mvm_sniffer_apply apply = { +- .mvm = mvm, +- }; +- u16 wait_cmds[] = { +- iwl_cmd_id(HE_AIR_SNIFFER_CONFIG_CMD, DATA_PATH_GROUP, 0), +- }; + u32 aid; + int ret; + +@@ -1823,30 +1801,10 @@ + + he_mon_cmd.aid = cpu_to_le16(aid); + +- apply.aid = aid; +- + mutex_lock(&mvm->mutex); +- +- /* +- * Use the notification waiter to get our function triggered +- * in sequence with other RX. This ensures that frames we get +- * on the RX queue _before_ the new configuration is applied +- * still have mvm->cur_aid pointing to the old AID, and that +- * frames on the RX queue _after_ the firmware processed the +- * new configuration (and sent the response, synchronously) +- * get mvm->cur_aid correctly set to the new AID. +- */ +- iwl_init_notification_wait(&mvm->notif_wait, &wait, +- wait_cmds, ARRAY_SIZE(wait_cmds), +- iwl_mvm_sniffer_apply, &apply); +- + ret = iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(HE_AIR_SNIFFER_CONFIG_CMD, + DATA_PATH_GROUP, 0), 0, + sizeof(he_mon_cmd), &he_mon_cmd); +- +- /* no need to really wait, we already did anyway */ +- iwl_remove_notification(&mvm->notif_wait, &wait); +- + mutex_unlock(&mvm->mutex); + + return ret ?: count; +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-06 02:01:40.850551976 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-06 02:17:21.908436074 +0200 +@@ -1046,8 +1046,6 @@ + + iwl_mvm_stop_device(mvm); + +- mvm->cur_aid = 0; +- + mvm->scan_status = 0; + mvm->ps_disabled = false; + mvm->calibrating = false; +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-09-06 02:17:21.740438236 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-09-06 02:17:21.910436048 +0200 +@@ -1132,10 +1132,6 @@ + + /* does a monitor vif exist (only one can exist hence bool) */ + bool monitor_on; +- +- /* sniffer data to include in radiotap */ +- __le16 cur_aid; +- + #ifdef CONFIG_ACPI + struct iwl_mvm_sar_profile sar_profiles[ACPI_SAR_PROFILE_NUM]; + struct iwl_mvm_geo_profile geo_profiles[ACPI_NUM_GEO_PROFILES]; +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 02:17:21.577440335 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 02:17:21.910436048 +0200 +@@ -208,40 +208,11 @@ + return 0; + } + +-static void iwl_mvm_add_rtap_sniffer_config(struct iwl_mvm *mvm, +- struct sk_buff *skb) +-{ +- struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb); +- struct ieee80211_vendor_radiotap *radiotap; +- int size = sizeof(*radiotap) + sizeof(__le16); +- +- if (!mvm->cur_aid) +- return; +- +- radiotap = skb_put(skb, size); +- radiotap->align = 1; +- /* Intel OUI */ +- radiotap->oui[0] = 0xf6; +- radiotap->oui[1] = 0x54; +- radiotap->oui[2] = 0x25; +- /* radiotap sniffer config sub-namespace */ +- radiotap->subns = 1; +- radiotap->present = 0x1; +- radiotap->len = size - sizeof(*radiotap); +- radiotap->pad = 0; +- +- /* fill the data now */ +- memcpy(radiotap->data, &mvm->cur_aid, sizeof(mvm->cur_aid)); +- +- rx_status->flag |= RX_FLAG_RADIOTAP_VENDOR_DATA; +-} +- + /* iwl_mvm_pass_packet_to_mac80211 - passes the packet for mac80211 */ + static void iwl_mvm_pass_packet_to_mac80211(struct iwl_mvm *mvm, + struct napi_struct *napi, + struct sk_buff *skb, int queue, +- struct ieee80211_sta *sta, +- bool csi) ++ struct ieee80211_sta *sta) + { + struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb); + +@@ -510,7 +481,7 @@ + while ((skb = __skb_dequeue(skb_list))) { + iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, + reorder_buf->queue, +- sta, false); ++ sta); + reorder_buf->num_stored--; + } + } +@@ -916,7 +887,6 @@ + struct ieee80211_sta *sta = NULL; + struct sk_buff *skb; + u8 crypt_len = 0; +- bool csi = false; + + if (unlikely(test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))) + return; +@@ -1171,8 +1141,7 @@ + } + + if (!iwl_mvm_reorder(mvm, napi, queue, sta, skb, desc)) +- iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, +- sta, csi); ++ iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta); + out: + rcu_read_unlock(); + } +@@ -1305,7 +1274,7 @@ + rx_status->rate_idx = rate; + } + +- iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta, false); ++ iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta); + out: + rcu_read_unlock(); + } diff --git a/SOURCES/0089-Revert-iwlwifi-mvm-implement-CSI-reporting.patch b/SOURCES/0089-Revert-iwlwifi-mvm-implement-CSI-reporting.patch new file mode 100644 index 0000000..511df2a --- /dev/null +++ b/SOURCES/0089-Revert-iwlwifi-mvm-implement-CSI-reporting.patch @@ -0,0 +1,209 @@ +From dbaa837f62011f9a7b57e38747a30153a0a1a163 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 02:11:21 +0200 +Subject: [PATCH 1/4] Revert "iwlwifi: mvm: implement CSI reporting" + +This reverts commit 5213e8a8a28d2c4c143fec94e57c866a958ed52d. +--- + .../net/wireless/intel/iwlwifi/fw/api/datapath.h | 55 ---------------------- + .../net/wireless/intel/iwlwifi/fw/api/location.h | 20 -------- + drivers/net/wireless/intel/iwlwifi/fw/api/rx.h | 2 - + drivers/net/wireless/intel/iwlwifi/fw/file.h | 7 +-- + drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 1 - + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 1 - + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 8 +--- + 7 files changed, 2 insertions(+), 92 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h 2019-09-06 15:31:38.601243739 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h 2019-09-06 15:31:57.823938961 +0200 +@@ -105,12 +105,6 @@ + HE_AIR_SNIFFER_CONFIG_CMD = 0x13, + + /** +- * @CHEST_COLLECTOR_FILTER_CONFIG_CMD: Configure the CSI +- * matrix collection, uses &struct iwl_channel_estimation_cfg +- */ +- CHEST_COLLECTOR_FILTER_CONFIG_CMD = 0x14, +- +- /** + * @RX_NO_DATA_NOTIF: &struct iwl_rx_no_data + */ + RX_NO_DATA_NOTIF = 0xF5, +@@ -162,53 +156,4 @@ + __le32 user_position[4]; + } __packed; /* MU_GROUP_MNG_NTFY_API_S_VER_1 */ + +-enum iwl_channel_estimation_flags { +- IWL_CHANNEL_ESTIMATION_ENABLE = BIT(0), +- IWL_CHANNEL_ESTIMATION_TIMER = BIT(1), +- IWL_CHANNEL_ESTIMATION_COUNTER = BIT(2), +-}; +- +-/** +- * struct iwl_channel_estimation_cfg - channel estimation reporting config +- */ +-struct iwl_channel_estimation_cfg { +- /** +- * @flags: flags, see &enum iwl_channel_estimation_flags +- */ +- __le32 flags; +- /** +- * @timer: if enabled via flags, automatically disable after this many +- * microseconds +- */ +- __le32 timer; +- /** +- * @count: if enabled via flags, automatically disable after this many +- * frames with channel estimation matrix were captured +- */ +- __le32 count; +- /** +- * @rate_n_flags_mask: only try to record the channel estimation matrix +- * if the rate_n_flags value for the received frame (let's call +- * that rx_rnf) matches the mask/value given here like this: +- * (rx_rnf & rate_n_flags_mask) == rate_n_flags_val. +- */ +- __le32 rate_n_flags_mask; +- /** +- * @rate_n_flags_val: see @rate_n_flags_mask +- */ +- __le32 rate_n_flags_val; +- /** +- * @reserved: reserved (for alignment) +- */ +- __le32 reserved; +- /** +- * @frame_types: bitmap of frame types to capture, the received frame's +- * subtype|type takes 6 bits in the frame and the corresponding bit +- * in this field must be set to 1 to capture channel estimation for +- * that frame type. Set to all-ones to enable capturing for all +- * frame types. +- */ +- __le64 frame_types; +-} __packed; /* CHEST_COLLECTOR_FILTER_CMD_API_S_VER_1 */ +- + #endif /* __iwl_fw_api_datapath_h__ */ +Index: src/drivers/net/wireless/intel/iwlwifi/fw/api/location.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/api/location.h 2019-09-06 15:31:38.601243739 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/api/location.h 2019-09-06 15:31:57.823938961 +0200 +@@ -94,15 +94,6 @@ + */ + TOF_RESPONDER_DYN_CONFIG_CMD = 0x5, + /** +- * @CSI_HEADER_NOTIFICATION: CSI header +- */ +- CSI_HEADER_NOTIFICATION = 0xFA, +- /** +- * @CSI_CHUNKS_NOTIFICATION: CSI chunk, +- * uses &struct iwl_csi_chunk_notification +- */ +- CSI_CHUNKS_NOTIFICATION = 0xFB, +- /** + * @TOF_LC_NOTIF: used for LCI/civic location, contains just + * the action frame + */ +@@ -697,15 +688,4 @@ + __le16 reserved; + } __packed; /* TOF_RESPONDER_STATISTICS_NTFY_S_VER_2 */ + +-#define IWL_CSI_CHUNK_CTL_NUM_MASK 0x3 +-#define IWL_CSI_CHUNK_CTL_IDX_MASK 0xc +- +-struct iwl_csi_chunk_notification { +- __le32 token; +- __le16 seq; +- __le16 ctl; +- __le32 size; +- u8 data[]; +-} __packed; /* CSI_CHUNKS_HDR_NTFY_API_S_VER_1 */ +- + #endif /* __iwl_fw_api_location_h__ */ +Index: src/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h 2019-09-06 15:31:38.601243739 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h 2019-09-06 15:31:57.824938945 +0200 +@@ -333,8 +333,6 @@ + IWL_RX_MPDU_PHY_AMPDU = BIT(5), + IWL_RX_MPDU_PHY_AMPDU_TOGGLE = BIT(6), + IWL_RX_MPDU_PHY_SHORT_PREAMBLE = BIT(7), +- /* short preamble is only for CCK, for non-CCK overridden by this */ +- IWL_RX_MPDU_PHY_NCCK_ADDTL_NTFY = BIT(7), + IWL_RX_MPDU_PHY_TSF_OVERLOAD = BIT(8), + }; + +Index: src/drivers/net/wireless/intel/iwlwifi/fw/file.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/file.h 2019-09-06 15:31:38.601243739 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/file.h 2019-09-06 15:31:57.824938945 +0200 +@@ -383,13 +383,10 @@ + * @IWL_UCODE_TLV_CAPA_TX_POWER_ACK: reduced TX power API has larger + * command size (command version 4) that supports toggling ACK TX + * power reduction. ++ * @IWL_UCODE_TLV_CAPA_MLME_OFFLOAD: supports MLME offload + * @IWL_UCODE_TLV_CAPA_D3_DEBUG: supports debug recording during D3 + * @IWL_UCODE_TLV_CAPA_MCC_UPDATE_11AX_SUPPORT: MCC response support 11ax + * capability. +- * @IWL_UCODE_TLV_CAPA_CSI_REPORTING: firmware is capable of being configured +- * to report the CSI information with (certain) RX frames +- * +- * @IWL_UCODE_TLV_CAPA_MLME_OFFLOAD: supports MLME offload + * + * @NUM_IWL_UCODE_TLV_CAPA: number of bits used + */ +@@ -445,8 +442,6 @@ + IWL_UCODE_TLV_CAPA_D3_DEBUG = (__force iwl_ucode_tlv_capa_t)87, + IWL_UCODE_TLV_CAPA_LED_CMD_SUPPORT = (__force iwl_ucode_tlv_capa_t)88, + IWL_UCODE_TLV_CAPA_MCC_UPDATE_11AX_SUPPORT = (__force iwl_ucode_tlv_capa_t)89, +- IWL_UCODE_TLV_CAPA_CSI_REPORTING = (__force iwl_ucode_tlv_capa_t)90, +- + IWL_UCODE_TLV_CAPA_MLME_OFFLOAD = (__force iwl_ucode_tlv_capa_t)96, + + NUM_IWL_UCODE_TLV_CAPA +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c 2019-09-06 15:31:38.601243739 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c 2019-09-06 15:31:57.824938945 +0200 +@@ -69,7 +69,6 @@ + #include "sta.h" + #include "iwl-io.h" + #include "debugfs.h" +-#include "iwl-modparams.h" + #include "fw/error-dump.h" + + static ssize_t iwl_dbgfs_ctdp_budget_read(struct file *file, +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-09-06 15:31:38.601243739 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-09-06 15:31:57.825938929 +0200 +@@ -446,7 +446,6 @@ + HCMD_NAME(TRIGGER_RX_QUEUES_NOTIF_CMD), + HCMD_NAME(RFH_QUEUE_CONFIG_CMD), + HCMD_NAME(TLC_MNG_CONFIG_CMD), +- HCMD_NAME(CHEST_COLLECTOR_FILTER_CONFIG_CMD), + HCMD_NAME(STA_PM_NOTIF), + HCMD_NAME(MU_GROUP_MGMT_NOTIF), + HCMD_NAME(RX_QUEUES_NOTIFICATION), +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 15:31:38.601243739 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 15:31:57.825938929 +0200 +@@ -951,15 +951,9 @@ + bool toggle_bit = phy_info & IWL_RX_MPDU_PHY_AMPDU_TOGGLE; + + rx_status->flag |= RX_FLAG_AMPDU_DETAILS; +- /* +- * Toggle is switched whenever new aggregation starts. Make +- * sure ampdu_reference is never 0 so we can later use it to +- * see if the frame was really part of an A-MPDU or not. +- */ ++ /* toggle is switched whenever new aggregation starts */ + if (toggle_bit != mvm->ampdu_toggle) { + mvm->ampdu_ref++; +- if (mvm->ampdu_ref == 0) +- mvm->ampdu_ref++; + mvm->ampdu_toggle = toggle_bit; + } + rx_status->ampdu_reference = mvm->ampdu_ref; diff --git a/SOURCES/0090-Revert-iwlwifi-iwlmvm-in-monitor-NDP-notif-take-the-.patch b/SOURCES/0090-Revert-iwlwifi-iwlmvm-in-monitor-NDP-notif-take-the-.patch new file mode 100644 index 0000000..c5d7081 --- /dev/null +++ b/SOURCES/0090-Revert-iwlwifi-iwlmvm-in-monitor-NDP-notif-take-the-.patch @@ -0,0 +1,68 @@ +From 090384c14e89b9de2550d68deb686ad038fc42b1 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 02:12:36 +0200 +Subject: [PATCH 2/4] Revert "iwlwifi: iwlmvm: in monitor NDP notif take the + NSS from rx_vec" + +This reverts commit c97781d1d9563dc594074177dfedd848da648223. +--- + drivers/net/wireless/intel/iwlwifi/fw/api/rx.h | 5 +---- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 17 ++++------------- + 2 files changed, 5 insertions(+), 17 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h 2019-09-06 15:31:57.824938945 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h 2019-09-06 15:31:58.160933618 +0200 +@@ -509,9 +509,6 @@ + #define RX_NO_DATA_FRAME_TIME_POS 0 + #define RX_NO_DATA_FRAME_TIME_MSK (0xfffff << RX_NO_DATA_FRAME_TIME_POS) + +-#define RX_NO_DATA_RX_VEC0_HE_NSTS_MSK 0x03800000 +-#define RX_NO_DATA_RX_VEC0_VHT_NSTS_MSK 0x38000000 +- + /** + * struct iwl_rx_no_data - RX no data descriptor + * @info: 7:0 frame type, 15:8 RX error type +@@ -532,7 +529,7 @@ + __le32 fr_time; + __le32 rate; + __le32 phy_info[2]; +- __le32 rx_vec[2]; ++ __le32 rx_vec[3]; + } __packed; /* RX_NO_DATA_NTFY_API_S_VER_1 */ + + struct iwl_frame_release { +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 15:31:57.825938929 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 15:31:58.160933618 +0200 +@@ -1238,24 +1238,15 @@ + } else if (rate_n_flags & RATE_MCS_VHT_MSK) { + u8 stbc = (rate_n_flags & RATE_MCS_STBC_MSK) >> + RATE_MCS_STBC_POS; ++ rx_status->nss = ++ ((rate_n_flags & RATE_VHT_MCS_NSS_MSK) >> ++ RATE_VHT_MCS_NSS_POS) + 1; + rx_status->rate_idx = rate_n_flags & RATE_VHT_MCS_RATE_CODE_MSK; + rx_status->encoding = RX_ENC_VHT; + rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT; + if (rate_n_flags & RATE_MCS_BF_MSK) + rx_status->enc_flags |= RX_ENC_FLAG_BF; +- /* +- * take the nss from the rx_vec since the rate_n_flags has +- * only 2 bits for the nss which gives a max of 4 ss but +- * there may be up to 8 spatial streams +- */ +- rx_status->nss = +- le32_get_bits(desc->rx_vec[0], +- RX_NO_DATA_RX_VEC0_VHT_NSTS_MSK) + 1; +- } else if (rate_n_flags & RATE_MCS_HE_MSK) { +- rx_status->nss = +- le32_get_bits(desc->rx_vec[0], +- RX_NO_DATA_RX_VEC0_HE_NSTS_MSK) + 1; +- } else { ++ } else if (!(rate_n_flags & RATE_MCS_HE_MSK)) { + int rate = iwl_mvm_legacy_rate_to_mac80211_idx(rate_n_flags, + rx_status->band); + diff --git a/SOURCES/0091-Revert-iwlwifi-mvm-handle-RX-no-data-notification.patch b/SOURCES/0091-Revert-iwlwifi-mvm-handle-RX-no-data-notification.patch new file mode 100644 index 0000000..bbf36f1 --- /dev/null +++ b/SOURCES/0091-Revert-iwlwifi-mvm-handle-RX-no-data-notification.patch @@ -0,0 +1,262 @@ +From 25fcfd03d3382e76ec0f7ababb9176ed3ccff37a Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 02:16:05 +0200 +Subject: [PATCH 3/4] Revert "iwlwifi: mvm: handle RX no data notification" + +This reverts commit bf9dfedaad9e65f2f580d3a573401d521d48b932. +--- + .../net/wireless/intel/iwlwifi/fw/api/datapath.h | 5 - + drivers/net/wireless/intel/iwlwifi/fw/api/rx.h | 49 -------- + drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 - + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 2 - + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 128 +-------------------- + 5 files changed, 1 insertion(+), 185 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h 2019-09-06 15:31:57.823938961 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h 2019-09-06 15:31:58.340930764 +0200 +@@ -105,11 +105,6 @@ + HE_AIR_SNIFFER_CONFIG_CMD = 0x13, + + /** +- * @RX_NO_DATA_NOTIF: &struct iwl_rx_no_data +- */ +- RX_NO_DATA_NOTIF = 0xF5, +- +- /** + * @TLC_MNG_UPDATE_NOTIF: &struct iwl_tlc_update_notif + */ + TLC_MNG_UPDATE_NOTIF = 0xF7, +Index: src/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h 2019-09-06 15:31:58.160933618 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h 2019-09-06 15:31:58.340930764 +0200 +@@ -483,55 +483,6 @@ + }; + } __packed; + +-#define RX_NO_DATA_CHAIN_A_POS 0 +-#define RX_NO_DATA_CHAIN_A_MSK (0xff << RX_NO_DATA_CHAIN_A_POS) +-#define RX_NO_DATA_CHAIN_B_POS 8 +-#define RX_NO_DATA_CHAIN_B_MSK (0xff << RX_NO_DATA_CHAIN_B_POS) +-#define RX_NO_DATA_CHANNEL_POS 16 +-#define RX_NO_DATA_CHANNEL_MSK (0xff << RX_NO_DATA_CHANNEL_POS) +- +-#define RX_NO_DATA_INFO_TYPE_POS 0 +-#define RX_NO_DATA_INFO_TYPE_MSK (0xff << RX_NO_DATA_INFO_TYPE_POS) +-#define RX_NO_DATA_INFO_TYPE_NONE 0 +-#define RX_NO_DATA_INFO_TYPE_RX_ERR 1 +-#define RX_NO_DATA_INFO_TYPE_NDP 2 +-#define RX_NO_DATA_INFO_TYPE_MU_UNMATCHED 3 +-#define RX_NO_DATA_INFO_TYPE_HE_TB_UNMATCHED 4 +- +-#define RX_NO_DATA_INFO_ERR_POS 8 +-#define RX_NO_DATA_INFO_ERR_MSK (0xff << RX_NO_DATA_INFO_ERR_POS) +-#define RX_NO_DATA_INFO_ERR_NONE 0 +-#define RX_NO_DATA_INFO_ERR_BAD_PLCP 1 +-#define RX_NO_DATA_INFO_ERR_UNSUPPORTED_RATE 2 +-#define RX_NO_DATA_INFO_ERR_NO_DELIM 3 +-#define RX_NO_DATA_INFO_ERR_BAD_MAC_HDR 4 +- +-#define RX_NO_DATA_FRAME_TIME_POS 0 +-#define RX_NO_DATA_FRAME_TIME_MSK (0xfffff << RX_NO_DATA_FRAME_TIME_POS) +- +-/** +- * struct iwl_rx_no_data - RX no data descriptor +- * @info: 7:0 frame type, 15:8 RX error type +- * @rssi: 7:0 energy chain-A, +- * 15:8 chain-B, measured at FINA time (FINA_ENERGY), 16:23 channel +- * @on_air_rise_time: GP2 during on air rise +- * @fr_time: frame time +- * @rate: rate/mcs of frame +- * @phy_info: &enum iwl_rx_phy_data0 and &enum iwl_rx_phy_info_type +- * @rx_vec: DW-12:9 raw RX vectors from DSP according to modulation type. +- * for VHT: OFDM_RX_VECTOR_SIGA1_OUT, OFDM_RX_VECTOR_SIGA2_OUT +- * for HE: OFDM_RX_VECTOR_HE_SIGA1_OUT, OFDM_RX_VECTOR_HE_SIGA2_OUT +- */ +-struct iwl_rx_no_data { +- __le32 info; +- __le32 rssi; +- __le32 on_air_rise_time; +- __le32 fr_time; +- __le32 rate; +- __le32 phy_info[2]; +- __le32 rx_vec[3]; +-} __packed; /* RX_NO_DATA_NTFY_API_S_VER_1 */ +- + struct iwl_frame_release { + u8 baid; + u8 reserved; +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-09-06 15:31:37.675258420 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-09-06 15:31:58.340930764 +0200 +@@ -1598,8 +1598,6 @@ + struct iwl_rx_cmd_buffer *rxb); + void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi, + struct iwl_rx_cmd_buffer *rxb, int queue); +-void iwl_mvm_rx_monitor_ndp(struct iwl_mvm *mvm, struct napi_struct *napi, +- struct iwl_rx_cmd_buffer *rxb, int queue); + void iwl_mvm_rx_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi, + struct iwl_rx_cmd_buffer *rxb, int queue); + int iwl_mvm_notify_rx_queue(struct iwl_mvm *mvm, u32 rxq_mask, +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-09-06 15:31:57.825938929 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-09-06 15:31:58.340930764 +0200 +@@ -1078,8 +1078,6 @@ + iwl_mvm_rx_queue_notif(mvm, rxb, 0); + else if (cmd == WIDE_ID(LEGACY_GROUP, FRAME_RELEASE)) + iwl_mvm_rx_frame_release(mvm, napi, rxb, 0); +- else if (cmd == WIDE_ID(DATA_PATH_GROUP, RX_NO_DATA_NOTIF)) +- iwl_mvm_rx_monitor_ndp(mvm, napi, rxb, 0); + else + iwl_mvm_rx_common(mvm, rxb, pkt); + } +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 15:31:58.160933618 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 15:31:58.341930748 +0200 +@@ -214,10 +214,7 @@ + struct sk_buff *skb, int queue, + struct ieee80211_sta *sta) + { +- struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb); +- +- if (!(rx_status->flag & RX_FLAG_NO_PSDU) && +- iwl_mvm_check_pn(mvm, skb, queue, sta)) ++ if (iwl_mvm_check_pn(mvm, skb, queue, sta)) + kfree_skb(skb); + else + ieee80211_rx_napi(mvm->hw, sta, skb, napi); +@@ -1140,129 +1137,6 @@ + rcu_read_unlock(); + } + +-void iwl_mvm_rx_monitor_ndp(struct iwl_mvm *mvm, struct napi_struct *napi, +- struct iwl_rx_cmd_buffer *rxb, int queue) +-{ +- struct ieee80211_rx_status *rx_status; +- struct iwl_rx_packet *pkt = rxb_addr(rxb); +- struct iwl_rx_no_data *desc = (void *)pkt->data; +- u32 rate_n_flags = le32_to_cpu(desc->rate); +- u32 gp2_on_air_rise = le32_to_cpu(desc->on_air_rise_time); +- u32 rssi = le32_to_cpu(desc->rssi); +- u32 info_type = le32_to_cpu(desc->info) & RX_NO_DATA_INFO_TYPE_MSK; +- u16 phy_info = IWL_RX_MPDU_PHY_TSF_OVERLOAD; +- struct ieee80211_sta *sta = NULL; +- struct sk_buff *skb; +- u8 channel, energy_a, energy_b; +- struct iwl_mvm_rx_phy_data phy_data = { +- .d0 = desc->phy_info[0], +- .info_type = IWL_RX_PHY_INFO_TYPE_NONE, +- }; +- +- if (unlikely(test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))) +- return; +- +- /* Currently only NDP type is supported */ +- if (info_type != RX_NO_DATA_INFO_TYPE_NDP) +- return; +- +- energy_a = (rssi & RX_NO_DATA_CHAIN_A_MSK) >> RX_NO_DATA_CHAIN_A_POS; +- energy_b = (rssi & RX_NO_DATA_CHAIN_B_MSK) >> RX_NO_DATA_CHAIN_B_POS; +- channel = (rssi & RX_NO_DATA_CHANNEL_MSK) >> RX_NO_DATA_CHANNEL_POS; +- +- phy_data.info_type = +- le32_get_bits(desc->phy_info[1], +- IWL_RX_PHY_DATA1_INFO_TYPE_MASK); +- +- /* Dont use dev_alloc_skb(), we'll have enough headroom once +- * ieee80211_hdr pulled. +- */ +- skb = alloc_skb(128, GFP_ATOMIC); +- if (!skb) { +- IWL_ERR(mvm, "alloc_skb failed\n"); +- return; +- } +- +- rx_status = IEEE80211_SKB_RXCB(skb); +- +- /* 0-length PSDU */ +- rx_status->flag |= RX_FLAG_NO_PSDU; +- /* currently this is the only type for which we get this notif */ +- rx_status->zero_length_psdu_type = +- IEEE80211_RADIOTAP_ZERO_LEN_PSDU_SOUNDING; +- +- /* This may be overridden by iwl_mvm_rx_he() to HE_RU */ +- switch (rate_n_flags & RATE_MCS_CHAN_WIDTH_MSK) { +- case RATE_MCS_CHAN_WIDTH_20: +- break; +- case RATE_MCS_CHAN_WIDTH_40: +- rx_status->bw = RATE_INFO_BW_40; +- break; +- case RATE_MCS_CHAN_WIDTH_80: +- rx_status->bw = RATE_INFO_BW_80; +- break; +- case RATE_MCS_CHAN_WIDTH_160: +- rx_status->bw = RATE_INFO_BW_160; +- break; +- } +- +- if (rate_n_flags & RATE_MCS_HE_MSK) +- iwl_mvm_rx_he(mvm, skb, &phy_data, rate_n_flags, +- phy_info, queue); +- +- iwl_mvm_decode_lsig(skb, &phy_data); +- +- rx_status->device_timestamp = gp2_on_air_rise; +- rx_status->band = channel > 14 ? NL80211_BAND_5GHZ : +- NL80211_BAND_2GHZ; +- rx_status->freq = ieee80211_channel_to_frequency(channel, +- rx_status->band); +- iwl_mvm_get_signal_strength(mvm, rx_status, rate_n_flags, energy_a, +- energy_b); +- +- rcu_read_lock(); +- +- if (!(rate_n_flags & RATE_MCS_CCK_MSK) && +- rate_n_flags & RATE_MCS_SGI_MSK) +- rx_status->enc_flags |= RX_ENC_FLAG_SHORT_GI; +- if (rate_n_flags & RATE_HT_MCS_GF_MSK) +- rx_status->enc_flags |= RX_ENC_FLAG_HT_GF; +- if (rate_n_flags & RATE_MCS_LDPC_MSK) +- rx_status->enc_flags |= RX_ENC_FLAG_LDPC; +- if (rate_n_flags & RATE_MCS_HT_MSK) { +- u8 stbc = (rate_n_flags & RATE_MCS_STBC_MSK) >> +- RATE_MCS_STBC_POS; +- rx_status->encoding = RX_ENC_HT; +- rx_status->rate_idx = rate_n_flags & RATE_HT_MCS_INDEX_MSK; +- rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT; +- } else if (rate_n_flags & RATE_MCS_VHT_MSK) { +- u8 stbc = (rate_n_flags & RATE_MCS_STBC_MSK) >> +- RATE_MCS_STBC_POS; +- rx_status->nss = +- ((rate_n_flags & RATE_VHT_MCS_NSS_MSK) >> +- RATE_VHT_MCS_NSS_POS) + 1; +- rx_status->rate_idx = rate_n_flags & RATE_VHT_MCS_RATE_CODE_MSK; +- rx_status->encoding = RX_ENC_VHT; +- rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT; +- if (rate_n_flags & RATE_MCS_BF_MSK) +- rx_status->enc_flags |= RX_ENC_FLAG_BF; +- } else if (!(rate_n_flags & RATE_MCS_HE_MSK)) { +- int rate = iwl_mvm_legacy_rate_to_mac80211_idx(rate_n_flags, +- rx_status->band); +- +- if (WARN(rate < 0 || rate > 0xFF, +- "Invalid rate flags 0x%x, band %d,\n", +- rate_n_flags, rx_status->band)) { +- kfree_skb(skb); +- goto out; +- } +- rx_status->rate_idx = rate; +- } +- +- iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta); +-out: +- rcu_read_unlock(); +-} + void iwl_mvm_rx_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi, + struct iwl_rx_cmd_buffer *rxb, int queue) + { diff --git a/SOURCES/0092-Revert-iwlwifi-mvm-fix-merge-damage-in-iwl_mvm_rx_mp.patch b/SOURCES/0092-Revert-iwlwifi-mvm-fix-merge-damage-in-iwl_mvm_rx_mp.patch new file mode 100644 index 0000000..9c6ef76 --- /dev/null +++ b/SOURCES/0092-Revert-iwlwifi-mvm-fix-merge-damage-in-iwl_mvm_rx_mp.patch @@ -0,0 +1,25 @@ +From eda9d623bc398fac76899008fd69176aed54f16d Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 14:51:13 +0200 +Subject: [PATCH 4/4] Revert "iwlwifi: mvm: fix merge damage in + iwl_mvm_rx_mpdu_mq()" + +This reverts commit 3864be551405b582ae38fbcdfdbb6e49052f5f6d. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 3 --- + 1 file changed, 3 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 15:31:58.341930748 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 2019-09-06 15:31:58.537927641 +0200 +@@ -956,9 +956,6 @@ + rx_status->ampdu_reference = mvm->ampdu_ref; + } + +- if (unlikely(mvm->monitor_on)) +- iwl_mvm_add_rtap_sniffer_config(mvm, skb); +- + rcu_read_lock(); + + if (desc->status & cpu_to_le16(IWL_RX_MPDU_STATUS_SRC_STA_FOUND)) { diff --git a/SOURCES/0093-Revert-iwlwifi-mvm-implement-VHT-extended-NSS-suppor.patch b/SOURCES/0093-Revert-iwlwifi-mvm-implement-VHT-extended-NSS-suppor.patch new file mode 100644 index 0000000..d570bd5 --- /dev/null +++ b/SOURCES/0093-Revert-iwlwifi-mvm-implement-VHT-extended-NSS-suppor.patch @@ -0,0 +1,68 @@ +From d295c3fbfdfc7d3b42a527b9e91c4785c1790188 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 15:35:40 +0200 +Subject: [PATCH 1/5] Revert "iwlwifi: mvm: implement VHT extended NSS support + in rs.c" + +This reverts commit a53b2a0b1245d70430a8b541d76666b585346882. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rs.c | 23 ++--------------------- + 1 file changed, 2 insertions(+), 21 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rs.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rs.c 2019-09-06 15:34:15.507755972 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rs.c 2019-09-06 15:42:07.252276422 +0200 +@@ -4,7 +4,7 @@ + * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 - 2017 Intel Deutschland GmbH +- * Copyright(c) 2018 - 2019 Intel Corporation ++ * Copyright(c) 2018 Intel Corporation + * + * Contact Information: + * Intel Linux Wireless +@@ -1611,26 +1611,8 @@ + + static u32 rs_bw_from_sta_bw(struct ieee80211_sta *sta) + { +- struct ieee80211_sta_vht_cap *sta_vht_cap = &sta->vht_cap; +- struct ieee80211_vht_cap vht_cap = { +- .vht_cap_info = cpu_to_le32(sta_vht_cap->cap), +- .supp_mcs = sta_vht_cap->vht_mcs, +- }; +- + switch (sta->bandwidth) { + case IEEE80211_STA_RX_BW_160: +- /* +- * Don't use 160 MHz if VHT extended NSS support +- * says we cannot use 2 streams, we don't want to +- * deal with this. +- * We only check MCS 0 - they will support that if +- * we got here at all and we don't care which MCS, +- * we want to determine a more global state. +- */ +- if (ieee80211_get_vht_max_nss(&vht_cap, +- IEEE80211_VHT_CHANWIDTH_160MHZ, +- 0, true) < sta->rx_nss) +- return RATE_MCS_CHAN_WIDTH_80; + return RATE_MCS_CHAN_WIDTH_160; + case IEEE80211_STA_RX_BW_80: + return RATE_MCS_CHAN_WIDTH_80; +@@ -1763,7 +1745,7 @@ + struct iwl_scale_tbl_info *tbl, + enum rs_action scale_action) + { +- if (rs_bw_from_sta_bw(sta) != RATE_MCS_CHAN_WIDTH_80) ++ if (sta->bandwidth != IEEE80211_STA_RX_BW_80) + return false; + + if (!is_vht_siso(&tbl->rate)) +@@ -4082,7 +4064,6 @@ + .add_sta_debugfs = rs_drv_add_sta_debugfs, + .remove_sta_debugfs = rs_remove_sta_debugfs, + #endif +- .capa = RATE_CTRL_CAPA_VHT_EXT_NSS_BW, + }; + + void iwl_mvm_rs_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta, diff --git a/SOURCES/0094-Revert-iwlwifi-fw-do-not-set-sgi-bits-for-HE-connect.patch b/SOURCES/0094-Revert-iwlwifi-fw-do-not-set-sgi-bits-for-HE-connect.patch new file mode 100644 index 0000000..7d4aca6 --- /dev/null +++ b/SOURCES/0094-Revert-iwlwifi-fw-do-not-set-sgi-bits-for-HE-connect.patch @@ -0,0 +1,28 @@ +From 99a69851c1134de37f4d3a52e3c9a43900341176 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 15:37:47 +0200 +Subject: [PATCH 2/5] Revert "iwlwifi: fw: do not set sgi bits for HE + connection" + +This reverts commit 5c2dbebb446539eb9640bf59a02756d6e7f1fc53. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c | 4 ---- + 1 file changed, 4 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c 2019-09-06 15:34:15.507755972 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c 2019-09-06 15:42:07.472272934 +0200 +@@ -98,12 +98,8 @@ + { + struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap; + struct ieee80211_sta_vht_cap *vht_cap = &sta->vht_cap; +- struct ieee80211_sta_he_cap *he_cap = &sta->he_cap; + u8 supp = 0; + +- if (he_cap && he_cap->has_he) +- return 0; +- + if (ht_cap->cap & IEEE80211_HT_CAP_SGI_20) + supp |= BIT(IWL_TLC_MNG_CH_WIDTH_20MHZ); + if (ht_cap->cap & IEEE80211_HT_CAP_SGI_40) diff --git a/SOURCES/0095-Revert-iwlwifi-mvm-fix-wrong-DCM-TLC-config.patch b/SOURCES/0095-Revert-iwlwifi-mvm-fix-wrong-DCM-TLC-config.patch new file mode 100644 index 0000000..33094e2 --- /dev/null +++ b/SOURCES/0095-Revert-iwlwifi-mvm-fix-wrong-DCM-TLC-config.patch @@ -0,0 +1,30 @@ +From e92d7bbbcc06e5b7bfd8031c2657b27ada83aeee Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 15:40:41 +0200 +Subject: [PATCH 3/5] Revert "iwlwifi: mvm: fix wrong DCM TLC config" + +This reverts commit 7703238ef7e56b96eb0d23e629245b1d56241224. +--- + drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c 2019-09-06 15:42:07.472272934 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c 2019-09-06 15:42:07.640270270 +0200 +@@ -145,9 +145,14 @@ + + if (he_cap && he_cap->has_he && + (he_cap->he_cap_elem.phy_cap_info[3] & +- IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_MASK)) ++ IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_MASK)) { + flags |= IWL_TLC_MNG_CFG_FLAGS_HE_DCM_NSS_1_MSK; + ++ if (he_cap->he_cap_elem.phy_cap_info[3] & ++ IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_2) ++ flags |= IWL_TLC_MNG_CFG_FLAGS_HE_DCM_NSS_2_MSK; ++ } ++ + return flags; + } + diff --git a/SOURCES/0096-Revert-iwlwifi-rs-fw-support-dcm.patch b/SOURCES/0096-Revert-iwlwifi-rs-fw-support-dcm.patch new file mode 100644 index 0000000..66fee14 --- /dev/null +++ b/SOURCES/0096-Revert-iwlwifi-rs-fw-support-dcm.patch @@ -0,0 +1,56 @@ +From 1f90d5a2b57beb17236e7a1ac70b43369c8b9b4d Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 15:41:00 +0200 +Subject: [PATCH 4/5] Revert "iwlwifi: rs-fw: support dcm" + +This reverts commit 423584dd8060a6d7e1b2fb71ad11025a64aa0bec. +--- + drivers/net/wireless/intel/iwlwifi/fw/api/rs.h | 8 -------- + drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c | 10 ---------- + 2 files changed, 18 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/fw/api/rs.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/api/rs.h 2019-06-27 14:54:04.122678470 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/api/rs.h 2019-09-06 15:42:07.804267670 +0200 +@@ -71,19 +71,11 @@ + * @IWL_TLC_MNG_CFG_FLAGS_LDPC_MSK: enable LDPC + * @IWL_TLC_MNG_CFG_FLAGS_HE_STBC_160MHZ_MSK: enable STBC in HE at 160MHz + * bandwidth +- * @IWL_TLC_MNG_CFG_FLAGS_HE_DCM_NSS_1_MSK: enable HE Dual Carrier Modulation +- * for BPSK (MCS 0) with 1 spatial +- * stream +- * @IWL_TLC_MNG_CFG_FLAGS_HE_DCM_NSS_2_MSK: enable HE Dual Carrier Modulation +- * for BPSK (MCS 0) with 2 spatial +- * streams + */ + enum iwl_tlc_mng_cfg_flags { + IWL_TLC_MNG_CFG_FLAGS_STBC_MSK = BIT(0), + IWL_TLC_MNG_CFG_FLAGS_LDPC_MSK = BIT(1), + IWL_TLC_MNG_CFG_FLAGS_HE_STBC_160MHZ_MSK = BIT(2), +- IWL_TLC_MNG_CFG_FLAGS_HE_DCM_NSS_1_MSK = BIT(3), +- IWL_TLC_MNG_CFG_FLAGS_HE_DCM_NSS_2_MSK = BIT(4), + }; + + /** +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c 2019-09-06 15:42:07.640270270 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c 2019-09-06 15:42:07.804267670 +0200 +@@ -143,16 +143,6 @@ + (vht_ena && (vht_cap->cap & IEEE80211_VHT_CAP_RXLDPC)))) + flags |= IWL_TLC_MNG_CFG_FLAGS_LDPC_MSK; + +- if (he_cap && he_cap->has_he && +- (he_cap->he_cap_elem.phy_cap_info[3] & +- IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_MASK)) { +- flags |= IWL_TLC_MNG_CFG_FLAGS_HE_DCM_NSS_1_MSK; +- +- if (he_cap->he_cap_elem.phy_cap_info[3] & +- IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_2) +- flags |= IWL_TLC_MNG_CFG_FLAGS_HE_DCM_NSS_2_MSK; +- } +- + return flags; + } + diff --git a/SOURCES/0097-Revert-iwlwifi-rs-fw-enable-STBC-in-he-correctly.patch b/SOURCES/0097-Revert-iwlwifi-rs-fw-enable-STBC-in-he-correctly.patch new file mode 100644 index 0000000..7041b89 --- /dev/null +++ b/SOURCES/0097-Revert-iwlwifi-rs-fw-enable-STBC-in-he-correctly.patch @@ -0,0 +1,70 @@ +From e440e418dbbee449983773e61107dee566d81da8 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Fri, 6 Sep 2019 15:41:06 +0200 +Subject: [PATCH 5/5] Revert "iwlwifi: rs-fw: enable STBC in he correctly" + +This reverts commit 3e467b8e4cf4d56244f92b1fb26a25e405e7d3aa. +--- + drivers/net/wireless/intel/iwlwifi/fw/api/rs.h | 10 +++------- + drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c | 20 ++++---------------- + 2 files changed, 7 insertions(+), 23 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/fw/api/rs.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/fw/api/rs.h 2019-09-06 15:42:07.804267670 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/fw/api/rs.h 2019-09-06 15:42:07.977264927 +0200 +@@ -66,16 +66,12 @@ + + /** + * enum iwl_tlc_mng_cfg_flags_enum - options for TLC config flags +- * @IWL_TLC_MNG_CFG_FLAGS_STBC_MSK: enable STBC. For HE this enables STBC for +- * bandwidths <= 80MHz ++ * @IWL_TLC_MNG_CFG_FLAGS_STBC_MSK: enable STBC + * @IWL_TLC_MNG_CFG_FLAGS_LDPC_MSK: enable LDPC +- * @IWL_TLC_MNG_CFG_FLAGS_HE_STBC_160MHZ_MSK: enable STBC in HE at 160MHz +- * bandwidth + */ + enum iwl_tlc_mng_cfg_flags { +- IWL_TLC_MNG_CFG_FLAGS_STBC_MSK = BIT(0), +- IWL_TLC_MNG_CFG_FLAGS_LDPC_MSK = BIT(1), +- IWL_TLC_MNG_CFG_FLAGS_HE_STBC_160MHZ_MSK = BIT(2), ++ IWL_TLC_MNG_CFG_FLAGS_STBC_MSK = BIT(0), ++ IWL_TLC_MNG_CFG_FLAGS_LDPC_MSK = BIT(1), + }; + + /** +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c 2019-09-06 15:42:07.804267670 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c 2019-09-06 15:42:07.977264927 +0200 +@@ -117,26 +117,14 @@ + { + struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap; + struct ieee80211_sta_vht_cap *vht_cap = &sta->vht_cap; +- struct ieee80211_sta_he_cap *he_cap = &sta->he_cap; + bool vht_ena = vht_cap && vht_cap->vht_supported; + u16 flags = 0; + + if (mvm->cfg->ht_params->stbc && +- (num_of_ant(iwl_mvm_get_valid_tx_ant(mvm)) > 1)) { +- if (he_cap && he_cap->has_he) { +- if (he_cap->he_cap_elem.phy_cap_info[2] & +- IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ) +- flags |= IWL_TLC_MNG_CFG_FLAGS_STBC_MSK; +- +- if (he_cap->he_cap_elem.phy_cap_info[7] & +- IEEE80211_HE_PHY_CAP7_STBC_RX_ABOVE_80MHZ) +- flags |= IWL_TLC_MNG_CFG_FLAGS_HE_STBC_160MHZ_MSK; +- } else if ((ht_cap && +- (ht_cap->cap & IEEE80211_HT_CAP_RX_STBC)) || +- (vht_ena && +- (vht_cap->cap & IEEE80211_VHT_CAP_RXSTBC_MASK))) +- flags |= IWL_TLC_MNG_CFG_FLAGS_STBC_MSK; +- } ++ (num_of_ant(iwl_mvm_get_valid_tx_ant(mvm)) > 1) && ++ ((ht_cap && (ht_cap->cap & IEEE80211_HT_CAP_RX_STBC)) || ++ (vht_ena && (vht_cap->cap & IEEE80211_VHT_CAP_RXSTBC_MASK)))) ++ flags |= IWL_TLC_MNG_CFG_FLAGS_STBC_MSK; + + if (mvm->cfg->ht_params->ldpc && + ((ht_cap && (ht_cap->cap & IEEE80211_HT_CAP_LDPC_CODING)) || diff --git a/SOURCES/_RHEL8_PATCH_17-45_iwlwifi_mvm_remove_d3_sram_debugfs_file.patch b/SOURCES/_RHEL8_PATCH_17-45_iwlwifi_mvm_remove_d3_sram_debugfs_file.patch new file mode 100644 index 0000000..cb59e53 --- /dev/null +++ b/SOURCES/_RHEL8_PATCH_17-45_iwlwifi_mvm_remove_d3_sram_debugfs_file.patch @@ -0,0 +1,181 @@ +Date: Fri, 19 Jul 2019 11:39:44 -0400 +From: Jarod Wilson +To: rhkernel-list@redhat.com +Cc: Jarod Wilson +Subject: [RHEL8 PATCH 17/45] iwlwifi: mvm: remove d3_sram debugfs file + +Bugzilla: http://bugzilla.redhat.com/1728992 + +commit 23f57bfac7c283746ffba5caf4046b152074b2d9 +Author: Johannes Berg +Date: Wed May 29 16:39:49 2019 +0300 + + iwlwifi: mvm: remove d3_sram debugfs file + + This debugfs file is really old, and cannot work properly since + the unified image support. Rather than trying to make it work, + which is difficult now due to multiple images (LMAC/UMAC etc.) + just remove it - we no longer need it since we properly do a FW + coredump even in D3 cases. + + Signed-off-by: Johannes Berg + Signed-off-by: Luca Coelho + Signed-off-by: Kalle Valo + +Signed-off-by: Jarod Wilson +--- + drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 22 ------- + .../net/wireless/intel/iwlwifi/mvm/debugfs.c | 57 ------------------- + drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 - + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 3 - + 4 files changed, 84 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/d3.c 2019-09-08 16:05:32.734990158 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/d3.c 2019-09-11 11:38:55.196303575 +0200 +@@ -1972,26 +1972,6 @@ + } + } + +-static void iwl_mvm_read_d3_sram(struct iwl_mvm *mvm) +-{ +-#ifdef CONFIG_IWLWIFI_DEBUGFS +- const struct fw_img *img = &mvm->fw->img[IWL_UCODE_WOWLAN]; +- u32 len = img->sec[IWL_UCODE_SECTION_DATA].len; +- u32 offs = img->sec[IWL_UCODE_SECTION_DATA].offset; +- +- if (!mvm->store_d3_resume_sram) +- return; +- +- if (!mvm->d3_resume_sram) { +- mvm->d3_resume_sram = kzalloc(len, GFP_KERNEL); +- if (!mvm->d3_resume_sram) +- return; +- } +- +- iwl_trans_read_mem_bytes(mvm->trans, offs, mvm->d3_resume_sram, len); +-#endif +-} +- + static void iwl_mvm_d3_disconnect_iter(void *data, u8 *mac, + struct ieee80211_vif *vif) + { +@@ -2054,8 +2034,6 @@ + } + + iwl_fw_dbg_read_d3_debug_data(&mvm->fwrt); +- /* query SRAM first in case we want event logging */ +- iwl_mvm_read_d3_sram(mvm); + + if (iwl_mvm_check_rt_status(mvm, vif)) { + set_bit(STATUS_FW_ERROR, &mvm->trans->status); +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c 2019-09-08 16:05:35.535954096 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c 2019-09-11 11:38:55.197303554 +0200 +@@ -1552,59 +1552,6 @@ + } + #endif + +-#ifdef CONFIG_PM_SLEEP +-static ssize_t iwl_dbgfs_d3_sram_write(struct iwl_mvm *mvm, char *buf, +- size_t count, loff_t *ppos) +-{ +- int store; +- +- if (sscanf(buf, "%d", &store) != 1) +- return -EINVAL; +- +- mvm->store_d3_resume_sram = store; +- +- return count; +-} +- +-static ssize_t iwl_dbgfs_d3_sram_read(struct file *file, char __user *user_buf, +- size_t count, loff_t *ppos) +-{ +- struct iwl_mvm *mvm = file->private_data; +- const struct fw_img *img; +- int ofs, len, pos = 0; +- size_t bufsz, ret; +- char *buf; +- u8 *ptr = mvm->d3_resume_sram; +- +- img = &mvm->fw->img[IWL_UCODE_WOWLAN]; +- len = img->sec[IWL_UCODE_SECTION_DATA].len; +- +- bufsz = len * 4 + 256; +- buf = kzalloc(bufsz, GFP_KERNEL); +- if (!buf) +- return -ENOMEM; +- +- pos += scnprintf(buf, bufsz, "D3 SRAM capture: %sabled\n", +- mvm->store_d3_resume_sram ? "en" : "dis"); +- +- if (ptr) { +- for (ofs = 0; ofs < len; ofs += 16) { +- pos += scnprintf(buf + pos, bufsz - pos, +- "0x%.4x %16ph\n", ofs, ptr + ofs); +- } +- } else { +- pos += scnprintf(buf + pos, bufsz - pos, +- "(no data captured)\n"); +- } +- +- ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); +- +- kfree(buf); +- +- return ret; +-} +-#endif +- + #define PRINT_MVM_REF(ref) do { \ + if (mvm->refs[ref]) \ + pos += scnprintf(buf + pos, bufsz - pos, \ +@@ -1872,9 +1819,6 @@ + MVM_DEBUGFS_READ_WRITE_FILE_OPS(bcast_filters_macs, 256); + #endif + +-#ifdef CONFIG_PM_SLEEP +-MVM_DEBUGFS_READ_WRITE_FILE_OPS(d3_sram, 8); +-#endif + #ifdef CONFIG_ACPI + MVM_DEBUGFS_READ_FILE_OPS(sar_geo_profile); + #endif +@@ -2091,7 +2035,6 @@ + #endif + + #ifdef CONFIG_PM_SLEEP +- MVM_DEBUGFS_ADD_FILE(d3_sram, mvm->debugfs_dir, 0600); + MVM_DEBUGFS_ADD_FILE(d3_test, mvm->debugfs_dir, 0400); + debugfs_create_bool("d3_wake_sysassert", 0600, mvm->debugfs_dir, + &mvm->d3_wake_sysassert); +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-09-08 16:05:35.630952873 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-09-11 11:38:55.198303534 +0200 +@@ -1004,8 +1004,6 @@ + #ifdef CONFIG_IWLWIFI_DEBUGFS + bool d3_wake_sysassert; + bool d3_test_active; +- bool store_d3_resume_sram; +- void *d3_resume_sram; + u32 d3_test_pme_ptr; + struct ieee80211_vif *keep_vif; + u32 last_netdetect_scans; /* no. of scans in the last net-detect wake */ +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-09-08 16:05:36.058947363 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-09-11 11:38:55.199303513 +0200 +@@ -903,9 +903,6 @@ + kfree(mvm->error_recovery_buf); + mvm->error_recovery_buf = NULL; + +-#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_IWLWIFI_DEBUGFS) +- kfree(mvm->d3_resume_sram); +-#endif + iwl_trans_op_mode_leave(mvm->trans); + + iwl_phy_db_free(mvm->phy_db); diff --git a/SOURCES/_RHEL8_PATCH_18-45_iwlwifi_fix_load_in_rfkill_flow_for_unified_firmwar.patch b/SOURCES/_RHEL8_PATCH_18-45_iwlwifi_fix_load_in_rfkill_flow_for_unified_firmwar.patch new file mode 100644 index 0000000..ee7d8d5 --- /dev/null +++ b/SOURCES/_RHEL8_PATCH_18-45_iwlwifi_fix_load_in_rfkill_flow_for_unified_firmwar.patch @@ -0,0 +1,207 @@ +Date: Fri, 19 Jul 2019 11:39:45 -0400 +From: Jarod Wilson +To: rhkernel-list@redhat.com +Cc: Jarod Wilson +Subject: [RHEL8 PATCH 18/45] iwlwifi: fix load in rfkill flow for unified + firmware + +Bugzilla: http://bugzilla.redhat.com/1728992 + +commit b3500b472c880b5abe90ffd5c4a25aa736f906ad +Author: Emmanuel Grumbach +Date: Wed May 29 16:39:50 2019 +0300 + + iwlwifi: fix load in rfkill flow for unified firmware + + When we have a single image (same firmware image for INIT and + OPERATIONAL), we couldn't load the driver and register to the + stack if we had hardware RF-Kill asserted. + + Fix this. This required a few changes: + + 1) Run the firmware as part of the INIT phase even if its + ucode_type is not IWL_UCODE_INIT. + 2) Send the commands that are sent to the unified image in + INIT flow even in RF-Kill. + 3) Don't ask the transport to stop the hardware upon RF-Kill + interrupt if the RF-Kill is asserted. + 4) Allow the RF-Kill interrupt to take us out of L1A so that + the RF-Kill interrupt will be received by the host (to + enable the radio). + + Signed-off-by: Emmanuel Grumbach + Signed-off-by: Luca Coelho + Signed-off-by: Kalle Valo + +Signed-off-by: Jarod Wilson +--- + drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 23 ++++++++++++++----- + .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +- + drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 +- + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 17 ++++++++++---- + .../wireless/intel/iwlwifi/pcie/internal.h | 2 +- + 5 files changed, 33 insertions(+), 13 deletions(-) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/fw.c 2019-09-08 16:05:32.735990145 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/fw.c 2019-09-11 11:39:11.178977764 +0200 +@@ -311,6 +311,8 @@ + int ret, i; + enum iwl_ucode_type old_type = mvm->fwrt.cur_fw_img; + static const u16 alive_cmd[] = { MVM_ALIVE }; ++ bool run_in_rfkill = ++ ucode_type == IWL_UCODE_INIT || iwl_mvm_has_unified_ucode(mvm); + + if (ucode_type == IWL_UCODE_REGULAR && + iwl_fw_dbg_conf_usniffer(mvm->fw, FW_DBG_START_FROM_ALIVE) && +@@ -328,7 +330,12 @@ + alive_cmd, ARRAY_SIZE(alive_cmd), + iwl_alive_fn, &alive_data); + +- ret = iwl_trans_start_fw(mvm->trans, fw, ucode_type == IWL_UCODE_INIT); ++ /* ++ * We want to load the INIT firmware even in RFKILL ++ * For the unified firmware case, the ucode_type is not ++ * INIT, but we still need to run it. ++ */ ++ ret = iwl_trans_start_fw(mvm->trans, fw, run_in_rfkill); + if (ret) { + iwl_fw_set_current_image(&mvm->fwrt, old_type); + iwl_remove_notification(&mvm->notif_wait, &alive_wait); +@@ -436,7 +443,8 @@ + * commands + */ + ret = iwl_mvm_send_cmd_pdu(mvm, WIDE_ID(SYSTEM_GROUP, +- INIT_EXTENDED_CFG_CMD), 0, ++ INIT_EXTENDED_CFG_CMD), ++ CMD_SEND_IN_RFKILL, + sizeof(init_cfg), &init_cfg); + if (ret) { + IWL_ERR(mvm, "Failed to run init config command: %d\n", +@@ -460,7 +468,8 @@ + } + + ret = iwl_mvm_send_cmd_pdu(mvm, WIDE_ID(REGULATORY_AND_NVM_GROUP, +- NVM_ACCESS_COMPLETE), 0, ++ NVM_ACCESS_COMPLETE), ++ CMD_SEND_IN_RFKILL, + sizeof(nvm_complete), &nvm_complete); + if (ret) { + IWL_ERR(mvm, "Failed to run complete NVM access: %d\n", +@@ -485,6 +494,8 @@ + } + } + ++ mvm->rfkill_safe_init_done = true; ++ + return 0; + + error: +@@ -529,7 +540,7 @@ + + lockdep_assert_held(&mvm->mutex); + +- if (WARN_ON_ONCE(mvm->calibrating)) ++ if (WARN_ON_ONCE(mvm->rfkill_safe_init_done)) + return 0; + + iwl_init_notification_wait(&mvm->notif_wait, +@@ -579,7 +590,7 @@ + goto remove_notif; + } + +- mvm->calibrating = true; ++ mvm->rfkill_safe_init_done = true; + + /* Send TX valid antennas before triggering calibrations */ + ret = iwl_send_tx_ant_cfg(mvm, iwl_mvm_get_valid_tx_ant(mvm)); +@@ -615,7 +626,7 @@ + remove_notif: + iwl_remove_notification(&mvm->notif_wait, &calib_wait); + out: +- mvm->calibrating = false; ++ mvm->rfkill_safe_init_done = false; + if (iwlmvm_mod_params.init_dbg && !mvm->nvm_data) { + /* we want to debug INIT and we have no NVM - fake */ + mvm->nvm_data = kzalloc(sizeof(struct iwl_nvm_data) + +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-08 16:05:35.487954714 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 2019-09-11 11:39:11.179977744 +0200 +@@ -1048,7 +1048,7 @@ + + mvm->scan_status = 0; + mvm->ps_disabled = false; +- mvm->calibrating = false; ++ mvm->rfkill_safe_init_done = false; + + /* just in case one was running */ + iwl_mvm_cleanup_roc_te(mvm); +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-09-11 11:38:55.198303534 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 2019-09-11 11:39:11.179977744 +0200 +@@ -844,7 +844,7 @@ + struct iwl_mvm_vif *bf_allowed_vif; + + bool hw_registered; +- bool calibrating; ++ bool rfkill_safe_init_done; + bool support_umac_log; + + u32 ampdu_ref; +Index: src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-09-11 11:38:55.199303513 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/mvm/ops.c 2019-09-11 11:39:11.180977724 +0200 +@@ -1167,7 +1167,8 @@ + static bool iwl_mvm_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state) + { + struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); +- bool calibrating = READ_ONCE(mvm->calibrating); ++ bool rfkill_safe_init_done = READ_ONCE(mvm->rfkill_safe_init_done); ++ bool unified = iwl_mvm_has_unified_ucode(mvm); + + if (state) + set_bit(IWL_MVM_STATUS_HW_RFKILL, &mvm->status); +@@ -1176,15 +1177,23 @@ + + iwl_mvm_set_rfkill_state(mvm); + +- /* iwl_run_init_mvm_ucode is waiting for results, abort it */ +- if (calibrating) ++ /* iwl_run_init_mvm_ucode is waiting for results, abort it. */ ++ if (rfkill_safe_init_done) + iwl_abort_notification_waits(&mvm->notif_wait); + + /* ++ * Don't ask the transport to stop the firmware. We'll do it ++ * after cfg80211 takes us down. ++ */ ++ if (unified) ++ return false; ++ ++ /* + * Stop the device if we run OPERATIONAL firmware or if we are in the + * middle of the calibrations. + */ +- return state && (mvm->fwrt.cur_fw_img != IWL_UCODE_INIT || calibrating); ++ return state && (mvm->fwrt.cur_fw_img != IWL_UCODE_INIT || ++ rfkill_safe_init_done); + } + + static void iwl_mvm_free_skb(struct iwl_op_mode *op_mode, struct sk_buff *skb) +Index: src/drivers/net/wireless/intel/iwlwifi/pcie/internal.h +=================================================================== +--- src.orig/drivers/net/wireless/intel/iwlwifi/pcie/internal.h 2019-06-27 14:54:04.143678216 +0200 ++++ src/drivers/net/wireless/intel/iwlwifi/pcie/internal.h 2019-09-11 11:39:11.181977703 +0200 +@@ -928,7 +928,7 @@ + MSIX_HW_INT_CAUSES_REG_RF_KILL); + } + +- if (trans->cfg->device_family == IWL_DEVICE_FAMILY_9000) { ++ if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_9000) { + /* + * On 9000-series devices this bit isn't enabled by default, so + * when we power down the device we need set the bit to allow it diff --git a/SOURCES/_RHEL8_PATCH_19-45_iwlwifi_clear_persistence_bit_according_to_device_f.patch b/SOURCES/_RHEL8_PATCH_19-45_iwlwifi_clear_persistence_bit_according_to_device_f.patch new file mode 100644 index 0000000..bb3148e --- /dev/null +++ b/SOURCES/_RHEL8_PATCH_19-45_iwlwifi_clear_persistence_bit_according_to_device_f.patch @@ -0,0 +1,126 @@ +Date: Fri, 19 Jul 2019 11:39:46 -0400 +From: Jarod Wilson +To: rhkernel-list@redhat.com +Cc: Jarod Wilson +Subject: [RHEL8 PATCH 19/45] iwlwifi: clear persistence bit according to + device family + +Bugzilla: http://bugzilla.redhat.com/1728992 + +commit 44f61b5c832c4085fcf476484efeaeef96dcfb8b +Author: Shahar S Matityahu +Date: Wed May 29 16:39:51 2019 +0300 + + iwlwifi: clear persistence bit according to device family + + The driver attempts to clear persistence bit on any device familiy even + though only 9000 and 22000 families require it. Clear the bit only on + the relevant device families. + + Each HW has different address to the write protection register. Use the + right register for each HW + + Signed-off-by: Shahar S Matityahu + Fixes: 8954e1eb2270 ("iwlwifi: trans: Clear persistence bit when starting the FW") + Signed-off-by: Luca Coelho + Signed-off-by: Kalle Valo + +Signed-off-by: Jarod Wilson +--- + drivers/net/wireless/intel/iwlwifi/iwl-prph.h | 7 ++- + .../net/wireless/intel/iwlwifi/pcie/trans.c | 46 +++++++++++++------ + 2 files changed, 39 insertions(+), 14 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-prph.h b/drivers/net/wireless/intel/iwlwifi/iwl-prph.h +index 8e6a0c363c0d..925f308764bf 100644 +--- a/drivers/net/wireless/intel/iwlwifi/iwl-prph.h ++++ b/drivers/net/wireless/intel/iwlwifi/iwl-prph.h +@@ -408,7 +408,12 @@ enum aux_misc_master1_en { + #define AUX_MISC_MASTER1_SMPHR_STATUS 0xA20800 + #define RSA_ENABLE 0xA24B08 + #define PREG_AUX_BUS_WPROT_0 0xA04CC0 +-#define PREG_PRPH_WPROT_0 0xA04CE0 ++ ++/* device family 9000 WPROT register */ ++#define PREG_PRPH_WPROT_9000 0xA04CE0 ++/* device family 22000 WPROT register */ ++#define PREG_PRPH_WPROT_22000 0xA04D00 ++ + #define SB_CPU_1_STATUS 0xA01E30 + #define SB_CPU_2_STATUS 0xA01E34 + #define UMAG_SB_CPU_1_STATUS 0xA038C0 +diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +index 803fcbac4152..e9d1075d91db 100644 +--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c ++++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +@@ -1698,26 +1698,26 @@ static int iwl_pcie_init_msix_handler(struct pci_dev *pdev, + return 0; + } + +-static int _iwl_trans_pcie_start_hw(struct iwl_trans *trans, bool low_power) ++static int iwl_trans_pcie_clear_persistence_bit(struct iwl_trans *trans) + { +- struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); +- u32 hpm; +- int err; +- +- lockdep_assert_held(&trans_pcie->mutex); ++ u32 hpm, wprot; + +- err = iwl_pcie_prepare_card_hw(trans); +- if (err) { +- IWL_ERR(trans, "Error while preparing HW: %d\n", err); +- return err; ++ switch (trans->cfg->device_family) { ++ case IWL_DEVICE_FAMILY_9000: ++ wprot = PREG_PRPH_WPROT_9000; ++ break; ++ case IWL_DEVICE_FAMILY_22000: ++ wprot = PREG_PRPH_WPROT_22000; ++ break; ++ default: ++ return 0; + } + + hpm = iwl_read_umac_prph_no_grab(trans, HPM_DEBUG); + if (hpm != 0xa5a5a5a0 && (hpm & PERSISTENCE_BIT)) { +- int wfpm_val = iwl_read_umac_prph_no_grab(trans, +- PREG_PRPH_WPROT_0); ++ u32 wprot_val = iwl_read_umac_prph_no_grab(trans, wprot); + +- if (wfpm_val & PREG_WFPM_ACCESS) { ++ if (wprot_val & PREG_WFPM_ACCESS) { + IWL_ERR(trans, + "Error, can not clear persistence bit\n"); + return -EPERM; +@@ -1726,6 +1726,26 @@ static int _iwl_trans_pcie_start_hw(struct iwl_trans *trans, bool low_power) + hpm & ~PERSISTENCE_BIT); + } + ++ return 0; ++} ++ ++static int _iwl_trans_pcie_start_hw(struct iwl_trans *trans, bool low_power) ++{ ++ struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); ++ int err; ++ ++ lockdep_assert_held(&trans_pcie->mutex); ++ ++ err = iwl_pcie_prepare_card_hw(trans); ++ if (err) { ++ IWL_ERR(trans, "Error while preparing HW: %d\n", err); ++ return err; ++ } ++ ++ err = iwl_trans_pcie_clear_persistence_bit(trans); ++ if (err) ++ return err; ++ + iwl_trans_pcie_sw_reset(trans); + + err = iwl_pcie_apm_init(trans); +-- +2.20.1 + + diff --git a/SOURCES/_RHEL8_PATCH_20-45_iwlwifi_print_fseq_info_upon_fw_assert.patch b/SOURCES/_RHEL8_PATCH_20-45_iwlwifi_print_fseq_info_upon_fw_assert.patch new file mode 100644 index 0000000..643088d --- /dev/null +++ b/SOURCES/_RHEL8_PATCH_20-45_iwlwifi_print_fseq_info_upon_fw_assert.patch @@ -0,0 +1,151 @@ +Date: Fri, 19 Jul 2019 11:39:47 -0400 +From: Jarod Wilson +To: rhkernel-list@redhat.com +Cc: Jarod Wilson +Subject: [RHEL8 PATCH 20/45] iwlwifi: print fseq info upon fw assert + +Bugzilla: http://bugzilla.redhat.com/1728992 + +commit cc5470df4495049170d49466415680ee3c2a9a42 +Author: Shahar S Matityahu +Date: Wed May 29 16:39:52 2019 +0300 + + iwlwifi: print fseq info upon fw assert + + Read fseq info from FW registers and print it upon fw assert. + The print is needed since the fseq version coming from the TLV might + not be the actual version that is used. + + Signed-off-by: Shahar S Matityahu + Signed-off-by: Luca Coelho + Signed-off-by: Kalle Valo + +Signed-off-by: Jarod Wilson +--- + drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 39 +++++++++++++++++++ + drivers/net/wireless/intel/iwlwifi/fw/dbg.h | 2 + + drivers/net/wireless/intel/iwlwifi/iwl-prph.h | 15 ++++++- + .../net/wireless/intel/iwlwifi/mvm/utils.c | 2 + + .../net/wireless/intel/iwlwifi/pcie/trans.c | 3 +- + 5 files changed, 59 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c +index 5f52e40a2903..33d7bc5500db 100644 +--- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c ++++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c +@@ -2747,3 +2747,42 @@ void iwl_fw_dbg_periodic_trig_handler(struct timer_list *t) + jiffies + msecs_to_jiffies(collect_interval)); + } + } ++ ++#define FSEQ_REG(x) { .addr = (x), .str = #x, } ++ ++void iwl_fw_error_print_fseq_regs(struct iwl_fw_runtime *fwrt) ++{ ++ struct iwl_trans *trans = fwrt->trans; ++ unsigned long flags; ++ int i; ++ struct { ++ u32 addr; ++ const char *str; ++ } fseq_regs[] = { ++ FSEQ_REG(FSEQ_ERROR_CODE), ++ FSEQ_REG(FSEQ_TOP_INIT_VERSION), ++ FSEQ_REG(FSEQ_CNVIO_INIT_VERSION), ++ FSEQ_REG(FSEQ_OTP_VERSION), ++ FSEQ_REG(FSEQ_TOP_CONTENT_VERSION), ++ FSEQ_REG(FSEQ_ALIVE_TOKEN), ++ FSEQ_REG(FSEQ_CNVI_ID), ++ FSEQ_REG(FSEQ_CNVR_ID), ++ FSEQ_REG(CNVI_AUX_MISC_CHIP), ++ FSEQ_REG(CNVR_AUX_MISC_CHIP), ++ FSEQ_REG(CNVR_SCU_SD_REGS_SD_REG_DIG_DCDC_VTRIM), ++ FSEQ_REG(CNVR_SCU_SD_REGS_SD_REG_ACTIVE_VDIG_MIRROR), ++ }; ++ ++ if (!iwl_trans_grab_nic_access(trans, &flags)) ++ return; ++ ++ IWL_ERR(fwrt, "Fseq Registers:\n"); ++ ++ for (i = 0; i < ARRAY_SIZE(fseq_regs); i++) ++ IWL_ERR(fwrt, "0x%08X | %s\n", ++ iwl_read_prph_no_grab(trans, fseq_regs[i].addr), ++ fseq_regs[i].str); ++ ++ iwl_trans_release_nic_access(trans, &flags); ++} ++IWL_EXPORT_SYMBOL(iwl_fw_error_print_fseq_regs); +diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.h b/drivers/net/wireless/intel/iwlwifi/fw/dbg.h +index 2a9e560a906b..fd0ad220e961 100644 +--- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.h ++++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.h +@@ -471,4 +471,6 @@ static inline void iwl_fw_error_collect(struct iwl_fw_runtime *fwrt) + } + + void iwl_fw_dbg_periodic_trig_handler(struct timer_list *t); ++ ++void iwl_fw_error_print_fseq_regs(struct iwl_fw_runtime *fwrt); + #endif /* __iwl_fw_dbg_h__ */ +diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-prph.h b/drivers/net/wireless/intel/iwlwifi/iwl-prph.h +index 925f308764bf..8d930bfe0727 100644 +--- a/drivers/net/wireless/intel/iwlwifi/iwl-prph.h ++++ b/drivers/net/wireless/intel/iwlwifi/iwl-prph.h +@@ -395,7 +395,11 @@ enum { + WFPM_AUX_CTL_AUX_IF_MAC_OWNER_MSK = 0x80000000, + }; + +-#define AUX_MISC_REG 0xA200B0 ++#define CNVI_AUX_MISC_CHIP 0xA200B0 ++#define CNVR_AUX_MISC_CHIP 0xA2B800 ++#define CNVR_SCU_SD_REGS_SD_REG_DIG_DCDC_VTRIM 0xA29890 ++#define CNVR_SCU_SD_REGS_SD_REG_ACTIVE_VDIG_MIRROR 0xA29938 ++ + enum { + HW_STEP_LOCATION_BITS = 24, + }; +@@ -447,4 +451,13 @@ enum { + + #define UREG_DOORBELL_TO_ISR6 0xA05C04 + #define UREG_DOORBELL_TO_ISR6_NMI_BIT BIT(0) ++ ++#define FSEQ_ERROR_CODE 0xA340C8 ++#define FSEQ_TOP_INIT_VERSION 0xA34038 ++#define FSEQ_CNVIO_INIT_VERSION 0xA3403C ++#define FSEQ_OTP_VERSION 0xA340FC ++#define FSEQ_TOP_CONTENT_VERSION 0xA340F4 ++#define FSEQ_ALIVE_TOKEN 0xA340F0 ++#define FSEQ_CNVI_ID 0xA3408C ++#define FSEQ_CNVR_ID 0xA34090 + #endif /* __iwl_prph_h__ */ +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c +index b9914efc55c4..cc56ab88fb43 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c +@@ -596,6 +596,8 @@ void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm) + iwl_mvm_dump_lmac_error_log(mvm, 1); + + iwl_mvm_dump_umac_error_log(mvm); ++ ++ iwl_fw_error_print_fseq_regs(&mvm->fwrt); + } + + int iwl_mvm_reconfig_scd(struct iwl_mvm *mvm, int queue, int fifo, int sta_id, +diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +index e9d1075d91db..21da18af0155 100644 +--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c ++++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +@@ -3546,7 +3546,8 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, + hw_step |= ENABLE_WFPM; + iwl_write_umac_prph_no_grab(trans, WFPM_CTRL_REG, + hw_step); +- hw_step = iwl_read_prph_no_grab(trans, AUX_MISC_REG); ++ hw_step = iwl_read_prph_no_grab(trans, ++ CNVI_AUX_MISC_CHIP); + hw_step = (hw_step >> HW_STEP_LOCATION_BITS) & 0xF; + if (hw_step == 0x3) + trans->hw_rev = (trans->hw_rev & 0xFFFFFFF3) | +-- +2.20.1 + + diff --git a/SOURCES/_RHEL8_PATCH_21-45_iwlwifi_fix_AX201_killer_sku_loading_firmware_issue.patch b/SOURCES/_RHEL8_PATCH_21-45_iwlwifi_fix_AX201_killer_sku_loading_firmware_issue.patch new file mode 100644 index 0000000..4c13154 --- /dev/null +++ b/SOURCES/_RHEL8_PATCH_21-45_iwlwifi_fix_AX201_killer_sku_loading_firmware_issue.patch @@ -0,0 +1,56 @@ +Date: Fri, 19 Jul 2019 11:39:48 -0400 +From: Jarod Wilson +To: rhkernel-list@redhat.com +Cc: Jarod Wilson +Subject: [RHEL8 PATCH 21/45] iwlwifi: fix AX201 killer sku loading firmware + issue + +Bugzilla: http://bugzilla.redhat.com/1728992 + +commit b17dc0632a17fbfe66b34ee7c24e1cc10cfc503e +Author: Matt Chen +Date: Wed May 29 16:39:53 2019 +0300 + + iwlwifi: fix AX201 killer sku loading firmware issue + + When try to bring up the AX201 2 killer sku, we + run into: + [81261.392463] iwlwifi 0000:01:00.0: loaded firmware version 46.8c20f243.0 op_mode iwlmvm + [81261.407407] iwlwifi 0000:01:00.0: Detected Intel(R) Dual Band Wireless AX 22000, REV=0x340 + [81262.424778] iwlwifi 0000:01:00.0: Collecting data: trigger 16 fired. + [81262.673359] iwlwifi 0000:01:00.0: Start IWL Error Log Dump: + [81262.673365] iwlwifi 0000:01:00.0: Status: 0x00000000, count: -906373681 + [81262.673368] iwlwifi 0000:01:00.0: Loaded firmware version: 46.8c20f243.0 + [81262.673371] iwlwifi 0000:01:00.0: 0x507C015D | ADVANCED_SYSASSERT + + Fix this issue by adding 2 more cfg to avoid modifying the + original cfg configuration. + + Signed-off-by: Matt Chen + Signed-off-by: Luca Coelho + Signed-off-by: Kalle Valo + +Signed-off-by: Jarod Wilson +--- + drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +index 21da18af0155..dfa1bed124aa 100644 +--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c ++++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +@@ -3598,7 +3598,9 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, + } + } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) == + CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR) && +- (trans->cfg != &iwl_ax200_cfg_cc || ++ ((trans->cfg != &iwl_ax200_cfg_cc && ++ trans->cfg != &killer1650x_2ax_cfg && ++ trans->cfg != &killer1650w_2ax_cfg) || + trans->hw_rev == CSR_HW_REV_TYPE_QNJ_B0)) { + u32 hw_status; + +-- +2.20.1 + + diff --git a/SOURCES/_RHEL8_PATCH_22-45_iwlwifi_Fix_double-free_problems_in_iwl_req_fw_call.patch b/SOURCES/_RHEL8_PATCH_22-45_iwlwifi_Fix_double-free_problems_in_iwl_req_fw_call.patch new file mode 100644 index 0000000..4bec948 --- /dev/null +++ b/SOURCES/_RHEL8_PATCH_22-45_iwlwifi_Fix_double-free_problems_in_iwl_req_fw_call.patch @@ -0,0 +1,49 @@ +Date: Fri, 19 Jul 2019 11:39:49 -0400 +From: Jarod Wilson +To: rhkernel-list@redhat.com +Cc: Jarod Wilson +Subject: [RHEL8 PATCH 22/45] iwlwifi: Fix double-free problems in + iwl_req_fw_callback() + +Bugzilla: http://bugzilla.redhat.com/1728992 + +commit a8627176b0de7ba3f4524f641ddff4abf23ae4e4 +Author: Jia-Ju Bai +Date: Wed May 29 16:39:54 2019 +0300 + + iwlwifi: Fix double-free problems in iwl_req_fw_callback() + + In the error handling code of iwl_req_fw_callback(), iwl_dealloc_ucode() + is called to free data. In iwl_drv_stop(), iwl_dealloc_ucode() is called + again, which can cause double-free problems. + + To fix this bug, the call to iwl_dealloc_ucode() in + iwl_req_fw_callback() is deleted. + + This bug is found by a runtime fuzzing tool named FIZZER written by us. + + Signed-off-by: Jia-Ju Bai + Signed-off-by: Luca Coelho + Signed-off-by: Kalle Valo + +Signed-off-by: Jarod Wilson +--- + drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c +index 852d3cbfc719..fba242284507 100644 +--- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c ++++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c +@@ -1597,7 +1597,6 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) + goto free; + + out_free_fw: +- iwl_dealloc_ucode(drv); + release_firmware(ucode_raw); + out_unbind: + complete(&drv->request_firmware_complete); +-- +2.20.1 + + diff --git a/SOURCES/_RHEL8_PATCH_23-45_iwlwifi_mvm_change_TLC_config_cmd_sent_by_rs_to_be_.patch b/SOURCES/_RHEL8_PATCH_23-45_iwlwifi_mvm_change_TLC_config_cmd_sent_by_rs_to_be_.patch new file mode 100644 index 0000000..e268e2c --- /dev/null +++ b/SOURCES/_RHEL8_PATCH_23-45_iwlwifi_mvm_change_TLC_config_cmd_sent_by_rs_to_be_.patch @@ -0,0 +1,46 @@ +Date: Fri, 19 Jul 2019 11:39:50 -0400 +From: Jarod Wilson +To: rhkernel-list@redhat.com +Cc: Jarod Wilson +Subject: [RHEL8 PATCH 23/45] iwlwifi: mvm: change TLC config cmd sent by rs + to be async + +Bugzilla: http://bugzilla.redhat.com/1728992 + +commit 5f4d55d5791a8b7150dbaba239e92719ae0f94d4 +Author: Lior Cohen +Date: Wed May 29 16:39:55 2019 +0300 + + iwlwifi: mvm: change TLC config cmd sent by rs to be async + + The TLC_MNG_CONFIG sync cmd sent by the rs leads to a kernel warning + of sleeping while in rcu read-side critical section. The fix is to + change the command to be ASYNC (not blocking for the response anymore). + + Signed-off-by: Lior Cohen + Signed-off-by: Luca Coelho + Signed-off-by: Kalle Valo + +Signed-off-by: Jarod Wilson +--- + drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c +index 659e21b2d4e7..be62f499c595 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c +@@ -441,7 +441,8 @@ void rs_fw_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta, + */ + sta->max_amsdu_len = max_amsdu_len; + +- ret = iwl_mvm_send_cmd_pdu(mvm, cmd_id, 0, sizeof(cfg_cmd), &cfg_cmd); ++ ret = iwl_mvm_send_cmd_pdu(mvm, cmd_id, CMD_ASYNC, sizeof(cfg_cmd), ++ &cfg_cmd); + if (ret) + IWL_ERR(mvm, "Failed to send rate scale config (%d)\n", ret); + } +-- +2.20.1 + + diff --git a/SPECS/iwlwifi.spec b/SPECS/iwlwifi.spec new file mode 100644 index 0000000..4154b96 --- /dev/null +++ b/SPECS/iwlwifi.spec @@ -0,0 +1,586 @@ +%define kmod_name iwlwifi +%define kmod_vendor redhat +%define kmod_driver_version 4.18.0_107_dup8.0 +%define kmod_driver_epoch %{nil} +%define kmod_rpm_release 5 +%define kmod_kernel_version 4.18.0-80.el8 +%define kmod_kernel_version_min %{nil} +%define kmod_kernel_version_dep %{nil} +%define kmod_kbuild_dir drivers/net/wireless/intel/iwlwifi +%define kmod_dependencies (dracut >= 049-10.git20190115.el8_0.1 if kernel > 4.18.0-80.el8) +%define kmod_dist_build_deps %{nil} +%define kmod_build_dependencies %{nil} +%define kmod_devel_package 1 +%define kmod_install_path extra/kmod-redhat-iwlwifi +%define kernel_pkg kernel +%define kernel_devel_pkg kernel-devel +%define kernel_modules_pkg kernel-modules + +%{!?dist: %define dist .el8_0} +%{!?make_build: %define make_build make} + +%if "%{kmod_kernel_version_dep}" == "" +%define kmod_kernel_version_dep %{kmod_kernel_version} +%endif + +%if "%{kmod_dist_build_deps}" == "" +%if (0%{?rhel} > 7) || (0%{?centos} > 7) +%define kmod_dist_build_deps redhat-rpm-config kernel-abi-whitelists elfutils-libelf-devel kernel-rpm-macros kmod +%else +%define kmod_dist_build_deps redhat-rpm-config kernel-abi-whitelists +%endif +%endif + +Source0: %{kmod_name}-%{kmod_vendor}-%{kmod_driver_version}.tar.bz2 +# Source code patches +Patch0: 0001-Revert-netlink-make-validation-more-configurable-for.patch +Patch1: 0002-Revert-iwlwifi-mvm-fix-merge-damage-in-iwl_mvm_vif_d.patch +Patch2: 0003-Revert-iwlwifi-mvm-fix-pointer-reference-when-settin.patch +Patch3: 0004-Revert-iwlwifi-remove-unnecessary-goto-out-in-iwl_pa.patch +Patch4: 0005-Revert-iwlwifi-Use-struct_size-in-kzalloc.patch +Patch5: 0006-Revert-mac80211-update-HE-IEs-to-D3.3.patch +Patch6: 0007-Revert-iwlwifi-mvm-report-FTM-start-time-TSF-when-ap.patch +Patch7: 0008-Revert-iwlwifi-mvm-support-rtt-confidence-indication.patch +Patch8: 0009-Revert-iwlwifi-fix-64-bit-division.patch +Patch9: 0010-Revert-iwlwifi-mvm-add-debug-prints-for-FTM.patch +Patch10: 0011-Revert-iwlwifi-mvm-add-support-for-new-FTM-fw-API.patch +Patch11: 0012-Revert-iwlwifi-mvm-support-FTM-initiator.patch +Patch12: 0013-Revert-iwlwifi-mvm-support-FTM-responder.patch +Patch13: 0014-Revert-iwlwifi-mvm-support-HE-context-cmd-API-change.patch +Patch14: 0015-Revert-iwlwifi-mvm-support-multiple-BSSID.patch +Patch15: 0016-Revert-iwlwifi-mvm-advertise-support-for-TWT-in-the-.patch +Patch16: 0017-Revert-iwlwifi-mvm-limit-AMSDU-size-to-8K.patch +Patch17: 0018-Revert-iwlwifi-mvm-bring-back-mvm-GSO-code.patch +Patch18: 0019-Revert-iwlwifi-mvm-support-mac80211-AMSDU.patch +Patch19: 0020-Revert-iwlwifi-mvm-remove-redundant-condition.patch +Patch20: 0021-Revert-iwlwifi-mvm-stop-static-queues-correctly.patch +Patch21: 0022-Revert-iwlwifi-mvm-remove-buggy-and-unnecessary-hw_q.patch +Patch22: 0023-Revert-iwlwifi-mvm-support-mac80211-TXQs-model.patch +Patch23: 0024-Revert-iwlwifi-nvm-parse-advertise-IEEE80211_VHT_EXT.patch +Patch24: 0025-Revert-iwlwifi-mvm-set-HW-capability-VHT_EXT_NSS_BW.patch +Patch25: 0026-Revert-iwlwifi-mvm-config-mac-ctxt-to-HE-before-TLC.patch +Patch26: 0027-Revert-iwlwifi-mvm-send-the-STA_HE_CTXT-command-in-A.patch +Patch27: 0028-Revert-iwlwifi-trust-calling-function.patch +Patch28: 0029-Revert-iwlwifi-split-HE-capabilities-between-AP-and-.patch +Patch29: 0030-Revert-wireless-align-to-draft-11ax-D3.0.patch +Patch30: 0031-Revert-iwlwifi-add-module-parameter-to-disable-802.1.patch +Patch31: 0032-Revert-iwlwifi-mvm-limit-TLC-according-to-our-HE-cap.patch +Patch32: 0033-Revert-iwlwifi-rs-consider-LDPC-capability-in-case-o.patch +Patch33: 0034-Revert-iwlwifi-mvm-fix-HE-radiotap-data4-for-HE-TB-P.patch +Patch34: 0035-Revert-iwlwifi-mvm-radiotap-remove-UL_DL-bit-in-HE-T.patch +Patch35: 0036-Revert-iwlwifi-mvm-report-all-NO_DATA-events-to-mac8.patch +Patch36: 0037-Revert-iwlwifi-mvm-fix-the-spatial-reuse-parsing-for.patch +Patch37: 0038-Revert-iwlwifi-mvm-clean-up-NO_PSDU-case.patch +Patch38: 0039-Revert-iwlwifi-mvm-don-t-hide-HE-radiotap-data-in-SK.patch +Patch39: 0040-Revert-iwlwifi-mvm-add-HE-TB-PPDU-SIG-A-BW-to-radiot.patch +Patch40: 0041-Revert-iwlwifi-iwlmvm-ignore-HE-PPDU-type-regarding-.patch +Patch41: 0042-Revert-iwlwifi-mvm-add-L-SIG-length-to-radiotap.patch +Patch42: 0043-Revert-iwlwifi-mvm-change-PHY-data-RX-for-HE-radiota.patch +Patch43: 0044-Revert-iwlwifi-mvm-remove-set-but-not-used-variable-.patch +Patch44: 0045-Revert-iwlwifi-mvm-show-more-HE-radiotap-data-for-TB.patch +Patch45: 0046-Revert-iwlwifi-mvm-decode-HE-information-for-MU-with.patch +Patch46: 0047-Revert-iwlwifi-mvm-add-more-information-to-HE-radiot.patch +Patch47: 0048-Revert-iwlwifi-mvm-add-LDPC-XSYM-to-HE-radiotap-data.patch +Patch48: 0049-Revert-iwlwifi-mvm-add-TXOP-to-HE-radiotap-data.patch +Patch49: 0050-Revert-iwlwifi-mvm-move-HE-MU-LTF_NUM-parsing-to-he_.patch +Patch50: 0051-Revert-iwlwifi-mvm-clean-up-HE-radiotap-RU-allocatio.patch +Patch51: 0052-Revert-iwlwifi-mvm-pull-some-he_phy_data-decoding-in.patch +Patch52: 0053-Revert-iwlwifi-mvm-put-HE-SIG-B-symbols-users-data-c.patch +Patch53: 0054-Revert-iwlwifi-mvm-minor-cleanups-to-HE-radiotap-cod.patch +Patch54: 0055-Revert-iwlwifi-mvm-remove-unnecessary-overload-varia.patch +Patch55: 0056-Revert-iwlwifi-mvm-report-RU-offset-is-known.patch +Patch56: 0057-Revert-iwlwifi-mvm-decode-HE-TB-PPDU-data.patch +Patch57: 0058-Revert-iwlwifi-mvm-remove-channel-2-from-HE-radiotap.patch +Patch58: 0059-Revert-iwlwifi-mvm-report-of-LTF-symbols-for-extende.patch +Patch59: 0060-Revert-iwlwifi-mvm-properly-decode-HE-GI-duration.patch +Patch60: 0061-Revert-iwlwifi-mvm-put-LTF-symbol-size-into-HE-radio.patch +Patch61: 0062-Revert-iwlwifi-RX-API-remove-unnecessary-anonymous-s.patch +Patch62: 0063-Revert-iwlwifi-mvm-implement-extended-HE-MU-sniffer-.patch +Patch63: 0064-Revert-iwlwifi-mvm-move-he-RX-handling-to-a-separate.patch +Patch64: 0065-Revert-iwlwifi-iwlmvm-fix-typo-when-checking-for-TX-.patch +Patch65: 0066-Revert-iwlwifi-mvm-move-he-RX-handling-to-a-separate.patch +Patch66: 0067-Revert-iwlwifi-mvm-add-support-for-RX_AMPDU_EOF-bit-.patch +Patch67: 0068-Revert-iwlwifi-mvm-add-bss-color-to-radiotap.patch +Patch68: 0069-Revert-iwlwifi-support-new-rx_mpdu_desc-api.patch +Patch69: 0070-Revert-iwlwifi-mvm-add-radiotap-data-for-HE.patch +Patch70: 0071-Revert-iwlwifi-mvm-set-MAC_FILTER_IN_11AX-in-AP-mode.patch +Patch71: 0072-Revert-iwlwifi-add-support-for-IEEE802.11ax.patch +Patch72: 0073-Revert-iwlwifi-mvm-update-firmware-when-MU-EDCA-para.patch +Patch73: 0074-Revert-iwlwifi-mvm-report-delayed-beacon-count-to-FW.patch +Patch74: 0075-Revert-iwlwifi-mvm-track-changes-in-beacon-count-dur.patch +Patch75: 0076-Revert-iwlwifi-mvm-disconnect-in-case-of-bad-channel.patch +Patch76: 0077-Revert-iwlwifi-mvm-notify-FW-on-quiet-mode-in-CSA.patch +Patch77: 0078-Revert-iwlwifi-mvm-track-CSA-beacons.patch +Patch78: 0079-Revert-iwlwifi-mvm-implement-CSA-abort.patch +Patch79: 0080-Revert-iwlwifi-nvm-parse-use-struct_size-in-kzalloc.patch +Patch80: 0081-Revert-iwlwifi-support-new-NVM-response-API.patch +Patch81: 0082-Revert-iwlwifi-add-support-for-6-7-GHz-channels.patch +Patch82: 0083-Revert-iwlwifi-use-kmemdup-in-iwl_parse_nvm_mcc_info.patch +Patch83: 0084-Revert-cfg80211-make-wmm_rule-part-of-the-reg_rule-s.patch +Patch84: 0085-Revert-iwlwifi-Use-correct-channel_profile-iniwl_get.patch +Patch85: 0086-Revert-iwlwifi-mvm-report-all-NO_DATA-events-to-mac8.patch +Patch86: 0087-Revert-iwlwifi-mvm-add-read-debugfs-for-he_sniffer_p.patch +Patch87: 0088-Revert-iwlwifi-mvm-include-configured-sniffer-AID-in.patch +Patch88: 0089-Revert-iwlwifi-mvm-implement-CSI-reporting.patch +Patch89: 0090-Revert-iwlwifi-iwlmvm-in-monitor-NDP-notif-take-the-.patch +Patch90: 0091-Revert-iwlwifi-mvm-handle-RX-no-data-notification.patch +Patch91: 0092-Revert-iwlwifi-mvm-fix-merge-damage-in-iwl_mvm_rx_mp.patch +Patch92: 0093-Revert-iwlwifi-mvm-implement-VHT-extended-NSS-suppor.patch +Patch93: 0094-Revert-iwlwifi-fw-do-not-set-sgi-bits-for-HE-connect.patch +Patch94: 0095-Revert-iwlwifi-mvm-fix-wrong-DCM-TLC-config.patch +Patch95: 0096-Revert-iwlwifi-rs-fw-support-dcm.patch +Patch96: 0097-Revert-iwlwifi-rs-fw-enable-STBC-in-he-correctly.patch +Patch97: 0000-add-back-rate_name-items-rs_sta_dbgfs_drv_tx_stats_read.patch +Patch98: 0000-add-iwlwifi_backport_compat-h.patch +Patch99: 0000-bump-module-version.patch +Patch100: 0000-define-IEEE80211_MAX_AMPDU_BUF_HT.patch +Patch101: 0000-fixup-firmware-modinfo.patch +Patch102: 0000-no-cap_he-check-iwl_mvm_max_amsdu_size.patch +Patch103: 0000-use-DUP-firmware-files.patch +Patch104: _RHEL8_PATCH_17-45_iwlwifi_mvm_remove_d3_sram_debugfs_file.patch +Patch105: _RHEL8_PATCH_18-45_iwlwifi_fix_load_in_rfkill_flow_for_unified_firmwar.patch +Patch106: _RHEL8_PATCH_19-45_iwlwifi_clear_persistence_bit_according_to_device_f.patch +Patch107: _RHEL8_PATCH_20-45_iwlwifi_print_fseq_info_upon_fw_assert.patch +Patch108: _RHEL8_PATCH_21-45_iwlwifi_fix_AX201_killer_sku_loading_firmware_issue.patch +Patch109: _RHEL8_PATCH_22-45_iwlwifi_Fix_double-free_problems_in_iwl_req_fw_call.patch +Patch110: _RHEL8_PATCH_23-45_iwlwifi_mvm_change_TLC_config_cmd_sent_by_rs_to_be_.patch + +%define findpat %( echo "%""P" ) +%define __find_requires /usr/lib/rpm/redhat/find-requires.ksyms +%define __find_provides /usr/lib/rpm/redhat/find-provides.ksyms %{kmod_name} %{?epoch:%{epoch}:}%{version}-%{release} +%define sbindir %( if [ -d "/sbin" -a \! -h "/sbin" ]; then echo "/sbin"; else echo %{_sbindir}; fi ) +%define dup_state_dir %{_localstatedir}/lib/rpm-state/kmod-dups +%define kver_state_dir %{dup_state_dir}/kver +%define kver_state_file %{kver_state_dir}/%{kmod_kernel_version}.%(arch) +%define dup_module_list %{dup_state_dir}/rpm-kmod-%{kmod_name}-modules + +Name: kmod-redhat-iwlwifi +Version: %{kmod_driver_version} +Release: %{kmod_rpm_release}%{?dist} +%if "%{kmod_driver_epoch}" != "" +Epoch: %{kmod_driver_epoch} +%endif +Summary: iwlwifi kernel module for Driver Update Program +Group: System/Kernel +License: GPLv2 +URL: https://www.kernel.org/ +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) +BuildRequires: %kernel_devel_pkg = %kmod_kernel_version +%if "%{kmod_dist_build_deps}" != "" +BuildRequires: %{kmod_dist_build_deps} +%endif +ExclusiveArch: x86_64 +%global kernel_source() /usr/src/kernels/%{kmod_kernel_version}.$(arch) + +%global _use_internal_dependency_generator 0 +%if "%{?kmod_kernel_version_min}" != "" +Provides: %kernel_modules_pkg >= %{kmod_kernel_version_min}.%{_target_cpu} +%else +Provides: %kernel_modules_pkg = %{kmod_kernel_version_dep}.%{_target_cpu} +%endif +Provides: kmod-%{kmod_name} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires(post): %{sbindir}/weak-modules +Requires(postun): %{sbindir}/weak-modules +Requires: kernel >= 4.18.0-80.el8 + +Requires: kernel < 4.18.0-81.el8 +%if 1 +Requires: firmware(%{kmod_name}) = 20190516_dup8.0 +%endif +%if "%{kmod_build_dependencies}" != "" +BuildRequires: %{kmod_build_dependencies} +%endif +%if "%{kmod_dependencies}" != "" +Requires: %{kmod_dependencies} +%endif +# if there are multiple kmods for the same driver from different vendors, +# they should conflict with each other. +Conflicts: kmod-%{kmod_name} + +%description +iwlwifi kernel module for Driver Update Program + +%if 1 + +%package -n kmod-redhat-iwlwifi-firmware +Version: 20190516_dup8.0 +Summary: iwlwifi firmware for Driver Update Program +Provides: firmware(%{kmod_name}) = 20190516_dup8.0 +%if "%{kmod_kernel_version_min}" != "" +Provides: %kernel_modules_pkg >= %{kmod_kernel_version_min}.%{_target_cpu} +%else +Provides: %kernel_modules_pkg = %{kmod_kernel_version_dep}.%{_target_cpu} +%endif +%description -n kmod-redhat-iwlwifi-firmware +iwlwifi firmware for Driver Update Program + + +%files -n kmod-redhat-iwlwifi-firmware +%defattr(644,root,root,755) +/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-41.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-34.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-34.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-29.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-41.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265-17.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-27.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-27.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-43.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-38.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-46.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-10.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-7260-17.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-21.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-31.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-27.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-21.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-22.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-3168-22.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-16.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-17.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-7260-16.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-3168-27.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-3168-21.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-22.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-16.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-22.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-34.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-3160-17.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-46.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-36.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-3160-16.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-3168-29.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-cc-a0-46.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-21.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-38.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-43.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-33.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-33.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-34.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-36.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-31.ucode +/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265-16.ucode + + +%endif + +# Development package +%if 0%{kmod_devel_package} +%package -n kmod-redhat-iwlwifi-devel +Version: %{kmod_driver_version} +Requires: kernel >= 4.18.0-80.el8 + +Requires: kernel < 4.18.0-81.el8 +Summary: iwlwifi development files for Driver Update Program + +%description -n kmod-redhat-iwlwifi-devel +iwlwifi development files for Driver Update Program + + +%files -n kmod-redhat-iwlwifi-devel +%defattr(644,root,root,755) +/usr/share/kmod-%{kmod_vendor}-%{kmod_name}/Module.symvers +%endif + +%post +modules=( $(find /lib/modules/%{kmod_kernel_version}.%(arch)/%{kmod_install_path} | grep '\.ko$') ) +printf '%s\n' "${modules[@]}" | %{sbindir}/weak-modules --add-modules --no-initramfs + +mkdir -p "%{kver_state_dir}" +touch "%{kver_state_file}" + +exit 0 + +%posttrans +# We have to re-implement part of weak-modules here because it doesn't allow +# calling initramfs regeneration separately +if [ -f "%{kver_state_file}" ]; then + kver_base="%{kmod_kernel_version_dep}" + kvers=$(ls -d "/lib/modules/${kver_base%%.*}"*) + + for k_dir in $kvers; do + k="${k_dir#/lib/modules/}" + + tmp_initramfs="/boot/initramfs-$k.tmp" + dst_initramfs="/boot/initramfs-$k.img" + + # The same check as in weak-modules: we assume that the kernel present + # if the symvers file exists. + if [ -e "/boot/symvers-$k.gz" ]; then + /usr/bin/dracut -f "$tmp_initramfs" "$k" || exit 1 + cmp -s "$tmp_initramfs" "$dst_initramfs" + if [ "$?" = 1 ]; then + mv "$tmp_initramfs" "$dst_initramfs" + else + rm -f "$tmp_initramfs" + fi + fi + done + + rm -f "%{kver_state_file}" + rmdir "%{kver_state_dir}" 2> /dev/null +fi + +rmdir "%{dup_state_dir}" 2> /dev/null + +exit 0 + +%preun +if rpm -q --filetriggers kmod 2> /dev/null| grep -q "Trigger for weak-modules call on kmod removal"; then + mkdir -p "%{kver_state_dir}" + touch "%{kver_state_file}" +fi + +mkdir -p "%{dup_state_dir}" +rpm -ql kmod-redhat-iwlwifi-%{kmod_driver_version}-%{kmod_rpm_release}%{?dist}.$(arch) | \ + grep '\.ko$' > "%{dup_module_list}" + +%postun +if rpm -q --filetriggers kmod 2> /dev/null| grep -q "Trigger for weak-modules call on kmod removal"; then + initramfs_opt="--no-initramfs" +else + initramfs_opt="" +fi + +modules=( $(cat "%{dup_module_list}") ) +rm -f "%{dup_module_list}" +printf '%s\n' "${modules[@]}" | %{sbindir}/weak-modules --remove-modules $initramfs_opt + +rmdir "%{dup_state_dir}" 2> /dev/null + +exit 0 + +%files +%defattr(644,root,root,755) +/lib/modules/%{kmod_kernel_version}.%(arch) +/etc/depmod.d/%{kmod_name}.conf +/usr/share/doc/kmod-%{kmod_name}/greylist.txt + +%prep +%setup -n %{kmod_name}-%{kmod_vendor}-%{kmod_driver_version} + +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 +%patch18 -p1 +%patch19 -p1 +%patch20 -p1 +%patch21 -p1 +%patch22 -p1 +%patch23 -p1 +%patch24 -p1 +%patch25 -p1 +%patch26 -p1 +%patch27 -p1 +%patch28 -p1 +%patch29 -p1 +%patch30 -p1 +%patch31 -p1 +%patch32 -p1 +%patch33 -p1 +%patch34 -p1 +%patch35 -p1 +%patch36 -p1 +%patch37 -p1 +%patch38 -p1 +%patch39 -p1 +%patch40 -p1 +%patch41 -p1 +%patch42 -p1 +%patch43 -p1 +%patch44 -p1 +%patch45 -p1 +%patch46 -p1 +%patch47 -p1 +%patch48 -p1 +%patch49 -p1 +%patch50 -p1 +%patch51 -p1 +%patch52 -p1 +%patch53 -p1 +%patch54 -p1 +%patch55 -p1 +%patch56 -p1 +%patch57 -p1 +%patch58 -p1 +%patch59 -p1 +%patch60 -p1 +%patch61 -p1 +%patch62 -p1 +%patch63 -p1 +%patch64 -p1 +%patch65 -p1 +%patch66 -p1 +%patch67 -p1 +%patch68 -p1 +%patch69 -p1 +%patch70 -p1 +%patch71 -p1 +%patch72 -p1 +%patch73 -p1 +%patch74 -p1 +%patch75 -p1 +%patch76 -p1 +%patch77 -p1 +%patch78 -p1 +%patch79 -p1 +%patch80 -p1 +%patch81 -p1 +%patch82 -p1 +%patch83 -p1 +%patch84 -p1 +%patch85 -p1 +%patch86 -p1 +%patch87 -p1 +%patch88 -p1 +%patch89 -p1 +%patch90 -p1 +%patch91 -p1 +%patch92 -p1 +%patch93 -p1 +%patch94 -p1 +%patch95 -p1 +%patch96 -p1 +%patch97 -p1 +%patch98 -p1 +%patch99 -p1 +%patch100 -p1 +%patch101 -p1 +%patch102 -p1 +%patch103 -p1 +%patch104 -p1 +%patch105 -p1 +%patch106 -p1 +%patch107 -p1 +%patch108 -p1 +%patch109 -p1 +%patch110 -p1 +set -- * +mkdir source +mv "$@" source/ +mkdir obj + +%build +rm -rf obj +cp -r source obj + +PWD_PATH="$PWD" +%if "%{workaround_no_pwd_rel_path}" != "1" +PWD_PATH=$(realpath --relative-to="%{kernel_source}" . 2>/dev/null || echo "$PWD") +%endif +%{make_build} -C %{kernel_source} V=1 M="$PWD_PATH/obj/%{kmod_kbuild_dir}" \ + NOSTDINC_FLAGS="-I$PWD_PATH/obj/include -I$PWD_PATH/obj/include/uapi" \ + EXTRA_CFLAGS="%{nil}" \ + %{nil} +# mark modules executable so that strip-to-file can strip them +find obj/%{kmod_kbuild_dir} -name "*.ko" -type f -exec chmod u+x '{}' + + +whitelist="/lib/modules/kabi-current/kabi_whitelist_%{_target_cpu}" +for modules in $( find obj/%{kmod_kbuild_dir} -name "*.ko" -type f -printf "%{findpat}\n" | sed 's|\.ko$||' | sort -u ) ; do + # update depmod.conf + module_weak_path=$(echo "$modules" | sed 's/[\/]*[^\/]*$//') + if [ -z "$module_weak_path" ]; then + module_weak_path=%{name} + else + module_weak_path=%{name}/$module_weak_path + fi + echo "override $(echo $modules | sed 's/.*\///')" \ + "$(echo "%{kmod_kernel_version_dep}" | + sed 's/\.[^\.]*$//; + s/\([.+?^$\/\\|()\[]\|\]\)/\\\0/g').*" \ + "weak-updates/$module_weak_path" >> source/depmod.conf + + # update greylist + nm -u obj/%{kmod_kbuild_dir}/$modules.ko | sed 's/.*U //' | sed 's/^\.//' | sort -u | while read -r symbol; do + grep -q "^\s*$symbol\$" $whitelist || echo "$symbol" >> source/greylist + done +done +sort -u source/greylist | uniq > source/greylist.txt + +%install +export INSTALL_MOD_PATH=$RPM_BUILD_ROOT +export INSTALL_MOD_DIR=%{kmod_install_path} +PWD_PATH="$PWD" +%if "%{workaround_no_pwd_rel_path}" != "1" +PWD_PATH=$(realpath --relative-to="%{kernel_source}" . 2>/dev/null || echo "$PWD") +%endif +make -C %{kernel_source} modules_install \ + M=$PWD_PATH/obj/%{kmod_kbuild_dir} +# Cleanup unnecessary kernel-generated module dependency files. +find $INSTALL_MOD_PATH/lib/modules -iname 'modules.*' -exec rm {} \; + +install -m 644 -D source/depmod.conf $RPM_BUILD_ROOT/etc/depmod.d/%{kmod_name}.conf +install -m 644 -D source/greylist.txt $RPM_BUILD_ROOT/usr/share/doc/kmod-%{kmod_name}/greylist.txt +%if 1 +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-41.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-41.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8000C-34.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-34.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8265-34.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-34.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7265D-29.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-29.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-41.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-41.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7265-17.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265-17.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8000C-27.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-27.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8265-27.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-27.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-43.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-43.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-38.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-38.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-46.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-46.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7265D-10.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-10.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7260-17.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7260-17.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8000C-21.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-21.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8000C-31.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-31.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7265D-27.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-27.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8265-21.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-21.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7265D-22.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-22.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-3168-22.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-3168-22.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7265D-16.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-16.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7265D-17.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-17.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7260-16.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7260-16.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-3168-27.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-3168-27.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-3168-21.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-3168-21.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8000C-22.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-22.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8000C-16.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-16.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8265-22.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-22.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-34.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-34.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-3160-17.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-3160-17.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-46.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-46.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8000C-36.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-36.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-3160-16.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-3160-16.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-3168-29.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-3168-29.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-cc-a0-46.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-cc-a0-46.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7265D-21.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-21.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-38.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-38.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-43.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-43.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-33.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-33.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-33.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-33.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-34.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-34.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8265-36.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-36.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8265-31.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-31.ucode +install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7265-16.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265-16.ucode + +%endif +%if 0%{kmod_devel_package} +install -m 644 -D $PWD/obj/%{kmod_kbuild_dir}/Module.symvers $RPM_BUILD_ROOT/usr/share/kmod-%{kmod_vendor}-%{kmod_name}/Module.symvers +%endif + +%clean +rm -rf $RPM_BUILD_ROOT + +%changelog +* Fri Oct 04 2019 Eugene Syromiatnikov 4.18.0_107_dup8.0-5 +- e67217ec68636d7570e69bab9e3b1ed1728b8292 +- iwlwifi kernel module for Driver Update Program +- Resolves: #bz1755919