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

staging: vt6655: rxtx.c create function to return __le16 wTimeStampOff

wTimeStampOff always needs to be endian corrected.

Create vnt_time_stamp_off to return this value.
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c00a378b
...@@ -337,6 +337,12 @@ s_vSWencryption( ...@@ -337,6 +337,12 @@ s_vSWencryption(
} }
} }
static __le16 vnt_time_stamp_off(struct vnt_private *priv, u16 rate)
{
return cpu_to_le16(wTimeStampOff[priv->byPreambleType % 2]
[rate % MAX_RATE]);
}
/*byPktType : PK_TYPE_11A 0 /*byPktType : PK_TYPE_11A 0
PK_TYPE_11B 1 PK_TYPE_11B 1
PK_TYPE_11GB 2 PK_TYPE_11GB 2
...@@ -706,8 +712,8 @@ s_uFillDataHead( ...@@ -706,8 +712,8 @@ s_uFillDataHead(
bNeedAck, uFragIdx, cbLastFragmentSize, bNeedAck, uFragIdx, cbLastFragmentSize,
uMACfragNum, byFBOption)); //1: 2.4 uMACfragNum, byFBOption)); //1: 2.4
pBuf->wTimeStampOff_a = cpu_to_le16(wTimeStampOff[pDevice->byPreambleType%2][wCurrentRate%MAX_RATE]); pBuf->wTimeStampOff_a = vnt_time_stamp_off(pDevice, wCurrentRate);
pBuf->wTimeStampOff_b = cpu_to_le16(wTimeStampOff[pDevice->byPreambleType%2][pDevice->byTopCCKBasicRate%MAX_RATE]); pBuf->wTimeStampOff_b = vnt_time_stamp_off(pDevice, pDevice->byTopCCKBasicRate);
return pBuf->wDuration_a; return pBuf->wDuration_a;
} else { } else {
...@@ -730,8 +736,8 @@ s_uFillDataHead( ...@@ -730,8 +736,8 @@ s_uFillDataHead(
pBuf->wDuration_a_f1 = cpu_to_le16((unsigned short)s_uGetDataDuration(pDevice, DATADUR_A_F1, cbFrameLength, byPktType, pBuf->wDuration_a_f1 = cpu_to_le16((unsigned short)s_uGetDataDuration(pDevice, DATADUR_A_F1, cbFrameLength, byPktType,
wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); //1: 2.4GHz wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); //1: 2.4GHz
pBuf->wTimeStampOff_a = cpu_to_le16(wTimeStampOff[pDevice->byPreambleType%2][wCurrentRate%MAX_RATE]); pBuf->wTimeStampOff_a = vnt_time_stamp_off(pDevice, wCurrentRate);
pBuf->wTimeStampOff_b = cpu_to_le16(wTimeStampOff[pDevice->byPreambleType%2][pDevice->byTopCCKBasicRate%MAX_RATE]); pBuf->wTimeStampOff_b = vnt_time_stamp_off(pDevice, pDevice->byTopCCKBasicRate);
return pBuf->wDuration_a; return pBuf->wDuration_a;
} //if (byFBOption == AUTO_FB_NONE) } //if (byFBOption == AUTO_FB_NONE)
...@@ -751,7 +757,7 @@ s_uFillDataHead( ...@@ -751,7 +757,7 @@ s_uFillDataHead(
wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); //0: 5GHz wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); //0: 5GHz
pBuf->wDuration_f1 = cpu_to_le16((unsigned short)s_uGetDataDuration(pDevice, DATADUR_A_F1, cbFrameLength, byPktType, pBuf->wDuration_f1 = cpu_to_le16((unsigned short)s_uGetDataDuration(pDevice, DATADUR_A_F1, cbFrameLength, byPktType,
wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); //0: 5GHz wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); //0: 5GHz
pBuf->wTimeStampOff = cpu_to_le16(wTimeStampOff[pDevice->byPreambleType%2][wCurrentRate%MAX_RATE]); pBuf->wTimeStampOff = vnt_time_stamp_off(pDevice, wCurrentRate);
return pBuf->wDuration; return pBuf->wDuration;
} else { } else {
PSTxDataHead_ab pBuf = (PSTxDataHead_ab)pTxDataHead; PSTxDataHead_ab pBuf = (PSTxDataHead_ab)pTxDataHead;
...@@ -765,7 +771,7 @@ s_uFillDataHead( ...@@ -765,7 +771,7 @@ s_uFillDataHead(
cbLastFragmentSize, uMACfragNum, cbLastFragmentSize, uMACfragNum,
byFBOption)); byFBOption));
pBuf->wTimeStampOff = cpu_to_le16(wTimeStampOff[pDevice->byPreambleType%2][wCurrentRate%MAX_RATE]); pBuf->wTimeStampOff = vnt_time_stamp_off(pDevice, wCurrentRate);
return pBuf->wDuration; return pBuf->wDuration;
} }
} else { } else {
...@@ -778,7 +784,7 @@ s_uFillDataHead( ...@@ -778,7 +784,7 @@ s_uFillDataHead(
wCurrentRate, bNeedAck, uFragIdx, wCurrentRate, bNeedAck, uFragIdx,
cbLastFragmentSize, uMACfragNum, cbLastFragmentSize, uMACfragNum,
byFBOption)); byFBOption));
pBuf->wTimeStampOff = cpu_to_le16(wTimeStampOff[pDevice->byPreambleType%2][wCurrentRate%MAX_RATE]); pBuf->wTimeStampOff = vnt_time_stamp_off(pDevice, wCurrentRate);
return pBuf->wDuration; return pBuf->wDuration;
} }
return 0; return 0;
...@@ -2370,7 +2376,7 @@ CMD_STATUS csBeacon_xmit(struct vnt_private *pDevice, PSTxMgmtPacket pPacket) ...@@ -2370,7 +2376,7 @@ CMD_STATUS csBeacon_xmit(struct vnt_private *pDevice, PSTxMgmtPacket pPacket)
wCurrentRate, byPktType, &short_head->ab); wCurrentRate, byPktType, &short_head->ab);
/* Get TimeStampOff */ /* Get TimeStampOff */
short_head->time_stamp_off = cpu_to_le16(wTimeStampOff[pDevice->byPreambleType%2][wCurrentRate%MAX_RATE]); short_head->time_stamp_off = vnt_time_stamp_off(pDevice, wCurrentRate);
cbHeaderSize = sizeof(struct vnt_tx_short_buf_head); cbHeaderSize = sizeof(struct vnt_tx_short_buf_head);
//Generate Beacon Header //Generate Beacon Header
......
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