diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-04-22 11:45:38 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-04-22 16:57:20 -0400 |
commit | 8e30bc55de98c000b0b836cb42525c82f605f191 (patch) | |
tree | 6b413976c2064157c3268b87921d4e2a7595f831 /net/wireless | |
parent | e255d5eb2b478eec1416b46aea03798b64355402 (diff) |
nl80211: allow configuring IBSS beacon interval
Make the JOIN_IBSS command look at the beacon interval
attribute to see if the user requested a specific beacon
interval, if not default to 100 TU (wext too).
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/ibss.c | 3 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 12 |
2 files changed, 14 insertions, 1 deletions
diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c index b5c601e1b1b7..3c38afaed28a 100644 --- a/net/wireless/ibss.c +++ b/net/wireless/ibss.c | |||
@@ -116,6 +116,9 @@ static int cfg80211_ibss_wext_join(struct cfg80211_registered_device *rdev, | |||
116 | enum ieee80211_band band; | 116 | enum ieee80211_band band; |
117 | int i; | 117 | int i; |
118 | 118 | ||
119 | if (!wdev->wext.beacon_interval) | ||
120 | wdev->wext.beacon_interval = 100; | ||
121 | |||
119 | /* try to find an IBSS channel if none requested ... */ | 122 | /* try to find an IBSS channel if none requested ... */ |
120 | if (!wdev->wext.channel) { | 123 | if (!wdev->wext.channel) { |
121 | for (band = 0; band < IEEE80211_NUM_BANDS; band++) { | 124 | for (band = 0; band < IEEE80211_NUM_BANDS; band++) { |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 97bb5c80125d..3b21b3e89e96 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -3159,6 +3159,8 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info) | |||
3159 | struct wiphy *wiphy; | 3159 | struct wiphy *wiphy; |
3160 | int err; | 3160 | int err; |
3161 | 3161 | ||
3162 | memset(&ibss, 0, sizeof(ibss)); | ||
3163 | |||
3162 | if (!is_valid_ie_attr(info->attrs[NL80211_ATTR_IE])) | 3164 | if (!is_valid_ie_attr(info->attrs[NL80211_ATTR_IE])) |
3163 | return -EINVAL; | 3165 | return -EINVAL; |
3164 | 3166 | ||
@@ -3167,6 +3169,15 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info) | |||
3167 | !nla_len(info->attrs[NL80211_ATTR_SSID])) | 3169 | !nla_len(info->attrs[NL80211_ATTR_SSID])) |
3168 | return -EINVAL; | 3170 | return -EINVAL; |
3169 | 3171 | ||
3172 | ibss.beacon_interval = 100; | ||
3173 | |||
3174 | if (info->attrs[NL80211_ATTR_BEACON_INTERVAL]) { | ||
3175 | ibss.beacon_interval = | ||
3176 | nla_get_u32(info->attrs[NL80211_ATTR_BEACON_INTERVAL]); | ||
3177 | if (ibss.beacon_interval < 1 || ibss.beacon_interval > 10000) | ||
3178 | return -EINVAL; | ||
3179 | } | ||
3180 | |||
3170 | rtnl_lock(); | 3181 | rtnl_lock(); |
3171 | 3182 | ||
3172 | err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); | 3183 | err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); |
@@ -3189,7 +3200,6 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info) | |||
3189 | } | 3200 | } |
3190 | 3201 | ||
3191 | wiphy = &drv->wiphy; | 3202 | wiphy = &drv->wiphy; |
3192 | memset(&ibss, 0, sizeof(ibss)); | ||
3193 | 3203 | ||
3194 | if (info->attrs[NL80211_ATTR_MAC]) | 3204 | if (info->attrs[NL80211_ATTR_MAC]) |
3195 | ibss.bssid = nla_data(info->attrs[NL80211_ATTR_MAC]); | 3205 | ibss.bssid = nla_data(info->attrs[NL80211_ATTR_MAC]); |