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

@ -1349,12 +1349,12 @@ void dhcp_flag_bcast(_adapter *priv, struct sk_buff *skb)
if (iph->protocol == IPPROTO_UDP) /* UDP */
{
struct udphdr *udph = (struct udphdr *)((SIZE_PTR)iph + (iph->ihl << 2));
struct udphdr *udph = (struct udphdr *)((size_t)iph + (iph->ihl << 2));
if ((udph->source == __constant_htons(CLIENT_PORT)) &&
(udph->dest == __constant_htons(SERVER_PORT))) { /* DHCP request */
struct dhcpMessage *dhcph =
(struct dhcpMessage *)((SIZE_PTR)udph + sizeof(struct udphdr));
(struct dhcpMessage *)((size_t)udph + sizeof(struct udphdr));
u32 cookie = be32_to_cpu((__be32)dhcph->cookie);
if (cookie == DHCP_MAGIC) { /* match magic word */

View file

@ -60,7 +60,7 @@ _func_enter_;
goto exit;
}
pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf + CMDBUFF_ALIGN_SZ - ( (SIZE_PTR)(pcmdpriv->cmd_allocated_buf) & (CMDBUFF_ALIGN_SZ-1));
pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf + CMDBUFF_ALIGN_SZ - ( (size_t)(pcmdpriv->cmd_allocated_buf) & (CMDBUFF_ALIGN_SZ-1));
pcmdpriv->rsp_allocated_buf = rtw_zmalloc(MAX_RSPSZ + 4);
@ -69,7 +69,7 @@ _func_enter_;
goto exit;
}
pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ( (SIZE_PTR)(pcmdpriv->rsp_allocated_buf) & 3);
pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ( (size_t)(pcmdpriv->rsp_allocated_buf) & 3);
pcmdpriv->cmd_issued_cnt = pcmdpriv->cmd_done_cnt = pcmdpriv->rsp_cnt = 0;

View file

@ -940,8 +940,8 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame)
sa = GetAddr2Ptr(pframe);
auth_mode = psecuritypriv->dot11AuthAlgrthm;
seq = le16_to_cpu(*(__le16 *)((SIZE_PTR)pframe + WLAN_HDR_A3_LEN + 2));
algorithm = le16_to_cpu(*(__le16 *)((SIZE_PTR)pframe + WLAN_HDR_A3_LEN));
seq = le16_to_cpu(*(__le16 *)((size_t)pframe + WLAN_HDR_A3_LEN + 2));
algorithm = le16_to_cpu(*(__le16 *)((size_t)pframe + WLAN_HDR_A3_LEN));
DBG_88E("auth alg=%x, seq=%X\n", algorithm, seq);
@ -1120,8 +1120,8 @@ unsigned int OnAuthClient(_adapter *padapter, union recv_frame *precv_frame)
offset = (GetPrivacy(pframe))? 4: 0;
seq = le16_to_cpu(*(__le16 *)((SIZE_PTR)pframe + WLAN_HDR_A3_LEN + offset + 2));
status = le16_to_cpu(*(__le16 *)((SIZE_PTR)pframe + WLAN_HDR_A3_LEN + offset + 4));
seq = le16_to_cpu(*(__le16 *)((size_t)pframe + WLAN_HDR_A3_LEN + offset + 2));
status = le16_to_cpu(*(__le16 *)((size_t)pframe + WLAN_HDR_A3_LEN + offset + 4));
if (status != 0) {
DBG_88E("clnt auth fail, status: %d\n", status);

View file

@ -148,7 +148,7 @@ static int init_mp_priv_by_os(struct mp_priv *pmp_priv)
goto _exit_init_mp_priv;
}
pmp_priv->pmp_xmtframe_buf = pmp_priv->pallocated_mp_xmitframe_buf + 4 - ((SIZE_PTR) (pmp_priv->pallocated_mp_xmitframe_buf) & 3);
pmp_priv->pmp_xmtframe_buf = pmp_priv->pallocated_mp_xmitframe_buf + 4 - ((size_t) (pmp_priv->pallocated_mp_xmitframe_buf) & 3);
pmp_xmitframe = (struct mp_xmit_frame*)pmp_priv->pmp_xmtframe_buf;
@ -847,7 +847,7 @@ void SetPacketTx(PADAPTER padapter)
DBG_88E("%s: malloc(%d) fail!!\n", __func__, pmp_priv->tx.buf_size);
return;
}
pmp_priv->tx.buf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pmp_priv->tx.pallocated_buf), XMITBUF_ALIGN_SZ);
pmp_priv->tx.buf = (u8 *)N_BYTE_ALIGMENT((size_t)(pmp_priv->tx.pallocated_buf), XMITBUF_ALIGN_SZ);
ptr = pmp_priv->tx.buf;
desc = &(pmp_priv->tx.desc);
@ -1129,7 +1129,7 @@ void _rtw_mp_xmit_priv (struct xmit_priv *pxmitpriv)
goto exit;
}
pxmitpriv->pxmit_extbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->pallocated_xmit_extbuf), 4);
pxmitpriv->pxmit_extbuf = (u8 *)N_BYTE_ALIGMENT((size_t)(pxmitpriv->pallocated_xmit_extbuf), 4);
pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf;

View file

