aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-03-06 16:30:47 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-03-07 13:51:51 -0500
commit84abd2cc066fc077c424d0faf7618be348a7efb2 (patch)
tree219ac651948a4382e0d946092711b6a44b4b5e1c /drivers
parent0dde86b2f2999a25dcc62a27cb768c35a418890a (diff)
iwlwifi: move status check functions out of shared
They are only used in the DVM op_mode. Also move the rfkill debug macros that depend on them. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-tt.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.h64
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debug.h16
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-shared.h42
4 files changed, 65 insertions, 58 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tt.c b/drivers/net/wireless/iwlwifi/iwl-agn-tt.c
index 85fe590ee721..7712c5537370 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-tt.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-tt.c
@@ -34,6 +34,7 @@
34 34
35#include <net/mac80211.h> 35#include <net/mac80211.h>
36 36
37#include "iwl-agn.h"
37#include "iwl-eeprom.h" 38#include "iwl-eeprom.h"
38#include "iwl-dev.h" 39#include "iwl-dev.h"
39#include "iwl-core.h" 40#include "iwl-core.h"
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h
index dfd86f288dee..1f62d6d1fc65 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.h
@@ -383,4 +383,68 @@ static inline void iwl_print_rx_config_cmd(struct iwl_priv *priv,
383} 383}
384#endif 384#endif
385 385
386/* status checks */
387
388static inline int iwl_is_ready(struct iwl_shared *shrd)
389{
390 /* The adapter is 'ready' if READY and GEO_CONFIGURED bits are
391 * set but EXIT_PENDING is not */
392 return test_bit(STATUS_READY, &shrd->status) &&
393 test_bit(STATUS_GEO_CONFIGURED, &shrd->status) &&
394 !test_bit(STATUS_EXIT_PENDING, &shrd->status);
395}
396
397static inline int iwl_is_alive(struct iwl_shared *shrd)
398{
399 return test_bit(STATUS_ALIVE, &shrd->status);
400}
401
402static inline int iwl_is_init(struct iwl_shared *shrd)
403{
404 return test_bit(STATUS_INIT, &shrd->status);
405}
406
407static inline int iwl_is_rfkill_hw(struct iwl_shared *shrd)
408{
409 return test_bit(STATUS_RF_KILL_HW, &shrd->status);
410}
411
412static inline int iwl_is_rfkill(struct iwl_shared *shrd)
413{
414 return iwl_is_rfkill_hw(shrd);
415}
416
417static inline int iwl_is_ctkill(struct iwl_shared *shrd)
418{
419 return test_bit(STATUS_CT_KILL, &shrd->status);
420}
421
422static inline int iwl_is_ready_rf(struct iwl_shared *shrd)
423{
424 if (iwl_is_rfkill(shrd))
425 return 0;
426
427 return iwl_is_ready(shrd);
428}
429
430#ifdef CONFIG_IWLWIFI_DEBUG
431#define IWL_DEBUG_QUIET_RFKILL(m, fmt, args...) \
432do { \
433 if (!iwl_is_rfkill((m)->shrd)) \
434 IWL_ERR(m, fmt, ##args); \
435 else \
436 __iwl_err(trans(m)->dev, true, \
437 !iwl_have_debug_level(IWL_DL_RADIO), \
438 fmt, ##args); \
439} while (0)
440#else
441#define IWL_DEBUG_QUIET_RFKILL(m, fmt, args...) \
442do { \
443 if (!iwl_is_rfkill((m)->shrd)) \
444 IWL_ERR(m, fmt, ##args); \
445 else \
446 __iwl_err(trans(m)->dev, true, true, fmt, ##args); \
447} while (0)
448#endif /* CONFIG_IWLWIFI_DEBUG */
449
386#endif /* __iwl_agn_h__ */ 450#endif /* __iwl_agn_h__ */
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h
index 163d259198be..a6b32a11e103 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debug.h
+++ b/drivers/net/wireless/iwlwifi/iwl-debug.h
@@ -76,24 +76,8 @@ do { \
76 print_hex_dump(KERN_DEBUG, "iwl data: ", \ 76 print_hex_dump(KERN_DEBUG, "iwl data: ", \
77 DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \ 77 DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \
78} while (0) 78} while (0)
79#define IWL_DEBUG_QUIET_RFKILL(m, fmt, args...) \
80do { \
81 if (!iwl_is_rfkill((m)->shrd)) \
82 IWL_ERR(m, fmt, ##args); \
83 else \
84 __iwl_err(trans(m)->dev, true, \
85 !iwl_have_debug_level(IWL_DL_RADIO), \
86 fmt, ##args); \
87} while (0)
88#else 79#else
89#define iwl_print_hex_dump(m, level, p, len) 80#define iwl_print_hex_dump(m, level, p, len)
90#define IWL_DEBUG_QUIET_RFKILL(m, fmt, args...) \
91do { \
92 if (!iwl_is_rfkill((m)->shrd)) \
93 IWL_ERR(m, fmt, ##args); \
94 else \
95 __iwl_err(trans(m)->dev, true, true, fmt, ##args); \
96} while (0)
97#endif /* CONFIG_IWLWIFI_DEBUG */ 81#endif /* CONFIG_IWLWIFI_DEBUG */
98 82
99#ifdef CONFIG_IWLWIFI_DEBUGFS 83#ifdef CONFIG_IWLWIFI_DEBUGFS
diff --git a/drivers/net/wireless/iwlwifi/iwl-shared.h b/drivers/net/wireless/iwlwifi/iwl-shared.h
index a5ab58ce0307..5e12b504aacf 100644
--- a/drivers/net/wireless/iwlwifi/iwl-shared.h
+++ b/drivers/net/wireless/iwlwifi/iwl-shared.h
@@ -508,46 +508,4 @@ iwl_remove_notification(struct iwl_shared *shrd,
508#define STATUS_CHANNEL_SWITCH_PENDING 19 508#define STATUS_CHANNEL_SWITCH_PENDING 19
509#define STATUS_SCAN_COMPLETE 20 509#define STATUS_SCAN_COMPLETE 20
510 510
511static inline int iwl_is_ready(struct iwl_shared *shrd)
512{
513 /* The adapter is 'ready' if READY and GEO_CONFIGURED bits are
514 * set but EXIT_PENDING is not */
515 return test_bit(STATUS_READY, &shrd->status) &&
516 test_bit(STATUS_GEO_CONFIGURED, &shrd->status) &&
517 !test_bit(STATUS_EXIT_PENDING, &shrd->status);
518}
519
520static inline int iwl_is_alive(struct iwl_shared *shrd)
521{
522 return test_bit(STATUS_ALIVE, &shrd->status);
523}
524
525static inline int iwl_is_init(struct iwl_shared *shrd)
526{
527 return test_bit(STATUS_INIT, &shrd->status);
528}
529
530static inline int iwl_is_rfkill_hw(struct iwl_shared *shrd)
531{
532 return test_bit(STATUS_RF_KILL_HW, &shrd->status);
533}
534
535static inline int iwl_is_rfkill(struct iwl_shared *shrd)
536{
537 return iwl_is_rfkill_hw(shrd);
538}
539
540static inline int iwl_is_ctkill(struct iwl_shared *shrd)
541{
542 return test_bit(STATUS_CT_KILL, &shrd->status);
543}
544
545static inline int iwl_is_ready_rf(struct iwl_shared *shrd)
546{
547 if (iwl_is_rfkill(shrd))
548 return 0;
549
550 return iwl_is_ready(shrd);
551}
552
553#endif /* #__iwl_shared_h__ */ 511#endif /* #__iwl_shared_h__ */