UINT8 NICGetBandSupported(RTMP_ADAPTER *pAd)
{
	if (BOARD_IS_5G_ONLY(pAd))
	{
		return RFIC_5GHZ;
	}
	else if (BOARD_IS_2G_ONLY(pAd))
	{
		return RFIC_24GHZ;
	}
	else if (RFIC_IS_5G_BAND(pAd))
	{
		return RFIC_DUAL_BAND;
	}
	else
		return RFIC_24GHZ;
}
Exemple #2
0
/* 
    ==========================================================================
    Description:
        Set Wireless Mode
    Return:
        TRUE if all parameters are OK, FALSE otherwise
    ==========================================================================
*/
INT RT_CfgSetWirelessMode(
	IN	PRTMP_ADAPTER	pAd, 
	IN	PSTRING			arg)
{
	INT		MaxPhyMode = PHY_11G;
	LONG	WirelessMode;
	
#ifdef DOT11_N_SUPPORT
	if (!RTMP_TEST_MORE_FLAG(pAd, fRTMP_ADAPTER_DISABLE_DOT_11N))
		MaxPhyMode = PHY_11N_5G;
#endif /* DOT11_N_SUPPORT */

	WirelessMode = simple_strtol(arg, 0, 10);

	/* check if chip support 5G band when WirelessMode is 5G band */
	if (PHY_MODE_IS_5G_BAND(WirelessMode))
	{
		if (!RFIC_IS_5G_BAND(pAd))
		{
			DBGPRINT(RT_DEBUG_ERROR,
					("phy mode> Error! The chip does not support 5G band %d!\n",
					pAd->RfIcType));
			return FALSE;
		}
	}

	if (WirelessMode <= MaxPhyMode)
	{
		pAd->CommonCfg.PhyMode = WirelessMode;
		pAd->CommonCfg.DesiredPhyMode = WirelessMode;
		return TRUE;
	}
	
	return FALSE;
	
}
Exemple #3
0
/* 
    ==========================================================================
    Description:
        Set Wireless Mode for MBSS
    Return:
        TRUE if all parameters are OK, FALSE otherwise
    ==========================================================================
*/
INT RT_CfgSetMbssWirelessMode(
	IN	PRTMP_ADAPTER	pAd, 
	IN	PSTRING			arg)
{
	UINT32	MaxPhyMode = PHY_11G;
	UINT32	WirelessMode;
	
#ifdef DOT11_N_SUPPORT
	if (!RTMP_TEST_MORE_FLAG(pAd, fRTMP_ADAPTER_DISABLE_DOT_11N))
		MaxPhyMode = PHY_11N_5G;
#endif /* DOT11_N_SUPPORT */

	WirelessMode = simple_strtol(arg, 0, 10);

	if ((WirelessMode == PHY_11ABG_MIXED)
#ifdef DOT11_N_SUPPORT
		|| (WirelessMode == PHY_11ABGN_MIXED)
		|| (WirelessMode == PHY_11AGN_MIXED)
#endif /* DOT11_N_SUPPORT */
		)
	{
		DBGPRINT(RT_DEBUG_ERROR, ("mbss> Wrong phy mode for AP!\n"));
		return FALSE;
	}

	/* check if chip support 5G band when WirelessMode is 5G band */
	if (PHY_MODE_IS_5G_BAND(WirelessMode))
	{
		if (!RFIC_IS_5G_BAND(pAd))
		{
			DBGPRINT(RT_DEBUG_ERROR,
					("phy mode> Error! The chip does not support 5G band!\n"));
			return FALSE;
		}
	}

	if (WirelessMode <= MaxPhyMode)
	{
		if (pAd->ApCfg.BssidNum > 1)
		{
			/* pAd->CommonCfg.PhyMode = maximum capability of all MBSS */
			if (RT_CfgMbssWirelessModeSameBand(pAd, WirelessMode) == TRUE)
			{
				WirelessMode = RT_CfgMbssWirelessModeMaxGet(pAd);

				DBGPRINT(RT_DEBUG_TRACE,
						("mbss> Maximum phy mode = %d!\n", WirelessMode));
			}
			else
			{
				UINT32 IdBss;

				/* replace all phy mode with the one with different band */
				DBGPRINT(RT_DEBUG_TRACE,
						("mbss> Different band with the current one!\n"));
				DBGPRINT(RT_DEBUG_TRACE,
						("mbss> Reset band of all BSS to the new one!\n"));

				for(IdBss=0; IdBss<pAd->ApCfg.BssidNum; IdBss++)
					pAd->ApCfg.MBSSID[IdBss].PhyMode = WirelessMode;
			}
		}

		pAd->CommonCfg.PhyMode = WirelessMode;
		pAd->CommonCfg.DesiredPhyMode = WirelessMode;
		return TRUE;
	}
	
	return FALSE;
}