diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2011-09-01 18:49:57 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2011-09-01 18:49:57 +0000 |
commit | 9541d1e9935ed1f995936e6a2abd46c1ee30eaed (patch) | |
tree | 3ec53787d7f2c5636906bdafb3ef3be9dde88290 /sys/dev | |
parent | a1045c89b975d3bf62a4d8059fc39df13a626292 (diff) |
The 6005 and 6050-based parts need DC calibration turned on, otherwise the
firmware will crap out, at least on the 6005. First step to getting my
"Intel Centrino Advanced-N 6205" to work.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_iwn.c | 26 | ||||
-rw-r--r-- | sys/dev/pci/if_iwnreg.h | 4 |
2 files changed, 28 insertions, 2 deletions
diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c index a89548c8931..fba7401767a 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.110 2011/06/16 19:48:22 oga Exp $ */ +/* $OpenBSD: if_iwn.c,v 1.111 2011/09/01 18:49:56 kettenis Exp $ */ /*- * Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr> @@ -207,6 +207,7 @@ int iwn_send_sensitivity(struct iwn_softc *); int iwn_set_pslevel(struct iwn_softc *, int, int, int); int iwn_send_temperature_offset(struct iwn_softc *); int iwn_send_btcoex(struct iwn_softc *); +int iwn5000_runtime_calib(struct iwn_softc *); int iwn_config(struct iwn_softc *); int iwn_scan(struct iwn_softc *, uint16_t); int iwn_auth(struct iwn_softc *); @@ -4126,6 +4127,18 @@ iwn_send_btcoex(struct iwn_softc *sc) } int +iwn5000_runtime_calib(struct iwn_softc *sc) +{ + struct iwn5000_calib_config cmd; + + memset(&cmd, 0, sizeof cmd); + cmd.ucode.once.enable = 0xffffffff; + cmd.ucode.once.start = IWN5000_CALIB_DC; + DPRINTF(("configuring runtime calibration\n")); + return iwn_cmd(sc, IWN5000_CMD_CALIB_CONFIG, &cmd, sizeof(cmd), 0); +} + +int iwn_config(struct iwn_softc *sc) { struct iwn_ops *ops = &sc->ops; @@ -4145,6 +4158,17 @@ iwn_config(struct iwn_softc *sc) } } + if (sc->hw_type == IWN_HW_REV_TYPE_6050 || + sc->hw_type == IWN_HW_REV_TYPE_6005) { + /* Configure runtime DC calibration. */ + error = iwn5000_runtime_calib(sc); + if (error != 0) { + printf("%s: could not configure runtime calibration\n", + sc->sc_dev.dv_xname); + return error; + } + } + /* Configure valid TX chains for >=5000 Series. */ if (sc->hw_type != IWN_HW_REV_TYPE_4965) { txmask = htole32(sc->txchainmask); diff --git a/sys/dev/pci/if_iwnreg.h b/sys/dev/pci/if_iwnreg.h index cd88cd010f3..3303750d709 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.42 2011/01/09 15:45:37 damien Exp $ */ +/* $OpenBSD: if_iwnreg.h,v 1.43 2011/09/01 18:49:56 kettenis Exp $ */ /*- * Copyright (c) 2007, 2008 @@ -727,6 +727,8 @@ struct iwn5000_wimax_coex { struct iwn5000_calib_elem { uint32_t enable; uint32_t start; +#define IWN5000_CALIB_DC (1 << 1) + uint32_t send; uint32_t apply; uint32_t reserved; |