X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/eb434568feb9157a62875a1ea504cc15ad553b4d..6d9af11c8cb11d5deb4f53649c7b96faba88df47:/package/mac80211/patches/406-ath9k-introduce-platform-driver-for-AHB-bus-support.patch 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 99eec34ba..7b0412826 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,19 +1,22 @@ -From 9b3c1b50a35455e28c5b2fede615a304df42e758 Mon Sep 17 00:00:00 2001 +From 23f9e44a18b5a2dfaa1326aa30dd07e1449e8b5f 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 v3 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. +Changes-licensed-under: ISC + 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(-) + create mode 100644 drivers/net/wireless/ath9k/ahb.c --- a/drivers/net/wireless/ath9k/Makefile +++ b/drivers/net/wireless/ath9k/Makefile @@ -27,7 +30,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 +63,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 +111,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 +166,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 +189,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 +208,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) +@@ -2531,8 +2531,17 @@ static int __init ath9k_init(void) goto err_rate_unregister; } @@ -250,7 +226,7 @@ Signed-off-by: Imre Kaloz err_rate_unregister: ath_rate_control_unregister(); err_out: -@@ -2525,6 +2534,7 @@ module_init(ath9k_init); +@@ -2542,6 +2551,7 @@ module_init(ath9k_init); static void __exit ath9k_exit(void) {