Exemple #1
0
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);
        }
    }
}
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);
		}
	}
}