Commit 4ac306e0 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

staging: vt6656: baseband.c BBvCalculateParameter pwPhyLen return endian corrected.

In rxtx.c many calls to BBvCaculateParameter are not endian
corrected all calls here need to be endian corrected.

Correct the endian in BBvCaculateParameter.

In card.c: CARDvSetRSPINF pwPhyLen points to awLen and is
manually applied to abyData.  Because it is now endian
corrected put_unaligned is needed to correct it.

In rxtx.c remove were endian is corrected.

This allows to merge  BBvCalculateParameter *pwPhyLen,*pbyPhySrv
and *pbyPhySgn to singles structure for tx buffers.
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent df2da9a3
...@@ -870,16 +870,15 @@ void BBvCalculateParameter(struct vnt_private *pDevice, u32 cbFrameLength, ...@@ -870,16 +870,15 @@ void BBvCalculateParameter(struct vnt_private *pDevice, u32 cbFrameLength,
break; break;
} }
if (byPacketType == PK_TYPE_11B) { if (byPacketType == PK_TYPE_11B) {
*pbyPhySrv = 0x00; *pbyPhySrv = 0x00;
if (bExtBit) if (bExtBit)
*pbyPhySrv = *pbyPhySrv | 0x80; *pbyPhySrv = *pbyPhySrv | 0x80;
*pwPhyLen = (u16) cbUsCount; *pwPhyLen = cpu_to_le16((u16)cbUsCount);
} } else {
else { *pbyPhySrv = 0x00;
*pbyPhySrv = 0x00; *pwPhyLen = cpu_to_le16((u16)cbFrameLength);
*pwPhyLen = (u16)cbFrameLength; }
}
} }
/* /*
......
...@@ -421,23 +421,19 @@ void CARDvSetRSPINF(struct vnt_private *pDevice, u8 byBBType) ...@@ -421,23 +421,19 @@ void CARDvSetRSPINF(struct vnt_private *pDevice, u8 byBBType)
&abyTxRate[8], &abyTxRate[8],
&abyRsvTime[8]); &abyRsvTime[8]);
abyData[0] = (u8)(awLen[0]&0xFF); put_unaligned(awLen[0], (u16 *)&abyData[0]);
abyData[1] = (u8)(awLen[0]>>8);
abyData[2] = abySignal[0]; abyData[2] = abySignal[0];
abyData[3] = abyServ[0]; abyData[3] = abyServ[0];
abyData[4] = (u8)(awLen[1]&0xFF); put_unaligned(awLen[1], (u16 *)&abyData[4]);
abyData[5] = (u8)(awLen[1]>>8);
abyData[6] = abySignal[1]; abyData[6] = abySignal[1];
abyData[7] = abyServ[1]; abyData[7] = abyServ[1];
abyData[8] = (u8)(awLen[2]&0xFF); put_unaligned(awLen[2], (u16 *)&abyData[8]);
abyData[9] = (u8)(awLen[2]>>8);
abyData[10] = abySignal[2]; abyData[10] = abySignal[2];
abyData[11] = abyServ[2]; abyData[11] = abyServ[2];
abyData[12] = (u8)(awLen[3]&0xFF); put_unaligned(awLen[3], (u16 *)&abyData[12]);
abyData[13] = (u8)(awLen[3]>>8);
abyData[14] = abySignal[3]; abyData[14] = abySignal[3];
abyData[15] = abyServ[3]; abyData[15] = abyServ[3];
......
...@@ -617,11 +617,9 @@ static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType, ...@@ -617,11 +617,9 @@ static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType,
BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B, BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B,
(u16 *)&(wLen), (u8 *)&(pBuf->byServiceField_b), (u8 *)&(pBuf->bySignalField_b) (u16 *)&(wLen), (u8 *)&(pBuf->byServiceField_b), (u8 *)&(pBuf->bySignalField_b)
); );
pBuf->wTransmitLength_b = cpu_to_le16(wLen);
BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopOFDMBasicRate, byPktType, BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopOFDMBasicRate, byPktType,
(u16 *)&(wLen), (u8 *)&(pBuf->byServiceField_a), (u8 *)&(pBuf->bySignalField_a) (u16 *)&(wLen), (u8 *)&(pBuf->byServiceField_a), (u8 *)&(pBuf->bySignalField_a)
); );
pBuf->wTransmitLength_a = cpu_to_le16(wLen);
//Get Duration //Get Duration
pBuf->wDuration_bb = s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, pBuf->wDuration_bb = s_uGetRTSCTSDuration(pDevice, RTSDUR_BB,
cbFrameLength, PK_TYPE_11B, cbFrameLength, PK_TYPE_11B,
...@@ -653,11 +651,9 @@ static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType, ...@@ -653,11 +651,9 @@ static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType,
BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B, BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B,
(u16 *)&(wLen), (u8 *)&(pBuf->byServiceField_b), (u8 *)&(pBuf->bySignalField_b) (u16 *)&(wLen), (u8 *)&(pBuf->byServiceField_b), (u8 *)&(pBuf->bySignalField_b)
); );
pBuf->wTransmitLength_b = cpu_to_le16(wLen);
BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopOFDMBasicRate, byPktType, BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopOFDMBasicRate, byPktType,
(u16 *)&(wLen), (u8 *)&(pBuf->byServiceField_a), (u8 *)&(pBuf->bySignalField_a) (u16 *)&(wLen), (u8 *)&(pBuf->byServiceField_a), (u8 *)&(pBuf->bySignalField_a)
); );
pBuf->wTransmitLength_a = cpu_to_le16(wLen);
//Get Duration //Get Duration
pBuf->wDuration_bb = s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, pBuf->wDuration_bb = s_uGetRTSCTSDuration(pDevice, RTSDUR_BB,
cbFrameLength, PK_TYPE_11B, cbFrameLength, PK_TYPE_11B,
...@@ -703,7 +699,6 @@ static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType, ...@@ -703,7 +699,6 @@ static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType,
BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopOFDMBasicRate, byPktType, BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopOFDMBasicRate, byPktType,
(u16 *)&(wLen), (u8 *)&(pBuf->byServiceField), (u8 *)&(pBuf->bySignalField) (u16 *)&(wLen), (u8 *)&(pBuf->byServiceField), (u8 *)&(pBuf->bySignalField)
); );
pBuf->wTransmitLength = cpu_to_le16(wLen);
//Get Duration //Get Duration
pBuf->wDuration = s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, pBuf->wDuration = s_uGetRTSCTSDuration(pDevice, RTSDUR_AA,
cbFrameLength, byPktType, wCurrentRate, cbFrameLength, byPktType, wCurrentRate,
...@@ -729,7 +724,6 @@ static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType, ...@@ -729,7 +724,6 @@ static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType,
BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopOFDMBasicRate, byPktType, BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopOFDMBasicRate, byPktType,
(u16 *)&(wLen), (u8 *)&(pBuf->byServiceField), (u8 *)&(pBuf->bySignalField) (u16 *)&(wLen), (u8 *)&(pBuf->byServiceField), (u8 *)&(pBuf->bySignalField)
); );
pBuf->wTransmitLength = cpu_to_le16(wLen);
//Get Duration //Get Duration
pBuf->wDuration = s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, pBuf->wDuration = s_uGetRTSCTSDuration(pDevice, RTSDUR_AA,
cbFrameLength, byPktType, wCurrentRate, cbFrameLength, byPktType, wCurrentRate,
...@@ -762,7 +756,6 @@ static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType, ...@@ -762,7 +756,6 @@ static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType,
BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B, BBvCalculateParameter(pDevice, uRTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B,
(u16 *)&(wLen), (u8 *)&(pBuf->byServiceField), (u8 *)&(pBuf->bySignalField) (u16 *)&(wLen), (u8 *)&(pBuf->byServiceField), (u8 *)&(pBuf->bySignalField)
); );
pBuf->wTransmitLength = cpu_to_le16(wLen);
//Get Duration //Get Duration
pBuf->wDuration = s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, pBuf->wDuration = s_uGetRTSCTSDuration(pDevice, RTSDUR_BB,
cbFrameLength, byPktType, wCurrentRate, cbFrameLength, byPktType, wCurrentRate,
...@@ -810,7 +803,6 @@ static void s_vFillCTSHead(struct vnt_private *pDevice, u32 uDMAIdx, ...@@ -810,7 +803,6 @@ static void s_vFillCTSHead(struct vnt_private *pDevice, u32 uDMAIdx,
BBvCalculateParameter(pDevice, uCTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B, BBvCalculateParameter(pDevice, uCTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B,
(u16 *)&(wLen), (u8 *)&(pBuf->byServiceField_b), (u8 *)&(pBuf->bySignalField_b) (u16 *)&(wLen), (u8 *)&(pBuf->byServiceField_b), (u8 *)&(pBuf->bySignalField_b)
); );
pBuf->wTransmitLength_b = cpu_to_le16(wLen);
pBuf->wDuration_ba = s_uGetRTSCTSDuration(pDevice, CTSDUR_BA, pBuf->wDuration_ba = s_uGetRTSCTSDuration(pDevice, CTSDUR_BA,
cbFrameLength, byPktType, cbFrameLength, byPktType,
wCurrentRate, bNeedAck, byFBOption); wCurrentRate, bNeedAck, byFBOption);
...@@ -832,7 +824,6 @@ static void s_vFillCTSHead(struct vnt_private *pDevice, u32 uDMAIdx, ...@@ -832,7 +824,6 @@ static void s_vFillCTSHead(struct vnt_private *pDevice, u32 uDMAIdx,
BBvCalculateParameter(pDevice, uCTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B, BBvCalculateParameter(pDevice, uCTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B,
(u16 *)&(wLen), (u8 *)&(pBuf->byServiceField_b), (u8 *)&(pBuf->bySignalField_b) (u16 *)&(wLen), (u8 *)&(pBuf->byServiceField_b), (u8 *)&(pBuf->bySignalField_b)
); );
pBuf->wTransmitLength_b = cpu_to_le16(wLen);
/* Get CTSDuration_ba */ /* Get CTSDuration_ba */
pBuf->wDuration_ba = s_uGetRTSCTSDuration(pDevice, pBuf->wDuration_ba = s_uGetRTSCTSDuration(pDevice,
CTSDUR_BA, cbFrameLength, byPktType, CTSDUR_BA, cbFrameLength, byPktType,
......
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