aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/nl80211.h5
-rw-r--r--include/net/cfg80211.h5
-rw-r--r--net/mac80211/main.c2
-rw-r--r--net/wireless/nl80211.c7
4 files changed, 18 insertions, 1 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index b8fa25d741ba..1cee56b3a79a 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -773,6 +773,9 @@ enum nl80211_commands {
773 * cache, a wiphy attribute. 773 * cache, a wiphy attribute.
774 * 774 *
775 * @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32. 775 * @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32.
776 * @NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION: Device attribute that
777 * specifies the maximum duration that can be requested with the
778 * remain-on-channel operation, in milliseconds, u32.
776 * 779 *
777 * @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects. 780 * @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects.
778 * 781 *
@@ -1035,6 +1038,8 @@ enum nl80211_attrs {
1035 1038
1036 NL80211_ATTR_KEY_DEFAULT_TYPES, 1039 NL80211_ATTR_KEY_DEFAULT_TYPES,
1037 1040
1041 NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION,
1042
1038 /* add attributes here, update the policy in nl80211.c */ 1043 /* add attributes here, update the policy in nl80211.c */
1039 1044
1040 __NL80211_ATTR_AFTER_LAST, 1045 __NL80211_ATTR_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 22be7c625b70..f45e15f12446 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1474,6 +1474,9 @@ struct ieee80211_txrx_stypes {
1474 * 1474 *
1475 * @available_antennas: bitmap of antennas which are available to configure. 1475 * @available_antennas: bitmap of antennas which are available to configure.
1476 * antenna configuration commands will be rejected unless this is set. 1476 * antenna configuration commands will be rejected unless this is set.
1477 *
1478 * @max_remain_on_channel_duration: Maximum time a remain-on-channel operation
1479 * may request, if implemented.
1477 */ 1480 */
1478struct wiphy { 1481struct wiphy {
1479 /* assign these fields before you register the wiphy */ 1482 /* assign these fields before you register the wiphy */
@@ -1511,6 +1514,8 @@ struct wiphy {
1511 char fw_version[ETHTOOL_BUSINFO_LEN]; 1514 char fw_version[ETHTOOL_BUSINFO_LEN];
1512 u32 hw_version; 1515 u32 hw_version;
1513 1516
1517 u16 max_remain_on_channel_duration;
1518
1514 u8 max_num_pmkids; 1519 u8 max_num_pmkids;
1515 1520
1516 u32 available_antennas; 1521 u32 available_antennas;
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index f7bdb7c78879..d87eb005690f 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -745,6 +745,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
745 } 745 }
746 } 746 }
747 747
748 local->hw.wiphy->max_remain_on_channel_duration = 5000;
749
748 result = wiphy_register(local->hw.wiphy); 750 result = wiphy_register(local->hw.wiphy);
749 if (result < 0) 751 if (result < 0)
750 goto fail_wiphy_register; 752 goto fail_wiphy_register;
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)