VOID APDetectOverlappingExec( IN PVOID SystemSpecific1, IN PVOID FunctionContext, IN PVOID SystemSpecific2, IN PVOID SystemSpecific3) { #ifdef DOT11_N_SUPPORT PRTMP_ADAPTER pAd = (RTMP_ADAPTER *)FunctionContext; if (DetectOverlappingPeriodicRound == 0) { /* switch back 20/40 */ if ((pAd->CommonCfg.Channel <=14) && (pAd->CommonCfg.HtCapability.HtCapInfo.ChannelWidth == BW_40)) { pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth = 1; pAd->CommonCfg.AddHTInfo.AddHtInfo.ExtChanOffset = pAd->CommonCfg.RegTransmitSetting.field.EXTCHA; } } else { if ((DetectOverlappingPeriodicRound == 25) || (DetectOverlappingPeriodicRound == 1)) { if ((pAd->CommonCfg.Channel <=14) && (pAd->CommonCfg.HtCapability.HtCapInfo.ChannelWidth==BW_40)) { SendBeaconRequest(pAd, 1); SendBeaconRequest(pAd, 2); SendBeaconRequest(pAd, 3); } } DetectOverlappingPeriodicRound--; } #endif /* DOT11_N_SUPPORT */ }
void Mac::HandleBeginTransmit(void) { ThreadError error = kThreadError_None; if (otPlatRadioIdle() != kThreadError_None) { mBeginTransmit.Post(); ExitNow(); } switch (mState) { case kStateActiveScan: mSendFrame.SetChannel(mScanChannel); SendBeaconRequest(mSendFrame); mSendFrame.SetSequence(0); break; case kStateTransmitBeacon: mSendFrame.SetChannel(mChannel); SendBeacon(mSendFrame); mSendFrame.SetSequence(mBeaconSequence++); break; case kStateTransmitData: mSendFrame.SetChannel(mChannel); SuccessOrExit(error = mSendHead->HandleFrameRequest(mSendFrame)); mSendFrame.SetSequence(mDataSequence); break; default: assert(false); break; } // Security Processing ProcessTransmitSecurity(); SuccessOrExit(error = otPlatRadioTransmit(&mSendFrame)); if (mSendFrame.GetAckRequest() && !(otPlatRadioGetCaps() & kRadioCapsAckTimeout)) { mAckTimer.Start(kAckTimeout); otLogDebgMac("ack timer start\n"); } exit: if (error != kThreadError_None) { assert(false); } }