diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2007-12-21 22:02:23 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:09:07 -0500 |
commit | 8160c031491015299afacb95a1c1113ccbfefe54 (patch) | |
tree | bdcf60ff2542dbafc8a0b9bb6d267d556772ba11 | |
parent | 184a3b2c517531faac80b0d74c423dd26038cfd2 (diff) |
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) | |||
48 | const struct firmware *fw_entry = NULL; | 48 | const struct firmware *fw_entry = NULL; |
49 | __le32 reg; | 49 | __le32 reg; |
50 | int err; | 50 | int err; |
51 | u32 *data; | 51 | __le32 *data; |
52 | u32 remains, left, device_addr; | 52 | u32 remains, left, device_addr; |
53 | 53 | ||
54 | P54P_WRITE(int_enable, 0); | 54 | P54P_WRITE(int_enable, cpu_to_le32(0)); |
55 | P54P_READ(int_enable); | 55 | P54P_READ(int_enable); |
56 | udelay(10); | 56 | udelay(10); |
57 | 57 | ||
@@ -82,7 +82,7 @@ static int p54p_upload_firmware(struct ieee80211_hw *dev) | |||
82 | 82 | ||
83 | p54_parse_firmware(dev, fw_entry); | 83 | p54_parse_firmware(dev, fw_entry); |
84 | 84 | ||
85 | data = (u32 *) fw_entry->data; | 85 | data = (__le32 *) fw_entry->data; |
86 | remains = fw_entry->size; | 86 | remains = fw_entry->size; |
87 | device_addr = ISL38XX_DEV_FIRMWARE_ADDR; | 87 | device_addr = ISL38XX_DEV_FIRMWARE_ADDR; |
88 | while (remains) { | 88 | while (remains) { |
@@ -166,7 +166,7 @@ static int p54p_read_eeprom(struct ieee80211_hw *dev) | |||
166 | } | 166 | } |
167 | 167 | ||
168 | memset(ring_control, 0, sizeof(*ring_control)); | 168 | memset(ring_control, 0, sizeof(*ring_control)); |
169 | P54P_WRITE(ring_control_base, priv->ring_control_dma); | 169 | P54P_WRITE(ring_control_base, cpu_to_le32(priv->ring_control_dma)); |
170 | P54P_READ(ring_control_base); | 170 | P54P_READ(ring_control_base); |
171 | udelay(10); | 171 | udelay(10); |
172 | 172 | ||
@@ -229,7 +229,7 @@ static int p54p_read_eeprom(struct ieee80211_hw *dev) | |||
229 | 229 | ||
230 | out: | 230 | out: |
231 | kfree(eeprom); | 231 | kfree(eeprom); |
232 | P54P_WRITE(int_enable, 0); | 232 | P54P_WRITE(int_enable, cpu_to_le32(0)); |
233 | P54P_READ(int_enable); | 233 | P54P_READ(int_enable); |
234 | udelay(10); | 234 | udelay(10); |
235 | free_irq(priv->pdev->irq, priv); | 235 | free_irq(priv->pdev->irq, priv); |
@@ -288,7 +288,7 @@ static irqreturn_t p54p_interrupt(int irq, void *dev_id) | |||
288 | 288 | ||
289 | spin_lock(&priv->lock); | 289 | spin_lock(&priv->lock); |
290 | reg = P54P_READ(int_ident); | 290 | reg = P54P_READ(int_ident); |
291 | if (unlikely(reg == 0xFFFFFFFF)) { | 291 | if (unlikely(reg == cpu_to_le32(0xFFFFFFFF))) { |
292 | spin_unlock(&priv->lock); | 292 | spin_unlock(&priv->lock); |
293 | return IRQ_HANDLED; | 293 | return IRQ_HANDLED; |
294 | } | 294 | } |
@@ -425,7 +425,7 @@ static int p54p_open(struct ieee80211_hw *dev) | |||
425 | 425 | ||
426 | p54p_upload_firmware(dev); | 426 | p54p_upload_firmware(dev); |
427 | 427 | ||
428 | P54P_WRITE(ring_control_base, priv->ring_control_dma); | 428 | P54P_WRITE(ring_control_base, cpu_to_le32(priv->ring_control_dma)); |
429 | P54P_READ(ring_control_base); | 429 | P54P_READ(ring_control_base); |
430 | wmb(); | 430 | wmb(); |
431 | udelay(10); | 431 | udelay(10); |
@@ -465,7 +465,7 @@ static void p54p_stop(struct ieee80211_hw *dev) | |||
465 | unsigned int i; | 465 | unsigned int i; |
466 | struct p54p_desc *desc; | 466 | struct p54p_desc *desc; |
467 | 467 | ||
468 | P54P_WRITE(int_enable, 0); | 468 | P54P_WRITE(int_enable, cpu_to_le32(0)); |
469 | P54P_READ(int_enable); | 469 | P54P_READ(int_enable); |
470 | udelay(10); | 470 | udelay(10); |
471 | 471 | ||
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 { | |||
85 | struct p54p_desc tx_mgmt[4]; | 85 | struct p54p_desc tx_mgmt[4]; |
86 | } __attribute__ ((packed)); | 86 | } __attribute__ ((packed)); |
87 | 87 | ||
88 | #define P54P_READ(r) __raw_readl(&priv->map->r) | 88 | #define P54P_READ(r) (__force __le32)__raw_readl(&priv->map->r) |
89 | #define P54P_WRITE(r, val) __raw_writel((__force u32)(val), &priv->map->r) | 89 | #define P54P_WRITE(r, val) __raw_writel((__force u32)(__le32)(val), &priv->map->r) |
90 | 90 | ||
91 | struct p54p_priv { | 91 | struct p54p_priv { |
92 | struct p54_common common; | 92 | struct p54_common common; |