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

staging: vt6655: replace typedef struct tagSRTS_ab with struct vnt_rts_ab

Replacing members
ab, wDuration, wReserved and data

with

ab, duration, reserved and data

replacing unsigned short with u16 and __le16 where necessary.

pvRTS is void pointer.

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 9587b092
...@@ -352,15 +352,6 @@ union vnt_phy_field_swap { ...@@ -352,15 +352,6 @@ union vnt_phy_field_swap {
u32 field_write; u32 field_write;
}; };
typedef struct tagSRTS_ab {
struct vnt_phy_field ab;
unsigned short wDuration;
unsigned short wReserved;
struct ieee80211_rts data;
} __attribute__ ((__packed__))
SRTS_ab, *PSRTS_ab;
typedef const SRTS_ab *PCSRTS_ab;
typedef struct tagSRTS_a_FB { typedef struct tagSRTS_a_FB {
struct vnt_phy_field a; struct vnt_phy_field a;
unsigned short wDuration; unsigned short wDuration;
......
...@@ -920,31 +920,34 @@ s_vFillRTSHead( ...@@ -920,31 +920,34 @@ s_vFillRTSHead(
} // if (byFBOption == AUTO_FB_NONE) } // if (byFBOption == AUTO_FB_NONE)
} else if (byPktType == PK_TYPE_11A) { } else if (byPktType == PK_TYPE_11A) {
if (byFBOption == AUTO_FB_NONE) { if (byFBOption == AUTO_FB_NONE) {
PSRTS_ab pBuf = (PSRTS_ab)pvRTS; struct vnt_rts_ab *buf = pvRTS;
/* Get SignalField, ServiceField & Length */ /* Get SignalField, ServiceField & Length */
vnt_get_phy_field(pDevice, uRTSFrameLen, vnt_get_phy_field(pDevice, uRTSFrameLen,
pDevice->byTopOFDMBasicRate, pDevice->byTopOFDMBasicRate,
byPktType, &pBuf->ab); byPktType, &buf->ab);
//Get Duration /* Get Duration */
pBuf->wDuration = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //0:RTSDuration_aa, 0:5G, 0: 5G OFDMData buf->duration =
pBuf->data.duration = pBuf->wDuration; cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength,
byPktType, wCurrentRate, bNeedAck,
byFBOption));
buf->data.duration = buf->duration;
/* Get RTS Frame body */ /* Get RTS Frame body */
pBuf->data.frame_control = buf->data.frame_control =
cpu_to_le16(IEEE80211_FTYPE_CTL | cpu_to_le16(IEEE80211_FTYPE_CTL |
IEEE80211_STYPE_RTS); IEEE80211_STYPE_RTS);
if ((pDevice->eOPMode == OP_MODE_ADHOC) || if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) { (pDevice->eOPMode == OP_MODE_AP)) {
memcpy(&pBuf->data.ra, psEthHeader->abyDstAddr, ETH_ALEN); memcpy(&buf->data.ra, psEthHeader->abyDstAddr, ETH_ALEN);
} else { } else {
memcpy(&pBuf->data.ra, pDevice->abyBSSID, ETH_ALEN); memcpy(&buf->data.ra, pDevice->abyBSSID, ETH_ALEN);
} }
if (pDevice->eOPMode == OP_MODE_AP) if (pDevice->eOPMode == OP_MODE_AP)
memcpy(&pBuf->data.ta, pDevice->abyBSSID, ETH_ALEN); memcpy(&buf->data.ta, pDevice->abyBSSID, ETH_ALEN);
else else
memcpy(&pBuf->data.ta, psEthHeader->abySrcAddr, ETH_ALEN); memcpy(&buf->data.ta, psEthHeader->abySrcAddr, ETH_ALEN);
} else { } else {
PSRTS_a_FB pBuf = (PSRTS_a_FB)pvRTS; PSRTS_a_FB pBuf = (PSRTS_a_FB)pvRTS;
...@@ -975,29 +978,32 @@ s_vFillRTSHead( ...@@ -975,29 +978,32 @@ s_vFillRTSHead(
memcpy(&pBuf->data.ta, psEthHeader->abySrcAddr, ETH_ALEN); memcpy(&pBuf->data.ta, psEthHeader->abySrcAddr, ETH_ALEN);
} }
} else if (byPktType == PK_TYPE_11B) { } else if (byPktType == PK_TYPE_11B) {
PSRTS_ab pBuf = (PSRTS_ab)pvRTS; struct vnt_rts_ab *buf = pvRTS;
/* Get SignalField, ServiceField & Length */ /* Get SignalField, ServiceField & Length */
vnt_get_phy_field(pDevice, uRTSFrameLen, vnt_get_phy_field(pDevice, uRTSFrameLen,
pDevice->byTopCCKBasicRate, pDevice->byTopCCKBasicRate,
PK_TYPE_11B, &pBuf->ab); PK_TYPE_11B, &buf->ab);
//Get Duration /* Get Duration */
pBuf->wDuration = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //0:RTSDuration_bb, 1:2.4G, 1:CCKData buf->duration =
pBuf->data.duration = pBuf->wDuration; cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, cbFrameLength,
byPktType, wCurrentRate, bNeedAck,
byFBOption));
buf->data.duration = buf->duration;
/* Get RTS Frame body */ /* Get RTS Frame body */
pBuf->data.frame_control = buf->data.frame_control =
cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_RTS); cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_RTS);
if ((pDevice->eOPMode == OP_MODE_ADHOC) || if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) { (pDevice->eOPMode == OP_MODE_AP)) {
memcpy(&pBuf->data.ra, psEthHeader->abyDstAddr, ETH_ALEN); memcpy(&buf->data.ra, psEthHeader->abyDstAddr, ETH_ALEN);
} else { } else {
memcpy(&pBuf->data.ra, pDevice->abyBSSID, ETH_ALEN); memcpy(&buf->data.ra, pDevice->abyBSSID, ETH_ALEN);
} }
if (pDevice->eOPMode == OP_MODE_AP) if (pDevice->eOPMode == OP_MODE_AP)
memcpy(&pBuf->data.ta, pDevice->abyBSSID, ETH_ALEN); memcpy(&buf->data.ta, pDevice->abyBSSID, ETH_ALEN);
else else
memcpy(&pBuf->data.ta, psEthHeader->abySrcAddr, ETH_ALEN); memcpy(&buf->data.ta, psEthHeader->abySrcAddr, ETH_ALEN);
} }
} }
...@@ -1408,12 +1414,12 @@ s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType, ...@@ -1408,12 +1414,12 @@ s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
if (bRTS == true) { if (bRTS == true) {
pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize); pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize);
pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab)); pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab));
pvRTS = (PSRTS_ab) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR); pvRTS = (void *)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR);
pvCTS = NULL; pvCTS = NULL;
pvTxDataHd = (void *)(pbyTxBufferAddr + wTxBufSize + pvTxDataHd = (void *)(pbyTxBufferAddr + wTxBufSize +
sizeof(struct vnt_rrv_time_ab) + cbMICHDR + sizeof(SRTS_ab)); sizeof(struct vnt_rrv_time_ab) + cbMICHDR + sizeof(struct vnt_rts_ab));
cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_ab) +
cbMICHDR + sizeof(SRTS_ab) + sizeof(struct vnt_tx_datahead_ab); cbMICHDR + sizeof(struct vnt_rts_ab) + sizeof(struct vnt_tx_datahead_ab);
} else { //RTS_needless, need MICHDR } else { //RTS_needless, need MICHDR
pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize); pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize);
pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab)); pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab));
......
...@@ -138,6 +138,13 @@ struct vnt_rts_g_fb { ...@@ -138,6 +138,13 @@ struct vnt_rts_g_fb {
struct ieee80211_rts data; struct ieee80211_rts data;
} __packed; } __packed;
struct vnt_rts_ab {
struct vnt_phy_field ab;
__le16 duration;
u16 reserved;
struct ieee80211_rts data;
} __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