Commit | Line | Data |
---|---|---|
92b96797 FB |
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 | * | |
20 | * File: rndis.h | |
21 | * | |
22 | * Purpose: Interface between firmware and driver | |
23 | * | |
24 | * Author: Warren Hsu | |
25 | * | |
26 | * Date: Nov 24, 2004 | |
27 | * | |
28 | */ | |
29 | ||
92b96797 FB |
30 | #ifndef __RNDIS_H__ |
31 | #define __RNDIS_H__ | |
32 | ||
92b96797 FB |
33 | #define MESSAGE_TYPE_READ 0x01 |
34 | #define MESSAGE_TYPE_WRITE 0x00 | |
35 | #define MESSAGE_TYPE_LOCK_OR 0x02 | |
36 | #define MESSAGE_TYPE_LOCK_AND 0x03 | |
37 | #define MESSAGE_TYPE_WRITE_MASK 0x04 | |
38 | #define MESSAGE_TYPE_CARDINIT 0x05 | |
39 | #define MESSAGE_TYPE_INIT_RSP 0x06 | |
40 | #define MESSAGE_TYPE_MACSHUTDOWN 0x07 | |
41 | #define MESSAGE_TYPE_SETKEY 0x08 | |
42 | #define MESSAGE_TYPE_CLRKEYENTRY 0x09 | |
43 | #define MESSAGE_TYPE_WRITE_MISCFF 0x0A | |
44 | #define MESSAGE_TYPE_SET_ANTMD 0x0B | |
45 | #define MESSAGE_TYPE_SELECT_CHANNLE 0x0C | |
46 | #define MESSAGE_TYPE_SET_TSFTBTT 0x0D | |
47 | #define MESSAGE_TYPE_SET_SSTIFS 0x0E | |
48 | #define MESSAGE_TYPE_CHANGE_BBTYPE 0x0F | |
49 | #define MESSAGE_TYPE_DISABLE_PS 0x10 | |
50 | #define MESSAGE_TYPE_WRITE_IFRF 0x11 | |
51 | ||
52 | //used for read/write(index) | |
53 | #define MESSAGE_REQUEST_MEM 0x01 | |
54 | #define MESSAGE_REQUEST_BBREG 0x02 | |
55 | #define MESSAGE_REQUEST_MACREG 0x03 | |
56 | #define MESSAGE_REQUEST_EEPROM 0x04 | |
57 | #define MESSAGE_REQUEST_TSF 0x05 | |
58 | #define MESSAGE_REQUEST_TBTT 0x06 | |
59 | #define MESSAGE_REQUEST_BBAGC 0x07 | |
60 | #define MESSAGE_REQUEST_VERSION 0x08 | |
61 | #define MESSAGE_REQUEST_RF_INIT 0x09 | |
62 | #define MESSAGE_REQUEST_RF_INIT2 0x0A | |
63 | #define MESSAGE_REQUEST_RF_CH0 0x0B | |
64 | #define MESSAGE_REQUEST_RF_CH1 0x0C | |
65 | #define MESSAGE_REQUEST_RF_CH2 0x0D | |
66 | ||
92b96797 FB |
67 | #define VIAUSB20_PACKET_HEADER 0x04 |
68 | ||
92b96797 FB |
69 | typedef struct _CMD_MESSAGE |
70 | { | |
b902fbfe | 71 | u8 byData[256]; |
92b96797 FB |
72 | } CMD_MESSAGE, *PCMD_MESSAGE; |
73 | ||
74 | typedef struct _CMD_WRITE_MASK | |
75 | { | |
b902fbfe AM |
76 | u8 byData; |
77 | u8 byMask; | |
92b96797 FB |
78 | } CMD_WRITE_MASK, *PCMD_WRITE_MASK; |
79 | ||
80 | typedef struct _CMD_CARD_INIT | |
81 | { | |
b902fbfe AM |
82 | u8 byInitClass; |
83 | u8 bExistSWNetAddr; | |
84 | u8 bySWNetAddr[6]; | |
85 | u8 byShortRetryLimit; | |
86 | u8 byLongRetryLimit; | |
92b96797 FB |
87 | } CMD_CARD_INIT, *PCMD_CARD_INIT; |
88 | ||
89 | typedef struct _RSP_CARD_INIT | |
90 | { | |
b902fbfe AM |
91 | u8 byStatus; |
92 | u8 byNetAddr[6]; | |
93 | u8 byRFType; | |
94 | u8 byMinChannel; | |
95 | u8 byMaxChannel; | |
92b96797 FB |
96 | } RSP_CARD_INIT, *PRSP_CARD_INIT; |
97 | ||
98 | typedef struct _CMD_SET_KEY | |
99 | { | |
3eaca0d2 | 100 | u16 wKCTL; |
b902fbfe AM |
101 | u8 abyMacAddr[6]; |
102 | u8 abyKey[16]; | |
92b96797 FB |
103 | } CMD_SET_KEY, *PCMD_SET_KEY; |
104 | ||
105 | typedef struct _CMD_CLRKEY_ENTRY | |
106 | { | |
b902fbfe | 107 | u8 abyKeyEntry[11]; |
92b96797 FB |
108 | } CMD_CLRKEY_ENTRY, *PCMD_CLRKEY_ENTRY; |
109 | ||
110 | typedef struct _CMD_WRITE_MISCFF | |
111 | { | |
52a7e64b | 112 | u32 adwMiscFFData[22][4]; //a key entry has only 22 dwords |
92b96797 FB |
113 | } CMD_WRITE_MISCFF, *PCMD_WRITE_MISCFF; |
114 | ||
115 | typedef struct _CMD_SET_TSFTBTT | |
116 | { | |
b902fbfe | 117 | u8 abyTSF_TBTT[8]; |
92b96797 FB |
118 | } CMD_SET_TSFTBTT, *PCMD_SET_TSFTBTT; |
119 | ||
120 | typedef struct _CMD_SET_SSTIFS | |
121 | { | |
b902fbfe AM |
122 | u8 bySIFS; |
123 | u8 byDIFS; | |
124 | u8 byEIFS; | |
125 | u8 bySlotTime; | |
126 | u8 byCwMax_Min; | |
127 | u8 byBBCR10; | |
92b96797 FB |
128 | } CMD_SET_SSTIFS, *PCMD_SET_SSTIFS; |
129 | ||
130 | typedef struct _CMD_CHANGE_BBTYPE | |
131 | { | |
b902fbfe AM |
132 | u8 bySIFS; |
133 | u8 byDIFS; | |
134 | u8 byEIFS; | |
135 | u8 bySlotTime; | |
136 | u8 byCwMax_Min; | |
137 | u8 byBBCR10; | |
138 | u8 byBB_BBType; //CR88 | |
139 | u8 byMAC_BBType; | |
52a7e64b AM |
140 | u32 dwRSPINF_b_1; |
141 | u32 dwRSPINF_b_2; | |
142 | u32 dwRSPINF_b_55; | |
143 | u32 dwRSPINF_b_11; | |
3eaca0d2 | 144 | u16 wRSPINF_a[9]; |
92b96797 FB |
145 | } CMD_CHANGE_BBTYPE, *PCMD_CHANGE_BBTYPE; |
146 | ||
3eaca0d2 | 147 | #define EXCH_WORD(w) ((u16)((u16)(w)<<8) | (u16)((u16)(w)>>8)) |
92b96797 | 148 | |
e7b07d1d | 149 | #endif /* _RNDIS_H_ */ |