xref: /illumos-gate/usr/src/uts/common/io/iwn/if_iwncompat.h (revision 5f82aa32fbc5dc2c59bca6ff315f44a4c4c9ea86)
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source.  A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * Copyright 2016 Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
14  */
15 
16 #ifndef _IF_IWNCOMPAT_H
17 #define	_IF_IWNCOMPAT_H
18 
19 /* XXX Added for NetBSD */
20 #define	IEEE80211_NO_HT
21 
22 /*
23  * QoS  definitions
24  */
25 
26 #define	AC_NUM		(4)	/* the number of access category */
27 
28 /*
29  * index of every AC in firmware
30  */
31 #define	QOS_AC_BK	(0)
32 #define	QOS_AC_BE	(1)
33 #define	QOS_AC_VI	(2)
34 #define	QOS_AC_VO	(3)
35 #define	QOS_AC_INVALID	(-1)
36 
37 #define	QOS_CW_RANGE_MIN	(0)	/* exponential of 2 */
38 #define	QOS_CW_RANGE_MAX	(15)	/* exponential of 2 */
39 #define	QOS_TXOP_MIN		(0)	/* unit of 32 microsecond */
40 #define	QOS_TXOP_MAX		(255)	/* unit of 32 microsecond */
41 #define	QOS_AIFSN_MIN		(2)
42 #define	QOS_AIFSN_MAX		(15)	/* undefined */
43 
44 /*
45  * masks for flags of QoS parameter command
46  */
47 #define	QOS_PARAM_FLG_UPDATE_EDCA	(0x01)
48 #define	QOS_PARAM_FLG_TGN		(0x02)
49 
50 /*
51  * index of TX queue for every AC
52  */
53 #define	QOS_AC_BK_TO_TXQ	(3)
54 #define	QOS_AC_BE_TO_TXQ	(2)
55 #define	QOS_AC_VI_TO_TXQ	(1)
56 #define	QOS_AC_VO_TO_TXQ	(0)
57 #define	TXQ_FOR_AC_MIN		(0)
58 #define	TXQ_FOR_AC_MAX		(3)
59 #define	TXQ_FOR_AC_INVALID	(-1)
60 #define	NON_QOS_TXQ		QOS_AC_BE_TO_TXQ
61 #define	QOS_TXQ_FOR_MGT		QOS_AC_VO_TO_TXQ
62 
63 #define	WME_TID_MIN	(0)
64 #define	WME_TID_MAX	(7)
65 #define	WME_TID_INVALID	((uint8_t)-1)
66 
67 #define	PCI_VENDOR_INTEL	0x8086		/* Intel */
68 
69 /* WiFi Link 1000 */
70 #define	PCI_PRODUCT_INTEL_WIFI_LINK_1000_1	0x0083
71 #define	PCI_PRODUCT_INTEL_WIFI_LINK_1000_2	0x0084
72 
73 /* Centrino Wireless-N 100 */
74 #define	PCI_PRODUCT_INTEL_WIFI_LINK_100_1	0x08ae
75 #define	PCI_PRODUCT_INTEL_WIFI_LINK_100_2	0x08af
76 
77 /* Centrino Wireless-N 105 */
78 #define	PCI_PRODUCT_INTEL_WIFI_LINK_105_1	0x0894
79 #define	PCI_PRODUCT_INTEL_WIFI_LINK_105_2	0x0895
80 
81 /* Centrino Wireless-N 130 */
82 #define	PCI_PRODUCT_INTEL_WIFI_LINK_130_1	0x0896
83 #define	PCI_PRODUCT_INTEL_WIFI_LINK_130_2	0x0897
84 
85 /* Centrino Wireless-N 135 */
86 #define	PCI_PRODUCT_INTEL_WIFI_LINK_135_1	0x0892
87 #define	PCI_PRODUCT_INTEL_WIFI_LINK_135_2	0x0893
88 
89 /* Centrino Wireless-N 1030 */
90 #define	PCI_PRODUCT_INTEL_WIFI_LINK_1030_1	0x008a
91 #define	PCI_PRODUCT_INTEL_WIFI_LINK_1030_2	0x008b
92 
93 /* Centrino Wireless-N 2200 */
94 #define	PCI_PRODUCT_INTEL_WIFI_LINK_2200_1	0x0890
95 #define	PCI_PRODUCT_INTEL_WIFI_LINK_2200_2	0x0891
96 
97 /* Centrino Wireless-N 2230 */
98 #define	PCI_PRODUCT_INTEL_WIFI_LINK_2230_1	0x0887
99 #define	PCI_PRODUCT_INTEL_WIFI_LINK_2230_2	0x0888
100 
101 /* Wireless WiFi Link 4965 */
102 #define	PCI_PRODUCT_INTEL_WIFI_LINK_4965_1	0x4229
103 #define	PCI_PRODUCT_INTEL_WIFI_LINK_4965_2	0x4230
104 #define	PCI_PRODUCT_INTEL_WIFI_LINK_4965_3	0x422d
105 #define	PCI_PRODUCT_INTEL_WIFI_LINK_4965_4	0x4233
106 
107 /* WiFi Link 5100 */
108 #define	PCI_PRODUCT_INTEL_WIFI_LINK_5100_1	0x4232
109 #define	PCI_PRODUCT_INTEL_WIFI_LINK_5100_2	0x4237
110 
111 /* WiFi Link 5150 */
112 #define	PCI_PRODUCT_INTEL_WIFI_LINK_5150_1	0x423c
113 #define	PCI_PRODUCT_INTEL_WIFI_LINK_5150_2	0x423d
114 
115 /* WiFi Link 5300 */
116 #define	PCI_PRODUCT_INTEL_WIFI_LINK_5300_1	0x4235
117 #define	PCI_PRODUCT_INTEL_WIFI_LINK_5300_2	0x4236
118 
119 /* WiFi Link 5350 */
120 #define	PCI_PRODUCT_INTEL_WIFI_LINK_5350_1	0x423a
121 #define	PCI_PRODUCT_INTEL_WIFI_LINK_5350_2	0x423b
122 
123 /* Centrino Advanced-N 6200 */
124 #define	PCI_PRODUCT_INTEL_WIFI_LINK_6000_IPA_1	0x422c
125 #define	PCI_PRODUCT_INTEL_WIFI_LINK_6000_IPA_2	0x4239
126 
127 /* Centrino Advanced-N 6205 */
128 #define	PCI_PRODUCT_INTEL_WIFI_LINK_6005_2X2_1	0x0082
129 #define	PCI_PRODUCT_INTEL_WIFI_LINK_6005_2X2_2	0x0085
130 
131 /* Centrino Advanced-N 6230 */
132 #define	PCI_PRODUCT_INTEL_WIFI_LINK_6230_1	0x0090
133 #define	PCI_PRODUCT_INTEL_WIFI_LINK_6230_2	0x0091
134 
135 /* Centrino Advanced-N 6235 */
136 #define	PCI_PRODUCT_INTEL_WIFI_LINK_6235	0x088e
137 #define	PCI_PRODUCT_INTEL_WIFI_LINK_6235_2	0x088f
138 
139 /* Centrino Advanced-N 6250 */
140 #define	PCI_PRODUCT_INTEL_WIFI_LINK_6050_2X2_1	0x0087
141 #define	PCI_PRODUCT_INTEL_WIFI_LINK_6050_2X2_2	0x0089
142 
143 /* Centrino Ultimate-N 6300 */
144 #define	PCI_PRODUCT_INTEL_WIFI_LINK_6000_3X3_1	0x422b
145 #define	PCI_PRODUCT_INTEL_WIFI_LINK_6000_3X3_2	0x4238
146 
147 #define	__inline	inline
148 #define	__arraycount(x)	ARRAY_SIZE(x)
149 #define	abs(x)		ABS(x)
150 
151 #define	le16toh(x) LE_16(x)
152 #define	htole16(x) LE_16(x)
153 #define	le32toh(x) LE_32(x)
154 #define	htole32(x) LE_32(x)
155 #define	le64toh(x) LE_64(x)
156 #define	htole64(x) LE_64(x)
157 
158 #define	IWN_SUCCESS		0
159 #define	IWN_FAIL		EIO
160 
161 #endif	/* _IF_IWNCOMPAT_H */
162