Merge ~canonical-hwe-team/ubuntu/+source/backport-iwlwifi-dkms/+git/backport-iwlwifi-dkms:vicamo/for-hwe/sync-debian-7906 into ~canonical-hwe-team/ubuntu/+source/backport-iwlwifi-dkms/+git/backport-iwlwifi-dkms:ubuntu/master

Proposed by You-Sheng Yang
Status: Merged
Approved by: You-Sheng Yang
Approved revision: 7a7c921e3ef0534469277d77219db5e8e144c15a
Merged at revision: 7a7c921e3ef0534469277d77219db5e8e144c15a
Proposed branch: ~canonical-hwe-team/ubuntu/+source/backport-iwlwifi-dkms/+git/backport-iwlwifi-dkms:vicamo/for-hwe/sync-debian-7906
Merge into: ~canonical-hwe-team/ubuntu/+source/backport-iwlwifi-dkms/+git/backport-iwlwifi-dkms:ubuntu/master
Diff against target: 4344 lines (+1417/-733)
51 files modified
backport-include/linux/skbuff.h (+5/-5)
backport-include/net/genetlink.h (+2/-1)
backport-include/net/netlink.h (+13/-5)
compat/Makefile (+1/-1)
compat/backport-4.20.c (+7/-1)
compat/backport-genetlink.c (+1/-1)
compat/verification/pkcs7_verify.c (+0/-1)
debian/backport-iwlwifi-dkms.modaliases (+2/-0)
debian/changelog (+6/-0)
drivers/net/wireless/intel/iwlwifi/cfg/22000.c (+55/-6)
drivers/net/wireless/intel/iwlwifi/fw/acpi.h (+12/-0)
drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h (+2/-0)
drivers/net/wireless/intel/iwlwifi/fw/api/location.h (+2/-2)
drivers/net/wireless/intel/iwlwifi/fw/api/phy.h (+7/-0)
drivers/net/wireless/intel/iwlwifi/fw/api/power.h (+12/-0)
drivers/net/wireless/intel/iwlwifi/fw/api/rx.h (+2/-1)
drivers/net/wireless/intel/iwlwifi/fw/dbg.c (+30/-26)
drivers/net/wireless/intel/iwlwifi/fw/file.h (+1/-0)
drivers/net/wireless/intel/iwlwifi/fw/img.h (+0/-9)
drivers/net/wireless/intel/iwlwifi/iwl-config.h (+7/-0)
drivers/net/wireless/intel/iwlwifi/iwl-csr.h (+1/-0)
drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c (+44/-109)
drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.h (+10/-14)
drivers/net/wireless/intel/iwlwifi/iwl-drv.c (+4/-8)
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c (+0/-14)
drivers/net/wireless/intel/iwlwifi/iwl-tm-gnl.c (+11/-6)
drivers/net/wireless/intel/iwlwifi/iwl-trans.h (+3/-1)
drivers/net/wireless/intel/iwlwifi/mvm/d3.c (+3/-0)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c (+141/-7)
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c (+3/-1)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c (+79/-44)
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h (+7/-4)
drivers/net/wireless/intel/iwlwifi/mvm/nvm.c (+1/-1)
drivers/net/wireless/intel/iwlwifi/mvm/ops.c (+15/-14)
drivers/net/wireless/intel/iwlwifi/mvm/rs.c (+268/-251)
drivers/net/wireless/intel/iwlwifi/mvm/rs.h (+2/-1)
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c (+134/-51)
drivers/net/wireless/intel/iwlwifi/mvm/sta.c (+4/-2)
drivers/net/wireless/intel/iwlwifi/mvm/sta.h (+10/-2)
drivers/net/wireless/intel/iwlwifi/mvm/utils.c (+2/-2)
drivers/net/wireless/intel/iwlwifi/pcie/drv.c (+23/-0)
drivers/net/wireless/intel/iwlwifi/pcie/trans.c (+4/-5)
drivers/net/wireless/mac80211_hwsim.c (+25/-6)
net/mac80211/ibss.c (+7/-3)
net/mac80211/ieee80211_i.h (+1/-1)
net/mac80211/main.c (+13/-0)
net/mac80211/mlme.c (+4/-4)
net/mac80211/scan.c (+2/-3)
net/mac80211/util.c (+6/-5)
net/wireless/nl80211.c (+422/-114)
versions (+1/-1)
Reviewer Review Type Date Requested Status
Anthony Wong Approve
Canonical Hardware Enablement Pending
Review via email: mp+369867@code.launchpad.net

Description of the change

Sync with debian 7906-1.

To post a comment you must log in.
Revision history for this message
You-Sheng Yang (vicamo) wrote :
Revision history for this message
You-Sheng Yang (vicamo) wrote :

Successfully built. Checked built blobs works on 4.15.0-1045-oem as well as 5.0.0-1011-oem-osp1 with Intel Wireless-AC 9560.

Revision history for this message
You-Sheng Yang (vicamo) wrote :

> Successfully built. Checked built blobs works on 4.15.0-1045-oem as well as
> 5.0.0-1011-oem-osp1 with Intel Wireless-AC 9560.

On IceLake platform, of course.

Revision history for this message
You-Sheng Yang (vicamo) wrote :

Verified same thing with 9462 on ICL.

Revision history for this message
Anthony Wong (anthonywong) wrote :

Is this just to merge upstream's code at 7906?

review: Needs Information
Revision history for this message
You-Sheng Yang (vicamo) wrote :

@anthonywong, yes, and update modaliases since 7906 includes support to new device models.

