diff options
author | Kalle Valo <kvalo@qca.qualcomm.com> | 2012-03-07 20:04:00 +0200 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2012-03-07 20:04:00 +0200 |
commit | b51f92e09ab63f49bb32769cc3a7d0d49ffefcdf (patch) | |
tree | 46d64af4d3383b5dfea1b4722fc6eff0502c7b4c /drivers/net/wireless/ath | |
parent | 05aab177a9a231455d8dfcb71c7179da0985e7f8 (diff) | |
download | blackbird-op-linux-b51f92e09ab63f49bb32769cc3a7d0d49ffefcdf.tar.gz blackbird-op-linux-b51f92e09ab63f49bb32769cc3a7d0d49ffefcdf.zip |
ath6kl: make ath6kl_bmi_[read|write]_hi32() endian safe
ath6kl_bmi_[read|write]_hi32() did not have endian support, fix that.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/bmi.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/bmi.h b/drivers/net/wireless/ath/ath6kl/bmi.h index 3c5b382a3529..18fdd69e1f71 100644 --- a/drivers/net/wireless/ath/ath6kl/bmi.h +++ b/drivers/net/wireless/ath/ath6kl/bmi.h @@ -225,18 +225,25 @@ struct ath6kl_bmi_target_info { #define ath6kl_bmi_write_hi32(ar, item, val) \ ({ \ - u32 addr, v; \ + u32 addr; \ + __le32 v; \ + \ addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \ - v = val; \ + v = cpu_to_le32(val); \ ath6kl_bmi_write(ar, addr, (u8 *) &v, sizeof(v)); \ }) #define ath6kl_bmi_read_hi32(ar, item, val) \ ({ \ u32 addr, *check_type = val; \ + __le32 tmp; \ + int ret; \ + \ (void) (check_type == val); \ addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \ - ath6kl_bmi_read(ar, addr, (u8 *) val, 4); \ + ret = ath6kl_bmi_read(ar, addr, (u8 *) &tmp, 4); \ + *val = le32_to_cpu(tmp); \ + ret; \ }) int ath6kl_bmi_init(struct ath6kl *ar); |