From: Larry Finger <Larry.Finger@lwfinger.net>
To: 李朝明 <chaoming_li@realsil.com.cn>, linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] fix_rtlwifi_rfkill_state_not_synchronous_with_true_rfstate_issue
Date: Wed, 26 Jan 2011 11:34:01 -0600 [thread overview]
Message-ID: <4D405B09.9070900@lwfinger.net> (raw)
In-Reply-To: <5D449C23195D46B388A79AE17932553E@realsil.com.cn>
On 01/24/2011 11:08 PM, 李朝明 wrote:
> Sorry for last patch have no description.
>
> 1. when driver init, rfkill_state was setted, but because the flag valid may
> not be true, this will cause rfkill_state
> not synchronous with the true rf state, and will cause some issues when we
> do rfkill.
> and now in driver init we will set rfkill_state to rf_on, and at the same
> time
> we tell rfkill to set rf_on also.
>
> 2. for rtl8192ce you can check GPIO any time, not only after up_first_time
> == true. so we delete rtlpci->up_first_time
> in rtl92ce_gpio_radio_on_off_checking.
>
> Signed-off-by: chaoming_li <chaoming_li@realsil.com.cn>
Chaoming,
This patch was line wrapped by your mailer. I'm not sure what you need to do to
allow longer lines, but we can discuss this offline.
I still see a couple of problems with the code after this patch is applied. When
the system is booted or when rtl8192ce is loaded, the log always shows the
switch to be off, no matter the actual position. In addition, the status is not
logged when the switch is moved.
@John,
We will work out the points noted above and get a revised patch to you. I t
will likely be part of some larger changes in rtlwifi that are needed to
accommodate some new drivers that are nearly ready.
Larry
>
> ---
> drivers/net/wireless/rtlwifi/base.c | 13 ++++++++-----
> drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | 2 +-
> 2 files changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/wireless/rtlwifi/base.c
> b/drivers/net/wireless/rtlwifi/base.c
> index cf0b73e..33323b4 100644
> --- a/drivers/net/wireless/rtlwifi/base.c
> +++ b/drivers/net/wireless/rtlwifi/base.c
> @@ -251,15 +251,18 @@ void rtl_init_rfkill(struct ieee80211_hw *hw)
> bool blocked;
> u8 valid = 0;
>
> - radio_state = rtlpriv->cfg->ops->radio_onoff_checking(hw, &valid);
> + /*1. 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\n",
> - rtlpriv->rfkill.rfkill_state ? "on" : "off");
> + /*2. check gpio for rf state */
> + radio_state = rtlpriv->cfg->ops->radio_onoff_checking(hw, &valid);
>
> + /*3. if valid, change state based on gpio */
> if (valid) {
> rtlpriv->rfkill.rfkill_state = radio_state;
> + printk(KERN_INFO "rtlwifi: wireless switch is %s\n",
> + rtlpriv->rfkill.rfkill_state ? "on" :
> "off");
>
> blocked = (rtlpriv->rfkill.rfkill_state == 1) ? 0 : 1;
> wiphy_rfkill_set_hw_state(hw->wiphy, blocked);
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
> b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
> index 1c41a0c..cb2e01a 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
> +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
> @@ -1943,7 +1943,7 @@ bool rtl92ce_gpio_radio_on_off_checking(struct
> ieee80211_hw *hw, u8 * valid)
> bool b_actuallyset = false;
> unsigned long flag;
>
> - if ((rtlpci->up_first_time == 1) || (rtlpci->being_init_adapter))
> + if (rtlpci->being_init_adapter)
> return false;
>
> if (ppsc->b_swrf_processing)
next prev parent reply other threads:[~2011-01-26 17:33 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-08 17:12 [PATCH 00/22] rtl8192ce: Initial upload of driver Larry Finger
2010-12-08 17:12 ` [PATCH 01/22] rtl8192ce: Add files to rtlwifi - Part 1: core.{c,h} Larry Finger
2010-12-08 17:12 ` [PATCH 02/22] rtl8192ce: Add files to rtlwifi - Part 2: base.{c,h} Larry Finger
2010-12-08 17:12 ` [PATCH 03/22] rtl8192ce: Add files to rtlwifi - Part 3: cam.{c,h} Larry Finger
2010-12-08 17:12 ` [PATCH 04/22] rtl8192ce: Add files to rtlwifi - Part 4: debug.{c,h} Larry Finger
2011-01-25 4:10 ` [PATCH] fix_rtlwifi_rfkill_state_not_synchronous_with_true_rfstate_issue 李朝明
2011-01-25 5:08 ` 李朝明
2011-01-26 17:34 ` Larry Finger [this message]
2010-12-08 17:12 ` [PATCH 05/22] rtl8192ce: Add files to rtlwifi - Part 5: efuse.{c,h} Larry Finger
2010-12-08 17:12 ` [PATCH 06/22] rtl8192ce: Add files to rtlwifi - Part 6: pci.{c,h} Larry Finger
2010-12-08 17:12 ` [PATCH 07/22] rtl8192ce: Add files to rtlwifi - Part 7: ps.{c,h} Larry Finger
2010-12-08 17:12 ` [PATCH 08/22] rtl8192ce: Add files to rtlwifi - Part 8: rc.{c,h} Larry Finger
2010-12-08 17:12 ` [PATCH 09/22] rtl8192ce: Add files to rtlwifi - Part 9: regd.{c,h} Larry Finger
2010-12-08 17:12 ` [PATCH 10/22] rtl8192ce: Add files to rtlwifi - Part 10: wifi.h Larry Finger
2010-12-08 17:12 ` [PATCH 11/22] rtl8192ce: Add files to rtlwifi - Part 11: Kconfig and Makefile Larry Finger
2010-12-08 17:12 ` [PATCH 12/22] rtl8192ce: Add files to rtlwifi/rtl8192ce - Part 12: rtl8192c-dm.{c,h} Larry Finger
2010-12-08 17:12 ` [PATCH 13/22] rtl8192ce: Add files to rtlwifi/rtl8192ce - Part 13: rtl8192c-fw.{c,h} Larry Finger
2010-12-08 17:12 ` [PATCH 14/22] rtl8192ce: Add files to rtlwifi/rtl8192ce - Part 14: rtl8192c-hw.{c,h} Larry Finger
2010-12-08 17:12 ` [PATCH 15/22] rtl8192ce: Add files to rtlwifi/rtl8192ce - Part 15: rtl8192c-led.{c,h} Larry Finger
2010-12-08 17:12 ` [PATCH 16/22] rtl8192ce: Add files to rtlwifi/rtl8192ce - Part 16: rtl8192c-phy.{c,h} Larry Finger
2010-12-08 17:12 ` [PATCH 17/22] rtl8192ce: Add files to rtlwifi/rtl8192ce - Part 17: rtl8192c-sw.{c,h} Larry Finger
2010-12-08 17:12 ` [PATCH 18/22] rtl8192ce: Add files to rtlwifi/rtl8192ce - Part 18: rtl8192c-rf.{c,h} Larry Finger
2010-12-08 17:12 ` [PATCH 19/22] rtl8192ce: Add files to rtlwifi/rtl8192ce - Part 19: rtl8192c-table.{c,h} Larry Finger
2010-12-08 17:12 ` [PATCH 20/22] rtl8192ce: Add files to rtlwifi/rtl8192ce - Part 20: rtl8192c-trx.{c,h} Larry Finger
2010-12-08 17:12 ` [PATCH 21/22] rtl8192ce: Add files to rtlwifi/rtl8192ce - Part 21: rtl8192c-def.h, rtl8192-reg.h, and Makefile Larry Finger
2010-12-08 17:12 ` [PATCH 22/22] rtl8192ce: Part 22: Update drivers/net/wireless/Kconfig " Larry Finger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D405B09.9070900@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=chaoming_li@realsil.com.cn \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).