summaryrefslogtreecommitdiffstats
path: root/sys/dev/iwn/if_iwnvar.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/iwn/if_iwnvar.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/iwn/if_iwnvar.h')
-rw-r--r--sys/dev/iwn/if_iwnvar.h35
1 files changed, 3 insertions, 32 deletions
diff --git a/sys/dev/iwn/if_iwnvar.h b/sys/dev/iwn/if_iwnvar.h
index 4620342..d956525 100644
--- a/sys/dev/iwn/if_iwnvar.h
+++ b/sys/dev/iwn/if_iwnvar.h
@@ -180,33 +180,10 @@ struct iwn_softc {
void *sc_ih;
bus_size_t sc_sz;
- /* command queue related variables */
-#define IWN_SCAN_START (1<<0)
-#define IWN_SCAN_CURCHAN (1<<1)
-#define IWN_SCAN_STOP (1<<2)
-#define IWN_SET_CHAN (1<<3)
-#define IWN_AUTH (1<<4)
-#define IWN_SCAN_NEXT (1<<5)
-#define IWN_RUN (1<<6)
-#define IWN_RADIO_ENABLE (1<<7)
-#define IWN_RADIO_DISABLE (1<<8)
-#define IWN_REINIT (1<<9)
-#define IWN_CMD_MAXOPS 10
- /* command queuing request type */
-#define IWN_QUEUE_NORMAL 0
-#define IWN_QUEUE_CLEAR 1
- int sc_cmd[IWN_CMD_MAXOPS];
- int sc_cmd_arg[IWN_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 */
-
/* Tasks used by the driver */
- struct task sc_ops_task; /* deferred ops */
- struct task sc_bmiss_task; /* beacon miss */
+ struct task sc_reinit_task;
+ struct task sc_radioon_task;
+ struct task sc_radiooff_task;
/* Thermal calibration */
int calib_cnt;
@@ -234,9 +211,3 @@ struct iwn_softc {
#define IWN_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED)
#define IWN_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
#define IWN_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx)
-#define IWN_CMD_LOCK_INIT(_sc) \
- mtx_init(&(_sc)->sc_cmdlock, device_get_nameunit((_sc)->sc_dev), \
- NULL, MTX_DEF);
-#define IWN_CMD_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_cmdlock)
-#define IWN_CMD_LOCK(_sc) mtx_lock(&(_sc)->sc_cmdlock)
-#define IWN_CMD_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_cmdlock)
OpenPOWER on IntegriCloud