History

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.

Johannes Berg committed 12 years ago

Commit 0e227081 parent f41ef644 files · +32 −8Browse files

Showing the changes to include/uapi/linux (1 of 4 files). Show all

Unified · Split

include/uapi/linux/nl80211.h+14−2
@@ -3055,14 +3055,20 @@ enum nl80211_bss_scan_width { · 3054 unmodified lines
30553055 * @NL80211_BSS_BSSID: BSSID of the BSS (6 octets)
30563056 * @NL80211_BSS_FREQUENCY: frequency in MHz (u32)
30573057 * @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)
30583061 * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16)
30593062 * @NL80211_BSS_CAPABILITY: capability field (CPU order, u16)
30603063 * @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the
30613064 * raw information elements from the probe response/beacon (bin);
3062− * if the %NL80211_BSS_BEACON_IES attribute is present, the IEs here are
3063− * from a Probe Response frame; otherwise they are from a Beacon frame.
3065+ * if the %NL80211_BSS_BEACON_IES attribute is present and the data is
3066+ * different then the IEs here are from a Probe Response frame; otherwise
3067+ * they are from a Beacon frame.
30643068 * However, if the driver does not indicate the source of the IEs, these
30653069 * 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.
30663072 * @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon
30673073 * in mBm (100 * dBm) (s32)
30683074 * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon
@@ -3074,6 +3080,10 @@ enum nl80211_bss_scan_width { · 5 unmodified lines
30743080 * yet been received
30753081 * @NL80211_BSS_CHAN_WIDTH: channel width of the control channel
30763082 * (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)
30773087 * @__NL80211_BSS_AFTER_LAST: internal
30783088 * @NL80211_BSS_MAX: highest BSS attribute
30793089 */
@@ -3091,6 +3101,8 @@ enum nl80211_bss { · 11 unmodified lines
30913101 NL80211_BSS_SEEN_MS_AGO,
30923102 NL80211_BSS_BEACON_IES,
30933103 NL80211_BSS_CHAN_WIDTH,
3104+ NL80211_BSS_BEACON_TSF,
3105+ NL80211_BSS_PRESP_DATA,
30943106
30953107 /* keep last */
30963108 __NL80211_BSS_AFTER_LAST,