@ -76,7 +76,7 @@ _func_enter_;
goto exit;
}
precvpriv->precv_frame_buf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(precvpriv->pallocated_frame_buf), RXFRAME_ALIGN_SZ);
precvpriv->precv_frame_buf = (u8 *)N_BYTE_ALIGMENT((size_t)(precvpriv->pallocated_frame_buf), RXFRAME_ALIGN_SZ);
precvframe = (union recv_frame*) precvpriv->precv_frame_buf;

View file

@ -218,7 +218,7 @@ _func_enter_;
arcfour_encrypt(&mycontext, payload+length, crc, 4);
pframe+=pxmitpriv->frag_len;
pframe=(u8 *)RND4((SIZE_PTR)(pframe));
pframe=(u8 *)RND4((size_t)(pframe));
}
@ -717,7 +717,7 @@ _func_enter_;
arcfour_encrypt(&mycontext, payload+length, crc, 4);
pframe+=pxmitpriv->frag_len;
pframe=(u8 *)RND4((SIZE_PTR)(pframe));
pframe=(u8 *)RND4((size_t)(pframe));
}
}
@ -1525,7 +1525,7 @@ _func_enter_;
aes_cipher(prwskey,pattrib->hdrlen,pframe, length);
pframe+=pxmitpriv->frag_len;
pframe=(u8*)RND4((SIZE_PTR)(pframe));
pframe=(u8*)RND4((size_t)(pframe));
}
}

View file

@ -89,7 +89,7 @@ _func_enter_;
return _FAIL;
pstapriv->pstainfo_buf = pstapriv->pallocated_stainfo_buf + 4 -
((SIZE_PTR)(pstapriv->pallocated_stainfo_buf ) & 3);
((size_t)(pstapriv->pallocated_stainfo_buf ) & 3);
_rtw_init_queue(&pstapriv->free_sta_queue);

View file

@ -118,9 +118,9 @@ _func_enter_;
res= _FAIL;
goto exit;
}
pxmitpriv->pxmit_frame_buf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->pallocated_frame_buf), 4);
pxmitpriv->pxmit_frame_buf = (u8 *)N_BYTE_ALIGMENT((size_t)(pxmitpriv->pallocated_frame_buf), 4);
/* pxmitpriv->pxmit_frame_buf = pxmitpriv->pallocated_frame_buf + 4 - */
/* ((SIZE_PTR) (pxmitpriv->pallocated_frame_buf) &3); */
/* ((size_t) (pxmitpriv->pallocated_frame_buf) &3); */
pxframe = (struct xmit_frame*) pxmitpriv->pxmit_frame_buf;
@ -158,9 +158,9 @@ _func_enter_;
goto exit;
}
pxmitpriv->pxmitbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->pallocated_xmitbuf), 4);
pxmitpriv->pxmitbuf = (u8 *)N_BYTE_ALIGMENT((size_t)(pxmitpriv->pallocated_xmitbuf), 4);
/* pxmitpriv->pxmitbuf = pxmitpriv->pallocated_xmitbuf + 4 - */
/* ((SIZE_PTR) (pxmitpriv->pallocated_xmitbuf) &3); */
/* ((size_t) (pxmitpriv->pallocated_xmitbuf) &3); */
pxmitbuf = (struct xmit_buf*)pxmitpriv->pxmitbuf;
@ -200,7 +200,7 @@ _func_enter_;
goto exit;
}
pxmitpriv->pxmit_extbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->pallocated_xmit_extbuf), 4);
pxmitpriv->pxmit_extbuf = (u8 *)N_BYTE_ALIGMENT((size_t)(pxmitpriv->pallocated_xmit_extbuf), 4);
pxmitbuf = (struct xmit_buf*)pxmitpriv->pxmit_extbuf;
@ -220,7 +220,7 @@ _func_enter_;
goto exit;
}
pxmitbuf->pbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitbuf->pallocated_buf), 4);
pxmitbuf->pbuf = (u8 *)N_BYTE_ALIGMENT((size_t)(pxmitbuf->pallocated_buf), 4);
*/
if ((res=rtw_os_xmit_resource_alloc(padapter, pxmitbuf,max_xmit_extbuf_size + XMITBUF_ALIGN_SZ)) == _FAIL) {
@ -856,7 +856,7 @@ _func_enter_;
payload=pframe;
for (curfragnum=0;curfragnum<pattrib->nr_frags;curfragnum++){
payload=(u8 *)RND4((SIZE_PTR)(payload));
payload=(u8 *)RND4((size_t)(payload));
RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("===curfragnum=%d, pframe= 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x,!!!\n",
curfragnum,*payload, *(payload+1),*(payload+2),*(payload+3),*(payload+4),*(payload+5),*(payload+6),*(payload+7)));
@ -1162,7 +1162,7 @@ s32 rtw_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame *pxm
s32 frg_inx, frg_len, mpdu_len, llc_sz, mem_sz;
SIZE_PTR addr;
size_t addr;
u8 *pframe, *mem_start;
u8 hw_hdr_offset;
@ -1311,7 +1311,7 @@ _func_enter_;
RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("%s: There're still something in packet!\n", __func__));
}
addr = (SIZE_PTR)(pframe);
addr = (size_t)(pframe);
mem_start = (unsigned char *)RND4(addr) + hw_hdr_offset;
_rtw_memcpy(mem_start, pbuf_start + hw_hdr_offset, pattrib->hdrlen);