diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-12-14 11:54:28 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-12-15 17:03:56 -0500 |
commit | a293911d4fd5e8593dbf478399a77f990d466269 (patch) | |
tree | 826f614f178e915c4d2c08aba9ca5b2a38f78c75 /net/wireless/nl80211.c | |
parent | 14a085e77063090fb12ad391d0f4d46e593be225 (diff) |
nl80211: advertise maximum remain-on-channel duration
With the upcoming hardware offload implementation,
some devices will have a different maximum duration
for the remain-on-channel command. Advertise the
maximum duration in mac80211, and make mac80211 set
it.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 53f044370cde..594a6ac8b9d2 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -755,6 +755,10 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags, | |||
755 | 755 | ||
756 | nla_nest_end(msg, nl_cmds); | 756 | nla_nest_end(msg, nl_cmds); |
757 | 757 | ||
758 | if (dev->ops->remain_on_channel) | ||
759 | NLA_PUT_U32(msg, NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION, | ||
760 | dev->wiphy.max_remain_on_channel_duration); | ||
761 | |||
758 | /* for now at least assume all drivers have it */ | 762 | /* for now at least assume all drivers have it */ |
759 | if (dev->ops->mgmt_tx) | 763 | if (dev->ops->mgmt_tx) |
760 | NLA_PUT_FLAG(msg, NL80211_ATTR_OFFCHANNEL_TX_OK); | 764 | NLA_PUT_FLAG(msg, NL80211_ATTR_OFFCHANNEL_TX_OK); |
@@ -4228,7 +4232,8 @@ static int nl80211_remain_on_channel(struct sk_buff *skb, | |||
4228 | * We should be on that channel for at least one jiffie, | 4232 | * We should be on that channel for at least one jiffie, |
4229 | * and more than 5 seconds seems excessive. | 4233 | * and more than 5 seconds seems excessive. |
4230 | */ | 4234 | */ |
4231 | if (!duration || !msecs_to_jiffies(duration) || duration > 5000) | 4235 | if (!duration || !msecs_to_jiffies(duration) || |
4236 | duration > rdev->wiphy.max_remain_on_channel_duration) | ||
4232 | return -EINVAL; | 4237 | return -EINVAL; |
4233 | 4238 | ||
4234 | if (!rdev->ops->remain_on_channel) | 4239 | if (!rdev->ops->remain_on_channel) |