Merge tag 'char-misc-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregk...
[linux-2.6-microblaze.git] / drivers / staging / vt6656 / rxtx.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
4  * All rights reserved.
5  *
6  * File: rxtx.h
7  *
8  * Purpose:
9  *
10  * Author: Jerry Chen
11  *
12  * Date: Jun. 27, 2002
13  *
14  */
15
16 #ifndef __RXTX_H__
17 #define __RXTX_H__
18
19 #include "device.h"
20 #include "wcmd.h"
21 #include "baseband.h"
22
23 #define DEFAULT_MGN_LIFETIME_RES_64us   125  /* 64us */
24 #define DEFAULT_MSDU_LIFETIME_RES_64us  8000
25
26 /* Length, Service, and Signal fields of Phy for Tx */
27 struct vnt_phy_field {
28         u8 signal;
29         u8 service;
30         __le16 len;
31 } __packed;
32
33 /* MIC HDR data header */
34 struct vnt_mic_hdr {
35         u8 id;
36         u8 tx_priority;
37         u8 mic_addr2[6];
38         u8 ccmp_pn[IEEE80211_CCMP_PN_LEN];
39         __be16 payload_len;
40         __be16 hlen;
41         __le16 frame_control;
42         u8 addr1[6];
43         u8 addr2[6];
44         u8 addr3[6];
45         __le16 seq_ctrl;
46         u8 addr4[6];
47         u16 packing; /* packing to 48 bytes */
48 } __packed;
49
50 /* RsvTime buffer header */
51 struct vnt_rrv_time_rts {
52         __le16 rts_rrv_time_ba;
53         __le16 rts_rrv_time_aa;
54         __le16 rts_rrv_time_bb;
55         u16 wReserved;
56         __le16 rrv_time_b;
57         __le16 rrv_time_a;
58 } __packed;
59
60 struct vnt_rrv_time_cts {
61         __le16 cts_rrv_time_ba;
62         u16 wReserved;
63         __le16 rrv_time_b;
64         __le16 rrv_time_a;
65 } __packed;
66
67 struct vnt_rrv_time_ab {
68         __le16 rts_rrv_time;
69         __le16 rrv_time;
70 } __packed;
71
72 /* TX data header */
73 struct vnt_tx_datahead_g {
74         struct vnt_phy_field b;
75         struct vnt_phy_field a;
76         __le16 duration_b;
77         __le16 duration_a;
78         __le16 time_stamp_off_b;
79         __le16 time_stamp_off_a;
80 } __packed;
81
82 struct vnt_tx_datahead_ab {
83         struct vnt_phy_field ab;
84         __le16 duration;
85         __le16 time_stamp_off;
86 } __packed;
87
88 /* RTS buffer header */
89 struct vnt_rts_g {
90         struct vnt_phy_field b;
91         struct vnt_phy_field a;
92         __le16 duration_ba;
93         __le16 duration_aa;
94         __le16 duration_bb;
95         u16 wReserved;
96         struct ieee80211_rts data;
97         struct vnt_tx_datahead_g data_head;
98 } __packed __aligned(2);
99
100 struct vnt_rts_ab {
101         struct vnt_phy_field ab;
102         __le16 duration;
103         u16 wReserved;
104         struct ieee80211_rts data;
105         struct vnt_tx_datahead_ab data_head;
106 } __packed __aligned(2);
107
108 /* CTS buffer header */
109 struct vnt_cts {
110         struct vnt_phy_field b;
111         __le16 duration_ba;
112         u16 wReserved;
113         struct ieee80211_cts data;
114         u16 reserved2;
115         struct vnt_tx_datahead_g data_head;
116 } __packed __aligned(2);
117
118 union vnt_tx_data_head {
119         /* rts g */
120         struct vnt_rts_g rts_g;
121         /* rts a/b */
122         struct vnt_rts_ab rts_ab;
123         /* cts g */
124         struct vnt_cts cts_g;
125         /* no rts/cts */
126         struct vnt_tx_datahead_ab data_head_ab;
127 };
128
129 struct vnt_tx_mic_hdr {
130         struct vnt_mic_hdr hdr;
131         union vnt_tx_data_head head;
132 } __packed;
133
134 union vnt_tx {
135         struct vnt_tx_mic_hdr mic;
136         union vnt_tx_data_head head;
137 };
138
139 union vnt_tx_head {
140         struct {
141                 struct vnt_rrv_time_rts rts;
142                 union vnt_tx tx;
143         } __packed tx_rts;
144         struct {
145                 struct vnt_rrv_time_cts cts;
146                 union vnt_tx tx;
147         } __packed tx_cts;
148         struct {
149                 struct vnt_rrv_time_ab ab;
150                 union vnt_tx tx;
151         } __packed tx_ab;
152 };
153
154 struct vnt_tx_fifo_head {
155         u8 tx_key[WLAN_KEY_LEN_CCMP];
156         __le16 fifo_ctl;
157         __le16 time_stamp;
158         __le16 frag_ctl;
159         __le16 current_rate;
160 } __packed;
161
162 struct vnt_tx_buffer {
163         struct vnt_tx_fifo_head fifo_head;
164         union vnt_tx_head tx_head;
165 } __packed;
166
167 struct vnt_tx_short_buf_head {
168         __le16 fifo_ctl;
169         u16 time_stamp;
170         struct vnt_phy_field ab;
171         __le16 duration;
172         __le16 time_stamp_off;
173 } __packed;
174
175 int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb);
176 int vnt_beacon_make(struct vnt_private *priv, struct ieee80211_vif *vif);
177 int vnt_beacon_enable(struct vnt_private *priv, struct ieee80211_vif *vif,
178                       struct ieee80211_bss_conf *conf);
179
180 #endif /* __RXTX_H__ */