linux/drivers/net/wireless/ath/ath9k/mac.h

/*
 * Copyright (c) 2008-2011 Atheros Communications Inc.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#ifndef MAC_H
#define MAC_H
#include <net/cfg80211.h>

#define set11nTries(_series, _index)

#define set11nRate(_series, _index)

#define set11nPktDurRTSCTS(_series, _index)

#define set11nRateFlags(_series, _index)

#define set11nChainSel(_series, _index)

#define CCK_SIFS_TIME
#define CCK_PREAMBLE_BITS
#define CCK_PLCP_BITS

#define OFDM_SIFS_TIME
#define OFDM_PREAMBLE_TIME
#define OFDM_PLCP_BITS
#define OFDM_SYMBOL_TIME

#define OFDM_SIFS_TIME_HALF
#define OFDM_PREAMBLE_TIME_HALF
#define OFDM_PLCP_BITS_HALF
#define OFDM_SYMBOL_TIME_HALF

#define OFDM_SIFS_TIME_QUARTER
#define OFDM_PREAMBLE_TIME_QUARTER
#define OFDM_PLCP_BITS_QUARTER
#define OFDM_SYMBOL_TIME_QUARTER

#define INIT_AIFS
#define INIT_CWMIN
#define INIT_CWMIN_11B
#define INIT_CWMAX
#define INIT_SH_RETRY
#define INIT_LG_RETRY
#define INIT_SSH_RETRY
#define INIT_SLG_RETRY

#define ATH9K_TXERR_XRETRY
#define ATH9K_TXERR_FILT
#define ATH9K_TXERR_FIFO
#define ATH9K_TXERR_XTXOP
#define ATH9K_TXERR_TIMER_EXPIRED
#define ATH9K_TX_ACKED
#define ATH9K_TX_FLUSH
#define ATH9K_TXERR_MASK

#define ATH9K_TX_BA
#define ATH9K_TX_PWRMGMT
#define ATH9K_TX_DESC_CFG_ERR
#define ATH9K_TX_DATA_UNDERRUN
#define ATH9K_TX_DELIM_UNDERRUN
#define ATH9K_TX_SW_FILTERED

/* 64 bytes */
#define MIN_TX_FIFO_THRESHOLD

/*
 * Single stream device AR9285 and AR9271 require 2 KB
 * to work around a hardware issue, all other devices
 * have can use the max 4 KB limit.
 */
#define MAX_TX_FIFO_THRESHOLD

struct ath_tx_status {};

struct ath_rx_status {};

struct ath_htc_rx_status {};

#define ATH9K_RXERR_CRC
#define ATH9K_RXERR_PHY
#define ATH9K_RXERR_FIFO
#define ATH9K_RXERR_DECRYPT
#define ATH9K_RXERR_MIC
#define ATH9K_RXERR_KEYMISS
#define ATH9K_RXERR_CORRUPT_DESC

#define ATH9K_RX_MORE
#define ATH9K_RX_MORE_AGGR
#define ATH9K_RX_GI
#define ATH9K_RX_2040
#define ATH9K_RX_DELIM_CRC_PRE
#define ATH9K_RX_DELIM_CRC_POST
#define ATH9K_RX_DECRYPT_BUSY

#define ATH9K_RXKEYIX_INVALID
#define ATH9K_TXKEYIX_INVALID

enum ath9k_phyerr {};

struct ath_desc {} __packed __aligned();

#define ATH9K_TXDESC_NOACK
#define ATH9K_TXDESC_RTSENA
#define ATH9K_TXDESC_CTSENA
/* ATH9K_TXDESC_INTREQ forces a tx interrupt to be generated for
 * the descriptor its marked on.  We take a tx interrupt to reap
 * descriptors when the h/w hits an EOL condition or
 * when the descriptor is specifically marked to generate
 * an interrupt with this flag. Descriptors should be
 * marked periodically to insure timely replenishing of the
 * supply needed for sending frames. Defering interrupts
 * reduces system load and potentially allows more concurrent
 * work to be done but if done to aggressively can cause
 * senders to backup. When the hardware queue is left too
 * large rate control information may also be too out of
 * date. An Alternative for this is TX interrupt mitigation
 * but this needs more testing. */
