From: Zhu Yi <yi.zhu@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
Mohamed Abbas <mabbas@linux.intel.com>,
Emmanuel Grumbach <emmanuel.grumbach@intel.com>,
Tomas Winkler <tomas.winkler@intel.com>
Subject: [PATCH 13/29] iwlwifi: fix resume SW RF-kill
Date: Thu, 12 Jun 2008 09:47:03 +0800 [thread overview]
Message-ID: <1213235239-2954-14-git-send-email-yi.zhu@intel.com> (raw)
In-Reply-To: <1213235239-2954-13-git-send-email-yi.zhu@intel.com>
From: Mohamed Abbas <mabbas@linux.intel.com>
This patch fixes SW RF-kill. If we resumed from S3 state with SW RF-kill
set, the driver wouldn't be able to remove SW RF-kill. This patch fixes
this.
Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-core.h | 2 +-
drivers/net/wireless/iwlwifi/iwl-dev.h | 2 +-
drivers/net/wireless/iwlwifi/iwl4965-base.c | 31 +++++++++++++--------------
3 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index a86e08b..b4c9d5d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -129,7 +129,7 @@ struct iwl_lib_ops {
/* 1st ucode load */
int (*load_ucode)(struct iwl_priv *priv);
/* rfkill */
- void (*radio_kill_sw)(struct iwl_priv *priv, int disable_radio);
+ int (*radio_kill_sw)(struct iwl_priv *priv, int disable_radio);
/* power management */
struct {
int (*init)(struct iwl_priv *priv);
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index ac68cce..54e6ac8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -725,7 +725,7 @@ static inline u8 get_cmd_index(struct iwl_queue *q, u32 index, int is_huge)
struct iwl_priv;
-extern void iwl4965_radio_kill_sw(struct iwl_priv *priv, int disable_radio);
+extern int iwl4965_radio_kill_sw(struct iwl_priv *priv, int disable_radio);
/*
* Forward declare iwl-4965.c functions for iwl-base.c
*/
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index de40e89..7a9567c 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -1260,12 +1260,12 @@ static void iwl4965_set_rate(struct iwl_priv *priv)
(IWL_OFDM_BASIC_RATES_MASK >> IWL_FIRST_OFDM_RATE) & 0xFF;
}
-void iwl4965_radio_kill_sw(struct iwl_priv *priv, int disable_radio)
+int iwl4965_radio_kill_sw(struct iwl_priv *priv, int disable_radio)
{
unsigned long flags;
if (!!disable_radio == test_bit(STATUS_RF_KILL_SW, &priv->status))
- return;
+ return 0;
IWL_DEBUG_RF_KILL("Manual SW RF KILL set to: RADIO %s\n",
disable_radio ? "OFF" : "ON");
@@ -1290,7 +1290,7 @@ void iwl4965_radio_kill_sw(struct iwl_priv *priv, int disable_radio)
if (priv->mac80211_registered)
ieee80211_stop_queues(priv->hw);
}
- return;
+ return 0;
}
spin_lock_irqsave(&priv->lock, flags);
@@ -1311,11 +1311,11 @@ void iwl4965_radio_kill_sw(struct iwl_priv *priv, int disable_radio)
if (test_bit(STATUS_RF_KILL_HW, &priv->status)) {
IWL_DEBUG_RF_KILL("Can not turn radio back on - "
"disabled by HW switch\n");
- return;
+ return 0;
}
queue_work(priv->workqueue, &priv->restart);
- return;
+ return 1;
}
#define IWL_PACKET_RETRY_TIME HZ
@@ -3028,13 +3028,6 @@ static int __iwl4965_up(struct iwl_priv *priv)
return -EIO;
}
- if (test_bit(STATUS_RF_KILL_SW, &priv->status)) {
- IWL_WARNING("Radio disabled by SW RF kill (module "
- "parameter)\n");
- iwl_rfkill_set_hw_state(priv);
- return -ENODEV;
- }
-
if (!priv->ucode_data_backup.v_addr || !priv->ucode_data.v_addr) {
IWL_ERROR("ucode not available for device bringup\n");
return -EIO;
@@ -3088,7 +3081,8 @@ static int __iwl4965_up(struct iwl_priv *priv)
priv->ucode_data.len);
/* We return success when we resume from suspend and rf_kill is on. */
- if (test_bit(STATUS_RF_KILL_HW, &priv->status))
+ if (test_bit(STATUS_RF_KILL_HW, &priv->status) ||
+ test_bit(STATUS_RF_KILL_SW, &priv->status))
return 0;
for (i = 0; i < MAX_HW_RESTARTS; i++) {
@@ -3115,6 +3109,7 @@ static int __iwl4965_up(struct iwl_priv *priv)
set_bit(STATUS_EXIT_PENDING, &priv->status);
__iwl4965_down(priv);
+ clear_bit(STATUS_EXIT_PENDING, &priv->status);
/* tried to restart and config the device for as long as our
* patience could withstand */
@@ -3860,6 +3855,13 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co
priv->add_radiotap = !!(conf->flags & IEEE80211_CONF_RADIOTAP);
+
+ if (priv->cfg->ops->lib->radio_kill_sw &&
+ priv->cfg->ops->lib->radio_kill_sw(priv, !conf->radio_enabled)) {
+ IWL_DEBUG_MAC80211("leave - RF-KILL - waiting for uCode\n");
+ mutex_unlock(&priv->mutex);
+ }
+
if (!iwl_is_ready(priv)) {
IWL_DEBUG_MAC80211("leave - not ready\n");
ret = -EIO;
@@ -3912,9 +3914,6 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co
}
#endif
- if (priv->cfg->ops->lib->radio_kill_sw)
- priv->cfg->ops->lib->radio_kill_sw(priv, !conf->radio_enabled);
-
if (!conf->radio_enabled) {
IWL_DEBUG_MAC80211("leave - radio disabled\n");
goto out;
--
1.5.3.6
next prev parent reply other threads:[~2008-06-12 1:49 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-12 1:46 [PATCH 00/29] iwlwifi driver 06/12 updates Zhu Yi
2008-06-12 1:46 ` [PATCH 01/29] iwlwifi: removing IWL4965_HT config Zhu Yi
2008-06-12 1:46 ` [PATCH 02/29] iwlwifi: removes the RUN_TIME_CALIB ifdef Zhu Yi
2008-06-12 1:46 ` [PATCH 03/29] iwlwifi: clean up in setup/cancel deferred work Zhu Yi
2008-06-12 1:46 ` [PATCH 04/29] iwlwifi: add possibility to disable tx_power calibration Zhu Yi
2008-06-12 1:46 ` [PATCH 05/29] iwlwifi: map sw and hw ampdu queues Zhu Yi
2008-06-12 1:46 ` [PATCH 06/29] iwlwifi: add TX aggregation code for 5000 HW Zhu Yi
2008-06-12 1:46 ` [PATCH 07/29] iwlwifi: use ieee80211_conf to examine rate capabilities Zhu Yi
2008-06-12 1:46 ` [PATCH 08/29] iwlwifi: fix allow iwlwifi to aggregate according to tid load Zhu Yi
2008-06-12 1:46 ` [PATCH 09/29] iwlwifi: remove unused flag Zhu Yi
2008-06-12 1:47 ` [PATCH 10/29] iwlwifi: remove redundant flags regarding to FAT channel Zhu Yi
2008-06-12 1:47 ` [PATCH 11/29] iwlwifi: fix bug when moving from 11gn to 11a or 11an to 11g Zhu Yi
2008-06-12 1:47 ` [PATCH 12/29] iwlwifi: format log prints for easier parsing Zhu Yi
2008-06-12 1:47 ` Zhu Yi [this message]
2008-06-12 1:47 ` [PATCH 14/29] iwlwifi: fix resart flow after fw error Zhu Yi
2008-06-12 1:47 ` [PATCH 15/29] iwlwifi enabling IBSS (Ad-Hoc) mode Zhu Yi
2008-06-12 1:47 ` [PATCH 16/29] iwlwifi: Fix mode changes (ad-hoc <--> managed) Zhu Yi
2008-06-12 1:47 ` [PATCH 17/29] iwlwifi: refactor tx aggregation response flow Zhu Yi
2008-06-12 1:47 ` [PATCH 18/29] iwlwifi: refactor setting tx power Zhu Yi
2008-06-12 1:47 ` [PATCH 19/29] iwlwifi: add bad length check for WEP keys Zhu Yi
2008-06-12 1:47 ` [PATCH 20/29] iwlwifi: move scan to iwl-scan.c iwlcore Zhu Yi
2008-06-12 1:47 ` [PATCH 21/29] iwlwifi: move rate helpers to iwlcore Zhu Yi
2008-06-12 1:47 ` [PATCH 22/29] iwlwifi: cleans up scanning code Zhu Yi
2008-06-12 1:47 ` [PATCH 23/29] iwlwifi: move iwl4965_rf_kill_ct_config to iwl-core.c Zhu Yi
2008-06-12 1:47 ` [PATCH 24/29] iwlwifi: retfactor get_temperature functions Zhu Yi
2008-06-12 1:47 ` [PATCH 25/29] iwlwifi: remove dead code iwl4965_calc_db_from_ratio Zhu Yi
2008-06-12 1:47 ` [PATCH 26/29] mac80211 : fix for iwconfig in ad-hoc mode Zhu Yi
2008-06-12 1:47 ` [PATCH 27/29] iwlwifi: fix software rf_kill problem when interface is down Zhu Yi
2008-06-12 1:47 ` [PATCH 28/29] iwlwifi: general code clean up Zhu Yi
2008-06-12 1:47 ` [PATCH 29/29] iwlwifi: remove iwlcore_low_level_notify Zhu Yi
2008-06-12 2:14 ` [PATCH 26/29] mac80211 : fix for iwconfig in ad-hoc mode Dan Williams
2008-06-12 5:15 ` [PATCH 00/29] iwlwifi driver 06/12 updates Harvey Harrison
2008-06-12 5:26 ` Zhu Yi
2008-06-12 14:00 ` John W. Linville
2008-06-13 1:30 ` Zhu Yi
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=1213235239-2954-14-git-send-email-yi.zhu@intel.com \
--to=yi.zhu@intel.com \
--cc=emmanuel.grumbach@intel.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=mabbas@linux.intel.com \
--cc=tomas.winkler@intel.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).