aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2011-08-16 09:00:23 -0400
committerStanislaw Gruszka <sgruszka@redhat.com>2011-11-15 05:17:07 -0500
commit46f16c492e5ca905c2170c11177fb90a58074eab (patch)
tree070c0377735e0a1c955b51841cfeef24bbcd4b14
parentd2ddf621aa45ac4cf4cce6359bfac6b49a8c6b34 (diff)
iwlegacy: remove DEBUG_IO
Nothing useful at present. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965-eeprom.c6
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-debug.h2
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-io.h192
3 files changed, 3 insertions, 197 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-eeprom.c b/drivers/net/wireless/iwlegacy/iwl-4965-eeprom.c
index 947475ea3cef..ef8b0d5f2e07 100644
--- a/drivers/net/wireless/iwlegacy/iwl-4965-eeprom.c
+++ b/drivers/net/wireless/iwlegacy/iwl-4965-eeprom.c
@@ -102,12 +102,8 @@ int il4965_eeprom_acquire_semaphore(struct il_priv *il)
102 CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM, 102 CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM,
103 CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM, 103 CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM,
104 EEPROM_SEM_TIMEOUT); 104 EEPROM_SEM_TIMEOUT);
105 if (ret >= 0) { 105 if (ret >= 0)
106 IL_DEBUG_IO(il,
107 "Acquired semaphore after %d tries.\n",
108 count+1);
109 return ret; 106 return ret;
110 }
111 } 107 }
112 108
113 return ret; 109 return ret;
diff --git a/drivers/net/wireless/iwlegacy/iwl-debug.h b/drivers/net/wireless/iwlegacy/iwl-debug.h
index 05a7933011b6..a825051d5f2d 100644
--- a/drivers/net/wireless/iwlegacy/iwl-debug.h
+++ b/drivers/net/wireless/iwlegacy/iwl-debug.h
@@ -146,7 +146,6 @@ static inline void il_dbgfs_unregister(struct il_priv *il)
146#define IL_DL_RX (1 << 24) 146#define IL_DL_RX (1 << 24)
147#define IL_DL_ISR (1 << 25) 147#define IL_DL_ISR (1 << 25)
148#define IL_DL_HT (1 << 26) 148#define IL_DL_HT (1 << 26)
149#define IL_DL_IO (1 << 27)
150/* 0xF0000000 - 0x10000000 */ 149/* 0xF0000000 - 0x10000000 */
151#define IL_DL_11H (1 << 28) 150#define IL_DL_11H (1 << 28)
152#define IL_DL_STATS (1 << 29) 151#define IL_DL_STATS (1 << 29)
@@ -174,7 +173,6 @@ static inline void il_dbgfs_unregister(struct il_priv *il)
174 IL_DEBUG_LIMIT(p, IL_DL_DROP, f, ## a) 173 IL_DEBUG_LIMIT(p, IL_DL_DROP, f, ## a)
175#define IL_DEBUG_AP(p, f, a...) IL_DEBUG(p, IL_DL_AP, f, ## a) 174#define IL_DEBUG_AP(p, f, a...) IL_DEBUG(p, IL_DL_AP, f, ## a)
176#define IL_DEBUG_TXPOWER(p, f, a...) IL_DEBUG(p, IL_DL_TXPOWER, f, ## a) 175#define IL_DEBUG_TXPOWER(p, f, a...) IL_DEBUG(p, IL_DL_TXPOWER, f, ## a)
177#define IL_DEBUG_IO(p, f, a...) IL_DEBUG(p, IL_DL_IO, f, ## a)
178#define IL_DEBUG_RATE(p, f, a...) IL_DEBUG(p, IL_DL_RATE, f, ## a) 176#define IL_DEBUG_RATE(p, f, a...) IL_DEBUG(p, IL_DL_RATE, f, ## a)
179#define IL_DEBUG_RATE_LIMIT(p, f, a...) \ 177#define IL_DEBUG_RATE_LIMIT(p, f, a...) \
180 IL_DEBUG_LIMIT(p, IL_DL_RATE, f, ## a) 178 IL_DEBUG_LIMIT(p, IL_DL_RATE, f, ## a)
diff --git a/drivers/net/wireless/iwlegacy/iwl-io.h b/drivers/net/wireless/iwlegacy/iwl-io.h
index 42d241fd6ac9..d6aae8daf3f0 100644
--- a/drivers/net/wireless/iwlegacy/iwl-io.h
+++ b/drivers/net/wireless/iwlegacy/iwl-io.h
@@ -34,90 +34,24 @@
34#include "iwl-dev.h" 34#include "iwl-dev.h"
35#include "iwl-debug.h" 35#include "iwl-debug.h"
36 36
37/*
38 * IO, register, and NIC memory access functions
39 *
40 * NOTE on naming convention and macro usage for these
41 *
42 * A single _ prefix before a an access function means that no state
43 * check or debug information is printed when that function is called.
44 *
45 * A double __ prefix before an access function means that state is checked
46 * and the current line number and caller function name are printed in addition
47 * to any other debug output.
48 *
49 * The non-prefixed name is the #define that maps the caller into a
50 * #define that provides the caller's name and __LINE__ to the double
51 * prefix version.
52 *
53 * If you wish to call the function without any debug or state checking,
54 * you should use the single _ prefix version (as is used by dependent IO
55 * routines, for example _il_read_direct32 calls the non-check version of
56 * _il_read32.)
57 *
58 * These declarations are *extremely* useful in quickly isolating code deltas
59 * which result in misconfiguration of the hardware I/O. In combination with
60 * git-bisect and the IO debug level you can quickly determine the specific
61 * commit which breaks the IO sequence to the hardware.
62 *
63 */
64
65static inline void _il_write8(struct il_priv *il, u32 ofs, u8 val) 37static inline void _il_write8(struct il_priv *il, u32 ofs, u8 val)
66{ 38{
67 iowrite8(val, il->hw_base + ofs); 39 iowrite8(val, il->hw_base + ofs);
68} 40}
69
70#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
71static inline void
72__il_write8(const char *f, u32 l, struct il_priv *il,
73 u32 ofs, u8 val)
74{
75 IL_DEBUG_IO(il, "write8(0x%08X, 0x%02X) - %s %d\n", ofs, val, f, l);
76 _il_write8(il, ofs, val);
77}
78#define il_write8(il, ofs, val) \
79 __il_write8(__FILE__, __LINE__, il, ofs, val)
80#else
81#define il_write8(il, ofs, val) _il_write8(il, ofs, val) 41#define il_write8(il, ofs, val) _il_write8(il, ofs, val)
82#endif
83
84 42
85static inline void _il_write32(struct il_priv *il, u32 ofs, u32 val) 43static inline void _il_write32(struct il_priv *il, u32 ofs, u32 val)
86{ 44{
87 iowrite32(val, il->hw_base + ofs); 45 iowrite32(val, il->hw_base + ofs);
88} 46}
89
90#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
91static inline void
92__il_write32(const char *f, u32 l, struct il_priv *il,
93 u32 ofs, u32 val)
94{
95 IL_DEBUG_IO(il, "write32(0x%08X, 0x%08X) - %s %d\n", ofs, val, f, l);
96 _il_write32(il, ofs, val);
97}
98#define il_write32(il, ofs, val) \
99 __il_write32(__FILE__, __LINE__, il, ofs, val)
100#else
101#define il_write32(il, ofs, val) _il_write32(il, ofs, val) 47#define il_write32(il, ofs, val) _il_write32(il, ofs, val)
102#endif
103 48
104static inline u32 _il_read32(struct il_priv *il, u32 ofs) 49static inline u32 _il_read32(struct il_priv *il, u32 ofs)
105{ 50{
106 u32 val = ioread32(il->hw_base + ofs); 51 u32 val = ioread32(il->hw_base + ofs);
107 return val; 52 return val;
108} 53}
109
110#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
111static inline u32
112__il_read32(char *f, u32 l, struct il_priv *il, u32 ofs)
113{
114 IL_DEBUG_IO(il, "read_direct32(0x%08X) - %s %d\n", ofs, f, l);
115 return _il_read32(il, ofs);
116}
117#define il_read32(il, ofs) __il_read32(__FILE__, __LINE__, il, ofs)
118#else
119#define il_read32(p, o) _il_read32(p, o) 54#define il_read32(p, o) _il_read32(p, o)
120#endif
121 55
122#define IL_POLL_INTERVAL 10 /* microseconds */ 56#define IL_POLL_INTERVAL 10 /* microseconds */
123static inline int 57static inline int
@@ -135,46 +69,13 @@ _il_poll_bit(struct il_priv *il, u32 addr,
135 69
136 return -ETIMEDOUT; 70 return -ETIMEDOUT;
137} 71}
138#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
139static inline int __il_poll_bit(const char *f, u32 l,
140 struct il_priv *il, u32 addr,
141 u32 bits, u32 mask, int timeout)
142{
143 int ret = _il_poll_bit(il, addr, bits, mask, timeout);
144 IL_DEBUG_IO(il, "poll_bit(0x%08X, 0x%08X, 0x%08X) - %s- %s %d\n",
145 addr, bits, mask,
146 unlikely(ret == -ETIMEDOUT) ? "timeout" : "", f, l);
147 return ret;
148}
149#define il_poll_bit(il, addr, bits, mask, timeout) \
150 __il_poll_bit(__FILE__, __LINE__, il, addr, \
151 bits, mask, timeout)
152#else
153#define il_poll_bit(p, a, b, m, t) _il_poll_bit(p, a, b, m, t) 72#define il_poll_bit(p, a, b, m, t) _il_poll_bit(p, a, b, m, t)
154#endif
155 73
156static inline void _il_set_bit(struct il_priv *il, u32 reg, u32 mask) 74static inline void _il_set_bit(struct il_priv *il, u32 reg, u32 mask)
157{ 75{
158 _il_write32(il, reg, _il_read32(il, reg) | mask); 76 _il_write32(il, reg, _il_read32(il, reg) | mask);
159} 77}
160#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
161static inline void __il_set_bit(const char *f, u32 l,
162 struct il_priv *il, u32 reg, u32 mask)
163{
164 u32 val = _il_read32(il, reg) | mask;
165 IL_DEBUG_IO(il, "set_bit(0x%08X, 0x%08X) = 0x%08X\n", reg,
166 mask, val);
167 _il_write32(il, reg, val);
168}
169static inline void il_set_bit(struct il_priv *p, u32 r, u32 m)
170{
171 unsigned long reg_flags;
172 78
173 spin_lock_irqsave(&p->reg_lock, reg_flags);
174 __il_set_bit(__FILE__, __LINE__, p, r, m);
175 spin_unlock_irqrestore(&p->reg_lock, reg_flags);
176}
177#else
178static inline void il_set_bit(struct il_priv *p, u32 r, u32 m) 79static inline void il_set_bit(struct il_priv *p, u32 r, u32 m)
179{ 80{
180 unsigned long reg_flags; 81 unsigned long reg_flags;
@@ -183,31 +84,13 @@ static inline void il_set_bit(struct il_priv *p, u32 r, u32 m)
183 _il_set_bit(p, r, m); 84 _il_set_bit(p, r, m);
184 spin_unlock_irqrestore(&p->reg_lock, reg_flags); 85 spin_unlock_irqrestore(&p->reg_lock, reg_flags);
185} 86}
186#endif
187 87
188static inline void 88static inline void
189_il_clear_bit(struct il_priv *il, u32 reg, u32 mask) 89_il_clear_bit(struct il_priv *il, u32 reg, u32 mask)
190{ 90{
191 _il_write32(il, reg, _il_read32(il, reg) & ~mask); 91 _il_write32(il, reg, _il_read32(il, reg) & ~mask);
192} 92}
193#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
194static inline void
195__il_clear_bit(const char *f, u32 l,
196 struct il_priv *il, u32 reg, u32 mask)
197{
198 u32 val = _il_read32(il, reg) & ~mask;
199 IL_DEBUG_IO(il, "clear_bit(0x%08X, 0x%08X) = 0x%08X\n", reg, mask, val);
200 _il_write32(il, reg, val);
201}
202static inline void il_clear_bit(struct il_priv *p, u32 r, u32 m)
203{
204 unsigned long reg_flags;
205 93
206 spin_lock_irqsave(&p->reg_lock, reg_flags);
207 __il_clear_bit(__FILE__, __LINE__, p, r, m);
208 spin_unlock_irqrestore(&p->reg_lock, reg_flags);
209}
210#else
211static inline void il_clear_bit(struct il_priv *p, u32 r, u32 m) 94static inline void il_clear_bit(struct il_priv *p, u32 r, u32 m)
212{ 95{
213 unsigned long reg_flags; 96 unsigned long reg_flags;
@@ -216,7 +99,6 @@ static inline void il_clear_bit(struct il_priv *p, u32 r, u32 m)
216 _il_clear_bit(p, r, m); 99 _il_clear_bit(p, r, m);
217 spin_unlock_irqrestore(&p->reg_lock, reg_flags); 100 spin_unlock_irqrestore(&p->reg_lock, reg_flags);
218} 101}
219#endif
220 102
221static inline int _il_grab_nic_access(struct il_priv *il) 103static inline int _il_grab_nic_access(struct il_priv *il)
222{ 104{
@@ -259,69 +141,20 @@ static inline int _il_grab_nic_access(struct il_priv *il)
259 141
260 return 0; 142 return 0;
261} 143}
262 144#define il_grab_nic_access(il) _il_grab_nic_access(il)
263#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
264static inline int __il_grab_nic_access(const char *f, u32 l,
265 struct il_priv *il)
266{
267 IL_DEBUG_IO(il, "grabbing nic access - %s %d\n", f, l);
268 return _il_grab_nic_access(il);
269}
270#define il_grab_nic_access(il) \
271 __il_grab_nic_access(__FILE__, __LINE__, il)
272#else
273#define il_grab_nic_access(il) \
274 _il_grab_nic_access(il)
275#endif
276 145
277static inline void _il_release_nic_access(struct il_priv *il) 146static inline void _il_release_nic_access(struct il_priv *il)
278{ 147{
279 _il_clear_bit(il, CSR_GP_CNTRL, 148 _il_clear_bit(il, CSR_GP_CNTRL,
280 CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); 149 CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
281} 150}
282#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG 151#define il_release_nic_access(il) _il_release_nic_access(il)
283static inline void __il_release_nic_access(const char *f, u32 l,
284 struct il_priv *il)
285{
286
287 IL_DEBUG_IO(il, "releasing nic access - %s %d\n", f, l);
288 _il_release_nic_access(il);
289}
290#define il_release_nic_access(il) \
291 __il_release_nic_access(__FILE__, __LINE__, il)
292#else
293#define il_release_nic_access(il) \
294 _il_release_nic_access(il)
295#endif
296 152
297static inline u32 _il_read_direct32(struct il_priv *il, u32 reg) 153static inline u32 _il_read_direct32(struct il_priv *il, u32 reg)
298{ 154{
299 return _il_read32(il, reg); 155 return _il_read32(il, reg);
300} 156}
301#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
302static inline u32 __il_read_direct32(const char *f, u32 l,
303 struct il_priv *il, u32 reg)
304{
305 u32 value = _il_read_direct32(il, reg);
306 IL_DEBUG_IO(il,
307 "read_direct32(0x%4X) = 0x%08x - %s %d\n", reg, value,
308 f, l);
309 return value;
310}
311static inline u32 il_read_direct32(struct il_priv *il, u32 reg)
312{
313 u32 value;
314 unsigned long reg_flags;
315
316 spin_lock_irqsave(&il->reg_lock, reg_flags);
317 il_grab_nic_access(il);
318 value = __il_read_direct32(__FILE__, __LINE__, il, reg);
319 il_release_nic_access(il);
320 spin_unlock_irqrestore(&il->reg_lock, reg_flags);
321 return value;
322}
323 157
324#else
325static inline u32 il_read_direct32(struct il_priv *il, u32 reg) 158static inline u32 il_read_direct32(struct il_priv *il, u32 reg)
326{ 159{
327 u32 value; 160 u32 value;
@@ -335,7 +168,6 @@ static inline u32 il_read_direct32(struct il_priv *il, u32 reg)
335 return value; 168 return value;
336 169
337} 170}
338#endif
339 171
340static inline void _il_write_direct32(struct il_priv *il, 172static inline void _il_write_direct32(struct il_priv *il,
341 u32 reg, u32 value) 173 u32 reg, u32 value)
@@ -380,27 +212,7 @@ static inline int _il_poll_direct_bit(struct il_priv *il, u32 addr,
380 212
381 return -ETIMEDOUT; 213 return -ETIMEDOUT;
382} 214}
383
384#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
385static inline int __il_poll_direct_bit(const char *f, u32 l,
386 struct il_priv *il,
387 u32 addr, u32 mask, int timeout)
388{
389 int ret = _il_poll_direct_bit(il, addr, mask, timeout);
390
391 if (unlikely(ret == -ETIMEDOUT))
392 IL_DEBUG_IO(il, "poll_direct_bit(0x%08X, 0x%08X) - "
393 "timedout - %s %d\n", addr, mask, f, l);
394 else
395 IL_DEBUG_IO(il, "poll_direct_bit(0x%08X, 0x%08X) = 0x%08X "
396 "- %s %d\n", addr, mask, ret, f, l);
397 return ret;
398}
399#define il_poll_direct_bit(il, addr, mask, timeout) \
400__il_poll_direct_bit(__FILE__, __LINE__, il, addr, mask, timeout)
401#else
402#define il_poll_direct_bit _il_poll_direct_bit 215#define il_poll_direct_bit _il_poll_direct_bit
403#endif
404 216
405static inline u32 _il_read_prph(struct il_priv *il, u32 reg) 217static inline u32 _il_read_prph(struct il_priv *il, u32 reg)
406{ 218{