aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/driver_bsd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-04-11 08:56:20 (GMT)
committerJouni Malinen <j@w1.fi>2016-04-17 15:34:22 (GMT)
commit18ae3a675cd56ebcf476c232c603dd6da31e8441 (patch)
tree55b9d3f07f53d6a3e8b13f708ffef1c78f35dd40 /src/drivers/driver_bsd.c
parent51269b386a4f40444df144ae4760f666889a7e37 (diff)
downloadhostap-18ae3a675cd56ebcf476c232c603dd6da31e8441.zip
hostap-18ae3a675cd56ebcf476c232c603dd6da31e8441.tar.gz
hostap-18ae3a675cd56ebcf476c232c603dd6da31e8441.tar.bz2
bsd: Set level correctly for non FreeBSD systems
Only FreeBSD treats rssi as dBm, other BSD have no special meaning to rssi. Signed-off-by: Roy Marples <roy@marples.name>
Diffstat (limited to 'src/drivers/driver_bsd.c')
-rw-r--r--src/drivers/driver_bsd.c5
1 files changed, 5 insertions, 0 deletions
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);