本文整理汇总了C++中MAC_ADDR_EQUAL函数的典型用法代码示例。如果您正苦于以下问题:C++ MAC_ADDR_EQUAL函数的具体用法?C++ MAC_ADDR_EQUAL怎么用?C++ MAC_ADDR_EQUAL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MAC_ADDR_EQUAL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ApCliPeerDisassocAction
/*
==========================================================================
Description:
left part of IEEE 802.11/1999 p.374
Parameters:
Elem - MLME message containing the received frame
==========================================================================
*/
static VOID ApCliPeerDisassocAction(
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem)
{
UCHAR Addr2[MAC_ADDR_LEN];
USHORT Reason;
USHORT ifIndex = (USHORT)(Elem->Priv);
PULONG pCurrState = &pAd->ApCfg.ApCliTab[ifIndex].AssocCurrState;
if(PeerDisassocSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Reason))
{
if (MAC_ADDR_EQUAL(pAd->ApCliMlmeAux.Bssid, Addr2))
{
*pCurrState = APCLI_ASSOC_IDLE;
MlmeEnqueue(pAd, APCLI_CTRL_STATE_MACHINE, APCLI_CTRL_PEER_DISCONNECT_REQ, 0, NULL, ifIndex);
}
}
else
{
DBGPRINT(RT_DEBUG_TRACE, ("APCLI_ASSOC - ApCliPeerDisassocAction() sanity check fail\n"));
}
return;
}
开发者ID:houwentaoff,项目名称:ST_wifi_7601U,代码行数:35,代码来源:p2pcli_assoc.c
示例2: RTMPSearchPMKIDCache
INT RTMPSearchPMKIDCache(
IN PRTMP_ADAPTER pAd,
IN INT apidx,
IN PUCHAR pAddr)
{
INT i = 0;
for (i = 0; i < MAX_PMKID_COUNT; i++)
{
if ((pAd->ApCfg.MBSSID[apidx].PMKIDCache.BSSIDInfo[i].Valid)
&& MAC_ADDR_EQUAL(&pAd->ApCfg.MBSSID[apidx].PMKIDCache.BSSIDInfo[i].MAC, pAddr))
{
DBGPRINT(RT_DEBUG_TRACE, ("RTMPSearchPMKIDCache %02x:%02x:%02x:%02x:%02x:%02x cache(%d) from IF(ra%d)\n",
PRINT_MAC(pAddr), i, apidx));
break;
}
}
if (i == MAX_PMKID_COUNT)
{
DBGPRINT(RT_DEBUG_TRACE, ("RTMPSearchPMKIDCache - IF(%d) not found\n", apidx));
return -1;
}
return i;
}
开发者ID:23171580,项目名称:ralink,代码行数:26,代码来源:ap_wpa.c
示例3: ApCliCtrlJoinReqTimeoutAction
/*
==========================================================================
Description:
APCLI MLME JOIN req timeout state machine procedure
==========================================================================
*/
static VOID ApCliCtrlJoinReqTimeoutAction(
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem)
{
APCLI_MLME_JOIN_REQ_STRUCT JoinReq;
PAPCLI_STRUCT pApCliEntry;
USHORT ifIndex = (USHORT)(Elem->Priv);
PULONG pCurrState = &pAd->ApCfg.ApCliTab[ifIndex].CtrlCurrState;
DBGPRINT(RT_DEBUG_TRACE, ("(%s) Probe Req Timeout.\n", __FUNCTION__));
if (ifIndex >= MAX_APCLI_NUM)
return;
if (ApScanRunning(pAd) == TRUE)
{
*pCurrState = APCLI_CTRL_DISCONNECTED;
return;
}
/* stay in same state. */
*pCurrState = APCLI_CTRL_PROBE;
/* retry Probe Req. */
DBGPRINT(RT_DEBUG_TRACE, ("(%s) Retry Probe Req.\n", __FUNCTION__));
pApCliEntry = &pAd->ApCfg.ApCliTab[ifIndex];
NdisZeroMemory(&JoinReq, sizeof(APCLI_MLME_JOIN_REQ_STRUCT));
if (!MAC_ADDR_EQUAL(pApCliEntry->CfgApCliBssid, ZERO_MAC_ADDR))
{
COPY_MAC_ADDR(JoinReq.Bssid, pApCliEntry->CfgApCliBssid);
}
#ifdef WSC_AP_SUPPORT
if ((pAd->ApCfg.ApCliTab[ifIndex].WscControl.WscConfMode != WSC_DISABLE) &&
(pAd->ApCfg.ApCliTab[ifIndex].WscControl.bWscTrigger == TRUE))
{
NdisZeroMemory(JoinReq.Ssid, MAX_LEN_OF_SSID);
JoinReq.SsidLen = pAd->ApCfg.ApCliTab[ifIndex].WscControl.WscSsid.SsidLength;
NdisMoveMemory(JoinReq.Ssid, pAd->ApCfg.ApCliTab[ifIndex].WscControl.WscSsid.Ssid, JoinReq.SsidLen);
}
else
#endif /* WSC_AP_SUPPORT */
if (pApCliEntry->CfgSsidLen != 0)
{
JoinReq.SsidLen = pApCliEntry->CfgSsidLen;
NdisMoveMemory(&(JoinReq.Ssid), pApCliEntry->CfgSsid, JoinReq.SsidLen);
}
DBGPRINT(RT_DEBUG_TRACE, ("(%s) Probe Ssid=%s, Bssid=%02x:%02x:%02x:%02x:%02x:%02x\n",
__FUNCTION__, JoinReq.Ssid, JoinReq.Bssid[0], JoinReq.Bssid[1], JoinReq.Bssid[2],
JoinReq.Bssid[3], JoinReq.Bssid[4], JoinReq.Bssid[5]));
MlmeEnqueue(pAd, APCLI_SYNC_STATE_MACHINE, APCLI_MT2_MLME_PROBE_REQ,
sizeof(APCLI_MLME_JOIN_REQ_STRUCT), &JoinReq, ifIndex);
return;
}
开发者ID:CoreTech-Development,项目名称:buildroot-linux-kernel,代码行数:66,代码来源:apcli_ctrl.c
示例4: CliWds_ProxyLookup
PUCHAR CliWds_ProxyLookup(
IN PRTMP_ADAPTER pAd,
IN PUCHAR pMac)
{
UINT8 HashId = (*(pMac + 5) & (CLIWDS_HASH_TAB_SIZE - 1));
PCLIWDS_PROXY_ENTRY pCliWdsEntry;
pCliWdsEntry =
(PCLIWDS_PROXY_ENTRY)pAd->ApCfg.CliWdsProxyTab[HashId].pHead;
while (pCliWdsEntry)
{
if (MAC_ADDR_EQUAL(pMac, pCliWdsEntry->Addr))
{
ULONG Now;
NdisGetSystemUpTime(&Now);
pCliWdsEntry->LastRefTime = Now;
if (VALID_WCID(pCliWdsEntry->Aid))
return pAd->MacTab.Content[pCliWdsEntry->Aid].Addr;
else
return NULL;
}
pCliWdsEntry = pCliWdsEntry->pNext;
}
return NULL;
}
开发者ID:jing-git,项目名称:rt-n56u,代码行数:26,代码来源:client_wds.c
示例5: PeerAuthRspAtSeq4Action
/*
==========================================================================
Description:
IRQL = DISPATCH_LEVEL
==========================================================================
*/
VOID PeerAuthRspAtSeq4Action(
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem)
{
UCHAR Addr2[MAC_ADDR_LEN];
USHORT Alg, Seq, Status;
CHAR ChlgText[CIPHER_TEXT_LEN];
BOOLEAN TimerCancelled;
if(PeerAuthSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Alg, &Seq, &Status, ChlgText))
{
if(MAC_ADDR_EQUAL(pAd->MlmeAux.Bssid, Addr2) && Seq == 4)
{
DBGPRINT(RT_DEBUG_TRACE, ("AUTH - Receive AUTH_RSP seq#4 to me\n"));
RTMPCancelTimer(&pAd->MlmeAux.AuthTimer, &TimerCancelled);
if (Status != MLME_SUCCESS)
{
pAd->StaCfg.AuthFailReason = Status;
COPY_MAC_ADDR(pAd->StaCfg.AuthFailSta, Addr2);
}
pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_AUTH_CONF, 2, &Status);
}
}
else
{
DBGPRINT(RT_DEBUG_TRACE, ("AUTH - PeerAuthRspAtSeq4Action() sanity check fail\n"));
}
}
开发者ID:acassis,项目名称:emlinux-ssd1935,代码行数:39,代码来源:auth.c
示例6: ApCliProbeTimeoutAtJoinAction
static VOID ApCliProbeTimeoutAtJoinAction(
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem)
{
APCLI_CTRL_MSG_STRUCT ApCliCtrlMsg;
USHORT ifIndex = (USHORT)(Elem->Priv);
PULONG pCurrState = &pAd->ApCfg.ApCliTab[ifIndex].SyncCurrState;
DBGPRINT(RT_DEBUG_TRACE, ("APCLI_SYNC - ProbeTimeoutAtJoinAction\n"));
*pCurrState = SYNC_IDLE;
DBGPRINT(RT_DEBUG_TRACE, ("APCLI_SYNC - ApCliMlmeAux.Bssid=%02x:%02x:%02x:%02x:%02x:%02x\n",
pAd->ApCliMlmeAux.Bssid[0],
pAd->ApCliMlmeAux.Bssid[1],
pAd->ApCliMlmeAux.Bssid[2],
pAd->ApCliMlmeAux.Bssid[3],
pAd->ApCliMlmeAux.Bssid[4],
pAd->ApCliMlmeAux.Bssid[5]));
if(!MAC_ADDR_EQUAL(pAd->ApCliMlmeAux.Bssid, ZERO_MAC_ADDR))
{
ApCliCtrlMsg.Status = MLME_SUCCESS;
MlmeEnqueue(pAd, APCLI_CTRL_STATE_MACHINE, APCLI_CTRL_PROBE_RSP,
sizeof(APCLI_CTRL_MSG_STRUCT), &ApCliCtrlMsg, ifIndex);
} else
{
MlmeEnqueue(pAd, APCLI_CTRL_STATE_MACHINE, APCLI_CTRL_JOIN_REQ_TIMEOUT, 0, NULL, ifIndex);
}
return;
}
开发者ID:andyvand,项目名称:ST_wifi_7601U,代码行数:32,代码来源:p2pcli_sync.c
示例7: AutoChBssSearchWithSSID
ULONG AutoChBssSearchWithSSID(
IN PRTMP_ADAPTER pAd,
IN PUCHAR Bssid,
IN PUCHAR pSsid,
IN UCHAR SsidLen,
IN UCHAR Channel)
{
UCHAR i;
PBSSINFO pBssInfoTab = pAd->pBssInfoTab;
if(pBssInfoTab == NULL)
{
DBGPRINT(RT_DEBUG_ERROR, ("pAd->pBssInfoTab equal NULL.\n"));
return (ULONG)BSS_NOT_FOUND;
}
for (i = 0; i < pBssInfoTab->BssNr; i++)
{
if ((((pBssInfoTab->BssEntry[i].Channel <= 14) && (Channel <= 14)) ||
((pBssInfoTab->BssEntry[i].Channel > 14) && (Channel > 14))) &&
MAC_ADDR_EQUAL(&(pBssInfoTab->BssEntry[i].Bssid), Bssid) &&
(SSID_EQUAL(pSsid, SsidLen, pBssInfoTab->BssEntry[i].Ssid, pBssInfoTab->BssEntry[i].SsidLen) ||
(NdisEqualMemory(pSsid, ZeroSsid, SsidLen)) ||
(NdisEqualMemory(pBssInfoTab->BssEntry[i].Ssid, ZeroSsid, pBssInfoTab->BssEntry[i].SsidLen))))
{
return i;
}
}
return (ULONG)BSS_NOT_FOUND;
}
开发者ID:schidler,项目名称:flyzjhz-rt-n56u,代码行数:30,代码来源:ap_autoChSel.c
示例8: NdisAcquireSpinLock
MAC_TABLE_ENTRY *WdsTableLookup(
IN PRTMP_ADAPTER pAd,
IN PUCHAR pAddr,
IN BOOLEAN bResetIdelCount)
{
USHORT HashIdx;
PMAC_TABLE_ENTRY pEntry = NULL;
NdisAcquireSpinLock(&pAd->WdsTabLock);
NdisAcquireSpinLock(&pAd->MacTabLock);
HashIdx = MAC_ADDR_HASH_INDEX(pAddr);
pEntry = pAd->MacTab.Hash[HashIdx];
while (pEntry)
{
if (IS_ENTRY_WDS(pEntry) && MAC_ADDR_EQUAL(pEntry->Addr, pAddr))
{
if(bResetIdelCount)
pEntry->NoDataIdleCount = 0;
break;
}
else
pEntry = pEntry->pNext;
}
NdisReleaseSpinLock(&pAd->MacTabLock);
NdisReleaseSpinLock(&pAd->WdsTabLock);
return pEntry;
}
开发者ID:fkpwolf,项目名称:openwrt-mt7620,代码行数:31,代码来源:ap_wds.c
示例9: WdsEntryAlloc
LONG WdsEntryAlloc(
IN PRTMP_ADAPTER pAd,
IN PUCHAR pAddr)
{
INT i;
LONG WdsTabIdx = -1;
NdisAcquireSpinLock(&pAd->WdsTabLock);
for (i = 0; i < MAX_WDS_ENTRY; i++)
{
if ((pAd->WdsTab.Mode >= WDS_LAZY_MODE) && !WDS_IF_UP_CHECK(pAd, i))
continue;
if (pAd->WdsTab.WdsEntry[i].Valid == FALSE)
{
pAd->WdsTab.WdsEntry[i].Valid = TRUE;
pAd->WdsTab.Size ++;
COPY_MAC_ADDR(pAd->WdsTab.WdsEntry[i].PeerWdsAddr, pAddr);
WdsTabIdx = i;
break;
}
else if (MAC_ADDR_EQUAL(pAd->WdsTab.WdsEntry[i].PeerWdsAddr, pAddr))
{
WdsTabIdx = i;
break;
}
}
if (i == MAX_WDS_ENTRY)
DBGPRINT(RT_DEBUG_ERROR, ("%s: Unable to allocate WdsEntry.\n", __FUNCTION__));
NdisReleaseSpinLock(&pAd->WdsTabLock);
return WdsTabIdx;
}
开发者ID:fkpwolf,项目名称:openwrt-mt7620,代码行数:35,代码来源:ap_wds.c
示例10: NotifyChSwAnnToPeerAPs
VOID NotifyChSwAnnToPeerAPs(
IN PRTMP_ADAPTER pAd,
IN PUCHAR pRA,
IN PUCHAR pTA,
IN UINT8 ChSwMode,
IN UINT8 Channel)
{
#ifdef WDS_SUPPORT
if (!((pRA[0] & 0xff) == 0xff)) // is pRA a broadcase address.
{
INT i;
// info neighbor APs that Radar signal found throgh WDS link.
for (i = 0; i < MAX_WDS_ENTRY; i++)
{
if (ValidWdsEntry(pAd, i))
{
PUCHAR pDA = pAd->WdsTab.WdsEntry[i].PeerWdsAddr;
// DA equal to SA. have no necessary orignal AP which found Radar signal.
if (MAC_ADDR_EQUAL(pTA, pDA))
continue;
// send Channel Switch Action frame to info Neighbro APs.
EnqueueChSwAnn(pAd, pDA, ChSwMode, Channel);
}
}
}
#endif // WDS_SUPPORT //
}
开发者ID:458941968,项目名称:mini2440-kernel-2.6.29,代码行数:29,代码来源:spectrum.c
示例11: PeerReassocRspAction
/*
==========================================================================
Description:
peer sends reassoc rsp
Parametrs:
Elem - MLME message cntaining the received frame
==========================================================================
*/
VOID PeerReassocRspAction(
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem)
{
USHORT CapabilityInfo;
USHORT Status;
USHORT Aid;
UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES], SupRateLen;
UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRateLen;
UCHAR Addr2[MAC_ADDR_LEN];
EDCA_PARM EdcaParm;
BOOLEAN TimerCancelled;
#ifdef RALINK_WPA_SUPPLICANT_SUPPORT
union iwreq_data wrqu;
#endif
if(PeerAssocRspSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &CapabilityInfo, &Status, &Aid, SupRate, &SupRateLen, ExtRate, &ExtRateLen, &EdcaParm))
{
if(MAC_ADDR_EQUAL(Addr2, pAd->MlmeAux.Bssid)) // The frame is for me ?
{
DBGPRINT(RT_DEBUG_TRACE, "ASSOC - receive REASSOC_RSP to me (status=%d)\n", Status);
RTMPCancelTimer(&pAd->MlmeAux.ReassocTimer,&TimerCancelled);
if(Status == MLME_SUCCESS)
{
// go to procedure listed on page 376
AssocPostProc(pAd, Addr2, CapabilityInfo, Aid, SupRate, SupRateLen, ExtRate, ExtRateLen, &EdcaParm);
#ifdef RALINK_WPA_SUPPLICANT_SUPPORT
if (pAd->PortCfg.WPA_Supplicant == TRUE)
{
//collect associate info
link_status_handler(pAd);
//send associnfo event to wpa_supplicant
memset(&wrqu, 0, sizeof(wrqu));
wrqu.data.flags = RT_ASSOC_EVENT_FLAG;
wireless_send_event(pAd->net_dev, IWEVCUSTOM, &wrqu, NULL);
}
DBGPRINT(RT_DEBUG_OFF, "ASSOC - receive REASSOC_RSP to me (status=%d)\n", Status);
#endif
#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
if (pAd->PortCfg.bNativeWpa == TRUE) // add by johnli
wext_notify_event_assoc(pAd, SIOCGIWAP, TRUE);
#endif // NATIVE_WPA_SUPPLICANT_SUPPORT
}
pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_REASSOC_CONF, 2, &Status);
}
}
else
{
DBGPRINT(RT_DEBUG_TRACE, "ASSOC - PeerReassocRspAction() sanity check fail\n");
}
}
开发者ID:cnm,项目名称:mia_vita,代码行数:67,代码来源:assoc.c
示例12: QueryHashID
ULONG QueryHashID(
IN PRTMP_ADAPTER pAd,
PUCHAR pAddr,
BOOLEAN RemoveBSS)
{
ULONG HashIdx;
UCHAR j = 0;
for(j = 1; j < NULLFRAMESPACE; j++)
{
if (MAC_ADDR_EQUAL(&pAd->HASH_BSSID[j][0],pAddr))
{
DBGPRINT(RT_DEBUG_TRACE, ("COEX: j = %d\n",j));
DBGPRINT(RT_DEBUG_TRACE, ("COEX: Find BSSID Address = %02X:%02X:%02X:%02X:%02X:%02X\n",pAd->HASH_BSSID[j][0],pAd->HASH_BSSID[j][1],
pAd->HASH_BSSID[j][2],pAd->HASH_BSSID[j][3],
pAd->HASH_BSSID[j][4], pAd->HASH_BSSID[j][5]));
HashIdx = j;
if (RemoveBSS == TRUE)
{
pAd->HASH_BSSID[j][MAC_ADDR_LEN] = 0;
DBGPRINT(RT_DEBUG_TRACE, ("COEX: Remove BSSID Address = %02X:%02X:%02X:%02X:%02X:%02X\n",pAd->HASH_BSSID[j][0],pAd->HASH_BSSID[j][1],
pAd->HASH_BSSID[j][2],pAd->HASH_BSSID[j][3],
pAd->HASH_BSSID[j][4], pAd->HASH_BSSID[j][5]));
}
return HashIdx;
}
//MAC_ADDR_EQUAL(&pAd->HASH_BSSID[j][0],)
DBGPRINT(RT_DEBUG_TRACE, ("COEX:Miss search j = %d\n",j));
}
for(j = 1; j < NULLFRAMESPACE; j++)
{
if (pAd->HASH_BSSID[j][MAC_ADDR_LEN] == 0)
{
COPY_MAC_ADDR(&pAd->HASH_BSSID[j][0], pAddr);
pAd->HASH_BSSID[j][MAC_ADDR_LEN] = 1;
HashIdx = j;
DBGPRINT(RT_DEBUG_TRACE, ("COEX: free space j = %d\n",j));
DBGPRINT(RT_DEBUG_TRACE, ("COEX: Insert MAC Address = %02X:%02X:%02X:%02X:%02X:%02X\n",pAd->HASH_BSSID[j][0],pAd->HASH_BSSID[j][1],
pAd->HASH_BSSID[j][2],pAd->HASH_BSSID[j][3],
pAd->HASH_BSSID[j][4], pAd->HASH_BSSID[j][5]));
return HashIdx;
}
//debug if there is an overflow issue
if (j == (NULLFRAMESPACE -1 ))
{
COPY_MAC_ADDR(&pAd->HASH_BSSID[j][0], pAddr);
pAd->HASH_BSSID[1][MAC_ADDR_LEN] = 1;
pAd->HASH_BSSID[2][MAC_ADDR_LEN] = 0;
pAd->HASH_BSSID[3][MAC_ADDR_LEN] = 0;
HashIdx = 1;
return HashIdx;
}
}
return 0;
}
开发者ID:vm3vuy,项目名称:my-local-repository,代码行数:58,代码来源:bt_coex.c
示例13: NdisAcquireSpinLock
REPEATER_CLIENT_ENTRY *RTMPLookupRepeaterCliEntry(
IN PRTMP_ADAPTER pAd,
IN BOOLEAN bRealMAC,
IN PUCHAR pAddr)
{
ULONG HashIdx;
UCHAR tempMAC[6];
REPEATER_CLIENT_ENTRY *pEntry = NULL;
REPEATER_CLIENT_ENTRY_MAP *pMapEntry = NULL;
NdisAcquireSpinLock(&pAd->ApCfg.ReptCliEntryLock);
COPY_MAC_ADDR(tempMAC, pAddr);
HashIdx = MAC_ADDR_HASH_INDEX(tempMAC);
if (bRealMAC == TRUE)
{
pMapEntry = pAd->ApCfg.ReptMapHash[HashIdx];
while (pMapEntry)
{
pEntry = pMapEntry->pReptCliEntry;
if (pEntry->CliValid && MAC_ADDR_EQUAL(pEntry->OriginalAddress, tempMAC))
break;
else
{
pEntry = NULL;
pMapEntry = pMapEntry->pNext;
}
}
}
else
{
pEntry = pAd->ApCfg.ReptCliHash[HashIdx];
while (pEntry)
{
if (pEntry->CliValid && MAC_ADDR_EQUAL(pEntry->CurrentAddress, tempMAC))
break;
else
pEntry = pEntry->pNext;
}
}
NdisReleaseSpinLock(&pAd->ApCfg.ReptCliEntryLock);
return pEntry;
}
开发者ID:23171580,项目名称:ralink,代码行数:45,代码来源:ap_repeater.c
示例14: isSpecialIgmpMacAddr
static inline BOOLEAN isSpecialIgmpMacAddr(IN PUCHAR pGrpId)
{
if (MAC_ADDR_EQUAL(pGrpId, itunes_mac))
{
return TRUE;
}
return FALSE;
}
开发者ID:patrick-ken,项目名称:kernel_808l,代码行数:9,代码来源:igmp_snoop.c
示例15: ApCliPeerDisassocAction
/*
==========================================================================
Description:
left part of IEEE 802.11/1999 p.374
Parameters:
Elem - MLME message containing the received frame
==========================================================================
*/
static VOID ApCliPeerDisassocAction(
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem)
{
UCHAR Addr2[MAC_ADDR_LEN];
USHORT Reason;
USHORT ifIndex = (USHORT)(Elem->Priv);
PULONG pCurrState = NULL;
#ifdef MAC_REPEATER_SUPPORT
UCHAR CliIdx = 0xFF;
#endif /* MAC_REPEATER_SUPPORT */
if ((ifIndex >= MAX_APCLI_NUM)
#ifdef MAC_REPEATER_SUPPORT
&& (ifIndex < 64)
#endif /* MAC_REPEATER_SUPPORT */
)
return;
#ifdef MAC_REPEATER_SUPPORT
if (ifIndex >= 64)
{
CliIdx = ((ifIndex - 64) % 16);
ifIndex = ((ifIndex - 64) / 16);
pCurrState = &pAd->ApCfg.ApCliTab[ifIndex].RepeaterCli[CliIdx].AssocCurrState;
}
else
#endif /* MAC_REPEATER_SUPPORT */
pCurrState = &pAd->ApCfg.ApCliTab[ifIndex].AssocCurrState;
if(PeerDisassocSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Reason))
{
if (MAC_ADDR_EQUAL(pAd->ApCfg.ApCliTab[ifIndex].ApCliMlmeAux.Bssid, Addr2))
{
*pCurrState = APCLI_ASSOC_IDLE;
#ifdef MAC_REPEATER_SUPPORT
ifIndex = (USHORT)(Elem->Priv);
#endif /* MAC_REPEATER_SUPPORT */
MlmeEnqueue(pAd, APCLI_CTRL_STATE_MACHINE, APCLI_CTRL_PEER_DISCONNECT_REQ, 0, NULL, ifIndex);
#ifdef MAC_REPEATER_SUPPORT
if ((pAd->ApCfg.bMACRepeaterEn == TRUE) && (ifIndex >= 64))
{
RTMP_MLME_HANDLER(pAd);
ifIndex = ((ifIndex - 64) / 16);
RTMPRemoveRepeaterEntry(pAd, ifIndex, CliIdx);
}
#endif /* MAC_REPEATER_SUPPORT */
}
}
else
{
DBGPRINT(RT_DEBUG_TRACE, ("APCLI_ASSOC - ApCliPeerDisassocAction() sanity check fail\n"));
}
return;
}
开发者ID:23171580,项目名称:ralink,代码行数:65,代码来源:apcli_assoc.c
示例16: ApCliPeerAssocRspAction
/*
==========================================================================
Description:
peer sends assoc rsp back
Parameters:
Elme - MLME message containing the received frame
==========================================================================
*/
static VOID ApCliPeerAssocRspAction(
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem)
{
BOOLEAN Cancelled;
USHORT CapabilityInfo, Status, Aid;
UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES], SupRateLen;
UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRateLen;
UCHAR Addr2[MAC_ADDR_LEN];
EDCA_PARM EdcaParm;
UCHAR CkipFlag;
APCLI_CTRL_MSG_STRUCT ApCliCtrlMsg;
HT_CAPABILITY_IE HtCapability;
ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */
UCHAR HtCapabilityLen;
UCHAR AddHtInfoLen;
UCHAR NewExtChannelOffset = 0xff;
USHORT ifIndex = (USHORT)(Elem->Priv);
PULONG pCurrState = &pAd->ApCfg.ApCliTab[ifIndex].AssocCurrState;
if (ApCliPeerAssocRspSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &CapabilityInfo, &Status, &Aid, SupRate, &SupRateLen, ExtRate, &ExtRateLen,
&HtCapability, &AddHtInfo, &HtCapabilityLen,&AddHtInfoLen,&NewExtChannelOffset, &EdcaParm, &CkipFlag))
{
/* The frame is for me ? */
if(MAC_ADDR_EQUAL(Addr2, pAd->ApCliMlmeAux.Bssid))
{
DBGPRINT(RT_DEBUG_TRACE, ("APCLI_ASSOC - receive ASSOC_RSP to me (status=%d)\n", Status));
RTMPCancelTimer(&pAd->ApCliMlmeAux.ApCliAssocTimer, &Cancelled);
if(Status == MLME_SUCCESS)
{
/* go to procedure listed on page 376 */
ApCliAssocPostProc(pAd, Addr2, CapabilityInfo, ifIndex, SupRate, SupRateLen,
ExtRate, ExtRateLen, &EdcaParm, &HtCapability, HtCapabilityLen, &AddHtInfo);
ApCliCtrlMsg.Status = MLME_SUCCESS;
MlmeEnqueue(pAd, APCLI_CTRL_STATE_MACHINE, APCLI_CTRL_ASSOC_RSP,
sizeof(APCLI_CTRL_MSG_STRUCT), &ApCliCtrlMsg, ifIndex);
}
else
{
ApCliCtrlMsg.Status = Status;
MlmeEnqueue(pAd, APCLI_CTRL_STATE_MACHINE, APCLI_CTRL_ASSOC_RSP,
sizeof(APCLI_CTRL_MSG_STRUCT), &ApCliCtrlMsg, ifIndex);
}
*pCurrState = APCLI_ASSOC_IDLE;
}
}
else
{
DBGPRINT(RT_DEBUG_TRACE, ("APCLI_ASSOC - ApCliPeerAssocRspAction() sanity check fail\n"));
}
return;
}
开发者ID:aircross,项目名称:ray,代码行数:64,代码来源:apcli_assoc.c
示例17: PeerDisassocAction
/*
==========================================================================
Description:
left part of IEEE 802.11/1999 p.374
Parameters:
Elem - MLME message containing the received frame
==========================================================================
*/
VOID PeerDisassocAction(
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem)
{
UCHAR Addr2[MAC_ADDR_LEN];
USHORT Reason;
#ifdef RALINK_WPA_SUPPLICANT_SUPPORT
union iwreq_data wrqu;
#endif
if(PeerDisassocSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Reason))
{
if (INFRA_ON(pAd) && MAC_ADDR_EQUAL(pAd->PortCfg.Bssid, Addr2))
{
LinkDown(pAd, TRUE);
pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
#ifdef RALINK_WPA_SUPPLICANT_SUPPORT
if (pAd->PortCfg.WPA_Supplicant == TRUE)
{
// send disassoc event to wpa_supplicant
memset(&wrqu, 0, sizeof(wrqu));
wrqu.data.flags = RT_DISASSOC_EVENT_FLAG;
wireless_send_event(pAd->net_dev, IWEVCUSTOM, &wrqu, NULL);
}
#endif
#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
if (pAd->PortCfg.bNativeWpa == TRUE) // add by johnli
wext_notify_event_assoc(pAd, SIOCGIWAP, FALSE);
#endif // NATIVE_WPA_SUPPLICANT_SUPPORT
#if 0
// 2004-09-11 john: can't remember why AP will DISASSOCIATE us.
// But since it says for 2430 only, we temporaily remove the patch.
// 2002/11/21 -
// patch RT2430/RT2420 hangup issue. We suspect this AP DIS-ASSOCIATE frame
// is caused by PHY hangup, so we reset PHY, then auto recover the connection.
// if this attempt fails, then remains in LinkDown and leaves the problem
// to MlmePeriodicExec()
// NICPatchRT2430Bug(pAd);
pAd->RalinkCounters.BeenDisassociatedCount ++;
// Remove auto recover effort when disassociate by AP, re-enable for patch 2430 only
DBGPRINT(RT_DEBUG_TRACE, "ASSOC - Disassociated by AP, Auto Recovery attempt #%d\n", pAd->RalinkCounters.BeenDisassociatedCount);
MlmeAutoReconnectLastSSID(pAd);
#endif
}
}
else
{
DBGPRINT(RT_DEBUG_TRACE, "ASSOC - PeerDisassocAction() sanity check fail\n");
}
}
开发者ID:cnm,项目名称:mia_vita,代码行数:63,代码来源:assoc.c
示例18: BMPktSigTabLookUp
PMESH_BMPKTSIG_ENTRY BMPktSigTabLookUp(
IN PRTMP_ADAPTER pAd,
IN PUCHAR MeshSA)
{
UINT HashIdx;
ULONG Now;
PMESH_BMPKTSIG_TAB pTab = pAd->MeshTab.pBMPktSigTab;
PMESH_BMPKTSIG_ENTRY pEntry = NULL;
PMESH_BMPKTSIG_ENTRY pPrevEntry = NULL;
if (pTab == NULL)
{
DBGPRINT(RT_DEBUG_ERROR, ("%s: pBMPktSigTab doesn't exist.\n", __FUNCTION__));
return NULL;
}
RTMP_SEM_LOCK(&pAd->MeshTab.MeshBMPktTabLock);
HashIdx = BMPKT_MAC_ADDR_HASH_INDEX(MeshSA);
pEntry = pTab->Hash[HashIdx];
while (pEntry)
{
if (MAC_ADDR_EQUAL(pEntry->MeshSA, MeshSA))
break;
else
{
pPrevEntry = pEntry;
pEntry = pEntry->pNext;
}
}
if (pEntry)
{
NdisGetSystemUpTime(&Now);
if (RTMP_TIME_AFTER((unsigned long)Now, (unsigned long)(pEntry->LastRefTime + MESH_BMPKT_RECORD_TIME)))
{ /* remove ageout entry. */
if (pPrevEntry == NULL)
pTab->Hash[HashIdx] = pEntry->pNext;
else
pPrevEntry->pNext = pEntry->pNext;
NdisZeroMemory(pEntry, sizeof(MESH_BMPKTSIG_ENTRY));
pEntry = NULL;
pTab->Size--;
}
else
pEntry->LastRefTime = Now;
}
RTMP_SEM_UNLOCK(&pAd->MeshTab.MeshBMPktTabLock);
return pEntry;
}
开发者ID:vm3vuy,项目名称:my-local-repository,代码行数:54,代码来源:mesh_bmpkt.c
示例19: ApCliProbeTimeoutAtJoinAction
static VOID ApCliProbeTimeoutAtJoinAction(
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem)
{
APCLI_CTRL_MSG_STRUCT ApCliCtrlMsg;
USHORT ifIndex = (USHORT)(Elem->Priv);
PULONG pCurrState = &pAd->ApCfg.ApCliTab[ifIndex].SyncCurrState;
PAPCLI_STRUCT pApCliEntry = NULL;
#ifdef APCLI_CONNECTION_TRIAL
PULONG pCurrCtrlState = &pAd->ApCfg.ApCliTab[ifIndex].CtrlCurrState;
DBGPRINT(RT_DEBUG_TRACE, ("APCLI_SYNC - ProbeTimeoutAtJoinAction, ifIndex = %d, pCurrCtrlState = %ld, pCurrSyncState = %ld\n", ifIndex, *pCurrCtrlState, *pCurrState));
#endif
if (ifIndex >= MAX_APCLI_NUM)
return;
pApCliEntry = &pAd->ApCfg.ApCliTab[ifIndex];
pCurrState = &pApCliEntry->SyncCurrState;
DBGPRINT(RT_DEBUG_TRACE, ("APCLI_SYNC - ProbeTimeoutAtJoinAction\n"));
*pCurrState = SYNC_IDLE;
#ifdef APCLI_CONNECTION_TRIAL
if (ifIndex == 1)
*pCurrCtrlState = APCLI_CTRL_DISCONNECTED;
#endif
DBGPRINT(RT_DEBUG_TRACE, ("APCLI_SYNC - ApCliMlmeAux.Bssid=%02x:%02x:%02x:%02x:%02x:%02x\n",
pApCliEntry->ApCliMlmeAux.Bssid[0],
pApCliEntry->ApCliMlmeAux.Bssid[1],
pApCliEntry->ApCliMlmeAux.Bssid[2],
pApCliEntry->ApCliMlmeAux.Bssid[3],
pApCliEntry->ApCliMlmeAux.Bssid[4],
pApCliEntry->ApCliMlmeAux.Bssid[5]));
if(!MAC_ADDR_EQUAL(pApCliEntry->ApCliMlmeAux.Bssid, ZERO_MAC_ADDR))
{
ApCliCtrlMsg.Status = MLME_SUCCESS;
#ifdef MAC_REPEATER_SUPPORT
ApCliCtrlMsg.BssIdx = ifIndex;
ApCliCtrlMsg.CliIdx = 0xFF;
#endif /* MAC_REPEATER_SUPPORT */
MlmeEnqueue(pAd, APCLI_CTRL_STATE_MACHINE, APCLI_CTRL_PROBE_RSP,
sizeof(APCLI_CTRL_MSG_STRUCT), &ApCliCtrlMsg, ifIndex);
} else
{
MlmeEnqueue(pAd, APCLI_CTRL_STATE_MACHINE, APCLI_CTRL_JOIN_REQ_TIMEOUT, 0, NULL, ifIndex);
}
return;
}
开发者ID:jing-git,项目名称:rt-n56u,代码行数:52,代码来源:apcli_sync.c
示例20: MeshClonePacket
VOID MeshClonePacket(
IN PRTMP_ADAPTER pAd,
IN PNDIS_PACKET pPacket,
IN UINT8 MeshSrc,
IN UINT8 MeshLinkIdx)
{
INT idx;
PUCHAR pSA = NULL;
PUCHAR pDA = NULL;
for (idx = 0; idx < MAX_MESH_LINKS; idx++)
{
if ((MeshSrc == MESH_FORWARD)
&& (MeshLinkIdx == idx))
continue;
pSA = GET_OS_PKT_DATAPTR(pPacket) + MAC_ADDR_LEN;
if (MAC_ADDR_EQUAL(pAd->MeshTab.MeshLink[idx].Entry.PeerMacAddr, pSA))
continue;
pDA = GET_OS_PKT_DATAPTR(pPacket);
if (IS_MULTICAST_MAC_ADDR(pDA)
&& (MultipathEntryLookUp(pAd, idx, pSA) != NULL))
continue;
if (PeerLinkValidCheck(pAd, idx) == TRUE)
{
PNDIS_PACKET pPacketClone;
/* pPacketClone = skb_clone(RTPKT_TO_OSPKT(pPacket), GFP_ATOMIC); */
OS_PKT_CLONE(pAd, pPacket, pPacketClone, GFP_ATOMIC);
if (pPacketClone == NULL)
continue;
RTMP_SET_PACKET_NET_DEVICE_MESH(pPacketClone, 0);
RTMP_SET_PACKET_SOURCE(pPacketClone, PKTSRC_NDIS);
RTMP_SET_PACKET_MOREDATA(pPacketClone, FALSE);
RTMP_SET_PACKET_WCID(pPacketClone, pAd->MeshTab.MeshLink[idx].Entry.MacTabMatchWCID);
RTMP_SET_MESH_ROUTE_ID(pPacketClone, BMCAST_ROUTE_ID);
RTMP_SET_MESH_SOURCE(pPacketClone, MeshSrc);
#ifdef CONFIG_AP_SUPPORT
APSendPacket(pAd, pPacketClone);
#endif /* CONFIG_AP_SUPPORT */
#ifdef CONFIG_STA_SUPPORT
STASendPacket(pAd, pPacketClone);
#endif /* CONFIG_STA_SUPPORT */
}
}
return;
}
开发者ID:23171580,项目名称:ralink,代码行数:51,代码来源:mesh_bmpkt.c
注:本文中的MAC_ADDR_EQUAL函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论