[svn-commits] kpfleming: branch mogorman/zaptel-1.2-transcoder r2026 - /team/mogorman/zapte...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Tue Jan 30 14:47:52 MST 2007


Author: kpfleming
Date: Tue Jan 30 15:47:51 2007
New Revision: 2026

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2026
Log:
add debugging output
transmit userspace transcode operations properly

Modified:
    team/mogorman/zaptel-1.2-transcoder/wctc4xxp/base.c

Modified: team/mogorman/zaptel-1.2-transcoder/wctc4xxp/base.c
URL: http://svn.digium.com/view/zaptel/team/mogorman/zaptel-1.2-transcoder/wctc4xxp/base.c?view=diff&rev=2026&r1=2025&r2=2026
==============================================================================
--- team/mogorman/zaptel-1.2-transcoder/wctc4xxp/base.c (original)
+++ team/mogorman/zaptel-1.2-transcoder/wctc4xxp/base.c Tue Jan 30 15:47:51 2007
@@ -354,7 +354,7 @@
 	} else if (wc->total_cmdq < MAX_TOTAL_CMDQ) {
 		/* we can make a new entry */
 		if ((winner = kmalloc(sizeof(*winner) + size_needed, GFP_KERNEL))) {
-			debug_printk(1, "created a '%zd' byte cmdq entry\n", size_needed);
+			debug_printk(1, "created a '%zd' byte cmdq entry at '%p'\n", size_needed, winner);
 			winner->cmdspace = size_needed;
 			INIT_LIST_HEAD(&winner->list);
 		}
@@ -365,7 +365,7 @@
 		list_del(&smallest_seen->list);
 		kfree(smallest_seen);
 		if ((winner = kmalloc(sizeof(*winner) + size_needed, GFP_KERNEL))) {
-			debug_printk(1, "replaced a '%zd' byte cmdq entry with a '%zd' byte one\n", smallest_seen_size, size_needed);
+			debug_printk(1, "replaced a '%zd' byte cmdq entry at '%p' with a '%zd' byte one at '%p'\n", smallest_seen_size, smallest_seen, size_needed, winner);
 			winner->cmdspace = size_needed;
 			INIT_LIST_HEAD(&winner->list);
 		}
@@ -532,6 +532,8 @@
 	/* pop the first entry off the list */
 	cmdq = list_entry(wc->pending_cmdq.next, struct cmdq, list);
 	list_del_init(&cmdq->list);
+
+	debug_printk(1, "transmitting command at '%p' of '%zd' bytes\n", cmdq, cmdq->cmdlen);
 
 	__transmit_one(wc, cmdq->cmd, cmdq->cmdlen);
 
@@ -693,8 +695,7 @@
 						((st->timestamp) >> 8)              & 0xFF,
 						(st->timestamp)                    & 0xFF);
 
-					ipchksum = 0x9869 + (fifo[16] << 8) + fifo[17] +
-						(fifo[18] << 8) + fifo[19];
+					ipchksum = 0x9869 + (fifo[16] << 8) + fifo[17] + (fifo[18] << 8) + fifo[19];
 					while (ipchksum >> 16)
 						ipchksum = (ipchksum & 0xFFFF) + (ipchksum >> 16);
 					ipchksum = (~ipchksum) & 0xFFFF;
@@ -715,6 +716,7 @@
 		
 					memcpy(cmdq->cmd, fifo, sizeof(fifo));
 					memcpy(cmdq->cmd + sizeof(fifo), chars, inbytes);
+					cmdq->cmdlen = sizeof(fifo) + inbytes;
 					list_add_tail(&wc->pending_cmdq, &cmdq->list);
 					__transmit_demand(wc);
 					up(&wc->cmdqsem);
@@ -1473,8 +1475,8 @@
 	memset(encoders, 0, sizeof(*encoders) * wc->numchannels);
 	memset(decoders, 0, sizeof(*decoders) * wc->numchannels);
 
-	strcpy(wc->udecode->name, "DTE Decoder");
-	strcpy(wc->uencode->name, "DTE Encoder");
+	strcpy(wc->udecode->name, wc->variety);
+	strcpy(wc->uencode->name, wc->variety);
 	
 	wc->udecode->srcfmts = wc->uencode->dstfmts = complexfmts;
 	wc->udecode->dstfmts = wc->uencode->srcfmts = ZT_FORMAT_ULAW | ZT_FORMAT_ALAW;
@@ -1573,10 +1575,12 @@
 	if (wc->freeregion)
 		release_region(wc->iobase, 0xff);
 	while ((cmdq = list_entry(wc->pending_cmdq.next, struct cmdq, list))) {
+		debug_printk(1, "freeing cmdq entry at '%p'\n", cmdq);
 		list_del(&cmdq->list);
 		kfree(cmdq);
 	}
 	while ((cmdq = list_entry(wc->free_cmdq.next, struct cmdq, list))) {
+		debug_printk(1, "freeing cmdq entry at '%p'\n", cmdq);
 		list_del(&cmdq->list);
 		kfree(cmdq);
 	}



More information about the svn-commits mailing list