wifi/pc: add ath9k driver

The driver was only tested with an "Atheros AR9462 Rev:2" [168c:0034]
device using the 'wifi.run' run script.

Note: for it to work MSI may not be used as otherwise interrupts do not
work. Using an IOMMU leads to the following fault:

[ 0] IOMMU:0xffffffff817eb0b0 FRR:0 FR:0x22 BDF:4:0:0 FI:0xb0000000000000 (0)

Issue #4813
This commit is contained in:
Josef Söntgen 2023-01-11 17:16:36 +00:00 committed by Christian Helmuth
parent e0d6e2e5a7
commit 56d366995c
7 changed files with 189 additions and 3 deletions

View File

@ -27,6 +27,8 @@ SRC_C += lx_emul/common_dummies.c
CC_C_OPT += -I$(LX_SRC_DIR)/drivers/net/wireless/intel/iwlwifi
CC_C_OPT += -I$(LX_SRC_DIR)/drivers/net/wireless/realtek/rtlwifi
CC_C_OPT += -I$(LX_SRC_DIR)/drivers/net/wireless/realtek/rtlwifi/rtl8188ee
CC_C_OPT += -I$(LX_SRC_DIR)/drivers/net/wireless/ath/
CC_C_OPT += -I$(LX_SRC_DIR)/drivers/net/wireless/ath/ath9k
CC_C_OPT += -I$(LX_SRC_DIR)/include/linux
CC_C_OPT += -Wno-address-of-packed-member

View File

