[svn-commits] sruffell: branch linux/sruffell/dahdi-linux-cmdqueue r6039 - /linux/team/sruf...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Feb 24 19:04:20 CST 2009


Author: sruffell
Date: Tue Feb 24 19:04:19 2009
New Revision: 6039

URL: http://svn.digium.com/svn-view/dahdi?view=rev&rev=6039
Log:
Remove some members from the t1 structure that were not used.

Modified:
    linux/team/sruffell/dahdi-linux-cmdqueue/drivers/dahdi/wcte12xp/base.c
    linux/team/sruffell/dahdi-linux-cmdqueue/drivers/dahdi/wcte12xp/wcte12xp.h

Modified: linux/team/sruffell/dahdi-linux-cmdqueue/drivers/dahdi/wcte12xp/base.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/sruffell/dahdi-linux-cmdqueue/drivers/dahdi/wcte12xp/base.c?view=diff&rev=6039&r1=6038&r2=6039
==============================================================================
--- linux/team/sruffell/dahdi-linux-cmdqueue/drivers/dahdi/wcte12xp/base.c (original)
+++ linux/team/sruffell/dahdi-linux-cmdqueue/drivers/dahdi/wcte12xp/base.c Tue Feb 24 19:04:19 2009
@@ -55,36 +55,6 @@
 
 struct pci_driver te12xp_driver;
 
-static int chanmap_t1[] = 
-{ 2,1,0,
-  6,5,4,
-  10,9,8,
-  14,13,12,
-  18,17,16,
-  22,21,20,
-  26,25,24,
-  30,29,28 };
-
-static int chanmap_e1[] = 
-{ 2,1,0,
-  7,6,5,4,
-  11,10,9,8,
-  15,14,13,12,
-  19,18,17,16,
-  23,22,21,20,
-  27,26,25,24,
-  31,30,29,28 };
-
-static int chanmap_e1uc[] =
-{ 3,2,1,0,
-  7,6,5,4,
-  11,10,9,8,
-  15,14,13,12,
-  19,18,17,16,
-  23,22,21,20,
-  27,26,25,24,
-  31,30,29,28 };
-
 int debug = 0;
 static int j1mode = 0;
 static int alarmdebounce = 0;
@@ -168,6 +138,9 @@
 static void cmd_dequeue(struct t1 *wc, volatile unsigned char *writechunk, int eframe, int slot)
 {
 	struct command *curcmd=NULL;
+	u16 address;
+	u8 data;
+	u32 flags;
 
 	/* Skip audio */
 	writechunk += 66;
@@ -177,25 +150,30 @@
 
 		/* framer */
 		curcmd = get_pending_cmd(wc);
-		if (!curcmd) {
-			curcmd = &wc->dummy;
+		if (curcmd) {
+			curcmd->cs_slot = slot; 
+			curcmd->ident = wc->txident;
+
+			address = curcmd->address;
+			data = curcmd->data;
+			flags = curcmd->flags;
+		} else {
 			/* If nothing else, use filler */
-			curcmd->address = 0x4a;
-			curcmd->data = 0x00;
-			curcmd->flags = __CMD_RD;
-		}
-		curcmd->cs_slot = slot; 
-		curcmd->ident = wc->txident;
-		if (curcmd->flags & __CMD_WR)
+			address = 0x4a;
+			data = 0;
+			flags = __CMD_RD;
+		}
+		
+		if (flags & __CMD_WR)
 			writechunk[CMD_BYTE(slot,0,0)] = 0x0c; /* 0c write command */
-		else if (curcmd->flags & __CMD_LEDS)
-			writechunk[CMD_BYTE(slot,0,0)] = 0x10 | ((curcmd->address) & 0x0E); /* led set command */ 
-		else if (curcmd->flags & __CMD_PINS)
+		else if (flags & __CMD_LEDS)
+			writechunk[CMD_BYTE(slot,0,0)] = 0x10 | ((address) & 0x0E); /* led set command */ 
+		else if (flags & __CMD_PINS)
 			writechunk[CMD_BYTE(slot,0,0)] = 0x30; /* CPLD2 pin state */
 		else
 			writechunk[CMD_BYTE(slot,0,0)] = 0x0a; /* read command */ 
-		writechunk[CMD_BYTE(slot,1,0)] = curcmd->address;
-		writechunk[CMD_BYTE(slot,2,0)] = curcmd->data;
+		writechunk[CMD_BYTE(slot,1,0)] = address;
+		writechunk[CMD_BYTE(slot,2,0)] = data;
 	} 
 
 }
@@ -604,11 +582,10 @@
 	struct t1 *wc = span->pvt;
 
 	/* Do we want to SYNC on receive or not */
-	wc->sync = lc->sync;
-	if (wc->sync)
-		wc->ctlreg |= 0x80;
+	if (lc->sync)
+		set_bit(7, &wc->ctlreg);
 	else
-		wc->ctlreg &= ~0x80;
+		clear_bit(7, &wc->ctlreg);
 
 	/* If already running, apply changes immediately */
 	if (test_bit(DAHDI_FLAGBIT_RUNNING, &span->flags))
