From 86952759dcdb07b5cada67f976d4d8eb14b55ebf Mon Sep 17 00:00:00 2001 From: markster Date: Fri, 29 Apr 2005 23:04:34 +0000 Subject: Fix TDM card with big endian architectures (Mac, ARM) git-svn-id: http://svn.digium.com/svn/zaptel/trunk@633 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- wctdm.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'wctdm.c') diff --git a/wctdm.c b/wctdm.c index c0de7cf..128b9ed 100755 --- a/wctdm.c +++ b/wctdm.c @@ -379,6 +379,16 @@ static inline void wctdm_transmitprep(struct wctdm *wc, unsigned char ints) for (x=0;xcardflag & (1 << 3)) + writechunk[x] |= (wc->chans[3].writechunk[x]); + if (wc->cardflag & (1 << 2)) + writechunk[x] |= (wc->chans[2].writechunk[x] << 8); + if (wc->cardflag & (1 << 1)) + writechunk[x] |= (wc->chans[1].writechunk[x] << 16); + if (wc->cardflag & (1 << 0)) + writechunk[x] |= (wc->chans[0].writechunk[x] << 24); +#else if (wc->cardflag & (1 << 3)) writechunk[x] |= (wc->chans[3].writechunk[x] << 24); if (wc->cardflag & (1 << 2)) @@ -387,7 +397,7 @@ static inline void wctdm_transmitprep(struct wctdm *wc, unsigned char ints) writechunk[x] |= (wc->chans[1].writechunk[x] << 8); if (wc->cardflag & (1 << 0)) writechunk[x] |= (wc->chans[0].writechunk[x]); - +#endif } } @@ -454,6 +464,16 @@ static inline void wctdm_receiveprep(struct wctdm *wc, unsigned char ints) /* Read is at interrupt address. Valid data is available at normal offset */ readchunk = wc->readchunk; for (x=0;xcardflag & (1 << 3)) + wc->chans[3].readchunk[x] = (readchunk[x]) & 0xff; + if (wc->cardflag & (1 << 2)) + wc->chans[2].readchunk[x] = (readchunk[x] >> 8) & 0xff; + if (wc->cardflag & (1 << 1)) + wc->chans[1].readchunk[x] = (readchunk[x] >> 16) & 0xff; + if (wc->cardflag & (1 << 0)) + wc->chans[0].readchunk[x] = (readchunk[x] >> 24) & 0xff; +#else if (wc->cardflag & (1 << 3)) wc->chans[3].readchunk[x] = (readchunk[x] >> 24) & 0xff; if (wc->cardflag & (1 << 2)) @@ -462,6 +482,7 @@ static inline void wctdm_receiveprep(struct wctdm *wc, unsigned char ints) wc->chans[1].readchunk[x] = (readchunk[x] >> 8) & 0xff; if (wc->cardflag & (1 << 0)) wc->chans[0].readchunk[x] = (readchunk[x]) & 0xff; +#endif } #ifdef AUDIO_RINGCHECK for (x=0;xcards;x++) -- cgit v1.2.3