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

staging: vt6656: rxtx.c Parse struct vnt_tx_datahead_g_fb

Parse struct vnt_tx_datahead_g_fb from s_uFillDataHead and
move to struct vnt_rts_g_fb/struct vnt_cts_fb structure returning
duration down functions.

This removes pvTxDataHd pointer assignment.
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 78363fd1
...@@ -530,6 +530,30 @@ static u16 vnt_rxtx_datahead_g(struct vnt_private *priv, u8 pkt_type, u16 rate, ...@@ -530,6 +530,30 @@ static u16 vnt_rxtx_datahead_g(struct vnt_private *priv, u8 pkt_type, u16 rate,
return buf->wDuration_a; return buf->wDuration_a;
} }
static u16 vnt_rxtx_datahead_g_fb(struct vnt_private *priv, u8 pkt_type,
u16 rate, struct vnt_tx_datahead_g_fb *buf,
u32 frame_len, int need_ack)
{
/* Get SignalField,ServiceField,Length */
BBvCalculateParameter(priv, frame_len, rate, pkt_type, &buf->a);
BBvCalculateParameter(priv, frame_len, priv->byTopCCKBasicRate,
PK_TYPE_11B, &buf->b);
/* Get Duration and TimeStamp */
buf->wDuration_a = s_uGetDataDuration(priv, pkt_type, need_ack);
buf->wDuration_b = s_uGetDataDuration(priv, PK_TYPE_11B, need_ack);
buf->wDuration_a_f0 = s_uGetDataDuration(priv, pkt_type, need_ack);
buf->wDuration_a_f1 = s_uGetDataDuration(priv, pkt_type, need_ack);
buf->wTimeStampOff_a = vnt_time_stamp_off(priv, rate);
buf->wTimeStampOff_b = vnt_time_stamp_off(priv,
priv->byTopCCKBasicRate);
return buf->wDuration_a;
}
static u32 s_uFillDataHead(struct vnt_private *pDevice, static u32 s_uFillDataHead(struct vnt_private *pDevice,
u8 byPktType, u16 wCurrentRate, void *pTxDataHead, u32 cbFrameLength, u8 byPktType, u16 wCurrentRate, void *pTxDataHead, u32 cbFrameLength,
u32 uDMAIdx, int bNeedAck, u8 byFBOption) u32 uDMAIdx, int bNeedAck, u8 byFBOption)
...@@ -539,35 +563,7 @@ static u32 s_uFillDataHead(struct vnt_private *pDevice, ...@@ -539,35 +563,7 @@ static u32 s_uFillDataHead(struct vnt_private *pDevice,
return 0; return 0;
} }
if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) { if (byPktType == PK_TYPE_11A) {
if (byFBOption == AUTO_FB_NONE) {
;
} else {
// Auto Fallback
struct vnt_tx_datahead_g_fb *pBuf =
(struct vnt_tx_datahead_g_fb *)pTxDataHead;
//Get SignalField,ServiceField,Length
BBvCalculateParameter(pDevice, cbFrameLength, wCurrentRate,
byPktType, &pBuf->a);
BBvCalculateParameter(pDevice, cbFrameLength,
pDevice->byTopCCKBasicRate, PK_TYPE_11B, &pBuf->b);
//Get Duration and TimeStamp
pBuf->wDuration_a = s_uGetDataDuration(pDevice,
byPktType, bNeedAck);
pBuf->wDuration_b = s_uGetDataDuration(pDevice,
PK_TYPE_11B, bNeedAck);
pBuf->wDuration_a_f0 = s_uGetDataDuration(pDevice,
byPktType, bNeedAck);
pBuf->wDuration_a_f1 = s_uGetDataDuration(pDevice,
byPktType, bNeedAck);
pBuf->wTimeStampOff_a = vnt_time_stamp_off(pDevice,
wCurrentRate);
pBuf->wTimeStampOff_b = vnt_time_stamp_off(pDevice,
pDevice->byTopCCKBasicRate);
return (pBuf->wDuration_a);
} //if (byFBOption == AUTO_FB_NONE)
}
else if (byPktType == PK_TYPE_11A) {
if (byFBOption != AUTO_FB_NONE) { if (byFBOption != AUTO_FB_NONE) {
struct vnt_tx_datahead_a_fb *pBuf = struct vnt_tx_datahead_a_fb *pBuf =
(struct vnt_tx_datahead_a_fb *)pTxDataHead; (struct vnt_tx_datahead_a_fb *)pTxDataHead;
...@@ -691,7 +687,8 @@ static u16 vnt_rxtx_rts_g_fb_head(struct vnt_private *priv, ...@@ -691,7 +687,8 @@ static u16 vnt_rxtx_rts_g_fb_head(struct vnt_private *priv,
vnt_fill_ieee80211_rts(priv, &buf->data, eth_hdr, buf->wDuration_aa); vnt_fill_ieee80211_rts(priv, &buf->data, eth_hdr, buf->wDuration_aa);
return 0; return vnt_rxtx_datahead_g_fb(priv, pkt_type, current_rate,
&buf->data_head, frame_len, need_ack);
} }
static u16 vnt_rxtx_rts_ab_head(struct vnt_private *priv, static u16 vnt_rxtx_rts_ab_head(struct vnt_private *priv,
...@@ -757,7 +754,7 @@ static u16 s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType, ...@@ -757,7 +754,7 @@ static u16 s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType,
psEthHeader, byPktType, cbFrameLength, psEthHeader, byPktType, cbFrameLength,
bNeedAck, wCurrentRate, byFBOption); bNeedAck, wCurrentRate, byFBOption);
else else
vnt_rxtx_rts_g_fb_head(pDevice, &head->rts_g_fb, return vnt_rxtx_rts_g_fb_head(pDevice, &head->rts_g_fb,
psEthHeader, byPktType, cbFrameLength, psEthHeader, byPktType, cbFrameLength,
bNeedAck, wCurrentRate, byFBOption); bNeedAck, wCurrentRate, byFBOption);
break; break;
...@@ -807,6 +804,9 @@ static u16 s_vFillCTSHead(struct vnt_private *pDevice, u32 uDMAIdx, ...@@ -807,6 +804,9 @@ static u16 s_vFillCTSHead(struct vnt_private *pDevice, u32 uDMAIdx,
pBuf->data.duration = pBuf->wDuration_ba; pBuf->data.duration = pBuf->wDuration_ba;
pBuf->data.frame_control = TYPE_CTL_CTS; pBuf->data.frame_control = TYPE_CTL_CTS;
memcpy(pBuf->data.ra, pDevice->abyCurrentNetAddr, ETH_ALEN); memcpy(pBuf->data.ra, pDevice->abyCurrentNetAddr, ETH_ALEN);
return vnt_rxtx_datahead_g_fb(pDevice, byPktType, wCurrentRate,
&pBuf->data_head, cbFrameLength, bNeedAck);
} else { } else {
struct vnt_cts *pBuf = &head->cts_g; struct vnt_cts *pBuf = &head->cts_g;
/* Get SignalField,ServiceField,Length */ /* Get SignalField,ServiceField,Length */
...@@ -1169,20 +1169,12 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType, ...@@ -1169,20 +1169,12 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
} else { } else {
// Auto Fall Back // Auto Fall Back
if (bRTS == true) {//RTS_need if (bRTS == true) {//RTS_need
pvTxDataHd = (struct vnt_tx_datahead_g_fb *) (pbyTxBufferAddr +
wTxBufSize + sizeof(struct vnt_rrv_time_rts) +
cbMICHDR + sizeof(struct vnt_rts_g_fb));
cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_rts) + cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_rts) +
cbMICHDR + sizeof(struct vnt_rts_g_fb) + cbMICHDR + sizeof(struct vnt_rts_g_fb);
sizeof(struct vnt_tx_datahead_g_fb);
} }
else if (bRTS == false) { //RTS_needless else if (bRTS == false) { //RTS_needless
pvTxDataHd = (struct vnt_tx_datahead_g_fb *) (pbyTxBufferAddr +
wTxBufSize + sizeof(struct vnt_rrv_time_cts) +
cbMICHDR + sizeof(struct vnt_cts_fb));
cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_cts) +
cbMICHDR + sizeof(struct vnt_cts_fb) + cbMICHDR + sizeof(struct vnt_cts_fb);
sizeof(struct vnt_tx_datahead_g_fb);
} }
} // Auto Fall Back } // Auto Fall Back
} }
......
...@@ -132,6 +132,7 @@ struct vnt_rts_g_fb { ...@@ -132,6 +132,7 @@ struct vnt_rts_g_fb {
u16 wRTSDuration_ba_f1; u16 wRTSDuration_ba_f1;
u16 wRTSDuration_aa_f1; u16 wRTSDuration_aa_f1;
struct ieee80211_rts data; struct ieee80211_rts data;
struct vnt_tx_datahead_g_fb data_head;
} __packed; } __packed;
struct vnt_rts_ab { struct vnt_rts_ab {
...@@ -168,6 +169,7 @@ struct vnt_cts_fb { ...@@ -168,6 +169,7 @@ struct vnt_cts_fb {
u16 wCTSDuration_ba_f1; u16 wCTSDuration_ba_f1;
struct ieee80211_cts data; struct ieee80211_cts data;
u16 reserved2; u16 reserved2;
struct vnt_tx_datahead_g_fb data_head;
} __packed; } __packed;
union vnt_tx_data_head { union vnt_tx_data_head {
......
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