summaryrefslogtreecommitdiffstats
path: root/sys/dev/wpi/if_wpivar.h
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2009-05-02 15:14:18 +0000
committerthompsa <thompsa@FreeBSD.org>2009-05-02 15:14:18 +0000
commited7c3176b96444dc82c6a07114013192611024f3 (patch)
tree46c2c9933cb1753f24ffd7c0096b2ba9074180d2 /sys/dev/wpi/if_wpivar.h
parentb704e6092a4076e74c276c0d531447a8cb3bf6a6 (diff)
downloadFreeBSD-src-ed7c3176b96444dc82c6a07114013192611024f3.zip
FreeBSD-src-ed7c3176b96444dc82c6a07114013192611024f3.tar.gz
Create a taskqueue for each wireless interface which provides a serialised
sleepable context for net80211 driver callbacks. This removes the need for USB and firmware based drivers to roll their own code to defer the chip programming for state changes, scan requests, channel changes and mcast/promisc updates. When a driver callback completes the hardware state is now guaranteed to have been updated and is in sync with net80211 layer. This nukes around 1300 lines of code from the wireless device drivers making them more readable and less race prone. The net80211 layer has been updated as follows - all state/channel changes are serialised on the taskqueue. - ieee80211_new_state() always queues and can now be called from any context - scanning runs from a single taskq function and executes to completion. driver callbacks are synchronous so the channel, phy mode and rx filters are guaranteed to be set in hardware before probe request frames are transmitted. Help and contributions from Sam Leffler. Reviewed by: sam
Diffstat (limited to 'sys/dev/wpi/if_wpivar.h')
-rw-r--r--sys/dev/wpi/if_wpivar.h41
1 files changed, 3 insertions, 38 deletions
diff --git a/sys/dev/wpi/if_wpivar.h b/sys/dev/wpi/if_wpivar.h
index a447fd3..36da3b1 100644
--- a/sys/dev/wpi/if_wpivar.h
+++ b/sys/dev/wpi/if_wpivar.h
@@ -144,9 +144,8 @@ struct wpi_softc {
*/
uint32_t flags;
#define WPI_FLAG_HW_RADIO_OFF (1 << 0)
-#define WPI_FLAG_SCANNING (1 << 1)
-#define WPI_FLAG_BUSY (1 << 2)
-#define WPI_FLAG_AUTH (1 << 3)
+#define WPI_FLAG_BUSY (1 << 1)
+#define WPI_FLAG_AUTH (1 << 2)
/* shared area */
struct wpi_dma_info shared_dma;
@@ -193,36 +192,9 @@ struct wpi_softc {
/* firmware DMA transfer */
struct wpi_dma_info fw_dma;
- /* command queue related variables */
-#define WPI_SCAN_START (1<<0)
-#define WPI_SCAN_CURCHAN (1<<1)
-#define WPI_SCAN_STOP (1<<2)
-#define WPI_SET_CHAN (1<<3)
-#define WPI_AUTH (1<<4)
-#define WPI_RUN (1<<5)
-#define WPI_SCAN_NEXT (1<<6)
-#define WPI_RESTART (1<<7)
-#define WPI_RF_RESTART (1<<8)
-#define WPI_CMD_MAXOPS 10
- /* command queuing request type */
-#define WPI_QUEUE_NORMAL 0
-#define WPI_QUEUE_CLEAR 1
- int sc_cmd[WPI_CMD_MAXOPS];
- int sc_cmd_arg[WPI_CMD_MAXOPS];
- int sc_cmd_cur; /* current queued scan task */
- int sc_cmd_next; /* last queued scan task */
- struct mtx sc_cmdlock;
-
- /* Task queues used to control the driver */
- struct taskqueue *sc_tq; /* Main command task queue */
- struct taskqueue *sc_tq2; /* firmware reset task queue */
-
/* Tasks used by the driver */
- struct task sc_radioontask; /* enable rf transmitter task*/
- struct task sc_radioofftask;/* disable rf transmitter task*/
- struct task sc_opstask; /* operation handling task */
struct task sc_restarttask; /* reset firmware task */
- struct task sc_bmiss_task; /* beacon miss */
+ struct task sc_radiotask; /* reset rf task */
/* Eeprom info */
uint8_t cap;
@@ -239,10 +211,3 @@ struct wpi_softc {
#define WPI_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
#define WPI_LOCK_ASSERT(sc) mtx_assert(&(sc)->sc_mtx, MA_OWNED)
#define WPI_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx)
-
-#define WPI_CMD_LOCK_INIT(_sc) \
- mtx_init(&(_sc)->sc_cmdlock, device_get_nameunit((_sc)->sc_dev), \
- NULL, MTX_DEF)
-#define WPI_CMD_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_cmdlock)
-#define WPI_CMD_LOCK(_sc) mtx_lock(&(_sc)->sc_cmdlock)
-#define WPI_CMD_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_cmdlock)
OpenPOWER on IntegriCloud