From: Larry Finger Date: Thu, 11 Feb 2010 20:41:24 +0000 (-0600) Subject: Staging: r8187se: Fix for LED not following radio switch X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6de92dd6495e36c0c2cddbee3e7c6a49f608e7cf;p=linux-beck.git Staging: r8187se: Fix for LED not following radio switch The current driver does not follow the state of the RF switch. Signed-off-by: Larry Finger Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8187se/r8180_core.c b/drivers/staging/rtl8187se/r8180_core.c index ac987d149219..0b7ec6b949b4 100644 --- a/drivers/staging/rtl8187se/r8180_core.c +++ b/drivers/staging/rtl8187se/r8180_core.c @@ -4238,11 +4238,12 @@ void GPIOChangeRFWorkItemCallBack(struct work_struct *work) /* HW radio On/Off according to the value of FF51[4](config0) */ btConfig0 = btPSR = read_nic_byte(dev, CONFIG0); - /* Turn on LED. */ - write_nic_byte(dev, PSR, btPSR | BIT3); - eRfPowerStateToSet = (btConfig0 & BIT4) ? eRfOn : eRfOff; + /* Turn LED back on when radio enabled */ + if (eRfPowerStateToSet == eRfOn) + write_nic_byte(dev, PSR, btPSR | BIT3); + if ((priv->ieee80211->bHwRadioOff == true) && (eRfPowerStateToSet == eRfOn)) { priv->ieee80211->bHwRadioOff = false;