FreeBSD kernel MWL device code
if_mwlvar.h File Reference
#include <sys/endian.h>
#include <sys/bus.h>
#include <net80211/ieee80211_radiotap.h>
#include <dev/mwl/mwlhal.h>
#include <dev/mwl/mwlreg.h>
#include <dev/mwl/if_mwlioctl.h>
Include dependency graph for if_mwlvar.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  mwl_txbuf
 
struct  mwl_descdma
 
struct  mwl_txq
 
struct  mwl_jumbo
 
struct  mwl_rxbuf
 
struct  mwl_bastate
 
struct  mwl_node
 
struct  mwl_vap
 
struct  mwl_softc
 

Macros

#define MWL_TXBUF   256 /* number of TX descriptors/buffers */
 
#define MWL_TXACKBUF   (MWL_TXBUF/2) /* number of TX ACK desc's/buffers */
 
#define MWL_RXDESC   256 /* number of RX descriptors */
 
#define MWL_RXBUF   ((5*MWL_RXDESC)/2)/* number of RX dma buffers */
 
#define MWL_MAXBA   2 /* max BA streams/sta */
 
#define MWL_TXDESC   1 /* max tx descriptors/segments */
 
#define MWL_AGGR_SIZE   3839 /* max tx aggregation size */
 
#define MWL_AGEINTERVAL   1 /* poke f/w every sec to age q's */
 
#define MWL_MAXSTAID   64 /* max of 64 stations */
 
#define MWL_TXQ_LOCK_INIT(_sc, _tq)
 
#define MWL_TXQ_LOCK_DESTROY(_tq)   mtx_destroy(&(_tq)->lock)
 
#define MWL_TXQ_LOCK(_tq)   mtx_lock(&(_tq)->lock)
 
#define MWL_TXQ_UNLOCK(_tq)   mtx_unlock(&(_tq)->lock)
 
#define MWL_TXQ_LOCK_ASSERT(_tq)   mtx_assert(&(_tq)->lock, MA_OWNED)
 
#define MWL_TXDESC_SYNC(txq, ds, how)
 
#define MWL_JUMBO_DATA2BUF(_data)   ((struct mwl_jumbo *)(_data))
 
#define MWL_JUMBO_BUF2DATA(_buf)   ((uint8_t *)(_buf))
 
#define MWL_JUMBO_OFFSET(_sc, _data)    (((const uint8_t *)(_data)) - (const uint8_t *)((_sc)->sc_rxmem))
 
#define MWL_JUMBO_DMA_ADDR(_sc, _data)    ((_sc)->sc_rxmem_paddr + MWL_JUMBO_OFFSET(_sc, _data))
 
#define MWL_RXDESC_SYNC(sc, ds, how)
 
#define MWL_NODE(ni)   ((struct mwl_node *)(ni))
 
#define MWL_NODE_CONST(ni)   ((const struct mwl_node *)(ni))
 
#define MWL_VAP(vap)   ((struct mwl_vap *)(vap))
 
#define MWL_VAP_CONST(vap)   ((const struct mwl_vap *)(vap))
 
#define MWL_LOCK_INIT(_sc)
 
#define MWL_LOCK_DESTROY(_sc)   mtx_destroy(&(_sc)->sc_mtx)
 
#define MWL_LOCK(_sc)   mtx_lock(&(_sc)->sc_mtx)
 
#define MWL_UNLOCK(_sc)   mtx_unlock(&(_sc)->sc_mtx)
 
#define MWL_LOCK_ASSERT(_sc)   mtx_assert(&(_sc)->sc_mtx, MA_OWNED)
 
#define MWL_RXFREE_INIT(_sc)
 
#define MWL_RXFREE_DESTROY(_sc)   mtx_destroy(&(_sc)->sc_rxlock)
 
#define MWL_RXFREE_LOCK(_sc)   mtx_lock(&(_sc)->sc_rxlock)
 
#define MWL_RXFREE_UNLOCK(_sc)   mtx_unlock(&(_sc)->sc_rxlock)
 
#define MWL_RXFREE_ASSERT(_sc)   mtx_assert(&(_sc)->sc_rxlock, MA_OWNED)
 

Functions

typedef STAILQ_HEAD (, mwl_txbuf) mwl_txbufhead
 
typedef SLIST_HEAD (, mwl_jumbo) mwl_jumbohead
 
typedef STAILQ_HEAD (, mwl_rxbuf) mwl_rxbufhead
 
static __inline__ void mwl_bastream_setup (struct mwl_bastate *bas, int tid, int txq)
 
static __inline__ void mwl_bastream_free (struct mwl_bastate *bas)
 
static __inline__ int mwl_bastream_match (const struct mwl_bastate *bas, uint16_t qos)
 
int mwl_attach (u_int16_t, struct mwl_softc *)
 
int mwl_detach (struct mwl_softc *)
 
void mwl_resume (struct mwl_softc *)
 
void mwl_suspend (struct mwl_softc *)
 
void mwl_shutdown (void *)
 
void mwl_intr (void *)
 

Macro Definition Documentation

◆ MWL_AGEINTERVAL

