FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 04-10-2011, 11:30 PM
Chaoming Li
 
Default rtlwifi: rtl8192ce: Fix LED initialization

Driver rtl8192ce does not initialize the LED correctly.

Signed-off-by: Chaoming Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

BugLink: http://bugs.launchpad.net/bugs/785975

(cherry-picked from commit 228bdfca9a09c1263c24509b4bc23a67be168e1a upstream)
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
---
drivers/net/wireless/rtlwifi/base.c | 12 +++++++-----
drivers/net/wireless/rtlwifi/pci.c | 3 ++-
drivers/net/wireless/rtlwifi/rtl8192ce/led.c | 14 +++++++++++---
drivers/net/wireless/rtlwifi/rtl8192ce/led.h | 1 -
drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 1 -
5 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
index 0d7d93e..2abf9fb 100644
--- a/drivers/net/wireless/rtlwifi/base.c
+++ b/drivers/net/wireless/rtlwifi/base.c
@@ -251,14 +251,16 @@ void rtl_init_rfkill(struct ieee80211_hw *hw)
bool blocked;
u8 valid = 0;

- radio_state = rtlpriv->cfg->ops->radio_onoff_checking(hw, &valid);
+ /*set init state to on */
+ rtlpriv->rfkill.rfkill_state = 1;
+ wiphy_rfkill_set_hw_state(hw->wiphy, 0);

- /*set init state to that of switch */
- rtlpriv->rfkill.rfkill_state = radio_state;
- printk(KERN_INFO "rtlwifi: wireless switch is %s
",
- rtlpriv->rfkill.rfkill_state ? "on" : "off");
+ radio_state = rtlpriv->cfg->ops->radio_onoff_checking(hw, &valid);

if (valid) {
+ printk(KERN_INFO "rtlwifi: wireless switch is %s
",
+ rtlpriv->rfkill.rfkill_state ? "on" : "off");
+
rtlpriv->rfkill.rfkill_state = radio_state;

blocked = (rtlpriv->rfkill.rfkill_state == 1) ? 0 : 1;
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 5938f6e..ea347f6 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -1806,7 +1806,8 @@ void rtl_pci_disconnect(struct pci_dev *pdev)

rtl_pci_deinit(hw);
rtl_deinit_core(hw);
- rtlpriv->cfg->ops->deinit_sw_leds(hw);
+ if (rtlpriv->cfg->ops->deinit_sw_leds)
+ rtlpriv->cfg->ops->deinit_sw_leds(hw);
_rtl_pci_io_handler_release(hw);
rtlpriv->cfg->ops->deinit_sw_vars(hw);

diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/led.c b/drivers/net/wireless/rtlwifi/rtl8192ce/led.c
index 7b1da8d..d21b934 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/led.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/led.c
@@ -32,6 +32,14 @@
#include "reg.h"
#include "led.h"

+static void _rtl92ce_init_led(struct ieee80211_hw *hw,
+ struct rtl_led *pled, enum rtl_led_pin ledpin)
+{
+ pled->hw = hw;
+ pled->ledpin = ledpin;
+ pled->ledon = false;
+}
+
void rtl92ce_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
{
u8 ledcfg;
@@ -97,10 +105,10 @@ void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)

void rtl92ce_init_sw_leds(struct ieee80211_hw *hw)
{
-}
+ struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw);

-void rtl92ce_deinit_sw_leds(struct ieee80211_hw *hw)
-{
+ _rtl92ce_init_led(hw, &(pcipriv->ledctl.sw_led0), LED_PIN_LED0);
+ _rtl92ce_init_led(hw, &(pcipriv->ledctl.sw_led1), LED_PIN_LED1);
}

