summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2019-04-01 15:19:57 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2019-04-01 15:19:57 +0000
commitdb0fee1f0cf56f66603e3251b424ec2b6d47baca (patch)
tree1759cbcd34999af96b561954252beb0bb2e4ad4d /sys/dev
parent0618cf58d3e7668824f6379c696eb38556f722c1 (diff)
Correctly extract the RSSI information from the structure. It's
a 16-bit value, so we have to use letoh16() instead of letoh32(). Also properly cast it to signed, so that it can be sign-extended properly. ok stsp@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/bwfm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/ic/bwfm.c b/sys/dev/ic/bwfm.c
index e68acd92a53..0174d2e603b 100644
--- a/sys/dev/ic/bwfm.c
+++ b/sys/dev/ic/bwfm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bwfm.c,v 1.58 2019/02/19 08:12:30 stsp Exp $ */
+/* $OpenBSD: bwfm.c,v 1.59 2019/04/01 15:19:56 patrick Exp $ */
/*
* Copyright (c) 2010-2016 Broadcom Corporation
* Copyright (c) 2016,2017 Patrick Wildt <patrick@blueri.se>
@@ -2411,7 +2411,7 @@ bwfm_scan_node(struct bwfm_softc *sc, struct bwfm_bss_info *bss, size_t len)
ni->ni_chan = &ic->ic_channels[chanidx];
/* Supply RSSI */
rxi.rxi_flags = 0;
- rxi.rxi_rssi = letoh32(bss->rssi);
+ rxi.rxi_rssi = (int16_t)letoh16(bss->rssi);
rxi.rxi_tstamp = 0;
ieee80211_input(ifp, m, ni, &rxi);
/* Restore channel */