aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 1c4f7daea6c7..4ab1ffa9df11 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1188,6 +1188,9 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
1188 if ((dev->wiphy.flags & WIPHY_FLAG_TDLS_EXTERNAL_SETUP) && 1188 if ((dev->wiphy.flags & WIPHY_FLAG_TDLS_EXTERNAL_SETUP) &&
1189 nla_put_flag(msg, NL80211_ATTR_TDLS_EXTERNAL_SETUP)) 1189 nla_put_flag(msg, NL80211_ATTR_TDLS_EXTERNAL_SETUP))
1190 goto nla_put_failure; 1190 goto nla_put_failure;
1191 if ((dev->wiphy.flags & WIPHY_FLAG_SUPPORTS_5_10_MHZ) &&
1192 nla_put_flag(msg, WIPHY_FLAG_SUPPORTS_5_10_MHZ))
1193 goto nla_put_failure;
1191 1194
1192 (*split_start)++; 1195 (*split_start)++;
1193 if (split) 1196 if (split)
@@ -1731,6 +1734,11 @@ static int nl80211_parse_chandef(struct cfg80211_registered_device *rdev,
1731 IEEE80211_CHAN_DISABLED)) 1734 IEEE80211_CHAN_DISABLED))
1732 return -EINVAL; 1735 return -EINVAL;
1733 1736
1737 if ((chandef->width == NL80211_CHAN_WIDTH_5 ||
1738 chandef->width == NL80211_CHAN_WIDTH_10) &&
1739 !(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_5_10_MHZ))
1740 return -EINVAL;
1741
1734 return 0; 1742 return 0;
1735} 1743}
1736 1744
@@ -6280,11 +6288,16 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
6280 if (!cfg80211_reg_can_beacon(&rdev->wiphy, &ibss.chandef)) 6288 if (!cfg80211_reg_can_beacon(&rdev->wiphy, &ibss.chandef))
6281 return -EINVAL; 6289 return -EINVAL;
6282 6290
6283 if (ibss.chandef.width > NL80211_CHAN_WIDTH_40) 6291 switch (ibss.chandef.width) {
6284 return -EINVAL; 6292 case NL80211_CHAN_WIDTH_20_NOHT:
6285 if (ibss.chandef.width != NL80211_CHAN_WIDTH_20_NOHT && 6293 break;
6286 !(rdev->wiphy.features & NL80211_FEATURE_HT_IBSS)) 6294 case NL80211_CHAN_WIDTH_20:
6295 case NL80211_CHAN_WIDTH_40:
6296 if (rdev->wiphy.features & NL80211_FEATURE_HT_IBSS)
6297 break;
6298 default:
6287 return -EINVAL; 6299 return -EINVAL;
6300 }
6288 6301
6289 ibss.channel_fixed = !!info->attrs[NL80211_ATTR_FREQ_FIXED]; 6302 ibss.channel_fixed = !!info->attrs[NL80211_ATTR_FREQ_FIXED];
6290 ibss.privacy = !!info->attrs[NL80211_ATTR_PRIVACY]; 6303 ibss.privacy = !!info->attrs[NL80211_ATTR_PRIVACY];