* [PATCH] mac80211: add ieee80211_hw flag for QoS NDP support
@ 2018-03-18 23:38 Ben Caradoc-Davies
2018-03-18 23:50 ` Ben Caradoc-Davies
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Ben Caradoc-Davies @ 2018-03-18 23:38 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Ben Caradoc-Davies
Commit 7b6ddeaf27ec ("mac80211: use QoS NDP for AP probing") adds an
argument qos_ok to ieee80211_nullfunc_get to support QoS NDP. Despite
the claim in the commit log "Change all the drivers to *not* allow
QoS NDP for now, even though it looks like most of them should be OK
with that", this commit enables QoS NDP in response to beacons (see
change to mlme.c:ieee80211_send_nullfunc), causing ath9k_htc to lose
IP connectivity. See:
https://patchwork.kernel.org/patch/10241109/
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891060
This patch replaces the argument qos_ok of ieee80211_nullfunc_get
with an ieee80211_hw flag that drivers can use to declare support for
QoS NDP, allowing consistent behaviour between mlme.c and drivers.
Signed-off-by: Ben Caradoc-Davies <ben@transient.nz>
---
drivers/net/wireless/ath/ath9k/channel.c | 2 +-
drivers/net/wireless/st/cw1200/sta.c | 4 ++--
drivers/net/wireless/ti/wl1251/main.c | 2 +-
drivers/net/wireless/ti/wlcore/cmd.c | 5 ++---
include/net/mac80211.h | 12 +++++-------
net/mac80211/debugfs.c | 1 +
net/mac80211/mlme.c | 2 +-
net/mac80211/tx.c | 5 ++---
8 files changed, 15 insertions(+), 18 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c
index 1b05b5d7a038..dfb26f03c1a2 100644
--- a/drivers/net/wireless/ath/ath9k/channel.c
+++ b/drivers/net/wireless/ath/ath9k/channel.c
@@ -1113,7 +1113,7 @@ ath_chanctx_send_vif_ps_frame(struct ath_softc *sc, struct ath_vif *avp,
if (!avp->assoc)
return false;
- skb = ieee80211_nullfunc_get(sc->hw, vif, false);
+ skb = ieee80211_nullfunc_get(sc->hw, vif);
if (!skb)
return false;
diff --git a/drivers/net/wireless/st/cw1200/sta.c b/drivers/net/wireless/st/cw1200/sta.c
index 38678e9a0562..03687a80d6e9 100644
--- a/drivers/net/wireless/st/cw1200/sta.c
+++ b/drivers/net/wireless/st/cw1200/sta.c
@@ -198,7 +198,7 @@ void __cw1200_cqm_bssloss_sm(struct cw1200_common *priv,
priv->bss_loss_state++;
- skb = ieee80211_nullfunc_get(priv->hw, priv->vif, false);
+ skb = ieee80211_nullfunc_get(priv->hw, priv->vif);
WARN_ON(!skb);
if (skb)
cw1200_tx(priv->hw, NULL, skb);
@@ -2265,7 +2265,7 @@ static int cw1200_upload_null(struct cw1200_common *priv)
.rate = 0xFF,
};
- frame.skb = ieee80211_nullfunc_get(priv->hw, priv->vif, false);
+ frame.skb = ieee80211_nullfunc_get(priv->hw, priv->vif);
if (!frame.skb)
return -ENOMEM;
diff --git a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c
index 037defd10b91..99a6889a6540 100644
--- a/drivers/net/wireless/ti/wl1251/main.c
+++ b/drivers/net/wireless/ti/wl1251/main.c
@@ -566,7 +566,7 @@ static int wl1251_build_null_data(struct wl1251 *wl)
size = sizeof(struct wl12xx_null_data_template);
ptr = NULL;
} else {
- skb = ieee80211_nullfunc_get(wl->hw, wl->vif, false);
+ skb = ieee80211_nullfunc_get(wl->hw, wl->vif);
if (!skb)
goto out;
size = skb->len;
diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c
index 761cf8573a80..2bfc12fdc929 100644
--- a/drivers/net/wireless/ti/wlcore/cmd.c
+++ b/drivers/net/wireless/ti/wlcore/cmd.c
@@ -1069,8 +1069,7 @@ int wl12xx_cmd_build_null_data(struct wl1271 *wl, struct wl12xx_vif *wlvif)
ptr = NULL;
} else {
skb = ieee80211_nullfunc_get(wl->hw,
- wl12xx_wlvif_to_vif(wlvif),
- false);
+ wl12xx_wlvif_to_vif(wlvif));
if (!skb)
goto out;
size = skb->len;
@@ -1097,7 +1096,7 @@ int wl12xx_cmd_build_klv_null_data(struct wl1271 *wl,
struct sk_buff *skb = NULL;
int ret = -ENOMEM;
- skb = ieee80211_nullfunc_get(wl->hw, vif, false);
+ skb = ieee80211_nullfunc_get(wl->hw, vif);
if (!skb)
goto out;
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index c96511fa9198..985f32c76ba9 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2063,6 +2063,9 @@ struct ieee80211_txq {
* @IEEE80211_HW_SUPPORTS_TDLS_BUFFER_STA: Hardware supports buffer STA on
* TDLS links.
*
+ * @IEEE80211_HW_SUPPORTS_QOS_NDP: The driver (or firmware) supports QoS NDP
+ * for AP probing.
+ *
* @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays
*/
enum ieee80211_hw_flags {
@@ -2106,6 +2109,7 @@ enum ieee80211_hw_flags {
IEEE80211_HW_REPORTS_LOW_ACK,
IEEE80211_HW_SUPPORTS_TX_FRAG,
IEEE80211_HW_SUPPORTS_TDLS_BUFFER_STA,
+ IEEE80211_HW_SUPPORTS_QOS_NDP,
/* keep last, obviously */
NUM_IEEE80211_HW_FLAGS
@@ -4478,24 +4482,18 @@ struct sk_buff *ieee80211_pspoll_get(struct ieee80211_hw *hw,
* ieee80211_nullfunc_get - retrieve a nullfunc template
* @hw: pointer obtained from ieee80211_alloc_hw().
* @vif: &struct ieee80211_vif pointer from the add_interface callback.
- * @qos_ok: QoS NDP is acceptable to the caller, this should be set
- * if at all possible
*
* Creates a Nullfunc template which can, for example, uploaded to
* hardware. The template must be updated after association so that correct
* BSSID and address is used.
*
- * If @qos_ndp is set and the association is to an AP with QoS/WMM, the
- * returned packet will be QoS NDP.
- *
* Note: Caller (or hardware) is responsible for setting the
* &IEEE80211_FCTL_PM bit as well as Duration and Sequence Control fields.
*
* Return: The nullfunc template. %NULL on error.
*/
struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif,
- bool qos_ok);
+ struct ieee80211_vif *vif);
/**
* ieee80211_probereq_get - retrieve a Probe Request template
diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index 1f466d12a6bc..8e5713f292dc 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -212,6 +212,7 @@ static const char *hw_flag_names[] = {
FLAG(REPORTS_LOW_ACK),
FLAG(SUPPORTS_TX_FRAG),
FLAG(SUPPORTS_TDLS_BUFFER_STA),
+ FLAG(SUPPORTS_SUPPORTS_QOS_NDP),
#undef FLAG
};
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 39b660b9a908..cc55ff8ae979 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -896,7 +896,7 @@ void ieee80211_send_nullfunc(struct ieee80211_local *local,
struct ieee80211_hdr_3addr *nullfunc;
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
- skb = ieee80211_nullfunc_get(&local->hw, &sdata->vif, true);
+ skb = ieee80211_nullfunc_get(&local->hw, &sdata->vif);
if (!skb)
return;
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 69722504e3e1..885285dd247b 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -4448,8 +4448,7 @@ struct sk_buff *ieee80211_pspoll_get(struct ieee80211_hw *hw,
EXPORT_SYMBOL(ieee80211_pspoll_get);
struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif,
- bool qos_ok)
+ struct ieee80211_vif *vif)
{
struct ieee80211_hdr_3addr *nullfunc;
struct ieee80211_sub_if_data *sdata;
@@ -4465,7 +4464,7 @@ struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
ifmgd = &sdata->u.mgd;
local = sdata->local;
- if (qos_ok) {
+ if (ieee80211_hw_check(hw, SUPPORTS_QOS_NDP)) {
struct sta_info *sta;
rcu_read_lock();
--
Ben Caradoc-Davies <ben@transient.nz>
Director
Transient Software Limited <https://transient.nz/>
New Zealand
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] mac80211: add ieee80211_hw flag for QoS NDP support
2018-03-18 23:38 [PATCH] mac80211: add ieee80211_hw flag for QoS NDP support Ben Caradoc-Davies
@ 2018-03-18 23:50 ` Ben Caradoc-Davies
2018-03-19 10:46 ` kbuild test robot
2018-03-19 19:39 ` kbuild test robot
2 siblings, 0 replies; 11+ messages in thread
From: Ben Caradoc-Davies @ 2018-03-18 23:50 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
Good grief. Typo. Please reject this one too.
Kind regards,
--
Ben Caradoc-Davies <ben@transient.nz>
Director
Transient Software Limited <https://transient.nz/>
New Zealand
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] mac80211: add ieee80211_hw flag for QoS NDP support
2018-03-18 23:38 [PATCH] mac80211: add ieee80211_hw flag for QoS NDP support Ben Caradoc-Davies
2018-03-18 23:50 ` Ben Caradoc-Davies
@ 2018-03-19 10:46 ` kbuild test robot
2018-03-19 19:39 ` kbuild test robot
2 siblings, 0 replies; 11+ messages in thread
From: kbuild test robot @ 2018-03-19 10:46 UTC (permalink / raw)
To: Ben Caradoc-Davies
Cc: kbuild-all, Johannes Berg, linux-wireless, Ben Caradoc-Davies
[-- Attachment #1: Type: text/plain, Size: 5219 bytes --]
Hi Ben,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on v4.16-rc4]
[cannot apply to next-20180316]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Ben-Caradoc-Davies/mac80211-add-ieee80211_hw-flag-for-QoS-NDP-support/20180319-170624
config: i386-randconfig-x013-201811 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All error/warnings (new ones prefixed by >>):
>> net/mac80211/debugfs.c:174:18: error: 'IEEE80211_HW_SUPPORTS_SUPPORTS_QOS_NDP' undeclared here (not in a function); did you mean 'IEEE80211_HW_SUPPORTS_QOS_NDP'?
#define FLAG(F) [IEEE80211_HW_##F] = #F
^
>> net/mac80211/debugfs.c:215:2: note: in expansion of macro 'FLAG'
FLAG(SUPPORTS_SUPPORTS_QOS_NDP),
^~~~
>> net/mac80211/debugfs.c:174:18: error: array index in initializer not of integer type
#define FLAG(F) [IEEE80211_HW_##F] = #F
^
>> net/mac80211/debugfs.c:215:2: note: in expansion of macro 'FLAG'
FLAG(SUPPORTS_SUPPORTS_QOS_NDP),
^~~~
net/mac80211/debugfs.c:174:18: note: (near initialization for 'hw_flag_names')
#define FLAG(F) [IEEE80211_HW_##F] = #F
^
>> net/mac80211/debugfs.c:215:2: note: in expansion of macro 'FLAG'
FLAG(SUPPORTS_SUPPORTS_QOS_NDP),
^~~~
vim +174 net/mac80211/debugfs.c
827b1fb4 Johannes Berg 2009-03-13 172
68920c97 Andrey Ryabinin 2016-01-20 173 static const char *hw_flag_names[] = {
30686bf7 Johannes Berg 2015-06-02 @174 #define FLAG(F) [IEEE80211_HW_##F] = #F
30686bf7 Johannes Berg 2015-06-02 175 FLAG(HAS_RATE_CONTROL),
30686bf7 Johannes Berg 2015-06-02 176 FLAG(RX_INCLUDES_FCS),
30686bf7 Johannes Berg 2015-06-02 177 FLAG(HOST_BROADCAST_PS_BUFFERING),
30686bf7 Johannes Berg 2015-06-02 178 FLAG(SIGNAL_UNSPEC),
30686bf7 Johannes Berg 2015-06-02 179 FLAG(SIGNAL_DBM),
30686bf7 Johannes Berg 2015-06-02 180 FLAG(NEED_DTIM_BEFORE_ASSOC),
30686bf7 Johannes Berg 2015-06-02 181 FLAG(SPECTRUM_MGMT),
30686bf7 Johannes Berg 2015-06-02 182 FLAG(AMPDU_AGGREGATION),
30686bf7 Johannes Berg 2015-06-02 183 FLAG(SUPPORTS_PS),
30686bf7 Johannes Berg 2015-06-02 184 FLAG(PS_NULLFUNC_STACK),
30686bf7 Johannes Berg 2015-06-02 185 FLAG(SUPPORTS_DYNAMIC_PS),
30686bf7 Johannes Berg 2015-06-02 186 FLAG(MFP_CAPABLE),
30686bf7 Johannes Berg 2015-06-02 187 FLAG(WANT_MONITOR_VIF),
30686bf7 Johannes Berg 2015-06-02 188 FLAG(NO_AUTO_VIF),
30686bf7 Johannes Berg 2015-06-02 189 FLAG(SW_CRYPTO_CONTROL),
30686bf7 Johannes Berg 2015-06-02 190 FLAG(SUPPORT_FAST_XMIT),
30686bf7 Johannes Berg 2015-06-02 191 FLAG(REPORTS_TX_ACK_STATUS),
30686bf7 Johannes Berg 2015-06-02 192 FLAG(CONNECTION_MONITOR),
30686bf7 Johannes Berg 2015-06-02 193 FLAG(QUEUE_CONTROL),
30686bf7 Johannes Berg 2015-06-02 194 FLAG(SUPPORTS_PER_STA_GTK),
30686bf7 Johannes Berg 2015-06-02 195 FLAG(AP_LINK_PS),
30686bf7 Johannes Berg 2015-06-02 196 FLAG(TX_AMPDU_SETUP_IN_HW),
30686bf7 Johannes Berg 2015-06-02 197 FLAG(SUPPORTS_RC_TABLE),
30686bf7 Johannes Berg 2015-06-02 198 FLAG(P2P_DEV_ADDR_FOR_INTF),
30686bf7 Johannes Berg 2015-06-02 199 FLAG(TIMING_BEACON_ONLY),
30686bf7 Johannes Berg 2015-06-02 200 FLAG(SUPPORTS_HT_CCK_RATES),
30686bf7 Johannes Berg 2015-06-02 201 FLAG(CHANCTX_STA_CSA),
30686bf7 Johannes Berg 2015-06-02 202 FLAG(SUPPORTS_CLONED_SKBS),
30686bf7 Johannes Berg 2015-06-02 203 FLAG(SINGLE_SCAN_ON_ALL_BANDS),
b98fb44f Arik Nemtsov 2015-06-10 204 FLAG(TDLS_WIDER_BW),
99e7ca44 Emmanuel Grumbach 2015-08-15 205 FLAG(SUPPORTS_AMSDU_IN_AMPDU),
35afa588 Helmut Schaa 2015-09-09 206 FLAG(BEACON_TX_STATUS),
31104891 Johannes Berg 2015-10-22 207 FLAG(NEEDS_UNIQUE_STA_ADDR),
412a6d80 Sara Sharon 2015-12-08 208 FLAG(SUPPORTS_REORDERING_BUFFER),
c9c5962b Johannes Berg 2016-03-31 209 FLAG(USES_RSS),
6e0456b5 Felix Fietkau 2016-03-03 210 FLAG(TX_AMSDU),
6e0456b5 Felix Fietkau 2016-03-03 211 FLAG(TX_FRAG_LIST),
e8a24cd4 Rajkumar Manoharan 2016-09-14 212 FLAG(REPORTS_LOW_ACK),
f3fe4e93 Sara Sharon 2016-10-18 213 FLAG(SUPPORTS_TX_FRAG),
e2fb1b83 Yingying Tang 2017-10-24 214 FLAG(SUPPORTS_TDLS_BUFFER_STA),
b9b085d9 Ben Caradoc-Davies 2018-03-19 @215 FLAG(SUPPORTS_SUPPORTS_QOS_NDP),
30686bf7 Johannes Berg 2015-06-02 216 #undef FLAG
30686bf7 Johannes Berg 2015-06-02 217 };
30686bf7 Johannes Berg 2015-06-02 218
:::::: The code at line 174 was first introduced by commit
:::::: 30686bf7f5b3c30831761e188a6e3cb33580fa48 mac80211: convert HW flags to unsigned long bitmap
:::::: TO: Johannes Berg <johannes.berg@intel.com>
:::::: CC: Johannes Berg <johannes.berg@intel.com>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 25861 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] mac80211: add ieee80211_hw flag for QoS NDP support
2018-03-18 23:38 [PATCH] mac80211: add ieee80211_hw flag for QoS NDP support Ben Caradoc-Davies
2018-03-18 23:50 ` Ben Caradoc-Davies
2018-03-19 10:46 ` kbuild test robot
@ 2018-03-19 19:39 ` kbuild test robot
2 siblings, 0 replies; 11+ messages in thread
From: kbuild test robot @ 2018-03-19 19:39 UTC (permalink / raw)
To: Ben Caradoc-Davies
Cc: kbuild-all, Johannes Berg, linux-wireless, Ben Caradoc-Davies
[-- Attachment #1: Type: text/plain, Size: 5212 bytes --]
Hi Ben,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on v4.16-rc4]
[cannot apply to next-20180319]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Ben-Caradoc-Davies/mac80211-add-ieee80211_hw-flag-for-QoS-NDP-support/20180319-170624
config: i386-randconfig-s1-201811 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All errors (new ones prefixed by >>):
>> net/mac80211/debugfs.c:174:18: error: 'IEEE80211_HW_SUPPORTS_SUPPORTS_QOS_NDP' undeclared here (not in a function)
#define FLAG(F) [IEEE80211_HW_##F] = #F
^
net/mac80211/debugfs.c:215:2: note: in expansion of macro 'FLAG'
FLAG(SUPPORTS_SUPPORTS_QOS_NDP),
^~~~
net/mac80211/debugfs.c:174:18: error: array index in initializer not of integer type
#define FLAG(F) [IEEE80211_HW_##F] = #F
^
net/mac80211/debugfs.c:215:2: note: in expansion of macro 'FLAG'
FLAG(SUPPORTS_SUPPORTS_QOS_NDP),
^~~~
net/mac80211/debugfs.c:174:18: note: (near initialization for 'hw_flag_names')
#define FLAG(F) [IEEE80211_HW_##F] = #F
^
net/mac80211/debugfs.c:215:2: note: in expansion of macro 'FLAG'
FLAG(SUPPORTS_SUPPORTS_QOS_NDP),
^~~~
vim +/IEEE80211_HW_SUPPORTS_SUPPORTS_QOS_NDP +174 net/mac80211/debugfs.c
827b1fb4 Johannes Berg 2009-03-13 172
68920c97 Andrey Ryabinin 2016-01-20 173 static const char *hw_flag_names[] = {
30686bf7 Johannes Berg 2015-06-02 @174 #define FLAG(F) [IEEE80211_HW_##F] = #F
30686bf7 Johannes Berg 2015-06-02 175 FLAG(HAS_RATE_CONTROL),
30686bf7 Johannes Berg 2015-06-02 176 FLAG(RX_INCLUDES_FCS),
30686bf7 Johannes Berg 2015-06-02 177 FLAG(HOST_BROADCAST_PS_BUFFERING),
30686bf7 Johannes Berg 2015-06-02 178 FLAG(SIGNAL_UNSPEC),
30686bf7 Johannes Berg 2015-06-02 179 FLAG(SIGNAL_DBM),
30686bf7 Johannes Berg 2015-06-02 180 FLAG(NEED_DTIM_BEFORE_ASSOC),
30686bf7 Johannes Berg 2015-06-02 181 FLAG(SPECTRUM_MGMT),
30686bf7 Johannes Berg 2015-06-02 182 FLAG(AMPDU_AGGREGATION),
30686bf7 Johannes Berg 2015-06-02 183 FLAG(SUPPORTS_PS),
30686bf7 Johannes Berg 2015-06-02 184 FLAG(PS_NULLFUNC_STACK),
30686bf7 Johannes Berg 2015-06-02 185 FLAG(SUPPORTS_DYNAMIC_PS),
30686bf7 Johannes Berg 2015-06-02 186 FLAG(MFP_CAPABLE),
30686bf7 Johannes Berg 2015-06-02 187 FLAG(WANT_MONITOR_VIF),
30686bf7 Johannes Berg 2015-06-02 188 FLAG(NO_AUTO_VIF),
30686bf7 Johannes Berg 2015-06-02 189 FLAG(SW_CRYPTO_CONTROL),
30686bf7 Johannes Berg 2015-06-02 190 FLAG(SUPPORT_FAST_XMIT),
30686bf7 Johannes Berg 2015-06-02 191 FLAG(REPORTS_TX_ACK_STATUS),
30686bf7 Johannes Berg 2015-06-02 192 FLAG(CONNECTION_MONITOR),
30686bf7 Johannes Berg 2015-06-02 193 FLAG(QUEUE_CONTROL),
30686bf7 Johannes Berg 2015-06-02 194 FLAG(SUPPORTS_PER_STA_GTK),
30686bf7 Johannes Berg 2015-06-02 195 FLAG(AP_LINK_PS),
30686bf7 Johannes Berg 2015-06-02 196 FLAG(TX_AMPDU_SETUP_IN_HW),
30686bf7 Johannes Berg 2015-06-02 197 FLAG(SUPPORTS_RC_TABLE),
30686bf7 Johannes Berg 2015-06-02 198 FLAG(P2P_DEV_ADDR_FOR_INTF),
30686bf7 Johannes Berg 2015-06-02 199 FLAG(TIMING_BEACON_ONLY),
30686bf7 Johannes Berg 2015-06-02 200 FLAG(SUPPORTS_HT_CCK_RATES),
30686bf7 Johannes Berg 2015-06-02 201 FLAG(CHANCTX_STA_CSA),
30686bf7 Johannes Berg 2015-06-02 202 FLAG(SUPPORTS_CLONED_SKBS),
30686bf7 Johannes Berg 2015-06-02 203 FLAG(SINGLE_SCAN_ON_ALL_BANDS),
b98fb44f Arik Nemtsov 2015-06-10 204 FLAG(TDLS_WIDER_BW),
99e7ca44 Emmanuel Grumbach 2015-08-15 205 FLAG(SUPPORTS_AMSDU_IN_AMPDU),
35afa588 Helmut Schaa 2015-09-09 206 FLAG(BEACON_TX_STATUS),
31104891 Johannes Berg 2015-10-22 207 FLAG(NEEDS_UNIQUE_STA_ADDR),
412a6d80 Sara Sharon 2015-12-08 208 FLAG(SUPPORTS_REORDERING_BUFFER),
c9c5962b Johannes Berg 2016-03-31 209 FLAG(USES_RSS),
6e0456b5 Felix Fietkau 2016-03-03 210 FLAG(TX_AMSDU),
6e0456b5 Felix Fietkau 2016-03-03 211 FLAG(TX_FRAG_LIST),
e8a24cd4 Rajkumar Manoharan 2016-09-14 212 FLAG(REPORTS_LOW_ACK),
f3fe4e93 Sara Sharon 2016-10-18 213 FLAG(SUPPORTS_TX_FRAG),
e2fb1b83 Yingying Tang 2017-10-24 214 FLAG(SUPPORTS_TDLS_BUFFER_STA),
b9b085d9 Ben Caradoc-Davies 2018-03-19 215 FLAG(SUPPORTS_SUPPORTS_QOS_NDP),
30686bf7 Johannes Berg 2015-06-02 216 #undef FLAG
30686bf7 Johannes Berg 2015-06-02 217 };
30686bf7 Johannes Berg 2015-06-02 218
:::::: The code at line 174 was first introduced by commit
:::::: 30686bf7f5b3c30831761e188a6e3cb33580fa48 mac80211: convert HW flags to unsigned long bitmap
:::::: TO: Johannes Berg <johannes.berg@intel.com>
:::::: CC: Johannes Berg <johannes.berg@intel.com>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 26748 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] mac80211: add ieee80211_hw flag for QoS NDP support
2018-03-21 9:53 ` Johannes Berg
@ 2018-03-21 23:11 ` Ben Caradoc-Davies
0 siblings, 0 replies; 11+ messages in thread
From: Ben Caradoc-Davies @ 2018-03-21 23:11 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
On 21/03/18 22:53, Johannes Berg wrote:
> I've applied a modified version of this patch - it will also require
> setting the new "broken" flag in the driver.
Thanks very much, Johannes. I have tested your modified patch
<https://patchwork.kernel.org/patch/10299025/> together with the patch
<https://patchwork.kernel.org/patch/10299031/> that enables the new
"broken" flag and they seem to fix the problem (when backported to
Debian 4.15.11-1).
Kind regards,
--
Ben Caradoc-Davies <ben@transient.nz>
Director
Transient Software Limited <https://transient.nz/>
New Zealand
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] mac80211: add ieee80211_hw flag for QoS NDP support
2018-03-18 23:57 Ben Caradoc-Davies
@ 2018-03-21 9:53 ` Johannes Berg
2018-03-21 23:11 ` Ben Caradoc-Davies
0 siblings, 1 reply; 11+ messages in thread
From: Johannes Berg @ 2018-03-21 9:53 UTC (permalink / raw)
To: Ben Caradoc-Davies; +Cc: linux-wireless
On Mon, 2018-03-19 at 12:57 +1300, Ben Caradoc-Davies wrote:
> Commit 7b6ddeaf27ec ("mac80211: use QoS NDP for AP probing") adds an
> argument qos_ok to ieee80211_nullfunc_get to support QoS NDP. Despite
> the claim in the commit log "Change all the drivers to *not* allow
> QoS NDP for now, even though it looks like most of them should be OK
> with that", this commit enables QoS NDP in response to beacons (see
> change to mlme.c:ieee80211_send_nullfunc), causing ath9k_htc to lose
> IP connectivity. See:
> https://patchwork.kernel.org/patch/10241109/
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891060
>
> This patch replaces the argument qos_ok of ieee80211_nullfunc_get
> with an ieee80211_hw flag that drivers can use to declare support for
> QoS NDP, allowing consistent behaviour between mlme.c and drivers.
A version identifier (as in "[PATCH v3]" in the subject) would help :-)
I've applied a modified version of this patch - it will also require
setting the new "broken" flag in the driver.
johannes
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH] mac80211: add ieee80211_hw flag for QoS NDP support
@ 2018-03-18 23:57 Ben Caradoc-Davies
2018-03-21 9:53 ` Johannes Berg
0 siblings, 1 reply; 11+ messages in thread
From: Ben Caradoc-Davies @ 2018-03-18 23:57 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Ben Caradoc-Davies
Commit 7b6ddeaf27ec ("mac80211: use QoS NDP for AP probing") adds an
argument qos_ok to ieee80211_nullfunc_get to support QoS NDP. Despite
the claim in the commit log "Change all the drivers to *not* allow
QoS NDP for now, even though it looks like most of them should be OK
with that", this commit enables QoS NDP in response to beacons (see
change to mlme.c:ieee80211_send_nullfunc), causing ath9k_htc to lose
IP connectivity. See:
https://patchwork.kernel.org/patch/10241109/
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891060
This patch replaces the argument qos_ok of ieee80211_nullfunc_get
with an ieee80211_hw flag that drivers can use to declare support for
QoS NDP, allowing consistent behaviour between mlme.c and drivers.
Signed-off-by: Ben Caradoc-Davies <ben@transient.nz>
---
drivers/net/wireless/ath/ath9k/channel.c | 2 +-
drivers/net/wireless/st/cw1200/sta.c | 4 ++--
drivers/net/wireless/ti/wl1251/main.c | 2 +-
drivers/net/wireless/ti/wlcore/cmd.c | 5 ++---
include/net/mac80211.h | 12 +++++-------
net/mac80211/debugfs.c | 1 +
net/mac80211/mlme.c | 2 +-
net/mac80211/tx.c | 5 ++---
8 files changed, 15 insertions(+), 18 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c
index 1b05b5d7a038..dfb26f03c1a2 100644
--- a/drivers/net/wireless/ath/ath9k/channel.c
+++ b/drivers/net/wireless/ath/ath9k/channel.c
@@ -1113,7 +1113,7 @@ ath_chanctx_send_vif_ps_frame(struct ath_softc *sc, struct ath_vif *avp,
if (!avp->assoc)
return false;
- skb = ieee80211_nullfunc_get(sc->hw, vif, false);
+ skb = ieee80211_nullfunc_get(sc->hw, vif);
if (!skb)
return false;
diff --git a/drivers/net/wireless/st/cw1200/sta.c b/drivers/net/wireless/st/cw1200/sta.c
index 38678e9a0562..03687a80d6e9 100644
--- a/drivers/net/wireless/st/cw1200/sta.c
+++ b/drivers/net/wireless/st/cw1200/sta.c
@@ -198,7 +198,7 @@ void __cw1200_cqm_bssloss_sm(struct cw1200_common *priv,
priv->bss_loss_state++;
- skb = ieee80211_nullfunc_get(priv->hw, priv->vif, false);
+ skb = ieee80211_nullfunc_get(priv->hw, priv->vif);
WARN_ON(!skb);
if (skb)
cw1200_tx(priv->hw, NULL, skb);
@@ -2265,7 +2265,7 @@ static int cw1200_upload_null(struct cw1200_common *priv)
.rate = 0xFF,
};
- frame.skb = ieee80211_nullfunc_get(priv->hw, priv->vif, false);
+ frame.skb = ieee80211_nullfunc_get(priv->hw, priv->vif);
if (!frame.skb)
return -ENOMEM;
diff --git a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c
index 037defd10b91..99a6889a6540 100644
--- a/drivers/net/wireless/ti/wl1251/main.c
+++ b/drivers/net/wireless/ti/wl1251/main.c
@@ -566,7 +566,7 @@ static int wl1251_build_null_data(struct wl1251 *wl)
size = sizeof(struct wl12xx_null_data_template);
ptr = NULL;
} else {
- skb = ieee80211_nullfunc_get(wl->hw, wl->vif, false);
+ skb = ieee80211_nullfunc_get(wl->hw, wl->vif);
if (!skb)
goto out;
size = skb->len;
diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c
index 761cf8573a80..2bfc12fdc929 100644
--- a/drivers/net/wireless/ti/wlcore/cmd.c
+++ b/drivers/net/wireless/ti/wlcore/cmd.c
@@ -1069,8 +1069,7 @@ int wl12xx_cmd_build_null_data(struct wl1271 *wl, struct wl12xx_vif *wlvif)
ptr = NULL;
} else {
skb = ieee80211_nullfunc_get(wl->hw,
- wl12xx_wlvif_to_vif(wlvif),
- false);
+ wl12xx_wlvif_to_vif(wlvif));
if (!skb)
goto out;
size = skb->len;
@@ -1097,7 +1096,7 @@ int wl12xx_cmd_build_klv_null_data(struct wl1271 *wl,
struct sk_buff *skb = NULL;
int ret = -ENOMEM;
- skb = ieee80211_nullfunc_get(wl->hw, vif, false);
+ skb = ieee80211_nullfunc_get(wl->hw, vif);
if (!skb)
goto out;
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index c96511fa9198..985f32c76ba9 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2063,6 +2063,9 @@ struct ieee80211_txq {
* @IEEE80211_HW_SUPPORTS_TDLS_BUFFER_STA: Hardware supports buffer STA on
* TDLS links.
*
+ * @IEEE80211_HW_SUPPORTS_QOS_NDP: The driver (or firmware) supports QoS NDP
+ * for AP probing.
+ *
* @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays
*/
enum ieee80211_hw_flags {
@@ -2106,6 +2109,7 @@ enum ieee80211_hw_flags {
IEEE80211_HW_REPORTS_LOW_ACK,
IEEE80211_HW_SUPPORTS_TX_FRAG,
IEEE80211_HW_SUPPORTS_TDLS_BUFFER_STA,
+ IEEE80211_HW_SUPPORTS_QOS_NDP,
/* keep last, obviously */
NUM_IEEE80211_HW_FLAGS
@@ -4478,24 +4482,18 @@ struct sk_buff *ieee80211_pspoll_get(struct ieee80211_hw *hw,
* ieee80211_nullfunc_get - retrieve a nullfunc template
* @hw: pointer obtained from ieee80211_alloc_hw().
* @vif: &struct ieee80211_vif pointer from the add_interface callback.
- * @qos_ok: QoS NDP is acceptable to the caller, this should be set
- * if at all possible
*
* Creates a Nullfunc template which can, for example, uploaded to
* hardware. The template must be updated after association so that correct
* BSSID and address is used.
*
- * If @qos_ndp is set and the association is to an AP with QoS/WMM, the
- * returned packet will be QoS NDP.
- *
* Note: Caller (or hardware) is responsible for setting the
* &IEEE80211_FCTL_PM bit as well as Duration and Sequence Control fields.
*
* Return: The nullfunc template. %NULL on error.
*/
struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif,
- bool qos_ok);
+ struct ieee80211_vif *vif);
/**
* ieee80211_probereq_get - retrieve a Probe Request template
diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index 1f466d12a6bc..8718d7e9ad9d 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -212,6 +212,7 @@ static const char *hw_flag_names[] = {
FLAG(REPORTS_LOW_ACK),
FLAG(SUPPORTS_TX_FRAG),
FLAG(SUPPORTS_TDLS_BUFFER_STA),
+ FLAG(SUPPORTS_QOS_NDP),
#undef FLAG
};
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 39b660b9a908..cc55ff8ae979 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -896,7 +896,7 @@ void ieee80211_send_nullfunc(struct ieee80211_local *local,
struct ieee80211_hdr_3addr *nullfunc;
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
- skb = ieee80211_nullfunc_get(&local->hw, &sdata->vif, true);
+ skb = ieee80211_nullfunc_get(&local->hw, &sdata->vif);
if (!skb)
return;
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 69722504e3e1..885285dd247b 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -4448,8 +4448,7 @@ struct sk_buff *ieee80211_pspoll_get(struct ieee80211_hw *hw,
EXPORT_SYMBOL(ieee80211_pspoll_get);
struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif,
- bool qos_ok)
+ struct ieee80211_vif *vif)
{
struct ieee80211_hdr_3addr *nullfunc;
struct ieee80211_sub_if_data *sdata;
@@ -4465,7 +4464,7 @@ struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
ifmgd = &sdata->u.mgd;
local = sdata->local;
- if (qos_ok) {
+ if (ieee80211_hw_check(hw, SUPPORTS_QOS_NDP)) {
struct sta_info *sta;
rcu_read_lock();
--
Ben Caradoc-Davies <ben@transient.nz>
Director
Transient Software Limited <https://transient.nz/>
New Zealand
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] mac80211: add ieee80211_hw flag for QoS NDP support
2018-03-18 22:12 ` kbuild test robot
@ 2018-03-18 23:36 ` Ben Caradoc-Davies
0 siblings, 0 replies; 11+ messages in thread
From: Ben Caradoc-Davies @ 2018-03-18 23:36 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
On 19/03/18 11:12, kbuild test robot wrote:
> net/mac80211/debugfs.c: In function 'hwflags_read':
>>> include/linux/compiler.h:339:38: error: call to '__compiletime_assert_234' declared with attribute error: BUILD_BUG_ON failed: ARRAY_SIZE(hw_flag_names) != NUM_IEEE80211_HW_FLAGS
Please reject this patch. I will submit a revised patch that adds the
new flag to hw_flag_names in net/mac80211/debugfs.c.
Kind regards,
--
Ben Caradoc-Davies <ben@transient.nz>
Director
Transient Software Limited <https://transient.nz/>
New Zealand
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] mac80211: add ieee80211_hw flag for QoS NDP support
2018-03-17 20:51 Ben Caradoc-Davies
2018-03-17 20:53 ` Ben Caradoc-Davies
@ 2018-03-18 22:12 ` kbuild test robot
2018-03-18 23:36 ` Ben Caradoc-Davies
1 sibling, 1 reply; 11+ messages in thread
From: kbuild test robot @ 2018-03-18 22:12 UTC (permalink / raw)
To: Ben Caradoc-Davies
Cc: kbuild-all, Johannes Berg, linux-wireless, Ben Caradoc-Davies
[-- Attachment #1: Type: text/plain, Size: 5536 bytes --]
Hi Ben,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on v4.16-rc4]
[cannot apply to next-20180316]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Ben-Caradoc-Davies/mac80211-add-ieee80211_hw-flag-for-QoS-NDP-support/20180319-052448
config: i386-randconfig-x013-201811 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All error/warnings (new ones prefixed by >>):
In file included from include/linux/kernel.h:10:0,
from include/linux/list.h:9,
from include/linux/wait.h:7,
from include/linux/wait_bit.h:8,
from include/linux/fs.h:6,
from include/linux/debugfs.h:15,
from net/mac80211/debugfs.c:11:
net/mac80211/debugfs.c: In function 'hwflags_read':
>> include/linux/compiler.h:339:38: error: call to '__compiletime_assert_234' declared with attribute error: BUILD_BUG_ON failed: ARRAY_SIZE(hw_flag_names) != NUM_IEEE80211_HW_FLAGS
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^
include/linux/compiler.h:319:4: note: in definition of macro '__compiletime_assert'
prefix ## suffix(); \
^~~~~~
include/linux/compiler.h:339:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:45:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:69:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
^~~~~~~~~~~~~~~~
>> net/mac80211/debugfs.c:234:2: note: in expansion of macro 'BUILD_BUG_ON'
BUILD_BUG_ON(ARRAY_SIZE(hw_flag_names) != NUM_IEEE80211_HW_FLAGS);
^~~~~~~~~~~~
--
In file included from include/linux/kernel.h:10:0,
from include/linux/list.h:9,
from include/linux/wait.h:7,
from include/linux/wait_bit.h:8,
from include/linux/fs.h:6,
from include/linux/debugfs.h:15,
from net//mac80211/debugfs.c:11:
net//mac80211/debugfs.c: In function 'hwflags_read':
>> include/linux/compiler.h:339:38: error: call to '__compiletime_assert_234' declared with attribute error: BUILD_BUG_ON failed: ARRAY_SIZE(hw_flag_names) != NUM_IEEE80211_HW_FLAGS
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^
include/linux/compiler.h:319:4: note: in definition of macro '__compiletime_assert'
prefix ## suffix(); \
^~~~~~
include/linux/compiler.h:339:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:45:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:69:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
^~~~~~~~~~~~~~~~
net//mac80211/debugfs.c:234:2: note: in expansion of macro 'BUILD_BUG_ON'
BUILD_BUG_ON(ARRAY_SIZE(hw_flag_names) != NUM_IEEE80211_HW_FLAGS);
^~~~~~~~~~~~
vim +/__compiletime_assert_234 +339 include/linux/compiler.h
9a8ab1c3 Daniel Santos 2013-02-21 325
9a8ab1c3 Daniel Santos 2013-02-21 326 #define _compiletime_assert(condition, msg, prefix, suffix) \
9a8ab1c3 Daniel Santos 2013-02-21 327 __compiletime_assert(condition, msg, prefix, suffix)
9a8ab1c3 Daniel Santos 2013-02-21 328
9a8ab1c3 Daniel Santos 2013-02-21 329 /**
9a8ab1c3 Daniel Santos 2013-02-21 330 * compiletime_assert - break build and emit msg if condition is false
9a8ab1c3 Daniel Santos 2013-02-21 331 * @condition: a compile-time constant condition to check
9a8ab1c3 Daniel Santos 2013-02-21 332 * @msg: a message to emit if condition is false
9a8ab1c3 Daniel Santos 2013-02-21 333 *
9a8ab1c3 Daniel Santos 2013-02-21 334 * In tradition of POSIX assert, this macro will break the build if the
9a8ab1c3 Daniel Santos 2013-02-21 335 * supplied condition is *false*, emitting the supplied error message if the
9a8ab1c3 Daniel Santos 2013-02-21 336 * compiler has support to do so.
9a8ab1c3 Daniel Santos 2013-02-21 337 */
9a8ab1c3 Daniel Santos 2013-02-21 338 #define compiletime_assert(condition, msg) \
9a8ab1c3 Daniel Santos 2013-02-21 @339 _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
9a8ab1c3 Daniel Santos 2013-02-21 340
:::::: The code at line 339 was first introduced by commit
:::::: 9a8ab1c39970a4938a72d94e6fd13be88a797590 bug.h, compiler.h: introduce compiletime_assert & BUILD_BUG_ON_MSG
:::::: TO: Daniel Santos <daniel.santos@pobox.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 25861 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] mac80211: add ieee80211_hw flag for QoS NDP support
2018-03-17 20:51 Ben Caradoc-Davies
@ 2018-03-17 20:53 ` Ben Caradoc-Davies
2018-03-18 22:12 ` kbuild test robot
1 sibling, 0 replies; 11+ messages in thread
From: Ben Caradoc-Davies @ 2018-03-17 20:53 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
Note that this patch supersedes
<https://patchwork.kernel.org/patch/10241109/>.
Kind regards,
--
Ben Caradoc-Davies <ben@transient.nz>
Director
Transient Software Limited <https://transient.nz/>
New Zealand
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH] mac80211: add ieee80211_hw flag for QoS NDP support
@ 2018-03-17 20:51 Ben Caradoc-Davies
2018-03-17 20:53 ` Ben Caradoc-Davies
2018-03-18 22:12 ` kbuild test robot
0 siblings, 2 replies; 11+ messages in thread
From: Ben Caradoc-Davies @ 2018-03-17 20:51 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Ben Caradoc-Davies
Commit 7b6ddeaf27ec ("mac80211: use QoS NDP for AP probing") adds an
argument qos_ok to ieee80211_nullfunc_get to support QoS NDP. Despite
the claim in the commit log "Change all the drivers to *not* allow
QoS NDP for now, even though it looks like most of them should be OK
with that", this commit enables QoS NDP in response to beacons (see
change to mlme.c:ieee80211_send_nullfunc), causing ath9k_htc to lose
IP connectivity. See:
https://patchwork.kernel.org/patch/10241109/
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891060
This patch replaces the argument qos_ok of ieee80211_nullfunc_get
with an ieee80211_hw flag that drivers can use to declare support for
QoS NDP, allowing consistent behaviour between mlme.c and drivers.
Signed-off-by: Ben Caradoc-Davies <ben@transient.nz>
---
drivers/net/wireless/ath/ath9k/channel.c | 2 +-
drivers/net/wireless/st/cw1200/sta.c | 4 ++--
drivers/net/wireless/ti/wl1251/main.c | 2 +-
drivers/net/wireless/ti/wlcore/cmd.c | 5 ++---
include/net/mac80211.h | 12 +++++-------
net/mac80211/mlme.c | 2 +-
net/mac80211/tx.c | 5 ++---
7 files changed, 14 insertions(+), 18 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c
index 1b05b5d7a038..dfb26f03c1a2 100644
--- a/drivers/net/wireless/ath/ath9k/channel.c
+++ b/drivers/net/wireless/ath/ath9k/channel.c
@@ -1113,7 +1113,7 @@ ath_chanctx_send_vif_ps_frame(struct ath_softc *sc, struct ath_vif *avp,
if (!avp->assoc)
return false;
- skb = ieee80211_nullfunc_get(sc->hw, vif, false);
+ skb = ieee80211_nullfunc_get(sc->hw, vif);
if (!skb)
return false;
diff --git a/drivers/net/wireless/st/cw1200/sta.c b/drivers/net/wireless/st/cw1200/sta.c
index 38678e9a0562..03687a80d6e9 100644
--- a/drivers/net/wireless/st/cw1200/sta.c
+++ b/drivers/net/wireless/st/cw1200/sta.c
@@ -198,7 +198,7 @@ void __cw1200_cqm_bssloss_sm(struct cw1200_common *priv,
priv->bss_loss_state++;
- skb = ieee80211_nullfunc_get(priv->hw, priv->vif, false);
+ skb = ieee80211_nullfunc_get(priv->hw, priv->vif);
WARN_ON(!skb);
if (skb)
cw1200_tx(priv->hw, NULL, skb);
@@ -2265,7 +2265,7 @@ static int cw1200_upload_null(struct cw1200_common *priv)
.rate = 0xFF,
};
- frame.skb = ieee80211_nullfunc_get(priv->hw, priv->vif, false);
+ frame.skb = ieee80211_nullfunc_get(priv->hw, priv->vif);
if (!frame.skb)
return -ENOMEM;
diff --git a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c
index 037defd10b91..99a6889a6540 100644
--- a/drivers/net/wireless/ti/wl1251/main.c
+++ b/drivers/net/wireless/ti/wl1251/main.c
@@ -566,7 +566,7 @@ static int wl1251_build_null_data(struct wl1251 *wl)
size = sizeof(struct wl12xx_null_data_template);
ptr = NULL;
} else {
- skb = ieee80211_nullfunc_get(wl->hw, wl->vif, false);
+ skb = ieee80211_nullfunc_get(wl->hw, wl->vif);
if (!skb)
goto out;
size = skb->len;
diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c
index 761cf8573a80..2bfc12fdc929 100644
--- a/drivers/net/wireless/ti/wlcore/cmd.c
+++ b/drivers/net/wireless/ti/wlcore/cmd.c
@@ -1069,8 +1069,7 @@ int wl12xx_cmd_build_null_data(struct wl1271 *wl, struct wl12xx_vif *wlvif)
ptr = NULL;
} else {
skb = ieee80211_nullfunc_get(wl->hw,
- wl12xx_wlvif_to_vif(wlvif),
- false);
+ wl12xx_wlvif_to_vif(wlvif));
if (!skb)
goto out;
size = skb->len;
@@ -1097,7 +1096,7 @@ int wl12xx_cmd_build_klv_null_data(struct wl1271 *wl,
struct sk_buff *skb = NULL;
int ret = -ENOMEM;
- skb = ieee80211_nullfunc_get(wl->hw, vif, false);
+ skb = ieee80211_nullfunc_get(wl->hw, vif);
if (!skb)
goto out;
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index c96511fa9198..985f32c76ba9 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2063,6 +2063,9 @@ struct ieee80211_txq {
* @IEEE80211_HW_SUPPORTS_TDLS_BUFFER_STA: Hardware supports buffer STA on
* TDLS links.
*
+ * @IEEE80211_HW_SUPPORTS_QOS_NDP: The driver (or firmware) supports QoS NDP
+ * for AP probing.
+ *
* @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays
*/
enum ieee80211_hw_flags {
@@ -2106,6 +2109,7 @@ enum ieee80211_hw_flags {
IEEE80211_HW_REPORTS_LOW_ACK,
IEEE80211_HW_SUPPORTS_TX_FRAG,
IEEE80211_HW_SUPPORTS_TDLS_BUFFER_STA,
+ IEEE80211_HW_SUPPORTS_QOS_NDP,
/* keep last, obviously */
NUM_IEEE80211_HW_FLAGS
@@ -4478,24 +4482,18 @@ struct sk_buff *ieee80211_pspoll_get(struct ieee80211_hw *hw,
* ieee80211_nullfunc_get - retrieve a nullfunc template
* @hw: pointer obtained from ieee80211_alloc_hw().
* @vif: &struct ieee80211_vif pointer from the add_interface callback.
- * @qos_ok: QoS NDP is acceptable to the caller, this should be set
- * if at all possible
*
* Creates a Nullfunc template which can, for example, uploaded to
* hardware. The template must be updated after association so that correct
* BSSID and address is used.
*
- * If @qos_ndp is set and the association is to an AP with QoS/WMM, the
- * returned packet will be QoS NDP.
- *
* Note: Caller (or hardware) is responsible for setting the
* &IEEE80211_FCTL_PM bit as well as Duration and Sequence Control fields.
*
* Return: The nullfunc template. %NULL on error.
*/
struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif,
- bool qos_ok);
+ struct ieee80211_vif *vif);
/**
* ieee80211_probereq_get - retrieve a Probe Request template
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 39b660b9a908..cc55ff8ae979 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -896,7 +896,7 @@ void ieee80211_send_nullfunc(struct ieee80211_local *local,
struct ieee80211_hdr_3addr *nullfunc;
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
- skb = ieee80211_nullfunc_get(&local->hw, &sdata->vif, true);
+ skb = ieee80211_nullfunc_get(&local->hw, &sdata->vif);
if (!skb)
return;
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 69722504e3e1..885285dd247b 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -4448,8 +4448,7 @@ struct sk_buff *ieee80211_pspoll_get(struct ieee80211_hw *hw,
EXPORT_SYMBOL(ieee80211_pspoll_get);
struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif,
- bool qos_ok)
+ struct ieee80211_vif *vif)
{
struct ieee80211_hdr_3addr *nullfunc;
struct ieee80211_sub_if_data *sdata;
@@ -4465,7 +4464,7 @@ struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
ifmgd = &sdata->u.mgd;
local = sdata->local;
- if (qos_ok) {
+ if (ieee80211_hw_check(hw, SUPPORTS_QOS_NDP)) {
struct sta_info *sta;
rcu_read_lock();
--
Ben Caradoc-Davies <ben@transient.nz>
Director
Transient Software Limited <https://transient.nz/>
New Zealand
^ permalink raw reply related [flat|nested] 11+ messages in thread
end of thread, other threads:[~2018-03-21 23:11 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-18 23:38 [PATCH] mac80211: add ieee80211_hw flag for QoS NDP support Ben Caradoc-Davies
2018-03-18 23:50 ` Ben Caradoc-Davies
2018-03-19 10:46 ` kbuild test robot
2018-03-19 19:39 ` kbuild test robot
-- strict thread matches above, loose matches on Subject: below --
2018-03-18 23:57 Ben Caradoc-Davies
2018-03-21 9:53 ` Johannes Berg
2018-03-21 23:11 ` Ben Caradoc-Davies
2018-03-17 20:51 Ben Caradoc-Davies
2018-03-17 20:53 ` Ben Caradoc-Davies
2018-03-18 22:12 ` kbuild test robot
2018-03-18 23:36 ` Ben Caradoc-Davies
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.