Commit 4375d083 authored by Jouni Malinen's avatar Jouni Malinen Committed by John W. Linville

mac80211: 802.11w - Add driver capability flag for MFP

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: default avatarJouni Malinen <jouni.malinen@atheros.com>
Acked-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 1f7d77ab
...@@ -865,6 +865,9 @@ enum ieee80211_tkip_key_type { ...@@ -865,6 +865,9 @@ enum ieee80211_tkip_key_type {
* *
* @IEEE80211_HW_SUPPORTS_DYNAMIC_PS: * @IEEE80211_HW_SUPPORTS_DYNAMIC_PS:
* Hardware has support for 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 { enum ieee80211_hw_flags {
IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, IEEE80211_HW_RX_INCLUDES_FCS = 1<<1,
...@@ -880,6 +883,7 @@ enum ieee80211_hw_flags { ...@@ -880,6 +883,7 @@ enum ieee80211_hw_flags {
IEEE80211_HW_SUPPORTS_PS = 1<<11, IEEE80211_HW_SUPPORTS_PS = 1<<11,
IEEE80211_HW_PS_NULLFUNC_STACK = 1<<12, IEEE80211_HW_PS_NULLFUNC_STACK = 1<<12,
IEEE80211_HW_SUPPORTS_DYNAMIC_PS = 1<<13, IEEE80211_HW_SUPPORTS_DYNAMIC_PS = 1<<13,
IEEE80211_HW_MFP_CAPABLE = 1<<14,
}; };
/** /**
......
...@@ -976,6 +976,10 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev, ...@@ -976,6 +976,10 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev,
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
break; break;
case IW_AUTH_MFP: case IW_AUTH_MFP:
if (!(sdata->local->hw.flags & IEEE80211_HW_MFP_CAPABLE)) {
ret = -EOPNOTSUPP;
break;
}
if (sdata->vif.type == NL80211_IFTYPE_STATION || if (sdata->vif.type == NL80211_IFTYPE_STATION ||
sdata->vif.type == NL80211_IFTYPE_ADHOC) sdata->vif.type == NL80211_IFTYPE_ADHOC)
sdata->u.sta.mfp = data->value; sdata->u.sta.mfp = data->value;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment