summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2010-01-28 16:59:31 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2010-01-28 16:59:31 +0000
commit1bd4468307a187e9835b605066499939fa16dad2 (patch)
tree1b4315b4dbe72690172e4e75853862caecd6bf69
parenta6b2bb6fab9638e1fb13165f02c384643409da0c (diff)
set differential gains on 6250 too (but use a 1.0 factor, not 1.5).
-rw-r--r--sys/dev/pci/if_iwn.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c
index 4af38df1b88..106ebb62c85 100644
--- a/sys/dev/pci/if_iwn.c
+++ b/sys/dev/pci/if_iwn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwn.c,v 1.82 2010/01/23 09:14:13 damien Exp $ */
+/* $OpenBSD: if_iwn.c,v 1.83 2010/01/28 16:59:30 damien Exp $ */
/*-
* Copyright (c) 2007-2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -3770,9 +3770,6 @@ iwn5000_init_gains(struct iwn_softc *sc)
{
struct iwn_phy_calib cmd;
- if (sc->hw_type == IWN_HW_REV_TYPE_6050)
- return 0;
-
memset(&cmd, 0, sizeof cmd);
cmd.code = IWN5000_PHY_CALIB_RESET_NOISE_GAIN;
cmd.ngroups = 1;
@@ -3818,10 +3815,10 @@ iwn5000_set_gains(struct iwn_softc *sc)
{
struct iwn_calib_state *calib = &sc->calib;
struct iwn_phy_calib_gain cmd;
- int i, ant, delta;
+ int i, ant, div, delta;
- if (sc->hw_type == IWN_HW_REV_TYPE_6050)
- return 0;
+ /* We collected 20 beacons and !=6050 need a 1.5 factor. */
+ div = (sc->hw_type == IWN_HW_REV_TYPE_6050) ? 20 : 30;
memset(&cmd, 0, sizeof cmd);
cmd.code = IWN5000_PHY_CALIB_NOISE_GAIN;
@@ -3834,7 +3831,7 @@ iwn5000_set_gains(struct iwn_softc *sc)
if (sc->chainmask & (1 << i)) {
/* The delta is relative to antenna "ant". */
delta = ((int32_t)calib->noise[ant] -
- (int32_t)calib->noise[i]) / 30;
+ (int32_t)calib->noise[i]) / div;
/* Limit to [-4.5dB,+4.5dB]. */
cmd.gain[i - 1] = MIN(abs(delta), 3);
if (delta < 0)