diff options
author | Zhu Yi <yi.zhu@intel.com> | 2006-08-20 23:36:53 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-08-29 17:06:31 -0400 |
commit | 01d478338ff3eff3bade043495f0fc9e57568876 (patch) | |
tree | ec7317a247a3758fdddaddf6877826f71e0425d8 /drivers/net | |
parent | f09fc44d8c25f22c4d985bb93857338ed02feac6 (diff) |
[PATCH] ipw2200: always enable frequently used debugging code
Moving part of the debugging code from IPW_DEBUG to IPW_LL_DEBUG (low level
debugging) and make IPW_DEBUG be always enabled. IPW_LL_DEBUG still needs
to be enabled by selecting CONFIG_IPW2200_DEBUG. But it is highly
deprecated for normal users since it adds higher debug verbosity in driver
hot paths.
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/Kconfig | 23 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2200.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2200.h | 40 |
3 files changed, 28 insertions, 53 deletions
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig index 2e8ac995d56f..bd4a68c85a47 100644 --- a/drivers/net/wireless/Kconfig +++ b/drivers/net/wireless/Kconfig | |||
@@ -271,25 +271,14 @@ config IPW2200_DEBUG | |||
271 | bool "Enable full debugging output in IPW2200 module." | 271 | bool "Enable full debugging output in IPW2200 module." |
272 | depends on IPW2200 | 272 | depends on IPW2200 |
273 | ---help--- | 273 | ---help--- |
274 | This option will enable debug tracing output for the IPW2200. | 274 | This option will enable low level debug tracing output for IPW2200. |
275 | 275 | ||
276 | This will result in the kernel module being ~100k larger. You can | 276 | Note, normal debug code is already compiled in. This low level |
277 | control which debug output is sent to the kernel log by setting the | 277 | debug option enables debug on hot paths (e.g Tx, Rx, ISR) and |
278 | value in | 278 | will result in the kernel module being ~70 larger. Most users |
279 | 279 | will typically not need this high verbosity debug information. | |
280 | /sys/bus/pci/drivers/ipw2200/debug_level | ||
281 | |||
282 | This entry will only exist if this option is enabled. | ||
283 | 280 | ||
284 | To set a value, simply echo an 8-byte hex value to the same file: | 281 | If you are not sure, say N here. |
285 | |||
286 | % echo 0x00000FFO > /sys/bus/pci/drivers/ipw2200/debug_level | ||
287 | |||
288 | You can find the list of debug mask values in | ||
289 | drivers/net/wireless/ipw2200.h | ||
290 | |||
291 | If you are not trying to debug or develop the IPW2200 driver, you | ||
292 | most likely want to say N here. | ||
293 | 282 | ||
294 | config AIRO | 283 | config AIRO |
295 | tristate "Cisco/Aironet 34X/35X/4500/4800 ISA and PCI cards" | 284 | tristate "Cisco/Aironet 34X/35X/4500/4800 ISA and PCI cards" |
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index 758459e72f3d..89e076fa1039 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c | |||
@@ -567,7 +567,6 @@ static inline void ipw_disable_interrupts(struct ipw_priv *priv) | |||
567 | spin_unlock_irqrestore(&priv->irq_lock, flags); | 567 | spin_unlock_irqrestore(&priv->irq_lock, flags); |
568 | } | 568 | } |
569 | 569 | ||
570 | #ifdef CONFIG_IPW2200_DEBUG | ||
571 | static char *ipw_error_desc(u32 val) | 570 | static char *ipw_error_desc(u32 val) |
572 | { | 571 | { |
573 | switch (val) { | 572 | switch (val) { |
@@ -634,7 +633,6 @@ static void ipw_dump_error_log(struct ipw_priv *priv, | |||
634 | error->log[i].time, | 633 | error->log[i].time, |
635 | error->log[i].data, error->log[i].event); | 634 | error->log[i].data, error->log[i].event); |
636 | } | 635 | } |
637 | #endif | ||
638 | 636 | ||
639 | static inline int ipw_is_init(struct ipw_priv *priv) | 637 | static inline int ipw_is_init(struct ipw_priv *priv) |
640 | { | 638 | { |
@@ -1435,9 +1433,7 @@ static ssize_t store_scan_age(struct device *d, struct device_attribute *attr, | |||
1435 | const char *buf, size_t count) | 1433 | const char *buf, size_t count) |
1436 | { | 1434 | { |
1437 | struct ipw_priv *priv = dev_get_drvdata(d); | 1435 | struct ipw_priv *priv = dev_get_drvdata(d); |
1438 | #ifdef CONFIG_IPW2200_DEBUG | ||
1439 | struct net_device *dev = priv->net_dev; | 1436 | struct net_device *dev = priv->net_dev; |
1440 | #endif | ||
1441 | char buffer[] = "00000000"; | 1437 | char buffer[] = "00000000"; |
1442 | unsigned long len = | 1438 | unsigned long len = |
1443 | (sizeof(buffer) - 1) > count ? count : sizeof(buffer) - 1; | 1439 | (sizeof(buffer) - 1) > count ? count : sizeof(buffer) - 1; |
@@ -1958,14 +1954,12 @@ static void ipw_irq_tasklet(struct ipw_priv *priv) | |||
1958 | IPW_WARNING("Firmware error detected. Restarting.\n"); | 1954 | IPW_WARNING("Firmware error detected. Restarting.\n"); |
1959 | if (priv->error) { | 1955 | if (priv->error) { |
1960 | IPW_DEBUG_FW("Sysfs 'error' log already exists.\n"); | 1956 | IPW_DEBUG_FW("Sysfs 'error' log already exists.\n"); |
1961 | #ifdef CONFIG_IPW2200_DEBUG | ||
1962 | if (ipw_debug_level & IPW_DL_FW_ERRORS) { | 1957 | if (ipw_debug_level & IPW_DL_FW_ERRORS) { |
1963 | struct ipw_fw_error *error = | 1958 | struct ipw_fw_error *error = |
1964 | ipw_alloc_error_log(priv); | 1959 | ipw_alloc_error_log(priv); |
1965 | ipw_dump_error_log(priv, error); | 1960 | ipw_dump_error_log(priv, error); |
1966 | kfree(error); | 1961 | kfree(error); |
1967 | } | 1962 | } |
1968 | #endif | ||
1969 | } else { | 1963 | } else { |
1970 | priv->error = ipw_alloc_error_log(priv); | 1964 | priv->error = ipw_alloc_error_log(priv); |
1971 | if (priv->error) | 1965 | if (priv->error) |
@@ -1973,10 +1967,8 @@ static void ipw_irq_tasklet(struct ipw_priv *priv) | |||
1973 | else | 1967 | else |
1974 | IPW_DEBUG_FW("Error allocating sysfs 'error' " | 1968 | IPW_DEBUG_FW("Error allocating sysfs 'error' " |
1975 | "log.\n"); | 1969 | "log.\n"); |
1976 | #ifdef CONFIG_IPW2200_DEBUG | ||
1977 | if (ipw_debug_level & IPW_DL_FW_ERRORS) | 1970 | if (ipw_debug_level & IPW_DL_FW_ERRORS) |
1978 | ipw_dump_error_log(priv, priv->error); | 1971 | ipw_dump_error_log(priv, priv->error); |
1979 | #endif | ||
1980 | } | 1972 | } |
1981 | 1973 | ||
1982 | /* XXX: If hardware encryption is for WPA/WPA2, | 1974 | /* XXX: If hardware encryption is for WPA/WPA2, |
@@ -3915,7 +3907,6 @@ static const struct ipw_status_code ipw_status_codes[] = { | |||
3915 | {0x2E, "Cipher suite is rejected per security policy"}, | 3907 | {0x2E, "Cipher suite is rejected per security policy"}, |
3916 | }; | 3908 | }; |
3917 | 3909 | ||
3918 | #ifdef CONFIG_IPW2200_DEBUG | ||
3919 | static const char *ipw_get_status_code(u16 status) | 3910 | static const char *ipw_get_status_code(u16 status) |
3920 | { | 3911 | { |
3921 | int i; | 3912 | int i; |
@@ -3924,7 +3915,6 @@ static const char *ipw_get_status_code(u16 status) | |||
3924 | return ipw_status_codes[i].reason; | 3915 | return ipw_status_codes[i].reason; |
3925 | return "Unknown status value."; | 3916 | return "Unknown status value."; |
3926 | } | 3917 | } |
3927 | #endif | ||
3928 | 3918 | ||
3929 | static void inline average_init(struct average *avg) | 3919 | static void inline average_init(struct average *avg) |
3930 | { | 3920 | { |
@@ -4394,7 +4384,6 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4394 | if (priv-> | 4384 | if (priv-> |
4395 | status & (STATUS_ASSOCIATED | | 4385 | status & (STATUS_ASSOCIATED | |
4396 | STATUS_AUTH)) { | 4386 | STATUS_AUTH)) { |
4397 | #ifdef CONFIG_IPW2200_DEBUG | ||
4398 | struct notif_authenticate *auth | 4387 | struct notif_authenticate *auth |
4399 | = ¬if->u.auth; | 4388 | = ¬if->u.auth; |
4400 | IPW_DEBUG(IPW_DL_NOTIF | | 4389 | IPW_DEBUG(IPW_DL_NOTIF | |
@@ -4412,7 +4401,6 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4412 | ipw_get_status_code | 4401 | ipw_get_status_code |
4413 | (ntohs | 4402 | (ntohs |
4414 | (auth->status))); | 4403 | (auth->status))); |
4415 | #endif | ||
4416 | 4404 | ||
4417 | priv->status &= | 4405 | priv->status &= |
4418 | ~(STATUS_ASSOCIATING | | 4406 | ~(STATUS_ASSOCIATING | |
@@ -5969,7 +5957,6 @@ static void ipw_bg_adhoc_check(void *data) | |||
5969 | mutex_unlock(&priv->mutex); | 5957 | mutex_unlock(&priv->mutex); |
5970 | } | 5958 | } |
5971 | 5959 | ||
5972 | #ifdef CONFIG_IPW2200_DEBUG | ||
5973 | static void ipw_debug_config(struct ipw_priv *priv) | 5960 | static void ipw_debug_config(struct ipw_priv *priv) |
5974 | { | 5961 | { |
5975 | IPW_DEBUG_INFO("Scan completed, no valid APs matched " | 5962 | IPW_DEBUG_INFO("Scan completed, no valid APs matched " |
@@ -5994,9 +5981,6 @@ static void ipw_debug_config(struct ipw_priv *priv) | |||
5994 | IPW_DEBUG_INFO("PRIVACY off\n"); | 5981 | IPW_DEBUG_INFO("PRIVACY off\n"); |
5995 | IPW_DEBUG_INFO("RATE MASK: 0x%08X\n", priv->rates_mask); | 5982 | IPW_DEBUG_INFO("RATE MASK: 0x%08X\n", priv->rates_mask); |
5996 | } | 5983 | } |
5997 | #else | ||
5998 | #define ipw_debug_config(x) do {} while (0) | ||
5999 | #endif | ||
6000 | 5984 | ||
6001 | static void ipw_set_fixed_rate(struct ipw_priv *priv, int mode) | 5985 | static void ipw_set_fixed_rate(struct ipw_priv *priv, int mode) |
6002 | { | 5986 | { |
@@ -11467,9 +11451,7 @@ static int ipw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
11467 | 11451 | ||
11468 | priv->net_dev = net_dev; | 11452 | priv->net_dev = net_dev; |
11469 | priv->pci_dev = pdev; | 11453 | priv->pci_dev = pdev; |
11470 | #ifdef CONFIG_IPW2200_DEBUG | ||
11471 | ipw_debug_level = debug; | 11454 | ipw_debug_level = debug; |
11472 | #endif | ||
11473 | spin_lock_init(&priv->irq_lock); | 11455 | spin_lock_init(&priv->irq_lock); |
11474 | spin_lock_init(&priv->lock); | 11456 | spin_lock_init(&priv->lock); |
11475 | for (i = 0; i < IPW_IBSS_MAC_HASH_SIZE; i++) | 11457 | for (i = 0; i < IPW_IBSS_MAC_HASH_SIZE; i++) |
diff --git a/drivers/net/wireless/ipw2200.h b/drivers/net/wireless/ipw2200.h index 8b1cd7c749a4..b49f7668644e 100644 --- a/drivers/net/wireless/ipw2200.h +++ b/drivers/net/wireless/ipw2200.h | |||
@@ -1381,13 +1381,18 @@ BITC(x,19),BITC(x,18),BITC(x,17),BITC(x,16),\ | |||
1381 | BIT_ARG16(x) | 1381 | BIT_ARG16(x) |
1382 | 1382 | ||
1383 | 1383 | ||
1384 | #ifdef CONFIG_IPW2200_DEBUG | ||
1385 | #define IPW_DEBUG(level, fmt, args...) \ | 1384 | #define IPW_DEBUG(level, fmt, args...) \ |
1386 | do { if (ipw_debug_level & (level)) \ | 1385 | do { if (ipw_debug_level & (level)) \ |
1387 | printk(KERN_DEBUG DRV_NAME": %c %s " fmt, \ | 1386 | printk(KERN_DEBUG DRV_NAME": %c %s " fmt, \ |
1388 | in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) | 1387 | in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) |
1388 | |||
1389 | #ifdef CONFIG_IPW2200_DEBUG | ||
1390 | #define IPW_LL_DEBUG(level, fmt, args...) \ | ||
1391 | do { if (ipw_debug_level & (level)) \ | ||
1392 | printk(KERN_DEBUG DRV_NAME": %c %s " fmt, \ | ||
1393 | in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) | ||
1389 | #else | 1394 | #else |
1390 | #define IPW_DEBUG(level, fmt, args...) do {} while (0) | 1395 | #define IPW_LL_DEBUG(level, fmt, args...) do {} while (0) |
1391 | #endif /* CONFIG_IPW2200_DEBUG */ | 1396 | #endif /* CONFIG_IPW2200_DEBUG */ |
1392 | 1397 | ||
1393 | /* | 1398 | /* |
@@ -1457,28 +1462,27 @@ do { if (ipw_debug_level & (level)) \ | |||
1457 | 1462 | ||
1458 | #define IPW_DEBUG_WX(f, a...) IPW_DEBUG(IPW_DL_WX, f, ## a) | 1463 | #define IPW_DEBUG_WX(f, a...) IPW_DEBUG(IPW_DL_WX, f, ## a) |
1459 | #define IPW_DEBUG_SCAN(f, a...) IPW_DEBUG(IPW_DL_SCAN, f, ## a) | 1464 | #define IPW_DEBUG_SCAN(f, a...) IPW_DEBUG(IPW_DL_SCAN, f, ## a) |
1460 | #define IPW_DEBUG_STATUS(f, a...) IPW_DEBUG(IPW_DL_STATUS, f, ## a) | 1465 | #define IPW_DEBUG_TRACE(f, a...) IPW_LL_DEBUG(IPW_DL_TRACE, f, ## a) |
1461 | #define IPW_DEBUG_TRACE(f, a...) IPW_DEBUG(IPW_DL_TRACE, f, ## a) | 1466 | #define IPW_DEBUG_RX(f, a...) IPW_LL_DEBUG(IPW_DL_RX, f, ## a) |
1462 | #define IPW_DEBUG_RX(f, a...) IPW_DEBUG(IPW_DL_RX, f, ## a) | 1467 | #define IPW_DEBUG_TX(f, a...) IPW_LL_DEBUG(IPW_DL_TX, f, ## a) |
1463 | #define IPW_DEBUG_TX(f, a...) IPW_DEBUG(IPW_DL_TX, f, ## a) | 1468 | #define IPW_DEBUG_ISR(f, a...) IPW_LL_DEBUG(IPW_DL_ISR, f, ## a) |
1464 | #define IPW_DEBUG_ISR(f, a...) IPW_DEBUG(IPW_DL_ISR, f, ## a) | ||
1465 | #define IPW_DEBUG_MANAGEMENT(f, a...) IPW_DEBUG(IPW_DL_MANAGE, f, ## a) | 1469 | #define IPW_DEBUG_MANAGEMENT(f, a...) IPW_DEBUG(IPW_DL_MANAGE, f, ## a) |
1466 | #define IPW_DEBUG_LED(f, a...) IPW_DEBUG(IPW_DL_LED, f, ## a) | 1470 | #define IPW_DEBUG_LED(f, a...) IPW_LL_DEBUG(IPW_DL_LED, f, ## a) |
1467 | #define IPW_DEBUG_WEP(f, a...) IPW_DEBUG(IPW_DL_WEP, f, ## a) | 1471 | #define IPW_DEBUG_WEP(f, a...) IPW_LL_DEBUG(IPW_DL_WEP, f, ## a) |
1468 | #define IPW_DEBUG_HC(f, a...) IPW_DEBUG(IPW_DL_HOST_COMMAND, f, ## a) | 1472 | #define IPW_DEBUG_HC(f, a...) IPW_LL_DEBUG(IPW_DL_HOST_COMMAND, f, ## a) |
1469 | #define IPW_DEBUG_FRAG(f, a...) IPW_DEBUG(IPW_DL_FRAG, f, ## a) | 1473 | #define IPW_DEBUG_FRAG(f, a...) IPW_LL_DEBUG(IPW_DL_FRAG, f, ## a) |
1470 | #define IPW_DEBUG_FW(f, a...) IPW_DEBUG(IPW_DL_FW, f, ## a) | 1474 | #define IPW_DEBUG_FW(f, a...) IPW_LL_DEBUG(IPW_DL_FW, f, ## a) |
1471 | #define IPW_DEBUG_RF_KILL(f, a...) IPW_DEBUG(IPW_DL_RF_KILL, f, ## a) | 1475 | #define IPW_DEBUG_RF_KILL(f, a...) IPW_DEBUG(IPW_DL_RF_KILL, f, ## a) |
1472 | #define IPW_DEBUG_DROP(f, a...) IPW_DEBUG(IPW_DL_DROP, f, ## a) | 1476 | #define IPW_DEBUG_DROP(f, a...) IPW_DEBUG(IPW_DL_DROP, f, ## a) |
1473 | #define IPW_DEBUG_IO(f, a...) IPW_DEBUG(IPW_DL_IO, f, ## a) | 1477 | #define IPW_DEBUG_IO(f, a...) IPW_LL_DEBUG(IPW_DL_IO, f, ## a) |
1474 | #define IPW_DEBUG_ORD(f, a...) IPW_DEBUG(IPW_DL_ORD, f, ## a) | 1478 | #define IPW_DEBUG_ORD(f, a...) IPW_LL_DEBUG(IPW_DL_ORD, f, ## a) |
1475 | #define IPW_DEBUG_FW_INFO(f, a...) IPW_DEBUG(IPW_DL_FW_INFO, f, ## a) | 1479 | #define IPW_DEBUG_FW_INFO(f, a...) IPW_LL_DEBUG(IPW_DL_FW_INFO, f, ## a) |
1476 | #define IPW_DEBUG_NOTIF(f, a...) IPW_DEBUG(IPW_DL_NOTIF, f, ## a) | 1480 | #define IPW_DEBUG_NOTIF(f, a...) IPW_DEBUG(IPW_DL_NOTIF, f, ## a) |
1477 | #define IPW_DEBUG_STATE(f, a...) IPW_DEBUG(IPW_DL_STATE | IPW_DL_ASSOC | IPW_DL_INFO, f, ## a) | 1481 | #define IPW_DEBUG_STATE(f, a...) IPW_DEBUG(IPW_DL_STATE | IPW_DL_ASSOC | IPW_DL_INFO, f, ## a) |
1478 | #define IPW_DEBUG_ASSOC(f, a...) IPW_DEBUG(IPW_DL_ASSOC | IPW_DL_INFO, f, ## a) | 1482 | #define IPW_DEBUG_ASSOC(f, a...) IPW_DEBUG(IPW_DL_ASSOC | IPW_DL_INFO, f, ## a) |
1479 | #define IPW_DEBUG_STATS(f, a...) IPW_DEBUG(IPW_DL_STATS, f, ## a) | 1483 | #define IPW_DEBUG_STATS(f, a...) IPW_LL_DEBUG(IPW_DL_STATS, f, ## a) |
1480 | #define IPW_DEBUG_MERGE(f, a...) IPW_DEBUG(IPW_DL_MERGE, f, ## a) | 1484 | #define IPW_DEBUG_MERGE(f, a...) IPW_LL_DEBUG(IPW_DL_MERGE, f, ## a) |
1481 | #define IPW_DEBUG_QOS(f, a...) IPW_DEBUG(IPW_DL_QOS, f, ## a) | 1485 | #define IPW_DEBUG_QOS(f, a...) IPW_LL_DEBUG(IPW_DL_QOS, f, ## a) |
1482 | 1486 | ||
1483 | #include <linux/ctype.h> | 1487 | #include <linux/ctype.h> |
1484 | 1488 | ||