import kmod-redhat-iwlwifi-4.18.0_107_dup8.0-5.el8_0

c8 imports/c8/kmod-redhat-iwlwifi-4.18.0_107_dup8.0-5.el8_0
CentOS Sources 5 years ago committed by MSVSphere Packaging Team
commit d93230ea43

1
.gitignore vendored

@ -0,0 +1 @@
SOURCES/iwlwifi-redhat-4.18.0_107_dup8.0.tar.bz2

@ -0,0 +1 @@
65cd7444152865e1540c1d13d91b408bc02e7270 SOURCES/iwlwifi-redhat-4.18.0_107_dup8.0.tar.bz2

@ -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;

@ -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 */

@ -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;

@ -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 <linux/stringify.h>
#include "iwl-config.h"
+#include "iwl-backport-compat.h"
+
/* Highest firmware API version supported */
#define IWL_22000_UCODE_API_MAX 48

@ -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));

@ -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);
/*

@ -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",

@ -0,0 +1,28 @@
From 7ebbaa13b06672b7a2b20292d11bb57218f3c9d1 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,31 @@
From 1151781dfad20d53bf37122d1043657ce6235a59 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,41 @@
From 83afe9f6493cf209160320e80b451a49c935a536 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,30 @@
From 910c002de243c4fa4c053e61dbccd7cf2352fe74 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,51 @@
From ba8ead2d7e896f57ea37bad77dd653cc0c7c81f1 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,206 @@
From 0f89f208e7a2437b5d7ff440db091c94d2ce3ac2 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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.

@ -0,0 +1,55 @@
From 49be6e27c80189463bf9940c42e49c8c803effee Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,168 @@
From 1f462c5d0f105c46b47db26c8a44c37a5c1028f2 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,28 @@
From 55be0dbc4aa21b2584afd83a676b0baed9934c2b Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,65 @@
From a5c259eba75a77abe8ae7c2f3661d8e523a655a1 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,736 @@
From 02a377d13809d6f5c67d03107a9e97b593ecb48d Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,706 @@
From 41894a94e16d1db4a08db235fe74040e7870d201 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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 <linux/ieee80211.h>
-#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 <linuxwifi@intel.com>
- * 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 <linux/etherdevice.h>
-#include <linux/math64.h>
-#include <net/cfg80211.h>
-#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);

@ -0,0 +1,534 @@
From 98d3e208e4ec5731aa4a310adfc6d59685e6d6b2 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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 <linuxwifi@intel.com>
- * 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 <net/cfg80211.h>
-#include <linux/etherdevice.h>
-#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,

@ -0,0 +1,163 @@
From 77ecb39916fce76f52040bfb5ef278c4f11b7aa7 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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");
}

@ -0,0 +1,45 @@
From c852a74acaa2d2595752b5110c9e49ce49fc137e Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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);

@ -0,0 +1,66 @@
From b51d74dc1f62cae3bbc1ac9549bcf0a958d44847 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,31 @@
From 1f907a5638fe2bb8d4f23c258e89bf2527070a02 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,275 @@
From 3aa78b629f25d741b8cfe9af2b982b34078e098a Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,431 @@
From 37359a82e85dab864b3aee0058f6deacc6448c21 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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,

@ -0,0 +1,32 @@
From a1e09a08fc21c3c17dc24f0d3413f8322c9c313f Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,46 @@
From 3335a827ae30b9575209c9c06e5086239da6fcd0 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,69 @@
From d724bb52e36359a8673cf30de2a93caf701743bd Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,46 @@
From 0b4775b7b2489601ee91d3a61bb939e62954f16d Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,25 @@
From 5ab76e5fae28344a68281b7bf0484af49e8bc014 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,45 @@
From d48db5470be29664cb44b51e822a55c1b4aae61f Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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,

@ -0,0 +1,25 @@
From 1f187d76562086f95e2b1bd70f83b80225036edd Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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,

@ -0,0 +1,31 @@
From e7a8266afda457bb661675b67779a38731362c2c Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,330 @@
From 5a532e3f0a2790c193a2e83e5ea7b32a43a4770d Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,128 @@
From fa85f5e990b991cb794bc53be62f7947bfe7850a Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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] &

@ -0,0 +1,92 @@
From f3623b10c8d9adac4a7e777a05972c934ac50560 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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);

@ -0,0 +1,71 @@
From f6fa861cd23ef48520a150969c39f5315cda5165 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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);

@ -0,0 +1,64 @@
From 490affbc4f7ffa0df7827f805be8cd2de63dc7cb Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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);
/*

@ -0,0 +1,54 @@
From 561fda1e84ed74901a9e95ce348318de9d800071 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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 |=

@ -0,0 +1,39 @@
From 7bb5884d5829f80853f441a7e7869b569a7a1f17 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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);

@ -0,0 +1,147 @@
From 4b37b55e8a1c275e1627aa29b195db94b0cac963 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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) {

@ -0,0 +1,36 @@
From 13d40dd19e04e63ec8bdaae9f41927d87608aefd Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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 */

