Ali Bahar | cf3e688 | 2011-09-04 03:14:04 +0800 | [diff] [blame] | 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 | ******************************************************************************/ |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 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) |
Ali Bahar | ee5b1aa | 2011-09-04 03:14:21 +0800 | [diff] [blame] | 67 | #define TYPE_SHT (24) |
| 68 | #define TYPE_MSK (0x03000000) |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 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) |
Ali Bahar | ee5b1aa | 2011-09-04 03:14:21 +0800 | [diff] [blame] | 79 | #define RTS_RC_SHT (16) |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 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) |
Ali Bahar | ee5b1aa | 2011-09-04 03:14:21 +0800 | [diff] [blame] | 89 | #define RSVD6_MSK (0x00E00000) |
| 90 | #define RSVD6_SHT (21) |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 91 | |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 92 | struct tx_desc { |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 93 | /*DWORD 0*/ |
| 94 | unsigned int txdw0; |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 95 | unsigned int txdw1; |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 96 | unsigned int txdw2; |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 97 | unsigned int txdw3; |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 98 | unsigned int txdw4; |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 99 | unsigned int txdw5; |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 100 | unsigned int txdw6; |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 101 | unsigned int txdw7; |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 102 | }; |
| 103 | |
| 104 | |
| 105 | union txdesc { |
| 106 | struct tx_desc txdesc; |
| 107 | unsigned int value[TXDESC_SIZE>>2]; |
| 108 | }; |
| 109 | |
| 110 | int r8712_xmitframe_complete(struct _adapter *padapter, |
| 111 | struct xmit_priv *pxmitpriv, |
| 112 | struct xmit_buf *pxmitbuf); |
| 113 | void r8712_do_queue_select(struct _adapter *padapter, |
| 114 | struct pkt_attrib *pattrib); |
| 115 | |
Ali Bahar | 93c55dd | 2011-09-04 03:14:22 +0800 | [diff] [blame^] | 116 | #ifdef CONFIG_R8712_TX_AGGR |
| 117 | u8 r8712_xmitframe_aggr_1st(struct xmit_buf *pxmitbuf, |
| 118 | struct xmit_frame *pxmitframe); |
| 119 | u8 r8712_dump_aggr_xframe(struct xmit_buf *pxmitbuf, |
| 120 | struct xmit_frame *pxmitframe); |
| 121 | #endif |
| 122 | |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 123 | #endif |