diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2009-01-14 14:17:04 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 16:00:30 -0500 |
commit | 88d15707644fad1a137af7a17b00da6135f1c1a8 (patch) | |
tree | 8f65aa4a632f0c32560f3bef2d2bcaef19b901ac /drivers/net/wireless/ath9k/main.c | |
parent | 7da3c55ce849e17fd9017c7bf770a03fa083d95b (diff) |
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.
Changes-licensed-under: ISC
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Tested-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/main.c')
-rw-r--r-- | drivers/net/wireless/ath9k/main.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index ebf0467674cf..884469a30235 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -42,7 +42,7 @@ static void ath_detach(struct ath_softc *sc); | |||
42 | 42 | ||
43 | /* return bus cachesize in 4B word units */ | 43 | /* return bus cachesize in 4B word units */ |
44 | 44 | ||
45 | static void bus_read_cachesize(struct ath_softc *sc, int *csz) | 45 | static void ath_pci_read_cachesize(struct ath_softc *sc, int *csz) |
46 | { | 46 | { |
47 | u8 u8tmp; | 47 | u8 u8tmp; |
48 | 48 | ||
@@ -1338,7 +1338,7 @@ static int ath_init(u16 devid, struct ath_softc *sc) | |||
1338 | * Cache line size is used to size and align various | 1338 | * Cache line size is used to size and align various |
1339 | * structures used to communicate with the hardware. | 1339 | * structures used to communicate with the hardware. |
1340 | */ | 1340 | */ |
1341 | bus_read_cachesize(sc, &csz); | 1341 | ath_read_cachesize(sc, &csz); |
1342 | /* XXX assert csz is non-zero */ | 1342 | /* XXX assert csz is non-zero */ |
1343 | sc->sc_cachelsz = csz << 2; /* convert to bytes */ | 1343 | sc->sc_cachelsz = csz << 2; /* convert to bytes */ |
1344 | 1344 | ||
@@ -2534,6 +2534,10 @@ ath_rf_name(u16 rf_version) | |||
2534 | return "????"; | 2534 | return "????"; |
2535 | } | 2535 | } |
2536 | 2536 | ||
2537 | static struct ath_bus_ops ath_pci_bus_ops = { | ||
2538 | .read_cachesize = ath_pci_read_cachesize, | ||
2539 | }; | ||
2540 | |||
2537 | static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | 2541 | static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) |
2538 | { | 2542 | { |
2539 | void __iomem *mem; | 2543 | void __iomem *mem; |
@@ -2622,6 +2626,7 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
2622 | sc->hw = hw; | 2626 | sc->hw = hw; |
2623 | sc->dev = &pdev->dev; | 2627 | sc->dev = &pdev->dev; |
2624 | sc->mem = mem; | 2628 | sc->mem = mem; |
2629 | sc->bus_ops = &ath_pci_bus_ops; | ||
2625 | 2630 | ||
2626 | if (ath_attach(id->device, sc) != 0) { | 2631 | if (ath_attach(id->device, sc) != 0) { |
2627 | ret = -ENODEV; | 2632 | ret = -ENODEV; |