aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2010-10-25 04:34:50 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-11-15 13:24:22 -0500
commit4beeba7dc59cc10d6a47346c857d1a64a9ec9642 (patch)
tree41c4c1fb9cc2c65840f3b0beb4ef9ce329817133 /drivers/net
parentc7317e41df30c7e04dca46360e5ebb0cb36dda45 (diff)
iwlwifi: warn when send tx power settings during scan
Add WARN_ONCE when scanning is pending. Use STATUS_SCAN_HW bit since we can have scan canceled or completed but STATUS_SCANNING bit still set. v1 -> v2: replace EIO to EAGAIN Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c4
3 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 176e52577673..4d7130c9b72c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -1451,6 +1451,10 @@ static int iwl3945_send_tx_power(struct iwl_priv *priv)
1451 }; 1451 };
1452 u16 chan; 1452 u16 chan;
1453 1453
1454 if (WARN_ONCE(test_bit(STATUS_SCAN_HW, &priv->status),
1455 "TX Power requested while scanning!\n"))
1456 return -EAGAIN;
1457
1454 chan = le16_to_cpu(priv->contexts[IWL_RXON_CTX_BSS].active.channel); 1458 chan = le16_to_cpu(priv->contexts[IWL_RXON_CTX_BSS].active.channel);
1455 1459
1456 txpower.band = (priv->band == IEEE80211_BAND_5GHZ) ? 0 : 1; 1460 txpower.band = (priv->band == IEEE80211_BAND_5GHZ) ? 0 : 1;
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index b207e3e9299f..ee9c582c8cf2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -1377,13 +1377,9 @@ static int iwl4965_send_tx_power(struct iwl_priv *priv)
1377 u8 ctrl_chan_high = 0; 1377 u8 ctrl_chan_high = 0;
1378 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; 1378 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
1379 1379
1380 if (test_bit(STATUS_SCANNING, &priv->status)) { 1380 if (WARN_ONCE(test_bit(STATUS_SCAN_HW, &priv->status),
1381 /* If this gets hit a lot, switch it to a BUG() and catch 1381 "TX Power requested while scanning!\n"))
1382 * the stack trace to find out who is calling this during
1383 * a scan. */
1384 IWL_WARN(priv, "TX Power requested while scanning!\n");
1385 return -EAGAIN; 1382 return -EAGAIN;
1386 }
1387 1383
1388 band = priv->band == IEEE80211_BAND_2GHZ; 1384 band = priv->band == IEEE80211_BAND_2GHZ;
1389 1385
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index b555edd53354..5e3d799ea3b5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -496,6 +496,10 @@ int iwlagn_send_tx_power(struct iwl_priv *priv)
496 struct iwlagn_tx_power_dbm_cmd tx_power_cmd; 496 struct iwlagn_tx_power_dbm_cmd tx_power_cmd;
497 u8 tx_ant_cfg_cmd; 497 u8 tx_ant_cfg_cmd;
498 498
499 if (WARN_ONCE(test_bit(STATUS_SCAN_HW, &priv->status),
500 "TX Power requested while scanning!\n"))
501 return -EAGAIN;
502
499 /* half dBm need to multiply */ 503 /* half dBm need to multiply */
500 tx_power_cmd.global_lmt = (s8)(2 * priv->tx_power_user_lmt); 504 tx_power_cmd.global_lmt = (s8)(2 * priv->tx_power_user_lmt);
501 505