summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
diff options
context:
space:
mode:
authorRemi Depommier <rde@setrix.com>2020-10-20 13:46:39 -0400
committerKalle Valo <kvalo@codeaurora.org>2020-11-07 17:49:20 +0200
commitd56fd83cf99c5e4b257f5be46531420509ba5066 (patch)
tree0fcb62d8442b412ccee15d3f05e5cb5d89299750 /drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
parent6ac6546973013b4b368cd3d3515f1e853658b6ce (diff)
brcmfmac: fix SDIO access for big-endian host
These full-mac chips use little-endian byte ordering. This patch adds a few missing conversions to/from little-endian so that the driver may be used with a big-endian host. Signed-off-by: Remi Depommier <rde@setrix.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20201020174639.28892-1-rde@setrix.com
Diffstat (limited to 'drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c')
-rw-r--r--drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
index 99987a789e7e..e5b6033fab33 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
@@ -1340,7 +1340,7 @@ static void brcmf_sdio_free_glom(struct brcmf_sdio *bus)
static inline u8 brcmf_sdio_getdatoffset(u8 *swheader)
{
u32 hdrvalue;
- hdrvalue = *(u32 *)swheader;
+ hdrvalue = le32_to_cpu(*(__le32 *)swheader);
return (u8)((hdrvalue & SDPCM_DOFFSET_MASK) >> SDPCM_DOFFSET_SHIFT);
}
@@ -1349,7 +1349,7 @@ static inline bool brcmf_sdio_fromevntchan(u8 *swheader)
u32 hdrvalue;
u8 ret;
- hdrvalue = *(u32 *)swheader;
+ hdrvalue = le32_to_cpu(*(__le32 *)swheader);
ret = (u8)((hdrvalue & SDPCM_CHANNEL_MASK) >> SDPCM_CHANNEL_SHIFT);
return (ret == SDPCM_EVENT_CHANNEL);
@@ -3544,7 +3544,7 @@ static int brcmf_sdio_bus_preinit(struct device *dev)
/* otherwise, set txglomalign */
value = sdiodev->settings->bus.sdio.sd_sgentry_align;
/* SDIO ADMA requires at least 32 bit alignment */
- value = max_t(u32, value, ALIGNMENT);
+ value = cpu_to_le32(max_t(u32, value, ALIGNMENT));
err = brcmf_iovar_data_set(dev, "bus:txglomalign", &value,
sizeof(u32));
}
@@ -3555,7 +3555,7 @@ static int brcmf_sdio_bus_preinit(struct device *dev)
bus->tx_hdrlen = SDPCM_HWHDR_LEN + SDPCM_SWHDR_LEN;
if (sdiodev->sg_support) {
bus->txglom = false;
- value = 1;
+ value = cpu_to_le32(1);
err = brcmf_iovar_data_set(bus->sdiodev->dev, "bus:rxglom",
&value, sizeof(u32));
if (err < 0) {