Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 225303
b: refs/heads/master
c: a293911
h: refs/heads/master
i:
  225301: 1edc17b
  225299: daad8ad
  225295: 7240b70
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Dec 15, 2010
1 parent 56c4e6d commit 59568bb
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 14a085e77063090fb12ad391d0f4d46e593be225
refs/heads/master: a293911d4fd5e8593dbf478399a77f990d466269
5 changes: 5 additions & 0 deletions trunk/include/linux/nl80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,9 @@ enum nl80211_commands {
* cache, a wiphy attribute.
*
* @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32.
* @NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION: Device attribute that
* specifies the maximum duration that can be requested with the
* remain-on-channel operation, in milliseconds, u32.
*
* @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects.
*
Expand Down Expand Up @@ -1035,6 +1038,8 @@ enum nl80211_attrs {

NL80211_ATTR_KEY_DEFAULT_TYPES,

NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION,

/* add attributes here, update the policy in nl80211.c */

__NL80211_ATTR_AFTER_LAST,
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -1474,6 +1474,9 @@ struct ieee80211_txrx_stypes {
*
* @available_antennas: bitmap of antennas which are available to configure.
* antenna configuration commands will be rejected unless this is set.
*
* @max_remain_on_channel_duration: Maximum time a remain-on-channel operation
* may request, if implemented.
*/
struct wiphy {
/* assign these fields before you register the wiphy */
Expand Down Expand Up @@ -1511,6 +1514,8 @@ struct wiphy {
char fw_version[ETHTOOL_BUSINFO_LEN];
u32 hw_version;

u16 max_remain_on_channel_duration;

u8 max_num_pmkids;

u32 available_antennas;
Expand Down
2 changes: 2 additions & 0 deletions trunk/net/mac80211/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
}
}

local->hw.wiphy->max_remain_on_channel_duration = 5000;

result = wiphy_register(local->hw.wiphy);
if (result < 0)
goto fail_wiphy_register;
Expand Down
7 changes: 6 additions & 1 deletion trunk/net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,10 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags,

nla_nest_end(msg, nl_cmds);

if (dev->ops->remain_on_channel)
NLA_PUT_U32(msg, NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION,
dev->wiphy.max_remain_on_channel_duration);

/* for now at least assume all drivers have it */
if (dev->ops->mgmt_tx)
NLA_PUT_FLAG(msg, NL80211_ATTR_OFFCHANNEL_TX_OK);
Expand Down Expand Up @@ -4228,7 +4232,8 @@ static int nl80211_remain_on_channel(struct sk_buff *skb,
* We should be on that channel for at least one jiffie,
* and more than 5 seconds seems excessive.
*/
if (!duration || !msecs_to_jiffies(duration) || duration > 5000)
if (!duration || !msecs_to_jiffies(duration) ||
duration > rdev->wiphy.max_remain_on_channel_duration)
return -EINVAL;

if (!rdev->ops->remain_on_channel)
Expand Down

0 comments on commit 59568bb

Please sign in to comment.