mirror of
https://github.com/Mange/rtl8192eu-linux-driver
synced 2025-12-10 00:04:17 +00:00
Add version v5.6.4
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* Copyright(c) 2012 - 2017 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
@@ -11,39 +11,35 @@
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
*****************************************************************************/
|
||||
#define _RTL8192E_LED_C_
|
||||
|
||||
//#include <drv_types.h>
|
||||
/* #include <drv_types.h> */
|
||||
#include <rtl8192e_hal.h>
|
||||
#ifdef CONFIG_RTW_SW_LED
|
||||
|
||||
|
||||
//================================================================================
|
||||
// LED object.
|
||||
//================================================================================
|
||||
/* ********************************************************************************
|
||||
* LED object.
|
||||
* ******************************************************************************** */
|
||||
|
||||
|
||||
//================================================================================
|
||||
// Prototype of protected function.
|
||||
//================================================================================
|
||||
/* ********************************************************************************
|
||||
* Prototype of protected function.
|
||||
* ******************************************************************************** */
|
||||
|
||||
|
||||
//================================================================================
|
||||
// LED_819xUsb routines.
|
||||
//================================================================================
|
||||
/* ********************************************************************************
|
||||
* LED_819xUsb routines.
|
||||
* ******************************************************************************** */
|
||||
|
||||
//
|
||||
// Description:
|
||||
// Turn on LED according to LedPin specified.
|
||||
//
|
||||
/*
|
||||
* Description:
|
||||
* Turn on LED according to LedPin specified.
|
||||
* */
|
||||
static void
|
||||
SwLedOn_8192EU(
|
||||
PADAPTER padapter,
|
||||
PADAPTER padapter,
|
||||
PLED_USB pLed
|
||||
)
|
||||
{
|
||||
@@ -53,62 +49,53 @@ SwLedOn_8192EU(
|
||||
if (RTW_CANNOT_RUN(padapter))
|
||||
return;
|
||||
|
||||
if( RT_GetInterfaceSelection(padapter) == INTF_SEL2_MINICARD ||
|
||||
RT_GetInterfaceSelection(padapter) == INTF_SEL3_USB_Solo ||
|
||||
RT_GetInterfaceSelection(padapter) == INTF_SEL4_USB_Combo)
|
||||
{
|
||||
if (RT_GetInterfaceSelection(padapter) == INTF_SEL2_MINICARD ||
|
||||
RT_GetInterfaceSelection(padapter) == INTF_SEL3_USB_Solo ||
|
||||
RT_GetInterfaceSelection(padapter) == INTF_SEL4_USB_Combo) {
|
||||
LedCfg = rtw_read8(padapter, REG_LEDCFG2);
|
||||
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("In SwLedON,LedAddr:%X LEDPIN=%d\n",REG_LEDCFG2, pLed->LedPin));
|
||||
switch(pLed->LedPin)
|
||||
{
|
||||
case LED_PIN_GPIO0:
|
||||
break;
|
||||
switch (pLed->LedPin) {
|
||||
case LED_PIN_GPIO0:
|
||||
break;
|
||||
|
||||
case LED_PIN_LED0:
|
||||
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("In SwLedOn,LedAddr:%X LEDPIN=%d\n",REG_LEDCFG1, pLed->LedPin));
|
||||
LedCfg = rtw_read8(padapter, REG_LEDCFG0);
|
||||
rtw_write8(padapter, REG_LEDCFG1, (LedCfg&~BIT7)); // SW control led1 on.
|
||||
break;
|
||||
case LED_PIN_LED0:
|
||||
LedCfg = rtw_read8(padapter, REG_LEDCFG0);
|
||||
rtw_write8(padapter, REG_LEDCFG1, (LedCfg & ~BIT7)); /* SW control led1 on. */
|
||||
break;
|
||||
|
||||
case LED_PIN_LED1:
|
||||
PHY_SetMacReg(padapter, 0x64, BIT1, 0);
|
||||
PHY_SetMacReg(padapter, 0x4C, BIT15, 0);
|
||||
PHY_SetMacReg(padapter, 0x4C, BIT10|BIT9|BIT8, 0);
|
||||
PHY_SetMacReg(padapter, 0x4C, BIT11, 0);
|
||||
break;
|
||||
case LED_PIN_LED1:
|
||||
phy_set_mac_reg(padapter, 0x64, BIT1, 0);
|
||||
phy_set_mac_reg(padapter, 0x4C, BIT15, 0);
|
||||
phy_set_mac_reg(padapter, 0x4C, BIT10 | BIT9 | BIT8, 0);
|
||||
phy_set_mac_reg(padapter, 0x4C, BIT11, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(pLed->LedPin)
|
||||
{
|
||||
case LED_PIN_GPIO0:
|
||||
break;
|
||||
} else {
|
||||
switch (pLed->LedPin) {
|
||||
case LED_PIN_GPIO0:
|
||||
break;
|
||||
|
||||
case LED_PIN_LED0: //8192EU don't have LED0, so we jump this case to set LED1
|
||||
LedCfg = rtw_read8(padapter, (REG_LEDCFG1));
|
||||
rtw_write8(padapter, (REG_LEDCFG1), (LedCfg&~BIT7)); // SW control led1 on.
|
||||
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("SwLedOn LED1 0x%x\n", rtw_read32(padapter, REG_LEDCFG1)));
|
||||
break;
|
||||
case LED_PIN_LED0: /* 8192EU don't have LED0, so we jump this case to set LED1 */
|
||||
LedCfg = rtw_read8(padapter, (REG_LEDCFG1));
|
||||
rtw_write8(padapter, (REG_LEDCFG1), (LedCfg & ~BIT7)); /* SW control led1 on. */
|
||||
break;
|
||||
|
||||
case LED_PIN_LED1:
|
||||
PHY_SetMacReg(padapter, 0x64, BIT1, 0);
|
||||
PHY_SetMacReg(padapter, 0x4C, BIT15, 0);
|
||||
PHY_SetMacReg(padapter, 0x4C, BIT10|BIT9|BIT8, 0);
|
||||
PHY_SetMacReg(padapter, 0x4C, BIT11, 0);
|
||||
break;
|
||||
case LED_PIN_LED1:
|
||||
phy_set_mac_reg(padapter, 0x64, BIT1, 0);
|
||||
phy_set_mac_reg(padapter, 0x4C, BIT15, 0);
|
||||
phy_set_mac_reg(padapter, 0x4C, BIT10 | BIT9 | BIT8, 0);
|
||||
phy_set_mac_reg(padapter, 0x4C, BIT11, 0);
|
||||
break;
|
||||
|
||||
case LED_PIN_LED2:
|
||||
LedCfg = rtw_read8(padapter, (REG_LEDCFG2));
|
||||
rtw_write8(padapter, (REG_LEDCFG2), (LedCfg&~BIT7)); // SW control led1 on.
|
||||
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("SwLedOn LED2 0x%x\n", rtw_read32(padapter, REG_LEDCFG2)));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
case LED_PIN_LED2:
|
||||
LedCfg = rtw_read8(padapter, (REG_LEDCFG2));
|
||||
rtw_write8(padapter, (REG_LEDCFG2), (LedCfg & ~BIT7)); /* SW control led1 on. */
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,13 +103,13 @@ SwLedOn_8192EU(
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Description:
|
||||
// Turn off LED according to LedPin specified.
|
||||
//
|
||||
/*
|
||||
* Description:
|
||||
* Turn off LED according to LedPin specified.
|
||||
* */
|
||||
static void
|
||||
SwLedOff_8192EU(
|
||||
PADAPTER padapter,
|
||||
PADAPTER padapter,
|
||||
PLED_USB pLed
|
||||
)
|
||||
{
|
||||
@@ -132,91 +119,85 @@ SwLedOff_8192EU(
|
||||
if (RTW_CANNOT_RUN(padapter))
|
||||
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));
|
||||
if (RT_GetInterfaceSelection(padapter) == INTF_SEL2_MINICARD ||
|
||||
RT_GetInterfaceSelection(padapter) == INTF_SEL3_USB_Solo ||
|
||||
RT_GetInterfaceSelection(padapter) == INTF_SEL4_USB_Combo) {
|
||||
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;
|
||||
/* 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_LED0: //8192EU don't have LED0, so we jump this case to set LED1
|
||||
LedCfg = rtw_read8(padapter, REG_LEDCFG1);
|
||||
rtw_write8(padapter, REG_LEDCFG1, LedCfg|BIT7);
|
||||
break;
|
||||
case LED_PIN_GPIO0:
|
||||
break;
|
||||
|
||||
case LED_PIN_LED1:
|
||||
PHY_SetMacReg(padapter, 0x64, BIT1, 0);
|
||||
PHY_SetMacReg(padapter, 0x4C, BIT15, 0);
|
||||
PHY_SetMacReg(padapter, 0x4C, BIT10|BIT9|BIT8, 0);
|
||||
PHY_SetMacReg(padapter, 0x4C, BIT11, 1);
|
||||
break;
|
||||
case LED_PIN_LED0: /* 8192EU don't have LED0, so we jump this case to set LED1 */
|
||||
LedCfg = rtw_read8(padapter, REG_LEDCFG1);
|
||||
rtw_write8(padapter, REG_LEDCFG1, LedCfg | BIT7);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
case LED_PIN_LED1:
|
||||
phy_set_mac_reg(padapter, 0x64, BIT1, 0);
|
||||
phy_set_mac_reg(padapter, 0x4C, BIT15, 0);
|
||||
phy_set_mac_reg(padapter, 0x4C, BIT10 | BIT9 | BIT8, 0);
|
||||
phy_set_mac_reg(padapter, 0x4C, BIT11, 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(pLed->LedPin)
|
||||
{
|
||||
case LED_PIN_GPIO0:
|
||||
break;
|
||||
} else {
|
||||
switch (pLed->LedPin) {
|
||||
case LED_PIN_GPIO0:
|
||||
break;
|
||||
|
||||
case LED_PIN_LED0://8192EU don't have LED0, so we jump this case to set LED1
|
||||
LedCfg = rtw_read8(padapter, REG_LEDCFG1);
|
||||
rtw_write8(padapter, REG_LEDCFG1, LedCfg|BIT7);
|
||||
break;
|
||||
case LED_PIN_LED0: /* 8192EU don't have LED0, so we jump this case to set LED1 */
|
||||
LedCfg = rtw_read8(padapter, REG_LEDCFG1);
|
||||
rtw_write8(padapter, REG_LEDCFG1, LedCfg | BIT7);
|
||||
break;
|
||||
|
||||
case LED_PIN_LED1:
|
||||
PHY_SetMacReg(padapter, 0x64, BIT1, 0);
|
||||
PHY_SetMacReg(padapter, 0x4C, BIT15, 0);
|
||||
PHY_SetMacReg(padapter, 0x4C, BIT10|BIT9|BIT8, 0);
|
||||
PHY_SetMacReg(padapter, 0x4C, BIT11, 1);
|
||||
break;
|
||||
case LED_PIN_LED1:
|
||||
phy_set_mac_reg(padapter, 0x64, BIT1, 0);
|
||||
phy_set_mac_reg(padapter, 0x4C, BIT15, 0);
|
||||
phy_set_mac_reg(padapter, 0x4C, BIT10 | BIT9 | BIT8, 0);
|
||||
phy_set_mac_reg(padapter, 0x4C, BIT11, 1);
|
||||
break;
|
||||
|
||||
case LED_PIN_LED2:
|
||||
LedCfg = rtw_read8(padapter, REG_LEDCFG2);
|
||||
rtw_write8(padapter, REG_LEDCFG2, LedCfg|BIT7);
|
||||
break;
|
||||
case LED_PIN_LED2:
|
||||
LedCfg = rtw_read8(padapter, REG_LEDCFG2);
|
||||
rtw_write8(padapter, REG_LEDCFG2, LedCfg | BIT7);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pLed->bLedOn = _FALSE;
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
// Interface to manipulate LED objects.
|
||||
//================================================================================
|
||||
/* ********************************************************************************
|
||||
* Interface to manipulate LED objects.
|
||||
* ******************************************************************************** */
|
||||
|
||||
|
||||
//================================================================================
|
||||
// Default LED behavior.
|
||||
//================================================================================
|
||||
/* ********************************************************************************
|
||||
* Default LED behavior.
|
||||
* ******************************************************************************** */
|
||||
|
||||
//
|
||||
// Description:
|
||||
// Initialize all LED_871x objects.
|
||||
//
|
||||
/*
|
||||
* Description:
|
||||
* Initialize all LED_871x objects.
|
||||
* */
|
||||
void
|
||||
rtl8192eu_InitSwLeds(
|
||||
_adapter *padapter
|
||||
)
|
||||
)
|
||||
{
|
||||
struct led_priv *pledpriv = &(padapter->ledpriv);
|
||||
struct led_priv *pledpriv = adapter_to_led(padapter);
|
||||
|
||||
pledpriv->LedControlHandler = LedControlUSB;
|
||||
|
||||
@@ -229,18 +210,18 @@ rtl8192eu_InitSwLeds(
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Description:
|
||||
// DeInitialize all LED_819xUsb objects.
|
||||
//
|
||||
/*
|
||||
* Description:
|
||||
* DeInitialize all LED_819xUsb objects.
|
||||
* */
|
||||
void
|
||||
rtl8192eu_DeInitSwLeds(
|
||||
_adapter *padapter
|
||||
)
|
||||
)
|
||||
{
|
||||
struct led_priv *ledpriv = &(padapter->ledpriv);
|
||||
struct led_priv *ledpriv = adapter_to_led(padapter);
|
||||
|
||||
DeInitLed( &(ledpriv->SwLed0) );
|
||||
DeInitLed( &(ledpriv->SwLed1) );
|
||||
DeInitLed(&(ledpriv->SwLed0));
|
||||
DeInitLed(&(ledpriv->SwLed1));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user