GNU Linux-libre 4.14.290-gnu1
[releases.git] / drivers / staging / vt6655 / rxtx.h
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  * File: rxtx.h
16  *
17  * Purpose:
18  *
19  * Author: Jerry Chen
20  *
21  * Date: Jun. 27, 2002
22  *
23  */
24
25 #ifndef __RXTX_H__
26 #define __RXTX_H__
27
28 #include "device.h"
29
30 #define DEFAULT_MSDU_LIFETIME_RES_64us  8000 /* 64us */
31 #define DEFAULT_MGN_LIFETIME_RES_64us   125  /* 64us */
32
33
34 /*---------------------  Export Definitions -------------------------*/
35
36 /*---------------------  Export Variables  --------------------------*/
37
38 /*---------------------  Export Functions  --------------------------*/
39
40 /* MIC HDR data header */
41 struct vnt_mic_hdr {
42         u8 id;
43         u8 tx_priority;
44         u8 mic_addr2[ETH_ALEN];
45         u8 ccmp_pn[IEEE80211_CCMP_PN_LEN];
46         __be16 payload_len;
47         __be16 hlen;
48         __le16 frame_control;
49         u8 addr1[ETH_ALEN];
50         u8 addr2[ETH_ALEN];
51         u8 addr3[ETH_ALEN];
52         __le16 seq_ctrl;
53         u8 addr4[ETH_ALEN];
54         u16 packing; /* packing to 48 bytes */
55 } __packed;
56
57 /* RsvTime buffer header */
58 struct vnt_rrv_time_rts {
59         __le16 rts_rrv_time_ba;
60         __le16 rts_rrv_time_aa;
61         __le16 rts_rrv_time_bb;
62         u16 reserved;
63         __le16 rrv_time_b;
64         __le16 rrv_time_a;
65 } __packed;
66
67 struct vnt_rrv_time_cts {
68         __le16 cts_rrv_time_ba;
69         u16 reserved;
70         __le16 rrv_time_b;
71         __le16 rrv_time_a;
72 } __packed;
73
74 struct vnt_rrv_time_ab {
75         __le16 rts_rrv_time;
76         __le16 rrv_time;
77 } __packed;
78
79 /* TX data header */
80 struct vnt_tx_datahead_g {
81         struct vnt_phy_field b;
82         struct vnt_phy_field a;
83         __le16 duration_b;
84         __le16 duration_a;
85         __le16 time_stamp_off_b;
86         __le16 time_stamp_off_a;
87 } __packed;
88
89 struct vnt_tx_datahead_g_fb {
90         struct vnt_phy_field b;
91         struct vnt_phy_field a;
92         __le16 duration_b;
93         __le16 duration_a;
94         __le16 duration_a_f0;
95         __le16 duration_a_f1;
96         __le16 time_stamp_off_b;
97         __le16 time_stamp_off_a;
98 } __packed;
99
100 struct vnt_tx_datahead_ab {
101         struct vnt_phy_field ab;
102         __le16 duration;
103         __le16 time_stamp_off;
104 } __packed;
105
106 struct vnt_tx_datahead_a_fb {
107         struct vnt_phy_field a;
108         __le16 duration;
109         __le16 time_stamp_off;
110         __le16 duration_f0;
111         __le16 duration_f1;
112 } __packed;
113
114 /* RTS buffer header */
115 struct vnt_rts_g {
116         struct vnt_phy_field b;
117         struct vnt_phy_field a;
118         __le16 duration_ba;
119         __le16 duration_aa;
120         __le16 duration_bb;
121         u16 reserved;
122         struct ieee80211_rts data;
123 } __packed;
124
125 struct vnt_rts_g_fb {
126         struct vnt_phy_field b;
127         struct vnt_phy_field a;
128         __le16 duration_ba;
129         __le16 duration_aa;
130         __le16 duration_bb;
131         u16 wReserved;
132         __le16 rts_duration_ba_f0;
133         __le16 rts_duration_aa_f0;
134         __le16 rts_duration_ba_f1;
135         __le16 rts_duration_aa_f1;
136         struct ieee80211_rts data;
137 } __packed;
138
139 struct vnt_rts_ab {
140         struct vnt_phy_field ab;
141         __le16 duration;
142         u16 reserved;
143         struct ieee80211_rts data;
144 } __packed;
145
146 struct vnt_rts_a_fb {
147         struct vnt_phy_field a;
148         __le16 duration;
149         u16 reserved;
150         __le16 rts_duration_f0;
151         __le16 rts_duration_f1;
152         struct ieee80211_rts data;
153 } __packed;
154
155 /* CTS buffer header */
156 struct vnt_cts {
157         struct vnt_phy_field b;
158         __le16 duration_ba;
159         u16 reserved;
160         struct ieee80211_cts data;
161         u16 reserved2;
162 } __packed;
163
164 struct vnt_cts_fb {
165         struct vnt_phy_field b;
166         __le16 duration_ba;
167         u16 reserved;
168         __le16 cts_duration_ba_f0;
169         __le16 cts_duration_ba_f1;
170         struct ieee80211_cts data;
171         u16 reserved2;
172 } __packed;
173
174 struct vnt_tx_fifo_head {
175         u8 tx_key[WLAN_KEY_LEN_CCMP];
176         __le16 fifo_ctl;
177         __le16 time_stamp;
178         __le16 frag_ctl;
179         __le16 current_rate;
180 } __packed;
181
182 struct vnt_tx_short_buf_head {
183         __le16 fifo_ctl;
184         u16 time_stamp;
185         struct vnt_phy_field ab;
186         __le16 duration;
187         __le16 time_stamp_off;
188 } __packed;
189
190 int vnt_generate_fifo_header(struct vnt_private *priv, u32 dma_idx,
191                              struct vnt_tx_desc *head_td, struct sk_buff *skb);
192 int vnt_beacon_make(struct vnt_private *priv, struct ieee80211_vif *vif);
193 int vnt_beacon_enable(struct vnt_private *priv, struct ieee80211_vif *vif,
194                       struct ieee80211_bss_conf *conf);
195
196 #endif /* __RXTX_H__ */