[svn-commits] sruffell: branch linux/sruffell/dahdi-linux-transcoder r5419 - in /linux/team...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Dec 1 11:43:17 CST 2008


Author: sruffell
Date: Mon Dec  1 11:43:16 2008
New Revision: 5419

URL: http://svn.digium.com/view/dahdi?view=rev&rev=5419
Log:
Merged revisions 5413 via svnmerge from 
https://origsvn.digium.com/svn/dahdi/linux/trunk

........
r5413 | sruffell | 2008-12-01 07:59:14 -0800 (Mon, 01 Dec 2008) | 4 lines

Service the transmit descriptor ring before the receive descriptor ring so
that commands that are still sitting on the transmit descriptor ring are not
completed twice.

........

Modified:
    linux/team/sruffell/dahdi-linux-transcoder/   (props changed)
    linux/team/sruffell/dahdi-linux-transcoder/drivers/dahdi/wctc4xxp/base.c

Propchange: linux/team/sruffell/dahdi-linux-transcoder/
------------------------------------------------------------------------------
    automerge = yes

Propchange: linux/team/sruffell/dahdi-linux-transcoder/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Dec  1 11:43:16 2008
@@ -1,1 +1,1 @@
-/linux/trunk:1-5409
+/linux/trunk:1-5418

Modified: linux/team/sruffell/dahdi-linux-transcoder/drivers/dahdi/wctc4xxp/base.c
URL: http://svn.digium.com/view/dahdi/linux/team/sruffell/dahdi-linux-transcoder/drivers/dahdi/wctc4xxp/base.c?view=diff&rev=5419&r1=5418&r2=5419
==============================================================================
--- linux/team/sruffell/dahdi-linux-transcoder/drivers/dahdi/wctc4xxp/base.c (original)
+++ linux/team/sruffell/dahdi-linux-transcoder/drivers/dahdi/wctc4xxp/base.c Mon Dec  1 11:43:16 2008
@@ -1954,8 +1954,9 @@
 		    (listhdr->channel == rxhdr->channel)) {
 			list_del_init(&pos->node);
 			pos->flags &= ~(__WAIT_FOR_RESPONSE);
+			pos->response = cmd;
 			WARN_ON(pos->response);
-			pos->response = cmd;
+			WARN_ON(!(pos->flags & TX_COMPLETE));
 			WARN_ON(!(pos->flags & TX_COMPLETE));
 			complete(&pos->complete);
 			break;
@@ -1983,6 +1984,7 @@
 			WARN_ON(!(pos->flags & DO_NOT_AUTO_FREE));
 			WARN_ON(!(pos->flags & TX_COMPLETE));
 			list_del_init(&pos->node);
+			WARN_ON(!(pos->flags & TX_COMPLETE));
 			complete(&pos->complete);
 		} else if ((listhdr->seq_num == rxhdr->seq_num) &&
 			   (listhdr->channel == rxhdr->channel)) {
@@ -1991,10 +1993,12 @@
 			} else {
 				list_del_init(&pos->node);
 
-				if (pos->flags & DO_NOT_AUTO_FREE)
+				if (pos->flags & DO_NOT_AUTO_FREE) {
+					WARN_ON(!(pos->flags & TX_COMPLETE));
 					complete(&pos->complete);
-				else
+				} else {
 					free_cmd(pos);
+				}
 			}
 			break;
 		}
@@ -2132,20 +2136,18 @@
 static inline void service_tx_ring(struct wcdte *wc)
 {
 	struct tcb *cmd;
-
-	/*
-	 * Process the transmit packets
-	 */
 	while ((cmd = wctc4xxp_retrieve(wc->txd))) {
 		if (!(cmd->flags & (__WAIT_FOR_ACK | __WAIT_FOR_RESPONSE))) {
 			/* If we're not waiting for an ACK or Response from
 			 * the DTE, this message should not be sitting on any
 			 * lists. */
 			WARN_ON(!list_empty(&cmd->node));
-			if (DO_NOT_AUTO_FREE & cmd->flags)
+			if (DO_NOT_AUTO_FREE & cmd->flags) {
+				WARN_ON(!(cmd->flags & TX_COMPLETE));
 				complete(&cmd->complete);
-			else
+			} else {
 				free_cmd(cmd);
+			}
 		}
 		/* We've freed up a spot in the hardware ring buffer.  If
 		 * another packet is queued up, let's submit it to the
@@ -2164,34 +2166,27 @@
 	}
 }
 
-static inline void service_dte(struct wcdte *wc)
+static inline void service_rx_ring(struct wcdte *wc)
 {
 	struct tcb *cmd;
-
-
-	service_tx_ring(wc);
-
 	while ((cmd = wctc4xxp_retrieve(wc->rxd))) {
 		struct tcb *newcmd;
-
 		wctc4xxp_net_capture_cmd(wc, cmd);
 
 		newcmd = __alloc_cmd(ALLOC_FLAGS, 0);
-		if (!newcmd) {
-			DTE_PRINTK(ERR, "Out of memory in %s.\n", __func__);
+		if(!newcmd) {
+			DTE_PRINTK(ERR, "Out of memory in %s.\n", __FUNCTION__);
 		} else {
 			if (newcmd->data_len < MAX_FRAME_SIZE) {
-				newcmd->data = kmalloc(MAX_FRAME_SIZE,
-						ALLOC_FLAGS);
+				newcmd->data = kmalloc(MAX_FRAME_SIZE, ALLOC_FLAGS);
 				if (!newcmd->data) {
-					DTE_PRINTK(ERR, "out of memory in %s "\
-					    "again.\n", __func__);
+					DTE_PRINTK(ERR, "out of memory in %s " \
+					    "again.\n", __FUNCTION__);
 				}
 				newcmd->data_len = MAX_FRAME_SIZE;
 			}
 			if (wctc4xxp_submit(wc->rxd, newcmd)) {
-				DTE_PRINTK(ERR, "Failed submit in %s\n",
-				__func__);
+				DTE_PRINTK(ERR, "Failed submit in %s\n", __FUNCTION__);
 				free_cmd(newcmd);
 			}
 			wctc4xxp_receive_demand_poll(wc);
@@ -2199,7 +2194,12 @@
 		wctc4xxp_receiveprep(wc, cmd);
 	}
 	wctc4xxp_receive_demand_poll(wc);
-
+}
+
+static inline void service_dte(struct wcdte *wc) 
+{
+	service_tx_ring(wc);
+	service_rx_ring(wc);	
 }
 
 




More information about the svn-commits mailing list