aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/nl80211.h10
-rw-r--r--include/net/cfg80211.h3
-rw-r--r--net/wireless/nl80211.c8
-rw-r--r--net/wireless/wext-sme.c3
4 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index c37d67add090..e474f6e780cc 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -369,6 +369,11 @@
369 * %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT, 369 * %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT,
370 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and 370 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and
371 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT. 371 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT.
372 * Background scan period can optionally be
373 * specified in %NL80211_ATTR_BG_SCAN_PERIOD,
374 * if not specified default background scan configuration
375 * in driver is used and if period value is 0, bg scan will be disabled.
376 * This attribute is ignored if driver does not support roam scan.
372 * It is also sent as an event, with the BSSID and response IEs when the 377 * It is also sent as an event, with the BSSID and response IEs when the
373 * connection is established or failed to be established. This can be 378 * connection is established or failed to be established. This can be
374 * determined by the STATUS_CODE attribute. 379 * determined by the STATUS_CODE attribute.
@@ -1207,6 +1212,9 @@ enum nl80211_commands {
1207 * this attribute is (depending on the driver capabilities) added to 1212 * this attribute is (depending on the driver capabilities) added to
1208 * received frames indicated with %NL80211_CMD_FRAME. 1213 * received frames indicated with %NL80211_CMD_FRAME.
1209 * 1214 *
1215 * @NL80211_ATTR_BG_SCAN_PERIOD: Background scan period in seconds
1216 * or 0 to disable background scan.
1217 *
1210 * @NL80211_ATTR_MAX: highest attribute number currently defined 1218 * @NL80211_ATTR_MAX: highest attribute number currently defined
1211 * @__NL80211_ATTR_AFTER_LAST: internal use 1219 * @__NL80211_ATTR_AFTER_LAST: internal use
1212 */ 1220 */
@@ -1456,6 +1464,8 @@ enum nl80211_attrs {
1456 1464
1457 NL80211_ATTR_RX_SIGNAL_DBM, 1465 NL80211_ATTR_RX_SIGNAL_DBM,
1458 1466
1467 NL80211_ATTR_BG_SCAN_PERIOD,
1468
1459 /* add attributes here, update the policy in nl80211.c */ 1469 /* add attributes here, update the policy in nl80211.c */
1460 1470
1461 __NL80211_ATTR_AFTER_LAST, 1471 __NL80211_ATTR_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 57c9fddc2acf..66f460325e24 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1203,6 +1203,8 @@ struct cfg80211_ibss_params {
1203 * @key_idx: index of WEP key for shared key authentication 1203 * @key_idx: index of WEP key for shared key authentication
1204 * @key: WEP key for shared key authentication 1204 * @key: WEP key for shared key authentication
1205 * @flags: See &enum cfg80211_assoc_req_flags 1205 * @flags: See &enum cfg80211_assoc_req_flags
1206 * @bg_scan_period: Background scan period in seconds
1207 * or -1 to indicate that default value is to be used.
1206 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask 1208 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask
1207 * will be used in ht_capa. Un-supported values will be ignored. 1209 * will be used in ht_capa. Un-supported values will be ignored.
1208 * @ht_capa_mask: The bits of ht_capa which are to be used. 1210 * @ht_capa_mask: The bits of ht_capa which are to be used.
@@ -1220,6 +1222,7 @@ struct cfg80211_connect_params {
1220 const u8 *key; 1222 const u8 *key;
1221 u8 key_len, key_idx; 1223 u8 key_len, key_idx;
1222 u32 flags; 1224 u32 flags;
1225 int bg_scan_period;
1223 struct ieee80211_ht_cap ht_capa; 1226 struct ieee80211_ht_cap ht_capa;
1224 struct ieee80211_ht_cap ht_capa_mask; 1227 struct ieee80211_ht_cap ht_capa_mask;
1225}; 1228};
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 39dbdf2adb12..4c1eb9472ddb 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -205,6 +205,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
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 [NL80211_ATTR_INACTIVITY_TIMEOUT] = { .type = NLA_U16 },
208 [NL80211_ATTR_BG_SCAN_PERIOD] = { .type = NLA_U16 },
208}; 209};
209 210
210/* policy for the key attributes */ 211/* policy for the key attributes */
@@ -5116,6 +5117,13 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
5116 5117
5117 wiphy = &rdev->wiphy; 5118 wiphy = &rdev->wiphy;
5118 5119
5120 connect.bg_scan_period = -1;
5121 if (info->attrs[NL80211_ATTR_BG_SCAN_PERIOD] &&
5122 (wiphy->flags & WIPHY_FLAG_SUPPORTS_FW_ROAM)) {
5123 connect.bg_scan_period =
5124 nla_get_u16(info->attrs[NL80211_ATTR_BG_SCAN_PERIOD]);
5125 }
5126
5119 if (info->attrs[NL80211_ATTR_MAC]) 5127 if (info->attrs[NL80211_ATTR_MAC])
5120 connect.bssid = nla_data(info->attrs[NL80211_ATTR_MAC]); 5128 connect.bssid = nla_data(info->attrs[NL80211_ATTR_MAC]);
5121 connect.ssid = nla_data(info->attrs[NL80211_ATTR_SSID]); 5129 connect.ssid = nla_data(info->attrs[NL80211_ATTR_SSID]);
diff --git a/net/wireless/wext-sme.c b/net/wireless/wext-sme.c
index 326750b99151..7c01c2f3b6cf 100644
--- a/net/wireless/wext-sme.c
+++ b/net/wireless/wext-sme.c
@@ -30,6 +30,9 @@ int cfg80211_mgd_wext_connect(struct cfg80211_registered_device *rdev,
30 wdev->wext.connect.ie = wdev->wext.ie; 30 wdev->wext.connect.ie = wdev->wext.ie;
31 wdev->wext.connect.ie_len = wdev->wext.ie_len; 31 wdev->wext.connect.ie_len = wdev->wext.ie_len;
32 32
33 /* Use default background scan period */
34 wdev->wext.connect.bg_scan_period = -1;
35
33 if (wdev->wext.keys) { 36 if (wdev->wext.keys) {
34 wdev->wext.keys->def = wdev->wext.default_key; 37 wdev->wext.keys->def = wdev->wext.default_key;
35 wdev->wext.keys->defmgmt = wdev->wext.default_mgmt_key; 38 wdev->wext.keys->defmgmt = wdev->wext.default_mgmt_key;