From 8160c031491015299afacb95a1c1113ccbfefe54 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 21 Dec 2007 22:02:23 -0500 Subject: [PATCH] p54pci: endianness annotations and fixes ->ring_control_dma is dma_addr_t, needs conversion to little-endian before __raw_writel()... Signed-off-by: Al Viro Signed-off-by: John W. Linville --- drivers/net/wireless/p54pci.c | 16 ++++++++-------- drivers/net/wireless/p54pci.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/p54pci.c b/drivers/net/wireless/p54pci.c index b7a3bde0b66..fa527723fbe 100644 --- a/drivers/net/wireless/p54pci.c +++ b/drivers/net/wireless/p54pci.c @@ -48,10 +48,10 @@ static int p54p_upload_firmware(struct ieee80211_hw *dev) const struct firmware *fw_entry = NULL; __le32 reg; int err; - u32 *data; + __le32 *data; u32 remains, left, device_addr; - P54P_WRITE(int_enable, 0); + P54P_WRITE(int_enable, cpu_to_le32(0)); P54P_READ(int_enable); udelay(10); @@ -82,7 +82,7 @@ static int p54p_upload_firmware(struct ieee80211_hw *dev) p54_parse_firmware(dev, fw_entry); - data = (u32 *) fw_entry->data; + data = (__le32 *) fw_entry->data; remains = fw_entry->size; device_addr = ISL38XX_DEV_FIRMWARE_ADDR; while (remains) { @@ -166,7 +166,7 @@ static int p54p_read_eeprom(struct ieee80211_hw *dev) } memset(ring_control, 0, sizeof(*ring_control)); - P54P_WRITE(ring_control_base, priv->ring_control_dma); + P54P_WRITE(ring_control_base, cpu_to_le32(priv->ring_control_dma)); P54P_READ(ring_control_base); udelay(10); @@ -229,7 +229,7 @@ static int p54p_read_eeprom(struct ieee80211_hw *dev) out: kfree(eeprom); - P54P_WRITE(int_enable, 0); + P54P_WRITE(int_enable, cpu_to_le32(0)); P54P_READ(int_enable); udelay(10); free_irq(priv->pdev->irq, priv); @@ -288,7 +288,7 @@ static irqreturn_t p54p_interrupt(int irq, void *dev_id) spin_lock(&priv->lock); reg = P54P_READ(int_ident); - if (unlikely(reg == 0xFFFFFFFF)) { + if (unlikely(reg == cpu_to_le32(0xFFFFFFFF))) { spin_unlock(&priv->lock); return IRQ_HANDLED; } @@ -425,7 +425,7 @@ static int p54p_open(struct ieee80211_hw *dev) p54p_upload_firmware(dev); - P54P_WRITE(ring_control_base, priv->ring_control_dma); + P54P_WRITE(ring_control_base, cpu_to_le32(priv->ring_control_dma)); P54P_READ(ring_control_base); wmb(); udelay(10); @@ -465,7 +465,7 @@ static void p54p_stop(struct ieee80211_hw *dev) unsigned int i; struct p54p_desc *desc; - P54P_WRITE(int_enable, 0); + P54P_WRITE(int_enable, cpu_to_le32(0)); P54P_READ(int_enable); udelay(10); diff --git a/drivers/net/wireless/p54pci.h b/drivers/net/wireless/p54pci.h index 52feb597dc4..5bedd7af385 100644 --- a/drivers/net/wireless/p54pci.h +++ b/drivers/net/wireless/p54pci.h @@ -85,8 +85,8 @@ struct p54p_ring_control { struct p54p_desc tx_mgmt[4]; } __attribute__ ((packed)); -#define P54P_READ(r) __raw_readl(&priv->map->r) -#define P54P_WRITE(r, val) __raw_writel((__force u32)(val), &priv->map->r) +#define P54P_READ(r) (__force __le32)__raw_readl(&priv->map->r) +#define P54P_WRITE(r, val) __raw_writel((__force u32)(__le32)(val), &priv->map->r) struct p54p_priv { struct p54_common common; -- 2.41.1