#define ATH9K_TXDESC_INTREQ
#define ATH9K_TXDESC_VEOL
#define ATH9K_TXDESC_EXT_ONLY
#define ATH9K_TXDESC_EXT_AND_CTL
#define ATH9K_TXDESC_VMF
#define ATH9K_TXDESC_FRAG_IS_ON
#define ATH9K_TXDESC_LOWRXCHAIN
#define ATH9K_TXDESC_LDPC
#define ATH9K_TXDESC_CLRDMASK

#define ATH9K_TXDESC_PAPRD
#define ATH9K_TXDESC_PAPRD_S

#define ATH9K_RXDESC_INTREQ

struct ar5416_desc {} __packed __aligned();

#define AR5416DESC(_ds)
#define AR5416DESC_CONST(_ds)

#define ds_ctl2
#define ds_ctl3
#define ds_ctl4
#define ds_ctl5
#define ds_ctl6
#define ds_ctl7
#define ds_ctl8
#define ds_ctl9
#define ds_ctl10
#define ds_ctl11

#define ds_txstatus0
#define ds_txstatus1
#define ds_txstatus2
#define ds_txstatus3
#define ds_txstatus4
#define ds_txstatus5
#define ds_txstatus6
#define ds_txstatus7
#define ds_txstatus8
#define ds_txstatus9

#define ds_rxstatus0
#define ds_rxstatus1
#define ds_rxstatus2
#define ds_rxstatus3
#define ds_rxstatus4
#define ds_rxstatus5
#define ds_rxstatus6
#define ds_rxstatus7
#define ds_rxstatus8

#define AR_FrameLen
#define AR_VirtMoreFrag
#define AR_TxCtlRsvd00
#define AR_XmitPower0
#define AR_XmitPower0_S
#define AR_XmitPower1
#define AR_XmitPower1_S
#define AR_XmitPower2
#define AR_XmitPower2_S
#define AR_XmitPower3
#define AR_XmitPower3_S
#define AR_RTSEnable
#define AR_VEOL
#define AR_ClrDestMask
#define AR_TxCtlRsvd01
#define AR_TxIntrReq
#define AR_DestIdxValid
#define AR_CTSEnable

#define AR_TxMore
#define AR_DestIdx
#define AR_DestIdx_S
#define AR_FrameType
#define AR_FrameType_S
#define AR_NoAck
#define AR_InsertTS
#define AR_CorruptFCS
#define AR_ExtOnly
#define AR_ExtAndCtl
#define AR_MoreAggr
#define AR_IsAggr

#define AR_BurstDur
#define AR_BurstDur_S
#define AR_DurUpdateEna
#define AR_XmitDataTries0
#define AR_XmitDataTries0_S
#define AR_XmitDataTries1
#define AR_XmitDataTries1_S
#define AR_XmitDataTries2
#define AR_XmitDataTries2_S
#define AR_XmitDataTries3
#define AR_XmitDataTries3_S

#define AR_XmitRate0
#define AR_XmitRate0_S
#define AR_XmitRate1
#define AR_XmitRate1_S
#define AR_XmitRate2
#define AR_XmitRate2_S
#define AR_XmitRate3
#define AR_XmitRate3_S

#define AR_PacketDur0
#define AR_PacketDur0_S
#define AR_RTSCTSQual0
#define AR_PacketDur1
#define AR_PacketDur1_S
#define AR_RTSCTSQual1

#define AR_PacketDur2
#define AR_PacketDur2_S
#define AR_RTSCTSQual2
#define AR_PacketDur3
#define AR_PacketDur3_S
#define AR_RTSCTSQual3

#define AR_AggrLen
#define AR_AggrLen_S
#define AR_TxCtlRsvd60
#define AR_PadDelim
#define AR_PadDelim_S
#define AR_EncrType
#define AR_EncrType_S
#define AR_TxCtlRsvd61
#define AR_LDPC

