17 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
20 #include <linux/pci.h>
23 #include <linux/module.h>
119 static int ath5k_pci_eeprom_read_mac(
struct ath5k_hw *ah,
u8 *
mac)
128 for (offset = 0x1f, octet = 0, total = 0; offset >= 0x1d; offset--) {
132 mac_d[octet + 1] = data & 0xff;
133 mac_d[octet] = data >> 8;
137 if (!total || total == 3 * 0xffff)
147 static const struct ath_bus_ops ath_pci_bus_ops = {
149 .read_cachesize = ath5k_pci_read_cachesize,
150 .eeprom_read = ath5k_pci_eeprom_read,
151 .eeprom_read_mac = ath5k_pci_eeprom_read_mac,
159 ath5k_pci_probe(
struct pci_dev *pdev,
197 dev_err(&pdev->
dev,
"32-bit DMA not available\n");
231 pci_write_config_byte(pdev, 0x41, 0);
235 dev_err(&pdev->
dev,
"cannot reserve PCI memory region\n");
239 mem = pci_iomap(pdev, 0, 0);
241 dev_err(&pdev->
dev,
"cannot remap PCI memory region\n");
252 dev_err(&pdev->
dev,
"cannot allocate ieee80211_hw\n");
264 ah->
devid =
id->device;
273 pci_set_drvdata(pdev, hw);
289 ath5k_pci_remove(
struct pci_dev *pdev)
301 #ifdef CONFIG_PM_SLEEP
302 static int ath5k_pci_suspend(
struct device *
dev)
312 static int ath5k_pci_resume(
struct device *
dev)
323 pci_write_config_byte(pdev, 0x41, 0);
330 #define ATH5K_PM_OPS (&ath5k_pm_ops)
332 #define ATH5K_PM_OPS NULL
336 .name = KBUILD_MODNAME,
337 .id_table = ath5k_pci_id_table,
338 .probe = ath5k_pci_probe,