Legend:
- Unmodified
- Added
- Removed
-
trunk/tx80211.h
r158 r159 120 120 * bitmasks. 121 121 */ 122 123 #ifdef _MSC_VER 124 #pragma pack(push, 1) 125 #endif 122 126 123 127 struct tx80211_radiotap_header { … … 146 150 uint16_t wr_chan_freq; /* Frequency flags */ 147 151 uint16_t wr_chan_flags; /* Modulation flags */ 148 } __attribute__((__packed__)); 152 } 153 #ifdef _MSC_VER 154 #pragma pack(pop) 155 #else 156 __attribute__((__packed__)) 157 #endif 158 ; 149 159 150 160 #define TX80211_RTAP_PRESENT (1 << TX_IEEE80211_RADIOTAP_FLAGS | \ … … 258 268 259 269 /* Swap magic */ 270 #ifdef _MSC_VER 271 272 #define tx80211_swap16(x) (uint16_t)( \ 273 (((uint16_t)(x) & 0x00ff) << 8) | (((uint16_t)(x) & 0xff00) >> 8)) 274 275 #define tx80211_swap32(x) (uint32_t)( \ 276 (((uint32_t)(x) & (uint32_t)0x000000ff) << 24) | \ 277 (((uint32_t)(x) & (uint32_t)0x0000ff00) << 8) | \ 278 (((uint32_t)(x) & (uint32_t)0x00ff0000) >> 8) | \ 279 (((uint32_t)(x) & (uint32_t)0xff000000) >> 24) ) 280 281 #define tx80211_swap64(x) (uint64_t)( \ 282 (((uint64_t)(x) & (uint64_t)0x00000000000000ffULL) << 56) | \ 283 (((uint64_t)(x) & (uint64_t)0x000000000000ff00ULL) << 40) | \ 284 (((uint64_t)(x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \ 285 (((uint64_t)(x) & (uint64_t)0x00000000ff000000ULL) << 8) | \ 286 (((uint64_t)(x) & (uint64_t)0x000000ff00000000ULL) >> 8) | \ 287 (((uint64_t)(x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \ 288 (((uint64_t)(x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \ 289 (((uint64_t)(x) & (uint64_t)0xff00000000000000ULL) >> 56) ) 290 #else 291 260 292 #define tx80211_swap16(x) \ 261 293 ({ \ … … 290 322 }) 291 323 324 #endif 325 292 326 /* Byteswap magic for turning an element into the endian format 293 327 * that the driver expects it to be. These are known to be accurate … … 296 330 * These are to be used to flip bits when building packet structs. 297 331 */ 332 #ifdef _MSC_VER 333 static tx80211_endian16(struct tx80211 *x, uint16_t y) 334 #else 298 335 static inline tx80211_endian16(struct tx80211 *x, uint16_t y) 336 #endif 299 337 { 300 338 switch (x->injectortype) { … … 302 340 case INJ_HOSTAP: 303 341 return tx80211_be16(y); 304 break;305 342 case INJ_PRISM54: 306 343 case INJ_MADWIFIOLD: 307 344 return tx80211_le16(y); 308 break;309 345 } 310 346 return y; 311 347 } 312 348 #ifdef _MSC_VER 349 static tx80211_endian32(struct tx80211 *x, uint32_t y) 350 #else 313 351 static inline tx80211_endian32(struct tx80211 *x, uint32_t y) 352 #endif 314 353 { 315 354 switch (x->injectortype) { … … 317 356 case INJ_HOSTAP: 318 357 return tx80211_be32(y); 319 break;320 358 case INJ_PRISM54: 321 359 case INJ_MADWIFIOLD: 322 360 return tx80211_le32(y); 323 break;324 361 } 325 362 return y; 326 363 } 327 364 365 #ifdef _MSC_VER 366 static tx80211_endian64(struct tx80211 *x, uint64_t y) 367 #else 328 368 static inline tx80211_endian64(struct tx80211 *x, uint64_t y) 369 #endif 329 370 { 330 371 switch (x->injectortype) { … … 332 373 case INJ_HOSTAP: 333 374 return tx80211_be64(y); 334 break;335 375 case INJ_PRISM54: 336 376 case INJ_MADWIFIOLD: 337 377 return tx80211_le64(y); 338 break;339 378 } 340 379 return y;
