diff mbox

[05/11] isdn/gigaset: improve CAPI message debugging

Message ID 20100705-patch-gigaset-05.tilman@imap.cc
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Tilman Schmidt July 6, 2010, 12:18 a.m. UTC
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>
---
 drivers/isdn/gigaset/capi.c |   27 ++++++++++++++++-----------
 1 files changed, 16 insertions(+), 11 deletions(-)

Comments

David Miller July 6, 2010, 2:23 a.m. UTC | #1
From: Tilman Schmidt <tilman@imap.cc>
Date: Tue,  6 Jul 2010 02:18:59 +0200 (CEST)

> @@ -384,7 +388,7 @@ void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *dskb)
>  
>  	/* don't send further B3 messages if disconnected */
>  	if (bcs->apconnstate < APCONN_ACTIVE) {
> -		gig_dbg(DEBUG_LLDATA, "disconnected, discarding ack");
> +		gig_dbg(DEBUG_MCMD, "disconnected, discarding ack");
>  		return;
>  	}

This is against something other than net-next-2.6 even with your
other two ISDN patches applied, because all of these lines read
"if (ap->connected ..."

Please tell me what exactly these patches are against so that I
can apply them to net-next-2.6 cleanly.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tilman Schmidt July 6, 2010, 8:14 a.m. UTC | #2
Am 2010-07-06 04:23 schrieb David Miller:
> From: Tilman Schmidt <tilman@imap.cc>
> Date: Tue,  6 Jul 2010 02:18:59 +0200 (CEST)
> 
>> @@ -384,7 +388,7 @@ void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *dskb)
>>  
>>  	/* don't send further B3 messages if disconnected */
>>  	if (bcs->apconnstate < APCONN_ACTIVE) {
>> -		gig_dbg(DEBUG_LLDATA, "disconnected, discarding ack");
>> +		gig_dbg(DEBUG_MCMD, "disconnected, discarding ack");
>>  		return;
>>  	}
> 
> This is against something other than net-next-2.6 even with your
> other two ISDN patches applied, because all of these lines read
> "if (ap->connected ..."
> 
> Please tell me what exactly these patches are against so that I
> can apply them to net-next-2.6 cleanly.

They are against mainline and apply cleanly to v2.6.35-rc3.
IOW, they go on top of the series you applied to net-2.6 on
Fri, 25 Jun 2010 21:31:28 -0700 (PDT).

Specifically, the last patch of that series,
> Subject: [PATCH 5/5] isdn/gigaset: correct CAPI connection state storage
makes the switch from ap->connected to bcs->apconnstate.

So if you'll postpone applying last night's series until
after your next merge of net-2.6 into net-next-2.6, it
should then apply cleanly.

Thanks,
Tilman
David Miller July 6, 2010, 5:44 p.m. UTC | #3
From: Tilman Schmidt <tilman@imap.cc>
Date: Tue, 06 Jul 2010 10:14:53 +0200

> So if you'll postpone applying last night's series until
> after your next merge of net-2.6 into net-next-2.6, it
> should then apply cleanly.

That's the kind of information I'd like to see from you when you
post patches which have such dependencies.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tilman Schmidt July 6, 2010, 8:31 p.m. UTC | #4
Am 06.07.2010 19:44 schrieb David Miller:
> From: Tilman Schmidt <tilman@imap.cc>
> Date: Tue, 06 Jul 2010 10:14:53 +0200
> 
>> So if you'll postpone applying last night's series until
>> after your next merge of net-2.6 into net-next-2.6, it
>> should then apply cleanly.
> 
> That's the kind of information I'd like to see from you when you
> post patches which have such dependencies.

Understood. It's just that I had thought my "for 2.6.35" patches
had already been applied to net-next-2.6, anyway. When I got
your complaint I noticed I had been mistaken. Sorry for that.
I know how that mistake arose, and it won't happen again.

Thanks,
Tilman
diff mbox

Patch

diff --git a/drivers/isdn/gigaset/capi.c b/drivers/isdn/gigaset/capi.c
index c38750c..ff074e9 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,
 	kfree(dbgline);
 	if (CAPIMSG_COMMAND(data) == CAPI_DATA_B3 &&
 	    (CAPIMSG_SUBCOMMAND(data) == CAPI_REQ ||
-	     CAPIMSG_SUBCOMMAND(data) == CAPI_IND) &&
-	    CAPIMSG_DATALEN(data) > 0) {
+	     CAPIMSG_SUBCOMMAND(data) == CAPI_IND)) {
 		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);
 		if (!dbgline)
 			return;
@@ -384,7 +388,7 @@  void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *dskb)
 
 	/* don't send further B3 messages if disconnected */
 	if (bcs->apconnstate < APCONN_ACTIVE) {
-		gig_dbg(DEBUG_LLDATA, "disconnected, discarding ack");
+		gig_dbg(DEBUG_MCMD, "disconnected, discarding ack");
 		return;
 	}
 
@@ -428,7 +432,7 @@  void gigaset_skb_rcvd(struct bc_state *bcs, struct sk_buff *skb)
 
 	/* don't send further B3 messages if disconnected */
 	if (bcs->apconnstate < APCONN_ACTIVE) {
-		gig_dbg(DEBUG_LLDATA, "disconnected, discarding data");
+		gig_dbg(DEBUG_MCMD, "disconnected, discarding data");
 		dev_kfree_skb_any(skb);
 		return;
 	}
@@ -454,7 +458,7 @@  void gigaset_skb_rcvd(struct bc_state *bcs, struct sk_buff *skb)
 	/* Data64 parameter not present */
 
 	/* 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);
 }
 EXPORT_SYMBOL_GPL(gigaset_skb_rcvd);
@@ -978,6 +982,9 @@  static void gigaset_register_appl(struct capi_ctr *ctr, u16 appl,
 	struct cardstate *cs = ctr->driverdata;
 	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)
 		if (ap->id == appl) {
 			dev_notice(cs->dev,
@@ -1062,6 +1069,8 @@  static void gigaset_release_appl(struct capi_ctr *ctr, u16 appl)
 	struct gigaset_capi_appl *ap, *tmp;
 	unsigned ch;
 
+	gig_dbg(DEBUG_CMD, "%s [%u]", __func__, appl);
+
 	list_for_each_entry_safe(ap, tmp, &iif->appls, ctrlist)
 		if (ap->id == appl) {
 			/* remove from any channels */
@@ -1951,11 +1960,7 @@  static void do_data_b3_req(struct gigaset_capi_ctr *iif,
 	u16 handle = CAPIMSG_HANDLE_REQ(skb->data);
 
 	/* frequent message, avoid _cmsg overhead */
-	dump_rawmsg(DEBUG_LLDATA, "DATA_B3_REQ", skb->data);
-
-	gig_dbg(DEBUG_LLDATA,
-		"Receiving data from LL (ch: %d, flg: %x, sz: %d|%d)",
-		channel, flags, msglen, datalen);
+	dump_rawmsg(DEBUG_MCMD, __func__, skb->data);
 
 	/* check parameters */
 	if (channel == 0 || channel > cs->channels || ncci != 1) {
@@ -2064,7 +2069,7 @@  static void do_data_b3_resp(struct gigaset_capi_ctr *iif,
 			    struct gigaset_capi_appl *ap,
 			    struct sk_buff *skb)
 {
-	dump_rawmsg(DEBUG_LLDATA, __func__, skb->data);
+	dump_rawmsg(DEBUG_MCMD, __func__, skb->data);
 	dev_kfree_skb_any(skb);
 }