From: Gabor Juhos Date: Fri, 9 Jan 2009 12:38:08 +0000 (+0000) Subject: mac80211: update ath9k patches X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b0122ff809412b95e3a6acc87e78ebe015213039;p=openwrt%2Fstaging%2Frobimarko.git mac80211: update ath9k patches SVN-Revision: 13948 --- diff --git a/package/mac80211/patches/401-ath9k-convert-to-struct-device.patch b/package/mac80211/patches/401-ath9k-convert-to-struct-device.patch index 762a0d7897..29ad4e9fe2 100644 --- a/package/mac80211/patches/401-ath9k-convert-to-struct-device.patch +++ b/package/mac80211/patches/401-ath9k-convert-to-struct-device.patch @@ -1,7 +1,7 @@ From 3ded580cd6f24776395649b301857d075a5121fb Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Mon, 5 Jan 2009 10:45:00 +0100 -Subject: [PATCH 01/11] ath9k: convert to struct device +Subject: [PATCH v2 01/11] ath9k: convert to struct device Convert 'struct pci_dev' to 'struct device' to make it usable on the AHB bus as well. diff --git a/package/mac80211/patches/402-ath9k-convert-to-use-bus-agnostic-DMA-routines.patch b/package/mac80211/patches/402-ath9k-convert-to-use-bus-agnostic-DMA-routines.patch index 2a30b610e1..ac8a51587c 100644 --- a/package/mac80211/patches/402-ath9k-convert-to-use-bus-agnostic-DMA-routines.patch +++ b/package/mac80211/patches/402-ath9k-convert-to-use-bus-agnostic-DMA-routines.patch @@ -1,7 +1,7 @@ From 57b901b5ceb401006a278bc1ad224f0ac88d4f08 Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Mon, 5 Jan 2009 10:50:30 +0100 -Subject: [PATCH 02/11] ath9k: convert to use bus-agnostic DMA routines +Subject: [PATCH v2 02/11] ath9k: convert to use bus-agnostic DMA routines Convert to use bus-agnostic DMA routines to make it usable on AHB bus as well. diff --git a/package/mac80211/patches/403-ath9k-introduce-bus-specific-cache-size-routine.patch b/package/mac80211/patches/403-ath9k-introduce-bus-specific-cache-size-routine.patch index 4fd49691a1..d6b24ebca3 100644 --- a/package/mac80211/patches/403-ath9k-introduce-bus-specific-cache-size-routine.patch +++ b/package/mac80211/patches/403-ath9k-introduce-bus-specific-cache-size-routine.patch @@ -1,7 +1,7 @@ From 1306e6b6d72b2bc0b91bcdd15b1d982965210bda Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Mon, 5 Jan 2009 10:57:42 +0100 -Subject: [PATCH 03/11] ath9k: introduce bus specific cache size routine +Subject: [PATCH v2 03/11] ath9k: introduce bus specific cache size routine The PCI specific bus_read_cachesize routine won't work on the AHB bus, we have to replace it with a suitable one later. diff --git a/package/mac80211/patches/404-ath9k-introduce-bus-specific-cleanup-routine.patch b/package/mac80211/patches/404-ath9k-introduce-bus-specific-cleanup-routine.patch index d1b2f3c1f9..6076f49ef5 100644 --- a/package/mac80211/patches/404-ath9k-introduce-bus-specific-cleanup-routine.patch +++ b/package/mac80211/patches/404-ath9k-introduce-bus-specific-cleanup-routine.patch @@ -1,7 +1,7 @@ -From 4167fb37cceda6a5ebfbfc4431abc69a1857ce43 Mon Sep 17 00:00:00 2001 +From 7524b77fe24a4464b08a2ac987ec22711a4f2027 Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Mon, 5 Jan 2009 10:59:29 +0100 -Subject: [PATCH 04/11] ath9k: introduce bus specific cleanup routine +Subject: [PATCH v2 04/11] ath9k: introduce bus specific cleanup routine We have left only some PCI specific cleanup code. We have to convert them as well. @@ -9,9 +9,9 @@ them as well. Signed-off-by: Gabor Juhos Signed-off-by: Imre Kaloz --- - drivers/net/wireless/ath9k/core.h | 6 ++++++ - drivers/net/wireless/ath9k/main.c | 30 ++++++++++++++++-------------- - 2 files changed, 22 insertions(+), 14 deletions(-) + drivers/net/wireless/ath9k/core.h | 7 +++++++ + drivers/net/wireless/ath9k/main.c | 37 +++++++++++++++++++++++-------------- + 2 files changed, 30 insertions(+), 14 deletions(-) --- a/drivers/net/wireless/ath9k/core.h +++ b/drivers/net/wireless/ath9k/core.h @@ -23,7 +23,15 @@ Signed-off-by: Imre Kaloz }; struct ath_softc { -@@ -760,4 +761,9 @@ static inline void ath_read_cachesize(st +@@ -704,6 +705,7 @@ struct ath_softc { + struct tasklet_struct bcon_tasklet; + struct ath_hal *sc_ah; + void __iomem *mem; ++ int irq; + spinlock_t sc_resetlock; + struct mutex mutex; + +@@ -760,4 +762,9 @@ static inline void ath_read_cachesize(st sc->bus_ops->read_cachesize(sc, csz); } @@ -35,7 +43,15 @@ Signed-off-by: Imre Kaloz #endif /* CORE_H */ --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c -@@ -1267,13 +1267,7 @@ static int ath_start_rfkill_poll(struct +@@ -39,6 +39,7 @@ static struct pci_device_id ath_pci_id_t + }; + + static void ath_detach(struct ath_softc *sc); ++static void ath_cleanup(struct ath_softc *sc); + + /* return bus cachesize in 4B word units */ + +@@ -1267,13 +1268,7 @@ static int ath_start_rfkill_poll(struct rfkill_free(sc->rf_kill.rfkill); /* Deinitialize the device */ @@ -46,11 +62,26 @@ Signed-off-by: Imre Kaloz - pci_release_region(to_pci_dev(sc->dev), 0); - pci_disable_device(to_pci_dev(sc->dev)); - ieee80211_free_hw(sc->hw); -+ ath_bus_cleanup(sc); ++ ath_cleanup(sc); return -EIO; } else { sc->sc_flags |= SC_OP_RFKILL_REGISTERED; -@@ -2529,8 +2523,22 @@ ath_rf_name(u16 rf_version) +@@ -1284,6 +1279,14 @@ static int ath_start_rfkill_poll(struct + } + #endif /* CONFIG_RFKILL */ + ++static void ath_cleanup(struct ath_softc *sc) ++{ ++ ath_detach(sc); ++ free_irq(sc->irq, sc); ++ ath_bus_cleanup(sc); ++ ieee80211_free_hw(sc->hw); ++} ++ + static void ath_detach(struct ath_softc *sc) + { + struct ieee80211_hw *hw = sc->hw; +@@ -2529,8 +2532,18 @@ ath_rf_name(u16 rf_version) return "????"; } @@ -58,13 +89,9 @@ Signed-off-by: Imre Kaloz +{ + struct pci_dev *pdev = to_pci_dev(sc->dev); + -+ ath_detach(sc); -+ if (pdev->irq) -+ free_irq(pdev->irq, sc); + pci_iounmap(pdev, sc->mem); + pci_release_region(pdev, 0); + pci_disable_device(pdev); -+ ieee80211_free_hw(sc->hw); +} + static struct ath_bus_ops ath_pci_bus_ops = { @@ -73,7 +100,16 @@ Signed-off-by: Imre Kaloz }; static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) -@@ -2667,13 +2675,7 @@ static void ath_pci_remove(struct pci_de +@@ -2637,6 +2650,8 @@ static int ath_pci_probe(struct pci_dev + goto bad4; + } + ++ sc->irq = pdev->irq; ++ + ah = sc->sc_ah; + printk(KERN_INFO + "%s: Atheros AR%s MAC/BB Rev:%x " +@@ -2667,13 +2682,7 @@ static void ath_pci_remove(struct pci_de struct ieee80211_hw *hw = pci_get_drvdata(pdev); struct ath_softc *sc = hw->priv; @@ -84,7 +120,7 @@ Signed-off-by: Imre Kaloz - pci_release_region(pdev, 0); - pci_disable_device(pdev); - ieee80211_free_hw(hw); -+ ath_pci_cleanup(sc); ++ ath_cleanup(sc); } #ifdef CONFIG_PM diff --git a/package/mac80211/patches/405-ath9k-move-PCI-code-into-separate-file.patch b/package/mac80211/patches/405-ath9k-move-PCI-code-into-separate-file.patch index 0cdf4daf54..462d623624 100644 --- a/package/mac80211/patches/405-ath9k-move-PCI-code-into-separate-file.patch +++ b/package/mac80211/patches/405-ath9k-move-PCI-code-into-separate-file.patch @@ -1,7 +1,7 @@ -From d95e670cd1395ffd8410bed809b6d060f2183d6b Mon Sep 17 00:00:00 2001 +From 39c2811d18b39991f49c16dcd9ed1a81200371ad Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Mon, 5 Jan 2009 11:01:09 +0100 -Subject: [PATCH 05/11] ath9k: move PCI code into separate file +Subject: [PATCH v2 05/11] ath9k: move PCI code into separate file Now that we have converted all bus specific routines to replaceable, we can move the PCI specific codes into a separate file. @@ -10,9 +10,9 @@ Signed-off-by: Gabor Juhos Signed-off-by: Imre Kaloz --- drivers/net/wireless/ath9k/Makefile | 1 + - drivers/net/wireless/ath9k/core.h | 18 ++- - drivers/net/wireless/ath9k/main.c | 299 +++-------------------------------- - drivers/net/wireless/ath9k/pci.c | 289 +++++++++++++++++++++++++++++++++ + drivers/net/wireless/ath9k/core.h | 19 ++- + drivers/net/wireless/ath9k/main.c | 300 +++-------------------------------- + drivers/net/wireless/ath9k/pci.c | 287 +++++++++++++++++++++++++++++++++ 4 files changed, 328 insertions(+), 279 deletions(-) --- a/drivers/net/wireless/ath9k/Makefile @@ -36,13 +36,14 @@ Signed-off-by: Imre Kaloz #include #include #include -@@ -766,4 +766,20 @@ static inline void ath_bus_cleanup(struc +@@ -767,4 +767,21 @@ static inline void ath_bus_cleanup(struc sc->bus_ops->cleanup(sc); } +extern struct ieee80211_ops ath9k_ops; + +irqreturn_t ath_isr(int irq, void *dev); ++void ath_cleanup(struct ath_softc *sc); +int ath_attach(u16 devid, struct ath_softc *sc); +void ath_detach(struct ath_softc *sc); +const char *ath_mac_bb_name(u32 mac_bb_version); @@ -59,7 +60,7 @@ Signed-off-by: Imre Kaloz #endif /* CORE_H */ --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c -@@ -28,38 +28,6 @@ MODULE_DESCRIPTION("Support for Atheros +@@ -28,39 +28,6 @@ MODULE_DESCRIPTION("Support for Atheros MODULE_SUPPORTED_DEVICE("Atheros 802.11n WLAN cards"); MODULE_LICENSE("Dual BSD/GPL"); @@ -74,6 +75,7 @@ Signed-off-by: Imre Kaloz -}; - -static void ath_detach(struct ath_softc *sc); +-static void ath_cleanup(struct ath_softc *sc); - -/* return bus cachesize in 4B word units */ - @@ -98,7 +100,7 @@ Signed-off-by: Imre Kaloz static void ath_cache_conf_rate(struct ath_softc *sc, struct ieee80211_conf *conf) { -@@ -497,7 +465,7 @@ static void ath9k_tasklet(unsigned long +@@ -498,7 +465,7 @@ static void ath9k_tasklet(unsigned long ath9k_hw_set_interrupts(sc->sc_ah, sc->sc_imask); } @@ -107,16 +109,25 @@ Signed-off-by: Imre Kaloz { struct ath_softc *sc = dev; struct ath_hal *ah = sc->sc_ah; -@@ -1278,7 +1246,7 @@ static int ath_start_rfkill_poll(struct +@@ -1279,7 +1246,7 @@ static int ath_start_rfkill_poll(struct } #endif /* CONFIG_RFKILL */ +-static void ath_cleanup(struct ath_softc *sc) ++void ath_cleanup(struct ath_softc *sc) + { + ath_detach(sc); + free_irq(sc->irq, sc); +@@ -1287,7 +1254,7 @@ static void ath_cleanup(struct ath_softc + ieee80211_free_hw(sc->hw); + } + -static void ath_detach(struct ath_softc *sc) +void ath_detach(struct ath_softc *sc) { struct ieee80211_hw *hw = sc->hw; int i = 0; -@@ -1529,7 +1497,7 @@ bad: +@@ -1538,7 +1505,7 @@ bad: return error; } @@ -125,7 +136,7 @@ Signed-off-by: Imre Kaloz { struct ieee80211_hw *hw = sc->hw; int error = 0; -@@ -2448,7 +2416,7 @@ static int ath9k_ampdu_action(struct iee +@@ -2457,7 +2424,7 @@ static int ath9k_ampdu_action(struct iee return ret; } @@ -134,7 +145,7 @@ Signed-off-by: Imre Kaloz .tx = ath9k_tx, .start = ath9k_start, .stop = ath9k_stop, -@@ -2492,7 +2460,7 @@ static struct { +@@ -2501,7 +2468,7 @@ static struct { /* * Return the MAC/BB name. "????" is returned if the MAC/BB is unknown. */ @@ -143,7 +154,7 @@ Signed-off-by: Imre Kaloz ath_mac_bb_name(u32 mac_bb_version) { int i; -@@ -2509,7 +2477,7 @@ ath_mac_bb_name(u32 mac_bb_version) +@@ -2518,7 +2485,7 @@ ath_mac_bb_name(u32 mac_bb_version) /* * Return the RF name. "????" is returned if the RF is unknown. */ @@ -152,7 +163,7 @@ Signed-off-by: Imre Kaloz ath_rf_name(u16 rf_version) { int i; -@@ -2523,236 +2491,7 @@ ath_rf_name(u16 rf_version) +@@ -2532,234 +2499,7 @@ ath_rf_name(u16 rf_version) return "????"; } @@ -160,13 +171,9 @@ Signed-off-by: Imre Kaloz -{ - struct pci_dev *pdev = to_pci_dev(sc->dev); - -- ath_detach(sc); -- if (pdev->irq) -- free_irq(pdev->irq, sc); - pci_iounmap(pdev, sc->mem); - pci_release_region(pdev, 0); - pci_disable_device(pdev); -- ieee80211_free_hw(sc->hw); -} - -static struct ath_bus_ops ath_pci_bus_ops = { @@ -278,6 +285,8 @@ Signed-off-by: Imre Kaloz - goto bad4; - } - +- sc->irq = pdev->irq; +- - ah = sc->sc_ah; - printk(KERN_INFO - "%s: Atheros AR%s MAC/BB Rev:%x " @@ -308,7 +317,7 @@ Signed-off-by: Imre Kaloz - struct ieee80211_hw *hw = pci_get_drvdata(pdev); - struct ath_softc *sc = hw->priv; - -- ath_pci_cleanup(sc); +- ath_cleanup(sc); -} - -#ifdef CONFIG_PM @@ -390,7 +399,7 @@ Signed-off-by: Imre Kaloz { int error; -@@ -2764,26 +2503,30 @@ static int __init init_ath_pci(void) +@@ -2771,26 +2511,30 @@ static int __init init_ath_pci(void) printk(KERN_ERR "Unable to register rate control algorithm: %d\n", error); @@ -433,7 +442,7 @@ Signed-off-by: Imre Kaloz +module_exit(ath9k_exit); --- /dev/null +++ b/drivers/net/wireless/ath9k/pci.c -@@ -0,0 +1,289 @@ +@@ -0,0 +1,287 @@ +/* + * Copyright (c) 2008 Atheros Communications Inc. + * @@ -489,13 +498,9 @@ Signed-off-by: Imre Kaloz +{ + struct pci_dev *pdev = to_pci_dev(sc->dev); + -+ ath_detach(sc); -+ if (pdev->irq) -+ free_irq(pdev->irq, sc); + pci_iounmap(pdev, sc->mem); + pci_release_region(pdev, 0); + pci_disable_device(pdev); -+ ieee80211_free_hw(sc->hw); +} + +static struct ath_bus_ops ath_pci_bus_ops = { @@ -607,6 +612,8 @@ Signed-off-by: Imre Kaloz + goto bad4; + } + ++ sc->irq = pdev->irq; ++ + ah = sc->sc_ah; + printk(KERN_INFO + "%s: Atheros AR%s MAC/BB Rev:%x " @@ -637,7 +644,7 @@ Signed-off-by: Imre Kaloz + struct ieee80211_hw *hw = pci_get_drvdata(pdev); + struct ath_softc *sc = hw->priv; + -+ ath_pci_cleanup(sc); ++ ath_cleanup(sc); +} + +#ifdef CONFIG_PM diff --git a/package/mac80211/patches/406-ath9k-introduce-platform-driver-for-AHB-bus-support.patch b/package/mac80211/patches/406-ath9k-introduce-platform-driver-for-AHB-bus-support.patch index 99eec34ba0..02c5632baf 100644 --- a/package/mac80211/patches/406-ath9k-introduce-platform-driver-for-AHB-bus-support.patch +++ b/package/mac80211/patches/406-ath9k-introduce-platform-driver-for-AHB-bus-support.patch @@ -1,7 +1,7 @@ -From 9b3c1b50a35455e28c5b2fede615a304df42e758 Mon Sep 17 00:00:00 2001 +From ace011bdb2676f594824c81a5a5b5089dc0c3e0b Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Mon, 5 Jan 2009 11:03:17 +0100 -Subject: [PATCH 06/11] ath9k: introduce platform driver for AHB bus support +Subject: [PATCH v2 06/11] ath9k: introduce platform driver for AHB bus support This patch adds the platform_driver itself, and modifies the main driver to register it. @@ -10,10 +10,10 @@ Signed-off-by: Gabor Juhos Signed-off-by: Imre Kaloz --- drivers/net/wireless/ath9k/Makefile | 1 + - drivers/net/wireless/ath9k/ahb.c | 179 +++++++++++++++++++++++++++++++++++ - drivers/net/wireless/ath9k/core.h | 9 ++ + drivers/net/wireless/ath9k/ahb.c | 160 +++++++++++++++++++++++++++++++++++ + drivers/net/wireless/ath9k/core.h | 8 ++ drivers/net/wireless/ath9k/main.c | 10 ++ - 4 files changed, 199 insertions(+), 0 deletions(-) + 4 files changed, 179 insertions(+), 0 deletions(-) --- a/drivers/net/wireless/ath9k/Makefile +++ b/drivers/net/wireless/ath9k/Makefile @@ -27,7 +27,7 @@ Signed-off-by: Imre Kaloz obj-$(CONFIG_ATH9K) += ath9k.o --- /dev/null +++ b/drivers/net/wireless/ath9k/ahb.c -@@ -0,0 +1,179 @@ +@@ -0,0 +1,160 @@ +/* + * Copyright (c) 2008 Atheros Communications Inc. + * Copyright (c) 2009 Gabor Juhos @@ -60,13 +60,7 @@ Signed-off-by: Imre Kaloz + +static void ath_ahb_cleanup(struct ath_softc *sc) +{ -+ struct ieee80211_hw *hw = sc->hw; -+ -+ free_irq(sc->irq, sc); -+ -+ ath_detach(sc); + iounmap(sc->mem); -+ ieee80211_free_hw(hw); +} + +static struct ath_bus_ops ath_ahb_bus_ops = { @@ -114,16 +108,6 @@ Signed-off-by: Imre Kaloz + goto err_iounmap; + } + -+ hw->flags = IEEE80211_HW_RX_INCLUDES_FCS | -+ IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | -+ IEEE80211_HW_SIGNAL_DBM | -+ IEEE80211_HW_NOISE_DBM; -+ -+ hw->wiphy->interface_modes = -+ BIT(NL80211_IFTYPE_AP) | -+ BIT(NL80211_IFTYPE_STATION) | -+ BIT(NL80211_IFTYPE_ADHOC); -+ + SET_IEEE80211_DEV(hw, &pdev->dev); + platform_set_drvdata(pdev, hw); + @@ -179,10 +163,7 @@ Signed-off-by: Imre Kaloz + if (hw) { + struct ath_softc *sc = hw->priv; + -+ free_irq(sc->irq, sc); -+ ath_detach(sc); -+ iounmap(sc->mem); -+ ieee80211_free_hw(hw); ++ ath_cleanup(sc); + platform_set_drvdata(pdev, NULL); + } + @@ -205,19 +186,11 @@ Signed-off-by: Imre Kaloz + +void ath_ahb_exit(void) +{ -+ platform_driver_register(&ath_ahb_driver); ++ platform_driver_unregister(&ath_ahb_driver); +} --- a/drivers/net/wireless/ath9k/core.h +++ b/drivers/net/wireless/ath9k/core.h -@@ -705,6 +705,7 @@ struct ath_softc { - struct tasklet_struct bcon_tasklet; - struct ath_hal *sc_ah; - void __iomem *mem; -+ int irq; - spinlock_t sc_resetlock; - struct mutex mutex; - -@@ -782,4 +783,12 @@ static inline int ath_pci_init(void) { r +@@ -784,4 +784,12 @@ static inline int ath_pci_init(void) { r static inline void ath_pci_exit(void) {}; #endif @@ -232,7 +205,7 @@ Signed-off-by: Imre Kaloz #endif /* CORE_H */ --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c -@@ -2514,8 +2514,17 @@ static int __init ath9k_init(void) +@@ -2522,8 +2522,17 @@ static int __init ath9k_init(void) goto err_rate_unregister; } @@ -250,7 +223,7 @@ Signed-off-by: Imre Kaloz err_rate_unregister: ath_rate_control_unregister(); err_out: -@@ -2525,6 +2534,7 @@ module_init(ath9k_init); +@@ -2533,6 +2542,7 @@ module_init(ath9k_init); static void __exit ath9k_exit(void) { diff --git a/package/mac80211/patches/407-ath9k-get-EEPROM-contents-from-platform-data-on-AHB.patch b/package/mac80211/patches/407-ath9k-get-EEPROM-contents-from-platform-data-on-AHB.patch index 2412d8f11b..e866acdc6c 100644 --- a/package/mac80211/patches/407-ath9k-get-EEPROM-contents-from-platform-data-on-AHB.patch +++ b/package/mac80211/patches/407-ath9k-get-EEPROM-contents-from-platform-data-on-AHB.patch @@ -1,7 +1,7 @@ -From d0d8545c85b03c2e7e3c9957a94d0d6fc8168bef Mon Sep 17 00:00:00 2001 +From 317e9ea5007e3ff18b52f973c1b3a3f2c84bcae1 Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Mon, 5 Jan 2009 11:05:05 +0100 -Subject: [PATCH 07/11] ath9k: get EEPROM contents from platform data on AHB bus +Subject: [PATCH v2 07/11] ath9k: get EEPROM contents from platform data on AHB bus On the AR913x SOCs we have to provide EEPROM contents via platform_data, because accessing the flash via MMIO is not safe. Additionally different @@ -27,8 +27,8 @@ Signed-off-by: Imre Kaloz #include "core.h" #include "reg.h" #include "hw.h" -@@ -39,9 +40,29 @@ static void ath_ahb_cleanup(struct ath_s - ieee80211_free_hw(hw); +@@ -33,9 +34,29 @@ static void ath_ahb_cleanup(struct ath_s + iounmap(sc->mem); } +static bool ath_ahb_eeprom_read(struct ath_hal *ah, u32 off, u16 *data) @@ -57,7 +57,7 @@ Signed-off-by: Imre Kaloz }; static int ath_ahb_probe(struct platform_device *pdev) -@@ -54,6 +75,12 @@ static int ath_ahb_probe(struct platform +@@ -48,6 +69,12 @@ static int ath_ahb_probe(struct platform int ret = 0; struct ath_hal *ah; @@ -151,8 +151,8 @@ Signed-off-by: Imre Kaloz else --- a/drivers/net/wireless/ath9k/pci.c +++ b/drivers/net/wireless/ath9k/pci.c -@@ -62,9 +62,27 @@ static void ath_pci_cleanup(struct ath_s - ieee80211_free_hw(sc->hw); +@@ -58,9 +58,27 @@ static void ath_pci_cleanup(struct ath_s + pci_disable_device(pdev); } +static bool ath_pci_eeprom_read(struct ath_hal *ah, u32 off, u16 *data) diff --git a/package/mac80211/patches/408-ath9k-enable-support-for-AR9100.patch b/package/mac80211/patches/408-ath9k-enable-support-for-AR9100.patch deleted file mode 100644 index 794f22ad67..0000000000 --- a/package/mac80211/patches/408-ath9k-enable-support-for-AR9100.patch +++ /dev/null @@ -1,32 +0,0 @@ -From c09de7514f7020370e256d6739c1c27ecb356542 Mon Sep 17 00:00:00 2001 -From: Gabor Juhos -Date: Mon, 5 Jan 2009 11:10:28 +0100 -Subject: [PATCH 08/11] ath9k: enable support for AR9100 - -Because we have support for the AR9100 devices now, we can enable them. - -Signed-off-by: Gabor Juhos -Signed-off-by: Imre Kaloz ---- - drivers/net/wireless/ath9k/hw.c | 3 +++ - 1 files changed, 3 insertions(+), 0 deletions(-) - ---- a/drivers/net/wireless/ath9k/hw.c -+++ b/drivers/net/wireless/ath9k/hw.c -@@ -373,6 +373,8 @@ static const char *ath9k_hw_devname(u16 - return "Atheros 5418"; - case AR9160_DEVID_PCI: - return "Atheros 9160"; -+ case AR5416_AR9100_DEVID: -+ return "Atheros 9100"; - case AR9280_DEVID_PCI: - case AR9280_DEVID_PCIE: - return "Atheros 9280"; -@@ -1176,6 +1178,7 @@ struct ath_hal *ath9k_hw_attach(u16 devi - switch (devid) { - case AR5416_DEVID_PCI: - case AR5416_DEVID_PCIE: -+ case AR5416_AR9100_DEVID: - case AR9160_DEVID_PCI: - case AR9280_DEVID_PCI: - case AR9280_DEVID_PCIE: diff --git a/package/mac80211/patches/408-ath9k-remove-u16-casts-from-rtc-register-access.patch b/package/mac80211/patches/408-ath9k-remove-u16-casts-from-rtc-register-access.patch new file mode 100644 index 0000000000..b5910f7df8 --- /dev/null +++ b/package/mac80211/patches/408-ath9k-remove-u16-casts-from-rtc-register-access.patch @@ -0,0 +1,60 @@ +From 891bd8d155bbdabac3c69486fc854984ee90761c Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Mon, 5 Jan 2009 11:11:28 +0100 +Subject: [PATCH v2 08/11] ath9k: remove (u16) casts from rtc register access + +The RTC register offsets don't fit into 'u16' on the AR913x, so we have +to remove the existing casts. + +Signed-off-by: Gabor Juhos +Signed-off-by: Imre Kaloz +--- + drivers/net/wireless/ath9k/hw.c | 14 +++++++------- + 1 files changed, 7 insertions(+), 7 deletions(-) + +--- a/drivers/net/wireless/ath9k/hw.c ++++ b/drivers/net/wireless/ath9k/hw.c +@@ -1008,7 +1008,7 @@ static void ath9k_hw_init_pll(struct ath + pll |= SM(0xb, AR_RTC_PLL_DIV); + } + } +- REG_WRITE(ah, (u16) (AR_RTC_PLL_CONTROL), pll); ++ REG_WRITE(ah, (AR_RTC_PLL_CONTROL), pll); + + udelay(RTC_PLL_SETTLE_DELAY); + +@@ -1547,11 +1547,11 @@ static bool ath9k_hw_set_reset(struct at + rst_flags |= AR_RTC_RC_MAC_COLD; + } + +- REG_WRITE(ah, (u16) (AR_RTC_RC), rst_flags); ++ REG_WRITE(ah, (AR_RTC_RC), rst_flags); + udelay(50); + +- REG_WRITE(ah, (u16) (AR_RTC_RC), 0); +- if (!ath9k_hw_wait(ah, (u16) (AR_RTC_RC), AR_RTC_RC_M, 0)) { ++ REG_WRITE(ah, (AR_RTC_RC), 0); ++ if (!ath9k_hw_wait(ah, (AR_RTC_RC), AR_RTC_RC_M, 0)) { + DPRINTF(ah->ah_sc, ATH_DBG_RESET, + "RTC stuck in MAC reset\n"); + return false; +@@ -1573,8 +1573,8 @@ static bool ath9k_hw_set_reset_power_on( + REG_WRITE(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN | + AR_RTC_FORCE_WAKE_ON_INT); + +- REG_WRITE(ah, (u16) (AR_RTC_RESET), 0); +- REG_WRITE(ah, (u16) (AR_RTC_RESET), 1); ++ REG_WRITE(ah, (AR_RTC_RESET), 0); ++ REG_WRITE(ah, (AR_RTC_RESET), 1); + + if (!ath9k_hw_wait(ah, + AR_RTC_STATUS, +@@ -2599,7 +2599,7 @@ static void ath9k_set_power_sleep(struct + if (!AR_SREV_9100(ah)) + REG_WRITE(ah, AR_RC, AR_RC_AHB | AR_RC_HOSTIF); + +- REG_CLR_BIT(ah, (u16) (AR_RTC_RESET), ++ REG_CLR_BIT(ah, (AR_RTC_RESET), + AR_RTC_RESET_EN); + } + } diff --git a/package/mac80211/patches/409-ath9k-fix-ar5416Addac_9100-values.patch b/package/mac80211/patches/409-ath9k-fix-ar5416Addac_9100-values.patch new file mode 100644 index 0000000000..2ede51fb46 --- /dev/null +++ b/package/mac80211/patches/409-ath9k-fix-ar5416Addac_9100-values.patch @@ -0,0 +1,27 @@ +From d1550cd72b9bddd43a355229aaa330b54c28d92e Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Mon, 5 Jan 2009 11:13:04 +0100 +Subject: [PATCH v2 09/11] ath9k: fix ar5416Addac_9100 values + +Writing the register at offset 0x98c4 causes a deadlock on the AR913x +SoCs. Although i don't have detailed knowledge about these registers, +but if i change the register offset according to the 'ar5416Addac' table, +it works. Additionally there is no reference to the 0x98c4 elsewhere. + +Signed-off-by: Gabor Juhos +Signed-off-by: Imre Kaloz +--- + drivers/net/wireless/ath9k/initvals.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +--- a/drivers/net/wireless/ath9k/initvals.h ++++ b/drivers/net/wireless/ath9k/initvals.h +@@ -658,7 +658,7 @@ static const u32 ar5416Addac_9100[][2] = + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, + {0x0000989c, 0x00000000 }, +- {0x000098c4, 0x00000000 }, ++ {0x000098cc, 0x00000000 }, + }; + + static const u32 ar5416Modes[][6] = { diff --git a/package/mac80211/patches/409-ath9k-remove-u16-casts-from-rtc-register-access.patch b/package/mac80211/patches/409-ath9k-remove-u16-casts-from-rtc-register-access.patch deleted file mode 100644 index 7aa2ee34f5..0000000000 --- a/package/mac80211/patches/409-ath9k-remove-u16-casts-from-rtc-register-access.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 491719852fb049d0a65dc05550b645b62d799453 Mon Sep 17 00:00:00 2001 -From: Gabor Juhos -Date: Mon, 5 Jan 2009 11:11:28 +0100 -Subject: [PATCH 09/11] ath9k: remove (u16) casts from rtc register access - -The RTC register offsets don't fit into 'u16' on the AR913x, so we have -to remove the existing casts. - -Signed-off-by: Gabor Juhos -Signed-off-by: Imre Kaloz ---- - drivers/net/wireless/ath9k/hw.c | 14 +++++++------- - 1 files changed, 7 insertions(+), 7 deletions(-) - ---- a/drivers/net/wireless/ath9k/hw.c -+++ b/drivers/net/wireless/ath9k/hw.c -@@ -1010,7 +1010,7 @@ static void ath9k_hw_init_pll(struct ath - pll |= SM(0xb, AR_RTC_PLL_DIV); - } - } -- REG_WRITE(ah, (u16) (AR_RTC_PLL_CONTROL), pll); -+ REG_WRITE(ah, (AR_RTC_PLL_CONTROL), pll); - - udelay(RTC_PLL_SETTLE_DELAY); - -@@ -1550,11 +1550,11 @@ static bool ath9k_hw_set_reset(struct at - rst_flags |= AR_RTC_RC_MAC_COLD; - } - -- REG_WRITE(ah, (u16) (AR_RTC_RC), rst_flags); -+ REG_WRITE(ah, (AR_RTC_RC), rst_flags); - udelay(50); - -- REG_WRITE(ah, (u16) (AR_RTC_RC), 0); -- if (!ath9k_hw_wait(ah, (u16) (AR_RTC_RC), AR_RTC_RC_M, 0)) { -+ REG_WRITE(ah, (AR_RTC_RC), 0); -+ if (!ath9k_hw_wait(ah, (AR_RTC_RC), AR_RTC_RC_M, 0)) { - DPRINTF(ah->ah_sc, ATH_DBG_RESET, - "RTC stuck in MAC reset\n"); - return false; -@@ -1576,8 +1576,8 @@ static bool ath9k_hw_set_reset_power_on( - REG_WRITE(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN | - AR_RTC_FORCE_WAKE_ON_INT); - -- REG_WRITE(ah, (u16) (AR_RTC_RESET), 0); -- REG_WRITE(ah, (u16) (AR_RTC_RESET), 1); -+ REG_WRITE(ah, (AR_RTC_RESET), 0); -+ REG_WRITE(ah, (AR_RTC_RESET), 1); - - if (!ath9k_hw_wait(ah, - AR_RTC_STATUS, -@@ -2602,7 +2602,7 @@ static void ath9k_set_power_sleep(struct - if (!AR_SREV_9100(ah)) - REG_WRITE(ah, AR_RC, AR_RC_AHB | AR_RC_HOSTIF); - -- REG_CLR_BIT(ah, (u16) (AR_RTC_RESET), -+ REG_CLR_BIT(ah, (AR_RTC_RESET), - AR_RTC_RESET_EN); - } - } diff --git a/package/mac80211/patches/410-ath9k-fix-ar5416Addac_9100-values.patch b/package/mac80211/patches/410-ath9k-fix-ar5416Addac_9100-values.patch deleted file mode 100644 index 0ac979b075..0000000000 --- a/package/mac80211/patches/410-ath9k-fix-ar5416Addac_9100-values.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 2084ddcc2e2e85d10b210202d8368126b0beaddd Mon Sep 17 00:00:00 2001 -From: Gabor Juhos -Date: Mon, 5 Jan 2009 11:13:04 +0100 -Subject: [PATCH 10/11] ath9k: fix ar5416Addac_9100 values - -Writing the register at offset 0x98c4 causes a deadlock on the AR913x -SoCs. Although i don't have detailed knowledge about these registers, -but if i change the register offset according to the 'ar5416Addac' table, -it works. Additionally there is no reference to the 0x98c4 elsewhere. - -Signed-off-by: Gabor Juhos -Signed-off-by: Imre Kaloz ---- - drivers/net/wireless/ath9k/initvals.h | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - ---- a/drivers/net/wireless/ath9k/initvals.h -+++ b/drivers/net/wireless/ath9k/initvals.h -@@ -658,7 +658,7 @@ static const u32 ar5416Addac_9100[][2] = - {0x0000989c, 0x00000000 }, - {0x0000989c, 0x00000000 }, - {0x0000989c, 0x00000000 }, -- {0x000098c4, 0x00000000 }, -+ {0x000098cc, 0x00000000 }, - }; - - static const u32 ar5416Modes[][6] = { diff --git a/package/mac80211/patches/410-ath9k-fix-null-pointer-dereference-in-ani-monitor-c.patch b/package/mac80211/patches/410-ath9k-fix-null-pointer-dereference-in-ani-monitor-c.patch new file mode 100644 index 0000000000..e12f7bc262 --- /dev/null +++ b/package/mac80211/patches/410-ath9k-fix-null-pointer-dereference-in-ani-monitor-c.patch @@ -0,0 +1,38 @@ +From a6411f449091c272ca08146238b91a0835306179 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Mon, 5 Jan 2009 11:14:14 +0100 +Subject: [PATCH v2 10/11] ath9k: fix null pointer dereference in ani monitor code + +In 'ath9k_ani_reset' the 'ahp->ah_curani' will be initialized only +if 'DO_ANI(ah)' true. In 'ath9k_hw_ani_monitor' we are using +'ahp->ah_curani' unconditionally, and it will cause a NULL pointer +dereference on AR9100. + +Signed-off-by: Gabor Juhos +Signed-off-by: Imre Kaloz +--- + drivers/net/wireless/ath9k/ani.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/ath9k/ani.c ++++ b/drivers/net/wireless/ath9k/ani.c +@@ -551,6 +551,9 @@ void ath9k_hw_ani_monitor(struct ath_hal + struct ar5416AniState *aniState; + int32_t listenTime; + ++ if (!DO_ANI(ah)) ++ return; ++ + aniState = ahp->ah_curani; + ahp->ah_stats.ast_nodestats = *stats; + +@@ -610,9 +613,6 @@ void ath9k_hw_ani_monitor(struct ath_hal + aniState->cckPhyErrCount = cckPhyErrCnt; + } + +- if (!DO_ANI(ah)) +- return; +- + if (aniState->listenTime > 5 * ahp->ah_aniPeriod) { + if (aniState->ofdmPhyErrCount <= aniState->listenTime * + aniState->ofdmTrigLow / 1000 && diff --git a/package/mac80211/patches/411-ath9k-enable-support-for-AR9100.patch b/package/mac80211/patches/411-ath9k-enable-support-for-AR9100.patch new file mode 100644 index 0000000000..f3cc0c9afb --- /dev/null +++ b/package/mac80211/patches/411-ath9k-enable-support-for-AR9100.patch @@ -0,0 +1,32 @@ +From c4568c6e2a62a95c95c7875643a64a19bc8c1a2f Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Mon, 5 Jan 2009 11:10:28 +0100 +Subject: [PATCH v2 11/11] ath9k: enable support for AR9100 + +Because we have support for the AR9100 devices now, we can enable them. + +Signed-off-by: Gabor Juhos +Signed-off-by: Imre Kaloz +--- + drivers/net/wireless/ath9k/hw.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +--- a/drivers/net/wireless/ath9k/hw.c ++++ b/drivers/net/wireless/ath9k/hw.c +@@ -373,6 +373,8 @@ static const char *ath9k_hw_devname(u16 + return "Atheros 5418"; + case AR9160_DEVID_PCI: + return "Atheros 9160"; ++ case AR5416_AR9100_DEVID: ++ return "Atheros 9100"; + case AR9280_DEVID_PCI: + case AR9280_DEVID_PCIE: + return "Atheros 9280"; +@@ -1176,6 +1178,7 @@ struct ath_hal *ath9k_hw_attach(u16 devi + switch (devid) { + case AR5416_DEVID_PCI: + case AR5416_DEVID_PCIE: ++ case AR5416_AR9100_DEVID: + case AR9160_DEVID_PCI: + case AR9280_DEVID_PCI: + case AR9280_DEVID_PCIE: diff --git a/package/mac80211/patches/411-ath9k-fix-null-pointer-dereference-in-ani-monitor-c.patch b/package/mac80211/patches/411-ath9k-fix-null-pointer-dereference-in-ani-monitor-c.patch deleted file mode 100644 index cec20838f0..0000000000 --- a/package/mac80211/patches/411-ath9k-fix-null-pointer-dereference-in-ani-monitor-c.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 7b647404fb694f250b62a2a363b1298243ea403b Mon Sep 17 00:00:00 2001 -From: Gabor Juhos -Date: Mon, 5 Jan 2009 11:14:14 +0100 -Subject: [PATCH 11/11] ath9k: fix null pointer dereference in ani monitor code - -In 'ath9k_ani_reset' the 'ahp->ah_curani' will be initialized only -if 'DO_ANI(ah)' true. In 'ath9k_hw_ani_monitor' we are using -'ahp->ah_curani' unconditionally, and it will cause a NULL pointer -dereference on AR9100. - -Signed-off-by: Gabor Juhos -Signed-off-by: Imre Kaloz ---- - drivers/net/wireless/ath9k/ani.c | 6 +++--- - 1 files changed, 3 insertions(+), 3 deletions(-) - ---- a/drivers/net/wireless/ath9k/ani.c -+++ b/drivers/net/wireless/ath9k/ani.c -@@ -551,6 +551,9 @@ void ath9k_hw_ani_monitor(struct ath_hal - struct ar5416AniState *aniState; - int32_t listenTime; - -+ if (!DO_ANI(ah)) -+ return; -+ - aniState = ahp->ah_curani; - ahp->ah_stats.ast_nodestats = *stats; - -@@ -610,9 +613,6 @@ void ath9k_hw_ani_monitor(struct ath_hal - aniState->cckPhyErrCount = cckPhyErrCnt; - } - -- if (!DO_ANI(ah)) -- return; -- - if (aniState->listenTime > 5 * ahp->ah_aniPeriod) { - if (aniState->ofdmPhyErrCount <= aniState->listenTime * - aniState->ofdmTrigLow / 1000 &&