Search Linux Wireless

[RFC 2/2] mac80211: support rssi threshold scan

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Thomas Pedersen <c_tpeder@xxxxxxxxxxxxxxxx>
---
 net/mac80211/main.c |    3 +++
 net/mac80211/scan.c |    4 ++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index f5548e9..3f49d1b 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -873,6 +873,9 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 	if (local->hw.wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS)
 		local->hw.wiphy->flags |= WIPHY_FLAG_TDLS_EXTERNAL_SETUP;
 
+	if (local->hw.wiphy->signal_type == CFG80211_SIGNAL_TYPE_MBM)
+		local->hw.wiphy->flags |= WIPHY_FLAG_SUPPORTS_RSSI_SCAN;
+
 	result = wiphy_register(local->hw.wiphy);
 	if (result < 0)
 		goto fail_wiphy_register;
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 8282284..1b92405 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -212,6 +212,10 @@ ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
 	if (baselen > skb->len)
 		return RX_DROP_MONITOR;
 
+	if (sdata->local->scan_req->rssi &&
+	    rx_status->signal < sdata->local->scan_req->rssi)
+		return RX_DROP_MONITOR;
+
 	ieee802_11_parse_elems(elements, skb->len - baselen, &elems);
 
 	if (elems.ds_params && elems.ds_params_len == 1)
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux