BSD: set level correctly for non FreeBSD systems

Roy Marples roy at marples.name
Mon Apr 11 01:56:20 PDT 2016


commit e248a328b446646592aa4a0d018ebeecb12986e1
Author: Roy Marples <roy at marples.name>
Date:   Mon Apr 11 09:48:21 2016 +0100

    Only FreeBSD treats rssi as dBm, other BSD have no special meaning
    to rssi.
    
    Signed-off-by: Roy Marples <roy at marples.name>

diff --git a/src/drivers/driver_bsd.c b/src/drivers/driver_bsd.c
index fd73f2e..2afd7df 100644
--- a/src/drivers/driver_bsd.c
+++ b/src/drivers/driver_bsd.c
@@ -1376,11 +1376,16 @@ wpa_driver_bsd_add_scan_entry(struct wpa_scan_results *res,
 	result->caps = sr->isr_capinfo;
 	result->qual = sr->isr_rssi;
 	result->noise = sr->isr_noise;
+
+#ifdef __FreeBSD__
 	/*
 	 * the rssi value reported by the kernel is in 0.5dB steps relative to
 	 * the reported noise floor. see ieee80211_node.h for details.
 	 */
 	result->level = sr->isr_rssi / 2 + sr->isr_noise;
+#else
+	result->level = sr->isr_rssi;
+#endif
 
 	pos = (u8 *)(result + 1);
 


More information about the Hostap mailing list