@ -0,0 +1,35 @@
From f42afed74bd0869fed5a8cf2e99c4e06211f0e38 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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();
}

@ -0,0 +1,118 @@
From 9ecf5349a3dc266355c9ae1fd74ad711515097e8 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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;

@ -0,0 +1,57 @@
From 7178e4273a222597d37155c0070e3e3530433f91 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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,

@ -0,0 +1,47 @@
From b02d8c6f4a9feb8a39172c21b5262b8234dff7fc Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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;

@ -0,0 +1,216 @@
From 5c2adb768dcc1275a47d35b61bffe8abdf225f9c Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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);

@ -0,0 +1,759 @@
From 31fdae686b7a84c5e47e9ab298dfdbaec1ccaeb9 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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,

@ -0,0 +1,28 @@
From dc7e4b317630effc7dd55b714820c158db9addf5 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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;
/*

@ -0,0 +1,108 @@
From 60ebb3bcd2e41735bd3ac849e7cee373022d3804 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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:

@ -0,0 +1,46 @@
From b712a47190ab9b19b44c22a357b3d7921710226e Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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;

@ -0,0 +1,84 @@
From 1235f5e955960b66e022f0aca5703b9dfc68ef30 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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)) {

@ -0,0 +1,38 @@
From a25f92136344bc8586f99ba71b524570f2a8c18a Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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)) {

@ -0,0 +1,26 @@
From 62a3de9ef101ff11c6214783901a89a82751cb41 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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;

@ -0,0 +1,74 @@
From f29430ff87e1ed63de31f76d4d6e5e07567649f3 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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;
}
}

@ -0,0 +1,216 @@
From a93e24f4eaf087b32f3e81022d4e907224632a73 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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) >>

@ -0,0 +1,148 @@
From a88d3a6f3ceecd318bfe4b27ca6ccd37787389a2 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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)) {

@ -0,0 +1,37 @@
From 9c06dcda83c311ffcda2f3fe983bcd8c5cd458a1 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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);

@ -0,0 +1,47 @@
From 4f2b4c2c38836f9a20ac16ad0ddc8f273b1997a6 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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;
}

@ -0,0 +1,42 @@
From 4edf3a23bf91859531bcfaa54451c8c39e60bb0b Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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),

@ -0,0 +1,24 @@
From fc0bd30f367a3d76537c618b74d74c6e624162ee Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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);

@ -0,0 +1,135 @@
From 302d708fad6d37c7c42760f0a8a9f7398dec5d01 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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);

@ -0,0 +1,42 @@
From 7f696e8cbeeb5bafe6de1534d9882cf696e8e937 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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 ||

@ -0,0 +1,33 @@
From 188d325434e417458beb25f7cd1922c7b358a96f Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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;

@ -0,0 +1,56 @@
From 7d0e51654368bcd06c4945beee388012001bad6e Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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;

@ -0,0 +1,58 @@
From 9e4d7a8c370f44f61540b26d5f76b916f791872d Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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;

@ -0,0 +1,51 @@
From b39f8acf83fb9483287cb6e79acb5afbd99f0db9 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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 */
/**

@ -0,0 +1,370 @@
From e01e8ffcfe71bd1400e53c94438287552991e85f Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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;

@ -0,0 +1,24 @@
From 14f32cc48eb034f122b8bd7d107c839279e97fae Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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);
}

@ -0,0 +1,24 @@
From eb5bb4763d7653ed5def1b827c8777d2efa621c6 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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) >>

@ -0,0 +1,653 @@
From 5e0d3511c1ef2ec98f93491b5f6da2b16051c8aa Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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 */

