Skip to content

Commit e9829b9

Browse files
committed
Merge tag 'mac80211-next-for-davem-2015-10-21' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Johannes Berg says: ==================== Here's another set of patches for the current cycle: * I merged net-next back to avoid a conflict with the * cfg80211 scheduled scan API extensions * preparations for better scan result timestamping * regulatory cleanups * mac80211 statistics cleanups * a few other small cleanups and fixes ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents c7fc9eb + e5a9f8d commit e9829b9

File tree

41 files changed

+910
-659
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+910
-659
lines changed

Documentation/DocBook/80211.tmpl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,9 @@
154154
!Finclude/net/cfg80211.h cfg80211_scan_request
155155
!Finclude/net/cfg80211.h cfg80211_scan_done
156156
!Finclude/net/cfg80211.h cfg80211_bss
157-
!Finclude/net/cfg80211.h cfg80211_inform_bss_width_frame
158-
!Finclude/net/cfg80211.h cfg80211_inform_bss_width
157+
!Finclude/net/cfg80211.h cfg80211_inform_bss
158+
!Finclude/net/cfg80211.h cfg80211_inform_bss_frame_data
159+
!Finclude/net/cfg80211.h cfg80211_inform_bss_data
159160
!Finclude/net/cfg80211.h cfg80211_unlink_bss
160161
!Finclude/net/cfg80211.h cfg80211_find_ie
161162
!Finclude/net/cfg80211.h ieee80211_bss_get_ie

drivers/net/wireless/ath/ath6kl/cfg80211.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3312,7 +3312,7 @@ static int ath6kl_cfg80211_sscan_start(struct wiphy *wiphy,
33123312
}
33133313

33143314
/* fw uses seconds, also make sure that it's >0 */
3315-
interval = max_t(u16, 1, request->interval / 1000);
3315+
interval = max_t(u16, 1, request->scan_plans[0].interval);
33163316

33173317
ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx,
33183318
interval, interval,

drivers/net/wireless/iwlwifi/mvm/ops.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ static void iwl_op_mode_mvm_stop(struct iwl_op_mode *op_mode)
630630
kfree(mvm->d3_resume_sram);
631631
if (mvm->nd_config) {
632632
kfree(mvm->nd_config->match_sets);
633+
kfree(mvm->nd_config->scan_plans);
633634
kfree(mvm->nd_config);
634635
mvm->nd_config = NULL;
635636
}

drivers/net/wireless/iwlwifi/mvm/scan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,12 +1271,12 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm,
12711271

12721272
params.type = iwl_mvm_get_scan_type(mvm, vif, &params);
12731273