@@ -911,6 +888,7 @@
 static int t1_software_init(struct t1 *wc)
 {
 	int x;
+	int num;
 	struct pci_dev* dev;
 
 	dev = voicebus_get_pci_dev(wc->vb);
@@ -928,9 +906,9 @@
 
 	t4_serial_setup(wc);
 
-	wc->num = x;
-	sprintf(wc->span.name, "WCT1/%d", wc->num);
-	snprintf(wc->span.desc, sizeof(wc->span.desc) - 1, "%s Card %d", wc->variety, wc->num);
+	num = x;
+	sprintf(wc->span.name, "WCT1/%d", num);
+	snprintf(wc->span.desc, sizeof(wc->span.desc) - 1, "%s Card %d", wc->variety, num);
 	wc->span.manufacturer = "Digium";
 	strncpy(wc->span.devicetype, wc->variety, sizeof(wc->span.devicetype) - 1);
 
@@ -975,7 +953,7 @@
 	wc->span.pvt = wc;
 	init_waitqueue_head(&wc->span.maintq);
 	for (x = 0; x < wc->span.channels; x++) {
-		sprintf(wc->chans[x]->name, "WCT1/%d/%d", wc->num, x + 1);
+		sprintf(wc->chans[x]->name, "WCT1/%d/%d", num, x + 1);
 		wc->chans[x]->sigcap = DAHDI_SIG_EM | DAHDI_SIG_CLEAR | DAHDI_SIG_EM_E1 | 
 				      DAHDI_SIG_FXSLS | DAHDI_SIG_FXSGS | DAHDI_SIG_MTP2 |
 				      DAHDI_SIG_FXSKS | DAHDI_SIG_FXOLS | DAHDI_SIG_DACS_RBS |
@@ -1024,13 +1002,6 @@
 	}
 	debug_printk(1, "spantype: %s\n", wc->spantype==1 ? "T1" : "E1");
 	
-	if (wc->spantype == TYPE_E1) {
-		if (unchannelized)
-			wc->chanmap = chanmap_e1uc;
-		else
-			wc->chanmap = chanmap_e1;
-	} else
-		wc->chanmap = chanmap_t1;
 	/* what version of the FALC are we using? */
 	reg = t1_setreg(wc, 0x4a, 0xaa);
 	reg = t1_getreg(wc, 0x4a);
@@ -1049,10 +1020,10 @@
 	t1_vpm150m_init(wc);
 	if (wc->vpm150m) {
 		module_printk("VPM present and operational (Firmware version %x)\n", wc->vpm150m->version);
-		wc->ctlreg |= 0x10; /* turn on vpm (RX audio from vpm module) */
+		set_bit(4, &wc->ctlreg); /* turn on vpm (RX audio from vpm module) */
 		if (vpmtsisupport) {
 			debug_printk(1, "enabling VPM TSI pin\n");
-			wc->ctlreg |= 0x01; /* turn on vpm timeslot interchange pin */
+			set_bit(0, &wc->ctlreg); /* turn on vpm timeslot interchange pin */
 		}
 	}
 #endif

Modified: linux/team/sruffell/dahdi-linux-cmdqueue/drivers/dahdi/wcte12xp/wcte12xp.h
URL: http://svn.digium.com/svn-view/dahdi/linux/team/sruffell/dahdi-linux-cmdqueue/drivers/dahdi/wcte12xp/wcte12xp.h?view=diff&rev=6039&r1=6038&r2=6039
==============================================================================
--- linux/team/sruffell/dahdi-linux-cmdqueue/drivers/dahdi/wcte12xp/wcte12xp.h (original)
+++ linux/team/sruffell/dahdi-linux-cmdqueue/drivers/dahdi/wcte12xp/wcte12xp.h Tue Feb 24 19:04:19 2009
@@ -112,27 +112,20 @@
 		unsigned int sendingyellow:1;
 	} flags;
 	unsigned char txsigs[16];  /* Copy of tx sig registers */
-	int num;
 	int alarmcount;			/* How much red alarm we've seen */
-	int alarmdebounce;
 	char *variety;
 	char name[80];
-	int sync;
 	unsigned long blinktimer;
-	int alarms_read;
-	int checktiming;	/* Set >0 to cause the timing source to be checked */
 	int loopupcnt;
 	int loopdowncnt;
 	atomic_t initialized;
 	unsigned long alarmtimer;
-	int *chanmap;
 	unsigned char ledstate;
 	unsigned char ec_chunk1[32][DAHDI_CHUNKSIZE];
 	unsigned char ec_chunk2[32][DAHDI_CHUNKSIZE];
 	struct dahdi_span span;						/* Span */
 	struct dahdi_chan *chans[32];					/* Channels */
-	struct command dummy;	/* preallocate for dummy noop command */
-	unsigned char ctlreg;
+	unsigned long ctlreg;
 	struct voicebus* vb;
 	atomic_t txints;
 #ifdef VPM_SUPPORT
@@ -145,7 +138,6 @@
 	/* Preallocted memory for the commands. TODO remove this. */
 	struct command cmds[MAX_COMMANDS];
 	
-	/* The lists we're interested in. */
 	spinlock_t cmd_list_lock;
 	struct list_head pending_cmds;
 	struct list_head active_cmds;




More information about the svn-commits mailing list