rtl8188eu: Replace several local size defines/typedefs with kernel header version

These include the following:

SIZE_T => size_t
SSIZE_T => ssize_t
SIZE_PTR => size_t

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2013-07-24 12:19:14 -05:00
parent 41ad3e27c6
commit 2685b52404
18 changed files with 58 additions and 63 deletions

View file

@ -36,15 +36,10 @@ typedef signed int sint;
typedef void (*proc_t)(void*);
typedef __kernel_size_t SIZE_T;
typedef __kernel_ssize_t SSIZE_T;
#define FIELD_OFFSET(s,field) ((SSIZE_T)&((s*)(0))->field)
#define FIELD_OFFSET(s,field) ((ssize_t)&((s*)(0))->field)
#define MEM_ALIGNMENT_OFFSET (sizeof (SIZE_T))
#define MEM_ALIGNMENT_PADDING (sizeof(SIZE_T) - 1)
#define SIZE_PTR SIZE_T
#define SSIZE_PTR SSIZE_T
#define MEM_ALIGNMENT_OFFSET (sizeof (size_t))
#define MEM_ALIGNMENT_PADDING (sizeof(size_t) - 1)
//port from fw by thomas
// TODO: Belows are Sync from SD7-Driver. It is necessary to check correctness

View file

@ -140,7 +140,7 @@ __inline static _list *get_list_head(_queue *queue)
#define LIST_CONTAINOR(ptr, type, member) \
((type *)((char *)(ptr)-(SIZE_T)(&((type *)0)->member)))
((type *)((char *)(ptr)-(size_t)(&((type *)0)->member)))
__inline static void _enter_critical(_lock *plock, unsigned long *pirqL)

View file

@ -504,7 +504,7 @@ __inline static union recv_frame *rxmem_to_recvframe(u8 *rxmem)
//from any given member of recv_frame.
// rxmem indicates the any member/address in recv_frame
return (union recv_frame*)(((SIZE_PTR)rxmem >> RXFRAME_ALIGN) << RXFRAME_ALIGN);
return (union recv_frame*)(((size_t)rxmem >> RXFRAME_ALIGN) << RXFRAME_ALIGN);
}

View file

@ -350,29 +350,29 @@ enum WIFI_REG_DOMAIN {
*(__le16 *)(pbuf) |= cpu_to_le16(type); \
} while (0)
#define GetSequence(pbuf) (le16_to_cpu(*(__le16 *)((SIZE_PTR)(pbuf) + 22)) >> 4)
#define GetSequence(pbuf) (le16_to_cpu(*(__le16 *)((size_t)(pbuf) + 22)) >> 4)
#define GetFragNum(pbuf) (le16_to_cpu(*(__le16 *)((SIZE_PTR)(pbuf) + 22)) & 0x0f)
#define GetFragNum(pbuf) (le16_to_cpu(*(__le16 *)((size_t)(pbuf) + 22)) & 0x0f)
#define GetTupleCache(pbuf) (cpu_to_le16(*(unsigned short *)((SIZE_PTR)(pbuf) + 22)))
#define GetTupleCache(pbuf) (cpu_to_le16(*(unsigned short *)((size_t)(pbuf) + 22)))
#define SetFragNum(pbuf, num) \
do { \
*(unsigned short *)((SIZE_PTR)(pbuf) + 22) = \
((*(unsigned short *)((SIZE_PTR)(pbuf) + 22)) & le16_to_cpu(~(0x000f))) | \
*(unsigned short *)((size_t)(pbuf) + 22) = \
((*(unsigned short *)((size_t)(pbuf) + 22)) & le16_to_cpu(~(0x000f))) | \
cpu_to_le16(0x0f & (num)); \
} while (0)
#define SetSeqNum(pbuf, num) \
do { \
*(__le16 *)((SIZE_PTR)(pbuf) + 22) = \
((*(__le16 *)((SIZE_PTR)(pbuf) + 22)) & cpu_to_le16((unsigned short)0x000f)) | \
*(__le16 *)((size_t)(pbuf) + 22) = \
((*(__le16 *)((size_t)(pbuf) + 22)) & cpu_to_le16((unsigned short)0x000f)) | \
cpu_to_le16((unsigned short)(0xfff0 & (num << 4))); \
} while (0)
#define SetDuration(pbuf, dur) \
do { \
*(__le16 *)((SIZE_PTR)(pbuf) + 2) = cpu_to_le16(0xffff & (dur)); \
*(__le16 *)((size_t)(pbuf) + 2) = cpu_to_le16(0xffff & (dur)); \
} while (0)
@ -402,19 +402,19 @@ enum WIFI_REG_DOMAIN {
*(__le16 *)(pbuf) |= cpu_to_le16( (amsdu & 1) << 7); \
} while (0)
#define GetAid(pbuf) (le16_to_cpu(*(__le16 *)((SIZE_PTR)(pbuf) + 2)) & 0x3fff)
#define GetAid(pbuf) (le16_to_cpu(*(__le16 *)((size_t)(pbuf) + 2)) & 0x3fff)
#define GetTid(pbuf) (le16_to_cpu(*(__le16 *)((SIZE_PTR)(pbuf) + \
#define GetTid(pbuf) (le16_to_cpu(*(__le16 *)((size_t)(pbuf) + \
(((GetToDs(pbuf)<<1) | GetFrDs(pbuf)) == 3 ? \
30 : 24))) & 0x000f)
#define GetAddr1Ptr(pbuf) ((unsigned char *)((SIZE_PTR)(pbuf) + 4))
#define GetAddr1Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 4))
#define GetAddr2Ptr(pbuf) ((unsigned char *)((SIZE_PTR)(pbuf) + 10))
#define GetAddr2Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 10))
#define GetAddr3Ptr(pbuf) ((unsigned char *)((SIZE_PTR)(pbuf) + 16))
#define GetAddr3Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 16))
#define GetAddr4Ptr(pbuf) ((unsigned char *)((SIZE_PTR)(pbuf) + 24))
#define GetAddr4Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 24))
#define MacAddr_isBcst(addr) \
( \

View file

@ -25,11 +25,11 @@
struct pkt_file {
_pkt *pkt;
SIZE_T pkt_len; //the remainder length of the open_file
size_t pkt_len; //the remainder length of the open_file
_buffer *cur_buffer;
u8 *buf_start;
u8 *cur_addr;
SIZE_T buf_len;
size_t buf_len;
};
#ifdef CONFIG_80211N_HT