From: Jay Sternberg Date: Wed, 17 Dec 2008 08:52:34 +0000 (+0800) Subject: iwlwifi: indicate txpower is off in sysfs X-Git-Tag: v2.6.29-rc1~581^2~105^2~15 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=91f39e8eea725347b6a82d1e35e512ec8b298b0b;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Zhu Yi Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index ff8635f0ed4..5da6b35cd26 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, struct device_attribute *attr, char *buf) { struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; - return sprintf(buf, "%d\n", priv->tx_power_user_lmt); + + if (!iwl_is_ready_rf(priv)) + return sprintf(buf, "off\n"); + else + return sprintf(buf, "%d\n", priv->tx_power_user_lmt); } static ssize_t store_tx_power(struct device *d,