mac80211: add ieee80211_hw flag for QoS NDP support
authorBen Caradoc-Davies <ben@transient.nz>
Sun, 18 Mar 2018 23:57:44 +0000 (12:57 +1300)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 19 Apr 2018 10:13:03 +0000 (11:13 +0100)
(Backport to v4.15.4)

Commit 7b6ddeaf27ec ("mac80211: use QoS NDP for AP probing") added 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

Introduce a hardware flag to allow such buggy drivers to override the
correct default behaviour of mac80211 of sending QoS NDP packets.

Signed-off-by: Ben Caradoc-Davies <ben@transient.nz>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name mac80211-add-ieee8211_hw-flag-for-qos-ndp-support.patch

include/net/mac80211.h
net/mac80211/debugfs.c
net/mac80211/mlme.c

index eec143cca1c0f118ac6e0447ebb55c6c7b1c2057..35119b63871c23455c304e6bd33b0e27ce3f917c 100644 (file)
@@ -2056,6 +2056,9 @@ struct ieee80211_txq {
  *     The stack will not do fragmentation.
  *     The callback for @set_frag_threshold should be set as well.
  *
+ * @IEEE80211_HW_DOESNT_SUPPORT_QOS_NDP: The driver (or firmware) doesn't
+ *     support QoS NDP for AP probing - that's most likely a driver bug.
+ *
  * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays
  */
 enum ieee80211_hw_flags {
@@ -2098,6 +2101,7 @@ enum ieee80211_hw_flags {
        IEEE80211_HW_TX_FRAG_LIST,
        IEEE80211_HW_REPORTS_LOW_ACK,
        IEEE80211_HW_SUPPORTS_TX_FRAG,
+       IEEE80211_HW_DOESNT_SUPPORT_QOS_NDP,
 
        /* keep last, obviously */
        NUM_IEEE80211_HW_FLAGS
index 5fae001f286ceb255f48236d297e3b05c6e8eac4..5d49fc24434bd371c93d7b960257dd94e15ffaba 100644 (file)
@@ -211,6 +211,7 @@ static const char *hw_flag_names[] = {
        FLAG(TX_FRAG_LIST),
        FLAG(REPORTS_LOW_ACK),
        FLAG(SUPPORTS_TX_FRAG),
+       FLAG(DOESNT_SUPPORT_QOS_NDP),
 #undef FLAG
 };
 
index c244691deab9c6dcae91305e429092dd6e23f1e2..38db2ef115fc40cf222a2dc0901fdb15a4edd14f 100644 (file)
@@ -895,7 +895,8 @@ 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,
+               !ieee80211_hw_check(&local->hw, DOESNT_SUPPORT_QOS_NDP));
        if (!skb)
                return;