/* ======================================================================== Routine Description: Initialize ASIC Channel Busy Calculation mechanism. Arguments: pAd - WLAN control block pointer Return Value: None Note: Init Condition: WMM must be enabled. ======================================================================== */ VOID QBSS_LoadInit( IN RTMP_ADAPTER *pAd) { UINT32 IdBss; /* check whether any BSS enables WMM feature */ for(IdBss=0; IdBss<pAd->ApCfg.BssidNum; IdBss++) { if ((pAd->ApCfg.MBSSID[IdBss].bWmmCapable) ) { pAd->FlgQloadEnable = TRUE; break; } /* End of if */ } /* End of for */ if (pAd->FlgQloadEnable == TRUE) { /* Count EIFS, NAV, RX busy, TX busy as channel busy and enable Channel statistic timer (bit 0) */ /* Note: if bit 0 == 0, the function will be disabled */ RTMP_IO_WRITE32(pAd, CH_TIME_CFG, 0x0000001F); /* default value is 50, please reference to IEEE802.11e 2005 Annex D */ pAd->QloadChanUtilBeaconInt = 50; } else { /* no any WMM is enabled */ RTMP_IO_WRITE32(pAd, CH_TIME_CFG, 0x00000000); } /* End of if */ pAd->QloadChanUtilTotal = 0; pAd->QloadUpTimeLast = 0; #ifdef QLOAD_FUNC_BUSY_TIME_STATS /* clear busy time statistics */ NdisZeroMemory(pAd->QloadBusyCountPri, sizeof(pAd->QloadBusyCountPri)); NdisZeroMemory(pAd->QloadBusyCountSec, sizeof(pAd->QloadBusyCountSec)); #endif /* QLOAD_FUNC_BUSY_TIME_STATS */ #ifdef QLOAD_FUNC_BUSY_TIME_ALARM /* init threshold before QBSS_LoadAlarmReset */ pAd->QloadAlarmBusyTimeThreshold = QBSS_LOAD_ALRAM_BUSY_TIME_THRESHOLD; pAd->QloadAlarmBusyNumThreshold = QBSS_LOAD_ALRAM_BUSY_NUM_THRESHOLD; QBSS_LoadAlarmReset(pAd); #endif /* QLOAD_FUNC_BUSY_TIME_ALARM */ } /* End of QBSS_LoadInit */
/* ======================================================================== Routine Description: Initialize ASIC Channel Busy Calculation mechanism. Arguments: pAd - WLAN control block pointer Return Value: None Note: Init Condition: WMM must be enabled. ======================================================================== */ VOID QBSS_LoadInit( IN struct rtmp_adapter *pAd) { uint32_t IdBss; /* check whether any BSS enables WMM feature */ for(IdBss=0; IdBss<pAd->ApCfg.BssidNum; IdBss++) { if ((pAd->ApCfg.MBSSID[IdBss].wdev.bWmmCapable) ) { pAd->FlgQloadEnable = true; break; } } if (pAd->FlgQloadEnable == true) { /* Count EIFS, NAV, RX busy, TX busy as channel busy and enable Channel statistic timer (bit 0) */ /* Note: if bit 0 == 0, the function will be disabled */ mt76u_reg_write(pAd, CH_TIME_CFG, 0x0000001F); /* default value is 50, please reference to IEEE802.11e 2005 Annex D */ pAd->QloadChanUtilBeaconInt = 50; } else { /* no any WMM is enabled */ mt76u_reg_write(pAd, CH_TIME_CFG, 0x00000000); } pAd->QloadChanUtilTotal = 0; pAd->QloadUpTimeLast = 0; #ifdef QLOAD_FUNC_BUSY_TIME_STATS /* clear busy time statistics */ memset(pAd->QloadBusyCountPri, 0, sizeof(pAd->QloadBusyCountPri)); memset(pAd->QloadBusyCountSec, 0, sizeof(pAd->QloadBusyCountSec)); #endif /* QLOAD_FUNC_BUSY_TIME_STATS */ #ifdef QLOAD_FUNC_BUSY_TIME_ALARM /* init threshold before QBSS_LoadAlarmReset */ pAd->QloadAlarmBusyTimeThreshold = QBSS_LOAD_ALRAM_BUSY_TIME_THRESHOLD; pAd->QloadAlarmBusyNumThreshold = QBSS_LOAD_ALRAM_BUSY_NUM_THRESHOLD; QBSS_LoadAlarmReset(pAd); #endif /* QLOAD_FUNC_BUSY_TIME_ALARM */ }
/* ======================================================================== Routine Description: Initialize ASIC Channel Busy Calculation mechanism. Arguments: pAd - WLAN control block pointer Return Value: None Note: Init Condition: WMM must be enabled. ======================================================================== */ VOID QBSS_LoadInit(RTMP_ADAPTER *pAd) { UINT32 IdBss; /* check whether any BSS enables WMM feature */ for(IdBss=0; IdBss<pAd->ApCfg.BssidNum; IdBss++) { if ((pAd->ApCfg.MBSSID[IdBss].wdev.bWmmCapable) ) { pAd->phy_ctrl.FlgQloadEnable = TRUE; break; } } if (pAd->phy_ctrl.FlgQloadEnable == TRUE) { /* default value is 50, please reference to IEEE802.11e 2005 Annex D */ pAd->phy_ctrl.QloadChanUtilBeaconInt = 50; } AsicSetChBusyStat(pAd, pAd->phy_ctrl.FlgQloadEnable); pAd->phy_ctrl.QloadChanUtilTotal = 0; pAd->phy_ctrl.QloadUpTimeLast = 0; #ifdef QLOAD_FUNC_BUSY_TIME_STATS /* clear busy time statistics */ NdisZeroMemory(pAd->phy_ctrl.QloadBusyCountPri, sizeof(pAd->phy_ctrl.QloadBusyCountPri)); NdisZeroMemory(pAd->phy_ctrl.QloadBusyCountSec, sizeof(pAd->phy_ctrl.QloadBusyCountSec)); #endif /* QLOAD_FUNC_BUSY_TIME_STATS */ #ifdef QLOAD_FUNC_BUSY_TIME_ALARM /* init threshold before QBSS_LoadAlarmReset */ pAd->phy_ctrl.QloadAlarmBusyTimeThreshold = QBSS_LOAD_ALRAM_BUSY_TIME_THRESHOLD; pAd->phy_ctrl.QloadAlarmBusyNumThreshold = QBSS_LOAD_ALRAM_BUSY_NUM_THRESHOLD; QBSS_LoadAlarmReset(pAd); #endif /* QLOAD_FUNC_BUSY_TIME_ALARM */ }