25 #define BITS_PER_BYTE 8 26 #define OFDM_PLCP_BITS 22 27 #define HT_RC_2_STREAMS(_rc) ((((_rc) & 0x78) >> 3) + 1) 33 #define HT_LTF(_ns) (4 * (_ns)) 34 #define SYMBOL_TIME(_ns) ((_ns) << 2) 35 #define SYMBOL_TIME_HALFGI(_ns) (((_ns) * 18 + 4) / 5) 36 #define NUM_SYMBOLS_PER_USEC(_usec) (_usec >> 2) 37 #define NUM_SYMBOLS_PER_USEC_HALFGI(_usec) (((_usec*5)-4)/18) 40 #define IS_HT_RATE(_rate) ((_rate) & 0x80) 110 static const int subtype_txq_to_hwq[] = {
115 memset(&qi, 0,
sizeof(qi));
141 if (axq_qnum == -1) {
149 DBG(
"ath9k: qnum %d out of range, max %zd!\n",
187 memset(&ts, 0,
sizeof(ts));
236 DBG(
"ath9k: Failed to stop TX DMA!\n");
247 txq = &sc->
tx.
txq[i];
297 if (
tid == last_tid ||
346 DBGIO(
"ath9k: TXDP[%d] = %llx (%p)\n",
352 "link[%d] (%p)=%llx (%p)\n",
415 (chainmask == 0x7) && (rate < 0x90))
427 u8 rix = 0, ctsrate = 0;
444 for (i = 0; i < 4; i++) {
494 0, series, 4,
flags);
517 DBG(
"ath9k: TX buffers are full\n");
607 DBGIO(
"ath9k: TX complete: iob: %p\n", iob);
666 DBGIO(
"ath9k: tx queue %d (%x), link %p\n",
701 memset(&ts, 0,
sizeof(ts));
749 txq = &sc->
tx.
txq[i];
762 "tx hung, resetting the chip\n");
796 "Failed to allocate tx descriptors: %d\n",
error);
#define ATH9K_RATESERIES_RTS_CTS
void ath_descdma_cleanup(struct ath_softc *sc, struct ath_descdma *dd, struct list_head *head)
struct io_buffer * bf_mpdu
Network protected with CCMP (AES-based system)
void ath_tx_tasklet(struct ath_softc *sc)
#define TICKS_PER_SEC
Number of ticks per second.
unsigned long tx_complete_work_timer
static void ath9k_hw_set_clrdmask(struct ath_hw *ah, void *ds, int val)
u8 ath_txchainmask_reduction(struct ath_softc *sc, u8 chainmask, u32 rate)
int ath_drain_all_txq(struct ath_softc *sc, int retry_tx)
u8 channel
The channel currently in use, as an index into the channels array.
#define ATH9K_TXDESC_CTSENA
struct ath_buf_state bf_state
struct list_head * next
Next list entry.
static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, int len)
Dummy value used when the cryptosystem can't be detected.
struct golan_inbox_hdr hdr
Message header.
u16 fc
802.11 Frame Control field
u32 ath9k_hw_numtxpending(struct ath_hw *ah, u32 q)
#define ATH_AGGR_MIN_QDEPTH
struct arbelprm_completion_with_error error
int ath_tx_init(struct ath_softc *sc, int nbufs)
static struct ath_buf * ath_tx_get_buffer(struct ath_softc *sc)
An 802.11 data or management frame without QoS or WDS header fields.
void ath9k_hw_puttxbuf(struct ath_hw *ah, u32 q, u32 txdp)
#define ATH_TXQ_SETUP(sc, i)
#define ATH_TXBUF_RESET(_bf)
struct ath_txq * ath_txq_setup(struct ath_softc *sc, int qtype, int subtype)
int ath_tx_start(struct net80211_device *dev, struct io_buffer *iob, struct ath_tx_control *txctl)
struct ath_txq txq[ATH9K_NUM_TX_QUEUES]
static enum ath9k_pkt_type get_hw_packet_type(struct io_buffer *iob)
u32 ath9k_hw_gettxbuf(struct ath_hw *ah, u32 q)
static void ath9k_hw_set11n_ratescenario(struct ath_hw *ah, void *ds, void *lastds, u32 durUpdateEn, u32 rtsctsRate, u32 rtsctsDuration, struct ath9k_11n_rate_series series[], u32 nseries, u32 flags)
Network protected with WEP (awful RC4-based system)
#define bf_isxretried(bf)
static void ath_tx_start_dma(struct ath_softc *sc, struct ath_buf *bf, struct ath_tx_control *txctl)
#define SC_OP_PREAMBLE_SHORT
#define ATH9K_TXDESC_INTREQ
A doubly-linked list entry (or list head)
int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd, struct list_head *head, const char *name, int nbuf, int ndesc, int is_tx)
void ath9k_hw_txstart(struct ath_hw *ah, u32 q)
static void ath_tx_queue_tid(struct ath_txq *txq, struct ath_atx_tid *tid)
#define list_empty(list)
Test whether a list is empty.
#define NET80211_BAND_2GHZ
The 2.4 GHz ISM band, unlicensed in most countries.
#define list_first_entry(list, type, member)
Get the container of the first entry in a list.
struct net80211_device * dev
#define list_del(list)
Delete an entry from a list.
#define ENOMEM
Not enough space.
enum net80211_crypto_alg algorithm
The cryptographic algorithm implemented.
#define IEEE80211_FC_SUBTYPE
802.11 Frame Control field, Frame Subtype bitmask
static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf, struct ath_txq *txq, struct list_head *bf_q, struct ath_tx_status *ts, int txok, int sendbar)
static void ath_tx_complete(struct ath_softc *sc, struct io_buffer *iob, int tx_flags __unused, struct ath_tx_status *ts, struct ath_txq *txq)
static void ath9k_hw_set11n_txdesc(struct ath_hw *ah, void *ds, u32 pktLen, enum ath9k_pkt_type type, u32 txPower, u32 keyIx, enum ath9k_key_type keyType, u32 flags)
struct net80211_crypto * crypto
802.11 cryptosystem for our current network
static __always_inline unsigned long virt_to_bus(volatile const void *addr)
Convert virtual address to a bus address.
void(* tx_complete_work)(struct ath_softc *sc)
int ath9k_hw_releasetxqueue(struct ath_hw *ah, u32 q)
#define ATH_TX_COMPLETE_POLL_INT
#define ATH9K_TXQ_USEDEFAULT
enum ath9k_tx_queue_flags tqi_qflags
unsigned long bfs_paprd_timestamp
#define __unused
Declare a variable or data structure as unused.
#define list_add_tail(new, head)
Add a new entry to the tail of a list.
void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq)
void ath9k_hw_abort_tx_dma(struct ath_hw *ah)
void ath9k_hw_gettxintrtxqs(struct ath_hw *ah, u32 *txqs)
static void ath_tx_complete_poll_work(struct ath_softc *sc)
#define list_for_each_entry_safe(pos, tmp, head, member)
Iterate over entries in a list, safe against deletion of the current entry.
void * priv
Driver private data.
static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq, struct list_head *head)
#define EINPROGRESS
Operation in progress.
void ath_tx_cleanup(struct ath_softc *sc)
#define list_splice_tail_init(list, entry)
Move all entries from one list into another list and reinitialise empty list.
static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
struct list_head txq_fifo[ATH_TXFIFO_DEPTH]
uint8_t subtype
Slow protocols subtype.
#define IEEE80211_FC_TYPE
802.11 Frame Control field, Frame Type bitmask
int ath9k_hw_setuptxqueue(struct ath_hw *ah, enum ath9k_tx_queue type, const struct ath9k_tx_queue_info *qinfo)
u16 ath9k_hw_computetxtime(struct ath_hw *ah, u8 phy, int kbps, u32 frameLen, u16 rateix, int shortPreamble)
static void ath9k_hw_filltxdesc(struct ath_hw *ah, void *ds, u32 seglen, int is_firstseg, int is_lastseg, const void *ds0, u32 buf_addr, unsigned int qcu)
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
Structure encapsulating the complete state of an 802.11 device.
struct ath_buf * bf_lastbf
No security, an "Open" network.
#define ATH9K_TXDESC_RTSENA
#define ATH9K_NUM_TX_QUEUES
static struct ath_common * ath9k_hw_common(struct ath_hw *ah)
void ath_draintxq(struct ath_softc *sc, struct ath_txq *txq, int retry_tx __unused)
#define list_cut_position(new, list, entry)
Cut a list into two.
void ath_txq_schedule(struct ath_softc *sc __unused, struct ath_txq *txq)
void net80211_tx_complete(struct net80211_device *dev, struct io_buffer *iob, int retries, int rc)
Indicate the completed transmission of a packet.
int ath_reset(struct ath_softc *sc, int retry_tx)
struct ib_cm_common common
static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq, struct ath_atx_tid *tid, struct list_head *bf_head)
#define IEEE80211_STYPE_PROBE_RESP
Subtype value for probe-response management frames.
static void ath_tx_return_buffer(struct ath_softc *sc, struct ath_buf *bf)
static int setup_tx_flags(struct io_buffer *iob __unused)
#define INIT_LIST_HEAD(list)
Initialise a list head.
static void ath9k_hw_get_desc_link(struct ath_hw *ah, void *ds, u32 **link)
#define list_is_singular(list)
Test whether a list has just one entry.
static void ath9k_hw_set_desc_link(struct ath_hw *ah, void *ds, u32 link)
struct list_head * prev
Previous list entry.
struct ath9k_hw_capabilities caps
void * data
Start of data.
#define EIO
Input/output error.
struct net80211_channel channels[NET80211_MAX_CHANNELS]
A list of all possible channels we might use.
static int ath9k_hw_txprocdesc(struct ath_hw *ah, void *ds, struct ath_tx_status *ts)
struct list_head txq_fifo_pending
struct ath9k_legacy_rate rates[NET80211_MAX_RATES]
#define SC_OP_PROTECT_ENABLE
Network protected with TKIP (better RC4-based system)
#define IEEE80211_STYPE_BEACON
Subtype value for beacon management frames.
unsigned long currticks(void)
Get current system time in ticks.
#define DBG(...)
Print a debugging message.
struct ath_txq * txq_map[WME_NUM_AC]
#define list_entry(list, type, member)
Get the container of a list entry.
#define ATH9K_TXERR_XRETRY
#define list_is_last(list, head)
Test whether an entry is the last entry in list.
#define NULL
NULL pointer (VOID *)
#define ATH9K_TXKEYIX_INVALID
static struct ath_buf * ath_tx_setup_buffer(struct net80211_device *dev, struct ath_txq *txq, struct io_buffer *iob)
#define IEEE80211_TYPE_MGMT
Type value for management (layer-2) frames.
#define IEEE80211_SEQ_MAX
if(natsemi->flags &NATSEMI_64BIT) return 1
void * memset(void *dest, int character, size_t len) __nonnull