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

staging: vt6656: csBeacon_xmit merge structures.

Merge structures typedef struct tagSTxShortBufHead and the members of
struct vnt_tx_datahead_ab to form single structure vnt_tx_short_buf_head.

Remove the duplicate members in struct vnt_beacon_buffer already in
typedef struct tagSTxShortBufHead.

This removes the need for any pointer arithmetic.
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c47b0a34
...@@ -146,14 +146,6 @@ ...@@ -146,14 +146,6 @@
/* /*
* TX FIFO header * TX FIFO header
*/ */
typedef struct tagSTxShortBufHead {
u16 wFIFOCtl;
u16 wTimeStamp;
} __attribute__ ((__packed__))
STxShortBufHead, *PSTxShortBufHead;
typedef const STxShortBufHead *PCSTxShortBufHead;
typedef struct tagSBEACONCtl { typedef struct tagSBEACONCtl {
u32 BufReady:1; u32 BufReady:1;
u32 TSF:15; u32 TSF:15;
......
...@@ -1643,12 +1643,10 @@ CMD_STATUS csBeacon_xmit(struct vnt_private *pDevice, ...@@ -1643,12 +1643,10 @@ CMD_STATUS csBeacon_xmit(struct vnt_private *pDevice,
struct vnt_tx_mgmt *pPacket) struct vnt_tx_mgmt *pPacket)
{ {
struct vnt_beacon_buffer *pTX_Buffer; struct vnt_beacon_buffer *pTX_Buffer;
struct vnt_tx_short_buf_head *short_head;
u32 cbFrameSize = pPacket->cbMPDULen + WLAN_FCS_LEN; u32 cbFrameSize = pPacket->cbMPDULen + WLAN_FCS_LEN;
u32 cbHeaderSize = 0; u32 cbHeaderSize = 0;
u16 wTxBufSize = sizeof(STxShortBufHead);
PSTxShortBufHead pTxBufHead;
struct ieee80211_hdr *pMACHeader; struct ieee80211_hdr *pMACHeader;
struct vnt_tx_datahead_ab *pTxDataHead;
u16 wCurrentRate; u16 wCurrentRate;
u32 cbFrameBodySize; u32 cbFrameBodySize;
u32 cbReqCount; u32 cbReqCount;
...@@ -1664,40 +1662,41 @@ CMD_STATUS csBeacon_xmit(struct vnt_private *pDevice, ...@@ -1664,40 +1662,41 @@ CMD_STATUS csBeacon_xmit(struct vnt_private *pDevice,
} }
pTX_Buffer = (struct vnt_beacon_buffer *)&pContext->Data[0]; pTX_Buffer = (struct vnt_beacon_buffer *)&pContext->Data[0];
pbyTxBufferAddr = (u8 *)&(pTX_Buffer->wFIFOCtl); short_head = &pTX_Buffer->short_head;
pbyTxBufferAddr = (u8 *)&short_head->fifo_ctl;
cbFrameBodySize = pPacket->cbPayloadLen; cbFrameBodySize = pPacket->cbPayloadLen;
pTxBufHead = (PSTxShortBufHead) pbyTxBufferAddr; cbHeaderSize = sizeof(struct vnt_tx_short_buf_head);
wTxBufSize = sizeof(STxShortBufHead);
if (pDevice->byBBType == BB_TYPE_11A) { if (pDevice->byBBType == BB_TYPE_11A) {
wCurrentRate = RATE_6M; wCurrentRate = RATE_6M;
pTxDataHead = (struct vnt_tx_datahead_ab *)
(pbyTxBufferAddr + wTxBufSize); /* Get SignalField,ServiceField,Length */
//Get SignalField,ServiceField,Length BBvCalculateParameter(pDevice, cbFrameSize, wCurrentRate,
BBvCalculateParameter(pDevice, cbFrameSize, wCurrentRate, PK_TYPE_11A, PK_TYPE_11A, &short_head->ab);
&pTxDataHead->ab);
//Get Duration and TimeStampOff /* Get Duration and TimeStampOff */
pTxDataHead->wDuration = s_uGetDataDuration(pDevice, short_head->duration = s_uGetDataDuration(pDevice,
PK_TYPE_11A, false); PK_TYPE_11A, false);
pTxDataHead->wTimeStampOff = vnt_time_stamp_off(pDevice, wCurrentRate); short_head->time_stamp_off =
cbHeaderSize = wTxBufSize + sizeof(struct vnt_tx_datahead_ab); vnt_time_stamp_off(pDevice, wCurrentRate);
} else { } else {
wCurrentRate = RATE_1M; wCurrentRate = RATE_1M;
pTxBufHead->wFIFOCtl |= FIFOCTL_11B; short_head->fifo_ctl |= FIFOCTL_11B;
pTxDataHead = (struct vnt_tx_datahead_ab *)
(pbyTxBufferAddr + wTxBufSize); /* Get SignalField,ServiceField,Length */
//Get SignalField,ServiceField,Length BBvCalculateParameter(pDevice, cbFrameSize, wCurrentRate,
BBvCalculateParameter(pDevice, cbFrameSize, wCurrentRate, PK_TYPE_11B, PK_TYPE_11B, &short_head->ab);
&pTxDataHead->ab);
//Get Duration and TimeStampOff /* Get Duration and TimeStampOff */
pTxDataHead->wDuration = s_uGetDataDuration(pDevice, short_head->duration = s_uGetDataDuration(pDevice,
PK_TYPE_11B, false); PK_TYPE_11B, false);
pTxDataHead->wTimeStampOff = vnt_time_stamp_off(pDevice, wCurrentRate); short_head->time_stamp_off =
cbHeaderSize = wTxBufSize + sizeof(struct vnt_tx_datahead_ab); vnt_time_stamp_off(pDevice, wCurrentRate);
} }
//Generate Beacon Header //Generate Beacon Header
pMACHeader = (struct ieee80211_hdr *)(pbyTxBufferAddr + cbHeaderSize); pMACHeader = (struct ieee80211_hdr *)(pbyTxBufferAddr + cbHeaderSize);
memcpy(pMACHeader, pPacket->p80211Header, pPacket->cbMPDULen); memcpy(pMACHeader, pPacket->p80211Header, pPacket->cbMPDULen);
......
...@@ -230,12 +230,19 @@ struct vnt_tx_buffer { ...@@ -230,12 +230,19 @@ struct vnt_tx_buffer {
union vnt_tx_head tx_head; union vnt_tx_head tx_head;
} __packed; } __packed;
struct vnt_tx_short_buf_head {
u16 fifo_ctl;
u16 time_stamp;
struct vnt_phy_field ab;
u16 duration;
u16 time_stamp_off;
} __packed;
struct vnt_beacon_buffer { struct vnt_beacon_buffer {
u8 byType; u8 byType;
u8 byPKTNO; u8 byPKTNO;
u16 wTxByteCount; u16 wTxByteCount;
u16 wFIFOCtl; struct vnt_tx_short_buf_head short_head;
u16 wTimeStamp;
} __packed; } __packed;
void vDMA0_tx_80211(struct vnt_private *, struct sk_buff *skb); void vDMA0_tx_80211(struct vnt_private *, struct sk_buff *skb);
......
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