aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-08-12 14:34:30 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-08-26 05:16:01 -0400
commit0e227084aee36b3ba27b4fc9cd9e425be6ce2ab8 (patch)
tree5a862e85d25ad5cf05e8f47800e20de792592e91 /include/uapi/linux
parentf41ef64853fb1e02728e56b2d0d55aef8ed12b26 (diff)
cfg80211: clarify BSS probe response vs. beacon data
There are a few possible cases of where BSS data came from: 1) only a beacon has been received 2) only a probe response has been received 3) the driver didn't report what it received (this happens when using cfg80211_inform_bss[_width]()) 4) both probe response and beacon data has been received Unfortunately, in the userspace API, a few things weren't there: a) there was no way to differentiate cases 1) and 4) above without comparing the data of the IEs b) the TSF was always from the last frame, instead of being exposed for beacon/probe response separately like IEs Fix this by i) exporting a new flag attribute that indicates whether or not probe response data has been received - this addresses (a) ii) exporting a BEACON_TSF attribute that holds the beacon's TSF if a beacon has been received iii) not exporting the beacon attributes in case (3) above as that would just lead userspace into thinking the data actually came from a beacon when that isn't clear To implement this, track inside the IEs struct whether or not it (definitely) came from a beacon. Reported-by: William Seto Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/nl80211.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index f1db15b9c041..d097568da690 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -3055,14 +3055,20 @@ enum nl80211_bss_scan_width {
3055 * @NL80211_BSS_BSSID: BSSID of the BSS (6 octets) 3055 * @NL80211_BSS_BSSID: BSSID of the BSS (6 octets)
3056 * @NL80211_BSS_FREQUENCY: frequency in MHz (u32) 3056 * @NL80211_BSS_FREQUENCY: frequency in MHz (u32)
3057 * @NL80211_BSS_TSF: TSF of the received probe response/beacon (u64) 3057 * @NL80211_BSS_TSF: TSF of the received probe response/beacon (u64)
3058 * (if @NL80211_BSS_PRESP_DATA is present then this is known to be
3059 * from a probe response, otherwise it may be from the same beacon
3060 * that the NL80211_BSS_BEACON_TSF will be from)
3058 * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16) 3061 * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16)
3059 * @NL80211_BSS_CAPABILITY: capability field (CPU order, u16) 3062 * @NL80211_BSS_CAPABILITY: capability field (CPU order, u16)
3060 * @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the 3063 * @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the
3061 * raw information elements from the probe response/beacon (bin); 3064 * raw information elements from the probe response/beacon (bin);
3062 * if the %NL80211_BSS_BEACON_IES attribute is present, the IEs here are 3065 * if the %NL80211_BSS_BEACON_IES attribute is present and the data is
3063 * from a Probe Response frame; otherwise they are from a Beacon frame. 3066 * different then the IEs here are from a Probe Response frame; otherwise
3067 * they are from a Beacon frame.
3064 * However, if the driver does not indicate the source of the IEs, these 3068 * However, if the driver does not indicate the source of the IEs, these
3065 * IEs may be from either frame subtype. 3069 * IEs may be from either frame subtype.
3070 * If present, the @NL80211_BSS_PRESP_DATA attribute indicates that the
3071 * data here is known to be from a probe response, without any heuristics.
3066 * @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon 3072 * @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon
3067 * in mBm (100 * dBm) (s32) 3073 * in mBm (100 * dBm) (s32)
3068 * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon 3074 * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon
@@ -3074,6 +3080,10 @@ enum nl80211_bss_scan_width {
3074 * yet been received 3080 * yet been received
3075 * @NL80211_BSS_CHAN_WIDTH: channel width of the control channel 3081 * @NL80211_BSS_CHAN_WIDTH: channel width of the control channel
3076 * (u32, enum nl80211_bss_scan_width) 3082 * (u32, enum nl80211_bss_scan_width)
3083 * @NL80211_BSS_BEACON_TSF: TSF of the last received beacon (u64)
3084 * (not present if no beacon frame has been received yet)
3085 * @NL80211_BSS_PRESP_DATA: the data in @NL80211_BSS_INFORMATION_ELEMENTS and
3086 * @NL80211_BSS_TSF is known to be from a probe response (flag attribute)
3077 * @__NL80211_BSS_AFTER_LAST: internal 3087 * @__NL80211_BSS_AFTER_LAST: internal
3078 * @NL80211_BSS_MAX: highest BSS attribute 3088 * @NL80211_BSS_MAX: highest BSS attribute
3079 */ 3089 */
@@ -3091,6 +3101,8 @@ enum nl80211_bss {
3091 NL80211_BSS_SEEN_MS_AGO, 3101 NL80211_BSS_SEEN_MS_AGO,
3092 NL80211_BSS_BEACON_IES, 3102 NL80211_BSS_BEACON_IES,
3093 NL80211_BSS_CHAN_WIDTH, 3103 NL80211_BSS_CHAN_WIDTH,
3104 NL80211_BSS_BEACON_TSF,
3105 NL80211_BSS_PRESP_DATA,
3094 3106
3095 /* keep last */ 3107 /* keep last */
3096 __NL80211_BSS_AFTER_LAST, 3108 __NL80211_BSS_AFTER_LAST,