wl1271: fix endianess issues
We were not handling endianess correctly. The wl1271 chip runs on little-endian values. This patch makes sure that all the communication with the wl1271 firmware is done in little-endian by using cpu_to_le* and le*_to_cpu where appropriate. Also, all the struct definitions for data exchanged with the firmware has been changed to use __le16/32 types instead of u16/32. This fixes a few sparse warnings, such as these: drivers/net/wireless/wl12xx/wl1271_cmd.c:554:42: warning: incorrect type in assignment (different base types) drivers/net/wireless/wl12xx/wl1271_cmd.c:555:42: warning: incorrect type in assignment (different base types) drivers/net/wireless/wl12xx/wl1271_cmd.c:577:58: warning: incorrect type in assignment (different base types) drivers/net/wireless/wl12xx/wl1271_cmd.c:579:58: warning: incorrect type in assignment (different base types) drivers/net/wireless/wl12xx/wl1271_cmd.c:676:18: warning: incorrect type in assignment (different base types) drivers/net/wireless/wl12xx/wl1271_cmd.c:787:22: warning: incorrect type in assignment (different base types) drivers/net/wireless/wl12xx/wl1271_cmd.c:789:21: warning: incorrect type in assignment (different base types) drivers/net/wireless/wl12xx/wl1271_tx.c:98:47: warning: incorrect type in argument 1 (different base types) drivers/net/wireless/wl12xx/wl1271_acx.c:932:32: warning: incorrect type in assignment (different base types) drivers/net/wireless/wl12xx/wl1271_boot.c:191:32: warning: incorrect type in argument 1 (different base types) drivers/net/wireless/wl12xx/wl1271_boot.c:197:38: warning: incorrect type in argument 1 (different base types) drivers/net/wireless/wl12xx/wl1271_boot.c:199:37: warning: incorrect type in argument 1 (different base types) drivers/net/wireless/wl12xx/wl1271_init.c:255:40: warning: incorrect type in assignment (different base types) drivers/net/wireless/wl12xx/wl1271_init.c:275:53: warning: incorrect type in assignment (different base types) Reported-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committad av
John W. Linville

förälder
0b5b72da1b
incheckning
d0f63b2021
@@ -188,15 +188,15 @@ static int wl1271_boot_upload_firmware(struct wl1271 *wl)
|
||||
u8 *fw;
|
||||
|
||||
fw = wl->fw;
|
||||
chunks = be32_to_cpup((u32 *) fw);
|
||||
chunks = be32_to_cpup((__be32 *) fw);
|
||||
fw += sizeof(u32);
|
||||
|
||||
wl1271_debug(DEBUG_BOOT, "firmware chunks to be uploaded: %u", chunks);
|
||||
|
||||
while (chunks--) {
|
||||
addr = be32_to_cpup((u32 *) fw);
|
||||
addr = be32_to_cpup((__be32 *) fw);
|
||||
fw += sizeof(u32);
|
||||
len = be32_to_cpup((u32 *) fw);
|
||||
len = be32_to_cpup((__be32 *) fw);
|
||||
fw += sizeof(u32);
|
||||
|
||||
if (len > 300000) {
|
||||
|
Referens i nytt ärende
Block a user