]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Add parsing of NL80211_BSS_SEEN_MS_AGO into scan results
authorJouni Malinen <jouni.malinen@atheros.com>
Thu, 1 Oct 2009 14:53:22 +0000 (17:53 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 1 Oct 2009 14:53:22 +0000 (17:53 +0300)
src/common/nl80211_copy.h
src/drivers/driver.h
src/drivers/driver_nl80211.c

index a8d71ed43a0e80a8608dadebe343c61379cd88ef..50afca3dcff14e0128402297ebc5c2f92638a4f6 100644 (file)
@@ -1277,6 +1277,7 @@ enum nl80211_channel_type {
  * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon
  *     in unspecified units, scaled to 0..100 (u8)
  * @NL80211_BSS_STATUS: status, if this BSS is "used"
+ * @NL80211_BSS_SEEN_MS_AGO: age of this BSS entry in ms
  * @__NL80211_BSS_AFTER_LAST: internal
  * @NL80211_BSS_MAX: highest BSS attribute
  */
@@ -1291,6 +1292,7 @@ enum nl80211_bss {
        NL80211_BSS_SIGNAL_MBM,
        NL80211_BSS_SIGNAL_UNSPEC,
        NL80211_BSS_STATUS,
+       NL80211_BSS_SEEN_MS_AGO,
 
        /* keep last */
        __NL80211_BSS_AFTER_LAST,
index c3be9d12762a354c3a34670a9a2b6930025f0d5f..9b44f13dce2f4b24a46f6160142aa740167ade05 100644 (file)
@@ -134,6 +134,8 @@ struct wpa_scan_result {
  * @noise: noise level
  * @level: signal level
  * @tsf: Timestamp
+ * @age: Age of the information in milliseconds (i.e., how many milliseconds
+ * ago the last Beacon or Probe Response frame was received)
  * @ie_len: length of the following IE field in octets
  *
  * This structure is used as a generic format for scan results from the
@@ -155,6 +157,7 @@ struct wpa_scan_res {
        int noise;
        int level;
        u64 tsf;
+       unsigned int age;
        size_t ie_len;
        /* followed by ie_len octets of IEs */
 };
index fee6cf9d49ecc3c0d6cd30b17df90c7e17c38dff..bf741adbb84baad4b3749ee9235d133a419c5376 100644 (file)
@@ -1654,6 +1654,7 @@ static int bss_info_handler(struct nl_msg *msg, void *arg)
                [NL80211_BSS_INFORMATION_ELEMENTS] = { .type = NLA_UNSPEC },
                [NL80211_BSS_SIGNAL_MBM] = { .type = NLA_U32 },
                [NL80211_BSS_SIGNAL_UNSPEC] = { .type = NLA_U8 },
+               [NL80211_BSS_SEEN_MS_AGO] = { .type = NLA_U32 },
        };
        struct wpa_scan_results *res = arg;
        struct wpa_scan_res **tmp;
@@ -1700,6 +1701,8 @@ static int bss_info_handler(struct nl_msg *msg, void *arg)
                r->flags |= WPA_SCAN_LEVEL_INVALID | WPA_SCAN_QUAL_INVALID;
        if (bss[NL80211_BSS_TSF])
                r->tsf = nla_get_u64(bss[NL80211_BSS_TSF]);
+       if (bss[NL80211_BSS_SEEN_MS_AGO])
+               r->age = nla_get_u32(bss[NL80211_BSS_SEEN_MS_AGO]);
        r->ie_len = ie_len;
        if (ie)
                os_memcpy(r + 1, ie, ie_len);