source: trunk/package/mac80211/patches/403-ath9k-introduce-bus-specific-cache-size-routine.patch @ 13961

Last change on this file since 13961 was 13961, checked in by juhosg, 8 years ago

[package] mac80211: update compat-wireless to 2009-01-10

File size: 2.6 KB
  • drivers/net/wireless/ath9k/core.h

    From 1306e6b6d72b2bc0b91bcdd15b1d982965210bda Mon Sep 17 00:00:00 2001
    From: Gabor Juhos <juhosg@openwrt.org>
    Date: Mon, 5 Jan 2009 10:57:42 +0100
    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.
    
    Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
    Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
    ---
     drivers/net/wireless/ath9k/core.h |   10 ++++++++++
     drivers/net/wireless/ath9k/main.c |    9 +++++++--
     2 files changed, 17 insertions(+), 2 deletions(-)
    
    a b enum PROT_MODE { 
    693693#define SC_OP_RFKILL_SW_BLOCKED BIT(12) 
    694694#define SC_OP_RFKILL_HW_BLOCKED BIT(13) 
    695695 
     696struct ath_bus_ops { 
     697        void            (*read_cachesize)(struct ath_softc *sc, int *csz); 
     698}; 
     699 
    696700struct ath_softc { 
    697701        struct ieee80211_hw *hw; 
    698702        struct device *dev; 
    struct ath_softc { 
    743747#ifdef CONFIG_ATH9K_DEBUG 
    744748        struct ath9k_debug sc_debug; 
    745749#endif 
     750        struct ath_bus_ops *bus_ops; 
    746751}; 
    747752 
    748753int ath_reset(struct ath_softc *sc, bool retry_tx); 
    int ath_get_hal_qnum(u16 queue, struct a 
    750755int ath_get_mac80211_qnum(u32 queue, struct ath_softc *sc); 
    751756int ath_cabq_update(struct ath_softc *); 
    752757 
     758static inline void ath_read_cachesize(struct ath_softc *sc, int *csz) 
     759{ 
     760        sc->bus_ops->read_cachesize(sc, csz); 
     761} 
     762 
    753763#endif /* CORE_H */ 
  • drivers/net/wireless/ath9k/main.c

    a b static void ath_detach(struct ath_softc  
    4242 
    4343/* return bus cachesize in 4B word units */ 
    4444 
    45 static void bus_read_cachesize(struct ath_softc *sc, int *csz) 
     45static void ath_pci_read_cachesize(struct ath_softc *sc, int *csz) 
    4646{ 
    4747        u8 u8tmp; 
    4848 
    static int ath_init(u16 devid, struct at 
    13401340         * Cache line size is used to size and align various 
    13411341         * structures used to communicate with the hardware. 
    13421342         */ 
    1343         bus_read_cachesize(sc, &csz); 
     1343        ath_read_cachesize(sc, &csz); 
    13441344        /* XXX assert csz is non-zero */ 
    13451345        sc->sc_cachelsz = csz << 2;     /* convert to bytes */ 
    13461346 
    ath_rf_name(u16 rf_version) 
    25382538        return "????"; 
    25392539} 
    25402540 
     2541static struct ath_bus_ops ath_pci_bus_ops = { 
     2542        .read_cachesize = ath_pci_read_cachesize, 
     2543}; 
     2544 
    25412545static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) 
    25422546{ 
    25432547        void __iomem *mem; 
    static int ath_pci_probe(struct pci_dev  
    26262630        sc->hw = hw; 
    26272631        sc->dev = &pdev->dev; 
    26282632        sc->mem = mem; 
     2633        sc->bus_ops = &ath_pci_bus_ops; 
    26292634 
    26302635        if (ath_attach(id->device, sc) != 0) { 
    26312636                ret = -ENODEV; 
Note: See TracBrowser for help on using the repository browser.