• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ NdisGetSystemUpTime函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中NdisGetSystemUpTime函数的典型用法代码示例。如果您正苦于以下问题:C++ NdisGetSystemUpTime函数的具体用法?C++ NdisGetSystemUpTime怎么用?C++ NdisGetSystemUpTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了NdisGetSystemUpTime函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:vision8520,项目名称:kernel-amlogic-mx,代码行数:57,代码来源:tdls_chswitch_mng.c


示例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));
		}
	}
}
开发者ID:acassis,项目名称:emlinux-ssd1935,代码行数:41,代码来源:ba_action.c


示例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 */
开发者ID:AudioGod,项目名称:MediaTek-HelioX10-Kernel,代码行数:31,代码来源:dbgce.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:eagleworld,项目名称:RT3070_SoftAP,代码行数:26,代码来源:client_wds.c


示例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;
}
开发者ID:eagleworld,项目名称:RT3070_SoftAP,代码行数:25,代码来源:client_wds.c


示例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;
}
开发者ID:vm3vuy,项目名称:my-local-repository,代码行数:29,代码来源:mesh_bmpkt.c


示例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;
}
开发者ID:vm3vuy,项目名称:my-local-repository,代码行数:28,代码来源:mesh_bmpkt.c


示例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));
		}
	}
}
开发者ID:ANFS,项目名称:ANFS-kernel,代码行数:41,代码来源:ba_action.c


示例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);
    }
}
开发者ID:ducktrick,项目名称:RUnigma,代码行数:79,代码来源:wpa.c


示例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;
}
开发者ID:vision8520,项目名称:kernel-amlogic-mx,代码行数:67,代码来源:tdls_chswitch_mng.c


示例11: kalGetTimeTick

/*----------------------------------------------------------------------------*/
OS_SYSTIME kalGetTimeTick(VOID)
{
	ULONG u4SystemUpTime;

	NdisGetSystemUpTime(&u4SystemUpTime);

	return (OS_SYSTIME) u4SystemUpTime;
}				/* kalGetTimeTick */
开发者ID:AudioGod,项目名称:MediaTek-HelioX10-Kernel,代码行数:9,代码来源:gl_kal_ndis51.c


示例12: ar6000_ms_tickget

A_UINT32
ar6000_ms_tickget()
{
    A_UINT32 upTime;

    NdisGetSystemUpTime(&upTime);

    return upTime;
}
开发者ID:NemProjects,项目名称:WLAN,代码行数:9,代码来源:timer.c


示例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;
}
开发者ID:23171580,项目名称:ralink,代码行数:55,代码来源:mesh_ctrl.c


示例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;
}
开发者ID:vm3vuy,项目名称:my-local-repository,代码行数:54,代码来源:mesh_bmpkt.c


示例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 */
开发者ID:AudioGod,项目名称:MediaTek-HelioX10-Kernel,代码行数:52,代码来源:dbgce.c


示例16: ApCliMlmeScanReqAction

