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 | * | |
92b96797 FB |
15 | * |
16 | * File: rxtx.h | |
17 | * | |
18 | * Purpose: | |
19 | * | |
20 | * Author: Jerry Chen | |
21 | * | |
22 | * Date: Jun. 27, 2002 | |
23 | * | |
24 | */ | |
25 | ||
92b96797 FB |
26 | #ifndef __RXTX_H__ |
27 | #define __RXTX_H__ | |
28 | ||
92b96797 | 29 | #include "device.h" |
92b96797 | 30 | #include "wcmd.h" |
aed387c7 | 31 | #include "baseband.h" |
92b96797 | 32 | |
93a1e1b0 MP |
33 | #define DEFAULT_MGN_LIFETIME_RES_64us 125 /* 64us */ |
34 | #define DEFAULT_MSDU_LIFETIME_RES_64us 8000 | |
35 | ||
5a5d6a80 MP |
36 | /* MIC HDR data header */ |
37 | struct vnt_mic_hdr { | |
38 | u8 id; | |
39 | u8 tx_priority; | |
40 | u8 mic_addr2[6]; | |
79f976dc | 41 | u8 ccmp_pn[IEEE80211_CCMP_PN_LEN]; |
5a5d6a80 MP |
42 | __be16 payload_len; |
43 | __be16 hlen; | |
44 | __le16 frame_control; | |
45 | u8 addr1[6]; | |
46 | u8 addr2[6]; | |
47 | u8 addr3[6]; | |
48 | __le16 seq_ctrl; | |
49 | u8 addr4[6]; | |
50 | u16 packing; /* packing to 48 bytes */ | |
51 | } __packed; | |
52 | ||
6398a59b MP |
53 | /* RsvTime buffer header */ |
54 | struct vnt_rrv_time_rts { | |
85417bf0 MP |
55 | __le16 rts_rrv_time_ba; |
56 | __le16 rts_rrv_time_aa; | |
57 | __le16 rts_rrv_time_bb; | |
6398a59b | 58 | u16 wReserved; |
5ff627ae MP |
59 | __le16 rrv_time_b; |
60 | __le16 rrv_time_a; | |
6398a59b MP |
61 | } __packed; |
62 | ||
4f990057 | 63 | struct vnt_rrv_time_cts { |
372108e7 | 64 | __le16 cts_rrv_time_ba; |
4f990057 | 65 | u16 wReserved; |
5ff627ae MP |
66 | __le16 rrv_time_b; |
67 | __le16 rrv_time_a; | |
4f990057 MP |
68 | } __packed; |
69 | ||
976467d3 | 70 | struct vnt_rrv_time_ab { |
85417bf0 | 71 | __le16 rts_rrv_time; |
5ff627ae | 72 | __le16 rrv_time; |
976467d3 MP |
73 | } __packed; |
74 | ||
7e60a3de MP |
75 | /* TX data header */ |
76 | struct vnt_tx_datahead_g { | |
aed387c7 MP |
77 | struct vnt_phy_field b; |
78 | struct vnt_phy_field a; | |
4e01117c MP |
79 | __le16 duration_b; |
80 | __le16 duration_a; | |
10bb39a0 MP |
81 | __le16 time_stamp_off_b; |
82 | __le16 time_stamp_off_a; | |
1622c8fc | 83 | struct ieee80211_hdr hdr; |
7e60a3de MP |
84 | } __packed; |
85 | ||
7c05c545 | 86 | struct vnt_tx_datahead_g_fb { |
aed387c7 MP |
87 | struct vnt_phy_field b; |
88 | struct vnt_phy_field a; | |
4e01117c MP |
89 | __le16 duration_b; |
90 | __le16 duration_a; | |
91 | __le16 duration_a_f0; | |
92 | __le16 duration_a_f1; | |
10bb39a0 MP |
93 | __le16 time_stamp_off_b; |
94 | __le16 time_stamp_off_a; | |
1622c8fc | 95 | struct ieee80211_hdr hdr; |
7c05c545 MP |
96 | } __packed; |
97 | ||
558becf1 | 98 | struct vnt_tx_datahead_ab { |
aed387c7 | 99 | struct vnt_phy_field ab; |
4e01117c | 100 | __le16 duration; |
10bb39a0 | 101 | __le16 time_stamp_off; |
1622c8fc | 102 | struct ieee80211_hdr hdr; |
558becf1 MP |
103 | } __packed; |
104 | ||
1da4ee20 | 105 | struct vnt_tx_datahead_a_fb { |
aed387c7 | 106 | struct vnt_phy_field a; |
4e01117c | 107 | __le16 duration; |
10bb39a0 | 108 | __le16 time_stamp_off; |
4e01117c MP |
109 | __le16 duration_f0; |
110 | __le16 duration_f1; | |
1622c8fc | 111 | struct ieee80211_hdr hdr; |
1da4ee20 MP |
112 | } __packed; |
113 | ||
c521cb58 MP |
114 | /* RTS buffer header */ |
115 | struct vnt_rts_g { | |
aed387c7 MP |
116 | struct vnt_phy_field b; |
117 | struct vnt_phy_field a; | |
4e01117c MP |
118 | __le16 duration_ba; |
119 | __le16 duration_aa; | |
120 | __le16 duration_bb; | |
c521cb58 MP |
121 | u16 wReserved; |
122 | struct ieee80211_rts data; | |
78363fd1 | 123 | struct vnt_tx_datahead_g data_head; |
c521cb58 MP |
124 | } __packed; |
125 | ||
126 | struct vnt_rts_g_fb { | |
aed387c7 MP |
127 | struct vnt_phy_field b; |
128 | struct vnt_phy_field a; | |
4e01117c MP |
129 | __le16 duration_ba; |
130 | __le16 duration_aa; | |
131 | __le16 duration_bb; | |
c521cb58 | 132 | u16 wReserved; |
fadc3bdf MP |
133 | __le16 rts_duration_ba_f0; |
134 | __le16 rts_duration_aa_f0; | |
135 | __le16 rts_duration_ba_f1; | |
136 | __le16 rts_duration_aa_f1; | |
c521cb58 | 137 | struct ieee80211_rts data; |
5b852f53 | 138 | struct vnt_tx_datahead_g_fb data_head; |
c521cb58 MP |
139 | } __packed; |
140 | ||
141 | struct vnt_rts_ab { | |
aed387c7 | 142 | struct vnt_phy_field ab; |
4e01117c | 143 | __le16 duration; |
c521cb58 MP |
144 | u16 wReserved; |
145 | struct ieee80211_rts data; | |
5634a5ab | 146 | struct vnt_tx_datahead_ab data_head; |
c521cb58 MP |
147 | } __packed; |
148 | ||
149 | struct vnt_rts_a_fb { | |
aed387c7 | 150 | struct vnt_phy_field a; |
4e01117c | 151 | __le16 duration; |
c521cb58 | 152 | u16 wReserved; |
fadc3bdf MP |
153 | __le16 rts_duration_f0; |
154 | __le16 rts_duration_f1; | |
c521cb58 | 155 | struct ieee80211_rts data; |
bd3f51f1 | 156 | struct vnt_tx_datahead_a_fb data_head; |
c521cb58 MP |
157 | } __packed; |
158 | ||
f0c5ba28 MP |
159 | /* CTS buffer header */ |
160 | struct vnt_cts { | |
aed387c7 | 161 | struct vnt_phy_field b; |
4e01117c | 162 | __le16 duration_ba; |
f0c5ba28 MP |
163 | u16 wReserved; |
164 | struct ieee80211_cts data; | |
165 | u16 reserved2; | |
78363fd1 | 166 | struct vnt_tx_datahead_g data_head; |
f0c5ba28 MP |
167 | } __packed; |
168 | ||
169 | struct vnt_cts_fb { | |
aed387c7 | 170 | struct vnt_phy_field b; |
4e01117c | 171 | __le16 duration_ba; |
f0c5ba28 | 172 | u16 wReserved; |
7fd5747f MP |
173 | __le16 cts_duration_ba_f0; |
174 | __le16 cts_duration_ba_f1; | |
f0c5ba28 MP |
175 | struct ieee80211_cts data; |
176 | u16 reserved2; | |
5b852f53 | 177 | struct vnt_tx_datahead_g_fb data_head; |
f0c5ba28 MP |
178 | } __packed; |
179 | ||
13fe62ae MP |
180 | union vnt_tx_data_head { |
181 | /* rts g */ | |
182 | struct vnt_rts_g rts_g; | |
183 | struct vnt_rts_g_fb rts_g_fb; | |
184 | /* rts a/b */ | |
185 | struct vnt_rts_ab rts_ab; | |
186 | struct vnt_rts_a_fb rts_a_fb; | |
187 | /* cts g */ | |
188 | struct vnt_cts cts_g; | |
189 | struct vnt_cts_fb cts_g_fb; | |
a90186e4 MP |
190 | /* no rts/cts */ |
191 | struct vnt_tx_datahead_a_fb data_head_a_fb; | |
c12dca09 | 192 | struct vnt_tx_datahead_ab data_head_ab; |
13fe62ae MP |
193 | }; |
194 | ||
56c60e4f MP |
195 | struct vnt_tx_mic_hdr { |
196 | struct vnt_mic_hdr hdr; | |
197 | union vnt_tx_data_head head; | |
198 | } __packed; | |
199 | ||
200 | union vnt_tx { | |
201 | struct vnt_tx_mic_hdr mic; | |
202 | union vnt_tx_data_head head; | |
203 | }; | |
204 | ||
9e38a5c1 | 205 | union vnt_tx_head { |
56c60e4f MP |
206 | struct { |
207 | struct vnt_rrv_time_rts rts; | |
208 | union vnt_tx tx; | |
209 | } __packed tx_rts; | |
210 | struct { | |
211 | struct vnt_rrv_time_cts cts; | |
212 | union vnt_tx tx; | |
213 | } __packed tx_cts; | |
214 | struct { | |
215 | struct vnt_rrv_time_ab ab; | |
216 | union vnt_tx tx; | |
217 | } __packed tx_ab; | |
9e38a5c1 MP |
218 | }; |
219 | ||
d66caada | 220 | struct vnt_tx_fifo_head { |
ab51f51b | 221 | u8 tx_key[WLAN_KEY_LEN_CCMP]; |
47e08894 | 222 | __le16 fifo_ctl; |
5846251d | 223 | __le16 time_stamp; |
5deb1cfa | 224 | __le16 frag_ctl; |
03a9cf34 | 225 | __le16 current_rate; |
f39c0d8e | 226 | } __packed; |
92b96797 | 227 | |
d66caada | 228 | struct vnt_tx_buffer { |
c8a3a4c0 | 229 | u8 type; |
d0335a03 | 230 | u8 pkt_no; |
ca347596 | 231 | __le16 tx_byte_count; |
d66caada | 232 | struct vnt_tx_fifo_head fifo_head; |
9e38a5c1 | 233 | union vnt_tx_head tx_head; |
d66caada MP |
234 | } __packed; |
235 | ||
c7c57b24 | 236 | struct vnt_tx_short_buf_head { |
14fb6ce8 | 237 | __le16 fifo_ctl; |
c7c57b24 MP |
238 | u16 time_stamp; |
239 | struct vnt_phy_field ab; | |
533f9d3a MP |
240 | __le16 duration; |
241 | __le16 time_stamp_off; | |
c7c57b24 MP |
242 | } __packed; |
243 | ||
01f865ba | 244 | struct vnt_beacon_buffer { |
1e00b449 | 245 | u8 type; |
af90ab39 | 246 | u8 pkt_no; |
fad8e4ae | 247 | __le16 tx_byte_count; |
c7c57b24 | 248 | struct vnt_tx_short_buf_head short_head; |
d38b13aa | 249 | struct ieee80211_mgmt mgmt_hdr; |
01f865ba | 250 | } __packed; |
92b96797 | 251 | |
d38b13aa MP |
252 | int vnt_tx_packet(struct vnt_private *, struct sk_buff *); |
253 | int vnt_beacon_make(struct vnt_private *, struct ieee80211_vif *); | |
254 | int vnt_beacon_enable(struct vnt_private *, struct ieee80211_vif *, | |
255 | struct ieee80211_bss_conf *); | |
256 | ||
e7b07d1d | 257 | #endif /* __RXTX_H__ */ |