Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db1afd18 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman
Browse files

staging: vt6655: replace typedef struct tagSCTS_FB with struct vnt_cts_fb



Replacing members
b, wDuration_ba,  wReserved, wCTSDuration_ba_f0, wCTSDuration_ba_f1, data and
reserved2.

With
b, duration_ba, reserved, cts_duration_ba_f0, cts_duration_ba_f1, 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 f5172b0e
Loading
Loading
Loading
Loading
+0 −15
Original line number Original line Diff line number Diff line
@@ -352,21 +352,6 @@ union vnt_phy_field_swap {
	u32 field_write;
	u32 field_write;
};
};


//
// CTS buffer header
//
typedef struct tagSCTS_FB {
	struct vnt_phy_field b;
	unsigned short wDuration_ba;
	unsigned short wReserved;
	unsigned short wCTSDuration_ba_f0;
	unsigned short wCTSDuration_ba_f1;
	struct ieee80211_cts data;
	u16 reserved2;
} __attribute__ ((__packed__))
SCTS_FB, *PSCTS_FB;
typedef const SCTS_FB *PCSCTS_FB;

//
//
// Tx FIFO header
// Tx FIFO header
//
//
+30 −20
Original line number Original line Diff line number Diff line
@@ -1043,33 +1043,42 @@ s_vFillCTSHead(
	if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {
	if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {
		if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) {
		if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) {
			// Auto Fall back
			// Auto Fall back
			PSCTS_FB pBuf = (PSCTS_FB)pvCTS;
			struct vnt_cts_fb *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);


			pBuf->wDuration_ba = (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 = (u16)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA, cbFrameLength,
			pBuf->wDuration_ba += pDevice->wCTSDuration;
								     byPktType, wCurrentRate, bNeedAck, byFBOption);
			pBuf->wDuration_ba = cpu_to_le16(pBuf->wDuration_ba);
			buf->duration_ba += pDevice->wCTSDuration;
			//Get CTSDuration_ba_f0

			pBuf->wCTSDuration_ba_f0 = (unsigned short)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA_F0, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption); //8:CTSDuration_ba_f0, 1:2.4G, 2,3:2.4G OFDM Data
			buf->duration_ba = cpu_to_le16(buf->duration_ba);
			pBuf->wCTSDuration_ba_f0 += pDevice->wCTSDuration;
			/* Get CTSDuration_ba_f0 */
			pBuf->wCTSDuration_ba_f0 = cpu_to_le16(pBuf->wCTSDuration_ba_f0);
			buf->cts_duration_ba_f0 = (u16)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA_F0, cbFrameLength,
									    byPktType, wCurrentRate,
									    bNeedAck, byFBOption);

			buf->cts_duration_ba_f0 += pDevice->wCTSDuration;

			buf->cts_duration_ba_f0 = cpu_to_le16(buf->cts_duration_ba_f0);
			//Get CTSDuration_ba_f1
			//Get CTSDuration_ba_f1
			pBuf->wCTSDuration_ba_f1 = (unsigned short)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA_F1, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption); //9:CTSDuration_ba_f1, 1:2.4G, 2,3:2.4G OFDM Data
			buf->cts_duration_ba_f1 = (u16)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA_F1, cbFrameLength,
			pBuf->wCTSDuration_ba_f1 += pDevice->wCTSDuration;
									    byPktType, wCurrentRate,
			pBuf->wCTSDuration_ba_f1 = cpu_to_le16(pBuf->wCTSDuration_ba_f1);
									    bNeedAck, byFBOption);
			buf->cts_duration_ba_f1 += pDevice->wCTSDuration;

			buf->cts_duration_ba_f1 = cpu_to_le16(buf->cts_duration_ba_f1);
			/* 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);
		} else { //if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA)
		} else { //if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA)
			struct vnt_cts *buf = pvCTS;
			struct vnt_cts *buf = pvCTS;
			/* Get SignalField, ServiceField & Length */
			/* Get SignalField, ServiceField & Length */
@@ -1414,10 +1423,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_FB) (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_FB));
				pvTxDataHd = (void  *)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts) +
					cbMICHDR + sizeof(struct vnt_cts_fb));
				cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_cts) +
				cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_cts) +
					cbMICHDR + sizeof(SCTS_FB) + sizeof(struct vnt_tx_datahead_g_fb);
					cbMICHDR + sizeof(struct vnt_cts_fb) + sizeof(struct vnt_tx_datahead_g_fb);
			}
			}
		} // Auto Fall Back
		} // Auto Fall Back
	} else {//802.11a/b packet
	} else {//802.11a/b packet
+10 −0
Original line number Original line Diff line number Diff line
@@ -163,6 +163,16 @@ struct vnt_cts {
	u16 reserved2;
	u16 reserved2;
} __packed;
} __packed;


struct vnt_cts_fb {
	struct vnt_phy_field b;
	__le16 duration_ba;
	u16 reserved;
	__le16 cts_duration_ba_f0;
	__le16 cts_duration_ba_f1;
	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;