162306a36Sopenharmony_ci/* 262306a36Sopenharmony_ci * Copyright (c) 2008-2011 Atheros Communications Inc. 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * Permission to use, copy, modify, and/or distribute this software for any 562306a36Sopenharmony_ci * purpose with or without fee is hereby granted, provided that the above 662306a36Sopenharmony_ci * copyright notice and this permission notice appear in all copies. 762306a36Sopenharmony_ci * 862306a36Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 962306a36Sopenharmony_ci * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 1062306a36Sopenharmony_ci * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 1162306a36Sopenharmony_ci * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 1262306a36Sopenharmony_ci * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 1362306a36Sopenharmony_ci * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 1462306a36Sopenharmony_ci * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1562306a36Sopenharmony_ci */ 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ci#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1862306a36Sopenharmony_ci 1962306a36Sopenharmony_ci#include <linux/nl80211.h> 2062306a36Sopenharmony_ci#include <linux/pci.h> 2162306a36Sopenharmony_ci#include <linux/module.h> 2262306a36Sopenharmony_ci#include "ath9k.h" 2362306a36Sopenharmony_ci 2462306a36Sopenharmony_ciextern int ath9k_use_msi; 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_cistatic const struct pci_device_id ath_pci_id_table[] = { 2762306a36Sopenharmony_ci { PCI_VDEVICE(ATHEROS, 0x0023) }, /* PCI */ 2862306a36Sopenharmony_ci { PCI_VDEVICE(ATHEROS, 0x0024) }, /* PCI-E */ 2962306a36Sopenharmony_ci { PCI_VDEVICE(ATHEROS, 0x0027) }, /* PCI */ 3062306a36Sopenharmony_ci 3162306a36Sopenharmony_ci#ifdef CONFIG_ATH9K_PCOEM 3262306a36Sopenharmony_ci /* Mini PCI AR9220 MB92 cards: Compex WLM200NX, Wistron DNMA-92 */ 3362306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 3462306a36Sopenharmony_ci 0x0029, 3562306a36Sopenharmony_ci PCI_VENDOR_ID_ATHEROS, 3662306a36Sopenharmony_ci 0x2096), 3762306a36Sopenharmony_ci .driver_data = ATH9K_PCI_LED_ACT_HI }, 3862306a36Sopenharmony_ci#endif 3962306a36Sopenharmony_ci 4062306a36Sopenharmony_ci { PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI */ 4162306a36Sopenharmony_ci 4262306a36Sopenharmony_ci#ifdef CONFIG_ATH9K_PCOEM 4362306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 4462306a36Sopenharmony_ci 0x002A, 4562306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 4662306a36Sopenharmony_ci 0x1C71), 4762306a36Sopenharmony_ci .driver_data = ATH9K_PCI_D3_L1_WAR }, 4862306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 4962306a36Sopenharmony_ci 0x002A, 5062306a36Sopenharmony_ci PCI_VENDOR_ID_FOXCONN, 5162306a36Sopenharmony_ci 0xE01F), 5262306a36Sopenharmony_ci .driver_data = ATH9K_PCI_D3_L1_WAR }, 5362306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 5462306a36Sopenharmony_ci 0x002A, 5562306a36Sopenharmony_ci 0x11AD, /* LITEON */ 5662306a36Sopenharmony_ci 0x6632), 5762306a36Sopenharmony_ci .driver_data = ATH9K_PCI_D3_L1_WAR }, 5862306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 5962306a36Sopenharmony_ci 0x002A, 6062306a36Sopenharmony_ci 0x11AD, /* LITEON */ 6162306a36Sopenharmony_ci 0x6642), 6262306a36Sopenharmony_ci .driver_data = ATH9K_PCI_D3_L1_WAR }, 6362306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 6462306a36Sopenharmony_ci 0x002A, 6562306a36Sopenharmony_ci PCI_VENDOR_ID_QMI, 6662306a36Sopenharmony_ci 0x0306), 6762306a36Sopenharmony_ci .driver_data = ATH9K_PCI_D3_L1_WAR }, 6862306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 6962306a36Sopenharmony_ci 0x002A, 7062306a36Sopenharmony_ci 0x185F, /* WNC */ 7162306a36Sopenharmony_ci 0x309D), 7262306a36Sopenharmony_ci .driver_data = ATH9K_PCI_D3_L1_WAR }, 7362306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 7462306a36Sopenharmony_ci 0x002A, 7562306a36Sopenharmony_ci 0x10CF, /* Fujitsu */ 7662306a36Sopenharmony_ci 0x147C), 7762306a36Sopenharmony_ci .driver_data = ATH9K_PCI_D3_L1_WAR }, 7862306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 7962306a36Sopenharmony_ci 0x002A, 8062306a36Sopenharmony_ci 0x10CF, /* Fujitsu */ 8162306a36Sopenharmony_ci 0x147D), 8262306a36Sopenharmony_ci .driver_data = ATH9K_PCI_D3_L1_WAR }, 8362306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 8462306a36Sopenharmony_ci 0x002A, 8562306a36Sopenharmony_ci 0x10CF, /* Fujitsu */ 8662306a36Sopenharmony_ci 0x1536), 8762306a36Sopenharmony_ci .driver_data = ATH9K_PCI_D3_L1_WAR }, 8862306a36Sopenharmony_ci#endif 8962306a36Sopenharmony_ci 9062306a36Sopenharmony_ci { PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */ 9162306a36Sopenharmony_ci 9262306a36Sopenharmony_ci#ifdef CONFIG_ATH9K_PCOEM 9362306a36Sopenharmony_ci /* AR9285 card for Asus */ 9462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 9562306a36Sopenharmony_ci 0x002B, 9662306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 9762306a36Sopenharmony_ci 0x2C37), 9862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_BT_ANT_DIV }, 9962306a36Sopenharmony_ci#endif 10062306a36Sopenharmony_ci 10162306a36Sopenharmony_ci { PCI_VDEVICE(ATHEROS, 0x002B) }, /* PCI-E */ 10262306a36Sopenharmony_ci { PCI_VDEVICE(ATHEROS, 0x002C) }, /* PCI-E 802.11n bonded out */ 10362306a36Sopenharmony_ci { PCI_VDEVICE(ATHEROS, 0x002D) }, /* PCI */ 10462306a36Sopenharmony_ci { PCI_VDEVICE(ATHEROS, 0x002E) }, /* PCI-E */ 10562306a36Sopenharmony_ci 10662306a36Sopenharmony_ci /* Killer Wireless (3x3) */ 10762306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 10862306a36Sopenharmony_ci 0x0030, 10962306a36Sopenharmony_ci 0x1A56, 11062306a36Sopenharmony_ci 0x2000), 11162306a36Sopenharmony_ci .driver_data = ATH9K_PCI_KILLER }, 11262306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 11362306a36Sopenharmony_ci 0x0030, 11462306a36Sopenharmony_ci 0x1A56, 11562306a36Sopenharmony_ci 0x2001), 11662306a36Sopenharmony_ci .driver_data = ATH9K_PCI_KILLER }, 11762306a36Sopenharmony_ci 11862306a36Sopenharmony_ci { PCI_VDEVICE(ATHEROS, 0x0030) }, /* PCI-E AR9300 */ 11962306a36Sopenharmony_ci 12062306a36Sopenharmony_ci#ifdef CONFIG_ATH9K_PCOEM 12162306a36Sopenharmony_ci /* PCI-E CUS198 */ 12262306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 12362306a36Sopenharmony_ci 0x0032, 12462306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 12562306a36Sopenharmony_ci 0x2086), 12662306a36Sopenharmony_ci .driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV }, 12762306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 12862306a36Sopenharmony_ci 0x0032, 12962306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 13062306a36Sopenharmony_ci 0x1237), 13162306a36Sopenharmony_ci .driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV }, 13262306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 13362306a36Sopenharmony_ci 0x0032, 13462306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 13562306a36Sopenharmony_ci 0x2126), 13662306a36Sopenharmony_ci .driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV }, 13762306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 13862306a36Sopenharmony_ci 0x0032, 13962306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 14062306a36Sopenharmony_ci 0x126A), 14162306a36Sopenharmony_ci .driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV }, 14262306a36Sopenharmony_ci 14362306a36Sopenharmony_ci /* PCI-E CUS230 */ 14462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 14562306a36Sopenharmony_ci 0x0032, 14662306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 14762306a36Sopenharmony_ci 0x2152), 14862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_CUS230 | ATH9K_PCI_BT_ANT_DIV }, 14962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 15062306a36Sopenharmony_ci 0x0032, 15162306a36Sopenharmony_ci PCI_VENDOR_ID_FOXCONN, 15262306a36Sopenharmony_ci 0xE075), 15362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_CUS230 | ATH9K_PCI_BT_ANT_DIV }, 15462306a36Sopenharmony_ci 15562306a36Sopenharmony_ci /* WB225 */ 15662306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 15762306a36Sopenharmony_ci 0x0032, 15862306a36Sopenharmony_ci PCI_VENDOR_ID_ATHEROS, 15962306a36Sopenharmony_ci 0x3119), 16062306a36Sopenharmony_ci .driver_data = ATH9K_PCI_BT_ANT_DIV }, 16162306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 16262306a36Sopenharmony_ci 0x0032, 16362306a36Sopenharmony_ci PCI_VENDOR_ID_ATHEROS, 16462306a36Sopenharmony_ci 0x3122), 16562306a36Sopenharmony_ci .driver_data = ATH9K_PCI_BT_ANT_DIV }, 16662306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 16762306a36Sopenharmony_ci 0x0032, 16862306a36Sopenharmony_ci 0x185F, /* WNC */ 16962306a36Sopenharmony_ci 0x3119), 17062306a36Sopenharmony_ci .driver_data = ATH9K_PCI_BT_ANT_DIV }, 17162306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 17262306a36Sopenharmony_ci 0x0032, 17362306a36Sopenharmony_ci 0x185F, /* WNC */ 17462306a36Sopenharmony_ci 0x3027), 17562306a36Sopenharmony_ci .driver_data = ATH9K_PCI_BT_ANT_DIV }, 17662306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 17762306a36Sopenharmony_ci 0x0032, 17862306a36Sopenharmony_ci PCI_VENDOR_ID_SAMSUNG, 17962306a36Sopenharmony_ci 0x4105), 18062306a36Sopenharmony_ci .driver_data = ATH9K_PCI_BT_ANT_DIV }, 18162306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 18262306a36Sopenharmony_ci 0x0032, 18362306a36Sopenharmony_ci PCI_VENDOR_ID_SAMSUNG, 18462306a36Sopenharmony_ci 0x4106), 18562306a36Sopenharmony_ci .driver_data = ATH9K_PCI_BT_ANT_DIV }, 18662306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 18762306a36Sopenharmony_ci 0x0032, 18862306a36Sopenharmony_ci PCI_VENDOR_ID_SAMSUNG, 18962306a36Sopenharmony_ci 0x410D), 19062306a36Sopenharmony_ci .driver_data = ATH9K_PCI_BT_ANT_DIV }, 19162306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 19262306a36Sopenharmony_ci 0x0032, 19362306a36Sopenharmony_ci PCI_VENDOR_ID_SAMSUNG, 19462306a36Sopenharmony_ci 0x410E), 19562306a36Sopenharmony_ci .driver_data = ATH9K_PCI_BT_ANT_DIV }, 19662306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 19762306a36Sopenharmony_ci 0x0032, 19862306a36Sopenharmony_ci PCI_VENDOR_ID_SAMSUNG, 19962306a36Sopenharmony_ci 0x410F), 20062306a36Sopenharmony_ci .driver_data = ATH9K_PCI_BT_ANT_DIV }, 20162306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 20262306a36Sopenharmony_ci 0x0032, 20362306a36Sopenharmony_ci PCI_VENDOR_ID_SAMSUNG, 20462306a36Sopenharmony_ci 0xC706), 20562306a36Sopenharmony_ci .driver_data = ATH9K_PCI_BT_ANT_DIV }, 20662306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 20762306a36Sopenharmony_ci 0x0032, 20862306a36Sopenharmony_ci PCI_VENDOR_ID_SAMSUNG, 20962306a36Sopenharmony_ci 0xC680), 21062306a36Sopenharmony_ci .driver_data = ATH9K_PCI_BT_ANT_DIV }, 21162306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 21262306a36Sopenharmony_ci 0x0032, 21362306a36Sopenharmony_ci PCI_VENDOR_ID_SAMSUNG, 21462306a36Sopenharmony_ci 0xC708), 21562306a36Sopenharmony_ci .driver_data = ATH9K_PCI_BT_ANT_DIV }, 21662306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 21762306a36Sopenharmony_ci 0x0032, 21862306a36Sopenharmony_ci PCI_VENDOR_ID_LENOVO, 21962306a36Sopenharmony_ci 0x3218), 22062306a36Sopenharmony_ci .driver_data = ATH9K_PCI_BT_ANT_DIV }, 22162306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 22262306a36Sopenharmony_ci 0x0032, 22362306a36Sopenharmony_ci PCI_VENDOR_ID_LENOVO, 22462306a36Sopenharmony_ci 0x3219), 22562306a36Sopenharmony_ci .driver_data = ATH9K_PCI_BT_ANT_DIV }, 22662306a36Sopenharmony_ci 22762306a36Sopenharmony_ci /* AR9485 cards with PLL power-save disabled by default. */ 22862306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 22962306a36Sopenharmony_ci 0x0032, 23062306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 23162306a36Sopenharmony_ci 0x2C97), 23262306a36Sopenharmony_ci .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, 23362306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 23462306a36Sopenharmony_ci 0x0032, 23562306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 23662306a36Sopenharmony_ci 0x2100), 23762306a36Sopenharmony_ci .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, 23862306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 23962306a36Sopenharmony_ci 0x0032, 24062306a36Sopenharmony_ci 0x1C56, /* ASKEY */ 24162306a36Sopenharmony_ci 0x4001), 24262306a36Sopenharmony_ci .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, 24362306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 24462306a36Sopenharmony_ci 0x0032, 24562306a36Sopenharmony_ci 0x11AD, /* LITEON */ 24662306a36Sopenharmony_ci 0x6627), 24762306a36Sopenharmony_ci .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, 24862306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 24962306a36Sopenharmony_ci 0x0032, 25062306a36Sopenharmony_ci 0x11AD, /* LITEON */ 25162306a36Sopenharmony_ci 0x6628), 25262306a36Sopenharmony_ci .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, 25362306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 25462306a36Sopenharmony_ci 0x0032, 25562306a36Sopenharmony_ci PCI_VENDOR_ID_FOXCONN, 25662306a36Sopenharmony_ci 0xE04E), 25762306a36Sopenharmony_ci .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, 25862306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 25962306a36Sopenharmony_ci 0x0032, 26062306a36Sopenharmony_ci PCI_VENDOR_ID_FOXCONN, 26162306a36Sopenharmony_ci 0xE04F), 26262306a36Sopenharmony_ci .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, 26362306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 26462306a36Sopenharmony_ci 0x0032, 26562306a36Sopenharmony_ci 0x144F, /* ASKEY */ 26662306a36Sopenharmony_ci 0x7197), 26762306a36Sopenharmony_ci .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, 26862306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 26962306a36Sopenharmony_ci 0x0032, 27062306a36Sopenharmony_ci 0x1B9A, /* XAVI */ 27162306a36Sopenharmony_ci 0x2000), 27262306a36Sopenharmony_ci .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, 27362306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 27462306a36Sopenharmony_ci 0x0032, 27562306a36Sopenharmony_ci 0x1B9A, /* XAVI */ 27662306a36Sopenharmony_ci 0x2001), 27762306a36Sopenharmony_ci .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, 27862306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 27962306a36Sopenharmony_ci 0x0032, 28062306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 28162306a36Sopenharmony_ci 0x1186), 28262306a36Sopenharmony_ci .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, 28362306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 28462306a36Sopenharmony_ci 0x0032, 28562306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 28662306a36Sopenharmony_ci 0x1F86), 28762306a36Sopenharmony_ci .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, 28862306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 28962306a36Sopenharmony_ci 0x0032, 29062306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 29162306a36Sopenharmony_ci 0x1195), 29262306a36Sopenharmony_ci .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, 29362306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 29462306a36Sopenharmony_ci 0x0032, 29562306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 29662306a36Sopenharmony_ci 0x1F95), 29762306a36Sopenharmony_ci .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, 29862306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 29962306a36Sopenharmony_ci 0x0032, 30062306a36Sopenharmony_ci 0x1B9A, /* XAVI */ 30162306a36Sopenharmony_ci 0x1C00), 30262306a36Sopenharmony_ci .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, 30362306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 30462306a36Sopenharmony_ci 0x0032, 30562306a36Sopenharmony_ci 0x1B9A, /* XAVI */ 30662306a36Sopenharmony_ci 0x1C01), 30762306a36Sopenharmony_ci .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, 30862306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 30962306a36Sopenharmony_ci 0x0032, 31062306a36Sopenharmony_ci PCI_VENDOR_ID_ASUSTEK, 31162306a36Sopenharmony_ci 0x850D), 31262306a36Sopenharmony_ci .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE }, 31362306a36Sopenharmony_ci#endif 31462306a36Sopenharmony_ci 31562306a36Sopenharmony_ci { PCI_VDEVICE(ATHEROS, 0x0032) }, /* PCI-E AR9485 */ 31662306a36Sopenharmony_ci { PCI_VDEVICE(ATHEROS, 0x0033) }, /* PCI-E AR9580 */ 31762306a36Sopenharmony_ci 31862306a36Sopenharmony_ci#ifdef CONFIG_ATH9K_PCOEM 31962306a36Sopenharmony_ci /* PCI-E CUS217 */ 32062306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 32162306a36Sopenharmony_ci 0x0034, 32262306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 32362306a36Sopenharmony_ci 0x2116), 32462306a36Sopenharmony_ci .driver_data = ATH9K_PCI_CUS217 }, 32562306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 32662306a36Sopenharmony_ci 0x0034, 32762306a36Sopenharmony_ci 0x11AD, /* LITEON */ 32862306a36Sopenharmony_ci 0x6661), 32962306a36Sopenharmony_ci .driver_data = ATH9K_PCI_CUS217 }, 33062306a36Sopenharmony_ci 33162306a36Sopenharmony_ci /* AR9462 with WoW support */ 33262306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 33362306a36Sopenharmony_ci 0x0034, 33462306a36Sopenharmony_ci PCI_VENDOR_ID_ATHEROS, 33562306a36Sopenharmony_ci 0x3117), 33662306a36Sopenharmony_ci .driver_data = ATH9K_PCI_WOW }, 33762306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 33862306a36Sopenharmony_ci 0x0034, 33962306a36Sopenharmony_ci PCI_VENDOR_ID_LENOVO, 34062306a36Sopenharmony_ci 0x3214), 34162306a36Sopenharmony_ci .driver_data = ATH9K_PCI_WOW }, 34262306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 34362306a36Sopenharmony_ci 0x0034, 34462306a36Sopenharmony_ci PCI_VENDOR_ID_ATTANSIC, 34562306a36Sopenharmony_ci 0x0091), 34662306a36Sopenharmony_ci .driver_data = ATH9K_PCI_WOW }, 34762306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 34862306a36Sopenharmony_ci 0x0034, 34962306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 35062306a36Sopenharmony_ci 0x2110), 35162306a36Sopenharmony_ci .driver_data = ATH9K_PCI_WOW }, 35262306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 35362306a36Sopenharmony_ci 0x0034, 35462306a36Sopenharmony_ci PCI_VENDOR_ID_ASUSTEK, 35562306a36Sopenharmony_ci 0x850E), 35662306a36Sopenharmony_ci .driver_data = ATH9K_PCI_WOW }, 35762306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 35862306a36Sopenharmony_ci 0x0034, 35962306a36Sopenharmony_ci 0x11AD, /* LITEON */ 36062306a36Sopenharmony_ci 0x6631), 36162306a36Sopenharmony_ci .driver_data = ATH9K_PCI_WOW }, 36262306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 36362306a36Sopenharmony_ci 0x0034, 36462306a36Sopenharmony_ci 0x11AD, /* LITEON */ 36562306a36Sopenharmony_ci 0x6641), 36662306a36Sopenharmony_ci .driver_data = ATH9K_PCI_WOW }, 36762306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 36862306a36Sopenharmony_ci 0x0034, 36962306a36Sopenharmony_ci PCI_VENDOR_ID_HP, 37062306a36Sopenharmony_ci 0x1864), 37162306a36Sopenharmony_ci .driver_data = ATH9K_PCI_WOW }, 37262306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 37362306a36Sopenharmony_ci 0x0034, 37462306a36Sopenharmony_ci 0x14CD, /* USI */ 37562306a36Sopenharmony_ci 0x0063), 37662306a36Sopenharmony_ci .driver_data = ATH9K_PCI_WOW }, 37762306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 37862306a36Sopenharmony_ci 0x0034, 37962306a36Sopenharmony_ci 0x14CD, /* USI */ 38062306a36Sopenharmony_ci 0x0064), 38162306a36Sopenharmony_ci .driver_data = ATH9K_PCI_WOW }, 38262306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 38362306a36Sopenharmony_ci 0x0034, 38462306a36Sopenharmony_ci 0x10CF, /* Fujitsu */ 38562306a36Sopenharmony_ci 0x1783), 38662306a36Sopenharmony_ci .driver_data = ATH9K_PCI_WOW }, 38762306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 38862306a36Sopenharmony_ci 0x0034, 38962306a36Sopenharmony_ci PCI_VENDOR_ID_DELL, 39062306a36Sopenharmony_ci 0x020B), 39162306a36Sopenharmony_ci .driver_data = ATH9K_PCI_WOW }, 39262306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 39362306a36Sopenharmony_ci 0x0034, 39462306a36Sopenharmony_ci PCI_VENDOR_ID_DELL, 39562306a36Sopenharmony_ci 0x0300), 39662306a36Sopenharmony_ci .driver_data = ATH9K_PCI_WOW }, 39762306a36Sopenharmony_ci 39862306a36Sopenharmony_ci /* Killer Wireless (2x2) */ 39962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 40062306a36Sopenharmony_ci 0x0030, 40162306a36Sopenharmony_ci 0x1A56, 40262306a36Sopenharmony_ci 0x2003), 40362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_KILLER }, 40462306a36Sopenharmony_ci 40562306a36Sopenharmony_ci { PCI_VDEVICE(ATHEROS, 0x0034) }, /* PCI-E AR9462 */ 40662306a36Sopenharmony_ci { PCI_VDEVICE(ATHEROS, 0x0037) }, /* PCI-E AR1111/AR9485 */ 40762306a36Sopenharmony_ci 40862306a36Sopenharmony_ci /* CUS252 */ 40962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 41062306a36Sopenharmony_ci 0x0036, 41162306a36Sopenharmony_ci PCI_VENDOR_ID_ATHEROS, 41262306a36Sopenharmony_ci 0x3028), 41362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_CUS252 | 41462306a36Sopenharmony_ci ATH9K_PCI_AR9565_2ANT | 41562306a36Sopenharmony_ci ATH9K_PCI_BT_ANT_DIV }, 41662306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 41762306a36Sopenharmony_ci 0x0036, 41862306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 41962306a36Sopenharmony_ci 0x2176), 42062306a36Sopenharmony_ci .driver_data = ATH9K_PCI_CUS252 | 42162306a36Sopenharmony_ci ATH9K_PCI_AR9565_2ANT | 42262306a36Sopenharmony_ci ATH9K_PCI_BT_ANT_DIV }, 42362306a36Sopenharmony_ci 42462306a36Sopenharmony_ci /* WB335 1-ANT */ 42562306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 42662306a36Sopenharmony_ci 0x0036, 42762306a36Sopenharmony_ci PCI_VENDOR_ID_FOXCONN, 42862306a36Sopenharmony_ci 0xE068), 42962306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT }, 43062306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 43162306a36Sopenharmony_ci 0x0036, 43262306a36Sopenharmony_ci 0x185F, /* WNC */ 43362306a36Sopenharmony_ci 0xA119), 43462306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT }, 43562306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 43662306a36Sopenharmony_ci 0x0036, 43762306a36Sopenharmony_ci 0x11AD, /* LITEON */ 43862306a36Sopenharmony_ci 0x0632), 43962306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT }, 44062306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 44162306a36Sopenharmony_ci 0x0036, 44262306a36Sopenharmony_ci 0x11AD, /* LITEON */ 44362306a36Sopenharmony_ci 0x06B2), 44462306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT }, 44562306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 44662306a36Sopenharmony_ci 0x0036, 44762306a36Sopenharmony_ci 0x11AD, /* LITEON */ 44862306a36Sopenharmony_ci 0x0842), 44962306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT }, 45062306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 45162306a36Sopenharmony_ci 0x0036, 45262306a36Sopenharmony_ci 0x11AD, /* LITEON */ 45362306a36Sopenharmony_ci 0x1842), 45462306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT }, 45562306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 45662306a36Sopenharmony_ci 0x0036, 45762306a36Sopenharmony_ci 0x11AD, /* LITEON */ 45862306a36Sopenharmony_ci 0x6671), 45962306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT }, 46062306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 46162306a36Sopenharmony_ci 0x0036, 46262306a36Sopenharmony_ci 0x1B9A, /* XAVI */ 46362306a36Sopenharmony_ci 0x2811), 46462306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT }, 46562306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 46662306a36Sopenharmony_ci 0x0036, 46762306a36Sopenharmony_ci 0x1B9A, /* XAVI */ 46862306a36Sopenharmony_ci 0x2812), 46962306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT }, 47062306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 47162306a36Sopenharmony_ci 0x0036, 47262306a36Sopenharmony_ci 0x1B9A, /* XAVI */ 47362306a36Sopenharmony_ci 0x28A1), 47462306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT }, 47562306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 47662306a36Sopenharmony_ci 0x0036, 47762306a36Sopenharmony_ci 0x1B9A, /* XAVI */ 47862306a36Sopenharmony_ci 0x28A3), 47962306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT }, 48062306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 48162306a36Sopenharmony_ci 0x0036, 48262306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 48362306a36Sopenharmony_ci 0x218A), 48462306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT }, 48562306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 48662306a36Sopenharmony_ci 0x0036, 48762306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 48862306a36Sopenharmony_ci 0x2F8A), 48962306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT }, 49062306a36Sopenharmony_ci 49162306a36Sopenharmony_ci /* WB335 1-ANT / Antenna Diversity */ 49262306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 49362306a36Sopenharmony_ci 0x0036, 49462306a36Sopenharmony_ci PCI_VENDOR_ID_ATHEROS, 49562306a36Sopenharmony_ci 0x3025), 49662306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, 49762306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 49862306a36Sopenharmony_ci 0x0036, 49962306a36Sopenharmony_ci PCI_VENDOR_ID_ATHEROS, 50062306a36Sopenharmony_ci 0x3026), 50162306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, 50262306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 50362306a36Sopenharmony_ci 0x0036, 50462306a36Sopenharmony_ci PCI_VENDOR_ID_ATHEROS, 50562306a36Sopenharmony_ci 0x302B), 50662306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, 50762306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 50862306a36Sopenharmony_ci 0x0036, 50962306a36Sopenharmony_ci PCI_VENDOR_ID_FOXCONN, 51062306a36Sopenharmony_ci 0xE069), 51162306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, 51262306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 51362306a36Sopenharmony_ci 0x0036, 51462306a36Sopenharmony_ci 0x185F, /* WNC */ 51562306a36Sopenharmony_ci 0x3028), 51662306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, 51762306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 51862306a36Sopenharmony_ci 0x0036, 51962306a36Sopenharmony_ci 0x11AD, /* LITEON */ 52062306a36Sopenharmony_ci 0x0622), 52162306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, 52262306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 52362306a36Sopenharmony_ci 0x0036, 52462306a36Sopenharmony_ci 0x11AD, /* LITEON */ 52562306a36Sopenharmony_ci 0x0672), 52662306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, 52762306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 52862306a36Sopenharmony_ci 0x0036, 52962306a36Sopenharmony_ci 0x11AD, /* LITEON */ 53062306a36Sopenharmony_ci 0x0662), 53162306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, 53262306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 53362306a36Sopenharmony_ci 0x0036, 53462306a36Sopenharmony_ci 0x11AD, /* LITEON */ 53562306a36Sopenharmony_ci 0x06A2), 53662306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, 53762306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 53862306a36Sopenharmony_ci 0x0036, 53962306a36Sopenharmony_ci 0x11AD, /* LITEON */ 54062306a36Sopenharmony_ci 0x0682), 54162306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, 54262306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 54362306a36Sopenharmony_ci 0x0036, 54462306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 54562306a36Sopenharmony_ci 0x213A), 54662306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, 54762306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 54862306a36Sopenharmony_ci 0x0036, 54962306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 55062306a36Sopenharmony_ci 0x213C), 55162306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, 55262306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 55362306a36Sopenharmony_ci 0x0036, 55462306a36Sopenharmony_ci PCI_VENDOR_ID_HP, 55562306a36Sopenharmony_ci 0x18E3), 55662306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, 55762306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 55862306a36Sopenharmony_ci 0x0036, 55962306a36Sopenharmony_ci PCI_VENDOR_ID_HP, 56062306a36Sopenharmony_ci 0x217F), 56162306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, 56262306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 56362306a36Sopenharmony_ci 0x0036, 56462306a36Sopenharmony_ci PCI_VENDOR_ID_HP, 56562306a36Sopenharmony_ci 0x2005), 56662306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, 56762306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 56862306a36Sopenharmony_ci 0x0036, 56962306a36Sopenharmony_ci PCI_VENDOR_ID_DELL, 57062306a36Sopenharmony_ci 0x020C), 57162306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, 57262306a36Sopenharmony_ci 57362306a36Sopenharmony_ci /* WB335 2-ANT / Antenna-Diversity */ 57462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 57562306a36Sopenharmony_ci 0x0036, 57662306a36Sopenharmony_ci PCI_VENDOR_ID_SAMSUNG, 57762306a36Sopenharmony_ci 0x411A), 57862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 57962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 58062306a36Sopenharmony_ci 0x0036, 58162306a36Sopenharmony_ci PCI_VENDOR_ID_SAMSUNG, 58262306a36Sopenharmony_ci 0x411B), 58362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 58462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 58562306a36Sopenharmony_ci 0x0036, 58662306a36Sopenharmony_ci PCI_VENDOR_ID_SAMSUNG, 58762306a36Sopenharmony_ci 0x411C), 58862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 58962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 59062306a36Sopenharmony_ci 0x0036, 59162306a36Sopenharmony_ci PCI_VENDOR_ID_SAMSUNG, 59262306a36Sopenharmony_ci 0x411D), 59362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 59462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 59562306a36Sopenharmony_ci 0x0036, 59662306a36Sopenharmony_ci PCI_VENDOR_ID_SAMSUNG, 59762306a36Sopenharmony_ci 0x411E), 59862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 59962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 60062306a36Sopenharmony_ci 0x0036, 60162306a36Sopenharmony_ci PCI_VENDOR_ID_SAMSUNG, 60262306a36Sopenharmony_ci 0x4129), 60362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 60462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 60562306a36Sopenharmony_ci 0x0036, 60662306a36Sopenharmony_ci PCI_VENDOR_ID_SAMSUNG, 60762306a36Sopenharmony_ci 0x412A), 60862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 60962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 61062306a36Sopenharmony_ci 0x0036, 61162306a36Sopenharmony_ci PCI_VENDOR_ID_ATHEROS, 61262306a36Sopenharmony_ci 0x3027), 61362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 61462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 61562306a36Sopenharmony_ci 0x0036, 61662306a36Sopenharmony_ci PCI_VENDOR_ID_ATHEROS, 61762306a36Sopenharmony_ci 0x302C), 61862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 61962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 62062306a36Sopenharmony_ci 0x0036, 62162306a36Sopenharmony_ci 0x11AD, /* LITEON */ 62262306a36Sopenharmony_ci 0x0642), 62362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 62462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 62562306a36Sopenharmony_ci 0x0036, 62662306a36Sopenharmony_ci 0x11AD, /* LITEON */ 62762306a36Sopenharmony_ci 0x0652), 62862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 62962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 63062306a36Sopenharmony_ci 0x0036, 63162306a36Sopenharmony_ci 0x11AD, /* LITEON */ 63262306a36Sopenharmony_ci 0x0612), 63362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 63462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 63562306a36Sopenharmony_ci 0x0036, 63662306a36Sopenharmony_ci 0x11AD, /* LITEON */ 63762306a36Sopenharmony_ci 0x0832), 63862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 63962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 64062306a36Sopenharmony_ci 0x0036, 64162306a36Sopenharmony_ci 0x11AD, /* LITEON */ 64262306a36Sopenharmony_ci 0x1832), 64362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 64462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 64562306a36Sopenharmony_ci 0x0036, 64662306a36Sopenharmony_ci 0x11AD, /* LITEON */ 64762306a36Sopenharmony_ci 0x0692), 64862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 64962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 65062306a36Sopenharmony_ci 0x0036, 65162306a36Sopenharmony_ci 0x11AD, /* LITEON */ 65262306a36Sopenharmony_ci 0x0803), 65362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 65462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 65562306a36Sopenharmony_ci 0x0036, 65662306a36Sopenharmony_ci 0x11AD, /* LITEON */ 65762306a36Sopenharmony_ci 0x0813), 65862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 65962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 66062306a36Sopenharmony_ci 0x0036, 66162306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 66262306a36Sopenharmony_ci 0x2130), 66362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 66462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 66562306a36Sopenharmony_ci 0x0036, 66662306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 66762306a36Sopenharmony_ci 0x213B), 66862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 66962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 67062306a36Sopenharmony_ci 0x0036, 67162306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 67262306a36Sopenharmony_ci 0x2182), 67362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 67462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 67562306a36Sopenharmony_ci 0x0036, 67662306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 67762306a36Sopenharmony_ci 0x218B), 67862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 67962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 68062306a36Sopenharmony_ci 0x0036, 68162306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 68262306a36Sopenharmony_ci 0x218C), 68362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 68462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 68562306a36Sopenharmony_ci 0x0036, 68662306a36Sopenharmony_ci PCI_VENDOR_ID_AZWAVE, 68762306a36Sopenharmony_ci 0x2F82), 68862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 68962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 69062306a36Sopenharmony_ci 0x0036, 69162306a36Sopenharmony_ci 0x144F, /* ASKEY */ 69262306a36Sopenharmony_ci 0x7202), 69362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 69462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 69562306a36Sopenharmony_ci 0x0036, 69662306a36Sopenharmony_ci 0x1B9A, /* XAVI */ 69762306a36Sopenharmony_ci 0x2810), 69862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 69962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 70062306a36Sopenharmony_ci 0x0036, 70162306a36Sopenharmony_ci 0x1B9A, /* XAVI */ 70262306a36Sopenharmony_ci 0x2813), 70362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 70462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 70562306a36Sopenharmony_ci 0x0036, 70662306a36Sopenharmony_ci 0x1B9A, /* XAVI */ 70762306a36Sopenharmony_ci 0x28A2), 70862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 70962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 71062306a36Sopenharmony_ci 0x0036, 71162306a36Sopenharmony_ci 0x1B9A, /* XAVI */ 71262306a36Sopenharmony_ci 0x28A4), 71362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 71462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 71562306a36Sopenharmony_ci 0x0036, 71662306a36Sopenharmony_ci 0x185F, /* WNC */ 71762306a36Sopenharmony_ci 0x3027), 71862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 71962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 72062306a36Sopenharmony_ci 0x0036, 72162306a36Sopenharmony_ci 0x185F, /* WNC */ 72262306a36Sopenharmony_ci 0xA120), 72362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 72462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 72562306a36Sopenharmony_ci 0x0036, 72662306a36Sopenharmony_ci PCI_VENDOR_ID_FOXCONN, 72762306a36Sopenharmony_ci 0xE07F), 72862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 72962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 73062306a36Sopenharmony_ci 0x0036, 73162306a36Sopenharmony_ci PCI_VENDOR_ID_FOXCONN, 73262306a36Sopenharmony_ci 0xE08F), 73362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 73462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 73562306a36Sopenharmony_ci 0x0036, 73662306a36Sopenharmony_ci PCI_VENDOR_ID_FOXCONN, 73762306a36Sopenharmony_ci 0xE081), 73862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 73962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 74062306a36Sopenharmony_ci 0x0036, 74162306a36Sopenharmony_ci PCI_VENDOR_ID_FOXCONN, 74262306a36Sopenharmony_ci 0xE091), 74362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 74462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 74562306a36Sopenharmony_ci 0x0036, 74662306a36Sopenharmony_ci PCI_VENDOR_ID_FOXCONN, 74762306a36Sopenharmony_ci 0xE099), 74862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 74962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 75062306a36Sopenharmony_ci 0x0036, 75162306a36Sopenharmony_ci PCI_VENDOR_ID_LENOVO, 75262306a36Sopenharmony_ci 0x3026), 75362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 75462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 75562306a36Sopenharmony_ci 0x0036, 75662306a36Sopenharmony_ci PCI_VENDOR_ID_LENOVO, 75762306a36Sopenharmony_ci 0x4026), 75862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 75962306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 76062306a36Sopenharmony_ci 0x0036, 76162306a36Sopenharmony_ci PCI_VENDOR_ID_ASUSTEK, 76262306a36Sopenharmony_ci 0x85F2), 76362306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, 76462306a36Sopenharmony_ci { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 76562306a36Sopenharmony_ci 0x0036, 76662306a36Sopenharmony_ci PCI_VENDOR_ID_DELL, 76762306a36Sopenharmony_ci 0x020E), 76862306a36Sopenharmony_ci .driver_data = ATH9K_PCI_AR9565_2ANT | 76962306a36Sopenharmony_ci ATH9K_PCI_BT_ANT_DIV | 77062306a36Sopenharmony_ci ATH9K_PCI_LED_ACT_HI}, 77162306a36Sopenharmony_ci 77262306a36Sopenharmony_ci /* PCI-E AR9565 (WB335) */ 77362306a36Sopenharmony_ci { PCI_VDEVICE(ATHEROS, 0x0036), 77462306a36Sopenharmony_ci .driver_data = ATH9K_PCI_BT_ANT_DIV }, 77562306a36Sopenharmony_ci#endif 77662306a36Sopenharmony_ci 77762306a36Sopenharmony_ci { 0 } 77862306a36Sopenharmony_ci}; 77962306a36Sopenharmony_ci 78062306a36Sopenharmony_ci 78162306a36Sopenharmony_ci/* return bus cachesize in 4B word units */ 78262306a36Sopenharmony_cistatic void ath_pci_read_cachesize(struct ath_common *common, int *csz) 78362306a36Sopenharmony_ci{ 78462306a36Sopenharmony_ci struct ath_softc *sc = (struct ath_softc *) common->priv; 78562306a36Sopenharmony_ci u8 u8tmp; 78662306a36Sopenharmony_ci 78762306a36Sopenharmony_ci pci_read_config_byte(to_pci_dev(sc->dev), PCI_CACHE_LINE_SIZE, &u8tmp); 78862306a36Sopenharmony_ci *csz = (int)u8tmp; 78962306a36Sopenharmony_ci 79062306a36Sopenharmony_ci /* 79162306a36Sopenharmony_ci * This check was put in to avoid "unpleasant" consequences if 79262306a36Sopenharmony_ci * the bootrom has not fully initialized all PCI devices. 79362306a36Sopenharmony_ci * Sometimes the cache line size register is not set 79462306a36Sopenharmony_ci */ 79562306a36Sopenharmony_ci 79662306a36Sopenharmony_ci if (*csz == 0) 79762306a36Sopenharmony_ci *csz = DEFAULT_CACHELINE >> 2; /* Use the default size */ 79862306a36Sopenharmony_ci} 79962306a36Sopenharmony_ci 80062306a36Sopenharmony_cistatic bool ath_pci_eeprom_read(struct ath_common *common, u32 off, u16 *data) 80162306a36Sopenharmony_ci{ 80262306a36Sopenharmony_ci struct ath_hw *ah = (struct ath_hw *) common->ah; 80362306a36Sopenharmony_ci 80462306a36Sopenharmony_ci common->ops->read(ah, AR5416_EEPROM_OFFSET + (off << AR5416_EEPROM_S)); 80562306a36Sopenharmony_ci 80662306a36Sopenharmony_ci if (!ath9k_hw_wait(ah, 80762306a36Sopenharmony_ci AR_EEPROM_STATUS_DATA(ah), 80862306a36Sopenharmony_ci AR_EEPROM_STATUS_DATA_BUSY | 80962306a36Sopenharmony_ci AR_EEPROM_STATUS_DATA_PROT_ACCESS, 0, 81062306a36Sopenharmony_ci AH_WAIT_TIMEOUT)) { 81162306a36Sopenharmony_ci return false; 81262306a36Sopenharmony_ci } 81362306a36Sopenharmony_ci 81462306a36Sopenharmony_ci *data = MS(common->ops->read(ah, AR_EEPROM_STATUS_DATA(ah)), 81562306a36Sopenharmony_ci AR_EEPROM_STATUS_DATA_VAL); 81662306a36Sopenharmony_ci 81762306a36Sopenharmony_ci return true; 81862306a36Sopenharmony_ci} 81962306a36Sopenharmony_ci 82062306a36Sopenharmony_ci/* Need to be called after we discover btcoex capabilities */ 82162306a36Sopenharmony_cistatic void ath_pci_aspm_init(struct ath_common *common) 82262306a36Sopenharmony_ci{ 82362306a36Sopenharmony_ci struct ath_softc *sc = (struct ath_softc *) common->priv; 82462306a36Sopenharmony_ci struct ath_hw *ah = sc->sc_ah; 82562306a36Sopenharmony_ci struct pci_dev *pdev = to_pci_dev(sc->dev); 82662306a36Sopenharmony_ci struct pci_dev *parent; 82762306a36Sopenharmony_ci u16 aspm; 82862306a36Sopenharmony_ci int ret; 82962306a36Sopenharmony_ci 83062306a36Sopenharmony_ci if (!ah->is_pciexpress) 83162306a36Sopenharmony_ci return; 83262306a36Sopenharmony_ci 83362306a36Sopenharmony_ci parent = pdev->bus->self; 83462306a36Sopenharmony_ci if (!parent) 83562306a36Sopenharmony_ci return; 83662306a36Sopenharmony_ci 83762306a36Sopenharmony_ci if ((ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) && 83862306a36Sopenharmony_ci (AR_SREV_9285(ah))) { 83962306a36Sopenharmony_ci /* Bluetooth coexistence requires disabling ASPM. */ 84062306a36Sopenharmony_ci pcie_capability_clear_word(pdev, PCI_EXP_LNKCTL, 84162306a36Sopenharmony_ci PCI_EXP_LNKCTL_ASPM_L0S | PCI_EXP_LNKCTL_ASPM_L1); 84262306a36Sopenharmony_ci 84362306a36Sopenharmony_ci /* 84462306a36Sopenharmony_ci * Both upstream and downstream PCIe components should 84562306a36Sopenharmony_ci * have the same ASPM settings. 84662306a36Sopenharmony_ci */ 84762306a36Sopenharmony_ci pcie_capability_clear_word(parent, PCI_EXP_LNKCTL, 84862306a36Sopenharmony_ci PCI_EXP_LNKCTL_ASPM_L0S | PCI_EXP_LNKCTL_ASPM_L1); 84962306a36Sopenharmony_ci 85062306a36Sopenharmony_ci ath_info(common, "Disabling ASPM since BTCOEX is enabled\n"); 85162306a36Sopenharmony_ci return; 85262306a36Sopenharmony_ci } 85362306a36Sopenharmony_ci 85462306a36Sopenharmony_ci /* 85562306a36Sopenharmony_ci * 0x70c - Ack Frequency Register. 85662306a36Sopenharmony_ci * 85762306a36Sopenharmony_ci * Bits 27:29 - DEFAULT_L1_ENTRANCE_LATENCY. 85862306a36Sopenharmony_ci * 85962306a36Sopenharmony_ci * 000 : 1 us 86062306a36Sopenharmony_ci * 001 : 2 us 86162306a36Sopenharmony_ci * 010 : 4 us 86262306a36Sopenharmony_ci * 011 : 8 us 86362306a36Sopenharmony_ci * 100 : 16 us 86462306a36Sopenharmony_ci * 101 : 32 us 86562306a36Sopenharmony_ci * 110/111 : 64 us 86662306a36Sopenharmony_ci */ 86762306a36Sopenharmony_ci if (AR_SREV_9462(ah)) 86862306a36Sopenharmony_ci pci_read_config_dword(pdev, 0x70c, &ah->config.aspm_l1_fix); 86962306a36Sopenharmony_ci 87062306a36Sopenharmony_ci ret = pcie_capability_read_word(parent, PCI_EXP_LNKCTL, &aspm); 87162306a36Sopenharmony_ci if (!ret && (aspm & (PCI_EXP_LNKCTL_ASPM_L0S | PCI_EXP_LNKCTL_ASPM_L1))) { 87262306a36Sopenharmony_ci ah->aspm_enabled = true; 87362306a36Sopenharmony_ci /* Initialize PCIe PM and SERDES registers. */ 87462306a36Sopenharmony_ci ath9k_hw_configpcipowersave(ah, false); 87562306a36Sopenharmony_ci ath_info(common, "ASPM enabled: 0x%x\n", aspm); 87662306a36Sopenharmony_ci } 87762306a36Sopenharmony_ci} 87862306a36Sopenharmony_ci 87962306a36Sopenharmony_cistatic const struct ath_bus_ops ath_pci_bus_ops = { 88062306a36Sopenharmony_ci .ath_bus_type = ATH_PCI, 88162306a36Sopenharmony_ci .read_cachesize = ath_pci_read_cachesize, 88262306a36Sopenharmony_ci .eeprom_read = ath_pci_eeprom_read, 88362306a36Sopenharmony_ci .aspm_init = ath_pci_aspm_init, 88462306a36Sopenharmony_ci}; 88562306a36Sopenharmony_ci 88662306a36Sopenharmony_cistatic int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) 88762306a36Sopenharmony_ci{ 88862306a36Sopenharmony_ci struct ath_softc *sc; 88962306a36Sopenharmony_ci struct ieee80211_hw *hw; 89062306a36Sopenharmony_ci u8 csz; 89162306a36Sopenharmony_ci u32 val; 89262306a36Sopenharmony_ci int ret = 0; 89362306a36Sopenharmony_ci char hw_name[64]; 89462306a36Sopenharmony_ci int msi_enabled = 0; 89562306a36Sopenharmony_ci 89662306a36Sopenharmony_ci if (pcim_enable_device(pdev)) 89762306a36Sopenharmony_ci return -EIO; 89862306a36Sopenharmony_ci 89962306a36Sopenharmony_ci ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); 90062306a36Sopenharmony_ci if (ret) { 90162306a36Sopenharmony_ci pr_err("32-bit DMA not available\n"); 90262306a36Sopenharmony_ci return ret; 90362306a36Sopenharmony_ci } 90462306a36Sopenharmony_ci 90562306a36Sopenharmony_ci /* 90662306a36Sopenharmony_ci * Cache line size is used to size and align various 90762306a36Sopenharmony_ci * structures used to communicate with the hardware. 90862306a36Sopenharmony_ci */ 90962306a36Sopenharmony_ci pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &csz); 91062306a36Sopenharmony_ci if (csz == 0) { 91162306a36Sopenharmony_ci /* 91262306a36Sopenharmony_ci * Linux 2.4.18 (at least) writes the cache line size 91362306a36Sopenharmony_ci * register as a 16-bit wide register which is wrong. 91462306a36Sopenharmony_ci * We must have this setup properly for rx buffer 91562306a36Sopenharmony_ci * DMA to work so force a reasonable value here if it 91662306a36Sopenharmony_ci * comes up zero. 91762306a36Sopenharmony_ci */ 91862306a36Sopenharmony_ci csz = L1_CACHE_BYTES / sizeof(u32); 91962306a36Sopenharmony_ci pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, csz); 92062306a36Sopenharmony_ci } 92162306a36Sopenharmony_ci /* 92262306a36Sopenharmony_ci * The default setting of latency timer yields poor results, 92362306a36Sopenharmony_ci * set it to the value used by other systems. It may be worth 92462306a36Sopenharmony_ci * tweaking this setting more. 92562306a36Sopenharmony_ci */ 92662306a36Sopenharmony_ci pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xa8); 92762306a36Sopenharmony_ci 92862306a36Sopenharmony_ci pci_set_master(pdev); 92962306a36Sopenharmony_ci 93062306a36Sopenharmony_ci /* 93162306a36Sopenharmony_ci * Disable the RETRY_TIMEOUT register (0x41) to keep 93262306a36Sopenharmony_ci * PCI Tx retries from interfering with C3 CPU state. 93362306a36Sopenharmony_ci */ 93462306a36Sopenharmony_ci pci_read_config_dword(pdev, 0x40, &val); 93562306a36Sopenharmony_ci if ((val & 0x0000ff00) != 0) 93662306a36Sopenharmony_ci pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); 93762306a36Sopenharmony_ci 93862306a36Sopenharmony_ci ret = pcim_iomap_regions(pdev, BIT(0), "ath9k"); 93962306a36Sopenharmony_ci if (ret) { 94062306a36Sopenharmony_ci dev_err(&pdev->dev, "PCI memory region reserve error\n"); 94162306a36Sopenharmony_ci return -ENODEV; 94262306a36Sopenharmony_ci } 94362306a36Sopenharmony_ci 94462306a36Sopenharmony_ci ath9k_fill_chanctx_ops(); 94562306a36Sopenharmony_ci hw = ieee80211_alloc_hw(sizeof(struct ath_softc), &ath9k_ops); 94662306a36Sopenharmony_ci if (!hw) { 94762306a36Sopenharmony_ci dev_err(&pdev->dev, "No memory for ieee80211_hw\n"); 94862306a36Sopenharmony_ci return -ENOMEM; 94962306a36Sopenharmony_ci } 95062306a36Sopenharmony_ci 95162306a36Sopenharmony_ci SET_IEEE80211_DEV(hw, &pdev->dev); 95262306a36Sopenharmony_ci pci_set_drvdata(pdev, hw); 95362306a36Sopenharmony_ci 95462306a36Sopenharmony_ci sc = hw->priv; 95562306a36Sopenharmony_ci sc->hw = hw; 95662306a36Sopenharmony_ci sc->dev = &pdev->dev; 95762306a36Sopenharmony_ci sc->mem = pcim_iomap_table(pdev)[0]; 95862306a36Sopenharmony_ci sc->driver_data = id->driver_data; 95962306a36Sopenharmony_ci 96062306a36Sopenharmony_ci if (ath9k_use_msi) { 96162306a36Sopenharmony_ci if (pci_enable_msi(pdev) == 0) { 96262306a36Sopenharmony_ci msi_enabled = 1; 96362306a36Sopenharmony_ci dev_err(&pdev->dev, "Using MSI\n"); 96462306a36Sopenharmony_ci } else { 96562306a36Sopenharmony_ci dev_err(&pdev->dev, "Using INTx\n"); 96662306a36Sopenharmony_ci } 96762306a36Sopenharmony_ci } 96862306a36Sopenharmony_ci 96962306a36Sopenharmony_ci if (!msi_enabled) 97062306a36Sopenharmony_ci ret = request_irq(pdev->irq, ath_isr, IRQF_SHARED, "ath9k", sc); 97162306a36Sopenharmony_ci else 97262306a36Sopenharmony_ci ret = request_irq(pdev->irq, ath_isr, 0, "ath9k", sc); 97362306a36Sopenharmony_ci 97462306a36Sopenharmony_ci if (ret) { 97562306a36Sopenharmony_ci dev_err(&pdev->dev, "request_irq failed\n"); 97662306a36Sopenharmony_ci goto err_irq; 97762306a36Sopenharmony_ci } 97862306a36Sopenharmony_ci 97962306a36Sopenharmony_ci sc->irq = pdev->irq; 98062306a36Sopenharmony_ci 98162306a36Sopenharmony_ci ret = ath9k_init_device(id->device, sc, &ath_pci_bus_ops); 98262306a36Sopenharmony_ci if (ret) { 98362306a36Sopenharmony_ci dev_err(&pdev->dev, "Failed to initialize device\n"); 98462306a36Sopenharmony_ci goto err_init; 98562306a36Sopenharmony_ci } 98662306a36Sopenharmony_ci 98762306a36Sopenharmony_ci sc->sc_ah->msi_enabled = msi_enabled; 98862306a36Sopenharmony_ci sc->sc_ah->msi_reg = 0; 98962306a36Sopenharmony_ci 99062306a36Sopenharmony_ci ath9k_hw_name(sc->sc_ah, hw_name, sizeof(hw_name)); 99162306a36Sopenharmony_ci wiphy_info(hw->wiphy, "%s mem=0x%p, irq=%d\n", 99262306a36Sopenharmony_ci hw_name, sc->mem, pdev->irq); 99362306a36Sopenharmony_ci 99462306a36Sopenharmony_ci return 0; 99562306a36Sopenharmony_ci 99662306a36Sopenharmony_cierr_init: 99762306a36Sopenharmony_ci free_irq(sc->irq, sc); 99862306a36Sopenharmony_cierr_irq: 99962306a36Sopenharmony_ci ieee80211_free_hw(hw); 100062306a36Sopenharmony_ci return ret; 100162306a36Sopenharmony_ci} 100262306a36Sopenharmony_ci 100362306a36Sopenharmony_cistatic void ath_pci_remove(struct pci_dev *pdev) 100462306a36Sopenharmony_ci{ 100562306a36Sopenharmony_ci struct ieee80211_hw *hw = pci_get_drvdata(pdev); 100662306a36Sopenharmony_ci struct ath_softc *sc = hw->priv; 100762306a36Sopenharmony_ci 100862306a36Sopenharmony_ci if (!is_ath9k_unloaded) 100962306a36Sopenharmony_ci sc->sc_ah->ah_flags |= AH_UNPLUGGED; 101062306a36Sopenharmony_ci ath9k_deinit_device(sc); 101162306a36Sopenharmony_ci free_irq(sc->irq, sc); 101262306a36Sopenharmony_ci ieee80211_free_hw(sc->hw); 101362306a36Sopenharmony_ci} 101462306a36Sopenharmony_ci 101562306a36Sopenharmony_ci#ifdef CONFIG_PM_SLEEP 101662306a36Sopenharmony_ci 101762306a36Sopenharmony_cistatic int ath_pci_suspend(struct device *device) 101862306a36Sopenharmony_ci{ 101962306a36Sopenharmony_ci struct ieee80211_hw *hw = dev_get_drvdata(device); 102062306a36Sopenharmony_ci struct ath_softc *sc = hw->priv; 102162306a36Sopenharmony_ci struct ath_common *common = ath9k_hw_common(sc->sc_ah); 102262306a36Sopenharmony_ci 102362306a36Sopenharmony_ci if (test_bit(ATH_OP_WOW_ENABLED, &common->op_flags)) { 102462306a36Sopenharmony_ci dev_info(device, "WOW is enabled, bypassing PCI suspend\n"); 102562306a36Sopenharmony_ci return 0; 102662306a36Sopenharmony_ci } 102762306a36Sopenharmony_ci 102862306a36Sopenharmony_ci /* The device has to be moved to FULLSLEEP forcibly. 102962306a36Sopenharmony_ci * Otherwise the chip never moved to full sleep, 103062306a36Sopenharmony_ci * when no interface is up. 103162306a36Sopenharmony_ci */ 103262306a36Sopenharmony_ci ath9k_stop_btcoex(sc); 103362306a36Sopenharmony_ci ath9k_hw_disable(sc->sc_ah); 103462306a36Sopenharmony_ci del_timer_sync(&sc->sleep_timer); 103562306a36Sopenharmony_ci ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP); 103662306a36Sopenharmony_ci 103762306a36Sopenharmony_ci return 0; 103862306a36Sopenharmony_ci} 103962306a36Sopenharmony_ci 104062306a36Sopenharmony_cistatic int ath_pci_resume(struct device *device) 104162306a36Sopenharmony_ci{ 104262306a36Sopenharmony_ci struct pci_dev *pdev = to_pci_dev(device); 104362306a36Sopenharmony_ci struct ieee80211_hw *hw = pci_get_drvdata(pdev); 104462306a36Sopenharmony_ci struct ath_softc *sc = hw->priv; 104562306a36Sopenharmony_ci struct ath_hw *ah = sc->sc_ah; 104662306a36Sopenharmony_ci struct ath_common *common = ath9k_hw_common(ah); 104762306a36Sopenharmony_ci u32 val; 104862306a36Sopenharmony_ci 104962306a36Sopenharmony_ci /* 105062306a36Sopenharmony_ci * Suspend/Resume resets the PCI configuration space, so we have to 105162306a36Sopenharmony_ci * re-disable the RETRY_TIMEOUT register (0x41) to keep 105262306a36Sopenharmony_ci * PCI Tx retries from interfering with C3 CPU state 105362306a36Sopenharmony_ci */ 105462306a36Sopenharmony_ci pci_read_config_dword(pdev, 0x40, &val); 105562306a36Sopenharmony_ci if ((val & 0x0000ff00) != 0) 105662306a36Sopenharmony_ci pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); 105762306a36Sopenharmony_ci 105862306a36Sopenharmony_ci ath_pci_aspm_init(common); 105962306a36Sopenharmony_ci ah->reset_power_on = false; 106062306a36Sopenharmony_ci 106162306a36Sopenharmony_ci return 0; 106262306a36Sopenharmony_ci} 106362306a36Sopenharmony_ci 106462306a36Sopenharmony_cistatic SIMPLE_DEV_PM_OPS(ath9k_pm_ops, ath_pci_suspend, ath_pci_resume); 106562306a36Sopenharmony_ci 106662306a36Sopenharmony_ci#define ATH9K_PM_OPS (&ath9k_pm_ops) 106762306a36Sopenharmony_ci 106862306a36Sopenharmony_ci#else /* !CONFIG_PM_SLEEP */ 106962306a36Sopenharmony_ci 107062306a36Sopenharmony_ci#define ATH9K_PM_OPS NULL 107162306a36Sopenharmony_ci 107262306a36Sopenharmony_ci#endif /* !CONFIG_PM_SLEEP */ 107362306a36Sopenharmony_ci 107462306a36Sopenharmony_ci 107562306a36Sopenharmony_ciMODULE_DEVICE_TABLE(pci, ath_pci_id_table); 107662306a36Sopenharmony_ci 107762306a36Sopenharmony_cistatic struct pci_driver ath_pci_driver = { 107862306a36Sopenharmony_ci .name = "ath9k", 107962306a36Sopenharmony_ci .id_table = ath_pci_id_table, 108062306a36Sopenharmony_ci .probe = ath_pci_probe, 108162306a36Sopenharmony_ci .remove = ath_pci_remove, 108262306a36Sopenharmony_ci .driver.pm = ATH9K_PM_OPS, 108362306a36Sopenharmony_ci}; 108462306a36Sopenharmony_ci 108562306a36Sopenharmony_ciint ath_pci_init(void) 108662306a36Sopenharmony_ci{ 108762306a36Sopenharmony_ci return pci_register_driver(&ath_pci_driver); 108862306a36Sopenharmony_ci} 108962306a36Sopenharmony_ci 109062306a36Sopenharmony_civoid ath_pci_exit(void) 109162306a36Sopenharmony_ci{ 109262306a36Sopenharmony_ci pci_unregister_driver(&ath_pci_driver); 109362306a36Sopenharmony_ci} 1094