diff options
author | mattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-11-21 23:52:50 +0000 |
---|---|---|
committer | mattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-11-21 23:52:50 +0000 |
commit | 260c1d0070decc8d89eac32243fa7ada2acffb1f (patch) | |
tree | 532d7bc1ef55690c5ee6c774ed086748dde30fd6 /wctdm24xxp | |
parent | 642b8c97336f2f6d923ce5a1d086dc76a65340c8 (diff) |
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
........
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@3244 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wctdm24xxp')
-rw-r--r-- | wctdm24xxp/base.c | 43 | ||||
-rw-r--r-- | wctdm24xxp/wctdm24xxp.h | 2 |
2 files changed, 41 insertions, 4 deletions
diff --git a/wctdm24xxp/base.c b/wctdm24xxp/base.c index f951eb4..5f53ad0 100644 --- a/wctdm24xxp/base.c +++ b/wctdm24xxp/base.c @@ -252,6 +252,7 @@ struct wctdm_desc { 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 }; @@ -292,6 +293,23 @@ static const char *vpm150m_firmware = "zaptel-fw-vpmadt032.bin"; 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 @@ static inline void wctdm_transmitprep(struct wctdm *wc, int dbl) 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 @@ retry: 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 @@ retry: 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 @@ retry: 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 @@ static struct pci_device_id wctdm_pci_tbl[] = { { 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 } }; diff --git a/wctdm24xxp/wctdm24xxp.h b/wctdm24xxp/wctdm24xxp.h index 16260cb..61291d7 100644 --- a/wctdm24xxp/wctdm24xxp.h +++ b/wctdm24xxp/wctdm24xxp.h @@ -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 |