Changeset 159 for trunk

Show
Ignore:
Timestamp:
10/09/07 02:09:38 (15 months ago)
Author:
dragorn
Message:

Added patches for win32 native headers and def to generate lib and exp
files on win32

Location:
trunk
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/tx80211.h

    r158 r159  
    120120 * bitmasks. 
    121121 */ 
     122 
     123#ifdef _MSC_VER 
     124#pragma pack(push, 1) 
     125#endif 
    122126 
    123127struct tx80211_radiotap_header { 
     
    146150        uint16_t wr_chan_freq;          /* Frequency flags */ 
    147151        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; 
    149159 
    150160#define TX80211_RTAP_PRESENT (1 << TX_IEEE80211_RADIOTAP_FLAGS | \ 
     
    258268 
    259269/* 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 
    260292#define tx80211_swap16(x) \ 
    261293({ \ 
     
    290322}) 
    291323 
     324#endif 
     325 
    292326/* Byteswap magic for turning an element into the endian format 
    293327 * that the driver expects it to be.  These are known to be accurate 
     
    296330 * These are to be used to flip bits when building packet structs. 
    297331 */ 
     332#ifdef _MSC_VER 
     333static tx80211_endian16(struct tx80211 *x, uint16_t y) 
     334#else 
    298335static inline tx80211_endian16(struct tx80211 *x, uint16_t y) 
     336#endif 
    299337{ 
    300338        switch (x->injectortype) { 
     
    302340        case INJ_HOSTAP: 
    303341                return tx80211_be16(y); 
    304                 break; 
    305342        case INJ_PRISM54: 
    306343        case INJ_MADWIFIOLD: 
    307344                return tx80211_le16(y); 
    308                 break; 
    309345        } 
    310346        return y; 
    311347} 
    312  
     348#ifdef _MSC_VER 
     349static tx80211_endian32(struct tx80211 *x, uint32_t y) 
     350#else 
    313351static inline tx80211_endian32(struct tx80211 *x, uint32_t y) 
     352#endif 
    314353{ 
    315354        switch (x->injectortype) { 
     
    317356        case INJ_HOSTAP: 
    318357                return tx80211_be32(y); 
    319                 break; 
    320358        case INJ_PRISM54: 
    321359        case INJ_MADWIFIOLD: 
    322360                return tx80211_le32(y); 
    323                 break; 
    324361        } 
    325362        return y; 
    326363} 
    327364 
     365#ifdef _MSC_VER 
     366static tx80211_endian64(struct tx80211 *x, uint64_t y) 
     367#else 
    328368static inline tx80211_endian64(struct tx80211 *x, uint64_t y) 
     369#endif 
    329370{ 
    330371        switch (x->injectortype) { 
     
    332373        case INJ_HOSTAP: 
    333374                return tx80211_be64(y); 
    334                 break; 
    335375        case INJ_PRISM54: 
    336376        case INJ_MADWIFIOLD: 
    337377                return tx80211_le64(y); 
    338                 break; 
    339378        } 
    340379        return y;