aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>2012-03-02 05:20:02 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-03-05 15:38:34 -0500
commit1b658f118b11de3c4052ed8cbdd5803cd1fa5670 (patch)
tree162160c05d29fc99b18d1914ffe2d614f2c9af6a /net/wireless/nl80211.c
parentd665508b98d3cdbeb476e7d6848a513184a81ed0 (diff)
cfg80211: Add an attribute to set inactivity timeout in AP mode
This patch adds an attribute, NL80211_ATTR_INACTIVITY_TIMEOUT, to set the inactivity timeout which can be used to remove the station in AP mode. This can be passed in NL80211_CMD_START_AP and used by the drivers which have AP MLME in firmware but don't support get_station() properly. To disable inactivity timer in userspace, wpa_s for example, there is a new flag, NL80211_FEATURE_INACTIVITY_TIMER, in nl80211_feature_flags through which drivers can register their capability to use the inactivity timeout to free the stations. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 25a470abd21d..4b6afc338aac 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -204,6 +204,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
204 .len = NL80211_HT_CAPABILITY_LEN 204 .len = NL80211_HT_CAPABILITY_LEN
205 }, 205 },
206 [NL80211_ATTR_NOACK_MAP] = { .type = NLA_U16 }, 206 [NL80211_ATTR_NOACK_MAP] = { .type = NLA_U16 },
207 [NL80211_ATTR_INACTIVITY_TIMEOUT] = { .type = NLA_U16 },
207}; 208};
208 209
209/* policy for the key attributes */ 210/* policy for the key attributes */
@@ -2214,6 +2215,13 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
2214 if (err) 2215 if (err)
2215 return err; 2216 return err;
2216 2217
2218 if (info->attrs[NL80211_ATTR_INACTIVITY_TIMEOUT]) {
2219 if (!(rdev->wiphy.features & NL80211_FEATURE_INACTIVITY_TIMER))
2220 return -EOPNOTSUPP;
2221 params.inactivity_timeout = nla_get_u16(
2222 info->attrs[NL80211_ATTR_INACTIVITY_TIMEOUT]);
2223 }
2224
2217 err = rdev->ops->start_ap(&rdev->wiphy, dev, &params); 2225 err = rdev->ops->start_ap(&rdev->wiphy, dev, &params);
2218 if (!err) 2226 if (!err)
2219 wdev->beacon_interval = params.beacon_interval; 2227 wdev->beacon_interval = params.beacon_interval;