]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mac80211: 802.11w - Add driver capability flag for MFP
authorJouni Malinen <j@w1.fi>
Thu, 8 Jan 2009 11:32:11 +0000 (13:32 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 29 Jan 2009 21:00:08 +0000 (16:00 -0500)
This allows user space to determine whether a driver supports MFP and
behave properly without having to ask user to configure this in
MFP-optional mode.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
include/net/mac80211.h
net/mac80211/wext.c

index 00a50a38c7f237fa8add4ecb7d4e3dc2b4851943..9bca2abbf038d1a4a413278d0cf668230eeffaa4 100644 (file)
@@ -865,6 +865,9 @@ enum ieee80211_tkip_key_type {
  *
  * @IEEE80211_HW_SUPPORTS_DYNAMIC_PS:
  *     Hardware has support for dynamic PS.
+ *
+ * @IEEE80211_HW_MFP_CAPABLE:
+ *     Hardware supports management frame protection (MFP, IEEE 802.11w).
  */
 enum ieee80211_hw_flags {
        IEEE80211_HW_RX_INCLUDES_FCS                    = 1<<1,
@@ -880,6 +883,7 @@ enum ieee80211_hw_flags {
        IEEE80211_HW_SUPPORTS_PS                        = 1<<11,
        IEEE80211_HW_PS_NULLFUNC_STACK                  = 1<<12,
        IEEE80211_HW_SUPPORTS_DYNAMIC_PS                = 1<<13,
+       IEEE80211_HW_MFP_CAPABLE                        = 1<<14,
 };
 
 /**
index 2dd387495dfeb6b03e9096d6ef2ac60040a766fc..70a29b657b61dab22b0ee203747d19dbadd48f4d 100644 (file)
@@ -976,6 +976,10 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev,
                        ret = -EOPNOTSUPP;
                break;
        case IW_AUTH_MFP:
+               if (!(sdata->local->hw.flags & IEEE80211_HW_MFP_CAPABLE)) {
+                       ret = -EOPNOTSUPP;
+                       break;
+               }
                if (sdata->vif.type == NL80211_IFTYPE_STATION ||
                    sdata->vif.type == NL80211_IFTYPE_ADHOC)
                        sdata->u.sta.mfp = data->value;