diff options
author | Wu Fengguang <fengguang.wu@intel.com> | 2008-12-18 21:37:23 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 15:59:07 -0500 |
commit | d2bf55839ad77486a02ec32f8411f432621da110 (patch) | |
tree | 3364dd0ca38a3cb80aefa535db0a52cbb043eec3 | |
parent | b5323d36637909481318e7dfcba9f3e3b9368881 (diff) |
iwlwifi: beautify code
This patch beautifies macros in iwl-debug.h.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debug.h | 167 |
1 files changed, 85 insertions, 82 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h index 9c209d635d5a..0617965c968c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debug.h +++ b/drivers/net/wireless/iwlwifi/iwl-debug.h | |||
@@ -32,15 +32,19 @@ | |||
32 | struct iwl_priv; | 32 | struct iwl_priv; |
33 | 33 | ||
34 | #ifdef CONFIG_IWLWIFI_DEBUG | 34 | #ifdef CONFIG_IWLWIFI_DEBUG |
35 | #define IWL_DEBUG(level, fmt, args...) \ | 35 | #define IWL_DEBUG(level, fmt, args...) \ |
36 | do { if (priv->debug_level & (level)) \ | 36 | do { \ |
37 | dev_printk(KERN_ERR, &(priv->hw->wiphy->dev), "%c %s " fmt, \ | 37 | if (priv->debug_level & (level)) \ |
38 | in_interrupt() ? 'I' : 'U', __func__ , ## args); } while (0) | 38 | dev_printk(KERN_ERR, &(priv->hw->wiphy->dev), "%c %s " fmt, \ |
39 | in_interrupt() ? 'I' : 'U', __func__ , ## args); \ | ||
40 | } while (0) | ||
39 | 41 | ||
40 | #define IWL_DEBUG_LIMIT(level, fmt, args...) \ | 42 | #define IWL_DEBUG_LIMIT(level, fmt, args...) \ |
41 | do { if ((priv->debug_level & (level)) && net_ratelimit()) \ | 43 | do { \ |
42 | dev_printk(KERN_ERR, &(priv->hw->wiphy->dev), "%c %s " fmt, \ | 44 | if ((priv->debug_level & (level)) && net_ratelimit()) \ |
43 | in_interrupt() ? 'I' : 'U', __func__ , ## args); } while (0) | 45 | dev_printk(KERN_ERR, &(priv->hw->wiphy->dev), "%c %s " fmt, \ |
46 | in_interrupt() ? 'I' : 'U', __func__ , ## args); \ | ||
47 | } while (0) | ||
44 | 48 | ||
45 | #define iwl_print_hex_dump(priv, level, p, len) \ | 49 | #define iwl_print_hex_dump(priv, level, p, len) \ |
46 | do { \ | 50 | do { \ |
@@ -120,86 +124,85 @@ static inline void iwl_dbgfs_unregister(struct iwl_priv *priv) | |||
120 | * when CONFIG_IWLWIFI_DEBUG=y. | 124 | * when CONFIG_IWLWIFI_DEBUG=y. |
121 | */ | 125 | */ |
122 | 126 | ||
127 | /* 0x0000000F - 0x00000001 */ | ||
123 | #define IWL_DL_INFO (1 << 0) | 128 | #define IWL_DL_INFO (1 << 0) |
124 | #define IWL_DL_MAC80211 (1 << 1) | 129 | #define IWL_DL_MAC80211 (1 << 1) |
125 | #define IWL_DL_HCMD (1 << 2) | 130 | #define IWL_DL_HCMD (1 << 2) |
126 | #define IWL_DL_STATE (1 << 3) | 131 | #define IWL_DL_STATE (1 << 3) |
132 | /* 0x000000F0 - 0x00000010 */ | ||
127 | #define IWL_DL_MACDUMP (1 << 4) | 133 | #define IWL_DL_MACDUMP (1 << 4) |
128 | #define IWL_DL_HCMD_DUMP (1 << 5) | 134 | #define IWL_DL_HCMD_DUMP (1 << 5) |
129 | #define IWL_DL_RADIO (1 << 7) | 135 | #define IWL_DL_RADIO (1 << 7) |
130 | #define IWL_DL_POWER (1 << 8) | 136 | |
131 | #define IWL_DL_TEMP (1 << 9) | 137 | #define IWL_DL_POWER (1 << 8) |
132 | 138 | #define IWL_DL_TEMP (1 << 9) | |
133 | #define IWL_DL_NOTIF (1 << 10) | 139 | #define IWL_DL_NOTIF (1 << 10) |
134 | #define IWL_DL_SCAN (1 << 11) | 140 | #define IWL_DL_SCAN (1 << 11) |
135 | #define IWL_DL_ASSOC (1 << 12) | 141 | |
136 | #define IWL_DL_DROP (1 << 13) | 142 | #define IWL_DL_ASSOC (1 << 12) |
137 | 143 | #define IWL_DL_DROP (1 << 13) | |
138 | #define IWL_DL_TXPOWER (1 << 14) | 144 | #define IWL_DL_TXPOWER (1 << 14) |
139 | 145 | #define IWL_DL_AP (1 << 15) | |
140 | #define IWL_DL_AP (1 << 15) | 146 | |
141 | 147 | #define IWL_DL_FW (1 << 16) | |
142 | #define IWL_DL_FW (1 << 16) | 148 | #define IWL_DL_RF_KILL (1 << 17) |
143 | #define IWL_DL_RF_KILL (1 << 17) | 149 | #define IWL_DL_FW_ERRORS (1 << 18) |
144 | #define IWL_DL_FW_ERRORS (1 << 18) | 150 | #define IWL_DL_LED (1 << 19) |
145 | 151 | ||
146 | #define IWL_DL_LED (1 << 19) | 152 | #define IWL_DL_RATE (1 << 20) |
147 | 153 | #define IWL_DL_CALIB (1 << 21) | |
148 | #define IWL_DL_RATE (1 << 20) | 154 | #define IWL_DL_WEP (1 << 22) |
149 | 155 | #define IWL_DL_TX (1 << 23) | |
150 | #define IWL_DL_CALIB (1 << 21) | 156 | #define IWL_DL_RX (1 << 24) |
151 | #define IWL_DL_WEP (1 << 22) | 157 | #define IWL_DL_ISR (1 << 25) |
152 | #define IWL_DL_TX (1 << 23) | 158 | #define IWL_DL_HT (1 << 26) |
153 | #define IWL_DL_RX (1 << 24) | 159 | #define IWL_DL_IO (1 << 27) |
154 | #define IWL_DL_ISR (1 << 25) | 160 | #define IWL_DL_11H (1 << 28) |
155 | #define IWL_DL_HT (1 << 26) | 161 | #define IWL_DL_STATS (1 << 29) |
156 | #define IWL_DL_IO (1 << 27) | 162 | #define IWL_DL_TX_REPLY (1 << 30) |
157 | #define IWL_DL_11H (1 << 28) | 163 | #define IWL_DL_QOS (1 << 31) |
158 | 164 | ||
159 | #define IWL_DL_STATS (1 << 29) | 165 | #define IWL_ERROR(f, a...) \ |
160 | #define IWL_DL_TX_REPLY (1 << 30) | 166 | dev_printk(KERN_ERR, &(priv->hw->wiphy->dev), f, ## a) |
161 | #define IWL_DL_QOS (1 << 31) | 167 | #define IWL_WARNING(f, a...) \ |
162 | 168 | dev_printk(KERN_WARNING, &(priv->hw->wiphy->dev), f, ## a) | |
163 | #define IWL_ERROR(f, a...) dev_printk(KERN_ERR, \ | 169 | |
164 | &(priv->hw->wiphy->dev), f, ## a) | 170 | #define IWL_DEBUG_INFO(f, a...) IWL_DEBUG(IWL_DL_INFO, f, ## a) |
165 | #define IWL_WARNING(f, a...) dev_printk(KERN_WARNING, \ | 171 | #define IWL_DEBUG_MAC80211(f, a...) IWL_DEBUG(IWL_DL_MAC80211, f, ## a) |
166 | &(priv->hw->wiphy->dev), f, ## a) | 172 | #define IWL_DEBUG_MACDUMP(f, a...) IWL_DEBUG(IWL_DL_MACDUMP, f, ## a) |
167 | #define IWL_DEBUG_INFO(f, a...) IWL_DEBUG(IWL_DL_INFO, f, ## a) | 173 | #define IWL_DEBUG_TEMP(f, a...) IWL_DEBUG(IWL_DL_TEMP, f, ## a) |
168 | 174 | #define IWL_DEBUG_SCAN(f, a...) IWL_DEBUG(IWL_DL_SCAN, f, ## a) | |
169 | #define IWL_DEBUG_MAC80211(f, a...) IWL_DEBUG(IWL_DL_MAC80211, f, ## a) | 175 | #define IWL_DEBUG_RX(f, a...) IWL_DEBUG(IWL_DL_RX, f, ## a) |
170 | #define IWL_DEBUG_MACDUMP(f, a...) IWL_DEBUG(IWL_DL_MACDUMP, f, ## a) | 176 | #define IWL_DEBUG_TX(f, a...) IWL_DEBUG(IWL_DL_TX, f, ## a) |
171 | #define IWL_DEBUG_TEMP(f, a...) IWL_DEBUG(IWL_DL_TEMP, f, ## a) | 177 | #define IWL_DEBUG_ISR(f, a...) IWL_DEBUG(IWL_DL_ISR, f, ## a) |
172 | #define IWL_DEBUG_SCAN(f, a...) IWL_DEBUG(IWL_DL_SCAN, f, ## a) | 178 | #define IWL_DEBUG_LED(f, a...) IWL_DEBUG(IWL_DL_LED, f, ## a) |
173 | #define IWL_DEBUG_RX(f, a...) IWL_DEBUG(IWL_DL_RX, f, ## a) | 179 | #define IWL_DEBUG_WEP(f, a...) IWL_DEBUG(IWL_DL_WEP, f, ## a) |
174 | #define IWL_DEBUG_TX(f, a...) IWL_DEBUG(IWL_DL_TX, f, ## a) | 180 | #define IWL_DEBUG_HC(f, a...) IWL_DEBUG(IWL_DL_HCMD, f, ## a) |
175 | #define IWL_DEBUG_ISR(f, a...) IWL_DEBUG(IWL_DL_ISR, f, ## a) | 181 | #define IWL_DEBUG_HC_DUMP(f, a...) IWL_DEBUG(IWL_DL_HCMD_DUMP, f, ## a) |
176 | #define IWL_DEBUG_LED(f, a...) IWL_DEBUG(IWL_DL_LED, f, ## a) | 182 | #define IWL_DEBUG_CALIB(f, a...) IWL_DEBUG(IWL_DL_CALIB, f, ## a) |
177 | #define IWL_DEBUG_WEP(f, a...) IWL_DEBUG(IWL_DL_WEP, f, ## a) | 183 | #define IWL_DEBUG_FW(f, a...) IWL_DEBUG(IWL_DL_FW, f, ## a) |
178 | #define IWL_DEBUG_HC(f, a...) IWL_DEBUG(IWL_DL_HCMD, f, ## a) | 184 | #define IWL_DEBUG_RF_KILL(f, a...) IWL_DEBUG(IWL_DL_RF_KILL, f, ## a) |
179 | #define IWL_DEBUG_HC_DUMP(f, a...) IWL_DEBUG(IWL_DL_HCMD_DUMP, f, ## a) | 185 | #define IWL_DEBUG_DROP(f, a...) IWL_DEBUG(IWL_DL_DROP, f, ## a) |
180 | #define IWL_DEBUG_CALIB(f, a...) IWL_DEBUG(IWL_DL_CALIB, f, ## a) | 186 | #define IWL_DEBUG_DROP_LIMIT(f, a...) IWL_DEBUG_LIMIT(IWL_DL_DROP, f, ## a) |
181 | #define IWL_DEBUG_FW(f, a...) IWL_DEBUG(IWL_DL_FW, f, ## a) | 187 | #define IWL_DEBUG_AP(f, a...) IWL_DEBUG(IWL_DL_AP, f, ## a) |
182 | #define IWL_DEBUG_RF_KILL(f, a...) IWL_DEBUG(IWL_DL_RF_KILL, f, ## a) | 188 | #define IWL_DEBUG_TXPOWER(f, a...) IWL_DEBUG(IWL_DL_TXPOWER, f, ## a) |
183 | #define IWL_DEBUG_DROP(f, a...) IWL_DEBUG(IWL_DL_DROP, f, ## a) | 189 | #define IWL_DEBUG_IO(f, a...) IWL_DEBUG(IWL_DL_IO, f, ## a) |
184 | #define IWL_DEBUG_DROP_LIMIT(f, a...) IWL_DEBUG_LIMIT(IWL_DL_DROP, f, ## a) | 190 | #define IWL_DEBUG_RATE(f, a...) IWL_DEBUG(IWL_DL_RATE, f, ## a) |
185 | #define IWL_DEBUG_AP(f, a...) IWL_DEBUG(IWL_DL_AP, f, ## a) | 191 | #define IWL_DEBUG_RATE_LIMIT(f, a...) IWL_DEBUG_LIMIT(IWL_DL_RATE, f, ## a) |
186 | #define IWL_DEBUG_TXPOWER(f, a...) IWL_DEBUG(IWL_DL_TXPOWER, f, ## a) | 192 | #define IWL_DEBUG_NOTIF(f, a...) IWL_DEBUG(IWL_DL_NOTIF, f, ## a) |
187 | #define IWL_DEBUG_IO(f, a...) IWL_DEBUG(IWL_DL_IO, f, ## a) | 193 | #define IWL_DEBUG_ASSOC(f, a...) \ |
188 | #define IWL_DEBUG_RATE(f, a...) IWL_DEBUG(IWL_DL_RATE, f, ## a) | 194 | IWL_DEBUG(IWL_DL_ASSOC | IWL_DL_INFO, f, ## a) |
189 | #define IWL_DEBUG_RATE_LIMIT(f, a...) IWL_DEBUG_LIMIT(IWL_DL_RATE, f, ## a) | 195 | #define IWL_DEBUG_ASSOC_LIMIT(f, a...) \ |
190 | #define IWL_DEBUG_NOTIF(f, a...) IWL_DEBUG(IWL_DL_NOTIF, f, ## a) | 196 | IWL_DEBUG_LIMIT(IWL_DL_ASSOC | IWL_DL_INFO, f, ## a) |
191 | #define IWL_DEBUG_ASSOC(f, a...) IWL_DEBUG(IWL_DL_ASSOC | IWL_DL_INFO, f, ## a) | 197 | #define IWL_DEBUG_HT(f, a...) IWL_DEBUG(IWL_DL_HT, f, ## a) |
192 | #define IWL_DEBUG_ASSOC_LIMIT(f, a...) \ | 198 | #define IWL_DEBUG_STATS(f, a...) IWL_DEBUG(IWL_DL_STATS, f, ## a) |
193 | IWL_DEBUG_LIMIT(IWL_DL_ASSOC | IWL_DL_INFO, f, ## a) | 199 | #define IWL_DEBUG_STATS_LIMIT(f, a...) IWL_DEBUG_LIMIT(IWL_DL_STATS, f, ## a) |
194 | #define IWL_DEBUG_HT(f, a...) IWL_DEBUG(IWL_DL_HT, f, ## a) | 200 | #define IWL_DEBUG_TX_REPLY(f, a...) IWL_DEBUG(IWL_DL_TX_REPLY, f, ## a) |
195 | #define IWL_DEBUG_STATS(f, a...) IWL_DEBUG(IWL_DL_STATS, f, ## a) | ||
196 | #define IWL_DEBUG_STATS_LIMIT(f, a...) IWL_DEBUG_LIMIT(IWL_DL_STATS, f, ## a) | ||
197 | #define IWL_DEBUG_TX_REPLY(f, a...) IWL_DEBUG(IWL_DL_TX_REPLY, f, ## a) | ||
198 | #define IWL_DEBUG_TX_REPLY_LIMIT(f, a...) \ | 201 | #define IWL_DEBUG_TX_REPLY_LIMIT(f, a...) \ |
199 | IWL_DEBUG_LIMIT(IWL_DL_TX_REPLY, f, ## a) | 202 | IWL_DEBUG_LIMIT(IWL_DL_TX_REPLY, f, ## a) |
200 | #define IWL_DEBUG_QOS(f, a...) IWL_DEBUG(IWL_DL_QOS, f, ## a) | 203 | #define IWL_DEBUG_QOS(f, a...) IWL_DEBUG(IWL_DL_QOS, f, ## a) |
201 | #define IWL_DEBUG_RADIO(f, a...) IWL_DEBUG(IWL_DL_RADIO, f, ## a) | 204 | #define IWL_DEBUG_RADIO(f, a...) IWL_DEBUG(IWL_DL_RADIO, f, ## a) |
202 | #define IWL_DEBUG_POWER(f, a...) IWL_DEBUG(IWL_DL_POWER, f, ## a) | 205 | #define IWL_DEBUG_POWER(f, a...) IWL_DEBUG(IWL_DL_POWER, f, ## a) |
203 | #define IWL_DEBUG_11H(f, a...) IWL_DEBUG(IWL_DL_11H, f, ## a) | 206 | #define IWL_DEBUG_11H(f, a...) IWL_DEBUG(IWL_DL_11H, f, ## a) |
204 | 207 | ||
205 | #endif | 208 | #endif |