1274-
if (req->interval > U16_MAX) {
1274+
if (req->scan_plans[0].interval > U16_MAX) {
12751275
IWL_DEBUG_SCAN(mvm,
12761276
"interval value is > 16-bits, set to max possible\n");
12771277
params.interval = U16_MAX;
12781278
} else {
1279-
params.interval = req->interval / MSEC_PER_SEC;
1279+
params.interval = req->scan_plans[0].interval;
12801280
}
12811281

12821282
/* In theory, LMAC scans can handle a 32-bit delay, but since

drivers/net/wireless/rt2x00/rt2x00config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
266266
if (beacon_diff > beacon_int)
267267
beacon_diff = 0;
268268

269-
autowake_timeout = (conf->max_sleep_period * beacon_int) - beacon_diff;
269+
autowake_timeout = (conf->ps_dtim_period * beacon_int) - beacon_diff;
270270
queue_delayed_work(rt2x00dev->workqueue,
271271
&rt2x00dev->autowakeup_work,
272272
autowake_timeout - 15);

drivers/net/wireless/ti/wl12xx/scan.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,8 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
350350
cfg->bss_type = SCAN_BSS_TYPE_ANY;
351351
/* currently NL80211 supports only a single interval */
352352
for (i = 0; i < SCAN_MAX_CYCLE_INTERVALS; i++)
353-
cfg->intervals[i] = cpu_to_le32(req->interval);
353+
cfg->intervals[i] = cpu_to_le32(req->scan_plans[0].interval *
354+
MSEC_PER_SEC);
354355

355356
cfg->ssid_len = 0;
356357
ret = wlcore_scan_sched_scan_ssid_list(wl, wlvif, req);

drivers/net/wireless/ti/wl18xx/scan.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,15 @@ int wl18xx_scan_sched_scan_config(struct wl1271 *wl,
228228
wl18xx_adjust_channels(cmd, cmd_channels);
229229

230230
if (c->num_short_intervals && c->long_interval &&
231-
c->long_interval > req->interval) {
232-
cmd->short_cycles_msec = cpu_to_le16(req->interval);
231+
c->long_interval > req->scan_plans[0].interval * MSEC_PER_SEC) {
232+
cmd->short_cycles_msec =
233+
cpu_to_le16(req->scan_plans[0].interval * MSEC_PER_SEC);
233234
cmd->long_cycles_msec = cpu_to_le16(c->long_interval);
234235
cmd->short_cycles_count = c->num_short_intervals;
235236
} else {
236237
cmd->short_cycles_msec = 0;
237-
cmd->long_cycles_msec = cpu_to_le16(req->interval);
238+
cmd->long_cycles_msec =
239+
cpu_to_le16(req->scan_plans[0].interval * MSEC_PER_SEC);
238240
cmd->short_cycles_count = 0;
239241
}
240242
wl1271_debug(DEBUG_SCAN, "short_interval: %d, long_interval: %d, num_short: %d",

include/linux/ieee80211.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1932,6 +1932,8 @@ enum ieee80211_category {
19321932
WLAN_CATEGORY_HT = 7,
19331933
WLAN_CATEGORY_SA_QUERY = 8,
19341934
WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION = 9,
1935+
WLAN_CATEGORY_WNM = 10,
1936+
WLAN_CATEGORY_WNM_UNPROTECTED = 11,
19351937
WLAN_CATEGORY_TDLS = 12,
19361938
WLAN_CATEGORY_MESH_ACTION = 13,
19371939
WLAN_CATEGORY_MULTIHOP_ACTION = 14,
@@ -2396,7 +2398,10 @@ static inline bool _ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr)
23962398
category = ((u8 *) hdr) + 24;
23972399
return *category != WLAN_CATEGORY_PUBLIC &&
23982400
*category != WLAN_CATEGORY_HT &&
2401+
*category != WLAN_CATEGORY_WNM_UNPROTECTED &&
23992402
*category != WLAN_CATEGORY_SELF_PROTECTED &&
2403+
*category != WLAN_CATEGORY_UNPROT_DMG &&
2404+
*category != WLAN_CATEGORY_VHT &&
24002405
*category != WLAN_CATEGORY_VENDOR_SPECIFIC;
24012406
}
24022407

include/net/cfg80211.h

Lines changed: 105 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*
66
* Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
77
* Copyright 2013-2014 Intel Mobile Communications GmbH
8+
* Copyright 2015 Intel Deutschland GmbH
89
*
910
* This program is free software; you can redistribute it and/or modify
1011
* it under the terms of the GNU General Public License version 2 as
@@ -1500,14 +1501,27 @@ struct cfg80211_match_set {
15001501
s32 rssi_thold;
15011502
};
15021503

1504+
/**
1505+
* struct cfg80211_sched_scan_plan - scan plan for scheduled scan
1506+
*
1507+
* @interval: interval between scheduled scan iterations. In seconds.
1508+
* @iterations: number of scan iterations in this scan plan. Zero means
1509+
* infinite loop.
1510+
* The last scan plan will always have this parameter set to zero,
1511+
* all other scan plans will have a finite number of iterations.
1512+
*/
1513+
struct cfg80211_sched_scan_plan {
1514+
u32 interval;
1515+
u32 iterations;
1516+
};
1517+
15031518
/**
15041519
* struct cfg80211_sched_scan_request - scheduled scan request description
15051520
*
15061521
* @ssids: SSIDs to scan for (passed in the probe_reqs in active scans)
15071522
* @n_ssids: number of SSIDs
15081523
* @n_channels: total number of channels to scan
15091524
* @scan_width: channel width for scanning
1510-
* @interval: interval between each scheduled scan cycle
15111525
* @ie: optional information element(s) to add into Probe Request or %NULL
15121526
* @ie_len: length of ie in octets
15131527
* @flags: bit field of flags controlling operation
@@ -1526,6 +1540,9 @@ struct cfg80211_match_set {
15261540
* @mac_addr_mask: MAC address mask used with randomisation, bits that
15271541
* are 0 in the mask should be randomised, bits that are 1 should
15281542
* be taken from the @mac_addr
1543+
* @scan_plans: scan plans to be executed in this scheduled scan. Lowest
1544+
* index must be executed first.
1545+
* @n_scan_plans: number of scan plans, at least 1.
15291546
* @rcu_head: RCU callback used to free the struct
15301547
* @owner_nlportid: netlink portid of owner (if this should is a request
15311548
* owned by a particular socket)
@@ -1539,14 +1556,15 @@ struct cfg80211_sched_scan_request {
15391556
int n_ssids;
15401557
u32 n_channels;
15411558
enum nl80211_bss_scan_width scan_width;
1542-
u32 interval;
15431559
const u8 *ie;
15441560
size_t ie_len;
15451561
u32 flags;
15461562
struct cfg80211_match_set *match_sets;
15471563
int n_match_sets;
15481564
s32 min_rssi_thold;
15491565
u32 delay;
1566+
struct cfg80211_sched_scan_plan *scan_plans;
1567+
int n_scan_plans;
15501568

15511569
u8 mac_addr[ETH_ALEN] __aligned(2);
15521570
u8 mac_addr_mask[ETH_ALEN] __aligned(2);
@@ -1575,6 +1593,26 @@ enum cfg80211_signal_type {
15751593
CFG80211_SIGNAL_TYPE_UNSPEC,
15761594
};
15771595

1596+
/**
1597+
* struct cfg80211_inform_bss - BSS inform data
1598+
* @chan: channel the frame was received on
1599+
* @scan_width: scan width that was used
1600+
* @signal: signal strength value, according to the wiphy's
1601+
* signal type
1602+
* @boottime_ns: timestamp (CLOCK_BOOTTIME) when the information was
1603+
* received; should match the time when the frame was actually
1604+
* received by the device (not just by the host, in case it was
1605+
* buffered on the device) and be accurate to about 10ms.
1606+
* If the frame isn't buffered, just passing the return value of
1607+
* ktime_get_boot_ns() is likely appropriate.
1608+
*/
1609+
struct cfg80211_inform_bss {
1610+
struct ieee80211_channel *chan;
1611+
enum nl80211_bss_scan_width scan_width;
1612+
s32 signal;
1613+
u64 boottime_ns;
1614+
};
1615+
15781616
/**
15791617
* struct cfg80211_bss_ie_data - BSS entry IE data
15801618
* @tsf: TSF contained in the frame that carried these IEs
@@ -3056,6 +3094,12 @@ struct wiphy_vendor_command {
30563094
* include fixed IEs like supported rates
30573095
* @max_sched_scan_ie_len: same as max_scan_ie_len, but for scheduled
30583096
* scans
3097+
* @max_sched_scan_plans: maximum number of scan plans (scan interval and number
3098+
* of iterations) for scheduled scan supported by the device.
3099+
* @max_sched_scan_plan_interval: maximum interval (in seconds) for a
3100+
* single scan plan supported by the device.
3101+
* @max_sched_scan_plan_iterations: maximum number of iterations for a single
3102+
* scan plan supported by the device.
30593103
* @coverage_class: current coverage class
30603104
* @fw_version: firmware version for ethtool reporting
30613105
* @hw_version: hardware version for ethtool reporting
@@ -3163,6 +3207,9 @@ struct wiphy {
31633207
u8 max_match_sets;
31643208
u16 max_scan_ie_len;
31653209
u16 max_sched_scan_ie_len;
3210+
u32 max_sched_scan_plans;
3211+
u32 max_sched_scan_plan_interval;
3212+
u32 max_sched_scan_plan_iterations;
31663213

31673214
int n_cipher_suites;
31683215
const u32 *cipher_suites;
@@ -3958,14 +4005,11 @@ void cfg80211_sched_scan_stopped(struct wiphy *wiphy);
39584005
void cfg80211_sched_scan_stopped_rtnl(struct wiphy *wiphy);
39594006

39604007
/**
3961-
* cfg80211_inform_bss_width_frame - inform cfg80211 of a received BSS frame
3962-
*
4008+
* cfg80211_inform_bss_frame_data - inform cfg80211 of a received BSS frame
39634009
* @wiphy: the wiphy reporting the BSS
3964-
* @rx_channel: The channel the frame was received on
3965-
* @scan_width: width of the control channel
4010+
* @data: the BSS metadata
39664011
* @mgmt: the management frame (probe response or beacon)
39674012
* @len: length of the management frame
3968-
* @signal: the signal strength, type depends on the wiphy's signal_type
39694013
* @gfp: context flags
39704014
*
39714015
* This informs cfg80211 that BSS information was found and
@@ -3975,21 +4019,40 @@ void cfg80211_sched_scan_stopped_rtnl(struct wiphy *wiphy);
39754019
* Or %NULL on error.
39764020
*/
39774021
struct cfg80211_bss * __must_check
4022+
cfg80211_inform_bss_frame_data(struct wiphy *wiphy,
4023+
struct cfg80211_inform_bss *data,
4024+
struct ieee80211_mgmt *mgmt, size_t len,
4025+
gfp_t gfp);
4026+
4027+
static inline struct cfg80211_bss * __must_check
39784028
cfg80211_inform_bss_width_frame(struct wiphy *wiphy,
39794029
struct ieee80211_channel *rx_channel,
39804030
enum nl80211_bss_scan_width scan_width,
39814031
struct ieee80211_mgmt *mgmt, size_t len,
3982-
s32 signal, gfp_t gfp);
4032+
s32 signal, gfp_t gfp)
4033+
{
4034+
struct cfg80211_inform_bss data = {
4035+
.chan = rx_channel,
4036+
.scan_width = scan_width,
4037+
.signal = signal,
4038+
};
4039+
4040+
return cfg80211_inform_bss_frame_data(wiphy, &data, mgmt, len, gfp);
4041+
}
39834042

39844043
static inline struct cfg80211_bss * __must_check
39854044
cfg80211_inform_bss_frame(struct wiphy *wiphy,
39864045
struct ieee80211_channel *rx_channel,
39874046
struct ieee80211_mgmt *mgmt, size_t len,
39884047
s32 signal, gfp_t gfp)
39894048
{
3990-
return cfg80211_inform_bss_width_frame(wiphy, rx_channel,
3991-
NL80211_BSS_CHAN_WIDTH_20,
3992-
mgmt, len, signal, gfp);
4049+
struct cfg80211_inform_bss data = {
4050+
.chan = rx_channel,
4051+
.scan_width = NL80211_BSS_CHAN_WIDTH_20,
4052+
.signal = signal,
4053+
};
4054+
4055+
return cfg80211_inform_bss_frame_data(wiphy, &data, mgmt, len, gfp);
39934056
}
39944057

39954058
/**
@@ -4006,19 +4069,17 @@ enum cfg80211_bss_frame_type {
40064069
};
40074070

40084071
/**
4009-
* cfg80211_inform_bss_width - inform cfg80211 of a new BSS
4072+
* cfg80211_inform_bss_data - inform cfg80211 of a new BSS
40104073
*
40114074
* @wiphy: the wiphy reporting the BSS
4012-
* @rx_channel: The channel the frame was received on
4013-
* @scan_width: width of the control channel
4075+
* @data: the BSS metadata
40144076
* @ftype: frame type (if known)
40154077
* @bssid: the BSSID of the BSS
40164078
* @tsf: the TSF sent by the peer in the beacon/probe response (or 0)
40174079
* @capability: the capability field sent by the peer
40184080
* @beacon_interval: the beacon interval announced by the peer
40194081
* @ie: additional IEs sent by the peer
40204082
* @ielen: length of the additional IEs
4021-
* @signal: the signal strength, type depends on the wiphy's signal_type
40224083
* @gfp: context flags
40234084
*
40244085
* This informs cfg80211 that BSS information was found and
@@ -4028,13 +4089,32 @@ enum cfg80211_bss_frame_type {
40284089
* Or %NULL on error.
40294090
*/
40304091
struct cfg80211_bss * __must_check
4092+
cfg80211_inform_bss_data(struct wiphy *wiphy,
4093+
struct cfg80211_inform_bss *data,
4094+
enum cfg80211_bss_frame_type ftype,
4095+
const u8 *bssid, u64 tsf, u16 capability,
4096+
u16 beacon_interval, const u8 *ie, size_t ielen,
4097+
gfp_t gfp);
4098+
4099+
static inline struct cfg80211_bss * __must_check
40314100
cfg80211_inform_bss_width(struct wiphy *wiphy,
40324101
struct ieee80211_channel *rx_channel,
40334102
enum nl80211_bss_scan_width scan_width,
40344103
enum cfg80211_bss_frame_type ftype,
40354104
const u8 *bssid, u64 tsf, u16 capability,
40364105
u16 beacon_interval, const u8 *ie, size_t ielen,
4037-
s32 signal, gfp_t gfp);
4106+
s32 signal, gfp_t gfp)
4107+
{
4108+
struct cfg80211_inform_bss data = {
4109+
.chan = rx_channel,
4110+
.scan_width = scan_width,
4111+
.signal = signal,
4112+
};
4113+
4114+
return cfg80211_inform_bss_data(wiphy, &data, ftype, bssid, tsf,
4115+
capability, beacon_interval, ie, ielen,
4116+
gfp);
4117+
}
40384118

