Commit 6a75342a authored by Tilman Schmidt's avatar Tilman Schmidt Committed by David S. Miller

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: default avatarTilman Schmidt <tilman@imap.cc>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 24c17625
...@@ -270,9 +270,13 @@ static inline void dump_rawmsg(enum debuglevel level, const char *tag, ...@@ -270,9 +270,13 @@ static inline void dump_rawmsg(enum debuglevel level, const char *tag,
kfree(dbgline); kfree(dbgline);
if (CAPIMSG_COMMAND(data) == CAPI_DATA_B3 && if (CAPIMSG_COMMAND(data) == CAPI_DATA_B3 &&
(CAPIMSG_SUBCOMMAND(data) == CAPI_REQ || (CAPIMSG_SUBCOMMAND(data) == CAPI_REQ ||
CAPIMSG_SUBCOMMAND(data) == CAPI_IND) && CAPIMSG_SUBCOMMAND(data) == CAPI_IND)) {
CAPIMSG_DATALEN(data) > 0) {
l = CAPIMSG_DATALEN(data); l = CAPIMSG_DATALEN(data);
gig_dbg(level, " DataLength=%d", l);
if (l <= 0 || !(gigaset_debuglevel & DEBUG_LLDATA))
return;
if (l > 64)
l = 64; /* arbitrary limit */
dbgline = kmalloc(3*l, GFP_ATOMIC); dbgline = kmalloc(3*l, GFP_ATOMIC);
if (!dbgline) if (!dbgline)
return; return;
...@@ -384,7 +388,7 @@ void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *dskb) ...@@ -384,7 +388,7 @@ void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *dskb)
/* don't send further B3 messages if disconnected */ /* don't send further B3 messages if disconnected */
if (bcs->apconnstate < APCONN_ACTIVE) { if (bcs->apconnstate < APCONN_ACTIVE) {
gig_dbg(DEBUG_LLDATA, "disconnected, discarding ack"); gig_dbg(DEBUG_MCMD, "disconnected, discarding ack");
return; return;
} }
...@@ -428,7 +432,7 @@ void gigaset_skb_rcvd(struct bc_state *bcs, struct sk_buff *skb) ...@@ -428,7 +432,7 @@ void gigaset_skb_rcvd(struct bc_state *bcs, struct sk_buff *skb)
/* don't send further B3 messages if disconnected */ /* don't send further B3 messages if disconnected */
if (bcs->apconnstate < APCONN_ACTIVE) { if (bcs->apconnstate < APCONN_ACTIVE) {
gig_dbg(DEBUG_LLDATA, "disconnected, discarding data"); gig_dbg(DEBUG_MCMD, "disconnected, discarding data");
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return; return;
} }
...@@ -454,7 +458,7 @@ void gigaset_skb_rcvd(struct bc_state *bcs, struct sk_buff *skb) ...@@ -454,7 +458,7 @@ void gigaset_skb_rcvd(struct bc_state *bcs, struct sk_buff *skb)
/* Data64 parameter not present */ /* Data64 parameter not present */
/* emit message */ /* emit message */
dump_rawmsg(DEBUG_LLDATA, "DATA_B3_IND", skb->data); dump_rawmsg(DEBUG_MCMD, __func__, skb->data);
capi_ctr_handle_message(&iif->ctr, ap->id, skb); capi_ctr_handle_message(&iif->ctr, ap->id, skb);
} }
EXPORT_SYMBOL_GPL(gigaset_skb_rcvd); EXPORT_SYMBOL_GPL(gigaset_skb_rcvd);
...@@ -978,6 +982,9 @@ static void gigaset_register_appl(struct capi_ctr *ctr, u16 appl, ...@@ -978,6 +982,9 @@ static void gigaset_register_appl(struct capi_ctr *ctr, u16 appl,
struct cardstate *cs = ctr->driverdata; struct cardstate *cs = ctr->driverdata;
struct gigaset_capi_appl *ap; struct gigaset_capi_appl *ap;
gig_dbg(DEBUG_CMD, "%s [%u] l3cnt=%u blkcnt=%u blklen=%u",
__func__, appl, rp->level3cnt, rp->datablkcnt, rp->datablklen);
list_for_each_entry(ap, &iif->appls, ctrlist) list_for_each_entry(ap, &iif->appls, ctrlist)
if (ap->id == appl) { if (ap->id == appl) {
dev_notice(cs->dev, dev_notice(cs->dev,
...@@ -1062,6 +1069,8 @@ static void gigaset_release_appl(struct capi_ctr *ctr, u16 appl) ...@@ -1062,6 +1069,8 @@ static void gigaset_release_appl(struct capi_ctr *ctr, u16 appl)
struct gigaset_capi_appl *ap, *tmp; struct gigaset_capi_appl *ap, *tmp;
unsigned ch; unsigned ch;
gig_dbg(DEBUG_CMD, "%s [%u]", __func__, appl);
list_for_each_entry_safe(ap, tmp, &iif->appls, ctrlist) list_for_each_entry_safe(ap, tmp, &iif->appls, ctrlist)
if (ap->id == appl) { if (ap->id == appl) {
/* remove from any channels */ /* remove from any channels */
...@@ -1951,11 +1960,7 @@ static void do_data_b3_req(struct gigaset_capi_ctr *iif, ...@@ -1951,11 +1960,7 @@ static void do_data_b3_req(struct gigaset_capi_ctr *iif,
u16 handle = CAPIMSG_HANDLE_REQ(skb->data); u16 handle = CAPIMSG_HANDLE_REQ(skb->data);
/* frequent message, avoid _cmsg overhead */ /* frequent message, avoid _cmsg overhead */
dump_rawmsg(DEBUG_LLDATA, "DATA_B3_REQ", skb->data); dump_rawmsg(DEBUG_MCMD, __func__, skb->data);
gig_dbg(DEBUG_LLDATA,
"Receiving data from LL (ch: %d, flg: %x, sz: %d|%d)",
channel, flags, msglen, datalen);
/* check parameters */ /* check parameters */
if (channel == 0 || channel > cs->channels || ncci != 1) { if (channel == 0 || channel > cs->channels || ncci != 1) {
...@@ -2064,7 +2069,7 @@ static void do_data_b3_resp(struct gigaset_capi_ctr *iif, ...@@ -2064,7 +2069,7 @@ static void do_data_b3_resp(struct gigaset_capi_ctr *iif,
struct gigaset_capi_appl *ap, struct gigaset_capi_appl *ap,
struct sk_buff *skb) struct sk_buff *skb)
{ {
dump_rawmsg(DEBUG_LLDATA, __func__, skb->data); dump_rawmsg(DEBUG_MCMD, __func__, skb->data);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment