1 --- a/drivers/net/wireless/ath/ath9k/hw.h
2 +++ b/drivers/net/wireless/ath/ath9k/hw.h
5 /* Register read/write primitives */
6 #define REG_WRITE(_ah, _reg, _val) \
7 - ath9k_hw_common(_ah)->ops->write((_ah), (_val), (_reg))
8 + (_ah)->reg_ops.write((_ah), (_val), (_reg))
10 #define REG_READ(_ah, _reg) \
11 - ath9k_hw_common(_ah)->ops->read((_ah), (_reg))
12 + (_ah)->reg_ops.read((_ah), (_reg))
14 #define REG_READ_MULTI(_ah, _addr, _val, _cnt) \
15 - ath9k_hw_common(_ah)->ops->multi_read((_ah), (_addr), (_val), (_cnt))
16 + (_ah)->reg_ops.multi_read((_ah), (_addr), (_val), (_cnt))
18 #define ENABLE_REGWRITE_BUFFER(_ah) \
20 - if (ath9k_hw_common(_ah)->ops->enable_write_buffer) \
21 - ath9k_hw_common(_ah)->ops->enable_write_buffer((_ah)); \
22 + if ((_ah)->reg_ops.enable_write_buffer) \
23 + (_ah)->reg_ops.enable_write_buffer((_ah)); \
26 #define REGWRITE_BUFFER_FLUSH(_ah) \
28 - if (ath9k_hw_common(_ah)->ops->write_flush) \
29 - ath9k_hw_common(_ah)->ops->write_flush((_ah)); \
30 + if ((_ah)->reg_ops.write_flush) \
31 + (_ah)->reg_ops.write_flush((_ah)); \
34 #define SM(_v, _f) (((_v) << _f##_S) & _f)
35 @@ -659,6 +659,8 @@ struct ath_nf_limits {
36 #define AH_UNPLUGGED 0x2 /* The card has been physically removed. */
39 + struct ath_ops reg_ops;
41 struct ieee80211_hw *hw;
42 struct ath_common common;
43 struct ath9k_hw_version hw_version;
44 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
45 +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
46 @@ -430,14 +430,6 @@ static void ath9k_regwrite_flush(void *h
47 mutex_unlock(&priv->wmi->multi_write_mutex);
50 -static const struct ath_ops ath9k_common_ops = {
51 - .read = ath9k_regread,
52 - .multi_read = ath9k_multi_regread,
53 - .write = ath9k_regwrite,
54 - .enable_write_buffer = ath9k_enable_regwrite_buffer,
55 - .write_flush = ath9k_regwrite_flush,
58 static void ath_usb_read_cachesize(struct ath_common *common, int *csz)
60 *csz = L1_CACHE_BYTES >> 2;
61 @@ -658,10 +650,15 @@ static int ath9k_init_priv(struct ath9k_
62 ah->hw_version.subsysid = 0; /* FIXME */
63 ah->hw_version.usbdev = drv_info;
64 ah->ah_flags |= AH_USE_EEPROM;
65 + ah->reg_ops.read = ath9k_regread;
66 + ah->reg_ops.multi_read = ath9k_multi_regread;
67 + ah->reg_ops.write = ath9k_regwrite;
68 + ah->reg_ops.enable_write_buffer = ath9k_enable_regwrite_buffer;
69 + ah->reg_ops.write_flush = ath9k_regwrite_flush;
72 common = ath9k_hw_common(ah);
73 - common->ops = &ath9k_common_ops;
74 + common->ops = &ah->reg_ops;
75 common->bus_ops = &ath9k_usb_bus_ops;
77 common->hw = priv->hw;
78 --- a/drivers/net/wireless/ath/ath9k/init.c
79 +++ b/drivers/net/wireless/ath/ath9k/init.c
80 @@ -196,11 +196,6 @@ static unsigned int ath9k_ioread32(void
84 -static const struct ath_ops ath9k_common_ops = {
85 - .read = ath9k_ioread32,
86 - .write = ath9k_iowrite32,
89 /**************************/
91 /**************************/
92 @@ -551,6 +546,8 @@ static int ath9k_init_softc(u16 devid, s
94 ah->hw_version.devid = devid;
95 ah->hw_version.subsysid = subsysid;
96 + ah->reg_ops.read = ath9k_ioread32;
97 + ah->reg_ops.write = ath9k_iowrite32;
101 @@ -563,7 +560,7 @@ static int ath9k_init_softc(u16 devid, s
104 common = ath9k_hw_common(ah);
105 - common->ops = &ath9k_common_ops;
106 + common->ops = &ah->reg_ops;
107 common->bus_ops = bus_ops;