40394119
static inline struct cfg80211_bss * __must_check
40404120
cfg80211_inform_bss(struct wiphy *wiphy,
@@ -4044,11 +4124,15 @@ cfg80211_inform_bss(struct wiphy *wiphy,
40444124
u16 beacon_interval, const u8 *ie, size_t ielen,
40454125
s32 signal, gfp_t gfp)
40464126
{
4047-
return cfg80211_inform_bss_width(wiphy, rx_channel,
4048-
NL80211_BSS_CHAN_WIDTH_20, ftype,
4049-
bssid, tsf, capability,
4050-
beacon_interval, ie, ielen, signal,
4051-
gfp);
4127+
struct cfg80211_inform_bss data = {
4128+
.chan = rx_channel,
4129+
.scan_width = NL80211_BSS_CHAN_WIDTH_20,
4130+
.signal = signal,
4131+
};
4132+
4133+
return cfg80211_inform_bss_data(wiphy, &data, ftype, bssid, tsf,
4134+
capability, beacon_interval, ie, ielen,
4135+
gfp);
40524136
}
40534137

40544138
struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,

include/net/mac80211.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,11 +1241,6 @@ enum ieee80211_smps_mode {
12411241
* @flags: configuration flags defined above
12421242
*
12431243
* @listen_interval: listen interval in units of beacon interval
1244-
* @max_sleep_period: the maximum number of beacon intervals to sleep for
1245-
* before checking the beacon for a TIM bit (managed mode only); this
1246-
* value will be only achievable between DTIM frames, the hardware
1247-
* needs to check for the multicast traffic bit in DTIM beacons.
1248-
* This variable is valid only when the CONF_PS flag is set.
12491244
* @ps_dtim_period: The DTIM period of the AP we're connected to, for use
12501245
* in power saving. Power saving will not be enabled until a beacon
12511246
* has been received and the DTIM period is known.
@@ -1275,7 +1270,6 @@ enum ieee80211_smps_mode {
12751270
struct ieee80211_conf {
12761271
u32 flags;
12771272
int power_level, dynamic_ps_timeout;
1278-
int max_sleep_period;
12791273

12801274
u16 listen_interval;
12811275
u8 ps_dtim_period;
@@ -1683,6 +1677,7 @@ struct ieee80211_sta_rates {
16831677
* @tdls: indicates whether the STA is a TDLS peer
16841678
* @tdls_initiator: indicates the STA is an initiator of the TDLS link. Only
16851679
* valid if the STA is a TDLS peer in the first place.
1680+
* @mfp: indicates whether the STA uses management frame protection or not.
16861681
* @txq: per-TID data TX queues (if driver uses the TXQ abstraction)
16871682
*/
16881683
struct ieee80211_sta {
@@ -1700,6 +1695,7 @@ struct ieee80211_sta {
17001695
struct ieee80211_sta_rates __rcu *rates;
17011696
bool tdls;
17021697
bool tdls_initiator;
1698+
bool mfp;
17031699

17041700
struct ieee80211_txq *txq[IEEE80211_NUM_TIDS];
17051701

0 commit comments

Comments
 (0)