summaryrefslogtreecommitdiff
path: root/wcfxsusb.c
diff options
context:
space:
mode:
Diffstat (limited to 'wcfxsusb.c')
-rwxr-xr-xwcfxsusb.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/wcfxsusb.c b/wcfxsusb.c
index 1857f72..7b0f615 100755
--- a/wcfxsusb.c
+++ b/wcfxsusb.c
@@ -527,7 +527,7 @@ static int wcusb_async_write(struct wc_usb_pvt *p, unsigned char index, unsigned
__u16 ind = index;
memset(urb, 0, sizeof(urb_t));
-
+
p->dr.requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE;
p->dr.request = REQUEST_NORMAL;
p->dr.value = 0;
@@ -948,9 +948,9 @@ static void wcusb_do_io(struct wc_usb_pvt *p, struct urb *out, struct urb *in)
switch (p->sample) {
case STREAM_NORMAL:
for (x = 0; x < ZT_CHUNKSIZE; x++) {
- p->chan.readchunk[x] = ZT_LIN2MU(ichunk[x]);
+ p->chan.readchunk[x] = ZT_LIN2MU(le16_to_cpu(ichunk[x]));
}
-
+
break;
case STREAM_DTMF:
for (x = 0; x < ZT_CHUNKSIZE; x++) {
@@ -960,12 +960,14 @@ static void wcusb_do_io(struct wc_usb_pvt *p, struct urb *out, struct urb *in)
}
/* Work with Zaptel now */
+ /* XXX Might be able to optimize this some XXX */
+ zt_ec_chunk(&p->chan, p->chan.readchunk, p->chan.writechunk);
zt_receive(&p->span);
zt_transmit(&p->span);
/* Fill in transmission info */
for (x = 0; x < ZT_CHUNKSIZE; x++) {
- ochunk[x] = ZT_MULAW(p->chan.writechunk[x]);
+ ochunk[x] = ZT_MULAW(cpu_to_le16(p->chan.writechunk[x]));
}
/* Transmit the pending outgoing urb */
@@ -1147,7 +1149,7 @@ static int InitPrivate(struct wc_usb_pvt *p)
p->datawrite[x].urb.iso_frame_desc[0].offset = 0;
p->datawrite[x].urb.transfer_buffer = p->writechunk + ZT_CHUNKSIZE * x;
p->datawrite[x].urb.transfer_buffer_length = ZT_CHUNKSIZE * 2;
-
+
}