]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mac80211: 802.11w - Configuration of MFP disabled/optional/required
authorJouni Malinen <j@w1.fi>
Thu, 8 Jan 2009 11:32:05 +0000 (13:32 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 29 Jan 2009 21:00:05 +0000 (16:00 -0500)
Add new WEXT IW_AUTH_* parameter for setting MFP
disabled/optional/required.

Signed-off-by: Jouni Malinen <j@w1.fi>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
include/linux/wireless.h
net/mac80211/ieee80211_i.h
net/mac80211/mlme.c
net/mac80211/wext.c

index 5d1f3fbffd779462d6429e01f29c43e053f96b27..cb24204851f7e7118a25c8db99d60030c03b1c3a 100644 (file)
 #define IW_AUTH_ROAMING_CONTROL                9
 #define IW_AUTH_PRIVACY_INVOKED                10
 #define IW_AUTH_CIPHER_GROUP_MGMT      11
+#define IW_AUTH_MFP                    12
 
 /* IW_AUTH_WPA_VERSION values (bit field) */
 #define IW_AUTH_WPA_VERSION_DISABLED   0x00000001
 #define IW_AUTH_ROAMING_DISABLE        1       /* user space program used for roaming
                                         * control */
 
+/* IW_AUTH_MFP (management frame protection) values */
+#define IW_AUTH_MFP_DISABLED   0       /* MFP disabled */
+#define IW_AUTH_MFP_OPTIONAL   1       /* MFP optional */
+#define IW_AUTH_MFP_REQUIRED   2       /* MFP required */
+
 /* SIOCSIWENCODEEXT definitions */
 #define IW_ENCODE_SEQ_MAX_SIZE 8
 /* struct iw_encode_ext ->alg */
index 8c3245717c5535318aa169ce522f2f147cb3b4b0..212c732fbba7acd8f5615069552abbabde710514 100644 (file)
@@ -320,6 +320,12 @@ struct ieee80211_if_sta {
        int auth_alg; /* currently used IEEE 802.11 authentication algorithm */
        int auth_transaction;
 
+       enum {
+               IEEE80211_MFP_DISABLED,
+               IEEE80211_MFP_OPTIONAL,
+               IEEE80211_MFP_REQUIRED
+       } mfp; /* management frame protection */
+
        unsigned long ibss_join_req;
        struct sk_buff *probe_resp; /* ProbeResp template for IBSS */
        u32 supp_rates_bits[IEEE80211_NUM_BANDS];
index bc8a7f1a6a15747488256731b7b37216ed39ec29..42c5f981c715f7c28f3196d5849cdb9666ff63ce 100644 (file)
@@ -2317,6 +2317,10 @@ static int ieee80211_sta_config_auth(struct ieee80211_sub_if_data *sdata,
                                               selected->ssid_len);
                ieee80211_sta_set_bssid(sdata, selected->bssid);
                ieee80211_sta_def_wmm_params(sdata, selected);
+               if (sdata->u.sta.mfp == IEEE80211_MFP_REQUIRED)
+                       sdata->u.sta.flags |= IEEE80211_STA_MFP_ENABLED;
+               else
+                       sdata->u.sta.flags &= ~IEEE80211_STA_MFP_ENABLED;
 
                /* Send out direct probe if no probe resp was received or
                 * the one we have is outdated
index 7ba1d5ba3afad51de656887cf0aa35cc31c167b8..2dd387495dfeb6b03e9096d6ef2ac60040a766fc 100644 (file)
@@ -975,6 +975,13 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev,
                else
                        ret = -EOPNOTSUPP;
                break;
+       case IW_AUTH_MFP:
+               if (sdata->vif.type == NL80211_IFTYPE_STATION ||
+                   sdata->vif.type == NL80211_IFTYPE_ADHOC)
+                       sdata->u.sta.mfp = data->value;
+               else
+                       ret = -EOPNOTSUPP;
+               break;
        default:
                ret = -EOPNOTSUPP;
                break;