Revision history for this message
Anthony Wong (anthonywong) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/backport-include/linux/skbuff.h b/backport-include/linux/skbuff.h
index 4d37569..c60cbcc 100644
--- a/backport-include/linux/skbuff.h
+++ b/backport-include/linux/skbuff.h
@@ -200,14 +200,14 @@ static inline struct sk_buff *__pskb_copy_fclone(struct sk_buff *skb,
200struct sk_buff *skb_clone_sk(struct sk_buff *skb);200struct sk_buff *skb_clone_sk(struct sk_buff *skb);
201#endif201#endif
202202
203static inline bool skb_xmit_more(struct sk_buff *skb)203
204{
205#if LINUX_VERSION_IS_LESS(3,18,0)204#if LINUX_VERSION_IS_LESS(3,18,0)
206 return false;205#define skb_xmit_more(skb) false
206#elif LINUX_VERSION_IS_LESS(5,2,0)
207#define skb_xmit_more(skb) ((skb)->xmit_more)
207#else208#else
208 return skb->xmit_more;209#define skb_xmit_more(skb) netdev_xmit_more()
209#endif210#endif
210}
211211
212#if LINUX_VERSION_IS_LESS(3,19,0)212#if LINUX_VERSION_IS_LESS(3,19,0)
213/**213/**
diff --git a/backport-include/net/genetlink.h b/backport-include/net/genetlink.h
index 844ed2a..59611a8 100644
--- a/backport-include/net/genetlink.h
+++ b/backport-include/net/genetlink.h
@@ -93,7 +93,7 @@ void backport_genl_dump_check_consistent(struct netlink_callback *cb,
93#endif93#endif
94#endif /* LINUX_VERSION_IS_LESS(4,15,0) */94#endif /* LINUX_VERSION_IS_LESS(4,15,0) */
9595
96#if LINUX_VERSION_IS_LESS(4,20,0)96#if LINUX_VERSION_IS_LESS(5,2,0)
97static inline int97static inline int
98__real_backport_genl_register_family(struct genl_family *family)98__real_backport_genl_register_family(struct genl_family *family)
99{99{
@@ -117,6 +117,7 @@ struct backport_genl_family {
117 unsigned int maxattr;117 unsigned int maxattr;
118 bool netnsok;118 bool netnsok;
119 bool parallel_ops;119 bool parallel_ops;
120 const struct nla_policy *policy;
120 int (*pre_doit)(__genl_const struct genl_ops *ops,121 int (*pre_doit)(__genl_const struct genl_ops *ops,
121 struct sk_buff *skb,122 struct sk_buff *skb,
122 struct genl_info *info);123 struct genl_info *info);
diff --git a/backport-include/net/netlink.h b/backport-include/net/netlink.h
index 8b58301..87c30cc 100644
--- a/backport-include/net/netlink.h
+++ b/backport-include/net/netlink.h
@@ -4,6 +4,19 @@
4#include <linux/version.h>4#include <linux/version.h>
5#include <linux/in6.h>5#include <linux/in6.h>
66
7#if LINUX_VERSION_IS_LESS(5,1,0)
8#undef NLA_POLICY_NESTED
9#undef NLA_POLICY_NESTED_ARRAY
10#define _NLA_POLICY_NESTED(maxattr, policy) \
11 { .type = NLA_NESTED, .validation_data = policy, .len = maxattr }
12#define _NLA_POLICY_NESTED_ARRAY(maxattr, policy) \
13 { .type = NLA_NESTED_ARRAY, .validation_data = policy, .len = maxattr }
14#define NLA_POLICY_NESTED(policy) \
15 _NLA_POLICY_NESTED(ARRAY_SIZE(policy) - 1, policy)
16#define NLA_POLICY_NESTED_ARRAY(policy) \
17 _NLA_POLICY_NESTED_ARRAY(ARRAY_SIZE(policy) - 1, policy)
18#endif /* < 5.1 */
19
7#if LINUX_VERSION_IS_LESS(4,20,0)20#if LINUX_VERSION_IS_LESS(4,20,0)
8/* can't backport using the enum - need to override */21/* can't backport using the enum - need to override */
9#define NLA_UNSPEC 022#define NLA_UNSPEC 0
@@ -59,11 +72,6 @@ struct backport_nla_policy {
59#define NLA_POLICY_ETH_ADDR NLA_POLICY_EXACT_LEN(ETH_ALEN)72#define NLA_POLICY_ETH_ADDR NLA_POLICY_EXACT_LEN(ETH_ALEN)
60#define NLA_POLICY_ETH_ADDR_COMPAT NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN)73#define NLA_POLICY_ETH_ADDR_COMPAT NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN)
6174
62#define NLA_POLICY_NESTED(maxattr, policy) \
63 { .type = NLA_NESTED, .validation_data = policy, .len = maxattr }
64#define NLA_POLICY_NESTED_ARRAY(maxattr, policy) \
65 { .type = NLA_NESTED_ARRAY, .validation_data = policy, .len = maxattr }
66
67#define __NLA_ENSURE(condition) (sizeof(char[1 - 2*!(condition)]) - 1)75#define __NLA_ENSURE(condition) (sizeof(char[1 - 2*!(condition)]) - 1)
68#define NLA_ENSURE_INT_TYPE(tp) \76#define NLA_ENSURE_INT_TYPE(tp) \
69 (__NLA_ENSURE(tp == NLA_S8 || tp == NLA_U8 || \77 (__NLA_ENSURE(tp == NLA_S8 || tp == NLA_U8 || \
diff --git a/compat/Makefile b/compat/Makefile
index 7d2278b..1f62e4f 100644
--- a/compat/Makefile
+++ b/compat/Makefile
@@ -39,7 +39,7 @@ compat-$(CPTCFG_KERNEL_4_10) += backport-4.10.o
39compat-$(CPTCFG_KERNEL_4_18) += backport-4.18.o39compat-$(CPTCFG_KERNEL_4_18) += backport-4.18.o
40compat-$(CPTCFG_KERNEL_4_20) += backport-4.20.o40compat-$(CPTCFG_KERNEL_4_20) += backport-4.20.o
4141
42compat-$(CPTCFG_KERNEL_4_20) += backport-genetlink.o42compat-$(CPTCFG_KERNEL_5_2) += backport-genetlink.o
4343
44compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/verify.o44compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/verify.o
45compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/pkcs7.asn1.o45compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/pkcs7.asn1.o
diff --git a/compat/backport-4.20.c b/compat/backport-4.20.c
index e26f3b5..a75657f 100644
--- a/compat/backport-4.20.c
+++ b/compat/backport-4.20.c
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2018 Intel Corporation2 * Copyright (C) 2018 - 2019 Intel Corporation
3 *3 *
4 * Backport functionality introduced in Linux 4.20.4 * Backport functionality introduced in Linux 4.20.
5 * This is basically upstream lib/nlattr.c.5 * This is basically upstream lib/nlattr.c.
@@ -158,6 +158,9 @@ static int validate_nla(const struct nlattr *nla, int maxtype,
158 if (type <= 0 || type > maxtype)158 if (type <= 0 || type > maxtype)
159 return 0;159 return 0;
160160
161 if (WARN_ON(!policy))
162 return -EINVAL;
163
161 pt = &policy[type];164 pt = &policy[type];
162165
163 BUG_ON(pt->type > NLA_TYPE_MAX);166 BUG_ON(pt->type > NLA_TYPE_MAX);
@@ -316,6 +319,9 @@ int backport_nla_validate(const struct nlattr *head, int len, int maxtype,
316 const struct nlattr *nla;319 const struct nlattr *nla;
317 int rem;320 int rem;
318321
322 if (!policy)
323 return 0;
324
319 nla_for_each_attr(nla, head, len, rem) {325 nla_for_each_attr(nla, head, len, rem) {
320 int err = validate_nla(nla, maxtype, policy, extack);326 int err = validate_nla(nla, maxtype, policy, extack);
321327
diff --git a/compat/backport-genetlink.c b/compat/backport-genetlink.c
index fb559d2..f9e307b 100644
--- a/compat/backport-genetlink.c
+++ b/compat/backport-genetlink.c
@@ -169,7 +169,7 @@ static int backport_pre_doit(__genl_const struct genl_ops *ops,
169#endif169#endif
170170
171 err = nlmsg_validate(info->nlhdr, GENL_HDRLEN + family->hdrsize,171 err = nlmsg_validate(info->nlhdr, GENL_HDRLEN + family->hdrsize,
172 family->maxattr, ops->policy, extack);172 family->maxattr, family->policy, extack);
173 if (!err && family->pre_doit)173 if (!err && family->pre_doit)
174 err = family->pre_doit(ops, skb, info);174 err = family->pre_doit(ops, skb, info);
175175
diff --git a/compat/verification/pkcs7_verify.c b/compat/verification/pkcs7_verify.c
index 97c77f6..f7b0980 100644
--- a/compat/verification/pkcs7_verify.c
+++ b/compat/verification/pkcs7_verify.c
@@ -56,7 +56,6 @@ static int pkcs7_digest(struct pkcs7_message *pkcs7,
56 goto error_no_desc;56 goto error_no_desc;
5757
58 desc->tfm = tfm;58 desc->tfm = tfm;
59 desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP;
6059
61 /* Digest the message [RFC2315 9.3] */60 /* Digest the message [RFC2315 9.3] */
62 ret = crypto_shash_digest(desc, pkcs7->data, pkcs7->data_len,61 ret = crypto_shash_digest(desc, pkcs7->data, pkcs7->data_len,
diff --git a/debian/backport-iwlwifi-dkms.modaliases b/debian/backport-iwlwifi-dkms.modaliases
index 4ac4b99..9e7706a 100644
--- a/debian/backport-iwlwifi-dkms.modaliases
+++ b/debian/backport-iwlwifi-dkms.modaliases
@@ -2,6 +2,7 @@ alias net-pf-16-proto-16-family-nl80211 cfg80211
2alias pci:v00008086d00007AF0sv*sd00000A10bc*sc*i* iwlwifi2alias pci:v00008086d00007AF0sv*sd00000A10bc*sc*i* iwlwifi
3alias pci:v00008086d00007AF0sv*sd00000510bc*sc*i* iwlwifi3alias pci:v00008086d00007AF0sv*sd00000510bc*sc*i* iwlwifi
4alias pci:v00008086d00007AF0sv*sd00000310bc*sc*i* iwlwifi4alias pci:v00008086d00007AF0sv*sd00000310bc*sc*i* iwlwifi
5alias pci:v00008086d00007AF0sv*sd00000090bc*sc*i* iwlwifi
5alias pci:v00008086d00007A70sv*sd00000A10bc*sc*i* iwlwifi6alias pci:v00008086d00007A70sv*sd00000A10bc*sc*i* iwlwifi
6alias pci:v00008086d00007A70sv*sd00000510bc*sc*i* iwlwifi7alias pci:v00008086d00007A70sv*sd00000510bc*sc*i* iwlwifi
7alias pci:v00008086d00007A70sv*sd00000310bc*sc*i* iwlwifi8alias pci:v00008086d00007A70sv*sd00000310bc*sc*i* iwlwifi
@@ -366,6 +367,7 @@ alias pci:v00008086d0000271Bsv*sd00000010bc*sc*i* iwlwifi
366alias pci:v00008086d00002526sv*sd0000A014bc*sc*i* iwlwifi367alias pci:v00008086d00002526sv*sd0000A014bc*sc*i* iwlwifi
367alias pci:v00008086d00002526sv*sd00008010bc*sc*i* iwlwifi368alias pci:v00008086d00002526sv*sd00008010bc*sc*i* iwlwifi
368alias pci:v00008086d00002526sv*sd00008014bc*sc*i* iwlwifi369alias pci:v00008086d00002526sv*sd00008014bc*sc*i* iwlwifi
370alias pci:v00008086d00002526sv*sd00006014bc*sc*i* iwlwifi
369alias pci:v00008086d00002526sv*sd000042A4bc*sc*i* iwlwifi371alias pci:v00008086d00002526sv*sd000042A4bc*sc*i* iwlwifi
370alias pci:v00008086d00002526sv*sd00004234bc*sc*i* iwlwifi372alias pci:v00008086d00002526sv*sd00004234bc*sc*i* iwlwifi
371alias pci:v00008086d00002526sv*sd000040A4bc*sc*i* iwlwifi373alias pci:v00008086d00002526sv*sd000040A4bc*sc*i* iwlwifi
diff --git a/debian/changelog b/debian/changelog
index d70c99a..75ea7c7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
1backport-iwlwifi-dkms (7906-ubuntu1) UNRELEASED; urgency=low
2
3 * Sync with debian 7906-1.
4
5 -- You-Sheng Yang <vicamo@gmail.com> Tue, 9 Jul 2019 16:35:22 +0800
6
1backport-iwlwifi-dkms (7858-ubuntu2) UNRELEASED; urgency=low7backport-iwlwifi-dkms (7858-ubuntu2) UNRELEASED; urgency=low
28
3 * Fix build on recent kernel that removes *.lex.c and *.tab.c at clean9 * Fix build on recent kernel that removes *.lex.c and *.tab.c at clean
diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
index c5a0b6f..351f2c0 100644
--- a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
+++ b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
@@ -56,7 +56,7 @@
56#include "iwl-config.h"56#include "iwl-config.h"
5757
58/* Highest firmware API version supported */58/* Highest firmware API version supported */
59#define IWL_22000_UCODE_API_MAX 5059#define IWL_22000_UCODE_API_MAX 51
6060
61/* Lowest firmware API version supported */61/* Lowest firmware API version supported */
62#define IWL_22000_UCODE_API_MIN 3962#define IWL_22000_UCODE_API_MIN 39
@@ -76,11 +76,12 @@
76#define IWL_22000_HR_FW_PRE "iwlwifi-Qu-a0-hr-a0-"76#define IWL_22000_HR_FW_PRE "iwlwifi-Qu-a0-hr-a0-"
77#define IWL_22000_HR_CDB_FW_PRE "iwlwifi-QuIcp-z0-hrcdb-a0-"77#define IWL_22000_HR_CDB_FW_PRE "iwlwifi-QuIcp-z0-hrcdb-a0-"
78#define IWL_22000_HR_A_F0_FW_PRE "iwlwifi-QuQnj-f0-hr-a0-"78#define IWL_22000_HR_A_F0_FW_PRE "iwlwifi-QuQnj-f0-hr-a0-"
79#define IWL_22000_HR_B_F0_FW_PRE "iwlwifi-Qu-b0-hr-b0-"
80#define IWL_22000_QU_B_HR_B_FW_PRE "iwlwifi-Qu-b0-hr-b0-"79#define IWL_22000_QU_B_HR_B_FW_PRE "iwlwifi-Qu-b0-hr-b0-"
81#define IWL_22000_HR_B_FW_PRE "iwlwifi-QuQnj-b0-hr-b0-"80#define IWL_22000_HR_B_FW_PRE "iwlwifi-QuQnj-b0-hr-b0-"
82#define IWL_22000_HR_A0_FW_PRE "iwlwifi-QuQnj-a0-hr-a0-"81#define IWL_22000_HR_A0_FW_PRE "iwlwifi-QuQnj-a0-hr-a0-"
82#define IWL_QU_C_HR_B_FW_PRE "iwlwifi-Qu-c0-hr-b0-"
83#define IWL_QU_B_JF_B_FW_PRE "iwlwifi-Qu-b0-jf-b0-"83#define IWL_QU_B_JF_B_FW_PRE "iwlwifi-Qu-b0-jf-b0-"
84#define IWL_QU_C_JF_B_FW_PRE "iwlwifi-Qu-c0-jf-b0-"
84#define IWL_QUZ_A_HR_B_FW_PRE "iwlwifi-QuZ-a0-hr-b0-"85#define IWL_QUZ_A_HR_B_FW_PRE "iwlwifi-QuZ-a0-hr-b0-"
85#define IWL_QUZ_A_JF_B_FW_PRE "iwlwifi-QuZ-a0-jf-b0-"86#define IWL_QUZ_A_JF_B_FW_PRE "iwlwifi-QuZ-a0-jf-b0-"
86#define IWL_QNJ_B_JF_B_FW_PRE "iwlwifi-QuQnj-b0-jf-b0-"87#define IWL_QNJ_B_JF_B_FW_PRE "iwlwifi-QuQnj-b0-jf-b0-"
@@ -97,8 +98,6 @@
97 IWL_22000_JF_FW_PRE __stringify(api) ".ucode"98 IWL_22000_JF_FW_PRE __stringify(api) ".ucode"
98#define IWL_22000_HR_A_F0_QNJ_MODULE_FIRMWARE(api) \99#define IWL_22000_HR_A_F0_QNJ_MODULE_FIRMWARE(api) \
99 IWL_22000_HR_A_F0_FW_PRE __stringify(api) ".ucode"100 IWL_22000_HR_A_F0_FW_PRE __stringify(api) ".ucode"
100#define IWL_22000_HR_B_F0_QNJ_MODULE_FIRMWARE(api) \
101 IWL_22000_HR_B_F0_FW_PRE __stringify(api) ".ucode"
102#define IWL_22000_QU_B_HR_B_MODULE_FIRMWARE(api) \101#define IWL_22000_QU_B_HR_B_MODULE_FIRMWARE(api) \
103 IWL_22000_QU_B_HR_B_FW_PRE __stringify(api) ".ucode"102 IWL_22000_QU_B_HR_B_FW_PRE __stringify(api) ".ucode"
104#define IWL_22000_HR_B_QNJ_MODULE_FIRMWARE(api) \103#define IWL_22000_HR_B_QNJ_MODULE_FIRMWARE(api) \
@@ -109,6 +108,8 @@
109 IWL_QUZ_A_HR_B_FW_PRE __stringify(api) ".ucode"108 IWL_QUZ_A_HR_B_FW_PRE __stringify(api) ".ucode"
110#define IWL_QUZ_A_JF_B_MODULE_FIRMWARE(api) \109#define IWL_QUZ_A_JF_B_MODULE_FIRMWARE(api) \
111 IWL_QUZ_A_JF_B_FW_PRE __stringify(api) ".ucode"110 IWL_QUZ_A_JF_B_FW_PRE __stringify(api) ".ucode"
111#define IWL_QU_C_HR_B_MODULE_FIRMWARE(api) \
112 IWL_QU_C_HR_B_FW_PRE __stringify(api) ".ucode"
112#define IWL_QU_B_JF_B_MODULE_FIRMWARE(api) \113#define IWL_QU_B_JF_B_MODULE_FIRMWARE(api) \
113 IWL_QU_B_JF_B_FW_PRE __stringify(api) ".ucode"114 IWL_QU_B_JF_B_FW_PRE __stringify(api) ".ucode"
114#define IWL_QNJ_B_JF_B_MODULE_FIRMWARE(api) \115#define IWL_QNJ_B_JF_B_MODULE_FIRMWARE(api) \
@@ -256,6 +257,30 @@ const struct iwl_cfg iwl_ax201_cfg_qu_hr = {
256 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,257 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
257};258};
258259
260const struct iwl_cfg iwl_ax101_cfg_qu_c0_hr_b0 = {
261 .name = "Intel(R) Wi-Fi 6 AX101",
262 .fw_name_pre = IWL_QU_C_HR_B_FW_PRE,
263 IWL_DEVICE_22500,
264 /*
265 * This device doesn't support receiving BlockAck with a large bitmap
266 * so we need to restrict the size of transmitted aggregation to the
267 * HT size; mac80211 would otherwise pick the HE max (256) by default.
268 */
269 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
270};
271
272const struct iwl_cfg iwl_ax201_cfg_qu_c0_hr_b0 = {
273 .name = "Intel(R) Wi-Fi 6 AX201 160MHz",
274 .fw_name_pre = IWL_QU_C_HR_B_FW_PRE,
275 IWL_DEVICE_22500,
276 /*
277 * This device doesn't support receiving BlockAck with a large bitmap
278 * so we need to restrict the size of transmitted aggregation to the
279 * HT size; mac80211 would otherwise pick the HE max (256) by default.
280 */
281 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
282};
283
259const struct iwl_cfg iwl_ax101_cfg_quz_hr = {284const struct iwl_cfg iwl_ax101_cfg_quz_hr = {
260 .name = "Intel(R) Wi-Fi 6 AX101",285 .name = "Intel(R) Wi-Fi 6 AX101",
261 .fw_name_pre = IWL_QUZ_A_HR_B_FW_PRE,286 .fw_name_pre = IWL_QUZ_A_HR_B_FW_PRE,
@@ -372,6 +397,30 @@ const struct iwl_cfg iwl9560_2ac_160_cfg_qu_b0_jf_b0 = {
372 IWL_DEVICE_22500,397 IWL_DEVICE_22500,
373};398};
374399
400const struct iwl_cfg iwl9461_2ac_cfg_qu_c0_jf_b0 = {
401 .name = "Intel(R) Wireless-AC 9461",
402 .fw_name_pre = IWL_QU_C_JF_B_FW_PRE,
403 IWL_DEVICE_22500,
404};
405
406const struct iwl_cfg iwl9462_2ac_cfg_qu_c0_jf_b0 = {
407 .name = "Intel(R) Wireless-AC 9462",
408 .fw_name_pre = IWL_QU_C_JF_B_FW_PRE,
409 IWL_DEVICE_22500,
410};
411
412const struct iwl_cfg iwl9560_2ac_cfg_qu_c0_jf_b0 = {
413 .name = "Intel(R) Wireless-AC 9560",
414 .fw_name_pre = IWL_QU_C_JF_B_FW_PRE,
415 IWL_DEVICE_22500,
416};
417
418const struct iwl_cfg iwl9560_2ac_160_cfg_qu_c0_jf_b0 = {
419 .name = "Intel(R) Wireless-AC 9560 160MHz",
420 .fw_name_pre = IWL_QU_C_JF_B_FW_PRE,
421 IWL_DEVICE_22500,
422};
423
375const struct iwl_cfg iwl9560_2ac_cfg_qnj_jf_b0 = {424const struct iwl_cfg iwl9560_2ac_cfg_qnj_jf_b0 = {
376 .name = "Intel(R) Wireless-AC 9560 160MHz",425 .name = "Intel(R) Wireless-AC 9560 160MHz",
377 .fw_name_pre = IWL_QNJ_B_JF_B_FW_PRE,426 .fw_name_pre = IWL_QNJ_B_JF_B_FW_PRE,
@@ -530,7 +579,7 @@ const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_a0_f0 = {
530579
531const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_b0_f0 = {580const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_b0_f0 = {
532 .name = "Intel(R) Dual Band Wireless AX 22000",581 .name = "Intel(R) Dual Band Wireless AX 22000",
533 .fw_name_pre = IWL_22000_HR_B_F0_FW_PRE,582 .fw_name_pre = IWL_22000_QU_B_HR_B_FW_PRE,
534 IWL_DEVICE_22500,583 IWL_DEVICE_22500,
535 /*584 /*
536 * This device doesn't support receiving BlockAck with a large bitmap585 * This device doesn't support receiving BlockAck with a large bitmap
@@ -599,9 +648,9 @@ const struct iwl_cfg iwlax411_2ax_cfg_so_gf4_a0 = {
599MODULE_FIRMWARE(IWL_22000_HR_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));648MODULE_FIRMWARE(IWL_22000_HR_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
600MODULE_FIRMWARE(IWL_22000_JF_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));649MODULE_FIRMWARE(IWL_22000_JF_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
601MODULE_FIRMWARE(IWL_22000_HR_A_F0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));650MODULE_FIRMWARE(IWL_22000_HR_A_F0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
602MODULE_FIRMWARE(IWL_22000_HR_B_F0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
603MODULE_FIRMWARE(IWL_22000_HR_B_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));651MODULE_FIRMWARE(IWL_22000_HR_B_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
604MODULE_FIRMWARE(IWL_22000_HR_A0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));652MODULE_FIRMWARE(IWL_22000_HR_A0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
653MODULE_FIRMWARE(IWL_QU_C_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
605MODULE_FIRMWARE(IWL_QU_B_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));654MODULE_FIRMWARE(IWL_QU_B_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
606MODULE_FIRMWARE(IWL_QUZ_A_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));655MODULE_FIRMWARE(IWL_QUZ_A_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
607MODULE_FIRMWARE(IWL_QUZ_A_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));656MODULE_FIRMWARE(IWL_QUZ_A_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.h b/drivers/net/wireless/intel/iwlwifi/fw/acpi.h
index 991a234..6cb2d1f 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.h
@@ -68,6 +68,7 @@
68#define ACPI_WRDD_METHOD "WRDD"68#define ACPI_WRDD_METHOD "WRDD"
69#define ACPI_SPLC_METHOD "SPLC"69#define ACPI_SPLC_METHOD "SPLC"
70#define ACPI_ECKV_METHOD "ECKV"70#define ACPI_ECKV_METHOD "ECKV"
71#define ACPI_PPAG_METHOD "PPAG"
7172
72#define ACPI_WIFI_DOMAIN (0x07)73#define ACPI_WIFI_DOMAIN (0x07)
7374
@@ -92,6 +93,17 @@
92#define ACPI_WGDS_NUM_BANDS 293#define ACPI_WGDS_NUM_BANDS 2
93#define ACPI_WGDS_TABLE_SIZE 394#define ACPI_WGDS_TABLE_SIZE 3
9495
96#define ACPI_PPAG_NUM_CHAINS 2
97#define ACPI_PPAG_NUM_SUB_BANDS 5
98#define ACPI_PPAG_WIFI_DATA_SIZE ((ACPI_PPAG_NUM_CHAINS * \
99 ACPI_PPAG_NUM_SUB_BANDS) + 3)
100
101/* PPAG gain value bounds in 1/8 dBm */
102#define ACPI_PPAG_MIN_LB -16
103#define ACPI_PPAG_MAX_LB 24
104#define ACPI_PPAG_MIN_HB -16
105#define ACPI_PPAG_MAX_HB 40
106
95#ifdef CONFIG_ACPI107#ifdef CONFIG_ACPI
96108
97void *iwl_acpi_get_object(struct device *dev, acpi_string method);109void *iwl_acpi_get_object(struct device *dev, acpi_string method);
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h b/drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h
index aaf3974..e02e289 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h
@@ -439,6 +439,7 @@ enum iwl_fw_ini_apply_point {
439 * @IWL_FW_INI_ALLOCATION_ID_SDFX: for SDFX module439 * @IWL_FW_INI_ALLOCATION_ID_SDFX: for SDFX module
440 * @IWL_FW_INI_ALLOCATION_ID_FW_DUMP: used for crash and runtime dumps440 * @IWL_FW_INI_ALLOCATION_ID_FW_DUMP: used for crash and runtime dumps
441 * @IWL_FW_INI_ALLOCATION_ID_USER_DEFINED: for future user scenarios441 * @IWL_FW_INI_ALLOCATION_ID_USER_DEFINED: for future user scenarios
442 * @IWL_FW_INI_ALLOCATION_NUM: number of allocation ids
442*/443*/
443enum iwl_fw_ini_allocation_id {444enum iwl_fw_ini_allocation_id {
444 IWL_FW_INI_ALLOCATION_INVALID,445 IWL_FW_INI_ALLOCATION_INVALID,
@@ -448,6 +449,7 @@ enum iwl_fw_ini_allocation_id {
448 IWL_FW_INI_ALLOCATION_ID_SDFX,449 IWL_FW_INI_ALLOCATION_ID_SDFX,
449 IWL_FW_INI_ALLOCATION_ID_FW_DUMP,450 IWL_FW_INI_ALLOCATION_ID_FW_DUMP,
450 IWL_FW_INI_ALLOCATION_ID_USER_DEFINED,451 IWL_FW_INI_ALLOCATION_ID_USER_DEFINED,
452 IWL_FW_INI_ALLOCATION_NUM,
451}; /* FW_DEBUG_TLV_ALLOCATION_ID_E_VER_1 */453}; /* FW_DEBUG_TLV_ALLOCATION_ID_E_VER_1 */
452454
453/**455/**
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/location.h b/drivers/net/wireless/intel/iwlwifi/fw/api/location.h
index ec864c7..7a0fe5a 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/location.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/location.h
@@ -82,7 +82,7 @@ enum iwl_location_subcmd_ids {
82 TOF_RANGE_ABORT_CMD = 0x2,82 TOF_RANGE_ABORT_CMD = 0x2,
83 /**83 /**
84 * @TOF_RANGE_REQ_EXT_CMD: TOF extended ranging config,84 * @TOF_RANGE_REQ_EXT_CMD: TOF extended ranging config,
85 * uses &struct iwl_tof_range_request_ext_cmd85 * uses &struct iwl_tof_range_req_ext_cmd
86 */86 */
87 TOF_RANGE_REQ_EXT_CMD = 0x3,87 TOF_RANGE_REQ_EXT_CMD = 0x3,
88 /**88 /**
@@ -292,7 +292,7 @@ struct iwl_tof_responder_dyn_config_cmd {
292} __packed; /* TOF_RESPONDER_DYN_CONFIG_CMD_API_S_VER_2 */292} __packed; /* TOF_RESPONDER_DYN_CONFIG_CMD_API_S_VER_2 */
293293
294/**294/**
295 * struct iwl_tof_range_request_ext_cmd - extended range req for WLS295 * struct iwl_tof_range_req_ext_cmd - extended range req for WLS
296 * @tsf_timer_offset_msec: the recommended time offset (mSec) from the AP's TSF296 * @tsf_timer_offset_msec: the recommended time offset (mSec) from the AP's TSF
297 * @reserved: reserved297 * @reserved: reserved
298 * @min_delta_ftm: Minimal time between two consecutive measurements,298 * @min_delta_ftm: Minimal time between two consecutive measurements,
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/phy.h b/drivers/net/wireless/intel/iwlwifi/fw/api/phy.h
index 9cc59e0..8991ddf 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/phy.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/phy.h
@@ -8,6 +8,7 @@
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
11 * Copyright(c) 2019 Intel Corporation
11 *12 *
12 * This program is free software; you can redistribute it and/or modify13 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of version 2 of the GNU General Public License as14 * it under the terms of version 2 of the GNU General Public License as
@@ -30,6 +31,7 @@
30 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
31 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
32 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
34 * Copyright(c) 2019 Intel Corporation
33 * All rights reserved.35 * All rights reserved.
34 *36 *
35 * Redistribution and use in source and binary forms, with or without37 * Redistribution and use in source and binary forms, with or without
@@ -90,6 +92,11 @@ enum iwl_phy_ops_subcmd_ids {
90 GEO_TX_POWER_LIMIT = 0x05,92 GEO_TX_POWER_LIMIT = 0x05,
9193
92 /**94 /**
95 * @PER_PLATFORM_ANT_GAIN_CMD: &struct iwl_ppag_table_cmd
96 */
97 PER_PLATFORM_ANT_GAIN_CMD = 0x07,
98
99 /**
93 * @CT_KILL_NOTIFICATION: &struct ct_kill_notif100 * @CT_KILL_NOTIFICATION: &struct ct_kill_notif
94 */101 */
95 CT_KILL_NOTIFICATION = 0xFE,102 CT_KILL_NOTIFICATION = 0xFE,
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/power.h b/drivers/net/wireless/intel/iwlwifi/fw/api/power.h
index f195db3..6e1b9b2 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/power.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/power.h
@@ -450,6 +450,18 @@ struct iwl_geo_tx_power_profiles_resp {
450} __packed; /* GEO_TX_POWER_LIMIT_RESP */450} __packed; /* GEO_TX_POWER_LIMIT_RESP */
451451
452/**452/**
453 * struct iwl_ppag_table_cmd - struct for PER_PLATFORM_ANT_GAIN_CMD cmd.
454 * @enabled: 1 if PPAG is enabled, 0 otherwise
455 * @gain: table of antenna gain values per chain and sub-band
456 * @reserved: reserved
457 */
458struct iwl_ppag_table_cmd {
459 __le32 enabled;
460 s8 gain[IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS];
461 s8 reserved[2];
462} __packed; /* PER_PLATFORM_ANT_GAIN_CMD */
463
464/**
453 * struct iwl_beacon_filter_cmd465 * struct iwl_beacon_filter_cmd
454 * REPLY_BEACON_FILTERING_CMD = 0xd2 (command)466 * REPLY_BEACON_FILTERING_CMD = 0xd2 (command)
455 * @bf_energy_delta: Used for RSSI filtering, if in 'normal' state. Send beacon467 * @bf_energy_delta: Used for RSSI filtering, if in 'normal' state. Send beacon
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h b/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h
index 4a96090..2920a11 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h
@@ -777,7 +777,6 @@ struct iwl_rss_config_cmd {
777 u8 indirection_table[IWL_RSS_INDIRECTION_TABLE_SIZE];777 u8 indirection_table[IWL_RSS_INDIRECTION_TABLE_SIZE];
778} __packed; /* RSS_CONFIG_CMD_API_S_VER_1 */778} __packed; /* RSS_CONFIG_CMD_API_S_VER_1 */
779779
780#define IWL_MULTI_QUEUE_SYNC_MSG_MAX_SIZE 128
781#define IWL_MULTI_QUEUE_SYNC_SENDER_POS 0780#define IWL_MULTI_QUEUE_SYNC_SENDER_POS 0
782#define IWL_MULTI_QUEUE_SYNC_SENDER_MSK 0xf781#define IWL_MULTI_QUEUE_SYNC_SENDER_MSK 0xf
783782
@@ -813,10 +812,12 @@ struct iwl_rxq_sync_notification {
813 *812 *
814 * @IWL_MVM_RXQ_EMPTY: empty sync notification813 * @IWL_MVM_RXQ_EMPTY: empty sync notification
815 * @IWL_MVM_RXQ_NOTIF_DEL_BA: notify RSS queues of delBA814 * @IWL_MVM_RXQ_NOTIF_DEL_BA: notify RSS queues of delBA
815 * @IWL_MVM_RXQ_NSSN_SYNC: notify all the RSS queues with the new NSSN
816 */816 */
817enum iwl_mvm_rxq_notif_type {817enum iwl_mvm_rxq_notif_type {
818 IWL_MVM_RXQ_EMPTY,818 IWL_MVM_RXQ_EMPTY,
819 IWL_MVM_RXQ_NOTIF_DEL_BA,819 IWL_MVM_RXQ_NOTIF_DEL_BA,
820 IWL_MVM_RXQ_NSSN_SYNC,
820};821};
821822
822/**823/**
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
index d5a595a..d243f71 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
@@ -468,6 +468,9 @@ static const struct iwl_prph_range iwl_prph_dump_addr_9000[] = {
468 { .start = 0x00a05400, .end = 0x00a056e8 },468 { .start = 0x00a05400, .end = 0x00a056e8 },
469 { .start = 0x00a08000, .end = 0x00a098bc },469 { .start = 0x00a08000, .end = 0x00a098bc },
470 { .start = 0x00a02400, .end = 0x00a02758 },470 { .start = 0x00a02400, .end = 0x00a02758 },
471 { .start = 0x00a04764, .end = 0x00a0476c },
472 { .start = 0x00a04770, .end = 0x00a04774 },
473 { .start = 0x00a04620, .end = 0x00a04624 },
471};474};
472475
473static const struct iwl_prph_range iwl_prph_dump_addr_22000[] = {476static const struct iwl_prph_range iwl_prph_dump_addr_22000[] = {
@@ -1905,8 +1908,6 @@ static void iwl_fw_ini_dump_trigger(struct iwl_fw_runtime *fwrt,
1905 iwl_dump_ini_mem(fwrt, data, reg, &ops);1908 iwl_dump_ini_mem(fwrt, data, reg, &ops);
1906 break;1909 break;
1907 case IWL_FW_INI_REGION_PERIPHERY_MAC:1910 case IWL_FW_INI_REGION_PERIPHERY_MAC:
1908 case IWL_FW_INI_REGION_PERIPHERY_PHY:
1909 case IWL_FW_INI_REGION_PERIPHERY_AUX:
1910 ops.get_num_of_ranges = iwl_dump_ini_mem_ranges;1911 ops.get_num_of_ranges = iwl_dump_ini_mem_ranges;
1911 ops.get_size = iwl_dump_ini_mem_get_size;1912 ops.get_size = iwl_dump_ini_mem_get_size;
1912 ops.fill_mem_hdr = iwl_dump_ini_mem_fill_header;1913 ops.fill_mem_hdr = iwl_dump_ini_mem_fill_header;
@@ -1971,6 +1972,8 @@ static void iwl_fw_ini_dump_trigger(struct iwl_fw_runtime *fwrt,
1971 ops.fill_range = iwl_dump_ini_csr_iter;1972 ops.fill_range = iwl_dump_ini_csr_iter;
1972 iwl_dump_ini_mem(fwrt, data, reg, &ops);1973 iwl_dump_ini_mem(fwrt, data, reg, &ops);
1973 break;1974 break;
1975 case IWL_FW_INI_REGION_PERIPHERY_PHY:
1976 case IWL_FW_INI_REGION_PERIPHERY_AUX:
1974 case IWL_FW_INI_REGION_DRAM_IMR:1977 case IWL_FW_INI_REGION_DRAM_IMR:
1975 /* This is undefined yet */1978 /* This is undefined yet */
1976 default:1979 default:
@@ -2481,8 +2484,7 @@ iwl_fw_dbg_buffer_allocation(struct iwl_fw_runtime *fwrt, u32 size)
24812484
2482 virtual_addr =2485 virtual_addr =
2483 dma_alloc_coherent(fwrt->trans->dev, size, &phys_addr,2486 dma_alloc_coherent(fwrt->trans->dev, size, &phys_addr,
2484 GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO |2487 GFP_KERNEL | __GFP_NOWARN);
2485 __GFP_COMP);
24862488
2487 /* TODO: alloc fragments if needed */2489 /* TODO: alloc fragments if needed */
2488 if (!virtual_addr)2490 if (!virtual_addr)
@@ -2499,7 +2501,7 @@ iwl_fw_dbg_buffer_allocation(struct iwl_fw_runtime *fwrt, u32 size)
2499}2501}
25002502
2501static void iwl_fw_dbg_buffer_apply(struct iwl_fw_runtime *fwrt,2503static void iwl_fw_dbg_buffer_apply(struct iwl_fw_runtime *fwrt,
2502 struct iwl_fw_ini_allocation_data *alloc,2504 struct iwl_fw_ini_allocation_tlv *alloc,
2503 enum iwl_fw_ini_apply_point pnt)2505 enum iwl_fw_ini_apply_point pnt)
2504{2506{
2505 struct iwl_trans *trans = fwrt->trans;2507 struct iwl_trans *trans = fwrt->trans;
@@ -2514,7 +2516,14 @@ static void iwl_fw_dbg_buffer_apply(struct iwl_fw_runtime *fwrt,
2514 .len[0] = sizeof(ldbg_cmd),2516 .len[0] = sizeof(ldbg_cmd),
2515 };2517 };
2516 int block_idx = trans->dbg.num_blocks;2518 int block_idx = trans->dbg.num_blocks;
2517 u32 buf_location = le32_to_cpu(alloc->tlv.buffer_location);2519 u32 buf_location = le32_to_cpu(alloc->buffer_location);
2520 u32 alloc_id = le32_to_cpu(alloc->allocation_id);
2521
2522 if (alloc_id <= IWL_FW_INI_ALLOCATION_INVALID ||
2523 alloc_id >= IWL_FW_INI_ALLOCATION_NUM) {
2524 IWL_ERR(fwrt, "WRT: Invalid allocation id %d\n", alloc_id);
2525 return;
2526 }
25182527
2519 if (fwrt->trans->dbg.ini_dest == IWL_FW_INI_LOCATION_INVALID)2528 if (fwrt->trans->dbg.ini_dest == IWL_FW_INI_LOCATION_INVALID)
2520 fwrt->trans->dbg.ini_dest = buf_location;2529 fwrt->trans->dbg.ini_dest = buf_location;
@@ -2539,12 +2548,11 @@ static void iwl_fw_dbg_buffer_apply(struct iwl_fw_runtime *fwrt,
2539 if (buf_location != IWL_FW_INI_LOCATION_DRAM_PATH)2548 if (buf_location != IWL_FW_INI_LOCATION_DRAM_PATH)
2540 return;2549 return;
25412550
2542 if (!alloc->is_alloc) {2551 if (!(BIT(alloc_id) & fwrt->trans->dbg.is_alloc)) {
2543 iwl_fw_dbg_buffer_allocation(fwrt,2552 iwl_fw_dbg_buffer_allocation(fwrt, le32_to_cpu(alloc->size));
2544 le32_to_cpu(alloc->tlv.size));
2545 if (block_idx == trans->dbg.num_blocks)2553 if (block_idx == trans->dbg.num_blocks)
2546 return;2554 return;
2547 alloc->is_alloc = 1;2555 fwrt->trans->dbg.is_alloc |= BIT(alloc_id);
2548 }2556 }
25492557
2550 /* First block is assigned via registers / context info */2558 /* First block is assigned via registers / context info */
@@ -2557,9 +2565,9 @@ static void iwl_fw_dbg_buffer_apply(struct iwl_fw_runtime *fwrt,
2557 cmd->num_frags = cpu_to_le32(1);2565 cmd->num_frags = cpu_to_le32(1);
2558 cmd->fragments[0].address =2566 cmd->fragments[0].address =
2559 cpu_to_le64(trans->dbg.fw_mon[block_idx].physical);2567 cpu_to_le64(trans->dbg.fw_mon[block_idx].physical);
2560 cmd->fragments[0].size = alloc->tlv.size;2568 cmd->fragments[0].size = alloc->size;
2561 cmd->allocation_id = alloc->tlv.allocation_id;2569 cmd->allocation_id = alloc->allocation_id;
2562 cmd->buffer_location = alloc->tlv.buffer_location;2570 cmd->buffer_location = alloc->buffer_location;
25632571
2564 iwl_trans_send_cmd(trans, &hcmd);2572 iwl_trans_send_cmd(trans, &hcmd);
2565}2573}
@@ -2773,10 +2781,13 @@ static void _iwl_fw_dbg_apply_point(struct iwl_fw_runtime *fwrt,
2773 enum iwl_fw_ini_apply_point pnt,2781 enum iwl_fw_ini_apply_point pnt,
2774 bool ext)2782 bool ext)
2775{2783{
2776 void *iter = data->data;2784 struct iwl_apply_point_data *iter;
2785
2786 if (!data->list.next)
2787 return;
27772788
2778 while (iter && iter < data->data + data->size) {2789 list_for_each_entry(iter, &data->list, list) {
2779 struct iwl_ucode_tlv *tlv = iter;2790 struct iwl_ucode_tlv *tlv = &iter->tlv;
2780 void *ini_tlv = (void *)tlv->data;2791 void *ini_tlv = (void *)tlv->data;
2781 u32 type = le32_to_cpu(tlv->type);2792 u32 type = le32_to_cpu(tlv->type);
2782 const char invalid_ap_str[] =2793 const char invalid_ap_str[] =
@@ -2786,24 +2797,19 @@ static void _iwl_fw_dbg_apply_point(struct iwl_fw_runtime *fwrt,
2786 case IWL_UCODE_TLV_TYPE_DEBUG_INFO:2797 case IWL_UCODE_TLV_TYPE_DEBUG_INFO:
2787 iwl_fw_dbg_info_apply(fwrt, ini_tlv, ext, pnt);2798 iwl_fw_dbg_info_apply(fwrt, ini_tlv, ext, pnt);
2788 break;2799 break;
2789 case IWL_UCODE_TLV_TYPE_BUFFER_ALLOCATION: {2800 case IWL_UCODE_TLV_TYPE_BUFFER_ALLOCATION:
2790 struct iwl_fw_ini_allocation_data *buf_alloc = ini_tlv;
2791
2792 if (pnt != IWL_FW_INI_APPLY_EARLY) {2801 if (pnt != IWL_FW_INI_APPLY_EARLY) {
2793 IWL_ERR(fwrt, invalid_ap_str, ext, pnt,2802 IWL_ERR(fwrt, invalid_ap_str, ext, pnt,
2794 "buffer allocation");2803 "buffer allocation");
2795 goto next;2804 break;
2796 }2805 }
2797
2798 iwl_fw_dbg_buffer_apply(fwrt, ini_tlv, pnt);2806 iwl_fw_dbg_buffer_apply(fwrt, ini_tlv, pnt);
2799 iter += sizeof(buf_alloc->is_alloc);
2800 break;2807 break;
2801 }
2802 case IWL_UCODE_TLV_TYPE_HCMD:2808 case IWL_UCODE_TLV_TYPE_HCMD:
2803 if (pnt < IWL_FW_INI_APPLY_AFTER_ALIVE) {2809 if (pnt < IWL_FW_INI_APPLY_AFTER_ALIVE) {
2804 IWL_ERR(fwrt, invalid_ap_str, ext, pnt,2810 IWL_ERR(fwrt, invalid_ap_str, ext, pnt,
2805 "host command");2811 "host command");
2806 goto next;2812 break;
2807 }2813 }
2808 iwl_fw_dbg_send_hcmd(fwrt, tlv, ext);2814 iwl_fw_dbg_send_hcmd(fwrt, tlv, ext);
2809 break;2815 break;
@@ -2821,8 +2827,6 @@ static void _iwl_fw_dbg_apply_point(struct iwl_fw_runtime *fwrt,
2821 ext, type);2827 ext, type);
2822 break;2828 break;
2823 }2829 }
2824next:
2825 iter += sizeof(*tlv) + le32_to_cpu(tlv->length);
2826 }2830 }
2827}2831}
28282832
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h
index a2b9299..d2b162f 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/file.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h
@@ -476,6 +476,7 @@ enum iwl_ucode_tlv_capa {
476 IWL_UCODE_TLV_CAPA_ULTRA_HB_CHANNELS = (__force iwl_ucode_tlv_capa_t)48,476 IWL_UCODE_TLV_CAPA_ULTRA_HB_CHANNELS = (__force iwl_ucode_tlv_capa_t)48,
477 IWL_UCODE_TLV_CAPA_CS_MODIFY = (__force iwl_ucode_tlv_capa_t)49,477 IWL_UCODE_TLV_CAPA_CS_MODIFY = (__force iwl_ucode_tlv_capa_t)49,
478 IWL_UCODE_TLV_CAPA_SET_LTR_GEN2 = (__force iwl_ucode_tlv_capa_t)50,478 IWL_UCODE_TLV_CAPA_SET_LTR_GEN2 = (__force iwl_ucode_tlv_capa_t)50,
479 IWL_UCODE_TLV_CAPA_SET_PPAG = (__force iwl_ucode_tlv_capa_t)52,
479480
480 /* set 2 */481 /* set 2 */
481 IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE = (__force iwl_ucode_tlv_capa_t)64,482 IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE = (__force iwl_ucode_tlv_capa_t)64,
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/img.h b/drivers/net/wireless/intel/iwlwifi/fw/img.h
index 18ca5f1..039576d 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/img.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/img.h
@@ -228,15 +228,6 @@ struct iwl_fw_dbg {
228};228};
229229
230/**230/**
231 * @tlv: the buffer allocation tlv
232 * @is_alloc: indicates if the buffer was already allocated
233 */
234struct iwl_fw_ini_allocation_data {
235 struct iwl_fw_ini_allocation_tlv tlv;
236 u32 is_alloc;
237} __packed;
238
239/**
240 * struct iwl_fw_ini_active_triggers231 * struct iwl_fw_ini_active_triggers
241 * @active: is this trigger active232 * @active: is this trigger active
242 * @size: allocated memory size of the trigger233 * @size: allocated memory size of the trigger
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-config.h b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
index 286bc0c..2cc02f0 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-config.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
@@ -523,10 +523,13 @@ extern const struct iwl_cfg iwl22000_2ac_cfg_hr;
523extern const struct iwl_cfg iwl22000_2ac_cfg_hr_cdb;523extern const struct iwl_cfg iwl22000_2ac_cfg_hr_cdb;
524extern const struct iwl_cfg iwl22000_2ac_cfg_jf;524extern const struct iwl_cfg iwl22000_2ac_cfg_jf;
525extern const struct iwl_cfg iwl_ax101_cfg_qu_hr;525extern const struct iwl_cfg iwl_ax101_cfg_qu_hr;
526extern const struct iwl_cfg iwl_ax101_cfg_qu_c0_hr_b0;
526extern const struct iwl_cfg iwl_ax101_cfg_quz_hr;527extern const struct iwl_cfg iwl_ax101_cfg_quz_hr;
527extern const struct iwl_cfg iwl22000_2ax_cfg_hr;528extern const struct iwl_cfg iwl22000_2ax_cfg_hr;
528extern const struct iwl_cfg iwl_ax200_cfg_cc;529extern const struct iwl_cfg iwl_ax200_cfg_cc;
529extern const struct iwl_cfg iwl_ax201_cfg_qu_hr;530extern const struct iwl_cfg iwl_ax201_cfg_qu_hr;
531extern const struct iwl_cfg iwl_ax201_cfg_qu_hr;
532extern const struct iwl_cfg iwl_ax201_cfg_qu_c0_hr_b0;
530extern const struct iwl_cfg iwl_ax201_cfg_quz_hr;533extern const struct iwl_cfg iwl_ax201_cfg_quz_hr;
531extern const struct iwl_cfg iwl_ax1650i_cfg_quz_hr;534extern const struct iwl_cfg iwl_ax1650i_cfg_quz_hr;
532extern const struct iwl_cfg iwl_ax1650s_cfg_quz_hr;535extern const struct iwl_cfg iwl_ax1650s_cfg_quz_hr;
@@ -538,6 +541,10 @@ extern const struct iwl_cfg iwl9461_2ac_cfg_qu_b0_jf_b0;
538extern const struct iwl_cfg iwl9462_2ac_cfg_qu_b0_jf_b0;541extern const struct iwl_cfg iwl9462_2ac_cfg_qu_b0_jf_b0;
539extern const struct iwl_cfg iwl9560_2ac_cfg_qu_b0_jf_b0;542extern const struct iwl_cfg iwl9560_2ac_cfg_qu_b0_jf_b0;
540extern const struct iwl_cfg iwl9560_2ac_160_cfg_qu_b0_jf_b0;543extern const struct iwl_cfg iwl9560_2ac_160_cfg_qu_b0_jf_b0;
544extern const struct iwl_cfg iwl9461_2ac_cfg_qu_c0_jf_b0;
545extern const struct iwl_cfg iwl9462_2ac_cfg_qu_c0_jf_b0;
546extern const struct iwl_cfg iwl9560_2ac_cfg_qu_c0_jf_b0;
547extern const struct iwl_cfg iwl9560_2ac_160_cfg_qu_c0_jf_b0;
541extern const struct iwl_cfg killer1550i_2ac_cfg_qu_b0_jf_b0;548extern const struct iwl_cfg killer1550i_2ac_cfg_qu_b0_jf_b0;
542extern const struct iwl_cfg killer1550s_2ac_cfg_qu_b0_jf_b0;549extern const struct iwl_cfg killer1550s_2ac_cfg_qu_b0_jf_b0;
543extern const struct iwl_cfg iwl22000_2ax_cfg_jf;550extern const struct iwl_cfg iwl22000_2ax_cfg_jf;
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-csr.h b/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
index 1c867ce..cb4c551 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
@@ -329,6 +329,7 @@ enum {
329#define CSR_HW_REV_TYPE_QNJ (0x0000360)329#define CSR_HW_REV_TYPE_QNJ (0x0000360)
330#define CSR_HW_REV_TYPE_QNJ_B0 (0x0000364)330#define CSR_HW_REV_TYPE_QNJ_B0 (0x0000364)
331#define CSR_HW_REV_TYPE_QU_B0 (0x0000334)331#define CSR_HW_REV_TYPE_QU_B0 (0x0000334)
332#define CSR_HW_REV_TYPE_QU_C0 (0x0000338)
332#define CSR_HW_REV_TYPE_QUZ (0x0000354)333#define CSR_HW_REV_TYPE_QUZ (0x0000354)
333#define CSR_HW_REV_TYPE_HR_CDB (0x0000340)334#define CSR_HW_REV_TYPE_HR_CDB (0x0000340)
334#define CSR_HW_REV_TYPE_SO (0x0000370)335#define CSR_HW_REV_TYPE_SO (0x0000370)
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c
index c4481aa..3029236 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c
@@ -60,143 +60,79 @@
60#include "iwl-trans.h"60#include "iwl-trans.h"
61#include "iwl-dbg-tlv.h"61#include "iwl-dbg-tlv.h"
6262
63void iwl_fw_dbg_copy_tlv(struct iwl_trans *trans, struct iwl_ucode_tlv *tlv,63void iwl_dbg_tlv_copy(struct iwl_trans *trans, struct iwl_ucode_tlv *tlv,
64 bool ext)64 bool ext)
65{65{
66 struct iwl_apply_point_data *data;66 struct iwl_apply_point_data *dbg_cfg, *tlv_copy;
67 struct iwl_fw_ini_header *header = (void *)&tlv->data[0];67 struct iwl_fw_ini_header *header = (void *)&tlv->data[0];
68 u32 tlv_type = le32_to_cpu(tlv->type);
69 u32 len = le32_to_cpu(tlv->length);
68 u32 apply_point = le32_to_cpu(header->apply_point);70 u32 apply_point = le32_to_cpu(header->apply_point);
6971
70 int copy_size = le32_to_cpu(tlv->length) + sizeof(*tlv);
71 int offset_size = copy_size;
72
73 if (le32_to_cpu(header->tlv_version) != 1)72 if (le32_to_cpu(header->tlv_version) != 1)
74 return;73 return;
7574
76 if (WARN_ONCE(apply_point >= IWL_FW_INI_APPLY_NUM,75 if (WARN_ONCE(apply_point >= IWL_FW_INI_APPLY_NUM,
77 "Invalid apply point id %d\n", apply_point))76 "Invalid apply point %d\n", apply_point))
78 return;77 return;
7978
79 IWL_DEBUG_FW(trans, "WRT: read TLV 0x%x, apply point %d\n",
80 tlv_type, apply_point);
81
80 if (ext)82 if (ext)
81 data = &trans->dbg.apply_points_ext[apply_point];83 dbg_cfg = &trans->dbg.apply_points_ext[apply_point];
82 else84 else
83 data = &trans->dbg.apply_points[apply_point];85 dbg_cfg = &trans->dbg.apply_points[apply_point];
84
85 /* add room for is_alloc field in &iwl_fw_ini_allocation_data struct */
86 if (le32_to_cpu(tlv->type) == IWL_UCODE_TLV_TYPE_BUFFER_ALLOCATION) {
87 struct iwl_fw_ini_allocation_data *buf_alloc =
88 (void *)tlv->data;
89
90 offset_size += sizeof(buf_alloc->is_alloc);
91 }
9286
93 /*87 tlv_copy = kzalloc(sizeof(*tlv_copy) + len, GFP_KERNEL);
94 * Make sure we still have room to copy this TLV. Offset points to the88 if (!tlv_copy) {
95 * location the last copy ended.89 IWL_ERR(trans, "WRT: No memory for TLV 0x%x, apply point %d\n",
96 */90 tlv_type, apply_point);
97 if (WARN_ONCE(data->offset + offset_size > data->size,
98 "Not enough memory for apply point %d\n",
99 apply_point))
100 return;91 return;
101
102 memcpy(data->data + data->offset, (void *)tlv, copy_size);
103 data->offset += offset_size;
104}
105
106void iwl_alloc_dbg_tlv(struct iwl_trans *trans, size_t len, const u8 *data,
107 bool ext)
108{
109 struct iwl_ucode_tlv *tlv;
110 u32 size[IWL_FW_INI_APPLY_NUM] = {0};
111 int i;
112
113 while (len >= sizeof(*tlv)) {
114 u32 tlv_len, tlv_type, apply;
115 struct iwl_fw_ini_header *hdr;
116
117 len -= sizeof(*tlv);
118 tlv = (void *)data;
119
120 tlv_len = le32_to_cpu(tlv->length);
121 tlv_type = le32_to_cpu(tlv->type);
122
123 if (len < tlv_len)
124 return;
125
126 len -= ALIGN(tlv_len, 4);
127 data += sizeof(*tlv) + ALIGN(tlv_len, 4);
128
129 if (tlv_type < IWL_UCODE_TLV_DEBUG_BASE ||
130 tlv_type > IWL_UCODE_TLV_DEBUG_MAX)
131 continue;
132
133 hdr = (void *)&tlv->data[0];
134 apply = le32_to_cpu(hdr->apply_point);
135
136 if (le32_to_cpu(hdr->tlv_version) != 1)
137 continue;
138
139 IWL_DEBUG_FW(trans, "WRT: read TLV 0x%x, apply point %d\n",
140 le32_to_cpu(tlv->type), apply);
141
142 if (WARN_ON(apply >= IWL_FW_INI_APPLY_NUM))
143 continue;
144
145 /* add room for is_alloc field in &iwl_fw_ini_allocation_data
146 * struct
147 */
148 if (tlv_type == IWL_UCODE_TLV_TYPE_BUFFER_ALLOCATION) {
149 struct iwl_fw_ini_allocation_data *buf_alloc =
150 (void *)tlv->data;
151
152 size[apply] += sizeof(buf_alloc->is_alloc);
153 }
154
155 size[apply] += sizeof(*tlv) + tlv_len;
156 }92 }
15793
158 for (i = 0; i < ARRAY_SIZE(size); i++) {94 INIT_LIST_HEAD(&tlv_copy->list);
159 void *mem;95 memcpy(&tlv_copy->tlv, tlv, sizeof(*tlv) + len);
16096
161 if (!size[i])97 if (!dbg_cfg->list.next)
162 continue;98 INIT_LIST_HEAD(&dbg_cfg->list);
16399
164 mem = kzalloc(size[i], GFP_KERNEL);100 list_add_tail(&tlv_copy->list, &dbg_cfg->list);
165101
166 if (!mem) {102 trans->dbg.ini_valid = true;
167 IWL_ERR(trans, "No memory for apply point %d\n", i);103}
168 return;
169 }
170104
171 if (ext) {105static void iwl_dbg_tlv_free_list(struct list_head *list)
172 trans->dbg.apply_points_ext[i].data = mem;106{
173 trans->dbg.apply_points_ext[i].size = size[i];107 if (!list || !list->next)
174 } else {108 return;
175 trans->dbg.apply_points[i].data = mem;
176 trans->dbg.apply_points[i].size = size[i];
177 }
178109
179 trans->dbg.ini_valid = true;110 while (!list_empty(list)) {
111 struct iwl_apply_point_data *node =
112 list_entry(list->next, typeof(*node), list);
113
114 list_del(&node->list);
115 kfree(node);
180 }116 }
181}117}
182118
183void iwl_fw_dbg_free(struct iwl_trans *trans)119void iwl_dbg_tlv_free(struct iwl_trans *trans)
184{120{
185 int i;121 int i;
186122
187 for (i = 0; i < ARRAY_SIZE(trans->dbg.apply_points); i++) {123 for (i = 0; i < ARRAY_SIZE(trans->dbg.apply_points); i++) {
188 kfree(trans->dbg.apply_points[i].data);124 struct iwl_apply_point_data *data;
189 trans->dbg.apply_points[i].size = 0;125
190 trans->dbg.apply_points[i].offset = 0;126 data = &trans->dbg.apply_points[i];
127 iwl_dbg_tlv_free_list(&data->list);
191128
192 kfree(trans->dbg.apply_points_ext[i].data);129 data = &trans->dbg.apply_points_ext[i];
193 trans->dbg.apply_points_ext[i].size = 0;130 iwl_dbg_tlv_free_list(&data->list);
194 trans->dbg.apply_points_ext[i].offset = 0;
195 }131 }
196}132}
197133
198static int iwl_parse_fw_dbg_tlv(struct iwl_trans *trans, const u8 *data,134static int iwl_dbg_tlv_parse_bin(struct iwl_trans *trans, const u8 *data,
199 size_t len)135 size_t len)
200{136{
201 struct iwl_ucode_tlv *tlv;137 struct iwl_ucode_tlv *tlv;
202 enum iwl_ucode_tlv_type tlv_type;138 enum iwl_ucode_tlv_type tlv_type;
@@ -224,7 +160,7 @@ static int iwl_parse_fw_dbg_tlv(struct iwl_trans *trans, const u8 *data,
224 case IWL_UCODE_TLV_TYPE_REGIONS:160 case IWL_UCODE_TLV_TYPE_REGIONS:
225 case IWL_UCODE_TLV_TYPE_TRIGGERS:161 case IWL_UCODE_TLV_TYPE_TRIGGERS:
226 case IWL_UCODE_TLV_TYPE_DEBUG_FLOW:162 case IWL_UCODE_TLV_TYPE_DEBUG_FLOW:
227 iwl_fw_dbg_copy_tlv(trans, tlv, true);163 iwl_dbg_tlv_copy(trans, tlv, true);
228 break;164 break;
229 default:165 default:
230 WARN_ONCE(1, "Invalid TLV %x\n", tlv_type);166 WARN_ONCE(1, "Invalid TLV %x\n", tlv_type);
@@ -235,7 +171,7 @@ static int iwl_parse_fw_dbg_tlv(struct iwl_trans *trans, const u8 *data,
235 return 0;171 return 0;
236}172}
237173
238void iwl_load_fw_dbg_tlv(struct device *dev, struct iwl_trans *trans)174void iwl_dbg_tlv_load_bin(struct device *dev, struct iwl_trans *trans)
239{175{
240 const struct firmware *fw;176 const struct firmware *fw;
241 int res;177 int res;
@@ -247,8 +183,7 @@ void iwl_load_fw_dbg_tlv(struct device *dev, struct iwl_trans *trans)
247 if (res)183 if (res)
248 return;184 return;
249185
250 iwl_alloc_dbg_tlv(trans, fw->size, fw->data, true);186 iwl_dbg_tlv_parse_bin(trans, fw->data, fw->size);
251 iwl_parse_fw_dbg_tlv(trans, fw->data, fw->size);
252187
253 trans->dbg.external_ini_loaded = true;188 trans->dbg.external_ini_loaded = true;
254 release_firmware(fw);189 release_firmware(fw);
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.h b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.h
index ee416f4..20c60a9 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.h
@@ -5,7 +5,7 @@
5 *5 *
6 * GPL LICENSE SUMMARY6 * GPL LICENSE SUMMARY
7 *7 *
8 * Copyright (C) 2018 Intel Corporation8 * Copyright (C) 2018 - 2019 Intel Corporation
9 *9 *
10 * This program is free software; you can redistribute it and/or modify10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of version 2 of the GNU General Public License as11 * it under the terms of version 2 of the GNU General Public License as
@@ -25,7 +25,7 @@
25 *25 *
26 * BSD LICENSE26 * BSD LICENSE
27 *27 *
28 * Copyright (C) 2018 Intel Corporation28 * Copyright (C) 2018 - 2019 Intel Corporation
29 * All rights reserved.29 * All rights reserved.
30 *30 *
31 * Redistribution and use in source and binary forms, with or without31 * Redistribution and use in source and binary forms, with or without
@@ -63,22 +63,18 @@
6363
64/**64/**
65 * struct iwl_apply_point_data65 * struct iwl_apply_point_data
66 * @data: start address of this apply point data66 * @list: list to go through the TLVs of the apply point
67 * @size total size of the data67 * @tlv: a debug TLV
68 * @offset: current offset of the copied data
69 */68 */
70struct iwl_apply_point_data {69struct iwl_apply_point_data {
71 void *data;70 struct list_head list;
72 int size;71 struct iwl_ucode_tlv tlv;
73 int offset;
74};72};
7573
76struct iwl_trans;74struct iwl_trans;
77void iwl_load_fw_dbg_tlv(struct device *dev, struct iwl_trans *trans);75void iwl_dbg_tlv_load_bin(struct device *dev, struct iwl_trans *trans);
78void iwl_fw_dbg_free(struct iwl_trans *trans);76void iwl_dbg_tlv_free(struct iwl_trans *trans);
79void iwl_fw_dbg_copy_tlv(struct iwl_trans *trans, struct iwl_ucode_tlv *tlv,77void iwl_dbg_tlv_copy(struct iwl_trans *trans, struct iwl_ucode_tlv *tlv,
80 bool ext);78 bool ext);
81void iwl_alloc_dbg_tlv(struct iwl_trans *trans, size_t len, const u8 *data,
82 bool ext);
8379
84#endif /* __iwl_dbg_tlv_h__*/80#endif /* __iwl_dbg_tlv_h__*/
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
index c4bfbb8..f70a749 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
@@ -897,9 +897,6 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,
897fw_dbg_conf:897fw_dbg_conf:
898#endif898#endif
899899
900 if (iwlwifi_mod_params.enable_ini)
901 iwl_alloc_dbg_tlv(drv->trans, len, data, false);
902
903 while (len >= sizeof(*tlv)) {900 while (len >= sizeof(*tlv)) {
904 len -= sizeof(*tlv);901 len -= sizeof(*tlv);
905 tlv = (void *)data;902 tlv = (void *)data;
@@ -1437,7 +1434,7 @@ fw_dbg_conf:
1437 case IWL_UCODE_TLV_TYPE_TRIGGERS:1434 case IWL_UCODE_TLV_TYPE_TRIGGERS:
1438 case IWL_UCODE_TLV_TYPE_DEBUG_FLOW:1435 case IWL_UCODE_TLV_TYPE_DEBUG_FLOW:
1439 if (iwlwifi_mod_params.enable_ini)1436 if (iwlwifi_mod_params.enable_ini)
1440 iwl_fw_dbg_copy_tlv(drv->trans, tlv, false);1437 iwl_dbg_tlv_copy(drv->trans, tlv, false);
1441 break;1438 break;
1442 case IWL_UCODE_TLV_CMD_VERSIONS:1439 case IWL_UCODE_TLV_CMD_VERSIONS:
1443 if (tlv_len % sizeof(struct iwl_fw_cmd_version)) {1440 if (tlv_len % sizeof(struct iwl_fw_cmd_version)) {
@@ -1956,9 +1953,8 @@ struct iwl_drv *iwl_drv_start(struct iwl_trans *trans)
1956#ifdef CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES1953#ifdef CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES
1957 trans->dbg_cfg = current_dbg_config;1954 trans->dbg_cfg = current_dbg_config;
1958 iwl_dbg_cfg_load_ini(drv->trans->dev, &drv->trans->dbg_cfg);1955 iwl_dbg_cfg_load_ini(drv->trans->dev, &drv->trans->dbg_cfg);
1959
1960 iwl_load_fw_dbg_tlv(drv->trans->dev, drv->trans);
1961#endif1956#endif
1957 iwl_dbg_tlv_load_bin(drv->trans->dev, drv->trans);
19621958
1963#ifdef CPTCFG_IWLWIFI_DEBUGFS1959#ifdef CPTCFG_IWLWIFI_DEBUGFS
1964 /* Create the device debugfs entries. */1960 /* Create the device debugfs entries. */
@@ -1995,8 +1991,8 @@ err_fw:
1995#endif1991#endif
1996#ifdef CPTCFG_IWLWIFI_DEBUGFS1992#ifdef CPTCFG_IWLWIFI_DEBUGFS
1997 debugfs_remove_recursive(drv->dbgfs_drv);1993 debugfs_remove_recursive(drv->dbgfs_drv);
1998 iwl_fw_dbg_free(drv->trans);
1999#endif1994#endif
1995 iwl_dbg_tlv_free(drv->trans);
2000 kfree(drv);1996 kfree(drv);
2001err:1997err:
2002 return ERR_PTR(ret);1998 return ERR_PTR(ret);
@@ -2029,7 +2025,7 @@ void iwl_drv_stop(struct iwl_drv *drv)
2029#ifdef CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES2025#ifdef CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES
2030 iwl_dbg_cfg_free(&drv->trans->dbg_cfg);2026 iwl_dbg_cfg_free(&drv->trans->dbg_cfg);
2031#endif2027#endif
2032 iwl_fw_dbg_free(drv->trans);2028 iwl_dbg_tlv_free(drv->trans);
20332029
2034#if IS_ENABLED(CPTCFG_IWLXVT)2030#if IS_ENABLED(CPTCFG_IWLXVT)
2035 iwl_remove_sysfs_file(drv);2031 iwl_remove_sysfs_file(drv);
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
index 1b26b5d..c83de0e 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
@@ -1232,11 +1232,6 @@ static u32 iwl_nvm_get_regdom_bw_flags(const u16 *nvm_chan,
1232 return flags;1232 return flags;
1233}1233}
12341234
1235struct regdb_ptrs {
1236 struct ieee80211_wmm_rule *rule;
1237 u32 token;
1238};
1239
1240struct ieee80211_regdomain *1235struct ieee80211_regdomain *
1241iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,1236iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
1242 int num_of_ch, __le32 *channels, u16 fw_mcc,1237 int num_of_ch, __le32 *channels, u16 fw_mcc,
@@ -1248,7 +1243,6 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
1248 const u16 *nvm_chan;1243 const u16 *nvm_chan;
1249 struct ieee80211_regdomain *regd, *copy_rd;1244 struct ieee80211_regdomain *regd, *copy_rd;
1250 struct ieee80211_reg_rule *rule;1245 struct ieee80211_reg_rule *rule;
1251 struct regdb_ptrs *regdb_ptrs;
1252 enum nl80211_band band;1246 enum nl80211_band band;
1253 int center_freq, prev_center_freq = 0;1247 int center_freq, prev_center_freq = 0;
1254 int valid_rules = 0;1248 int valid_rules = 0;
@@ -1280,12 +1274,6 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
1280 if (!regd)1274 if (!regd)
1281 return ERR_PTR(-ENOMEM);1275 return ERR_PTR(-ENOMEM);
12821276
1283 regdb_ptrs = kcalloc(num_of_ch, sizeof(*regdb_ptrs), GFP_KERNEL);
1284 if (!regdb_ptrs) {
1285 copy_rd = ERR_PTR(-ENOMEM);
1286 goto out;
1287 }
1288
1289 /* set alpha2 from FW. */1277 /* set alpha2 from FW. */
1290 regd->alpha2[0] = fw_mcc >> 8;1278 regd->alpha2[0] = fw_mcc >> 8;
1291 regd->alpha2[1] = fw_mcc & 0xff;1279 regd->alpha2[1] = fw_mcc & 0xff;
@@ -1357,8 +1345,6 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
1357 if (!copy_rd)1345 if (!copy_rd)
1358 copy_rd = ERR_PTR(-ENOMEM);1346 copy_rd = ERR_PTR(-ENOMEM);
13591347
1360out:
1361 kfree(regdb_ptrs);
1362 kfree(regd);1348 kfree(regd);
1363 return copy_rd;1349 return copy_rd;
1364}1350}
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-tm-gnl.c b/drivers/net/wireless/intel/iwlwifi/iwl-tm-gnl.c
index 79be4e6..55358f5 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-tm-gnl.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-tm-gnl.c
@@ -5,10 +5,9 @@
5 *5 *
6 * GPL LICENSE SUMMARY6 * GPL LICENSE SUMMARY
7 *7 *
8 * Copyright(c) 2010 - 2014 Intel Corporation. All rights reserved.8 * Copyright(c) 2010 - 2014, 2018 - 2019 Intel Corporation
9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
11 * Copyright(c) 2018 Intel Corporation
12 *11 *
13 * This program is free software; you can redistribute it and/or modify12 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of version 2 of the GNU General Public License as13 * it under the terms of version 2 of the GNU General Public License as
@@ -28,10 +27,9 @@
28 *27 *
29 * BSD LICENSE28 * BSD LICENSE
30 *29 *
31 * Copyright(c) 2010 - 2014 Intel Corporation. All rights reserved.30 * Copyright(c) 2010 - 2014, 2018 - 2019 Intel Corporation
32 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH31 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH32 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
34 * Copyright(c) 2018 Intel Corporation
35 * All rights reserved.33 * All rights reserved.
36 *34 *
37 * Redistribution and use in source and binary forms, with or without35 * Redistribution and use in source and binary forms, with or without
@@ -1081,14 +1079,20 @@ static int iwl_tm_gnl_cmd_subscribe(struct sk_buff *skb, struct genl_info *info)
1081static __genl_const struct genl_ops iwl_tm_gnl_ops[] = {1079static __genl_const struct genl_ops iwl_tm_gnl_ops[] = {
1082 {1080 {
1083 .cmd = IWL_TM_GNL_CMD_EXECUTE,1081 .cmd = IWL_TM_GNL_CMD_EXECUTE,
1084 .policy = iwl_tm_gnl_msg_policy,1082#if LINUX_VERSION_IS_GEQ(5,2,0)
1083 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
1084#endif
1085
1085 .doit = iwl_tm_gnl_cmd_do,1086 .doit = iwl_tm_gnl_cmd_do,
1086 .dumpit = iwl_tm_gnl_dump,1087 .dumpit = iwl_tm_gnl_dump,
1087 .done = iwl_tm_gnl_done,1088 .done = iwl_tm_gnl_done,
1088 },1089 },
1089 {1090 {
1090 .cmd = IWL_TM_GNL_CMD_SUBSCRIBE_EVENTS,1091 .cmd = IWL_TM_GNL_CMD_SUBSCRIBE_EVENTS,
1091 .policy = iwl_tm_gnl_msg_policy,1092#if LINUX_VERSION_IS_GEQ(5,2,0)
1093 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
1094#endif
1095
1092 .doit = iwl_tm_gnl_cmd_subscribe,1096 .doit = iwl_tm_gnl_cmd_subscribe,
1093 },1097 },
1094};1098};
@@ -1098,6 +1102,7 @@ static struct genl_family iwl_tm_gnl_family __genl_ro_after_init = {
1098 .name = IWL_TM_GNL_FAMILY_NAME,1102 .name = IWL_TM_GNL_FAMILY_NAME,
1099 .version = IWL_TM_GNL_VERSION_NR,1103 .version = IWL_TM_GNL_VERSION_NR,
1100 .maxattr = IWL_TM_GNL_MSG_ATTR_MAX,1104 .maxattr = IWL_TM_GNL_MSG_ATTR_MAX,
1105 .policy = iwl_tm_gnl_msg_policy,
1101 .module = THIS_MODULE,1106 .module = THIS_MODULE,
1102 .ops = iwl_tm_gnl_ops,1107 .ops = iwl_tm_gnl_ops,
1103 .n_ops = ARRAY_SIZE(iwl_tm_gnl_ops),1108 .n_ops = ARRAY_SIZE(iwl_tm_gnl_ops),
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
index 6d156ee..6d0403a 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
@@ -708,6 +708,7 @@ struct iwl_self_init_dram {
708 * @ini_valid: indicates if debug ini mode is on708 * @ini_valid: indicates if debug ini mode is on
709 * @num_blocks: number of blocks in fw_mon709 * @num_blocks: number of blocks in fw_mon
710 * @fw_mon: address of the buffers for firmware monitor710 * @fw_mon: address of the buffers for firmware monitor
711 * @is_alloc: bit i is set if buffer i was allocated
711 * @hw_error: equals true if hw error interrupt was received from the FW712 * @hw_error: equals true if hw error interrupt was received from the FW
712 * @ini_dest: debug monitor destination uses &enum iwl_fw_ini_buffer_location713 * @ini_dest: debug monitor destination uses &enum iwl_fw_ini_buffer_location
713 */714 */
@@ -730,7 +731,8 @@ struct iwl_trans_debug {
730 struct iwl_apply_point_data apply_points_ext[IWL_FW_INI_APPLY_NUM];731 struct iwl_apply_point_data apply_points_ext[IWL_FW_INI_APPLY_NUM];
731732
732 int num_blocks;733 int num_blocks;
733 struct iwl_dram_data fw_mon[IWL_FW_INI_APPLY_NUM];734 struct iwl_dram_data fw_mon[IWL_FW_INI_ALLOCATION_NUM];
735 u32 is_alloc;
734736
735 bool hw_error;737 bool hw_error;
736 enum iwl_fw_ini_buffer_location ini_dest;738 enum iwl_fw_ini_buffer_location ini_dest;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
index 5e6cd75..dfc553e 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
@@ -1965,6 +1965,9 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
1965 */1965 */
1966 iwl_mvm_update_changed_regdom(mvm);1966 iwl_mvm_update_changed_regdom(mvm);
19671967
1968 /* Re-configure PPAG settings */
1969 iwl_mvm_ppag_send_cmd(mvm);
1970
1968 if (!unified_image)1971 if (!unified_image)
1969 /* Re-configure default SAR profile */1972 /* Re-configure default SAR profile */
1970 iwl_mvm_sar_select_profile(mvm, 1, 1);1973 iwl_mvm_sar_select_profile(mvm, 1, 1);
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
index bb2ad8b..e413f0a 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -987,6 +987,17 @@ int iwl_mvm_sar_select_profile(struct iwl_mvm *mvm, int prof_a, int prof_b)
987 return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, len, &cmd);987 return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, len, &cmd);
988}988}
989989
990static bool iwl_mvm_sar_geo_support(struct iwl_mvm *mvm)
991{
992 /*
993 * The GEO_TX_POWER_LIMIT command is not supported on earlier
994 * firmware versions. Unfortunately, we don't have a TLV API
995 * flag to rely on, so rely on the major version which is in
996 * the first byte of ucode_ver.
997 */
998 return IWL_UCODE_SERIAL(mvm->fw->ucode_ver) >= 41;
999}
1000
990int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm)1001int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm)
991{1002{
992 struct iwl_geo_tx_power_profiles_resp *resp;1003 struct iwl_geo_tx_power_profiles_resp *resp;
@@ -1016,6 +1027,9 @@ int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm)
1016 .data = { data },1027 .data = { data },
1017 };1028 };
10181029
1030 if (!iwl_mvm_sar_geo_support(mvm))
1031 return -EOPNOTSUPP;
1032
1019 ret = iwl_mvm_send_cmd(mvm, &cmd);1033 ret = iwl_mvm_send_cmd(mvm, &cmd);
1020 if (ret) {1034 if (ret) {
1021 IWL_ERR(mvm, "Failed to get geographic profile info %d\n", ret);1035 IWL_ERR(mvm, "Failed to get geographic profile info %d\n", ret);
@@ -1041,13 +1055,7 @@ static int iwl_mvm_sar_geo_init(struct iwl_mvm *mvm)
1041 int ret, i, j;1055 int ret, i, j;
1042 u16 cmd_wide_id = WIDE_ID(PHY_OPS_GROUP, GEO_TX_POWER_LIMIT);1056 u16 cmd_wide_id = WIDE_ID(PHY_OPS_GROUP, GEO_TX_POWER_LIMIT);
10431057
1044 /*1058 if (!iwl_mvm_sar_geo_support(mvm))
1045 * This command is not supported on earlier firmware versions.
1046 * Unfortunately, we don't have a TLV API flag to rely on, so
1047 * rely on the major version which is in the first byte of
1048 * ucode_ver.
1049 */
1050 if (IWL_UCODE_SERIAL(mvm->fw->ucode_ver) < 41)
1051 return 0;1059 return 0;
10521060
1053 ret = iwl_mvm_sar_get_wgds_table(mvm);1061 ret = iwl_mvm_sar_get_wgds_table(mvm);
@@ -1096,6 +1104,113 @@ static int iwl_mvm_sar_geo_init(struct iwl_mvm *mvm)
1096 return iwl_mvm_send_cmd_pdu(mvm, cmd_wide_id, 0, sizeof(cmd), &cmd);1104 return iwl_mvm_send_cmd_pdu(mvm, cmd_wide_id, 0, sizeof(cmd), &cmd);
1097}1105}
10981106
1107static int iwl_mvm_get_ppag_table(struct iwl_mvm *mvm)
1108{
1109 union acpi_object *wifi_pkg, *data, *enabled;
1110 int i, j, ret, tbl_rev;
1111 int idx = 2;
1112
1113 mvm->ppag_table.enabled = cpu_to_le32(0);
1114 data = iwl_acpi_get_object(mvm->dev, ACPI_PPAG_METHOD);
1115 if (IS_ERR(data))
1116 return PTR_ERR(data);
1117
1118 wifi_pkg = iwl_acpi_get_wifi_pkg(mvm->dev, data,
1119 ACPI_PPAG_WIFI_DATA_SIZE, &tbl_rev);
1120
1121 if (IS_ERR(wifi_pkg) || tbl_rev != 0) {
1122 ret = PTR_ERR(wifi_pkg);
1123 goto out_free;
1124 }
1125
1126 enabled = &wifi_pkg->package.elements[1];
1127 if (enabled->type != ACPI_TYPE_INTEGER ||
1128 (enabled->integer.value != 0 && enabled->integer.value != 1)) {
1129 ret = -EINVAL;
1130 goto out_free;
1131 }
1132
1133 mvm->ppag_table.enabled = cpu_to_le32(enabled->integer.value);
1134 if (!mvm->ppag_table.enabled) {
1135 ret = 0;
1136 goto out_free;
1137 }
1138
1139 /*
1140 * read, verify gain values and save them into the PPAG table.
1141 * first sub-band (j=0) corresponds to Low-Band (2.4GHz), and the
1142 * following sub-bands to High-Band (5GHz).
1143 */
1144 for (i = 0; i < ACPI_PPAG_NUM_CHAINS; i++) {
1145 for (j = 0; j < ACPI_PPAG_NUM_SUB_BANDS; j++) {
1146 union acpi_object *ent;
1147
1148 ent = &wifi_pkg->package.elements[idx++];
1149 if (ent->type != ACPI_TYPE_INTEGER ||
1150 (j == 0 && ent->integer.value > ACPI_PPAG_MAX_LB) ||
1151 (j == 0 && ent->integer.value < ACPI_PPAG_MIN_LB) ||
1152 (j != 0 && ent->integer.value > ACPI_PPAG_MAX_HB) ||
1153 (j != 0 && ent->integer.value < ACPI_PPAG_MIN_HB)) {
1154 mvm->ppag_table.enabled = cpu_to_le32(0);
1155 ret = -EINVAL;
1156 goto out_free;
1157 }
1158 mvm->ppag_table.gain[i][j] = ent->integer.value;
1159 }
1160 }
1161 ret = 0;
1162out_free:
1163 kfree(data);
1164 return ret;
1165}
1166
1167int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm)
1168{
1169 int i, j, ret;
1170
1171 if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_SET_PPAG)) {
1172 IWL_DEBUG_RADIO(mvm,
1173 "PPAG capability not supported by FW, command not sent.\n");
1174 return 0;
1175 }
1176
1177 IWL_DEBUG_RADIO(mvm, "Sending PER_PLATFORM_ANT_GAIN_CMD\n");
1178 IWL_DEBUG_RADIO(mvm, "PPAG is %s\n",
1179 mvm->ppag_table.enabled ? "enabled" : "disabled");
1180
1181 for (i = 0; i < ACPI_PPAG_NUM_CHAINS; i++) {
1182 for (j = 0; j < ACPI_PPAG_NUM_SUB_BANDS; j++) {
1183 IWL_DEBUG_RADIO(mvm,
1184 "PPAG table: chain[%d] band[%d]: gain = %d\n",
1185 i, j, mvm->ppag_table.gain[i][j]);
1186 }
1187 }
1188
1189 ret = iwl_mvm_send_cmd_pdu(mvm, WIDE_ID(PHY_OPS_GROUP,
1190 PER_PLATFORM_ANT_GAIN_CMD),
1191 0, sizeof(mvm->ppag_table),
1192 &mvm->ppag_table);
1193 if (ret < 0)
1194 IWL_ERR(mvm, "failed to send PER_PLATFORM_ANT_GAIN_CMD (%d)\n",
1195 ret);
1196
1197 return ret;
1198}
1199
1200static int iwl_mvm_ppag_init(struct iwl_mvm *mvm)
1201{
1202 int ret;
1203
1204 ret = iwl_mvm_get_ppag_table(mvm);
1205 if (ret < 0) {
1206 IWL_DEBUG_RADIO(mvm,
1207 "PPAG BIOS table invalid or unavailable. (%d)\n",
1208 ret);
1209 return 0;
1210 }
1211 return iwl_mvm_ppag_send_cmd(mvm);
1212}
1213
1099#else /* CONFIG_ACPI */1214#else /* CONFIG_ACPI */
1100static int iwl_mvm_sar_get_wrds_table(struct iwl_mvm *mvm)1215static int iwl_mvm_sar_get_wrds_table(struct iwl_mvm *mvm)
1101{1216{
@@ -1127,6 +1242,21 @@ int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm)
1127{1242{
1128 return -ENOENT;1243 return -ENOENT;
1129}1244}
1245
1246static int iwl_mvm_get_ppag_table(struct iwl_mvm *mvm)
1247{
1248 return -ENOENT;
1249}
1250
1251static int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm)
1252{
1253 return -ENOENT;
1254}
1255
1256static int iwl_mvm_ppag_init(struct iwl_mvm *mvm)
1257{
1258 return -ENOENT;
1259}
1130#endif /* CONFIG_ACPI */1260#endif /* CONFIG_ACPI */
11311261
1132void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags)1262void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags)
@@ -1497,6 +1627,10 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
1497 if (iwl_acpi_get_eckv(mvm->dev, &mvm->ext_clock_valid))1627 if (iwl_acpi_get_eckv(mvm->dev, &mvm->ext_clock_valid))
1498 IWL_DEBUG_INFO(mvm, "ECKV table doesn't exist in BIOS\n");1628 IWL_DEBUG_INFO(mvm, "ECKV table doesn't exist in BIOS\n");
14991629
1630 ret = iwl_mvm_ppag_init(mvm);
1631 if (ret)
1632 goto error;
1633
1500 ret = iwl_mvm_sar_init(mvm);1634 ret = iwl_mvm_sar_init(mvm);
1501 if (ret == 0) {1635 if (ret == 0) {
1502 ret = iwl_mvm_sar_geo_init(mvm);1636 ret = iwl_mvm_sar_geo_init(mvm);
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
index ebcacd1..69dc7d1 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
@@ -1623,7 +1623,9 @@ void iwl_mvm_channel_switch_noa_notif(struct iwl_mvm *mvm,
1623 RCU_INIT_POINTER(mvm->csa_vif, NULL);1623 RCU_INIT_POINTER(mvm->csa_vif, NULL);
1624 return;1624 return;
1625 case NL80211_IFTYPE_STATION:1625 case NL80211_IFTYPE_STATION:
1626 iwl_mvm_csa_client_absent(mvm, vif);1626 if (!fw_has_capa(&mvm->fw->ucode_capa,
1627 IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD))
1628 iwl_mvm_csa_client_absent(mvm, vif);
1627 cancel_delayed_work(&mvmvif->csa_work);1629 cancel_delayed_work(&mvmvif->csa_work);
1628 ieee80211_chswitch_done(vif, true);1630 ieee80211_chswitch_done(vif, true);
1629 break;1631 break;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index c610056..3ab1876 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -246,11 +246,11 @@ static const struct cfg80211_pmsr_capabilities iwl_mvm_pmsr_capa = {
246 },246 },
247};247};
248248
249static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw,249static int __iwl_mvm_mac_set_key(struct ieee80211_hw *hw,
250 enum set_key_cmd cmd,250 enum set_key_cmd cmd,
251 struct ieee80211_vif *vif,251 struct ieee80211_vif *vif,
252 struct ieee80211_sta *sta,252 struct ieee80211_sta *sta,
253 struct ieee80211_key_conf *key);253 struct ieee80211_key_conf *key);
254254
255static void iwl_mvm_reset_phy_ctxts(struct iwl_mvm *mvm)255static void iwl_mvm_reset_phy_ctxts(struct iwl_mvm *mvm)
256{256{
@@ -1401,15 +1401,20 @@ static int iwl_mvm_post_channel_switch(struct ieee80211_hw *hw,
1401 goto out_unlock;1401 goto out_unlock;
1402 }1402 }
14031403
1404 iwl_mvm_sta_modify_disable_tx(mvm, mvmsta, false);1404 if (!fw_has_capa(&mvm->fw->ucode_capa,
1405 IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD))
1406 iwl_mvm_sta_modify_disable_tx(mvm, mvmsta, false);
14051407
1406 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL);1408 iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL);
14071409
1408 ret = iwl_mvm_enable_beacon_filter(mvm, vif, 0);1410 if (!fw_has_capa(&mvm->fw->ucode_capa,
1409 if (ret)1411 IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD)) {
1410 goto out_unlock;1412 ret = iwl_mvm_enable_beacon_filter(mvm, vif, 0);
1413 if (ret)
1414 goto out_unlock;
14111415
1412 iwl_mvm_stop_session_protection(mvm, vif);1416 iwl_mvm_stop_session_protection(mvm, vif);
1417 }
1413 }1418 }
14141419
1415 mvmvif->ps_disabled = false;1420 mvmvif->ps_disabled = false;
@@ -2640,7 +2645,7 @@ static int iwl_mvm_start_ap_ibss(struct ieee80211_hw *hw,
26402645
2641 mvmvif->ap_early_keys[i] = NULL;2646 mvmvif->ap_early_keys[i] = NULL;
26422647
2643 ret = iwl_mvm_mac_set_key(hw, SET_KEY, vif, NULL, key);2648 ret = __iwl_mvm_mac_set_key(hw, SET_KEY, vif, NULL, key);
2644 if (ret)2649 if (ret)
2645 goto out_quota_failed;2650 goto out_quota_failed;
2646 }2651 }
@@ -3445,11 +3450,11 @@ static int iwl_mvm_mac_sched_scan_stop(struct ieee80211_hw *hw,
3445 return ret;3450 return ret;
3446}3451}
34473452
3448static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw,3453static int __iwl_mvm_mac_set_key(struct ieee80211_hw *hw,
3449 enum set_key_cmd cmd,3454 enum set_key_cmd cmd,
3450 struct ieee80211_vif *vif,3455 struct ieee80211_vif *vif,
3451 struct ieee80211_sta *sta,3456 struct ieee80211_sta *sta,
3452 struct ieee80211_key_conf *key)3457 struct ieee80211_key_conf *key)
3453{3458{
3454 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);3459 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
3455 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);3460 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
@@ -3504,8 +3509,6 @@ static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw,
3504 return -EOPNOTSUPP;3509 return -EOPNOTSUPP;
3505 }3510 }
35063511
3507 mutex_lock(&mvm->mutex);
3508
3509 switch (cmd) {3512 switch (cmd) {
3510 case SET_KEY:3513 case SET_KEY:
3511 if ((vif->type == NL80211_IFTYPE_ADHOC ||3514 if ((vif->type == NL80211_IFTYPE_ADHOC ||
@@ -3651,7 +3654,22 @@ static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw,
3651 ret = -EINVAL;3654 ret = -EINVAL;
3652 }3655 }
36533656
3657 return ret;
3658}
3659
3660static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw,
3661 enum set_key_cmd cmd,
3662 struct ieee80211_vif *vif,
3663 struct ieee80211_sta *sta,
3664 struct ieee80211_key_conf *key)
3665{
3666 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
3667 int ret;
3668
3669 mutex_lock(&mvm->mutex);
3670 ret = __iwl_mvm_mac_set_key(hw, cmd, vif, sta, key);
3654 mutex_unlock(&mvm->mutex);3671 mutex_unlock(&mvm->mutex);
3672
3655 return ret;3673 return ret;
3656}3674}
36573675
@@ -4554,6 +4572,42 @@ static int iwl_mvm_schedule_client_csa(struct iwl_mvm *mvm,
4554 0, sizeof(cmd), &cmd);4572 0, sizeof(cmd), &cmd);
4555}4573}
45564574
4575static int iwl_mvm_old_pre_chan_sw_sta(struct iwl_mvm *mvm,
4576 struct ieee80211_vif *vif,
4577 struct ieee80211_channel_switch *chsw)
4578{
4579 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
4580 u32 apply_time;
4581
4582 /* Schedule the time event to a bit before beacon 1,
4583 * to make sure we're in the new channel when the
4584 * GO/AP arrives. In case count <= 1 immediately schedule the
4585 * TE (this might result with some packet loss or connection
4586 * loss).
4587 */
4588 if (chsw->count <= 1)
4589 apply_time = 0;
4590 else
4591 apply_time = chsw->device_timestamp +
4592 ((vif->bss_conf.beacon_int * (chsw->count - 1) -
4593 IWL_MVM_CHANNEL_SWITCH_TIME_CLIENT) * 1024);
4594
4595 if (chsw->block_tx)
4596 iwl_mvm_csa_client_absent(mvm, vif);
4597
4598 if (mvmvif->bf_data.bf_enabled) {
4599 int ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0);
4600
4601 if (ret)
4602 return ret;
4603 }
4604
4605 iwl_mvm_schedule_csa_period(mvm, vif, vif->bss_conf.beacon_int,
4606 apply_time);
4607
4608 return 0;
4609}
4610
4557#define IWL_MAX_CSA_BLOCK_TX 15004611#define IWL_MAX_CSA_BLOCK_TX 1500
4558static int iwl_mvm_pre_channel_switch(struct ieee80211_hw *hw,4612static int iwl_mvm_pre_channel_switch(struct ieee80211_hw *hw,
4559 struct ieee80211_vif *vif,4613 struct ieee80211_vif *vif,
@@ -4562,7 +4616,6 @@ static int iwl_mvm_pre_channel_switch(struct ieee80211_hw *hw,
4562 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);4616 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
4563 struct ieee80211_vif *csa_vif;4617 struct ieee80211_vif *csa_vif;
4564 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);4618 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
4565 u32 apply_time;
4566 int ret;4619 int ret;
45674620
4568 mutex_lock(&mvm->mutex);4621 mutex_lock(&mvm->mutex);
@@ -4606,21 +4659,7 @@ static int iwl_mvm_pre_channel_switch(struct ieee80211_hw *hw,
46064659
4607 break;4660 break;
4608 case NL80211_IFTYPE_STATION:4661 case NL80211_IFTYPE_STATION:
4609 /* Schedule the time event to a bit before beacon 1,
4610 * to make sure we're in the new channel when the
4611 * GO/AP arrives. In case count <= 1 immediately schedule the
4612 * TE (this might result with some packet loss or connection
4613 * loss).
4614 */
4615 if (chsw->count <= 1)
4616 apply_time = 0;
4617 else
4618 apply_time = chsw->device_timestamp +
4619 ((vif->bss_conf.beacon_int * (chsw->count - 1) -
4620 IWL_MVM_CHANNEL_SWITCH_TIME_CLIENT) * 1024);
4621
4622 if (chsw->block_tx) {4662 if (chsw->block_tx) {
4623 iwl_mvm_csa_client_absent(mvm, vif);
4624 /*4663 /*
4625 * In case of undetermined / long time with immediate4664 * In case of undetermined / long time with immediate
4626 * quiet monitor status to gracefully disconnect4665 * quiet monitor status to gracefully disconnect
@@ -4632,19 +4671,14 @@ static int iwl_mvm_pre_channel_switch(struct ieee80211_hw *hw,
4632 msecs_to_jiffies(IWL_MAX_CSA_BLOCK_TX));4671 msecs_to_jiffies(IWL_MAX_CSA_BLOCK_TX));
4633 }4672 }
46344673
4635 if (mvmvif->bf_data.bf_enabled) {4674 if (!fw_has_capa(&mvm->fw->ucode_capa,
4636 ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0);4675 IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD)) {
4676 ret = iwl_mvm_old_pre_chan_sw_sta(mvm, vif, chsw);
4637 if (ret)4677 if (ret)
4638 goto out_unlock;4678 goto out_unlock;
4639 }4679 } else {
4640
4641 if (fw_has_capa(&mvm->fw->ucode_capa,
4642 IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD))
4643 iwl_mvm_schedule_client_csa(mvm, vif, chsw);4680 iwl_mvm_schedule_client_csa(mvm, vif, chsw);
4644 else4681 }
4645 iwl_mvm_schedule_csa_period(mvm, vif,
4646 vif->bss_conf.beacon_int,
4647 apply_time);
46484682
4649 mvmvif->csa_count = chsw->count;4683 mvmvif->csa_count = chsw->count;
4650 mvmvif->csa_misbehave = false;4684 mvmvif->csa_misbehave = false;
@@ -5246,7 +5280,8 @@ void iwl_mvm_sync_rx_queues_internal(struct iwl_mvm *mvm,
5246 atomic_set(&mvm->queue_sync_counter,5280 atomic_set(&mvm->queue_sync_counter,
5247 mvm->trans->num_rx_queues);5281 mvm->trans->num_rx_queues);
52485282
5249 ret = iwl_mvm_notify_rx_queue(mvm, qmask, (u8 *)notif, size);5283 ret = iwl_mvm_notify_rx_queue(mvm, qmask, (u8 *)notif,
5284 size, !notif->sync);
5250 if (ret) {5285 if (ret) {
5251 IWL_ERR(mvm, "Failed to trigger RX queues sync (%d)\n", ret);5286 IWL_ERR(mvm, "Failed to trigger RX queues sync (%d)\n", ret);
5252 goto out;5287 goto out;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index e140a1f..c9f8c5d 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -1227,6 +1227,8 @@ struct iwl_mvm {
1227#endif1227#endif
1228 struct iwl_mvm_geo_profile geo_profiles[ACPI_NUM_GEO_PROFILES];1228 struct iwl_mvm_geo_profile geo_profiles[ACPI_NUM_GEO_PROFILES];
1229 u32 geo_rev;1229 u32 geo_rev;
1230 struct iwl_ppag_table_cmd ppag_table;
1231 u32 ppag_rev;
1230#endif1232#endif
12311233
1232};1234};
@@ -1698,9 +1700,9 @@ void iwl_mvm_rx_monitor_no_data(struct iwl_mvm *mvm, struct napi_struct *napi,
1698void iwl_mvm_rx_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi,1700void iwl_mvm_rx_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi,
1699 struct iwl_rx_cmd_buffer *rxb, int queue);1701 struct iwl_rx_cmd_buffer *rxb, int queue);
1700int iwl_mvm_notify_rx_queue(struct iwl_mvm *mvm, u32 rxq_mask,1702int iwl_mvm_notify_rx_queue(struct iwl_mvm *mvm, u32 rxq_mask,
1701 const u8 *data, u32 count);1703 const u8 *data, u32 count, bool async);
1702void iwl_mvm_rx_queue_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,1704void iwl_mvm_rx_queue_notif(struct iwl_mvm *mvm, struct napi_struct *napi,
1703 int queue);1705 struct iwl_rx_cmd_buffer *rxb, int queue);
1704void iwl_mvm_rx_tx_cmd(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb);1706void iwl_mvm_rx_tx_cmd(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb);
1705void iwl_mvm_mfu_assert_dump_notif(struct iwl_mvm *mvm,1707void iwl_mvm_mfu_assert_dump_notif(struct iwl_mvm *mvm,
1706 struct iwl_rx_cmd_buffer *rxb);1708 struct iwl_rx_cmd_buffer *rxb);
@@ -1847,7 +1849,7 @@ iwl_mvm_vif_dbgfs_clean(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
1847#endif /* CPTCFG_IWLWIFI_DEBUGFS */1849#endif /* CPTCFG_IWLWIFI_DEBUGFS */
18481850
1849/* rate scaling */1851/* rate scaling */
1850int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq, bool sync);1852int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq);
1851void iwl_mvm_update_frame_stats(struct iwl_mvm *mvm, u32 rate, bool agg);1853void iwl_mvm_update_frame_stats(struct iwl_mvm *mvm, u32 rate, bool agg);
1852int rs_pretty_print_rate(char *buf, int bufsz, const u32 rate);1854int rs_pretty_print_rate(char *buf, int bufsz, const u32 rate);
1853void rs_update_last_rssi(struct iwl_mvm *mvm,1855void rs_update_last_rssi(struct iwl_mvm *mvm,
@@ -2199,6 +2201,7 @@ int iwl_mvm_nan_config_nan_faw_cmd(struct iwl_mvm *mvm,
21992201
2200int iwl_mvm_sar_select_profile(struct iwl_mvm *mvm, int prof_a, int prof_b);2202int iwl_mvm_sar_select_profile(struct iwl_mvm *mvm, int prof_a, int prof_b);
2201int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm);2203int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm);
2204int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm);
2202#ifdef CPTCFG_IWLWIFI_DEBUGFS2205#ifdef CPTCFG_IWLWIFI_DEBUGFS
2203void iwl_mvm_sta_add_debugfs(struct ieee80211_hw *hw,2206void iwl_mvm_sta_add_debugfs(struct ieee80211_hw *hw,
2204 struct ieee80211_vif *vif,2207 struct ieee80211_vif *vif,
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
index 5a81722..cd3b5d6 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
@@ -620,7 +620,7 @@ void iwl_mvm_rx_chub_update_mcc(struct iwl_mvm *mvm,
620 enum iwl_mcc_source src;620 enum iwl_mcc_source src;
621 char mcc[3];621 char mcc[3];
622 struct ieee80211_regdomain *regd;622 struct ieee80211_regdomain *regd;
623 u32 wgds_tbl_idx;623 int wgds_tbl_idx;
624624
625 lockdep_assert_held(&mvm->mutex);625 lockdep_assert_held(&mvm->mutex);
626626
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
index ca25c5c..7ef326e 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -1260,7 +1260,7 @@ static void iwl_mvm_rx_mq(struct iwl_op_mode *op_mode,
1260 iwl_mvm_rx_mpdu_mq(mvm, napi, rxb, 0);1260 iwl_mvm_rx_mpdu_mq(mvm, napi, rxb, 0);
1261 else if (unlikely(cmd == WIDE_ID(DATA_PATH_GROUP,1261 else if (unlikely(cmd == WIDE_ID(DATA_PATH_GROUP,
1262 RX_QUEUES_NOTIFICATION)))1262 RX_QUEUES_NOTIFICATION)))
1263 iwl_mvm_rx_queue_notif(mvm, rxb, 0);1263 iwl_mvm_rx_queue_notif(mvm, napi, rxb, 0);
1264 else if (cmd == WIDE_ID(LEGACY_GROUP, FRAME_RELEASE))1264 else if (cmd == WIDE_ID(LEGACY_GROUP, FRAME_RELEASE))
1265 iwl_mvm_rx_frame_release(mvm, napi, rxb, 0);1265 iwl_mvm_rx_frame_release(mvm, napi, rxb, 0);
1266 else if (cmd == WIDE_ID(DATA_PATH_GROUP, RX_NO_DATA_NOTIF))1266 else if (cmd == WIDE_ID(DATA_PATH_GROUP, RX_NO_DATA_NOTIF))
@@ -1489,18 +1489,19 @@ void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error)
1489 IWL_ERR(mvm, "HW restart already requested, but not started\n");1489 IWL_ERR(mvm, "HW restart already requested, but not started\n");
1490 } else if (mvm->fwrt.cur_fw_img == IWL_UCODE_REGULAR &&1490 } else if (mvm->fwrt.cur_fw_img == IWL_UCODE_REGULAR &&
1491 mvm->hw_registered &&1491 mvm->hw_registered &&
1492 !test_bit(STATUS_TRANS_DEAD, &mvm->trans->status) &&1492 !test_bit(STATUS_TRANS_DEAD, &mvm->trans->status)) {
1493 mvm->fw->ucode_capa.error_log_size) {1493 if (mvm->fw->ucode_capa.error_log_size) {
1494 u32 src_size = mvm->fw->ucode_capa.error_log_size;1494 u32 src_size = mvm->fw->ucode_capa.error_log_size;
1495 u32 src_addr = mvm->fw->ucode_capa.error_log_addr;1495 u32 src_addr = mvm->fw->ucode_capa.error_log_addr;
1496 u8 *recover_buf = kzalloc(src_size, GFP_ATOMIC);1496 u8 *recover_buf = kzalloc(src_size, GFP_ATOMIC);
14971497
1498 if (recover_buf) {1498 if (recover_buf) {
1499 mvm->error_recovery_buf = recover_buf;1499 mvm->error_recovery_buf = recover_buf;
1500 iwl_trans_read_mem_bytes(mvm->trans,1500 iwl_trans_read_mem_bytes(mvm->trans,
1501 src_addr,1501 src_addr,
1502 recover_buf,1502 recover_buf,
1503 src_size);1503 src_size);
1504 }
1504 }1505 }
15051506
1506 iwl_fw_error_collect(&mvm->fwrt);1507 iwl_fw_error_collect(&mvm->fwrt);
@@ -1574,7 +1575,7 @@ static void iwl_mvm_rx_mq_rss(struct iwl_op_mode *op_mode,
1574 iwl_mvm_rx_frame_release(mvm, napi, rxb, queue);1575 iwl_mvm_rx_frame_release(mvm, napi, rxb, queue);
1575 else if (unlikely(cmd == WIDE_ID(DATA_PATH_GROUP,1576 else if (unlikely(cmd == WIDE_ID(DATA_PATH_GROUP,
1576 RX_QUEUES_NOTIFICATION)))1577 RX_QUEUES_NOTIFICATION)))
1577 iwl_mvm_rx_queue_notif(mvm, rxb, queue);1578 iwl_mvm_rx_queue_notif(mvm, napi, rxb, queue);
1578 else if (likely(cmd == WIDE_ID(LEGACY_GROUP, REPLY_RX_MPDU_CMD)))1579 else if (likely(cmd == WIDE_ID(LEGACY_GROUP, REPLY_RX_MPDU_CMD)))
1579 iwl_mvm_rx_mpdu_mq(mvm, napi, rxb, queue);1580 iwl_mvm_rx_mpdu_mq(mvm, napi, rxb, queue);
1580}1581}
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rs.c b/drivers/net/wireless/intel/iwlwifi/mvm/rs.c
index 190c514..8cb07f4 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rs.c
@@ -1208,240 +1208,6 @@ static u8 rs_get_tid(struct ieee80211_hdr *hdr)
1208 return tid;1208 return tid;
1209}1209}
12101210
1211void iwl_mvm_rs_tx_status(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
1212 int tid, struct ieee80211_tx_info *info, bool ndp)
1213{
1214 int legacy_success;
1215 int retries;
1216 int i;
1217 struct iwl_lq_cmd *table;
1218 u32 lq_hwrate;
1219 struct rs_rate lq_rate, tx_resp_rate;
1220 struct iwl_scale_tbl_info *curr_tbl, *other_tbl, *tmp_tbl;
1221 u32 tlc_info = (uintptr_t)info->status.status_driver_data[0];
1222 u8 reduced_txp = tlc_info & RS_DRV_DATA_TXP_MSK;
1223 u8 lq_color = RS_DRV_DATA_LQ_COLOR_GET(tlc_info);
1224 u32 tx_resp_hwrate = (uintptr_t)info->status.status_driver_data[1];
1225 struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
1226 struct iwl_lq_sta *lq_sta = &mvmsta->lq_sta.rs_drv;
1227
1228 /* Treat uninitialized rate scaling data same as non-existing. */
1229 if (!lq_sta) {
1230 IWL_DEBUG_RATE(mvm, "Station rate scaling not created yet.\n");
1231 return;
1232 } else if (!lq_sta->pers.drv) {
1233 IWL_DEBUG_RATE(mvm, "Rate scaling not initialized yet.\n");
1234 return;
1235 }
1236
1237 /* This packet was aggregated but doesn't carry status info */
1238 if ((info->flags & IEEE80211_TX_CTL_AMPDU) &&
1239 !(info->flags & IEEE80211_TX_STAT_AMPDU))
1240 return;
1241
1242 if (rs_rate_from_ucode_rate(tx_resp_hwrate, info->band,
1243 &tx_resp_rate)) {
1244 WARN_ON_ONCE(1);
1245 return;
1246 }
1247
1248#ifdef CPTCFG_MAC80211_DEBUGFS
1249 /* Disable last tx check if we are debugging with fixed rate but
1250 * update tx stats */
1251 if (lq_sta->pers.dbg_fixed_rate) {
1252 int index = tx_resp_rate.index;
1253 enum rs_column column;
1254 int attempts, success;
1255
1256 column = rs_get_column_from_rate(&tx_resp_rate);
1257 if (WARN_ONCE(column == RS_COLUMN_INVALID,
1258 "Can't map rate 0x%x to column",
1259 tx_resp_hwrate))
1260 return;
1261
1262 if (info->flags & IEEE80211_TX_STAT_AMPDU) {
1263 attempts = info->status.ampdu_len;
1264 success = info->status.ampdu_ack_len;
1265 } else {
1266 attempts = info->status.rates[0].count;
1267 success = !!(info->flags & IEEE80211_TX_STAT_ACK);
1268 }
1269
1270 lq_sta->pers.tx_stats[column][index].total += attempts;
1271 lq_sta->pers.tx_stats[column][index].success += success;
1272
1273 IWL_DEBUG_RATE(mvm, "Fixed rate 0x%x success %d attempts %d\n",
1274 tx_resp_hwrate, success, attempts);
1275 return;
1276 }
1277#endif
1278
1279 if (time_after(jiffies,
1280 (unsigned long)(lq_sta->last_tx +
1281 (IWL_MVM_RS_IDLE_TIMEOUT * HZ)))) {
1282 IWL_DEBUG_RATE(mvm, "Tx idle for too long. reinit rs\n");
1283 iwl_mvm_rs_rate_init(mvm, sta, info->band, true);
1284 return;
1285 }
1286 lq_sta->last_tx = jiffies;
1287
1288 /* Ignore this Tx frame response if its initial rate doesn't match
1289 * that of latest Link Quality command. There may be stragglers
1290 * from a previous Link Quality command, but we're no longer interested
1291 * in those; they're either from the "active" mode while we're trying
1292 * to check "search" mode, or a prior "search" mode after we've moved
1293 * to a new "search" mode (which might become the new "active" mode).
1294 */
1295 table = &lq_sta->lq;
1296 lq_hwrate = le32_to_cpu(table->rs_table[0]);
1297 if (rs_rate_from_ucode_rate(lq_hwrate, info->band, &lq_rate)) {
1298 WARN_ON_ONCE(1);
1299 return;
1300 }
1301
1302 /* Here we actually compare this rate to the latest LQ command */
1303 if (lq_color != LQ_FLAG_COLOR_GET(table->flags)) {
1304 IWL_DEBUG_RATE(mvm,
1305 "tx resp color 0x%x does not match 0x%x\n",
1306 lq_color, LQ_FLAG_COLOR_GET(table->flags));
1307
1308 /*
1309 * Since rates mis-match, the last LQ command may have failed.
1310 * After IWL_MISSED_RATE_MAX mis-matches, resync the uCode with
1311 * ... driver.
1312 */
1313 lq_sta->missed_rate_counter++;
1314 if (lq_sta->missed_rate_counter > IWL_MVM_RS_MISSED_RATE_MAX) {
1315 lq_sta->missed_rate_counter = 0;
1316 IWL_DEBUG_RATE(mvm,
1317 "Too many rates mismatch. Send sync LQ. rs_state %d\n",
1318 lq_sta->rs_state);
1319 iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, false);
1320 }
1321 /* Regardless, ignore this status info for outdated rate */
1322 return;
1323 } else
1324 /* Rate did match, so reset the missed_rate_counter */
1325 lq_sta->missed_rate_counter = 0;
1326
1327 if (!lq_sta->search_better_tbl) {
1328 curr_tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
1329 other_tbl = &(lq_sta->lq_info[1 - lq_sta->active_tbl]);
1330 } else {
1331 curr_tbl = &(lq_sta->lq_info[1 - lq_sta->active_tbl]);
1332 other_tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
1333 }
1334
1335 if (WARN_ON_ONCE(!rs_rate_column_match(&lq_rate, &curr_tbl->rate))) {
1336 IWL_DEBUG_RATE(mvm,
1337 "Neither active nor search matches tx rate\n");
1338 tmp_tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
1339 rs_dump_rate(mvm, &tmp_tbl->rate, "ACTIVE");
1340 tmp_tbl = &(lq_sta->lq_info[1 - lq_sta->active_tbl]);
1341 rs_dump_rate(mvm, &tmp_tbl->rate, "SEARCH");
1342 rs_dump_rate(mvm, &lq_rate, "ACTUAL");
1343
1344 /*
1345 * no matching table found, let's by-pass the data collection
1346 * and continue to perform rate scale to find the rate table
1347 */
1348 rs_stay_in_table(lq_sta, true);
1349 goto done;
1350 }
1351
1352 /*
1353 * Updating the frame history depends on whether packets were
1354 * aggregated.
1355 *
1356 * For aggregation, all packets were transmitted at the same rate, the
1357 * first index into rate scale table.
1358 */
1359 if (info->flags & IEEE80211_TX_STAT_AMPDU) {
1360 rs_collect_tpc_data(mvm, lq_sta, curr_tbl, tx_resp_rate.index,
1361 info->status.ampdu_len,
1362 info->status.ampdu_ack_len,
1363 reduced_txp);
1364
1365 /* ampdu_ack_len = 0 marks no BA was received. For TLC, treat
1366 * it as a single frame loss as we don't want the success ratio
1367 * to dip too quickly because a BA wasn't received.
1368 * For TPC, there's no need for this optimisation since we want
1369 * to recover very quickly from a bad power reduction and,
1370 * therefore we'd like the success ratio to get an immediate hit
1371 * when failing to get a BA, so we'd switch back to a lower or
1372 * zero power reduction. When FW transmits agg with a rate
1373 * different from the initial rate, it will not use reduced txp
1374 * and will send BA notification twice (one empty with reduced
1375 * txp equal to the value from LQ and one with reduced txp 0).
1376 * We need to update counters for each txp level accordingly.
1377 */
1378 if (info->status.ampdu_ack_len == 0)
1379 info->status.ampdu_len = 1;
1380
1381 rs_collect_tlc_data(mvm, mvmsta, tid, curr_tbl,
1382 tx_resp_rate.index,
1383 info->status.ampdu_len,
1384 info->status.ampdu_ack_len);
1385
1386 /* Update success/fail counts if not searching for new mode */
1387 if (lq_sta->rs_state == RS_STATE_STAY_IN_COLUMN) {
1388 lq_sta->total_success += info->status.ampdu_ack_len;
1389 lq_sta->total_failed += (info->status.ampdu_len -
1390 info->status.ampdu_ack_len);
1391 }
1392 } else {
1393 /* For legacy, update frame history with for each Tx retry. */
1394 retries = info->status.rates[0].count - 1;
1395 /* HW doesn't send more than 15 retries */
1396 retries = min(retries, 15);
1397
1398 /* The last transmission may have been successful */
1399 legacy_success = !!(info->flags & IEEE80211_TX_STAT_ACK);
1400 /* Collect data for each rate used during failed TX attempts */
1401 for (i = 0; i <= retries; ++i) {
1402 lq_hwrate = le32_to_cpu(table->rs_table[i]);
1403 if (rs_rate_from_ucode_rate(lq_hwrate, info->band,
1404 &lq_rate)) {
1405 WARN_ON_ONCE(1);
1406 return;
1407 }
1408
1409 /*
1410 * Only collect stats if retried rate is in the same RS
1411 * table as active/search.
1412 */
1413 if (rs_rate_column_match(&lq_rate, &curr_tbl->rate))
1414 tmp_tbl = curr_tbl;
1415 else if (rs_rate_column_match(&lq_rate,
1416 &other_tbl->rate))
1417 tmp_tbl = other_tbl;
1418 else
1419 continue;
1420
1421 rs_collect_tpc_data(mvm, lq_sta, tmp_tbl,
1422 tx_resp_rate.index, 1,
1423 i < retries ? 0 : legacy_success,
1424 reduced_txp);
1425 rs_collect_tlc_data(mvm, mvmsta, tid, tmp_tbl,
1426 tx_resp_rate.index, 1,
1427 i < retries ? 0 : legacy_success);
1428 }
1429
1430 /* Update success/fail counts if not searching for new mode */
1431 if (lq_sta->rs_state == RS_STATE_STAY_IN_COLUMN) {
1432 lq_sta->total_success += legacy_success;
1433 lq_sta->total_failed += retries + (1 - legacy_success);
1434 }
1435 }
1436 /* The last TX rate is cached in lq_sta; it's set in if/else above */
1437 lq_sta->last_rate_n_flags = lq_hwrate;
1438 IWL_DEBUG_RATE(mvm, "reduced txpower: %d\n", reduced_txp);
1439done:
1440 /* See if there's a better rate or modulation mode to try. */
1441 if (sta->supp_rates[info->band])
1442 rs_rate_scale_perform(mvm, sta, lq_sta, tid, ndp);
1443}
1444
1445/*1211/*
1446 * mac80211 sends us Tx status1212 * mac80211 sends us Tx status
1447 */1213 */
@@ -1454,8 +1220,9 @@ static void rs_drv_mac80211_tx_status(void *mvm_r,
1454 struct iwl_op_mode *op_mode = mvm_r;1220 struct iwl_op_mode *op_mode = mvm_r;
1455 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode);1221 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode);
1456 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);1222 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1223 struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
14571224
1458 if (!iwl_mvm_sta_from_mac80211(sta)->vif)1225 if (!mvmsta->vif)
1459 return;1226 return;
14601227
1461 if (!ieee80211_is_data(hdr->frame_control) ||1228 if (!ieee80211_is_data(hdr->frame_control) ||
@@ -1806,7 +1573,7 @@ static void rs_update_rate_tbl(struct iwl_mvm *mvm,
1806 struct iwl_scale_tbl_info *tbl)1573 struct iwl_scale_tbl_info *tbl)
1807{1574{
1808 rs_fill_lq_cmd(mvm, sta, lq_sta, &tbl->rate);1575 rs_fill_lq_cmd(mvm, sta, lq_sta, &tbl->rate);
1809 iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, false);1576 iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq);
1810}1577}
18111578
1812static bool rs_tweak_rate_tbl(struct iwl_mvm *mvm,1579static bool rs_tweak_rate_tbl(struct iwl_mvm *mvm,
@@ -2908,7 +2675,7 @@ void rs_update_last_rssi(struct iwl_mvm *mvm,
2908static void rs_initialize_lq(struct iwl_mvm *mvm,2675static void rs_initialize_lq(struct iwl_mvm *mvm,
2909 struct ieee80211_sta *sta,2676 struct ieee80211_sta *sta,
2910 struct iwl_lq_sta *lq_sta,2677 struct iwl_lq_sta *lq_sta,
2911 enum nl80211_band band, bool update)2678 enum nl80211_band band)
2912{2679{
2913 struct iwl_scale_tbl_info *tbl;2680 struct iwl_scale_tbl_info *tbl;
2914 struct rs_rate *rate;2681 struct rs_rate *rate;
@@ -2938,7 +2705,7 @@ static void rs_initialize_lq(struct iwl_mvm *mvm,
2938 rs_set_expected_tpt_table(lq_sta, tbl);2705 rs_set_expected_tpt_table(lq_sta, tbl);
2939 rs_fill_lq_cmd(mvm, sta, lq_sta, rate);2706 rs_fill_lq_cmd(mvm, sta, lq_sta, rate);
2940 /* TODO restore station should remember the lq cmd */2707 /* TODO restore station should remember the lq cmd */
2941 iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, !update);2708 iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq);
2942}2709}
29432710
2944static void rs_drv_get_rate(void *mvm_r, struct ieee80211_sta *sta,2711static void rs_drv_get_rate(void *mvm_r, struct ieee80211_sta *sta,
@@ -3187,7 +2954,7 @@ void iwl_mvm_update_frame_stats(struct iwl_mvm *mvm, u32 rate, bool agg)
3187 * Called after adding a new station to initialize rate scaling2954 * Called after adding a new station to initialize rate scaling
3188 */2955 */
3189static void rs_drv_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta,2956static void rs_drv_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
3190 enum nl80211_band band, bool update)2957 enum nl80211_band band)
3191{2958{
3192 int i, j;2959 int i, j;
3193 struct ieee80211_hw *hw = mvm->hw;2960 struct ieee80211_hw *hw = mvm->hw;
@@ -3198,6 +2965,8 @@ static void rs_drv_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
3198 struct ieee80211_supported_band *sband;2965 struct ieee80211_supported_band *sband;
3199 unsigned long supp; /* must be unsigned long for for_each_set_bit */2966 unsigned long supp; /* must be unsigned long for for_each_set_bit */
32002967
2968 lockdep_assert_held(&mvmsta->lq_sta.rs_drv.pers.lock);
2969
3201 /* clear all non-persistent lq data */2970 /* clear all non-persistent lq data */
3202 memset(lq_sta, 0, offsetof(typeof(*lq_sta), pers));2971 memset(lq_sta, 0, offsetof(typeof(*lq_sta), pers));
32032972
@@ -3267,7 +3036,7 @@ static void rs_drv_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
3267#ifdef CPTCFG_IWLWIFI_DEBUGFS3036#ifdef CPTCFG_IWLWIFI_DEBUGFS
3268 iwl_mvm_reset_frame_stats(mvm);3037 iwl_mvm_reset_frame_stats(mvm);
3269#endif3038#endif
3270 rs_initialize_lq(mvm, sta, lq_sta, band, update);3039 rs_initialize_lq(mvm, sta, lq_sta, band);
3271}3040}
32723041
3273static void rs_drv_rate_update(void *mvm_r,3042static void rs_drv_rate_update(void *mvm_r,
@@ -3290,6 +3059,254 @@ static void rs_drv_rate_update(void *mvm_r,
3290 iwl_mvm_rs_rate_init(mvm, sta, sband->band, true);3059 iwl_mvm_rs_rate_init(mvm, sta, sband->band, true);
3291}3060}
32923061
3062static void __iwl_mvm_rs_tx_status(struct iwl_mvm *mvm,
3063 struct ieee80211_sta *sta,
3064 int tid, struct ieee80211_tx_info *info,
3065 bool ndp)
3066{
3067 int legacy_success;
3068 int retries;
3069 int i;
3070 struct iwl_lq_cmd *table;
3071 u32 lq_hwrate;
3072 struct rs_rate lq_rate, tx_resp_rate;
3073 struct iwl_scale_tbl_info *curr_tbl, *other_tbl, *tmp_tbl;
3074 u32 tlc_info = (uintptr_t)info->status.status_driver_data[0];
3075 u8 reduced_txp = tlc_info & RS_DRV_DATA_TXP_MSK;
3076 u8 lq_color = RS_DRV_DATA_LQ_COLOR_GET(tlc_info);
3077 u32 tx_resp_hwrate = (uintptr_t)info->status.status_driver_data[1];
3078 struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
3079 struct iwl_lq_sta *lq_sta = &mvmsta->lq_sta.rs_drv;
3080
3081 if (!lq_sta->pers.drv) {
3082 IWL_DEBUG_RATE(mvm, "Rate scaling not initialized yet.\n");
3083 return;
3084 }
3085
3086 /* This packet was aggregated but doesn't carry status info */
3087 if ((info->flags & IEEE80211_TX_CTL_AMPDU) &&
3088 !(info->flags & IEEE80211_TX_STAT_AMPDU))
3089 return;
3090
3091 if (rs_rate_from_ucode_rate(tx_resp_hwrate, info->band,
3092 &tx_resp_rate)) {
3093 WARN_ON_ONCE(1);
3094 return;
3095 }
3096
3097#ifdef CPTCFG_MAC80211_DEBUGFS
3098 /* Disable last tx check if we are debugging with fixed rate but
3099 * update tx stats
3100 */
3101 if (lq_sta->pers.dbg_fixed_rate) {
3102 int index = tx_resp_rate.index;
3103 enum rs_column column;
3104 int attempts, success;
3105
3106 column = rs_get_column_from_rate(&tx_resp_rate);
3107 if (WARN_ONCE(column == RS_COLUMN_INVALID,
3108 "Can't map rate 0x%x to column",
3109 tx_resp_hwrate))
3110 return;
3111
3112 if (info->flags & IEEE80211_TX_STAT_AMPDU) {
3113 attempts = info->status.ampdu_len;
3114 success = info->status.ampdu_ack_len;
3115 } else {
3116 attempts = info->status.rates[0].count;
3117 success = !!(info->flags & IEEE80211_TX_STAT_ACK);
3118 }
3119
3120 lq_sta->pers.tx_stats[column][index].total += attempts;
3121 lq_sta->pers.tx_stats[column][index].success += success;
3122
3123 IWL_DEBUG_RATE(mvm, "Fixed rate 0x%x success %d attempts %d\n",
3124 tx_resp_hwrate, success, attempts);
3125 return;
3126 }
3127#endif
3128
3129 if (time_after(jiffies,
3130 (unsigned long)(lq_sta->last_tx +
3131 (IWL_MVM_RS_IDLE_TIMEOUT * HZ)))) {
3132 IWL_DEBUG_RATE(mvm, "Tx idle for too long. reinit rs\n");
3133 /* reach here only in case of driver RS, call directly
3134 * the unlocked version
3135 */
3136 rs_drv_rate_init(mvm, sta, info->band);
3137 return;
3138 }
3139 lq_sta->last_tx = jiffies;
3140
3141 /* Ignore this Tx frame response if its initial rate doesn't match
3142 * that of latest Link Quality command. There may be stragglers
3143 * from a previous Link Quality command, but we're no longer interested
3144 * in those; they're either from the "active" mode while we're trying
3145 * to check "search" mode, or a prior "search" mode after we've moved
3146 * to a new "search" mode (which might become the new "active" mode).
3147 */
3148 table = &lq_sta->lq;
3149 lq_hwrate = le32_to_cpu(table->rs_table[0]);
3150 if (rs_rate_from_ucode_rate(lq_hwrate, info->band, &lq_rate)) {
3151 WARN_ON_ONCE(1);
3152 return;
3153 }
3154
3155 /* Here we actually compare this rate to the latest LQ command */
3156 if (lq_color != LQ_FLAG_COLOR_GET(table->flags)) {
3157 IWL_DEBUG_RATE(mvm,
3158 "tx resp color 0x%x does not match 0x%x\n",
3159 lq_color, LQ_FLAG_COLOR_GET(table->flags));
3160
3161 /* Since rates mis-match, the last LQ command may have failed.
3162 * After IWL_MISSED_RATE_MAX mis-matches, resync the uCode with
3163 * ... driver.
3164 */
3165 lq_sta->missed_rate_counter++;
3166 if (lq_sta->missed_rate_counter > IWL_MVM_RS_MISSED_RATE_MAX) {
3167 lq_sta->missed_rate_counter = 0;
3168 IWL_DEBUG_RATE(mvm,
3169 "Too many rates mismatch. Send sync LQ. rs_state %d\n",
3170 lq_sta->rs_state);
3171 iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq);
3172 }
3173 /* Regardless, ignore this status info for outdated rate */
3174 return;
3175 }
3176
3177 /* Rate did match, so reset the missed_rate_counter */
3178 lq_sta->missed_rate_counter = 0;
3179
3180 if (!lq_sta->search_better_tbl) {
3181 curr_tbl = &lq_sta->lq_info[lq_sta->active_tbl];
3182 other_tbl = &lq_sta->lq_info[1 - lq_sta->active_tbl];
3183 } else {
3184 curr_tbl = &lq_sta->lq_info[1 - lq_sta->active_tbl];
3185 other_tbl = &lq_sta->lq_info[lq_sta->active_tbl];
3186 }
3187
3188 if (WARN_ON_ONCE(!rs_rate_column_match(&lq_rate, &curr_tbl->rate))) {
3189 IWL_DEBUG_RATE(mvm,
3190 "Neither active nor search matches tx rate\n");
3191 tmp_tbl = &lq_sta->lq_info[lq_sta->active_tbl];
3192 rs_dump_rate(mvm, &tmp_tbl->rate, "ACTIVE");
3193 tmp_tbl = &lq_sta->lq_info[1 - lq_sta->active_tbl];
3194 rs_dump_rate(mvm, &tmp_tbl->rate, "SEARCH");
3195 rs_dump_rate(mvm, &lq_rate, "ACTUAL");
3196
3197 /* no matching table found, let's by-pass the data collection
3198 * and continue to perform rate scale to find the rate table
3199 */
3200 rs_stay_in_table(lq_sta, true);
3201 goto done;
3202 }
3203
3204 /* Updating the frame history depends on whether packets were
3205 * aggregated.
3206 *
3207 * For aggregation, all packets were transmitted at the same rate, the
3208 * first index into rate scale table.
3209 */
3210 if (info->flags & IEEE80211_TX_STAT_AMPDU) {
3211 rs_collect_tpc_data(mvm, lq_sta, curr_tbl, tx_resp_rate.index,
3212 info->status.ampdu_len,
3213 info->status.ampdu_ack_len,
3214 reduced_txp);
3215
3216 /* ampdu_ack_len = 0 marks no BA was received. For TLC, treat
3217 * it as a single frame loss as we don't want the success ratio
3218 * to dip too quickly because a BA wasn't received.
3219 * For TPC, there's no need for this optimisation since we want
3220 * to recover very quickly from a bad power reduction and,
3221 * therefore we'd like the success ratio to get an immediate hit
3222 * when failing to get a BA, so we'd switch back to a lower or
3223 * zero power reduction. When FW transmits agg with a rate
3224 * different from the initial rate, it will not use reduced txp
3225 * and will send BA notification twice (one empty with reduced
3226 * txp equal to the value from LQ and one with reduced txp 0).
3227 * We need to update counters for each txp level accordingly.
3228 */
3229 if (info->status.ampdu_ack_len == 0)
3230 info->status.ampdu_len = 1;
3231
3232 rs_collect_tlc_data(mvm, mvmsta, tid, curr_tbl,
3233 tx_resp_rate.index,
3234 info->status.ampdu_len,
3235 info->status.ampdu_ack_len);
3236
3237 /* Update success/fail counts if not searching for new mode */
3238 if (lq_sta->rs_state == RS_STATE_STAY_IN_COLUMN) {
3239 lq_sta->total_success += info->status.ampdu_ack_len;
3240 lq_sta->total_failed += (info->status.ampdu_len -
3241 info->status.ampdu_ack_len);
3242 }
3243 } else {
3244 /* For legacy, update frame history with for each Tx retry. */
3245 retries = info->status.rates[0].count - 1;
3246 /* HW doesn't send more than 15 retries */
3247 retries = min(retries, 15);
3248
3249 /* The last transmission may have been successful */
3250 legacy_success = !!(info->flags & IEEE80211_TX_STAT_ACK);
3251 /* Collect data for each rate used during failed TX attempts */
3252 for (i = 0; i <= retries; ++i) {
3253 lq_hwrate = le32_to_cpu(table->rs_table[i]);
3254 if (rs_rate_from_ucode_rate(lq_hwrate, info->band,
3255 &lq_rate)) {
3256 WARN_ON_ONCE(1);
3257 return;
3258 }
3259
3260 /* Only collect stats if retried rate is in the same RS
3261 * table as active/search.
3262 */
3263 if (rs_rate_column_match(&lq_rate, &curr_tbl->rate))
3264 tmp_tbl = curr_tbl;
3265 else if (rs_rate_column_match(&lq_rate,
3266 &other_tbl->rate))
3267 tmp_tbl = other_tbl;
3268 else
3269 continue;
3270
3271 rs_collect_tpc_data(mvm, lq_sta, tmp_tbl,
3272 tx_resp_rate.index, 1,
3273 i < retries ? 0 : legacy_success,
3274 reduced_txp);
3275 rs_collect_tlc_data(mvm, mvmsta, tid, tmp_tbl,
3276 tx_resp_rate.index, 1,
3277 i < retries ? 0 : legacy_success);
3278 }
3279
3280 /* Update success/fail counts if not searching for new mode */
3281 if (lq_sta->rs_state == RS_STATE_STAY_IN_COLUMN) {
3282 lq_sta->total_success += legacy_success;
3283 lq_sta->total_failed += retries + (1 - legacy_success);
3284 }
3285 }
3286 /* The last TX rate is cached in lq_sta; it's set in if/else above */
3287 lq_sta->last_rate_n_flags = lq_hwrate;
3288 IWL_DEBUG_RATE(mvm, "reduced txpower: %d\n", reduced_txp);
3289done:
3290 /* See if there's a better rate or modulation mode to try. */
3291 if (sta->supp_rates[info->band])
3292 rs_rate_scale_perform(mvm, sta, lq_sta, tid, ndp);
3293}
3294
3295void iwl_mvm_rs_tx_status(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
3296 int tid, struct ieee80211_tx_info *info, bool ndp)
3297{
3298 struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
3299
3300 /* If it's locked we are in middle of init flow
3301 * just wait for next tx status to update the lq_sta data
3302 */
3303 if (!spin_trylock(&mvmsta->lq_sta.rs_drv.pers.lock))
3304 return;
3305
3306 __iwl_mvm_rs_tx_status(mvm, sta, tid, info, ndp);
3307 spin_unlock(&mvmsta->lq_sta.rs_drv.pers.lock);
3308}
3309
3293#ifdef CPTCFG_MAC80211_DEBUGFS3310#ifdef CPTCFG_MAC80211_DEBUGFS
3294static void rs_build_rates_table_from_fixed(struct iwl_mvm *mvm,3311static void rs_build_rates_table_from_fixed(struct iwl_mvm *mvm,
3295 struct iwl_lq_cmd *lq_cmd,3312 struct iwl_lq_cmd *lq_cmd,
@@ -3581,7 +3598,7 @@ static void rs_set_lq_ss_params(struct iwl_mvm *mvm,
35813598
3582 bfersta_ss_params &= ~LQ_SS_BFER_ALLOWED;3599 bfersta_ss_params &= ~LQ_SS_BFER_ALLOWED;
3583 bfersta_lq_cmd->ss_params = cpu_to_le32(bfersta_ss_params);3600 bfersta_lq_cmd->ss_params = cpu_to_le32(bfersta_ss_params);
3584 iwl_mvm_send_lq_cmd(mvm, bfersta_lq_cmd, false);3601 iwl_mvm_send_lq_cmd(mvm, bfersta_lq_cmd);
35853602
3586 ss_params |= LQ_SS_BFER_ALLOWED;3603 ss_params |= LQ_SS_BFER_ALLOWED;
3587 IWL_DEBUG_RATE(mvm,3604 IWL_DEBUG_RATE(mvm,
@@ -3747,7 +3764,7 @@ static void rs_program_fix_rate(struct iwl_mvm *mvm,
37473764
3748 if (lq_sta->pers.dbg_fixed_rate) {3765 if (lq_sta->pers.dbg_fixed_rate) {
3749 rs_fill_lq_cmd(mvm, NULL, lq_sta, NULL);3766 rs_fill_lq_cmd(mvm, NULL, lq_sta, NULL);
3750 iwl_mvm_send_lq_cmd(lq_sta->pers.drv, &lq_sta->lq, false);3767 iwl_mvm_send_lq_cmd(lq_sta->pers.drv, &lq_sta->lq);
3751 }3768 }
3752}3769}
37533770
@@ -4105,10 +4122,6 @@ static void rs_drv_add_sta_debugfs(void *mvm, void *priv_sta,
41054122
4106 MVM_DEBUGFS_ADD_FILE_RS(ss_force, dir, 0600);4123 MVM_DEBUGFS_ADD_FILE_RS(ss_force, dir, 0600);
4107}4124}
4108
4109void rs_remove_sta_debugfs(void *mvm, void *mvm_sta)
4110{
4111}
4112#endif4125#endif
41134126
4114/*4127/*
@@ -4136,7 +4149,6 @@ static const struct rate_control_ops rs_mvm_ops_drv = {
4136 .rate_update = rs_drv_rate_update,4149 .rate_update = rs_drv_rate_update,
4137#ifdef CPTCFG_MAC80211_DEBUGFS4150#ifdef CPTCFG_MAC80211_DEBUGFS
4138 .add_sta_debugfs = rs_drv_add_sta_debugfs,4151 .add_sta_debugfs = rs_drv_add_sta_debugfs,
4139 .remove_sta_debugfs = rs_remove_sta_debugfs,
4140#endif4152#endif
4141 .capa = RATE_CTRL_CAPA_VHT_EXT_NSS_BW,4153 .capa = RATE_CTRL_CAPA_VHT_EXT_NSS_BW,
4142};4154};
@@ -4144,10 +4156,15 @@ static const struct rate_control_ops rs_mvm_ops_drv = {
4144void iwl_mvm_rs_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta,4156void iwl_mvm_rs_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
4145 enum nl80211_band band, bool update)4157 enum nl80211_band band, bool update)
4146{4158{
4147 if (iwl_mvm_has_tlc_offload(mvm))4159 if (iwl_mvm_has_tlc_offload(mvm)) {
4148 rs_fw_rate_init(mvm, sta, band, update);4160 rs_fw_rate_init(mvm, sta, band, update);
4149 else4161 } else {
4150 rs_drv_rate_init(mvm, sta, band, update);4162 struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
4163
4164 spin_lock(&mvmsta->lq_sta.rs_drv.pers.lock);
4165 rs_drv_rate_init(mvm, sta, band);
4166 spin_unlock(&mvmsta->lq_sta.rs_drv.pers.lock);
4167 }
4151}4168}
41524169
4153int iwl_mvm_rate_control_register(void)4170int iwl_mvm_rate_control_register(void)
@@ -4177,7 +4194,7 @@ static int rs_drv_tx_protection(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta,
4177 lq->flags &= ~LQ_FLAG_USE_RTS_MSK;4194 lq->flags &= ~LQ_FLAG_USE_RTS_MSK;
4178 }4195 }
41794196
4180 return iwl_mvm_send_lq_cmd(mvm, lq, false);4197 return iwl_mvm_send_lq_cmd(mvm, lq);
4181}4198}
41824199
4183/**4200/**
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rs.h b/drivers/net/wireless/intel/iwlwifi/mvm/rs.h
index b80eebc..b199b43 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rs.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rs.h
@@ -3,7 +3,7 @@
3 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.3 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.
4 * Copyright(c) 2015 Intel Mobile Communications GmbH4 * Copyright(c) 2015 Intel Mobile Communications GmbH
5 * Copyright(c) 2017 Intel Deutschland GmbH5 * Copyright(c) 2017 Intel Deutschland GmbH
6 * Copyright(c) 2018 Intel Corporation6 * Copyright(c) 2018 - 2019 Intel Corporation
7 *7 *
8 * This program is free software; you can redistribute it and/or modify it8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of version 2 of the GNU General Public License as9 * under the terms of version 2 of the GNU General Public License as
@@ -396,6 +396,7 @@ struct iwl_lq_sta {
396 s8 last_rssi;396 s8 last_rssi;
397 struct rs_rate_stats tx_stats[RS_COLUMN_COUNT][IWL_RATE_COUNT];397 struct rs_rate_stats tx_stats[RS_COLUMN_COUNT][IWL_RATE_COUNT];
398 struct iwl_mvm *drv;398 struct iwl_mvm *drv;
399 spinlock_t lock; /* for races in reinit/update table */
399 } pers;400 } pers;
400};401};
401402
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
index c35c3dd..6eadeb7 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
@@ -462,20 +462,22 @@ static bool iwl_mvm_is_dup(struct ieee80211_sta *sta, int queue,
462}462}
463463
464int iwl_mvm_notify_rx_queue(struct iwl_mvm *mvm, u32 rxq_mask,464int iwl_mvm_notify_rx_queue(struct iwl_mvm *mvm, u32 rxq_mask,
465 const u8 *data, u32 count)465 const u8 *data, u32 count, bool async)
466{466{
467 struct iwl_rxq_sync_cmd *cmd;467 u8 buf[sizeof(struct iwl_rxq_sync_cmd) +
468 sizeof(struct iwl_mvm_rss_sync_notif)];
469 struct iwl_rxq_sync_cmd *cmd = (void *)buf;
468 u32 data_size = sizeof(*cmd) + count;470 u32 data_size = sizeof(*cmd) + count;
469 int ret;471 int ret;
470472
471 /* should be DWORD aligned */473 /*
472 if (WARN_ON(count & 3 || count > IWL_MULTI_QUEUE_SYNC_MSG_MAX_SIZE))474 * size must be a multiple of DWORD
475 * Ensure we don't overflow buf
476 */
477 if (WARN_ON(count & 3 ||
478 count > sizeof(struct iwl_mvm_rss_sync_notif)))
473 return -EINVAL;479 return -EINVAL;
474480
475 cmd = kzalloc(data_size, GFP_KERNEL);
476 if (!cmd)
477 return -ENOMEM;
478
479 cmd->rxq_mask = cpu_to_le32(rxq_mask);481 cmd->rxq_mask = cpu_to_le32(rxq_mask);
480 cmd->count = cpu_to_le32(count);482 cmd->count = cpu_to_le32(count);
481 cmd->flags = 0;483 cmd->flags = 0;
@@ -484,9 +486,8 @@ int iwl_mvm_notify_rx_queue(struct iwl_mvm *mvm, u32 rxq_mask,
484 ret = iwl_mvm_send_cmd_pdu(mvm,486 ret = iwl_mvm_send_cmd_pdu(mvm,
485 WIDE_ID(DATA_PATH_GROUP,487 WIDE_ID(DATA_PATH_GROUP,
486 TRIGGER_RX_QUEUES_NOTIF_CMD),488 TRIGGER_RX_QUEUES_NOTIF_CMD),
487 0, data_size, cmd);489 async ? CMD_ASYNC : 0, data_size, cmd);
488490
489 kfree(cmd);
490 return ret;491 return ret;
491}492}
492493
@@ -502,14 +503,31 @@ static bool iwl_mvm_is_sn_less(u16 sn1, u16 sn2, u16 buffer_size)
502 !ieee80211_sn_less(sn1, sn2 - buffer_size);503 !ieee80211_sn_less(sn1, sn2 - buffer_size);
503}504}
504505
506static void iwl_mvm_sync_nssn(struct iwl_mvm *mvm, u8 baid, u16 nssn)
507{
508 struct iwl_mvm_rss_sync_notif notif = {
509 .metadata.type = IWL_MVM_RXQ_NSSN_SYNC,
510 .metadata.sync = 0,
511 .nssn_sync.baid = baid,
512 .nssn_sync.nssn = nssn,
513 };
514
515 iwl_mvm_sync_rx_queues_internal(mvm, (void *)&notif, sizeof(notif));
516}
517
505#define RX_REORDER_BUF_TIMEOUT_MQ (HZ / 10)518#define RX_REORDER_BUF_TIMEOUT_MQ (HZ / 10)
506519
520enum iwl_mvm_release_flags {
521 IWL_MVM_RELEASE_SEND_RSS_SYNC = BIT(0),
522 IWL_MVM_RELEASE_FROM_RSS_SYNC = BIT(1),
523};
524
507static void iwl_mvm_release_frames(struct iwl_mvm *mvm,525static void iwl_mvm_release_frames(struct iwl_mvm *mvm,
508 struct ieee80211_sta *sta,526 struct ieee80211_sta *sta,
509 struct napi_struct *napi,527 struct napi_struct *napi,
510 struct iwl_mvm_baid_data *baid_data,528 struct iwl_mvm_baid_data *baid_data,
511 struct iwl_mvm_reorder_buffer *reorder_buf,529 struct iwl_mvm_reorder_buffer *reorder_buf,
512 u16 nssn)530 u16 nssn, u32 flags)
513{531{
514 struct iwl_mvm_reorder_buf_entry *entries =532 struct iwl_mvm_reorder_buf_entry *entries =
515 &baid_data->entries[reorder_buf->queue *533 &baid_data->entries[reorder_buf->queue *
@@ -518,6 +536,18 @@ static void iwl_mvm_release_frames(struct iwl_mvm *mvm,
518536
519 lockdep_assert_held(&reorder_buf->lock);537 lockdep_assert_held(&reorder_buf->lock);
520538
539 /*
540 * We keep the NSSN not too far behind, if we are sync'ing it and it
541 * is more than 2048 ahead of us, it must be behind us. Discard it.
542 * This can happen if the queue that hit the 0 / 2048 seqno was lagging
543 * behind and this queue already processed packets. The next if
544 * would have caught cases where this queue would have processed less
545 * than 64 packets, but it may have processed more than 64 packets.
546 */
547 if ((flags & IWL_MVM_RELEASE_FROM_RSS_SYNC) &&
548 ieee80211_sn_less(nssn, ssn))
549 goto set_timer;
550
521 /* ignore nssn smaller than head sn - this can happen due to timeout */551 /* ignore nssn smaller than head sn - this can happen due to timeout */
522 if (iwl_mvm_is_sn_less(nssn, ssn, reorder_buf->buf_size))552 if (iwl_mvm_is_sn_less(nssn, ssn, reorder_buf->buf_size))
523 goto set_timer;553 goto set_timer;
@@ -528,6 +558,9 @@ static void iwl_mvm_release_frames(struct iwl_mvm *mvm,
528 struct sk_buff *skb;558 struct sk_buff *skb;
529559
530 ssn = ieee80211_sn_inc(ssn);560 ssn = ieee80211_sn_inc(ssn);
561 if ((flags & IWL_MVM_RELEASE_SEND_RSS_SYNC) &&
562 (ssn == 2048 || ssn == 0))
563 iwl_mvm_sync_nssn(mvm, baid_data->baid, ssn);
531564
532 /*565 /*
533 * Empty the list. Will have more than one frame for A-MSDU.566 * Empty the list. Will have more than one frame for A-MSDU.
@@ -614,7 +647,8 @@ void iwl_mvm_reorder_timer_expired(struct timer_list *t)
614 sta_id, sn);647 sta_id, sn);
615 iwl_mvm_event_frame_timeout_callback(buf->mvm, mvmsta->vif,648 iwl_mvm_event_frame_timeout_callback(buf->mvm, mvmsta->vif,
616 sta, baid_data->tid);649 sta, baid_data->tid);
617 iwl_mvm_release_frames(buf->mvm, sta, NULL, baid_data, buf, sn);650 iwl_mvm_release_frames(buf->mvm, sta, NULL, baid_data,
651 buf, sn, IWL_MVM_RELEASE_SEND_RSS_SYNC);
618 rcu_read_unlock();652 rcu_read_unlock();
619 } else {653 } else {
620 /*654 /*
@@ -656,7 +690,8 @@ static void iwl_mvm_del_ba(struct iwl_mvm *mvm, int queue,
656 spin_lock_bh(&reorder_buf->lock);690 spin_lock_bh(&reorder_buf->lock);
657 iwl_mvm_release_frames(mvm, sta, NULL, ba_data, reorder_buf,691 iwl_mvm_release_frames(mvm, sta, NULL, ba_data, reorder_buf,
658 ieee80211_sn_add(reorder_buf->head_sn,692 ieee80211_sn_add(reorder_buf->head_sn,
659 reorder_buf->buf_size));693 reorder_buf->buf_size),
694 0);
660 spin_unlock_bh(&reorder_buf->lock);695 spin_unlock_bh(&reorder_buf->lock);
661 del_timer_sync(&reorder_buf->reorder_timer);696 del_timer_sync(&reorder_buf->reorder_timer);
662697
@@ -664,8 +699,54 @@ out:
664 rcu_read_unlock();699 rcu_read_unlock();
665}700}
666701
667void iwl_mvm_rx_queue_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,702static void iwl_mvm_release_frames_from_notif(struct iwl_mvm *mvm,
668 int queue)703 struct napi_struct *napi,
704 u8 baid, u16 nssn, int queue,
705 u32 flags)
706{
707 struct ieee80211_sta *sta;
708 struct iwl_mvm_reorder_buffer *reorder_buf;
709 struct iwl_mvm_baid_data *ba_data;
710
711 IWL_DEBUG_HT(mvm, "Frame release notification for BAID %u, NSSN %d\n",
712 baid, nssn);
713
714 if (WARN_ON_ONCE(baid == IWL_RX_REORDER_DATA_INVALID_BAID ||
715 baid >= ARRAY_SIZE(mvm->baid_map)))
716 return;
717
718 rcu_read_lock();
719
720 ba_data = rcu_dereference(mvm->baid_map[baid]);
721 if (WARN_ON_ONCE(!ba_data))
722 goto out;
723
724 sta = rcu_dereference(mvm->fw_id_to_mac_id[ba_data->sta_id]);
725 if (WARN_ON_ONCE(IS_ERR_OR_NULL(sta)))
726 goto out;
727
728 reorder_buf = &ba_data->reorder_buf[queue];
729
730 spin_lock_bh(&reorder_buf->lock);
731 iwl_mvm_release_frames(mvm, sta, napi, ba_data,
732 reorder_buf, nssn, flags);
733 spin_unlock_bh(&reorder_buf->lock);
734
735out:
736 rcu_read_unlock();
737}
738
739static void iwl_mvm_nssn_sync(struct iwl_mvm *mvm,
740 struct napi_struct *napi, int queue,
741 const struct iwl_mvm_nssn_sync_data *data)
742{
743 iwl_mvm_release_frames_from_notif(mvm, napi, data->baid,
744 data->nssn, queue,
745 IWL_MVM_RELEASE_FROM_RSS_SYNC);
746}
747
748void iwl_mvm_rx_queue_notif(struct iwl_mvm *mvm, struct napi_struct *napi,
749 struct iwl_rx_cmd_buffer *rxb, int queue)
669{750{
670 struct iwl_rx_packet *pkt = rxb_addr(rxb);751 struct iwl_rx_packet *pkt = rxb_addr(rxb);
671 struct iwl_rxq_sync_notification *notif;752 struct iwl_rxq_sync_notification *notif;
@@ -686,6 +767,10 @@ void iwl_mvm_rx_queue_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
686 case IWL_MVM_RXQ_NOTIF_DEL_BA:767 case IWL_MVM_RXQ_NOTIF_DEL_BA:
687 iwl_mvm_del_ba(mvm, queue, (void *)internal_notif->data);768 iwl_mvm_del_ba(mvm, queue, (void *)internal_notif->data);
688 break;769 break;
770 case IWL_MVM_RXQ_NSSN_SYNC:
771 iwl_mvm_nssn_sync(mvm, napi, queue,
772 (void *)internal_notif->data);
773 break;
689 default:774 default:
690 WARN_ONCE(1, "Invalid identifier %d", internal_notif->type);775 WARN_ONCE(1, "Invalid identifier %d", internal_notif->type);
691 }776 }
@@ -784,7 +869,8 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm,
784 }869 }
785870
786 if (ieee80211_is_back_req(hdr->frame_control)) {871 if (ieee80211_is_back_req(hdr->frame_control)) {
787 iwl_mvm_release_frames(mvm, sta, napi, baid_data, buffer, nssn);872 iwl_mvm_release_frames(mvm, sta, napi, baid_data,
873 buffer, nssn, 0);
788 goto drop;874 goto drop;
789 }875 }
790876
@@ -793,7 +879,10 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm,
793 * If the SN is smaller than the NSSN it might need to first go into879 * If the SN is smaller than the NSSN it might need to first go into
794 * the reorder buffer, in which case we just release up to it and the880 * the reorder buffer, in which case we just release up to it and the
795 * rest of the function will take care of storing it and releasing up to881 * rest of the function will take care of storing it and releasing up to
796 * the nssn882 * the nssn.
883 * This should not happen. This queue has been lagging and it should
884 * have been updated by a IWL_MVM_RXQ_NSSN_SYNC notification. Be nice
885 * and update the other queues.
797 */886 */
798 if (!iwl_mvm_is_sn_less(nssn, buffer->head_sn + buffer->buf_size,887 if (!iwl_mvm_is_sn_less(nssn, buffer->head_sn + buffer->buf_size,
799 buffer->buf_size) ||888 buffer->buf_size) ||
@@ -801,7 +890,7 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm,
801 u16 min_sn = ieee80211_sn_less(sn, nssn) ? sn : nssn;890 u16 min_sn = ieee80211_sn_less(sn, nssn) ? sn : nssn;
802891
803 iwl_mvm_release_frames(mvm, sta, napi, baid_data, buffer,892 iwl_mvm_release_frames(mvm, sta, napi, baid_data, buffer,
804 min_sn);893 min_sn, IWL_MVM_RELEASE_SEND_RSS_SYNC);
805 }894 }
806895
807 /* drop any oudated packets */896 /* drop any oudated packets */
@@ -812,8 +901,23 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm,
812 if (!buffer->num_stored && ieee80211_sn_less(sn, nssn)) {901 if (!buffer->num_stored && ieee80211_sn_less(sn, nssn)) {
813 if (iwl_mvm_is_sn_less(buffer->head_sn, nssn,902 if (iwl_mvm_is_sn_less(buffer->head_sn, nssn,
814 buffer->buf_size) &&903 buffer->buf_size) &&
815 (!amsdu || last_subframe))904 (!amsdu || last_subframe)) {
905 /*
906 * If we crossed the 2048 or 0 SN, notify all the
907 * queues. This is done in order to avoid having a
908 * head_sn that lags behind for too long. When that
909 * happens, we can get to a situation where the head_sn
910 * is within the interval [nssn - buf_size : nssn]
911 * which will make us think that the nssn is a packet
912 * that we already freed because of the reordering
913 * buffer and we will ignore it. So maintain the
914 * head_sn somewhat updated across all the queues:
915 * when it crosses 0 and 2048.
916 */
917 if (sn == 2048 || sn == 0)
918 iwl_mvm_sync_nssn(mvm, baid, sn);
816 buffer->head_sn = nssn;919 buffer->head_sn = nssn;
920 }
817 /* No need to update AMSDU last SN - we are moving the head */921 /* No need to update AMSDU last SN - we are moving the head */
818 spin_unlock_bh(&buffer->lock);922 spin_unlock_bh(&buffer->lock);
819 return false;923 return false;
@@ -828,8 +932,11 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm,
828 * while technically there is no hole and we can move forward.932 * while technically there is no hole and we can move forward.
829 */933 */
830 if (!buffer->num_stored && sn == buffer->head_sn) {934 if (!buffer->num_stored && sn == buffer->head_sn) {
831 if (!amsdu || last_subframe)935 if (!amsdu || last_subframe) {
936 if (sn == 2048 || sn == 0)
937 iwl_mvm_sync_nssn(mvm, baid, sn);
832 buffer->head_sn = ieee80211_sn_inc(buffer->head_sn);938 buffer->head_sn = ieee80211_sn_inc(buffer->head_sn);
939 }
833 /* No need to update AMSDU last SN - we are moving the head */940 /* No need to update AMSDU last SN - we are moving the head */
834 spin_unlock_bh(&buffer->lock);941 spin_unlock_bh(&buffer->lock);
835 return false;942 return false;
@@ -874,7 +981,9 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm,
874 * release notification with up to date NSSN.981 * release notification with up to date NSSN.
875 */982 */
876 if (!amsdu || last_subframe)983 if (!amsdu || last_subframe)
877 iwl_mvm_release_frames(mvm, sta, napi, baid_data, buffer, nssn);984 iwl_mvm_release_frames(mvm, sta, napi, baid_data,
985 buffer, nssn,
986 IWL_MVM_RELEASE_SEND_RSS_SYNC);
878987
879 spin_unlock_bh(&buffer->lock);988 spin_unlock_bh(&buffer->lock);
880 return true;989 return true;
@@ -1843,40 +1952,14 @@ void iwl_mvm_rx_monitor_no_data(struct iwl_mvm *mvm, struct napi_struct *napi,
1843out:1952out:
1844 rcu_read_unlock();1953 rcu_read_unlock();
1845}1954}
1955
1846void iwl_mvm_rx_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi,1956void iwl_mvm_rx_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi,
1847 struct iwl_rx_cmd_buffer *rxb, int queue)1957 struct iwl_rx_cmd_buffer *rxb, int queue)
1848{1958{
1849 struct iwl_rx_packet *pkt = rxb_addr(rxb);1959 struct iwl_rx_packet *pkt = rxb_addr(rxb);
1850 struct iwl_frame_release *release = (void *)pkt->data;1960 struct iwl_frame_release *release = (void *)pkt->data;
1851 struct ieee80211_sta *sta;
1852 struct iwl_mvm_reorder_buffer *reorder_buf;
1853 struct iwl_mvm_baid_data *ba_data;
1854
1855 int baid = release->baid;
1856
1857 IWL_DEBUG_HT(mvm, "Frame release notification for BAID %u, NSSN %d\n",
1858 release->baid, le16_to_cpu(release->nssn));
18591961
1860 if (WARN_ON_ONCE(baid == IWL_RX_REORDER_DATA_INVALID_BAID))1962 iwl_mvm_release_frames_from_notif(mvm, napi, release->baid,
1861 return;1963 le16_to_cpu(release->nssn),
18621964 queue, 0);
1863 rcu_read_lock();
1864
1865 ba_data = rcu_dereference(mvm->baid_map[baid]);
1866 if (WARN_ON_ONCE(!ba_data))
1867 goto out;
1868
1869 sta = rcu_dereference(mvm->fw_id_to_mac_id[ba_data->sta_id]);
1870 if (WARN_ON_ONCE(IS_ERR_OR_NULL(sta)))
1871 goto out;
1872
1873 reorder_buf = &ba_data->reorder_buf[queue];
1874
1875 spin_lock_bh(&reorder_buf->lock);
1876 iwl_mvm_release_frames(mvm, sta, napi, ba_data, reorder_buf,
1877 le16_to_cpu(release->nssn));
1878 spin_unlock_bh(&reorder_buf->lock);
1879
1880out:
1881 rcu_read_unlock();
1882}1965}
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
index 7d667f3..1cdfebc 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
@@ -1678,6 +1678,8 @@ int iwl_mvm_add_sta(struct iwl_mvm *mvm,
1678 */1678 */
1679 if (iwl_mvm_has_tlc_offload(mvm))1679 if (iwl_mvm_has_tlc_offload(mvm))
1680 iwl_mvm_rs_add_sta(mvm, mvm_sta);1680 iwl_mvm_rs_add_sta(mvm, mvm_sta);
1681 else
1682 spin_lock_init(&mvm_sta->lq_sta.rs_drv.pers.lock);
16811683
1682 iwl_mvm_toggle_tx_ant(mvm, &mvm_sta->tx_ant);1684 iwl_mvm_toggle_tx_ant(mvm, &mvm_sta->tx_ant);
16831685
@@ -2411,7 +2413,7 @@ int iwl_mvm_rm_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
24112413
2412static void iwl_mvm_sync_rxq_del_ba(struct iwl_mvm *mvm, u8 baid)2414static void iwl_mvm_sync_rxq_del_ba(struct iwl_mvm *mvm, u8 baid)
2413{2415{
2414 struct iwl_mvm_delba_notif notif = {2416 struct iwl_mvm_rss_sync_notif notif = {
2415 .metadata.type = IWL_MVM_RXQ_NOTIF_DEL_BA,2417 .metadata.type = IWL_MVM_RXQ_NOTIF_DEL_BA,
2416 .metadata.sync = 1,2418 .metadata.sync = 1,
2417 .delba.baid = baid,2419 .delba.baid = baid,
@@ -2955,7 +2957,7 @@ out:
2955 IWL_DEBUG_HT(mvm, "Tx aggregation enabled on ra = %pM tid = %d\n",2957 IWL_DEBUG_HT(mvm, "Tx aggregation enabled on ra = %pM tid = %d\n",
2956 sta->addr, tid);2958 sta->addr, tid);
29572959
2958 return iwl_mvm_send_lq_cmd(mvm, &mvmsta->lq_sta.rs_drv.lq, false);2960 return iwl_mvm_send_lq_cmd(mvm, &mvmsta->lq_sta.rs_drv.lq);
2959}2961}
29602962
2961static void iwl_mvm_unreserve_agg_queue(struct iwl_mvm *mvm,2963static void iwl_mvm_unreserve_agg_queue(struct iwl_mvm *mvm,
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.h b/drivers/net/wireless/intel/iwlwifi/mvm/sta.h
index 4487cc3..8d70093 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.h
@@ -343,9 +343,17 @@ struct iwl_mvm_delba_data {
343 u32 baid;343 u32 baid;
344} __packed;344} __packed;
345345
346struct iwl_mvm_delba_notif {346struct iwl_mvm_nssn_sync_data {
347 u32 baid;
348 u32 nssn;
349} __packed;
350
351struct iwl_mvm_rss_sync_notif {
347 struct iwl_mvm_internal_rxq_notif metadata;352 struct iwl_mvm_internal_rxq_notif metadata;
348 struct iwl_mvm_delba_data delba;353 union {
354 struct iwl_mvm_delba_data delba;
355 struct iwl_mvm_nssn_sync_data nssn_sync;
356 };
349} __packed;357} __packed;
350358
351/**359/**
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
index dd65970..99f02f8 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
@@ -647,12 +647,12 @@ int iwl_mvm_reconfig_scd(struct iwl_mvm *mvm, int queue, int fifo, int sta_id,
647 * this case to clear the state indicating that station creation is in647 * this case to clear the state indicating that station creation is in
648 * progress.648 * progress.
649 */649 */
650int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq, bool sync)650int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq)
651{651{
652 struct iwl_host_cmd cmd = {652 struct iwl_host_cmd cmd = {
653 .id = LQ_CMD,653 .id = LQ_CMD,
654 .len = { sizeof(struct iwl_lq_cmd), },654 .len = { sizeof(struct iwl_lq_cmd), },
655 .flags = sync ? 0 : CMD_ASYNC,655 .flags = CMD_ASYNC,
656 .data = { lq, },656 .data = { lq, },
657 };657 };
658658
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index fee789b..1324f23 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -417,6 +417,7 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
417 {IWL_PCI_DEVICE(0x2526, 0x40A4, iwl9460_2ac_cfg)},417 {IWL_PCI_DEVICE(0x2526, 0x40A4, iwl9460_2ac_cfg)},
418 {IWL_PCI_DEVICE(0x2526, 0x4234, iwl9560_2ac_cfg_soc)},418 {IWL_PCI_DEVICE(0x2526, 0x4234, iwl9560_2ac_cfg_soc)},
419 {IWL_PCI_DEVICE(0x2526, 0x42A4, iwl9462_2ac_cfg_soc)},419 {IWL_PCI_DEVICE(0x2526, 0x42A4, iwl9462_2ac_cfg_soc)},
420 {IWL_PCI_DEVICE(0x2526, 0x6014, iwl9260_2ac_160_cfg)},
420 {IWL_PCI_DEVICE(0x2526, 0x8014, iwl9260_2ac_160_cfg)},421 {IWL_PCI_DEVICE(0x2526, 0x8014, iwl9260_2ac_160_cfg)},
421 {IWL_PCI_DEVICE(0x2526, 0x8010, iwl9260_2ac_160_cfg)},422 {IWL_PCI_DEVICE(0x2526, 0x8010, iwl9260_2ac_160_cfg)},
422 {IWL_PCI_DEVICE(0x2526, 0xA014, iwl9260_2ac_160_cfg)},423 {IWL_PCI_DEVICE(0x2526, 0xA014, iwl9260_2ac_160_cfg)},
@@ -789,6 +790,7 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
789 {IWL_PCI_DEVICE(0x7A70, 0x0310, iwlax211_2ax_cfg_so_gf_a0)},790 {IWL_PCI_DEVICE(0x7A70, 0x0310, iwlax211_2ax_cfg_so_gf_a0)},
790 {IWL_PCI_DEVICE(0x7A70, 0x0510, iwlax211_2ax_cfg_so_gf_a0)},791 {IWL_PCI_DEVICE(0x7A70, 0x0510, iwlax211_2ax_cfg_so_gf_a0)},
791 {IWL_PCI_DEVICE(0x7A70, 0x0A10, iwlax211_2ax_cfg_so_gf_a0)},792 {IWL_PCI_DEVICE(0x7A70, 0x0A10, iwlax211_2ax_cfg_so_gf_a0)},
793 {IWL_PCI_DEVICE(0x7AF0, 0x0090, iwlax211_2ax_cfg_so_gf_a0)},
792 {IWL_PCI_DEVICE(0x7AF0, 0x0310, iwlax211_2ax_cfg_so_gf_a0)},794 {IWL_PCI_DEVICE(0x7AF0, 0x0310, iwlax211_2ax_cfg_so_gf_a0)},
793 {IWL_PCI_DEVICE(0x7AF0, 0x0510, iwlax211_2ax_cfg_so_gf_a0)},795 {IWL_PCI_DEVICE(0x7AF0, 0x0510, iwlax211_2ax_cfg_so_gf_a0)},
794 {IWL_PCI_DEVICE(0x7AF0, 0x0A10, iwlax211_2ax_cfg_so_gf_a0)},796 {IWL_PCI_DEVICE(0x7AF0, 0x0A10, iwlax211_2ax_cfg_so_gf_a0)},
@@ -861,6 +863,27 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
861 }863 }
862 iwl_trans->cfg = cfg;864 iwl_trans->cfg = cfg;
863 }865 }
866
867 /*
868 * This is a hack to switch from Qu B0 to Qu C0. We need to
869 * do this for all cfgs that use Qu B0. All this code is in
870 * urgent need for a refactor, but for now this is the easiest
871 * thing to do to support Qu C-step.
872 */
873 if (iwl_trans->hw_rev == CSR_HW_REV_TYPE_QU_C0) {
874 if (iwl_trans->cfg == &iwl_ax101_cfg_qu_hr)
875 iwl_trans->cfg = &iwl_ax101_cfg_qu_c0_hr_b0;
876 else if (iwl_trans->cfg == &iwl_ax201_cfg_qu_hr)
877 iwl_trans->cfg = &iwl_ax201_cfg_qu_c0_hr_b0;
878 else if (iwl_trans->cfg == &iwl9461_2ac_cfg_qu_b0_jf_b0)
879 iwl_trans->cfg = &iwl9461_2ac_cfg_qu_c0_jf_b0;
880 else if (iwl_trans->cfg == &iwl9462_2ac_cfg_qu_b0_jf_b0)
881 iwl_trans->cfg = &iwl9462_2ac_cfg_qu_c0_jf_b0;
882 else if (iwl_trans->cfg == &iwl9560_2ac_cfg_qu_b0_jf_b0)
883 iwl_trans->cfg = &iwl9560_2ac_cfg_qu_c0_jf_b0;
884 else if (iwl_trans->cfg == &iwl9560_2ac_160_cfg_qu_b0_jf_b0)
885 iwl_trans->cfg = &iwl9560_2ac_160_cfg_qu_c0_jf_b0;
886 }
864#endif887#endif
865888
866 pci_set_drvdata(pdev, iwl_trans);889 pci_set_drvdata(pdev, iwl_trans);
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
index 1e63a59..519a421 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
@@ -218,8 +218,7 @@ static void iwl_pcie_alloc_fw_monitor_block(struct iwl_trans *trans,
218 for (power = max_power; power >= min_power; power--) {218 for (power = max_power; power >= min_power; power--) {
219 size = BIT(power);219 size = BIT(power);
220 cpu_addr = dma_alloc_coherent(trans->dev, size, &phys,220 cpu_addr = dma_alloc_coherent(trans->dev, size, &phys,
221 GFP_KERNEL | __GFP_NOWARN |221 GFP_KERNEL | __GFP_NOWARN);
222 __GFP_ZERO | __GFP_COMP);
223 if (!cpu_addr)222 if (!cpu_addr)
224 continue;223 continue;
225224
@@ -2140,7 +2139,6 @@ static void iwl_trans_pcie_release_nic_access(struct iwl_trans *trans,
2140 * MAC_ACCESS_REQ bit to be performed before any other writes2139 * MAC_ACCESS_REQ bit to be performed before any other writes
2141 * scheduled on different CPUs (after we drop reg_lock).2140 * scheduled on different CPUs (after we drop reg_lock).
2142 */2141 */
2143 mmiowb();
2144out:2142out:
2145 spin_unlock_irqrestore(&trans_pcie->reg_lock, *flags);2143 spin_unlock_irqrestore(&trans_pcie->reg_lock, *flags);
2146}2144}
@@ -3615,8 +3613,9 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
3615 } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==3613 } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==
3616 CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR) &&3614 CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR) &&
3617 ((trans->cfg != &iwl_ax200_cfg_cc &&3615 ((trans->cfg != &iwl_ax200_cfg_cc &&
3618 trans->cfg != &killer1650x_2ax_cfg &&3616 trans->cfg != &killer1650x_2ax_cfg &&
3619 trans->cfg != &killer1650w_2ax_cfg) ||3617 trans->cfg != &killer1650w_2ax_cfg &&
3618 trans->cfg != &iwl_ax201_cfg_quz_hr) ||
3620 trans->hw_rev == CSR_HW_REV_TYPE_QNJ_B0)) {3619 trans->hw_rev == CSR_HW_REV_TYPE_QNJ_B0)) {
3621 u32 hw_status;3620 u32 hw_status;
36223621
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 26e4405..880445d 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -3654,35 +3654,53 @@ done:
3654static __genl_const struct genl_ops hwsim_ops[] = {3654static __genl_const struct genl_ops hwsim_ops[] = {
3655 {3655 {
3656 .cmd = HWSIM_CMD_REGISTER,3656 .cmd = HWSIM_CMD_REGISTER,
3657 .policy = hwsim_genl_policy,3657#if LINUX_VERSION_IS_GEQ(5,2,0)
3658 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
3659#endif
3660
3658 .doit = hwsim_register_received_nl,3661 .doit = hwsim_register_received_nl,
3659 .flags = GENL_UNS_ADMIN_PERM,3662 .flags = GENL_UNS_ADMIN_PERM,
3660 },3663 },
3661 {3664 {
3662 .cmd = HWSIM_CMD_FRAME,3665 .cmd = HWSIM_CMD_FRAME,
3663 .policy = hwsim_genl_policy,3666#if LINUX_VERSION_IS_GEQ(5,2,0)
3667 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
3668#endif
3669
3664 .doit = hwsim_cloned_frame_received_nl,3670 .doit = hwsim_cloned_frame_received_nl,
3665 },3671 },
3666 {3672 {
3667 .cmd = HWSIM_CMD_TX_INFO_FRAME,3673 .cmd = HWSIM_CMD_TX_INFO_FRAME,
3668 .policy = hwsim_genl_policy,3674#if LINUX_VERSION_IS_GEQ(5,2,0)
3675 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
3676#endif
3677
3669 .doit = hwsim_tx_info_frame_received_nl,3678 .doit = hwsim_tx_info_frame_received_nl,
3670 },3679 },
3671 {3680 {
3672 .cmd = HWSIM_CMD_NEW_RADIO,3681 .cmd = HWSIM_CMD_NEW_RADIO,
3673 .policy = hwsim_genl_policy,3682#if LINUX_VERSION_IS_GEQ(5,2,0)
3683 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
3684#endif
3685
3674 .doit = hwsim_new_radio_nl,3686 .doit = hwsim_new_radio_nl,
3675 .flags = GENL_UNS_ADMIN_PERM,3687 .flags = GENL_UNS_ADMIN_PERM,
3676 },3688 },
3677 {3689 {
3678 .cmd = HWSIM_CMD_DEL_RADIO,3690 .cmd = HWSIM_CMD_DEL_RADIO,
3679 .policy = hwsim_genl_policy,3691#if LINUX_VERSION_IS_GEQ(5,2,0)
3692 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
3693#endif
3694
3680 .doit = hwsim_del_radio_nl,3695 .doit = hwsim_del_radio_nl,
3681 .flags = GENL_UNS_ADMIN_PERM,3696 .flags = GENL_UNS_ADMIN_PERM,
3682 },3697 },
3683 {3698 {
3684 .cmd = HWSIM_CMD_GET_RADIO,3699 .cmd = HWSIM_CMD_GET_RADIO,
3685 .policy = hwsim_genl_policy,3700#if LINUX_VERSION_IS_GEQ(5,2,0)
3701 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
3702#endif
3703
3686 .doit = hwsim_get_radio_nl,3704 .doit = hwsim_get_radio_nl,
3687 .dumpit = hwsim_dump_radio_nl,3705 .dumpit = hwsim_dump_radio_nl,
3688 },3706 },
@@ -3692,6 +3710,7 @@ static struct genl_family hwsim_genl_family __genl_ro_after_init = {
3692 .name = "MAC80211_HWSIM",3710 .name = "MAC80211_HWSIM",
3693 .version = 1,3711 .version = 1,
3694 .maxattr = HWSIM_ATTR_MAX,3712 .maxattr = HWSIM_ATTR_MAX,
3713 .policy = hwsim_genl_policy,
3695 .netnsok = true,3714 .netnsok = true,
3696 .module = THIS_MODULE,3715 .module = THIS_MODULE,
3697 .ops = hwsim_ops,3716 .ops = hwsim_ops,
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index fc29f99..ba2d64a 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -1193,6 +1193,7 @@ void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
1193{1193{
1194 struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;1194 struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
1195 struct ieee80211_chanctx_conf *chanctx_conf;1195 struct ieee80211_chanctx_conf *chanctx_conf;
1196 struct sk_buff *skb;
11961197
1197 if (ifibss->state == IEEE80211_IBSS_MLME_SEARCH)1198 if (ifibss->state == IEEE80211_IBSS_MLME_SEARCH)
1198 return;1199 return;
@@ -1207,9 +1208,12 @@ void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
1207 return;1208 return;
1208 }1209 }
12091210
1210 ieee80211_mlme_send_probe_req(sdata, sdata->vif.addr, addr,1211 skb = ieee80211_build_probe_req(sdata, sdata->vif.addr, addr, bssid,
1211 sdata->u.ibss.ssid, sdata->u.ibss.ssid_len,1212 (u32)-1, chanctx_conf->def.chan,
1212 chanctx_conf->def.chan);1213 ifibss->ssid, ifibss->ssid_len, NULL, 0,
1214 IEEE80211_PROBE_FLAG_DIRECTED);
1215 if (skb)
1216 ieee80211_tx_skb(sdata, skb);
1213 rcu_read_unlock();1217 rcu_read_unlock();
1214}1218}
12151219
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index fca3b96..1c659c7 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2212,7 +2212,7 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
2212 u32 flags);2212 u32 flags);
2213struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,2213struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
2214 const u8 *src, const u8 *dst,2214 const u8 *src, const u8 *dst,
2215 u32 ratemask,2215 const u8 *bssid, u32 ratemask,
2216 struct ieee80211_channel *chan,2216 struct ieee80211_channel *chan,
2217 const u8 *ssid, size_t ssid_len,2217 const u8 *ssid, size_t ssid_len,
2218 const u8 *ie, size_t ie_len,2218 const u8 *ie, size_t ie_len,
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index e470b33..e6f291e 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -422,7 +422,20 @@ ieee80211_default_mgmt_stypes[NUM_NL80211_IFTYPES] = {
422 },422 },
423 [NL80211_IFTYPE_STATION] = {423 [NL80211_IFTYPE_STATION] = {
424 .tx = 0xffff,424 .tx = 0xffff,
425 /*
426 * To support Pre Association Security Negotiation (PASN) while
427 * already associated to one AP, allow user space to register to
428 * Rx authentication frames, so that the user space logic would
429 * be able to receive/handle authentication frames from a
430 * different AP as part of PASN.
431 * It is expected that user space would intelligently register
432 * for Rx authentication frames, i.e., only when PASN is used
433 * and configure a match filter only for PASN authentication
434 * algorithm, as otherwise the MLME functionality of mac80211
435 * would be broken.
436 */
425 .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |437 .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
438 BIT(IEEE80211_STYPE_AUTH >> 4) |
426 BIT(IEEE80211_STYPE_PROBE_REQ >> 4),439 BIT(IEEE80211_STYPE_PROBE_REQ >> 4),
427 },440 },
428 [NL80211_IFTYPE_AP] = {441 [NL80211_IFTYPE_AP] = {
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 7791e4d..b929cb4 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2480,8 +2480,8 @@ void ieee80211_mlme_send_probe_req(struct ieee80211_sub_if_data *sdata,
2480{2480{
2481 struct sk_buff *skb;2481 struct sk_buff *skb;
24822482
2483 skb = ieee80211_build_probe_req(sdata, src, dst, (u32)-1, channel,2483 skb = ieee80211_build_probe_req(sdata, src, dst, dst, (u32)-1,
2484 ssid, ssid_len, NULL, 0,2484 channel, ssid, ssid_len, NULL, 0,
2485 IEEE80211_PROBE_FLAG_DIRECTED);2485 IEEE80211_PROBE_FLAG_DIRECTED);
2486 if (skb)2486 if (skb)
2487 ieee80211_tx_skb(sdata, skb);2487 ieee80211_tx_skb(sdata, skb);
@@ -2635,7 +2635,7 @@ struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw,
2635 ssid_len = ssid[1];2635 ssid_len = ssid[1];
26362636
2637 skb = ieee80211_build_probe_req(sdata, sdata->vif.addr, cbss->bssid,2637 skb = ieee80211_build_probe_req(sdata, sdata->vif.addr, cbss->bssid,
2638 (u32) -1, cbss->channel,2638 cbss->bssid, (u32)-1, cbss->channel,
2639 ssid + 2, ssid_len,2639 ssid + 2, ssid_len,
2640 NULL, 0, IEEE80211_PROBE_FLAG_DIRECTED);2640 NULL, 0, IEEE80211_PROBE_FLAG_DIRECTED);
2641 rcu_read_unlock();2641 rcu_read_unlock();
@@ -5308,7 +5308,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
5308 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;5308 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
5309 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;5309 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
5310 netdev_info(sdata->dev,5310 netdev_info(sdata->dev,
5311 "disabling HE/HT/VHT due to WEP/TKIP use\n");5311 "disabling HT/VHT/HE due to WEP/TKIP use\n");
5312 }5312 }
5313 }5313 }
53145314
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 565bc1e..57ba759 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -565,9 +565,8 @@ static void ieee80211_send_scan_probe_req(struct ieee80211_sub_if_data *sdata,
565 struct sk_buff *skb;565 struct sk_buff *skb;
566 u32 txdata_flags = 0;566 u32 txdata_flags = 0;
567567
568 skb = ieee80211_build_probe_req(sdata, src, dst, ratemask, channel,568 skb = ieee80211_build_probe_req(sdata, src, dst, dst, ratemask, channel,
569 ssid, ssid_len,569 ssid, ssid_len, ie, ie_len, flags);
570 ie, ie_len, flags);
571570
572 if (skb) {571 if (skb) {
573 if (flags & IEEE80211_PROBE_FLAG_RANDOM_SN) {572 if (flags & IEEE80211_PROBE_FLAG_RANDOM_SN) {
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index c8f6405..2a4515c 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1857,7 +1857,7 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
18571857
1858struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,1858struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1859 const u8 *src, const u8 *dst,1859 const u8 *src, const u8 *dst,
1860 u32 ratemask,1860 const u8 *bssid, u32 ratemask,
1861 struct ieee80211_channel *chan,1861 struct ieee80211_channel *chan,
1862 const u8 *ssid, size_t ssid_len,1862 const u8 *ssid, size_t ssid_len,
1863 const u8 *ie, size_t ie_len,1863 const u8 *ie, size_t ie_len,
@@ -1894,11 +1894,12 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1894 rate_masks, &chandef, flags);1894 rate_masks, &chandef, flags);
1895 skb_put(skb, ies_len);1895 skb_put(skb, ies_len);
18961896
1897 if (dst) {1897 mgmt = (void *)skb->data;
1898 mgmt = (struct ieee80211_mgmt *) skb->data;1898 if (dst)
1899 memcpy(mgmt->da, dst, ETH_ALEN);1899 memcpy(mgmt->da, dst, ETH_ALEN);
1900 memcpy(mgmt->bssid, dst, ETH_ALEN);1900
1901 }1901 if (bssid)
1902 memcpy(mgmt->bssid, bssid, ETH_ALEN);
19021903
1903 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;1904 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
19041905
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index a3547aa..98b8f96 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -248,15 +248,13 @@ nl80211_pmsr_ftm_req_attr_policy[NL80211_PMSR_FTM_REQ_ATTR_MAX + 1] = {
248static const struct nla_policy248static const struct nla_policy
249nl80211_pmsr_req_data_policy[NL80211_PMSR_TYPE_MAX + 1] = {249nl80211_pmsr_req_data_policy[NL80211_PMSR_TYPE_MAX + 1] = {
250 [NL80211_PMSR_TYPE_FTM] =250 [NL80211_PMSR_TYPE_FTM] =
251 NLA_POLICY_NESTED(NL80211_PMSR_FTM_REQ_ATTR_MAX,251 NLA_POLICY_NESTED(nl80211_pmsr_ftm_req_attr_policy),
252 nl80211_pmsr_ftm_req_attr_policy),
253};252};
254253
255static const struct nla_policy254static const struct nla_policy
256nl80211_pmsr_req_attr_policy[NL80211_PMSR_REQ_ATTR_MAX + 1] = {255nl80211_pmsr_req_attr_policy[NL80211_PMSR_REQ_ATTR_MAX + 1] = {
257 [NL80211_PMSR_REQ_ATTR_DATA] =256 [NL80211_PMSR_REQ_ATTR_DATA] =
258 NLA_POLICY_NESTED(NL80211_PMSR_TYPE_MAX,257 NLA_POLICY_NESTED(nl80211_pmsr_req_data_policy),
259 nl80211_pmsr_req_data_policy),
260 [NL80211_PMSR_REQ_ATTR_GET_AP_TSF] = { .type = NLA_FLAG },258 [NL80211_PMSR_REQ_ATTR_GET_AP_TSF] = { .type = NLA_FLAG },
261};259};
262260
@@ -269,8 +267,7 @@ nl80211_psmr_peer_attr_policy[NL80211_PMSR_PEER_ATTR_MAX + 1] = {
269 */267 */
270 [NL80211_PMSR_PEER_ATTR_CHAN] = { .type = NLA_NESTED },268 [NL80211_PMSR_PEER_ATTR_CHAN] = { .type = NLA_NESTED },
271 [NL80211_PMSR_PEER_ATTR_REQ] =269 [NL80211_PMSR_PEER_ATTR_REQ] =
272 NLA_POLICY_NESTED(NL80211_PMSR_REQ_ATTR_MAX,270 NLA_POLICY_NESTED(nl80211_pmsr_req_attr_policy),
273 nl80211_pmsr_req_attr_policy),
274 [NL80211_PMSR_PEER_ATTR_RESP] = { .type = NLA_REJECT },271 [NL80211_PMSR_PEER_ATTR_RESP] = { .type = NLA_REJECT },
275};272};
276273
@@ -281,8 +278,7 @@ nl80211_pmsr_attr_policy[NL80211_PMSR_ATTR_MAX + 1] = {
281 [NL80211_PMSR_ATTR_RANDOMIZE_MAC_ADDR] = { .type = NLA_REJECT },278 [NL80211_PMSR_ATTR_RANDOMIZE_MAC_ADDR] = { .type = NLA_REJECT },
282 [NL80211_PMSR_ATTR_TYPE_CAPA] = { .type = NLA_REJECT },279 [NL80211_PMSR_ATTR_TYPE_CAPA] = { .type = NLA_REJECT },
283 [NL80211_PMSR_ATTR_PEERS] =280 [NL80211_PMSR_ATTR_PEERS] =
284 NLA_POLICY_NESTED_ARRAY(NL80211_PMSR_PEER_ATTR_MAX,281 NLA_POLICY_NESTED_ARRAY(nl80211_psmr_peer_attr_policy),
285 nl80211_psmr_peer_attr_policy),
286};282};
287283
288const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {284const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
@@ -543,8 +539,7 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
543 },539 },
544 [NL80211_ATTR_TIMEOUT] = NLA_POLICY_MIN(NLA_U32, 1),540 [NL80211_ATTR_TIMEOUT] = NLA_POLICY_MIN(NLA_U32, 1),
545 [NL80211_ATTR_PEER_MEASUREMENTS] =541 [NL80211_ATTR_PEER_MEASUREMENTS] =
546 NLA_POLICY_NESTED(NL80211_PMSR_FTM_REQ_ATTR_MAX,542 NLA_POLICY_NESTED(nl80211_pmsr_attr_policy),
547 nl80211_pmsr_attr_policy),
548543
549 [NL80211_ATTR_NAN_CDW_2G] = { .type = NLA_U8 },544 [NL80211_ATTR_NAN_CDW_2G] = { .type = NLA_U8 },
550 [NL80211_ATTR_NAN_CDW_5G] = { .type = NLA_U8 },545 [NL80211_ATTR_NAN_CDW_5G] = { .type = NLA_U8 },
@@ -13645,66 +13640,90 @@ static void nl80211_post_doit(__genl_const struct genl_ops *ops,
13645static __genl_const struct genl_ops nl80211_ops[] = {13640static __genl_const struct genl_ops nl80211_ops[] = {
13646 {13641 {
13647 .cmd = NL80211_CMD_GET_WIPHY,13642 .cmd = NL80211_CMD_GET_WIPHY,
13643#if LINUX_VERSION_IS_GEQ(5,2,0)
13644 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13645#endif
13646
13648 .doit = nl80211_get_wiphy,13647 .doit = nl80211_get_wiphy,
13649 .dumpit = nl80211_dump_wiphy,13648 .dumpit = nl80211_dump_wiphy,
13650 .done = nl80211_dump_wiphy_done,13649 .done = nl80211_dump_wiphy_done,
13651 .policy = nl80211_policy,
13652 /* can be retrieved by unprivileged users */13650 /* can be retrieved by unprivileged users */
13653 .internal_flags = NL80211_FLAG_NEED_WIPHY |13651 .internal_flags = NL80211_FLAG_NEED_WIPHY |
13654 NL80211_FLAG_NEED_RTNL,13652 NL80211_FLAG_NEED_RTNL,
13655 },13653 },
13656 {13654 {
13657 .cmd = NL80211_CMD_SET_WIPHY,13655 .cmd = NL80211_CMD_SET_WIPHY,
13656#if LINUX_VERSION_IS_GEQ(5,2,0)
13657 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13658#endif
13659
13658 .doit = nl80211_set_wiphy,13660 .doit = nl80211_set_wiphy,
13659 .policy = nl80211_policy,
13660 .flags = GENL_UNS_ADMIN_PERM,13661 .flags = GENL_UNS_ADMIN_PERM,
13661 .internal_flags = NL80211_FLAG_NEED_RTNL,13662 .internal_flags = NL80211_FLAG_NEED_RTNL,
13662 },13663 },
13663 {13664 {
13664 .cmd = NL80211_CMD_GET_INTERFACE,13665 .cmd = NL80211_CMD_GET_INTERFACE,
13666#if LINUX_VERSION_IS_GEQ(5,2,0)
13667 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13668#endif
13669
13665 .doit = nl80211_get_interface,13670 .doit = nl80211_get_interface,
13666 .dumpit = nl80211_dump_interface,13671 .dumpit = nl80211_dump_interface,
13667 .policy = nl80211_policy,
13668 /* can be retrieved by unprivileged users */13672 /* can be retrieved by unprivileged users */
13669 .internal_flags = NL80211_FLAG_NEED_WDEV |13673 .internal_flags = NL80211_FLAG_NEED_WDEV |
13670 NL80211_FLAG_NEED_RTNL,13674 NL80211_FLAG_NEED_RTNL,
13671 },13675 },
13672 {13676 {
13673 .cmd = NL80211_CMD_SET_INTERFACE,13677 .cmd = NL80211_CMD_SET_INTERFACE,
13678#if LINUX_VERSION_IS_GEQ(5,2,0)
13679 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13680#endif
13681
13674 .doit = nl80211_set_interface,13682 .doit = nl80211_set_interface,
13675 .policy = nl80211_policy,
13676 .flags = GENL_UNS_ADMIN_PERM,13683 .flags = GENL_UNS_ADMIN_PERM,
13677 .internal_flags = NL80211_FLAG_NEED_NETDEV |13684 .internal_flags = NL80211_FLAG_NEED_NETDEV |
13678 NL80211_FLAG_NEED_RTNL,13685 NL80211_FLAG_NEED_RTNL,
13679 },13686 },
13680 {13687 {
13681 .cmd = NL80211_CMD_NEW_INTERFACE,13688 .cmd = NL80211_CMD_NEW_INTERFACE,
13689#if LINUX_VERSION_IS_GEQ(5,2,0)
13690 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13691#endif
13692
13682 .doit = nl80211_new_interface,13693 .doit = nl80211_new_interface,
13683 .policy = nl80211_policy,
13684 .flags = GENL_UNS_ADMIN_PERM,13694 .flags = GENL_UNS_ADMIN_PERM,
13685 .internal_flags = NL80211_FLAG_NEED_WIPHY |13695 .internal_flags = NL80211_FLAG_NEED_WIPHY |
13686 NL80211_FLAG_NEED_RTNL,13696 NL80211_FLAG_NEED_RTNL,
13687 },13697 },
13688 {13698 {
13689 .cmd = NL80211_CMD_DEL_INTERFACE,13699 .cmd = NL80211_CMD_DEL_INTERFACE,
13700#if LINUX_VERSION_IS_GEQ(5,2,0)
13701 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13702#endif
13703
13690 .doit = nl80211_del_interface,13704 .doit = nl80211_del_interface,
13691 .policy = nl80211_policy,
13692 .flags = GENL_UNS_ADMIN_PERM,13705 .flags = GENL_UNS_ADMIN_PERM,
13693 .internal_flags = NL80211_FLAG_NEED_WDEV |13706 .internal_flags = NL80211_FLAG_NEED_WDEV |
13694 NL80211_FLAG_NEED_RTNL,13707 NL80211_FLAG_NEED_RTNL,
13695 },13708 },
13696 {13709 {
13697 .cmd = NL80211_CMD_GET_KEY,13710 .cmd = NL80211_CMD_GET_KEY,
13711#if LINUX_VERSION_IS_GEQ(5,2,0)
13712 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13713#endif
13714
13698 .doit = nl80211_get_key,13715 .doit = nl80211_get_key,
13699 .policy = nl80211_policy,
13700 .flags = GENL_UNS_ADMIN_PERM,13716 .flags = GENL_UNS_ADMIN_PERM,
13701 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |13717 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13702 NL80211_FLAG_NEED_RTNL,13718 NL80211_FLAG_NEED_RTNL,
13703 },13719 },
13704 {13720 {
13705 .cmd = NL80211_CMD_SET_KEY,13721 .cmd = NL80211_CMD_SET_KEY,
13722#if LINUX_VERSION_IS_GEQ(5,2,0)
13723 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13724#endif
13725
13706 .doit = nl80211_set_key,13726 .doit = nl80211_set_key,
13707 .policy = nl80211_policy,
13708 .flags = GENL_UNS_ADMIN_PERM,13727 .flags = GENL_UNS_ADMIN_PERM,
13709 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |13728 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13710 NL80211_FLAG_NEED_RTNL |13729 NL80211_FLAG_NEED_RTNL |
@@ -13712,8 +13731,11 @@ static __genl_const struct genl_ops nl80211_ops[] = {
13712 },13731 },
13713 {13732 {
13714 .cmd = NL80211_CMD_NEW_KEY,13733 .cmd = NL80211_CMD_NEW_KEY,
13734#if LINUX_VERSION_IS_GEQ(5,2,0)
13735 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13736#endif
13737
13715 .doit = nl80211_new_key,13738 .doit = nl80211_new_key,
13716 .policy = nl80211_policy,
13717 .flags = GENL_UNS_ADMIN_PERM,13739 .flags = GENL_UNS_ADMIN_PERM,
13718 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |13740 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13719 NL80211_FLAG_NEED_RTNL |13741 NL80211_FLAG_NEED_RTNL |
@@ -13721,15 +13743,21 @@ static __genl_const struct genl_ops nl80211_ops[] = {
13721 },13743 },
13722 {13744 {
13723 .cmd = NL80211_CMD_DEL_KEY,13745 .cmd = NL80211_CMD_DEL_KEY,
13746#if LINUX_VERSION_IS_GEQ(5,2,0)
13747 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13748#endif
13749
13724 .doit = nl80211_del_key,13750 .doit = nl80211_del_key,
13725 .policy = nl80211_policy,
13726 .flags = GENL_UNS_ADMIN_PERM,13751 .flags = GENL_UNS_ADMIN_PERM,
13727 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |13752 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13728 NL80211_FLAG_NEED_RTNL,13753 NL80211_FLAG_NEED_RTNL,
13729 },13754 },
13730 {13755 {
13731 .cmd = NL80211_CMD_SET_BEACON,13756 .cmd = NL80211_CMD_SET_BEACON,
13732 .policy = nl80211_policy,13757#if LINUX_VERSION_IS_GEQ(5,2,0)
13758 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13759#endif
13760
13733 .flags = GENL_UNS_ADMIN_PERM,13761 .flags = GENL_UNS_ADMIN_PERM,
13734 .doit = nl80211_set_beacon,13762 .doit = nl80211_set_beacon,
13735 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |13763 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
@@ -13737,7 +13765,10 @@ static __genl_const struct genl_ops nl80211_ops[] = {
13737 },13765 },
13738 {13766 {
13739 .cmd = NL80211_CMD_START_AP,13767 .cmd = NL80211_CMD_START_AP,
13740 .policy = nl80211_policy,13768#if LINUX_VERSION_IS_GEQ(5,2,0)
13769 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13770#endif
13771
13741 .flags = GENL_UNS_ADMIN_PERM,13772 .flags = GENL_UNS_ADMIN_PERM,
13742 .doit = nl80211_start_ap,13773 .doit = nl80211_start_ap,
13743 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |13774 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
@@ -13745,7 +13776,10 @@ static __genl_const struct genl_ops nl80211_ops[] = {
13745 },13776 },
13746 {13777 {
13747 .cmd = NL80211_CMD_STOP_AP,13778 .cmd = NL80211_CMD_STOP_AP,
13748 .policy = nl80211_policy,13779#if LINUX_VERSION_IS_GEQ(5,2,0)
13780 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13781#endif
13782
13749 .flags = GENL_UNS_ADMIN_PERM,13783 .flags = GENL_UNS_ADMIN_PERM,
13750 .doit = nl80211_stop_ap,13784 .doit = nl80211_stop_ap,
13751 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |13785 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
@@ -13753,172 +13787,238 @@ static __genl_const struct genl_ops nl80211_ops[] = {
13753 },13787 },
13754 {13788 {
13755 .cmd = NL80211_CMD_GET_STATION,13789 .cmd = NL80211_CMD_GET_STATION,
13790#if LINUX_VERSION_IS_GEQ(5,2,0)
13791 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13792#endif
13793
13756 .doit = nl80211_get_station,13794 .doit = nl80211_get_station,
13757 .dumpit = nl80211_dump_station,13795 .dumpit = nl80211_dump_station,
13758 .policy = nl80211_policy,
13759 .internal_flags = NL80211_FLAG_NEED_NETDEV |13796 .internal_flags = NL80211_FLAG_NEED_NETDEV |
13760 NL80211_FLAG_NEED_RTNL,13797 NL80211_FLAG_NEED_RTNL,
13761 },13798 },
13762 {13799 {
13763 .cmd = NL80211_CMD_SET_STATION,13800 .cmd = NL80211_CMD_SET_STATION,
13801#if LINUX_VERSION_IS_GEQ(5,2,0)
13802 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13803#endif
13804
13764 .doit = nl80211_set_station,13805 .doit = nl80211_set_station,
13765 .policy = nl80211_policy,
13766 .flags = GENL_UNS_ADMIN_PERM,13806 .flags = GENL_UNS_ADMIN_PERM,
13767 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |13807 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13768 NL80211_FLAG_NEED_RTNL,13808 NL80211_FLAG_NEED_RTNL,
13769 },13809 },
13770 {13810 {
13771 .cmd = NL80211_CMD_NEW_STATION,13811 .cmd = NL80211_CMD_NEW_STATION,
13812#if LINUX_VERSION_IS_GEQ(5,2,0)
13813 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13814#endif
13815
13772 .doit = nl80211_new_station,13816 .doit = nl80211_new_station,
13773 .policy = nl80211_policy,
13774 .flags = GENL_UNS_ADMIN_PERM,13817 .flags = GENL_UNS_ADMIN_PERM,
13775 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |13818 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13776 NL80211_FLAG_NEED_RTNL,13819 NL80211_FLAG_NEED_RTNL,
13777 },13820 },
13778 {13821 {
13779 .cmd = NL80211_CMD_DEL_STATION,13822 .cmd = NL80211_CMD_DEL_STATION,
13823#if LINUX_VERSION_IS_GEQ(5,2,0)
13824 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13825#endif
13826
13780 .doit = nl80211_del_station,13827 .doit = nl80211_del_station,
13781 .policy = nl80211_policy,
13782 .flags = GENL_UNS_ADMIN_PERM,13828 .flags = GENL_UNS_ADMIN_PERM,
13783 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |13829 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13784 NL80211_FLAG_NEED_RTNL,13830 NL80211_FLAG_NEED_RTNL,
13785 },13831 },
13786 {13832 {
13787 .cmd = NL80211_CMD_GET_MPATH,13833 .cmd = NL80211_CMD_GET_MPATH,
13834#if LINUX_VERSION_IS_GEQ(5,2,0)
13835 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13836#endif
13837
13788 .doit = nl80211_get_mpath,13838 .doit = nl80211_get_mpath,
13789 .dumpit = nl80211_dump_mpath,13839 .dumpit = nl80211_dump_mpath,
13790 .policy = nl80211_policy,
13791 .flags = GENL_UNS_ADMIN_PERM,13840 .flags = GENL_UNS_ADMIN_PERM,
13792 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |13841 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13793 NL80211_FLAG_NEED_RTNL,13842 NL80211_FLAG_NEED_RTNL,
13794 },13843 },
13795 {13844 {
13796 .cmd = NL80211_CMD_GET_MPP,13845 .cmd = NL80211_CMD_GET_MPP,
13846#if LINUX_VERSION_IS_GEQ(5,2,0)
13847 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13848#endif
13849
13797 .doit = nl80211_get_mpp,13850 .doit = nl80211_get_mpp,
13798 .dumpit = nl80211_dump_mpp,13851 .dumpit = nl80211_dump_mpp,
13799 .policy = nl80211_policy,
13800 .flags = GENL_UNS_ADMIN_PERM,13852 .flags = GENL_UNS_ADMIN_PERM,
13801 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |13853 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13802 NL80211_FLAG_NEED_RTNL,13854 NL80211_FLAG_NEED_RTNL,
13803 },13855 },
13804 {13856 {
13805 .cmd = NL80211_CMD_SET_MPATH,13857 .cmd = NL80211_CMD_SET_MPATH,
13858#if LINUX_VERSION_IS_GEQ(5,2,0)
13859 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13860#endif
13861
13806 .doit = nl80211_set_mpath,13862 .doit = nl80211_set_mpath,
13807 .policy = nl80211_policy,
13808 .flags = GENL_UNS_ADMIN_PERM,13863 .flags = GENL_UNS_ADMIN_PERM,
13809 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |13864 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13810 NL80211_FLAG_NEED_RTNL,13865 NL80211_FLAG_NEED_RTNL,
13811 },13866 },
13812 {13867 {
13813 .cmd = NL80211_CMD_NEW_MPATH,13868 .cmd = NL80211_CMD_NEW_MPATH,
13869#if LINUX_VERSION_IS_GEQ(5,2,0)
13870 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13871#endif
13872
13814 .doit = nl80211_new_mpath,13873 .doit = nl80211_new_mpath,
13815 .policy = nl80211_policy,
13816 .flags = GENL_UNS_ADMIN_PERM,13874 .flags = GENL_UNS_ADMIN_PERM,
13817 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |13875 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13818 NL80211_FLAG_NEED_RTNL,13876 NL80211_FLAG_NEED_RTNL,
13819 },13877 },
13820 {13878 {
13821 .cmd = NL80211_CMD_DEL_MPATH,13879 .cmd = NL80211_CMD_DEL_MPATH,
13880#if LINUX_VERSION_IS_GEQ(5,2,0)
13881 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13882#endif
13883
13822 .doit = nl80211_del_mpath,13884 .doit = nl80211_del_mpath,
13823 .policy = nl80211_policy,
13824 .flags = GENL_UNS_ADMIN_PERM,13885 .flags = GENL_UNS_ADMIN_PERM,
13825 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |13886 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13826 NL80211_FLAG_NEED_RTNL,13887 NL80211_FLAG_NEED_RTNL,
13827 },13888 },
13828 {13889 {
13829 .cmd = NL80211_CMD_SET_BSS,13890 .cmd = NL80211_CMD_SET_BSS,
13891#if LINUX_VERSION_IS_GEQ(5,2,0)
13892 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13893#endif
13894
13830 .doit = nl80211_set_bss,13895 .doit = nl80211_set_bss,
13831 .policy = nl80211_policy,
13832 .flags = GENL_UNS_ADMIN_PERM,13896 .flags = GENL_UNS_ADMIN_PERM,
13833 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |13897 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13834 NL80211_FLAG_NEED_RTNL,13898 NL80211_FLAG_NEED_RTNL,
13835 },13899 },
13836 {13900 {
13837 .cmd = NL80211_CMD_GET_REG,13901 .cmd = NL80211_CMD_GET_REG,
13902#if LINUX_VERSION_IS_GEQ(5,2,0)
13903 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13904#endif
13905
13838 .doit = nl80211_get_reg_do,13906 .doit = nl80211_get_reg_do,
13839 .dumpit = nl80211_get_reg_dump,13907 .dumpit = nl80211_get_reg_dump,
13840 .policy = nl80211_policy,
13841 .internal_flags = NL80211_FLAG_NEED_RTNL,13908 .internal_flags = NL80211_FLAG_NEED_RTNL,
13842 /* can be retrieved by unprivileged users */13909 /* can be retrieved by unprivileged users */
13843 },13910 },
13844#ifdef CPTCFG_CFG80211_CRDA_SUPPORT13911#ifdef CPTCFG_CFG80211_CRDA_SUPPORT
13845 {13912 {
13846 .cmd = NL80211_CMD_SET_REG,13913 .cmd = NL80211_CMD_SET_REG,
13914#if LINUX_VERSION_IS_GEQ(5,2,0)
13915 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13916#endif
13917
13847 .doit = nl80211_set_reg,13918 .doit = nl80211_set_reg,
13848 .policy = nl80211_policy,
13849 .flags = GENL_ADMIN_PERM,13919 .flags = GENL_ADMIN_PERM,
13850 .internal_flags = NL80211_FLAG_NEED_RTNL,13920 .internal_flags = NL80211_FLAG_NEED_RTNL,
13851 },13921 },
13852#endif13922#endif
13853 {13923 {
13854 .cmd = NL80211_CMD_REQ_SET_REG,13924 .cmd = NL80211_CMD_REQ_SET_REG,
13925#if LINUX_VERSION_IS_GEQ(5,2,0)
13926 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13927#endif
13928
13855 .doit = nl80211_req_set_reg,13929 .doit = nl80211_req_set_reg,
13856 .policy = nl80211_policy,
13857 .flags = GENL_ADMIN_PERM,13930 .flags = GENL_ADMIN_PERM,
13858 },13931 },
13859 {13932 {
13860 .cmd = NL80211_CMD_RELOAD_REGDB,13933 .cmd = NL80211_CMD_RELOAD_REGDB,
13934#if LINUX_VERSION_IS_GEQ(5,2,0)
13935 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13936#endif
13937
13861 .doit = nl80211_reload_regdb,13938 .doit = nl80211_reload_regdb,
13862 .policy = nl80211_policy,
13863 .flags = GENL_ADMIN_PERM,13939 .flags = GENL_ADMIN_PERM,
13864 },13940 },
13865 {13941 {
13866 .cmd = NL80211_CMD_GET_MESH_CONFIG,13942 .cmd = NL80211_CMD_GET_MESH_CONFIG,
13943#if LINUX_VERSION_IS_GEQ(5,2,0)
13944 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13945#endif
13946
13867 .doit = nl80211_get_mesh_config,13947 .doit = nl80211_get_mesh_config,
13868 .policy = nl80211_policy,
13869 /* can be retrieved by unprivileged users */13948 /* can be retrieved by unprivileged users */
13870 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |13949 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13871 NL80211_FLAG_NEED_RTNL,13950 NL80211_FLAG_NEED_RTNL,
13872 },13951 },
13873 {13952 {
13874 .cmd = NL80211_CMD_SET_MESH_CONFIG,13953 .cmd = NL80211_CMD_SET_MESH_CONFIG,
13954#if LINUX_VERSION_IS_GEQ(5,2,0)
13955 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13956#endif
13957
13875 .doit = nl80211_update_mesh_config,13958 .doit = nl80211_update_mesh_config,
13876 .policy = nl80211_policy,
13877 .flags = GENL_UNS_ADMIN_PERM,13959 .flags = GENL_UNS_ADMIN_PERM,
13878 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |13960 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13879 NL80211_FLAG_NEED_RTNL,13961 NL80211_FLAG_NEED_RTNL,
13880 },13962 },
13881 {13963 {
13882 .cmd = NL80211_CMD_TRIGGER_SCAN,13964 .cmd = NL80211_CMD_TRIGGER_SCAN,
13965#if LINUX_VERSION_IS_GEQ(5,2,0)
13966 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13967#endif
13968
13883 .doit = nl80211_trigger_scan,13969 .doit = nl80211_trigger_scan,
13884 .policy = nl80211_policy,
13885 .flags = GENL_UNS_ADMIN_PERM,13970 .flags = GENL_UNS_ADMIN_PERM,
13886 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |13971 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |
13887 NL80211_FLAG_NEED_RTNL,13972 NL80211_FLAG_NEED_RTNL,
13888 },13973 },
13889 {13974 {
13890 .cmd = NL80211_CMD_ABORT_SCAN,13975 .cmd = NL80211_CMD_ABORT_SCAN,
13976#if LINUX_VERSION_IS_GEQ(5,2,0)
13977 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13978#endif
13979
13891 .doit = nl80211_abort_scan,13980 .doit = nl80211_abort_scan,
13892 .policy = nl80211_policy,
13893 .flags = GENL_UNS_ADMIN_PERM,13981 .flags = GENL_UNS_ADMIN_PERM,
13894 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |13982 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |
13895 NL80211_FLAG_NEED_RTNL,13983 NL80211_FLAG_NEED_RTNL,
13896 },13984 },
13897 {13985 {
13898 .cmd = NL80211_CMD_GET_SCAN,13986 .cmd = NL80211_CMD_GET_SCAN,
13899 .policy = nl80211_policy,13987#if LINUX_VERSION_IS_GEQ(5,2,0)
13988 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13989#endif
13990
13900 .dumpit = nl80211_dump_scan,13991 .dumpit = nl80211_dump_scan,
13901 },13992 },
13902 {13993 {
13903 .cmd = NL80211_CMD_START_SCHED_SCAN,13994 .cmd = NL80211_CMD_START_SCHED_SCAN,
13995#if LINUX_VERSION_IS_GEQ(5,2,0)
13996 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
13997#endif
13998
13904 .doit = nl80211_start_sched_scan,13999 .doit = nl80211_start_sched_scan,
13905 .policy = nl80211_policy,
13906 .flags = GENL_UNS_ADMIN_PERM,14000 .flags = GENL_UNS_ADMIN_PERM,
13907 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14001 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13908 NL80211_FLAG_NEED_RTNL,14002 NL80211_FLAG_NEED_RTNL,
13909 },14003 },
13910 {14004 {
13911 .cmd = NL80211_CMD_STOP_SCHED_SCAN,14005 .cmd = NL80211_CMD_STOP_SCHED_SCAN,
14006#if LINUX_VERSION_IS_GEQ(5,2,0)
14007 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14008#endif
14009
13912 .doit = nl80211_stop_sched_scan,14010 .doit = nl80211_stop_sched_scan,
13913 .policy = nl80211_policy,
13914 .flags = GENL_UNS_ADMIN_PERM,14011 .flags = GENL_UNS_ADMIN_PERM,
13915 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14012 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13916 NL80211_FLAG_NEED_RTNL,14013 NL80211_FLAG_NEED_RTNL,
13917 },14014 },
13918 {14015 {
13919 .cmd = NL80211_CMD_AUTHENTICATE,14016 .cmd = NL80211_CMD_AUTHENTICATE,
14017#if LINUX_VERSION_IS_GEQ(5,2,0)
14018 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14019#endif
14020
13920 .doit = nl80211_authenticate,14021 .doit = nl80211_authenticate,
13921 .policy = nl80211_policy,
13922 .flags = GENL_UNS_ADMIN_PERM,14022 .flags = GENL_UNS_ADMIN_PERM,
13923 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14023 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13924 NL80211_FLAG_NEED_RTNL |14024 NL80211_FLAG_NEED_RTNL |
@@ -13926,40 +14026,55 @@ static __genl_const struct genl_ops nl80211_ops[] = {
13926 },14026 },
13927 {14027 {
13928 .cmd = NL80211_CMD_ASSOCIATE,14028 .cmd = NL80211_CMD_ASSOCIATE,
14029#if LINUX_VERSION_IS_GEQ(5,2,0)
14030 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14031#endif
14032
13929 .doit = nl80211_associate,14033 .doit = nl80211_associate,
13930 .policy = nl80211_policy,
13931 .flags = GENL_UNS_ADMIN_PERM,14034 .flags = GENL_UNS_ADMIN_PERM,
13932 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14035 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13933 NL80211_FLAG_NEED_RTNL,14036 NL80211_FLAG_NEED_RTNL,
13934 },14037 },
13935 {14038 {
13936 .cmd = NL80211_CMD_DEAUTHENTICATE,14039 .cmd = NL80211_CMD_DEAUTHENTICATE,
14040#if LINUX_VERSION_IS_GEQ(5,2,0)
14041 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14042#endif
14043
13937 .doit = nl80211_deauthenticate,14044 .doit = nl80211_deauthenticate,
13938 .policy = nl80211_policy,
13939 .flags = GENL_UNS_ADMIN_PERM,14045 .flags = GENL_UNS_ADMIN_PERM,
13940 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14046 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13941 NL80211_FLAG_NEED_RTNL,14047 NL80211_FLAG_NEED_RTNL,
13942 },14048 },
13943 {14049 {
13944 .cmd = NL80211_CMD_DISASSOCIATE,14050 .cmd = NL80211_CMD_DISASSOCIATE,
14051#if LINUX_VERSION_IS_GEQ(5,2,0)
14052 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14053#endif
14054
13945 .doit = nl80211_disassociate,14055 .doit = nl80211_disassociate,
13946 .policy = nl80211_policy,
13947 .flags = GENL_UNS_ADMIN_PERM,14056 .flags = GENL_UNS_ADMIN_PERM,
13948 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14057 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13949 NL80211_FLAG_NEED_RTNL,14058 NL80211_FLAG_NEED_RTNL,
13950 },14059 },
13951 {14060 {
13952 .cmd = NL80211_CMD_JOIN_IBSS,14061 .cmd = NL80211_CMD_JOIN_IBSS,
14062#if LINUX_VERSION_IS_GEQ(5,2,0)
14063 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14064#endif
14065
13953 .doit = nl80211_join_ibss,14066 .doit = nl80211_join_ibss,
13954 .policy = nl80211_policy,
13955 .flags = GENL_UNS_ADMIN_PERM,14067 .flags = GENL_UNS_ADMIN_PERM,
13956 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14068 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13957 NL80211_FLAG_NEED_RTNL,14069 NL80211_FLAG_NEED_RTNL,
13958 },14070 },
13959 {14071 {
13960 .cmd = NL80211_CMD_LEAVE_IBSS,14072 .cmd = NL80211_CMD_LEAVE_IBSS,
14073#if LINUX_VERSION_IS_GEQ(5,2,0)
14074 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14075#endif
14076
13961 .doit = nl80211_leave_ibss,14077 .doit = nl80211_leave_ibss,
13962 .policy = nl80211_policy,
13963 .flags = GENL_UNS_ADMIN_PERM,14078 .flags = GENL_UNS_ADMIN_PERM,
13964 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14079 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13965 NL80211_FLAG_NEED_RTNL,14080 NL80211_FLAG_NEED_RTNL,
@@ -13967,9 +14082,12 @@ static __genl_const struct genl_ops nl80211_ops[] = {
13967#ifdef CPTCFG_NL80211_TESTMODE14082#ifdef CPTCFG_NL80211_TESTMODE
13968 {14083 {
13969 .cmd = NL80211_CMD_TESTMODE,14084 .cmd = NL80211_CMD_TESTMODE,
14085#if LINUX_VERSION_IS_GEQ(5,2,0)
14086 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14087#endif
14088
13970 .doit = nl80211_testmode_do,14089 .doit = nl80211_testmode_do,
13971 .dumpit = nl80211_testmode_dump,14090 .dumpit = nl80211_testmode_dump,
13972 .policy = nl80211_policy,
13973 .flags = GENL_UNS_ADMIN_PERM,14091 .flags = GENL_UNS_ADMIN_PERM,
13974 .internal_flags = NL80211_FLAG_NEED_WIPHY |14092 .internal_flags = NL80211_FLAG_NEED_WIPHY |
13975 NL80211_FLAG_NEED_RTNL,14093 NL80211_FLAG_NEED_RTNL,
@@ -13977,181 +14095,250 @@ static __genl_const struct genl_ops nl80211_ops[] = {
13977#endif14095#endif
13978 {14096 {
13979 .cmd = NL80211_CMD_CONNECT,14097 .cmd = NL80211_CMD_CONNECT,
14098#if LINUX_VERSION_IS_GEQ(5,2,0)
14099 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14100#endif
14101
13980 .doit = nl80211_connect,14102 .doit = nl80211_connect,
13981 .policy = nl80211_policy,
13982 .flags = GENL_UNS_ADMIN_PERM,14103 .flags = GENL_UNS_ADMIN_PERM,
13983 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14104 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13984 NL80211_FLAG_NEED_RTNL,14105 NL80211_FLAG_NEED_RTNL,
13985 },14106 },
13986 {14107 {
13987 .cmd = NL80211_CMD_UPDATE_CONNECT_PARAMS,14108 .cmd = NL80211_CMD_UPDATE_CONNECT_PARAMS,
14109#if LINUX_VERSION_IS_GEQ(5,2,0)
14110 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14111#endif
14112
13988 .doit = nl80211_update_connect_params,14113 .doit = nl80211_update_connect_params,
13989 .policy = nl80211_policy,
13990 .flags = GENL_ADMIN_PERM,14114 .flags = GENL_ADMIN_PERM,
13991 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14115 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
13992 NL80211_FLAG_NEED_RTNL,14116 NL80211_FLAG_NEED_RTNL,
13993 },14117 },
13994 {14118 {
13995 .cmd = NL80211_CMD_DISCONNECT,14119 .cmd = NL80211_CMD_DISCONNECT,
14120#if LINUX_VERSION_IS_GEQ(5,2,0)
14121 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14122#endif
14123
13996 .doit = nl80211_disconnect,14124 .doit = nl80211_disconnect,
13997 .policy = nl80211_policy,
13998 .flags = GENL_UNS_ADMIN_PERM,14125 .flags = GENL_UNS_ADMIN_PERM,
13999 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14126 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14000 NL80211_FLAG_NEED_RTNL,14127 NL80211_FLAG_NEED_RTNL,
14001 },14128 },
14002 {14129 {
14003 .cmd = NL80211_CMD_SET_WIPHY_NETNS,14130 .cmd = NL80211_CMD_SET_WIPHY_NETNS,
14131#if LINUX_VERSION_IS_GEQ(5,2,0)
14132 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14133#endif
14134
14004 .doit = nl80211_wiphy_netns,14135 .doit = nl80211_wiphy_netns,
14005 .policy = nl80211_policy,
14006 .flags = GENL_UNS_ADMIN_PERM,14136 .flags = GENL_UNS_ADMIN_PERM,
14007 .internal_flags = NL80211_FLAG_NEED_WIPHY |14137 .internal_flags = NL80211_FLAG_NEED_WIPHY |
14008 NL80211_FLAG_NEED_RTNL,14138 NL80211_FLAG_NEED_RTNL,
14009 },14139 },
14010 {14140 {
14011 .cmd = NL80211_CMD_GET_SURVEY,14141 .cmd = NL80211_CMD_GET_SURVEY,
14012 .policy = nl80211_policy,14142#if LINUX_VERSION_IS_GEQ(5,2,0)
14143 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14144#endif
14145
14013 .dumpit = nl80211_dump_survey,14146 .dumpit = nl80211_dump_survey,
14014 },14147 },
14015 {14148 {
14016 .cmd = NL80211_CMD_SET_PMKSA,14149 .cmd = NL80211_CMD_SET_PMKSA,
14150#if LINUX_VERSION_IS_GEQ(5,2,0)
14151 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14152#endif
14153
14017 .doit = nl80211_setdel_pmksa,14154 .doit = nl80211_setdel_pmksa,
14018 .policy = nl80211_policy,
14019 .flags = GENL_UNS_ADMIN_PERM,14155 .flags = GENL_UNS_ADMIN_PERM,
14020 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14156 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14021 NL80211_FLAG_NEED_RTNL,14157 NL80211_FLAG_NEED_RTNL,
14022 },14158 },
14023 {14159 {
14024 .cmd = NL80211_CMD_DEL_PMKSA,14160 .cmd = NL80211_CMD_DEL_PMKSA,
14161#if LINUX_VERSION_IS_GEQ(5,2,0)
14162 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14163#endif
14164
14025 .doit = nl80211_setdel_pmksa,14165 .doit = nl80211_setdel_pmksa,
14026 .policy = nl80211_policy,
14027 .flags = GENL_UNS_ADMIN_PERM,14166 .flags = GENL_UNS_ADMIN_PERM,
14028 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14167 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14029 NL80211_FLAG_NEED_RTNL,14168 NL80211_FLAG_NEED_RTNL,
14030 },14169 },
14031 {14170 {
14032 .cmd = NL80211_CMD_FLUSH_PMKSA,14171 .cmd = NL80211_CMD_FLUSH_PMKSA,
14172#if LINUX_VERSION_IS_GEQ(5,2,0)
14173 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14174#endif
14175
14033 .doit = nl80211_flush_pmksa,14176 .doit = nl80211_flush_pmksa,
14034 .policy = nl80211_policy,
14035 .flags = GENL_UNS_ADMIN_PERM,14177 .flags = GENL_UNS_ADMIN_PERM,
14036 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14178 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14037 NL80211_FLAG_NEED_RTNL,14179 NL80211_FLAG_NEED_RTNL,
14038 },14180 },
14039 {14181 {
14040 .cmd = NL80211_CMD_REMAIN_ON_CHANNEL,14182 .cmd = NL80211_CMD_REMAIN_ON_CHANNEL,
14183#if LINUX_VERSION_IS_GEQ(5,2,0)
14184 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14185#endif
14186
14041 .doit = nl80211_remain_on_channel,14187 .doit = nl80211_remain_on_channel,
14042 .policy = nl80211_policy,
14043 .flags = GENL_UNS_ADMIN_PERM,14188 .flags = GENL_UNS_ADMIN_PERM,
14044 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |14189 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |
14045 NL80211_FLAG_NEED_RTNL,14190 NL80211_FLAG_NEED_RTNL,
14046 },14191 },
14047 {14192 {
14048 .cmd = NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL,14193 .cmd = NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL,
14194#if LINUX_VERSION_IS_GEQ(5,2,0)
14195 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14196#endif
14197
14049 .doit = nl80211_cancel_remain_on_channel,14198 .doit = nl80211_cancel_remain_on_channel,
14050 .policy = nl80211_policy,
14051 .flags = GENL_UNS_ADMIN_PERM,14199 .flags = GENL_UNS_ADMIN_PERM,
14052 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |14200 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |
14053 NL80211_FLAG_NEED_RTNL,14201 NL80211_FLAG_NEED_RTNL,
14054 },14202 },
14055 {14203 {
14056 .cmd = NL80211_CMD_SET_TX_BITRATE_MASK,14204 .cmd = NL80211_CMD_SET_TX_BITRATE_MASK,
14205#if LINUX_VERSION_IS_GEQ(5,2,0)
14206 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14207#endif
14208
14057 .doit = nl80211_set_tx_bitrate_mask,14209 .doit = nl80211_set_tx_bitrate_mask,
14058 .policy = nl80211_policy,
14059 .flags = GENL_UNS_ADMIN_PERM,14210 .flags = GENL_UNS_ADMIN_PERM,
14060 .internal_flags = NL80211_FLAG_NEED_NETDEV |14211 .internal_flags = NL80211_FLAG_NEED_NETDEV |
14061 NL80211_FLAG_NEED_RTNL,14212 NL80211_FLAG_NEED_RTNL,
14062 },14213 },
14063 {14214 {
14064 .cmd = NL80211_CMD_REGISTER_FRAME,14215 .cmd = NL80211_CMD_REGISTER_FRAME,
14216#if LINUX_VERSION_IS_GEQ(5,2,0)
14217 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14218#endif
14219
14065 .doit = nl80211_register_mgmt,14220 .doit = nl80211_register_mgmt,
14066 .policy = nl80211_policy,
14067 .flags = GENL_UNS_ADMIN_PERM,14221 .flags = GENL_UNS_ADMIN_PERM,
14068 .internal_flags = NL80211_FLAG_NEED_WDEV |14222 .internal_flags = NL80211_FLAG_NEED_WDEV |
14069 NL80211_FLAG_NEED_RTNL,14223 NL80211_FLAG_NEED_RTNL,
14070 },14224 },
14071 {14225 {
14072 .cmd = NL80211_CMD_FRAME,14226 .cmd = NL80211_CMD_FRAME,
14227#if LINUX_VERSION_IS_GEQ(5,2,0)
14228 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14229#endif
14230
14073 .doit = nl80211_tx_mgmt,14231 .doit = nl80211_tx_mgmt,
14074 .policy = nl80211_policy,
14075 .flags = GENL_UNS_ADMIN_PERM,14232 .flags = GENL_UNS_ADMIN_PERM,
14076 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |14233 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |
14077 NL80211_FLAG_NEED_RTNL,14234 NL80211_FLAG_NEED_RTNL,
14078 },14235 },
14079 {14236 {
14080 .cmd = NL80211_CMD_FRAME_WAIT_CANCEL,14237 .cmd = NL80211_CMD_FRAME_WAIT_CANCEL,
14238#if LINUX_VERSION_IS_GEQ(5,2,0)
14239 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14240#endif
14241
14081 .doit = nl80211_tx_mgmt_cancel_wait,14242 .doit = nl80211_tx_mgmt_cancel_wait,
14082 .policy = nl80211_policy,
14083 .flags = GENL_UNS_ADMIN_PERM,14243 .flags = GENL_UNS_ADMIN_PERM,
14084 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |14244 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |
14085 NL80211_FLAG_NEED_RTNL,14245 NL80211_FLAG_NEED_RTNL,
14086 },14246 },
14087 {14247 {
14088 .cmd = NL80211_CMD_SET_POWER_SAVE,14248 .cmd = NL80211_CMD_SET_POWER_SAVE,
14249#if LINUX_VERSION_IS_GEQ(5,2,0)
14250 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14251#endif
14252
14089 .doit = nl80211_set_power_save,14253 .doit = nl80211_set_power_save,
14090 .policy = nl80211_policy,
14091 .flags = GENL_UNS_ADMIN_PERM,14254 .flags = GENL_UNS_ADMIN_PERM,
14092 .internal_flags = NL80211_FLAG_NEED_NETDEV |14255 .internal_flags = NL80211_FLAG_NEED_NETDEV |
14093 NL80211_FLAG_NEED_RTNL,14256 NL80211_FLAG_NEED_RTNL,
14094 },14257 },
14095 {14258 {
14096 .cmd = NL80211_CMD_GET_POWER_SAVE,14259 .cmd = NL80211_CMD_GET_POWER_SAVE,
14260#if LINUX_VERSION_IS_GEQ(5,2,0)
14261 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14262#endif
14263
14097 .doit = nl80211_get_power_save,14264 .doit = nl80211_get_power_save,
14098 .policy = nl80211_policy,
14099 /* can be retrieved by unprivileged users */14265 /* can be retrieved by unprivileged users */
14100 .internal_flags = NL80211_FLAG_NEED_NETDEV |14266 .internal_flags = NL80211_FLAG_NEED_NETDEV |
14101 NL80211_FLAG_NEED_RTNL,14267 NL80211_FLAG_NEED_RTNL,
14102 },14268 },
14103 {14269 {
14104 .cmd = NL80211_CMD_SET_CQM,14270 .cmd = NL80211_CMD_SET_CQM,
14271#if LINUX_VERSION_IS_GEQ(5,2,0)
14272 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14273#endif
14274
14105 .doit = nl80211_set_cqm,14275 .doit = nl80211_set_cqm,
14106 .policy = nl80211_policy,
14107 .flags = GENL_UNS_ADMIN_PERM,14276 .flags = GENL_UNS_ADMIN_PERM,
14108 .internal_flags = NL80211_FLAG_NEED_NETDEV |14277 .internal_flags = NL80211_FLAG_NEED_NETDEV |
14109 NL80211_FLAG_NEED_RTNL,14278 NL80211_FLAG_NEED_RTNL,
14110 },14279 },
14111 {14280 {
14112 .cmd = NL80211_CMD_SET_CHANNEL,14281 .cmd = NL80211_CMD_SET_CHANNEL,
14282#if LINUX_VERSION_IS_GEQ(5,2,0)
14283 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14284#endif
14285
14113 .doit = nl80211_set_channel,14286 .doit = nl80211_set_channel,
14114 .policy = nl80211_policy,
14115 .flags = GENL_UNS_ADMIN_PERM,14287 .flags = GENL_UNS_ADMIN_PERM,
14116 .internal_flags = NL80211_FLAG_NEED_NETDEV |14288 .internal_flags = NL80211_FLAG_NEED_NETDEV |
14117 NL80211_FLAG_NEED_RTNL,14289 NL80211_FLAG_NEED_RTNL,
14118 },14290 },
14119 {14291 {
14120 .cmd = NL80211_CMD_SET_WDS_PEER,14292 .cmd = NL80211_CMD_SET_WDS_PEER,
14293#if LINUX_VERSION_IS_GEQ(5,2,0)
14294 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14295#endif
14296
14121 .doit = nl80211_set_wds_peer,14297 .doit = nl80211_set_wds_peer,
14122 .policy = nl80211_policy,
14123 .flags = GENL_UNS_ADMIN_PERM,14298 .flags = GENL_UNS_ADMIN_PERM,
14124 .internal_flags = NL80211_FLAG_NEED_NETDEV |14299 .internal_flags = NL80211_FLAG_NEED_NETDEV |
14125 NL80211_FLAG_NEED_RTNL,14300 NL80211_FLAG_NEED_RTNL,
14126 },14301 },
14127 {14302 {
14128 .cmd = NL80211_CMD_JOIN_MESH,14303 .cmd = NL80211_CMD_JOIN_MESH,
14304#if LINUX_VERSION_IS_GEQ(5,2,0)
14305 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14306#endif
14307
14129 .doit = nl80211_join_mesh,14308 .doit = nl80211_join_mesh,
14130 .policy = nl80211_policy,
14131 .flags = GENL_UNS_ADMIN_PERM,14309 .flags = GENL_UNS_ADMIN_PERM,
14132 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14310 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14133 NL80211_FLAG_NEED_RTNL,14311 NL80211_FLAG_NEED_RTNL,
14134 },14312 },
14135 {14313 {
14136 .cmd = NL80211_CMD_LEAVE_MESH,14314 .cmd = NL80211_CMD_LEAVE_MESH,
14315#if LINUX_VERSION_IS_GEQ(5,2,0)
14316 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14317#endif
14318
14137 .doit = nl80211_leave_mesh,14319 .doit = nl80211_leave_mesh,
14138 .policy = nl80211_policy,
14139 .flags = GENL_UNS_ADMIN_PERM,14320 .flags = GENL_UNS_ADMIN_PERM,
14140 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14321 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14141 NL80211_FLAG_NEED_RTNL,14322 NL80211_FLAG_NEED_RTNL,
14142 },14323 },
14143 {14324 {
14144 .cmd = NL80211_CMD_JOIN_OCB,14325 .cmd = NL80211_CMD_JOIN_OCB,
14326#if LINUX_VERSION_IS_GEQ(5,2,0)
14327 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14328#endif
14329
14145 .doit = nl80211_join_ocb,14330 .doit = nl80211_join_ocb,
14146 .policy = nl80211_policy,
14147 .flags = GENL_UNS_ADMIN_PERM,14331 .flags = GENL_UNS_ADMIN_PERM,
14148 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14332 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14149 NL80211_FLAG_NEED_RTNL,14333 NL80211_FLAG_NEED_RTNL,
14150 },14334 },
14151 {14335 {
14152 .cmd = NL80211_CMD_LEAVE_OCB,14336 .cmd = NL80211_CMD_LEAVE_OCB,
14337#if LINUX_VERSION_IS_GEQ(5,2,0)
14338 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14339#endif
14340
14153 .doit = nl80211_leave_ocb,14341 .doit = nl80211_leave_ocb,
14154 .policy = nl80211_policy,
14155 .flags = GENL_UNS_ADMIN_PERM,14342 .flags = GENL_UNS_ADMIN_PERM,
14156 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14343 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14157 NL80211_FLAG_NEED_RTNL,14344 NL80211_FLAG_NEED_RTNL,
@@ -14159,16 +14346,22 @@ static __genl_const struct genl_ops nl80211_ops[] = {
14159#ifdef CONFIG_PM14346#ifdef CONFIG_PM
14160 {14347 {
14161 .cmd = NL80211_CMD_GET_WOWLAN,14348 .cmd = NL80211_CMD_GET_WOWLAN,
14349#if LINUX_VERSION_IS_GEQ(5,2,0)
14350 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14351#endif
14352
14162 .doit = nl80211_get_wowlan,14353 .doit = nl80211_get_wowlan,
14163 .policy = nl80211_policy,
14164 /* can be retrieved by unprivileged users */14354 /* can be retrieved by unprivileged users */
14165 .internal_flags = NL80211_FLAG_NEED_WIPHY |14355 .internal_flags = NL80211_FLAG_NEED_WIPHY |
14166 NL80211_FLAG_NEED_RTNL,14356 NL80211_FLAG_NEED_RTNL,
14167 },14357 },
14168 {14358 {
14169 .cmd = NL80211_CMD_SET_WOWLAN,14359 .cmd = NL80211_CMD_SET_WOWLAN,
14360#if LINUX_VERSION_IS_GEQ(5,2,0)
14361 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14362#endif
14363
14170 .doit = nl80211_set_wowlan,14364 .doit = nl80211_set_wowlan,
14171 .policy = nl80211_policy,
14172 .flags = GENL_UNS_ADMIN_PERM,14365 .flags = GENL_UNS_ADMIN_PERM,
14173 .internal_flags = NL80211_FLAG_NEED_WIPHY |14366 .internal_flags = NL80211_FLAG_NEED_WIPHY |
14174 NL80211_FLAG_NEED_RTNL,14367 NL80211_FLAG_NEED_RTNL,
@@ -14176,8 +14369,11 @@ static __genl_const struct genl_ops nl80211_ops[] = {
14176#endif14369#endif
14177 {14370 {
14178 .cmd = NL80211_CMD_SET_REKEY_OFFLOAD,14371 .cmd = NL80211_CMD_SET_REKEY_OFFLOAD,
14372#if LINUX_VERSION_IS_GEQ(5,2,0)
14373 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14374#endif
14375
14179 .doit = nl80211_set_rekey_data,14376 .doit = nl80211_set_rekey_data,
14180 .policy = nl80211_policy,
14181 .flags = GENL_UNS_ADMIN_PERM,14377 .flags = GENL_UNS_ADMIN_PERM,
14182 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14378 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14183 NL80211_FLAG_NEED_RTNL |14379 NL80211_FLAG_NEED_RTNL |
@@ -14185,290 +14381,401 @@ static __genl_const struct genl_ops nl80211_ops[] = {
14185 },14381 },
14186 {14382 {
14187 .cmd = NL80211_CMD_TDLS_MGMT,14383 .cmd = NL80211_CMD_TDLS_MGMT,
14384#if LINUX_VERSION_IS_GEQ(5,2,0)
14385 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14386#endif
14387
14188 .doit = nl80211_tdls_mgmt,14388 .doit = nl80211_tdls_mgmt,
14189 .policy = nl80211_policy,
14190 .flags = GENL_UNS_ADMIN_PERM,14389 .flags = GENL_UNS_ADMIN_PERM,
14191 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14390 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14192 NL80211_FLAG_NEED_RTNL,14391 NL80211_FLAG_NEED_RTNL,
14193 },14392 },
14194 {14393 {
14195 .cmd = NL80211_CMD_TDLS_OPER,14394 .cmd = NL80211_CMD_TDLS_OPER,
14395#if LINUX_VERSION_IS_GEQ(5,2,0)
14396 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14397#endif
14398
14196 .doit = nl80211_tdls_oper,14399 .doit = nl80211_tdls_oper,
14197 .policy = nl80211_policy,
14198 .flags = GENL_UNS_ADMIN_PERM,14400 .flags = GENL_UNS_ADMIN_PERM,
14199 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14401 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14200 NL80211_FLAG_NEED_RTNL,14402 NL80211_FLAG_NEED_RTNL,
14201 },14403 },
14202 {14404 {
14203 .cmd = NL80211_CMD_UNEXPECTED_FRAME,14405 .cmd = NL80211_CMD_UNEXPECTED_FRAME,
14406#if LINUX_VERSION_IS_GEQ(5,2,0)
14407 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14408#endif
14409
14204 .doit = nl80211_register_unexpected_frame,14410 .doit = nl80211_register_unexpected_frame,
14205 .policy = nl80211_policy,
14206 .flags = GENL_UNS_ADMIN_PERM,14411 .flags = GENL_UNS_ADMIN_PERM,
14207 .internal_flags = NL80211_FLAG_NEED_NETDEV |14412 .internal_flags = NL80211_FLAG_NEED_NETDEV |
14208 NL80211_FLAG_NEED_RTNL,14413 NL80211_FLAG_NEED_RTNL,
14209 },14414 },
14210 {14415 {
14211 .cmd = NL80211_CMD_PROBE_CLIENT,14416 .cmd = NL80211_CMD_PROBE_CLIENT,
14417#if LINUX_VERSION_IS_GEQ(5,2,0)
14418 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14419#endif
14420
14212 .doit = nl80211_probe_client,14421 .doit = nl80211_probe_client,
14213 .policy = nl80211_policy,
14214 .flags = GENL_UNS_ADMIN_PERM,14422 .flags = GENL_UNS_ADMIN_PERM,
14215 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14423 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14216 NL80211_FLAG_NEED_RTNL,14424 NL80211_FLAG_NEED_RTNL,
14217 },14425 },
14218 {14426 {
14219 .cmd = NL80211_CMD_REGISTER_BEACONS,14427 .cmd = NL80211_CMD_REGISTER_BEACONS,
14428#if LINUX_VERSION_IS_GEQ(5,2,0)
14429 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14430#endif
14431
14220 .doit = nl80211_register_beacons,14432 .doit = nl80211_register_beacons,
14221 .policy = nl80211_policy,
14222 .flags = GENL_UNS_ADMIN_PERM,14433 .flags = GENL_UNS_ADMIN_PERM,
14223 .internal_flags = NL80211_FLAG_NEED_WIPHY |14434 .internal_flags = NL80211_FLAG_NEED_WIPHY |
14224 NL80211_FLAG_NEED_RTNL,14435 NL80211_FLAG_NEED_RTNL,
14225 },14436 },
14226 {14437 {
14227 .cmd = NL80211_CMD_SET_NOACK_MAP,14438 .cmd = NL80211_CMD_SET_NOACK_MAP,
14439#if LINUX_VERSION_IS_GEQ(5,2,0)
14440 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14441#endif
14442
14228 .doit = nl80211_set_noack_map,14443 .doit = nl80211_set_noack_map,
14229 .policy = nl80211_policy,
14230 .flags = GENL_UNS_ADMIN_PERM,14444 .flags = GENL_UNS_ADMIN_PERM,
14231 .internal_flags = NL80211_FLAG_NEED_NETDEV |14445 .internal_flags = NL80211_FLAG_NEED_NETDEV |
14232 NL80211_FLAG_NEED_RTNL,14446 NL80211_FLAG_NEED_RTNL,
14233 },14447 },
14234 {14448 {
14235 .cmd = NL80211_CMD_START_P2P_DEVICE,14449 .cmd = NL80211_CMD_START_P2P_DEVICE,
14450#if LINUX_VERSION_IS_GEQ(5,2,0)
14451 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14452#endif
14453
14236 .doit = nl80211_start_p2p_device,14454 .doit = nl80211_start_p2p_device,
14237 .policy = nl80211_policy,
14238 .flags = GENL_UNS_ADMIN_PERM,14455 .flags = GENL_UNS_ADMIN_PERM,
14239 .internal_flags = NL80211_FLAG_NEED_WDEV |14456 .internal_flags = NL80211_FLAG_NEED_WDEV |
14240 NL80211_FLAG_NEED_RTNL,14457 NL80211_FLAG_NEED_RTNL,
14241 },14458 },
14242 {14459 {
14243 .cmd = NL80211_CMD_STOP_P2P_DEVICE,14460 .cmd = NL80211_CMD_STOP_P2P_DEVICE,
14461#if LINUX_VERSION_IS_GEQ(5,2,0)
14462 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14463#endif
14464
14244 .doit = nl80211_stop_p2p_device,14465 .doit = nl80211_stop_p2p_device,
14245 .policy = nl80211_policy,
14246 .flags = GENL_UNS_ADMIN_PERM,14466 .flags = GENL_UNS_ADMIN_PERM,
14247 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |14467 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |
14248 NL80211_FLAG_NEED_RTNL,14468 NL80211_FLAG_NEED_RTNL,
14249 },14469 },
14250 {14470 {
14251 .cmd = NL80211_CMD_START_NAN,14471 .cmd = NL80211_CMD_START_NAN,
14472#if LINUX_VERSION_IS_GEQ(5,2,0)
14473 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14474#endif
14475
14252 .doit = nl80211_start_nan,14476 .doit = nl80211_start_nan,
14253 .policy = nl80211_policy,
14254 .flags = GENL_ADMIN_PERM,14477 .flags = GENL_ADMIN_PERM,
14255 .internal_flags = NL80211_FLAG_NEED_WDEV |14478 .internal_flags = NL80211_FLAG_NEED_WDEV |
14256 NL80211_FLAG_NEED_RTNL,14479 NL80211_FLAG_NEED_RTNL,
14257 },14480 },
14258 {14481 {
14259 .cmd = NL80211_CMD_STOP_NAN,14482 .cmd = NL80211_CMD_STOP_NAN,
14483#if LINUX_VERSION_IS_GEQ(5,2,0)
14484 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14485#endif
14486
14260 .doit = nl80211_stop_nan,14487 .doit = nl80211_stop_nan,
14261 .policy = nl80211_policy,
14262 .flags = GENL_ADMIN_PERM,14488 .flags = GENL_ADMIN_PERM,
14263 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |14489 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |
14264 NL80211_FLAG_NEED_RTNL,14490 NL80211_FLAG_NEED_RTNL,
14265 },14491 },
14266 {14492 {
14267 .cmd = NL80211_CMD_ADD_NAN_FUNCTION,14493 .cmd = NL80211_CMD_ADD_NAN_FUNCTION,
14494#if LINUX_VERSION_IS_GEQ(5,2,0)
14495 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14496#endif
14497
14268 .doit = nl80211_nan_add_func,14498 .doit = nl80211_nan_add_func,
14269 .policy = nl80211_policy,
14270 .flags = GENL_ADMIN_PERM,14499 .flags = GENL_ADMIN_PERM,
14271 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |14500 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |
14272 NL80211_FLAG_NEED_RTNL,14501 NL80211_FLAG_NEED_RTNL,
14273 },14502 },
14274 {14503 {
14275 .cmd = NL80211_CMD_DEL_NAN_FUNCTION,14504 .cmd = NL80211_CMD_DEL_NAN_FUNCTION,
14505#if LINUX_VERSION_IS_GEQ(5,2,0)
14506 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14507#endif
14508
14276 .doit = nl80211_nan_del_func,14509 .doit = nl80211_nan_del_func,
14277 .policy = nl80211_policy,
14278 .flags = GENL_ADMIN_PERM,14510 .flags = GENL_ADMIN_PERM,
14279 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |14511 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |
14280 NL80211_FLAG_NEED_RTNL,14512 NL80211_FLAG_NEED_RTNL,
14281 },14513 },
14282 {14514 {
14283 .cmd = NL80211_CMD_CHANGE_NAN_CONFIG,14515 .cmd = NL80211_CMD_CHANGE_NAN_CONFIG,
14516#if LINUX_VERSION_IS_GEQ(5,2,0)
14517 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14518#endif
14519
14284 .doit = nl80211_nan_change_config,14520 .doit = nl80211_nan_change_config,
14285 .policy = nl80211_policy,
14286 .flags = GENL_ADMIN_PERM,14521 .flags = GENL_ADMIN_PERM,
14287 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |14522 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |
14288 NL80211_FLAG_NEED_RTNL,14523 NL80211_FLAG_NEED_RTNL,
14289 },14524 },
14290 {14525 {
14291 .cmd = NL80211_CMD_SET_MCAST_RATE,14526 .cmd = NL80211_CMD_SET_MCAST_RATE,
14527#if LINUX_VERSION_IS_GEQ(5,2,0)
14528 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14529#endif
14530
14292 .doit = nl80211_set_mcast_rate,14531 .doit = nl80211_set_mcast_rate,
14293 .policy = nl80211_policy,
14294 .flags = GENL_UNS_ADMIN_PERM,14532 .flags = GENL_UNS_ADMIN_PERM,
14295 .internal_flags = NL80211_FLAG_NEED_NETDEV |14533 .internal_flags = NL80211_FLAG_NEED_NETDEV |
14296 NL80211_FLAG_NEED_RTNL,14534 NL80211_FLAG_NEED_RTNL,
14297 },14535 },
14298 {14536 {
14299 .cmd = NL80211_CMD_SET_MAC_ACL,14537 .cmd = NL80211_CMD_SET_MAC_ACL,
14538#if LINUX_VERSION_IS_GEQ(5,2,0)
14539 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14540#endif
14541
14300 .doit = nl80211_set_mac_acl,14542 .doit = nl80211_set_mac_acl,
14301 .policy = nl80211_policy,
14302 .flags = GENL_UNS_ADMIN_PERM,14543 .flags = GENL_UNS_ADMIN_PERM,
14303 .internal_flags = NL80211_FLAG_NEED_NETDEV |14544 .internal_flags = NL80211_FLAG_NEED_NETDEV |
14304 NL80211_FLAG_NEED_RTNL,14545 NL80211_FLAG_NEED_RTNL,
14305 },14546 },
14306 {14547 {
14307 .cmd = NL80211_CMD_RADAR_DETECT,14548 .cmd = NL80211_CMD_RADAR_DETECT,
14549#if LINUX_VERSION_IS_GEQ(5,2,0)
14550 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14551#endif
14552
14308 .doit = nl80211_start_radar_detection,14553 .doit = nl80211_start_radar_detection,
14309 .policy = nl80211_policy,
14310 .flags = GENL_UNS_ADMIN_PERM,14554 .flags = GENL_UNS_ADMIN_PERM,
14311 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14555 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14312 NL80211_FLAG_NEED_RTNL,14556 NL80211_FLAG_NEED_RTNL,
14313 },14557 },
14314 {14558 {
14315 .cmd = NL80211_CMD_GET_PROTOCOL_FEATURES,14559 .cmd = NL80211_CMD_GET_PROTOCOL_FEATURES,
14560#if LINUX_VERSION_IS_GEQ(5,2,0)
14561 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14562#endif
14563
14316 .doit = nl80211_get_protocol_features,14564 .doit = nl80211_get_protocol_features,
14317 .policy = nl80211_policy,
14318 },14565 },
14319 {14566 {
14320 .cmd = NL80211_CMD_UPDATE_FT_IES,14567 .cmd = NL80211_CMD_UPDATE_FT_IES,
14568#if LINUX_VERSION_IS_GEQ(5,2,0)
14569 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14570#endif
14571
14321 .doit = nl80211_update_ft_ies,14572 .doit = nl80211_update_ft_ies,
14322 .policy = nl80211_policy,
14323 .flags = GENL_UNS_ADMIN_PERM,14573 .flags = GENL_UNS_ADMIN_PERM,
14324 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14574 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14325 NL80211_FLAG_NEED_RTNL,14575 NL80211_FLAG_NEED_RTNL,
14326 },14576 },
14327 {14577 {
14328 .cmd = NL80211_CMD_CRIT_PROTOCOL_START,14578 .cmd = NL80211_CMD_CRIT_PROTOCOL_START,
14579#if LINUX_VERSION_IS_GEQ(5,2,0)
14580 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14581#endif
14582
14329 .doit = nl80211_crit_protocol_start,14583 .doit = nl80211_crit_protocol_start,
14330 .policy = nl80211_policy,
14331 .flags = GENL_UNS_ADMIN_PERM,14584 .flags = GENL_UNS_ADMIN_PERM,
14332 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |14585 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |
14333 NL80211_FLAG_NEED_RTNL,14586 NL80211_FLAG_NEED_RTNL,
14334 },14587 },
14335 {14588 {
14336 .cmd = NL80211_CMD_CRIT_PROTOCOL_STOP,14589 .cmd = NL80211_CMD_CRIT_PROTOCOL_STOP,
14590#if LINUX_VERSION_IS_GEQ(5,2,0)
14591 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14592#endif
14593
14337 .doit = nl80211_crit_protocol_stop,14594 .doit = nl80211_crit_protocol_stop,
14338 .policy = nl80211_policy,
14339 .flags = GENL_UNS_ADMIN_PERM,14595 .flags = GENL_UNS_ADMIN_PERM,
14340 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |14596 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |
14341 NL80211_FLAG_NEED_RTNL,14597 NL80211_FLAG_NEED_RTNL,
14342 },14598 },
14343 {14599 {
14344 .cmd = NL80211_CMD_GET_COALESCE,14600 .cmd = NL80211_CMD_GET_COALESCE,
14601#if LINUX_VERSION_IS_GEQ(5,2,0)
14602 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14603#endif
14604
14345 .doit = nl80211_get_coalesce,14605 .doit = nl80211_get_coalesce,
14346 .policy = nl80211_policy,
14347 .internal_flags = NL80211_FLAG_NEED_WIPHY |14606 .internal_flags = NL80211_FLAG_NEED_WIPHY |
14348 NL80211_FLAG_NEED_RTNL,14607 NL80211_FLAG_NEED_RTNL,
14349 },14608 },
14350 {14609 {
14351 .cmd = NL80211_CMD_SET_COALESCE,14610 .cmd = NL80211_CMD_SET_COALESCE,
14611#if LINUX_VERSION_IS_GEQ(5,2,0)
14612 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14613#endif
14614
14352 .doit = nl80211_set_coalesce,14615 .doit = nl80211_set_coalesce,
14353 .policy = nl80211_policy,
14354 .flags = GENL_UNS_ADMIN_PERM,14616 .flags = GENL_UNS_ADMIN_PERM,
14355 .internal_flags = NL80211_FLAG_NEED_WIPHY |14617 .internal_flags = NL80211_FLAG_NEED_WIPHY |
14356 NL80211_FLAG_NEED_RTNL,14618 NL80211_FLAG_NEED_RTNL,
14357 },14619 },
14358 {14620 {
14359 .cmd = NL80211_CMD_CHANNEL_SWITCH,14621 .cmd = NL80211_CMD_CHANNEL_SWITCH,
14622#if LINUX_VERSION_IS_GEQ(5,2,0)
14623 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14624#endif
14625
14360 .doit = nl80211_channel_switch,14626 .doit = nl80211_channel_switch,
14361 .policy = nl80211_policy,
14362 .flags = GENL_UNS_ADMIN_PERM,14627 .flags = GENL_UNS_ADMIN_PERM,
14363 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14628 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14364 NL80211_FLAG_NEED_RTNL,14629 NL80211_FLAG_NEED_RTNL,
14365 },14630 },
14366 {14631 {
14367 .cmd = NL80211_CMD_VENDOR,14632 .cmd = NL80211_CMD_VENDOR,
14633#if LINUX_VERSION_IS_GEQ(5,2,0)
14634 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14635#endif
14636
14368 .doit = nl80211_vendor_cmd,14637 .doit = nl80211_vendor_cmd,
14369 .dumpit = nl80211_vendor_cmd_dump,14638 .dumpit = nl80211_vendor_cmd_dump,
14370 .policy = nl80211_policy,
14371 .flags = GENL_UNS_ADMIN_PERM,14639 .flags = GENL_UNS_ADMIN_PERM,
14372 .internal_flags = NL80211_FLAG_NEED_WIPHY |14640 .internal_flags = NL80211_FLAG_NEED_WIPHY |
14373 NL80211_FLAG_NEED_RTNL,14641 NL80211_FLAG_NEED_RTNL,
14374 },14642 },
14375 {14643 {
14376 .cmd = NL80211_CMD_SET_QOS_MAP,14644 .cmd = NL80211_CMD_SET_QOS_MAP,
14645#if LINUX_VERSION_IS_GEQ(5,2,0)
14646 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14647#endif
14648
14377 .doit = nl80211_set_qos_map,14649 .doit = nl80211_set_qos_map,
14378 .policy = nl80211_policy,
14379 .flags = GENL_UNS_ADMIN_PERM,14650 .flags = GENL_UNS_ADMIN_PERM,
14380 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14651 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14381 NL80211_FLAG_NEED_RTNL,14652 NL80211_FLAG_NEED_RTNL,
14382 },14653 },
14383 {14654 {
14384 .cmd = NL80211_CMD_ADD_TX_TS,14655 .cmd = NL80211_CMD_ADD_TX_TS,
14656#if LINUX_VERSION_IS_GEQ(5,2,0)
14657 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14658#endif
14659
14385 .doit = nl80211_add_tx_ts,14660 .doit = nl80211_add_tx_ts,
14386 .policy = nl80211_policy,
14387 .flags = GENL_UNS_ADMIN_PERM,14661 .flags = GENL_UNS_ADMIN_PERM,
14388 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14662 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14389 NL80211_FLAG_NEED_RTNL,14663 NL80211_FLAG_NEED_RTNL,
14390 },14664 },
14391 {14665 {
14392 .cmd = NL80211_CMD_DEL_TX_TS,14666 .cmd = NL80211_CMD_DEL_TX_TS,
14667#if LINUX_VERSION_IS_GEQ(5,2,0)
14668 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14669#endif
14670
14393 .doit = nl80211_del_tx_ts,14671 .doit = nl80211_del_tx_ts,
14394 .policy = nl80211_policy,
14395 .flags = GENL_UNS_ADMIN_PERM,14672 .flags = GENL_UNS_ADMIN_PERM,
14396 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14673 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14397 NL80211_FLAG_NEED_RTNL,14674 NL80211_FLAG_NEED_RTNL,
14398 },14675 },
14399 {14676 {
14400 .cmd = NL80211_CMD_TDLS_CHANNEL_SWITCH,14677 .cmd = NL80211_CMD_TDLS_CHANNEL_SWITCH,
14678#if LINUX_VERSION_IS_GEQ(5,2,0)
14679 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14680#endif
14681
14401 .doit = nl80211_tdls_channel_switch,14682 .doit = nl80211_tdls_channel_switch,
14402 .policy = nl80211_policy,
14403 .flags = GENL_UNS_ADMIN_PERM,14683 .flags = GENL_UNS_ADMIN_PERM,
14404 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14684 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14405 NL80211_FLAG_NEED_RTNL,14685 NL80211_FLAG_NEED_RTNL,
14406 },14686 },
14407 {14687 {
14408 .cmd = NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH,14688 .cmd = NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH,
14689#if LINUX_VERSION_IS_GEQ(5,2,0)
14690 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14691#endif
14692
14409 .doit = nl80211_tdls_cancel_channel_switch,14693 .doit = nl80211_tdls_cancel_channel_switch,
14410 .policy = nl80211_policy,
14411 .flags = GENL_UNS_ADMIN_PERM,14694 .flags = GENL_UNS_ADMIN_PERM,
14412 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14695 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14413 NL80211_FLAG_NEED_RTNL,14696 NL80211_FLAG_NEED_RTNL,
14414 },14697 },
14415 {14698 {
14416 .cmd = NL80211_CMD_SET_MULTICAST_TO_UNICAST,14699 .cmd = NL80211_CMD_SET_MULTICAST_TO_UNICAST,
14700#if LINUX_VERSION_IS_GEQ(5,2,0)
14701 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14702#endif
14703
14417 .doit = nl80211_set_multicast_to_unicast,14704 .doit = nl80211_set_multicast_to_unicast,
14418 .policy = nl80211_policy,
14419 .flags = GENL_UNS_ADMIN_PERM,14705 .flags = GENL_UNS_ADMIN_PERM,
14420 .internal_flags = NL80211_FLAG_NEED_NETDEV |14706 .internal_flags = NL80211_FLAG_NEED_NETDEV |
14421 NL80211_FLAG_NEED_RTNL,14707 NL80211_FLAG_NEED_RTNL,
14422 },14708 },
14423 {14709 {
14424 .cmd = NL80211_CMD_SET_PMK,14710 .cmd = NL80211_CMD_SET_PMK,
14711#if LINUX_VERSION_IS_GEQ(5,2,0)
14712 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14713#endif
14714
14425 .doit = nl80211_set_pmk,14715 .doit = nl80211_set_pmk,
14426 .policy = nl80211_policy,
14427 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14716 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14428 NL80211_FLAG_NEED_RTNL,14717 NL80211_FLAG_NEED_RTNL,
14429 },14718 },
14430 {14719 {
14431 .cmd = NL80211_CMD_DEL_PMK,14720 .cmd = NL80211_CMD_DEL_PMK,
14721#if LINUX_VERSION_IS_GEQ(5,2,0)
14722 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14723#endif
14724
14432 .doit = nl80211_del_pmk,14725 .doit = nl80211_del_pmk,
14433 .policy = nl80211_policy,
14434 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14726 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14435 NL80211_FLAG_NEED_RTNL,14727 NL80211_FLAG_NEED_RTNL,
14436 },14728 },
14437 {14729 {
14438 .cmd = NL80211_CMD_EXTERNAL_AUTH,14730 .cmd = NL80211_CMD_EXTERNAL_AUTH,
14731#if LINUX_VERSION_IS_GEQ(5,2,0)
14732 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14733#endif
14734
14439 .doit = nl80211_external_auth,14735 .doit = nl80211_external_auth,
14440 .policy = nl80211_policy,
14441 .flags = GENL_ADMIN_PERM,14736 .flags = GENL_ADMIN_PERM,
14442 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14737 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14443 NL80211_FLAG_NEED_RTNL,14738 NL80211_FLAG_NEED_RTNL,
14444 },14739 },
14445 {14740 {
14446 .cmd = NL80211_CMD_CONTROL_PORT_FRAME,14741 .cmd = NL80211_CMD_CONTROL_PORT_FRAME,
14742#if LINUX_VERSION_IS_GEQ(5,2,0)
14743 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14744#endif
14745
14447 .doit = nl80211_tx_control_port,14746 .doit = nl80211_tx_control_port,
14448 .policy = nl80211_policy,
14449 .flags = GENL_UNS_ADMIN_PERM,14747 .flags = GENL_UNS_ADMIN_PERM,
14450 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14748 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14451 NL80211_FLAG_NEED_RTNL,14749 NL80211_FLAG_NEED_RTNL,
14452 },14750 },
14453 {14751 {
14454 .cmd = NL80211_CMD_GET_FTM_RESPONDER_STATS,14752 .cmd = NL80211_CMD_GET_FTM_RESPONDER_STATS,
14753#if LINUX_VERSION_IS_GEQ(5,2,0)
14754 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14755#endif
14756
14455 .doit = nl80211_get_ftm_responder_stats,14757 .doit = nl80211_get_ftm_responder_stats,
14456 .policy = nl80211_policy,
14457 .internal_flags = NL80211_FLAG_NEED_NETDEV |14758 .internal_flags = NL80211_FLAG_NEED_NETDEV |
14458 NL80211_FLAG_NEED_RTNL,14759 NL80211_FLAG_NEED_RTNL,
14459 },14760 },
14460 {14761 {
14461 .cmd = NL80211_CMD_PEER_MEASUREMENT_START,14762 .cmd = NL80211_CMD_PEER_MEASUREMENT_START,
14763#if LINUX_VERSION_IS_GEQ(5,2,0)
14764 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14765#endif
14766
14462 .doit = nl80211_pmsr_start,14767 .doit = nl80211_pmsr_start,
14463 .policy = nl80211_policy,
14464 .flags = GENL_UNS_ADMIN_PERM,14768 .flags = GENL_UNS_ADMIN_PERM,
14465 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |14769 .internal_flags = NL80211_FLAG_NEED_WDEV_UP |
14466 NL80211_FLAG_NEED_RTNL,14770 NL80211_FLAG_NEED_RTNL,
14467 },14771 },
14468 {14772 {
14469 .cmd = NL80211_CMD_NOTIFY_RADAR,14773 .cmd = NL80211_CMD_NOTIFY_RADAR,
14774#if LINUX_VERSION_IS_GEQ(5,2,0)
14775 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
14776#endif
14777
14470 .doit = nl80211_notify_radar_detection,14778 .doit = nl80211_notify_radar_detection,
14471 .policy = nl80211_policy,
14472 .flags = GENL_UNS_ADMIN_PERM,14779 .flags = GENL_UNS_ADMIN_PERM,
14473 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |14780 .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
14474 NL80211_FLAG_NEED_RTNL,14781 NL80211_FLAG_NEED_RTNL,
@@ -14480,6 +14787,7 @@ static struct genl_family nl80211_fam __genl_ro_after_init = {
14480 .hdrsize = 0, /* no private header */14787 .hdrsize = 0, /* no private header */
14481 .version = 1, /* no particular meaning now */14788 .version = 1, /* no particular meaning now */
14482 .maxattr = NL80211_ATTR_MAX,14789 .maxattr = NL80211_ATTR_MAX,
14790 .policy = nl80211_policy,
14483 .netnsok = true,14791 .netnsok = true,
14484 .pre_doit = nl80211_pre_doit,14792 .pre_doit = nl80211_pre_doit,
14485 .post_doit = nl80211_post_doit,14793 .post_doit = nl80211_post_doit,
diff --git a/versions b/versions
index a2de5cc..95f63c9 100644
--- a/versions
+++ b/versions
@@ -2,4 +2,4 @@ BACKPORTS_VERSION="(see git)"
2BACKPORTED_KERNEL_VERSION="(see git)"2BACKPORTED_KERNEL_VERSION="(see git)"
3BACKPORTED_KERNEL_NAME="iwlwifi"3BACKPORTED_KERNEL_NAME="iwlwifi"
4BACKPORTS_BUILD_TSTAMP=__DATE__ \" \" __TIME__4BACKPORTS_BUILD_TSTAMP=__DATE__ \" \" __TIME__
5BACKPORTS_GIT_TRACKED="iwlwifi-stack-public:master:7858:cb17257d"5BACKPORTS_GIT_TRACKED="iwlwifi-stack-public:master:7906:7773a757"

Subscribers

People subscribed via source and target branches