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

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

staging: vt6656: rxtx s_vFillTxKey Fix pdwIV base type



Use base type __le32 and endian correct changed values.

Correct endian conversions to cpu_to_le32.

Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fbfaccff
Loading
Loading
Loading
Loading
+5 −6
Original line number Original line Diff line number Diff line
@@ -181,7 +181,7 @@ static void s_vFillTxKey(struct vnt_private *pDevice,
	struct vnt_mic_hdr *mic_hdr)
	struct vnt_mic_hdr *mic_hdr)
{
{
	u8 *pbyBuf = (u8 *)&fifo_head->adwTxKey[0];
	u8 *pbyBuf = (u8 *)&fifo_head->adwTxKey[0];
	u32 *pdwIV = (u32 *)pbyIVHead;
	__le32 *pdwIV = (__le32 *)pbyIVHead;
	u32 *pdwExtIV = (u32 *)((u8 *)pbyIVHead + 4);
	u32 *pdwExtIV = (u32 *)((u8 *)pbyIVHead + 4);
	struct ieee80211_hdr *pMACHeader = (struct ieee80211_hdr *)pbyHdrBuf;
	struct ieee80211_hdr *pMACHeader = (struct ieee80211_hdr *)pbyHdrBuf;
	__le32 rev_iv_counter;
	__le32 rev_iv_counter;
@@ -191,7 +191,7 @@ static void s_vFillTxKey(struct vnt_private *pDevice,
		return;
		return;


	rev_iv_counter = cpu_to_le32(pDevice->dwIVCounter);
	rev_iv_counter = cpu_to_le32(pDevice->dwIVCounter);
	*pdwIV = pDevice->dwIVCounter;
	*pdwIV = cpu_to_le32(pDevice->dwIVCounter);
	pDevice->byKeyIndex = pTransmitKey->dwKeyIndex & 0xf;
	pDevice->byKeyIndex = pTransmitKey->dwKeyIndex & 0xf;


	switch (pTransmitKey->byCipherSuite) {
	switch (pTransmitKey->byCipherSuite) {
@@ -213,9 +213,8 @@ static void s_vFillTxKey(struct vnt_private *pDevice,
			memcpy(pDevice->abyPRNG, pbyBuf, 16);
			memcpy(pDevice->abyPRNG, pbyBuf, 16);
		}
		}
		/* Append IV after Mac Header */
		/* Append IV after Mac Header */
		*pdwIV &= WEP_IV_MASK;
		*pdwIV &= cpu_to_le32(WEP_IV_MASK);
		*pdwIV |= (u32)pDevice->byKeyIndex << 30;
		*pdwIV |= cpu_to_le32((u32)pDevice->byKeyIndex << 30);
		*pdwIV = cpu_to_le32(*pdwIV);


		pDevice->dwIVCounter++;
		pDevice->dwIVCounter++;
		if (pDevice->dwIVCounter > WEP_IV_MASK)
		if (pDevice->dwIVCounter > WEP_IV_MASK)
@@ -256,7 +255,7 @@ static void s_vFillTxKey(struct vnt_private *pDevice,
		*(pbyIVHead+3) = (u8)(((pDevice->byKeyIndex << 6) &
		*(pbyIVHead+3) = (u8)(((pDevice->byKeyIndex << 6) &
							0xc0) | 0x20);
							0xc0) | 0x20);


		*pdwIV |= cpu_to_le16((u16)(pTransmitKey->wTSC15_0));
		*pdwIV |= cpu_to_le32((u32)(pTransmitKey->wTSC15_0));


		/* Append IV&ExtIV after Mac Header */
		/* Append IV&ExtIV after Mac Header */
		*pdwExtIV = cpu_to_le32(pTransmitKey->dwTSC47_16);
		*pdwExtIV = cpu_to_le32(pTransmitKey->dwTSC47_16);