OSDN Git Service

mac80211: Set CAN_REPLACE_PTK0 for SW crypto only drivers
authorAlexander Wetzel <alexander@wetzel-home.de>
Wed, 24 Apr 2019 17:32:46 +0000 (19:32 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 26 Apr 2019 11:02:11 +0000 (13:02 +0200)
Mac80211 SW crypto handles replacing PTK keys correctly.

Don't trigger needless warnings or workarounds when the driver can only
use the known good SW crypto provided by mac80211.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/main.c

index e56650a..2b60804 100644 (file)
@@ -1060,6 +1060,13 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
                wiphy_ext_feature_set(local->hw.wiphy,
                                      NL80211_EXT_FEATURE_EXT_KEY_ID);
 
+       /* Mac80211 and therefore all cards only using SW crypto are able to
+        * handle PTK rekeys correctly
+        */
+       if (!local->ops->set_key)
+               wiphy_ext_feature_set(local->hw.wiphy,
+                                     NL80211_EXT_FEATURE_CAN_REPLACE_PTK0);
+
        /*
         * Calculate scan IE length -- we need this to alloc
         * memory and to subtract from the driver limit. It