aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2006-11-20 15:28:09 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:24:36 -0500
commit56724aa434e9b4d73548021ede7a1474f533f3fe (patch)
tree830f7c9883747a47cf63eddf05d8418e0f59a1cc /net
parent84116716cc9404356f775443b460f76766f08f65 (diff)
[DCCP]: Add CCID3 debug support to Kconfig
This adds a CCID3 debug option to the configuration menu which is missing in Kconfig, but already used by the code. CCID 2 already provides such an entry. To enable debugging, set CONFIG_IP_DCCP_CCID3_DEBUG=y NOTE: The use of ccid3_{t,r}x_state_name is safe, since now only enum values can appear. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net')
-rw-r--r--net/dccp/ccids/Kconfig11
-rw-r--r--net/dccp/ccids/ccid3.c16
2 files changed, 19 insertions, 8 deletions
diff --git a/net/dccp/ccids/Kconfig b/net/dccp/ccids/Kconfig
index ba826d99ed03..dac89166eb18 100644
--- a/net/dccp/ccids/Kconfig
+++ b/net/dccp/ccids/Kconfig
@@ -78,4 +78,15 @@ config IP_DCCP_TFRC_LIB
78 depends on IP_DCCP_CCID3 78 depends on IP_DCCP_CCID3
79 def_tristate IP_DCCP_CCID3 79 def_tristate IP_DCCP_CCID3
80 80
81config IP_DCCP_CCID3_DEBUG
82 bool "CCID3 debugging messages"
83 depends on IP_DCCP_CCID3
84 ---help---
85 Enable CCID3-specific debugging messages.
86
87 When compiling CCID3 as a module, this debugging output can
88 additionally be toggled by setting the ccid3_debug module
89 parameter to 0 or 1.
90
91 If in doubt, say N.
81endmenu 92endmenu
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index 2fa0c6d1fbee..7db801ec1ab9 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -60,13 +60,11 @@ static u32 usecs_div(const u32 a, const u32 b)
60 return (b >= 2 * div) ? tmp / (b / div) : tmp; 60 return (b >= 2 * div) ? tmp / (b / div) : tmp;
61} 61}
62 62
63static int ccid3_debug;
64 63
65#ifdef CCID3_DEBUG 64
66#define ccid3_pr_debug(format, a...) \ 65#ifdef CONFIG_IP_DCCP_CCID3_DEBUG
67 do { if (ccid3_debug) \ 66static int ccid3_debug;
68 printk(KERN_DEBUG "%s: " format, __FUNCTION__, ##a); \ 67#define ccid3_pr_debug(format, a...) DCCP_PR_DEBUG(ccid3_debug, format, ##a)
69 } while (0)
70#else 68#else
71#define ccid3_pr_debug(format, a...) 69#define ccid3_pr_debug(format, a...)
72#endif 70#endif
@@ -75,7 +73,7 @@ static struct dccp_tx_hist *ccid3_tx_hist;
75static struct dccp_rx_hist *ccid3_rx_hist; 73static struct dccp_rx_hist *ccid3_rx_hist;
76static struct dccp_li_hist *ccid3_li_hist; 74static struct dccp_li_hist *ccid3_li_hist;
77 75
78#ifdef CCID3_DEBUG 76#ifdef CONFIG_IP_DCCP_CCID3_DEBUG
79static const char *ccid3_tx_state_name(enum ccid3_hc_tx_states state) 77static const char *ccid3_tx_state_name(enum ccid3_hc_tx_states state)
80{ 78{
81 static char *ccid3_state_names[] = { 79 static char *ccid3_state_names[] = {
@@ -676,7 +674,7 @@ static void ccid3_hc_tx_exit(struct sock *sk)
676 * RX Half Connection methods 674 * RX Half Connection methods
677 */ 675 */
678 676
679#ifdef CCID3_DEBUG 677#ifdef CONFIG_IP_DCCP_CCID3_DEBUG
680static const char *ccid3_rx_state_name(enum ccid3_hc_rx_states state) 678static const char *ccid3_rx_state_name(enum ccid3_hc_rx_states state)
681{ 679{
682 static char *ccid3_rx_state_names[] = { 680 static char *ccid3_rx_state_names[] = {
@@ -1240,8 +1238,10 @@ static struct ccid_operations ccid3 = {
1240 .ccid_hc_tx_getsockopt = ccid3_hc_tx_getsockopt, 1238 .ccid_hc_tx_getsockopt = ccid3_hc_tx_getsockopt,
1241}; 1239};
1242 1240
1241#ifdef CONFIG_IP_DCCP_CCID3_DEBUG
1243module_param(ccid3_debug, int, 0444); 1242module_param(ccid3_debug, int, 0444);
1244MODULE_PARM_DESC(ccid3_debug, "Enable debug messages"); 1243MODULE_PARM_DESC(ccid3_debug, "Enable debug messages");
1244#endif
1245 1245
1246static __init int ccid3_module_init(void) 1246static __init int ccid3_module_init(void)
1247{ 1247{