lib80211: remove unused host_build_iv option
[firefly-linux-kernel-4.4.55.git] / net / wireless / scan.c
index a026c6d56bd3347898cb1486301aedba37119b03..5ca8c7180141d8dc9bc43d607eb26395cd0268bf 100644 (file)
@@ -275,6 +275,7 @@ struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
 {
        struct cfg80211_registered_device *dev = wiphy_to_dev(wiphy);
        struct cfg80211_internal_bss *bss, *res = NULL;
+       unsigned long now = jiffies;
 
        spin_lock_bh(&dev->bss_lock);
 
@@ -283,6 +284,10 @@ struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
                        continue;
                if (channel && bss->pub.channel != channel)
                        continue;
+               /* Don't get expired BSS structs */
+               if (time_after(now, bss->ts + IEEE80211_SCAN_RESULT_EXPIRE) &&
+                   !atomic_read(&bss->hold))
+                       continue;
                if (is_bss(&bss->pub, bssid, ssid, ssid_len)) {
                        res = bss;
                        kref_get(&res->ref);
@@ -515,7 +520,7 @@ cfg80211_inform_bss(struct wiphy *wiphy,
 
        privsz = wiphy->bss_priv_size;
 
-       if (WARN_ON(wiphy->signal_type == NL80211_BSS_SIGNAL_UNSPEC &&
+       if (WARN_ON(wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC &&
                        (signal < 0 || signal > 100)))
                return NULL;
 
@@ -571,7 +576,7 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
                                      u.probe_resp.variable);
        size_t privsz = wiphy->bss_priv_size;
 
-       if (WARN_ON(wiphy->signal_type == NL80211_BSS_SIGNAL_UNSPEC &&
+       if (WARN_ON(wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC &&
                    (signal < 0 || signal > 100)))
                return NULL;