1*6e778a7eSPedro F. Giffuni /*- 2*6e778a7eSPedro F. Giffuni * SPDX-License-Identifier: ISC 3*6e778a7eSPedro F. Giffuni * 414779705SSam Leffler * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting 514779705SSam Leffler * Copyright (c) 2002-2004 Atheros Communications, Inc. 614779705SSam Leffler * 714779705SSam Leffler * Permission to use, copy, modify, and/or distribute this software for any 814779705SSam Leffler * purpose with or without fee is hereby granted, provided that the above 914779705SSam Leffler * copyright notice and this permission notice appear in all copies. 1014779705SSam Leffler * 1114779705SSam Leffler * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 1214779705SSam Leffler * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 1314779705SSam Leffler * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 1414779705SSam Leffler * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 1514779705SSam Leffler * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 1614779705SSam Leffler * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 1714779705SSam Leffler * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1814779705SSam Leffler */ 1914779705SSam Leffler #ifndef _DEV_ATH_AR5210DESC_H 2014779705SSam Leffler #define _DEV_ATH_AR5210DESC_H 2114779705SSam Leffler 2214779705SSam Leffler /* 2314779705SSam Leffler * Defintions for the DMA descriptors used by the Atheros 2414779705SSam Leffler * AR5210/AR5211 and AR5110 Wireless Lan controller parts. 2514779705SSam Leffler */ 2614779705SSam Leffler 2714779705SSam Leffler /* DMA descriptors */ 2814779705SSam Leffler struct ar5210_desc { 2914779705SSam Leffler uint32_t ds_link; /* link pointer */ 3014779705SSam Leffler uint32_t ds_data; /* data buffer pointer */ 3114779705SSam Leffler uint32_t ds_ctl0; /* DMA control 0 */ 3214779705SSam Leffler uint32_t ds_ctl1; /* DMA control 1 */ 3314779705SSam Leffler uint32_t ds_status0; /* DMA status 0 */ 3414779705SSam Leffler uint32_t ds_status1; /* DMA status 1 */ 3514779705SSam Leffler } __packed; 3614779705SSam Leffler #define AR5210DESC(_ds) ((struct ar5210_desc *)(_ds)) 3714779705SSam Leffler #define AR5210DESC_CONST(_ds) ((const struct ar5210_desc *)(_ds)) 3814779705SSam Leffler 3914779705SSam Leffler /* TX ds_ctl0 */ 4014779705SSam Leffler #define AR_FrameLen 0x00000fff /* frame length */ 4114779705SSam Leffler #define AR_HdrLen 0x0003f000 /* header length */ 4214779705SSam Leffler #define AR_HdrLen_S 12 4314779705SSam Leffler #define AR_XmitRate 0x003c0000 /* txrate */ 4414779705SSam Leffler #define AR_XmitRate_S 18 4514779705SSam Leffler #define AR_Rate_6M 0xb 4614779705SSam Leffler #define AR_Rate_9M 0xf 4714779705SSam Leffler #define AR_Rate_12M 0xa 4814779705SSam Leffler #define AR_Rate_18M 0xe 4914779705SSam Leffler #define AR_Rate_24M 0x9 5014779705SSam Leffler #define AR_Rate_36M 0xd 5114779705SSam Leffler #define AR_Rate_48M 0x8 5214779705SSam Leffler #define AR_Rate_54M 0xc 5314779705SSam Leffler #define AR_RTSCTSEnable 0x00400000 /* RTS/CTS enable */ 5414779705SSam Leffler #define AR_LongPkt 0x00800000 /* long packet indication */ 5514779705SSam Leffler #define AR_ClearDestMask 0x01000000 /* Clear destination mask bit */ 5614779705SSam Leffler #define AR_AntModeXmit 0x02000000 /* TX antenna seslection */ 5714779705SSam Leffler #define AR_FrmType 0x1c000000 /* frame type indication */ 583a4d0022SAdrian Chadd #define AR_FrmType_S 26 5914779705SSam Leffler #define AR_Frm_Normal 0x00000000 /* normal frame */ 6014779705SSam Leffler #define AR_Frm_ATIM 0x04000000 /* ATIM frame */ 6114779705SSam Leffler #define AR_Frm_PSPOLL 0x08000000 /* PS poll frame */ 6214779705SSam Leffler #define AR_Frm_NoDelay 0x0c000000 /* no delay data */ 6314779705SSam Leffler #define AR_Frm_PIFS 0x10000000 /* PIFS data */ 6414779705SSam Leffler #define AR_TxInterReq 0x20000000 /* TX interrupt request */ 6514779705SSam Leffler #define AR_EncryptKeyValid 0x40000000 /* EncryptKeyIdx is valid */ 6614779705SSam Leffler 6714779705SSam Leffler /* TX ds_ctl1 */ 6814779705SSam Leffler #define AR_BufLen 0x00000fff /* data buffer length */ 6914779705SSam Leffler #define AR_More 0x00001000 /* more desc in this frame */ 7014779705SSam Leffler #define AR_EncryptKeyIdx 0x0007e000 /* ecnrypt key table index */ 7114779705SSam Leffler #define AR_EncryptKeyIdx_S 13 7214779705SSam Leffler #define AR_RTSDuration 0xfff80000 /* lower 13bit of duration */ 733a4d0022SAdrian Chadd #define AR_RTSDuration_S 19 7414779705SSam Leffler 7514779705SSam Leffler /* RX ds_ctl1 */ 7614779705SSam Leffler /* AR_BufLen 0x00000fff data buffer length */ 7714779705SSam Leffler #define AR_RxInterReq 0x00002000 /* RX interrupt request */ 7814779705SSam Leffler 7914779705SSam Leffler /* TX ds_status0 */ 8014779705SSam Leffler #define AR_FrmXmitOK 0x00000001 /* TX success */ 8114779705SSam Leffler #define AR_ExcessiveRetries 0x00000002 /* excessive retries */ 8214779705SSam Leffler #define AR_FIFOUnderrun 0x00000004 /* TX FIFO underrun */ 8314779705SSam Leffler #define AR_Filtered 0x00000008 /* TX filter indication */ 8414779705SSam Leffler /* NB: the spec has the Short+Long retry counts reversed */ 8514779705SSam Leffler #define AR_LongRetryCnt 0x000000f0 /* long retry count */ 8614779705SSam Leffler #define AR_LongRetryCnt_S 4 8714779705SSam Leffler #define AR_ShortRetryCnt 0x00000f00 /* short retry count */ 8814779705SSam Leffler #define AR_ShortRetryCnt_S 8 8914779705SSam Leffler #define AR_SendTimestamp 0xffff0000 /* TX timestamp */ 9014779705SSam Leffler #define AR_SendTimestamp_S 16 9114779705SSam Leffler 9214779705SSam Leffler /* RX ds_status0 */ 9314779705SSam Leffler #define AR_DataLen 0x00000fff /* RX data length */ 9414779705SSam Leffler /* AR_More 0x00001000 more desc in this frame */ 9514779705SSam Leffler #define AR_RcvAntenna 0x00004000 /* received on ant 1 */ 9614779705SSam Leffler #define AR_RcvRate 0x00078000 /* reception rate */ 9714779705SSam Leffler #define AR_RcvRate_S 15 9814779705SSam Leffler #define AR_RcvSigStrength 0x07f80000 /* receive signal strength */ 9914779705SSam Leffler #define AR_RcvSigStrength_S 19 10014779705SSam Leffler 10114779705SSam Leffler /* TX ds_status1 */ 10214779705SSam Leffler #define AR_Done 0x00000001 /* descripter complete */ 10314779705SSam Leffler #define AR_SeqNum 0x00001ffe /* TX sequence number */ 10414779705SSam Leffler #define AR_AckSigStrength 0x001fe000 /* strength of ACK */ 10514779705SSam Leffler #define AR_AckSigStrength_S 13 10614779705SSam Leffler 10714779705SSam Leffler /* RX ds_status1 */ 10814779705SSam Leffler /* AR_Done 0x00000001 descripter complete */ 10914779705SSam Leffler #define AR_FrmRcvOK 0x00000002 /* frame reception success */ 11014779705SSam Leffler #define AR_CRCErr 0x00000004 /* CRC error */ 11114779705SSam Leffler #define AR_FIFOOverrun 0x00000008 /* RX FIFO overrun */ 11214779705SSam Leffler #define AR_DecryptCRCErr 0x00000010 /* Decryption CRC fiailure */ 11314779705SSam Leffler #define AR_PHYErr 0x000000e0 /* PHY error */ 11414779705SSam Leffler #define AR_PHYErr_S 5 11514779705SSam Leffler #define AR_PHYErr_NoErr 0x00000000 /* No error */ 11614779705SSam Leffler #define AR_PHYErr_Tim 0x00000020 /* Timing error */ 11714779705SSam Leffler #define AR_PHYErr_Par 0x00000040 /* Parity error */ 11814779705SSam Leffler #define AR_PHYErr_Rate 0x00000060 /* Illegal rate */ 11914779705SSam Leffler #define AR_PHYErr_Len 0x00000080 /* Illegal length */ 12014779705SSam Leffler #define AR_PHYErr_QAM 0x000000a0 /* 64 QAM rate */ 12114779705SSam Leffler #define AR_PHYErr_Srv 0x000000c0 /* Service bit error */ 12214779705SSam Leffler #define AR_PHYErr_TOR 0x000000e0 /* Transmit override receive */ 12314779705SSam Leffler #define AR_KeyIdxValid 0x00000100 /* decryption key index valid */ 12414779705SSam Leffler #define AR_KeyIdx 0x00007e00 /* Decryption key index */ 12514779705SSam Leffler #define AR_KeyIdx_S 9 12614779705SSam Leffler #define AR_RcvTimestamp 0x0fff8000 /* timestamp */ 12714779705SSam Leffler #define AR_RcvTimestamp_S 15 12814779705SSam Leffler #define AR_KeyCacheMiss 0x10000000 /* key cache miss indication */ 12914779705SSam Leffler 13014779705SSam Leffler #endif /* _DEV_ATH_AR5210DESC_H_ */ 131