diff options
author | Reinette Chatre <reinette.chatre@intel.com> | 2009-08-07 18:41:37 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-14 09:13:46 -0400 |
commit | 3d816c77ecb05d3a3e974a205e53392e5353553e (patch) | |
tree | d86eb434ea830d5ec43ee0a6d6aa1251fbcd67a5 /drivers/net/wireless/iwlwifi/iwl-dev.h | |
parent | 34b921cf6fb4014e0e8d414492959a4725049000 (diff) |
iwlwifi: re-introduce per device debugging
Commit "iwlwifi: make debug level more user friendly" cleaned up the
debug level handling. In doing so it created a single global debug
level for all devices. Some setups do consits of more that one iwlwifi
device and in these setups there is a requirement that debug levels
should be unique per device.
We now re-introduce the per device debugging while maintaining the
cleanup effort of the previous patch.
The maintain the global debug level and now introduce a per-device debug
level that will be used if it (the per-device debug level) is set. The
per-device debug level can be controlled via the debug_level sysfs file
while the global debug level is controlled by the debug module parameter.
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-dev.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index cab6255210d5..1bf3e4ccc5d9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -1175,6 +1175,8 @@ struct iwl_priv { | |||
1175 | 1175 | ||
1176 | #ifdef CONFIG_IWLWIFI_DEBUG | 1176 | #ifdef CONFIG_IWLWIFI_DEBUG |
1177 | /* debugging info */ | 1177 | /* debugging info */ |
1178 | u32 debug_level; /* per device debugging will override global | ||
1179 | iwl_debug_level if set */ | ||
1178 | u32 framecnt_to_us; | 1180 | u32 framecnt_to_us; |
1179 | atomic_t restrict_refcnt; | 1181 | atomic_t restrict_refcnt; |
1180 | bool disable_ht40; | 1182 | bool disable_ht40; |
@@ -1211,8 +1213,27 @@ static inline void iwl_txq_ctx_deactivate(struct iwl_priv *priv, int txq_id) | |||
1211 | 1213 | ||
1212 | #ifdef CONFIG_IWLWIFI_DEBUG | 1214 | #ifdef CONFIG_IWLWIFI_DEBUG |
1213 | const char *iwl_get_tx_fail_reason(u32 status); | 1215 | const char *iwl_get_tx_fail_reason(u32 status); |
1216 | /* | ||
1217 | * iwl_get_debug_level: Return active debug level for device | ||
1218 | * | ||
1219 | * Using sysfs it is possible to set per device debug level. This debug | ||
1220 | * level will be used if set, otherwise the global debug level which can be | ||
1221 | * set via module parameter is used. | ||
1222 | */ | ||
1223 | static inline u32 iwl_get_debug_level(struct iwl_priv *priv) | ||
1224 | { | ||
1225 | if (priv->debug_level) | ||
1226 | return priv->debug_level; | ||
1227 | else | ||
1228 | return iwl_debug_level; | ||
1229 | } | ||
1214 | #else | 1230 | #else |
1215 | static inline const char *iwl_get_tx_fail_reason(u32 status) { return ""; } | 1231 | static inline const char *iwl_get_tx_fail_reason(u32 status) { return ""; } |
1232 | |||
1233 | static inline u32 iwl_get_debug_level(struct iwl_priv *priv) | ||
1234 | { | ||
1235 | return iwl_debug_level; | ||
1236 | } | ||
1216 | #endif | 1237 | #endif |
1217 | 1238 | ||
1218 | 1239 | ||