Path: blob/main/sys/dev/ath/ath_hal/ar5210/ar5210desc.h
39566 views
/*-1* SPDX-License-Identifier: ISC2*3* Copyright (c) 2002-2008 Sam Leffler, Errno Consulting4* Copyright (c) 2002-2004 Atheros Communications, Inc.5*6* Permission to use, copy, modify, and/or distribute this software for any7* purpose with or without fee is hereby granted, provided that the above8* copyright notice and this permission notice appear in all copies.9*10* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES11* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF12* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR13* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES14* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN15* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF16* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.17*/18#ifndef _DEV_ATH_AR5210DESC_H19#define _DEV_ATH_AR5210DESC_H2021/*22* Defintions for the DMA descriptors used by the Atheros23* AR5210/AR5211 and AR5110 Wireless Lan controller parts.24*/2526/* DMA descriptors */27struct ar5210_desc {28uint32_t ds_link; /* link pointer */29uint32_t ds_data; /* data buffer pointer */30uint32_t ds_ctl0; /* DMA control 0 */31uint32_t ds_ctl1; /* DMA control 1 */32uint32_t ds_status0; /* DMA status 0 */33uint32_t ds_status1; /* DMA status 1 */34} __packed;35#define AR5210DESC(_ds) ((struct ar5210_desc *)(_ds))36#define AR5210DESC_CONST(_ds) ((const struct ar5210_desc *)(_ds))3738/* TX ds_ctl0 */39#define AR_FrameLen 0x00000fff /* frame length */40#define AR_HdrLen 0x0003f000 /* header length */41#define AR_HdrLen_S 1242#define AR_XmitRate 0x003c0000 /* txrate */43#define AR_XmitRate_S 1844#define AR_Rate_6M 0xb45#define AR_Rate_9M 0xf46#define AR_Rate_12M 0xa47#define AR_Rate_18M 0xe48#define AR_Rate_24M 0x949#define AR_Rate_36M 0xd50#define AR_Rate_48M 0x851#define AR_Rate_54M 0xc52#define AR_RTSCTSEnable 0x00400000 /* RTS/CTS enable */53#define AR_LongPkt 0x00800000 /* long packet indication */54#define AR_ClearDestMask 0x01000000 /* Clear destination mask bit */55#define AR_AntModeXmit 0x02000000 /* TX antenna seslection */56#define AR_FrmType 0x1c000000 /* frame type indication */57#define AR_FrmType_S 2658#define AR_Frm_Normal 0x00000000 /* normal frame */59#define AR_Frm_ATIM 0x04000000 /* ATIM frame */60#define AR_Frm_PSPOLL 0x08000000 /* PS poll frame */61#define AR_Frm_NoDelay 0x0c000000 /* no delay data */62#define AR_Frm_PIFS 0x10000000 /* PIFS data */63#define AR_TxInterReq 0x20000000 /* TX interrupt request */64#define AR_EncryptKeyValid 0x40000000 /* EncryptKeyIdx is valid */6566/* TX ds_ctl1 */67#define AR_BufLen 0x00000fff /* data buffer length */68#define AR_More 0x00001000 /* more desc in this frame */69#define AR_EncryptKeyIdx 0x0007e000 /* ecnrypt key table index */70#define AR_EncryptKeyIdx_S 1371#define AR_RTSDuration 0xfff80000 /* lower 13bit of duration */72#define AR_RTSDuration_S 197374/* RX ds_ctl1 */75/* AR_BufLen 0x00000fff data buffer length */76#define AR_RxInterReq 0x00002000 /* RX interrupt request */7778/* TX ds_status0 */79#define AR_FrmXmitOK 0x00000001 /* TX success */80#define AR_ExcessiveRetries 0x00000002 /* excessive retries */81#define AR_FIFOUnderrun 0x00000004 /* TX FIFO underrun */82#define AR_Filtered 0x00000008 /* TX filter indication */83/* NB: the spec has the Short+Long retry counts reversed */84#define AR_LongRetryCnt 0x000000f0 /* long retry count */85#define AR_LongRetryCnt_S 486#define AR_ShortRetryCnt 0x00000f00 /* short retry count */87#define AR_ShortRetryCnt_S 888#define AR_SendTimestamp 0xffff0000 /* TX timestamp */89#define AR_SendTimestamp_S 169091/* RX ds_status0 */92#define AR_DataLen 0x00000fff /* RX data length */93/* AR_More 0x00001000 more desc in this frame */94#define AR_RcvAntenna 0x00004000 /* received on ant 1 */95#define AR_RcvRate 0x00078000 /* reception rate */96#define AR_RcvRate_S 1597#define AR_RcvSigStrength 0x07f80000 /* receive signal strength */98#define AR_RcvSigStrength_S 1999100/* TX ds_status1 */101#define AR_Done 0x00000001 /* descripter complete */102#define AR_SeqNum 0x00001ffe /* TX sequence number */103#define AR_AckSigStrength 0x001fe000 /* strength of ACK */104#define AR_AckSigStrength_S 13105106/* RX ds_status1 */107/* AR_Done 0x00000001 descripter complete */108#define AR_FrmRcvOK 0x00000002 /* frame reception success */109#define AR_CRCErr 0x00000004 /* CRC error */110#define AR_FIFOOverrun 0x00000008 /* RX FIFO overrun */111#define AR_DecryptCRCErr 0x00000010 /* Decryption CRC fiailure */112#define AR_PHYErr 0x000000e0 /* PHY error */113#define AR_PHYErr_S 5114#define AR_PHYErr_NoErr 0x00000000 /* No error */115#define AR_PHYErr_Tim 0x00000020 /* Timing error */116#define AR_PHYErr_Par 0x00000040 /* Parity error */117#define AR_PHYErr_Rate 0x00000060 /* Illegal rate */118#define AR_PHYErr_Len 0x00000080 /* Illegal length */119#define AR_PHYErr_QAM 0x000000a0 /* 64 QAM rate */120#define AR_PHYErr_Srv 0x000000c0 /* Service bit error */121#define AR_PHYErr_TOR 0x000000e0 /* Transmit override receive */122#define AR_KeyIdxValid 0x00000100 /* decryption key index valid */123#define AR_KeyIdx 0x00007e00 /* Decryption key index */124#define AR_KeyIdx_S 9125#define AR_RcvTimestamp 0x0fff8000 /* timestamp */126#define AR_RcvTimestamp_S 15127#define AR_KeyCacheMiss 0x10000000 /* key cache miss indication */128129#endif /* _DEV_ATH_AR5210DESC_H_ */130131132