1/******************************************************************************
2 *
3 * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17 *
18 * Modifications for inclusion into the Linux staging tree are
19 * Copyright(c) 2010 Larry Finger. All rights reserved.
20 *
21 * Contact information:
22 * WLAN FAE <wlanfae@realtek.com>
23 * Larry Finger <Larry.Finger@lwfinger.net>
24 *
25 ******************************************************************************/
26#ifndef _RTL8712_XMIT_H_
27#define _RTL8712_XMIT_H_
28
29#define HWXMIT_ENTRY	4
30
31#define VO_QUEUE_INX	0
32#define VI_QUEUE_INX	1
33#define BE_QUEUE_INX	2
34#define BK_QUEUE_INX	3
35#define TS_QUEUE_INX	4
36#define MGT_QUEUE_INX	5
37#define BMC_QUEUE_INX	6
38#define BCN_QUEUE_INX	7
39
40#define HW_QUEUE_ENTRY	8
41
42#define TXDESC_SIZE 32
43#define TXDESC_OFFSET TXDESC_SIZE
44
45#define NR_AMSDU_XMITFRAME 8
46#define NR_TXAGG_XMITFRAME 8
47
48#define MAX_AMSDU_XMITBUF_SZ 8704
49#define MAX_TXAGG_XMITBUF_SZ 16384 /*16k*/
50
51
52#define tx_cmd tx_desc
53
54
55/*
56 *defined for TX DESC Operation
57 */
58
59#define MAX_TID (15)
60
61/*OFFSET 0*/
62#define OFFSET_SZ (0)
63#define OFFSET_SHT (16)
64#define OWN	BIT(31)
65#define FSG	BIT(27)
66#define LSG	BIT(26)
67#define TYPE_SHT (24)
68#define TYPE_MSK (0x03000000)
69
70/*OFFSET 4*/
71#define PKT_OFFSET_SZ (0)
72#define QSEL_SHT (8)
73#define HWPC BIT(31)
74
75/*OFFSET 8*/
76#define BMC BIT(7)
77#define BK BIT(30)
78#define AGG_EN BIT(29)
79#define RTS_RC_SHT (16)
80
81/*OFFSET 12*/
82#define SEQ_SHT (16)
83
84/*OFFSET 16*/
85#define TXBW BIT(18)
86
87/*OFFSET 20*/
88#define DISFB BIT(15)
89#define RSVD6_MSK (0x00E00000)
90#define RSVD6_SHT (21)
91
92struct tx_desc {
93	/*DWORD 0*/
94	unsigned int txdw0;
95	unsigned int txdw1;
96	unsigned int txdw2;
97	unsigned int txdw3;
98	unsigned int txdw4;
99	unsigned int txdw5;
100	unsigned int txdw6;
101	unsigned int txdw7;
102};
103
104
105union txdesc {
106	struct tx_desc txdesc;
107	unsigned int value[TXDESC_SIZE>>2];
108};
109
110int r8712_xmitframe_complete(struct _adapter *padapter,
111			     struct xmit_priv *pxmitpriv,
112			     struct xmit_buf *pxmitbuf);
113void r8712_do_queue_select(struct _adapter *padapter,
114			   struct pkt_attrib *pattrib);
115
116#ifdef CONFIG_R8712_TX_AGGR
117u8 r8712_xmitframe_aggr_1st(struct xmit_buf *pxmitbuf,
118			struct xmit_frame *pxmitframe);
119u8 r8712_dump_aggr_xframe(struct xmit_buf *pxmitbuf,
120			struct xmit_frame *pxmitframe);
121#endif
122
123#endif
124