mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-18 09:51:26 +00:00
106 lines
4.3 KiB
Diff
106 lines
4.3 KiB
Diff
From: John Crispin <john@phrozen.org>
|
|
Date: Wed, 26 Aug 2020 07:56:46 +0200
|
|
Subject: [PATCH] nl80211: rename csa counter attributes countdown counters
|
|
|
|
We want to reuse the attributes for other counters such as BSS color
|
|
change. Rename them to more generic names.
|
|
|
|
Signed-off-by: John Crispin <john@phrozen.org>
|
|
---
|
|
include/uapi/linux/nl80211.h | 14 ++++++++------
|
|
net/wireless/nl80211.c | 16 ++++++++--------
|
|
2 files changed, 16 insertions(+), 14 deletions(-)
|
|
|
|
--- a/include/uapi/linux/nl80211.h
|
|
+++ b/include/uapi/linux/nl80211.h
|
|
@@ -2088,10 +2088,10 @@ enum nl80211_commands {
|
|
* operation).
|
|
* @NL80211_ATTR_CSA_IES: Nested set of attributes containing the IE information
|
|
* for the time while performing a channel switch.
|
|
- * @NL80211_ATTR_CSA_C_OFF_BEACON: An array of offsets (u16) to the channel
|
|
- * switch counters in the beacons tail (%NL80211_ATTR_BEACON_TAIL).
|
|
- * @NL80211_ATTR_CSA_C_OFF_PRESP: An array of offsets (u16) to the channel
|
|
- * switch counters in the probe response (%NL80211_ATTR_PROBE_RESP).
|
|
+ * @NL80211_ATTR_CNTDWN_OFFS_BEACON: An array of offsets (u16) to the channel
|
|
+ * switch or color change counters in the beacons tail (%NL80211_ATTR_BEACON_TAIL).
|
|
+ * @NL80211_ATTR_CNTDWN_OFFS_PRESP: An array of offsets (u16) to the channel
|
|
+ * switch or color change counters in the probe response (%NL80211_ATTR_PROBE_RESP).
|
|
*
|
|
* @NL80211_ATTR_RXMGMT_FLAGS: flags for nl80211_send_mgmt(), u32.
|
|
* As specified in the &enum nl80211_rxmgmt_flags.
|
|
@@ -2852,8 +2852,8 @@ enum nl80211_attrs {
|
|
NL80211_ATTR_CH_SWITCH_COUNT,
|
|
NL80211_ATTR_CH_SWITCH_BLOCK_TX,
|
|
NL80211_ATTR_CSA_IES,
|
|
- NL80211_ATTR_CSA_C_OFF_BEACON,
|
|
- NL80211_ATTR_CSA_C_OFF_PRESP,
|
|
+ NL80211_ATTR_CNTDWN_OFFS_BEACON,
|
|
+ NL80211_ATTR_CNTDWN_OFFS_PRESP,
|
|
|
|
NL80211_ATTR_RXMGMT_FLAGS,
|
|
|
|
@@ -3052,6 +3052,8 @@ enum nl80211_attrs {
|
|
#define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG
|
|
#define NL80211_ATTR_IFACE_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER
|
|
#define NL80211_ATTR_SAE_DATA NL80211_ATTR_AUTH_DATA
|
|
+#define NL80211_ATTR_CSA_C_OFF_BEACON NL80211_ATTR_CNTDWN_OFFS_BEACON
|
|
+#define NL80211_ATTR_CSA_C_OFF_PRESP NL80211_ATTR_CNTDWN_OFFS_PRESP
|
|
|
|
/*
|
|
* Allow user space programs to use #ifdef on new attributes by defining them
|
|
--- a/net/wireless/nl80211.c
|
|
+++ b/net/wireless/nl80211.c
|
|
@@ -663,8 +663,8 @@ static const struct nla_policy nl80211_p
|
|
[NL80211_ATTR_CH_SWITCH_COUNT] = { .type = NLA_U32 },
|
|
[NL80211_ATTR_CH_SWITCH_BLOCK_TX] = { .type = NLA_FLAG },
|
|
[NL80211_ATTR_CSA_IES] = { .type = NLA_NESTED },
|
|
- [NL80211_ATTR_CSA_C_OFF_BEACON] = { .type = NLA_BINARY },
|
|
- [NL80211_ATTR_CSA_C_OFF_PRESP] = { .type = NLA_BINARY },
|
|
+ [NL80211_ATTR_CNTDWN_OFFS_BEACON] = { .type = NLA_BINARY },
|
|
+ [NL80211_ATTR_CNTDWN_OFFS_PRESP] = { .type = NLA_BINARY },
|
|
[NL80211_ATTR_STA_SUPPORTED_CHANNELS] = { .type = NLA_BINARY },
|
|
[NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES] = { .type = NLA_BINARY },
|
|
[NL80211_ATTR_HANDLE_DFS] = { .type = NLA_FLAG },
|
|
@@ -9064,10 +9064,10 @@ static int nl80211_channel_switch(struct
|
|
if (err)
|
|
return err;
|
|
|
|
- if (!csa_attrs[NL80211_ATTR_CSA_C_OFF_BEACON])
|
|
+ if (!csa_attrs[NL80211_ATTR_CNTDWN_OFFS_BEACON])
|
|
return -EINVAL;
|
|
|
|
- len = nla_len(csa_attrs[NL80211_ATTR_CSA_C_OFF_BEACON]);
|
|
+ len = nla_len(csa_attrs[NL80211_ATTR_CNTDWN_OFFS_BEACON]);
|
|
if (!len || (len % sizeof(u16)))
|
|
return -EINVAL;
|
|
|
|
@@ -9078,7 +9078,7 @@ static int nl80211_channel_switch(struct
|
|
return -EINVAL;
|
|
|
|
params.counter_offsets_beacon =
|
|
- nla_data(csa_attrs[NL80211_ATTR_CSA_C_OFF_BEACON]);
|
|
+ nla_data(csa_attrs[NL80211_ATTR_CNTDWN_OFFS_BEACON]);
|
|
|
|
/* sanity checks - counters should fit and be the same */
|
|
for (i = 0; i < params.n_counter_offsets_beacon; i++) {
|
|
@@ -9091,8 +9091,8 @@ static int nl80211_channel_switch(struct
|
|
return -EINVAL;
|
|
}
|
|
|
|
- if (csa_attrs[NL80211_ATTR_CSA_C_OFF_PRESP]) {
|
|
- len = nla_len(csa_attrs[NL80211_ATTR_CSA_C_OFF_PRESP]);
|
|
+ if (csa_attrs[NL80211_ATTR_CNTDWN_OFFS_PRESP]) {
|
|
+ len = nla_len(csa_attrs[NL80211_ATTR_CNTDWN_OFFS_PRESP]);
|
|
if (!len || (len % sizeof(u16)))
|
|
return -EINVAL;
|
|
|
|
@@ -9103,7 +9103,7 @@ static int nl80211_channel_switch(struct
|
|
return -EINVAL;
|
|
|
|
params.counter_offsets_presp =
|
|
- nla_data(csa_attrs[NL80211_ATTR_CSA_C_OFF_PRESP]);
|
|
+ nla_data(csa_attrs[NL80211_ATTR_CNTDWN_OFFS_PRESP]);
|
|
|
|
/* sanity checks - counters should fit and be the same */
|
|
for (i = 0; i < params.n_counter_offsets_presp; i++) {
|