summaryrefslogtreecommitdiffstats
path: root/sys/dev/ath/if_athvar.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ath/if_athvar.h')
-rw-r--r--sys/dev/ath/if_athvar.h118
1 files changed, 76 insertions, 42 deletions
diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h
index af1045d..257c6ee 100644
--- a/sys/dev/ath/if_athvar.h
+++ b/sys/dev/ath/if_athvar.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2002-2007 Sam Leffler, Errno Consulting
+ * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -49,6 +49,8 @@
#ifndef ATH_TXBUF
#define ATH_TXBUF 200 /* number of TX buffers */
#endif
+#define ATH_BCBUF 4 /* number of beacon buffers */
+
#define ATH_TXDESC 10 /* number of descriptors per buffer */
#define ATH_TXMAXTRY 11 /* max number of transmit attempts */
#define ATH_TXMGTTRY 4 /* xmit attempts for mgt/ctl frames */
@@ -80,7 +82,9 @@ struct ath_buf;
/* driver-specific node state */
struct ath_node {
struct ieee80211_node an_node; /* base class */
- u_int32_t an_avgrssi; /* average rssi over all rx frames */
+ const struct ieee80211_txparam *an_tp;
+ u_int8_t an_mgmtrix; /* min h/w rate index */
+ u_int8_t an_mcastrix; /* mcast h/w rate index */
struct ath_buf *an_ff_buf[WME_NUM_AC]; /* ff staging area */
/* variable-length rate control state follows */
};
@@ -141,6 +145,7 @@ struct ath_descdma {
*/
struct ath_txq {
u_int axq_qnum; /* hardware q number */
+#define ATH_TXQ_SWQ (HAL_NUM_TX_QUEUES+1) /* qnum for s/w only queue */
u_int axq_depth; /* queue depth (stat only) */
u_int axq_intrcnt; /* interrupt count */
u_int32_t *axq_link; /* link ptr in last TX desc */
@@ -175,6 +180,25 @@ struct ath_txq {
STAILQ_REMOVE_HEAD(&(_tq)->axq_q, _field); \
(_tq)->axq_depth--; \
} while (0)
+/* NB: this does not do the "head empty check" that STAILQ_LAST does */
+#define ATH_TXQ_LAST(_tq) \
+ ((struct ath_buf *)(void *) \
+ ((char *)((_tq)->axq_q.stqh_last) - __offsetof(struct ath_buf, bf_list)))
+
+struct ath_vap {
+ struct ieee80211vap av_vap; /* base class */
+ int av_bslot; /* beacon slot index */
+ struct ath_buf *av_bcbuf; /* beacon buffer */
+ struct ieee80211_beacon_offsets av_boff;/* dynamic update state */
+ struct ath_txq av_mcastq; /* buffered mcast s/w queue */
+
+ void (*av_recv_mgmt)(struct ieee80211_node *,
+ struct mbuf *, int, int, int, u_int32_t);
+ int (*av_newstate)(struct ieee80211vap *,
+ enum ieee80211_state, int);
+ void (*av_bmiss)(struct ieee80211vap *);
+};
+#define ATH_VAP(vap) ((struct ath_vap *)(vap))
struct taskqueue;
struct ath_tx99;
@@ -182,16 +206,13 @@ struct ath_tx99;
struct ath_softc {
struct ifnet *sc_ifp; /* interface common */
struct ath_stats sc_stats; /* interface statistics */
- struct ieee80211com sc_ic; /* IEEE 802.11 common */
int sc_debug;
- u_int32_t sc_countrycode;
- u_int32_t sc_regdomain;
- void (*sc_recv_mgmt)(struct ieee80211com *,
- struct mbuf *,
- struct ieee80211_node *,
- int, int, int, u_int32_t);
- int (*sc_newstate)(struct ieee80211com *,
- enum ieee80211_state, int);
+ int sc_nvaps; /* # vaps */
+ int sc_nstavaps; /* # station vaps */
+ u_int8_t sc_hwbssidmask[IEEE80211_ADDR_LEN];
+ u_int8_t sc_nbssid0; /* # vap's using base mac */
+ uint32_t sc_bssidmask; /* bssid mask */
+
void (*sc_node_free)(struct ieee80211_node *);
device_t sc_dev;
HAL_BUS_TAG sc_st; /* bus space tag */
@@ -203,22 +224,28 @@ struct ath_softc {
struct ath_ratectrl *sc_rc; /* tx rate control support */
struct ath_tx99 *sc_tx99; /* tx99 adjunct state */
void (*sc_setdefantenna)(struct ath_softc *, u_int);
- unsigned int sc_invalid : 1, /* disable hardware accesses */
- sc_mrretry : 1, /* multi-rate retry support */
- sc_softled : 1, /* enable LED gpio status */
- sc_splitmic: 1, /* split TKIP MIC keys */
- sc_needmib : 1, /* enable MIB stats intr */
- sc_diversity : 1,/* enable rx diversity */
- sc_hasveol : 1, /* tx VEOL support */
- sc_ledstate: 1, /* LED on/off state */
- sc_blinking: 1, /* LED blink operation active */
- sc_mcastkey: 1, /* mcast key cache search */
- sc_scanning: 1, /* scanning active */
+ unsigned int sc_invalid : 1,/* disable hardware accesses */
+ sc_mrretry : 1,/* multi-rate retry support */
+ sc_softled : 1,/* enable LED gpio status */
+ sc_splitmic : 1,/* split TKIP MIC keys */
+ sc_needmib : 1,/* enable MIB stats intr */
+ sc_diversity: 1,/* enable rx diversity */
+ sc_hasveol : 1,/* tx VEOL support */
+ sc_ledstate : 1,/* LED on/off state */
+ sc_blinking : 1,/* LED blink operation active */
+ sc_mcastkey : 1,/* mcast key cache search */
+ sc_scanning : 1,/* scanning active */
sc_syncbeacon:1,/* sync/resync beacon timers */
- sc_hasclrkey:1, /* CLR key supported */
+ sc_hasclrkey: 1,/* CLR key supported */
sc_xchanmode: 1,/* extended channel mode */
sc_outdoor : 1,/* outdoor operation */
- sc_dturbo : 1; /* dynamic turbo in use */
+ sc_dturbo : 1,/* dynamic turbo in use */
+ sc_hasbmask : 1,/* bssid mask support */
+ sc_hastsfadd: 1,/* tsf adjust support */
+ sc_beacons : 1,/* beacons running */
+ sc_swbmiss : 1,/* sta mode using sw bmiss */
+ sc_stagbeacons:1,/* use staggered beacons */
+ sc_wmetkipmic:1;/* can do WME+TKIP MIC */
/* rate tables */
#define IEEE80211_MODE_HALF (IEEE80211_MODE_MAX+0)
#define IEEE80211_MODE_QUARTER (IEEE80211_MODE_MAX+1)
@@ -238,8 +265,6 @@ struct ath_softc {
u_int16_t ledon; /* softled on time */
u_int16_t ledoff; /* softled off time */
} sc_hwmap[32]; /* h/w rate ix mappings */
- u_int8_t sc_minrateix; /* min h/w rate index */
- u_int8_t sc_mcastrix; /* mcast h/w rate index */
u_int8_t sc_protrix; /* protection rate index */
u_int8_t sc_lastdatarix; /* last data frame rate index */
u_int sc_mcastrate; /* ieee rate for mcastrateix */
@@ -262,20 +287,13 @@ struct ath_softc {
u_int sc_rfsilentpin; /* GPIO pin for rfkill int */
u_int sc_rfsilentpol; /* pin setting for rfkill on */
- struct bpf_if *sc_drvbpf;
- union {
- struct ath_tx_radiotap_header th;
- u_int8_t pad[64];
- } u_tx_rt;
+ struct ath_tx_radiotap_header sc_tx_th;
int sc_tx_th_len;
- union {
- struct ath_rx_radiotap_header th;
- u_int8_t pad[64];
- } u_rx_rt;
+ struct ath_rx_radiotap_header sc_rx_th;
int sc_rx_th_len;
u_int sc_monpass; /* frames to pass in mon.mode */
- struct ath_descdma sc_rxdma; /* RX descriptos */
+ struct ath_descdma sc_rxdma; /* RX descriptors */
ath_bufhead sc_rxbuf; /* receive buffer */
struct mbuf *sc_rxpending; /* pending receive data */
u_int32_t *sc_rxlink; /* link ptr in last RX desc */
@@ -301,7 +319,6 @@ struct ath_softc {
u_int sc_bmisscount; /* missed beacon transmits */
u_int32_t sc_ant_tx[8]; /* recent tx frames/antenna */
struct ath_txq *sc_cabq; /* tx q for cab frames */
- struct ieee80211_beacon_offsets sc_boff;/* dynamic update state */
struct task sc_bmisstask; /* bmiss int processing */
struct task sc_bstucktask; /* stuck beacon processing */
enum {
@@ -309,16 +326,15 @@ struct ath_softc {
UPDATE, /* update pending */
COMMIT /* beacon sent, commit change */
} sc_updateslot; /* slot time update fsm */
- struct ath_txq sc_mcastq; /* mcast xmits w/ ps sta's */
+ int sc_slotupdate; /* slot to advance fsm */
+ struct ieee80211vap *sc_bslot[ATH_BCBUF];
+ int sc_nbcnvaps; /* # vaps with beacons */
struct callout sc_cal_ch; /* callout handle for cals */
int sc_calinterval; /* current polling interval */
int sc_caltries; /* cals at current interval */
HAL_NODE_STATS sc_halstats; /* station-mode rssi stats */
- struct callout sc_dfs_ch; /* callout handle for dfs */
};
-#define sc_tx_th u_tx_rt.th
-#define sc_rx_th u_rx_rt.th
#define ATH_LOCK_INIT(_sc) \
mtx_init(&(_sc)->sc_mtx, device_get_nameunit((_sc)->sc_dev), \
@@ -361,6 +377,10 @@ void ath_intr(void *);
((*(_ah)->ah_getMacAddress)((_ah), (_mac)))
#define ath_hal_setmac(_ah, _mac) \
((*(_ah)->ah_setMacAddress)((_ah), (_mac)))
+#define ath_hal_getbssidmask(_ah, _mask) \
+ ((*(_ah)->ah_getBssIdMask)((_ah), (_mask)))
+#define ath_hal_setbssidmask(_ah, _mask) \
+ ((*(_ah)->ah_setBssIdMask)((_ah), (_mask)))
#define ath_hal_intrset(_ah, _mask) \
((*(_ah)->ah_setInterrupts)((_ah), (_mask)))
#define ath_hal_intrget(_ah) \
@@ -483,15 +503,21 @@ void ath_intr(void *);
#define ath_hal_getregdomain(_ah, _prd) \
(ath_hal_getcapability(_ah, HAL_CAP_REG_DMN, 0, (_prd)) == HAL_OK)
#define ath_hal_setregdomain(_ah, _rd) \
- ((*(_ah)->ah_setRegulatoryDomain)((_ah), (_rd), NULL))
+ (*(uint16_t *)(((uint8_t *)(_ah)) + 520) = (_rd))
#define ath_hal_getcountrycode(_ah, _pcc) \
(*(_pcc) = (_ah)->ah_countryCode)
+#define ath_hal_gettkipmic(_ah) \
+ (ath_hal_getcapability(_ah, HAL_CAP_TKIP_MIC, 1, NULL) == HAL_OK)
+#define ath_hal_settkipmic(_ah, _v) \
+ ath_hal_setcapability(_ah, HAL_CAP_TKIP_MIC, 1, _v, NULL)
#define ath_hal_hastkipsplit(_ah) \
(ath_hal_getcapability(_ah, HAL_CAP_TKIP_SPLIT, 0, NULL) == HAL_OK)
#define ath_hal_gettkipsplit(_ah) \
(ath_hal_getcapability(_ah, HAL_CAP_TKIP_SPLIT, 1, NULL) == HAL_OK)
#define ath_hal_settkipsplit(_ah, _v) \
ath_hal_setcapability(_ah, HAL_CAP_TKIP_SPLIT, 1, _v, NULL)
+#define ath_hal_haswmetkipmic(_ah) \
+ (ath_hal_getcapability(_ah, HAL_CAP_WME_TKIPMIC, 0, NULL) == HAL_OK)
#define ath_hal_hwphycounters(_ah) \
(ath_hal_getcapability(_ah, HAL_CAP_PHYCOUNTERS, 0, NULL) == HAL_OK)
#define ath_hal_hasdiversity(_ah) \
@@ -542,6 +568,14 @@ void ath_intr(void *);
#endif
#define ath_hal_hasfastframes(_ah) \
(ath_hal_getcapability(_ah, HAL_CAP_FASTFRAME, 0, NULL) == HAL_OK)
+#define ath_hal_hasbssidmask(_ah) \
+ (ath_hal_getcapability(_ah, HAL_CAP_BSSIDMASK, 0, NULL) == HAL_OK)
+#define ath_hal_hastsfadjust(_ah) \
+ (ath_hal_getcapability(_ah, HAL_CAP_TSF_ADJUST, 0, NULL) == HAL_OK)
+#define ath_hal_gettsfadjust(_ah) \
+ (ath_hal_getcapability(_ah, HAL_CAP_TSF_ADJUST, 1, NULL) == HAL_OK)
+#define ath_hal_settsfadjust(_ah, _onoff) \
+ ath_hal_setcapability(_ah, HAL_CAP_TSF_ADJUST, 1, _onoff, NULL)
#define ath_hal_hasrfsilent(_ah) \
(ath_hal_getcapability(_ah, HAL_CAP_RFSILENT, 0, NULL) == HAL_OK)
#define ath_hal_getrfkill(_ah) \
OpenPOWER on IntegriCloud