Please note: This project is no longer active. The website is kept online for historic purposes only.
If you´re looking for a Linux driver for your Atheros WLAN device, you should continue here .
Version 6 (modified by dyqith, 14 years ago)

Locking Data Structures in MadWifi

This page will collect all information about locking procedures in madwifi. The idea is to document which lock protects what data structure, under what context, in what function and why. That way, all the devs will have a consistent view of what lock behaviors to change when needed. Also, we have to define a pecking order for the locks so we won't have live locks. We should also make sure the locks are unlocked in LIFO order so we don't have weird messes.


struct ath_node - spinlock_t an_uapsd_lock


struct ath_softc - struct semaphore sc_lock


struct ath_txq - spinlock_t axq_lock

Locks everything of ath_txq


ath_uapsd_processtriggers() - locks uapsd_xmit_q ath_tx_txqaddbuf() ath_ff_stageq_flush() ath_hardstart() ath_beacon_generate() - locks sc->sc_cabq and avp->av_mcastq ath_node_move_data() ath_grppoll_start() ath_tx_processq() ath_tx_draintxq()

Queues include ath_vap's av_mcastq, softc's sc_txq[HAL_NUM_TX_QUEUES], sc_ac2q[WME_NUM_AC], sc_cabq, sc_grpplq, sc_xrtxq, sc_uapsdq

-- struct ath_node an_tx_ffbuf ??

struct ath_softc - spinlock_t sc_rxbuflock


Protection for sc->sc_rxbufcur, sc_rxbuf, sc_rxlink(?)

struct ath_softc - spinlock_t sc_txbuflock


Protection for sc->sc_txbuf

struct ath_softc - spinlock_t sc_hal_lock

All accesses to the HAL needs to hold this lock. Check ath/if_ath_hal.h for function list.