summaryrefslogtreecommitdiff
path: root/sys/dev/ic/bcw.c
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2007-02-23 19:51:38 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2007-02-23 19:51:38 +0000
commit04905dfdbe40230067ef5ae1626244dcb66ccd44 (patch)
tree41366c5502404b24f2eff185699b3057535c678b /sys/dev/ic/bcw.c
parent38bc8f06eacaa5b5e9a70a7b54660968e6ed799a (diff)
Add missing routine to just allow a number in a given range. Replaces
some /* XXX */ lines.
Diffstat (limited to 'sys/dev/ic/bcw.c')
-rw-r--r--sys/dev/ic/bcw.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/ic/bcw.c b/sys/dev/ic/bcw.c
index 66201456b8c..5d9541f513f 100644
--- a/sys/dev/ic/bcw.c
+++ b/sys/dev/ic/bcw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bcw.c,v 1.51 2007/02/23 19:44:37 mglocker Exp $ */
+/* $OpenBSD: bcw.c,v 1.52 2007/02/23 19:51:37 mglocker Exp $ */
/*
* Copyright (c) 2006 Jon Simola <jsimola@gmail.com>
@@ -4901,7 +4901,7 @@ bcw_radio_nrssi_hw_update(struct bcw_softc *sc, uint16_t val)
for (i = 0; i < 64; i++) {
tmp = bcw_radio_nrssi_hw_read(sc, i);
tmp -= val;
- /* XXX limit_value() ? */
+ tmp = bcw_lv(tmp, 32, 31);
bcw_radio_nrssi_hw_write(sc, i, tmp);
}
}
@@ -4929,7 +4929,7 @@ bcw_radio_calc_nrssi_threshold(struct bcw_softc *sc)
} else
threshold = sc->sc_radio_nrssi[1] - 5;
- threshold = 0; /* XXX limit_value() */
+ threshold = bcw_lv(threshold, 0, 0x3e);
bcw_phy_read16(sc, 0x0020);
bcw_phy_write16(sc, 0x0020, (((uint16_t)threshold) << 8) |
0x001c);
@@ -4980,7 +4980,7 @@ bcw_radio_calc_nrssi_threshold(struct bcw_softc *sc)
else
a += 32;
a = a >> 6;
- a = 0; /* XXX limit_value() */
+ a = bcw_lv(a, -31, 31);
b = b * (sc->sc_radio_nrssi[1] - sc->sc_radio_nrssi[0]);
b += (sc->sc_radio_nrssi[0] << 6);
@@ -4989,7 +4989,7 @@ bcw_radio_calc_nrssi_threshold(struct bcw_softc *sc)
else
b += 32;
b = b >> 6;
- b = 0; /* XXX limit_value() */
+ b = bcw_lv(b, -31, 31);
tmp_u16 = bcw_phy_read16(sc, 0x048a) & 0xf000;
tmp_u16 |= ((uint32_t)b & 0x0000003f);
@@ -5339,7 +5339,7 @@ bcw_radio_set_txpower_a(struct bcw_softc *sc, uint16_t txpower)
{
uint16_t pamp, base, dac, ilt;
- /* TODO txpower = limit_value(txpower, 0, 63); */
+ txpower = bcw_lv(txpower, 0, 63);
pamp = bcw_radio_get_txgain_freq_power_amp(txpower);
pamp <<= 5;