Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc. |
| 3 | * All rights reserved. |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License along |
| 16 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 18 | * |
| 19 | * File: desc.h |
| 20 | * |
| 21 | * Purpose:The header file of descriptor |
| 22 | * |
| 23 | * Revision History: |
| 24 | * |
| 25 | * Author: Tevin Chen |
| 26 | * |
| 27 | * Date: May 21, 1996 |
| 28 | * |
| 29 | */ |
| 30 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 31 | #ifndef __DESC_H__ |
| 32 | #define __DESC_H__ |
| 33 | |
| 34 | #include <linux/types.h> |
| 35 | #include <linux/mm.h> |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 36 | #include "ttype.h" |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 37 | #include "tether.h" |
Jim Lieb | 612822f | 2009-08-12 14:54:03 -0700 | [diff] [blame] | 38 | |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 39 | #define B_OWNED_BY_CHIP 1 |
| 40 | #define B_OWNED_BY_HOST 0 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 41 | |
| 42 | // |
| 43 | // Bits in the RSR register |
| 44 | // |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 45 | #define RSR_ADDRBROAD 0x80 |
| 46 | #define RSR_ADDRMULTI 0x40 |
| 47 | #define RSR_ADDRUNI 0x00 |
| 48 | #define RSR_IVLDTYP 0x20 |
| 49 | #define RSR_IVLDLEN 0x10 // invalid len (> 2312 byte) |
| 50 | #define RSR_BSSIDOK 0x08 |
| 51 | #define RSR_CRCOK 0x04 |
| 52 | #define RSR_BCNSSIDOK 0x02 |
| 53 | #define RSR_ADDROK 0x01 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 54 | |
| 55 | // |
| 56 | // Bits in the new RSR register |
| 57 | // |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 58 | #define NEWRSR_DECRYPTOK 0x10 |
| 59 | #define NEWRSR_CFPIND 0x08 |
| 60 | #define NEWRSR_HWUTSF 0x04 |
| 61 | #define NEWRSR_BCNHITAID 0x02 |
| 62 | #define NEWRSR_BCNHITAID0 0x01 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 63 | |
| 64 | // |
| 65 | // Bits in the TSR0 register |
| 66 | // |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 67 | #define TSR0_PWRSTS1_2 0xC0 |
| 68 | #define TSR0_PWRSTS7 0x20 |
| 69 | #define TSR0_NCR 0x1F |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 70 | |
| 71 | // |
| 72 | // Bits in the TSR1 register |
| 73 | // |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 74 | #define TSR1_TERR 0x80 |
| 75 | #define TSR1_PWRSTS4_6 0x70 |
| 76 | #define TSR1_RETRYTMO 0x08 |
| 77 | #define TSR1_TMO 0x04 |
| 78 | #define TSR1_PWRSTS3 0x02 |
| 79 | #define ACK_DATA 0x01 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 80 | |
| 81 | // |
| 82 | // Bits in the TCR register |
| 83 | // |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 84 | #define EDMSDU 0x04 // end of sdu |
| 85 | #define TCR_EDP 0x02 // end of packet |
| 86 | #define TCR_STP 0x01 // start of packet |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 87 | |
| 88 | // max transmit or receive buffer size |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 89 | #define CB_MAX_BUF_SIZE 2900U |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 90 | // NOTE: must be multiple of 4 |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 91 | #define CB_MAX_TX_BUF_SIZE CB_MAX_BUF_SIZE |
| 92 | #define CB_MAX_RX_BUF_SIZE_NORMAL CB_MAX_BUF_SIZE |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 93 | |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 94 | #define CB_BEACON_BUF_SIZE 512U |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 95 | |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 96 | #define CB_MAX_RX_DESC 128 |
| 97 | #define CB_MIN_RX_DESC 16 |
| 98 | #define CB_MAX_TX_DESC 64 |
| 99 | #define CB_MIN_TX_DESC 16 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 100 | |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 101 | #define CB_MAX_RECEIVED_PACKETS 16 |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 102 | // limit our receive routine to indicating |
| 103 | // this many at a time for 2 reasons: |
| 104 | // 1. driver flow control to protocol layer |
| 105 | // 2. limit the time used in ISR routine |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 106 | |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 107 | #define CB_EXTRA_RD_NUM 32 |
| 108 | #define CB_RD_NUM 32 |
| 109 | #define CB_TD_NUM 32 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 110 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 111 | // max number of physical segments |
| 112 | // in a single NDIS packet. Above this threshold, the packet |
| 113 | // is copied into a single physically contiguous buffer |
| 114 | #define CB_MAX_SEGMENT 4 |
| 115 | |
| 116 | #define CB_MIN_MAP_REG_NUM 4 |
| 117 | #define CB_MAX_MAP_REG_NUM CB_MAX_TX_DESC |
| 118 | |
| 119 | #define CB_PROTOCOL_RESERVED_SECTION 16 |
| 120 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 121 | // if retrys excess 15 times , tx will abort, and |
| 122 | // if tx fifo underflow, tx will fail |
| 123 | // we should try to resend it |
| 124 | #define CB_MAX_TX_ABORT_RETRY 3 |
| 125 | |
| 126 | #ifdef __BIG_ENDIAN |
| 127 | |
| 128 | // WMAC definition FIFO Control |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 129 | #define FIFOCTL_AUTO_FB_1 0x0010 |
| 130 | #define FIFOCTL_AUTO_FB_0 0x0008 |
| 131 | #define FIFOCTL_GRPACK 0x0004 |
| 132 | #define FIFOCTL_11GA 0x0003 |
| 133 | #define FIFOCTL_11GB 0x0002 |
| 134 | #define FIFOCTL_11B 0x0001 |
| 135 | #define FIFOCTL_11A 0x0000 |
| 136 | #define FIFOCTL_RTS 0x8000 |
| 137 | #define FIFOCTL_ISDMA0 0x4000 |
| 138 | #define FIFOCTL_GENINT 0x2000 |
| 139 | #define FIFOCTL_TMOEN 0x1000 |
| 140 | #define FIFOCTL_LRETRY 0x0800 |
| 141 | #define FIFOCTL_CRCDIS 0x0400 |
| 142 | #define FIFOCTL_NEEDACK 0x0200 |
| 143 | #define FIFOCTL_LHEAD 0x0100 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 144 | |
| 145 | //WMAC definition Frag Control |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 146 | #define FRAGCTL_AES 0x0003 |
| 147 | #define FRAGCTL_TKIP 0x0002 |
| 148 | #define FRAGCTL_LEGACY 0x0001 |
| 149 | #define FRAGCTL_NONENCRYPT 0x0000 |
| 150 | #define FRAGCTL_ENDFRAG 0x0300 |
| 151 | #define FRAGCTL_MIDFRAG 0x0200 |
| 152 | #define FRAGCTL_STAFRAG 0x0100 |
| 153 | #define FRAGCTL_NONFRAG 0x0000 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 154 | |
| 155 | #else |
| 156 | |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 157 | #define FIFOCTL_AUTO_FB_1 0x1000 |
| 158 | #define FIFOCTL_AUTO_FB_0 0x0800 |
| 159 | #define FIFOCTL_GRPACK 0x0400 |
| 160 | #define FIFOCTL_11GA 0x0300 |
| 161 | #define FIFOCTL_11GB 0x0200 |
| 162 | #define FIFOCTL_11B 0x0100 |
| 163 | #define FIFOCTL_11A 0x0000 |
| 164 | #define FIFOCTL_RTS 0x0080 |
| 165 | #define FIFOCTL_ISDMA0 0x0040 |
| 166 | #define FIFOCTL_GENINT 0x0020 |
| 167 | #define FIFOCTL_TMOEN 0x0010 |
| 168 | #define FIFOCTL_LRETRY 0x0008 |
| 169 | #define FIFOCTL_CRCDIS 0x0004 |
| 170 | #define FIFOCTL_NEEDACK 0x0002 |
| 171 | #define FIFOCTL_LHEAD 0x0001 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 172 | |
| 173 | //WMAC definition Frag Control |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 174 | #define FRAGCTL_AES 0x0300 |
| 175 | #define FRAGCTL_TKIP 0x0200 |
| 176 | #define FRAGCTL_LEGACY 0x0100 |
| 177 | #define FRAGCTL_NONENCRYPT 0x0000 |
| 178 | #define FRAGCTL_ENDFRAG 0x0003 |
| 179 | #define FRAGCTL_MIDFRAG 0x0002 |
| 180 | #define FRAGCTL_STAFRAG 0x0001 |
| 181 | #define FRAGCTL_NONFRAG 0x0000 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 182 | |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 183 | #endif |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 184 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 185 | #define TYPE_TXDMA0 0 |
| 186 | #define TYPE_AC0DMA 1 |
| 187 | #define TYPE_ATIMDMA 2 |
| 188 | #define TYPE_SYNCDMA 3 |
| 189 | #define TYPE_MAXTD 2 |
| 190 | |
| 191 | #define TYPE_BEACONDMA 4 |
| 192 | |
| 193 | #define TYPE_RXDMA0 0 |
| 194 | #define TYPE_RXDMA1 1 |
| 195 | #define TYPE_MAXRD 2 |
| 196 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 197 | // TD_INFO flags control bit |
| 198 | #define TD_FLAGS_NETIF_SKB 0x01 // check if need release skb |
| 199 | #define TD_FLAGS_PRIV_SKB 0x02 // check if called from private skb(hostap) |
| 200 | #define TD_FLAGS_PS_RETRY 0x04 // check if PS STA frame re-transmit |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 201 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 202 | // ref_sk_buff is used for mapping the skb structure between pre-built driver-obj & running kernel. |
| 203 | // Since different kernel version (2.4x) may change skb structure, i.e. pre-built driver-obj |
| 204 | // may link to older skb that leads error. |
| 205 | |
| 206 | typedef struct tagDEVICE_RD_INFO { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 207 | struct sk_buff *skb; |
| 208 | dma_addr_t skb_dma; |
| 209 | dma_addr_t curr_desc; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 210 | } DEVICE_RD_INFO, *PDEVICE_RD_INFO; |
| 211 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 212 | #ifdef __BIG_ENDIAN |
| 213 | |
| 214 | typedef struct tagRDES0 { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 215 | volatile unsigned short wResCount; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 216 | union { |
Charles Clément | c17ce8c | 2010-05-28 12:34:20 -0700 | [diff] [blame] | 217 | volatile u16 f15Reserved; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 218 | struct { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 219 | volatile u8 f8Reserved1; |
Charles Clément | 737c3d7 | 2010-05-28 12:34:19 -0700 | [diff] [blame] | 220 | volatile u8 f1Owner:1; |
| 221 | volatile u8 f7Reserved:7; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 222 | } __attribute__ ((__packed__)); |
| 223 | } __attribute__ ((__packed__)); |
| 224 | } __attribute__ ((__packed__)) |
| 225 | SRDES0, *PSRDES0; |
| 226 | |
| 227 | #else |
| 228 | |
| 229 | typedef struct tagRDES0 { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 230 | unsigned short wResCount; |
| 231 | unsigned short f15Reserved:15; |
| 232 | unsigned short f1Owner:1; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 233 | } __attribute__ ((__packed__)) |
| 234 | SRDES0; |
| 235 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 236 | #endif |
| 237 | |
| 238 | typedef struct tagRDES1 { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 239 | unsigned short wReqCount; |
| 240 | unsigned short wReserved; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 241 | } __attribute__ ((__packed__)) |
| 242 | SRDES1; |
| 243 | |
| 244 | // |
| 245 | // Rx descriptor |
| 246 | // |
| 247 | typedef struct tagSRxDesc { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 248 | volatile SRDES0 m_rd0RD0; |
| 249 | volatile SRDES1 m_rd1RD1; |
| 250 | volatile u32 buff_addr; |
| 251 | volatile u32 next_desc; |
Malcolm Priestley | 829127b | 2014-03-06 22:44:21 +0000 | [diff] [blame] | 252 | struct tagSRxDesc *next __aligned(8); |
| 253 | volatile PDEVICE_RD_INFO pRDInfo __aligned(8); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 254 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 255 | SRxDesc, *PSRxDesc; |
| 256 | typedef const SRxDesc *PCSRxDesc; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 257 | |
| 258 | #ifdef __BIG_ENDIAN |
| 259 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 260 | typedef struct tagTDES0 { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 261 | volatile unsigned char byTSR0; |
| 262 | volatile unsigned char byTSR1; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 263 | union { |
Charles Clément | c17ce8c | 2010-05-28 12:34:20 -0700 | [diff] [blame] | 264 | volatile u16 f15Txtime; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 265 | struct { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 266 | volatile u8 f8Reserved1; |
Charles Clément | 737c3d7 | 2010-05-28 12:34:19 -0700 | [diff] [blame] | 267 | volatile u8 f1Owner:1; |
| 268 | volatile u8 f7Reserved:7; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 269 | } __attribute__ ((__packed__)); |
| 270 | } __attribute__ ((__packed__)); |
| 271 | } __attribute__ ((__packed__)) |
| 272 | STDES0, PSTDES0; |
| 273 | |
| 274 | #else |
| 275 | |
| 276 | typedef struct tagTDES0 { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 277 | volatile unsigned char byTSR0; |
| 278 | volatile unsigned char byTSR1; |
| 279 | volatile unsigned short f15Txtime:15; |
| 280 | volatile unsigned short f1Owner:1; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 281 | } __attribute__ ((__packed__)) |
| 282 | STDES0; |
| 283 | |
| 284 | #endif |
| 285 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 286 | typedef struct tagTDES1 { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 287 | volatile unsigned short wReqCount; |
| 288 | volatile unsigned char byTCR; |
| 289 | volatile unsigned char byReserved; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 290 | } __attribute__ ((__packed__)) |
| 291 | STDES1; |
| 292 | |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 293 | typedef struct tagDEVICE_TD_INFO { |
| 294 | struct sk_buff *skb; |
| 295 | unsigned char *buf; |
| 296 | dma_addr_t skb_dma; |
| 297 | dma_addr_t buf_dma; |
| 298 | dma_addr_t curr_desc; |
| 299 | unsigned long dwReqCount; |
| 300 | unsigned long dwHeaderLength; |
| 301 | unsigned char byFlags; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 302 | } DEVICE_TD_INFO, *PDEVICE_TD_INFO; |
| 303 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 304 | // |
| 305 | // transmit descriptor |
| 306 | // |
| 307 | typedef struct tagSTxDesc { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 308 | volatile STDES0 m_td0TD0; |
| 309 | volatile STDES1 m_td1TD1; |
| 310 | volatile u32 buff_addr; |
| 311 | volatile u32 next_desc; |
Malcolm Priestley | 829127b | 2014-03-06 22:44:21 +0000 | [diff] [blame] | 312 | struct tagSTxDesc *next __aligned(8); |
| 313 | volatile PDEVICE_TD_INFO pTDInfo __aligned(8); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 314 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 315 | STxDesc, *PSTxDesc; |
| 316 | typedef const STxDesc *PCSTxDesc; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 317 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 318 | typedef struct tagSTxSyncDesc { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 319 | volatile STDES0 m_td0TD0; |
| 320 | volatile STDES1 m_td1TD1; |
| 321 | volatile u32 buff_addr; // pointer to logical buffer |
| 322 | volatile u32 next_desc; // pointer to next logical descriptor |
| 323 | volatile unsigned short m_wFIFOCtl; |
| 324 | volatile unsigned short m_wTimeStamp; |
Malcolm Priestley | 829127b | 2014-03-06 22:44:21 +0000 | [diff] [blame] | 325 | struct tagSTxSyncDesc *next __aligned(8); |
| 326 | volatile PDEVICE_TD_INFO pTDInfo __aligned(8); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 327 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 328 | STxSyncDesc, *PSTxSyncDesc; |
| 329 | typedef const STxSyncDesc *PCSTxSyncDesc; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 330 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 331 | // |
| 332 | // RsvTime buffer header |
| 333 | // |
| 334 | typedef struct tagSRrvTime_gRTS { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 335 | unsigned short wRTSTxRrvTime_ba; |
| 336 | unsigned short wRTSTxRrvTime_aa; |
| 337 | unsigned short wRTSTxRrvTime_bb; |
| 338 | unsigned short wReserved; |
| 339 | unsigned short wTxRrvTime_b; |
| 340 | unsigned short wTxRrvTime_a; |
| 341 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 342 | SRrvTime_gRTS, *PSRrvTime_gRTS; |
| 343 | typedef const SRrvTime_gRTS *PCSRrvTime_gRTS; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 344 | |
| 345 | typedef struct tagSRrvTime_gCTS { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 346 | unsigned short wCTSTxRrvTime_ba; |
| 347 | unsigned short wReserved; |
| 348 | unsigned short wTxRrvTime_b; |
| 349 | unsigned short wTxRrvTime_a; |
| 350 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 351 | SRrvTime_gCTS, *PSRrvTime_gCTS; |
| 352 | typedef const SRrvTime_gCTS *PCSRrvTime_gCTS; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 353 | |
| 354 | typedef struct tagSRrvTime_ab { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 355 | unsigned short wRTSTxRrvTime; |
| 356 | unsigned short wTxRrvTime; |
| 357 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 358 | SRrvTime_ab, *PSRrvTime_ab; |
| 359 | typedef const SRrvTime_ab *PCSRrvTime_ab; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 360 | |
| 361 | typedef struct tagSRrvTime_atim { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 362 | unsigned short wCTSTxRrvTime_ba; |
| 363 | unsigned short wTxRrvTime_a; |
| 364 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 365 | SRrvTime_atim, *PSRrvTime_atim; |
| 366 | typedef const SRrvTime_atim *PCSRrvTime_atim; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 367 | |
| 368 | // |
| 369 | // RTS buffer header |
| 370 | // |
| 371 | typedef struct tagSRTSData { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 372 | unsigned short wFrameControl; |
| 373 | unsigned short wDurationID; |
| 374 | unsigned char abyRA[ETH_ALEN]; |
| 375 | unsigned char abyTA[ETH_ALEN]; |
| 376 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 377 | SRTSData, *PSRTSData; |
| 378 | typedef const SRTSData *PCSRTSData; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 379 | |
Malcolm Priestley | edbae99 | 2014-08-20 22:30:27 +0100 | [diff] [blame] | 380 | /* Length, Service, and Signal fields of Phy for Tx */ |
| 381 | struct vnt_phy_field { |
| 382 | u8 signal; |
| 383 | u8 service; |
| 384 | __le16 len; |
| 385 | } __packed; |
| 386 | |
Malcolm Priestley | 864a5a3 | 2014-08-20 22:30:30 +0100 | [diff] [blame^] | 387 | union vnt_phy_field_swap { |
| 388 | struct vnt_phy_field field_read; |
| 389 | u16 swap[2]; |
| 390 | u32 field_write; |
| 391 | }; |
| 392 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 393 | typedef struct tagSRTS_g { |
Malcolm Priestley | edbae99 | 2014-08-20 22:30:27 +0100 | [diff] [blame] | 394 | struct vnt_phy_field b; |
| 395 | struct vnt_phy_field a; |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 396 | unsigned char bySignalField_b; |
| 397 | unsigned char byServiceField_b; |
| 398 | unsigned short wTransmitLength_b; |
| 399 | unsigned char bySignalField_a; |
| 400 | unsigned char byServiceField_a; |
| 401 | unsigned short wTransmitLength_a; |
| 402 | unsigned short wDuration_ba; |
| 403 | unsigned short wDuration_aa; |
| 404 | unsigned short wDuration_bb; |
| 405 | unsigned short wReserved; |
| 406 | SRTSData Data; |
| 407 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 408 | SRTS_g, *PSRTS_g; |
| 409 | typedef const SRTS_g *PCSRTS_g; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 410 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 411 | typedef struct tagSRTS_g_FB { |
Malcolm Priestley | edbae99 | 2014-08-20 22:30:27 +0100 | [diff] [blame] | 412 | struct vnt_phy_field b; |
| 413 | struct vnt_phy_field a; |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 414 | unsigned char bySignalField_b; |
| 415 | unsigned char byServiceField_b; |
| 416 | unsigned short wTransmitLength_b; |
| 417 | unsigned char bySignalField_a; |
| 418 | unsigned char byServiceField_a; |
| 419 | unsigned short wTransmitLength_a; |
| 420 | unsigned short wDuration_ba; |
| 421 | unsigned short wDuration_aa; |
| 422 | unsigned short wDuration_bb; |
| 423 | unsigned short wReserved; |
| 424 | unsigned short wRTSDuration_ba_f0; |
| 425 | unsigned short wRTSDuration_aa_f0; |
| 426 | unsigned short wRTSDuration_ba_f1; |
| 427 | unsigned short wRTSDuration_aa_f1; |
| 428 | SRTSData Data; |
| 429 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 430 | SRTS_g_FB, *PSRTS_g_FB; |
| 431 | typedef const SRTS_g_FB *PCSRTS_g_FB; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 432 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 433 | typedef struct tagSRTS_ab { |
Malcolm Priestley | edbae99 | 2014-08-20 22:30:27 +0100 | [diff] [blame] | 434 | struct vnt_phy_field ab; |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 435 | unsigned char bySignalField; |
| 436 | unsigned char byServiceField; |
| 437 | unsigned short wTransmitLength; |
| 438 | unsigned short wDuration; |
| 439 | unsigned short wReserved; |
| 440 | SRTSData Data; |
| 441 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 442 | SRTS_ab, *PSRTS_ab; |
| 443 | typedef const SRTS_ab *PCSRTS_ab; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 444 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 445 | typedef struct tagSRTS_a_FB { |
Malcolm Priestley | edbae99 | 2014-08-20 22:30:27 +0100 | [diff] [blame] | 446 | struct vnt_phy_field a; |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 447 | unsigned char bySignalField; |
| 448 | unsigned char byServiceField; |
| 449 | unsigned short wTransmitLength; |
| 450 | unsigned short wDuration; |
| 451 | unsigned short wReserved; |
| 452 | unsigned short wRTSDuration_f0; |
| 453 | unsigned short wRTSDuration_f1; |
| 454 | SRTSData Data; |
| 455 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 456 | SRTS_a_FB, *PSRTS_a_FB; |
| 457 | typedef const SRTS_a_FB *PCSRTS_a_FB; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 458 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 459 | // |
| 460 | // CTS buffer header |
| 461 | // |
| 462 | typedef struct tagSCTSData { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 463 | unsigned short wFrameControl; |
| 464 | unsigned short wDurationID; |
| 465 | unsigned char abyRA[ETH_ALEN]; |
| 466 | unsigned short wReserved; |
| 467 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 468 | SCTSData, *PSCTSData; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 469 | |
| 470 | typedef struct tagSCTS { |
Malcolm Priestley | edbae99 | 2014-08-20 22:30:27 +0100 | [diff] [blame] | 471 | struct vnt_phy_field b; |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 472 | unsigned char bySignalField_b; |
| 473 | unsigned char byServiceField_b; |
| 474 | unsigned short wTransmitLength_b; |
| 475 | unsigned short wDuration_ba; |
| 476 | unsigned short wReserved; |
| 477 | SCTSData Data; |
| 478 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 479 | SCTS, *PSCTS; |
| 480 | typedef const SCTS *PCSCTS; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 481 | |
| 482 | typedef struct tagSCTS_FB { |
Malcolm Priestley | edbae99 | 2014-08-20 22:30:27 +0100 | [diff] [blame] | 483 | struct vnt_phy_field b; |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 484 | unsigned char bySignalField_b; |
| 485 | unsigned char byServiceField_b; |
| 486 | unsigned short wTransmitLength_b; |
| 487 | unsigned short wDuration_ba; |
| 488 | unsigned short wReserved; |
| 489 | unsigned short wCTSDuration_ba_f0; |
| 490 | unsigned short wCTSDuration_ba_f1; |
| 491 | SCTSData Data; |
| 492 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 493 | SCTS_FB, *PSCTS_FB; |
| 494 | typedef const SCTS_FB *PCSCTS_FB; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 495 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 496 | // |
| 497 | // Tx FIFO header |
| 498 | // |
| 499 | typedef struct tagSTxBufHead { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 500 | u32 adwTxKey[4]; |
| 501 | unsigned short wFIFOCtl; |
| 502 | unsigned short wTimeStamp; |
| 503 | unsigned short wFragCtl; |
| 504 | unsigned char byTxPower; |
| 505 | unsigned char wReserved; |
| 506 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 507 | STxBufHead, *PSTxBufHead; |
| 508 | typedef const STxBufHead *PCSTxBufHead; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 509 | |
| 510 | typedef struct tagSTxShortBufHead { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 511 | unsigned short wFIFOCtl; |
| 512 | unsigned short wTimeStamp; |
| 513 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 514 | STxShortBufHead, *PSTxShortBufHead; |
| 515 | typedef const STxShortBufHead *PCSTxShortBufHead; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 516 | |
| 517 | // |
| 518 | // Tx data header |
| 519 | // |
| 520 | typedef struct tagSTxDataHead_g { |
Malcolm Priestley | edbae99 | 2014-08-20 22:30:27 +0100 | [diff] [blame] | 521 | struct vnt_phy_field b; |
| 522 | struct vnt_phy_field a; |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 523 | unsigned char bySignalField_b; |
| 524 | unsigned char byServiceField_b; |
| 525 | unsigned short wTransmitLength_b; |
| 526 | unsigned char bySignalField_a; |
| 527 | unsigned char byServiceField_a; |
| 528 | unsigned short wTransmitLength_a; |
| 529 | unsigned short wDuration_b; |
| 530 | unsigned short wDuration_a; |
| 531 | unsigned short wTimeStampOff_b; |
| 532 | unsigned short wTimeStampOff_a; |
| 533 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 534 | STxDataHead_g, *PSTxDataHead_g; |
| 535 | typedef const STxDataHead_g *PCSTxDataHead_g; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 536 | |
| 537 | typedef struct tagSTxDataHead_g_FB { |
Malcolm Priestley | edbae99 | 2014-08-20 22:30:27 +0100 | [diff] [blame] | 538 | struct vnt_phy_field b; |
| 539 | struct vnt_phy_field a; |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 540 | unsigned char bySignalField_b; |
| 541 | unsigned char byServiceField_b; |
| 542 | unsigned short wTransmitLength_b; |
| 543 | unsigned char bySignalField_a; |
| 544 | unsigned char byServiceField_a; |
| 545 | unsigned short wTransmitLength_a; |
| 546 | unsigned short wDuration_b; |
| 547 | unsigned short wDuration_a; |
| 548 | unsigned short wDuration_a_f0; |
| 549 | unsigned short wDuration_a_f1; |
| 550 | unsigned short wTimeStampOff_b; |
| 551 | unsigned short wTimeStampOff_a; |
| 552 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 553 | STxDataHead_g_FB, *PSTxDataHead_g_FB; |
| 554 | typedef const STxDataHead_g_FB *PCSTxDataHead_g_FB; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 555 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 556 | typedef struct tagSTxDataHead_ab { |
Malcolm Priestley | edbae99 | 2014-08-20 22:30:27 +0100 | [diff] [blame] | 557 | struct vnt_phy_field ab; |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 558 | unsigned char bySignalField; |
| 559 | unsigned char byServiceField; |
| 560 | unsigned short wTransmitLength; |
| 561 | unsigned short wDuration; |
| 562 | unsigned short wTimeStampOff; |
| 563 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 564 | STxDataHead_ab, *PSTxDataHead_ab; |
| 565 | typedef const STxDataHead_ab *PCSTxDataHead_ab; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 566 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 567 | typedef struct tagSTxDataHead_a_FB { |
Malcolm Priestley | edbae99 | 2014-08-20 22:30:27 +0100 | [diff] [blame] | 568 | struct vnt_phy_field a; |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 569 | unsigned char bySignalField; |
| 570 | unsigned char byServiceField; |
| 571 | unsigned short wTransmitLength; |
| 572 | unsigned short wDuration; |
| 573 | unsigned short wTimeStampOff; |
| 574 | unsigned short wDuration_f0; |
| 575 | unsigned short wDuration_f1; |
| 576 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 577 | STxDataHead_a_FB, *PSTxDataHead_a_FB; |
| 578 | typedef const STxDataHead_a_FB *PCSTxDataHead_a_FB; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 579 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 580 | typedef struct tagSBEACONCtl { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 581 | u32 BufReady:1; |
| 582 | u32 TSF:15; |
| 583 | u32 BufLen:11; |
| 584 | u32 Reserved:5; |
| 585 | } __attribute__ ((__packed__)) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 586 | SBEACONCtl; |
| 587 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 588 | typedef struct tagSSecretKey { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 589 | u32 dwLowDword; |
| 590 | unsigned char byHighByte; |
| 591 | } __attribute__ ((__packed__)) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 592 | SSecretKey; |
| 593 | |
| 594 | typedef struct tagSKeyEntry { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 595 | unsigned char abyAddrHi[2]; |
| 596 | unsigned short wKCTL; |
| 597 | unsigned char abyAddrLo[4]; |
| 598 | u32 dwKey0[4]; |
| 599 | u32 dwKey1[4]; |
| 600 | u32 dwKey2[4]; |
| 601 | u32 dwKey3[4]; |
| 602 | u32 dwKey4[4]; |
| 603 | } __attribute__ ((__packed__)) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 604 | SKeyEntry; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 605 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 606 | #endif // __DESC_H__ |