blob: 2236063112613acb3dc66bf33e26e0d80d8e2f37 [file] [log] [blame]
Gabor Juhos6baff7f2009-01-14 20:17:06 +01001/*
Sujith Manoharan5b681382011-05-17 13:36:18 +05302 * Copyright (c) 2008-2011 Atheros Communications Inc.
Gabor Juhos6baff7f2009-01-14 20:17:06 +01003 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
Joe Perches516304b2012-03-18 17:30:52 -070017#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
18
Gabor Juhos6baff7f2009-01-14 20:17:06 +010019#include <linux/nl80211.h>
20#include <linux/pci.h>
Stanislaw Gruszkad4930082011-07-29 15:59:08 +020021#include <linux/pci-aspm.h>
Paul Gortmaker9d9779e2011-07-03 15:21:01 -040022#include <linux/module.h>
Sujith394cf0a2009-02-09 13:26:54 +053023#include "ath9k.h"
Gabor Juhos6baff7f2009-01-14 20:17:06 +010024
Benoit Taine9baa3c32014-08-08 15:56:03 +020025static const struct pci_device_id ath_pci_id_table[] = {
Gabor Juhos6baff7f2009-01-14 20:17:06 +010026 { PCI_VDEVICE(ATHEROS, 0x0023) }, /* PCI */
27 { PCI_VDEVICE(ATHEROS, 0x0024) }, /* PCI-E */
28 { PCI_VDEVICE(ATHEROS, 0x0027) }, /* PCI */
Vittorio Gambaletta (VittGam)0f9edcd2016-04-11 04:48:55 +020029
30#ifdef CONFIG_ATH9K_PCOEM
31 /* Mini PCI AR9220 MB92 cards: Compex WLM200NX, Wistron DNMA-92 */
32 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
33 0x0029,
34 PCI_VENDOR_ID_ATHEROS,
35 0x2096),
36 .driver_data = ATH9K_PCI_LED_ACT_HI },
37#endif
38
Vittorio Gambaletta (VittGam)79e57dd12016-11-09 03:40:56 +020039 { PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI */
Sujith Manoharana5354cc2013-08-04 14:21:58 +053040
Felix Fietkau935477e2014-10-25 17:19:26 +020041#ifdef CONFIG_ATH9K_PCOEM
Sujith Manoharand1ae25a2013-08-25 16:30:40 +053042 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
43 0x002A,
44 PCI_VENDOR_ID_AZWAVE,
45 0x1C71),
46 .driver_data = ATH9K_PCI_D3_L1_WAR },
47 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
48 0x002A,
49 PCI_VENDOR_ID_FOXCONN,
50 0xE01F),
51 .driver_data = ATH9K_PCI_D3_L1_WAR },
52 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
53 0x002A,
54 0x11AD, /* LITEON */
55 0x6632),
56 .driver_data = ATH9K_PCI_D3_L1_WAR },
57 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
58 0x002A,
59 0x11AD, /* LITEON */
60 0x6642),
61 .driver_data = ATH9K_PCI_D3_L1_WAR },
62 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
63 0x002A,
64 PCI_VENDOR_ID_QMI,
65 0x0306),
66 .driver_data = ATH9K_PCI_D3_L1_WAR },
67 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
68 0x002A,
69 0x185F, /* WNC */
70 0x309D),
71 .driver_data = ATH9K_PCI_D3_L1_WAR },
72 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
73 0x002A,
74 0x10CF, /* Fujitsu */
75 0x147C),
76 .driver_data = ATH9K_PCI_D3_L1_WAR },
77 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
78 0x002A,
79 0x10CF, /* Fujitsu */
80 0x147D),
81 .driver_data = ATH9K_PCI_D3_L1_WAR },
82 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
83 0x002A,
84 0x10CF, /* Fujitsu */
85 0x1536),
86 .driver_data = ATH9K_PCI_D3_L1_WAR },
Vittorio Gambaletta (VittGam)79e57dd12016-11-09 03:40:56 +020087#endif
Sujith Manoharand1ae25a2013-08-25 16:30:40 +053088
Vittorio Gambaletta (VittGam)79e57dd12016-11-09 03:40:56 +020089 { PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */
90
91#ifdef CONFIG_ATH9K_PCOEM
Sujith Manoharana5354cc2013-08-04 14:21:58 +053092 /* AR9285 card for Asus */
93 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
94 0x002B,
95 PCI_VENDOR_ID_AZWAVE,
96 0x2C37),
97 .driver_data = ATH9K_PCI_BT_ANT_DIV },
Felix Fietkau935477e2014-10-25 17:19:26 +020098#endif
Sujith Manoharana5354cc2013-08-04 14:21:58 +053099
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100100 { PCI_VDEVICE(ATHEROS, 0x002B) }, /* PCI-E */
Luis R. Rodriguez5ffaf8a2010-02-02 11:58:33 -0500101 { PCI_VDEVICE(ATHEROS, 0x002C) }, /* PCI-E 802.11n bonded out */
Vivek Natarajanac88b6e2009-07-23 10:59:57 +0530102 { PCI_VDEVICE(ATHEROS, 0x002D) }, /* PCI */
103 { PCI_VDEVICE(ATHEROS, 0x002E) }, /* PCI-E */
Sujith Manoharan4dd35642013-10-23 14:26:04 +0530104
105 /* Killer Wireless (3x3) */
106 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
107 0x0030,
108 0x1A56,
109 0x2000),
110 .driver_data = ATH9K_PCI_KILLER },
111 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
112 0x0030,
113 0x1A56,
114 0x2001),
115 .driver_data = ATH9K_PCI_KILLER },
116
Luis R. Rodriguez0efabd52010-06-12 00:34:02 -0400117 { PCI_VDEVICE(ATHEROS, 0x0030) }, /* PCI-E AR9300 */
Sujith Manoharan9b60b642013-06-13 22:51:26 +0530118
Felix Fietkau935477e2014-10-25 17:19:26 +0200119#ifdef CONFIG_ATH9K_PCOEM
Sujith Manoharan9b60b642013-06-13 22:51:26 +0530120 /* PCI-E CUS198 */
121 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
122 0x0032,
123 PCI_VENDOR_ID_AZWAVE,
124 0x2086),
Sujith Manoharana5354cc2013-08-04 14:21:58 +0530125 .driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV },
Sujith Manoharan9b60b642013-06-13 22:51:26 +0530126 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
127 0x0032,
128 PCI_VENDOR_ID_AZWAVE,
129 0x1237),
Sujith Manoharana5354cc2013-08-04 14:21:58 +0530130 .driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV },
Sujith Manoharan9b60b642013-06-13 22:51:26 +0530131 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
132 0x0032,
133 PCI_VENDOR_ID_AZWAVE,
134 0x2126),
Sujith Manoharana5354cc2013-08-04 14:21:58 +0530135 .driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV },
Sujith Manoharanf4d90702013-08-20 13:05:58 +0530136 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
137 0x0032,
138 PCI_VENDOR_ID_AZWAVE,
139 0x126A),
140 .driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV },
Sujith Manoharane861ef52013-06-18 10:13:43 +0530141
142 /* PCI-E CUS230 */
Sujith Manoharan9b60b642013-06-13 22:51:26 +0530143 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
144 0x0032,
145 PCI_VENDOR_ID_AZWAVE,
146 0x2152),
Sujith Manoharana5354cc2013-08-04 14:21:58 +0530147 .driver_data = ATH9K_PCI_CUS230 | ATH9K_PCI_BT_ANT_DIV },
Sujith Manoharan9b60b642013-06-13 22:51:26 +0530148 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
149 0x0032,
150 PCI_VENDOR_ID_FOXCONN,
151 0xE075),
Sujith Manoharana5354cc2013-08-04 14:21:58 +0530152 .driver_data = ATH9K_PCI_CUS230 | ATH9K_PCI_BT_ANT_DIV },
Sujith Manoharan9b60b642013-06-13 22:51:26 +0530153
Sujith Manoharan2952f6e2013-08-05 15:08:28 +0530154 /* WB225 */
155 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
156 0x0032,
157 PCI_VENDOR_ID_ATHEROS,
158 0x3119),
159 .driver_data = ATH9K_PCI_BT_ANT_DIV },
160 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
161 0x0032,
162 PCI_VENDOR_ID_ATHEROS,
163 0x3122),
164 .driver_data = ATH9K_PCI_BT_ANT_DIV },
165 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
166 0x0032,
167 0x185F, /* WNC */
168 0x3119),
169 .driver_data = ATH9K_PCI_BT_ANT_DIV },
170 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
171 0x0032,
172 0x185F, /* WNC */
173 0x3027),
174 .driver_data = ATH9K_PCI_BT_ANT_DIV },
175 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
176 0x0032,
177 PCI_VENDOR_ID_SAMSUNG,
178 0x4105),
179 .driver_data = ATH9K_PCI_BT_ANT_DIV },
180 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
181 0x0032,
182 PCI_VENDOR_ID_SAMSUNG,
183 0x4106),
184 .driver_data = ATH9K_PCI_BT_ANT_DIV },
185 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
186 0x0032,
187 PCI_VENDOR_ID_SAMSUNG,
188 0x410D),
189 .driver_data = ATH9K_PCI_BT_ANT_DIV },
190 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
191 0x0032,
192 PCI_VENDOR_ID_SAMSUNG,
193 0x410E),
194 .driver_data = ATH9K_PCI_BT_ANT_DIV },
195 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
196 0x0032,
197 PCI_VENDOR_ID_SAMSUNG,
198 0x410F),
199 .driver_data = ATH9K_PCI_BT_ANT_DIV },
200 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
201 0x0032,
202 PCI_VENDOR_ID_SAMSUNG,
203 0xC706),
204 .driver_data = ATH9K_PCI_BT_ANT_DIV },
205 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
206 0x0032,
207 PCI_VENDOR_ID_SAMSUNG,
208 0xC680),
209 .driver_data = ATH9K_PCI_BT_ANT_DIV },
210 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
211 0x0032,
212 PCI_VENDOR_ID_SAMSUNG,
213 0xC708),
214 .driver_data = ATH9K_PCI_BT_ANT_DIV },
215 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
216 0x0032,
217 PCI_VENDOR_ID_LENOVO,
218 0x3218),
219 .driver_data = ATH9K_PCI_BT_ANT_DIV },
220 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
221 0x0032,
222 PCI_VENDOR_ID_LENOVO,
223 0x3219),
224 .driver_data = ATH9K_PCI_BT_ANT_DIV },
225
Sujith Manoharan2d22c7d2013-11-08 11:45:25 +0530226 /* AR9485 cards with PLL power-save disabled by default. */
227 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
228 0x0032,
229 PCI_VENDOR_ID_AZWAVE,
230 0x2C97),
231 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
232 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
233 0x0032,
234 PCI_VENDOR_ID_AZWAVE,
235 0x2100),
236 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
237 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
238 0x0032,
239 0x1C56, /* ASKEY */
240 0x4001),
241 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
242 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
243 0x0032,
244 0x11AD, /* LITEON */
245 0x6627),
246 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
247 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
248 0x0032,
249 0x11AD, /* LITEON */
250 0x6628),
251 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
252 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
253 0x0032,
254 PCI_VENDOR_ID_FOXCONN,
255 0xE04E),
256 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
257 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
258 0x0032,
259 PCI_VENDOR_ID_FOXCONN,
260 0xE04F),
261 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
262 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
263 0x0032,
264 0x144F, /* ASKEY */
265 0x7197),
266 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
267 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
268 0x0032,
269 0x1B9A, /* XAVI */
270 0x2000),
271 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
272 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
273 0x0032,
274 0x1B9A, /* XAVI */
275 0x2001),
276 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
277 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
278 0x0032,
279 PCI_VENDOR_ID_AZWAVE,
280 0x1186),
281 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
282 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
283 0x0032,
284 PCI_VENDOR_ID_AZWAVE,
285 0x1F86),
286 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
287 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
288 0x0032,
289 PCI_VENDOR_ID_AZWAVE,
290 0x1195),
291 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
292 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
293 0x0032,
294 PCI_VENDOR_ID_AZWAVE,
295 0x1F95),
296 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
297 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
298 0x0032,
299 0x1B9A, /* XAVI */
300 0x1C00),
301 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
302 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
303 0x0032,
304 0x1B9A, /* XAVI */
305 0x1C01),
306 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
307 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
308 0x0032,
309 PCI_VENDOR_ID_ASUSTEK,
310 0x850D),
311 .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
Felix Fietkau935477e2014-10-25 17:19:26 +0200312#endif
Sujith Manoharan2d22c7d2013-11-08 11:45:25 +0530313
Vasanthakumar Thiagarajan14358942010-12-06 04:28:00 -0800314 { PCI_VDEVICE(ATHEROS, 0x0032) }, /* PCI-E AR9485 */
Luis R. Rodrigueza508a6e2011-08-23 13:37:07 -0700315 { PCI_VDEVICE(ATHEROS, 0x0033) }, /* PCI-E AR9580 */
Sujith Manoharan12eea642013-06-18 15:42:36 +0530316
Felix Fietkau935477e2014-10-25 17:19:26 +0200317#ifdef CONFIG_ATH9K_PCOEM
Sujith Manoharan12eea642013-06-18 15:42:36 +0530318 /* PCI-E CUS217 */
319 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
320 0x0034,
321 PCI_VENDOR_ID_AZWAVE,
322 0x2116),
323 .driver_data = ATH9K_PCI_CUS217 },
324 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
325 0x0034,
326 0x11AD, /* LITEON */
327 0x6661),
328 .driver_data = ATH9K_PCI_CUS217 },
329
Sujith Manoharanfca3c212013-06-21 11:11:52 +0530330 /* AR9462 with WoW support */
331 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
332 0x0034,
333 PCI_VENDOR_ID_ATHEROS,
334 0x3117),
335 .driver_data = ATH9K_PCI_WOW },
336 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
337 0x0034,
338 PCI_VENDOR_ID_LENOVO,
339 0x3214),
340 .driver_data = ATH9K_PCI_WOW },
341 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
342 0x0034,
343 PCI_VENDOR_ID_ATTANSIC,
344 0x0091),
345 .driver_data = ATH9K_PCI_WOW },
346 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
347 0x0034,
348 PCI_VENDOR_ID_AZWAVE,
349 0x2110),
350 .driver_data = ATH9K_PCI_WOW },
351 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
352 0x0034,
353 PCI_VENDOR_ID_ASUSTEK,
354 0x850E),
355 .driver_data = ATH9K_PCI_WOW },
356 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
357 0x0034,
358 0x11AD, /* LITEON */
359 0x6631),
360 .driver_data = ATH9K_PCI_WOW },
361 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
362 0x0034,
363 0x11AD, /* LITEON */
364 0x6641),
365 .driver_data = ATH9K_PCI_WOW },
366 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
367 0x0034,
368 PCI_VENDOR_ID_HP,
369 0x1864),
370 .driver_data = ATH9K_PCI_WOW },
371 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
372 0x0034,
373 0x14CD, /* USI */
374 0x0063),
375 .driver_data = ATH9K_PCI_WOW },
376 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
377 0x0034,
378 0x14CD, /* USI */
379 0x0064),
380 .driver_data = ATH9K_PCI_WOW },
381 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
382 0x0034,
383 0x10CF, /* Fujitsu */
384 0x1783),
385 .driver_data = ATH9K_PCI_WOW },
Damien Thébault050fd822017-04-06 13:51:10 +0200386 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
387 0x0034,
388 PCI_VENDOR_ID_DELL,
389 0x020B),
390 .driver_data = ATH9K_PCI_WOW },
Rosen Penev129e12a2017-07-28 15:15:47 +0300391 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
392 0x0034,
393 PCI_VENDOR_ID_DELL,
394 0x0300),
395 .driver_data = ATH9K_PCI_WOW },
Sujith Manoharanfca3c212013-06-21 11:11:52 +0530396
Sujith Manoharan4dd35642013-10-23 14:26:04 +0530397 /* Killer Wireless (2x2) */
398 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
399 0x0030,
400 0x1A56,
401 0x2003),
402 .driver_data = ATH9K_PCI_KILLER },
403
Rajkumar Manoharan423e38e2011-10-13 11:00:44 +0530404 { PCI_VDEVICE(ATHEROS, 0x0034) }, /* PCI-E AR9462 */
Mohammed Shafi Shajakhand4e59792012-08-02 11:58:50 +0530405 { PCI_VDEVICE(ATHEROS, 0x0037) }, /* PCI-E AR1111/AR9485 */
Sujith Manoharan1823a422013-09-02 13:59:04 +0530406
Sujith Manoharan10631332013-09-02 13:59:05 +0530407 /* CUS252 */
408 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
409 0x0036,
410 PCI_VENDOR_ID_ATHEROS,
411 0x3028),
Sujith Manoharan3fcdd0a2013-09-02 13:59:06 +0530412 .driver_data = ATH9K_PCI_CUS252 |
413 ATH9K_PCI_AR9565_2ANT |
414 ATH9K_PCI_BT_ANT_DIV },
Sujith Manoharan10631332013-09-02 13:59:05 +0530415 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
416 0x0036,
417 PCI_VENDOR_ID_AZWAVE,
418 0x2176),
Sujith Manoharan3fcdd0a2013-09-02 13:59:06 +0530419 .driver_data = ATH9K_PCI_CUS252 |
420 ATH9K_PCI_AR9565_2ANT |
421 ATH9K_PCI_BT_ANT_DIV },
422
423 /* WB335 1-ANT */
424 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
425 0x0036,
426 PCI_VENDOR_ID_FOXCONN,
427 0xE068),
428 .driver_data = ATH9K_PCI_AR9565_1ANT },
429 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
430 0x0036,
431 0x185F, /* WNC */
432 0xA119),
433 .driver_data = ATH9K_PCI_AR9565_1ANT },
434 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
435 0x0036,
436 0x11AD, /* LITEON */
437 0x0632),
438 .driver_data = ATH9K_PCI_AR9565_1ANT },
439 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
440 0x0036,
441 0x11AD, /* LITEON */
Sujith Manoharan9c362542014-01-09 08:51:13 +0530442 0x06B2),
443 .driver_data = ATH9K_PCI_AR9565_1ANT },
444 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
445 0x0036,
446 0x11AD, /* LITEON */
447 0x0842),
448 .driver_data = ATH9K_PCI_AR9565_1ANT },
449 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
450 0x0036,
451 0x11AD, /* LITEON */
Sujith Manoharanedea2acb2015-01-05 11:14:25 +0530452 0x1842),
453 .driver_data = ATH9K_PCI_AR9565_1ANT },
454 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
455 0x0036,
456 0x11AD, /* LITEON */
Sujith Manoharan3fcdd0a2013-09-02 13:59:06 +0530457 0x6671),
458 .driver_data = ATH9K_PCI_AR9565_1ANT },
459 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
460 0x0036,
461 0x1B9A, /* XAVI */
462 0x2811),
463 .driver_data = ATH9K_PCI_AR9565_1ANT },
464 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
465 0x0036,
466 0x1B9A, /* XAVI */
467 0x2812),
468 .driver_data = ATH9K_PCI_AR9565_1ANT },
Sujith Manoharan9c362542014-01-09 08:51:13 +0530469 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
470 0x0036,
471 0x1B9A, /* XAVI */
472 0x28A1),
473 .driver_data = ATH9K_PCI_AR9565_1ANT },
474 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
475 0x0036,
Sujith Manoharanedea2acb2015-01-05 11:14:25 +0530476 0x1B9A, /* XAVI */
477 0x28A3),
478 .driver_data = ATH9K_PCI_AR9565_1ANT },
479 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
480 0x0036,
Sujith Manoharan9c362542014-01-09 08:51:13 +0530481 PCI_VENDOR_ID_AZWAVE,
482 0x218A),
483 .driver_data = ATH9K_PCI_AR9565_1ANT },
Sujith Manoharanedea2acb2015-01-05 11:14:25 +0530484 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
485 0x0036,
486 PCI_VENDOR_ID_AZWAVE,
487 0x2F8A),
488 .driver_data = ATH9K_PCI_AR9565_1ANT },
Sujith Manoharan3fcdd0a2013-09-02 13:59:06 +0530489
490 /* WB335 1-ANT / Antenna Diversity */
491 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
492 0x0036,
493 PCI_VENDOR_ID_ATHEROS,
494 0x3025),
495 .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV },
496 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
497 0x0036,
498 PCI_VENDOR_ID_ATHEROS,
499 0x3026),
500 .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV },
501 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
502 0x0036,
503 PCI_VENDOR_ID_ATHEROS,
504 0x302B),
505 .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV },
506 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
507 0x0036,
508 PCI_VENDOR_ID_FOXCONN,
509 0xE069),
510 .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV },
511 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
512 0x0036,
513 0x185F, /* WNC */
514 0x3028),
515 .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV },
516 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
517 0x0036,
518 0x11AD, /* LITEON */
519 0x0622),
520 .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV },
521 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
522 0x0036,
523 0x11AD, /* LITEON */
524 0x0672),
525 .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV },
526 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
527 0x0036,
528 0x11AD, /* LITEON */
529 0x0662),
530 .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV },
531 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
532 0x0036,
Sujith Manoharan96581132013-10-23 13:53:28 +0530533 0x11AD, /* LITEON */
Sujith Manoharan9c362542014-01-09 08:51:13 +0530534 0x06A2),
535 .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV },
536 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
537 0x0036,
538 0x11AD, /* LITEON */
Sujith Manoharan96581132013-10-23 13:53:28 +0530539 0x0682),
540 .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV },
541 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
542 0x0036,
Sujith Manoharan3fcdd0a2013-09-02 13:59:06 +0530543 PCI_VENDOR_ID_AZWAVE,
544 0x213A),
545 .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV },
546 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
547 0x0036,
Sujith Manoharanedea2acb2015-01-05 11:14:25 +0530548 PCI_VENDOR_ID_AZWAVE,
549 0x213C),
550 .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV },
551 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
552 0x0036,
Sujith Manoharan3fcdd0a2013-09-02 13:59:06 +0530553 PCI_VENDOR_ID_HP,
554 0x18E3),
555 .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV },
556 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
557 0x0036,
558 PCI_VENDOR_ID_HP,
559 0x217F),
560 .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV },
Sujith Manoharanbf7c7562013-09-05 10:56:54 +0530561 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
562 0x0036,
Sujith Manoharan96581132013-10-23 13:53:28 +0530563 PCI_VENDOR_ID_HP,
564 0x2005),
565 .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV },
566 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
567 0x0036,
Sujith Manoharanbf7c7562013-09-05 10:56:54 +0530568 PCI_VENDOR_ID_DELL,
Sujith Manoharan9c362542014-01-09 08:51:13 +0530569 0x020C),
Sujith Manoharanbf7c7562013-09-05 10:56:54 +0530570 .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV },
Sujith Manoharan3fcdd0a2013-09-02 13:59:06 +0530571
Sujith Manoharan9c362542014-01-09 08:51:13 +0530572 /* WB335 2-ANT / Antenna-Diversity */
Sujith Manoharan3fcdd0a2013-09-02 13:59:06 +0530573 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
574 0x0036,
575 PCI_VENDOR_ID_SAMSUNG,
576 0x411A),
Sujith Manoharan9c362542014-01-09 08:51:13 +0530577 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
Sujith Manoharan3fcdd0a2013-09-02 13:59:06 +0530578 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
579 0x0036,
580 PCI_VENDOR_ID_SAMSUNG,
581 0x411B),
Sujith Manoharan9c362542014-01-09 08:51:13 +0530582 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
Sujith Manoharan3fcdd0a2013-09-02 13:59:06 +0530583 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
584 0x0036,
585 PCI_VENDOR_ID_SAMSUNG,
586 0x411C),
Sujith Manoharan9c362542014-01-09 08:51:13 +0530587 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
Sujith Manoharan3fcdd0a2013-09-02 13:59:06 +0530588 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
589 0x0036,
590 PCI_VENDOR_ID_SAMSUNG,
591 0x411D),
Sujith Manoharan9c362542014-01-09 08:51:13 +0530592 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
Sujith Manoharan3fcdd0a2013-09-02 13:59:06 +0530593 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
594 0x0036,
595 PCI_VENDOR_ID_SAMSUNG,
596 0x411E),
Sujith Manoharan9c362542014-01-09 08:51:13 +0530597 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
Sujith Manoharan3fcdd0a2013-09-02 13:59:06 +0530598 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
599 0x0036,
Sujith Manoharanedea2acb2015-01-05 11:14:25 +0530600 PCI_VENDOR_ID_SAMSUNG,
601 0x4129),
602 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
603 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
604 0x0036,
605 PCI_VENDOR_ID_SAMSUNG,
606 0x412A),
607 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
608 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
609 0x0036,
Sujith Manoharan3fcdd0a2013-09-02 13:59:06 +0530610 PCI_VENDOR_ID_ATHEROS,
611 0x3027),
612 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
613 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
614 0x0036,
615 PCI_VENDOR_ID_ATHEROS,
616 0x302C),
617 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
618 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
619 0x0036,
620 0x11AD, /* LITEON */
621 0x0642),
622 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
623 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
624 0x0036,
625 0x11AD, /* LITEON */
626 0x0652),
627 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
628 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
629 0x0036,
630 0x11AD, /* LITEON */
631 0x0612),
632 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
633 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
634 0x0036,
Sujith Manoharan9c362542014-01-09 08:51:13 +0530635 0x11AD, /* LITEON */
636 0x0832),
637 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
638 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
639 0x0036,
640 0x11AD, /* LITEON */
Sujith Manoharanedea2acb2015-01-05 11:14:25 +0530641 0x1832),
642 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
643 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
644 0x0036,
645 0x11AD, /* LITEON */
Sujith Manoharan9c362542014-01-09 08:51:13 +0530646 0x0692),
647 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
648 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
649 0x0036,
Sujith Manoharanedea2acb2015-01-05 11:14:25 +0530650 0x11AD, /* LITEON */
651 0x0803),
652 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
653 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
654 0x0036,
655 0x11AD, /* LITEON */
656 0x0813),
657 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
658 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
659 0x0036,
Sujith Manoharan3fcdd0a2013-09-02 13:59:06 +0530660 PCI_VENDOR_ID_AZWAVE,
661 0x2130),
662 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
663 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
664 0x0036,
Sujith Manoharan9c362542014-01-09 08:51:13 +0530665 PCI_VENDOR_ID_AZWAVE,
666 0x213B),
667 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
668 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
669 0x0036,
670 PCI_VENDOR_ID_AZWAVE,
671 0x2182),
672 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
673 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
674 0x0036,
Sujith Manoharanedea2acb2015-01-05 11:14:25 +0530675 PCI_VENDOR_ID_AZWAVE,
676 0x218B),
677 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
678 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
679 0x0036,
680 PCI_VENDOR_ID_AZWAVE,
681 0x218C),
682 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
683 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
684 0x0036,
685 PCI_VENDOR_ID_AZWAVE,
686 0x2F82),
687 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
688 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
689 0x0036,
Sujith Manoharan3fcdd0a2013-09-02 13:59:06 +0530690 0x144F, /* ASKEY */
691 0x7202),
692 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
693 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
694 0x0036,
695 0x1B9A, /* XAVI */
696 0x2810),
697 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
698 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
699 0x0036,
Sujith Manoharan9c362542014-01-09 08:51:13 +0530700 0x1B9A, /* XAVI */
Sujith Manoharanedea2acb2015-01-05 11:14:25 +0530701 0x2813),
702 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
703 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
704 0x0036,
705 0x1B9A, /* XAVI */
Sujith Manoharan9c362542014-01-09 08:51:13 +0530706 0x28A2),
707 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
708 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
709 0x0036,
Sujith Manoharanedea2acb2015-01-05 11:14:25 +0530710 0x1B9A, /* XAVI */
711 0x28A4),
712 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
713 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
714 0x0036,
Sujith Manoharan3fcdd0a2013-09-02 13:59:06 +0530715 0x185F, /* WNC */
716 0x3027),
717 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
Sujith Manoharan96581132013-10-23 13:53:28 +0530718 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
719 0x0036,
720 0x185F, /* WNC */
721 0xA120),
722 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
723 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
724 0x0036,
725 PCI_VENDOR_ID_FOXCONN,
726 0xE07F),
727 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
Sujith Manoharan9c362542014-01-09 08:51:13 +0530728 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
729 0x0036,
730 PCI_VENDOR_ID_FOXCONN,
Sujith Manoharanedea2acb2015-01-05 11:14:25 +0530731 0xE08F),
732 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
733 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
734 0x0036,
735 PCI_VENDOR_ID_FOXCONN,
Sujith Manoharan9c362542014-01-09 08:51:13 +0530736 0xE081),
737 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
738 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
739 0x0036,
Sujith Manoharanedea2acb2015-01-05 11:14:25 +0530740 PCI_VENDOR_ID_FOXCONN,
741 0xE091),
742 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
743 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
744 0x0036,
745 PCI_VENDOR_ID_FOXCONN,
746 0xE099),
747 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
748 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
749 0x0036,
Sujith Manoharan9c362542014-01-09 08:51:13 +0530750 PCI_VENDOR_ID_LENOVO,
751 0x3026),
752 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
753 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
754 0x0036,
755 PCI_VENDOR_ID_LENOVO,
756 0x4026),
757 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
758 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
759 0x0036,
760 PCI_VENDOR_ID_ASUSTEK,
761 0x85F2),
762 .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV },
763 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
764 0x0036,
765 PCI_VENDOR_ID_DELL,
766 0x020E),
Sujith Manoharanaeeb2062014-11-16 06:11:02 +0530767 .driver_data = ATH9K_PCI_AR9565_2ANT |
768 ATH9K_PCI_BT_ANT_DIV |
769 ATH9K_PCI_LED_ACT_HI},
Sujith Manoharan10631332013-09-02 13:59:05 +0530770
Sujith Manoharan1823a422013-09-02 13:59:04 +0530771 /* PCI-E AR9565 (WB335) */
772 { PCI_VDEVICE(ATHEROS, 0x0036),
773 .driver_data = ATH9K_PCI_BT_ANT_DIV },
Felix Fietkau935477e2014-10-25 17:19:26 +0200774#endif
Sujith Manoharan1823a422013-09-02 13:59:04 +0530775
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100776 { 0 }
777};
778
Stanislaw Gruszka84c87dc2011-08-05 13:10:32 +0200779
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100780/* return bus cachesize in 4B word units */
Luis R. Rodriguez5bb12792009-09-14 00:55:09 -0700781static void ath_pci_read_cachesize(struct ath_common *common, int *csz)
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100782{
Luis R. Rodriguezbc974f42009-09-28 02:54:40 -0400783 struct ath_softc *sc = (struct ath_softc *) common->priv;
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100784 u8 u8tmp;
785
Vasanthakumar Thiagarajanf0209792009-09-07 17:46:50 +0530786 pci_read_config_byte(to_pci_dev(sc->dev), PCI_CACHE_LINE_SIZE, &u8tmp);
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100787 *csz = (int)u8tmp;
788
789 /*
Lucas De Marchi25985ed2011-03-30 22:57:33 -0300790 * This check was put in to avoid "unpleasant" consequences if
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100791 * the bootrom has not fully initialized all PCI devices.
792 * Sometimes the cache line size register is not set
793 */
794
795 if (*csz == 0)
796 *csz = DEFAULT_CACHELINE >> 2; /* Use the default size */
797}
798
Luis R. Rodriguez5bb12792009-09-14 00:55:09 -0700799static bool ath_pci_eeprom_read(struct ath_common *common, u32 off, u16 *data)
Gabor Juhos9dbeb912009-01-14 20:17:08 +0100800{
Martin Blumenstingl56398512016-07-10 01:09:55 +0200801 struct ath_hw *ah = (struct ath_hw *) common->ah;
Luis R. Rodriguez5bb12792009-09-14 00:55:09 -0700802
Martin Blumenstingl56398512016-07-10 01:09:55 +0200803 common->ops->read(ah, AR5416_EEPROM_OFFSET + (off << AR5416_EEPROM_S));
Eduardo Abinader0f27ac402016-06-29 19:29:29 +0300804
Martin Blumenstingl56398512016-07-10 01:09:55 +0200805 if (!ath9k_hw_wait(ah,
806 AR_EEPROM_STATUS_DATA,
807 AR_EEPROM_STATUS_DATA_BUSY |
808 AR_EEPROM_STATUS_DATA_PROT_ACCESS, 0,
809 AH_WAIT_TIMEOUT)) {
810 return false;
Gabor Juhos9dbeb912009-01-14 20:17:08 +0100811 }
812
Martin Blumenstingl56398512016-07-10 01:09:55 +0200813 *data = MS(common->ops->read(ah, AR_EEPROM_STATUS_DATA),
814 AR_EEPROM_STATUS_DATA_VAL);
815
Gabor Juhos9dbeb912009-01-14 20:17:08 +0100816 return true;
817}
818
Stanislaw Gruszka69ce6742011-08-05 13:10:34 +0200819/* Need to be called after we discover btcoex capabilities */
Stanislaw Gruszkad4930082011-07-29 15:59:08 +0200820static void ath_pci_aspm_init(struct ath_common *common)
821{
822 struct ath_softc *sc = (struct ath_softc *) common->priv;
823 struct ath_hw *ah = sc->sc_ah;
824 struct pci_dev *pdev = to_pci_dev(sc->dev);
825 struct pci_dev *parent;
Jiang Liu08bd1082012-07-24 17:20:25 +0800826 u16 aspm;
Stanislaw Gruszkad4930082011-07-29 15:59:08 +0200827
Sujith Manoharand09f5f42012-06-04 16:27:14 +0530828 if (!ah->is_pciexpress)
829 return;
830
Stanislaw Gruszkad4930082011-07-29 15:59:08 +0200831 parent = pdev->bus->self;
John W. Linville22c55e62011-08-24 14:08:41 -0400832 if (!parent)
833 return;
Stanislaw Gruszka69ce6742011-08-05 13:10:34 +0200834
Sujith Manoharan046b6802012-09-22 00:14:28 +0530835 if ((ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) &&
836 (AR_SREV_9285(ah))) {
Bjorn Helgaasa8756212012-12-05 13:51:19 -0700837 /* Bluetooth coexistence requires disabling ASPM. */
Jiang Liu08bd1082012-07-24 17:20:25 +0800838 pcie_capability_clear_word(pdev, PCI_EXP_LNKCTL,
Bjorn Helgaasa8756212012-12-05 13:51:19 -0700839 PCI_EXP_LNKCTL_ASPM_L0S | PCI_EXP_LNKCTL_ASPM_L1);
Stanislaw Gruszka69ce6742011-08-05 13:10:34 +0200840
841 /*
842 * Both upstream and downstream PCIe components should
843 * have the same ASPM settings.
844 */
Jiang Liu08bd1082012-07-24 17:20:25 +0800845 pcie_capability_clear_word(parent, PCI_EXP_LNKCTL,
Bjorn Helgaasa8756212012-12-05 13:51:19 -0700846 PCI_EXP_LNKCTL_ASPM_L0S | PCI_EXP_LNKCTL_ASPM_L1);
Stanislaw Gruszka69ce6742011-08-05 13:10:34 +0200847
Sujith Manoharand09f5f42012-06-04 16:27:14 +0530848 ath_info(common, "Disabling ASPM since BTCOEX is enabled\n");
Stanislaw Gruszka69ce6742011-08-05 13:10:34 +0200849 return;
850 }
851
Sujith Manoharanb380a43b2013-08-25 14:43:09 +0530852 /*
853 * 0x70c - Ack Frequency Register.
854 *
855 * Bits 27:29 - DEFAULT_L1_ENTRANCE_LATENCY.
856 *
857 * 000 : 1 us
858 * 001 : 2 us
859 * 010 : 4 us
860 * 011 : 8 us
861 * 100 : 16 us
862 * 101 : 32 us
863 * 110/111 : 64 us
864 */
865 if (AR_SREV_9462(ah))
866 pci_read_config_dword(pdev, 0x70c, &ah->config.aspm_l1_fix);
867
Jiang Liu08bd1082012-07-24 17:20:25 +0800868 pcie_capability_read_word(parent, PCI_EXP_LNKCTL, &aspm);
Bjorn Helgaasa8756212012-12-05 13:51:19 -0700869 if (aspm & (PCI_EXP_LNKCTL_ASPM_L0S | PCI_EXP_LNKCTL_ASPM_L1)) {
Stanislaw Gruszkad4930082011-07-29 15:59:08 +0200870 ah->aspm_enabled = true;
871 /* Initialize PCIe PM and SERDES registers. */
Stanislaw Gruszka84c87dc2011-08-05 13:10:32 +0200872 ath9k_hw_configpcipowersave(ah, false);
Sujith Manoharand09f5f42012-06-04 16:27:14 +0530873 ath_info(common, "ASPM enabled: 0x%x\n", aspm);
Stanislaw Gruszkad4930082011-07-29 15:59:08 +0200874 }
875}
876
Tobias Klauser83bd11a2009-12-23 14:04:43 +0100877static const struct ath_bus_ops ath_pci_bus_ops = {
Sujith497ad9a2010-04-01 10:28:20 +0530878 .ath_bus_type = ATH_PCI,
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100879 .read_cachesize = ath_pci_read_cachesize,
Gabor Juhos9dbeb912009-01-14 20:17:08 +0100880 .eeprom_read = ath_pci_eeprom_read,
Stanislaw Gruszkad4930082011-07-29 15:59:08 +0200881 .aspm_init = ath_pci_aspm_init,
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100882};
883
884static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
885{
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100886 struct ath_softc *sc;
887 struct ieee80211_hw *hw;
888 u8 csz;
Jouni Malinenf0214842009-06-16 11:59:23 +0300889 u32 val;
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100890 int ret = 0;
Luis R. Rodriguezf934c4d2009-10-27 12:59:34 -0400891 char hw_name[64];
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100892
Felix Fietkaub81950b12012-12-12 13:14:22 +0100893 if (pcim_enable_device(pdev))
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100894 return -EIO;
895
Yang Hongyange9304382009-04-13 14:40:14 -0700896 ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100897 if (ret) {
Joe Perches516304b2012-03-18 17:30:52 -0700898 pr_err("32-bit DMA not available\n");
Felix Fietkaub81950b12012-12-12 13:14:22 +0100899 return ret;
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100900 }
901
Yang Hongyange9304382009-04-13 14:40:14 -0700902 ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100903 if (ret) {
Joe Perches516304b2012-03-18 17:30:52 -0700904 pr_err("32-bit DMA consistent DMA enable failed\n");
Felix Fietkaub81950b12012-12-12 13:14:22 +0100905 return ret;
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100906 }
907
908 /*
909 * Cache line size is used to size and align various
910 * structures used to communicate with the hardware.
911 */
912 pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &csz);
913 if (csz == 0) {
914 /*
915 * Linux 2.4.18 (at least) writes the cache line size
916 * register as a 16-bit wide register which is wrong.
917 * We must have this setup properly for rx buffer
918 * DMA to work so force a reasonable value here if it
919 * comes up zero.
920 */
921 csz = L1_CACHE_BYTES / sizeof(u32);
922 pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, csz);
923 }
924 /*
925 * The default setting of latency timer yields poor results,
926 * set it to the value used by other systems. It may be worth
927 * tweaking this setting more.
928 */
929 pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xa8);
930
931 pci_set_master(pdev);
932
Jouni Malinenf0214842009-06-16 11:59:23 +0300933 /*
934 * Disable the RETRY_TIMEOUT register (0x41) to keep
935 * PCI Tx retries from interfering with C3 CPU state.
936 */
937 pci_read_config_dword(pdev, 0x40, &val);
938 if ((val & 0x0000ff00) != 0)
939 pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
940
Felix Fietkaub81950b12012-12-12 13:14:22 +0100941 ret = pcim_iomap_regions(pdev, BIT(0), "ath9k");
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100942 if (ret) {
943 dev_err(&pdev->dev, "PCI memory region reserve error\n");
Felix Fietkaub81950b12012-12-12 13:14:22 +0100944 return -ENODEV;
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100945 }
946
Felix Fietkau78b21942014-06-11 16:17:55 +0530947 ath9k_fill_chanctx_ops();
Felix Fietkau9ac586152011-01-24 19:23:18 +0100948 hw = ieee80211_alloc_hw(sizeof(struct ath_softc), &ath9k_ops);
Luis R. Rodriguezdb6be532009-09-02 16:34:57 -0700949 if (!hw) {
Sujith285f2dd2010-01-08 10:36:07 +0530950 dev_err(&pdev->dev, "No memory for ieee80211_hw\n");
Felix Fietkaub81950b12012-12-12 13:14:22 +0100951 return -ENOMEM;
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100952 }
953
954 SET_IEEE80211_DEV(hw, &pdev->dev);
955 pci_set_drvdata(pdev, hw);
956
Felix Fietkau9ac586152011-01-24 19:23:18 +0100957 sc = hw->priv;
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100958 sc->hw = hw;
959 sc->dev = &pdev->dev;
Felix Fietkaub81950b12012-12-12 13:14:22 +0100960 sc->mem = pcim_iomap_table(pdev)[0];
Sujith Manoharan9b60b642013-06-13 22:51:26 +0530961 sc->driver_data = id->driver_data;
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100962
Luis R. Rodriguezfc548af2009-09-02 17:06:21 -0700963 ret = request_irq(pdev->irq, ath_isr, IRQF_SHARED, "ath9k", sc);
Luis R. Rodriguez580171f2009-09-02 17:02:18 -0700964 if (ret) {
965 dev_err(&pdev->dev, "request_irq failed\n");
Sujith285f2dd2010-01-08 10:36:07 +0530966 goto err_irq;
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100967 }
968
969 sc->irq = pdev->irq;
970
Pavel Roskineb93e892011-07-23 03:55:39 -0400971 ret = ath9k_init_device(id->device, sc, &ath_pci_bus_ops);
Sujith285f2dd2010-01-08 10:36:07 +0530972 if (ret) {
973 dev_err(&pdev->dev, "Failed to initialize device\n");
974 goto err_init;
975 }
976
977 ath9k_hw_name(sc->sc_ah, hw_name, sizeof(hw_name));
Joe Perchesc96c31e2010-07-26 14:39:58 -0700978 wiphy_info(hw->wiphy, "%s mem=0x%lx, irq=%d\n",
Felix Fietkaub81950b12012-12-12 13:14:22 +0100979 hw_name, (unsigned long)sc->mem, pdev->irq);
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100980
981 return 0;
Sujith285f2dd2010-01-08 10:36:07 +0530982
983err_init:
984 free_irq(sc->irq, sc);
985err_irq:
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100986 ieee80211_free_hw(hw);
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100987 return ret;
988}
989
990static void ath_pci_remove(struct pci_dev *pdev)
991{
992 struct ieee80211_hw *hw = pci_get_drvdata(pdev);
Felix Fietkau9ac586152011-01-24 19:23:18 +0100993 struct ath_softc *sc = hw->priv;
Gabor Juhos6baff7f2009-01-14 20:17:06 +0100994
Rajkumar Manoharand5847472010-12-20 14:39:51 +0530995 if (!is_ath9k_unloaded)
996 sc->sc_ah->ah_flags |= AH_UNPLUGGED;
Sujith285f2dd2010-01-08 10:36:07 +0530997 ath9k_deinit_device(sc);
998 free_irq(sc->irq, sc);
999 ieee80211_free_hw(sc->hw);
Gabor Juhos6baff7f2009-01-14 20:17:06 +01001000}
1001
Hauke Mehrtens88427582012-11-29 23:27:15 +01001002#ifdef CONFIG_PM_SLEEP
Gabor Juhos6baff7f2009-01-14 20:17:06 +01001003
Rafael J. Wysockif0e94b42010-10-16 00:36:17 +02001004static int ath_pci_suspend(struct device *device)
Gabor Juhos6baff7f2009-01-14 20:17:06 +01001005{
Rafael J. Wysockif0e94b42010-10-16 00:36:17 +02001006 struct pci_dev *pdev = to_pci_dev(device);
Gabor Juhos6baff7f2009-01-14 20:17:06 +01001007 struct ieee80211_hw *hw = pci_get_drvdata(pdev);
Felix Fietkau9ac586152011-01-24 19:23:18 +01001008 struct ath_softc *sc = hw->priv;
Sujith Manoharan249943a2015-01-30 19:05:27 +05301009 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
Gabor Juhos6baff7f2009-01-14 20:17:06 +01001010
Sujith Manoharan249943a2015-01-30 19:05:27 +05301011 if (test_bit(ATH_OP_WOW_ENABLED, &common->op_flags)) {
1012 dev_info(&pdev->dev, "WOW is enabled, bypassing PCI suspend\n");
Mohammed Shafi Shajakhan4a17a502012-07-10 14:57:11 +05301013 return 0;
Sujith Manoharan249943a2015-01-30 19:05:27 +05301014 }
Mohammed Shafi Shajakhan4a17a502012-07-10 14:57:11 +05301015
Rajkumar Manoharanc31eb8e2011-06-28 18:21:19 +05301016 /* The device has to be moved to FULLSLEEP forcibly.
1017 * Otherwise the chip never moved to full sleep,
1018 * when no interface is up.
1019 */
Rajkumar Manoharane19f15a2012-08-09 12:37:26 +05301020 ath9k_stop_btcoex(sc);
Felix Fietkauc0c11742011-11-16 13:08:41 +01001021 ath9k_hw_disable(sc->sc_ah);
Rajkumar Manoharan1c48f982014-05-22 14:11:41 +05301022 del_timer_sync(&sc->sleep_timer);
Rajkumar Manoharanc31eb8e2011-06-28 18:21:19 +05301023 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP);
1024
Gabor Juhos6baff7f2009-01-14 20:17:06 +01001025 return 0;
1026}
1027
Rafael J. Wysockif0e94b42010-10-16 00:36:17 +02001028static int ath_pci_resume(struct device *device)
Gabor Juhos6baff7f2009-01-14 20:17:06 +01001029{
Rafael J. Wysockif0e94b42010-10-16 00:36:17 +02001030 struct pci_dev *pdev = to_pci_dev(device);
Felix Fietkau93170512012-10-03 21:07:50 +02001031 struct ieee80211_hw *hw = pci_get_drvdata(pdev);
1032 struct ath_softc *sc = hw->priv;
Felix Fietkauceb26a62012-10-03 21:07:51 +02001033 struct ath_hw *ah = sc->sc_ah;
1034 struct ath_common *common = ath9k_hw_common(ah);
Jouni Malinenf0214842009-06-16 11:59:23 +03001035 u32 val;
Sujith523c36f2009-08-13 09:34:35 +05301036
Jouni Malinenf0214842009-06-16 11:59:23 +03001037 /*
1038 * Suspend/Resume resets the PCI configuration space, so we have to
1039 * re-disable the RETRY_TIMEOUT register (0x41) to keep
1040 * PCI Tx retries from interfering with C3 CPU state
1041 */
1042 pci_read_config_dword(pdev, 0x40, &val);
1043 if ((val & 0x0000ff00) != 0)
1044 pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
Gabor Juhos6baff7f2009-01-14 20:17:06 +01001045
Felix Fietkau93170512012-10-03 21:07:50 +02001046 ath_pci_aspm_init(common);
Felix Fietkauceb26a62012-10-03 21:07:51 +02001047 ah->reset_power_on = false;
Felix Fietkau93170512012-10-03 21:07:50 +02001048
Gabor Juhos6baff7f2009-01-14 20:17:06 +01001049 return 0;
1050}
1051
Hauke Mehrtens88427582012-11-29 23:27:15 +01001052static SIMPLE_DEV_PM_OPS(ath9k_pm_ops, ath_pci_suspend, ath_pci_resume);
Rafael J. Wysockif0e94b42010-10-16 00:36:17 +02001053
1054#define ATH9K_PM_OPS (&ath9k_pm_ops)
1055
Hauke Mehrtens88427582012-11-29 23:27:15 +01001056#else /* !CONFIG_PM_SLEEP */
Rafael J. Wysockif0e94b42010-10-16 00:36:17 +02001057
1058#define ATH9K_PM_OPS NULL
1059
Hauke Mehrtens88427582012-11-29 23:27:15 +01001060#endif /* !CONFIG_PM_SLEEP */
Rafael J. Wysockif0e94b42010-10-16 00:36:17 +02001061
Gabor Juhos6baff7f2009-01-14 20:17:06 +01001062
1063MODULE_DEVICE_TABLE(pci, ath_pci_id_table);
1064
1065static struct pci_driver ath_pci_driver = {
1066 .name = "ath9k",
1067 .id_table = ath_pci_id_table,
1068 .probe = ath_pci_probe,
1069 .remove = ath_pci_remove,
Rafael J. Wysockif0e94b42010-10-16 00:36:17 +02001070 .driver.pm = ATH9K_PM_OPS,
Gabor Juhos6baff7f2009-01-14 20:17:06 +01001071};
1072
Sujithdb0f41f2009-02-20 15:13:26 +05301073int ath_pci_init(void)
Gabor Juhos6baff7f2009-01-14 20:17:06 +01001074{
1075 return pci_register_driver(&ath_pci_driver);
1076}
1077
1078void ath_pci_exit(void)
1079{
1080 pci_unregister_driver(&ath_pci_driver);
1081}