Ejemplo n.º 1
0
VOID
HALBT_SendBtDbgH2c(
	IN	PADAPTER	Adapter,
	IN	u4Byte		CmdLen,
	IN	pu1Byte 		pCmdBuffer
	)
{
	if(IS_HARDWARE_TYPE_8723A(Adapter))
	{
		FillH2CCmd(Adapter, 0x46, CmdLen, pCmdBuffer);
	}
	else
	{
		FillH2CCmd(Adapter, 0x67, CmdLen, pCmdBuffer);
	}
}
Ejemplo n.º 2
0
BOOLEAN
HALBT_IsBtExist(
	IN	PADAPTER	Adapter
	)
{
	HAL_DATA_TYPE	*pHalData = GET_HAL_DATA(Adapter);

	if( IS_HARDWARE_TYPE_8192C(Adapter) ||
		IS_HARDWARE_TYPE_8192D(Adapter) ||
		IS_HARDWARE_TYPE_8723A(Adapter) ||
		IS_HARDWARE_TYPE_8723B(Adapter))
	{
		if(pHalData->bt_coexist.BluetoothCoexist)
			return TRUE;
		else
			return FALSE;
	}
	else
		return FALSE;
}
Ejemplo n.º 3
0
//
//	Description:
//		Turn off LED according to LedPin specified.
//
static void
SwLedOff_8812AU(
	PADAPTER		padapter, 
	PLED_USB		pLed
)
{
	u8	LedCfg;
	HAL_DATA_TYPE	*pHalData = GET_HAL_DATA(padapter);

	if(padapter->bSurpriseRemoved == _TRUE)
	{
		return;
	}

	if(	RT_GetInterfaceSelection(padapter) == INTF_SEL2_MINICARD ||
		RT_GetInterfaceSelection(padapter) == INTF_SEL3_USB_Solo ||
		RT_GetInterfaceSelection(padapter) == INTF_SEL4_USB_Combo)
	{		
		RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("In SwLedOff,LedAddr:%X LEDPIN=%d\n",REG_LEDCFG2, pLed->LedPin));
		LedCfg = rtw_read8(padapter, REG_LEDCFG2);
		
		// 2009/10/23 MH Issau eed to move the LED GPIO from bit  0 to bit3.
		// 2009/10/26 MH Issau if tyhe device is 8c DID is 0x8176, we need to enable bit6 to
		// enable GPIO8 for controlling LED.	
		// 2010/07/02 Supprt Open-drain arrangement for controlling the LED. Added by Roger.
		//
		switch(pLed->LedPin)
		{

			case LED_PIN_GPIO0:
				break;

			case LED_PIN_LED0:
				if(pHalData->bLedOpenDrain == _TRUE)					
				{
					LedCfg &= 0x90; // Set to software control.				
					rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3));				
					LedCfg = rtw_read8(padapter, REG_MAC_PINMUX_CFG);
					LedCfg &= 0xFE;
					rtw_write8(padapter, REG_MAC_PINMUX_CFG, LedCfg);									
				}
				else
				{
					rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3|BIT5|BIT6));
				}
				break;

			case LED_PIN_LED1:
				LedCfg &= 0x0f; // Set to software control.
				rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3));
				break;

			default:
				break;
		}
	}
	else
	{
		switch(pLed->LedPin)
		{
			case LED_PIN_GPIO0:
				break;

			case LED_PIN_LED0:
				 if(pHalData->AntDivCfg==0)
				{
					LedCfg = rtw_read8(padapter, REG_LEDCFG0);
					LedCfg &= 0x70; // Set to software control.
					rtw_write8(padapter, REG_LEDCFG0, (LedCfg|BIT3|BIT5));
					RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("SwLedOff LED0 0x%x\n", rtw_read32(padapter, REG_LEDCFG0)));
				}
				else
				{
					LedCfg = rtw_read8(padapter, REG_LEDCFG2);
					LedCfg &= 0xe0; // Set to software control. 			
					if(IS_HARDWARE_TYPE_8723A(padapter))
						rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3|BIT7|BIT5));
					else
						rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3|BIT7|BIT6|BIT5));
					RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("SwLedOff LED0 0x%x\n", rtw_read32(padapter, REG_LEDCFG2)));
				}
				break;

			case LED_PIN_LED1:
				LedCfg = rtw_read8(padapter, REG_LEDCFG1);
				LedCfg &= 0x70; // Set to software control.
				rtw_write8(padapter, REG_LEDCFG1, (LedCfg|BIT3|BIT5));
				RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("SwLedOff LED1 0x%x\n", rtw_read32(padapter, REG_LEDCFG1)));
				break;

			case LED_PIN_LED2:
				LedCfg = rtw_read8(padapter, REG_LEDCFG2);
				LedCfg &= 0x70; // Set to software control.
				rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3|BIT5));
				RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("SwLedOff LED1 0x%x\n", rtw_read32(padapter, REG_LEDCFG2)));
				break;

			default:
				break;
		}
	}

	pLed->bLedOn = _FALSE;
}