[svn-commits] sruffell: branch linux/sruffell/chan_list r9337 - in /linux/team/sruffell/cha...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Sep 17 14:11:48 CDT 2010


Author: sruffell
Date: Fri Sep 17 14:11:37 2010
New Revision: 9337

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9337
Log:
dahdi: Change dahdi_chan.nextslave from index to a pointer.

Modified:
    linux/team/sruffell/chan_list/drivers/dahdi/dahdi-base.c
    linux/team/sruffell/chan_list/include/dahdi/kernel.h

Modified: linux/team/sruffell/chan_list/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/sruffell/chan_list/drivers/dahdi/dahdi-base.c?view=diff&rev=9337&r1=9336&r2=9337
==============================================================================
--- linux/team/sruffell/chan_list/drivers/dahdi/dahdi-base.c (original)
+++ linux/team/sruffell/chan_list/drivers/dahdi/dahdi-base.c Fri Sep 17 14:11:37 2010
@@ -4251,11 +4251,11 @@
 			module_printk(KERN_NOTICE, "Channel %s, slave to %s, last is %s, its next will be %d\n",
 				      chan->span->chans[x]->name, chan->name, last->name, x);
 #endif
-			last->nextslave = x;
-			last = chan->span->chans[x];
+			last->nextslave = chan->span->chans[x];
+			last = last->nextslave;
 		}
 	/* Terminate list */
-	last->nextslave = 0;
+	last->nextslave = NULL;
 #ifdef CONFIG_DAHDI_DEBUG
 	module_printk(KERN_NOTICE, "Done Recalculating slaves on %s (last is %s)\n", chan->name, last->name);
 #endif
@@ -4338,7 +4338,7 @@
 
 		/* Clear the master channel */
 		chan->master = chan;
-		chan->nextslave = 0;
+		chan->nextslave = NULL;
 		/* Unlink this channel from the master's channel list */
 		recalc_slaves(oldmaster);
 	}
@@ -8476,8 +8476,8 @@
 
 int dahdi_transmit(struct dahdi_span *span)
 {
-	int x,y,z;
 	unsigned long flags;
+	unsigned int x;
 
 	for (x=0;x<span->channels;x++) {
 		struct dahdi_chan *const chan = span->chans[x];
@@ -8497,20 +8497,20 @@
 			} else {
 				if (chan->nextslave) {
 					u_char data[DAHDI_CHUNKSIZE];
-					int pos=DAHDI_CHUNKSIZE;
+					int pos = DAHDI_CHUNKSIZE;
+					int y;
+					struct dahdi_chan *z;
 					/* Process master/slaves one way */
-					for (y=0;y<DAHDI_CHUNKSIZE;y++) {
+					for (y = 0; y < DAHDI_CHUNKSIZE; y++) {
 						/* Process slaves for this byte too */
-						z = x;
-						do {
-							if (pos==DAHDI_CHUNKSIZE) {
+						for (z = chan; z; z = z->nextslave) {
+							if (pos == DAHDI_CHUNKSIZE) {
 								/* Get next chunk */
 								__dahdi_transmit_chunk(chan, data);
 								pos = 0;
 							}
-							span->chans[z]->writechunk[y] = data[pos++];
-							z = span->chans[z]->nextslave;
-						} while(z);
+							z->writechunk[y] = data[pos++];
+						}
 					}
 				} else {
 					/* Process independents elsewise */
@@ -8763,8 +8763,8 @@
 
 int dahdi_receive(struct dahdi_span *span)
 {
-	int x,y,z;
 	unsigned long flags;
+	unsigned int x;
 
 #ifdef CONFIG_DAHDI_WATCHDOG
 	span->watchcounter--;
@@ -8777,18 +8777,18 @@
 				/* Must process each slave at the same time */
 				u_char data[DAHDI_CHUNKSIZE];
 				int pos = 0;
+				int y;
+				struct dahdi_chan *z;
 				for (y=0;y<DAHDI_CHUNKSIZE;y++) {
 					/* Put all its slaves, too */
-					z = x;
-					do {
-						data[pos++] = span->chans[z]->readchunk[y];
+					for (z = chan; z; z = z->nextslave) {
+						data[pos++] = z->readchunk[y];
 						if (pos == DAHDI_CHUNKSIZE) {
 							if (!(chan->flags & DAHDI_FLAG_NOSTDTXRX))
 								__dahdi_receive_chunk(chan, data);
 							pos = 0;
 						}
-						z=span->chans[z]->nextslave;
-					} while(z);
+					}
 				}
 			} else {
 				/* Process a normal channel */

Modified: linux/team/sruffell/chan_list/include/dahdi/kernel.h
URL: http://svnview.digium.com/svn/dahdi/linux/team/sruffell/chan_list/include/dahdi/kernel.h?view=diff&rev=9337&r1=9336&r2=9337
==============================================================================
--- linux/team/sruffell/chan_list/include/dahdi/kernel.h (original)
+++ linux/team/sruffell/chan_list/include/dahdi/kernel.h Fri Sep 17 14:11:37 2010
@@ -416,7 +416,7 @@
 
 	struct dahdi_chan *master;	/*!< Our Master channel (could be us) */
 	/*! \brief Next slave (if appropriate) */
-	int nextslave;
+	struct dahdi_chan *nextslave;
 
 	u_char *writechunk;						/*!< Actual place to write to */
 	u_char swritechunk[DAHDI_MAX_CHUNKSIZE];	/*!< Buffer to be written */




More information about the svn-commits mailing list