@ -227,6 +227,8 @@ static const char * lx_emul_initcall_order[] = {
"__initcall_phylink_init6",
"__initcall_phy_module_init6",
"__initcall_fixed_mdio_bus_init6",
"__initcall_ath9k_init6",
"__initcall_ath9k_cmn_init6",
"__initcall_iwl_drv_init6",
"__initcall_iwl_init6",
"__initcall_iwl_mvm_init6",

View File

@ -1,5 +1,64 @@
arch/x86/include/asm/set_memory.h
crypto/internal.h
drivers/net/wireless/ath/ath.h
drivers/net/wireless/ath/dfs_pattern_detector.h
drivers/net/wireless/ath/dfs_pri_detector.h
drivers/net/wireless/ath/reg.h
drivers/net/wireless/ath/regd.h
drivers/net/wireless/ath/regd_common.h
drivers/net/wireless/ath/spectral_common.h
drivers/net/wireless/ath/trace.h
drivers/net/wireless/ath/ath9k/ani.h
drivers/net/wireless/ath/ath9k/ar5008_initvals.h
drivers/net/wireless/ath/ath9k/ar9001_initvals.h
drivers/net/wireless/ath/ath9k/ar9002_initvals.h
drivers/net/wireless/ath/ath9k/ar9002_phy.h
drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
drivers/net/wireless/ath/ath9k/ar9003_aic.h
drivers/net/wireless/ath/ath9k/ar9003_buffalo_initvals.h
drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
drivers/net/wireless/ath/ath9k/ar9003_mac.h
drivers/net/wireless/ath/ath9k/ar9003_mci.h
drivers/net/wireless/ath/ath9k/ar9003_phy.h
drivers/net/wireless/ath/ath9k/ar9003_rtt.h
drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h
drivers/net/wireless/ath/ath9k/ar9330_1p2_initvals.h
drivers/net/wireless/ath/ath9k/ar9340_initvals.h
drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h
drivers/net/wireless/ath/ath9k/ar9462_2p1_initvals.h
drivers/net/wireless/ath/ath9k/ar9485_initvals.h
drivers/net/wireless/ath/ath9k/ar953x_initvals.h
drivers/net/wireless/ath/ath9k/ar955x_1p0_initvals.h
drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h
drivers/net/wireless/ath/ath9k/ar9565_1p1_initvals.h
drivers/net/wireless/ath/ath9k/ar956x_initvals.h
drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h
drivers/net/wireless/ath/ath9k/ath9k.h
drivers/net/wireless/ath/ath9k/btcoex.h
drivers/net/wireless/ath/ath9k/calib.h
drivers/net/wireless/ath/ath9k/common-beacon.h
drivers/net/wireless/ath/ath9k/common-debug.h
drivers/net/wireless/ath/ath9k/common-init.h
drivers/net/wireless/ath/ath9k/common-spectral.h
drivers/net/wireless/ath/ath9k/common.h
drivers/net/wireless/ath/ath9k/debug.h
drivers/net/wireless/ath/ath9k/dfs.h
drivers/net/wireless/ath/ath9k/dfs_debug.h
drivers/net/wireless/ath/ath9k/dynack.h
drivers/net/wireless/ath/ath9k/eeprom.h
drivers/net/wireless/ath/ath9k/hif_usb.h
drivers/net/wireless/ath/ath9k/htc.h
drivers/net/wireless/ath/ath9k/htc_hst.h
drivers/net/wireless/ath/ath9k/hw-ops.h
drivers/net/wireless/ath/ath9k/hw.h
drivers/net/wireless/ath/ath9k/mac.h
drivers/net/wireless/ath/ath9k/mci.h
drivers/net/wireless/ath/ath9k/phy.h
drivers/net/wireless/ath/ath9k/reg.h
drivers/net/wireless/ath/ath9k/reg_aic.h
drivers/net/wireless/ath/ath9k/reg_mci.h
drivers/net/wireless/ath/ath9k/reg_wow.h
drivers/net/wireless/ath/ath9k/wmi.h
drivers/net/wireless/intel/iwlwifi/dvm/agn.h
drivers/net/wireless/intel/iwlwifi/dvm/calib.h
drivers/net/wireless/intel/iwlwifi/dvm/commands.h
@ -157,6 +216,7 @@ include/crypto/skcipher.h
include/crypto/streebog.h
include/dt-bindings/leds/common.h
include/keys/asymmetric-type.h
include/linux/ath9k_platform.h
include/linux/asn1.h
include/linux/asn1_ber_bytecode.h
include/linux/asn1_decoder.h
@ -184,6 +244,8 @@ include/linux/firmware.h
include/linux/gcd.h
include/linux/genetlink.h
include/linux/icmpv6.h
include/linux/gpio.h
include/linux/hw_random.h
include/linux/ieee80211.h
include/linux/if_arp.h
include/linux/if_bridge.h

View File

@ -478,6 +478,25 @@ noinstr void ct_irq_exit(void)
}
unsigned int pci_rescan_bus(struct pci_bus *bus)
{
lx_emul_trace(__func__);
return 0;
}
void pcim_pin_device(struct pci_dev *pdev)
{
lx_emul_trace(__func__);
}
void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr)
{
lx_emul_trace(__func__);
}
#include <linux/sysctl.h>
void __init __register_sysctl_init(const char * path,struct ctl_table * table,const char * table_name)
@ -496,3 +515,18 @@ int sysfs_add_file_to_group(struct kobject * kobj,const struct attribute * attr,
void * high_memory;
int pcim_iomap_regions(struct pci_dev *pdev, int mask, const char *name)
{
lx_emul_trace(__func__);
return 0;
}
int pcie_capability_clear_and_set_word(struct pci_dev *dev, int pos,
u16 clear, u16 set)
{
lx_emul_trace_and_stop(__func__);
return 0;
}

View File

@ -630,6 +630,36 @@ int pci_write_config_byte(const struct pci_dev * dev,int where,u8 val)
}
int pci_write_config_dword(const struct pci_dev * dev,int where,u32 val)
{
switch (where) {
/*
* ath9k: "Disable the bETRY_TIMEOUT register (0x41) to keep
* PCI Tx retries from interfering with C3 CPU state."
*/
case 0x40:
return 0;
}
return -1;
}
int pci_read_config_dword(const struct pci_dev * dev,int where,u32 * val)
{
switch (where) {
/*
* ath9k: "Disable the bETRY_TIMEOUT register (0x41) to keep
* PCI Tx retries from interfering with C3 CPU state."
*/
case 0x40:
return 0;
}
return -1;
}
int pci_read_config_word(const struct pci_dev * dev,int where,u16 * val)
{
switch (where) {
@ -704,10 +734,16 @@ void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
}
int pci_read_config_dword(const struct pci_dev * dev,int where,u32 * val)
void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen)
{
*val = 0;
return 0;
return pci_iomap(pdev, bar, maxlen);
}
void *dmam_alloc_attrs(struct device *dev, size_t size, dma_addr_t *dma_handle,
gfp_t gfp, unsigned long attrs)
{
return dma_alloc_attrs(dev, size, dma_handle, gfp, attrs);
}

