diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2009-10-24 19:00:41 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2009-10-24 19:00:41 +0000 |
commit | 7baa71c51b9dbf84ab1d35c621b2e28f06e39a46 (patch) | |
tree | a3704019c8c0651eb9757c6175d7894ec0c2319c | |
parent | 2a0e61964eacd142489e1b4a61361f83c31df3c0 (diff) |
enable WiFi/WiMAX coexistence for 6050 combo adapters.
-rw-r--r-- | sys/dev/pci/if_iwn.c | 34 | ||||
-rw-r--r-- | sys/dev/pci/if_iwnreg.h | 29 |
2 files changed, 54 insertions, 9 deletions
diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c index 58b83640e1f..4c5fbbbc87f 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.67 2009/10/24 18:32:37 damien Exp $ */ +/* $OpenBSD: if_iwn.c,v 1.68 2009/10/24 19:00:40 damien Exp $ */ /*- * Copyright (c) 2007-2009 Damien Bergamini <damien.bergamini@free.fr> @@ -228,6 +228,7 @@ void iwn5000_ampdu_tx_stop(struct iwn_softc *, #endif int iwn5000_query_calibration(struct iwn_softc *); int iwn5000_send_calibration(struct iwn_softc *); +int iwn5000_send_wimax_coex(struct iwn_softc *); int iwn4965_post_alive(struct iwn_softc *); int iwn5000_post_alive(struct iwn_softc *); int iwn4965_load_bootcode(struct iwn_softc *, const uint8_t *, @@ -4702,6 +4703,29 @@ iwn5000_send_calibration(struct iwn_softc *sc) return 0; } +int +iwn5000_send_wimax_coex(struct iwn_softc *sc) +{ + struct iwn5000_wimax_coex wimax; + + if (sc->hw_type == IWN_HW_REV_TYPE_6050) { + /* Enable WiMAX coexistence for combo adapters. */ + wimax.flags = + IWN_WIMAX_COEX_ASSOC_WA_UNMASK | + IWN_WIMAX_COEX_UNASSOC_WA_UNMASK | + IWN_WIMAX_COEX_STA_TABLE_VALID | + IWN_WIMAX_COEX_ENABLE; + memcpy(wimax.events, iwn6050_wimax_events, + sizeof iwn6050_wimax_events); + } else { + /* Disable WiMAX coexistence. */ + wimax.flags = 0; + memset(wimax.events, 0, sizeof wimax.events); + } + DPRINTF(("Configuring WiMAX coexistence\n")); + return iwn_cmd(sc, IWN5000_CMD_WIMAX_COEX, &wimax, sizeof wimax, 0); +} + /* * This function is called after the runtime firmware notifies us of its * readiness (called in a process context.) @@ -4762,7 +4786,6 @@ iwn4965_post_alive(struct iwn_softc *sc) int iwn5000_post_alive(struct iwn_softc *sc) { - struct iwn5000_wimax_coex wimax; int error, qid; /* Switch to using ICT interrupt mode. */ @@ -4810,16 +4833,13 @@ iwn5000_post_alive(struct iwn_softc *sc) } iwn_nic_unlock(sc); - /* Configure WiMAX (IEEE 802.16e) coexistence. */ - memset(&wimax, 0, sizeof wimax); - DPRINTF(("Configuring WiMAX coexistence\n")); - error = iwn_cmd(sc, IWN5000_CMD_WIMAX_COEX, &wimax, sizeof wimax, 0); + /* Configure WiMAX coexistence for combo adapters. */ + error = iwn5000_send_wimax_coex(sc); if (error != 0) { printf("%s: could not configure WiMAX coexistence\n", sc->sc_dev.dv_xname); return error; } - if (sc->hw_type != IWN_HW_REV_TYPE_5150) { struct iwn5000_phy_calib_crystal cmd; diff --git a/sys/dev/pci/if_iwnreg.h b/sys/dev/pci/if_iwnreg.h index 10c3de89065..68de80122f3 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.27 2009/10/24 18:14:57 damien Exp $ */ +/* $OpenBSD: if_iwnreg.h,v 1.28 2009/10/24 19:00:40 damien Exp $ */ /*- * Copyright (c) 2007, 2008 @@ -704,7 +704,12 @@ struct iwn_cmd_led { /* Structure for command IWN5000_CMD_WIMAX_COEX. */ struct iwn5000_wimax_coex { uint32_t flags; - struct { +#define IWN_WIMAX_COEX_STA_TABLE_VALID (1 << 0) +#define IWN_WIMAX_COEX_UNASSOC_WA_UNMASK (1 << 2) +#define IWN_WIMAX_COEX_ASSOC_WA_UNMASK (1 << 3) +#define IWN_WIMAX_COEX_ENABLE (1 << 7) + + struct iwn5000_wimax_event { uint8_t request; uint8_t window; uint8_t reserved; @@ -1532,6 +1537,26 @@ static const uint8_t iwn_tid2fifo[] = { 1, 0, 0, 1, 2, 2, 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 3 }; +/* WiFi/WiMAX coexist event priority table for 6050. */ +static const struct iwn5000_wimax_event iwn6050_wimax_events[] = { + { 0x04, 0x03, 0x00, 0x00 }, + { 0x04, 0x03, 0x00, 0x03 }, + { 0x04, 0x03, 0x00, 0x03 }, + { 0x04, 0x03, 0x00, 0x03 }, + { 0x04, 0x03, 0x00, 0x00 }, + { 0x04, 0x03, 0x00, 0x07 }, + { 0x04, 0x03, 0x00, 0x00 }, + { 0x04, 0x03, 0x00, 0x03 }, + { 0x04, 0x03, 0x00, 0x03 }, + { 0x04, 0x03, 0x00, 0x00 }, + { 0x06, 0x03, 0x00, 0x07 }, + { 0x04, 0x03, 0x00, 0x00 }, + { 0x06, 0x06, 0x00, 0x03 }, + { 0x04, 0x03, 0x00, 0x07 }, + { 0x04, 0x03, 0x00, 0x00 }, + { 0x04, 0x03, 0x00, 0x00 } +}; + /* Firmware errors. */ static const char * const iwn_fw_errmsg[] = { "OK", |