Esempio n. 1
0
VOID
HALBT_DownloadRsvdPageForBt(
	IN	PADAPTER	Adapter
	)
{
	if(BT_1Ant(Adapter))
	{
		HalDownloadRsvdPage(Adapter, FALSE);
	}
}
CHANNEL_WIDTH
CHNL_CheckChnlPlanWithBW(
	IN	PADAPTER			pAdapter,
	IN	u1Byte				PrimaryChnl,	
	IN	CHANNEL_WIDTH		Bandwidth,	
	IN	EXTCHNL_OFFSET		BwOffset	
)
{
	CHANNEL_WIDTH finalBw = CHANNEL_WIDTH_20;
	PRT_CHANNEL_LIST	pChanneList = NULL;
	u2Byte				i;
	u1Byte				CentralChnl=PrimaryChnl;
	u1Byte				anotherPrimaryChnl=PrimaryChnl;
	u1Byte				findcnt=0;
	BOOLEAN				bFind=FALSE;



	if(Bandwidth == CHANNEL_WIDTH_40)
	{
		if(BwOffset == EXTCHNL_OFFSET_UPPER)
		{
			CentralChnl = PrimaryChnl + 2;
			anotherPrimaryChnl = CentralChnl+2;
		}
		else
		{
			CentralChnl = PrimaryChnl - 2;
			anotherPrimaryChnl = CentralChnl-2;
		}
	}


	RtActChannelList(pAdapter, RT_CHNL_LIST_ACTION_GET_CHANNEL_LIST, NULL, &pChanneList);

	if(PrimaryChnl>13)
	{
		if(!(pChanneList->WirelessMode & (WIRELESS_MODE_A|WIRELESS_MODE_AC_5G|WIRELESS_MODE_N_5G)))
		{
			finalBw =  Bandwidth;
			return finalBw;
		}
	}
	else
	{
		if(!(pChanneList->WirelessMode & (WIRELESS_MODE_B|WIRELESS_MODE_N_24G|WIRELESS_MODE_G|WIRELESS_MODE_AC_24G)))
		{
			finalBw =  Bandwidth;
			return finalBw;
		}
	}

	for(i=0;i<pChanneList->ChannelLen;i++)
	{
		if((anotherPrimaryChnl == pChanneList->ChnlListEntry[i].ChannelNum) ||
			(PrimaryChnl == pChanneList->ChnlListEntry[i].ChannelNum))
		{
			findcnt++;
		}

		if(findcnt==2)
		{
			bFind =TRUE;
			findcnt =0;
			break;			
		}
	}

	if(Bandwidth == CHANNEL_WIDTH_80)
		finalBw = CHANNEL_WIDTH_80;
	else
	{
		// remove, advised by Bryant, this will cause IOT issue with TP link Ap
		// TP link will be 40MHz, but NIC is 20MHz => problem.
#if 0	
		if( BT_1Ant(pAdapter) && BT_IsBtLinkExist(pAdapter) &&
			IS_WIRELESS_MODE_24G(pAdapter) )
		{
			finalBw = CHANNEL_WIDTH_20;
		}
		else
#endif
		{
			if(bFind)
				finalBw = CHANNEL_WIDTH_40;
			else 
				finalBw = CHANNEL_WIDTH_20;
		}
	}			

	return finalBw;
}