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

staging: vt6656: rxtx.c add no rts struct vnt_tx_datahead_ab

Add no rts/cts vnt_tx_datahead_ab to union vnt_tx_data_head.

The need_mic now applies to all modes of packet type PK_TYPE_11B.

and return vnt_rxtx_datahead_ab in s_vGenerateTxParameter

This removes pvTxDataHd pointer assignment and calls to s_uFillDataHead.

Since pvTxDataHd is now null a small vendor hack to vDMA0_tx_80211/csMgmt_xmit
to do with Disassociation-packet is also changed correct head position.
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5634a5ab
...@@ -966,6 +966,13 @@ static u16 s_vGenerateTxParameter(struct vnt_private *pDevice, ...@@ -966,6 +966,13 @@ static u16 s_vGenerateTxParameter(struct vnt_private *pDevice,
} }
} }
else if (byPktType == PK_TYPE_11B) { else if (byPktType == PK_TYPE_11B) {
if (need_mic) {
*mic_hdr = &tx_buffer->tx_head.tx_ab.tx.mic.hdr;
head = &tx_buffer->tx_head.tx_ab.tx.mic.head;
} else {
head = &tx_buffer->tx_head.tx_ab.tx.head;
}
if (need_rts) { if (need_rts) {
//Fill RsvTime //Fill RsvTime
struct vnt_rrv_time_ab *pBuf = &tx_buffer->tx_head.tx_ab.ab; struct vnt_rrv_time_ab *pBuf = &tx_buffer->tx_head.tx_ab.ab;
...@@ -975,13 +982,6 @@ static u16 s_vGenerateTxParameter(struct vnt_private *pDevice, ...@@ -975,13 +982,6 @@ static u16 s_vGenerateTxParameter(struct vnt_private *pDevice,
pBuf->wTxRrvTime = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, pBuf->wTxRrvTime = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B,
cbFrameSize, wCurrentRate, bNeedACK); cbFrameSize, wCurrentRate, bNeedACK);
if (need_mic) {
*mic_hdr = &tx_buffer->tx_head.tx_ab.tx.mic.hdr;
head = &tx_buffer->tx_head.tx_ab.tx.mic.head;
} else {
head = &tx_buffer->tx_head.tx_ab.tx.head;
}
/* Fill RTS */ /* Fill RTS */
return s_vFillRTSHead(pDevice, byPktType, head, cbFrameSize, return s_vFillRTSHead(pDevice, byPktType, head, cbFrameSize,
bNeedACK, psEthHeader, wCurrentRate, byFBOption); bNeedACK, psEthHeader, wCurrentRate, byFBOption);
...@@ -990,11 +990,11 @@ static u16 s_vGenerateTxParameter(struct vnt_private *pDevice, ...@@ -990,11 +990,11 @@ static u16 s_vGenerateTxParameter(struct vnt_private *pDevice,
//Fill RsvTime //Fill RsvTime
struct vnt_rrv_time_ab *pBuf = &tx_buffer->tx_head.tx_ab.ab; struct vnt_rrv_time_ab *pBuf = &tx_buffer->tx_head.tx_ab.ab;
if (need_mic)
*mic_hdr = &tx_buffer->tx_head.tx_ab.tx.mic.hdr;
pBuf->wTxRrvTime = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, pBuf->wTxRrvTime = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B,
cbFrameSize, wCurrentRate, bNeedACK); cbFrameSize, wCurrentRate, bNeedACK);
return vnt_rxtx_datahead_ab(pDevice, byPktType, wCurrentRate,
&head->data_head_ab, cbFrameSize, bNeedACK);
} }
} }
//DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"s_vGenerateTxParameter END.\n"); //DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"s_vGenerateTxParameter END.\n");
...@@ -1188,8 +1188,6 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType, ...@@ -1188,8 +1188,6 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
cbMICHDR + sizeof(struct vnt_rts_ab); cbMICHDR + sizeof(struct vnt_rts_ab);
} }
else if (bRTS == false) { //RTS_needless, no MICHDR else if (bRTS == false) { //RTS_needless, no MICHDR
pvTxDataHd = (struct vnt_tx_datahead_ab *)(pbyTxBufferAddr +
wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR);
cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_ab) +
cbMICHDR + sizeof(struct vnt_tx_datahead_ab); cbMICHDR + sizeof(struct vnt_tx_datahead_ab);
} }
...@@ -1222,10 +1220,7 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType, ...@@ -1222,10 +1220,7 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
uDuration = s_vGenerateTxParameter(pDevice, byPktType, wCurrentRate, uDuration = s_vGenerateTxParameter(pDevice, byPktType, wCurrentRate,
tx_buffer, &pMICHDR, cbMICHDR, tx_buffer, &pMICHDR, cbMICHDR,
cbFrameSize, bNeedACK, uDMAIdx, psEthHeader, bRTS); cbFrameSize, bNeedACK, uDMAIdx, psEthHeader, bRTS);
//Fill DataHead
if (pvTxDataHd)
uDuration |= s_uFillDataHead(pDevice, byPktType, wCurrentRate,
pvTxDataHd, cbFrameSize, uDMAIdx, bNeedACK, byFBOption);
// Generate TX MAC Header // Generate TX MAC Header
s_vGenerateMACHeader(pDevice, pbyMacHdr, (u16)uDuration, psEthHeader, bNeedEncryption, s_vGenerateMACHeader(pDevice, pbyMacHdr, (u16)uDuration, psEthHeader, bNeedEncryption,
byFragType, uDMAIdx, 0); byFragType, uDMAIdx, 0);
...@@ -1458,7 +1453,6 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice, ...@@ -1458,7 +1453,6 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
struct ieee80211_hdr *pMACHeader; struct ieee80211_hdr *pMACHeader;
struct ethhdr sEthHeader; struct ethhdr sEthHeader;
u8 byPktType, *pbyTxBufferAddr; u8 byPktType, *pbyTxBufferAddr;
void *pvTxDataHd;
struct vnt_mic_hdr *pMICHDR = NULL; struct vnt_mic_hdr *pMICHDR = NULL;
u32 uDuration, cbReqCount, cbHeaderSize, cbFrameBodySize, cbFrameSize; u32 uDuration, cbReqCount, cbHeaderSize, cbFrameBodySize, cbFrameSize;
int bNeedACK, bIsPSPOLL = false; int bNeedACK, bIsPSPOLL = false;
...@@ -1595,8 +1589,6 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice, ...@@ -1595,8 +1589,6 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
sizeof(struct vnt_cts); sizeof(struct vnt_cts);
} }
else { // 802.11a/b packet else { // 802.11a/b packet
pvTxDataHd = (struct vnt_tx_datahead_ab *) (pbyTxBufferAddr +
wTxBufSize + sizeof(struct vnt_rrv_time_ab));
cbHeaderSize = wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbHeaderSize = wTxBufSize + sizeof(struct vnt_rrv_time_ab) +
sizeof(struct vnt_tx_datahead_ab); sizeof(struct vnt_tx_datahead_ab);
} }
...@@ -1617,10 +1609,6 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice, ...@@ -1617,10 +1609,6 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
pTX_Buffer, &pMICHDR, 0, pTX_Buffer, &pMICHDR, 0,
cbFrameSize, bNeedACK, TYPE_TXDMA0, &sEthHeader, false); cbFrameSize, bNeedACK, TYPE_TXDMA0, &sEthHeader, false);
//Fill DataHead
uDuration |= s_uFillDataHead(pDevice, byPktType, wCurrentRate, pvTxDataHd,
cbFrameSize, TYPE_TXDMA0, bNeedACK, AUTO_FB_NONE);
pMACHeader = (struct ieee80211_hdr *) (pbyTxBufferAddr + cbHeaderSize); pMACHeader = (struct ieee80211_hdr *) (pbyTxBufferAddr + cbHeaderSize);
cbReqCount = cbHeaderSize + cbMacHdLen + uPadding + cbIVlen + cbFrameBodySize; cbReqCount = cbHeaderSize + cbMacHdLen + uPadding + cbIVlen + cbFrameBodySize;
...@@ -1690,7 +1678,9 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice, ...@@ -1690,7 +1678,9 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
data_head->wDuration_b = data_head->wDuration_b =
cpu_to_le16(pPacket->p80211Header->sA2.wDurationID); cpu_to_le16(pPacket->p80211Header->sA2.wDurationID);
} else { } else {
((struct vnt_tx_datahead_ab *)pvTxDataHd)->wDuration = struct vnt_tx_datahead_ab *data_head = &pTX_Buffer->tx_head.
tx_ab.tx.head.data_head_ab;
data_head->wDuration =
cpu_to_le16(pPacket->p80211Header->sA2.wDurationID); cpu_to_le16(pPacket->p80211Header->sA2.wDurationID);
} }
} }
...@@ -1999,8 +1989,6 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb) ...@@ -1999,8 +1989,6 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)
} }
else {//802.11a/b packet else {//802.11a/b packet
pvTxDataHd = (struct vnt_tx_datahead_ab *)(pbyTxBufferAddr +
wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR);
cbHeaderSize = wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR + cbHeaderSize = wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR +
sizeof(struct vnt_tx_datahead_ab); sizeof(struct vnt_tx_datahead_ab);
} }
...@@ -2139,7 +2127,9 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb) ...@@ -2139,7 +2127,9 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)
data_head->wDuration_b = data_head->wDuration_b =
cpu_to_le16(p80211Header->sA2.wDurationID); cpu_to_le16(p80211Header->sA2.wDurationID);
} else { } else {
((struct vnt_tx_datahead_ab *)pvTxDataHd)->wDuration = struct vnt_tx_datahead_ab *data_head = &pTX_Buffer->tx_head.
tx_ab.tx.head.data_head_ab;
data_head->wDuration =
cpu_to_le16(p80211Header->sA2.wDurationID); cpu_to_le16(p80211Header->sA2.wDurationID);
} }
} }
......
...@@ -186,6 +186,7 @@ union vnt_tx_data_head { ...@@ -186,6 +186,7 @@ union vnt_tx_data_head {
struct vnt_cts_fb cts_g_fb; struct vnt_cts_fb cts_g_fb;
/* no rts/cts */ /* no rts/cts */
struct vnt_tx_datahead_a_fb data_head_a_fb; struct vnt_tx_datahead_a_fb data_head_a_fb;
struct vnt_tx_datahead_ab data_head_ab;
}; };
struct vnt_tx_mic_hdr { struct vnt_tx_mic_hdr {
......
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