diff options
author | Luciano Coelho <luciano.coelho@nokia.com> | 2009-10-15 03:33:29 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-27 16:48:19 -0400 |
commit | d0f63b202146f3281800ee44823740c8bbf38f11 (patch) | |
tree | e6cfd9e31039674135c5727cc192b3d4270a457d /drivers/net/wireless/wl12xx/wl1271_tx.h | |
parent | 0b5b72da1b21fe61926318dd842f6dd7c8862e9f (diff) |
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>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_tx.h')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_tx.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_tx.h b/drivers/net/wireless/wl12xx/wl1271_tx.h index 4a614067ddba..416396caf0a0 100644 --- a/drivers/net/wireless/wl12xx/wl1271_tx.h +++ b/drivers/net/wireless/wl12xx/wl1271_tx.h | |||
@@ -58,7 +58,7 @@ | |||
58 | 58 | ||
59 | struct wl1271_tx_hw_descr { | 59 | struct wl1271_tx_hw_descr { |
60 | /* Length of packet in words, including descriptor+header+data */ | 60 | /* Length of packet in words, including descriptor+header+data */ |
61 | u16 length; | 61 | __le16 length; |
62 | /* Number of extra memory blocks to allocate for this packet in | 62 | /* Number of extra memory blocks to allocate for this packet in |
63 | addition to the number of blocks derived from the packet length */ | 63 | addition to the number of blocks derived from the packet length */ |
64 | u8 extra_mem_blocks; | 64 | u8 extra_mem_blocks; |
@@ -67,12 +67,12 @@ struct wl1271_tx_hw_descr { | |||
67 | HW!! */ | 67 | HW!! */ |
68 | u8 total_mem_blocks; | 68 | u8 total_mem_blocks; |
69 | /* Device time (in us) when the packet arrived to the driver */ | 69 | /* Device time (in us) when the packet arrived to the driver */ |
70 | u32 start_time; | 70 | __le32 start_time; |
71 | /* Max delay in TUs until transmission. The last device time the | 71 | /* Max delay in TUs until transmission. The last device time the |
72 | packet can be transmitted is: startTime+(1024*LifeTime) */ | 72 | packet can be transmitted is: startTime+(1024*LifeTime) */ |
73 | u16 life_time; | 73 | __le16 life_time; |
74 | /* Bitwise fields - see TX_ATTR... definitions above. */ | 74 | /* Bitwise fields - see TX_ATTR... definitions above. */ |
75 | u16 tx_attr; | 75 | __le16 tx_attr; |
76 | /* Packet identifier used also in the Tx-Result. */ | 76 | /* Packet identifier used also in the Tx-Result. */ |
77 | u8 id; | 77 | u8 id; |
78 | /* The packet TID value (as User-Priority) */ | 78 | /* The packet TID value (as User-Priority) */ |
@@ -100,12 +100,12 @@ struct wl1271_tx_hw_res_descr { | |||
100 | several possible reasons for failure. */ | 100 | several possible reasons for failure. */ |
101 | u8 status; | 101 | u8 status; |
102 | /* Total air access duration including all retrys and overheads.*/ | 102 | /* Total air access duration including all retrys and overheads.*/ |
103 | u16 medium_usage; | 103 | __le16 medium_usage; |
104 | /* The time passed from host xfer to Tx-complete.*/ | 104 | /* The time passed from host xfer to Tx-complete.*/ |
105 | u32 fw_handling_time; | 105 | __le32 fw_handling_time; |
106 | /* Total media delay | 106 | /* Total media delay |
107 | (from 1st EDCA AIFS counter until TX Complete). */ | 107 | (from 1st EDCA AIFS counter until TX Complete). */ |
108 | u32 medium_delay; | 108 | __le32 medium_delay; |
109 | /* LS-byte of last TKIP seq-num (saved per AC for recovery). */ | 109 | /* LS-byte of last TKIP seq-num (saved per AC for recovery). */ |
110 | u8 lsb_security_sequence_number; | 110 | u8 lsb_security_sequence_number; |
111 | /* Retry count - number of transmissions without successful ACK.*/ | 111 | /* Retry count - number of transmissions without successful ACK.*/ |
@@ -118,8 +118,8 @@ struct wl1271_tx_hw_res_descr { | |||
118 | } __attribute__ ((packed)); | 118 | } __attribute__ ((packed)); |
119 | 119 | ||
120 | struct wl1271_tx_hw_res_if { | 120 | struct wl1271_tx_hw_res_if { |
121 | u32 tx_result_fw_counter; | 121 | __le32 tx_result_fw_counter; |
122 | u32 tx_result_host_counter; | 122 | __le32 tx_result_host_counter; |
123 | struct wl1271_tx_hw_res_descr tx_results_queue[TX_HW_RESULT_QUEUE_LEN]; | 123 | struct wl1271_tx_hw_res_descr tx_results_queue[TX_HW_RESULT_QUEUE_LEN]; |
124 | } __attribute__ ((packed)); | 124 | } __attribute__ ((packed)); |
125 | 125 | ||