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