VOID MultiportRecordLastScanTime( IN PADAPTER pAdapter ) { u8Byte CurrTime = PlatformGetCurrentTime(); PADAPTER DefAdapter = GetDefaultAdapter(pAdapter); DefAdapter->LastScanCompleteTime = CurrTime; }
u8Byte ODM_GetCurrentTime( IN PDM_ODM_T pDM_Odm ) { #if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) return 0; #elif(DM_ODM_SUPPORT_TYPE & ODM_CE) return (u8Byte)rtw_get_current_time(); #elif(DM_ODM_SUPPORT_TYPE & ODM_WIN) return PlatformGetCurrentTime(); #endif }
u8Byte ODM_GetProgressingTime( IN PDM_ODM_T pDM_Odm, IN u8Byte Start_Time ) { #if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) return 0; #elif(DM_ODM_SUPPORT_TYPE & ODM_CE) return rtw_get_passing_time_ms((u4Byte)Start_Time); #elif(DM_ODM_SUPPORT_TYPE & ODM_WIN) return ((PlatformGetCurrentTime() - Start_Time)>>10); #endif }
// // Description: // Record the current scan complete time to all adapters. // Arguments: // [in] pAdapter - // One of adapter list. // Return: // None // Remark: // This function save the current time as the scan complete mark into each // adapter. // The input adapter can be any one of the adapter list. // By Bruce, 2012-03-02. // VOID MultiportRecordLastScanTime( IN PADAPTER pAdapter ) { PADAPTER pLoopAdapter = GetDefaultAdapter(pAdapter); u8Byte CurrTime = PlatformGetCurrentTime(); while(pLoopAdapter) { pLoopAdapter->LastScanCompleteTime = CurrTime; pLoopAdapter = GetNextExtAdapter(pLoopAdapter); } }
// // Description: // Add one log to corresponding pool. // VOID AddDrvLog( IN PADAPTER pAdapter, IN DRV_LOG_ID_E eLogId, IN pu1Byte pBuffer, IN u4Byte BufferLen ) { DRV_LOG_TYPE_E eLogType = (DRV_LOG_TYPE_E)g_LogAttributes[eLogId].Type; PDRV_LOG_POOL_T pLogPool = GET_DRV_LOG_POOL(pAdapter, eLogType); u8Byte CurrTime = PlatformGetCurrentTime(); u4Byte MaxLogCount = ((u4Byte)1 << g_LogTypes[eLogType].MaxLogCountPwr); u4Byte LogCountMask = MaxLogCount - 1; PDRV_LOG_DATA_IMP_T pLogData; PlatformAcquireSpinLock(pAdapter, RT_LOG_SPINLOCK); if( pLogPool->LogCountUsed < MaxLogCount ) { pLogData = pLogPool->pLogDataRing + ( (pLogPool->LogStartIndex + pLogPool->LogCountUsed) & LogCountMask ); pLogPool->LogCountUsed++; } else { // full! age out oldest one. pLogData = pLogPool->pLogDataRing + pLogPool->LogStartIndex; pLogPool->LogStartIndex = (pLogPool->LogStartIndex + 1) & LogCountMask; } pLogData->Id = eLogId; pLogData->BufferLenUsed = (BufferLen <= MAX_LOG_BUFFER_LEN) ? BufferLen: MAX_LOG_BUFFER_LEN; PlatformMoveMemory(pLogData->Buffer, pBuffer, pLogData->BufferLenUsed); pLogData->TimeStampLow = (u4Byte)CurrTime; pLogData->TimeStampHigh = (u4Byte)(CurrTime >> 32); PlatformReleaseSpinLock(pAdapter, RT_LOG_SPINLOCK); }
VOID Phydm_AdaptivityBSOD( IN PVOID pDM_VOID ) { PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; PADAPTER pAdapter = pDM_Odm->Adapter; PMGNT_INFO pMgntInfo = &(pAdapter->MgntInfo); u1Byte count = 0; u4Byte u4Value; /* 1. turn off RF (TRX Mux in standby mode) 2. H2C mac id drop 3. ignore EDCCA 4. wait for clear FIFO 5. don't ignore EDCCA 6. turn on RF (TRX Mux in TRx mdoe) 7. H2C mac id resume */ RT_TRACE(COMP_MLME, DBG_WARNING, ("MAC id drop packet!!!!!\n")); pAdapter->dropPktByMacIdCnt++; pMgntInfo->bDropPktInProgress = TRUE; pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_MAX_Q_PAGE_NUM, (pu1Byte)(&u4Value)); RT_TRACE(COMP_INIT, DBG_LOUD, ("Queue Reserved Page Number = 0x%08x\n", u4Value)); pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_AVBL_Q_PAGE_NUM, (pu1Byte)(&u4Value)); RT_TRACE(COMP_INIT, DBG_LOUD, ("Available Queue Page Number = 0x%08x\n", u4Value)); #if 1 //3 Standby mode Phydm_SetTRxMux(pDM_Odm, PhyDM_STANDBY_MODE, PhyDM_STANDBY_MODE); ODM_Write_DIG(pDM_Odm, 0x20); //3 H2C mac id drop MacIdIndicateDisconnect(pAdapter); //3 Ignore EDCCA Phydm_MACEDCCAState(pDM_Odm, PhyDM_IGNORE_EDCCA); delay_ms(50); count = 5; #else do { u8Byte diffTime, curTime, oldestTime; u1Byte queueIdx //3 Standby mode Phydm_SetTRxMux(pDM_Odm, PhyDM_STANDBY_MODE, PhyDM_STANDBY_MODE); ODM_Write_DIG(pDM_Odm, 0x20); //3 H2C mac id drop MacIdIndicateDisconnect(pAdapter); //3 Ignore EDCCA Phydm_MACEDCCAState(pDM_Odm, PhyDM_IGNORE_EDCCA); count++; delay_ms(10); // Check latest packet curTime = PlatformGetCurrentTime(); oldestTime = 0xFFFFFFFFFFFFFFFF; for(queueIdx = 0; queueIdx < MAX_TX_QUEUE; queueIdx++) { if(!IS_DATA_QUEUE(queueIdx)) continue; if(!pAdapter->bTcbBusyQEmpty[queueIdx]) { RT_TRACE(COMP_MLME, DBG_WARNING, ("oldestTime = %llu\n", oldestTime)); RT_TRACE(COMP_MLME, DBG_WARNING, ("Q[%d] = %llu\n", queueIdx, pAdapter->firstTcbSysTime[queueIdx])); if(pAdapter->firstTcbSysTime[queueIdx] < oldestTime) { oldestTime = pAdapter->firstTcbSysTime[queueIdx]; } } } diffTime = curTime - oldestTime; RT_TRACE(COMP_MLME, DBG_WARNING, ("diff s = %llu\n", (diffTime/1000000))); }while(((diffTime/1000000) >= 4) && (oldestTime != 0xFFFFFFFFFFFFFFFF)); #endif //3 Resume EDCCA Phydm_MACEDCCAState(pDM_Odm, PhyDM_DONT_IGNORE_EDCCA); //3 Turn on TRx mode Phydm_SetTRxMux(pDM_Odm, PhyDM_TX_MODE, PhyDM_RX_MODE); ODM_Write_DIG(pDM_Odm, 0x20); //3 Resume H2C macid MacIdRecoverMediaStatus(pAdapter); pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_AVBL_Q_PAGE_NUM, (pu1Byte)(&u4Value)); RT_TRACE(COMP_INIT, DBG_LOUD, ("Available Queue Page Number = 0x%08x\n", u4Value)); pMgntInfo->bDropPktInProgress = FALSE; RT_TRACE(COMP_MLME, DBG_WARNING, ("End of MAC id drop packet, spent %dms\n", count*10)); }