⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmm_info.c

📁 ralink 2870 usb无线网卡 最新驱动
💻 C
📖 第 1 页 / 共 5 页
字号:
	if (success == TRUE)		DBGPRINT(RT_DEBUG_TRACE, ("Set_Channel_Proc::(Channel=%d)\n", pAd->CommonCfg.Channel));	return success;}/*     ==========================================================================    Description:        Set Short Slot Time Enable or Disable    Return:        TRUE if all parameters are OK, FALSE otherwise    ==========================================================================*/INT	Set_ShortSlot_Proc(	IN	PRTMP_ADAPTER	pAd, 	IN	PSTRING			arg){	int retval;		retval = RT_CfgSetShortSlot(pAd, arg);	if (retval == TRUE)		DBGPRINT(RT_DEBUG_TRACE, ("Set_ShortSlot_Proc::(ShortSlot=%d)\n", pAd->CommonCfg.bUseShortSlotTime));	return retval;}/*     ==========================================================================    Description:        Set Tx power    Return:        TRUE if all parameters are OK, FALSE otherwise    ==========================================================================*/INT	Set_TxPower_Proc(	IN	PRTMP_ADAPTER	pAd, 	IN	PSTRING			arg){	LONG TxPower;	INT   success = FALSE;	TxPower = simple_strtol(arg, 0, 10);	if (TxPower <= 100)	{#ifdef CONFIG_STA_SUPPORT		IF_DEV_CONFIG_OPMODE_ON_STA(pAd)		{			pAd->CommonCfg.TxPowerDefault = TxPower;			pAd->CommonCfg.TxPowerPercentage = pAd->CommonCfg.TxPowerDefault;		}#endif // CONFIG_STA_SUPPORT //		success = TRUE;	}	else		success = FALSE;	DBGPRINT(RT_DEBUG_TRACE, ("Set_TxPower_Proc::(TxPowerPercentage=%ld)\n", pAd->CommonCfg.TxPowerPercentage));	return success;}/*     ==========================================================================    Description:        Set 11B/11G Protection    Return:        TRUE if all parameters are OK, FALSE otherwise    ==========================================================================*/INT	Set_BGProtection_Proc(	IN	PRTMP_ADAPTER	pAd, 	IN	PSTRING			arg){	switch (simple_strtol(arg, 0, 10))	{		case 0: //AUTO			pAd->CommonCfg.UseBGProtection = 0;			break;		case 1: //Always On			pAd->CommonCfg.UseBGProtection = 1;			break;		case 2: //Always OFF			pAd->CommonCfg.UseBGProtection = 2;			break;				default:  //Invalid argument 			return FALSE;	}	DBGPRINT(RT_DEBUG_TRACE, ("Set_BGProtection_Proc::(BGProtection=%ld)\n", pAd->CommonCfg.UseBGProtection));		return TRUE;}/*     ==========================================================================    Description:        Set TxPreamble    Return:        TRUE if all parameters are OK, FALSE otherwise    ==========================================================================*/INT	Set_TxPreamble_Proc(	IN	PRTMP_ADAPTER	pAd, 	IN	PSTRING			arg){	RT_802_11_PREAMBLE	Preamble;	Preamble = simple_strtol(arg, 0, 10);	switch (Preamble)	{		case Rt802_11PreambleShort:			pAd->CommonCfg.TxPreamble = Preamble;#ifdef CONFIG_STA_SUPPORT			IF_DEV_CONFIG_OPMODE_ON_STA(pAd)				MlmeSetTxPreamble(pAd, Rt802_11PreambleShort);#endif // CONFIG_STA_SUPPORT //			break;		case Rt802_11PreambleLong:#ifdef CONFIG_STA_SUPPORT		case Rt802_11PreambleAuto:			// if user wants AUTO, initialize to LONG here, then change according to AP's			// capability upon association.#endif // CONFIG_STA_SUPPORT //			pAd->CommonCfg.TxPreamble = Preamble;#ifdef CONFIG_STA_SUPPORT			IF_DEV_CONFIG_OPMODE_ON_STA(pAd)				MlmeSetTxPreamble(pAd, Rt802_11PreambleLong);#endif // CONFIG_STA_SUPPORT //			break;		default: //Invalid argument 			return FALSE;	}	DBGPRINT(RT_DEBUG_TRACE, ("Set_TxPreamble_Proc::(TxPreamble=%ld)\n", pAd->CommonCfg.TxPreamble));	return TRUE;}/*     ==========================================================================    Description:        Set RTS Threshold    Return:        TRUE if all parameters are OK, FALSE otherwise    ==========================================================================*/INT	Set_RTSThreshold_Proc(	IN	PRTMP_ADAPTER	pAd, 	IN	PSTRING			arg){	 NDIS_802_11_RTS_THRESHOLD           RtsThresh;	RtsThresh = simple_strtol(arg, 0, 10);	if((RtsThresh > 0) && (RtsThresh <= MAX_RTS_THRESHOLD))		pAd->CommonCfg.RtsThreshold  = (USHORT)RtsThresh;#ifdef CONFIG_STA_SUPPORT	else if (RtsThresh == 0)		pAd->CommonCfg.RtsThreshold = MAX_RTS_THRESHOLD;#endif // CONFIG_STA_SUPPORT //	else		return FALSE; //Invalid argument 	DBGPRINT(RT_DEBUG_TRACE, ("Set_RTSThreshold_Proc::(RTSThreshold=%d)\n", pAd->CommonCfg.RtsThreshold));	return TRUE;}/*     ==========================================================================    Description:        Set Fragment Threshold    Return:        TRUE if all parameters are OK, FALSE otherwise    ==========================================================================*/INT	Set_FragThreshold_Proc(	IN	PRTMP_ADAPTER	pAd, 	IN	PSTRING			arg){	 NDIS_802_11_FRAGMENTATION_THRESHOLD     FragThresh;	FragThresh = simple_strtol(arg, 0, 10);	if (FragThresh > MAX_FRAG_THRESHOLD || FragThresh < MIN_FRAG_THRESHOLD)	{ 		//Illegal FragThresh so we set it to default		pAd->CommonCfg.FragmentThreshold = MAX_FRAG_THRESHOLD;	}	else if (FragThresh % 2 == 1)	{		// The length of each fragment shall always be an even number of octets, except for the last fragment		// of an MSDU or MMPDU, which may be either an even or an odd number of octets.		pAd->CommonCfg.FragmentThreshold = (USHORT)(FragThresh - 1);	}	else	{		pAd->CommonCfg.FragmentThreshold = (USHORT)FragThresh;	}#ifdef CONFIG_STA_SUPPORT	IF_DEV_CONFIG_OPMODE_ON_STA(pAd)	{		if (pAd->CommonCfg.FragmentThreshold == MAX_FRAG_THRESHOLD)			pAd->CommonCfg.bUseZeroToDisableFragment = TRUE;		else			pAd->CommonCfg.bUseZeroToDisableFragment = FALSE;	}#endif // CONFIG_STA_SUPPORT //	DBGPRINT(RT_DEBUG_TRACE, ("Set_FragThreshold_Proc::(FragThreshold=%d)\n", pAd->CommonCfg.FragmentThreshold));	return TRUE;}/*     ==========================================================================    Description:        Set TxBurst    Return:        TRUE if all parameters are OK, FALSE otherwise    ==========================================================================*/INT	Set_TxBurst_Proc(	IN	PRTMP_ADAPTER	pAd, 	IN	PSTRING			arg){	LONG TxBurst;	TxBurst = simple_strtol(arg, 0, 10);	if (TxBurst == 1)		pAd->CommonCfg.bEnableTxBurst = TRUE;	else if (TxBurst == 0)		pAd->CommonCfg.bEnableTxBurst = FALSE;	else		return FALSE;  //Invalid argument 		DBGPRINT(RT_DEBUG_TRACE, ("Set_TxBurst_Proc::(TxBurst=%d)\n", pAd->CommonCfg.bEnableTxBurst));	return TRUE;}#ifdef AGGREGATION_SUPPORT/*     ==========================================================================    Description:        Set TxBurst    Return:        TRUE if all parameters are OK, FALSE otherwise    ==========================================================================*/INT	Set_PktAggregate_Proc(	IN	PRTMP_ADAPTER	pAd, 	IN	PSTRING			arg){	LONG aggre;	aggre = simple_strtol(arg, 0, 10);	if (aggre == 1)		pAd->CommonCfg.bAggregationCapable = TRUE;	else if (aggre == 0)		pAd->CommonCfg.bAggregationCapable = FALSE;	else		return FALSE;  //Invalid argument 	DBGPRINT(RT_DEBUG_TRACE, ("Set_PktAggregate_Proc::(AGGRE=%d)\n", pAd->CommonCfg.bAggregationCapable));	return TRUE;}#endif/*     ==========================================================================    Description:        Set IEEE80211H.        This parameter is 1 when needs radar detection, otherwise 0    Return:        TRUE if all parameters are OK, FALSE otherwise    ==========================================================================*/INT	Set_IEEE80211H_Proc(	IN	PRTMP_ADAPTER	pAd, 	IN	PSTRING			arg){    LONG ieee80211h;	ieee80211h = simple_strtol(arg, 0, 10);	if (ieee80211h == 1)		pAd->CommonCfg.bIEEE80211H = TRUE;	else if (ieee80211h == 0)		pAd->CommonCfg.bIEEE80211H = FALSE;	else		return FALSE;  //Invalid argument 		DBGPRINT(RT_DEBUG_TRACE, ("Set_IEEE80211H_Proc::(IEEE80211H=%d)\n", pAd->CommonCfg.bIEEE80211H));	return TRUE;}#ifdef DBG/*     ==========================================================================    Description:        For Debug information    Return:        TRUE if all parameters are OK, FALSE otherwise    ==========================================================================*/INT	Set_Debug_Proc(	IN	PRTMP_ADAPTER	pAd, 	IN	PSTRING			arg){	DBGPRINT(RT_DEBUG_TRACE, ("==> Set_Debug_Proc *******************\n"));    if(simple_strtol(arg, 0, 10) <= RT_DEBUG_LOUD)        RTDebugLevel = simple_strtol(arg, 0, 10);	DBGPRINT(RT_DEBUG_TRACE, ("<== Set_Debug_Proc(RTDebugLevel = %ld)\n", RTDebugLevel));	return TRUE;}#endifINT	Show_DescInfo_Proc(	IN	PRTMP_ADAPTER	pAd, 	IN	PSTRING			arg){	return TRUE;}/*     ==========================================================================    Description:        Reset statistics counter    Arguments:        pAdapter            Pointer to our adapter        arg                     Return:        TRUE if all parameters are OK, FALSE otherwise    ==========================================================================*/INT	Set_ResetStatCounter_Proc(	IN	PRTMP_ADAPTER	pAd, 	IN	PSTRING			arg){	//UCHAR           i;	//MAC_TABLE_ENTRY *pEntry;    	DBGPRINT(RT_DEBUG_TRACE, ("==>Set_ResetStatCounter_Proc\n"));	// add the most up-to-date h/w raw counters into software counters	NICUpdateRawCounters(pAd);    	NdisZeroMemory(&pAd->WlanCounters, sizeof(COUNTER_802_11));	NdisZeroMemory(&pAd->Counters8023, sizeof(COUNTER_802_3));	NdisZeroMemory(&pAd->RalinkCounters, sizeof(COUNTER_RALINK));	// Reset HotSpot counter	return TRUE;}/*	========================================================================		Routine Description:		Add WPA key process.		In Adhoc WPANONE, bPairwise = 0;  KeyIdx = 0;	Arguments:		pAd 					Pointer to our adapter		pBuf							Pointer to the where the key stored	Return Value:		NDIS_SUCCESS					Add key successfully	IRQL = DISPATCH_LEVEL		Note:			========================================================================*/BOOLEAN RTMPCheckStrPrintAble(    IN  CHAR *pInPutStr,     IN  UCHAR strLen){    UCHAR i=0;        for (i=0; i<strLen; i++)    {        if ((pInPutStr[i] < 0x21) ||            (pInPutStr[i] > 0x7E))            return FALSE;    }        return TRUE;}/*	========================================================================		Routine Description:		Remove WPA Key process	Arguments:		pAd 					Pointer to our adapter		pBuf							Pointer to the where the key stored	Return Value:		NDIS_SUCCESS					Add key successfully

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -