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

staging: vt6656: rxtx.c s_vFillRTSHead Parse out struct vnt_rts_a_fb to new function.

Parse out vnt_rts_a_fb code to new function vnt_rxtx_rts_a_fb_head.
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1712633d
...@@ -692,11 +692,34 @@ static int vnt_rxtx_rts_ab_head(struct vnt_private *priv, ...@@ -692,11 +692,34 @@ static int vnt_rxtx_rts_ab_head(struct vnt_private *priv,
return 0; return 0;
} }
static int vnt_rxtx_rts_a_fb_head(struct vnt_private *priv,
struct vnt_rts_a_fb *buf, struct ethhdr *eth_hdr,
u8 pkt_type, u32 frame_len, int need_ack,
u16 current_rate, u8 fb_option)
{
u16 rts_frame_len = 20;
BBvCalculateParameter(priv, rts_frame_len,
priv->byTopOFDMBasicRate, pkt_type, &buf->a);
buf->wDuration = s_uGetRTSCTSDuration(priv, RTSDUR_AA, frame_len,
pkt_type, current_rate, need_ack, fb_option);
buf->wRTSDuration_f0 = s_uGetRTSCTSDuration(priv, RTSDUR_AA_F0,
frame_len, pkt_type, current_rate, need_ack, fb_option);
buf->wRTSDuration_f1 = s_uGetRTSCTSDuration(priv, RTSDUR_AA_F1,
frame_len, pkt_type, current_rate, need_ack, fb_option);
vnt_fill_ieee80211_rts(priv, &buf->data, eth_hdr, buf->wDuration);
return 0;
}
static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType, static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType,
void *pvRTS, u32 cbFrameLength, int bNeedAck, void *pvRTS, u32 cbFrameLength, int bNeedAck,
struct ethhdr *psEthHeader, u16 wCurrentRate, u8 byFBOption) struct ethhdr *psEthHeader, u16 wCurrentRate, u8 byFBOption)
{ {
u32 uRTSFrameLen = 20;
if (pvRTS == NULL) if (pvRTS == NULL)
return; return;
...@@ -729,33 +752,10 @@ static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType, ...@@ -729,33 +752,10 @@ static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType,
} }
else { else {
struct vnt_rts_a_fb *pBuf = (struct vnt_rts_a_fb *)pvRTS; struct vnt_rts_a_fb *pBuf = (struct vnt_rts_a_fb *)pvRTS;
//Get SignalField,ServiceField,Length
BBvCalculateParameter(pDevice, uRTSFrameLen,
pDevice->byTopOFDMBasicRate, byPktType, &pBuf->a);
//Get Duration
pBuf->wDuration = s_uGetRTSCTSDuration(pDevice, RTSDUR_AA,
cbFrameLength, byPktType, wCurrentRate,
bNeedAck, byFBOption);
pBuf->wRTSDuration_f0 = s_uGetRTSCTSDuration(pDevice,
RTSDUR_AA_F0, cbFrameLength, byPktType,
wCurrentRate, bNeedAck, byFBOption);
pBuf->wRTSDuration_f1 = s_uGetRTSCTSDuration(pDevice,
RTSDUR_AA_F1, cbFrameLength, byPktType,
wCurrentRate, bNeedAck, byFBOption);
pBuf->data.duration = pBuf->wDuration;
/* Get RTS Frame body */
pBuf->data.frame_control = TYPE_CTL_RTS;
if (pDevice->eOPMode == OP_MODE_ADHOC ||
pDevice->eOPMode == OP_MODE_AP)
memcpy(pBuf->data.ra, psEthHeader->h_dest, ETH_ALEN);
else
memcpy(pBuf->data.ra, pDevice->abyBSSID, ETH_ALEN);
if (pDevice->eOPMode == OP_MODE_AP) vnt_rxtx_rts_a_fb_head(pDevice, pBuf,
memcpy(pBuf->data.ta, pDevice->abyBSSID, ETH_ALEN); psEthHeader, byPktType, cbFrameLength,
else bNeedAck, wCurrentRate, byFBOption);
memcpy(pBuf->data.ta, psEthHeader->h_source, ETH_ALEN);
} }
} }
else if (byPktType == PK_TYPE_11B) { else if (byPktType == PK_TYPE_11B) {
......
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