summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2008-11-19 18:52:54 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2008-11-19 18:52:54 +0000
commitbb0722f32f29812c4c0ba45a62cc233ac69cb924 (patch)
treee18e3ff01a6fc49c82b3c66aa4b715dbdaa922d4
parentee1b1f927545a3f22c88f5122ec56ecce06d3bd3 (diff)
For 5000 Series, store baseband calibration results sent by the
initialization firmware and send them to the runtime firmware. This has no effect on my 5300 since the initialization firmware does not send baseband results. This may be important for other chips though or for future firmware revisions.
-rw-r--r--sys/dev/pci/if_iwn.c17
-rw-r--r--sys/dev/pci/if_iwnreg.h11
-rw-r--r--sys/dev/pci/if_iwnvar.h4
3 files changed, 23 insertions, 9 deletions
diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c
index 47f1f333188..423f89013b1 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.34 2008/11/16 09:52:31 damien Exp $ */
+/* $OpenBSD: if_iwn.c,v 1.35 2008/11/19 18:52:53 damien Exp $ */
/*-
* Copyright (c) 2007, 2008
@@ -1737,12 +1737,15 @@ iwn5000_rx_calib_results(struct iwn_softc *sc, struct iwn_rx_desc *desc)
case IWN5000_PHY_CALIB_LO:
idx = 0;
break;
- case IWN5000_PHY_CALIB_LO_TX_IQ:
+ case IWN5000_PHY_CALIB_TX_IQ:
idx = 1;
break;
- case IWN5000_PHY_CALIB_LO_TX_IQ_PERD:
+ case IWN5000_PHY_CALIB_TX_IQ_PERD:
idx = 2;
break;
+ case IWN5000_PHY_CALIB_BASE_BAND:
+ idx = 3;
+ break;
default:
/* Ignore other results. */
return;
@@ -4247,7 +4250,7 @@ iwn5000_send_calibration(struct iwn_softc *sc)
{
int idx, error;
- for (idx = 0; idx < 3; idx++) {
+ for (idx = 0; idx < 4; idx++) {
if (sc->calibcmd[idx].buf == NULL)
continue; /* No results available. */
DPRINTF(("send calibration result idx=%d len=%d\n",
@@ -4282,6 +4285,9 @@ iwn4965_post_alive(struct iwn_softc *sc)
/* Set physical address of TX scheduler rings (1KB aligned.) */
iwn_prph_write(sc, IWN4965_SCHED_DRAM_ADDR, sc->sched_dma.paddr >> 10);
+
+ IWN_SETBITS(sc, IWN_FH_TX_CHICKEN, IWN_FH_TX_CHICKEN_SCHED_RETRY);
+
/* Disable chain mode for all our 16 queues. */
iwn_prph_write(sc, IWN4965_SCHED_QCHAIN_SEL, 0);
@@ -4333,6 +4339,9 @@ iwn5000_post_alive(struct iwn_softc *sc)
/* Set physical address of TX scheduler rings (1KB aligned.) */
iwn_prph_write(sc, IWN5000_SCHED_DRAM_ADDR, sc->sched_dma.paddr >> 10);
+
+ IWN_SETBITS(sc, IWN_FH_TX_CHICKEN, IWN_FH_TX_CHICKEN_SCHED_RETRY);
+
/* Enable chain mode for all our 20 queues. */
iwn_prph_write(sc, IWN5000_SCHED_QCHAIN_SEL, 0xfffff);
iwn_prph_write(sc, IWN5000_SCHED_AGGR_SEL, 0);
diff --git a/sys/dev/pci/if_iwnreg.h b/sys/dev/pci/if_iwnreg.h
index 509e44ed979..ba944ece559 100644
--- a/sys/dev/pci/if_iwnreg.h
+++ b/sys/dev/pci/if_iwnreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwnreg.h,v 1.15 2008/11/09 10:00:17 damien Exp $ */
+/* $OpenBSD: if_iwnreg.h,v 1.16 2008/11/19 18:52:53 damien Exp $ */
/*-
* Copyright (c) 2007, 2008
@@ -87,6 +87,7 @@
#define IWN_FH_RX_STATUS 0x1c44
#define IWN_FH_TX_CONFIG(qid) (0x1d00 + (qid) * 32)
#define IWN_FH_TXBUF_STATUS(qid) (0x1d08 + (qid) * 32)
+#define IWN_FH_TX_CHICKEN 0x1e98
#define IWN_FH_TX_STATUS 0x1eb0
/*
@@ -242,6 +243,9 @@
#define IWN_FH_TXBUF_STATUS_TBIDX(x) ((x) << 12)
#define IWN_FH_TXBUF_STATUS_TFBD_VALID 3
+/* Possible flags for register IWN_FH_TX_CHICKEN. */
+#define IWN_FH_TX_CHICKEN_SCHED_RETRY (1 << 1)
+
/* Possible flags for register IWN_FH_TX_STATUS. */
#define IWN_FH_TX_STATUS_IDLE(chnl) \
(1 << ((chnl) + 24) | 1 << ((chnl) + 16))
@@ -820,9 +824,10 @@ struct iwn_phy_calib {
uint8_t code;
#define IWN4965_PHY_CALIB_DIFF_GAIN 7
#define IWN5000_PHY_CALIB_LO 9
-#define IWN5000_PHY_CALIB_LO_TX_IQ 11
+#define IWN5000_PHY_CALIB_TX_IQ 11
#define IWN5000_PHY_CALIB_CRYSTAL 15
-#define IWN5000_PHY_CALIB_LO_TX_IQ_PERD 17
+#define IWN5000_PHY_CALIB_BASE_BAND 16
+#define IWN5000_PHY_CALIB_TX_IQ_PERD 17
#define IWN5000_PHY_CALIB_RESET_NOISE_GAIN 18
#define IWN5000_PHY_CALIB_NOISE_GAIN 19
diff --git a/sys/dev/pci/if_iwnvar.h b/sys/dev/pci/if_iwnvar.h
index c7e5996a50e..506e3dd32a2 100644
--- a/sys/dev/pci/if_iwnvar.h
+++ b/sys/dev/pci/if_iwnvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwnvar.h,v 1.5 2008/11/09 10:00:17 damien Exp $ */
+/* $OpenBSD: if_iwnvar.h,v 1.6 2008/11/19 18:52:53 damien Exp $ */
/*-
* Copyright (c) 2007, 2008
@@ -246,7 +246,7 @@ struct iwn_softc {
struct iwn_calib_state calib;
struct iwn_fw_info fw;
- struct iwn_calib_info calibcmd[3];
+ struct iwn_calib_info calibcmd[4];
uint32_t errptr;
struct iwn_rx_stat last_rx_stat;