From f11777d1a323daf29ff336e6a5aed84d8198b360 Mon Sep 17 00:00:00 2001 From: markster Date: Sat, 29 Jun 2002 18:08:17 +0000 Subject: Version 0.2.0 from FTP git-svn-id: http://svn.digium.com/svn/zaptel/trunk@89 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- wcfxsusb.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'wcfxsusb.c') 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; - + } -- cgit v1.2.3