View File

@ -39,6 +39,50 @@ drivers/base/driver.c
drivers/base/platform.c
drivers/base/property.c
drivers/net/loopback.c
drivers/net/wireless/ath/dfs_pattern_detector.c
drivers/net/wireless/ath/dfs_pri_detector.c
drivers/net/wireless/ath/hw.c
drivers/net/wireless/ath/key.c
drivers/net/wireless/ath/main.c
drivers/net/wireless/ath/regd.c
drivers/net/wireless/ath/ath9k/ani.c
drivers/net/wireless/ath/ath9k/antenna.c
drivers/net/wireless/ath/ath9k/ar5008_phy.c
drivers/net/wireless/ath/ath9k/ar9002_calib.c
drivers/net/wireless/ath/ath9k/ar9002_hw.c
drivers/net/wireless/ath/ath9k/ar9002_mac.c
drivers/net/wireless/ath/ath9k/ar9002_phy.c
drivers/net/wireless/ath/ath9k/ar9003_aic.c
drivers/net/wireless/ath/ath9k/ar9003_calib.c
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
drivers/net/wireless/ath/ath9k/ar9003_hw.c
drivers/net/wireless/ath/ath9k/ar9003_mac.c
drivers/net/wireless/ath/ath9k/ar9003_mci.c
drivers/net/wireless/ath/ath9k/ar9003_paprd.c
drivers/net/wireless/ath/ath9k/ar9003_phy.c
drivers/net/wireless/ath/ath9k/ar9003_rtt.c
drivers/net/wireless/ath/ath9k/beacon.c
drivers/net/wireless/ath/ath9k/btcoex.c
drivers/net/wireless/ath/ath9k/calib.c
drivers/net/wireless/ath/ath9k/channel.c
drivers/net/wireless/ath/ath9k/common-beacon.c
drivers/net/wireless/ath/ath9k/common-init.c
drivers/net/wireless/ath/ath9k/common.c
drivers/net/wireless/ath/ath9k/eeprom.c
drivers/net/wireless/ath/ath9k/eeprom_4k.c
drivers/net/wireless/ath/ath9k/eeprom_9287.c
drivers/net/wireless/ath/ath9k/eeprom_def.c
drivers/net/wireless/ath/ath9k/gpio.c
drivers/net/wireless/ath/ath9k/hw.c
drivers/net/wireless/ath/ath9k/init.c
drivers/net/wireless/ath/ath9k/link.c
drivers/net/wireless/ath/ath9k/mac.c
drivers/net/wireless/ath/ath9k/main.c
drivers/net/wireless/ath/ath9k/mci.c
drivers/net/wireless/ath/ath9k/pci.c
drivers/net/wireless/ath/ath9k/recv.c
drivers/net/wireless/ath/ath9k/wmi.c
drivers/net/wireless/ath/ath9k/xmit.c
drivers/net/wireless/intel/iwlwifi/cfg/1000.c
drivers/net/wireless/intel/iwlwifi/cfg/2000.c
drivers/net/wireless/intel/iwlwifi/cfg/22000.c

View File

@ -34,6 +34,12 @@ LX_ENABLE += WLAN_VENDOR_INTEL IWLWIFI IWLDVM IWLMVM
# rtlwifi
LX_ENABLE += WLAN_VENDOR_REALTEK RTL_CARDS RTL8188EE
# ath9k
LX_ENABLE += WLAN_VENDOR_ATH ATH_COMMON ATH9K ATH9K_PCI
LX_ENABLE += ATH9K_DEBUGFS
#LX_ENABLE += ATH9K_RFKILL ATH9K_PCI_NO_EEPROM
#LX_ENABLE += ATH9K_HTC
# USB host-controller support
LX_ENABLE += USB_SUPPORT USB USB_ARCH_HAS_HCD USB_XHCI_HCD USB_EHCI_HCD USB_OHCI_HCD
LX_ENABLE += USB_PCI USB_UHCI_HCD USB_USBNET