/* ======================================================================== Routine Description: Bbp Radar detection routine Arguments: pAd Pointer to our adapter Return Value: ======================================================================== */ VOID BbpRadarDetectionStart( IN PRTMP_ADAPTER pAd) { UINT8 RadarPeriod; RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 114, 0x02); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 121, 0x20); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 122, 0x00); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 123, 0x08/*0x80*/); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 124, 0x28); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 125, 0xff); #ifdef MERGE_ARCH_TEAM if ((pAd->CommonCfg.RadarDetect.RDDurRegion == JAP) || (pAd->CommonCfg.RadarDetect.RDDurRegion == JAP_W53) || (pAd->CommonCfg.RadarDetect.RDDurRegion == JAP_W56)) { pAd->CommonCfg.RadarDetect.RDDurRegion = JAP; pAd->CommonCfg.RadarDetect.RDDurRegion = JapRadarType(pAd); if (pAd->CommonCfg.RadarDetect.RDDurRegion == JAP_W56) { pAd->CommonCfg.RadarDetect.DfsSessionTime = 13; } else if (pAd->CommonCfg.RadarDetect.RDDurRegion == JAP_W53) { pAd->CommonCfg.RadarDetect.DfsSessionTime = 15; } #ifdef CARRIER_DETECTION_SUPPORT pAd->CommonCfg.CarrierDetect.Enable = 1; #endif // CARRIER_DETECTION_SUPPORT // } #endif // MERGE_ARCH_TEAM // #if 0 // toggle Rx enable bit for radar detection. // it's Andy's recommand. { UINT32 Value; RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value); Value |= (0x1 << 3); RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value); Value &= ~(0x1 << 3); RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value); } #endif RadarPeriod = ((UINT)RdIdleTimeTable[pAd->CommonCfg.RadarDetect.RDDurRegion][0] + (UINT)pAd->CommonCfg.RadarDetect.DfsSessionTime) < 250 ? (RdIdleTimeTable[pAd->CommonCfg.RadarDetect.RDDurRegion][0] + pAd->CommonCfg.RadarDetect.DfsSessionTime) : 250; #ifdef MERGE_ARCH_TEAM #else // Original RT28xx source code. RTMP_IO_WRITE8(pAd, 0x7020, 0x1d); RTMP_IO_WRITE8(pAd, 0x7021, 0x40); #endif // MERGE_ARCH_TEAM // RadarDetectionStart(pAd, 0, RadarPeriod); return; }
/* ======================================================================== Routine Description: Bbp Radar detection routine Arguments: pAd Pointer to our adapter Return Value: ======================================================================== */ VOID BbpRadarDetectionStart( IN PRTMP_ADAPTER pAd) { UINT8 RadarPeriod; RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 114, 0x02); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 121, 0x20); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 122, 0x00); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 123, 0x08/*0x80*/); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 124, 0x28); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 125, 0xff); #ifdef MERGE_ARCH_TEAM if ((pAd->CommonCfg.RadarDetect.RDDurRegion == JAP) || (pAd->CommonCfg.RadarDetect.RDDurRegion == JAP_W53) || (pAd->CommonCfg.RadarDetect.RDDurRegion == JAP_W56)) { pAd->CommonCfg.RadarDetect.RDDurRegion = JAP; pAd->CommonCfg.RadarDetect.RDDurRegion = JapRadarType(pAd); if (pAd->CommonCfg.RadarDetect.RDDurRegion == JAP_W56) { pAd->CommonCfg.RadarDetect.DfsSessionTime = 13; } else if (pAd->CommonCfg.RadarDetect.RDDurRegion == JAP_W53) { pAd->CommonCfg.RadarDetect.DfsSessionTime = 15; } #ifdef CARRIER_DETECTION_SUPPORT pAd->CommonCfg.CarrierDetect.Enable = 1; #endif // CARRIER_DETECTION_SUPPORT // } #endif // MERGE_ARCH_TEAM // RadarPeriod = ((UINT)RdIdleTimeTable[pAd->CommonCfg.RadarDetect.RDDurRegion][0] + (UINT)pAd->CommonCfg.RadarDetect.DfsSessionTime) < 250 ? (RdIdleTimeTable[pAd->CommonCfg.RadarDetect.RDDurRegion][0] + pAd->CommonCfg.RadarDetect.DfsSessionTime) : 250; #ifdef MERGE_ARCH_TEAM #ifdef CONFIG_AP_SUPPORT #ifdef CARRIER_DETECTION_SUPPORT if (pAd->CommonCfg.CarrierDetect.Enable == TRUE) { // make sure CarrierDetect wont send CTS CARRIER_DETECT_STOP(pAd); } #endif // CARRIER_DETECTION_SUPPORT // #endif // CONFIG_AP_SUPPORT // #else // Original RT28xx source code. RTMP_IO_WRITE8(pAd, 0x7020, 0x1d); RTMP_IO_WRITE8(pAd, 0x7021, 0x40); #endif // MERGE_ARCH_TEAM // RadarDetectionStart(pAd, 0, RadarPeriod); return; }
VOID RTMPHandleMcuInterrupt( IN PRTMP_ADAPTER pAd) { UINT32 McuIntSrc = 0; RTMP_IO_READ32(pAd, 0x7024, &McuIntSrc); // clear MCU Int source register. RTMP_IO_WRITE32(pAd, 0x7024, 0); #ifdef DFS_SUPPORT #ifdef DFS_SOFTWARE_SUPPORT if (pAd->CommonCfg.bIEEE80211H) { POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; // pulse radar signal Int. if (McuIntSrc & 0x40) { tasklet_hi_schedule(&pObj->pulse_radar_detect_task); } // width radar signal Int. if(((pAd->CommonCfg.RadarDetect.RDDurRegion == FCC) || (pAd->CommonCfg.RadarDetect.RDDurRegion == JAP_W56)) && (McuIntSrc & 0x80)) { tasklet_hi_schedule(&pObj->width_radar_detect_task); } // long pulse radar signal detection. if(((pAd->CommonCfg.RadarDetect.RDDurRegion == FCC) || (pAd->CommonCfg.RadarDetect.RDDurRegion == JAP_W56) || (JapRadarType(pAd) == JAP_W56)) && (McuIntSrc & 0x10)) { tasklet_hi_schedule(&pObj->width_radar_detect_task); } } #endif // DFS_SOFTWARE_SUPPORT // #endif // DFS_SUPPORT // #ifdef CARRIER_DETECTION_SUPPORT if ((pAd->CommonCfg.CarrierDetect.Enable) && (McuIntSrc & 0x04)) { POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; tasklet_hi_schedule(&pObj->carrier_sense_task); } #endif // CARRIER_DETECTION_SUPPORT // }
/* ======================================================================== Routine Description: Radar detection routine Arguments: pAd Pointer to our adapter Return Value: ======================================================================== */ VOID RadarDetectionStart( IN PRTMP_ADAPTER pAd, IN BOOLEAN CTSProtect, IN UINT8 CTSPeriod) { UINT8 DfsActiveTime = (pAd->CommonCfg.RadarDetect.DfsSessionTime & 0x1f); UINT8 CtsProtect = (CTSProtect == 1) ? 0x02 : 0x01; /* CTS protect.*/ if (CTSProtect != 0) { switch(pAd->CommonCfg.RadarDetect.RDDurRegion) { case FCC: case JAP_W56: CtsProtect = 0x03; break; case JAP: { UCHAR RDDurRegion; RDDurRegion = JapRadarType(pAd); if (RDDurRegion == JAP_W56) CtsProtect = 0x03; else CtsProtect = 0x02; break; } case CE: case JAP_W53: default: CtsProtect = 0x02; break; } } else CtsProtect = 0x01; /* send start-RD with CTS protection command to MCU*/ /* highbyte [7] reserve*/ /* highbyte [6:5] 0x: stop Carrier/Radar detection*/ /* highbyte [10]: Start Carrier/Radar detection without CTS protection, 11: Start Carrier/Radar detection with CTS protection*/ /* highbyte [4:0] Radar/carrier detection duration. In 1ms.*/ /* lowbyte [7:0] Radar/carrier detection period, in 1ms.*/ AsicSendCommandToMcu(pAd, 0x60, 0xff, CTSPeriod, DfsActiveTime | (CtsProtect << 5)); /*AsicSendCommandToMcu(pAd, 0x63, 0xff, 10, 0);*/ return; }
/* ======================================================================== Routine Description: Bbp Radar detection routine Arguments: pAd Pointer to our adapter Return Value: ======================================================================== */ VOID BbpRadarDetectionStart( IN PRTMP_ADAPTER pAd) { UINT8 RadarPeriod; if (pAd->CommonCfg.dfs_func >= HARDWARE_DFS_V1) { return; } RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 114, 0x02); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 121, 0x20); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 122, 0x00); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 123, 0x08/*0x80*/); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 124, 0x28); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 125, 0xff); #ifdef RTMP_RBUS_SUPPORT if ((pAd->CommonCfg.RadarDetect.RDDurRegion == JAP) || (pAd->CommonCfg.RadarDetect.RDDurRegion == JAP_W53) || (pAd->CommonCfg.RadarDetect.RDDurRegion == JAP_W56)) { pAd->CommonCfg.RadarDetect.RDDurRegion = JAP; pAd->CommonCfg.RadarDetect.RDDurRegion = JapRadarType(pAd); if (pAd->CommonCfg.RadarDetect.RDDurRegion == JAP_W56) { pAd->CommonCfg.RadarDetect.DfsSessionTime = 13; } else if (pAd->CommonCfg.RadarDetect.RDDurRegion == JAP_W53) { pAd->CommonCfg.RadarDetect.DfsSessionTime = 15; } } #endif /* RTMP_RBUS_SUPPORT */ RadarPeriod = ((UINT)RdIdleTimeTable[pAd->CommonCfg.RadarDetect.RDDurRegion][0] + (UINT)pAd->CommonCfg.RadarDetect.DfsSessionTime) < 250 ? (RdIdleTimeTable[pAd->CommonCfg.RadarDetect.RDDurRegion][0] + pAd->CommonCfg.RadarDetect.DfsSessionTime) : 250; #ifdef RTMP_RBUS_SUPPORT #ifdef RT2880 pAd->CommonCfg.R65 = 0x1d; pAd->CommonCfg.R66 = 0x60; #endif /* RT2880 */ #ifdef CONFIG_AP_SUPPORT #ifdef CARRIER_DETECTION_SUPPORT if (pAd->CommonCfg.CarrierDetect.Enable == TRUE) { /* make sure CarrierDetect wont send CTS*/ CARRIER_DETECT_STOP(pAd); } #endif /* CARRIER_DETECTION_SUPPORT */ #endif /* CONFIG_AP_SUPPORT */ #else /* Original RT28xx source code.*/ RTMP_IO_WRITE8(pAd, 0x7020, 0x1d); RTMP_IO_WRITE8(pAd, 0x7021, 0x40); #endif /* RTMP_RBUS_SUPPORT */ RadarDetectionStart(pAd, 0, RadarPeriod); return; }