#define MWL_AGEINTERVAL   1 /* poke f/w every sec to age q's */

Definition at line 72 of file if_mwlvar.h.

◆ MWL_AGGR_SIZE

#define MWL_AGGR_SIZE   3839 /* max tx aggregation size */

Definition at line 70 of file if_mwlvar.h.

◆ MWL_JUMBO_BUF2DATA

#define MWL_JUMBO_BUF2DATA (   _buf)    ((uint8_t *)(_buf))

Definition at line 156 of file if_mwlvar.h.

◆ MWL_JUMBO_DATA2BUF

#define MWL_JUMBO_DATA2BUF (   _data)    ((struct mwl_jumbo *)(_data))

Definition at line 155 of file if_mwlvar.h.

◆ MWL_JUMBO_DMA_ADDR

#define MWL_JUMBO_DMA_ADDR (   _sc,
  _data 
)     ((_sc)->sc_rxmem_paddr + MWL_JUMBO_OFFSET(_sc, _data))

Definition at line 159 of file if_mwlvar.h.

◆ MWL_JUMBO_OFFSET

#define MWL_JUMBO_OFFSET (   _sc,
  _data 
)     (((const uint8_t *)(_data)) - (const uint8_t *)((_sc)->sc_rxmem))

Definition at line 157 of file if_mwlvar.h.

◆ MWL_LOCK

#define MWL_LOCK (   _sc)    mtx_lock(&(_sc)->sc_mtx)

Definition at line 347 of file if_mwlvar.h.

◆ MWL_LOCK_ASSERT

#define MWL_LOCK_ASSERT (   _sc)    mtx_assert(&(_sc)->sc_mtx, MA_OWNED)

Definition at line 349 of file if_mwlvar.h.

◆ MWL_LOCK_DESTROY

#define MWL_LOCK_DESTROY (   _sc)    mtx_destroy(&(_sc)->sc_mtx)

Definition at line 346 of file if_mwlvar.h.

◆ MWL_LOCK_INIT

#define MWL_LOCK_INIT (   _sc)
Value:
mtx_init(&(_sc)->sc_mtx, device_get_nameunit((_sc)->sc_dev), \
NULL, MTX_DEF | MTX_RECURSE)

Definition at line 343 of file if_mwlvar.h.

◆ MWL_MAXBA

#define MWL_MAXBA   2 /* max BA streams/sta */

Definition at line 61 of file if_mwlvar.h.

◆ MWL_MAXSTAID

#define MWL_MAXSTAID   64 /* max of 64 stations */

Definition at line 73 of file if_mwlvar.h.

◆ MWL_NODE

#define MWL_NODE (   ni)    ((struct mwl_node *)(ni))

Definition at line 230 of file if_mwlvar.h.

◆ MWL_NODE_CONST

#define MWL_NODE_CONST (   ni)    ((const struct mwl_node *)(ni))

Definition at line 231 of file if_mwlvar.h.

◆ MWL_RXBUF

#define MWL_RXBUF   ((5*MWL_RXDESC)/2)/* number of RX dma buffers */

Definition at line 58 of file if_mwlvar.h.

◆ MWL_RXDESC

#define MWL_RXDESC   256 /* number of RX descriptors */

Definition at line 55 of file if_mwlvar.h.

◆ MWL_RXDESC_SYNC

#define MWL_RXDESC_SYNC (   sc,
  ds,
  how 
)
Value:
do { \
bus_dmamap_sync((sc)->sc_rxdma.dd_dmat, (sc)->sc_rxdma.dd_dmamap, how);\
} while (0)

Definition at line 170 of file if_mwlvar.h.

◆ MWL_RXFREE_ASSERT

#define MWL_RXFREE_ASSERT (   _sc)    mtx_assert(&(_sc)->sc_rxlock, MA_OWNED)

Definition at line 357 of file if_mwlvar.h.

◆ MWL_RXFREE_DESTROY

#define MWL_RXFREE_DESTROY (   _sc)    mtx_destroy(&(_sc)->sc_rxlock)

Definition at line 354 of file if_mwlvar.h.

◆ MWL_RXFREE_INIT

#define MWL_RXFREE_INIT (   _sc)
Value:
mtx_init(&(_sc)->sc_rxlock, device_get_nameunit((_sc)->sc_dev), \
NULL, MTX_DEF)

Definition at line 351 of file if_mwlvar.h.

◆ MWL_RXFREE_LOCK

#define MWL_RXFREE_LOCK (   _sc)    mtx_lock(&(_sc)->sc_rxlock)

Definition at line 355 of file if_mwlvar.h.

◆ MWL_RXFREE_UNLOCK

#define MWL_RXFREE_UNLOCK (   _sc)    mtx_unlock(&(_sc)->sc_rxlock)

Definition at line 356 of file if_mwlvar.h.

◆ MWL_TXACKBUF

#define MWL_TXACKBUF   (MWL_TXBUF/2) /* number of TX ACK desc's/buffers */

Definition at line 52 of file if_mwlvar.h.

◆ MWL_TXBUF

#define MWL_TXBUF   256 /* number of TX descriptors/buffers */

Definition at line 49 of file if_mwlvar.h.

