aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/brcm80211/include/bcmendian.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2010-10-07 20:04:47 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-07 20:04:47 -0400
commit7d4df48eba4cea654ee6fe6e1a51a0600807ed7b (patch)
tree7c4e3cbb7d576ac3a0b273b5908bbed460eceb0a /drivers/staging/brcm80211/include/bcmendian.h
parent4128dd9afb986321edf0baa8a3aaa3c7c5aa3730 (diff)
Staging: brcm80211: s/uint16/u16/
Use the kernel types, don't invent your own. Cc: Brett Rudley <brudley@broadcom.com> Cc: Henry Ptasinski <henryp@broadcom.com> Cc: Nohee Ko <noheek@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/brcm80211/include/bcmendian.h')
-rw-r--r--drivers/staging/brcm80211/include/bcmendian.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/staging/brcm80211/include/bcmendian.h b/drivers/staging/brcm80211/include/bcmendian.h
index cad2720f99b..6a9ca37664f 100644
--- a/drivers/staging/brcm80211/include/bcmendian.h
+++ b/drivers/staging/brcm80211/include/bcmendian.h
@@ -21,8 +21,8 @@
21 21
22/* Reverse the bytes in a 16-bit value */ 22/* Reverse the bytes in a 16-bit value */
23#define BCMSWAP16(val) \ 23#define BCMSWAP16(val) \
24 ((uint16)((((uint16)(val) & (uint16)0x00ffU) << 8) | \ 24 ((u16)((((u16)(val) & (u16)0x00ffU) << 8) | \
25 (((uint16)(val) & (uint16)0xff00U) >> 8))) 25 (((u16)(val) & (u16)0xff00U) >> 8)))
26 26
27/* Reverse the bytes in a 32-bit value */ 27/* Reverse the bytes in a 32-bit value */
28#define BCMSWAP32(val) \ 28#define BCMSWAP32(val) \
@@ -82,8 +82,8 @@
82#define ltoh16_buf(buf, i) 82#define ltoh16_buf(buf, i)
83#define htol16_buf(buf, i) 83#define htol16_buf(buf, i)
84#else 84#else
85#define ltoh16_buf(buf, i) bcmswap16_buf((uint16 *)(buf), (i)) 85#define ltoh16_buf(buf, i) bcmswap16_buf((u16 *)(buf), (i))
86#define htol16_buf(buf, i) bcmswap16_buf((uint16 *)(buf), (i)) 86#define htol16_buf(buf, i) bcmswap16_buf((u16 *)(buf), (i))
87#endif /* IL_BIGENDIAN */ 87#endif /* IL_BIGENDIAN */
88 88
89/* Unaligned loads and stores in host byte order */ 89/* Unaligned loads and stores in host byte order */
@@ -106,13 +106,13 @@
106 106
107#define ltoh_ua(ptr) \ 107#define ltoh_ua(ptr) \
108 (sizeof(*(ptr)) == sizeof(u8) ? *(const u8 *)(ptr) : \ 108 (sizeof(*(ptr)) == sizeof(u8) ? *(const u8 *)(ptr) : \
109 sizeof(*(ptr)) == sizeof(uint16) ? _LTOH16_UA((const u8 *)(ptr)) : \ 109 sizeof(*(ptr)) == sizeof(u16) ? _LTOH16_UA((const u8 *)(ptr)) : \
110 sizeof(*(ptr)) == sizeof(uint32) ? _LTOH32_UA((const u8 *)(ptr)) : \ 110 sizeof(*(ptr)) == sizeof(uint32) ? _LTOH32_UA((const u8 *)(ptr)) : \
111 *(u8 *)0) 111 *(u8 *)0)
112 112
113#define ntoh_ua(ptr) \ 113#define ntoh_ua(ptr) \
114 (sizeof(*(ptr)) == sizeof(u8) ? *(const u8 *)(ptr) : \ 114 (sizeof(*(ptr)) == sizeof(u8) ? *(const u8 *)(ptr) : \
115 sizeof(*(ptr)) == sizeof(uint16) ? _NTOH16_UA((const u8 *)(ptr)) : \ 115 sizeof(*(ptr)) == sizeof(u16) ? _NTOH16_UA((const u8 *)(ptr)) : \
116 sizeof(*(ptr)) == sizeof(uint32) ? _NTOH32_UA((const u8 *)(ptr)) : \ 116 sizeof(*(ptr)) == sizeof(uint32) ? _NTOH32_UA((const u8 *)(ptr)) : \
117 *(u8 *)0) 117 *(u8 *)0)
118 118
@@ -123,7 +123,7 @@
123 */ 123 */
124 124
125#define bcmswap16(val) ({ \ 125#define bcmswap16(val) ({ \
126 uint16 _val = (val); \ 126 u16 _val = (val); \
127 BCMSWAP16(_val); \ 127 BCMSWAP16(_val); \
128}) 128})
129 129
@@ -138,7 +138,7 @@
138}) 138})
139 139
140#define bcmswap16_buf(buf, len) ({ \ 140#define bcmswap16_buf(buf, len) ({ \
141 uint16 *_buf = (uint16 *)(buf); \ 141 u16 *_buf = (u16 *)(buf); \
142 uint _wds = (len) / 2; \ 142 uint _wds = (len) / 2; \
143 while (_wds--) { \ 143 while (_wds--) { \
144 *_buf = bcmswap16(*_buf); \ 144 *_buf = bcmswap16(*_buf); \
@@ -147,7 +147,7 @@
147}) 147})
148 148
149#define htol16_ua_store(val, bytes) ({ \ 149#define htol16_ua_store(val, bytes) ({ \
150 uint16 _val = (val); \ 150 u16 _val = (val); \
151 u8 *_bytes = (u8 *)(bytes); \ 151 u8 *_bytes = (u8 *)(bytes); \
152 _bytes[0] = _val & 0xff; \ 152 _bytes[0] = _val & 0xff; \
153 _bytes[1] = _val >> 8; \ 153 _bytes[1] = _val >> 8; \
@@ -163,7 +163,7 @@
163}) 163})
164 164
165#define hton16_ua_store(val, bytes) ({ \ 165#define hton16_ua_store(val, bytes) ({ \
166 uint16 _val = (val); \ 166 u16 _val = (val); \
167 u8 *_bytes = (u8 *)(bytes); \ 167 u8 *_bytes = (u8 *)(bytes); \
168 _bytes[0] = _val >> 8; \ 168 _bytes[0] = _val >> 8; \
169 _bytes[1] = _val & 0xff; \ 169 _bytes[1] = _val & 0xff; \
@@ -201,7 +201,7 @@
201#else /* !__GNUC__ */ 201#else /* !__GNUC__ */
202 202
203/* Inline versions avoid referencing the argument multiple times */ 203/* Inline versions avoid referencing the argument multiple times */
204static inline uint16 bcmswap16(uint16 val) 204static inline u16 bcmswap16(u16 val)
205{ 205{
206 return BCMSWAP16(val); 206 return BCMSWAP16(val);
207} 207}
@@ -219,7 +219,7 @@ static inline uint32 bcmswap32by16(uint32 val)
219/* Reverse pairs of bytes in a buffer (not for high-performance use) */ 219/* Reverse pairs of bytes in a buffer (not for high-performance use) */
220/* buf - start of buffer of shorts to swap */ 220/* buf - start of buffer of shorts to swap */
221/* len - byte length of buffer */ 221/* len - byte length of buffer */
222static inline void bcmswap16_buf(uint16 *buf, uint len) 222static inline void bcmswap16_buf(u16 *buf, uint len)
223{ 223{
224 len = len / 2; 224 len = len / 2;
225 225
@@ -232,7 +232,7 @@ static inline void bcmswap16_buf(uint16 *buf, uint len)
232/* 232/*
233 * Store 16-bit value to unaligned little-endian byte array. 233 * Store 16-bit value to unaligned little-endian byte array.
234 */ 234 */
235static inline void htol16_ua_store(uint16 val, u8 *bytes) 235static inline void htol16_ua_store(u16 val, u8 *bytes)
236{ 236{
237 bytes[0] = val & 0xff; 237 bytes[0] = val & 0xff;
238 bytes[1] = val >> 8; 238 bytes[1] = val >> 8;
@@ -252,7 +252,7 @@ static inline void htol32_ua_store(uint32 val, u8 *bytes)
252/* 252/*
253 * Store 16-bit value to unaligned network-(big-)endian byte array. 253 * Store 16-bit value to unaligned network-(big-)endian byte array.
254 */ 254 */
255static inline void hton16_ua_store(uint16 val, u8 *bytes) 255static inline void hton16_ua_store(u16 val, u8 *bytes)
256{ 256{
257 bytes[0] = val >> 8; 257 bytes[0] = val >> 8;
258 bytes[1] = val & 0xff; 258 bytes[1] = val & 0xff;
@@ -272,7 +272,7 @@ static inline void hton32_ua_store(uint32 val, u8 *bytes)
272/* 272/*
273 * Load 16-bit value from unaligned little-endian byte array. 273 * Load 16-bit value from unaligned little-endian byte array.
274 */ 274 */
275static inline uint16 ltoh16_ua(const void *bytes) 275static inline u16 ltoh16_ua(const void *bytes)
276{ 276{
277 return _LTOH16_UA((const u8 *)bytes); 277 return _LTOH16_UA((const u8 *)bytes);
278} 278}
@@ -288,7 +288,7 @@ static inline uint32 ltoh32_ua(const void *bytes)
288/* 288/*
289 * Load 16-bit value from unaligned big-(network-)endian byte array. 289 * Load 16-bit value from unaligned big-(network-)endian byte array.
290 */ 290 */
291static inline uint16 ntoh16_ua(const void *bytes) 291static inline u16 ntoh16_ua(const void *bytes)
292{ 292{
293 return _NTOH16_UA((const u8 *)bytes); 293 return _NTOH16_UA((const u8 *)bytes);
294} 294}