ath9k: add some cleanup patches and rework tx power handling
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 580-ath9k_cleanup_set_interrupt.patch
1 --- a/drivers/net/wireless/ath/ath9k/beacon.c
2 +++ b/drivers/net/wireless/ath/ath9k/beacon.c
3 @@ -515,7 +515,7 @@ static void ath_beacon_config_ap(struct
4 sc->sc_flags |= SC_OP_TSF_RESET;
5 ath9k_beacon_init(sc, nexttbtt, intval);
6 sc->beacon.bmisscnt = 0;
7 - ath9k_hw_set_interrupts(ah, ah->imask);
8 + ath9k_hw_set_interrupts(ah);
9 ath9k_hw_enable_interrupts(ah);
10 }
11
12 @@ -643,7 +643,7 @@ static void ath_beacon_config_sta(struct
13 ath9k_hw_set_sta_beacon_timers(ah, &bs);
14 ah->imask |= ATH9K_INT_BMISS;
15
16 - ath9k_hw_set_interrupts(ah, ah->imask);
17 + ath9k_hw_set_interrupts(ah);
18 ath9k_hw_enable_interrupts(ah);
19 }
20
21 @@ -679,7 +679,7 @@ static void ath_beacon_config_adhoc(stru
22 ath9k_beacon_init(sc, nexttbtt, intval);
23 sc->beacon.bmisscnt = 0;
24
25 - ath9k_hw_set_interrupts(ah, ah->imask);
26 + ath9k_hw_set_interrupts(ah);
27 ath9k_hw_enable_interrupts(ah);
28 }
29
30 @@ -821,11 +821,11 @@ void ath9k_set_beaconing_status(struct a
31 if (status) {
32 /* Re-enable beaconing */
33 ah->imask |= ATH9K_INT_SWBA;
34 - ath9k_hw_set_interrupts(ah, ah->imask);
35 + ath9k_hw_set_interrupts(ah);
36 } else {
37 /* Disable SWBA interrupt */
38 ah->imask &= ~ATH9K_INT_SWBA;
39 - ath9k_hw_set_interrupts(ah, ah->imask);
40 + ath9k_hw_set_interrupts(ah);
41 tasklet_kill(&sc->bcon_tasklet);
42 ath9k_hw_stop_dma_queue(ah, sc->beacon.beaconq);
43 }
44 --- a/drivers/net/wireless/ath/ath9k/gpio.c
45 +++ b/drivers/net/wireless/ath/ath9k/gpio.c
46 @@ -151,7 +151,7 @@ static void ath9k_gen_timer_start(struct
47 if ((ah->imask & ATH9K_INT_GENTIMER) == 0) {
48 ath9k_hw_disable_interrupts(ah);
49 ah->imask |= ATH9K_INT_GENTIMER;
50 - ath9k_hw_set_interrupts(ah, ah->imask);
51 + ath9k_hw_set_interrupts(ah);
52 ath9k_hw_enable_interrupts(ah);
53 }
54 }
55 @@ -166,7 +166,7 @@ static void ath9k_gen_timer_stop(struct
56 if (timer_table->timer_mask.val == 0) {
57 ath9k_hw_disable_interrupts(ah);
58 ah->imask &= ~ATH9K_INT_GENTIMER;
59 - ath9k_hw_set_interrupts(ah, ah->imask);
60 + ath9k_hw_set_interrupts(ah);
61 ath9k_hw_enable_interrupts(ah);
62 }
63 }
64 --- a/drivers/net/wireless/ath/ath9k/main.c
65 +++ b/drivers/net/wireless/ath/ath9k/main.c
66 @@ -273,7 +273,7 @@ static bool ath_complete_reset(struct at
67
68 ath9k_cmn_update_txpow(ah, sc->curtxpow,
69 sc->config.txpowlimit, &sc->curtxpow);
70 - ath9k_hw_set_interrupts(ah, ah->imask);
71 + ath9k_hw_set_interrupts(ah);
72 ath9k_hw_enable_interrupts(ah);
73
74 if (!(sc->sc_flags & (SC_OP_OFFCHANNEL)) && start) {
75 @@ -833,7 +833,7 @@ irqreturn_t ath_isr(int irq, void *dev)
76
77 if (status & ATH9K_INT_RXEOL) {
78 ah->imask &= ~(ATH9K_INT_RXEOL | ATH9K_INT_RXORN);
79 - ath9k_hw_set_interrupts(ah, ah->imask);
80 + ath9k_hw_set_interrupts(ah);
81 }
82
83 if (status & ATH9K_INT_MIB) {
84 @@ -1409,7 +1409,7 @@ static void ath9k_calculate_summary_stat
85 ah->imask &= ~ATH9K_INT_TSFOOR;
86 }
87
88 - ath9k_hw_set_interrupts(ah, ah->imask);
89 + ath9k_hw_set_interrupts(ah);
90
91 /* Set up ANI */
92 if (iter_data.naps > 0) {
93 @@ -1566,7 +1566,7 @@ static void ath9k_enable_ps(struct ath_s
94 if (!(ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) {
95 if ((ah->imask & ATH9K_INT_TIM_TIMER) == 0) {
96 ah->imask |= ATH9K_INT_TIM_TIMER;
97 - ath9k_hw_set_interrupts(ah, ah->imask);
98 + ath9k_hw_set_interrupts(ah);
99 }
100 ath9k_hw_setrxabort(ah, 1);
101 }
102 @@ -1586,7 +1586,7 @@ static void ath9k_disable_ps(struct ath_
103 PS_WAIT_FOR_TX_ACK);
104 if (ah->imask & ATH9K_INT_TIM_TIMER) {
105 ah->imask &= ~ATH9K_INT_TIM_TIMER;
106 - ath9k_hw_set_interrupts(ah, ah->imask);
107 + ath9k_hw_set_interrupts(ah);
108 }
109 }
110
111 --- a/drivers/net/wireless/ath/ath9k/recv.c
112 +++ b/drivers/net/wireless/ath/ath9k/recv.c
113 @@ -1977,7 +1977,7 @@ requeue:
114
115 if (!(ah->imask & ATH9K_INT_RXEOL)) {
116 ah->imask |= (ATH9K_INT_RXEOL | ATH9K_INT_RXORN);
117 - ath9k_hw_set_interrupts(ah, ah->imask);
118 + ath9k_hw_set_interrupts(ah);
119 }
120
121 return 0;
122 --- a/drivers/net/wireless/ath/ath9k/mac.c
123 +++ b/drivers/net/wireless/ath/ath9k/mac.c
124 @@ -827,9 +827,9 @@ void ath9k_hw_enable_interrupts(struct a
125 }
126 EXPORT_SYMBOL(ath9k_hw_enable_interrupts);
127
128 -void ath9k_hw_set_interrupts(struct ath_hw *ah, enum ath9k_int ints)
129 +void ath9k_hw_set_interrupts(struct ath_hw *ah)
130 {
131 - enum ath9k_int omask = ah->imask;
132 + enum ath9k_int ints = ah->imask;
133 u32 mask, mask2;
134 struct ath9k_hw_capabilities *pCap = &ah->caps;
135 struct ath_common *common = ath9k_hw_common(ah);
136 @@ -837,7 +837,7 @@ void ath9k_hw_set_interrupts(struct ath_
137 if (!(ints & ATH9K_INT_GLOBAL))
138 ath9k_hw_disable_interrupts(ah);
139
140 - ath_dbg(common, ATH_DBG_INTERRUPT, "0x%x => 0x%x\n", omask, ints);
141 + ath_dbg(common, ATH_DBG_INTERRUPT, "New interrupt mask 0x%x\n", ints);
142
143 mask = ints & ATH9K_INT_COMMON;
144 mask2 = 0;
145 --- a/drivers/net/wireless/ath/ath9k/mac.h
146 +++ b/drivers/net/wireless/ath/ath9k/mac.h
147 @@ -734,7 +734,7 @@ int ath9k_hw_beaconq_setup(struct ath_hw
148
149 /* Interrupt Handling */
150 bool ath9k_hw_intrpend(struct ath_hw *ah);
151 -void ath9k_hw_set_interrupts(struct ath_hw *ah, enum ath9k_int ints);
152 +void ath9k_hw_set_interrupts(struct ath_hw *ah);
153 void ath9k_hw_enable_interrupts(struct ath_hw *ah);
154 void ath9k_hw_disable_interrupts(struct ath_hw *ah);
155