aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-io.h
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-03-25 19:33:38 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-03-27 16:03:17 -0400
commit775ea378fa04f39164f170f308ec467ee4ab6d34 (patch)
treead51795c1858885be24c316fcaafaa5176ec9ac0 /drivers/net/wireless/iwlwifi/iwl-io.h
parent3395f6e9cf48469d7ee05703cad1502002741c16 (diff)
iwlwifi: improve NIC i/o debug prints information
This patch gives the function's caller name in case NIC access reference count was not used by it. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-io.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-io.h47
1 files changed, 25 insertions, 22 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-io.h b/drivers/net/wireless/iwlwifi/iwl-io.h
index 09cc094340b0..5bc3df432d2d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-io.h
+++ b/drivers/net/wireless/iwlwifi/iwl-io.h
@@ -42,10 +42,12 @@
42 * check or debug information is printed when that function is called. 42 * check or debug information is printed when that function is called.
43 * 43 *
44 * A double __ prefix before an access function means that state is checked 44 * A double __ prefix before an access function means that state is checked
45 * and the current line number is printed in addition to any other debug output. 45 * and the current line number and caller function name are printed in addition
46 * to any other debug output.
46 * 47 *
47 * The non-prefixed name is the #define that maps the caller into a 48 * The non-prefixed name is the #define that maps the caller into a
48 * #define that provides the caller's __LINE__ to the double prefix version. 49 * #define that provides the caller's name and __LINE__ to the double
50 * prefix version.
49 * 51 *
50 * If you wish to call the function without any debug or state checking, 52 * If you wish to call the function without any debug or state checking,
51 * you should use the single _ prefix version (as is used by dependent IO 53 * you should use the single _ prefix version (as is used by dependent IO
@@ -197,8 +199,7 @@ static inline int __iwl_grab_nic_access(const char *f, u32 l,
197 struct iwl_priv *priv) 199 struct iwl_priv *priv)
198{ 200{
199 if (atomic_read(&priv->restrict_refcnt)) 201 if (atomic_read(&priv->restrict_refcnt))
200 IWL_DEBUG_INFO("Grabbing access while already held at " 202 IWL_ERROR("Grabbing access while already held %s %d.\n", f, l);
201 "line %d.\n", l);
202 203
203 IWL_DEBUG_IO("grabbing nic access - %s %d\n", f, l); 204 IWL_DEBUG_IO("grabbing nic access - %s %d\n", f, l);
204 return _iwl_grab_nic_access(priv); 205 return _iwl_grab_nic_access(priv);
@@ -223,7 +224,7 @@ static inline void __iwl_release_nic_access(const char *f, u32 l,
223 struct iwl_priv *priv) 224 struct iwl_priv *priv)
224{ 225{
225 if (atomic_read(&priv->restrict_refcnt) <= 0) 226 if (atomic_read(&priv->restrict_refcnt) <= 0)
226 IWL_ERROR("Release unheld nic access at line %d.\n", l); 227 IWL_ERROR("Release unheld nic access at line %s %d.\n", f, l);
227 228
228 IWL_DEBUG_IO("releasing nic access - %s %d\n", f, l); 229 IWL_DEBUG_IO("releasing nic access - %s %d\n", f, l);
229 _iwl_release_nic_access(priv); 230 _iwl_release_nic_access(priv);
@@ -262,15 +263,15 @@ static inline void _iwl_write_direct32(struct iwl_priv *priv,
262 _iwl_write32(priv, reg, value); 263 _iwl_write32(priv, reg, value);
263} 264}
264#ifdef CONFIG_IWLWIFI_DEBUG 265#ifdef CONFIG_IWLWIFI_DEBUG
265static void __iwl_write_direct32(u32 line, 266static void __iwl_write_direct32(const char *f , u32 line,
266 struct iwl_priv *priv, u32 reg, u32 value) 267 struct iwl_priv *priv, u32 reg, u32 value)
267{ 268{
268 if (!atomic_read(&priv->restrict_refcnt)) 269 if (!atomic_read(&priv->restrict_refcnt))
269 IWL_ERROR("Nic access not held from line %d\n", line); 270 IWL_ERROR("Nic access not held from %s line %d\n", f, line);
270 _iwl_write_direct32(priv, reg, value); 271 _iwl_write_direct32(priv, reg, value);
271} 272}
272#define iwl_write_direct32(priv, reg, value) \ 273#define iwl_write_direct32(priv, reg, value) \
273 __iwl_write_direct32(__LINE__, priv, reg, value) 274 __iwl_write_direct32(__func__, __LINE__, priv, reg, value)
274#else 275#else
275#define iwl_write_direct32 _iwl_write_direct32 276#define iwl_write_direct32 _iwl_write_direct32
276#endif 277#endif
@@ -328,15 +329,16 @@ static inline u32 _iwl_read_prph(struct iwl_priv *priv, u32 reg)
328 return _iwl_read_direct32(priv, HBUS_TARG_PRPH_RDAT); 329 return _iwl_read_direct32(priv, HBUS_TARG_PRPH_RDAT);
329} 330}
330#ifdef CONFIG_IWLWIFI_DEBUG 331#ifdef CONFIG_IWLWIFI_DEBUG
331static inline u32 __iwl_read_prph(u32 line, struct iwl_priv *priv, u32 reg) 332static inline u32 __iwl_read_prph(const char *f, u32 line,
333 struct iwl_priv *priv, u32 reg)
332{ 334{
333 if (!atomic_read(&priv->restrict_refcnt)) 335 if (!atomic_read(&priv->restrict_refcnt))
334 IWL_ERROR("Nic access not held from line %d\n", line); 336 IWL_ERROR("Nic access not held from %s line %d\n", f, line);
335 return _iwl_read_prph(priv, reg); 337 return _iwl_read_prph(priv, reg);
336} 338}
337 339
338#define iwl_read_prph(priv, reg) \ 340#define iwl_read_prph(priv, reg) \
339 __iwl_read_prph(__LINE__, priv, reg) 341 __iwl_read_prph(__func__, __LINE__, priv, reg)
340#else 342#else
341#define iwl_read_prph _iwl_read_prph 343#define iwl_read_prph _iwl_read_prph
342#endif 344#endif
@@ -349,16 +351,16 @@ static inline void _iwl_write_prph(struct iwl_priv *priv,
349 _iwl_write_direct32(priv, HBUS_TARG_PRPH_WDAT, val); 351 _iwl_write_direct32(priv, HBUS_TARG_PRPH_WDAT, val);
350} 352}
351#ifdef CONFIG_IWLWIFI_DEBUG 353#ifdef CONFIG_IWLWIFI_DEBUG
352static inline void __iwl_write_prph(u32 line, struct iwl_priv *priv, 354static inline void __iwl_write_prph(const char *f, u32 line,
353 u32 addr, u32 val) 355 struct iwl_priv *priv, u32 addr, u32 val)
354{ 356{
355 if (!atomic_read(&priv->restrict_refcnt)) 357 if (!atomic_read(&priv->restrict_refcnt))
356 IWL_ERROR("Nic access from line %d\n", line); 358 IWL_ERROR("Nic access not held from %s line %d\n", f, line);
357 _iwl_write_prph(priv, addr, val); 359 _iwl_write_prph(priv, addr, val);
358} 360}
359 361
360#define iwl_write_prph(priv, addr, val) \ 362#define iwl_write_prph(priv, addr, val) \
361 __iwl_write_prph(__LINE__, priv, addr, val); 363 __iwl_write_prph(__func__, __LINE__, priv, addr, val);
362#else 364#else
363#define iwl_write_prph _iwl_write_prph 365#define iwl_write_prph _iwl_write_prph
364#endif 366#endif
@@ -366,16 +368,17 @@ static inline void __iwl_write_prph(u32 line, struct iwl_priv *priv,
366#define _iwl_set_bits_prph(priv, reg, mask) \ 368#define _iwl_set_bits_prph(priv, reg, mask) \
367 _iwl_write_prph(priv, reg, (_iwl_read_prph(priv, reg) | mask)) 369 _iwl_write_prph(priv, reg, (_iwl_read_prph(priv, reg) | mask))
368#ifdef CONFIG_IWLWIFI_DEBUG 370#ifdef CONFIG_IWLWIFI_DEBUG
369static inline void __iwl_set_bits_prph(u32 line, struct iwl_priv *priv, 371static inline void __iwl_set_bits_prph(const char *f, u32 line,
370 u32 reg, u32 mask) 372 struct iwl_priv *priv,
373 u32 reg, u32 mask)
371{ 374{
372 if (!atomic_read(&priv->restrict_refcnt)) 375 if (!atomic_read(&priv->restrict_refcnt))
373 IWL_ERROR("Nic access not held from line %d\n", line); 376 IWL_ERROR("Nic access not held from %s line %d\n", f, line);
374 377
375 _iwl_set_bits_prph(priv, reg, mask); 378 _iwl_set_bits_prph(priv, reg, mask);
376} 379}
377#define iwl_set_bits_prph(priv, reg, mask) \ 380#define iwl_set_bits_prph(priv, reg, mask) \
378 __iwl_set_bits_prph(__LINE__, priv, reg, mask) 381 __iwl_set_bits_prph(__func__, __LINE__, priv, reg, mask)
379#else 382#else
380#define iwl_set_bits_prph _iwl_set_bits_prph 383#define iwl_set_bits_prph _iwl_set_bits_prph
381#endif 384#endif
@@ -384,15 +387,15 @@ static inline void __iwl_set_bits_prph(u32 line, struct iwl_priv *priv,
384 _iwl_write_prph(priv, reg, ((_iwl_read_prph(priv, reg) & mask) | bits)) 387 _iwl_write_prph(priv, reg, ((_iwl_read_prph(priv, reg) & mask) | bits))
385 388
386#ifdef CONFIG_IWLWIFI_DEBUG 389#ifdef CONFIG_IWLWIFI_DEBUG
387static inline void __iwl_set_bits_mask_prph(u32 line, 390static inline void __iwl_set_bits_mask_prph(const char *f, u32 line,
388 struct iwl_priv *priv, u32 reg, u32 bits, u32 mask) 391 struct iwl_priv *priv, u32 reg, u32 bits, u32 mask)
389{ 392{
390 if (!atomic_read(&priv->restrict_refcnt)) 393 if (!atomic_read(&priv->restrict_refcnt))
391 IWL_ERROR("Nic access not held from line %d\n", line); 394 IWL_ERROR("Nic access not held from %s line %d\n", f, line);
392 _iwl_set_bits_mask_prph(priv, reg, bits, mask); 395 _iwl_set_bits_mask_prph(priv, reg, bits, mask);
393} 396}
394#define iwl_set_bits_mask_prph(priv, reg, bits, mask) \ 397#define iwl_set_bits_mask_prph(priv, reg, bits, mask) \
395 __iwl_set_bits_mask_prph(__LINE__, priv, reg, bits, mask) 398 __iwl_set_bits_mask_prph(__func__, __LINE__, priv, reg, bits, mask)
396#else 399#else
397#define iwl_set_bits_mask_prph _iwl_set_bits_mask_prph 400#define iwl_set_bits_mask_prph _iwl_set_bits_mask_prph
398#endif 401#endif