rtl8192eu: Fix more sparse errors

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2013-06-20 10:13:14 -05:00
parent 7e778fc0be
commit 5c8ff88003
13 changed files with 171 additions and 285 deletions

View file

@ -139,21 +139,20 @@ exit:
_func_exit_;
}
static u32 getcrc32(u8 *buf, sint len)
static __le32 getcrc32(u8 *buf, sint len)
{
u8 *p;
u32 crc;
_func_enter_;
if (bcrc32initialized == 0) crc32_init();
if (bcrc32initialized == 0)
crc32_init();
crc = 0xffffffff; /* preload shift register, per CRC-32 spec */
for (p = buf; len > 0; ++p, --len)
{
crc = crc32_table[ (crc ^ *p) & 0xff] ^ (crc >> 8);
}
_func_exit_;
return ~crc; /* transmit complement, per CRC-32 spec */
return cpu_to_le32(~crc); /* transmit complement, per CRC-32 spec */
}
@ -212,7 +211,7 @@ _func_enter_;
length=pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len- pattrib->icv_len;
*((__le32 *)crc)=cpu_to_le32(getcrc32(payload,length));
*((__le32 *)crc) = getcrc32(payload,length);
arcfour_init(&mycontext, wepkey,3+keylength);
arcfour_encrypt(&mycontext, payload, payload, length);
@ -222,7 +221,7 @@ _func_enter_;
else
{
length=pxmitpriv->frag_len-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len ;
*((__le32 *)crc)=cpu_to_le32(getcrc32(payload,length));
*((__le32 *)crc) = getcrc32(payload,length);
arcfour_init(&mycontext, wepkey,3+keylength);
arcfour_encrypt(&mycontext, payload, payload, length);
arcfour_encrypt(&mycontext, payload+length, crc, 4);
@ -272,7 +271,7 @@ _func_enter_;
arcfour_encrypt(&mycontext, payload, payload, length);
//calculate icv and compare the icv
*((u32 *)crc) = le32_to_cpu(getcrc32(payload, length - 4));
*((__le32 *)crc) = getcrc32(payload, length - 4);
if (crc[3] != payload[length-1] ||
crc[2] != payload[length-2] ||
@ -724,7 +723,7 @@ _func_enter_;
RT_TRACE(_module_rtl871x_security_c_, _drv_info_,
("pattrib->iv_len =%x, pattrib->icv_len =%x\n",
pattrib->iv_len,pattrib->icv_len));
*((__le32 *)crc)=cpu_to_le32(getcrc32(payload,length));/* modified by Amy*/
*((__le32 *)crc) = getcrc32(payload,length);/* modified by Amy*/
arcfour_init(&mycontext, rc4key,16);
arcfour_encrypt(&mycontext, payload, payload, length);
@ -733,7 +732,7 @@ _func_enter_;
}
else{
length=pxmitpriv->frag_len-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len ;
*((__le32 *)crc)=cpu_to_le32(getcrc32(payload,length));/* modified by Amy*/
*((__le32 *)crc) = getcrc32(payload,length);/* modified by Amy*/
arcfour_init(&mycontext,rc4key,16);
arcfour_encrypt(&mycontext, payload, payload, length);
arcfour_encrypt(&mycontext, payload+length, crc, 4);
@ -825,7 +824,7 @@ _func_enter_;
arcfour_init(&mycontext, rc4key,16);
arcfour_encrypt(&mycontext, payload, payload, length);
*((u32 *)crc) = le32_to_cpu(getcrc32(payload, length-4));
*((__le32 *)crc) = getcrc32(payload, length-4);
if (crc[3] != payload[length-1] ||
crc[2] != payload[length-2] ||