summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrussell <russell@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-08-02 18:13:11 +0000
committerrussell <russell@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-08-02 18:13:11 +0000
commit33a601cb706a779187946b5539317ac6353d5573 (patch)
treeb57b926f97ccc7d3210f937e57ee80129673a479
parent6fb43e3d95aebe0c31534686ad309deeec740b1f (diff)
merge dual-span card fixes from head
git-svn-id: http://svn.digium.com/svn/zaptel/branches/v1-0@714 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rwxr-xr-xwct4xxp.c4
-rwxr-xr-xzaptel.c20
2 files changed, 13 insertions, 11 deletions
diff --git a/wct4xxp.c b/wct4xxp.c
index 0146677..b6350ea 100755
--- a/wct4xxp.c
+++ b/wct4xxp.c
@@ -2511,7 +2511,7 @@ static int __devinit t4_launch(struct t4 *wc)
printk("TE%dXXP: Launching card: %d\n", wc->numspans, wc->order);
/* Setup serial parameters and system interface */
- for (x=0;x<wc->numspans;x++)
+ for (x=0;x<4;x++)
t4_serial_setup(wc, x);
if (zt_register(&wc->tspans[0]->span, 0)) {
@@ -2653,7 +2653,7 @@ static int __devinit t4_init_one(struct pci_dev *pdev, const struct pci_device_i
#endif
/* Allocate pieces we need here */
- for (x=0;x<wc->numspans;x++) {
+ for (x=0;x<4;x++) {
if (wc->t1e1 & (1 << x)) {
wc->tspans[x] = kmalloc(sizeof(struct t4_span) + sizeof(struct zt_chan) * 31, GFP_KERNEL);
if (wc->tspans[x]) {
diff --git a/zaptel.c b/zaptel.c
index fcfedc1..714fc66 100755
--- a/zaptel.c
+++ b/zaptel.c
@@ -470,9 +470,6 @@ static int zaptel_proc_read(char *page, char **start, off_t off, int count, int
/* In Linux 2.6, this MUST NOT EXECEED 1024 bytes in one read! */
- if (off > 0)
- return 0;
-
span = (long)data;
if (!span)
@@ -552,15 +549,20 @@ static int zaptel_proc_read(char *page, char **start, off_t off, int count, int
if (chans[x]->nextslave && chans[x]->master->channo == x)
len += sprintf(page + len, "Master ");
}
+ }
+ if ((chans[x]->flags & ZT_FLAG_OPEN)) {
+ len += sprintf(page + len, "(In use) ");
+ }
+ len += sprintf(page + len, "\n");
}
- if ((chans[x]->flags & ZT_FLAG_OPEN)) {
- len += sprintf(page + len, "(In use) ");
- }
- len += sprintf(page + len, "\n");
-
+ if ( len <= off ) /* If everything printed so far is before beginning of request */
+ {
+ off -= len;
+ len = 0;
}
}
}
+ *start = page + off;
return len;
}
#endif
@@ -2428,7 +2430,7 @@ ioctl_load_zone(unsigned long data)
next[x] = td.next;
/* Make sure the "next" one is sane */
if ((next[x] >= th.count) || (next[x] < 0)) {
- printk("Invalid 'next' pointer\n");
+ printk("Invalid 'next' pointer: %d\n", next[x]);
kfree(slab);
return -EINVAL;
}