static VOID ApCliMlmeScanReqAction(
	IN RTMP_ADAPTER *pAd,
	IN MLME_QUEUE_ELEM *Elem)
{
	BOOLEAN Cancelled;
	UCHAR Ssid[MAX_LEN_OF_SSID], SsidLen, ScanType, BssType;

	/* Suspend MSDU transmission here */
	RTMPSuspendMsduTransmission(pAd);

	/* first check the parameter sanity */
	if (MlmeScanReqSanity(pAd, Elem->Msg, Elem->MsgLen, &BssType, (PCHAR)Ssid, &SsidLen, &ScanType))
	{
		DBGPRINT(RT_DEBUG_TRACE, ("%s(): mlme scan req action!\n", __FUNCTION__));
		NdisGetSystemUpTime(&pAd->ApCfg.LastScanTime);

		RTMPCancelTimer(&pAd->MlmeAux.APScanTimer, &Cancelled);

		/* record desired BSS parameters */
		pAd->MlmeAux.BssType = BssType;
		pAd->MlmeAux.ScanType = ScanType;
		pAd->MlmeAux.SsidLen = SsidLen;
		NdisMoveMemory(pAd->MlmeAux.Ssid, Ssid, SsidLen);

		/* start from the first channel */
#ifdef AP_PARTIAL_SCAN_SUPPORT
		pAd->MlmeAux.Channel = RTMPFindScanChannel(pAd, 0);
#else
		pAd->MlmeAux.Channel = FirstChannel(pAd);
#endif /* AP_PARTIAL_SCAN_SUPPORT */

		/* Let BBP register at 20MHz to do scan */
		bbp_set_bw(pAd, BW_20);
		DBGPRINT(RT_DEBUG_TRACE, ("SYNC - BBP R4 to 20MHz.l\n"));

#ifdef CONFIG_AP_SUPPORT
		IF_DEV_CONFIG_OPMODE_ON_AP(pAd)
		{
			if (pAd->ApCfg.bAutoChannelAtBootup == TRUE)/* iwpriv set auto channel selection */
			{
				APAutoChannelInit(pAd);	
				pAd->ApCfg.AutoChannel_Channel = pAd->ChannelList[0].Channel;
			}
#ifdef SMART_MESH
			Set_Scan_False_CCA(pAd, 0, CCA_RESET);
#endif /* SMART_MESH */		
		}
#endif /* CONFIG_AP_SUPPORT */
		ScanNextChannel(pAd, OPMODE_AP, INT_APCLI);
	}
开发者ID:andy-padavan,项目名称:rt-n56u,代码行数:50,代码来源:apcli_sync.c


示例17: GenRandom

/*
	========================================================================
	
	Routine Description:
		Generate random number by software.

	Arguments:
		pAd		-	pointer to our pAdapter context 
		macAddr	-	pointer to local MAC address
		
	Return Value:

	Note:
		802.1ii-2004  Annex H.5
		
	========================================================================
*/
VOID	GenRandom(
	IN	PRTMP_ADAPTER	pAd, 
	IN	UCHAR			*macAddr,
	OUT	UCHAR			*random)
{	
	INT		i, curr;
	UCHAR	local[80], KeyCounter[32];
	UCHAR	result[80];
	ULONG	CurrentTime;
	UCHAR	prefix[] = {'I', 'n', 'i', 't', ' ', 'C', 'o', 'u', 'n', 't', 'e', 'r'};

	// Zero the related information
	NdisZeroMemory(result, 80);
	NdisZeroMemory(local, 80);
	NdisZeroMemory(KeyCounter, 32);	

	for	(i = 0;	i <	32;	i++)
	{		
		// copy the local MAC address
		COPY_MAC_ADDR(local, macAddr);
		curr =	MAC_ADDR_LEN;

		// concatenate the current time
		NdisGetSystemUpTime(&CurrentTime);
		NdisMoveMemory(&local[curr],  &CurrentTime,	sizeof(CurrentTime));
		curr +=	sizeof(CurrentTime);

		// concatenate the last result
		NdisMoveMemory(&local[curr],  result, 32);
		curr +=	32;
		
		// concatenate a variable 
		NdisMoveMemory(&local[curr],  &i,  2);		
		curr +=	2;

		// calculate the result
		PRF(KeyCounter, 32, prefix,12, local, curr, result, 32); 
	}
	
	NdisMoveMemory(random, result,	32);	
}
开发者ID:acassis,项目名称:emlinux-ssd1935,代码行数:58,代码来源:cmm_wpa.c


示例18: RTMPMaintainPMKIDCache

VOID RTMPMaintainPMKIDCache(
	IN  struct rtmp_adapter *  pAd)
{
	INT	i, j;
	ULONG Now;
	for (i = 0; i < MAX_MBSSID_NUM(pAd); i++)
	{
		PMULTISSID_STRUCT pMbss = &pAd->ApCfg.MBSSID[i];

		for (j = 0; j < MAX_PMKID_COUNT; j++)
		{
			PAP_BSSID_INFO pBssInfo = &pMbss->PMKIDCache.BSSIDInfo[j];

			NdisGetSystemUpTime(&Now);

			if ((pBssInfo->Valid)
				&& /*((Now - pBssInfo->RefreshTime) >= pMbss->PMKCachePeriod)*/
				(RTMP_TIME_AFTER(Now, (pBssInfo->RefreshTime + pMbss->PMKCachePeriod))))
			{
				RTMPDeletePMKIDCache(pAd, i, j);
			}
		}
	}
}
开发者ID:ulli-kroll,项目名称:mt7612u,代码行数:24,代码来源:ap_wpa.c


示例19: CliWds_ProxyTabMaintain

VOID CliWds_ProxyTabMaintain(
	IN PRTMP_ADAPTER pAd)
{
	ULONG idx;
	PCLIWDS_PROXY_ENTRY pCliWdsEntry;
	ULONG Now;

	NdisGetSystemUpTime(&Now);
	for (idx = 0; idx < CLIWDS_HASH_TAB_SIZE; idx++)
	{
		pCliWdsEntry = (PCLIWDS_PROXY_ENTRY)(pAd->ApCfg.CliWdsProxyTab[idx].pHead);
		while(pCliWdsEntry)
		{
			PCLIWDS_PROXY_ENTRY pCliWdsEntryNext = pCliWdsEntry->pNext;
			if (RTMP_TIME_AFTER(Now, pCliWdsEntry->LastRefTime + (CLI_WDS_ENTRY_AGEOUT * OS_HZ / 1000)))
			{
				delEntryList(&pAd->ApCfg.CliWdsProxyTab[idx], (PLIST_ENTRY)pCliWdsEntry);
				CliWdsEntyFree(pAd, pCliWdsEntry);
			}
			pCliWdsEntry = pCliWdsEntryNext;
		}
	}
	return;
}
开发者ID:eagleworld,项目名称:RT3070_SoftAP,代码行数:24,代码来源:client_wds.c


示例20: BMPktSigTabInsert

PMESH_BMPKTSIG_ENTRY BMPktSigTabInsert(
	IN PRTMP_ADAPTER	pAd,
	IN PUCHAR			MeshSA)
{
	INT i;
	ULONG HashIdx;
	PMESH_BMPKTSIG_TAB pTab = pAd->MeshTab.pBMPktSigTab;
	PMESH_BMPKTSIG_ENTRY pEntry = NULL, pCurrEntry;
	ULONG Now;

	if(pTab == NULL)
	{
		DBGPRINT(RT_DEBUG_ERROR, ("%s: pBMPktSigTab doesn't exist.\n", __FUNCTION__));
		return NULL;
	}

	pEntry = BMPktSigTabLookUp(pAd, MeshSA);
	if (pEntry == NULL)
	{
		/* if FULL, return */
		if (pTab->Size >= MAX_BMPKTSIG_TAB_SIZE)
		{
			DBGPRINT(RT_DEBUG_ERROR, ("%s: pBMPktSigTab FULL.\n", __FUNCTION__));
			return NULL;
		}

		RTMP_SEM_LOCK(&pAd->MeshTab.MeshBMPktTabLock);
		for (i = 0; i < MAX_BMPKTSIG_TAB_SIZE; i++)
		{
			NdisGetSystemUpTime(&Now);
			pEntry = &pTab->Content[i];
 
			if ((pEntry->Valid == TRUE)
				&& RTMP_TIME_AFTER((unsigned long)Now, (unsigned long)(pEntry->LastRefTime + MESH_BMPKT_RECORD_TIME)))
			{
				PMESH_BMPKTSIG_ENTRY pPrevEntry = NULL;
				ULONG HashIdx = BMPKT_MAC_ADDR_HASH_INDEX(pEntry->MeshSA);
				PMESH_BMPKTSIG_ENTRY pProbeEntry = pTab->Hash[HashIdx];

				/* update Hash list */
				do
				{
					if (pProbeEntry == pEntry)
					{
						if (pPrevEntry == NULL)
						{
							pTab->Hash[HashIdx] = pEntry->pNext;
						}
						else
						{
							pPrevEntry->pNext = pEntry->pNext;
						}
						break;
					}

					pPrevEntry = pProbeEntry;
					pProbeEntry = pProbeEntry->pNext;
				} while (pProbeEntry);

				NdisZeroMemory(pEntry, sizeof(MESH_BMPKTSIG_ENTRY));
				pTab->Size--;

				continue;
			}
 
			if (pEntry->Valid == FALSE)
				break;
		}

		if (i < MAX_BMPKTSIG_TAB_SIZE)
		{
			NdisGetSystemUpTime(&Now);
			pEntry->LastRefTime = Now;
			pEntry->Valid = TRUE;
			COPY_MAC_ADDR(pEntry->MeshSA, MeshSA);
			pTab->Size++;
		}
		else
		{
			pEntry = NULL;
			DBGPRINT(RT_DEBUG_ERROR, ("%s: pBMPktSigTab tab full.\n", __FUNCTION__));
		}

		/* add this Neighbor entry into HASH table */
		if (pEntry)
		{
			HashIdx = BMPKT_MAC_ADDR_HASH_INDEX(MeshSA);
			if (pTab->Hash[HashIdx] == NULL)
			{
				pTab->Hash[HashIdx] = pEntry;
			}
			else
			{
				pCurrEntry = pTab->Hash[HashIdx];
				while (pCurrEntry->pNext != NULL)
					pCurrEntry = pCurrEntry->pNext;
				pCurrEntry->pNext = pEntry;
			}
		}

//.........这里部分代码省略.........
开发者ID:vm3vuy,项目名称:my-local-repository,代码行数:101,代码来源:mesh_bmpkt.c



注:本文中的NdisGetSystemUpTime函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ NdisMoveMemory函数代码示例发布时间:2022-05-30
下一篇:
C++ NdisFreeMemory函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap