本文整理汇总了C++中NdisGetSystemUpTime函数的典型用法代码示例。如果您正苦于以下问题:C++ NdisGetSystemUpTime函数的具体用法?C++ NdisGetSystemUpTime怎么用?C++ NdisGetSystemUpTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NdisGetSystemUpTime函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TDLS_ChannelSwitchTimeOutAction
/*
==========================================================================
Description:
IRQL = PASSIVE_LEVEL
==========================================================================
*/
VOID TDLS_ChannelSwitchTimeOutAction(
IN PVOID SystemSpecific1,
IN PVOID FunctionContext,
IN PVOID SystemSpecific2,
IN PVOID SystemSpecific3)
{
PRT_802_11_TDLS pTDLS = (PRT_802_11_TDLS)FunctionContext;
PRTMP_ADAPTER pAd = pTDLS->pAd;
BOOLEAN TimerCancelled;
DBGPRINT(RT_DEBUG_WARN, ("TDLS - Failed to wait for channel switch, terminate the channel switch procedure (%02x:%02x:%02x:%02x:%02x:%02x)\n",
pTDLS->MacAddr[0], pTDLS->MacAddr[1], pTDLS->MacAddr[2],
pTDLS->MacAddr[3], pTDLS->MacAddr[4], pTDLS->MacAddr[5]));
{
ULONG Now, temp1;
NdisGetSystemUpTime(&Now);
temp1 = (((Now - pTDLS->ChannelSwitchTimerStartTime) * 1000) / OS_HZ);
if (temp1 < (pTDLS->ChSwitchTimeout / 1000))
{
RTMPSetTimer(&pTDLS->ChannelSwitchTimeoutTimer, ((pTDLS->ChSwitchTimeout / 1000) - temp1));
return;
}
if (temp1 < (pTDLS->ChSwitchTimeout / 1000))
{
DBGPRINT(RT_DEBUG_OFF, ("Timer = %ld < 11 !!!\n", temp1));
}
}
RTMPCancelTimer(&pAd->StaCfg.TdlsResponderGoBackBaseChTimer, &TimerCancelled);
pAd->StaCfg.bTdlsCurrentDoingChannelSwitchWaitSuccess = FALSE;
pAd->StaCfg.bDoingPeriodChannelSwitch = FALSE;
RTMPusecDelay(300);
NdisGetSystemUpTime(&pAd->StaCfg.TdlsGoBackStartTime);
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_TDLS_DOING_CHANNEL_SWITCH);
if (pAd->CommonCfg.CentralChannel > pAd->CommonCfg.Channel)
TDLS_InitChannelRelatedValue(pAd, pAd->CommonCfg.Channel, EXTCHA_ABOVE);
else if (pAd->CommonCfg.CentralChannel < pAd->CommonCfg.Channel)
TDLS_InitChannelRelatedValue(pAd, pAd->CommonCfg.Channel, EXTCHA_BELOW);
else
TDLS_InitChannelRelatedValue(pAd, pAd->CommonCfg.Channel, EXTCHA_NONE);
TDLS_EnablePktChannel(pAd, TDLS_FIFO_ALL);
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_TDLS_DOING_CHANNEL_SWITCH);
}
示例2: BARecSessionIdleTimeout
/*
==========================================================================
Description:
Retry sending ADDBA Reqest.
IRQL = DISPATCH_LEVEL
Parametrs:
p8023Header: if this is already 802.3 format, p8023Header is NULL
Return : TRUE if put into rx reordering buffer, shouldn't indicaterxhere.
FALSE , then continue indicaterx at this moment.
==========================================================================
*/
VOID BARecSessionIdleTimeout(
IN PVOID SystemSpecific1,
IN PVOID FunctionContext,
IN PVOID SystemSpecific2,
IN PVOID SystemSpecific3)
{
BA_REC_ENTRY *pBAEntry = (BA_REC_ENTRY *)FunctionContext;
PRTMP_ADAPTER pAd;
ULONG Now32;
if (pBAEntry == NULL)
return;
if ((pBAEntry->REC_BA_Status == Recipient_Accept))
{
NdisGetSystemUpTime(&Now32);
if (RTMP_TIME_AFTER((unsigned long)Now32, (unsigned long)(pBAEntry->LastIndSeqAtTimer + REC_BA_SESSION_IDLE_TIMEOUT)))
{
pAd = pBAEntry->pAdapter;
// flush all pending reordering mpdus
ba_refresh_reordering_mpdus(pAd, pBAEntry);
DBGPRINT(RT_DEBUG_OFF, ("%ld: REC BA session Timeout\n", Now32));
}
}
}
示例3: dbgLogWr1
/*----------------------------------------------------------------------------*/
NDIS_STATUS dbgLogWr1(IN PINT_8 debugStr, IN ...
)
{
PINT_8 buf_p = NULL;
UINT_32 systemUpTime;
va_list paramList;
if (pBuf == NULL) {
return NDIS_STATUS_FAILURE;
}
/* Format log message: systemTime + message */
buf_p = pBuf->dbgMsg[pBuf->currentIndex].dbgStr;
va_start(paramList, debugStr);
vsprintf(buf_p, debugStr, paramList); /* 11: 10-digit time and 1 space */
/* Get system time */
NdisGetSystemUpTime(&systemUpTime);
pBuf->dbgMsg[pBuf->currentIndex].sysTime = systemUpTime;
pBuf->dbgMsg[pBuf->currentIndex].id = g_logId;
g_logId++;
pBuf->currentIndex++;
if (pBuf->currentIndex >= MAX_RECORD_NUM) {
pBuf->currentIndex = (pBuf->currentIndex) % MAX_RECORD_NUM;
}
return NDIS_STATUS_SUCCESS;
} /* dbgLogWr1 */
示例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;
}
示例5: CliWds_ProxyTabUpdate
VOID CliWds_ProxyTabUpdate(
IN PRTMP_ADAPTER pAd,
IN SHORT Aid,
IN PUCHAR pMac)
{
UINT8 HashId = (*(pMac + 5) & (CLIWDS_HASH_TAB_SIZE - 1));
PCLIWDS_PROXY_ENTRY pCliWdsEntry;
if (CliWds_ProxyLookup(pAd, pMac) != NULL)
return;
pCliWdsEntry = CliWdsEntyAlloc(pAd);
if (pCliWdsEntry)
{
ULONG Now;
NdisGetSystemUpTime(&Now);
pCliWdsEntry->Aid = Aid;
COPY_MAC_ADDR(&pCliWdsEntry->Addr, pMac);
pCliWdsEntry->LastRefTime = Now;
pCliWdsEntry->pNext = NULL;
insertTailList(&pAd->ApCfg.CliWdsProxyTab[HashId], (PLIST_ENTRY)pCliWdsEntry);
}
return;
}
示例6: MultipathEntryInsert
VOID MultipathEntryInsert(
IN PRTMP_ADAPTER pAd,
IN UCHAR LinkIdx,
IN PUCHAR pMac)
{
PMESH_MULTIPATH_ENTRY pEntry;
UINT8 HashId = *(pMac + 5);
ULONG Now;
if (!VALID_MESH_LINK_ID(LinkIdx))
return;
pEntry = MultipathEntryLookUp(pAd, LinkIdx, pMac);
if(pEntry == NULL)
{
if ((pEntry = MultipathEntyAlloc(pAd)) == NULL)
return;
insertTailList(&pAd->MeshTab.MeshLink[LinkIdx].Entry.MultiPathHash[HashId], (PLIST_ENTRY)pEntry);
}
DBGPRINT(RT_DEBUG_TRACE, ("Block multipath pkt to link(%d) from SA=%02x:%02x:%02x:%02x:%02x:%02x\n",
LinkIdx, pMac[0], pMac[1], pMac[2], pMac[3], pMac[4], pMac[5]));
NdisGetSystemUpTime(&Now);
COPY_MAC_ADDR(pEntry->MeshSA, pMac);
pEntry->ReferTime = Now;
return;
}
示例7: MultipathEntryMaintain
VOID MultipathEntryMaintain(
IN PRTMP_ADAPTER pAd,
IN UCHAR LinkIdx)
{
ULONG i;
PMESH_MULTIPATH_ENTRY pEntry;
ULONG Now;
if (!VALID_MESH_LINK_ID(LinkIdx))
return;
NdisGetSystemUpTime(&Now);
for (i = 0; i < MULTIPATH_HASH_TAB_SIZE; i++)
{
pEntry = (PMESH_MULTIPATH_ENTRY)(pAd->MeshTab.MeshLink[LinkIdx].Entry.MultiPathHash[i].pHead);
while (pEntry)
{
PMESH_MULTIPATH_ENTRY pEntryNext = pEntry->pNext;
if (RTMP_TIME_AFTER(Now, pEntry->ReferTime + (pAd->MeshTab.MeshMultiCastAgeOut * OS_HZ / 1000)))
{
delEntryList(&pAd->MeshTab.MeshLink[LinkIdx].Entry.MultiPathHash[i], (PLIST_ENTRY)pEntry);
MultipathEntyFree(pAd, pEntry);
}
pEntry = pEntryNext;
}
}
return;
}
示例8: BARecSessionIdleTimeout
/*
==========================================================================
Description:
Retry sending ADDBA Reqest.
IRQL = DISPATCH_LEVEL
Parametrs:
p8023Header: if this is already 802.3 format, p8023Header is NULL
Return : TRUE if put into rx reordering buffer, shouldn't indicaterxhere.
FALSE , then continue indicaterx at this moment.
==========================================================================
*/
void BARecSessionIdleTimeout(void *SystemSpecific1,
void *FunctionContext,
void *SystemSpecific2, void *SystemSpecific3)
{
struct rt_ba_rec_entry *pBAEntry = (struct rt_ba_rec_entry *)FunctionContext;
struct rt_rtmp_adapter *pAd;
unsigned long Now32;
if (pBAEntry == NULL)
return;
if ((pBAEntry->REC_BA_Status == Recipient_Accept)) {
NdisGetSystemUpTime(&Now32);
if (RTMP_TIME_AFTER
((unsigned long)Now32,
(unsigned long)(pBAEntry->LastIndSeqAtTimer +
REC_BA_SESSION_IDLE_TIMEOUT))) {
pAd = pBAEntry->pAdapter;
/* flush all pending reordering mpdus */
ba_refresh_reordering_mpdus(pAd, pBAEntry);
DBGPRINT(RT_DEBUG_OFF,
("%ld: REC BA session Timeout\n", Now32));
}
}
}
示例9: RTMPReportMicError
/*
========================================================================
Routine Description:
Process MIC error indication and record MIC error timer.
Arguments:
pAd Pointer to our adapter
pWpaKey Pointer to the WPA key structure
Return Value:
None
IRQL = DISPATCH_LEVEL
Note:
========================================================================
*/
VOID RTMPReportMicError(
IN PRTMP_ADAPTER pAd,
IN PCIPHER_KEY pWpaKey)
{
ULONG Now;
UCHAR unicastKey = (pWpaKey->Type == PAIRWISE_KEY ? 1:0);
// Record Last MIC error time and count
NdisGetSystemUpTime(&Now);
if (pAd->StaCfg.MicErrCnt == 0)
{
pAd->StaCfg.MicErrCnt++;
pAd->StaCfg.LastMicErrorTime = Now;
NdisZeroMemory(pAd->StaCfg.ReplayCounter, 8);
}
else if (pAd->StaCfg.MicErrCnt == 1)
{
if ((pAd->StaCfg.LastMicErrorTime + (60 * OS_HZ)) < Now)
{
// Update Last MIC error time, this did not violate two MIC errors within 60 seconds
pAd->StaCfg.LastMicErrorTime = Now;
}
else
{
RTMPSendWirelessEvent(pAd, IW_COUNTER_MEASURES_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
pAd->StaCfg.LastMicErrorTime = Now;
// Violate MIC error counts, MIC countermeasures kicks in
pAd->StaCfg.MicErrCnt++;
// We shall block all reception
// We shall clean all Tx ring and disassoicate from AP after next EAPOL frame
//
// No necessary to clean all Tx ring, on RTMPHardTransmit will stop sending non-802.1X EAPOL packets
// if pAd->StaCfg.MicErrCnt greater than 2.
//
// RTMPRingCleanUp(pAd, QID_AC_BK);
// RTMPRingCleanUp(pAd, QID_AC_BE);
// RTMPRingCleanUp(pAd, QID_AC_VI);
// RTMPRingCleanUp(pAd, QID_AC_VO);
// RTMPRingCleanUp(pAd, QID_HCCA);
}
}
else
{
// MIC error count >= 2
// This should not happen
;
}
MlmeEnqueue(pAd,
MLME_CNTL_STATE_MACHINE,
OID_802_11_MIC_FAILURE_REPORT_FRAME,
1,
&unicastKey, 0);
if (pAd->StaCfg.MicErrCnt == 2)
{
RTMPSetTimer(&pAd->StaCfg.WpaDisassocAndBlockAssocTimer, 100);
}
}
示例10: TDLS_MlmeChannelSwitchRspAction
/*
==========================================================================
Description:
IRQL = PASSIVE_LEVEL
==========================================================================
*/
VOID
TDLS_MlmeChannelSwitchRspAction(
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem)
{
PMLME_TDLS_CH_SWITCH_STRUCT pMlmeChSwitchRsp = NULL;
NDIS_STATUS NStatus = NDIS_STATUS_SUCCESS;
PRT_802_11_TDLS pTdls = NULL;
int LinkId = 0xff;
DBGPRINT(RT_DEBUG_WARN,("TDLS ===> TDLS_MlmeChannelSwitchRspAction() \n"));
pMlmeChSwitchRsp = (PMLME_TDLS_CH_SWITCH_STRUCT)Elem->Msg;
if (INFRA_ON(pAd))
{
// Drop not within my TDLS Table that created before !
LinkId = TDLS_SearchLinkId(pAd, pMlmeChSwitchRsp->PeerMacAddr);
if (LinkId == -1 || LinkId == MAX_NUM_OF_TDLS_ENTRY)
{
DBGPRINT(RT_DEBUG_OFF,("TDLS - TDLS_MlmeChannelSwitchRspAction() can not find the LinkId!\n"));
return;
}
/* Point to the current Link ID */
pTdls = &pAd->StaCfg.TdlsInfo.TDLSEntry[LinkId];
/* Build TDLS channel switch Request Frame */
NStatus = TDLS_ChannelSwitchRspAction(pAd, pTdls, pTdls->ChSwitchTime, pTdls->ChSwitchTimeout, 0, (RTMP_TDLS_SPECIFIC_CS_RSP_NOACK + RTMP_TDLS_SPECIFIC_HCCA));
if (NStatus != NDIS_STATUS_SUCCESS)
{
DBGPRINT(RT_DEBUG_ERROR,("TDLS - TDLS_MlmeChannelSwitchRspAction() Build Channel Switch Response Fail !!!\n"));
}
else
{
RTMPusecDelay(300);
NdisGetSystemUpTime(&pAd->StaCfg.TdlsGoBackStartTime);
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_TDLS_DOING_CHANNEL_SWITCH);
if (pAd->CommonCfg.CentralChannel > pAd->CommonCfg.Channel)
TDLS_InitChannelRelatedValue(pAd, pAd->CommonCfg.Channel, EXTCHA_ABOVE);
else if (pAd->CommonCfg.CentralChannel < pAd->CommonCfg.Channel)
TDLS_InitChannelRelatedValue(pAd, pAd->CommonCfg.Channel, EXTCHA_BELOW);
else
TDLS_InitChannelRelatedValue(pAd, pAd->CommonCfg.Channel, EXTCHA_NONE);
TDLS_EnablePktChannel(pAd, TDLS_FIFO_ALL);
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_TDLS_DOING_CHANNEL_SWITCH);
DBGPRINT(RT_DEBUG_WARN,("TDLS <=== TDLS_MlmeChannelSwitchRspAction() \n"));
}
}
else
{
DBGPRINT(RT_DEBUG_ERROR,("TDLS - TDLS_MlmeChannelSwitchRspAction() TDLS only support infra mode !!!\n"));
}
return;
}
示例11: kalGetTimeTick
/*----------------------------------------------------------------------------*/
OS_SYSTIME kalGetTimeTick(VOID)
{
ULONG u4SystemUpTime;
NdisGetSystemUpTime(&u4SystemUpTime);
return (OS_SYSTIME) u4SystemUpTime;
} /* kalGetTimeTick */
示例12: ar6000_ms_tickget
A_UINT32
ar6000_ms_tickget()
{
A_UINT32 upTime;
NdisGetSystemUpTime(&upTime);
return upTime;
}
示例13: NeighborTableUpdate
VOID NeighborTableUpdate(
IN PRTMP_ADAPTER pAd)
{
INT i;
PMESH_NEIGHBOR_TAB pNeighborTab = pAd->MeshTab.pMeshNeighborTab;
PMESH_NEIGHBOR_ENTRY pNeighborEntry = NULL;
ULONG Now;
if(pNeighborTab == NULL)
{
DBGPRINT(RT_DEBUG_ERROR, ("pAd->MeshTab.pMeshNeighborTab equal NULL.\n"));
return;
}
for (i = 0; i < MAX_NEIGHBOR_MP; i++)
{
pNeighborEntry = &pAd->MeshTab.pMeshNeighborTab->NeighborMP[i];
if (pNeighborEntry->Valid == FALSE)
continue;
NdisGetSystemUpTime(&Now);
/*if ((++pNeighborEntry->IdleCnt > NEIGHBOR_MP_IDLE_CNT)) */
if(RTMP_TIME_AFTER(Now, pNeighborEntry->LastBeaconTime + (MESH_NEIGHBOR_BEACON_IDLE_TIME * OS_HZ / 1000) ))
{
if (MeshValid(&pAd->MeshTab)
&& (pNeighborEntry->State == CANDIDATE_MP)
&& (PeerLinkValidCheck(pAd, pNeighborEntry->MeshLinkIdx) == TRUE))
{
MlmeEnqueue(pAd, MESH_LINK_MNG_STATE_MACHINE, MESH_LINK_MNG_CNCL, 0, NULL, pNeighborEntry->MeshLinkIdx);
}
if ( (pAd->MeshTab.UCGEnable && pNeighborEntry->Channel == pAd->MeshTab.MeshChannel)
|| !pAd->MeshTab.UCGEnable)
DeleteNeighborMP(pAd, pNeighborEntry->PeerMac);
}
else
{
if (VALID_MESH_LINK_ID(pNeighborEntry->MeshLinkIdx))
{
if ((pNeighborEntry->State == LINK_AVAILABLE)
&& (pNeighborEntry->ExtChOffset != pAd->MeshTab.MeshLink[pNeighborEntry->MeshLinkIdx].Entry.ExtChOffset))
{
DBGPRINT(RT_DEBUG_TRACE, ("Link%d:Neighbor ExtChOffset change from %d to %d , kill the link!\n"
,pNeighborEntry->MeshLinkIdx
,pNeighborEntry->ExtChOffset,pAd->MeshTab.MeshLink[pNeighborEntry->MeshLinkIdx].Entry.ExtChOffset));
MlmeEnqueue(pAd, MESH_LINK_MNG_STATE_MACHINE, MESH_LINK_MNG_CNCL, 0, NULL, pNeighborEntry->MeshLinkIdx);
RTMP_MLME_HANDLER(pAd);
}
}
}
}
return;
}
示例14: 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;
}
示例15: dbgLogWr
/*----------------------------------------------------------------------------*/
NDIS_STATUS dbgLogWr(IN PINT_8 debugStr, IN ...
)
{
#define TMP_BUF_LEN 256
int strLen;
DWORD BytesWritten;
PINT_8 buf_p = NULL;
HANDLE FileHandle = NULL;
va_list paramList;
UINT_32 systemUpTime;
/* Open the log file */
FileHandle = CreateFile(TEXT(DEBUG_FILE_NAME), GENERIC_WRITE, 0, /* No sharing */
NULL, /* Handle cannot be inherited */
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (FileHandle == INVALID_HANDLE_VALUE) {
return NDIS_STATUS_FAILURE;
}
/* Create log message buffer */
buf_p = (PUINT_8) kalMemAlloc(TMP_BUF_LEN, VIR_MEM_TYPE);
if (buf_p == NULL) {
CloseHandle(FileHandle);
return NDIS_STATUS_FAILURE;
}
/* Get system time */
NdisGetSystemUpTime(&systemUpTime);
/* Format log message: systemTime + message */
kalMemZero(buf_p, TMP_BUF_LEN);
va_start(paramList, debugStr);
sprintf(buf_p, "%10d ", systemUpTime);
/* 11: 10-digit time and 1 space */
_vsnprintf(buf_p + 11, TMP_BUF_LEN - 12, debugStr, paramList);
strLen = strlen(buf_p);
/* Write message log to log file */
SetFilePointer(FileHandle, 0, 0, FILE_END);
WriteFile(FileHandle, buf_p, strLen, &BytesWritten, NULL);
CloseHandle(FileHandle);
kalMemFree(buf_p, VIR_MEM_TYPE, TMP_BUF_LEN);
return NDIS_STATUS_SUCCESS;
} /* dbgLogWr */