VOID BuildBeaconChList( IN PRTMP_ADAPTER pAd, OUT PUCHAR pBuf, OUT PULONG pBufLen) { INT i; ULONG TmpLen; PCH_REGION pChRegion; PCH_DESP pChDesp; UCHAR ChType; pChRegion = GetChRegion(pAd->CommonCfg.CountryCode); if (pChRegion == NULL) return; ChBandCheck(pAd->CommonCfg.PhyMode, &ChType); *pBufLen = 0; for (i=0; i<10; i++) { pChDesp = &pChRegion->ChDesp[i]; if (pChDesp->FirstChannel == 0) break; if (ChType == BAND_5G) { if (pChDesp->FirstChannel <= 14) continue; } else if (ChType == BAND_24G) { if (pChDesp->FirstChannel > 14) continue; } if ((pChDesp->Geography == BOTH) || (pChDesp->Geography == pAd->CommonCfg.Geography)) { MakeOutgoingFrame(pBuf + *pBufLen, &TmpLen, 1, &pChDesp->FirstChannel, 1, &pChDesp->NumOfCh, 1, &pChDesp->MaxTxPwr, END_OF_ARGS); *pBufLen += TmpLen; } } }
static inline VOID CreateChList( IN PRTMP_ADAPTER pAd, IN PCH_REGION pChRegion, IN UCHAR Geography) { INT i; UCHAR offset = 0; PCH_DESP pChDesp; UCHAR ChType; UCHAR increment; UCHAR regulatoryDomain; if (pChRegion == NULL) return; ChBandCheck(pAd->CommonCfg.PhyMode, &ChType); for (i=0; i<10; i++) { pChDesp = &pChRegion->ChDesp[i]; if (pChDesp->FirstChannel == 0) break; if (ChType == BAND_5G) { if (pChDesp->FirstChannel <= 14) continue; } else if (ChType == BAND_24G) { if (pChDesp->FirstChannel > 14) continue; } if ((pChDesp->Geography == BOTH) || (Geography == BOTH) || (pChDesp->Geography == Geography)) { if (pChDesp->FirstChannel > 14) increment = 4; else increment = 1; regulatoryDomain = pChRegion->DfsType; offset = FillChList(pAd, pChDesp, offset, increment, regulatoryDomain); } } }
void BuildBeaconChList(struct rt_rtmp_adapter *pAd, u8 *pBuf, unsigned long *pBufLen) { int i; unsigned long TmpLen; struct rt_ch_region *pChRegion; struct rt_ch_desp *pChDesp; u8 ChType; pChRegion = GetChRegion(pAd->CommonCfg.CountryCode); if (pChRegion == NULL) return; ChBandCheck(pAd->CommonCfg.PhyMode, &ChType); *pBufLen = 0; for (i = 0; i < 10; i++) { pChDesp = &pChRegion->ChDesp[i]; if (pChDesp->FirstChannel == 0) break; if (ChType == BAND_5G) { if (pChDesp->FirstChannel <= 14) continue; } else if (ChType == BAND_24G) { if (pChDesp->FirstChannel > 14) continue; } if ((pChDesp->Geography == BOTH) || (pChDesp->Geography == pAd->CommonCfg.Geography)) { MakeOutgoingFrame(pBuf + *pBufLen, &TmpLen, 1, &pChDesp->FirstChannel, 1, &pChDesp->NumOfCh, 1, &pChDesp->MaxTxPwr, END_OF_ARGS); *pBufLen += TmpLen; } } }
static inline void CreateChList(struct rt_rtmp_adapter *pAd, struct rt_ch_region *pChRegion, u8 Geography) { int i; u8 offset = 0; struct rt_ch_desp *pChDesp; u8 ChType; u8 increment; if (pChRegion == NULL) return; ChBandCheck(pAd->CommonCfg.PhyMode, &ChType); for (i = 0; i < 10; i++) { pChDesp = &pChRegion->ChDesp[i]; if (pChDesp->FirstChannel == 0) break; if (ChType == BAND_5G) { if (pChDesp->FirstChannel <= 14) continue; } else if (ChType == BAND_24G) { if (pChDesp->FirstChannel > 14) continue; } if ((pChDesp->Geography == BOTH) || (pChDesp->Geography == Geography)) { if (pChDesp->FirstChannel > 14) increment = 4; else increment = 1; offset = FillChList(pAd, pChDesp, offset, increment); } } }