1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
3  *
4  * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved.
5  *
6  * Modifications for inclusion into the Linux staging tree are
7  * Copyright(c) 2010 Larry Finger. All rights reserved.
8  *
9  * Contact information:
10  * WLAN FAE <wlanfae@realtek.com>
11  * Larry Finger <Larry.Finger@lwfinger.net>
12  *
13  ******************************************************************************/
14 #ifndef _RTL8712_XMIT_H_
15 #define _RTL8712_XMIT_H_
16 
17 #define HWXMIT_ENTRY	4
18 
19 #define VO_QUEUE_INX	0
20 #define VI_QUEUE_INX	1
21 #define BE_QUEUE_INX	2
22 #define BK_QUEUE_INX	3
23 #define TS_QUEUE_INX	4
24 #define MGT_QUEUE_INX	5
25 #define BMC_QUEUE_INX	6
26 #define BCN_QUEUE_INX	7
27 
28 #define HW_QUEUE_ENTRY	8
29 
30 #define TXDESC_SIZE 32
31 #define TXDESC_OFFSET TXDESC_SIZE
32 
33 #define NR_AMSDU_XMITFRAME 8
34 #define NR_TXAGG_XMITFRAME 8
35 
36 #define MAX_AMSDU_XMITBUF_SZ 8704
37 #define MAX_TXAGG_XMITBUF_SZ 16384 /*16k*/
38 
39 
40 #define tx_cmd tx_desc
41 
42 
43 /*
44  *defined for TX DESC Operation
45  */
46 
47 #define MAX_TID (15)
48 
49 /*OFFSET 0*/
50 #define OFFSET_SZ (0)
51 #define OFFSET_SHT (16)
52 #define OWN	BIT(31)
53 #define FSG	BIT(27)
54 #define LSG	BIT(26)
55 #define TYPE_SHT (24)
56 #define TYPE_MSK (0x03000000)
57 
58 /*OFFSET 4*/
59 #define PKT_OFFSET_SZ (0)
60 #define QSEL_SHT (8)
61 #define HWPC BIT(31)
62 
63 /*OFFSET 8*/
64 #define BMC BIT(7)
65 #define BK BIT(30)
66 #define AGG_EN BIT(29)
67 #define RTS_RC_SHT (16)
68 
69 /*OFFSET 12*/
70 #define SEQ_SHT (16)
71 
72 /*OFFSET 16*/
73 #define TXBW BIT(18)
74 
75 /*OFFSET 20*/
76 #define DISFB BIT(15)
77 #define RSVD6_MSK (0x00E00000)
78 #define RSVD6_SHT (21)
79 
80 struct tx_desc {
81 	/*DWORD 0*/
82 	__le32 txdw0;
83 	__le32 txdw1;
84 	__le32 txdw2;
85 	__le32 txdw3;
86 	__le32 txdw4;
87 	__le32 txdw5;
88 	__le32 txdw6;
89 	__le32 txdw7;
90 };
91 
92 
93 union txdesc {
94 	struct tx_desc txdesc;
95 	unsigned int value[TXDESC_SIZE>>2];
96 };
97 
98 int r8712_xmitframe_complete(struct _adapter *padapter,
99 			     struct xmit_priv *pxmitpriv,
100 			     struct xmit_buf *pxmitbuf);
101 void r8712_do_queue_select(struct _adapter *padapter,
102 			   struct pkt_attrib *pattrib);
103 
104 #ifdef CONFIG_R8712_TX_AGGR
105 void r8712_xmitframe_aggr_1st(struct xmit_buf *pxmitbuf,
106 			      struct xmit_frame *pxmitframe);
107 void r8712_dump_aggr_xframe(struct xmit_buf *pxmitbuf,
108 			    struct xmit_frame *pxmitframe);
109 #endif
110 
111 #endif
112