[dahdi-commits] sruffell: linux/trunk r9779 - in /linux/trunk/drivers/dahdi: voicebus/ wctdm2...
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Mon Feb 28 08:19:19 CST 2011
Author: sruffell
Date: Mon Feb 28 08:19:17 2011
New Revision: 9779
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9779
Log:
wcte12xp, wctdm24xxp: Minor fixes for big endian host architectures.
Signed-off-by: Shaun Ruffell <sruffell at digium.com>
Modified:
linux/trunk/drivers/dahdi/voicebus/voicebus.c
linux/trunk/drivers/dahdi/wctdm24xxp/base.c
Modified: linux/trunk/drivers/dahdi/voicebus/voicebus.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/voicebus/voicebus.c?view=diff&rev=9779&r1=9778&r2=9779
==============================================================================
--- linux/trunk/drivers/dahdi/voicebus/voicebus.c (original)
+++ linux/trunk/drivers/dahdi/voicebus/voicebus.c Mon Feb 28 08:19:17 2011
@@ -92,7 +92,7 @@
#define CSR9_MMC 0x00040000
#define CSR9_MDI 0x00080000
-#define OWN_BIT (1 << 31)
+#define OWN_BIT cpu_to_le32(1 << 31)
#ifdef CONFIG_VOICEBUS_ECREFERENCE
@@ -268,7 +268,7 @@
memset(dl->desc, 0, (sizeof(*d) + dl->padding) * DRING_SIZE);
for (i = 0; i < DRING_SIZE; ++i) {
d = vb_descriptor(dl, i);
- d->des1 = des1;
+ d->des1 = cpu_to_le32(des1);
}
d->des1 |= cpu_to_le32(END_OF_RING);
atomic_set(&dl->count, 0);
@@ -321,7 +321,7 @@
for (i = 0; i < DRING_SIZE; ++i) {
d = vb_descriptor(dl, i);
- d->des1 = des1;
+ d->des1 = cpu_to_le32(des1);
dl->pending[i] = NULL;
d->buffer1 = 0;
}
@@ -478,14 +478,15 @@
for (i = 0; i < DRING_SIZE; ++i) {
d = vb_descriptor(dl, i);
- if (d->buffer1 && (d->buffer1 != vb->idle_vbb_dma_addr)) {
+ if (d->buffer1 &&
+ (d->buffer1 != le32_to_cpu(vb->idle_vbb_dma_addr))) {
WARN_ON(!dl->pending[i]);
vbb = dl->pending[i];
dma_pool_free(vb->pool, vbb, vbb->dma_addr);
}
if (NORMAL == vb->mode) {
- d->des1 |= 0x80000000;
- d->buffer1 = vb->idle_vbb_dma_addr;
+ d->des1 |= cpu_to_le32(0x80000000);
+ d->buffer1 = cpu_to_le32(vb->idle_vbb_dma_addr);
dl->pending[i] = vb->idle_vbb;
SET_OWNED(d);
} else {
@@ -724,7 +725,7 @@
dl->pending[tail] = vbb;
dl->tail = (++tail) & DRING_MASK;
- d->buffer1 = vbb->dma_addr;
+ d->buffer1 = cpu_to_le32(vbb->dma_addr);
SET_OWNED(d); /* That's it until the hardware is done with it. */
atomic_inc(&dl->count);
return 0;
@@ -737,7 +738,8 @@
d = vb_descriptor(dl, dl->tail);
- if (unlikely((d->buffer1 != vb->idle_vbb_dma_addr) && d->buffer1)) {
+ if (unlikely((le32_to_cpu(d->buffer1) != vb->idle_vbb_dma_addr) &&
+ d->buffer1)) {
if (printk_ratelimit())
dev_warn(&vb->pdev->dev, "Dropping tx buffer buffer\n");
dma_pool_free(vb->pool, vbb, vbb->dma_addr);
@@ -748,7 +750,7 @@
}
dl->pending[dl->tail] = vbb;
- d->buffer1 = vbb->dma_addr;
+ d->buffer1 = cpu_to_le32(vbb->dma_addr);
dl->tail = (dl->tail + 1) & DRING_MASK;
SET_OWNED(d); /* That's it until the hardware is done with it. */
atomic_inc(&dl->count);
@@ -895,10 +897,10 @@
dump_descriptor(struct voicebus *vb, struct voicebus_descriptor *d)
{
VB_PRINTK(vb, DEBUG, "Displaying descriptor at address %08x\n", (unsigned int)d);
- VB_PRINTK(vb, DEBUG, " des0: %08x\n", d->des0);
- VB_PRINTK(vb, DEBUG, " des1: %08x\n", d->des1);
- VB_PRINTK(vb, DEBUG, " buffer1: %08x\n", d->buffer1);
- VB_PRINTK(vb, DEBUG, " container: %08x\n", d->container);
+ VB_PRINTK(vb, DEBUG, " des0: %08x\n", le32_to_cpu(d->des0));
+ VB_PRINTK(vb, DEBUG, " des1: %08x\n", le32_to_cpu(d->des1));
+ VB_PRINTK(vb, DEBUG, " buffer1: %08x\n", le32_to_cpu(d->buffer1));
+ VB_PRINTK(vb, DEBUG, " container: %08x\n", le32_to_cpu(d->container));
}
static void
@@ -941,12 +943,13 @@
d = vb_descriptor(dl, head);
- if (OWNED(d) || !d->buffer1 || (d->buffer1 == vb->idle_vbb_dma_addr))
+ if (OWNED(d) || !d->buffer1 ||
+ (le32_to_cpu(d->buffer1) == vb->idle_vbb_dma_addr))
return NULL;
vbb = dl->pending[head];
if (NORMAL == vb->mode) {
- d->buffer1 = vb->idle_vbb_dma_addr;
+ d->buffer1 = cpu_to_le32(vb->idle_vbb_dma_addr);
dl->pending[head] = vb->idle_vbb;
SET_OWNED(d);
} else {
@@ -1477,7 +1480,7 @@
behind = 2;
while (!OWNED(d)) {
- if (d->buffer1 != vb->idle_vbb_dma_addr)
+ if (le32_to_cpu(d->buffer1) != vb->idle_vbb_dma_addr)
goto tx_error_exit;
SET_OWNED(d);
dl->head = (dl->head + 1) & DRING_MASK;
@@ -1507,7 +1510,7 @@
vb_increase_latency(vb, behind, &buffers);
d = vb_descriptor(dl, dl->head);
while (!OWNED(d)) {
- if (d->buffer1 != vb->idle_vbb_dma_addr) {
+ if (le32_to_cpu(d->buffer1) != vb->idle_vbb_dma_addr) {
local_irq_restore(flags);
goto tx_error_exit;
}
@@ -1519,7 +1522,7 @@
/* Now we'll get a little further ahead of the hardware. */
for (i = 0; i < 5; ++i) {
d = vb_descriptor(dl, dl->head);
- d->buffer1 = vb->idle_vbb_dma_addr;
+ d->buffer1 = cpu_to_le32(vb->idle_vbb_dma_addr);
dl->pending[dl->head] = vb->idle_vbb;
d->des0 |= OWN_BIT;
dl->head = (dl->head + 1) & DRING_MASK;
@@ -1529,7 +1532,7 @@
}
d = vb_descriptor(dl, dl->tail);
- if (d->buffer1 != vb->idle_vbb_dma_addr)
+ if (le32_to_cpu(d->buffer1) != vb->idle_vbb_dma_addr)
goto tx_error_exit;
/* Now we can send all our buffers together in a group. */
Modified: linux/trunk/drivers/dahdi/wctdm24xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=9779&r1=9778&r2=9779
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wctdm24xxp/base.c Mon Feb 28 08:19:17 2011
@@ -4212,7 +4212,7 @@
u8 major_ver;
u8 minor_ver;
u8 data[54648];
- u32 chksum;
+ __le32 chksum;
} __attribute__((packed));
static void hx8_send_dummy(struct wctdm *wc)
@@ -4417,7 +4417,7 @@
if ((fw->size != sizeof(*ha8_fw)) ||
(0 != memcmp("DIGIUM", ha8_fw->header, sizeof(ha8_fw->header))) ||
((crc32(~0, (void *)ha8_fw, sizeof(*ha8_fw) - sizeof(u32)) ^ ~0) !=
- ha8_fw->chksum)) {
+ le32_to_cpu(ha8_fw->chksum))) {
dev_warn(dev, "Firmware file is invalid. Skipping load.\n");
ret = 0;
goto cleanup;
More information about the dahdi-commits
mailing list