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

staging: vt6655: replace typedef struct tagSCTS with struct vnt_cts

Replacing members
b, wDuration_ba, wReserved, data and reserved2
with
b, duration_ba, reserved, data and reserved2

unsigned short is replaced with u16 or __le16 where necessary.

cast void pointer to pvCTS

Creating the new structure in rxtx.h
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8e44804e
...@@ -355,16 +355,6 @@ union vnt_phy_field_swap { ...@@ -355,16 +355,6 @@ union vnt_phy_field_swap {
// //
// CTS buffer header // CTS buffer header
// //
typedef struct tagSCTS {
struct vnt_phy_field b;
unsigned short wDuration_ba;
unsigned short wReserved;
struct ieee80211_cts data;
u16 reserved2;
} __attribute__ ((__packed__))
SCTS, *PSCTS;
typedef const SCTS *PCSCTS;
typedef struct tagSCTS_FB { typedef struct tagSCTS_FB {
struct vnt_phy_field b; struct vnt_phy_field b;
unsigned short wDuration_ba; unsigned short wDuration_ba;
......
...@@ -1071,26 +1071,29 @@ s_vFillCTSHead( ...@@ -1071,26 +1071,29 @@ s_vFillCTSHead(
memcpy(&pBuf->data.ra, pDevice->abyCurrentNetAddr, ETH_ALEN); memcpy(&pBuf->data.ra, pDevice->abyCurrentNetAddr, ETH_ALEN);
} else { //if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) } else { //if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA)
PSCTS pBuf = (PSCTS)pvCTS; struct vnt_cts *buf = pvCTS;
/* Get SignalField, ServiceField & Length */ /* Get SignalField, ServiceField & Length */
vnt_get_phy_field(pDevice, uCTSFrameLen, vnt_get_phy_field(pDevice, uCTSFrameLen,
pDevice->byTopCCKBasicRate, pDevice->byTopCCKBasicRate,
PK_TYPE_11B, &pBuf->b); PK_TYPE_11B, &buf->b);
//Get CTSDuration_ba /* Get CTSDuration_ba */
pBuf->wDuration_ba = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //3:CTSDuration_ba, 1:2.4G, 2,3:2.4G OFDM Data buf->duration_ba =
pBuf->wDuration_ba += pDevice->wCTSDuration; cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA, cbFrameLength,
pBuf->wDuration_ba = cpu_to_le16(pBuf->wDuration_ba); byPktType, wCurrentRate, bNeedAck,
byFBOption));
buf->duration_ba += pDevice->wCTSDuration;
buf->duration_ba = cpu_to_le16(buf->duration_ba);
//Get CTS Frame body /* Get CTS Frame body */
pBuf->data.duration = pBuf->wDuration_ba; buf->data.duration = buf->duration_ba;
pBuf->data.frame_control = buf->data.frame_control =
cpu_to_le16(IEEE80211_FTYPE_CTL | cpu_to_le16(IEEE80211_FTYPE_CTL |
IEEE80211_STYPE_CTS); IEEE80211_STYPE_CTS);
pBuf->reserved2 = 0x0; buf->reserved2 = 0x0;
memcpy(&pBuf->data.ra, pDevice->abyCurrentNetAddr, ETH_ALEN); memcpy(&buf->data.ra, pDevice->abyCurrentNetAddr, ETH_ALEN);
} }
} }
} }
...@@ -1390,10 +1393,11 @@ s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType, ...@@ -1390,10 +1393,11 @@ s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize); pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize);
pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts)); pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts));
pvRTS = NULL; pvRTS = NULL;
pvCTS = (PSCTS) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbMICHDR); pvCTS = (void *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbMICHDR);
pvTxDataHd = (void *)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbMICHDR + sizeof(SCTS)); pvTxDataHd = (void *)(pbyTxBufferAddr + wTxBufSize +
sizeof(struct vnt_rrv_time_cts) + cbMICHDR + sizeof(struct vnt_cts));
cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_cts) +
cbMICHDR + sizeof(SCTS) + sizeof(struct vnt_tx_datahead_g); cbMICHDR + sizeof(struct vnt_cts) + sizeof(struct vnt_tx_datahead_g);
} }
} else { } else {
// Auto Fall Back // Auto Fall Back
...@@ -2126,7 +2130,7 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice, PSTxMgmtPacket pPacket) ...@@ -2126,7 +2130,7 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice, PSTxMgmtPacket pPacket)
unsigned char byPktType; unsigned char byPktType;
unsigned char *pbyTxBufferAddr; unsigned char *pbyTxBufferAddr;
void *pvRTS; void *pvRTS;
PSCTS pCTS; struct vnt_cts *pCTS;
void *pvTxDataHd; void *pvTxDataHd;
unsigned int uDuration; unsigned int uDuration;
unsigned int cbReqCount; unsigned int cbReqCount;
...@@ -2264,12 +2268,12 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice, PSTxMgmtPacket pPacket) ...@@ -2264,12 +2268,12 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice, PSTxMgmtPacket pPacket)
pvRrvTime = (void *) (pbyTxBufferAddr + wTxBufSize); pvRrvTime = (void *) (pbyTxBufferAddr + wTxBufSize);
pMICHDR = NULL; pMICHDR = NULL;
pvRTS = NULL; pvRTS = NULL;
pCTS = (PSCTS) (pbyTxBufferAddr + wTxBufSize + pCTS = (struct vnt_cts *)(pbyTxBufferAddr + wTxBufSize +
sizeof(struct vnt_rrv_time_cts)); sizeof(struct vnt_rrv_time_cts));
pvTxDataHd = (void *)(pbyTxBufferAddr + wTxBufSize + pvTxDataHd = (void *)(pbyTxBufferAddr + wTxBufSize +
sizeof(struct vnt_rrv_time_cts) + sizeof(SCTS)); sizeof(struct vnt_rrv_time_cts) + sizeof(struct vnt_cts));
cbHeaderSize = wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbHeaderSize = wTxBufSize + sizeof(struct vnt_rrv_time_cts) +
sizeof(SCTS) + sizeof(struct vnt_tx_datahead_g); sizeof(struct vnt_cts) + sizeof(struct vnt_tx_datahead_g);
} else { // 802.11a/b packet } else { // 802.11a/b packet
pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize); pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize);
pMICHDR = NULL; pMICHDR = NULL;
...@@ -2754,12 +2758,12 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb, ...@@ -2754,12 +2758,12 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb,
pMICHDR = (struct vnt_mic_hdr *)(pbyTxBufferAddr + wTxBufSize + pMICHDR = (struct vnt_mic_hdr *)(pbyTxBufferAddr + wTxBufSize +
sizeof(struct vnt_rrv_time_cts)); sizeof(struct vnt_rrv_time_cts));
pvRTS = NULL; pvRTS = NULL;
pvCTS = (PSCTS) (pbyTxBufferAddr + wTxBufSize + pvCTS = (struct vnt_cts *)(pbyTxBufferAddr + wTxBufSize +
sizeof(struct vnt_rrv_time_cts) + cbMICHDR); sizeof(struct vnt_rrv_time_cts) + cbMICHDR);
pvTxDataHd = (void *)(pbyTxBufferAddr + wTxBufSize + pvTxDataHd = (void *)(pbyTxBufferAddr + wTxBufSize +
sizeof(struct vnt_rrv_time_cts) + cbMICHDR + sizeof(SCTS)); sizeof(struct vnt_rrv_time_cts) + cbMICHDR + sizeof(struct vnt_cts));
cbHeaderSize = wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbHeaderSize = wTxBufSize + sizeof(struct vnt_rrv_time_cts) +
cbMICHDR + sizeof(SCTS) + sizeof(struct vnt_tx_datahead_g); cbMICHDR + sizeof(struct vnt_cts) + sizeof(struct vnt_tx_datahead_g);
} else {//802.11a/b packet } else {//802.11a/b packet
......
...@@ -154,6 +154,15 @@ struct vnt_rts_a_fb { ...@@ -154,6 +154,15 @@ struct vnt_rts_a_fb {
struct ieee80211_rts data; struct ieee80211_rts data;
} __packed; } __packed;
/* CTS buffer header */
struct vnt_cts {
struct vnt_phy_field b;
__le16 duration_ba;
u16 reserved;
struct ieee80211_cts data;
u16 reserved2;
} __packed;
struct vnt_tx_short_buf_head { struct vnt_tx_short_buf_head {
__le16 fifo_ctl; __le16 fifo_ctl;
u16 time_stamp; u16 time_stamp;
......
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