desc.h 20 KB

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