Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134146
b: refs/heads/master
c: 88d1570
h: refs/heads/master
v: v3
  • Loading branch information
Gabor Juhos authored and John W. Linville committed Jan 29, 2009
1 parent 152d331 commit 73981f7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7da3c55ce849e17fd9017c7bf770a03fa083d95b
refs/heads/master: 88d15707644fad1a137af7a17b00da6135f1c1a8
10 changes: 10 additions & 0 deletions trunk/drivers/net/wireless/ath9k/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,10 @@ enum PROT_MODE {
#define SC_OP_RFKILL_SW_BLOCKED BIT(12)
#define SC_OP_RFKILL_HW_BLOCKED BIT(13)

struct ath_bus_ops {
void (*read_cachesize)(struct ath_softc *sc, int *csz);
};

struct ath_softc {
struct ieee80211_hw *hw;
struct device *dev;
Expand Down Expand Up @@ -743,11 +747,17 @@ struct ath_softc {
#ifdef CONFIG_ATH9K_DEBUG
struct ath9k_debug sc_debug;
#endif
struct ath_bus_ops *bus_ops;
};

int ath_reset(struct ath_softc *sc, bool retry_tx);
int ath_get_hal_qnum(u16 queue, struct ath_softc *sc);
int ath_get_mac80211_qnum(u32 queue, struct ath_softc *sc);
int ath_cabq_update(struct ath_softc *);

static inline void ath_read_cachesize(struct ath_softc *sc, int *csz)
{
sc->bus_ops->read_cachesize(sc, csz);
}

#endif /* CORE_H */
9 changes: 7 additions & 2 deletions trunk/drivers/net/wireless/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static void ath_detach(struct ath_softc *sc);

/* return bus cachesize in 4B word units */

static void bus_read_cachesize(struct ath_softc *sc, int *csz)
static void ath_pci_read_cachesize(struct ath_softc *sc, int *csz)
{
u8 u8tmp;

Expand Down Expand Up @@ -1338,7 +1338,7 @@ static int ath_init(u16 devid, struct ath_softc *sc)
* Cache line size is used to size and align various
* structures used to communicate with the hardware.
*/
bus_read_cachesize(sc, &csz);
ath_read_cachesize(sc, &csz);
/* XXX assert csz is non-zero */
sc->sc_cachelsz = csz << 2; /* convert to bytes */

Expand Down Expand Up @@ -2534,6 +2534,10 @@ ath_rf_name(u16 rf_version)
return "????";
}

static struct ath_bus_ops ath_pci_bus_ops = {
.read_cachesize = ath_pci_read_cachesize,
};

static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
void __iomem *mem;
Expand Down Expand Up @@ -2622,6 +2626,7 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
sc->hw = hw;
sc->dev = &pdev->dev;
sc->mem = mem;
sc->bus_ops = &ath_pci_bus_ops;

if (ath_attach(id->device, sc) != 0) {
ret = -ENODEV;
Expand Down

0 comments on commit 73981f7

Please sign in to comment.