/*
* Copyright (c) 2008-2011 Atheros Communications Inc.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/nl80211.h>
#include <linux/pci.h>
#include <linux/pci-aspm.h>
#include <linux/ath9k_platform.h>
#include <linux/module.h>
#include "ath9k.h"
static const struct pci_device_id ath_pci_id_table[] = {
{ PCI_VDEVICE(ATHEROS, 0x0023) }, /* PCI */
{ PCI_VDEVICE(ATHEROS, 0x0024) }, /* PCI-E */
{ PCI_VDEVICE(ATHEROS, 0x0027) }, /* PCI */
{ PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI */
#ifdef CONFIG_ATH9K_PCOEM
/* Mini PCI AR9220 MB92 cards: Compex WLM200NX, Wistron DNMA-92 */
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
0x0029,
PCI_VENDOR_ID_ATHEROS,
0x2096),
.driver_data = ATH9K_PCI_LED_ACT_HI },
#endif
{ PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */
#ifdef CONFIG_ATH9K_PCOEM
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
0x002A,
PCI_VENDOR_ID_AZWAVE,
0x1C71),
.driver_data = ATH9K_PCI_D3_L1_WAR },
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
0x002A,
PCI_VENDOR_ID_FOXCONN,
0xE01F),
.driver_data = ATH9K_PCI_D3_L1_WAR },
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
0x002A,
0x11AD, /* LITEON */
0x6632),
.driver_data = ATH9K_PCI_D3_L1_WAR },
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
0x002A,
0x11AD, /* LITEON */
0x6642),
.driver_data = ATH9K_PCI_D3_L1_WAR },
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
0x002A,
PCI_VENDOR_ID_QMI,
0x0306),
.driver_data = ATH9K_PCI_D3_L1_WAR },
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
0x002A,
0x185F, /* WNC */
0x309D),
.driver_data = ATH9K_PCI_D3_L1_WAR },
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
0x002A,
0x10CF, /* Fujitsu */
0x147C),
.driver_data = ATH9K_PCI_D3_L1_WAR },
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
0x002A,
0x10CF, /* Fujitsu */
0x147D),
.driver_data = ATH9K_PCI_D3_L1_WAR },
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
0x002A,
0x10CF, /* Fujitsu */
0x1536),
.driver_data = ATH9K_PCI_D3_L1_WAR },
/* AR9285 card for Asus */
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
0x002B,
PCI_VENDOR_ID_AZWAVE,
0x2C37),
.driver_data = ATH9K_PCI_BT_ANT_DIV },
#endif
{ PCI_VDEVICE(ATHEROS, 0x002B) }, /* PCI-E */
{ PCI_VDEVICE(ATHEROS, 0x002C) }, /* PCI-E 802.11n bonded out */
{ PCI_VDEVICE(ATHEROS, 0x002D) }, /* PCI */
{ PCI_VDEVICE(ATHEROS, 0x002E) }, /* PCI-E */
/* Killer Wireless (3x3) */
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
0x0030,
0x1A56,
0x2000),
.driver_data = ATH9K_PCI_KILLER },
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
0x0030,
0x1A56,
0x2001),
.driver_data = ATH9K_PCI_KILLER },
{ PCI_VDEVICE(ATHEROS, 0x0030) }, /* PCI-E AR9300 */
#ifdef CONFIG_ATH9K_PCOEM
/* PCI-E CUS198 */
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
0x0032,
PCI_VENDOR_ID_AZWAVE,
0x2086),
.driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV },
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
0x0032,
PCI_VENDOR_ID_AZWAVE,
0x1237),
.driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV },
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
0x0032,
PCI_VENDOR_ID_AZWAVE,
0x2126),
.driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV },
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
0x0032,
PCI_VENDOR_ID_AZWAVE,
0x126A),
.driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV },
/* PCI-E CUS230 */
{ PCI_D