◆ MWL_TXDESC

#define MWL_TXDESC   1 /* max tx descriptors/segments */

Definition at line 67 of file if_mwlvar.h.

◆ MWL_TXDESC_SYNC

#define MWL_TXDESC_SYNC (   txq,
  ds,
  how 
)
Value:
do { \
bus_dmamap_sync((txq)->dma.dd_dmat, (txq)->dma.dd_dmamap, how); \
} while(0)

Definition at line 143 of file if_mwlvar.h.

◆ MWL_TXQ_LOCK

#define MWL_TXQ_LOCK (   _tq)    mtx_lock(&(_tq)->lock)

Definition at line 139 of file if_mwlvar.h.

◆ MWL_TXQ_LOCK_ASSERT

#define MWL_TXQ_LOCK_ASSERT (   _tq)    mtx_assert(&(_tq)->lock, MA_OWNED)

Definition at line 141 of file if_mwlvar.h.

◆ MWL_TXQ_LOCK_DESTROY

#define MWL_TXQ_LOCK_DESTROY (   _tq)    mtx_destroy(&(_tq)->lock)

Definition at line 138 of file if_mwlvar.h.

◆ MWL_TXQ_LOCK_INIT

#define MWL_TXQ_LOCK_INIT (   _sc,
  _tq 
)
Value:
do { \
snprintf((_tq)->name, sizeof((_tq)->name), "%s_txq%u", \
device_get_nameunit((_sc)->sc_dev), (_tq)->qnum); \
mtx_init(&(_tq)->lock, (_tq)->name, NULL, MTX_DEF); \
} while (0)

Definition at line 133 of file if_mwlvar.h.

◆ MWL_TXQ_UNLOCK

#define MWL_TXQ_UNLOCK (   _tq)    mtx_unlock(&(_tq)->lock)

Definition at line 140 of file if_mwlvar.h.

◆ MWL_UNLOCK

#define MWL_UNLOCK (   _sc)    mtx_unlock(&(_sc)->sc_mtx)

Definition at line 348 of file if_mwlvar.h.

◆ MWL_VAP

#define MWL_VAP (   vap)    ((struct mwl_vap *)(vap))

Definition at line 246 of file if_mwlvar.h.

◆ MWL_VAP_CONST

#define MWL_VAP_CONST (   vap)    ((const struct mwl_vap *)(vap))

Definition at line 247 of file if_mwlvar.h.

Function Documentation

◆ mwl_attach()

int mwl_attach ( u_int16_t  ,
struct mwl_softc  
)

◆ mwl_bastream_free()

static __inline__ void mwl_bastream_free ( struct mwl_bastate bas)
static

Definition at line 200 of file if_mwlvar.h.

References mwl_bastate::bastream, and mwl_bastate::qos.

Referenced by mwl_addba_response(), and mwl_addba_stop().

Here is the caller graph for this function:

◆ mwl_bastream_match()

static __inline__ int mwl_bastream_match ( const struct mwl_bastate bas,
uint16_t  qos 
)
static

Definition at line 215 of file if_mwlvar.h.

References mwl_bastate::qos.

Referenced by mwl_tx_start().

Here is the caller graph for this function:

◆ mwl_bastream_setup()

static __inline__ void mwl_bastream_setup ( struct mwl_bastate bas,
int  tid,
int  txq 
)
static

Definition at line 193 of file if_mwlvar.h.

References mwl_bastate::qos, and mwl_bastate::txq.

Referenced by mwl_addba_response().

Here is the caller graph for this function:

◆ mwl_detach()

int mwl_detach ( struct mwl_softc sc)

Definition at line 527 of file if_mwl.c.

References mwl_dma_cleanup(), mwl_hal_detach(), MWL_LOCK, MWL_RXFREE_DESTROY, mwl_stop(), mwl_tx_cleanup(), MWL_UNLOCK, mwl_softc::sc_ic, mwl_softc::sc_mh, mwl_softc::sc_snd, and mwl_softc::sc_watchdog.

Referenced by mwl_pci_detach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_intr()

◆ mwl_resume()

void mwl_resume ( struct mwl_softc sc)

Definition at line 769 of file if_mwl.c.

References mwl_init(), MWL_LOCK, MWL_UNLOCK, and mwl_softc::sc_ic.

Referenced by mwl_pci_resume().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_shutdown()

void mwl_shutdown ( void *  arg)

Definition at line 783 of file if_mwl.c.

References MWL_LOCK, mwl_stop(), and MWL_UNLOCK.

Referenced by mwl_pci_shutdown().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_suspend()

void mwl_suspend ( struct mwl_softc sc)

Definition at line 760 of file if_mwl.c.

References MWL_LOCK, mwl_stop(), and MWL_UNLOCK.

Referenced by mwl_pci_suspend().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SLIST_HEAD()

typedef SLIST_HEAD ( mwl_jumbo  )

◆ STAILQ_HEAD() [1/2]

typedef STAILQ_HEAD ( mwl_rxbuf  )

◆ STAILQ_HEAD() [2/2]

typedef STAILQ_HEAD ( mwl_txbuf  )