diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2006-11-20 15:26:03 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:24:35 -0500 |
commit | 84116716cc9404356f775443b460f76766f08f65 (patch) | |
tree | 627662e0ac97542de873ed2071561ba2c2f0ba8e /net/dccp/ccids | |
parent | f123bc5f800d528e59684c7faffda88b4dd2d38c (diff) |
[DCCP]: enable debug messages also for static builds
This patch
* makes debugging (when configured) work both for static / module build
* provides generic debugging macros for use in other DCCP / CCID modules
* adds missing information about debug parameters to Kconfig
* performs some code tidy-up
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net/dccp/ccids')
-rw-r--r-- | net/dccp/ccids/Kconfig | 14 | ||||
-rw-r--r-- | net/dccp/ccids/ccid2.c | 16 |
2 files changed, 18 insertions, 12 deletions
diff --git a/net/dccp/ccids/Kconfig b/net/dccp/ccids/Kconfig index 8533dabfb9f8..ba826d99ed03 100644 --- a/net/dccp/ccids/Kconfig +++ b/net/dccp/ccids/Kconfig | |||
@@ -28,13 +28,20 @@ config IP_DCCP_CCID2 | |||
28 | This text was extracted from RFC 4340 (sec. 10.1), | 28 | This text was extracted from RFC 4340 (sec. 10.1), |
29 | http://www.ietf.org/rfc/rfc4340.txt | 29 | http://www.ietf.org/rfc/rfc4340.txt |
30 | 30 | ||
31 | To compile this CCID as a module, choose M here: the module will be | ||
32 | called dccp_ccid2. | ||
33 | |||
31 | If in doubt, say M. | 34 | If in doubt, say M. |
32 | 35 | ||
33 | config IP_DCCP_CCID2_DEBUG | 36 | config IP_DCCP_CCID2_DEBUG |
34 | bool "CCID2 debug" | 37 | bool "CCID2 debugging messages" |
35 | depends on IP_DCCP_CCID2 | 38 | depends on IP_DCCP_CCID2 |
36 | ---help--- | 39 | ---help--- |
37 | Enable CCID2 debug messages. | 40 | Enable CCID2-specific debugging messages. |
41 | |||
42 | When compiling CCID2 as a module, this debugging output can | ||
43 | additionally be toggled by setting the ccid2_debug module | ||
44 | parameter to 0 or 1. | ||
38 | 45 | ||
39 | If in doubt, say N. | 46 | If in doubt, say N. |
40 | 47 | ||
@@ -62,6 +69,9 @@ config IP_DCCP_CCID3 | |||
62 | This text was extracted from RFC 4340 (sec. 10.2), | 69 | This text was extracted from RFC 4340 (sec. 10.2), |
63 | http://www.ietf.org/rfc/rfc4340.txt | 70 | http://www.ietf.org/rfc/rfc4340.txt |
64 | 71 | ||
72 | To compile this CCID as a module, choose M here: the module will be | ||
73 | called dccp_ccid3. | ||
74 | |||
65 | If in doubt, say M. | 75 | If in doubt, say M. |
66 | 76 | ||
67 | config IP_DCCP_TFRC_LIB | 77 | config IP_DCCP_TFRC_LIB |
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c index 6533cb2f27bb..0fb0d66544a2 100644 --- a/net/dccp/ccids/ccid2.c +++ b/net/dccp/ccids/ccid2.c | |||
@@ -33,18 +33,11 @@ | |||
33 | #include "../dccp.h" | 33 | #include "../dccp.h" |
34 | #include "ccid2.h" | 34 | #include "ccid2.h" |
35 | 35 | ||
36 | static int ccid2_debug; | ||
37 | 36 | ||
38 | #ifdef CONFIG_IP_DCCP_CCID2_DEBUG | 37 | #ifdef CONFIG_IP_DCCP_CCID2_DEBUG |
39 | #define ccid2_pr_debug(format, a...) \ | 38 | static int ccid2_debug; |
40 | do { if (ccid2_debug) \ | 39 | #define ccid2_pr_debug(format, a...) DCCP_PR_DEBUG(ccid2_debug, format, ##a) |
41 | printk(KERN_DEBUG "%s: " format, __FUNCTION__, ##a); \ | ||
42 | } while (0) | ||
43 | #else | ||
44 | #define ccid2_pr_debug(format, a...) | ||
45 | #endif | ||
46 | 40 | ||
47 | #ifdef CONFIG_IP_DCCP_CCID2_DEBUG | ||
48 | static void ccid2_hc_tx_check_sanity(const struct ccid2_hc_tx_sock *hctx) | 41 | static void ccid2_hc_tx_check_sanity(const struct ccid2_hc_tx_sock *hctx) |
49 | { | 42 | { |
50 | int len = 0; | 43 | int len = 0; |
@@ -86,7 +79,8 @@ static void ccid2_hc_tx_check_sanity(const struct ccid2_hc_tx_sock *hctx) | |||
86 | BUG_ON(len != hctx->ccid2hctx_seqbufc * CCID2_SEQBUF_LEN); | 79 | BUG_ON(len != hctx->ccid2hctx_seqbufc * CCID2_SEQBUF_LEN); |
87 | } | 80 | } |
88 | #else | 81 | #else |
89 | #define ccid2_hc_tx_check_sanity(hctx) do {} while (0) | 82 | #define ccid2_pr_debug(format, a...) |
83 | #define ccid2_hc_tx_check_sanity(hctx) | ||
90 | #endif | 84 | #endif |
91 | 85 | ||
92 | static int ccid2_hc_tx_alloc_seq(struct ccid2_hc_tx_sock *hctx, int num, | 86 | static int ccid2_hc_tx_alloc_seq(struct ccid2_hc_tx_sock *hctx, int num, |
@@ -841,8 +835,10 @@ static struct ccid_operations ccid2 = { | |||
841 | .ccid_hc_rx_packet_recv = ccid2_hc_rx_packet_recv, | 835 | .ccid_hc_rx_packet_recv = ccid2_hc_rx_packet_recv, |
842 | }; | 836 | }; |
843 | 837 | ||
838 | #ifdef CONFIG_IP_DCCP_CCID2_DEBUG | ||
844 | module_param(ccid2_debug, int, 0444); | 839 | module_param(ccid2_debug, int, 0444); |
845 | MODULE_PARM_DESC(ccid2_debug, "Enable debug messages"); | 840 | MODULE_PARM_DESC(ccid2_debug, "Enable debug messages"); |
841 | #endif | ||
846 | 842 | ||
847 | static __init int ccid2_module_init(void) | 843 | static __init int ccid2_module_init(void) |
848 | { | 844 | { |