[svn-commits] mattf: branch 1.4 r3244 - in /branches/1.4: ./ wctdm24xxp/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Nov 21 17:52:51 CST 2007


Author: mattf
Date: Wed Nov 21 17:52:50 2007
New Revision: 3244

URL: http://svn.digium.com/view/zaptel?view=rev&rev=3244
Log:
Merged revisions 3243 via svnmerge from 
https://origsvn.digium.com/svn/zaptel/branches/1.2

........
r3243 | mattf | 2007-11-21 17:51:48 -0600 (Wed, 21 Nov 2007) | 1 line

Add new product support
........

Modified:
    branches/1.4/   (props changed)
    branches/1.4/wctdm24xxp/base.c
    branches/1.4/wctdm24xxp/wctdm24xxp.h

Propchange: branches/1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: branches/1.4/wctdm24xxp/base.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/wctdm24xxp/base.c?view=diff&rev=3244&r1=3243&r2=3244
==============================================================================
--- branches/1.4/wctdm24xxp/base.c (original)
+++ branches/1.4/wctdm24xxp/base.c Wed Nov 21 17:52:50 2007
@@ -252,6 +252,7 @@
 
 static struct wctdm_desc wctdm2400 = { "Wildcard TDM2400P", 0, 24 };
 static struct wctdm_desc wctdm800 = { "Wildcard TDM800P", 0, 8 };
+static struct wctdm_desc wctdm410 = { "Wildcard TDM410P", 0, 4 };
 static struct wctdm_desc wcaex2400 = { "Wildcard AEX2400", 0, 24 };
 static struct wctdm_desc wcaex800 = { "Wildcard AEX800", 0, 8 };
 
@@ -291,6 +292,23 @@
 #endif
 
 static int wctdm_init_proslic(struct wctdm *wc, int card, int fast , int manual, int sane);
+
+static inline int CMD_BYTE(int card, int bit, int altcs)
+{
+	/* Let's add some trickery to make the TDM410 work */
+	if (altcs == 3) {
+		if (card == 2) {
+			card = 4;
+			altcs = 0;
+		} else if (card == 3) {
+			card = 5;
+			altcs = 2;
+		}
+	}
+
+	return (((((card) & 0x3) * 3 + (bit)) * 7) \
+			+ ((card) >> 2) + (altcs) + ((altcs) ? -21 : 0));
+}
 
 /* sleep in user space until woken up. Equivilant of tsleep() in BSD */
 int schluffen(wait_queue_head_t *q)
@@ -764,6 +782,16 @@
 		if (x < ZT_CHUNKSIZE - 1) {
 			writechunk[EFRAME_SIZE] = wc->ctlreg;
 			writechunk[EFRAME_SIZE + 1] = wc->txident++;
+#if 1
+			if ((wc->type == 4) && ((wc->ctlreg & 0x10) || (wc->modtype[NUM_CARDS] == MOD_TYPE_NONE))) {
+				writechunk[EFRAME_SIZE + 2] = 0;
+				for (y = 0; y < 4; y++) {
+					if (wc->modtype[y] == MOD_TYPE_NONE)
+						writechunk[EFRAME_SIZE + 2] |= (1 << y);
+				}
+			} else
+				writechunk[EFRAME_SIZE + 2] = 0xf;
+#endif
 		}
 		writechunk += (EFRAME_SIZE + EFRAME_GAP);
 	}
@@ -3916,11 +3944,17 @@
  				wc->cardflag |= 1 << x;
  				printk("Port %d: Installed -- QRV DRI card\n",x + 1);
 			} else {
- 				if ((wc->type == 8) && ((x & 0x3) == 1) && !wc->altcs[x]) {
+ 				if ((wc->type != 24) && ((x & 0x3) == 1) && !wc->altcs[x]) {
  					spin_lock_irqsave(&wc->reglock, flags);
+					wc->altcs[x] = 2;
+					if (wc->type == 4) {
+						wc->altcs[x+1] = 3;
+						wc->altcs[x+2] = 3;
+					}
  					wc->modtype[x] = MOD_TYPE_FXSINIT;
- 					wc->altcs[x] = 2;
  					spin_unlock_irqrestore(&wc->reglock, flags);
+				
+ 					schluffen(&wc->regq);
  					schluffen(&wc->regq);
  					spin_lock_irqsave(&wc->reglock, flags);
  					wc->modtype[x] = MOD_TYPE_FXS;
@@ -3928,7 +3962,7 @@
  					if (debug & DEBUG_CARD)
  						printk("Trying port %d with alternate chip select\n", x + 1);
  					goto retry;
- 				} else {
+				} else {
  					printk("Port %d: Not installed\n", x + 1);
  					wc->modtype[x] = MOD_TYPE_NONE;
  					wc->cardflag |= (1 << x);
@@ -3943,7 +3977,7 @@
 		wc->ctlreg |= 0x10;
 	} else {
 		spin_lock_irqsave(&wc->reglock, flags);
-		for (x = wc->cards; x < wc->cards+NUM_EC; x++)
+		for (x = NUM_CARDS; x < NUM_CARDS + NUM_EC; x++)
 			wc->modtype[x] = MOD_TYPE_NONE;
 		spin_unlock_irqrestore(&wc->reglock, flags);
 		wctdm_vpm150m_init(wc);
@@ -4151,6 +4185,7 @@
 	{ 0xd161, 0x0800, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (unsigned long) &wctdm800 },
 	{ 0xd161, 0x8002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (unsigned long) &wcaex800 },
 	{ 0xd161, 0x8003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (unsigned long) &wcaex2400 },
+	{ 0xd161, 0x8005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (unsigned long) &wctdm410 },
 	{ 0 }
 };
 

Modified: branches/1.4/wctdm24xxp/wctdm24xxp.h
URL: http://svn.digium.com/view/zaptel/branches/1.4/wctdm24xxp/wctdm24xxp.h?view=diff&rev=3244&r1=3243&r2=3244
==============================================================================
--- branches/1.4/wctdm24xxp/wctdm24xxp.h (original)
+++ branches/1.4/wctdm24xxp/wctdm24xxp.h Wed Nov 21 17:52:50 2007
@@ -57,8 +57,10 @@
 #define CMD_WR(a,b) (((a) << 8) | (b) | __CMD_WR)
 #define CMD_RD(a) (((a) << 8) | __CMD_RD)
 
+#if 0
 #define CMD_BYTE(card,bit,altcs) (((((card) & 0x3) * 3 + (bit)) * 7) \
 			+ ((card) >> 2) + (altcs) + ((altcs) ? -21 : 0))
+#endif
 #define NUM_CARDS 24
 #define NUM_EC	  4
 #define NUM_SLOTS 6




More information about the svn-commits mailing list