mac80211: fix a deadlock in minstrel_ht when a HT client without valid MCS rates...
[openwrt.git] / package / mac80211 / patches / 560-ath9k_move_regops_struct.patch
1 --- a/drivers/net/wireless/ath/ath9k/hw.h
2 +++ b/drivers/net/wireless/ath/ath9k/hw.h
3 @@ -65,24 +65,24 @@
4
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))
9
10 #define REG_READ(_ah, _reg) \
11 - ath9k_hw_common(_ah)->ops->read((_ah), (_reg))
12 + (_ah)->reg_ops.read((_ah), (_reg))
13
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))
17
18 #define ENABLE_REGWRITE_BUFFER(_ah) \
19 do { \
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)); \
24 } while (0)
25
26 #define REGWRITE_BUFFER_FLUSH(_ah) \
27 do { \
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)); \
32 } while (0)
33
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. */
37
38 struct ath_hw {
39 + struct ath_ops reg_ops;
40 +
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);
48 }
49
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,
56 -};
57 -
58 static void ath_usb_read_cachesize(struct ath_common *common, int *csz)
59 {
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;
70 priv->ah = ah;
71
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;
76 common->ah = ah;
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
81 return val;
82 }
83
84 -static const struct ath_ops ath9k_common_ops = {
85 - .read = ath9k_ioread32,
86 - .write = ath9k_iowrite32,
87 -};
88 -
89 /**************************/
90 /* Initialization */
91 /**************************/
92 @@ -551,6 +546,8 @@ static int ath9k_init_softc(u16 devid, s
93 ah->hw = sc->hw;
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;
98 sc->sc_ah = ah;
99
100 if (!pdata) {
101 @@ -563,7 +560,7 @@ static int ath9k_init_softc(u16 devid, s
102 }
103
104 common = ath9k_hw_common(ah);
105 - common->ops = &ath9k_common_ops;
106 + common->ops = &ah->reg_ops;
107 common->bus_ops = bus_ops;
108 common->ah = ah;
109 common->hw = sc->hw;
This page took 0.043362 seconds and 5 git commands to generate.