#define AR_2040_0
#define AR_GI0
#define AR_ChainSel0
#define AR_ChainSel0_S
#define AR_2040_1
#define AR_GI1
#define AR_ChainSel1
#define AR_ChainSel1_S
#define AR_2040_2
#define AR_GI2
#define AR_ChainSel2
#define AR_ChainSel2_S
#define AR_2040_3
#define AR_GI3
#define AR_ChainSel3
#define AR_ChainSel3_S
#define AR_RTSCTSRate
#define AR_RTSCTSRate_S
#define AR_STBC0
#define AR_STBC1
#define AR_STBC2
#define AR_STBC3

#define AR_TxRSSIAnt00
#define AR_TxRSSIAnt00_S
#define AR_TxRSSIAnt01
#define AR_TxRSSIAnt01_S
#define AR_TxRSSIAnt02
#define AR_TxRSSIAnt02_S
#define AR_TxStatusRsvd00
#define AR_TxBaStatus
#define AR_TxStatusRsvd01

/*
 * AR_FrmXmitOK - Frame transmission success flag. If set, the frame was
 * transmitted successfully. If clear, no ACK or BA was received to indicate
 * successful transmission when we were expecting an ACK or BA.
 */
#define AR_FrmXmitOK
#define AR_ExcessiveRetries
#define AR_FIFOUnderrun
#define AR_Filtered
#define AR_RTSFailCnt
#define AR_RTSFailCnt_S
#define AR_DataFailCnt
#define AR_DataFailCnt_S
#define AR_VirtRetryCnt
#define AR_VirtRetryCnt_S
#define AR_TxDelimUnderrun
#define AR_TxDataUnderrun
#define AR_DescCfgErr
#define AR_TxTimerExpired
#define AR_TxStatusRsvd10

#define AR_SendTimestamp
#define AR_BaBitmapLow
#define AR_BaBitmapHigh

#define AR_TxRSSIAnt10
#define AR_TxRSSIAnt10_S
#define AR_TxRSSIAnt11
#define AR_TxRSSIAnt11_S
#define AR_TxRSSIAnt12
#define AR_TxRSSIAnt12_S
#define AR_TxRSSICombined
#define AR_TxRSSICombined_S

#define AR_TxTid
#define AR_TxTid_S

#define AR_TxEVM0
#define AR_TxEVM1
#define AR_TxEVM2

#define AR_TxDone
#define AR_SeqNum
#define AR_SeqNum_S
#define AR_TxStatusRsvd80
#define AR_TxOpExceeded
#define AR_TxStatusRsvd81
#define AR_FinalTxIdx
#define AR_FinalTxIdx_S
#define AR_TxStatusRsvd82
#define AR_PowerMgmt
#define AR_TxStatusRsvd83

#define AR_RxCTLRsvd00

#define AR_RxCtlRsvd00
#define AR_RxIntrReq
#define AR_RxCtlRsvd01

#define AR_RxRSSIAnt00
#define AR_RxRSSIAnt00_S
#define AR_RxRSSIAnt01
#define AR_RxRSSIAnt01_S
#define AR_RxRSSIAnt02
#define AR_RxRSSIAnt02_S
#define AR_RxRate
#define AR_RxRate_S
#define AR_RxStatusRsvd00

#define AR_DataLen
#define AR_RxMore
#define AR_NumDelim
#define AR_NumDelim_S
#define AR_RxStatusRsvd10

#define AR_RcvTimestamp

#define AR_GI
#define AR_2040
#define AR_Parallel40
#define AR_Parallel40_S
#define AR_STBC
#define AR_RxStatusRsvd30
#define AR_RxAntenna
#define AR_RxAntenna_S

#define AR_RxRSSIAnt10
#define AR_RxRSSIAnt10_S
#define AR_RxRSSIAnt11
#define AR_RxRSSIAnt11_S
#define AR_RxRSSIAnt12
#define AR_RxRSSIAnt12_S
#define AR_RxRSSICombined
#define AR_RxRSSICombined_S

#define AR_RxEVM0
#define AR_RxEVM1
#define AR_RxEVM2

