Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 1 | /* |
Sujith Manoharan | 5b68138 | 2011-05-17 13:36:18 +0530 | [diff] [blame] | 2 | * Copyright (c) 2008-2011 Atheros Communications Inc. |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 3 | * |
| 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 Perches | 516304b | 2012-03-18 17:30:52 -0700 | [diff] [blame] | 17 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| 18 | |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 19 | #include <linux/nl80211.h> |
| 20 | #include <linux/pci.h> |
Stanislaw Gruszka | d493008 | 2011-07-29 15:59:08 +0200 | [diff] [blame] | 21 | #include <linux/pci-aspm.h> |
Paul Gortmaker | 9d9779e | 2011-07-03 15:21:01 -0400 | [diff] [blame] | 22 | #include <linux/module.h> |
Sujith | 394cf0a | 2009-02-09 13:26:54 +0530 | [diff] [blame] | 23 | #include "ath9k.h" |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 24 | |
Benoit Taine | 9baa3c3 | 2014-08-08 15:56:03 +0200 | [diff] [blame] | 25 | static const struct pci_device_id ath_pci_id_table[] = { |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 26 | { PCI_VDEVICE(ATHEROS, 0x0023) }, /* PCI */ |
| 27 | { PCI_VDEVICE(ATHEROS, 0x0024) }, /* PCI-E */ |
| 28 | { PCI_VDEVICE(ATHEROS, 0x0027) }, /* PCI */ |
Vittorio Gambaletta (VittGam) | 0f9edcd | 2016-04-11 04:48:55 +0200 | [diff] [blame] | 29 | |
| 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) | 79e57dd1 | 2016-11-09 03:40:56 +0200 | [diff] [blame] | 39 | { PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI */ |
Sujith Manoharan | a5354cc | 2013-08-04 14:21:58 +0530 | [diff] [blame] | 40 | |
Felix Fietkau | 935477e | 2014-10-25 17:19:26 +0200 | [diff] [blame] | 41 | #ifdef CONFIG_ATH9K_PCOEM |
Sujith Manoharan | d1ae25a | 2013-08-25 16:30:40 +0530 | [diff] [blame] | 42 | { 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) | 79e57dd1 | 2016-11-09 03:40:56 +0200 | [diff] [blame] | 87 | #endif |
Sujith Manoharan | d1ae25a | 2013-08-25 16:30:40 +0530 | [diff] [blame] | 88 | |
Vittorio Gambaletta (VittGam) | 79e57dd1 | 2016-11-09 03:40:56 +0200 | [diff] [blame] | 89 | { PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */ |
| 90 | |
| 91 | #ifdef CONFIG_ATH9K_PCOEM |
Sujith Manoharan | a5354cc | 2013-08-04 14:21:58 +0530 | [diff] [blame] | 92 | /* 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 Fietkau | 935477e | 2014-10-25 17:19:26 +0200 | [diff] [blame] | 98 | #endif |
Sujith Manoharan | a5354cc | 2013-08-04 14:21:58 +0530 | [diff] [blame] | 99 | |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 100 | { PCI_VDEVICE(ATHEROS, 0x002B) }, /* PCI-E */ |
Luis R. Rodriguez | 5ffaf8a | 2010-02-02 11:58:33 -0500 | [diff] [blame] | 101 | { PCI_VDEVICE(ATHEROS, 0x002C) }, /* PCI-E 802.11n bonded out */ |
Vivek Natarajan | ac88b6e | 2009-07-23 10:59:57 +0530 | [diff] [blame] | 102 | { PCI_VDEVICE(ATHEROS, 0x002D) }, /* PCI */ |
| 103 | { PCI_VDEVICE(ATHEROS, 0x002E) }, /* PCI-E */ |
Sujith Manoharan | 4dd3564 | 2013-10-23 14:26:04 +0530 | [diff] [blame] | 104 | |
| 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. Rodriguez | 0efabd5 | 2010-06-12 00:34:02 -0400 | [diff] [blame] | 117 | { PCI_VDEVICE(ATHEROS, 0x0030) }, /* PCI-E AR9300 */ |
Sujith Manoharan | 9b60b64 | 2013-06-13 22:51:26 +0530 | [diff] [blame] | 118 | |
Felix Fietkau | 935477e | 2014-10-25 17:19:26 +0200 | [diff] [blame] | 119 | #ifdef CONFIG_ATH9K_PCOEM |
Sujith Manoharan | 9b60b64 | 2013-06-13 22:51:26 +0530 | [diff] [blame] | 120 | /* PCI-E CUS198 */ |
| 121 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 122 | 0x0032, |
| 123 | PCI_VENDOR_ID_AZWAVE, |
| 124 | 0x2086), |
Sujith Manoharan | a5354cc | 2013-08-04 14:21:58 +0530 | [diff] [blame] | 125 | .driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 9b60b64 | 2013-06-13 22:51:26 +0530 | [diff] [blame] | 126 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 127 | 0x0032, |
| 128 | PCI_VENDOR_ID_AZWAVE, |
| 129 | 0x1237), |
Sujith Manoharan | a5354cc | 2013-08-04 14:21:58 +0530 | [diff] [blame] | 130 | .driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 9b60b64 | 2013-06-13 22:51:26 +0530 | [diff] [blame] | 131 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 132 | 0x0032, |
| 133 | PCI_VENDOR_ID_AZWAVE, |
| 134 | 0x2126), |
Sujith Manoharan | a5354cc | 2013-08-04 14:21:58 +0530 | [diff] [blame] | 135 | .driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | f4d9070 | 2013-08-20 13:05:58 +0530 | [diff] [blame] | 136 | { 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 Manoharan | e861ef5 | 2013-06-18 10:13:43 +0530 | [diff] [blame] | 141 | |
| 142 | /* PCI-E CUS230 */ |
Sujith Manoharan | 9b60b64 | 2013-06-13 22:51:26 +0530 | [diff] [blame] | 143 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 144 | 0x0032, |
| 145 | PCI_VENDOR_ID_AZWAVE, |
| 146 | 0x2152), |
Sujith Manoharan | a5354cc | 2013-08-04 14:21:58 +0530 | [diff] [blame] | 147 | .driver_data = ATH9K_PCI_CUS230 | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 9b60b64 | 2013-06-13 22:51:26 +0530 | [diff] [blame] | 148 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 149 | 0x0032, |
| 150 | PCI_VENDOR_ID_FOXCONN, |
| 151 | 0xE075), |
Sujith Manoharan | a5354cc | 2013-08-04 14:21:58 +0530 | [diff] [blame] | 152 | .driver_data = ATH9K_PCI_CUS230 | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 9b60b64 | 2013-06-13 22:51:26 +0530 | [diff] [blame] | 153 | |
Sujith Manoharan | 2952f6e | 2013-08-05 15:08:28 +0530 | [diff] [blame] | 154 | /* 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 Manoharan | 2d22c7d | 2013-11-08 11:45:25 +0530 | [diff] [blame] | 226 | /* 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 Fietkau | 935477e | 2014-10-25 17:19:26 +0200 | [diff] [blame] | 312 | #endif |
Sujith Manoharan | 2d22c7d | 2013-11-08 11:45:25 +0530 | [diff] [blame] | 313 | |
Vasanthakumar Thiagarajan | 1435894 | 2010-12-06 04:28:00 -0800 | [diff] [blame] | 314 | { PCI_VDEVICE(ATHEROS, 0x0032) }, /* PCI-E AR9485 */ |
Luis R. Rodriguez | a508a6e | 2011-08-23 13:37:07 -0700 | [diff] [blame] | 315 | { PCI_VDEVICE(ATHEROS, 0x0033) }, /* PCI-E AR9580 */ |
Sujith Manoharan | 12eea64 | 2013-06-18 15:42:36 +0530 | [diff] [blame] | 316 | |
Felix Fietkau | 935477e | 2014-10-25 17:19:26 +0200 | [diff] [blame] | 317 | #ifdef CONFIG_ATH9K_PCOEM |
Sujith Manoharan | 12eea64 | 2013-06-18 15:42:36 +0530 | [diff] [blame] | 318 | /* 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 Manoharan | fca3c21 | 2013-06-21 11:11:52 +0530 | [diff] [blame] | 330 | /* 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ébault | 050fd82 | 2017-04-06 13:51:10 +0200 | [diff] [blame] | 386 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 387 | 0x0034, |
| 388 | PCI_VENDOR_ID_DELL, |
| 389 | 0x020B), |
| 390 | .driver_data = ATH9K_PCI_WOW }, |
Rosen Penev | 129e12a | 2017-07-28 15:15:47 +0300 | [diff] [blame] | 391 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 392 | 0x0034, |
| 393 | PCI_VENDOR_ID_DELL, |
| 394 | 0x0300), |
| 395 | .driver_data = ATH9K_PCI_WOW }, |
Sujith Manoharan | fca3c21 | 2013-06-21 11:11:52 +0530 | [diff] [blame] | 396 | |
Sujith Manoharan | 4dd3564 | 2013-10-23 14:26:04 +0530 | [diff] [blame] | 397 | /* 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 Manoharan | 423e38e | 2011-10-13 11:00:44 +0530 | [diff] [blame] | 404 | { PCI_VDEVICE(ATHEROS, 0x0034) }, /* PCI-E AR9462 */ |
Mohammed Shafi Shajakhan | d4e5979 | 2012-08-02 11:58:50 +0530 | [diff] [blame] | 405 | { PCI_VDEVICE(ATHEROS, 0x0037) }, /* PCI-E AR1111/AR9485 */ |
Sujith Manoharan | 1823a42 | 2013-09-02 13:59:04 +0530 | [diff] [blame] | 406 | |
Sujith Manoharan | 1063133 | 2013-09-02 13:59:05 +0530 | [diff] [blame] | 407 | /* CUS252 */ |
| 408 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 409 | 0x0036, |
| 410 | PCI_VENDOR_ID_ATHEROS, |
| 411 | 0x3028), |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 412 | .driver_data = ATH9K_PCI_CUS252 | |
| 413 | ATH9K_PCI_AR9565_2ANT | |
| 414 | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 1063133 | 2013-09-02 13:59:05 +0530 | [diff] [blame] | 415 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 416 | 0x0036, |
| 417 | PCI_VENDOR_ID_AZWAVE, |
| 418 | 0x2176), |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 419 | .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 Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 442 | 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 Manoharan | edea2acb | 2015-01-05 11:14:25 +0530 | [diff] [blame] | 452 | 0x1842), |
| 453 | .driver_data = ATH9K_PCI_AR9565_1ANT }, |
| 454 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 455 | 0x0036, |
| 456 | 0x11AD, /* LITEON */ |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 457 | 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 Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 469 | { 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 Manoharan | edea2acb | 2015-01-05 11:14:25 +0530 | [diff] [blame] | 476 | 0x1B9A, /* XAVI */ |
| 477 | 0x28A3), |
| 478 | .driver_data = ATH9K_PCI_AR9565_1ANT }, |
| 479 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 480 | 0x0036, |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 481 | PCI_VENDOR_ID_AZWAVE, |
| 482 | 0x218A), |
| 483 | .driver_data = ATH9K_PCI_AR9565_1ANT }, |
Sujith Manoharan | edea2acb | 2015-01-05 11:14:25 +0530 | [diff] [blame] | 484 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 485 | 0x0036, |
| 486 | PCI_VENDOR_ID_AZWAVE, |
| 487 | 0x2F8A), |
| 488 | .driver_data = ATH9K_PCI_AR9565_1ANT }, |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 489 | |
| 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 Manoharan | 9658113 | 2013-10-23 13:53:28 +0530 | [diff] [blame] | 533 | 0x11AD, /* LITEON */ |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 534 | 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 Manoharan | 9658113 | 2013-10-23 13:53:28 +0530 | [diff] [blame] | 539 | 0x0682), |
| 540 | .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 541 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 542 | 0x0036, |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 543 | 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 Manoharan | edea2acb | 2015-01-05 11:14:25 +0530 | [diff] [blame] | 548 | 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 Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 553 | 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 Manoharan | bf7c756 | 2013-09-05 10:56:54 +0530 | [diff] [blame] | 561 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 562 | 0x0036, |
Sujith Manoharan | 9658113 | 2013-10-23 13:53:28 +0530 | [diff] [blame] | 563 | 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 Manoharan | bf7c756 | 2013-09-05 10:56:54 +0530 | [diff] [blame] | 568 | PCI_VENDOR_ID_DELL, |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 569 | 0x020C), |
Sujith Manoharan | bf7c756 | 2013-09-05 10:56:54 +0530 | [diff] [blame] | 570 | .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 571 | |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 572 | /* WB335 2-ANT / Antenna-Diversity */ |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 573 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 574 | 0x0036, |
| 575 | PCI_VENDOR_ID_SAMSUNG, |
| 576 | 0x411A), |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 577 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 578 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 579 | 0x0036, |
| 580 | PCI_VENDOR_ID_SAMSUNG, |
| 581 | 0x411B), |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 582 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 583 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 584 | 0x0036, |
| 585 | PCI_VENDOR_ID_SAMSUNG, |
| 586 | 0x411C), |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 587 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 588 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 589 | 0x0036, |
| 590 | PCI_VENDOR_ID_SAMSUNG, |
| 591 | 0x411D), |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 592 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 593 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 594 | 0x0036, |
| 595 | PCI_VENDOR_ID_SAMSUNG, |
| 596 | 0x411E), |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 597 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 598 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 599 | 0x0036, |
Sujith Manoharan | edea2acb | 2015-01-05 11:14:25 +0530 | [diff] [blame] | 600 | 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 Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 610 | 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 Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 635 | 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 Manoharan | edea2acb | 2015-01-05 11:14:25 +0530 | [diff] [blame] | 641 | 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 Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 646 | 0x0692), |
| 647 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 648 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 649 | 0x0036, |
Sujith Manoharan | edea2acb | 2015-01-05 11:14:25 +0530 | [diff] [blame] | 650 | 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 Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 660 | 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 Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 665 | 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 Manoharan | edea2acb | 2015-01-05 11:14:25 +0530 | [diff] [blame] | 675 | 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 Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 690 | 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 Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 700 | 0x1B9A, /* XAVI */ |
Sujith Manoharan | edea2acb | 2015-01-05 11:14:25 +0530 | [diff] [blame] | 701 | 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 Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 706 | 0x28A2), |
| 707 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 708 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 709 | 0x0036, |
Sujith Manoharan | edea2acb | 2015-01-05 11:14:25 +0530 | [diff] [blame] | 710 | 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 Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 715 | 0x185F, /* WNC */ |
| 716 | 0x3027), |
| 717 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 9658113 | 2013-10-23 13:53:28 +0530 | [diff] [blame] | 718 | { 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 Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 728 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 729 | 0x0036, |
| 730 | PCI_VENDOR_ID_FOXCONN, |
Sujith Manoharan | edea2acb | 2015-01-05 11:14:25 +0530 | [diff] [blame] | 731 | 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 Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 736 | 0xE081), |
| 737 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 738 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 739 | 0x0036, |
Sujith Manoharan | edea2acb | 2015-01-05 11:14:25 +0530 | [diff] [blame] | 740 | 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 Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 750 | 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 Manoharan | aeeb206 | 2014-11-16 06:11:02 +0530 | [diff] [blame] | 767 | .driver_data = ATH9K_PCI_AR9565_2ANT | |
| 768 | ATH9K_PCI_BT_ANT_DIV | |
| 769 | ATH9K_PCI_LED_ACT_HI}, |
Sujith Manoharan | 1063133 | 2013-09-02 13:59:05 +0530 | [diff] [blame] | 770 | |
Sujith Manoharan | 1823a42 | 2013-09-02 13:59:04 +0530 | [diff] [blame] | 771 | /* PCI-E AR9565 (WB335) */ |
| 772 | { PCI_VDEVICE(ATHEROS, 0x0036), |
| 773 | .driver_data = ATH9K_PCI_BT_ANT_DIV }, |
Felix Fietkau | 935477e | 2014-10-25 17:19:26 +0200 | [diff] [blame] | 774 | #endif |
Sujith Manoharan | 1823a42 | 2013-09-02 13:59:04 +0530 | [diff] [blame] | 775 | |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 776 | { 0 } |
| 777 | }; |
| 778 | |
Stanislaw Gruszka | 84c87dc | 2011-08-05 13:10:32 +0200 | [diff] [blame] | 779 | |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 780 | /* return bus cachesize in 4B word units */ |
Luis R. Rodriguez | 5bb1279 | 2009-09-14 00:55:09 -0700 | [diff] [blame] | 781 | static void ath_pci_read_cachesize(struct ath_common *common, int *csz) |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 782 | { |
Luis R. Rodriguez | bc974f4 | 2009-09-28 02:54:40 -0400 | [diff] [blame] | 783 | struct ath_softc *sc = (struct ath_softc *) common->priv; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 784 | u8 u8tmp; |
| 785 | |
Vasanthakumar Thiagarajan | f020979 | 2009-09-07 17:46:50 +0530 | [diff] [blame] | 786 | pci_read_config_byte(to_pci_dev(sc->dev), PCI_CACHE_LINE_SIZE, &u8tmp); |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 787 | *csz = (int)u8tmp; |
| 788 | |
| 789 | /* |
Lucas De Marchi | 25985ed | 2011-03-30 22:57:33 -0300 | [diff] [blame] | 790 | * This check was put in to avoid "unpleasant" consequences if |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 791 | * 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. Rodriguez | 5bb1279 | 2009-09-14 00:55:09 -0700 | [diff] [blame] | 799 | static bool ath_pci_eeprom_read(struct ath_common *common, u32 off, u16 *data) |
Gabor Juhos | 9dbeb91 | 2009-01-14 20:17:08 +0100 | [diff] [blame] | 800 | { |
Martin Blumenstingl | 5639851 | 2016-07-10 01:09:55 +0200 | [diff] [blame] | 801 | struct ath_hw *ah = (struct ath_hw *) common->ah; |
Luis R. Rodriguez | 5bb1279 | 2009-09-14 00:55:09 -0700 | [diff] [blame] | 802 | |
Martin Blumenstingl | 5639851 | 2016-07-10 01:09:55 +0200 | [diff] [blame] | 803 | common->ops->read(ah, AR5416_EEPROM_OFFSET + (off << AR5416_EEPROM_S)); |
Eduardo Abinader | 0f27ac40 | 2016-06-29 19:29:29 +0300 | [diff] [blame] | 804 | |
Martin Blumenstingl | 5639851 | 2016-07-10 01:09:55 +0200 | [diff] [blame] | 805 | 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 Juhos | 9dbeb91 | 2009-01-14 20:17:08 +0100 | [diff] [blame] | 811 | } |
| 812 | |
Martin Blumenstingl | 5639851 | 2016-07-10 01:09:55 +0200 | [diff] [blame] | 813 | *data = MS(common->ops->read(ah, AR_EEPROM_STATUS_DATA), |
| 814 | AR_EEPROM_STATUS_DATA_VAL); |
| 815 | |
Gabor Juhos | 9dbeb91 | 2009-01-14 20:17:08 +0100 | [diff] [blame] | 816 | return true; |
| 817 | } |
| 818 | |
Stanislaw Gruszka | 69ce674 | 2011-08-05 13:10:34 +0200 | [diff] [blame] | 819 | /* Need to be called after we discover btcoex capabilities */ |
Stanislaw Gruszka | d493008 | 2011-07-29 15:59:08 +0200 | [diff] [blame] | 820 | static 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 Liu | 08bd108 | 2012-07-24 17:20:25 +0800 | [diff] [blame] | 826 | u16 aspm; |
Stanislaw Gruszka | d493008 | 2011-07-29 15:59:08 +0200 | [diff] [blame] | 827 | |
Sujith Manoharan | d09f5f4 | 2012-06-04 16:27:14 +0530 | [diff] [blame] | 828 | if (!ah->is_pciexpress) |
| 829 | return; |
| 830 | |
Stanislaw Gruszka | d493008 | 2011-07-29 15:59:08 +0200 | [diff] [blame] | 831 | parent = pdev->bus->self; |
John W. Linville | 22c55e6 | 2011-08-24 14:08:41 -0400 | [diff] [blame] | 832 | if (!parent) |
| 833 | return; |
Stanislaw Gruszka | 69ce674 | 2011-08-05 13:10:34 +0200 | [diff] [blame] | 834 | |
Sujith Manoharan | 046b680 | 2012-09-22 00:14:28 +0530 | [diff] [blame] | 835 | if ((ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) && |
| 836 | (AR_SREV_9285(ah))) { |
Bjorn Helgaas | a875621 | 2012-12-05 13:51:19 -0700 | [diff] [blame] | 837 | /* Bluetooth coexistence requires disabling ASPM. */ |
Jiang Liu | 08bd108 | 2012-07-24 17:20:25 +0800 | [diff] [blame] | 838 | pcie_capability_clear_word(pdev, PCI_EXP_LNKCTL, |
Bjorn Helgaas | a875621 | 2012-12-05 13:51:19 -0700 | [diff] [blame] | 839 | PCI_EXP_LNKCTL_ASPM_L0S | PCI_EXP_LNKCTL_ASPM_L1); |
Stanislaw Gruszka | 69ce674 | 2011-08-05 13:10:34 +0200 | [diff] [blame] | 840 | |
| 841 | /* |
| 842 | * Both upstream and downstream PCIe components should |
| 843 | * have the same ASPM settings. |
| 844 | */ |
Jiang Liu | 08bd108 | 2012-07-24 17:20:25 +0800 | [diff] [blame] | 845 | pcie_capability_clear_word(parent, PCI_EXP_LNKCTL, |
Bjorn Helgaas | a875621 | 2012-12-05 13:51:19 -0700 | [diff] [blame] | 846 | PCI_EXP_LNKCTL_ASPM_L0S | PCI_EXP_LNKCTL_ASPM_L1); |
Stanislaw Gruszka | 69ce674 | 2011-08-05 13:10:34 +0200 | [diff] [blame] | 847 | |
Sujith Manoharan | d09f5f4 | 2012-06-04 16:27:14 +0530 | [diff] [blame] | 848 | ath_info(common, "Disabling ASPM since BTCOEX is enabled\n"); |
Stanislaw Gruszka | 69ce674 | 2011-08-05 13:10:34 +0200 | [diff] [blame] | 849 | return; |
| 850 | } |
| 851 | |
Sujith Manoharan | b380a43b | 2013-08-25 14:43:09 +0530 | [diff] [blame] | 852 | /* |
| 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 Liu | 08bd108 | 2012-07-24 17:20:25 +0800 | [diff] [blame] | 868 | pcie_capability_read_word(parent, PCI_EXP_LNKCTL, &aspm); |
Bjorn Helgaas | a875621 | 2012-12-05 13:51:19 -0700 | [diff] [blame] | 869 | if (aspm & (PCI_EXP_LNKCTL_ASPM_L0S | PCI_EXP_LNKCTL_ASPM_L1)) { |
Stanislaw Gruszka | d493008 | 2011-07-29 15:59:08 +0200 | [diff] [blame] | 870 | ah->aspm_enabled = true; |
| 871 | /* Initialize PCIe PM and SERDES registers. */ |
Stanislaw Gruszka | 84c87dc | 2011-08-05 13:10:32 +0200 | [diff] [blame] | 872 | ath9k_hw_configpcipowersave(ah, false); |
Sujith Manoharan | d09f5f4 | 2012-06-04 16:27:14 +0530 | [diff] [blame] | 873 | ath_info(common, "ASPM enabled: 0x%x\n", aspm); |
Stanislaw Gruszka | d493008 | 2011-07-29 15:59:08 +0200 | [diff] [blame] | 874 | } |
| 875 | } |
| 876 | |
Tobias Klauser | 83bd11a | 2009-12-23 14:04:43 +0100 | [diff] [blame] | 877 | static const struct ath_bus_ops ath_pci_bus_ops = { |
Sujith | 497ad9a | 2010-04-01 10:28:20 +0530 | [diff] [blame] | 878 | .ath_bus_type = ATH_PCI, |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 879 | .read_cachesize = ath_pci_read_cachesize, |
Gabor Juhos | 9dbeb91 | 2009-01-14 20:17:08 +0100 | [diff] [blame] | 880 | .eeprom_read = ath_pci_eeprom_read, |
Stanislaw Gruszka | d493008 | 2011-07-29 15:59:08 +0200 | [diff] [blame] | 881 | .aspm_init = ath_pci_aspm_init, |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 882 | }; |
| 883 | |
| 884 | static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) |
| 885 | { |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 886 | struct ath_softc *sc; |
| 887 | struct ieee80211_hw *hw; |
| 888 | u8 csz; |
Jouni Malinen | f021484 | 2009-06-16 11:59:23 +0300 | [diff] [blame] | 889 | u32 val; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 890 | int ret = 0; |
Luis R. Rodriguez | f934c4d | 2009-10-27 12:59:34 -0400 | [diff] [blame] | 891 | char hw_name[64]; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 892 | |
Felix Fietkau | b81950b1 | 2012-12-12 13:14:22 +0100 | [diff] [blame] | 893 | if (pcim_enable_device(pdev)) |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 894 | return -EIO; |
| 895 | |
Yang Hongyang | e930438 | 2009-04-13 14:40:14 -0700 | [diff] [blame] | 896 | ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 897 | if (ret) { |
Joe Perches | 516304b | 2012-03-18 17:30:52 -0700 | [diff] [blame] | 898 | pr_err("32-bit DMA not available\n"); |
Felix Fietkau | b81950b1 | 2012-12-12 13:14:22 +0100 | [diff] [blame] | 899 | return ret; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 900 | } |
| 901 | |
Yang Hongyang | e930438 | 2009-04-13 14:40:14 -0700 | [diff] [blame] | 902 | ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 903 | if (ret) { |
Joe Perches | 516304b | 2012-03-18 17:30:52 -0700 | [diff] [blame] | 904 | pr_err("32-bit DMA consistent DMA enable failed\n"); |
Felix Fietkau | b81950b1 | 2012-12-12 13:14:22 +0100 | [diff] [blame] | 905 | return ret; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 906 | } |
| 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 Malinen | f021484 | 2009-06-16 11:59:23 +0300 | [diff] [blame] | 933 | /* |
| 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 Fietkau | b81950b1 | 2012-12-12 13:14:22 +0100 | [diff] [blame] | 941 | ret = pcim_iomap_regions(pdev, BIT(0), "ath9k"); |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 942 | if (ret) { |
| 943 | dev_err(&pdev->dev, "PCI memory region reserve error\n"); |
Felix Fietkau | b81950b1 | 2012-12-12 13:14:22 +0100 | [diff] [blame] | 944 | return -ENODEV; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 945 | } |
| 946 | |
Felix Fietkau | 78b2194 | 2014-06-11 16:17:55 +0530 | [diff] [blame] | 947 | ath9k_fill_chanctx_ops(); |
Felix Fietkau | 9ac58615 | 2011-01-24 19:23:18 +0100 | [diff] [blame] | 948 | hw = ieee80211_alloc_hw(sizeof(struct ath_softc), &ath9k_ops); |
Luis R. Rodriguez | db6be53 | 2009-09-02 16:34:57 -0700 | [diff] [blame] | 949 | if (!hw) { |
Sujith | 285f2dd | 2010-01-08 10:36:07 +0530 | [diff] [blame] | 950 | dev_err(&pdev->dev, "No memory for ieee80211_hw\n"); |
Felix Fietkau | b81950b1 | 2012-12-12 13:14:22 +0100 | [diff] [blame] | 951 | return -ENOMEM; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 952 | } |
| 953 | |
| 954 | SET_IEEE80211_DEV(hw, &pdev->dev); |
| 955 | pci_set_drvdata(pdev, hw); |
| 956 | |
Felix Fietkau | 9ac58615 | 2011-01-24 19:23:18 +0100 | [diff] [blame] | 957 | sc = hw->priv; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 958 | sc->hw = hw; |
| 959 | sc->dev = &pdev->dev; |
Felix Fietkau | b81950b1 | 2012-12-12 13:14:22 +0100 | [diff] [blame] | 960 | sc->mem = pcim_iomap_table(pdev)[0]; |
Sujith Manoharan | 9b60b64 | 2013-06-13 22:51:26 +0530 | [diff] [blame] | 961 | sc->driver_data = id->driver_data; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 962 | |
Luis R. Rodriguez | fc548af | 2009-09-02 17:06:21 -0700 | [diff] [blame] | 963 | ret = request_irq(pdev->irq, ath_isr, IRQF_SHARED, "ath9k", sc); |
Luis R. Rodriguez | 580171f | 2009-09-02 17:02:18 -0700 | [diff] [blame] | 964 | if (ret) { |
| 965 | dev_err(&pdev->dev, "request_irq failed\n"); |
Sujith | 285f2dd | 2010-01-08 10:36:07 +0530 | [diff] [blame] | 966 | goto err_irq; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 967 | } |
| 968 | |
| 969 | sc->irq = pdev->irq; |
| 970 | |
Pavel Roskin | eb93e89 | 2011-07-23 03:55:39 -0400 | [diff] [blame] | 971 | ret = ath9k_init_device(id->device, sc, &ath_pci_bus_ops); |
Sujith | 285f2dd | 2010-01-08 10:36:07 +0530 | [diff] [blame] | 972 | 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 Perches | c96c31e | 2010-07-26 14:39:58 -0700 | [diff] [blame] | 978 | wiphy_info(hw->wiphy, "%s mem=0x%lx, irq=%d\n", |
Felix Fietkau | b81950b1 | 2012-12-12 13:14:22 +0100 | [diff] [blame] | 979 | hw_name, (unsigned long)sc->mem, pdev->irq); |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 980 | |
| 981 | return 0; |
Sujith | 285f2dd | 2010-01-08 10:36:07 +0530 | [diff] [blame] | 982 | |
| 983 | err_init: |
| 984 | free_irq(sc->irq, sc); |
| 985 | err_irq: |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 986 | ieee80211_free_hw(hw); |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 987 | return ret; |
| 988 | } |
| 989 | |
| 990 | static void ath_pci_remove(struct pci_dev *pdev) |
| 991 | { |
| 992 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); |
Felix Fietkau | 9ac58615 | 2011-01-24 19:23:18 +0100 | [diff] [blame] | 993 | struct ath_softc *sc = hw->priv; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 994 | |
Rajkumar Manoharan | d584747 | 2010-12-20 14:39:51 +0530 | [diff] [blame] | 995 | if (!is_ath9k_unloaded) |
| 996 | sc->sc_ah->ah_flags |= AH_UNPLUGGED; |
Sujith | 285f2dd | 2010-01-08 10:36:07 +0530 | [diff] [blame] | 997 | ath9k_deinit_device(sc); |
| 998 | free_irq(sc->irq, sc); |
| 999 | ieee80211_free_hw(sc->hw); |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 1000 | } |
| 1001 | |
Hauke Mehrtens | 8842758 | 2012-11-29 23:27:15 +0100 | [diff] [blame] | 1002 | #ifdef CONFIG_PM_SLEEP |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 1003 | |
Rafael J. Wysocki | f0e94b4 | 2010-10-16 00:36:17 +0200 | [diff] [blame] | 1004 | static int ath_pci_suspend(struct device *device) |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 1005 | { |
Rafael J. Wysocki | f0e94b4 | 2010-10-16 00:36:17 +0200 | [diff] [blame] | 1006 | struct pci_dev *pdev = to_pci_dev(device); |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 1007 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); |
Felix Fietkau | 9ac58615 | 2011-01-24 19:23:18 +0100 | [diff] [blame] | 1008 | struct ath_softc *sc = hw->priv; |
Sujith Manoharan | 249943a | 2015-01-30 19:05:27 +0530 | [diff] [blame] | 1009 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 1010 | |
Sujith Manoharan | 249943a | 2015-01-30 19:05:27 +0530 | [diff] [blame] | 1011 | if (test_bit(ATH_OP_WOW_ENABLED, &common->op_flags)) { |
| 1012 | dev_info(&pdev->dev, "WOW is enabled, bypassing PCI suspend\n"); |
Mohammed Shafi Shajakhan | 4a17a50 | 2012-07-10 14:57:11 +0530 | [diff] [blame] | 1013 | return 0; |
Sujith Manoharan | 249943a | 2015-01-30 19:05:27 +0530 | [diff] [blame] | 1014 | } |
Mohammed Shafi Shajakhan | 4a17a50 | 2012-07-10 14:57:11 +0530 | [diff] [blame] | 1015 | |
Rajkumar Manoharan | c31eb8e | 2011-06-28 18:21:19 +0530 | [diff] [blame] | 1016 | /* 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 Manoharan | e19f15a | 2012-08-09 12:37:26 +0530 | [diff] [blame] | 1020 | ath9k_stop_btcoex(sc); |
Felix Fietkau | c0c1174 | 2011-11-16 13:08:41 +0100 | [diff] [blame] | 1021 | ath9k_hw_disable(sc->sc_ah); |
Rajkumar Manoharan | 1c48f98 | 2014-05-22 14:11:41 +0530 | [diff] [blame] | 1022 | del_timer_sync(&sc->sleep_timer); |
Rajkumar Manoharan | c31eb8e | 2011-06-28 18:21:19 +0530 | [diff] [blame] | 1023 | ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP); |
| 1024 | |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 1025 | return 0; |
| 1026 | } |
| 1027 | |
Rafael J. Wysocki | f0e94b4 | 2010-10-16 00:36:17 +0200 | [diff] [blame] | 1028 | static int ath_pci_resume(struct device *device) |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 1029 | { |
Rafael J. Wysocki | f0e94b4 | 2010-10-16 00:36:17 +0200 | [diff] [blame] | 1030 | struct pci_dev *pdev = to_pci_dev(device); |
Felix Fietkau | 9317051 | 2012-10-03 21:07:50 +0200 | [diff] [blame] | 1031 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); |
| 1032 | struct ath_softc *sc = hw->priv; |
Felix Fietkau | ceb26a6 | 2012-10-03 21:07:51 +0200 | [diff] [blame] | 1033 | struct ath_hw *ah = sc->sc_ah; |
| 1034 | struct ath_common *common = ath9k_hw_common(ah); |
Jouni Malinen | f021484 | 2009-06-16 11:59:23 +0300 | [diff] [blame] | 1035 | u32 val; |
Sujith | 523c36f | 2009-08-13 09:34:35 +0530 | [diff] [blame] | 1036 | |
Jouni Malinen | f021484 | 2009-06-16 11:59:23 +0300 | [diff] [blame] | 1037 | /* |
| 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 Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 1045 | |
Felix Fietkau | 9317051 | 2012-10-03 21:07:50 +0200 | [diff] [blame] | 1046 | ath_pci_aspm_init(common); |
Felix Fietkau | ceb26a6 | 2012-10-03 21:07:51 +0200 | [diff] [blame] | 1047 | ah->reset_power_on = false; |
Felix Fietkau | 9317051 | 2012-10-03 21:07:50 +0200 | [diff] [blame] | 1048 | |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 1049 | return 0; |
| 1050 | } |
| 1051 | |
Hauke Mehrtens | 8842758 | 2012-11-29 23:27:15 +0100 | [diff] [blame] | 1052 | static SIMPLE_DEV_PM_OPS(ath9k_pm_ops, ath_pci_suspend, ath_pci_resume); |
Rafael J. Wysocki | f0e94b4 | 2010-10-16 00:36:17 +0200 | [diff] [blame] | 1053 | |
| 1054 | #define ATH9K_PM_OPS (&ath9k_pm_ops) |
| 1055 | |
Hauke Mehrtens | 8842758 | 2012-11-29 23:27:15 +0100 | [diff] [blame] | 1056 | #else /* !CONFIG_PM_SLEEP */ |
Rafael J. Wysocki | f0e94b4 | 2010-10-16 00:36:17 +0200 | [diff] [blame] | 1057 | |
| 1058 | #define ATH9K_PM_OPS NULL |
| 1059 | |
Hauke Mehrtens | 8842758 | 2012-11-29 23:27:15 +0100 | [diff] [blame] | 1060 | #endif /* !CONFIG_PM_SLEEP */ |
Rafael J. Wysocki | f0e94b4 | 2010-10-16 00:36:17 +0200 | [diff] [blame] | 1061 | |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 1062 | |
| 1063 | MODULE_DEVICE_TABLE(pci, ath_pci_id_table); |
| 1064 | |
| 1065 | static 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. Wysocki | f0e94b4 | 2010-10-16 00:36:17 +0200 | [diff] [blame] | 1070 | .driver.pm = ATH9K_PM_OPS, |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 1071 | }; |
| 1072 | |
Sujith | db0f41f | 2009-02-20 15:13:26 +0530 | [diff] [blame] | 1073 | int ath_pci_init(void) |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 1074 | { |
| 1075 | return pci_register_driver(&ath_pci_driver); |
| 1076 | } |
| 1077 | |
| 1078 | void ath_pci_exit(void) |
| 1079 | { |
| 1080 | pci_unregister_driver(&ath_pci_driver); |
| 1081 | } |