本文整理汇总了C++中RTMPEqualMemory函数的典型用法代码示例。如果您正苦于以下问题:C++ RTMPEqualMemory函数的具体用法?C++ RTMPEqualMemory怎么用?C++ RTMPEqualMemory使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RTMPEqualMemory函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PeerP2pNoaAction
VOID PeerP2pNoaAction(
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem)
{
PP2P_ACTION_FRAME pFrame = (PP2P_ACTION_FRAME)Elem->Msg;
PMAC_TABLE_ENTRY pClient;
DBGPRINT(RT_DEBUG_TRACE,("PeerP2pNoaAction %s. \n", decodeP2PState(pAd->P2pCfg.P2PConnectState)));
DBGPRINT(RT_DEBUG_TRACE,("Category = %d. Subtype = %d. Token = %d.\n", pFrame->Category, pFrame->Subtype, pFrame->Token));
if (!P2P_CLI_ON(pAd))
{
DBGPRINT(RT_DEBUG_TRACE,("PeerP2pNoaAction return %s. \n", decodeP2PState(pAd->P2pCfg.P2PConnectState)));
return;
}
if (Elem->Wcid >= MAX_LEN_OF_MAC_TABLE)
{
DBGPRINT(RT_DEBUG_TRACE,("PeerP2pNoaAction Elem->Wcid %d. return.\n", Elem->Wcid));
return;
}
pClient = &pAd->MacTab.Content[Elem->Wcid];
pAd->P2pCfg.NoAIndex = Elem->Wcid;
DBGPRINT(RT_DEBUG_TRACE,("PeerP2pNoaAction Current NoAToken = %d. \n", pClient->P2pInfo.NoAToken));
if (pFrame->Token != pClient->P2pInfo.NoAToken)
{
if ((RTMPEqualMemory(&pFrame->Octet[0], P2POUIBYTE, 4)) && (pFrame->Octet[4] == SUBID_P2P_NOA))
{
DBGPRINT(RT_DEBUG_TRACE,("PeerP2pNoaAction CTWindow = %d. \n", pFrame->Octet[8]));
pClient->P2pInfo.CTWindow = pFrame->Octet[8];
P2pHandleNoAAttri(pAd, pClient, &pFrame->Octet[0]);
}
}
}
示例2: TDLS_TPKMsg1Process
/*
==========================================================================
Description:
IRQL = PASSIVE_LEVEL
==========================================================================
*/
USHORT TDLS_TPKMsg1Process(
IN PRTMP_ADAPTER pAd,
IN PRT_802_11_TDLS pTDLS,
IN PUCHAR pRsnIe,
IN UCHAR RsnLen,
IN PUCHAR pFTIe,
IN UCHAR FTLen,
IN PUCHAR pTIIe,
IN UCHAR TILen)
{
USHORT StatusCode = MLME_SUCCESS;
UCHAR CipherTmp[64] = {0};
UCHAR CipherTmpLen = 0;
FT_FTIE *ft = NULL;
// Validate RsnIE
//
if (RsnLen == 0) // RSN not exist
return MLME_INVALID_INFORMATION_ELEMENT;
if (pRsnIe[2] < 1) // Smaller version
return MLME_NOT_SUPPORT_RSN_VERSION;
CipherTmpLen = CipherSuiteTDLSLen;
if (pAd->StaCfg.WepStatus == Ndis802_11Encryption2Enabled)
NdisMoveMemory(CipherTmp, CipherSuiteTDLSWpa2PskTkip, CipherTmpLen);
else
NdisMoveMemory(CipherTmp, CipherSuiteTDLSWpa2PskAes, CipherTmpLen);
if(pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2)
CipherTmp[19] = TDLS_AKM_SUITE_1X;
if ( RTMPEqualMemory(&pRsnIe[16], &CipherTmp[16], 4) == 0) // Invalid TDLS AKM
return MLME_INVALID_AKMP;
if ( RTMPEqualMemory(&pRsnIe[20], &CipherTmp[20], 2) == 0) // Invalid RSN capability
return MLME_INVALID_RSN_CAPABILITIES;
if ((RsnLen != 22) || (RTMPEqualMemory(pRsnIe, CipherTmp, RsnLen) == 0)) // Invalid Pairwise Cipher
return REASON_UCIPHER_NOT_VALID;
// Validate FTIE
//
ft = (PFT_FTIE)(pFTIe + 2); // point to the element of IE
if ((FTLen != (sizeof(FT_FTIE) + 2)) || RTMPEqualMemory(&ft->MICCtr, TdlsZeroSsid, 2) == 0 ||
(RTMPEqualMemory(ft->MIC, TdlsZeroSsid, 16) == 0) || (RTMPEqualMemory(ft->ANonce, TdlsZeroSsid, 32) == 0))
return REASON_FT_INVALID_FTIE;
// Validate TIIE
//
if ((TILen != 7) || (pTIIe[2] != 2) || ( le2cpu32(*((PULONG) (pTIIe + 3))) < TDLS_KEY_TIMEOUT))
return TDLS_STATUS_CODE_UNACCEPTABLE_LIFETIME;
return StatusCode;
}
示例3: RTMPCheckAKM
/*
==========================================================================
Description:
Check invalidity of authentication method selection in RSN IE.
Return:
true if match
false otherwise
==========================================================================
*/
bool RTMPCheckAKM(u8 *sta_akm, u8 *ap_rsn_ie, INT iswpa2)
{
u8 *pTmp;
unsigned short Count;
pTmp = ap_rsn_ie;
if(iswpa2)
/* skip Version(2),Multicast cipter(4) 2+4==6 */
pTmp +=6;
else
/*skip OUI(4),Vesrion(2),Multicast cipher(4) 4+2+4==10 */
pTmp += 10;/*point to number of unicast */
memmove(&Count, pTmp, sizeof(unsigned short));
Count = cpu2le16(Count);
pTmp += sizeof(unsigned short);/*pointer to unicast cipher */
/* Skip all unicast cipher suite */
while (Count > 0)
{
/* Skip OUI */
pTmp += 4;
Count--;
}
memmove(&Count, pTmp, sizeof(unsigned short));
Count = cpu2le16(Count);
pTmp += sizeof(unsigned short);/*pointer to AKM cipher */
while (Count > 0)
{
/*rtmp_hexdump(RT_DEBUG_TRACE,"MBSS WPA_IE AKM ",pTmp,4); */
if(RTMPEqualMemory(sta_akm,pTmp,4))
return true;
else
{
pTmp += 4;
Count--;
}
}
return false;/* do not match the AKM */
}
示例4: RTMPCheckAKM
/*
==========================================================================
Description:
Check invalidity of authentication method selection in RSN IE.
Return:
TRUE if match
FALSE otherwise
==========================================================================
*/
BOOLEAN RTMPCheckAKM(PUCHAR sta_akm, PUCHAR ap_rsn_ie, INT iswpa2)
{
PUCHAR pTmp;
USHORT Count;
pTmp = ap_rsn_ie;
if(iswpa2)
/* skip Version(2),Multicast cipter(4) 2+4==6 */
pTmp +=6;
else
/*skip OUI(4),Vesrion(2),Multicast cipher(4) 4+2+4==10 */
pTmp += 10;/*point to number of unicast */
NdisMoveMemory(&Count, pTmp, sizeof(USHORT));
Count = cpu2le16(Count);
pTmp += sizeof(USHORT);/*pointer to unicast cipher */
/* Skip all unicast cipher suite */
while (Count > 0)
{
/* Skip OUI */
pTmp += 4;
Count--;
}
NdisMoveMemory(&Count, pTmp, sizeof(USHORT));
Count = cpu2le16(Count);
pTmp += sizeof(USHORT);/*pointer to AKM cipher */
while (Count > 0)
{
/*rtmp_hexdump(RT_DEBUG_TRACE,"MBSS WPA_IE AKM ",pTmp,4); */
if(RTMPEqualMemory(sta_akm,pTmp,4))
return TRUE;
else
{
pTmp += 4;
Count--;
}
}
return FALSE;/* do not match the AKM */
}
示例5: rtmp_wdev_idx_find_by_p2p_ifaddr
INT rtmp_wdev_idx_find_by_p2p_ifaddr(RTMP_ADAPTER *pAd, UCHAR *ifAddr)
{
INT idx, type;
ULONG flags;
PNET_DEV if_dev = NULL;
struct wifi_dev *wdev = NULL;
if (!ifAddr)
return -1;
RTMP_INT_LOCK(&pAd->irq_lock, flags);
for (idx = 0; idx < WDEV_NUM_MAX; idx++) {
wdev = pAd->wdev_list[idx];
if (!wdev)
continue;
if_dev = wdev->if_dev;
if (!if_dev)
continue;
if (!if_dev->ieee80211_ptr)
continue;
type = if_dev->ieee80211_ptr->iftype;
if ( RTMPEqualMemory(wdev->if_addr, ifAddr, MAC_ADDR_LEN) &&
( type == RT_CMD_80211_IFTYPE_P2P_CLIENT ||
type == RT_CMD_80211_IFTYPE_P2P_GO ||
type == RT_CMD_80211_IFTYPE_P2P_DEVICE
))
{
//MTWF_LOG(DBG_CAT_ALL, DBG_LVL_INFO,
// ("find the wdev(type:%d, idx:%d) from wdev_list\n",
// pAd->wdev_list[idx]->wdev_type, pAd->wdev_list[idx]->wdev_idx));
break;
}
}
RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
return ((idx < WDEV_NUM_MAX) ? idx : -1);
}
示例6: RTMP_CFG80211_FindVifEntry_ByMac
static
PCFG80211_VIF_DEV RTMP_CFG80211_FindVifEntry_ByMac(void *pAdSrc, PNET_DEV pNewNetDev)
{
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pAdSrc;
PLIST_HEADER pCacheList = &pAd->cfg80211_ctrl.Cfg80211VifDevSet.vifDevList;
PCFG80211_VIF_DEV pDevEntry = NULL;
PLIST_ENTRY pListEntry = NULL;
pListEntry = pCacheList->pHead;
pDevEntry = (PCFG80211_VIF_DEV)pListEntry;
while (pDevEntry != NULL) {
if (RTMPEqualMemory(pDevEntry->net_dev->dev_addr, pNewNetDev->dev_addr, MAC_ADDR_LEN))
return pDevEntry;
pListEntry = pListEntry->pNext;
pDevEntry = (PCFG80211_VIF_DEV)pListEntry;
}
return NULL;
}
示例7: RTMP_CFG80211_FindVifEntry_ByMac
static
PCFG80211_VIF_DEV RTMP_CFG80211_FindVifEntry_ByMac(struct rtmp_adapter *pAd, struct net_device *pNewNetDev)
{
PLIST_HEADER pCacheList = &pAd->cfg80211_ctrl.Cfg80211VifDevSet.vifDevList;
PCFG80211_VIF_DEV pDevEntry = NULL;
PLIST_ENTRY pListEntry = NULL;
pListEntry = pCacheList->pHead;
pDevEntry = (PCFG80211_VIF_DEV)pListEntry;
while (pDevEntry != NULL)
{
if (RTMPEqualMemory(pDevEntry->net_dev->dev_addr, pNewNetDev->dev_addr, MAC_ADDR_LEN))
return pDevEntry;
pListEntry = pListEntry->pNext;
pDevEntry = (PCFG80211_VIF_DEV)pListEntry;
}
return NULL;
}
示例8: P2pCrednTabDelete
VOID P2pCrednTabDelete(
IN PRTMP_ADAPTER pAd,
IN UCHAR *pAddr)
{
PRT_P2P_TABLE Tab = &pAd->P2pTable;
UCHAR i;
/*UCHAR Zero[6] = {0,0,0,0,0,0}; */
DBGPRINT(RT_DEBUG_ERROR, (" P2P - P2pCrednTabDelete \n"));
for (i = 0; i < MAX_P2P_TABLE_SIZE; i++)
{
if (RTMPEqualMemory(pAddr, Tab->TempCredential[i].InterAddr, MAC_ADDR_LEN))
{
Tab->TempCredential[i].bValid = FALSE;
RTMPZeroMemory(Tab->TempCredential[i].InterAddr, MAC_ADDR_LEN);
RTMPZeroMemory(&Tab->TempCredential[i].Profile, sizeof(WSC_CREDENTIAL));
}
}
}
示例9: RTMPCheckUcast
/*
==========================================================================
Description:
Check sanity of unicast cipher selector in RSN IE.
Return:
TRUE if match
FALSE otherwise
==========================================================================
*/
BOOLEAN RTMPCheckUcast(
IN PRTMP_ADAPTER pAd,
IN PEID_STRUCT eid_ptr,
IN MAC_TABLE_ENTRY *pEntry)
{
PUCHAR pStaTmp;
USHORT Count;
UCHAR apidx;
ASSERT(pEntry);
ASSERT(pEntry->apidx < pAd->ApCfg.BssidNum);
apidx = pEntry->apidx;
pEntry->WepStatus = pAd->ApCfg.MBSSID[apidx].WepStatus;
if (eid_ptr->Len < 16)
{
DBGPRINT(RT_DEBUG_ERROR, ("[ERROR]RTMPCheckUcast : the length is too short(%d) \n", eid_ptr->Len));
return FALSE;
}
/* Store STA RSN_IE capability */
pStaTmp = (PUCHAR)&eid_ptr->Octet[0];
if(eid_ptr->Eid == IE_WPA2)
{
/* skip Version(2),Multicast cipter(4) 2+4==6 */
/* point to number of unicast */
pStaTmp +=6;
}
else if (eid_ptr->Eid == IE_WPA)
{
/* skip OUI(4),Vesrion(2),Multicast cipher(4) 4+2+4==10 */
/* point to number of unicast */
pStaTmp += 10;
}
else
{
DBGPRINT(RT_DEBUG_ERROR, ("[ERROR]RTMPCheckUcast : invalid IE=%d\n", eid_ptr->Eid));
return FALSE;
}
/* Store unicast cipher count */
NdisMoveMemory(&Count, pStaTmp, sizeof(USHORT));
Count = cpu2le16(Count);
/* pointer to unicast cipher */
pStaTmp += sizeof(USHORT);
if (eid_ptr->Len >= 16)
{
if (eid_ptr->Eid == IE_WPA)
{
if (pAd->ApCfg.MBSSID[apidx].WepStatus == Ndis802_11Encryption4Enabled)
{/* multiple cipher (TKIP/CCMP) */
while (Count > 0)
{
/* TKIP */
if (MIX_CIPHER_WPA_TKIP_ON(pAd->ApCfg.MBSSID[apidx].WpaMixPairCipher))
{
/* Compare if peer STA uses the TKIP as its unicast cipher */
if (RTMPEqualMemory(pStaTmp, &pAd->ApCfg.MBSSID[apidx].RSN_IE[0][12], 4))
{
pEntry->WepStatus = Ndis802_11Encryption2Enabled;
return TRUE;
}
/* Our AP uses the AES as the secondary cipher */
/* Compare if the peer STA use AES as its unicast cipher */
if (MIX_CIPHER_WPA_AES_ON(pAd->ApCfg.MBSSID[apidx].WpaMixPairCipher))
{
if (RTMPEqualMemory(pStaTmp, &pAd->ApCfg.MBSSID[apidx].RSN_IE[0][16], 4))
{
pEntry->WepStatus = Ndis802_11Encryption3Enabled;
return TRUE;
}
}
}
else
{
/* AES */
if (RTMPEqualMemory(pStaTmp, &pAd->ApCfg.MBSSID[apidx].RSN_IE[0][12], 4))
{
pEntry->WepStatus = Ndis802_11Encryption3Enabled;
return TRUE;
}
}
pStaTmp += 4;
//.........这里部分代码省略.........
示例10: RTUSBBulkOutDataPacket
VOID RTUSBBulkOutDataPacket(
IN PRTMP_ADAPTER pAd,
IN UCHAR BulkOutPipeId,
IN UCHAR Index)
{
PHT_TX_CONTEXT pHTTXContext;
PURB pUrb;
int ret = 0;
PTXINFO_STRUC pTxInfo, pLastTxInfo = NULL;
PTXWI_STRUC pTxWI;
ULONG TmpBulkEndPos, ThisBulkSize;
unsigned long IrqFlags = 0, IrqFlags2 = 0;
PUCHAR pWirelessPkt, pAppendant;
BOOLEAN bTxQLastRound = FALSE;
UCHAR allzero[4]= {0x0,0x0,0x0,0x0};
BULK_OUT_LOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
if ((pAd->BulkOutPending[BulkOutPipeId] == TRUE) || RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NEED_STOP_TX))
{
BULK_OUT_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
return;
}
pAd->BulkOutPending[BulkOutPipeId] = TRUE;
if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)
)
{
pAd->BulkOutPending[BulkOutPipeId] = FALSE;
BULK_OUT_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
return;
}
BULK_OUT_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
pHTTXContext = &(pAd->TxContext[BulkOutPipeId]);
BULK_OUT_LOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags2);
if ((pHTTXContext->ENextBulkOutPosition == pHTTXContext->CurWritePosition)
|| ((pHTTXContext->ENextBulkOutPosition-8) == pHTTXContext->CurWritePosition))
{
BULK_OUT_UNLOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags2);
BULK_OUT_LOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
pAd->BulkOutPending[BulkOutPipeId] = FALSE;
// Clear Data flag
RTUSB_CLEAR_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_FRAG << BulkOutPipeId));
RTUSB_CLEAR_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_NORMAL << BulkOutPipeId));
BULK_OUT_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
return;
}
// Clear Data flag
RTUSB_CLEAR_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_FRAG << BulkOutPipeId));
RTUSB_CLEAR_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_NORMAL << BulkOutPipeId));
//DBGPRINT(RT_DEBUG_TRACE,("BulkOut-B:I=0x%lx, CWPos=%ld, CWRPos=%ld, NBPos=%ld, ENBPos=%ld, bCopy=%d!\n", in_interrupt(),
// pHTTXContext->CurWritePosition, pHTTXContext->CurWriteRealPos, pHTTXContext->NextBulkOutPosition,
// pHTTXContext->ENextBulkOutPosition, pHTTXContext->bCopySavePad));
pHTTXContext->NextBulkOutPosition = pHTTXContext->ENextBulkOutPosition;
ThisBulkSize = 0;
TmpBulkEndPos = pHTTXContext->NextBulkOutPosition;
pWirelessPkt = &pHTTXContext->TransferBuffer->field.WirelessPacket[0];
if ((pHTTXContext->bCopySavePad == TRUE))
{
if (RTMPEqualMemory(pHTTXContext->SavedPad, allzero,4))
{
DBGPRINT_RAW(RT_DEBUG_ERROR,("e1, allzero : %x %x %x %x %x %x %x %x \n",
pHTTXContext->SavedPad[0], pHTTXContext->SavedPad[1], pHTTXContext->SavedPad[2],pHTTXContext->SavedPad[3]
,pHTTXContext->SavedPad[4], pHTTXContext->SavedPad[5], pHTTXContext->SavedPad[6],pHTTXContext->SavedPad[7]));
}
NdisMoveMemory(&pWirelessPkt[TmpBulkEndPos], pHTTXContext->SavedPad, 8);
pHTTXContext->bCopySavePad = FALSE;
if (pAd->bForcePrintTX == TRUE)
DBGPRINT(RT_DEBUG_TRACE,("RTUSBBulkOutDataPacket --> COPY PAD. CurWrite = %ld, NextBulk = %ld. ENextBulk = %ld.\n", pHTTXContext->CurWritePosition, pHTTXContext->NextBulkOutPosition, pHTTXContext->ENextBulkOutPosition));
}
do
{
pTxInfo = (PTXINFO_STRUC)&pWirelessPkt[TmpBulkEndPos];
pTxWI = (PTXWI_STRUC)&pWirelessPkt[TmpBulkEndPos + TXINFO_SIZE];
if (pAd->bForcePrintTX == TRUE)
DBGPRINT(RT_DEBUG_TRACE, ("RTUSBBulkOutDataPacket AMPDU = %d.\n", pTxWI->AMPDU));
// add by Iverson, limit BulkOut size to 4k to pass WMM b mode 2T1R test items
//if ((ThisBulkSize != 0) && (pTxWI->AMPDU == 0))
if ((ThisBulkSize != 0) && (pTxWI->PHYMODE == MODE_CCK))
{
if (((ThisBulkSize&0xffff8000) != 0) || ((ThisBulkSize&0x1000) == 0x1000))
{
// Limit BulkOut size to about 4k bytes.
pHTTXContext->ENextBulkOutPosition = TmpBulkEndPos;
break;
}
else if (((pAd->BulkOutMaxPacketSize < 512) && ((ThisBulkSize&0xfffff800) != 0) ) /*|| ( (ThisBulkSize != 0) && (pTxWI->AMPDU == 0))*/)
{
//.........这里部分代码省略.........
示例11: APPeerAuthReqAtIdleAction
static VOID APPeerAuthReqAtIdleAction(
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem)
{
INT i;
USHORT Seq, Alg, RspReason, Status;
UCHAR Addr1[MAC_ADDR_LEN];
UCHAR Addr2[MAC_ADDR_LEN];
CHAR Chtxt[CIPHER_TEXT_LEN];
UINT32 apidx;
PHEADER_802_11 pRcvHdr;
HEADER_802_11 AuthHdr;
PUCHAR pOutBuffer = NULL;
NDIS_STATUS NStatus;
ULONG FrameLen = 0;
MAC_TABLE_ENTRY *pEntry;
UCHAR ChTxtIe = 16, ChTxtLen = CIPHER_TEXT_LEN;
MULTISSID_STRUCT *pMbss;
struct wifi_dev *wdev;
CHAR rssi;
if (! APPeerAuthSanity(pAd, Elem->Msg, Elem->MsgLen, Addr1,
Addr2, &Alg, &Seq, &Status, Chtxt
))
return;
/* Find which MBSSID to be authenticate */
apidx = get_apidx_by_addr(pAd, Addr1);
if (apidx >= pAd->ApCfg.BssidNum)
{
DBGPRINT(RT_DEBUG_TRACE, ("AUTH - Bssid not found\n"));
return;
}
pMbss = &pAd->ApCfg.MBSSID[apidx];
wdev = &pMbss->wdev;
if ((wdev->if_dev == NULL) || ((wdev->if_dev != NULL) &&
!(RTMP_OS_NETDEV_STATE_RUNNING(wdev->if_dev))))
{
DBGPRINT(RT_DEBUG_TRACE, ("AUTH - Bssid IF didn't up yet.\n"));
return;
}
pEntry = MacTableLookup(pAd, Addr2);
if (pEntry && IS_ENTRY_CLIENT(pEntry))
{
#ifdef DOT11W_PMF_SUPPORT
if ((CLIENT_STATUS_TEST_FLAG(pEntry, fCLIENT_STATUS_PMF_CAPABLE))
&& (pEntry->PortSecured == WPA_802_1X_PORT_SECURED))
goto SendAuth;
#endif /* DOT11W_PMF_SUPPORT */
if (!RTMPEqualMemory(Addr1, pAd->ApCfg.MBSSID[pEntry->apidx].wdev.bssid, MAC_ADDR_LEN))
{
MacTableDeleteEntry(pAd, pEntry->wcid, pEntry->Addr);
pEntry = NULL;
DBGPRINT(RT_DEBUG_WARN, ("AUTH - Bssid does not match\n"));
}
else
{
if (pEntry->bIAmBadAtheros == TRUE)
{
AsicUpdateProtect(pAd, 8, ALLN_SETPROTECT, FALSE, FALSE);
DBGPRINT(RT_DEBUG_TRACE, ("Atheros Problem. Turn on RTS/CTS!!!\n"));
pEntry->bIAmBadAtheros = FALSE;
}
#ifdef DOT11_N_SUPPORT
BASessionTearDownALL(pAd, pEntry->wcid);
#endif /* DOT11_N_SUPPORT */
ASSERT(pEntry->Aid == Elem->Wcid);
}
}
#ifdef DOT11W_PMF_SUPPORT
SendAuth:
#endif /* DOT11W_PMF_SUPPORT */
pRcvHdr = (PHEADER_802_11)(Elem->Msg);
DBGPRINT(RT_DEBUG_TRACE,
("AUTH - MBSS(%d), Rcv AUTH seq#%d, Alg=%d, Status=%d from "
"[wcid=%d]%02x:%02x:%02x:%02x:%02x:%02x\n",
apidx, Seq, Alg, Status, Elem->Wcid, PRINT_MAC(Addr2)));
/* [email protected]: Refuse the weak signal of AuthReq */
rssi = RTMPMaxRssi(pAd, ConvertToRssi(pAd, (CHAR)Elem->Rssi0, RSSI_0),
ConvertToRssi(pAd, (CHAR)Elem->Rssi1, RSSI_1),
ConvertToRssi(pAd, (CHAR)Elem->Rssi2, RSSI_2));
DBGPRINT(RT_DEBUG_TRACE, ("%s: AUTH_FAIL_REQ Threshold = %d, AUTH_NO_RSP_REQ Threshold = %d, AUTH RSSI = %d\n",
wdev->if_dev->name, pMbss->AuthFailRssiThreshold, pMbss->AuthNoRspRssiThreshold, rssi));
if (((pMbss->AuthFailRssiThreshold != 0) && (rssi < pMbss->AuthFailRssiThreshold)) ||
((pMbss->AuthNoRspRssiThreshold != 0) && (rssi < pMbss->AuthNoRspRssiThreshold)))
{
//.........这里部分代码省略.........
示例12: MlmeHardTransmitTxRing
//.........这里部分代码省略.........
Should not be hard code to set PwrMgmt to 0 (PWR_ACTIVE)
Snice it's been set to 0 while on MgtMacHeaderInit
By the way this will cause frame to be send on PWR_SAVE failed.
*/
/* In WMM-UAPSD, mlme frame should be set psm as power saving but probe request frame*/
bInsertTimestamp = FALSE;
if (pHeader_802_11->FC.Type == BTYPE_CNTL) /* must be PS-POLL*/
{
bAckRequired = FALSE;
}
else /* BTYPE_MGMT or BTYPE_DATA(must be NULL frame)*/
{
if (pHeader_802_11->Addr1[0] & 0x01) /* MULTICAST, BROADCAST*/
{
bAckRequired = FALSE;
pHeader_802_11->Duration = 0;
}
else
{
bAckRequired = TRUE;
pHeader_802_11->Duration = RTMPCalcDuration(pAd, MlmeRate, 14);
if (pHeader_802_11->FC.SubType == SUBTYPE_PROBE_RSP)
{
bInsertTimestamp = TRUE;
#ifdef CONFIG_AP_SUPPORT
#ifdef SPECIFIC_TX_POWER_SUPPORT
/* Find which MBSSID to be send this probeRsp */
UINT32 apidx;
for (apidx=0; apidx<pAd->ApCfg.BssidNum; apidx++)
{
if (RTMPEqualMemory(pHeader_802_11->Addr2, pAd->ApCfg.MBSSID[apidx].Bssid, MAC_ADDR_LEN))
break;
}
if (!(apidx >= pAd->ApCfg.BssidNum) &&
(pAd->ApCfg.MBSSID[apidx].TxPwrAdj != -1) &&
(pAd->CommonCfg.MlmeTransmit.field.MODE == MODE_CCK) &&
(pAd->CommonCfg.MlmeTransmit.field.MCS == RATE_1))
{
TxPwrAdj = pAd->ApCfg.MBSSID[apidx].TxPwrAdj;
}
#endif /* SPECIFIC_TX_POWER_SUPPORT */
#endif /* CONFIG_AP_SUPPORT */
}
}
}
pHeader_802_11->Sequence = pAd->Sequence++;
if (pAd->Sequence > 0xfff)
pAd->Sequence = 0;
/* Before radar detection done, mgmt frame can not be sent but probe req*/
/* Because we need to use probe req to trigger driver to send probe req in passive scan*/
if ((pHeader_802_11->FC.SubType != SUBTYPE_PROBE_REQ)
&& (pAd->CommonCfg.bIEEE80211H == 1)
&& (pAd->Dot11_H.RDMode != RD_NORMAL_MODE))
{
DBGPRINT(RT_DEBUG_ERROR,("MlmeHardTransmit --> radar detect not in normal mode !!!\n"));
/*NdisReleaseSpinLock(&pAd->TxRingLock);*/
return (NDIS_STATUS_FAILURE);
}
#ifdef RT_BIG_ENDIAN
RTMPFrameEndianChange(pAd, (PUCHAR)pHeader_802_11, DIR_WRITE, FALSE);
示例13: RTMPInsertRepeaterEntry
VOID RTMPInsertRepeaterEntry(
IN PRTMP_ADAPTER pAd,
IN UCHAR apidx,
IN PUCHAR pAddr)
{
INT CliIdx, idx;
UCHAR HashIdx;
BOOLEAN Cancelled;
UCHAR tempMAC[MAC_ADDR_LEN];
APCLI_CTRL_MSG_STRUCT ApCliCtrlMsg;
PREPEATER_CLIENT_ENTRY pReptCliEntry = NULL, pCurrEntry = NULL;
PREPEATER_CLIENT_ENTRY_MAP pReptCliMap;
UCHAR SPEC_ADDR[6][3] = {{0x02, 0x0F, 0xB5}, {0x02, 0x09, 0x5B},
{0x02, 0x14, 0x6C}, {0x02, 0x18, 0x4D},
{0x02, 0x1B, 0x2F}, {0x02, 0x1E, 0x2A}};
MAC_TABLE_ENTRY *pMacEntry = NULL;
DBGPRINT(RT_DEBUG_TRACE, (" %s.\n", __FUNCTION__));
pMacEntry = MacTableLookup(pAd, pAddr);
if (pMacEntry && IS_ENTRY_CLIENT(pMacEntry))
{
if (pMacEntry->PortSecured == WPA_802_1X_PORT_NOT_SECURED)
{
DBGPRINT(RT_DEBUG_ERROR, (" wireless client is not ready !!!\n"));
return;
}
}
NdisAcquireSpinLock(&pAd->ApCfg.ReptCliEntryLock);
if (pAd->ApCfg.RepeaterCliSize >= MAX_EXT_MAC_ADDR_SIZE)
{
DBGPRINT(RT_DEBUG_ERROR, (" Repeater Client Full !!!\n"));
NdisReleaseSpinLock(&pAd->ApCfg.ReptCliEntryLock);
return ;
}
for (CliIdx = 0; CliIdx < MAX_EXT_MAC_ADDR_SIZE; CliIdx++)
{
pReptCliEntry = &pAd->ApCfg.ApCliTab[apidx].RepeaterCli[CliIdx];
if ((pReptCliEntry->CliEnable) &&
(MAC_ADDR_EQUAL(pReptCliEntry->OriginalAddress, pAddr) || MAC_ADDR_EQUAL(pReptCliEntry->CurrentAddress, pAddr)))
{
DBGPRINT(RT_DEBUG_ERROR, ("\n receive mac :%02x:%02x:%02x:%02x:%02x:%02x !!!\n",
pAddr[0], pAddr[1], pAddr[2], pAddr[3], pAddr[4], pAddr[5]));
DBGPRINT(RT_DEBUG_ERROR, (" duplicate Insert !!!\n"));
NdisReleaseSpinLock(&pAd->ApCfg.ReptCliEntryLock);
return ;
}
if (pReptCliEntry->CliEnable == FALSE)
break;
}
if (CliIdx >= MAX_EXT_MAC_ADDR_SIZE)
{
DBGPRINT(RT_DEBUG_ERROR, (" Repeater Client Full !!!\n"));
NdisReleaseSpinLock(&pAd->ApCfg.ReptCliEntryLock);
return ;
}
pReptCliEntry = &pAd->ApCfg.ApCliTab[apidx].RepeaterCli[CliIdx];
pReptCliMap = &pAd->ApCfg.ApCliTab[apidx].RepeaterCliMap[CliIdx];
/* ENTRY PREEMPTION: initialize the entry */
RTMPCancelTimer(&pReptCliEntry->ApCliAuthTimer, &Cancelled);
RTMPCancelTimer(&pReptCliEntry->ApCliAssocTimer, &Cancelled);
pReptCliEntry->CtrlCurrState = APCLI_CTRL_DISCONNECTED;
pReptCliEntry->AuthCurrState = APCLI_AUTH_REQ_IDLE;
pReptCliEntry->AssocCurrState = APCLI_ASSOC_IDLE;
pReptCliEntry->CliConnectState = 0;
pReptCliEntry->CliValid = FALSE;
pReptCliEntry->bEthCli = FALSE;
pReptCliEntry->MacTabWCID = 0xFF;
pReptCliEntry->AuthReqCnt = 0;
pReptCliEntry->AssocReqCnt = 0;
pReptCliEntry->CliTriggerTime = 0;
pReptCliEntry->pNext = NULL;
pReptCliMap->pReptCliEntry = pReptCliEntry;
pReptCliMap->pNext = NULL;
COPY_MAC_ADDR(pReptCliEntry->OriginalAddress, pAddr);
COPY_MAC_ADDR(tempMAC, pAddr);
#ifdef SMART_MESH
NdisZeroMemory(pAd->vMacAddrPrefix,sizeof(pAd->vMacAddrPrefix));
#endif /* SMART_MESH */
if (pAd->ApCfg.MACRepeaterOuiMode == 1)
{
DBGPRINT(RT_DEBUG_ERROR, (" todo !!!\n"));
}
else if (pAd->ApCfg.MACRepeaterOuiMode == 2)
{
INT IdxToUse;
for (idx = 0; idx < 6; idx++)
{
if (RTMPEqualMemory(SPEC_ADDR[idx], pAddr, 3))
//.........这里部分代码省略.........
示例14: APPeerAuthConfirmAction
static VOID APPeerAuthConfirmAction(
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem)
{
AUTH_FRAME_INFO auth_info;
PHEADER_802_11 pRcvHdr;
MAC_TABLE_ENTRY *pEntry;
UINT32 apidx;
if (!APPeerAuthSanity(pAd, Elem->Msg, Elem->MsgLen, &auth_info))
return;
apidx = get_apidx_by_addr(pAd, auth_info.addr1);
if (apidx >= pAd->ApCfg.BssidNum)
{
DBGPRINT(RT_DEBUG_TRACE, ("AUTH - Bssid not found\n"));
return;
}
if ((pAd->ApCfg.MBSSID[apidx].wdev.if_dev != NULL) &&
!(RTMP_OS_NETDEV_STATE_RUNNING(pAd->ApCfg.MBSSID[apidx].wdev.if_dev)))
{
DBGPRINT(RT_DEBUG_TRACE, ("AUTH - Bssid IF didn't up yet.\n"));
return;
} /* End of if */
if (Elem->Wcid >= MAX_LEN_OF_MAC_TABLE)
{
DBGPRINT(RT_DEBUG_ERROR, ("AUTH - Invalid wcid (%d).\n", Elem->Wcid));
return;
}
pEntry = &pAd->MacTab.Content[Elem->Wcid];
if (pEntry && IS_ENTRY_CLIENT(pEntry))
{
if (!RTMPEqualMemory(auth_info.addr1, pAd->ApCfg.MBSSID[pEntry->func_tb_idx].wdev.bssid, MAC_ADDR_LEN))
{
MacTableDeleteEntry(pAd, pEntry->wcid, pEntry->Addr);
pEntry = NULL;
DBGPRINT(RT_DEBUG_WARN, ("AUTH - Bssid does not match\n"));
}
else
{
if (pEntry->bIAmBadAtheros == TRUE)
{
AsicUpdateProtect(pAd, 8, ALLN_SETPROTECT, FALSE, FALSE);
DBGPRINT(RT_DEBUG_TRACE, ("Atheros Problem. Turn on RTS/CTS!!!\n"));
pEntry->bIAmBadAtheros = FALSE;
}
ASSERT(pEntry->Aid == Elem->Wcid);
#ifdef DOT11_N_SUPPORT
BASessionTearDownALL(pAd, pEntry->wcid);
#endif /* DOT11_N_SUPPORT */
}
}
pRcvHdr = (PHEADER_802_11)(Elem->Msg);
DBGPRINT(RT_DEBUG_TRACE,
("AUTH - MBSS(%d), Rcv AUTH seq#%d, Alg=%d, Status=%d from "
"[wcid=%d]%02x:%02x:%02x:%02x:%02x:%02x\n",
apidx, auth_info.auth_seq, auth_info.auth_alg,
auth_info.auth_status, Elem->Wcid,
PRINT_MAC(auth_info.addr2)));
if (pEntry && MAC_ADDR_EQUAL(auth_info.addr2, pAd->ApMlmeAux.Addr))
{
if ((pRcvHdr->FC.Wep == 1) &&
NdisEqualMemory(auth_info.Chtxt, pAd->ApMlmeAux.Challenge, CIPHER_TEXT_LEN))
{
/* Successful */
APPeerAuthSimpleRspGenAndSend(pAd, pRcvHdr, auth_info.auth_alg, auth_info.auth_seq + 1, MLME_SUCCESS);
pEntry->AuthState = AS_AUTH_KEY;
pEntry->Sst = SST_AUTH;
}
else
{
/* send wireless event - Authentication rejected because of challenge failure */
RTMPSendWirelessEvent(pAd, IW_AUTH_REJECT_CHALLENGE_FAILURE, pEntry->Addr, 0, 0);
/* fail - wep bit is not set or challenge text is not equal */
APPeerAuthSimpleRspGenAndSend(pAd, pRcvHdr, auth_info.auth_alg,
auth_info.auth_seq + 1,
MLME_REJ_CHALLENGE_FAILURE);
MacTableDeleteEntry(pAd, pEntry->wcid, pEntry->Addr);
/*Chtxt[127]='\0'; */
/*pAd->ApMlmeAux.Challenge[127]='\0'; */
DBGPRINT(RT_DEBUG_TRACE, ("%s\n",
((pRcvHdr->FC.Wep == 1) ? "challenge text is not equal" : "wep bit is not set")));
/*DBGPRINT(RT_DEBUG_TRACE, ("Sent Challenge = %s\n",&pAd->ApMlmeAux.Challenge[100])); */
/*DBGPRINT(RT_DEBUG_TRACE, ("Rcv Challenge = %s\n",&Chtxt[100])); */
}
}
else
//.........这里部分代码省略.........
示例15: CFG80211_SendMgmtFrame
INT CFG80211_SendMgmtFrame(RTMP_ADAPTER *pAd, VOID *pData, ULONG Data)
{
struct ieee80211_mgmt *mgmt = NULL;
#ifdef CONFIG_MULTI_CHANNEL
if (pAd->MCC_InfraConnect_Protect == TRUE)
{
return;
}
if (pAd->Mlme.bStartMcc == TRUE)
{
// return;
}
#endif /* CONFIG_MULTI_CHANNEL */
if (pData != NULL)
{
PCFG80211_CTRL pCfg80211_ctrl = &pAd->cfg80211_ctrl;
pCfg80211_ctrl->TxStatusInUsed = TRUE;
pCfg80211_ctrl->TxStatusSeq = pAd->Sequence;
RTMP_OS_INIT_COMPLETION(&pCfg80211_ctrl->fw_event_done);
if (pCfg80211_ctrl->pTxStatusBuf != NULL)
{
os_free_mem(NULL, pCfg80211_ctrl->pTxStatusBuf);
pCfg80211_ctrl->pTxStatusBuf = NULL;
}
os_alloc_mem(NULL, (UCHAR **)&pCfg80211_ctrl->pTxStatusBuf, Data);
if (pCfg80211_ctrl->pTxStatusBuf != NULL)
{
NdisCopyMemory(pCfg80211_ctrl->pTxStatusBuf, pData, Data);
pCfg80211_ctrl->TxStatusBufLen = Data;
}
else
{
pCfg80211_ctrl->TxStatusBufLen = 0;
DBGPRINT(RT_DEBUG_ERROR, ("CFG_TX_STATUS: MEM ALLOC ERROR\n"));
return NDIS_STATUS_FAILURE;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0)
CFG80211_IsNeedTxStatus(pAd, pData, Data);
#else
pAd->cfg80211_ctrl.IsNeedTxStatus = CFG80211_IsNeedTxStatus(pAd, pData, Data);
#endif
if(TRUE == pAd->cfg80211_ctrl.IsNeedTxStatus)
{
int ret = 0;
// send fw cmd to FW
ret = CFG80211_TxStatusCmd(pAd, TXS_TIMEOUT, (UCHAR)pCfg80211_ctrl->TxStatusSeq, TXS_P2P_WCID, TXS_P2P_MgmtID, Data);
DBGPRINT(RT_DEBUG_INFO, ("%s, send tx status cmd status(%d)\n", __FUNCTION__, ret));
}
//Parser probe rsp to remove WPS IE
#ifdef CONFIG_P2P_AUTO_GO_AS_SOFTAP
if (pAd->p2pForceGOAsSoftAP)
{
PP2P_PUBLIC_FRAME pFrame = (PP2P_PUBLIC_FRAME)pData;
mgmt = (struct ieee80211_mgmt *)pData;
UINT Elemlen, Offset;
PMULTISSID_STRUCT pMbss = &pAd->ApCfg.MBSSID[MAIN_MBSSID];
struct wifi_dev *pWdev = &pMbss->wdev;
DBGPRINT(RT_DEBUG_TRACE, ("SubType: pFrame->p80211Header.FC.SubType: %d\n", pFrame->p80211Header.FC.SubType));
if (pFrame->p80211Header.FC.SubType == SUBTYPE_PROBE_RSP)
{
Offset = offsetof(struct ieee80211_mgmt, u.probe_resp.variable);
Elemlen = Data - Offset;
if (mgmt && Elemlen > 0)
{
//DBGPRINT(RT_DEBUG_ERROR, ("IELen %d, lk added\n", Elemlen));
//hex_dump("probe_resp: variable:", (UCHAR *)mgmt->u.probe_resp.variable, Elemlen);
#if 1
if (mgmt->u.probe_resp.variable)
{
//DBGPRINT(RT_DEBUG_TRACE,("Remove P2P IE done, lk added\n"));
PUCHAR pVendorIE = NULL, pPreVendorIE = NULL, pIEData = NULL;
UINT VendorIELen;
pIEData = (PUCHAR)mgmt->u.probe_resp.variable;
pVendorIE = pIEData;
if ((pWdev->AuthMode == Ndis802_11AuthModeWPA2PSK) || (pWdev->AuthMode == Ndis802_11AuthModeOpen))
{
while (pVendorIE < pIEData + Elemlen)
{
//Remove WPS IE
extern UCHAR WPS_OUI[];
if (RTMPEqualMemory(pVendorIE + 2/*EID + Length*/, WPS_OUI, 4))
{
VendorIELen = *(pVendorIE + 1);
//hex_dump("pDest WPS IE 2:", pVendorIE, VendorIELen);
RTMPZeroMemory(pVendorIE + 2, VendorIELen);
pPreVendorIE = pVendorIE;
pVendorIE += VendorIELen + 2; //Next Vendor IE address pointer
if (pVendorIE < pIEData + Elemlen)
//.........这里部分代码省略.........