blob: b50e7a1f3a42cd1e916433471c5ccfd5a815b3c7 [file] [log] [blame]
Ali Baharcf3e6882011-09-04 03:14:04 +08001/******************************************************************************
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 ******************************************************************************/
Larry Finger2865d422010-08-20 10:15:30 -050026#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)
Ali Baharee5b1aa2011-09-04 03:14:21 +080067#define TYPE_SHT (24)
68#define TYPE_MSK (0x03000000)
Larry Finger2865d422010-08-20 10:15:30 -050069
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)
Ali Baharee5b1aa2011-09-04 03:14:21 +080079#define RTS_RC_SHT (16)
Larry Finger2865d422010-08-20 10:15:30 -050080
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)
Ali Baharee5b1aa2011-09-04 03:14:21 +080089#define RSVD6_MSK (0x00E00000)
90#define RSVD6_SHT (21)
Larry Finger2865d422010-08-20 10:15:30 -050091
Javier M. Mellid05937582011-04-02 03:01:49 +020092struct tx_desc {
Larry Finger2865d422010-08-20 10:15:30 -050093 /*DWORD 0*/
94 unsigned int txdw0;
Larry Finger2865d422010-08-20 10:15:30 -050095 unsigned int txdw1;
Larry Finger2865d422010-08-20 10:15:30 -050096 unsigned int txdw2;
Larry Finger2865d422010-08-20 10:15:30 -050097 unsigned int txdw3;
Larry Finger2865d422010-08-20 10:15:30 -050098 unsigned int txdw4;
Larry Finger2865d422010-08-20 10:15:30 -050099 unsigned int txdw5;
Larry Finger2865d422010-08-20 10:15:30 -0500100 unsigned int txdw6;
Larry Finger2865d422010-08-20 10:15:30 -0500101 unsigned int txdw7;
Larry Finger2865d422010-08-20 10:15:30 -0500102};
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
Ali Bahar93c55dd2011-09-04 03:14:22 +0800116#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
Larry Finger2865d422010-08-20 10:15:30 -0500123#endif