55 *
66 * Copyright 2006-2010 Johannes Berg <[email protected] > 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);
39584005void 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 */
39774021struct 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
39784028cfg80211_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
39844043static inline struct cfg80211_bss * __must_check
39854044cfg80211_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 */
40304091struct 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
40314100cfg80211_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
40394119static inline struct cfg80211_bss * __must_check
40404120cfg80211_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
40544138struct cfg80211_bss * cfg80211_get_bss (struct wiphy * wiphy ,
0 commit comments