#define AR_RxDone
#define AR_RxFrameOK
#define AR_CRCErr
#define AR_DecryptCRCErr
#define AR_PHYErr
#define AR_MichaelErr
#define AR_PreDelimCRCErr
#define AR_RxStatusRsvd70
#define AR_RxKeyIdxValid
#define AR_KeyIdx
#define AR_KeyIdx_S
#define AR_PHYErrCode
#define AR_PHYErrCode_S
#define AR_RxMoreAggr
#define AR_RxAggr
#define AR_PostDelimCRCErr
#define AR_RxStatusRsvd71
#define AR_RxFirstAggr
#define AR_DecryptBusyErr
#define AR_KeyMiss

enum ath9k_tx_queue {};

#define ATH9K_NUM_TX_QUEUES

/* Used as a queue subtype instead of a WMM AC */
#define ATH9K_WME_UPSD

enum ath9k_tx_queue_flags {};

#define ATH9K_TXQ_USEDEFAULT
#define ATH9K_TXQ_USE_LOCKOUT_BKOFF_DIS

#define ATH9K_DECOMP_MASK_SIZE

enum ath9k_pkt_type {};

struct ath9k_tx_queue_info {};

enum ath9k_rx_filter {};

#define ATH9K_RATESERIES_RTS_CTS
#define ATH9K_RATESERIES_2040
#define ATH9K_RATESERIES_HALFGI
#define ATH9K_RATESERIES_STBC

struct ath9k_11n_rate_series {};

enum aggr_type {};

enum ath9k_key_type {};

struct ath_tx_info {};

struct ath_hw;
struct ath9k_channel;
enum ath9k_int;

u32 ath9k_hw_gettxbuf(struct ath_hw *ah, u32 q);
void ath9k_hw_puttxbuf(struct ath_hw *ah, u32 q, u32 txdp);
void ath9k_hw_txstart(struct ath_hw *ah, u32 q);
u32 ath9k_hw_numtxpending(struct ath_hw *ah, u32 q);
bool ath9k_hw_updatetxtriglevel(struct ath_hw *ah, bool bIncTrigLevel);
bool ath9k_hw_stop_dma_queue(struct ath_hw *ah, u32 q);
void ath9k_hw_abort_tx_dma(struct ath_hw *ah);
bool ath9k_hw_set_txq_props(struct ath_hw *ah, int q,
			    const struct ath9k_tx_queue_info *qinfo);
bool ath9k_hw_get_txq_props(struct ath_hw *ah, int q,
			    struct ath9k_tx_queue_info *qinfo);
int ath9k_hw_setuptxqueue(struct ath_hw *ah, enum ath9k_tx_queue type,
			  const struct ath9k_tx_queue_info *qinfo);
bool ath9k_hw_releasetxqueue(struct ath_hw *ah, u32 q);
bool ath9k_hw_resettxqueue(struct ath_hw *ah, u32 q);
int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
			struct ath_rx_status *rs);
void ath9k_hw_setuprxdesc(struct ath_hw *ah, struct ath_desc *ds,
			  u32 size, u32 flags);
bool ath9k_hw_setrxabort(struct ath_hw *ah, bool set);
void ath9k_hw_putrxbuf(struct ath_hw *ah, u32 rxdp);
void ath9k_hw_startpcureceive(struct ath_hw *ah, bool is_scanning);
void ath9k_hw_abortpcurecv(struct ath_hw *ah);
bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset);
int ath9k_hw_beaconq_setup(struct ath_hw *ah);
void ath9k_hw_set_tx_filter(struct ath_hw *ah, u8 destidx, bool set);

/* Interrupt Handling */
bool ath9k_hw_intrpend(struct ath_hw *ah);
void ath9k_hw_set_interrupts(struct ath_hw *ah);
void ath9k_hw_enable_interrupts(struct ath_hw *ah);
void ath9k_hw_disable_interrupts(struct ath_hw *ah);
void ath9k_hw_kill_interrupts(struct ath_hw *ah);
void ath9k_hw_resume_interrupts(struct ath_hw *ah);

void ar9002_hw_attach_mac_ops(struct ath_hw *ah);

#endif /* MAC_H */