Commit 5b4df5c6 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Greg Kroah-Hartman

Staging: rtxxx0: remove unused code

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 881abc9d
......@@ -2017,119 +2017,6 @@ VOID RTMPHandleRxCoherentInterrupt(
DBGPRINT(RT_DEBUG_TRACE, ("<== RTMPHandleRxCoherentInterrupt \n"));
}
VOID DBGPRINT_TX_RING(
IN PRTMP_ADAPTER pAd,
IN UCHAR QueIdx)
{
UINT32 Ac0Base;
UINT32 Ac0HwIdx = 0, Ac0SwIdx = 0, AC0freeIdx;
int i;
PULONG ptemp;
DBGPRINT_RAW(RT_DEBUG_TRACE, ("=====================================================\n " ));
switch (QueIdx)
{
case QID_AC_BE:
RTMP_IO_READ32(pAd, TX_BASE_PTR0, &Ac0Base);
RTMP_IO_READ32(pAd, TX_CTX_IDX0, &Ac0SwIdx);
RTMP_IO_READ32(pAd, TX_DTX_IDX0, &Ac0HwIdx);
DBGPRINT_RAW(RT_DEBUG_TRACE, ("All QID_AC_BE DESCRIPTOR \n " ));
for (i=0;i<TX_RING_SIZE;i++)
{
ptemp= (PULONG)pAd->TxRing[QID_AC_BE].Cell[i].AllocVa;
DBGPRINT_RAW(RT_DEBUG_TRACE, ("[%02d] %08lx: %08lx: %08lx: %08lx\n " , i, *ptemp,*(ptemp+1),*(ptemp+2),*(ptemp+3)));
}
DBGPRINT_RAW(RT_DEBUG_TRACE, (" \n " ));
break;
case QID_AC_BK:
RTMP_IO_READ32(pAd, TX_BASE_PTR1, &Ac0Base);
RTMP_IO_READ32(pAd, TX_CTX_IDX1, &Ac0SwIdx);
RTMP_IO_READ32(pAd, TX_DTX_IDX1, &Ac0HwIdx);
DBGPRINT_RAW(RT_DEBUG_TRACE, ("All QID_AC_BK DESCRIPTOR \n " ));
for (i=0;i<TX_RING_SIZE;i++)
{
ptemp= (PULONG)pAd->TxRing[QID_AC_BK].Cell[i].AllocVa;
DBGPRINT_RAW(RT_DEBUG_TRACE, ("[%02d] %08lx: %08lx: %08lx: %08lx\n " , i, *ptemp,*(ptemp+1),*(ptemp+2),*(ptemp+3)));
}
DBGPRINT_RAW(RT_DEBUG_TRACE, (" \n " ));
break;
case QID_AC_VI:
RTMP_IO_READ32(pAd, TX_BASE_PTR2, &Ac0Base);
RTMP_IO_READ32(pAd, TX_CTX_IDX2, &Ac0SwIdx);
RTMP_IO_READ32(pAd, TX_DTX_IDX2, &Ac0HwIdx);
DBGPRINT_RAW(RT_DEBUG_TRACE, ("All QID_AC_VI DESCRIPTOR \n " ));
for (i=0;i<TX_RING_SIZE;i++)
{
ptemp= (PULONG)pAd->TxRing[QID_AC_VI].Cell[i].AllocVa;
DBGPRINT_RAW(RT_DEBUG_TRACE, ("[%02d] %08lx: %08lx: %08lx: %08lx\n " , i, *ptemp,*(ptemp+1),*(ptemp+2),*(ptemp+3)));
}
DBGPRINT_RAW(RT_DEBUG_TRACE, (" \n " ));
break;
case QID_AC_VO:
RTMP_IO_READ32(pAd, TX_BASE_PTR3, &Ac0Base);
RTMP_IO_READ32(pAd, TX_CTX_IDX3, &Ac0SwIdx);
RTMP_IO_READ32(pAd, TX_DTX_IDX3, &Ac0HwIdx);
DBGPRINT_RAW(RT_DEBUG_TRACE, ("All QID_AC_VO DESCRIPTOR \n " ));
for (i=0;i<TX_RING_SIZE;i++)
{
ptemp= (PULONG)pAd->TxRing[QID_AC_VO].Cell[i].AllocVa;
DBGPRINT_RAW(RT_DEBUG_TRACE, ("[%02d] %08lx: %08lx: %08lx: %08lx\n " , i, *ptemp,*(ptemp+1),*(ptemp+2),*(ptemp+3)));
}
DBGPRINT_RAW(RT_DEBUG_TRACE, (" \n " ));
break;
case QID_MGMT:
RTMP_IO_READ32(pAd, TX_BASE_PTR5, &Ac0Base);
RTMP_IO_READ32(pAd, TX_CTX_IDX5, &Ac0SwIdx);
RTMP_IO_READ32(pAd, TX_DTX_IDX5, &Ac0HwIdx);
DBGPRINT_RAW(RT_DEBUG_TRACE, (" All QID_MGMT DESCRIPTOR \n " ));
for (i=0;i<MGMT_RING_SIZE;i++)
{
ptemp= (PULONG)pAd->MgmtRing.Cell[i].AllocVa;
DBGPRINT_RAW(RT_DEBUG_TRACE, ("[%02d] %08lx: %08lx: %08lx: %08lx\n " , i, *ptemp,*(ptemp+1),*(ptemp+2),*(ptemp+3)));
}
DBGPRINT_RAW(RT_DEBUG_TRACE, (" \n " ));
break;
default:
DBGPRINT_ERR(("DBGPRINT_TX_RING(Ring %d) not supported\n", QueIdx));
break;
}
AC0freeIdx = pAd->TxRing[QueIdx].TxSwFreeIdx;
DBGPRINT(RT_DEBUG_TRACE,("TxRing%d, TX_DTX_IDX=%d, TX_CTX_IDX=%d\n", QueIdx, Ac0HwIdx, Ac0SwIdx));
DBGPRINT_RAW(RT_DEBUG_TRACE,(" TxSwFreeIdx[%d]", AC0freeIdx));
DBGPRINT_RAW(RT_DEBUG_TRACE,(" pending-NDIS=%ld\n", pAd->RalinkCounters.PendingNdisPacketCount));
}
VOID DBGPRINT_RX_RING(
IN PRTMP_ADAPTER pAd)
{
UINT32 Ac0Base;
UINT32 Ac0HwIdx = 0, Ac0SwIdx = 0, AC0freeIdx;
int i;
UINT32 *ptemp;
DBGPRINT_RAW(RT_DEBUG_TRACE, ("=====================================================\n " ));
RTMP_IO_READ32(pAd, RX_BASE_PTR, &Ac0Base);
RTMP_IO_READ32(pAd, RX_CRX_IDX, &Ac0SwIdx);
RTMP_IO_READ32(pAd, RX_DRX_IDX, &Ac0HwIdx);
AC0freeIdx = pAd->RxRing.RxSwReadIdx;
DBGPRINT_RAW(RT_DEBUG_TRACE, ("All RX DSP \n " ));
for (i=0;i<RX_RING_SIZE;i++)
{
ptemp = (UINT32 *)pAd->RxRing.Cell[i].AllocVa;
DBGPRINT_RAW(RT_DEBUG_TRACE, ("[%02d] %08x: %08x: %08x: %08x\n " , i, *ptemp,*(ptemp+1),*(ptemp+2),*(ptemp+3)));
}
DBGPRINT(RT_DEBUG_TRACE,("RxRing, RX_DRX_IDX=%d, RX_CRX_IDX=%d \n", Ac0HwIdx, Ac0SwIdx));
DBGPRINT_RAW(RT_DEBUG_TRACE,(" RxSwReadIdx [%d]=", AC0freeIdx));
DBGPRINT_RAW(RT_DEBUG_TRACE,(" pending-NDIS=%ld\n", pAd->RalinkCounters.PendingNdisPacketCount));
}
#endif /* RT2860 */
/*
......
......@@ -1052,187 +1052,3 @@ NDIS_802_11_NETWORK_TYPE NetworkTypeInUseSanity(
return NetWorkType;
}
/*
==========================================================================
Description:
WPA message sanity check
Return:
TRUE if all parameters are OK, FALSE otherwise
==========================================================================
*/
BOOLEAN PeerWpaMessageSanity(
IN PRTMP_ADAPTER pAd,
IN PEAPOL_PACKET pMsg,
IN ULONG MsgLen,
IN UCHAR MsgType,
IN MAC_TABLE_ENTRY *pEntry)
{
UCHAR mic[LEN_KEY_DESC_MIC], digest[80], KEYDATA[MAX_LEN_OF_RSNIE];
BOOLEAN bReplayDiff = FALSE;
BOOLEAN bWPA2 = FALSE;
KEY_INFO EapolKeyInfo;
UCHAR GroupKeyIndex = 0;
NdisZeroMemory(mic, sizeof(mic));
NdisZeroMemory(digest, sizeof(digest));
NdisZeroMemory(KEYDATA, sizeof(KEYDATA));
NdisZeroMemory((PUCHAR)&EapolKeyInfo, sizeof(EapolKeyInfo));
NdisMoveMemory((PUCHAR)&EapolKeyInfo, (PUCHAR)&pMsg->KeyDesc.KeyInfo, sizeof(KEY_INFO));
*((USHORT *)&EapolKeyInfo) = cpu2le16(*((USHORT *)&EapolKeyInfo));
// Choose WPA2 or not
if ((pEntry->AuthMode == Ndis802_11AuthModeWPA2) || (pEntry->AuthMode == Ndis802_11AuthModeWPA2PSK))
bWPA2 = TRUE;
// 0. Check MsgType
if ((MsgType > EAPOL_GROUP_MSG_2) || (MsgType < EAPOL_PAIR_MSG_1))
{
DBGPRINT(RT_DEBUG_ERROR, ("The message type is invalid(%d)! \n", MsgType));
return FALSE;
}
// 1. Replay counter check
if (MsgType == EAPOL_PAIR_MSG_1 || MsgType == EAPOL_PAIR_MSG_3 || MsgType == EAPOL_GROUP_MSG_1) // For supplicant
{
// First validate replay counter, only accept message with larger replay counter.
// Let equal pass, some AP start with all zero replay counter
UCHAR ZeroReplay[LEN_KEY_DESC_REPLAY];
NdisZeroMemory(ZeroReplay, LEN_KEY_DESC_REPLAY);
if ((RTMPCompareMemory(pMsg->KeyDesc.ReplayCounter, pEntry->R_Counter, LEN_KEY_DESC_REPLAY) != 1) &&
(RTMPCompareMemory(pMsg->KeyDesc.ReplayCounter, ZeroReplay, LEN_KEY_DESC_REPLAY) != 0))
{
bReplayDiff = TRUE;
}
}
else if (MsgType == EAPOL_PAIR_MSG_2 || MsgType == EAPOL_PAIR_MSG_4 || MsgType == EAPOL_GROUP_MSG_2) // For authenticator
{
// check Replay Counter coresponds to MSG from authenticator, otherwise discard
if (!NdisEqualMemory(pMsg->KeyDesc.ReplayCounter, pEntry->R_Counter, LEN_KEY_DESC_REPLAY))
{
bReplayDiff = TRUE;
}
}
// Replay Counter different condition
if (bReplayDiff)
{
// send wireless event - for replay counter different
if (pAd->CommonCfg.bWirelessEvent)
RTMPSendWirelessEvent(pAd, IW_REPLAY_COUNTER_DIFF_EVENT_FLAG, pEntry->Addr, pEntry->apidx, 0);
if (MsgType < EAPOL_GROUP_MSG_1)
{
DBGPRINT(RT_DEBUG_ERROR, ("Replay Counter Different in pairwise msg %d of 4-way handshake!\n", MsgType));
}
else
{
DBGPRINT(RT_DEBUG_ERROR, ("Replay Counter Different in group msg %d of 2-way handshake!\n", (MsgType - EAPOL_PAIR_MSG_4)));
}
hex_dump("Receive replay counter ", pMsg->KeyDesc.ReplayCounter, LEN_KEY_DESC_REPLAY);
hex_dump("Current replay counter ", pEntry->R_Counter, LEN_KEY_DESC_REPLAY);
return FALSE;
}
// 2. Verify MIC except Pairwise Msg1
if (MsgType != EAPOL_PAIR_MSG_1)
{
UCHAR rcvd_mic[LEN_KEY_DESC_MIC];
// Record the received MIC for check later
NdisMoveMemory(rcvd_mic, pMsg->KeyDesc.KeyMic, LEN_KEY_DESC_MIC);
NdisZeroMemory(pMsg->KeyDesc.KeyMic, LEN_KEY_DESC_MIC);
if (pEntry->WepStatus == Ndis802_11Encryption2Enabled) // TKIP
{
hmac_md5(pEntry->PTK, LEN_EAP_MICK, (PUCHAR)pMsg, MsgLen, mic);
}
else if (pEntry->WepStatus == Ndis802_11Encryption3Enabled) // AES
{
HMAC_SHA1((PUCHAR)pMsg, MsgLen, pEntry->PTK, LEN_EAP_MICK, digest);
NdisMoveMemory(mic, digest, LEN_KEY_DESC_MIC);
}
if (!NdisEqualMemory(rcvd_mic, mic, LEN_KEY_DESC_MIC))
{
// send wireless event - for MIC different
if (pAd->CommonCfg.bWirelessEvent)
RTMPSendWirelessEvent(pAd, IW_MIC_DIFF_EVENT_FLAG, pEntry->Addr, pEntry->apidx, 0);
if (MsgType < EAPOL_GROUP_MSG_1)
{
DBGPRINT(RT_DEBUG_ERROR, ("MIC Different in pairwise msg %d of 4-way handshake!\n", MsgType));
}
else
{
DBGPRINT(RT_DEBUG_ERROR, ("MIC Different in group msg %d of 2-way handshake!\n", (MsgType - EAPOL_PAIR_MSG_4)));
}
hex_dump("Received MIC", rcvd_mic, LEN_KEY_DESC_MIC);
hex_dump("Desired MIC", mic, LEN_KEY_DESC_MIC);
return FALSE;
}
}
// Extract the context of the Key Data field if it exist
// The field in pairwise_msg_2_WPA1(WPA2) & pairwise_msg_3_WPA1 is un-encrypted.
// The field in group_msg_1_WPA1(WPA2) & pairwise_msg_3_WPA2 is encrypted.
if (pMsg->KeyDesc.KeyDataLen[1] > 0)
{
// Decrypt this field
if ((MsgType == EAPOL_PAIR_MSG_3 && bWPA2) || (MsgType == EAPOL_GROUP_MSG_1))
{
if(pEntry->WepStatus == Ndis802_11Encryption3Enabled)
{
// AES
AES_GTK_KEY_UNWRAP(&pEntry->PTK[16], KEYDATA, pMsg->KeyDesc.KeyDataLen[1],pMsg->KeyDesc.KeyData);
}
else
{
INT i;
UCHAR Key[32];
// Decrypt TKIP GTK
// Construct 32 bytes RC4 Key
NdisMoveMemory(Key, pMsg->KeyDesc.KeyIv, 16);
NdisMoveMemory(&Key[16], &pEntry->PTK[16], 16);
ARCFOUR_INIT(&pAd->PrivateInfo.WEPCONTEXT, Key, 32);
//discard first 256 bytes
for(i = 0; i < 256; i++)
ARCFOUR_BYTE(&pAd->PrivateInfo.WEPCONTEXT);
// Decrypt GTK. Becareful, there is no ICV to check the result is correct or not
ARCFOUR_DECRYPT(&pAd->PrivateInfo.WEPCONTEXT, KEYDATA, pMsg->KeyDesc.KeyData, pMsg->KeyDesc.KeyDataLen[1]);
}
if (!bWPA2 && (MsgType == EAPOL_GROUP_MSG_1))
GroupKeyIndex = EapolKeyInfo.KeyIndex;
}
else if ((MsgType == EAPOL_PAIR_MSG_2) || (MsgType == EAPOL_PAIR_MSG_3 && !bWPA2))
{
NdisMoveMemory(KEYDATA, pMsg->KeyDesc.KeyData, pMsg->KeyDesc.KeyDataLen[1]);
}
else
{
return TRUE;
}
// Parse Key Data field to
// 1. verify RSN IE for pairwise_msg_2_WPA1(WPA2) ,pairwise_msg_3_WPA1(WPA2)
// 2. verify KDE format for pairwise_msg_3_WPA2, group_msg_1_WPA2
// 3. update shared key for pairwise_msg_3_WPA2, group_msg_1_WPA1(WPA2)
if (!RTMPParseEapolKeyData(pAd, KEYDATA, pMsg->KeyDesc.KeyDataLen[1], GroupKeyIndex, MsgType, bWPA2, pEntry))
{
return FALSE;
}
}
return TRUE;
}
This diff is collapsed.
......@@ -43,7 +43,6 @@ UCHAR CISCO_OUI[] = {0x00, 0x40, 0x96};
UCHAR WPA_OUI[] = {0x00, 0x50, 0xf2, 0x01};
UCHAR RSN_OUI[] = {0x00, 0x0f, 0xac};
UCHAR WAPI_OUI[] = {0x00, 0x14, 0x72};
UCHAR WME_INFO_ELEM[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01};
UCHAR WME_PARM_ELEM[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01};
UCHAR Ccx2QosInfo[] = {0x00, 0x40, 0x96, 0x04};
......@@ -338,9 +337,6 @@ UCHAR WpaIe = IE_WPA;
UCHAR Wpa2Ie = IE_WPA2;
UCHAR IbssIe = IE_IBSS_PARM;
UCHAR Ccx2Ie = IE_CCX_V2;
#ifdef RT2870
UCHAR WapiIe = IE_WAPI;
#endif
extern UCHAR WPA_OUI[];
......
......@@ -231,15 +231,9 @@ extern UCHAR WpaIe;
extern UCHAR Wpa2Ie;
extern UCHAR IbssIe;
extern UCHAR Ccx2Ie;
#ifdef RT30xx
extern UCHAR WapiIe;
#endif
extern UCHAR WPA_OUI[];
extern UCHAR RSN_OUI[];
#ifdef RT30xx
extern UCHAR WAPI_OUI[];
#endif
extern UCHAR WME_INFO_ELEM[];
extern UCHAR WME_PARM_ELEM[];
extern UCHAR Ccx2QosInfo[];
......@@ -4554,13 +4548,6 @@ BOOLEAN PeerDisassocSanity(
OUT PUCHAR pAddr2,
OUT USHORT *Reason);
BOOLEAN PeerWpaMessageSanity(
IN PRTMP_ADAPTER pAd,
IN PEAPOL_PACKET pMsg,
IN ULONG MsgLen,
IN UCHAR MsgType,
IN MAC_TABLE_ENTRY *pEntry);
BOOLEAN PeerDeauthSanity(
IN PRTMP_ADAPTER pAd,
IN VOID *Msg,
......@@ -5082,13 +5069,6 @@ VOID AironetAddBeaconReport(
VOID AironetCreateBeaconReportFromBssTable(
IN PRTMP_ADAPTER pAd);
VOID DBGPRINT_TX_RING(
IN PRTMP_ADAPTER pAd,
IN UCHAR QueIdx);
VOID DBGPRINT_RX_RING(
IN PRTMP_ADAPTER pAd);
CHAR ConvertToRssi(
IN PRTMP_ADAPTER pAd,
IN CHAR Rssi,
......@@ -5110,64 +5090,6 @@ VOID AES_GTK_KEY_UNWRAP(
IN UCHAR c_len,
IN UCHAR *ciphertext);
BOOLEAN RTMPCheckRSNIE(
IN PRTMP_ADAPTER pAd,
IN PUCHAR pData,
IN UCHAR DataLen,
IN MAC_TABLE_ENTRY *pEntry,
OUT UCHAR *Offset);
BOOLEAN RTMPParseEapolKeyData(
IN PRTMP_ADAPTER pAd,
IN PUCHAR pKeyData,
IN UCHAR KeyDataLen,
IN UCHAR GroupKeyIndex,
IN UCHAR MsgType,
IN BOOLEAN bWPA2,
IN MAC_TABLE_ENTRY *pEntry);
VOID ConstructEapolMsg(
IN PRTMP_ADAPTER pAd,
IN UCHAR PeerAuthMode,
IN UCHAR PeerWepStatus,
IN UCHAR MyGroupKeyWepStatus,
IN UCHAR MsgType,
IN UCHAR DefaultKeyIdx,
IN UCHAR *ReplayCounter,
IN UCHAR *KeyNonce,
IN UCHAR *TxRSC,
IN UCHAR *PTK,
IN UCHAR *GTK,
IN UCHAR *RSNIE,
IN UCHAR RSNIE_Len,
OUT PEAPOL_PACKET pMsg);
VOID CalculateMIC(
IN PRTMP_ADAPTER pAd,
IN UCHAR PeerWepStatus,
IN UCHAR *PTK,
OUT PEAPOL_PACKET pMsg);
NDIS_STATUS RTMPSoftDecryptBroadCastData(
IN PRTMP_ADAPTER pAd,
IN RX_BLK *pRxBlk,
IN NDIS_802_11_ENCRYPTION_STATUS GroupCipher,
IN PCIPHER_KEY pShard_key);
VOID ConstructEapolKeyData(
IN PRTMP_ADAPTER pAd,
IN UCHAR PeerAuthMode,
IN UCHAR PeerWepStatus,
IN UCHAR GroupKeyWepStatus,
IN UCHAR MsgType,
IN UCHAR DefaultKeyIdx,
IN BOOLEAN bWPA2Capable,
IN UCHAR *PTK,
IN UCHAR *GTK,
IN UCHAR *RSNIE,
IN UCHAR RSNIE_LEN,
OUT PEAPOL_PACKET pMsg);
VOID RTMPMakeRSNIE(
IN PRTMP_ADAPTER pAd,
IN UINT AuthMode,
......@@ -5182,12 +5104,6 @@ VOID HandleCounterMeasure(
IN PRTMP_ADAPTER pAd,
IN MAC_TABLE_ENTRY *pEntry);
VOID AES_GTK_KEY_WRAP(
IN UCHAR *key,
IN UCHAR *plaintext,
IN UCHAR p_len,
OUT UCHAR *ciphertext);
/* timeout -- ms */
VOID RTMP_SetPeriodicTimer(
IN NDIS_MINIPORT_TIMER *pTimer,
......
......@@ -569,9 +569,6 @@
// For 802.11n D3.03
//#define IE_NEW_EXT_CHA_OFFSET 62 // 802.11n d1. New extension channel offset elemet
#define IE_SECONDARY_CH_OFFSET 62 // 802.11n D3.03 Secondary Channel Offset element
#ifdef RT2870
#define IE_WAPI 68 // WAPI information element
#endif
#define IE_2040_BSS_COEXIST 72 // 802.11n D3.0.3
#define IE_2040_BSS_INTOLERANT_REPORT 73 // 802.11n D3.03
#define IE_OVERLAPBSS_SCAN_PARM 74 // 802.11n D3.03
......
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