Commit 96372bd9 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

staging: vt6655: s_uGetRTSCTSDuration always return __le16

This function should always return __le16, move all endian
correction to here.
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 93320258
...@@ -578,7 +578,7 @@ s_uGetDataDuration( ...@@ -578,7 +578,7 @@ s_uGetDataDuration(
//byFreqType: 0=>5GHZ 1=>2.4GHZ //byFreqType: 0=>5GHZ 1=>2.4GHZ
static static
unsigned int __le16
s_uGetRTSCTSDuration( s_uGetRTSCTSDuration(
struct vnt_private *pDevice, struct vnt_private *pDevice,
unsigned char byDurType, unsigned char byDurType,
...@@ -667,7 +667,7 @@ s_uGetRTSCTSDuration( ...@@ -667,7 +667,7 @@ s_uGetRTSCTSDuration(
break; break;
} }
return uDurTime; return cpu_to_le16((u16)uDurTime);
} }
static static
...@@ -829,17 +829,20 @@ s_vFillRTSHead( ...@@ -829,17 +829,20 @@ s_vFillRTSHead(
byPktType, &buf->a); byPktType, &buf->a);
/* Get Duration */ /* Get Duration */
buf->duration_bb = buf->duration_bb =
cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, cbFrameLength, s_uGetRTSCTSDuration(pDevice, RTSDUR_BB,
PK_TYPE_11B, pDevice->byTopCCKBasicRate, cbFrameLength, PK_TYPE_11B,
bNeedAck, byFBOption)); pDevice->byTopCCKBasicRate,
bNeedAck, byFBOption);
buf->duration_aa = buf->duration_aa =
cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength, s_uGetRTSCTSDuration(pDevice, RTSDUR_AA,
byPktType, wCurrentRate, bNeedAck, cbFrameLength, byPktType,
byFBOption)); wCurrentRate, bNeedAck,
byFBOption);
buf->duration_ba = buf->duration_ba =
cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA, cbFrameLength, s_uGetRTSCTSDuration(pDevice, RTSDUR_BA,
byPktType, wCurrentRate, bNeedAck, cbFrameLength, byPktType,
byFBOption)); wCurrentRate, bNeedAck,
byFBOption);
buf->data.duration = buf->duration_aa; buf->data.duration = buf->duration_aa;
/* Get RTS Frame body */ /* Get RTS Frame body */
...@@ -871,33 +874,40 @@ s_vFillRTSHead( ...@@ -871,33 +874,40 @@ s_vFillRTSHead(
byPktType, &buf->a); byPktType, &buf->a);
/* Get Duration */ /* Get Duration */
buf->duration_bb = buf->duration_bb =
cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, cbFrameLength, s_uGetRTSCTSDuration(pDevice, RTSDUR_BB,
PK_TYPE_11B, pDevice->byTopCCKBasicRate, cbFrameLength, PK_TYPE_11B,
bNeedAck, byFBOption)); pDevice->byTopCCKBasicRate,
bNeedAck, byFBOption);
buf->duration_aa = buf->duration_aa =
cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength, s_uGetRTSCTSDuration(pDevice, RTSDUR_AA,
byPktType, wCurrentRate, bNeedAck, cbFrameLength, byPktType,
byFBOption)); wCurrentRate, bNeedAck,
byFBOption);
buf->duration_ba = buf->duration_ba =
cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA, cbFrameLength, s_uGetRTSCTSDuration(pDevice, RTSDUR_BA,
byPktType, wCurrentRate, bNeedAck, cbFrameLength, byPktType,
byFBOption)); wCurrentRate, bNeedAck,
byFBOption);
buf->rts_duration_ba_f0 = buf->rts_duration_ba_f0 =
cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA_F0, cbFrameLength, s_uGetRTSCTSDuration(pDevice, RTSDUR_BA_F0,
byPktType, wCurrentRate, bNeedAck, cbFrameLength, byPktType,
byFBOption)); wCurrentRate, bNeedAck,
byFBOption);
buf->rts_duration_aa_f0 = buf->rts_duration_aa_f0 =
cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F0, cbFrameLength, s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F0,
byPktType, wCurrentRate, bNeedAck, cbFrameLength, byPktType,
byFBOption)); wCurrentRate, bNeedAck,
byFBOption);
buf->rts_duration_ba_f1 = buf->rts_duration_ba_f1 =
cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA_F1, cbFrameLength, s_uGetRTSCTSDuration(pDevice, RTSDUR_BA_F1,
byPktType, wCurrentRate, bNeedAck, cbFrameLength, byPktType,
byFBOption)); wCurrentRate, bNeedAck,
byFBOption);
buf->rts_duration_aa_f1 = buf->rts_duration_aa_f1 =
cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F1, cbFrameLength, s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F1,
byPktType, wCurrentRate, bNeedAck, cbFrameLength, byPktType,
byFBOption)); wCurrentRate, bNeedAck,
byFBOption);
buf->data.duration = buf->duration_aa; buf->data.duration = buf->duration_aa;
/* Get RTS Frame body */ /* Get RTS Frame body */
buf->data.frame_control = buf->data.frame_control =
...@@ -927,9 +937,10 @@ s_vFillRTSHead( ...@@ -927,9 +937,10 @@ s_vFillRTSHead(
byPktType, &buf->ab); byPktType, &buf->ab);
/* Get Duration */ /* Get Duration */
buf->duration = buf->duration =
cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength, s_uGetRTSCTSDuration(pDevice, RTSDUR_AA,
byPktType, wCurrentRate, bNeedAck, cbFrameLength, byPktType,
byFBOption)); wCurrentRate, bNeedAck,
byFBOption);
buf->data.duration = buf->duration; buf->data.duration = buf->duration;
/* Get RTS Frame body */ /* Get RTS Frame body */
buf->data.frame_control = buf->data.frame_control =
...@@ -957,17 +968,20 @@ s_vFillRTSHead( ...@@ -957,17 +968,20 @@ s_vFillRTSHead(
byPktType, &buf->a); byPktType, &buf->a);
/* Get Duration */ /* Get Duration */
buf->duration = buf->duration =
cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength, s_uGetRTSCTSDuration(pDevice, RTSDUR_AA,
byPktType, wCurrentRate, cbFrameLength, byPktType,
bNeedAck, byFBOption)); wCurrentRate, bNeedAck,
byFBOption);
buf->rts_duration_f0 = buf->rts_duration_f0 =
cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F0, cbFrameLength, s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F0,
byPktType, wCurrentRate, cbFrameLength, byPktType,
bNeedAck, byFBOption)); wCurrentRate, bNeedAck,
byFBOption);
buf->rts_duration_f1 = buf->rts_duration_f1 =
cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F1, cbFrameLength, s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F1,
byPktType, wCurrentRate, cbFrameLength, byPktType,
bNeedAck, byFBOption)); wCurrentRate, bNeedAck,
byFBOption);
buf->data.duration = buf->duration; buf->data.duration = buf->duration;
/* Get RTS Frame body */ /* Get RTS Frame body */
buf->data.frame_control = buf->data.frame_control =
...@@ -993,9 +1007,10 @@ s_vFillRTSHead( ...@@ -993,9 +1007,10 @@ s_vFillRTSHead(
PK_TYPE_11B, &buf->ab); PK_TYPE_11B, &buf->ab);
/* Get Duration */ /* Get Duration */
buf->duration = buf->duration =
cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, cbFrameLength, s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, cbFrameLength,
byPktType, wCurrentRate, bNeedAck, byPktType, wCurrentRate, bNeedAck,
byFBOption)); byFBOption);
buf->data.duration = buf->duration; buf->data.duration = buf->duration;
/* Get RTS Frame body */ /* Get RTS Frame body */
buf->data.frame_control = buf->data.frame_control =
...@@ -1049,21 +1064,26 @@ s_vFillCTSHead( ...@@ -1049,21 +1064,26 @@ s_vFillCTSHead(
pDevice->byTopCCKBasicRate, pDevice->byTopCCKBasicRate,
PK_TYPE_11B, &buf->b); PK_TYPE_11B, &buf->b);
buf->duration_ba = (u16)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA, cbFrameLength, buf->duration_ba =
byPktType, wCurrentRate, bNeedAck, byFBOption); s_uGetRTSCTSDuration(pDevice, CTSDUR_BA,
buf->duration_ba = cpu_to_le16(buf->duration_ba); cbFrameLength, byPktType,
/* Get CTSDuration_ba_f0 */ wCurrentRate, bNeedAck,
buf->cts_duration_ba_f0 = (u16)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA_F0, cbFrameLength, byFBOption);
byPktType, wCurrentRate,
bNeedAck, byFBOption);
buf->cts_duration_ba_f0 = cpu_to_le16(buf->cts_duration_ba_f0); /* Get CTSDuration_ba_f0 */
//Get CTSDuration_ba_f1 buf->cts_duration_ba_f0 =
buf->cts_duration_ba_f1 = (u16)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA_F1, cbFrameLength, s_uGetRTSCTSDuration(pDevice, CTSDUR_BA_F0,
byPktType, wCurrentRate, cbFrameLength, byPktType,
bNeedAck, byFBOption); wCurrentRate, bNeedAck,
byFBOption);
/* Get CTSDuration_ba_f1 */
buf->cts_duration_ba_f1 =
s_uGetRTSCTSDuration(pDevice, CTSDUR_BA_F1,
cbFrameLength, byPktType,
wCurrentRate, bNeedAck,
byFBOption);
buf->cts_duration_ba_f1 = cpu_to_le16(buf->cts_duration_ba_f1);
/* Get CTS Frame body */ /* Get CTS Frame body */
buf->data.duration = buf->duration_ba; buf->data.duration = buf->duration_ba;
...@@ -1083,11 +1103,10 @@ s_vFillCTSHead( ...@@ -1083,11 +1103,10 @@ s_vFillCTSHead(
/* Get CTSDuration_ba */ /* Get CTSDuration_ba */
buf->duration_ba = buf->duration_ba =
cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA, cbFrameLength, s_uGetRTSCTSDuration(pDevice, CTSDUR_BA,
byPktType, wCurrentRate, bNeedAck, cbFrameLength, byPktType,
byFBOption)); wCurrentRate, bNeedAck,
byFBOption);
buf->duration_ba = cpu_to_le16(buf->duration_ba);
/* Get CTS Frame body */ /* Get CTS Frame body */
buf->data.duration = buf->duration_ba; buf->data.duration = buf->duration_ba;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment