5
5
*
6
6
* Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
7
7
* Copyright 2013-2014 Intel Mobile Communications GmbH
8
+ * Copyright 2015 Intel Deutschland GmbH
8
9
*
9
10
* This program is free software; you can redistribute it and/or modify
10
11
* it under the terms of the GNU General Public License version 2 as
@@ -1500,14 +1501,27 @@ struct cfg80211_match_set {
1500
1501
s32 rssi_thold ;
1501
1502
};
1502
1503
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
+
1503
1518
/**
1504
1519
* struct cfg80211_sched_scan_request - scheduled scan request description
1505
1520
*
1506
1521
* @ssids: SSIDs to scan for (passed in the probe_reqs in active scans)
1507
1522
* @n_ssids: number of SSIDs
1508
1523
* @n_channels: total number of channels to scan
1509
1524
* @scan_width: channel width for scanning
1510
- * @interval: interval between each scheduled scan cycle
1511
1525
* @ie: optional information element(s) to add into Probe Request or %NULL
1512
1526
* @ie_len: length of ie in octets
1513
1527
* @flags: bit field of flags controlling operation
@@ -1526,6 +1540,9 @@ struct cfg80211_match_set {
1526
1540
* @mac_addr_mask: MAC address mask used with randomisation, bits that
1527
1541
* are 0 in the mask should be randomised, bits that are 1 should
1528
1542
* 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.
1529
1546
* @rcu_head: RCU callback used to free the struct
1530
1547
* @owner_nlportid: netlink portid of owner (if this should is a request
1531
1548
* owned by a particular socket)
@@ -1539,14 +1556,15 @@ struct cfg80211_sched_scan_request {
1539
1556
int n_ssids ;
1540
1557
u32 n_channels ;
1541
1558
enum nl80211_bss_scan_width scan_width ;
1542
- u32 interval ;
1543
1559
const u8 * ie ;
1544
1560
size_t ie_len ;
1545
1561
u32 flags ;
1546
1562
struct cfg80211_match_set * match_sets ;
1547
1563
int n_match_sets ;
1548
1564
s32 min_rssi_thold ;
1549
1565
u32 delay ;
1566
+ struct cfg80211_sched_scan_plan * scan_plans ;
1567
+ int n_scan_plans ;
1550
1568
1551
1569
u8 mac_addr [ETH_ALEN ] __aligned (2 );
1552
1570
u8 mac_addr_mask [ETH_ALEN ] __aligned (2 );
@@ -1575,6 +1593,26 @@ enum cfg80211_signal_type {
1575
1593
CFG80211_SIGNAL_TYPE_UNSPEC ,
1576
1594
};
1577
1595
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
+
1578
1616
/**
1579
1617
* struct cfg80211_bss_ie_data - BSS entry IE data
1580
1618
* @tsf: TSF contained in the frame that carried these IEs
@@ -3056,6 +3094,12 @@ struct wiphy_vendor_command {
3056
3094
* include fixed IEs like supported rates
3057
3095
* @max_sched_scan_ie_len: same as max_scan_ie_len, but for scheduled
3058
3096
* 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.
3059
3103
* @coverage_class: current coverage class
3060
3104
* @fw_version: firmware version for ethtool reporting
3061
3105
* @hw_version: hardware version for ethtool reporting
@@ -3163,6 +3207,9 @@ struct wiphy {
3163
3207
u8 max_match_sets ;
3164
3208
u16 max_scan_ie_len ;
3165
3209
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 ;
3166
3213
3167
3214
int n_cipher_suites ;
3168
3215
const u32 * cipher_suites ;
@@ -3958,14 +4005,11 @@ void cfg80211_sched_scan_stopped(struct wiphy *wiphy);
3958
4005
void cfg80211_sched_scan_stopped_rtnl (struct wiphy * wiphy );
3959
4006
3960
4007
/**
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
3963
4009
* @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
3966
4011
* @mgmt: the management frame (probe response or beacon)
3967
4012
* @len: length of the management frame
3968
- * @signal: the signal strength, type depends on the wiphy's signal_type
3969
4013
* @gfp: context flags
3970
4014
*
3971
4015
* This informs cfg80211 that BSS information was found and
@@ -3975,21 +4019,40 @@ void cfg80211_sched_scan_stopped_rtnl(struct wiphy *wiphy);
3975
4019
* Or %NULL on error.
3976
4020
*/
3977
4021
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
3978
4028
cfg80211_inform_bss_width_frame (struct wiphy * wiphy ,
3979
4029
struct ieee80211_channel * rx_channel ,
3980
4030
enum nl80211_bss_scan_width scan_width ,
3981
4031
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
+ }
3983
4042
3984
4043
static inline struct cfg80211_bss * __must_check
3985
4044
cfg80211_inform_bss_frame (struct wiphy * wiphy ,
3986
4045
struct ieee80211_channel * rx_channel ,
3987
4046
struct ieee80211_mgmt * mgmt , size_t len ,
3988
4047
s32 signal , gfp_t gfp )
3989
4048
{
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 );
3993
4056
}
3994
4057
3995
4058
/**
@@ -4006,19 +4069,17 @@ enum cfg80211_bss_frame_type {
4006
4069
};
4007
4070
4008
4071
/**
4009
- * cfg80211_inform_bss_width - inform cfg80211 of a new BSS
4072
+ * cfg80211_inform_bss_data - inform cfg80211 of a new BSS
4010
4073
*
4011
4074
* @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
4014
4076
* @ftype: frame type (if known)
4015
4077
* @bssid: the BSSID of the BSS
4016
4078
* @tsf: the TSF sent by the peer in the beacon/probe response (or 0)
4017
4079
* @capability: the capability field sent by the peer
4018
4080
* @beacon_interval: the beacon interval announced by the peer
4019
4081
* @ie: additional IEs sent by the peer
4020
4082
* @ielen: length of the additional IEs
4021
- * @signal: the signal strength, type depends on the wiphy's signal_type
4022
4083
* @gfp: context flags
4023
4084
*
4024
4085
* This informs cfg80211 that BSS information was found and
@@ -4028,13 +4089,32 @@ enum cfg80211_bss_frame_type {
4028
4089
* Or %NULL on error.
4029
4090
*/
4030
4091
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
4031
4100
cfg80211_inform_bss_width (struct wiphy * wiphy ,
4032
4101
struct ieee80211_channel * rx_channel ,
4033
4102
enum nl80211_bss_scan_width scan_width ,
4034
4103
enum cfg80211_bss_frame_type ftype ,
4035
4104
const u8 * bssid , u64 tsf , u16 capability ,
4036
4105
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
+ }
4038
4118
4039
4119
static inline struct cfg80211_bss * __must_check
4040
4120
cfg80211_inform_bss (struct wiphy * wiphy ,
@@ -4044,11 +4124,15 @@ cfg80211_inform_bss(struct wiphy *wiphy,
4044
4124
u16 beacon_interval , const u8 * ie , size_t ielen ,
4045
4125
s32 signal , gfp_t gfp )
4046
4126
{
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 );
4052
4136
}
4053
4137
4054
4138
struct cfg80211_bss * cfg80211_get_bss (struct wiphy * wiphy ,
0 commit comments