xref: /freebsd/sys/dev/rtwn/rtl8192c/r92c_tx_desc.h (revision 2ff63af9b88c7413b7d71715b5532625752a248e)
17453645fSAndriy Voskoboinyk /*-
27453645fSAndriy Voskoboinyk  * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
37453645fSAndriy Voskoboinyk  * Copyright (c) 2016 Andriy Voskoboinyk <avos@FreeBSD.org>
47453645fSAndriy Voskoboinyk  *
57453645fSAndriy Voskoboinyk  * Permission to use, copy, modify, and distribute this software for any
67453645fSAndriy Voskoboinyk  * purpose with or without fee is hereby granted, provided that the above
77453645fSAndriy Voskoboinyk  * copyright notice and this permission notice appear in all copies.
87453645fSAndriy Voskoboinyk  *
97453645fSAndriy Voskoboinyk  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
107453645fSAndriy Voskoboinyk  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
117453645fSAndriy Voskoboinyk  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
127453645fSAndriy Voskoboinyk  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
137453645fSAndriy Voskoboinyk  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
147453645fSAndriy Voskoboinyk  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
157453645fSAndriy Voskoboinyk  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
167453645fSAndriy Voskoboinyk  *
177453645fSAndriy Voskoboinyk  * $OpenBSD: if_urtwnreg.h,v 1.3 2010/11/16 18:02:59 damien Exp $
187453645fSAndriy Voskoboinyk  */
197453645fSAndriy Voskoboinyk 
207453645fSAndriy Voskoboinyk #ifndef R92C_TX_DESC_H
217453645fSAndriy Voskoboinyk #define R92C_TX_DESC_H
227453645fSAndriy Voskoboinyk 
237453645fSAndriy Voskoboinyk /* Tx MAC descriptor (common part). */
247453645fSAndriy Voskoboinyk struct r92c_tx_desc {
257453645fSAndriy Voskoboinyk 	uint16_t 	pktlen;
267453645fSAndriy Voskoboinyk 	uint8_t		offset;
277453645fSAndriy Voskoboinyk 	uint8_t		flags0;
287453645fSAndriy Voskoboinyk #define R92C_FLAGS0_BMCAST	0x01
297453645fSAndriy Voskoboinyk #define R92C_FLAGS0_LSG		0x04
307453645fSAndriy Voskoboinyk #define R92C_FLAGS0_FSG		0x08
317453645fSAndriy Voskoboinyk #define R92C_FLAGS0_OWN		0x80
327453645fSAndriy Voskoboinyk 
337453645fSAndriy Voskoboinyk 	uint32_t	txdw1;
347453645fSAndriy Voskoboinyk #define R92C_TXDW1_MACID_M	0x0000001f
357453645fSAndriy Voskoboinyk #define R92C_TXDW1_MACID_S	0
367453645fSAndriy Voskoboinyk #define R92C_TXDW1_AGGEN	0x00000020
377453645fSAndriy Voskoboinyk #define R92C_TXDW1_AGGBK	0x00000040
387453645fSAndriy Voskoboinyk 
397453645fSAndriy Voskoboinyk #define R92C_TXDW1_QSEL_M	0x00001f00
407453645fSAndriy Voskoboinyk #define R92C_TXDW1_QSEL_S	8
417453645fSAndriy Voskoboinyk 
427453645fSAndriy Voskoboinyk #define R92C_TXDW1_QSEL_BE	0x00	/* or 0x03 */
437453645fSAndriy Voskoboinyk #define R92C_TXDW1_QSEL_BK	0x01	/* or 0x02 */
447453645fSAndriy Voskoboinyk #define R92C_TXDW1_QSEL_VI	0x04	/* or 0x05 */
457453645fSAndriy Voskoboinyk #define R92C_TXDW1_QSEL_VO	0x06	/* or 0x07 */
467453645fSAndriy Voskoboinyk #define RTWN_MAX_TID		8
477453645fSAndriy Voskoboinyk 
487453645fSAndriy Voskoboinyk #define R92C_TXDW1_QSEL_BEACON	0x10
497453645fSAndriy Voskoboinyk #define R92C_TXDW1_QSEL_MGNT	0x12
507453645fSAndriy Voskoboinyk 
517453645fSAndriy Voskoboinyk #define R92C_TXDW1_RAID_M	0x000f0000
527453645fSAndriy Voskoboinyk #define R92C_TXDW1_RAID_S	16
537453645fSAndriy Voskoboinyk #define R92C_TXDW1_CIPHER_M	0x00c00000
547453645fSAndriy Voskoboinyk #define R92C_TXDW1_CIPHER_S	22
557453645fSAndriy Voskoboinyk #define R92C_TXDW1_CIPHER_NONE	0
567453645fSAndriy Voskoboinyk #define R92C_TXDW1_CIPHER_RC4	1
577453645fSAndriy Voskoboinyk #define R92C_TXDW1_CIPHER_AES	3
587453645fSAndriy Voskoboinyk #define R92C_TXDW1_PKTOFF_M	0x7c000000
597453645fSAndriy Voskoboinyk #define R92C_TXDW1_PKTOFF_S	26
607453645fSAndriy Voskoboinyk 
617453645fSAndriy Voskoboinyk 	uint32_t	txdw2;
627453645fSAndriy Voskoboinyk #define R92C_TXDW2_CCX_RPT	0x00080000
637453645fSAndriy Voskoboinyk #define R92C_TXDW2_AMPDU_DEN_M	0x00700000
647453645fSAndriy Voskoboinyk #define R92C_TXDW2_AMPDU_DEN_S	20
657453645fSAndriy Voskoboinyk 
667453645fSAndriy Voskoboinyk 	uint16_t	txdw3;
677453645fSAndriy Voskoboinyk 	uint16_t	txdseq;
687453645fSAndriy Voskoboinyk 
697453645fSAndriy Voskoboinyk 	uint32_t	txdw4;
70*bd99d5d4SAndriy Voskoboinyk #define R92C_TXDW4_RTSRATE_M	0x0000001f
717453645fSAndriy Voskoboinyk #define R92C_TXDW4_RTSRATE_S	0
727453645fSAndriy Voskoboinyk #define R92C_TXDW4_SEQ_SEL_M	0x00000040
737453645fSAndriy Voskoboinyk #define R92C_TXDW4_SEQ_SEL_S	6
747453645fSAndriy Voskoboinyk #define R92C_TXDW4_HWSEQ_EN	0x00000080
757453645fSAndriy Voskoboinyk #define R92C_TXDW4_DRVRATE	0x00000100
767453645fSAndriy Voskoboinyk #define R92C_TXDW4_CTS2SELF	0x00000800
777453645fSAndriy Voskoboinyk #define R92C_TXDW4_RTSEN	0x00001000
787453645fSAndriy Voskoboinyk #define R92C_TXDW4_HWRTSEN	0x00002000
797453645fSAndriy Voskoboinyk #define R92C_TXDW4_PORT_ID_M	0x00004000
807453645fSAndriy Voskoboinyk #define R92C_TXDW4_PORT_ID_S	14
817453645fSAndriy Voskoboinyk #define R92C_TXDW4_DATA_SCO_M	0x00300000
827453645fSAndriy Voskoboinyk #define R92C_TXDW4_DATA_SCO_S	20
837453645fSAndriy Voskoboinyk #define R92C_TXDW4_SCO_SCA	1
847453645fSAndriy Voskoboinyk #define R92C_TXDW4_SCO_SCB	2
857453645fSAndriy Voskoboinyk #define R92C_TXDW4_DATA_SHPRE	0x01000000
867453645fSAndriy Voskoboinyk #define R92C_TXDW4_DATA_BW40	0x02000000
877453645fSAndriy Voskoboinyk #define R92C_TXDW4_RTS_SHORT	0x04000000
887453645fSAndriy Voskoboinyk #define R92C_TXDW4_RTS_BW40	0x08000000
897453645fSAndriy Voskoboinyk #define R92C_TXDW4_RTS_SCO_M	0x30000000
907453645fSAndriy Voskoboinyk #define R92C_TXDW4_RTS_SCO_S	28
917453645fSAndriy Voskoboinyk 
927453645fSAndriy Voskoboinyk 	uint32_t	txdw5;
937453645fSAndriy Voskoboinyk #define R92C_TXDW5_DATARATE_M		0x0000003f
947453645fSAndriy Voskoboinyk #define R92C_TXDW5_DATARATE_S		0
957453645fSAndriy Voskoboinyk #define R92C_TXDW5_SGI			0x00000040
967453645fSAndriy Voskoboinyk #define R92C_TXDW5_DATARATE_FB_LMT_M	0x00001f00
977453645fSAndriy Voskoboinyk #define R92C_TXDW5_DATARATE_FB_LMT_S	8
987453645fSAndriy Voskoboinyk #define R92C_TXDW5_RTSRATE_FB_LMT_M	0x0001e000
997453645fSAndriy Voskoboinyk #define R92C_TXDW5_RTSRATE_FB_LMT_S	13
1007453645fSAndriy Voskoboinyk #define R92C_TXDW5_RTY_LMT_ENA		0x00020000
1017453645fSAndriy Voskoboinyk #define R92C_TXDW5_RTY_LMT_M		0x00fc0000
1027453645fSAndriy Voskoboinyk #define R92C_TXDW5_RTY_LMT_S		18
1037453645fSAndriy Voskoboinyk #define R92C_TXDW5_AGGNUM_M		0xff000000
1047453645fSAndriy Voskoboinyk #define R92C_TXDW5_AGGNUM_S		24
1057453645fSAndriy Voskoboinyk 
1067453645fSAndriy Voskoboinyk 	uint32_t	txdw6;
1077453645fSAndriy Voskoboinyk #define R92C_TXDW6_MAX_AGG_M		0x0000f800
1087453645fSAndriy Voskoboinyk #define R92C_TXDW6_MAX_AGG_S		11
1097453645fSAndriy Voskoboinyk } __packed __attribute__((aligned(4)));
1107453645fSAndriy Voskoboinyk 
1117453645fSAndriy Voskoboinyk /* Rate adaptation modes. */
1127453645fSAndriy Voskoboinyk #define R92C_RAID_11BGN		0
1137453645fSAndriy Voskoboinyk #define R92C_RAID_11GN		1
1147453645fSAndriy Voskoboinyk #define R92C_RAID_11BN		2
1157453645fSAndriy Voskoboinyk #define R92C_RAID_11N		3
1167453645fSAndriy Voskoboinyk #define R92C_RAID_11BG		4
1177453645fSAndriy Voskoboinyk #define R92C_RAID_11G		5	/* "pure" 11g */
1187453645fSAndriy Voskoboinyk #define R92C_RAID_11B		6
1197453645fSAndriy Voskoboinyk 
1207453645fSAndriy Voskoboinyk #endif	/* R92C_TX_DESC_H */
121