summaryrefslogtreecommitdiffstats
path: root/sys/dev/ath/if_athvar.h
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2009-01-08 17:12:47 +0000
committersam <sam@FreeBSD.org>2009-01-08 17:12:47 +0000
commit98ad45c3d3f257c3649d4e198723267231203184 (patch)
tree6038542738398db4d8d4a8e36ed50ac642a506ac /sys/dev/ath/if_athvar.h
parent6f4df3b74deeeb200dfc7f23a8344f50eb34942c (diff)
downloadFreeBSD-src-98ad45c3d3f257c3649d4e198723267231203184.zip
FreeBSD-src-98ad45c3d3f257c3649d4e198723267231203184.tar.gz
TDMA support for long distance point-to-point links using ath devices:
o add net80211 support for a tdma vap that is built on top of the existing adhoc-demo support o add tdma scheduling of frame transmission to the ath driver; it's conceivable other devices might be capable of this too in which case they can make use of the 802.11 protocol additions etc. o add minor bits to user tools that need to know: ifconfig to setup and configure, new statistics in athstats, and new debug mask bits While the architecture can support >2 slots in a TDMA BSS the current design is intended (and tested) for only 2 slots. Sponsored by: Intel
Diffstat (limited to 'sys/dev/ath/if_athvar.h')
-rw-r--r--sys/dev/ath/if_athvar.h34
1 files changed, 31 insertions, 3 deletions
diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h
index 0f08eec..7b74c47 100644
--- a/sys/dev/ath/if_athvar.h
+++ b/sys/dev/ath/if_athvar.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
+ * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -109,7 +109,8 @@ struct ath_buf {
TAILQ_ENTRY(ath_buf) bf_stagelist; /* stage queue list */
u_int32_t bf_age; /* age when placed on stageq */
int bf_nseg;
- int bf_txflags; /* tx descriptor flags */
+ uint16_t bf_txflags; /* tx descriptor flags */
+ uint16_t bf_flags; /* status flags (below) */
struct ath_desc *bf_desc; /* virtual addr of desc */
struct ath_desc_status bf_status; /* tx/rx status */
bus_addr_t bf_daddr; /* physical addr of desc */
@@ -122,6 +123,8 @@ struct ath_buf {
};
typedef STAILQ_HEAD(, ath_buf) ath_bufhead;
+#define ATH_BUF_BUSY 0x00000002 /* (tx) desc owned by h/w */
+
/*
* DMA state for tx/rx descriptors.
*/
@@ -148,6 +151,8 @@ 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_flags;
+#define ATH_TXQ_PUTPENDING 0x0001 /* ath_hal_puttxbuf pending */
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 */
@@ -249,6 +254,7 @@ struct ath_softc {
sc_stagbeacons:1,/* use staggered beacons */
sc_wmetkipmic:1,/* can do WME+TKIP MIC */
sc_resume_up: 1,/* on resume, start all vaps */
+ sc_tdma : 1,/* TDMA in use */
sc_resetcal : 1;/* reset cal state next trip */
uint32_t sc_eerd; /* regdomain from EEPROM */
uint32_t sc_eecc; /* country code from EEPROM */
@@ -338,6 +344,18 @@ struct ath_softc {
int sc_lastlongcal; /* last long cal completed */
int sc_lastcalreset;/* last cal reset done */
HAL_NODE_STATS sc_halstats; /* station-mode rssi stats */
+#ifdef ATH_SUPPORT_TDMA
+ u_int sc_tdmadbaprep; /* TDMA DBA prep time */
+ u_int sc_tdmaswbaprep;/* TDMA SWBA prep time */
+ u_int sc_tdmaswba; /* TDMA SWBA counter */
+ u_int32_t sc_tdmabintval; /* TDMA beacon interval (TU) */
+ u_int32_t sc_tdmaguard; /* TDMA guard time (usec) */
+ u_int sc_tdmaslotlen; /* TDMA slot length (usec) */
+ u_int sc_tdmabintcnt; /* TDMA beacon intvl (slots) */
+ struct ath_rx_status *sc_tdmars; /* TDMA status of last rx */
+ u_int32_t sc_avgtsfdeltap;/* TDMA slot adjust (+) */
+ u_int32_t sc_avgtsfdeltam;/* TDMA slot adjust (-) */
+#endif
};
#define ATH_LOCK_INIT(_sc) \
@@ -375,6 +393,8 @@ void ath_intr(void *);
((*(_ah)->ah_detach)((_ah)))
#define ath_hal_reset(_ah, _opmode, _chan, _outdoor, _pstatus) \
((*(_ah)->ah_reset)((_ah), (_opmode), (_chan), (_outdoor), (_pstatus)))
+#define ath_hal_macversion(_ah) \
+ (((_ah)->ah_macVersion << 4) | ((_ah)->ah_macRev))
#define ath_hal_getratetable(_ah, _mode) \
((*(_ah)->ah_getRateTable)((_ah), (_mode)))
#define ath_hal_getmac(_ah, _mac) \
@@ -417,8 +437,10 @@ void ath_intr(void *);
((*(_ah)->ah_waitForBeaconDone)((_ah), (_bf)->bf_daddr))
#define ath_hal_putrxbuf(_ah, _bufaddr) \
((*(_ah)->ah_setRxDP)((_ah), (_bufaddr)))
+/* NB: common across all chips */
+#define AR_TSF_L32 0x804c /* MAC local clock lower 32 bits */
#define ath_hal_gettsf32(_ah) \
- ((*(_ah)->ah_getTsf32)((_ah)))
+ OS_REG_READ(_ah, AR_TSF_L32)
#define ath_hal_gettsf64(_ah) \
((*(_ah)->ah_getTsf64)((_ah)))
#define ath_hal_resettsf(_ah) \
@@ -455,6 +477,8 @@ void ath_intr(void *);
((*(_ah)->ah_beaconInit)((_ah), (_nextb), (_bperiod)))
#define ath_hal_beaconreset(_ah) \
((*(_ah)->ah_resetStationBeaconTimers)((_ah)))
+#define ath_hal_beaconsettimers(_ah, _bt) \
+ ((*(_ah)->ah_setBeaconTimers)((_ah), (_bt)))
#define ath_hal_beacontimers(_ah, _bs) \
((*(_ah)->ah_setStationBeaconTimers)((_ah), (_bs)))
#define ath_hal_setassocid(_ah, _bss, _associd) \
@@ -486,6 +510,10 @@ void ath_intr(void *);
((*(_ah)->ah_getTxQueueProps)((_ah), (_q), (_qi)))
#define ath_hal_settxqueueprops(_ah, _q, _qi) \
((*(_ah)->ah_setTxQueueProps)((_ah), (_q), (_qi)))
+/* NB: common across all chips */
+#define AR_Q_TXE 0x0840 /* MAC Transmit Queue enable */
+#define ath_hal_txqenabled(_ah, _qnum) \
+ (OS_REG_READ(_ah, AR_Q_TXE) & (1<<(_qnum)))
#define ath_hal_getrfgain(_ah) \
((*(_ah)->ah_getRfGain)((_ah)))
#define ath_hal_getdefantenna(_ah) \
OpenPOWER on IntegriCloud