void _rtl92ce_sw_led_control(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/led.h b/drivers/net/wireless/rtlwifi/rtl8192ce/led.h
index 10da301..94332b3 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/led.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/led.h
@@ -31,7 +31,6 @@
#define __RTL92CE_LED_H__

void rtl92ce_init_sw_leds(struct ieee80211_hw *hw);
-void rtl92ce_deinit_sw_leds(struct ieee80211_hw *hw);
void rtl92ce_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled);
void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled);
void rtl92ce_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
index b1cc4d4..f4e2f3d 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
@@ -131,7 +131,6 @@ static struct rtl_hal_ops rtl8192ce_hal_ops = {
.enable_hw_sec = rtl92ce_enable_hw_security_config,
.set_key = rtl92ce_set_key,
.init_sw_leds = rtl92ce_init_sw_leds,
- .deinit_sw_leds = rtl92ce_deinit_sw_leds,
.get_bbreg = rtl92c_phy_query_bb_reg,
.set_bbreg = rtl92c_phy_set_bb_reg,
.get_rfreg = rtl92ce_phy_query_rf_reg,
--
1.7.4.1


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 04-10-2011, 11:30 PM
Chaoming Li
 
Default rtlwifi: rtl8192ce: Fix LED initialization

Driver rtl8192ce does not initialize the LED correctly.

Signed-off-by: Chaoming Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

BugLink: http://bugs.launchpad.net/bugs/785975

[backport: renamed ledon to b_ledon]
(backported from commit 228bdfca9a09c1263c24509b4bc23a67be168e1a upstream)
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
---
drivers/net/wireless/rtlwifi/base.c | 12 +++++++-----
drivers/net/wireless/rtlwifi/pci.c | 3 ++-
drivers/net/wireless/rtlwifi/rtl8192ce/led.c | 14 +++++++++++---
drivers/net/wireless/rtlwifi/rtl8192ce/led.h | 1 -
drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 1 -
5 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
index cf0b73e..173f4fe 100644
--- a/drivers/net/wireless/rtlwifi/base.c
+++ b/drivers/net/wireless/rtlwifi/base.c
@@ -251,14 +251,16 @@ void rtl_init_rfkill(struct ieee80211_hw *hw)
bool blocked;
u8 valid = 0;

- radio_state = rtlpriv->cfg->ops->radio_onoff_checking(hw, &valid);
+ /*set init state to on */
+ rtlpriv->rfkill.rfkill_state = 1;
+ wiphy_rfkill_set_hw_state(hw->wiphy, 0);

- /*set init state to that of switch */
- rtlpriv->rfkill.rfkill_state = radio_state;
- printk(KERN_INFO "rtlwifi: wireless switch is %s
",
- rtlpriv->rfkill.rfkill_state ? "on" : "off");
+ radio_state = rtlpriv->cfg->ops->radio_onoff_checking(hw, &valid);

if (valid) {
+ printk(KERN_INFO "rtlwifi: wireless switch is %s
",
+ rtlpriv->rfkill.rfkill_state ? "on" : "off");
+
rtlpriv->rfkill.rfkill_state = radio_state;

blocked = (rtlpriv->rfkill.rfkill_state == 1) ? 0 : 1;
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 1758d44..4755c7b 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -1878,7 +1878,8 @@ void rtl_pci_disconnect(struct pci_dev *pdev)

rtl_pci_deinit(hw);
rtl_deinit_core(hw);
- rtlpriv->cfg->ops->deinit_sw_leds(hw);
+ if (rtlpriv->cfg->ops->deinit_sw_leds)
+ rtlpriv->cfg->ops->deinit_sw_leds(hw);
_rtl_pci_io_handler_release(hw);
rtlpriv->cfg->ops->deinit_sw_vars(hw);

diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/led.c b/drivers/net/wireless/rtlwifi/rtl8192ce/led.c
index 78a0569..1958e6a 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/led.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/led.c
@@ -32,6 +32,14 @@
#include "reg.h"
#include "led.h"

+static void _rtl92ce_init_led(struct ieee80211_hw *hw,
+ struct rtl_led *pled, enum rtl_led_pin ledpin)
+{
+ pled->hw = hw;
+ pled->ledpin = ledpin;
+ pled->b_ledon = false;
+}
+
void rtl92ce_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
{
u8 ledcfg;
@@ -97,10 +105,10 @@ void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)

void rtl92ce_init_sw_leds(struct ieee80211_hw *hw)
{
-}
+ struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw);

-void rtl92ce_deinit_sw_leds(struct ieee80211_hw *hw)
-{
+ _rtl92ce_init_led(hw, &(pcipriv->ledctl.sw_led0), LED_PIN_LED0);
+ _rtl92ce_init_led(hw, &(pcipriv->ledctl.sw_led1), LED_PIN_LED1);
}

void _rtl92ce_sw_led_control(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/led.h b/drivers/net/wireless/rtlwifi/rtl8192ce/led.h
index 10da301..94332b3 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/led.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/led.h
@@ -31,7 +31,6 @@
#define __RTL92CE_LED_H__

void rtl92ce_init_sw_leds(struct ieee80211_hw *hw);
-void rtl92ce_deinit_sw_leds(struct ieee80211_hw *hw);
void rtl92ce_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled);
void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled);
void rtl92ce_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
index b366e88..920203a 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
@@ -130,7 +130,6 @@ static struct rtl_hal_ops rtl8192ce_hal_ops = {
.enable_hw_sec = rtl92ce_enable_hw_security_config,
.set_key = rtl92ce_set_key,
.init_sw_leds = rtl92ce_init_sw_leds,
- .deinit_sw_leds = rtl92ce_deinit_sw_leds,
.get_bbreg = rtl92c_phy_query_bb_reg,
.set_bbreg = rtl92c_phy_set_bb_reg,
.get_rfreg = rtl92c_phy_query_rf_reg,
--
1.7.4.1


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 05-31-2011, 05:38 PM
Stefan Bader
 
Default rtlwifi: rtl8192ce: Fix LED initialization

 
Old 05-31-2011, 05:38 PM
Stefan Bader
 
Default rtlwifi: rtl8192ce: Fix LED initialization

 
Old 05-31-2011, 06:36 PM
Leann Ogasawara
 
Default rtlwifi: rtl8192ce: Fix LED initialization

On Tue, 2011-05-31 at 19:38 +0200, Stefan Bader wrote:
> From afec5ce78c117153ee98f791b7e139788d27b2f3 Mon Sep 17 00:00:00 2001
> From: Chaoming Li <chaoming_li@realsil.com.cn>
> Date: Sun, 10 Apr 2011 18:30:23 -0500
> Subject: [PATCH] rtlwifi: rtl8192ce: Fix LED initialization
>
> Driver rtl8192ce does not initialize the LED correctly.
>
> Signed-off-by: Chaoming Li <chaoming_li@realsil.com.cn>
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
>
> BugLink: http://bugs.launchpad.net/bugs/785975
>
> [backport: renamed ledon to b_ledon]
> (backported from commit 228bdfca9a09c1263c24509b4bc23a67be168e1a upstream)
> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>

Acked-by: Leann Ogasawara <leann.ogasawara@canonical.com>

> ---
> drivers/net/wireless/rtlwifi/base.c | 12 +++++++-----
> drivers/net/wireless/rtlwifi/pci.c | 3 ++-
> drivers/net/wireless/rtlwifi/rtl8192ce/led.c | 14 +++++++++++---
> drivers/net/wireless/rtlwifi/rtl8192ce/led.h | 1 -
> drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 1 -
> 5 files changed, 20 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
> index cf0b73e..173f4fe 100644
> --- a/drivers/net/wireless/rtlwifi/base.c
> +++ b/drivers/net/wireless/rtlwifi/base.c
> @@ -251,14 +251,16 @@ void rtl_init_rfkill(struct ieee80211_hw *hw)
> bool blocked;
> u8 valid = 0;
>
> - radio_state = rtlpriv->cfg->ops->radio_onoff_checking(hw, &valid);
> + /*set init state to on */
> + rtlpriv->rfkill.rfkill_state = 1;
> + wiphy_rfkill_set_hw_state(hw->wiphy, 0);
>
> - /*set init state to that of switch */
> - rtlpriv->rfkill.rfkill_state = radio_state;
> - printk(KERN_INFO "rtlwifi: wireless switch is %s
",
> - rtlpriv->rfkill.rfkill_state ? "on" : "off");
> + radio_state = rtlpriv->cfg->ops->radio_onoff_checking(hw, &valid);
>
> if (valid) {
> + printk(KERN_INFO "rtlwifi: wireless switch is %s
",
> + rtlpriv->rfkill.rfkill_state ? "on" : "off");
> +
> rtlpriv->rfkill.rfkill_state = radio_state;
>
> blocked = (rtlpriv->rfkill.rfkill_state == 1) ? 0 : 1;
> diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
> index 1758d44..4755c7b 100644
> --- a/drivers/net/wireless/rtlwifi/pci.c
> +++ b/drivers/net/wireless/rtlwifi/pci.c
> @@ -1878,7 +1878,8 @@ void rtl_pci_disconnect(struct pci_dev *pdev)
>
> rtl_pci_deinit(hw);
> rtl_deinit_core(hw);
> - rtlpriv->cfg->ops->deinit_sw_leds(hw);
> + if (rtlpriv->cfg->ops->deinit_sw_leds)
> + rtlpriv->cfg->ops->deinit_sw_leds(hw);
> _rtl_pci_io_handler_release(hw);
> rtlpriv->cfg->ops->deinit_sw_vars(hw);
>
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/led.c b/drivers/net/wireless/rtlwifi/rtl8192ce/led.c
> index 78a0569..1958e6a 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192ce/led.c
> +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/led.c
> @@ -32,6 +32,14 @@
> #include "reg.h"
> #include "led.h"
>
> +static void _rtl92ce_init_led(struct ieee80211_hw *hw,
> + struct rtl_led *pled, enum rtl_led_pin ledpin)
> +{
> + pled->hw = hw;
> + pled->ledpin = ledpin;
> + pled->b_ledon = false;
> +}
> +
> void rtl92ce_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
> {
> u8 ledcfg;
> @@ -97,10 +105,10 @@ void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
>
> void rtl92ce_init_sw_leds(struct ieee80211_hw *hw)
> {
> -}
> + struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw);
>
> -void rtl92ce_deinit_sw_leds(struct ieee80211_hw *hw)
> -{
> + _rtl92ce_init_led(hw, &(pcipriv->ledctl.sw_led0), LED_PIN_LED0);
> + _rtl92ce_init_led(hw, &(pcipriv->ledctl.sw_led1), LED_PIN_LED1);
> }
>
> void _rtl92ce_sw_led_control(struct ieee80211_hw *hw,
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/led.h b/drivers/net/wireless/rtlwifi/rtl8192ce/led.h
> index 10da301..94332b3 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192ce/led.h
> +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/led.h
> @@ -31,7 +31,6 @@
> #define __RTL92CE_LED_H__
>
> void rtl92ce_init_sw_leds(struct ieee80211_hw *hw);
> -void rtl92ce_deinit_sw_leds(struct ieee80211_hw *hw);
> void rtl92ce_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled);
> void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled);
> void rtl92ce_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction);
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
> index b366e88..920203a 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
> +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
> @@ -130,7 +130,6 @@ static struct rtl_hal_ops rtl8192ce_hal_ops = {
> .enable_hw_sec = rtl92ce_enable_hw_security_config,
> .set_key = rtl92ce_set_key,
> .init_sw_leds = rtl92ce_init_sw_leds,
> - .deinit_sw_leds = rtl92ce_deinit_sw_leds,
> .get_bbreg = rtl92c_phy_query_bb_reg,
> .set_bbreg = rtl92c_phy_set_bb_reg,
> .get_rfreg = rtl92c_phy_query_rf_reg,
> --
> 1.7.4.1
>
>



--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 05-31-2011, 06:40 PM
Leann Ogasawara
 
Default rtlwifi: rtl8192ce: Fix LED initialization

Thanks for the heads up. We've got Oneiric rebased to v3.0-rc1, just
fixing up some script fallout due to the new version as well as some
misc build issues before we push to the repo.

Thanks,
Leann

On Tue, 2011-05-31 at 19:38 +0200, Stefan Bader wrote:
> From 57ea80a00bacbefb5d2ed3963955c0b7449ab251 Mon Sep 17 00:00:00 2001
> From: Chaoming Li <chaoming_li@realsil.com.cn>
> Date: Sun, 10 Apr 2011 18:30:23 -0500
> Subject: [PATCH] rtlwifi: rtl8192ce: Fix LED initialization
>
> Driver rtl8192ce does not initialize the LED correctly.
>
> Signed-off-by: Chaoming Li <chaoming_li@realsil.com.cn>
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
>
> BugLink: http://bugs.launchpad.net/bugs/785975
>
> (cherry-picked from commit 228bdfca9a09c1263c24509b4bc23a67be168e1a upstream)
> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
> ---
> drivers/net/wireless/rtlwifi/base.c | 12 +++++++-----
> drivers/net/wireless/rtlwifi/pci.c | 3 ++-
> drivers/net/wireless/rtlwifi/rtl8192ce/led.c | 14 +++++++++++---
> drivers/net/wireless/rtlwifi/rtl8192ce/led.h | 1 -
> drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 1 -
> 5 files changed, 20 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
> index 0d7d93e..2abf9fb 100644
> --- a/drivers/net/wireless/rtlwifi/base.c
> +++ b/drivers/net/wireless/rtlwifi/base.c
> @@ -251,14 +251,16 @@ void rtl_init_rfkill(struct ieee80211_hw *hw)
> bool blocked;
> u8 valid = 0;
>
> - radio_state = rtlpriv->cfg->ops->radio_onoff_checking(hw, &valid);
> + /*set init state to on */
> + rtlpriv->rfkill.rfkill_state = 1;
> + wiphy_rfkill_set_hw_state(hw->wiphy, 0);
>
> - /*set init state to that of switch */
> - rtlpriv->rfkill.rfkill_state = radio_state;
> - printk(KERN_INFO "rtlwifi: wireless switch is %s
",
> - rtlpriv->rfkill.rfkill_state ? "on" : "off");
> + radio_state = rtlpriv->cfg->ops->radio_onoff_checking(hw, &valid);
>
> if (valid) {
> + printk(KERN_INFO "rtlwifi: wireless switch is %s
",
> + rtlpriv->rfkill.rfkill_state ? "on" : "off");
> +
> rtlpriv->rfkill.rfkill_state = radio_state;
>
> blocked = (rtlpriv->rfkill.rfkill_state == 1) ? 0 : 1;
> diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
> index 5938f6e..ea347f6 100644
> --- a/drivers/net/wireless/rtlwifi/pci.c
> +++ b/drivers/net/wireless/rtlwifi/pci.c
> @@ -1806,7 +1806,8 @@ void rtl_pci_disconnect(struct pci_dev *pdev)
>
> rtl_pci_deinit(hw);
> rtl_deinit_core(hw);
> - rtlpriv->cfg->ops->deinit_sw_leds(hw);
> + if (rtlpriv->cfg->ops->deinit_sw_leds)
> + rtlpriv->cfg->ops->deinit_sw_leds(hw);
> _rtl_pci_io_handler_release(hw);
> rtlpriv->cfg->ops->deinit_sw_vars(hw);
>
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/led.c b/drivers/net/wireless/rtlwifi/rtl8192ce/led.c
> index 7b1da8d..d21b934 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192ce/led.c
> +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/led.c
> @@ -32,6 +32,14 @@
> #include "reg.h"
> #include "led.h"
>
> +static void _rtl92ce_init_led(struct ieee80211_hw *hw,
> + struct rtl_led *pled, enum rtl_led_pin ledpin)
> +{
> + pled->hw = hw;
> + pled->ledpin = ledpin;
> + pled->ledon = false;
> +}
> +
> void rtl92ce_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
> {
> u8 ledcfg;
> @@ -97,10 +105,10 @@ void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
>
> void rtl92ce_init_sw_leds(struct ieee80211_hw *hw)
> {
> -}
> + struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw);
>
> -void rtl92ce_deinit_sw_leds(struct ieee80211_hw *hw)
> -{
> + _rtl92ce_init_led(hw, &(pcipriv->ledctl.sw_led0), LED_PIN_LED0);
> + _rtl92ce_init_led(hw, &(pcipriv->ledctl.sw_led1), LED_PIN_LED1);
> }
>
> void _rtl92ce_sw_led_control(struct ieee80211_hw *hw,
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/led.h b/drivers/net/wireless/rtlwifi/rtl8192ce/led.h
> index 10da301..94332b3 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192ce/led.h
> +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/led.h
> @@ -31,7 +31,6 @@
> #define __RTL92CE_LED_H__
>
> void rtl92ce_init_sw_leds(struct ieee80211_hw *hw);
> -void rtl92ce_deinit_sw_leds(struct ieee80211_hw *hw);
> void rtl92ce_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled);
> void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled);
> void rtl92ce_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction);
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
> index b1cc4d4..f4e2f3d 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
> +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
> @@ -131,7 +131,6 @@ static struct rtl_hal_ops rtl8192ce_hal_ops = {
> .enable_hw_sec = rtl92ce_enable_hw_security_config,
> .set_key = rtl92ce_set_key,
> .init_sw_leds = rtl92ce_init_sw_leds,
> - .deinit_sw_leds = rtl92ce_deinit_sw_leds,
> .get_bbreg = rtl92c_phy_query_bb_reg,
> .set_bbreg = rtl92c_phy_set_bb_reg,
> .get_rfreg = rtl92ce_phy_query_rf_reg,
> --
> 1.7.4.1
>
>



--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 06-01-2011, 12:57 PM
Herton Ronaldo Krzesinski
 
Default rtlwifi: rtl8192ce: Fix LED initialization

On Tue, May 31, 2011 at 07:38:46PM +0200, Stefan Bader wrote:
> From afec5ce78c117153ee98f791b7e139788d27b2f3 Mon Sep 17 00:00:00 2001
> From: Chaoming Li <chaoming_li@realsil.com.cn>
> Date: Sun, 10 Apr 2011 18:30:23 -0500
> Subject: [PATCH] rtlwifi: rtl8192ce: Fix LED initialization
>
> Driver rtl8192ce does not initialize the LED correctly.
>
> Signed-off-by: Chaoming Li <chaoming_li@realsil.com.cn>
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
>
> BugLink: http://bugs.launchpad.net/bugs/785975
>
> [backport: renamed ledon to b_ledon]
> (backported from commit 228bdfca9a09c1263c24509b4bc23a67be168e1a upstream)
> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>

The changes looks good, tested by the reporter, contained to rtl8192ce.

Acked-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>

> ---
> drivers/net/wireless/rtlwifi/base.c | 12 +++++++-----
> drivers/net/wireless/rtlwifi/pci.c | 3 ++-
> drivers/net/wireless/rtlwifi/rtl8192ce/led.c | 14 +++++++++++---
> drivers/net/wireless/rtlwifi/rtl8192ce/led.h | 1 -
> drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 1 -
> 5 files changed, 20 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
> index cf0b73e..173f4fe 100644
> --- a/drivers/net/wireless/rtlwifi/base.c
> +++ b/drivers/net/wireless/rtlwifi/base.c
> @@ -251,14 +251,16 @@ void rtl_init_rfkill(struct ieee80211_hw *hw)
> bool blocked;
> u8 valid = 0;
>
> - radio_state = rtlpriv->cfg->ops->radio_onoff_checking(hw, &valid);
> + /*set init state to on */
> + rtlpriv->rfkill.rfkill_state = 1;
> + wiphy_rfkill_set_hw_state(hw->wiphy, 0);
>
> - /*set init state to that of switch */
> - rtlpriv->rfkill.rfkill_state = radio_state;
> - printk(KERN_INFO "rtlwifi: wireless switch is %s
",
> - rtlpriv->rfkill.rfkill_state ? "on" : "off");
> + radio_state = rtlpriv->cfg->ops->radio_onoff_checking(hw, &valid);
>
> if (valid) {
> + printk(KERN_INFO "rtlwifi: wireless switch is %s
",
> + rtlpriv->rfkill.rfkill_state ? "on" : "off");
> +
> rtlpriv->rfkill.rfkill_state = radio_state;
>
> blocked = (rtlpriv->rfkill.rfkill_state == 1) ? 0 : 1;
> diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
> index 1758d44..4755c7b 100644
> --- a/drivers/net/wireless/rtlwifi/pci.c
> +++ b/drivers/net/wireless/rtlwifi/pci.c
> @@ -1878,7 +1878,8 @@ void rtl_pci_disconnect(struct pci_dev *pdev)
>
> rtl_pci_deinit(hw);
> rtl_deinit_core(hw);
> - rtlpriv->cfg->ops->deinit_sw_leds(hw);
> + if (rtlpriv->cfg->ops->deinit_sw_leds)
> + rtlpriv->cfg->ops->deinit_sw_leds(hw);
> _rtl_pci_io_handler_release(hw);
> rtlpriv->cfg->ops->deinit_sw_vars(hw);
>
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/led.c b/drivers/net/wireless/rtlwifi/rtl8192ce/led.c
> index 78a0569..1958e6a 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192ce/led.c
> +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/led.c
> @@ -32,6 +32,14 @@
> #include "reg.h"
> #include "led.h"
>
> +static void _rtl92ce_init_led(struct ieee80211_hw *hw,
> + struct rtl_led *pled, enum rtl_led_pin ledpin)
> +{
> + pled->hw = hw;
> + pled->ledpin = ledpin;
> + pled->b_ledon = false;
> +}
> +
> void rtl92ce_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
> {
> u8 ledcfg;
> @@ -97,10 +105,10 @@ void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
>
> void rtl92ce_init_sw_leds(struct ieee80211_hw *hw)
> {
> -}
> + struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw);
>
> -void rtl92ce_deinit_sw_leds(struct ieee80211_hw *hw)
> -{
> + _rtl92ce_init_led(hw, &(pcipriv->ledctl.sw_led0), LED_PIN_LED0);
> + _rtl92ce_init_led(hw, &(pcipriv->ledctl.sw_led1), LED_PIN_LED1);
> }
>
> void _rtl92ce_sw_led_control(struct ieee80211_hw *hw,
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/led.h b/drivers/net/wireless/rtlwifi/rtl8192ce/led.h
> index 10da301..94332b3 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192ce/led.h
> +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/led.h
> @@ -31,7 +31,6 @@
> #define __RTL92CE_LED_H__
>
> void rtl92ce_init_sw_leds(struct ieee80211_hw *hw);
> -void rtl92ce_deinit_sw_leds(struct ieee80211_hw *hw);
> void rtl92ce_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled);
> void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled);
> void rtl92ce_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction);
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
> index b366e88..920203a 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
> +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
> @@ -130,7 +130,6 @@ static struct rtl_hal_ops rtl8192ce_hal_ops = {
> .enable_hw_sec = rtl92ce_enable_hw_security_config,
> .set_key = rtl92ce_set_key,
> .init_sw_leds = rtl92ce_init_sw_leds,
> - .deinit_sw_leds = rtl92ce_deinit_sw_leds,
> .get_bbreg = rtl92c_phy_query_bb_reg,
> .set_bbreg = rtl92c_phy_set_bb_reg,
> .get_rfreg = rtl92c_phy_query_rf_reg,
> --
> 1.7.4.1
>
>
> --
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
>

--
[]'s
Herton

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 06-01-2011, 02:14 PM
Stefan Bader
 
Default rtlwifi: rtl8192ce: Fix LED initialization

Applied and pushed to Natty master-next

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 

Thread Tools




All times are GMT. The time now is 03:32 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org