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> |
Felix Fietkau | a05b5d45 | 2010-11-17 04:25:33 +0100 | [diff] [blame] | 22 | #include <linux/ath9k_platform.h> |
Paul Gortmaker | 9d9779e | 2011-07-03 15:21:01 -0400 | [diff] [blame] | 23 | #include <linux/module.h> |
Sujith | 394cf0a | 2009-02-09 13:26:54 +0530 | [diff] [blame] | 24 | #include "ath9k.h" |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 25 | |
Benoit Taine | 9baa3c3 | 2014-08-08 15:56:03 +0200 | [diff] [blame^] | 26 | static const struct pci_device_id ath_pci_id_table[] = { |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 27 | { PCI_VDEVICE(ATHEROS, 0x0023) }, /* PCI */ |
| 28 | { PCI_VDEVICE(ATHEROS, 0x0024) }, /* PCI-E */ |
| 29 | { PCI_VDEVICE(ATHEROS, 0x0027) }, /* PCI */ |
| 30 | { PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI */ |
| 31 | { PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */ |
Sujith Manoharan | a5354cc | 2013-08-04 14:21:58 +0530 | [diff] [blame] | 32 | |
Sujith Manoharan | d1ae25a | 2013-08-25 16:30:40 +0530 | [diff] [blame] | 33 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 34 | 0x002A, |
| 35 | PCI_VENDOR_ID_AZWAVE, |
| 36 | 0x1C71), |
| 37 | .driver_data = ATH9K_PCI_D3_L1_WAR }, |
| 38 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 39 | 0x002A, |
| 40 | PCI_VENDOR_ID_FOXCONN, |
| 41 | 0xE01F), |
| 42 | .driver_data = ATH9K_PCI_D3_L1_WAR }, |
| 43 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 44 | 0x002A, |
| 45 | 0x11AD, /* LITEON */ |
| 46 | 0x6632), |
| 47 | .driver_data = ATH9K_PCI_D3_L1_WAR }, |
| 48 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 49 | 0x002A, |
| 50 | 0x11AD, /* LITEON */ |
| 51 | 0x6642), |
| 52 | .driver_data = ATH9K_PCI_D3_L1_WAR }, |
| 53 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 54 | 0x002A, |
| 55 | PCI_VENDOR_ID_QMI, |
| 56 | 0x0306), |
| 57 | .driver_data = ATH9K_PCI_D3_L1_WAR }, |
| 58 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 59 | 0x002A, |
| 60 | 0x185F, /* WNC */ |
| 61 | 0x309D), |
| 62 | .driver_data = ATH9K_PCI_D3_L1_WAR }, |
| 63 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 64 | 0x002A, |
| 65 | 0x10CF, /* Fujitsu */ |
| 66 | 0x147C), |
| 67 | .driver_data = ATH9K_PCI_D3_L1_WAR }, |
| 68 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 69 | 0x002A, |
| 70 | 0x10CF, /* Fujitsu */ |
| 71 | 0x147D), |
| 72 | .driver_data = ATH9K_PCI_D3_L1_WAR }, |
| 73 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 74 | 0x002A, |
| 75 | 0x10CF, /* Fujitsu */ |
| 76 | 0x1536), |
| 77 | .driver_data = ATH9K_PCI_D3_L1_WAR }, |
| 78 | |
Sujith Manoharan | a5354cc | 2013-08-04 14:21:58 +0530 | [diff] [blame] | 79 | /* AR9285 card for Asus */ |
| 80 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 81 | 0x002B, |
| 82 | PCI_VENDOR_ID_AZWAVE, |
| 83 | 0x2C37), |
| 84 | .driver_data = ATH9K_PCI_BT_ANT_DIV }, |
| 85 | |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 86 | { PCI_VDEVICE(ATHEROS, 0x002B) }, /* PCI-E */ |
Luis R. Rodriguez | 5ffaf8a | 2010-02-02 11:58:33 -0500 | [diff] [blame] | 87 | { PCI_VDEVICE(ATHEROS, 0x002C) }, /* PCI-E 802.11n bonded out */ |
Vivek Natarajan | ac88b6e | 2009-07-23 10:59:57 +0530 | [diff] [blame] | 88 | { PCI_VDEVICE(ATHEROS, 0x002D) }, /* PCI */ |
| 89 | { PCI_VDEVICE(ATHEROS, 0x002E) }, /* PCI-E */ |
Sujith Manoharan | 4dd3564 | 2013-10-23 14:26:04 +0530 | [diff] [blame] | 90 | |
| 91 | /* Killer Wireless (3x3) */ |
| 92 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 93 | 0x0030, |
| 94 | 0x1A56, |
| 95 | 0x2000), |
| 96 | .driver_data = ATH9K_PCI_KILLER }, |
| 97 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 98 | 0x0030, |
| 99 | 0x1A56, |
| 100 | 0x2001), |
| 101 | .driver_data = ATH9K_PCI_KILLER }, |
| 102 | |
Luis R. Rodriguez | 0efabd5 | 2010-06-12 00:34:02 -0400 | [diff] [blame] | 103 | { PCI_VDEVICE(ATHEROS, 0x0030) }, /* PCI-E AR9300 */ |
Sujith Manoharan | 9b60b64 | 2013-06-13 22:51:26 +0530 | [diff] [blame] | 104 | |
| 105 | /* PCI-E CUS198 */ |
| 106 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 107 | 0x0032, |
| 108 | PCI_VENDOR_ID_AZWAVE, |
| 109 | 0x2086), |
Sujith Manoharan | a5354cc | 2013-08-04 14:21:58 +0530 | [diff] [blame] | 110 | .driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 9b60b64 | 2013-06-13 22:51:26 +0530 | [diff] [blame] | 111 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 112 | 0x0032, |
| 113 | PCI_VENDOR_ID_AZWAVE, |
| 114 | 0x1237), |
Sujith Manoharan | a5354cc | 2013-08-04 14:21:58 +0530 | [diff] [blame] | 115 | .driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 9b60b64 | 2013-06-13 22:51:26 +0530 | [diff] [blame] | 116 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 117 | 0x0032, |
| 118 | PCI_VENDOR_ID_AZWAVE, |
| 119 | 0x2126), |
Sujith Manoharan | a5354cc | 2013-08-04 14:21:58 +0530 | [diff] [blame] | 120 | .driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | f4d9070 | 2013-08-20 13:05:58 +0530 | [diff] [blame] | 121 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 122 | 0x0032, |
| 123 | PCI_VENDOR_ID_AZWAVE, |
| 124 | 0x126A), |
| 125 | .driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | e861ef5 | 2013-06-18 10:13:43 +0530 | [diff] [blame] | 126 | |
| 127 | /* PCI-E CUS230 */ |
Sujith Manoharan | 9b60b64 | 2013-06-13 22:51:26 +0530 | [diff] [blame] | 128 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 129 | 0x0032, |
| 130 | PCI_VENDOR_ID_AZWAVE, |
| 131 | 0x2152), |
Sujith Manoharan | a5354cc | 2013-08-04 14:21:58 +0530 | [diff] [blame] | 132 | .driver_data = ATH9K_PCI_CUS230 | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 9b60b64 | 2013-06-13 22:51:26 +0530 | [diff] [blame] | 133 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 134 | 0x0032, |
| 135 | PCI_VENDOR_ID_FOXCONN, |
| 136 | 0xE075), |
Sujith Manoharan | a5354cc | 2013-08-04 14:21:58 +0530 | [diff] [blame] | 137 | .driver_data = ATH9K_PCI_CUS230 | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 9b60b64 | 2013-06-13 22:51:26 +0530 | [diff] [blame] | 138 | |
Sujith Manoharan | 2952f6e | 2013-08-05 15:08:28 +0530 | [diff] [blame] | 139 | /* WB225 */ |
| 140 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 141 | 0x0032, |
| 142 | PCI_VENDOR_ID_ATHEROS, |
| 143 | 0x3119), |
| 144 | .driver_data = ATH9K_PCI_BT_ANT_DIV }, |
| 145 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 146 | 0x0032, |
| 147 | PCI_VENDOR_ID_ATHEROS, |
| 148 | 0x3122), |
| 149 | .driver_data = ATH9K_PCI_BT_ANT_DIV }, |
| 150 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 151 | 0x0032, |
| 152 | 0x185F, /* WNC */ |
| 153 | 0x3119), |
| 154 | .driver_data = ATH9K_PCI_BT_ANT_DIV }, |
| 155 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 156 | 0x0032, |
| 157 | 0x185F, /* WNC */ |
| 158 | 0x3027), |
| 159 | .driver_data = ATH9K_PCI_BT_ANT_DIV }, |
| 160 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 161 | 0x0032, |
| 162 | PCI_VENDOR_ID_SAMSUNG, |
| 163 | 0x4105), |
| 164 | .driver_data = ATH9K_PCI_BT_ANT_DIV }, |
| 165 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 166 | 0x0032, |
| 167 | PCI_VENDOR_ID_SAMSUNG, |
| 168 | 0x4106), |
| 169 | .driver_data = ATH9K_PCI_BT_ANT_DIV }, |
| 170 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 171 | 0x0032, |
| 172 | PCI_VENDOR_ID_SAMSUNG, |
| 173 | 0x410D), |
| 174 | .driver_data = ATH9K_PCI_BT_ANT_DIV }, |
| 175 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 176 | 0x0032, |
| 177 | PCI_VENDOR_ID_SAMSUNG, |
| 178 | 0x410E), |
| 179 | .driver_data = ATH9K_PCI_BT_ANT_DIV }, |
| 180 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 181 | 0x0032, |
| 182 | PCI_VENDOR_ID_SAMSUNG, |
| 183 | 0x410F), |
| 184 | .driver_data = ATH9K_PCI_BT_ANT_DIV }, |
| 185 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 186 | 0x0032, |
| 187 | PCI_VENDOR_ID_SAMSUNG, |
| 188 | 0xC706), |
| 189 | .driver_data = ATH9K_PCI_BT_ANT_DIV }, |
| 190 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 191 | 0x0032, |
| 192 | PCI_VENDOR_ID_SAMSUNG, |
| 193 | 0xC680), |
| 194 | .driver_data = ATH9K_PCI_BT_ANT_DIV }, |
| 195 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 196 | 0x0032, |
| 197 | PCI_VENDOR_ID_SAMSUNG, |
| 198 | 0xC708), |
| 199 | .driver_data = ATH9K_PCI_BT_ANT_DIV }, |
| 200 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 201 | 0x0032, |
| 202 | PCI_VENDOR_ID_LENOVO, |
| 203 | 0x3218), |
| 204 | .driver_data = ATH9K_PCI_BT_ANT_DIV }, |
| 205 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 206 | 0x0032, |
| 207 | PCI_VENDOR_ID_LENOVO, |
| 208 | 0x3219), |
| 209 | .driver_data = ATH9K_PCI_BT_ANT_DIV }, |
| 210 | |
Sujith Manoharan | 2d22c7d | 2013-11-08 11:45:25 +0530 | [diff] [blame] | 211 | /* AR9485 cards with PLL power-save disabled by default. */ |
| 212 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 213 | 0x0032, |
| 214 | PCI_VENDOR_ID_AZWAVE, |
| 215 | 0x2C97), |
| 216 | .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, |
| 217 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 218 | 0x0032, |
| 219 | PCI_VENDOR_ID_AZWAVE, |
| 220 | 0x2100), |
| 221 | .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, |
| 222 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 223 | 0x0032, |
| 224 | 0x1C56, /* ASKEY */ |
| 225 | 0x4001), |
| 226 | .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, |
| 227 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 228 | 0x0032, |
| 229 | 0x11AD, /* LITEON */ |
| 230 | 0x6627), |
| 231 | .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, |
| 232 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 233 | 0x0032, |
| 234 | 0x11AD, /* LITEON */ |
| 235 | 0x6628), |
| 236 | .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, |
| 237 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 238 | 0x0032, |
| 239 | PCI_VENDOR_ID_FOXCONN, |
| 240 | 0xE04E), |
| 241 | .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, |
| 242 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 243 | 0x0032, |
| 244 | PCI_VENDOR_ID_FOXCONN, |
| 245 | 0xE04F), |
| 246 | .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, |
| 247 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 248 | 0x0032, |
| 249 | 0x144F, /* ASKEY */ |
| 250 | 0x7197), |
| 251 | .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, |
| 252 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 253 | 0x0032, |
| 254 | 0x1B9A, /* XAVI */ |
| 255 | 0x2000), |
| 256 | .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, |
| 257 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 258 | 0x0032, |
| 259 | 0x1B9A, /* XAVI */ |
| 260 | 0x2001), |
| 261 | .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, |
| 262 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 263 | 0x0032, |
| 264 | PCI_VENDOR_ID_AZWAVE, |
| 265 | 0x1186), |
| 266 | .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, |
| 267 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 268 | 0x0032, |
| 269 | PCI_VENDOR_ID_AZWAVE, |
| 270 | 0x1F86), |
| 271 | .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, |
| 272 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 273 | 0x0032, |
| 274 | PCI_VENDOR_ID_AZWAVE, |
| 275 | 0x1195), |
| 276 | .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, |
| 277 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 278 | 0x0032, |
| 279 | PCI_VENDOR_ID_AZWAVE, |
| 280 | 0x1F95), |
| 281 | .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, |
| 282 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 283 | 0x0032, |
| 284 | 0x1B9A, /* XAVI */ |
| 285 | 0x1C00), |
| 286 | .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, |
| 287 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 288 | 0x0032, |
| 289 | 0x1B9A, /* XAVI */ |
| 290 | 0x1C01), |
| 291 | .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, |
| 292 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 293 | 0x0032, |
| 294 | PCI_VENDOR_ID_ASUSTEK, |
| 295 | 0x850D), |
| 296 | .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, |
| 297 | |
Vasanthakumar Thiagarajan | 1435894 | 2010-12-06 04:28:00 -0800 | [diff] [blame] | 298 | { PCI_VDEVICE(ATHEROS, 0x0032) }, /* PCI-E AR9485 */ |
Luis R. Rodriguez | a508a6e | 2011-08-23 13:37:07 -0700 | [diff] [blame] | 299 | { PCI_VDEVICE(ATHEROS, 0x0033) }, /* PCI-E AR9580 */ |
Sujith Manoharan | 12eea64 | 2013-06-18 15:42:36 +0530 | [diff] [blame] | 300 | |
| 301 | /* PCI-E CUS217 */ |
| 302 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 303 | 0x0034, |
| 304 | PCI_VENDOR_ID_AZWAVE, |
| 305 | 0x2116), |
| 306 | .driver_data = ATH9K_PCI_CUS217 }, |
| 307 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 308 | 0x0034, |
| 309 | 0x11AD, /* LITEON */ |
| 310 | 0x6661), |
| 311 | .driver_data = ATH9K_PCI_CUS217 }, |
| 312 | |
Sujith Manoharan | fca3c21 | 2013-06-21 11:11:52 +0530 | [diff] [blame] | 313 | /* AR9462 with WoW support */ |
| 314 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 315 | 0x0034, |
| 316 | PCI_VENDOR_ID_ATHEROS, |
| 317 | 0x3117), |
| 318 | .driver_data = ATH9K_PCI_WOW }, |
| 319 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 320 | 0x0034, |
| 321 | PCI_VENDOR_ID_LENOVO, |
| 322 | 0x3214), |
| 323 | .driver_data = ATH9K_PCI_WOW }, |
| 324 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 325 | 0x0034, |
| 326 | PCI_VENDOR_ID_ATTANSIC, |
| 327 | 0x0091), |
| 328 | .driver_data = ATH9K_PCI_WOW }, |
| 329 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 330 | 0x0034, |
| 331 | PCI_VENDOR_ID_AZWAVE, |
| 332 | 0x2110), |
| 333 | .driver_data = ATH9K_PCI_WOW }, |
| 334 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 335 | 0x0034, |
| 336 | PCI_VENDOR_ID_ASUSTEK, |
| 337 | 0x850E), |
| 338 | .driver_data = ATH9K_PCI_WOW }, |
| 339 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 340 | 0x0034, |
| 341 | 0x11AD, /* LITEON */ |
| 342 | 0x6631), |
| 343 | .driver_data = ATH9K_PCI_WOW }, |
| 344 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 345 | 0x0034, |
| 346 | 0x11AD, /* LITEON */ |
| 347 | 0x6641), |
| 348 | .driver_data = ATH9K_PCI_WOW }, |
| 349 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 350 | 0x0034, |
| 351 | PCI_VENDOR_ID_HP, |
| 352 | 0x1864), |
| 353 | .driver_data = ATH9K_PCI_WOW }, |
| 354 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 355 | 0x0034, |
| 356 | 0x14CD, /* USI */ |
| 357 | 0x0063), |
| 358 | .driver_data = ATH9K_PCI_WOW }, |
| 359 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 360 | 0x0034, |
| 361 | 0x14CD, /* USI */ |
| 362 | 0x0064), |
| 363 | .driver_data = ATH9K_PCI_WOW }, |
| 364 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 365 | 0x0034, |
| 366 | 0x10CF, /* Fujitsu */ |
| 367 | 0x1783), |
| 368 | .driver_data = ATH9K_PCI_WOW }, |
| 369 | |
Sujith Manoharan | 4dd3564 | 2013-10-23 14:26:04 +0530 | [diff] [blame] | 370 | /* Killer Wireless (2x2) */ |
| 371 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 372 | 0x0030, |
| 373 | 0x1A56, |
| 374 | 0x2003), |
| 375 | .driver_data = ATH9K_PCI_KILLER }, |
| 376 | |
Rajkumar Manoharan | 423e38e | 2011-10-13 11:00:44 +0530 | [diff] [blame] | 377 | { PCI_VDEVICE(ATHEROS, 0x0034) }, /* PCI-E AR9462 */ |
Mohammed Shafi Shajakhan | d4e5979 | 2012-08-02 11:58:50 +0530 | [diff] [blame] | 378 | { PCI_VDEVICE(ATHEROS, 0x0037) }, /* PCI-E AR1111/AR9485 */ |
Sujith Manoharan | 1823a42 | 2013-09-02 13:59:04 +0530 | [diff] [blame] | 379 | |
Sujith Manoharan | 1063133 | 2013-09-02 13:59:05 +0530 | [diff] [blame] | 380 | /* CUS252 */ |
| 381 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 382 | 0x0036, |
| 383 | PCI_VENDOR_ID_ATHEROS, |
| 384 | 0x3028), |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 385 | .driver_data = ATH9K_PCI_CUS252 | |
| 386 | ATH9K_PCI_AR9565_2ANT | |
| 387 | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 1063133 | 2013-09-02 13:59:05 +0530 | [diff] [blame] | 388 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 389 | 0x0036, |
| 390 | PCI_VENDOR_ID_AZWAVE, |
| 391 | 0x2176), |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 392 | .driver_data = ATH9K_PCI_CUS252 | |
| 393 | ATH9K_PCI_AR9565_2ANT | |
| 394 | ATH9K_PCI_BT_ANT_DIV }, |
| 395 | |
| 396 | /* WB335 1-ANT */ |
| 397 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 398 | 0x0036, |
| 399 | PCI_VENDOR_ID_FOXCONN, |
| 400 | 0xE068), |
| 401 | .driver_data = ATH9K_PCI_AR9565_1ANT }, |
| 402 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 403 | 0x0036, |
| 404 | 0x185F, /* WNC */ |
| 405 | 0xA119), |
| 406 | .driver_data = ATH9K_PCI_AR9565_1ANT }, |
| 407 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 408 | 0x0036, |
| 409 | 0x11AD, /* LITEON */ |
| 410 | 0x0632), |
| 411 | .driver_data = ATH9K_PCI_AR9565_1ANT }, |
| 412 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 413 | 0x0036, |
| 414 | 0x11AD, /* LITEON */ |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 415 | 0x06B2), |
| 416 | .driver_data = ATH9K_PCI_AR9565_1ANT }, |
| 417 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 418 | 0x0036, |
| 419 | 0x11AD, /* LITEON */ |
| 420 | 0x0842), |
| 421 | .driver_data = ATH9K_PCI_AR9565_1ANT }, |
| 422 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 423 | 0x0036, |
| 424 | 0x11AD, /* LITEON */ |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 425 | 0x6671), |
| 426 | .driver_data = ATH9K_PCI_AR9565_1ANT }, |
| 427 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 428 | 0x0036, |
| 429 | 0x1B9A, /* XAVI */ |
| 430 | 0x2811), |
| 431 | .driver_data = ATH9K_PCI_AR9565_1ANT }, |
| 432 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 433 | 0x0036, |
| 434 | 0x1B9A, /* XAVI */ |
| 435 | 0x2812), |
| 436 | .driver_data = ATH9K_PCI_AR9565_1ANT }, |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 437 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 438 | 0x0036, |
| 439 | 0x1B9A, /* XAVI */ |
| 440 | 0x28A1), |
| 441 | .driver_data = ATH9K_PCI_AR9565_1ANT }, |
| 442 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 443 | 0x0036, |
| 444 | PCI_VENDOR_ID_AZWAVE, |
| 445 | 0x218A), |
| 446 | .driver_data = ATH9K_PCI_AR9565_1ANT }, |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 447 | |
| 448 | /* WB335 1-ANT / Antenna Diversity */ |
| 449 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 450 | 0x0036, |
| 451 | PCI_VENDOR_ID_ATHEROS, |
| 452 | 0x3025), |
| 453 | .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 454 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 455 | 0x0036, |
| 456 | PCI_VENDOR_ID_ATHEROS, |
| 457 | 0x3026), |
| 458 | .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 459 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 460 | 0x0036, |
| 461 | PCI_VENDOR_ID_ATHEROS, |
| 462 | 0x302B), |
| 463 | .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 464 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 465 | 0x0036, |
| 466 | PCI_VENDOR_ID_FOXCONN, |
| 467 | 0xE069), |
| 468 | .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 469 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 470 | 0x0036, |
| 471 | 0x185F, /* WNC */ |
| 472 | 0x3028), |
| 473 | .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 474 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 475 | 0x0036, |
| 476 | 0x11AD, /* LITEON */ |
| 477 | 0x0622), |
| 478 | .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 479 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 480 | 0x0036, |
| 481 | 0x11AD, /* LITEON */ |
| 482 | 0x0672), |
| 483 | .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 484 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 485 | 0x0036, |
| 486 | 0x11AD, /* LITEON */ |
| 487 | 0x0662), |
| 488 | .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 489 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 490 | 0x0036, |
Sujith Manoharan | 9658113 | 2013-10-23 13:53:28 +0530 | [diff] [blame] | 491 | 0x11AD, /* LITEON */ |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 492 | 0x06A2), |
| 493 | .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 494 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 495 | 0x0036, |
| 496 | 0x11AD, /* LITEON */ |
Sujith Manoharan | 9658113 | 2013-10-23 13:53:28 +0530 | [diff] [blame] | 497 | 0x0682), |
| 498 | .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 499 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 500 | 0x0036, |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 501 | PCI_VENDOR_ID_AZWAVE, |
| 502 | 0x213A), |
| 503 | .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 504 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 505 | 0x0036, |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 506 | PCI_VENDOR_ID_HP, |
| 507 | 0x18E3), |
| 508 | .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 509 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 510 | 0x0036, |
| 511 | PCI_VENDOR_ID_HP, |
| 512 | 0x217F), |
| 513 | .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | bf7c756 | 2013-09-05 10:56:54 +0530 | [diff] [blame] | 514 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 515 | 0x0036, |
Sujith Manoharan | 9658113 | 2013-10-23 13:53:28 +0530 | [diff] [blame] | 516 | PCI_VENDOR_ID_HP, |
| 517 | 0x2005), |
| 518 | .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 519 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 520 | 0x0036, |
Sujith Manoharan | bf7c756 | 2013-09-05 10:56:54 +0530 | [diff] [blame] | 521 | PCI_VENDOR_ID_DELL, |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 522 | 0x020C), |
Sujith Manoharan | bf7c756 | 2013-09-05 10:56:54 +0530 | [diff] [blame] | 523 | .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 524 | |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 525 | /* WB335 2-ANT / Antenna-Diversity */ |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 526 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 527 | 0x0036, |
| 528 | PCI_VENDOR_ID_SAMSUNG, |
| 529 | 0x411A), |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 530 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 531 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 532 | 0x0036, |
| 533 | PCI_VENDOR_ID_SAMSUNG, |
| 534 | 0x411B), |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 535 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 536 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 537 | 0x0036, |
| 538 | PCI_VENDOR_ID_SAMSUNG, |
| 539 | 0x411C), |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 540 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 541 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 542 | 0x0036, |
| 543 | PCI_VENDOR_ID_SAMSUNG, |
| 544 | 0x411D), |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 545 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 546 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 547 | 0x0036, |
| 548 | PCI_VENDOR_ID_SAMSUNG, |
| 549 | 0x411E), |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 550 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 551 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 552 | 0x0036, |
| 553 | PCI_VENDOR_ID_ATHEROS, |
| 554 | 0x3027), |
| 555 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 556 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 557 | 0x0036, |
| 558 | PCI_VENDOR_ID_ATHEROS, |
| 559 | 0x302C), |
| 560 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 561 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 562 | 0x0036, |
| 563 | 0x11AD, /* LITEON */ |
| 564 | 0x0642), |
| 565 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 566 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 567 | 0x0036, |
| 568 | 0x11AD, /* LITEON */ |
| 569 | 0x0652), |
| 570 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 571 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 572 | 0x0036, |
| 573 | 0x11AD, /* LITEON */ |
| 574 | 0x0612), |
| 575 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 576 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 577 | 0x0036, |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 578 | 0x11AD, /* LITEON */ |
| 579 | 0x0832), |
| 580 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 581 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 582 | 0x0036, |
| 583 | 0x11AD, /* LITEON */ |
| 584 | 0x0692), |
| 585 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 586 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 587 | 0x0036, |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 588 | PCI_VENDOR_ID_AZWAVE, |
| 589 | 0x2130), |
| 590 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 591 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 592 | 0x0036, |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 593 | PCI_VENDOR_ID_AZWAVE, |
| 594 | 0x213B), |
| 595 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 596 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 597 | 0x0036, |
| 598 | PCI_VENDOR_ID_AZWAVE, |
| 599 | 0x2182), |
| 600 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 601 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 602 | 0x0036, |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 603 | 0x144F, /* ASKEY */ |
| 604 | 0x7202), |
| 605 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 606 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 607 | 0x0036, |
| 608 | 0x1B9A, /* XAVI */ |
| 609 | 0x2810), |
| 610 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 611 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 612 | 0x0036, |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 613 | 0x1B9A, /* XAVI */ |
| 614 | 0x28A2), |
| 615 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 616 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 617 | 0x0036, |
Sujith Manoharan | 3fcdd0a | 2013-09-02 13:59:06 +0530 | [diff] [blame] | 618 | 0x185F, /* WNC */ |
| 619 | 0x3027), |
| 620 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 9658113 | 2013-10-23 13:53:28 +0530 | [diff] [blame] | 621 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 622 | 0x0036, |
| 623 | 0x185F, /* WNC */ |
| 624 | 0xA120), |
| 625 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 626 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 627 | 0x0036, |
| 628 | PCI_VENDOR_ID_FOXCONN, |
| 629 | 0xE07F), |
| 630 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 9c36254 | 2014-01-09 08:51:13 +0530 | [diff] [blame] | 631 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 632 | 0x0036, |
| 633 | PCI_VENDOR_ID_FOXCONN, |
| 634 | 0xE081), |
| 635 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 636 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 637 | 0x0036, |
| 638 | PCI_VENDOR_ID_LENOVO, |
| 639 | 0x3026), |
| 640 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 641 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 642 | 0x0036, |
| 643 | PCI_VENDOR_ID_LENOVO, |
| 644 | 0x4026), |
| 645 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 646 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 647 | 0x0036, |
| 648 | PCI_VENDOR_ID_ASUSTEK, |
| 649 | 0x85F2), |
| 650 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
| 651 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
| 652 | 0x0036, |
| 653 | PCI_VENDOR_ID_DELL, |
| 654 | 0x020E), |
| 655 | .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, |
Sujith Manoharan | 1063133 | 2013-09-02 13:59:05 +0530 | [diff] [blame] | 656 | |
Sujith Manoharan | 1823a42 | 2013-09-02 13:59:04 +0530 | [diff] [blame] | 657 | /* PCI-E AR9565 (WB335) */ |
| 658 | { PCI_VDEVICE(ATHEROS, 0x0036), |
| 659 | .driver_data = ATH9K_PCI_BT_ANT_DIV }, |
| 660 | |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 661 | { 0 } |
| 662 | }; |
| 663 | |
Stanislaw Gruszka | 84c87dc | 2011-08-05 13:10:32 +0200 | [diff] [blame] | 664 | |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 665 | /* return bus cachesize in 4B word units */ |
Luis R. Rodriguez | 5bb1279 | 2009-09-14 00:55:09 -0700 | [diff] [blame] | 666 | static void ath_pci_read_cachesize(struct ath_common *common, int *csz) |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 667 | { |
Luis R. Rodriguez | bc974f4 | 2009-09-28 02:54:40 -0400 | [diff] [blame] | 668 | struct ath_softc *sc = (struct ath_softc *) common->priv; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 669 | u8 u8tmp; |
| 670 | |
Vasanthakumar Thiagarajan | f020979 | 2009-09-07 17:46:50 +0530 | [diff] [blame] | 671 | 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] | 672 | *csz = (int)u8tmp; |
| 673 | |
| 674 | /* |
Lucas De Marchi | 25985ed | 2011-03-30 22:57:33 -0300 | [diff] [blame] | 675 | * This check was put in to avoid "unpleasant" consequences if |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 676 | * the bootrom has not fully initialized all PCI devices. |
| 677 | * Sometimes the cache line size register is not set |
| 678 | */ |
| 679 | |
| 680 | if (*csz == 0) |
| 681 | *csz = DEFAULT_CACHELINE >> 2; /* Use the default size */ |
| 682 | } |
| 683 | |
Luis R. Rodriguez | 5bb1279 | 2009-09-14 00:55:09 -0700 | [diff] [blame] | 684 | 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] | 685 | { |
Felix Fietkau | a05b5d45 | 2010-11-17 04:25:33 +0100 | [diff] [blame] | 686 | struct ath_softc *sc = (struct ath_softc *) common->priv; |
| 687 | struct ath9k_platform_data *pdata = sc->dev->platform_data; |
Luis R. Rodriguez | 5bb1279 | 2009-09-14 00:55:09 -0700 | [diff] [blame] | 688 | |
Helmut Schaa | 4f15754 | 2014-05-08 13:48:38 +0200 | [diff] [blame] | 689 | if (pdata && !pdata->use_eeprom) { |
Felix Fietkau | a05b5d45 | 2010-11-17 04:25:33 +0100 | [diff] [blame] | 690 | if (off >= (ARRAY_SIZE(pdata->eeprom_data))) { |
Joe Perches | 3800276 | 2010-12-02 19:12:36 -0800 | [diff] [blame] | 691 | ath_err(common, |
| 692 | "%s: eeprom read failed, offset %08x is out of range\n", |
| 693 | __func__, off); |
Felix Fietkau | a05b5d45 | 2010-11-17 04:25:33 +0100 | [diff] [blame] | 694 | } |
Gabor Juhos | 9dbeb91 | 2009-01-14 20:17:08 +0100 | [diff] [blame] | 695 | |
Felix Fietkau | a05b5d45 | 2010-11-17 04:25:33 +0100 | [diff] [blame] | 696 | *data = pdata->eeprom_data[off]; |
| 697 | } else { |
| 698 | struct ath_hw *ah = (struct ath_hw *) common->ah; |
| 699 | |
| 700 | common->ops->read(ah, AR5416_EEPROM_OFFSET + |
| 701 | (off << AR5416_EEPROM_S)); |
| 702 | |
| 703 | if (!ath9k_hw_wait(ah, |
| 704 | AR_EEPROM_STATUS_DATA, |
| 705 | AR_EEPROM_STATUS_DATA_BUSY | |
| 706 | AR_EEPROM_STATUS_DATA_PROT_ACCESS, 0, |
| 707 | AH_WAIT_TIMEOUT)) { |
| 708 | return false; |
| 709 | } |
| 710 | |
| 711 | *data = MS(common->ops->read(ah, AR_EEPROM_STATUS_DATA), |
| 712 | AR_EEPROM_STATUS_DATA_VAL); |
Gabor Juhos | 9dbeb91 | 2009-01-14 20:17:08 +0100 | [diff] [blame] | 713 | } |
| 714 | |
Gabor Juhos | 9dbeb91 | 2009-01-14 20:17:08 +0100 | [diff] [blame] | 715 | return true; |
| 716 | } |
| 717 | |
Stanislaw Gruszka | 69ce674 | 2011-08-05 13:10:34 +0200 | [diff] [blame] | 718 | /* Need to be called after we discover btcoex capabilities */ |
Stanislaw Gruszka | d493008 | 2011-07-29 15:59:08 +0200 | [diff] [blame] | 719 | static void ath_pci_aspm_init(struct ath_common *common) |
| 720 | { |
| 721 | struct ath_softc *sc = (struct ath_softc *) common->priv; |
| 722 | struct ath_hw *ah = sc->sc_ah; |
| 723 | struct pci_dev *pdev = to_pci_dev(sc->dev); |
| 724 | struct pci_dev *parent; |
Jiang Liu | 08bd108 | 2012-07-24 17:20:25 +0800 | [diff] [blame] | 725 | u16 aspm; |
Stanislaw Gruszka | d493008 | 2011-07-29 15:59:08 +0200 | [diff] [blame] | 726 | |
Sujith Manoharan | d09f5f4 | 2012-06-04 16:27:14 +0530 | [diff] [blame] | 727 | if (!ah->is_pciexpress) |
| 728 | return; |
| 729 | |
Stanislaw Gruszka | d493008 | 2011-07-29 15:59:08 +0200 | [diff] [blame] | 730 | parent = pdev->bus->self; |
John W. Linville | 22c55e6 | 2011-08-24 14:08:41 -0400 | [diff] [blame] | 731 | if (!parent) |
| 732 | return; |
Stanislaw Gruszka | 69ce674 | 2011-08-05 13:10:34 +0200 | [diff] [blame] | 733 | |
Sujith Manoharan | 046b680 | 2012-09-22 00:14:28 +0530 | [diff] [blame] | 734 | if ((ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) && |
| 735 | (AR_SREV_9285(ah))) { |
Bjorn Helgaas | a875621 | 2012-12-05 13:51:19 -0700 | [diff] [blame] | 736 | /* Bluetooth coexistence requires disabling ASPM. */ |
Jiang Liu | 08bd108 | 2012-07-24 17:20:25 +0800 | [diff] [blame] | 737 | pcie_capability_clear_word(pdev, PCI_EXP_LNKCTL, |
Bjorn Helgaas | a875621 | 2012-12-05 13:51:19 -0700 | [diff] [blame] | 738 | PCI_EXP_LNKCTL_ASPM_L0S | PCI_EXP_LNKCTL_ASPM_L1); |
Stanislaw Gruszka | 69ce674 | 2011-08-05 13:10:34 +0200 | [diff] [blame] | 739 | |
| 740 | /* |
| 741 | * Both upstream and downstream PCIe components should |
| 742 | * have the same ASPM settings. |
| 743 | */ |
Jiang Liu | 08bd108 | 2012-07-24 17:20:25 +0800 | [diff] [blame] | 744 | pcie_capability_clear_word(parent, PCI_EXP_LNKCTL, |
Bjorn Helgaas | a875621 | 2012-12-05 13:51:19 -0700 | [diff] [blame] | 745 | PCI_EXP_LNKCTL_ASPM_L0S | PCI_EXP_LNKCTL_ASPM_L1); |
Stanislaw Gruszka | 69ce674 | 2011-08-05 13:10:34 +0200 | [diff] [blame] | 746 | |
Sujith Manoharan | d09f5f4 | 2012-06-04 16:27:14 +0530 | [diff] [blame] | 747 | ath_info(common, "Disabling ASPM since BTCOEX is enabled\n"); |
Stanislaw Gruszka | 69ce674 | 2011-08-05 13:10:34 +0200 | [diff] [blame] | 748 | return; |
| 749 | } |
| 750 | |
Sujith Manoharan | b380a43b | 2013-08-25 14:43:09 +0530 | [diff] [blame] | 751 | /* |
| 752 | * 0x70c - Ack Frequency Register. |
| 753 | * |
| 754 | * Bits 27:29 - DEFAULT_L1_ENTRANCE_LATENCY. |
| 755 | * |
| 756 | * 000 : 1 us |
| 757 | * 001 : 2 us |
| 758 | * 010 : 4 us |
| 759 | * 011 : 8 us |
| 760 | * 100 : 16 us |
| 761 | * 101 : 32 us |
| 762 | * 110/111 : 64 us |
| 763 | */ |
| 764 | if (AR_SREV_9462(ah)) |
| 765 | pci_read_config_dword(pdev, 0x70c, &ah->config.aspm_l1_fix); |
| 766 | |
Jiang Liu | 08bd108 | 2012-07-24 17:20:25 +0800 | [diff] [blame] | 767 | pcie_capability_read_word(parent, PCI_EXP_LNKCTL, &aspm); |
Bjorn Helgaas | a875621 | 2012-12-05 13:51:19 -0700 | [diff] [blame] | 768 | if (aspm & (PCI_EXP_LNKCTL_ASPM_L0S | PCI_EXP_LNKCTL_ASPM_L1)) { |
Stanislaw Gruszka | d493008 | 2011-07-29 15:59:08 +0200 | [diff] [blame] | 769 | ah->aspm_enabled = true; |
| 770 | /* Initialize PCIe PM and SERDES registers. */ |
Stanislaw Gruszka | 84c87dc | 2011-08-05 13:10:32 +0200 | [diff] [blame] | 771 | ath9k_hw_configpcipowersave(ah, false); |
Sujith Manoharan | d09f5f4 | 2012-06-04 16:27:14 +0530 | [diff] [blame] | 772 | ath_info(common, "ASPM enabled: 0x%x\n", aspm); |
Stanislaw Gruszka | d493008 | 2011-07-29 15:59:08 +0200 | [diff] [blame] | 773 | } |
| 774 | } |
| 775 | |
Tobias Klauser | 83bd11a | 2009-12-23 14:04:43 +0100 | [diff] [blame] | 776 | static const struct ath_bus_ops ath_pci_bus_ops = { |
Sujith | 497ad9a | 2010-04-01 10:28:20 +0530 | [diff] [blame] | 777 | .ath_bus_type = ATH_PCI, |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 778 | .read_cachesize = ath_pci_read_cachesize, |
Gabor Juhos | 9dbeb91 | 2009-01-14 20:17:08 +0100 | [diff] [blame] | 779 | .eeprom_read = ath_pci_eeprom_read, |
Stanislaw Gruszka | d493008 | 2011-07-29 15:59:08 +0200 | [diff] [blame] | 780 | .aspm_init = ath_pci_aspm_init, |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 781 | }; |
| 782 | |
| 783 | static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) |
| 784 | { |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 785 | struct ath_softc *sc; |
| 786 | struct ieee80211_hw *hw; |
| 787 | u8 csz; |
Jouni Malinen | f021484 | 2009-06-16 11:59:23 +0300 | [diff] [blame] | 788 | u32 val; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 789 | int ret = 0; |
Luis R. Rodriguez | f934c4d | 2009-10-27 12:59:34 -0400 | [diff] [blame] | 790 | char hw_name[64]; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 791 | |
Felix Fietkau | b81950b1 | 2012-12-12 13:14:22 +0100 | [diff] [blame] | 792 | if (pcim_enable_device(pdev)) |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 793 | return -EIO; |
| 794 | |
Yang Hongyang | e930438 | 2009-04-13 14:40:14 -0700 | [diff] [blame] | 795 | ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 796 | if (ret) { |
Joe Perches | 516304b | 2012-03-18 17:30:52 -0700 | [diff] [blame] | 797 | pr_err("32-bit DMA not available\n"); |
Felix Fietkau | b81950b1 | 2012-12-12 13:14:22 +0100 | [diff] [blame] | 798 | return ret; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 799 | } |
| 800 | |
Yang Hongyang | e930438 | 2009-04-13 14:40:14 -0700 | [diff] [blame] | 801 | ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 802 | if (ret) { |
Joe Perches | 516304b | 2012-03-18 17:30:52 -0700 | [diff] [blame] | 803 | pr_err("32-bit DMA consistent DMA enable failed\n"); |
Felix Fietkau | b81950b1 | 2012-12-12 13:14:22 +0100 | [diff] [blame] | 804 | return ret; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 805 | } |
| 806 | |
| 807 | /* |
| 808 | * Cache line size is used to size and align various |
| 809 | * structures used to communicate with the hardware. |
| 810 | */ |
| 811 | pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &csz); |
| 812 | if (csz == 0) { |
| 813 | /* |
| 814 | * Linux 2.4.18 (at least) writes the cache line size |
| 815 | * register as a 16-bit wide register which is wrong. |
| 816 | * We must have this setup properly for rx buffer |
| 817 | * DMA to work so force a reasonable value here if it |
| 818 | * comes up zero. |
| 819 | */ |
| 820 | csz = L1_CACHE_BYTES / sizeof(u32); |
| 821 | pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, csz); |
| 822 | } |
| 823 | /* |
| 824 | * The default setting of latency timer yields poor results, |
| 825 | * set it to the value used by other systems. It may be worth |
| 826 | * tweaking this setting more. |
| 827 | */ |
| 828 | pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xa8); |
| 829 | |
| 830 | pci_set_master(pdev); |
| 831 | |
Jouni Malinen | f021484 | 2009-06-16 11:59:23 +0300 | [diff] [blame] | 832 | /* |
| 833 | * Disable the RETRY_TIMEOUT register (0x41) to keep |
| 834 | * PCI Tx retries from interfering with C3 CPU state. |
| 835 | */ |
| 836 | pci_read_config_dword(pdev, 0x40, &val); |
| 837 | if ((val & 0x0000ff00) != 0) |
| 838 | pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); |
| 839 | |
Felix Fietkau | b81950b1 | 2012-12-12 13:14:22 +0100 | [diff] [blame] | 840 | ret = pcim_iomap_regions(pdev, BIT(0), "ath9k"); |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 841 | if (ret) { |
| 842 | dev_err(&pdev->dev, "PCI memory region reserve error\n"); |
Felix Fietkau | b81950b1 | 2012-12-12 13:14:22 +0100 | [diff] [blame] | 843 | return -ENODEV; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 844 | } |
| 845 | |
Felix Fietkau | 78b2194 | 2014-06-11 16:17:55 +0530 | [diff] [blame] | 846 | ath9k_fill_chanctx_ops(); |
Felix Fietkau | 9ac5861 | 2011-01-24 19:23:18 +0100 | [diff] [blame] | 847 | hw = ieee80211_alloc_hw(sizeof(struct ath_softc), &ath9k_ops); |
Luis R. Rodriguez | db6be53 | 2009-09-02 16:34:57 -0700 | [diff] [blame] | 848 | if (!hw) { |
Sujith | 285f2dd | 2010-01-08 10:36:07 +0530 | [diff] [blame] | 849 | dev_err(&pdev->dev, "No memory for ieee80211_hw\n"); |
Felix Fietkau | b81950b1 | 2012-12-12 13:14:22 +0100 | [diff] [blame] | 850 | return -ENOMEM; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 851 | } |
| 852 | |
| 853 | SET_IEEE80211_DEV(hw, &pdev->dev); |
| 854 | pci_set_drvdata(pdev, hw); |
| 855 | |
Felix Fietkau | 9ac5861 | 2011-01-24 19:23:18 +0100 | [diff] [blame] | 856 | sc = hw->priv; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 857 | sc->hw = hw; |
| 858 | sc->dev = &pdev->dev; |
Felix Fietkau | b81950b1 | 2012-12-12 13:14:22 +0100 | [diff] [blame] | 859 | sc->mem = pcim_iomap_table(pdev)[0]; |
Sujith Manoharan | 9b60b64 | 2013-06-13 22:51:26 +0530 | [diff] [blame] | 860 | sc->driver_data = id->driver_data; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 861 | |
Luis R. Rodriguez | fc548af | 2009-09-02 17:06:21 -0700 | [diff] [blame] | 862 | ret = request_irq(pdev->irq, ath_isr, IRQF_SHARED, "ath9k", sc); |
Luis R. Rodriguez | 580171f | 2009-09-02 17:02:18 -0700 | [diff] [blame] | 863 | if (ret) { |
| 864 | dev_err(&pdev->dev, "request_irq failed\n"); |
Sujith | 285f2dd | 2010-01-08 10:36:07 +0530 | [diff] [blame] | 865 | goto err_irq; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 866 | } |
| 867 | |
| 868 | sc->irq = pdev->irq; |
| 869 | |
Pavel Roskin | eb93e89 | 2011-07-23 03:55:39 -0400 | [diff] [blame] | 870 | ret = ath9k_init_device(id->device, sc, &ath_pci_bus_ops); |
Sujith | 285f2dd | 2010-01-08 10:36:07 +0530 | [diff] [blame] | 871 | if (ret) { |
| 872 | dev_err(&pdev->dev, "Failed to initialize device\n"); |
| 873 | goto err_init; |
| 874 | } |
| 875 | |
| 876 | ath9k_hw_name(sc->sc_ah, hw_name, sizeof(hw_name)); |
Joe Perches | c96c31e | 2010-07-26 14:39:58 -0700 | [diff] [blame] | 877 | wiphy_info(hw->wiphy, "%s mem=0x%lx, irq=%d\n", |
Felix Fietkau | b81950b1 | 2012-12-12 13:14:22 +0100 | [diff] [blame] | 878 | hw_name, (unsigned long)sc->mem, pdev->irq); |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 879 | |
| 880 | return 0; |
Sujith | 285f2dd | 2010-01-08 10:36:07 +0530 | [diff] [blame] | 881 | |
| 882 | err_init: |
| 883 | free_irq(sc->irq, sc); |
| 884 | err_irq: |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 885 | ieee80211_free_hw(hw); |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 886 | return ret; |
| 887 | } |
| 888 | |
| 889 | static void ath_pci_remove(struct pci_dev *pdev) |
| 890 | { |
| 891 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); |
Felix Fietkau | 9ac5861 | 2011-01-24 19:23:18 +0100 | [diff] [blame] | 892 | struct ath_softc *sc = hw->priv; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 893 | |
Rajkumar Manoharan | d584747 | 2010-12-20 14:39:51 +0530 | [diff] [blame] | 894 | if (!is_ath9k_unloaded) |
| 895 | sc->sc_ah->ah_flags |= AH_UNPLUGGED; |
Sujith | 285f2dd | 2010-01-08 10:36:07 +0530 | [diff] [blame] | 896 | ath9k_deinit_device(sc); |
| 897 | free_irq(sc->irq, sc); |
| 898 | ieee80211_free_hw(sc->hw); |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 899 | } |
| 900 | |
Hauke Mehrtens | 8842758 | 2012-11-29 23:27:15 +0100 | [diff] [blame] | 901 | #ifdef CONFIG_PM_SLEEP |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 902 | |
Rafael J. Wysocki | f0e94b4 | 2010-10-16 00:36:17 +0200 | [diff] [blame] | 903 | static int ath_pci_suspend(struct device *device) |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 904 | { |
Rafael J. Wysocki | f0e94b4 | 2010-10-16 00:36:17 +0200 | [diff] [blame] | 905 | struct pci_dev *pdev = to_pci_dev(device); |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 906 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); |
Felix Fietkau | 9ac5861 | 2011-01-24 19:23:18 +0100 | [diff] [blame] | 907 | struct ath_softc *sc = hw->priv; |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 908 | |
Mohammed Shafi Shajakhan | 4a17a50 | 2012-07-10 14:57:11 +0530 | [diff] [blame] | 909 | if (sc->wow_enabled) |
| 910 | return 0; |
| 911 | |
Rajkumar Manoharan | c31eb8e | 2011-06-28 18:21:19 +0530 | [diff] [blame] | 912 | /* The device has to be moved to FULLSLEEP forcibly. |
| 913 | * Otherwise the chip never moved to full sleep, |
| 914 | * when no interface is up. |
| 915 | */ |
Rajkumar Manoharan | e19f15a | 2012-08-09 12:37:26 +0530 | [diff] [blame] | 916 | ath9k_stop_btcoex(sc); |
Felix Fietkau | c0c1174 | 2011-11-16 13:08:41 +0100 | [diff] [blame] | 917 | ath9k_hw_disable(sc->sc_ah); |
Rajkumar Manoharan | 1c48f98 | 2014-05-22 14:11:41 +0530 | [diff] [blame] | 918 | del_timer_sync(&sc->sleep_timer); |
Rajkumar Manoharan | c31eb8e | 2011-06-28 18:21:19 +0530 | [diff] [blame] | 919 | ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP); |
| 920 | |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 921 | return 0; |
| 922 | } |
| 923 | |
Rafael J. Wysocki | f0e94b4 | 2010-10-16 00:36:17 +0200 | [diff] [blame] | 924 | static int ath_pci_resume(struct device *device) |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 925 | { |
Rafael J. Wysocki | f0e94b4 | 2010-10-16 00:36:17 +0200 | [diff] [blame] | 926 | struct pci_dev *pdev = to_pci_dev(device); |
Felix Fietkau | 9317051 | 2012-10-03 21:07:50 +0200 | [diff] [blame] | 927 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); |
| 928 | struct ath_softc *sc = hw->priv; |
Felix Fietkau | ceb26a6 | 2012-10-03 21:07:51 +0200 | [diff] [blame] | 929 | struct ath_hw *ah = sc->sc_ah; |
| 930 | struct ath_common *common = ath9k_hw_common(ah); |
Jouni Malinen | f021484 | 2009-06-16 11:59:23 +0300 | [diff] [blame] | 931 | u32 val; |
Sujith | 523c36f | 2009-08-13 09:34:35 +0530 | [diff] [blame] | 932 | |
Jouni Malinen | f021484 | 2009-06-16 11:59:23 +0300 | [diff] [blame] | 933 | /* |
| 934 | * Suspend/Resume resets the PCI configuration space, so we have to |
| 935 | * re-disable the RETRY_TIMEOUT register (0x41) to keep |
| 936 | * PCI Tx retries from interfering with C3 CPU state |
| 937 | */ |
| 938 | pci_read_config_dword(pdev, 0x40, &val); |
| 939 | if ((val & 0x0000ff00) != 0) |
| 940 | pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 941 | |
Felix Fietkau | 9317051 | 2012-10-03 21:07:50 +0200 | [diff] [blame] | 942 | ath_pci_aspm_init(common); |
Felix Fietkau | ceb26a6 | 2012-10-03 21:07:51 +0200 | [diff] [blame] | 943 | ah->reset_power_on = false; |
Felix Fietkau | 9317051 | 2012-10-03 21:07:50 +0200 | [diff] [blame] | 944 | |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 945 | return 0; |
| 946 | } |
| 947 | |
Hauke Mehrtens | 8842758 | 2012-11-29 23:27:15 +0100 | [diff] [blame] | 948 | 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] | 949 | |
| 950 | #define ATH9K_PM_OPS (&ath9k_pm_ops) |
| 951 | |
Hauke Mehrtens | 8842758 | 2012-11-29 23:27:15 +0100 | [diff] [blame] | 952 | #else /* !CONFIG_PM_SLEEP */ |
Rafael J. Wysocki | f0e94b4 | 2010-10-16 00:36:17 +0200 | [diff] [blame] | 953 | |
| 954 | #define ATH9K_PM_OPS NULL |
| 955 | |
Hauke Mehrtens | 8842758 | 2012-11-29 23:27:15 +0100 | [diff] [blame] | 956 | #endif /* !CONFIG_PM_SLEEP */ |
Rafael J. Wysocki | f0e94b4 | 2010-10-16 00:36:17 +0200 | [diff] [blame] | 957 | |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 958 | |
| 959 | MODULE_DEVICE_TABLE(pci, ath_pci_id_table); |
| 960 | |
| 961 | static struct pci_driver ath_pci_driver = { |
| 962 | .name = "ath9k", |
| 963 | .id_table = ath_pci_id_table, |
| 964 | .probe = ath_pci_probe, |
| 965 | .remove = ath_pci_remove, |
Rafael J. Wysocki | f0e94b4 | 2010-10-16 00:36:17 +0200 | [diff] [blame] | 966 | .driver.pm = ATH9K_PM_OPS, |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 967 | }; |
| 968 | |
Sujith | db0f41f | 2009-02-20 15:13:26 +0530 | [diff] [blame] | 969 | int ath_pci_init(void) |
Gabor Juhos | 6baff7f | 2009-01-14 20:17:06 +0100 | [diff] [blame] | 970 | { |
| 971 | return pci_register_driver(&ath_pci_driver); |
| 972 | } |
| 973 | |
| 974 | void ath_pci_exit(void) |
| 975 | { |
| 976 | pci_unregister_driver(&ath_pci_driver); |
| 977 | } |