From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, Dietmar Rudolph <dietmar@crlf.de>,
Pedro Francisco <pedrogfrancisco@gmail.com>
Subject: Re: [PATCH] iwl3945: do not print RFKILL message
Date: Wed, 30 Oct 2013 09:34:34 +0100 [thread overview]
Message-ID: <20131030083432.GA1478@redhat.com> (raw)
In-Reply-To: <1382699879.12755.0.camel@jlt4.sipsolutions.net>
[-- Attachment #1: Type: text/plain, Size: 730 bytes --]
On Fri, Oct 25, 2013 at 01:17:59PM +0200, Johannes Berg wrote:
> On Fri, 2013-10-25 at 12:37 +0200, Stanislaw Gruszka wrote:
> > We can mess logs if user space try to open device again and again if
> > RFKILL switch is on. Do not print message and return ERFKILL error
> > instead to indicate where the problem is.
>
> Are you maybe not calling wiphy_rfkill_set_hw_state() in the right
> places?
This is done from work scheduled every 2 second if rfkill state change,
but is possible that initial state is not provided to upper layer.
Dietmar or Pedro, could you test attached patch (my old laptop with 3945
does not work any longer). It is alternative to previous patch posted
before, does rfkill work ok with it?
Stanislaw
[-- Attachment #2: iwl3945_rfkill.patch --]
[-- Type: text/plain, Size: 1206 bytes --]
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index dea3b50..74e2b0a 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -2202,6 +2202,9 @@ il3945_alive_start(struct il_priv *il)
} else
set_bit(S_RFKILL, &il->status);
+ wiphy_rfkill_set_hw_state(il->hw->wiphy,
+ test_bit(S_RFKILL, &il->status));
+
/* After the ALIVE response, we can send commands to 3945 uCode */
set_bit(S_ALIVE, &il->status);
@@ -2397,7 +2400,7 @@ __il3945_up(struct il_priv *il)
else {
set_bit(S_RFKILL, &il->status);
IL_WARN("Radio disabled by HW RF Kill switch\n");
- return -ENODEV;
+ return 0;
}
_il_wr(il, CSR_INT, 0xFFFFFFFF);
@@ -2825,6 +2828,9 @@ il3945_mac_start(struct ieee80211_hw *hw)
if (ret)
goto out_release_irq;
+ if (il_is_rfkill(il))
+ goto out;
+
D_INFO("Start UP work.\n");
/* Wait for START_ALIVE from ucode. Otherwise callbacks from
@@ -2845,6 +2851,7 @@ il3945_mac_start(struct ieee80211_hw *hw)
* no need to poll the killswitch state anymore */
cancel_delayed_work(&il->_3945.rfkill_poll);
+out:
il->is_open = 1;
D_MAC80211("leave\n");
return 0;
next prev parent reply other threads:[~2013-10-30 8:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-25 10:37 [PATCH] iwl3945: do not print RFKILL message Stanislaw Gruszka
2013-10-25 11:17 ` Johannes Berg
2013-10-30 8:34 ` Stanislaw Gruszka [this message]
2013-10-30 8:51 ` Dietmar Rudolph
2013-10-30 13:34 ` Pedro Francisco
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=20131030083432.GA1478@redhat.com \
--to=sgruszka@redhat.com \
--cc=dietmar@crlf.de \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=pedrogfrancisco@gmail.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).