diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2007-12-22 06:02:23 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-29 02:09:07 +0300 |
commit | 8160c031491015299afacb95a1c1113ccbfefe54 (patch) | |
tree | bdcf60ff2542dbafc8a0b9bb6d267d556772ba11 | |
parent | 184a3b2c517531faac80b0d74c423dd26038cfd2 (diff) | |
download | linux-8160c031491015299afacb95a1c1113ccbfefe54.tar.xz |
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 <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/p54pci.c | 16 | ||||
-rw-r--r-- | 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 b7a3bde0b66d..fa527723fbe0 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 52feb597dc4a..5bedd7af385d 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; |