hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/drivers/staging/vt6656/device.h
....@@ -1,4 +1,4 @@
1
-// SPDX-License-Identifier: GPL-2.0+
1
+/* SPDX-License-Identifier: GPL-2.0+ */
22 /*
33 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
44 * All rights reserved.
....@@ -16,6 +16,7 @@
1616 #ifndef __DEVICE_H__
1717 #define __DEVICE_H__
1818
19
+#include <linux/bits.h>
1920 #include <linux/module.h>
2021 #include <linux/kernel.h>
2122 #include <linux/slab.h>
....@@ -71,6 +72,10 @@
7172 #define DEVICE_FULL_DRV_NAM "VIA Networking Wireless LAN USB Driver"
7273
7374 #define DEVICE_VERSION "mac80211"
75
+
76
+#define FIRMWARE_VERSION 0x133 /* version 1.51 */
77
+#define FIRMWARE_NAME "vntwusb.fw"
78
+#define FIRMWARE_CHUNK_SIZE 0x400
7479
7580 #define CONFIG_PATH "/etc/vntconfiguration.dat"
7681
....@@ -129,12 +134,12 @@
129134 #define EEP_OFS_OFDMA_PWR_TBL 0x50
130135
131136 /* Bits in EEP_OFS_ANTENNA */
132
-#define EEP_ANTENNA_MAIN 0x1
133
-#define EEP_ANTENNA_AUX 0x2
134
-#define EEP_ANTINV 0x4
137
+#define EEP_ANTENNA_MAIN BIT(0)
138
+#define EEP_ANTENNA_AUX BIT(1)
139
+#define EEP_ANTINV BIT(2)
135140
136141 /* Bits in EEP_OFS_RADIOCTL */
137
-#define EEP_RADIOCTL_ENABLE 0x80
142
+#define EEP_RADIOCTL_ENABLE BIT(7)
138143
139144 /* control commands */
140145 #define MESSAGE_TYPE_READ 0x1
....@@ -201,36 +206,45 @@
201206 * Enum of context types for SendPacket
202207 */
203208 enum {
204
- CONTEXT_DATA_PACKET = 1,
205
- CONTEXT_MGMT_PACKET,
209
+ CONTEXT_DATA_PACKET = 0,
206210 CONTEXT_BEACON_PACKET
207211 };
212
+
213
+struct vnt_rx_header {
214
+ u32 wbk_status;
215
+ u8 rx_sts;
216
+ u8 rx_rate;
217
+ u16 pay_load_len;
218
+} __packed;
219
+
220
+struct vnt_rx_tail {
221
+ __le64 tsf_time;
222
+ u8 sq;
223
+ u8 new_rsr;
224
+ u8 rssi;
225
+ u8 rsr;
226
+ u8 sq_3;
227
+} __packed;
208228
209229 /* RCB (Receive Control Block) */
210230 struct vnt_rcb {
211231 void *priv;
212232 struct urb *urb;
213233 struct sk_buff *skb;
214
- int in_use;
215234 };
216235
217236 /* used to track bulk out irps */
218237 struct vnt_usb_send_context {
219238 void *priv;
220239 struct sk_buff *skb;
221
- struct urb *urb;
222
- struct ieee80211_hdr *hdr;
223
- unsigned int buf_len;
240
+ void *tx_buffer;
224241 u32 frame_len;
225242 u16 tx_hdr_size;
226243 u16 tx_rate;
227244 u8 type;
228245 u8 pkt_no;
229246 u8 pkt_type;
230
- u8 need_ack;
231
- u8 fb_option;
232247 bool in_use;
233
- unsigned char data[MAX_TOTAL_SIZE_WITH_ALL_HEADERS];
234248 };
235249
236250 /*
....@@ -238,16 +252,6 @@
238252 */
239253 struct vnt_interrupt_buffer {
240254 u8 *data_buf;
241
- bool in_use;
242
-};
243
-
244
-/*++ NDIS related */
245
-
246
-enum {
247
- STATUS_SUCCESS = 0,
248
- STATUS_FAILURE,
249
- STATUS_RESOURCES,
250
- STATUS_PENDING,
251255 };
252256
253257 /* flags for options */
....@@ -264,7 +268,6 @@
264268 struct usb_interface *intf;
265269
266270 u64 tsf_time;
267
- u8 rx_rate;
268271
269272 u32 rx_buf_sz;
270273 int mc_list_count;
....@@ -284,6 +287,7 @@
284287
285288 /* Variables to track resources for the BULK Out Pipe */
286289 struct vnt_usb_send_context *tx_context[CB_MAX_TX_DESC];
290
+ struct usb_anchor tx_submitted;
287291 u32 num_tx_context;
288292
289293 /* Variables to track resources for the Interrupt In Pipe */
....@@ -340,12 +344,8 @@
340344 u8 ofdm_pwr_tbl[14];
341345 u8 ofdm_a_pwr_tbl[42];
342346
343
- u16 current_rate;
344347 u16 tx_rate_fb0;
345348 u16 tx_rate_fb1;
346
-
347
- u8 short_retry_limit;
348
- u8 long_retry_limit;
349349
350350 enum nl80211_iftype op_mode;
351351
....@@ -378,8 +378,6 @@
378378
379379 u8 bb_pre_ed_rssi;
380380 u8 bb_pre_ed_index;
381
-
382
- u16 wake_up_count;
383381
384382 /* command timer */
385383 struct delayed_work run_command_work;