summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwmeadows <wmeadows@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-08-28 19:53:19 +0000
committerwmeadows <wmeadows@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-08-28 19:53:19 +0000
commit6a0ba1704a3cf9d030e863e17b8530361ff4da5d (patch)
tree051e42699799a0159a013e8914a12af9fbbb6621
parenta6713c85dc21d91ec426a8ee731146bf7ef67caf (diff)
1. Add SubVendorID
2. Reverse Order of TDM Slots to Module Locations git-svn-id: http://svn.digium.com/svn/zaptel/trunk@236 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rwxr-xr-xwcfxs.c33
-rwxr-xr-xwctdm.c33
2 files changed, 34 insertions, 32 deletions
diff --git a/wcfxs.c b/wcfxs.c
index 8406cdd..28f5bfc 100755
--- a/wcfxs.c
+++ b/wcfxs.c
@@ -201,14 +201,14 @@ static inline void wcfxs_transmitprep(struct wcfxs *wc, unsigned char ints)
for (x=0;x<ZT_CHUNKSIZE;x++) {
/* Send a sample, as a 32-bit word */
writechunk[x] = 0;
- if (wc->cardflag & (1 << 0))
- writechunk[x] |= (wc->chans[0].writechunk[x] << 24);
- if (wc->cardflag & (1 << 1))
- writechunk[x] |= (wc->chans[1].writechunk[x] << 16);
- if (wc->cardflag & (1 << 2))
- writechunk[x] |= (wc->chans[2].writechunk[x] << 8);
if (wc->cardflag & (1 << 3))
- writechunk[x] |= (wc->chans[3].writechunk[x]);
+ writechunk[x] |= (wc->chans[3].writechunk[x] << 24);
+ if (wc->cardflag & (1 << 2))
+ writechunk[x] |= (wc->chans[2].writechunk[x] << 16);
+ if (wc->cardflag & (1 << 1))
+ writechunk[x] |= (wc->chans[1].writechunk[x] << 8);
+ if (wc->cardflag & (1 << 0))
+ writechunk[x] |= (wc->chans[0].writechunk[x]);
}
@@ -225,14 +225,14 @@ static inline void wcfxs_receiveprep(struct wcfxs *wc, unsigned char ints)
/* Read is at interrupt address. Valid data is available at normal offset */
readchunk = wc->readchunk;
for (x=0;x<ZT_CHUNKSIZE;x++) {
- if (wc->cardflag & (1 << 0))
- wc->chans[0].readchunk[x] = (readchunk[x] >> 24) & 0xff;
- if (wc->cardflag & (1 << 1))
- wc->chans[1].readchunk[x] = (readchunk[x] >> 16) & 0xff;
- if (wc->cardflag & (1 << 2))
- wc->chans[2].readchunk[x] = (readchunk[x] >> 8) & 0xff;
if (wc->cardflag & (1 << 3))
- wc->chans[3].readchunk[x] = (readchunk[x]) & 0xff;
+ wc->chans[3].readchunk[x] = (readchunk[x] >> 24) & 0xff;
+ if (wc->cardflag & (1 << 2))
+ wc->chans[2].readchunk[x] = (readchunk[x] >> 16) & 0xff;
+ if (wc->cardflag & (1 << 1))
+ wc->chans[1].readchunk[x] = (readchunk[x] >> 8) & 0xff;
+ if (wc->cardflag & (1 << 0))
+ wc->chans[0].readchunk[x] = (readchunk[x]) & 0xff;
}
/* XXX We're wasting 8 taps. We should get closer :( */
for (x=0;x<wc->cards;x++) {
@@ -764,9 +764,9 @@ static int wcfxs_init_proslic(struct wcfxs *wc, int card)
wcfxs_setreg(wc, card, 1, 0x28);
// U-Law 8-bit interface
- wcfxs_setreg(wc, card, 2, card * 8); // Tx Start count low byte 0
+ wcfxs_setreg(wc, card, 2, (3-card) * 8); // Tx Start count low byte 0
wcfxs_setreg(wc, card, 3, 0); // Tx Start count high byte 0
- wcfxs_setreg(wc, card, 4, card * 8); // Rx Start count low byte 0
+ wcfxs_setreg(wc, card, 4, (3-card) * 8); // Rx Start count low byte 0
wcfxs_setreg(wc, card, 5, 0); // Rx Start count high byte 0
wcfxs_setreg(wc, card, 18, 0xff); // clear all interrupt
wcfxs_setreg(wc, card, 19, 0xff);
@@ -1283,6 +1283,7 @@ static void __devexit wcfxs_remove_one(struct pci_dev *pdev)
static struct pci_device_id wcfxs_pci_tbl[] __devinitdata = {
{ 0xe159, 0x0001, 0xa159, PCI_ANY_ID, 0, 0, (unsigned long) &wcfxs },
{ 0xe159, 0x0001, 0xe159, PCI_ANY_ID, 0, 0, (unsigned long) &wcfxs },
+ { 0xe159, 0x0001, 0xb100, PCI_ANY_ID, 0, 0, (unsigned long) &wcfxs },
};
static struct pci_driver wcfxs_driver = {
diff --git a/wctdm.c b/wctdm.c
index 8406cdd..28f5bfc 100755
--- a/wctdm.c
+++ b/wctdm.c
@@ -201,14 +201,14 @@ static inline void wcfxs_transmitprep(struct wcfxs *wc, unsigned char ints)
for (x=0;x<ZT_CHUNKSIZE;x++) {
/* Send a sample, as a 32-bit word */
writechunk[x] = 0;
- if (wc->cardflag & (1 << 0))
- writechunk[x] |= (wc->chans[0].writechunk[x] << 24);
- if (wc->cardflag & (1 << 1))
- writechunk[x] |= (wc->chans[1].writechunk[x] << 16);
- if (wc->cardflag & (1 << 2))
- writechunk[x] |= (wc->chans[2].writechunk[x] << 8);
if (wc->cardflag & (1 << 3))
- writechunk[x] |= (wc->chans[3].writechunk[x]);
+ writechunk[x] |= (wc->chans[3].writechunk[x] << 24);
+ if (wc->cardflag & (1 << 2))
+ writechunk[x] |= (wc->chans[2].writechunk[x] << 16);
+ if (wc->cardflag & (1 << 1))
+ writechunk[x] |= (wc->chans[1].writechunk[x] << 8);
+ if (wc->cardflag & (1 << 0))
+ writechunk[x] |= (wc->chans[0].writechunk[x]);
}
@@ -225,14 +225,14 @@ static inline void wcfxs_receiveprep(struct wcfxs *wc, unsigned char ints)
/* Read is at interrupt address. Valid data is available at normal offset */
readchunk = wc->readchunk;
for (x=0;x<ZT_CHUNKSIZE;x++) {
- if (wc->cardflag & (1 << 0))
- wc->chans[0].readchunk[x] = (readchunk[x] >> 24) & 0xff;
- if (wc->cardflag & (1 << 1))
- wc->chans[1].readchunk[x] = (readchunk[x] >> 16) & 0xff;
- if (wc->cardflag & (1 << 2))
- wc->chans[2].readchunk[x] = (readchunk[x] >> 8) & 0xff;
if (wc->cardflag & (1 << 3))
- wc->chans[3].readchunk[x] = (readchunk[x]) & 0xff;
+ wc->chans[3].readchunk[x] = (readchunk[x] >> 24) & 0xff;
+ if (wc->cardflag & (1 << 2))
+ wc->chans[2].readchunk[x] = (readchunk[x] >> 16) & 0xff;
+ if (wc->cardflag & (1 << 1))
+ wc->chans[1].readchunk[x] = (readchunk[x] >> 8) & 0xff;
+ if (wc->cardflag & (1 << 0))
+ wc->chans[0].readchunk[x] = (readchunk[x]) & 0xff;
}
/* XXX We're wasting 8 taps. We should get closer :( */
for (x=0;x<wc->cards;x++) {
@@ -764,9 +764,9 @@ static int wcfxs_init_proslic(struct wcfxs *wc, int card)
wcfxs_setreg(wc, card, 1, 0x28);
// U-Law 8-bit interface
- wcfxs_setreg(wc, card, 2, card * 8); // Tx Start count low byte 0
+ wcfxs_setreg(wc, card, 2, (3-card) * 8); // Tx Start count low byte 0
wcfxs_setreg(wc, card, 3, 0); // Tx Start count high byte 0
- wcfxs_setreg(wc, card, 4, card * 8); // Rx Start count low byte 0
+ wcfxs_setreg(wc, card, 4, (3-card) * 8); // Rx Start count low byte 0
wcfxs_setreg(wc, card, 5, 0); // Rx Start count high byte 0
wcfxs_setreg(wc, card, 18, 0xff); // clear all interrupt
wcfxs_setreg(wc, card, 19, 0xff);
@@ -1283,6 +1283,7 @@ static void __devexit wcfxs_remove_one(struct pci_dev *pdev)
static struct pci_device_id wcfxs_pci_tbl[] __devinitdata = {
{ 0xe159, 0x0001, 0xa159, PCI_ANY_ID, 0, 0, (unsigned long) &wcfxs },
{ 0xe159, 0x0001, 0xe159, PCI_ANY_ID, 0, 0, (unsigned long) &wcfxs },
+ { 0xe159, 0x0001, 0xb100, PCI_ANY_ID, 0, 0, (unsigned long) &wcfxs },
};
static struct pci_driver wcfxs_driver = {