iwlwifi: indicate txpower is off in sysfs
authorJay Sternberg <jay.e.sternberg@linux.intel.com>
Wed, 17 Dec 2008 08:52:34 +0000 (16:52 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 19 Dec 2008 20:23:42 +0000 (15:23 -0500)
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>
drivers/net/wireless/iwlwifi/iwl-agn.c

index ff8635f0ed458a3fee353be6da534f97a160b36c..5da6b35cd26dbfa52da035a6ed78b871957b5c42 100644 (file)
@@ -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,