mirror of
https://github.com/t2linux/kernel.git
synced 2026-04-30 13:48:59 -07:00
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>
This commit is contained in:
@@ -154,8 +154,9 @@
|
||||
!Finclude/net/cfg80211.h cfg80211_scan_request
|
||||
!Finclude/net/cfg80211.h cfg80211_scan_done
|
||||
!Finclude/net/cfg80211.h cfg80211_bss
|
||||
!Finclude/net/cfg80211.h cfg80211_inform_bss_width_frame
|
||||
!Finclude/net/cfg80211.h cfg80211_inform_bss_width
|
||||
!Finclude/net/cfg80211.h cfg80211_inform_bss
|
||||
!Finclude/net/cfg80211.h cfg80211_inform_bss_frame_data
|
||||
!Finclude/net/cfg80211.h cfg80211_inform_bss_data
|
||||
!Finclude/net/cfg80211.h cfg80211_unlink_bss
|
||||
!Finclude/net/cfg80211.h cfg80211_find_ie
|
||||
!Finclude/net/cfg80211.h ieee80211_bss_get_ie
|
||||
|
||||
@@ -3312,7 +3312,7 @@ static int ath6kl_cfg80211_sscan_start(struct wiphy *wiphy,
|
||||
}
|
||||
|
||||
/* fw uses seconds, also make sure that it's >0 */
|
||||
interval = max_t(u16, 1, request->interval / 1000);
|
||||
interval = max_t(u16, 1, request->scan_plans[0].interval);
|
||||
|
||||
ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx,
|
||||
interval, interval,
|
||||
|
||||
@@ -630,6 +630,7 @@ static void iwl_op_mode_mvm_stop(struct iwl_op_mode *op_mode)
|
||||
kfree(mvm->d3_resume_sram);
|
||||
if (mvm->nd_config) {
|
||||
kfree(mvm->nd_config->match_sets);
|
||||
kfree(mvm->nd_config->scan_plans);
|
||||
kfree(mvm->nd_config);
|
||||
mvm->nd_config = NULL;
|
||||
}
|
||||
|
||||
@@ -1271,12 +1271,12 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm,
|
||||
|
||||
params.type = iwl_mvm_get_scan_type(mvm, vif, ¶ms);
|
||||
|
||||
if (req->interval > U16_MAX) {
|
||||
if (req->scan_plans[0].interval > U16_MAX) {
|
||||
IWL_DEBUG_SCAN(mvm,
|
||||
"interval value is > 16-bits, set to max possible\n");
|
||||
params.interval = U16_MAX;
|
||||
} else {
|
||||
params.interval = req->interval / MSEC_PER_SEC;
|
||||
params.interval = req->scan_plans[0].interval;
|
||||
}
|
||||
|
||||
/* In theory, LMAC scans can handle a 32-bit delay, but since
|
||||
|
||||
@@ -266,7 +266,7 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
|
||||
if (beacon_diff > beacon_int)
|
||||
beacon_diff = 0;
|
||||
|
||||
autowake_timeout = (conf->max_sleep_period * beacon_int) - beacon_diff;
|
||||
autowake_timeout = (conf->ps_dtim_period * beacon_int) - beacon_diff;
|
||||
queue_delayed_work(rt2x00dev->workqueue,
|
||||
&rt2x00dev->autowakeup_work,
|
||||
autowake_timeout - 15);
|
||||
|
||||
@@ -350,7 +350,8 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
|
||||
cfg->bss_type = SCAN_BSS_TYPE_ANY;
|
||||
/* currently NL80211 supports only a single interval */
|
||||
for (i = 0; i < SCAN_MAX_CYCLE_INTERVALS; i++)
|
||||
cfg->intervals[i] = cpu_to_le32(req->interval);
|
||||
cfg->intervals[i] = cpu_to_le32(req->scan_plans[0].interval *
|
||||
MSEC_PER_SEC);
|
||||
|
||||
cfg->ssid_len = 0;
|
||||
ret = wlcore_scan_sched_scan_ssid_list(wl, wlvif, req);
|
||||
|
||||
@@ -228,13 +228,15 @@ int wl18xx_scan_sched_scan_config(struct wl1271 *wl,
|
||||
wl18xx_adjust_channels(cmd, cmd_channels);
|
||||
|
||||
if (c->num_short_intervals && c->long_interval &&
|
||||
c->long_interval > req->interval) {
|
||||
cmd->short_cycles_msec = cpu_to_le16(req->interval);
|
||||
c->long_interval > req->scan_plans[0].interval * MSEC_PER_SEC) {
|
||||
cmd->short_cycles_msec =
|
||||
cpu_to_le16(req->scan_plans[0].interval * MSEC_PER_SEC);
|
||||
cmd->long_cycles_msec = cpu_to_le16(c->long_interval);
|
||||
cmd->short_cycles_count = c->num_short_intervals;
|
||||
} else {
|
||||
cmd->short_cycles_msec = 0;
|
||||
cmd->long_cycles_msec = cpu_to_le16(req->interval);
|
||||
cmd->long_cycles_msec =
|
||||
cpu_to_le16(req->scan_plans[0].interval * MSEC_PER_SEC);
|
||||
cmd->short_cycles_count = 0;
|
||||
}
|
||||
wl1271_debug(DEBUG_SCAN, "short_interval: %d, long_interval: %d, num_short: %d",
|
||||
|
||||
@@ -1932,6 +1932,8 @@ enum ieee80211_category {
|
||||
WLAN_CATEGORY_HT = 7,
|
||||
WLAN_CATEGORY_SA_QUERY = 8,
|
||||
WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION = 9,
|
||||
WLAN_CATEGORY_WNM = 10,
|
||||
WLAN_CATEGORY_WNM_UNPROTECTED = 11,
|
||||
WLAN_CATEGORY_TDLS = 12,
|
||||
WLAN_CATEGORY_MESH_ACTION = 13,
|
||||
WLAN_CATEGORY_MULTIHOP_ACTION = 14,
|
||||
@@ -2396,7 +2398,10 @@ static inline bool _ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr)
|
||||
category = ((u8 *) hdr) + 24;
|
||||
return *category != WLAN_CATEGORY_PUBLIC &&
|
||||
*category != WLAN_CATEGORY_HT &&
|
||||
*category != WLAN_CATEGORY_WNM_UNPROTECTED &&
|
||||
*category != WLAN_CATEGORY_SELF_PROTECTED &&
|
||||
*category != WLAN_CATEGORY_UNPROT_DMG &&
|
||||
*category != WLAN_CATEGORY_VHT &&
|
||||
*category != WLAN_CATEGORY_VENDOR_SPECIFIC;
|
||||
}
|
||||
|
||||
|
||||
+105
-21
@@ -5,6 +5,7 @@
|
||||
*
|
||||
* Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
|
||||
* Copyright 2013-2014 Intel Mobile Communications GmbH
|
||||
* Copyright 2015 Intel Deutschland GmbH
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
@@ -1500,6 +1501,20 @@ struct cfg80211_match_set {
|
||||
s32 rssi_thold;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct cfg80211_sched_scan_plan - scan plan for scheduled scan
|
||||
*
|
||||
* @interval: interval between scheduled scan iterations. In seconds.
|
||||
* @iterations: number of scan iterations in this scan plan. Zero means
|
||||
* infinite loop.
|
||||
* The last scan plan will always have this parameter set to zero,
|
||||
* all other scan plans will have a finite number of iterations.
|
||||
*/
|
||||
struct cfg80211_sched_scan_plan {
|
||||
u32 interval;
|
||||
u32 iterations;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct cfg80211_sched_scan_request - scheduled scan request description
|
||||
*
|
||||
@@ -1507,7 +1522,6 @@ struct cfg80211_match_set {
|
||||
* @n_ssids: number of SSIDs
|
||||
* @n_channels: total number of channels to scan
|
||||
* @scan_width: channel width for scanning
|
||||
* @interval: interval between each scheduled scan cycle
|
||||
* @ie: optional information element(s) to add into Probe Request or %NULL
|
||||
* @ie_len: length of ie in octets
|
||||
* @flags: bit field of flags controlling operation
|
||||
@@ -1526,6 +1540,9 @@ struct cfg80211_match_set {
|
||||
* @mac_addr_mask: MAC address mask used with randomisation, bits that
|
||||
* are 0 in the mask should be randomised, bits that are 1 should
|
||||
* be taken from the @mac_addr
|
||||
* @scan_plans: scan plans to be executed in this scheduled scan. Lowest
|
||||
* index must be executed first.
|
||||
* @n_scan_plans: number of scan plans, at least 1.
|
||||
* @rcu_head: RCU callback used to free the struct
|
||||
* @owner_nlportid: netlink portid of owner (if this should is a request
|
||||
* owned by a particular socket)
|
||||
@@ -1539,7 +1556,6 @@ struct cfg80211_sched_scan_request {
|
||||
int n_ssids;
|
||||
u32 n_channels;
|
||||
enum nl80211_bss_scan_width scan_width;
|
||||
u32 interval;
|
||||
const u8 *ie;
|
||||
size_t ie_len;
|
||||
u32 flags;
|
||||
@@ -1547,6 +1563,8 @@ struct cfg80211_sched_scan_request {
|
||||
int n_match_sets;
|
||||
s32 min_rssi_thold;
|
||||
u32 delay;
|
||||
struct cfg80211_sched_scan_plan *scan_plans;
|
||||
int n_scan_plans;
|
||||
|
||||
u8 mac_addr[ETH_ALEN] __aligned(2);
|
||||
u8 mac_addr_mask[ETH_ALEN] __aligned(2);
|
||||
@@ -1575,6 +1593,26 @@ enum cfg80211_signal_type {
|
||||
CFG80211_SIGNAL_TYPE_UNSPEC,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct cfg80211_inform_bss - BSS inform data
|
||||
* @chan: channel the frame was received on
|
||||
* @scan_width: scan width that was used
|
||||
* @signal: signal strength value, according to the wiphy's
|
||||
* signal type
|
||||
* @boottime_ns: timestamp (CLOCK_BOOTTIME) when the information was
|
||||
* received; should match the time when the frame was actually
|
||||
* received by the device (not just by the host, in case it was
|
||||
* buffered on the device) and be accurate to about 10ms.
|
||||
* If the frame isn't buffered, just passing the return value of
|
||||
* ktime_get_boot_ns() is likely appropriate.
|
||||
*/
|
||||
struct cfg80211_inform_bss {
|
||||
struct ieee80211_channel *chan;
|
||||
enum nl80211_bss_scan_width scan_width;
|
||||
s32 signal;
|
||||
u64 boottime_ns;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct cfg80211_bss_ie_data - BSS entry IE data
|
||||
* @tsf: TSF contained in the frame that carried these IEs
|
||||
@@ -3056,6 +3094,12 @@ struct wiphy_vendor_command {
|
||||
* include fixed IEs like supported rates
|
||||
* @max_sched_scan_ie_len: same as max_scan_ie_len, but for scheduled
|
||||
* scans
|
||||
* @max_sched_scan_plans: maximum number of scan plans (scan interval and number
|
||||
* of iterations) for scheduled scan supported by the device.
|
||||
* @max_sched_scan_plan_interval: maximum interval (in seconds) for a
|
||||
* single scan plan supported by the device.
|
||||
* @max_sched_scan_plan_iterations: maximum number of iterations for a single
|
||||
* scan plan supported by the device.
|
||||
* @coverage_class: current coverage class
|
||||
* @fw_version: firmware version for ethtool reporting
|
||||
* @hw_version: hardware version for ethtool reporting
|
||||
@@ -3163,6 +3207,9 @@ struct wiphy {
|
||||
u8 max_match_sets;
|
||||
u16 max_scan_ie_len;
|
||||
u16 max_sched_scan_ie_len;
|
||||
u32 max_sched_scan_plans;
|
||||
u32 max_sched_scan_plan_interval;
|
||||
u32 max_sched_scan_plan_iterations;
|
||||
|
||||
int n_cipher_suites;
|
||||
const u32 *cipher_suites;
|
||||
@@ -3958,14 +4005,11 @@ void cfg80211_sched_scan_stopped(struct wiphy *wiphy);
|
||||
void cfg80211_sched_scan_stopped_rtnl(struct wiphy *wiphy);
|
||||
|
||||
/**
|
||||
* cfg80211_inform_bss_width_frame - inform cfg80211 of a received BSS frame
|
||||
*
|
||||
* cfg80211_inform_bss_frame_data - inform cfg80211 of a received BSS frame
|
||||
* @wiphy: the wiphy reporting the BSS
|
||||
* @rx_channel: The channel the frame was received on
|
||||
* @scan_width: width of the control channel
|
||||
* @data: the BSS metadata
|
||||
* @mgmt: the management frame (probe response or beacon)
|
||||
* @len: length of the management frame
|
||||
* @signal: the signal strength, type depends on the wiphy's signal_type
|
||||
* @gfp: context flags
|
||||
*
|
||||
* This informs cfg80211 that BSS information was found and
|
||||
@@ -3975,11 +4019,26 @@ void cfg80211_sched_scan_stopped_rtnl(struct wiphy *wiphy);
|
||||
* Or %NULL on error.
|
||||
*/
|
||||
struct cfg80211_bss * __must_check
|
||||
cfg80211_inform_bss_frame_data(struct wiphy *wiphy,
|
||||
struct cfg80211_inform_bss *data,
|
||||
struct ieee80211_mgmt *mgmt, size_t len,
|
||||
gfp_t gfp);
|
||||
|
||||
static inline struct cfg80211_bss * __must_check
|
||||
cfg80211_inform_bss_width_frame(struct wiphy *wiphy,
|
||||
struct ieee80211_channel *rx_channel,
|
||||
enum nl80211_bss_scan_width scan_width,
|
||||
struct ieee80211_mgmt *mgmt, size_t len,
|
||||
s32 signal, gfp_t gfp);
|
||||
s32 signal, gfp_t gfp)
|
||||
{
|
||||
struct cfg80211_inform_bss data = {
|
||||
.chan = rx_channel,
|
||||
.scan_width = scan_width,
|
||||
.signal = signal,
|
||||
};
|
||||
|
||||
return cfg80211_inform_bss_frame_data(wiphy, &data, mgmt, len, gfp);
|
||||
}
|
||||
|
||||
static inline struct cfg80211_bss * __must_check
|
||||
cfg80211_inform_bss_frame(struct wiphy *wiphy,
|
||||
@@ -3987,9 +4046,13 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
|
||||
struct ieee80211_mgmt *mgmt, size_t len,
|
||||
s32 signal, gfp_t gfp)
|
||||
{
|
||||
return cfg80211_inform_bss_width_frame(wiphy, rx_channel,
|
||||
NL80211_BSS_CHAN_WIDTH_20,
|
||||
mgmt, len, signal, gfp);
|
||||
struct cfg80211_inform_bss data = {
|
||||
.chan = rx_channel,
|
||||
.scan_width = NL80211_BSS_CHAN_WIDTH_20,
|
||||
.signal = signal,
|
||||
};
|
||||
|
||||
return cfg80211_inform_bss_frame_data(wiphy, &data, mgmt, len, gfp);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4006,11 +4069,10 @@ enum cfg80211_bss_frame_type {
|
||||
};
|
||||
|
||||
/**
|
||||
* cfg80211_inform_bss_width - inform cfg80211 of a new BSS
|
||||
* cfg80211_inform_bss_data - inform cfg80211 of a new BSS
|
||||
*
|
||||
* @wiphy: the wiphy reporting the BSS
|
||||
* @rx_channel: The channel the frame was received on
|
||||
* @scan_width: width of the control channel
|
||||
* @data: the BSS metadata
|
||||
* @ftype: frame type (if known)
|
||||
* @bssid: the BSSID of the BSS
|
||||
* @tsf: the TSF sent by the peer in the beacon/probe response (or 0)
|
||||
@@ -4018,7 +4080,6 @@ enum cfg80211_bss_frame_type {
|
||||
* @beacon_interval: the beacon interval announced by the peer
|
||||
* @ie: additional IEs sent by the peer
|
||||
* @ielen: length of the additional IEs
|
||||
* @signal: the signal strength, type depends on the wiphy's signal_type
|
||||
* @gfp: context flags
|
||||
*
|
||||
* This informs cfg80211 that BSS information was found and
|
||||
@@ -4028,13 +4089,32 @@ enum cfg80211_bss_frame_type {
|
||||
* Or %NULL on error.
|
||||
*/
|
||||
struct cfg80211_bss * __must_check
|
||||
cfg80211_inform_bss_data(struct wiphy *wiphy,
|
||||
struct cfg80211_inform_bss *data,
|
||||
enum cfg80211_bss_frame_type ftype,
|
||||
const u8 *bssid, u64 tsf, u16 capability,
|
||||
u16 beacon_interval, const u8 *ie, size_t ielen,
|
||||
gfp_t gfp);
|
||||
|
||||
static inline struct cfg80211_bss * __must_check
|
||||
cfg80211_inform_bss_width(struct wiphy *wiphy,
|
||||
struct ieee80211_channel *rx_channel,
|
||||
enum nl80211_bss_scan_width scan_width,
|
||||
enum cfg80211_bss_frame_type ftype,
|
||||
const u8 *bssid, u64 tsf, u16 capability,
|
||||
u16 beacon_interval, const u8 *ie, size_t ielen,
|
||||
s32 signal, gfp_t gfp);
|
||||
s32 signal, gfp_t gfp)
|
||||
{
|
||||
struct cfg80211_inform_bss data = {
|
||||
.chan = rx_channel,
|
||||
.scan_width = scan_width,
|
||||
.signal = signal,
|
||||
};
|
||||
|
||||
return cfg80211_inform_bss_data(wiphy, &data, ftype, bssid, tsf,
|
||||
capability, beacon_interval, ie, ielen,
|
||||
gfp);
|
||||
}
|
||||
|
||||
static inline struct cfg80211_bss * __must_check
|
||||
cfg80211_inform_bss(struct wiphy *wiphy,
|
||||
@@ -4044,11 +4124,15 @@ cfg80211_inform_bss(struct wiphy *wiphy,
|
||||
u16 beacon_interval, const u8 *ie, size_t ielen,
|
||||
s32 signal, gfp_t gfp)
|
||||
{
|
||||
return cfg80211_inform_bss_width(wiphy, rx_channel,
|
||||
NL80211_BSS_CHAN_WIDTH_20, ftype,
|
||||
bssid, tsf, capability,
|
||||
beacon_interval, ie, ielen, signal,
|
||||
gfp);
|
||||
struct cfg80211_inform_bss data = {
|
||||
.chan = rx_channel,
|
||||
.scan_width = NL80211_BSS_CHAN_WIDTH_20,
|
||||
.signal = signal,
|
||||
};
|
||||
|
||||
return cfg80211_inform_bss_data(wiphy, &data, ftype, bssid, tsf,
|
||||
capability, beacon_interval, ie, ielen,
|
||||
gfp);
|
||||
}
|
||||
|
||||
struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
|
||||
|
||||
@@ -1241,11 +1241,6 @@ enum ieee80211_smps_mode {
|
||||
* @flags: configuration flags defined above
|
||||
*
|
||||
* @listen_interval: listen interval in units of beacon interval
|
||||
* @max_sleep_period: the maximum number of beacon intervals to sleep for
|
||||
* before checking the beacon for a TIM bit (managed mode only); this
|
||||
* value will be only achievable between DTIM frames, the hardware
|
||||
* needs to check for the multicast traffic bit in DTIM beacons.
|
||||
* This variable is valid only when the CONF_PS flag is set.
|
||||
* @ps_dtim_period: The DTIM period of the AP we're connected to, for use
|
||||
* in power saving. Power saving will not be enabled until a beacon
|
||||
* has been received and the DTIM period is known.
|
||||
@@ -1275,7 +1270,6 @@ enum ieee80211_smps_mode {
|
||||
struct ieee80211_conf {
|
||||
u32 flags;
|
||||
int power_level, dynamic_ps_timeout;
|
||||
int max_sleep_period;
|
||||
|
||||
u16 listen_interval;
|
||||
u8 ps_dtim_period;
|
||||
@@ -1683,6 +1677,7 @@ struct ieee80211_sta_rates {
|
||||
* @tdls: indicates whether the STA is a TDLS peer
|
||||
* @tdls_initiator: indicates the STA is an initiator of the TDLS link. Only
|
||||
* valid if the STA is a TDLS peer in the first place.
|
||||
* @mfp: indicates whether the STA uses management frame protection or not.
|
||||
* @txq: per-TID data TX queues (if driver uses the TXQ abstraction)
|
||||
*/
|
||||
struct ieee80211_sta {
|
||||
@@ -1700,6 +1695,7 @@ struct ieee80211_sta {
|
||||
struct ieee80211_sta_rates __rcu *rates;
|
||||
bool tdls;
|
||||
bool tdls_initiator;
|
||||
bool mfp;
|
||||
|
||||
struct ieee80211_txq *txq[IEEE80211_NUM_TIDS];
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
* Copyright 2008, 2009 Luis R. Rodriguez <lrodriguez@atheros.com>
|
||||
* Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
|
||||
* Copyright 2008 Colin McCabe <colin@cozybit.com>
|
||||
* Copyright 2015 Intel Deutschland GmbH
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -328,7 +329,15 @@
|
||||
* partial scan results may be available
|
||||
*
|
||||
* @NL80211_CMD_START_SCHED_SCAN: start a scheduled scan at certain
|
||||
* intervals, as specified by %NL80211_ATTR_SCHED_SCAN_INTERVAL.
|
||||
* intervals and certain number of cycles, as specified by
|
||||
* %NL80211_ATTR_SCHED_SCAN_PLANS. If %NL80211_ATTR_SCHED_SCAN_PLANS is
|
||||
* not specified and only %NL80211_ATTR_SCHED_SCAN_INTERVAL is specified,
|
||||
* scheduled scan will run in an infinite loop with the specified interval.
|
||||
* These attributes are mutually exculsive,
|
||||
* i.e. NL80211_ATTR_SCHED_SCAN_INTERVAL must not be passed if
|
||||
* NL80211_ATTR_SCHED_SCAN_PLANS is defined.
|
||||
* If for some reason scheduled scan is aborted by the driver, all scan
|
||||
* plans are canceled (including scan plans that did not start yet).
|
||||
* Like with normal scans, if SSIDs (%NL80211_ATTR_SCAN_SSIDS)
|
||||
* are passed, they are used in the probe requests. For
|
||||
* broadcast, a broadcast SSID must be passed (ie. an empty
|
||||
@@ -1761,6 +1770,19 @@ enum nl80211_commands {
|
||||
* @NL80211_ATTR_REG_INDOOR: flag attribute, if set indicates that the device
|
||||
* is operating in an indoor environment.
|
||||
*
|
||||
* @NL80211_ATTR_MAX_NUM_SCHED_SCAN_PLANS: maximum number of scan plans for
|
||||
* scheduled scan supported by the device (u32), a wiphy attribute.
|
||||
* @NL80211_ATTR_MAX_SCAN_PLAN_INTERVAL: maximum interval (in seconds) for
|
||||
* a scan plan (u32), a wiphy attribute.
|
||||
* @NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS: maximum number of iterations in
|
||||
* a scan plan (u32), a wiphy attribute.
|
||||
* @NL80211_ATTR_SCHED_SCAN_PLANS: a list of scan plans for scheduled scan.
|
||||
* Each scan plan defines the number of scan iterations and the interval
|
||||
* between scans. The last scan plan will always run infinitely,
|
||||
* thus it must not specify the number of iterations, only the interval
|
||||
* between scans. The scan plans are executed sequentially.
|
||||
* Each scan plan is a nested attribute of &enum nl80211_sched_scan_plan.
|
||||
*
|
||||
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
|
||||
* @NL80211_ATTR_MAX: highest attribute number currently defined
|
||||
* @__NL80211_ATTR_AFTER_LAST: internal use
|
||||
@@ -2130,6 +2152,11 @@ enum nl80211_attrs {
|
||||
|
||||
NL80211_ATTR_REG_INDOOR,
|
||||
|
||||
NL80211_ATTR_MAX_NUM_SCHED_SCAN_PLANS,
|
||||
NL80211_ATTR_MAX_SCAN_PLAN_INTERVAL,
|
||||
NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS,
|
||||
NL80211_ATTR_SCHED_SCAN_PLANS,
|
||||
|
||||
/* add attributes here, update the policy in nl80211.c */
|
||||
|
||||
__NL80211_ATTR_AFTER_LAST,
|
||||
@@ -3364,6 +3391,9 @@ enum nl80211_bss_scan_width {
|
||||
* (not present if no beacon frame has been received yet)
|
||||
* @NL80211_BSS_PRESP_DATA: the data in @NL80211_BSS_INFORMATION_ELEMENTS and
|
||||
* @NL80211_BSS_TSF is known to be from a probe response (flag attribute)
|
||||
* @NL80211_BSS_LAST_SEEN_BOOTTIME: CLOCK_BOOTTIME timestamp when this entry
|
||||
* was last updated by a received frame. The value is expected to be
|
||||
* accurate to about 10ms. (u64, nanoseconds)
|
||||
* @__NL80211_BSS_AFTER_LAST: internal
|
||||
* @NL80211_BSS_MAX: highest BSS attribute
|
||||
*/
|
||||
@@ -3383,6 +3413,7 @@ enum nl80211_bss {
|
||||
NL80211_BSS_CHAN_WIDTH,
|
||||
NL80211_BSS_BEACON_TSF,
|
||||
NL80211_BSS_PRESP_DATA,
|
||||
NL80211_BSS_LAST_SEEN_BOOTTIME,
|
||||
|
||||
/* keep last */
|
||||
__NL80211_BSS_AFTER_LAST,
|
||||
@@ -4589,4 +4620,28 @@ enum nl80211_tdls_peer_capability {
|
||||
NL80211_TDLS_PEER_WMM = 1<<2,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum nl80211_sched_scan_plan - scanning plan for scheduled scan
|
||||
* @__NL80211_SCHED_SCAN_PLAN_INVALID: attribute number 0 is reserved
|
||||
* @NL80211_SCHED_SCAN_PLAN_INTERVAL: interval between scan iterations. In
|
||||
* seconds (u32).
|
||||
* @NL80211_SCHED_SCAN_PLAN_ITERATIONS: number of scan iterations in this
|
||||
* scan plan (u32). The last scan plan must not specify this attribute
|
||||
* because it will run infinitely. A value of zero is invalid as it will
|
||||
* make the scan plan meaningless.
|
||||
* @NL80211_SCHED_SCAN_PLAN_MAX: highest scheduled scan plan attribute number
|
||||
* currently defined
|
||||
* @__NL80211_SCHED_SCAN_PLAN_AFTER_LAST: internal use
|
||||
*/
|
||||
enum nl80211_sched_scan_plan {
|
||||
__NL80211_SCHED_SCAN_PLAN_INVALID,
|
||||
NL80211_SCHED_SCAN_PLAN_INTERVAL,
|
||||
NL80211_SCHED_SCAN_PLAN_ITERATIONS,
|
||||
|
||||
/* keep last */
|
||||
__NL80211_SCHED_SCAN_PLAN_AFTER_LAST,
|
||||
NL80211_SCHED_SCAN_PLAN_MAX =
|
||||
__NL80211_SCHED_SCAN_PLAN_AFTER_LAST - 1
|
||||
};
|
||||
|
||||
#endif /* __LINUX_NL80211_H */
|
||||
|
||||
@@ -27,7 +27,6 @@ mac80211-y := \
|
||||
key.o \
|
||||
util.o \
|
||||
wme.o \
|
||||
event.o \
|
||||
chan.o \
|
||||
trace.o mlme.o \
|
||||
tdls.o \
|
||||
|
||||
+3
-42
@@ -17,7 +17,6 @@
|
||||
#include <net/cfg80211.h>
|
||||
#include "ieee80211_i.h"
|
||||
#include "driver-ops.h"
|
||||
#include "cfg.h"
|
||||
#include "rate.h"
|
||||
#include "mesh.h"
|
||||
#include "wme.h"
|
||||
@@ -469,45 +468,6 @@ void sta_set_rate_info_tx(struct sta_info *sta,
|
||||
rinfo->flags |= RATE_INFO_FLAGS_SHORT_GI;
|
||||
}
|
||||
|
||||
void sta_set_rate_info_rx(struct sta_info *sta, struct rate_info *rinfo)
|
||||
{
|
||||
rinfo->flags = 0;
|
||||
|
||||
if (sta->last_rx_rate_flag & RX_FLAG_HT) {
|
||||
rinfo->flags |= RATE_INFO_FLAGS_MCS;
|
||||
rinfo->mcs = sta->last_rx_rate_idx;
|
||||
} else if (sta->last_rx_rate_flag & RX_FLAG_VHT) {
|
||||
rinfo->flags |= RATE_INFO_FLAGS_VHT_MCS;
|
||||
rinfo->nss = sta->last_rx_rate_vht_nss;
|
||||
rinfo->mcs = sta->last_rx_rate_idx;
|
||||
} else {
|
||||
struct ieee80211_supported_band *sband;
|
||||
int shift = ieee80211_vif_get_shift(&sta->sdata->vif);
|
||||
u16 brate;
|
||||
|
||||
sband = sta->local->hw.wiphy->bands[
|
||||
ieee80211_get_sdata_band(sta->sdata)];
|
||||
brate = sband->bitrates[sta->last_rx_rate_idx].bitrate;
|
||||
rinfo->legacy = DIV_ROUND_UP(brate, 1 << shift);
|
||||
}
|
||||
|
||||
if (sta->last_rx_rate_flag & RX_FLAG_SHORT_GI)
|
||||
rinfo->flags |= RATE_INFO_FLAGS_SHORT_GI;
|
||||
|
||||
if (sta->last_rx_rate_flag & RX_FLAG_5MHZ)
|
||||
rinfo->bw = RATE_INFO_BW_5;
|
||||
else if (sta->last_rx_rate_flag & RX_FLAG_10MHZ)
|
||||
rinfo->bw = RATE_INFO_BW_10;
|
||||
else if (sta->last_rx_rate_flag & RX_FLAG_40MHZ)
|
||||
rinfo->bw = RATE_INFO_BW_40;
|
||||
else if (sta->last_rx_rate_vht_flag & RX_VHT_FLAG_80MHZ)
|
||||
rinfo->bw = RATE_INFO_BW_80;
|
||||
else if (sta->last_rx_rate_vht_flag & RX_VHT_FLAG_160MHZ)
|
||||
rinfo->bw = RATE_INFO_BW_160;
|
||||
else
|
||||
rinfo->bw = RATE_INFO_BW_20;
|
||||
}
|
||||
|
||||
static int ieee80211_dump_station(struct wiphy *wiphy, struct net_device *dev,
|
||||
int idx, u8 *mac, struct station_info *sinfo)
|
||||
{
|
||||
@@ -1138,6 +1098,7 @@ static int sta_apply_parameters(struct ieee80211_local *local,
|
||||
}
|
||||
|
||||
if (mask & BIT(NL80211_STA_FLAG_MFP)) {
|
||||
sta->sta.mfp = !!(set & BIT(NL80211_STA_FLAG_MFP));
|
||||
if (set & BIT(NL80211_STA_FLAG_MFP))
|
||||
set_sta_flag(sta, WLAN_STA_MFP);
|
||||
else
|
||||
@@ -1427,7 +1388,7 @@ static int ieee80211_change_station(struct wiphy *wiphy,
|
||||
|
||||
if (sdata->vif.type == NL80211_IFTYPE_STATION &&
|
||||
params->sta_flags_mask & BIT(NL80211_STA_FLAG_AUTHORIZED)) {
|
||||
ieee80211_recalc_ps(local, -1);
|
||||
ieee80211_recalc_ps(local);
|
||||
ieee80211_recalc_ps_vif(sdata);
|
||||
}
|
||||
|
||||
@@ -2462,7 +2423,7 @@ static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
|
||||
if (ieee80211_hw_check(&local->hw, SUPPORTS_DYNAMIC_PS))
|
||||
ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
|
||||
|
||||
ieee80211_recalc_ps(local, -1);
|
||||
ieee80211_recalc_ps(local);
|
||||
ieee80211_recalc_ps_vif(sdata);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
/*
|
||||
* mac80211 configuration hooks for cfg80211
|
||||
*/
|
||||
#ifndef __CFG_H
|
||||
#define __CFG_H
|
||||
|
||||
extern const struct cfg80211_ops mac80211_config_ops;
|
||||
|
||||
#endif /* __CFG_H */
|
||||
@@ -50,7 +50,6 @@ static const struct file_operations sta_ ##name## _ops = { \
|
||||
STA_OPS(name)
|
||||
|
||||
STA_FILE(aid, sta.aid, D);
|
||||
STA_FILE(last_ack_signal, last_ack_signal, D);
|
||||
|
||||
static ssize_t sta_flags_read(struct file *file, char __user *userbuf,
|
||||
size_t count, loff_t *ppos)
|
||||
@@ -366,11 +365,10 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)
|
||||
DEBUGFS_ADD(agg_status);
|
||||
DEBUGFS_ADD(ht_capa);
|
||||
DEBUGFS_ADD(vht_capa);
|
||||
DEBUGFS_ADD(last_ack_signal);
|
||||
|
||||
DEBUGFS_ADD_COUNTER(rx_duplicates, num_duplicates);
|
||||
DEBUGFS_ADD_COUNTER(rx_fragments, rx_fragments);
|
||||
DEBUGFS_ADD_COUNTER(tx_filtered, tx_filtered_count);
|
||||
DEBUGFS_ADD_COUNTER(rx_duplicates, rx_stats.num_duplicates);
|
||||
DEBUGFS_ADD_COUNTER(rx_fragments, rx_stats.fragments);
|
||||
DEBUGFS_ADD_COUNTER(tx_filtered, status_stats.filtered);
|
||||
|
||||
if (sizeof(sta->driver_buffered_tids) == sizeof(u32))
|
||||
debugfs_create_x32("driver_buffered_tids", 0400,
|
||||
|
||||
+14
-15
@@ -40,7 +40,7 @@ static const char ieee80211_gstrings_sta_stats[][ETH_GSTRING_LEN] = {
|
||||
"rx_duplicates", "rx_fragments", "rx_dropped",
|
||||
"tx_packets", "tx_bytes",
|
||||
"tx_filtered", "tx_retry_failed", "tx_retries",
|
||||
"beacon_loss", "sta_state", "txrate", "rxrate", "signal",
|
||||
"sta_state", "txrate", "rxrate", "signal",
|
||||
"channel", "noise", "ch_time", "ch_time_busy",
|
||||
"ch_time_ext_busy", "ch_time_rx", "ch_time_tx"
|
||||
};
|
||||
@@ -77,20 +77,19 @@ static void ieee80211_get_stats(struct net_device *dev,
|
||||
|
||||
memset(data, 0, sizeof(u64) * STA_STATS_LEN);
|
||||
|
||||
#define ADD_STA_STATS(sta) \
|
||||
do { \
|
||||
data[i++] += sta->rx_packets; \
|
||||
data[i++] += sta->rx_bytes; \
|
||||
data[i++] += sta->num_duplicates; \
|
||||
data[i++] += sta->rx_fragments; \
|
||||
data[i++] += sta->rx_dropped; \
|
||||
\
|
||||
data[i++] += sinfo.tx_packets; \
|
||||
data[i++] += sinfo.tx_bytes; \
|
||||
data[i++] += sta->tx_filtered_count; \
|
||||
data[i++] += sta->tx_retry_failed; \
|
||||
data[i++] += sta->tx_retry_count; \
|
||||
data[i++] += sta->beacon_loss_count; \
|
||||
#define ADD_STA_STATS(sta) \
|
||||
do { \
|
||||
data[i++] += sta->rx_stats.packets; \
|
||||
data[i++] += sta->rx_stats.bytes; \
|
||||
data[i++] += sta->rx_stats.num_duplicates; \
|
||||
data[i++] += sta->rx_stats.fragments; \
|
||||
data[i++] += sta->rx_stats.dropped; \
|
||||
\
|
||||
data[i++] += sinfo.tx_packets; \
|
||||
data[i++] += sinfo.tx_bytes; \
|
||||
data[i++] += sta->status_stats.filtered; \
|
||||
data[i++] += sta->status_stats.retry_failed; \
|
||||
data[i++] += sta->status_stats.retry_count; \
|
||||
} while (0)
|
||||
|
||||
/* For Managed stations, find the single station based on BSSID
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* Copyright 2007 Johannes Berg <johannes@sipsolutions.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* mac80211 - events
|
||||
*/
|
||||
#include <net/cfg80211.h>
|
||||
#include "ieee80211_i.h"
|
||||
|
||||
/*
|
||||
* Indicate a failed Michael MIC to userspace. If the caller knows the TSC of
|
||||
* the frame that generated the MIC failure (i.e., if it was provided by the
|
||||
* driver or is still in the frame), it should provide that information.
|
||||
*/
|
||||
void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx,
|
||||
struct ieee80211_hdr *hdr, const u8 *tsc,
|
||||
gfp_t gfp)
|
||||
{
|
||||
cfg80211_michael_mic_failure(sdata->dev, hdr->addr2,
|
||||
(hdr->addr1[0] & 0x01) ?
|
||||
NL80211_KEYTYPE_GROUP :
|
||||
NL80211_KEYTYPE_PAIRWISE,
|
||||
keyidx, tsc, gfp);
|
||||
}
|
||||
+13
-11
@@ -229,7 +229,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
|
||||
struct cfg80211_chan_def chandef;
|
||||
struct ieee80211_channel *chan;
|
||||
struct beacon_data *presp;
|
||||
enum nl80211_bss_scan_width scan_width;
|
||||
struct cfg80211_inform_bss bss_meta = {};
|
||||
bool have_higher_than_11mbit;
|
||||
bool radar_required;
|
||||
int err;
|
||||
@@ -383,10 +383,11 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
|
||||
mod_timer(&ifibss->timer,
|
||||
round_jiffies(jiffies + IEEE80211_IBSS_MERGE_INTERVAL));
|
||||
|
||||
scan_width = cfg80211_chandef_to_scan_width(&chandef);
|
||||
bss = cfg80211_inform_bss_width_frame(local->hw.wiphy, chan,
|
||||
scan_width, mgmt,
|
||||
presp->head_len, 0, GFP_KERNEL);
|
||||
bss_meta.chan = chan;
|
||||
bss_meta.scan_width = cfg80211_chandef_to_scan_width(&chandef);
|
||||
bss = cfg80211_inform_bss_frame_data(local->hw.wiphy, &bss_meta, mgmt,
|
||||
presp->head_len, GFP_KERNEL);
|
||||
|
||||
cfg80211_put_bss(local->hw.wiphy, bss);
|
||||
netif_carrier_on(sdata->dev);
|
||||
cfg80211_ibss_joined(sdata->dev, ifibss->bssid, chan, GFP_KERNEL);
|
||||
@@ -646,7 +647,7 @@ ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, const u8 *bssid,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sta->last_rx = jiffies;
|
||||
sta->rx_stats.last_rx = jiffies;
|
||||
|
||||
/* make sure mandatory rates are always added */
|
||||
sband = local->hw.wiphy->bands[band];
|
||||
@@ -668,7 +669,8 @@ static int ieee80211_sta_active_ibss(struct ieee80211_sub_if_data *sdata)
|
||||
|
||||
list_for_each_entry_rcu(sta, &local->sta_list, list) {
|
||||
if (sta->sdata == sdata &&
|
||||
time_after(sta->last_rx + IEEE80211_IBSS_MERGE_INTERVAL,
|
||||
time_after(sta->rx_stats.last_rx +
|
||||
IEEE80211_IBSS_MERGE_INTERVAL,
|
||||
jiffies)) {
|
||||
active++;
|
||||
break;
|
||||
@@ -1234,7 +1236,7 @@ void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
|
||||
if (!sta)
|
||||
return;
|
||||
|
||||
sta->last_rx = jiffies;
|
||||
sta->rx_stats.last_rx = jiffies;
|
||||
|
||||
/* make sure mandatory rates are always added */
|
||||
sband = local->hw.wiphy->bands[band];
|
||||
@@ -1252,7 +1254,7 @@ static void ieee80211_ibss_sta_expire(struct ieee80211_sub_if_data *sdata)
|
||||
struct ieee80211_local *local = sdata->local;
|
||||
struct sta_info *sta, *tmp;
|
||||
unsigned long exp_time = IEEE80211_IBSS_INACTIVITY_LIMIT;
|
||||
unsigned long exp_rsn_time = IEEE80211_IBSS_RSN_INACTIVITY_LIMIT;
|
||||
unsigned long exp_rsn = IEEE80211_IBSS_RSN_INACTIVITY_LIMIT;
|
||||
|
||||
mutex_lock(&local->sta_mtx);
|
||||
|
||||
@@ -1260,8 +1262,8 @@ static void ieee80211_ibss_sta_expire(struct ieee80211_sub_if_data *sdata)
|
||||
if (sdata != sta->sdata)
|
||||
continue;
|
||||
|
||||
if (time_after(jiffies, sta->last_rx + exp_time) ||
|
||||
(time_after(jiffies, sta->last_rx + exp_rsn_time) &&
|
||||
if (time_after(jiffies, sta->rx_stats.last_rx + exp_time) ||
|
||||
(time_after(jiffies, sta->rx_stats.last_rx + exp_rsn) &&
|
||||
sta->sta_state != IEEE80211_STA_AUTHORIZED)) {
|
||||
sta_dbg(sta->sdata, "expiring inactive %sSTA %pM\n",
|
||||
sta->sta_state != IEEE80211_STA_AUTHORIZED ?
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
#include "sta_info.h"
|
||||
#include "debug.h"
|
||||
|
||||
extern const struct cfg80211_ops mac80211_config_ops;
|
||||
|
||||
struct ieee80211_local;
|
||||
|
||||
/* Maximum number of broadcast/multicast frames to buffer when some of the
|
||||
@@ -501,6 +503,9 @@ struct ieee80211_if_managed {
|
||||
*/
|
||||
unsigned int count_beacon_signal;
|
||||
|
||||
/* Number of times beacon loss was invoked. */
|
||||
unsigned int beacon_loss_count;
|
||||
|
||||
/*
|
||||
* Last Beacon frame signal strength average (ave_beacon_signal / 16)
|
||||
* that triggered a cqm event. 0 indicates that no event has been
|
||||
@@ -1305,7 +1310,6 @@ struct ieee80211_local {
|
||||
struct work_struct dynamic_ps_enable_work;
|
||||
struct work_struct dynamic_ps_disable_work;
|
||||
struct timer_list dynamic_ps_timer;
|
||||
struct notifier_block network_latency_notifier;
|
||||
struct notifier_block ifa_notifier;
|
||||
struct notifier_block ifa6_notifier;
|
||||
|
||||
@@ -1491,10 +1495,8 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
|
||||
struct cfg80211_disassoc_request *req);
|
||||
void ieee80211_send_pspoll(struct ieee80211_local *local,
|
||||
struct ieee80211_sub_if_data *sdata);
|
||||
void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency);
|
||||
void ieee80211_recalc_ps(struct ieee80211_local *local);
|
||||
void ieee80211_recalc_ps_vif(struct ieee80211_sub_if_data *sdata);
|
||||
int ieee80211_max_network_latency(struct notifier_block *nb,
|
||||
unsigned long data, void *dummy);
|
||||
int ieee80211_set_arp_filter(struct ieee80211_sub_if_data *sdata);
|
||||
void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata);
|
||||
void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
|
||||
@@ -1766,9 +1768,6 @@ extern const void *const mac80211_wiphy_privid; /* for wiphy privid */
|
||||
int ieee80211_frame_duration(enum ieee80211_band band, size_t len,
|
||||
int rate, int erp, int short_preamble,
|
||||
int shift);
|
||||
void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx,
|
||||
struct ieee80211_hdr *hdr, const u8 *tsc,
|
||||
gfp_t gfp);
|
||||
void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
|
||||
bool bss_notify);
|
||||
void ieee80211_xmit(struct ieee80211_sub_if_data *sdata,
|
||||
|
||||
@@ -709,7 +709,7 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
|
||||
if (hw_reconf_flags)
|
||||
ieee80211_hw_config(local, hw_reconf_flags);
|
||||
|
||||
ieee80211_recalc_ps(local, -1);
|
||||
ieee80211_recalc_ps(local);
|
||||
|
||||
if (sdata->vif.type == NL80211_IFTYPE_MONITOR ||
|
||||
sdata->vif.type == NL80211_IFTYPE_AP_VLAN) {
|
||||
@@ -1016,7 +1016,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
|
||||
drv_remove_interface(local, sdata);
|
||||
}
|
||||
|
||||
ieee80211_recalc_ps(local, -1);
|
||||
ieee80211_recalc_ps(local);
|
||||
|
||||
if (cancel_scan)
|
||||
flush_delayed_work(&local->scan_work);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user