1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
4  * All rights reserved.
5  *
6  * File: desc.h
7  *
8  * Purpose:The header file of descriptor
9  *
10  * Revision History:
11  *
12  * Author: Tevin Chen
13  *
14  * Date: May 21, 1996
15  *
16  */
17 
18 #ifndef __DESC_H__
19 #define __DESC_H__
20 
21 #include <linux/types.h>
22 #include <linux/mm.h>
23 
24 /* max transmit or receive buffer size */
25 #define CB_MAX_BUF_SIZE     2900U       /* NOTE: must be multiple of 4 */
26 
27 #define MAX_TOTAL_SIZE_WITH_ALL_HEADERS CB_MAX_BUF_SIZE
28 
29 #define MAX_INTERRUPT_SIZE              32
30 
31 #define CB_MAX_RX_DESC      128         /* max # of descriptors */
32 #define CB_MIN_RX_DESC      16          /* min # of RX descriptors */
33 #define CB_MAX_TX_DESC      128         /* max # of descriptors */
34 #define CB_MIN_TX_DESC      16          /* min # of TX descriptors */
35 
36 /*
37  * bits in the RSR register
38  */
39 #define RSR_ADDRBROAD       0x80
40 #define RSR_ADDRMULTI       0x40
41 #define RSR_ADDRUNI         0x00
42 #define RSR_IVLDTYP         0x20        /* invalid packet type */
43 #define RSR_IVLDLEN         0x10        /* invalid len (> 2312 byte) */
44 #define RSR_BSSIDOK         0x08
45 #define RSR_CRCOK           0x04
46 #define RSR_BCNSSIDOK       0x02
47 #define RSR_ADDROK          0x01
48 
49 /*
50  * bits in the new RSR register
51  */
52 #define NEWRSR_DECRYPTOK    0x10
53 #define NEWRSR_CFPIND       0x08
54 #define NEWRSR_HWUTSF       0x04
55 #define NEWRSR_BCNHITAID    0x02
56 #define NEWRSR_BCNHITAID0   0x01
57 
58 /*
59  * bits in the TSR register
60  */
61 #define TSR_RETRYTMO        0x08
62 #define TSR_TMO             0x04
63 #define TSR_ACKDATA         0x02
64 #define TSR_VALID           0x01
65 
66 #define FIFOCTL_AUTO_FB_1   0x1000
67 #define FIFOCTL_AUTO_FB_0   0x0800
68 #define FIFOCTL_GRPACK      0x0400
69 #define FIFOCTL_11GA        0x0300
70 #define FIFOCTL_11GB        0x0200
71 #define FIFOCTL_11B         0x0100
72 #define FIFOCTL_11A         0x0000
73 #define FIFOCTL_RTS         0x0080
74 #define FIFOCTL_ISDMA0      0x0040
75 #define FIFOCTL_GENINT      0x0020
76 #define FIFOCTL_TMOEN       0x0010
77 #define FIFOCTL_LRETRY      0x0008
78 #define FIFOCTL_CRCDIS      0x0004
79 #define FIFOCTL_NEEDACK     0x0002
80 #define FIFOCTL_LHEAD       0x0001
81 
82 /* WMAC definition Frag Control */
83 #define FRAGCTL_AES         0x0300
84 #define FRAGCTL_TKIP        0x0200
85 #define FRAGCTL_LEGACY      0x0100
86 #define FRAGCTL_NONENCRYPT  0x0000
87 #define FRAGCTL_ENDFRAG     0x0003
88 #define FRAGCTL_MIDFRAG     0x0002
89 #define FRAGCTL_STAFRAG     0x0001
90 #define FRAGCTL_NONFRAG     0x0000
91 
92 #endif /* __DESC_H__ */
93