diff options
author | Tilman Schmidt <tilman@imap.cc> | 2010-07-05 10:18:59 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-07 19:57:53 -0400 |
commit | 6a75342a1c788aa89acac675e1720b08068ac8e7 (patch) | |
tree | da3f3fbce4228fd79227eb8ddb24d1ce61ce9e35 /drivers/isdn/gigaset | |
parent | 24c176258d9b2aa58d86584338fcd2d1a1521dbf (diff) |
isdn/gigaset: improve CAPI message debugging
Provide better control of debugging output for DATA_B3 CAPI messages
which tend to occur very frequently.
Impact: logging
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/gigaset')
-rw-r--r-- | drivers/isdn/gigaset/capi.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/isdn/gigaset/capi.c b/drivers/isdn/gigaset/capi.c index 6fbe8999c419..68194b502731 100644 --- a/drivers/isdn/gigaset/capi.c +++ b/drivers/isdn/gigaset/capi.c | |||
@@ -270,9 +270,13 @@ static inline void dump_rawmsg(enum debuglevel level, const char *tag, | |||
270 | kfree(dbgline); | 270 | kfree(dbgline); |
271 | if (CAPIMSG_COMMAND(data) == CAPI_DATA_B3 && | 271 | if (CAPIMSG_COMMAND(data) == CAPI_DATA_B3 && |
272 | (CAPIMSG_SUBCOMMAND(data) == CAPI_REQ || | 272 | (CAPIMSG_SUBCOMMAND(data) == CAPI_REQ || |
273 | CAPIMSG_SUBCOMMAND(data) == CAPI_IND) && | 273 | CAPIMSG_SUBCOMMAND(data) == CAPI_IND)) { |
274 | CAPIMSG_DATALEN(data) > 0) { | ||
275 | l = CAPIMSG_DATALEN(data); | 274 | l = CAPIMSG_DATALEN(data); |
275 | gig_dbg(level, " DataLength=%d", l); | ||
276 | if (l <= 0 || !(gigaset_debuglevel & DEBUG_LLDATA)) | ||
277 | return; | ||
278 | if (l > 64) | ||
279 | l = 64; /* arbitrary limit */ | ||
276 | dbgline = kmalloc(3*l, GFP_ATOMIC); | 280 | dbgline = kmalloc(3*l, GFP_ATOMIC); |
277 | if (!dbgline) | 281 | if (!dbgline) |
278 | return; | 282 | return; |
@@ -384,7 +388,7 @@ void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *dskb) | |||
384 | 388 | ||
385 | /* don't send further B3 messages if disconnected */ | 389 | /* don't send further B3 messages if disconnected */ |
386 | if (bcs->apconnstate < APCONN_ACTIVE) { | 390 | if (bcs->apconnstate < APCONN_ACTIVE) { |
387 | gig_dbg(DEBUG_LLDATA, "disconnected, discarding ack"); | 391 | gig_dbg(DEBUG_MCMD, "disconnected, discarding ack"); |
388 | return; | 392 | return; |
389 | } | 393 | } |
390 | 394 | ||
@@ -428,7 +432,7 @@ void gigaset_skb_rcvd(struct bc_state *bcs, struct sk_buff *skb) | |||
428 | 432 | ||
429 | /* don't send further B3 messages if disconnected */ | 433 | /* don't send further B3 messages if disconnected */ |
430 | if (bcs->apconnstate < APCONN_ACTIVE) { | 434 | if (bcs->apconnstate < APCONN_ACTIVE) { |
431 | gig_dbg(DEBUG_LLDATA, "disconnected, discarding data"); | 435 | gig_dbg(DEBUG_MCMD, "disconnected, discarding data"); |
432 | dev_kfree_skb_any(skb); | 436 | dev_kfree_skb_any(skb); |
433 | return; | 437 | return; |
434 | } | 438 | } |
@@ -454,7 +458,7 @@ void gigaset_skb_rcvd(struct bc_state *bcs, struct sk_buff *skb) | |||
454 | /* Data64 parameter not present */ | 458 | /* Data64 parameter not present */ |
455 | 459 | ||
456 | /* emit message */ | 460 | /* emit message */ |
457 | dump_rawmsg(DEBUG_LLDATA, "DATA_B3_IND", skb->data); | 461 | dump_rawmsg(DEBUG_MCMD, __func__, skb->data); |
458 | capi_ctr_handle_message(&iif->ctr, ap->id, skb); | 462 | capi_ctr_handle_message(&iif->ctr, ap->id, skb); |
459 | } | 463 | } |
460 | EXPORT_SYMBOL_GPL(gigaset_skb_rcvd); | 464 | EXPORT_SYMBOL_GPL(gigaset_skb_rcvd); |
@@ -978,6 +982,9 @@ static void gigaset_register_appl(struct capi_ctr *ctr, u16 appl, | |||
978 | struct cardstate *cs = ctr->driverdata; | 982 | struct cardstate *cs = ctr->driverdata; |
979 | struct gigaset_capi_appl *ap; | 983 | struct gigaset_capi_appl *ap; |
980 | 984 | ||
985 | gig_dbg(DEBUG_CMD, "%s [%u] l3cnt=%u blkcnt=%u blklen=%u", | ||
986 | __func__, appl, rp->level3cnt, rp->datablkcnt, rp->datablklen); | ||
987 | |||
981 | list_for_each_entry(ap, &iif->appls, ctrlist) | 988 | list_for_each_entry(ap, &iif->appls, ctrlist) |
982 | if (ap->id == appl) { | 989 | if (ap->id == appl) { |
983 | dev_notice(cs->dev, | 990 | dev_notice(cs->dev, |
@@ -1062,6 +1069,8 @@ static void gigaset_release_appl(struct capi_ctr *ctr, u16 appl) | |||
1062 | struct gigaset_capi_appl *ap, *tmp; | 1069 | struct gigaset_capi_appl *ap, *tmp; |
1063 | unsigned ch; | 1070 | unsigned ch; |
1064 | 1071 | ||
1072 | gig_dbg(DEBUG_CMD, "%s [%u]", __func__, appl); | ||
1073 | |||
1065 | list_for_each_entry_safe(ap, tmp, &iif->appls, ctrlist) | 1074 | list_for_each_entry_safe(ap, tmp, &iif->appls, ctrlist) |
1066 | if (ap->id == appl) { | 1075 | if (ap->id == appl) { |
1067 | /* remove from any channels */ | 1076 | /* remove from any channels */ |
@@ -1951,11 +1960,7 @@ static void do_data_b3_req(struct gigaset_capi_ctr *iif, | |||
1951 | u16 handle = CAPIMSG_HANDLE_REQ(skb->data); | 1960 | u16 handle = CAPIMSG_HANDLE_REQ(skb->data); |
1952 | 1961 | ||
1953 | /* frequent message, avoid _cmsg overhead */ | 1962 | /* frequent message, avoid _cmsg overhead */ |
1954 | dump_rawmsg(DEBUG_LLDATA, "DATA_B3_REQ", skb->data); | 1963 | dump_rawmsg(DEBUG_MCMD, __func__, skb->data); |
1955 | |||
1956 | gig_dbg(DEBUG_LLDATA, | ||
1957 | "Receiving data from LL (ch: %d, flg: %x, sz: %d|%d)", | ||
1958 | channel, flags, msglen, datalen); | ||
1959 | 1964 | ||
1960 | /* check parameters */ | 1965 | /* check parameters */ |
1961 | if (channel == 0 || channel > cs->channels || ncci != 1) { | 1966 | if (channel == 0 || channel > cs->channels || ncci != 1) { |
@@ -2064,7 +2069,7 @@ static void do_data_b3_resp(struct gigaset_capi_ctr *iif, | |||
2064 | struct gigaset_capi_appl *ap, | 2069 | struct gigaset_capi_appl *ap, |
2065 | struct sk_buff *skb) | 2070 | struct sk_buff *skb) |
2066 | { | 2071 | { |
2067 | dump_rawmsg(DEBUG_LLDATA, __func__, skb->data); | 2072 | dump_rawmsg(DEBUG_MCMD, __func__, skb->data); |
2068 | dev_kfree_skb_any(skb); | 2073 | dev_kfree_skb_any(skb); |
2069 | } | 2074 | } |
2070 | 2075 | ||