@ -0,0 +1,25 @@
From 1ddc8e8538b0b2c4b48bef0628f723337f8c6c35 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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))

@ -0,0 +1,35 @@
From 009083504f40025e38bcbbd25ccd17c206c23e40 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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;

@ -0,0 +1,503 @@
From 90c061a4ac143f50225054e38f8a715e499312b7 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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);

@ -0,0 +1,235 @@
From 1eebf4ab32c4f817b1fa5fadbec1445c5dec2fb9 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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 */

@ -0,0 +1,25 @@
From 87d5d91b6ab374c905a0a4a0620d2a2830fe7942 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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);

@ -0,0 +1,972 @@
From d574baf35b78dc94ba2fbe6273c20b8ed7c20a90 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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 = &params->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);

@ -0,0 +1,31 @@
From f7108086dcf7153e099939fb776223c8fc46be96 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,25 @@
From 077242276a3c90947250db737df49a10bf9d37bb Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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),

@ -0,0 +1,58 @@
From 866f912283b38bb8429ae5d0ce11e4f0575f6d84 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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 */

@ -0,0 +1,320 @@
From af78069a8e25027e8ea2d3cb3fdbe545b398db34 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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:

@ -0,0 +1,30 @@
From a6926232ac2d027a9cb7edc5c1880944fed31bb9 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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))

@ -0,0 +1,92 @@
From 1cc8caa4a0763344aaed1b7cbefd5f7e999db91b Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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,

@ -0,0 +1,52 @@
From 809ebadf870b7291ce9d0e80d5fb4bbba9c83e2a Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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,

@ -0,0 +1,48 @@
From 2d91368aef2a73d37acdea30cd7086356e81ccc5 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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;

@ -0,0 +1,248 @@
From f374231a3a0dcfb8c2c6d33b853b17700d899cc0 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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;

@ -0,0 +1,211 @@
From 74cd2cdf235fbba685e8518b87a1035bc580cb60 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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;

@ -0,0 +1,30 @@
From a594e9d1d06ddfb6dd3a20a181bf5f0be6481bff Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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);

@ -0,0 +1,115 @@
From a10ba457727c6da7a599619faeb440521eb467d4 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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,
+ &regdb_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);

@ -0,0 +1,24 @@
From 9b259b74b866cd46fd0b24ca31c4a56f338c97b9 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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);

@ -0,0 +1,31 @@
From be24a91b5235ebb5b78b2bca72b4b553a883cd25 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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

@ -0,0 +1,95 @@
From 2cc08d0bf6d1a756ba1484b7f4fff97328034ccc Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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];

@ -0,0 +1,194 @@
From 17ca0052ed9bc2267a6bf80c5e539299f59db930 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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();
}

@ -0,0 +1,209 @@
From dbaa837f62011f9a7b57e38747a30153a0a1a163 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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;

@ -0,0 +1,68 @@
From 090384c14e89b9de2550d68deb686ad038fc42b1 Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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);

@ -0,0 +1,262 @@
From 25fcfd03d3382e76ec0f7ababb9176ed3ccff37a Mon Sep 17 00:00:00 2001
From: Eugene Syromiatnikov <esyr@redhat.com>
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)
{

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save