summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-05-06 11:05:13 +0800
committerJohn W. Linville <linville@tuxdriver.com>2008-05-14 16:29:47 -0400
commitbc6f59bc9b2f494ca1b018622f1fbd25933bc920 (patch)
tree6ddbe6087aa41efdfd1ed5757fdeac99d6149b74
parentf3d67999348776638644fd0035ee465261cc8c68 (diff)
downloadblackbird-op-linux-bc6f59bc9b2f494ca1b018622f1fbd25933bc920.tar.gz
blackbird-op-linux-bc6f59bc9b2f494ca1b018622f1fbd25933bc920.zip
iwlwifi: add device sysfs version entry
This patch adds sysfs version file that displays ucode version and type. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 901d9cf9ad78..7708b19ca0cc 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -5993,6 +5993,25 @@ static DEVICE_ATTR(debug_level, S_IWUSR | S_IRUGO,
#endif /* CONFIG_IWLWIFI_DEBUG */
+static ssize_t show_version(struct device *d,
+ struct device_attribute *attr, char *buf)
+{
+ struct iwl_priv *priv = d->driver_data;
+ struct iwl4965_alive_resp *palive = &priv->card_alive;
+
+ if (palive->is_valid)
+ return sprintf(buf, "fw version: 0x%01X.0x%01X.0x%01X.0x%01X\n"
+ "fw type: 0x%01X 0x%01X\n",
+ palive->ucode_major, palive->ucode_minor,
+ palive->sw_rev[0], palive->sw_rev[1],
+ palive->ver_type, palive->ver_subtype);
+
+ else
+ return sprintf(buf, "fw not loaded\n");
+}
+
+static DEVICE_ATTR(version, S_IWUSR | S_IRUGO, show_version, NULL);
+
static ssize_t show_temperature(struct device *d,
struct device_attribute *attr, char *buf)
{
@@ -6438,6 +6457,7 @@ static struct attribute *iwl4965_sysfs_entries[] = {
#ifdef CONFIG_IWLWIFI_DEBUG
&dev_attr_debug_level.attr,
#endif
+ &dev_attr_version.attr,
NULL
};
OpenPOWER on IntegriCloud