summaryrefslogtreecommitdiff
path: root/sys/dev/ic/bwfm.c
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2022-06-27 09:16:57 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2022-06-27 09:16:57 +0000
commit84aaa079d20236fd03271f1d5a96e8d1db72cfd6 (patch)
treee77d230fab6e575310e795982ac22246a8483483 /sys/dev/ic/bwfm.c
parentde5a04ae0e1ffdb05ee9805979c1df37cd9d9600 (diff)
Fix bwfm(4) ifconfig media display on devices with sta_info command version 3.
ok jsg@
Diffstat (limited to 'sys/dev/ic/bwfm.c')
-rw-r--r--sys/dev/ic/bwfm.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/sys/dev/ic/bwfm.c b/sys/dev/ic/bwfm.c
index 0c9c948115a..508885a845a 100644
--- a/sys/dev/ic/bwfm.c
+++ b/sys/dev/ic/bwfm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bwfm.c,v 1.103 2022/04/21 21:03:02 stsp Exp $ */
+/* $OpenBSD: bwfm.c,v 1.104 2022/06/27 09:16:56 stsp Exp $ */
/*
* Copyright (c) 2010-2016 Broadcom Corporation
* Copyright (c) 2016,2017 Patrick Wildt <patrick@blueri.se>
@@ -703,22 +703,24 @@ bwfm_update_node(void *arg, struct ieee80211_node *ni)
if (!IEEE80211_ADDR_EQ(ni->ni_macaddr, sta.ea))
return;
- if (le16toh(sta.ver) < 4)
+ if (le16toh(sta.ver) < 3)
return;
flags = le32toh(sta.flags);
if ((flags & BWFM_STA_SCBSTATS) == 0)
return;
- rssi = 0;
- for (i = 0; i < BWFM_ANT_MAX; i++) {
- if (sta.rssi[i] >= 0)
- continue;
- if (rssi == 0 || sta.rssi[i] > rssi)
- rssi = sta.rssi[i];
+ if (le16toh(sta.ver) >= 4) {
+ rssi = 0;
+ for (i = 0; i < BWFM_ANT_MAX; i++) {
+ if (sta.rssi[i] >= 0)
+ continue;
+ if (rssi == 0 || sta.rssi[i] > rssi)
+ rssi = sta.rssi[i];
+ }
+ if (rssi)
+ ni->ni_rssi = rssi;
}
- if (rssi)
- ni->ni_rssi = rssi;
txrate = le32toh(sta.tx_rate); /* in kbit/s */
if (txrate == 0xffffffff) /* Seen this happening during association. */