* [PATCH] iwl3945: do not print RFKILL message @ 2013-10-25 10:37 Stanislaw Gruszka 2013-10-25 11:17 ` Johannes Berg 0 siblings, 1 reply; 5+ messages in thread From: Stanislaw Gruszka @ 2013-10-25 10:37 UTC (permalink / raw) To: linux-wireless; +Cc: Dietmar Rudolph 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. Note that iwl4965 handle this problem differently, it allows to open device when radio is disabled. Reported-by: Dietmar Rudolph <dietmar@crlf.de> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> --- drivers/net/wireless/iwlegacy/3945-mac.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c index dea3b50..f7c2145 100644 --- a/drivers/net/wireless/iwlegacy/3945-mac.c +++ b/drivers/net/wireless/iwlegacy/3945-mac.c @@ -2396,8 +2396,7 @@ __il3945_up(struct il_priv *il) clear_bit(S_RFKILL, &il->status); else { set_bit(S_RFKILL, &il->status); - IL_WARN("Radio disabled by HW RF Kill switch\n"); - return -ENODEV; + return -ERFKILL; } _il_wr(il, CSR_INT, 0xFFFFFFFF); -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] iwl3945: do not print RFKILL message 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 0 siblings, 1 reply; 5+ messages in thread From: Johannes Berg @ 2013-10-25 11:17 UTC (permalink / raw) To: Stanislaw Gruszka; +Cc: linux-wireless, Dietmar Rudolph 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? johannes ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iwl3945: do not print RFKILL message 2013-10-25 11:17 ` Johannes Berg @ 2013-10-30 8:34 ` Stanislaw Gruszka 2013-10-30 8:51 ` Dietmar Rudolph 2013-10-30 13:34 ` Pedro Francisco 0 siblings, 2 replies; 5+ messages in thread From: Stanislaw Gruszka @ 2013-10-30 8:34 UTC (permalink / raw) To: Johannes Berg; +Cc: linux-wireless, Dietmar Rudolph, Pedro Francisco [-- 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; ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] iwl3945: do not print RFKILL message 2013-10-30 8:34 ` Stanislaw Gruszka @ 2013-10-30 8:51 ` Dietmar Rudolph 2013-10-30 13:34 ` Pedro Francisco 1 sibling, 0 replies; 5+ messages in thread From: Dietmar Rudolph @ 2013-10-30 8:51 UTC (permalink / raw) To: Stanislaw Gruszka, Johannes Berg; +Cc: linux-wireless, Pedro Francisco > 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, I'm sorry a cannot be any help here as I don't have the time nor the environment to compile and test your patch. In regard to this, I'm just a plain end user who installed Ubuntu out of the box. I had nticed the problem of the ever growing kernel log and found this mailing list to be the right spot to post a bug report. And I noticed your immediate reaction. Keep up the great work. Kind regards Dietmar -- Dietmar Rudolph Geschäftsführer/President CR/LF GmbH Obere Fuhr 27, 45136 Essen, Germany phone: ++49 201 254566 mailto: dietmar@crlf.de, http://www.crlf.de CR/LF Beratungsgesellschaft für EDV-Anwendungen mbH Essen HRB 7016 - GF: Dipl.-Math. Dietmar Rudolph ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iwl3945: do not print RFKILL message 2013-10-30 8:34 ` Stanislaw Gruszka 2013-10-30 8:51 ` Dietmar Rudolph @ 2013-10-30 13:34 ` Pedro Francisco 1 sibling, 0 replies; 5+ messages in thread From: Pedro Francisco @ 2013-10-30 13:34 UTC (permalink / raw) To: Stanislaw Gruszka; +Cc: ML linux-wireless On Wed, Oct 30, 2013 at 8:34 AM, Stanislaw Gruszka <sgruszka@redhat.com> wrote: > 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? My main laptop is no longer the one with the 3945. That being said, I still intend to test the other patches (powersave) and I can add this one to the mix, I just don't know when :) -- Pedro ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-10-30 13:34 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 2013-10-30 8:51 ` Dietmar Rudolph 2013-10-30 13:34 ` Pedro Francisco
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).