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> |
Malcolm Priestley | 52c4130 | 2014-08-30 22:25:39 +0100 | [diff] [blame] | 36 | #include "linux/ieee80211.h" |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 37 | #include "ttype.h" |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 38 | #include "tether.h" |
Jim Lieb | 612822f | 2009-08-12 14:54:03 -0700 | [diff] [blame] | 39 | |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 40 | #define B_OWNED_BY_CHIP 1 |
| 41 | #define B_OWNED_BY_HOST 0 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 42 | |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 43 | /* Bits in the RSR register */ |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 44 | #define RSR_ADDRBROAD 0x80 |
| 45 | #define RSR_ADDRMULTI 0x40 |
| 46 | #define RSR_ADDRUNI 0x00 |
| 47 | #define RSR_IVLDTYP 0x20 |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 48 | #define RSR_IVLDLEN 0x10 /* invalid len (> 2312 byte) */ |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 49 | #define RSR_BSSIDOK 0x08 |
| 50 | #define RSR_CRCOK 0x04 |
| 51 | #define RSR_BCNSSIDOK 0x02 |
| 52 | #define RSR_ADDROK 0x01 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 53 | |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 54 | /* Bits in the new RSR register */ |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 55 | #define NEWRSR_DECRYPTOK 0x10 |
| 56 | #define NEWRSR_CFPIND 0x08 |
| 57 | #define NEWRSR_HWUTSF 0x04 |
| 58 | #define NEWRSR_BCNHITAID 0x02 |
| 59 | #define NEWRSR_BCNHITAID0 0x01 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 60 | |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 61 | /* Bits in the TSR0 register */ |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 62 | #define TSR0_PWRSTS1_2 0xC0 |
| 63 | #define TSR0_PWRSTS7 0x20 |
| 64 | #define TSR0_NCR 0x1F |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 65 | |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 66 | /* Bits in the TSR1 register */ |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 67 | #define TSR1_TERR 0x80 |
| 68 | #define TSR1_PWRSTS4_6 0x70 |
| 69 | #define TSR1_RETRYTMO 0x08 |
| 70 | #define TSR1_TMO 0x04 |
| 71 | #define TSR1_PWRSTS3 0x02 |
| 72 | #define ACK_DATA 0x01 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 73 | |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 74 | /* Bits in the TCR register */ |
| 75 | #define EDMSDU 0x04 /* end of sdu */ |
| 76 | #define TCR_EDP 0x02 /* end of packet */ |
| 77 | #define TCR_STP 0x01 /* start of packet */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 78 | |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 79 | /* max transmit or receive buffer size */ |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 80 | #define CB_MAX_BUF_SIZE 2900U |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 81 | /* NOTE: must be multiple of 4 */ |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 82 | #define CB_MAX_TX_BUF_SIZE CB_MAX_BUF_SIZE |
| 83 | #define CB_MAX_RX_BUF_SIZE_NORMAL CB_MAX_BUF_SIZE |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 84 | |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 85 | #define CB_BEACON_BUF_SIZE 512U |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 86 | |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 87 | #define CB_MAX_RX_DESC 128 |
| 88 | #define CB_MIN_RX_DESC 16 |
| 89 | #define CB_MAX_TX_DESC 64 |
| 90 | #define CB_MIN_TX_DESC 16 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 91 | |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 92 | #define CB_MAX_RECEIVED_PACKETS 16 |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 93 | /* |
| 94 | * limit our receive routine to indicating |
| 95 | * this many at a time for 2 reasons: |
| 96 | * 1. driver flow control to protocol layer |
| 97 | * 2. limit the time used in ISR routine |
| 98 | */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 99 | |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 100 | #define CB_EXTRA_RD_NUM 32 |
| 101 | #define CB_RD_NUM 32 |
| 102 | #define CB_TD_NUM 32 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 103 | |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 104 | /* |
| 105 | * max number of physical segments in a single NDIS packet. Above this |
| 106 | * threshold, the packet is copied into a single physically contiguous buffer |
| 107 | */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 108 | #define CB_MAX_SEGMENT 4 |
| 109 | |
| 110 | #define CB_MIN_MAP_REG_NUM 4 |
| 111 | #define CB_MAX_MAP_REG_NUM CB_MAX_TX_DESC |
| 112 | |
| 113 | #define CB_PROTOCOL_RESERVED_SECTION 16 |
| 114 | |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 115 | /* |
| 116 | * if retrys excess 15 times , tx will abort, and if tx fifo underflow, |
| 117 | * tx will fail, we should try to resend it |
| 118 | */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 119 | #define CB_MAX_TX_ABORT_RETRY 3 |
| 120 | |
| 121 | #ifdef __BIG_ENDIAN |
| 122 | |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 123 | /* WMAC definition FIFO Control */ |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 124 | #define FIFOCTL_AUTO_FB_1 0x0010 |
| 125 | #define FIFOCTL_AUTO_FB_0 0x0008 |
| 126 | #define FIFOCTL_GRPACK 0x0004 |
| 127 | #define FIFOCTL_11GA 0x0003 |
| 128 | #define FIFOCTL_11GB 0x0002 |
| 129 | #define FIFOCTL_11B 0x0001 |
| 130 | #define FIFOCTL_11A 0x0000 |
| 131 | #define FIFOCTL_RTS 0x8000 |
| 132 | #define FIFOCTL_ISDMA0 0x4000 |
| 133 | #define FIFOCTL_GENINT 0x2000 |
| 134 | #define FIFOCTL_TMOEN 0x1000 |
| 135 | #define FIFOCTL_LRETRY 0x0800 |
| 136 | #define FIFOCTL_CRCDIS 0x0400 |
| 137 | #define FIFOCTL_NEEDACK 0x0200 |
| 138 | #define FIFOCTL_LHEAD 0x0100 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 139 | |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 140 | /* WMAC definition Frag Control */ |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 141 | #define FRAGCTL_AES 0x0003 |
| 142 | #define FRAGCTL_TKIP 0x0002 |
| 143 | #define FRAGCTL_LEGACY 0x0001 |
| 144 | #define FRAGCTL_NONENCRYPT 0x0000 |
| 145 | #define FRAGCTL_ENDFRAG 0x0300 |
| 146 | #define FRAGCTL_MIDFRAG 0x0200 |
| 147 | #define FRAGCTL_STAFRAG 0x0100 |
| 148 | #define FRAGCTL_NONFRAG 0x0000 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 149 | |
| 150 | #else |
| 151 | |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 152 | #define FIFOCTL_AUTO_FB_1 0x1000 |
| 153 | #define FIFOCTL_AUTO_FB_0 0x0800 |
| 154 | #define FIFOCTL_GRPACK 0x0400 |
| 155 | #define FIFOCTL_11GA 0x0300 |
| 156 | #define FIFOCTL_11GB 0x0200 |
| 157 | #define FIFOCTL_11B 0x0100 |
| 158 | #define FIFOCTL_11A 0x0000 |
| 159 | #define FIFOCTL_RTS 0x0080 |
| 160 | #define FIFOCTL_ISDMA0 0x0040 |
| 161 | #define FIFOCTL_GENINT 0x0020 |
| 162 | #define FIFOCTL_TMOEN 0x0010 |
| 163 | #define FIFOCTL_LRETRY 0x0008 |
| 164 | #define FIFOCTL_CRCDIS 0x0004 |
| 165 | #define FIFOCTL_NEEDACK 0x0002 |
| 166 | #define FIFOCTL_LHEAD 0x0001 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 167 | |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 168 | /* WMAC definition Frag Control */ |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 169 | #define FRAGCTL_AES 0x0300 |
| 170 | #define FRAGCTL_TKIP 0x0200 |
| 171 | #define FRAGCTL_LEGACY 0x0100 |
| 172 | #define FRAGCTL_NONENCRYPT 0x0000 |
| 173 | #define FRAGCTL_ENDFRAG 0x0003 |
| 174 | #define FRAGCTL_MIDFRAG 0x0002 |
| 175 | #define FRAGCTL_STAFRAG 0x0001 |
| 176 | #define FRAGCTL_NONFRAG 0x0000 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 177 | |
Igor Bezukh | 795a8f9 | 2014-07-25 19:05:31 +0300 | [diff] [blame] | 178 | #endif |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 179 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 180 | #define TYPE_TXDMA0 0 |
| 181 | #define TYPE_AC0DMA 1 |
| 182 | #define TYPE_ATIMDMA 2 |
| 183 | #define TYPE_SYNCDMA 3 |
| 184 | #define TYPE_MAXTD 2 |
| 185 | |
| 186 | #define TYPE_BEACONDMA 4 |
| 187 | |
| 188 | #define TYPE_RXDMA0 0 |
| 189 | #define TYPE_RXDMA1 1 |
| 190 | #define TYPE_MAXRD 2 |
| 191 | |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 192 | /* TD_INFO flags control bit */ |
| 193 | #define TD_FLAGS_NETIF_SKB 0x01 /* check if need release skb */ |
| 194 | #define TD_FLAGS_PRIV_SKB 0x02 /* check if called from private skb (hostap) */ |
| 195 | #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] | 196 | |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 197 | /* |
| 198 | * ref_sk_buff is used for mapping the skb structure between pre-built |
| 199 | * driver-obj & running kernel. Since different kernel version (2.4x) may |
| 200 | * change skb structure, i.e. pre-built driver-obj may link to older skb that |
| 201 | * leads error. |
| 202 | */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 203 | |
| 204 | typedef struct tagDEVICE_RD_INFO { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 205 | struct sk_buff *skb; |
| 206 | dma_addr_t skb_dma; |
| 207 | dma_addr_t curr_desc; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 208 | } DEVICE_RD_INFO, *PDEVICE_RD_INFO; |
| 209 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 210 | #ifdef __BIG_ENDIAN |
| 211 | |
| 212 | typedef struct tagRDES0 { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 213 | volatile unsigned short wResCount; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 214 | union { |
Charles Clément | c17ce8c | 2010-05-28 12:34:20 -0700 | [diff] [blame] | 215 | volatile u16 f15Reserved; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 216 | struct { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 217 | volatile u8 f8Reserved1; |
Charles Clément | 737c3d7 | 2010-05-28 12:34:19 -0700 | [diff] [blame] | 218 | volatile u8 f1Owner:1; |
| 219 | volatile u8 f7Reserved:7; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 220 | } __attribute__ ((__packed__)); |
| 221 | } __attribute__ ((__packed__)); |
| 222 | } __attribute__ ((__packed__)) |
| 223 | SRDES0, *PSRDES0; |
| 224 | |
| 225 | #else |
| 226 | |
| 227 | typedef struct tagRDES0 { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 228 | unsigned short wResCount; |
| 229 | unsigned short f15Reserved:15; |
| 230 | unsigned short f1Owner:1; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 231 | } __attribute__ ((__packed__)) |
| 232 | SRDES0; |
| 233 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 234 | #endif |
| 235 | |
| 236 | typedef struct tagRDES1 { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 237 | unsigned short wReqCount; |
| 238 | unsigned short wReserved; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 239 | } __attribute__ ((__packed__)) |
| 240 | SRDES1; |
| 241 | |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 242 | /* Rx descriptor*/ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 243 | typedef struct tagSRxDesc { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 244 | volatile SRDES0 m_rd0RD0; |
| 245 | volatile SRDES1 m_rd1RD1; |
| 246 | volatile u32 buff_addr; |
| 247 | volatile u32 next_desc; |
Malcolm Priestley | 829127b | 2014-03-06 22:44:21 +0000 | [diff] [blame] | 248 | struct tagSRxDesc *next __aligned(8); |
| 249 | volatile PDEVICE_RD_INFO pRDInfo __aligned(8); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 250 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 251 | SRxDesc, *PSRxDesc; |
| 252 | typedef const SRxDesc *PCSRxDesc; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 253 | |
| 254 | #ifdef __BIG_ENDIAN |
| 255 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 256 | typedef struct tagTDES0 { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 257 | volatile unsigned char byTSR0; |
| 258 | volatile unsigned char byTSR1; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 259 | union { |
Charles Clément | c17ce8c | 2010-05-28 12:34:20 -0700 | [diff] [blame] | 260 | volatile u16 f15Txtime; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 261 | struct { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 262 | volatile u8 f8Reserved1; |
Charles Clément | 737c3d7 | 2010-05-28 12:34:19 -0700 | [diff] [blame] | 263 | volatile u8 f1Owner:1; |
| 264 | volatile u8 f7Reserved:7; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 265 | } __attribute__ ((__packed__)); |
| 266 | } __attribute__ ((__packed__)); |
| 267 | } __attribute__ ((__packed__)) |
| 268 | STDES0, PSTDES0; |
| 269 | |
| 270 | #else |
| 271 | |
| 272 | typedef struct tagTDES0 { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 273 | volatile unsigned char byTSR0; |
| 274 | volatile unsigned char byTSR1; |
| 275 | volatile unsigned short f15Txtime:15; |
| 276 | volatile unsigned short f1Owner:1; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 277 | } __attribute__ ((__packed__)) |
| 278 | STDES0; |
| 279 | |
| 280 | #endif |
| 281 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 282 | typedef struct tagTDES1 { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 283 | volatile unsigned short wReqCount; |
| 284 | volatile unsigned char byTCR; |
| 285 | volatile unsigned char byReserved; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 286 | } __attribute__ ((__packed__)) |
| 287 | STDES1; |
| 288 | |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 289 | typedef struct tagDEVICE_TD_INFO { |
Malcolm Priestley | 01eec15 | 2014-10-29 17:43:38 +0000 | [diff] [blame^] | 290 | void *mic_hdr; |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 291 | struct sk_buff *skb; |
| 292 | unsigned char *buf; |
| 293 | dma_addr_t skb_dma; |
| 294 | dma_addr_t buf_dma; |
| 295 | dma_addr_t curr_desc; |
| 296 | unsigned long dwReqCount; |
| 297 | unsigned long dwHeaderLength; |
| 298 | unsigned char byFlags; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 299 | } DEVICE_TD_INFO, *PDEVICE_TD_INFO; |
| 300 | |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 301 | /* transmit descriptor */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 302 | typedef struct tagSTxDesc { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 303 | volatile STDES0 m_td0TD0; |
| 304 | volatile STDES1 m_td1TD1; |
| 305 | volatile u32 buff_addr; |
| 306 | volatile u32 next_desc; |
Malcolm Priestley | 829127b | 2014-03-06 22:44:21 +0000 | [diff] [blame] | 307 | struct tagSTxDesc *next __aligned(8); |
| 308 | volatile PDEVICE_TD_INFO pTDInfo __aligned(8); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 309 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 310 | STxDesc, *PSTxDesc; |
| 311 | typedef const STxDesc *PCSTxDesc; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 312 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 313 | typedef struct tagSTxSyncDesc { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 314 | volatile STDES0 m_td0TD0; |
| 315 | volatile STDES1 m_td1TD1; |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 316 | volatile u32 buff_addr; /* pointer to logical buffer */ |
| 317 | volatile u32 next_desc; /* pointer to next logical descriptor */ |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 318 | volatile unsigned short m_wFIFOCtl; |
| 319 | volatile unsigned short m_wTimeStamp; |
Malcolm Priestley | 829127b | 2014-03-06 22:44:21 +0000 | [diff] [blame] | 320 | struct tagSTxSyncDesc *next __aligned(8); |
| 321 | volatile PDEVICE_TD_INFO pTDInfo __aligned(8); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 322 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 323 | STxSyncDesc, *PSTxSyncDesc; |
| 324 | typedef const STxSyncDesc *PCSTxSyncDesc; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 325 | |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 326 | /* RsvTime buffer header */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 327 | typedef struct tagSRrvTime_atim { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 328 | unsigned short wCTSTxRrvTime_ba; |
| 329 | unsigned short wTxRrvTime_a; |
| 330 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 331 | SRrvTime_atim, *PSRrvTime_atim; |
| 332 | typedef const SRrvTime_atim *PCSRrvTime_atim; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 333 | |
Malcolm Priestley | edbae99 | 2014-08-20 22:30:27 +0100 | [diff] [blame] | 334 | /* Length, Service, and Signal fields of Phy for Tx */ |
| 335 | struct vnt_phy_field { |
| 336 | u8 signal; |
| 337 | u8 service; |
| 338 | __le16 len; |
| 339 | } __packed; |
| 340 | |
Malcolm Priestley | 864a5a3 | 2014-08-20 22:30:30 +0100 | [diff] [blame] | 341 | union vnt_phy_field_swap { |
| 342 | struct vnt_phy_field field_read; |
| 343 | u16 swap[2]; |
| 344 | u32 field_write; |
| 345 | }; |
| 346 | |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 347 | /* Tx FIFO header */ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 348 | typedef struct tagSTxBufHead { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 349 | u32 adwTxKey[4]; |
| 350 | unsigned short wFIFOCtl; |
| 351 | unsigned short wTimeStamp; |
| 352 | unsigned short wFragCtl; |
| 353 | unsigned char byTxPower; |
| 354 | unsigned char wReserved; |
| 355 | } __attribute__ ((__packed__)) |
Jim Lieb | a884847 | 2009-08-12 14:54:07 -0700 | [diff] [blame] | 356 | STxBufHead, *PSTxBufHead; |
| 357 | typedef const STxBufHead *PCSTxBufHead; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 358 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 359 | typedef struct tagSBEACONCtl { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 360 | u32 BufReady:1; |
| 361 | u32 TSF:15; |
| 362 | u32 BufLen:11; |
| 363 | u32 Reserved:5; |
| 364 | } __attribute__ ((__packed__)) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 365 | SBEACONCtl; |
| 366 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 367 | typedef struct tagSSecretKey { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 368 | u32 dwLowDword; |
| 369 | unsigned char byHighByte; |
| 370 | } __attribute__ ((__packed__)) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 371 | SSecretKey; |
| 372 | |
| 373 | typedef struct tagSKeyEntry { |
Joe Perches | 78a717d | 2013-03-18 10:44:44 -0700 | [diff] [blame] | 374 | unsigned char abyAddrHi[2]; |
| 375 | unsigned short wKCTL; |
| 376 | unsigned char abyAddrLo[4]; |
| 377 | u32 dwKey0[4]; |
| 378 | u32 dwKey1[4]; |
| 379 | u32 dwKey2[4]; |
| 380 | u32 dwKey3[4]; |
| 381 | u32 dwKey4[4]; |
| 382 | } __attribute__ ((__packed__)) |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 383 | SKeyEntry; |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 384 | |
Veronika Kabatova | b69c0bf | 2014-10-25 23:08:50 +0200 | [diff] [blame] | 385 | #endif /* __DESC_H__ */ |