diff options
author | Jay Sternberg <jay.e.sternberg@linux.intel.com> | 2008-12-17 03:52:34 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-12-19 15:23:42 -0500 |
commit | 91f39e8eea725347b6a82d1e35e512ec8b298b0b (patch) | |
tree | 7fa577f135b1a1a45e794c066a6b58eb46ea2c77 /drivers/net/wireless/iwlwifi | |
parent | f1bc4ac61f2c08515afd80c6dc3962aa6d0b138b (diff) |
iwlwifi: indicate txpower is off in sysfs
The patch checks if the radio is disabled before displaying the tx power
level. Previously when the txpower was set off show_tx_power still
returned the prior power level. Now it will indicate the power has been
turned off.
Signed-off-by: Jay Sternberg <jay.e.sternberg@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index ff8635f0ed45..5da6b35cd26d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -3418,7 +3418,11 @@ static ssize_t show_tx_power(struct device *d, | |||
3418 | struct device_attribute *attr, char *buf) | 3418 | struct device_attribute *attr, char *buf) |
3419 | { | 3419 | { |
3420 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 3420 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; |
3421 | return sprintf(buf, "%d\n", priv->tx_power_user_lmt); | 3421 | |
3422 | if (!iwl_is_ready_rf(priv)) | ||
3423 | return sprintf(buf, "off\n"); | ||
3424 | else | ||
3425 | return sprintf(buf, "%d\n", priv->tx_power_user_lmt); | ||
3422 | } | 3426 | } |
3423 | 3427 | ||
3424 | static ssize_t store_tx_power(struct device *d, | 3428 | static ssize_t store_tx_power(struct device *d, |