diff options
author | thompsa <thompsa@FreeBSD.org> | 2007-10-12 05:23:00 +0000 |
---|---|---|
committer | thompsa <thompsa@FreeBSD.org> | 2007-10-12 05:23:00 +0000 |
commit | a7a6cc62cbb4f888b36f438e41119d295a856e55 (patch) | |
tree | 0fc6812db765f9b2f15140dfde14ea64fb1fc6e4 /sys/dev/ipw/if_ipwvar.h | |
parent | 58809b0788815a16cbc3fbef8276ecca2f0bf19e (diff) | |
download | FreeBSD-src-a7a6cc62cbb4f888b36f438e41119d295a856e55.zip FreeBSD-src-a7a6cc62cbb4f888b36f438e41119d295a856e55.tar.gz |
Update ipw to work with the new net80211 stack, plus other driver improvements.
- Add proper scanning support rather than letting the firmware grab the first
access point
- Overhaul state changes
- Use macros for locking and provide _locked() versions of some functions
- Increase debugging output
- Use a callout rather than the old watchdog interface
- Improve style, function names and defines
- Add WPA (TKIP) support
Based heavily on a patchset provided by Sam Leffler.
Diffstat (limited to 'sys/dev/ipw/if_ipwvar.h')
-rw-r--r-- | sys/dev/ipw/if_ipwvar.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/sys/dev/ipw/if_ipwvar.h b/sys/dev/ipw/if_ipwvar.h index c97d6a8..f6ec999 100644 --- a/sys/dev/ipw/if_ipwvar.h +++ b/sys/dev/ipw/if_ipwvar.h @@ -85,12 +85,21 @@ struct ipw_softc { struct mtx sc_mtx; struct task sc_init_task; + struct task sc_scan_task; + struct task sc_chan_task; + struct task sc_assoc_task; + struct task sc_disassoc_task; + struct callout sc_wdtimer; /* watchdog timer */ uint32_t flags; #define IPW_FLAG_FW_INITED (1 << 0) #define IPW_FLAG_INIT_LOCKED (1 << 1) #define IPW_FLAG_HAS_RADIO_SWITCH (1 << 2) -#define IPW_FLAG_FW_WARNED (1 << 3) +#define IPW_FLAG_HACK (1 << 3) +#define IPW_FLAG_SCANNING (1 << 4) +#define IPW_FLAG_ENABLED (1 << 5) +#define IPW_FLAG_BUSY (1 << 6) +#define IPW_FLAG_ASSOCIATED (1 << 7) int irq_rid; int mem_rid; @@ -102,6 +111,7 @@ struct ipw_softc { const struct firmware *sc_firmware; int sc_tx_timer; + int sc_scan_timer; bus_dma_tag_t tbd_dmat; bus_dma_tag_t rbd_dmat; @@ -160,3 +170,18 @@ struct ipw_softc { #define sc_txtap sc_txtapu.th int sc_txtap_len; }; + +/* + * NB.: This models the only instance of async locking in ipw_init_locked + * and must be kept in sync. + */ +#define IPW_LOCK_DECL int __waslocked = 0 +#define IPW_LOCK(sc) do { \ + if (!(__waslocked = mtx_owned(&(sc)->sc_mtx))) \ + mtx_lock(&sc->sc_mtx); \ +} while (0) +#define IPW_UNLOCK(sc) do { \ + if (!__waslocked) \ + mtx_unlock(&sc->sc_mtx); \ +} while (0) +#define IPW_LOCK_ASSERT(sc) mtx_assert(&(sc)->sc_mtx, MA_OWNED) |