diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-05-05 23:05:13 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-14 16:29:47 -0400 |
commit | bc6f59bc9b2f494ca1b018622f1fbd25933bc920 (patch) | |
tree | 6ddbe6087aa41efdfd1ed5757fdeac99d6149b74 /drivers | |
parent | f3d67999348776638644fd0035ee465261cc8c68 (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 20 |
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, | |||
5993 | #endif /* CONFIG_IWLWIFI_DEBUG */ | 5993 | #endif /* CONFIG_IWLWIFI_DEBUG */ |
5994 | 5994 | ||
5995 | 5995 | ||
5996 | static ssize_t show_version(struct device *d, | ||
5997 | struct device_attribute *attr, char *buf) | ||
5998 | { | ||
5999 | struct iwl_priv *priv = d->driver_data; | ||
6000 | struct iwl4965_alive_resp *palive = &priv->card_alive; | ||
6001 | |||
6002 | if (palive->is_valid) | ||
6003 | return sprintf(buf, "fw version: 0x%01X.0x%01X.0x%01X.0x%01X\n" | ||
6004 | "fw type: 0x%01X 0x%01X\n", | ||
6005 | palive->ucode_major, palive->ucode_minor, | ||
6006 | palive->sw_rev[0], palive->sw_rev[1], | ||
6007 | palive->ver_type, palive->ver_subtype); | ||
6008 | |||
6009 | else | ||
6010 | return sprintf(buf, "fw not loaded\n"); | ||
6011 | } | ||
6012 | |||
6013 | static DEVICE_ATTR(version, S_IWUSR | S_IRUGO, show_version, NULL); | ||
6014 | |||
5996 | static ssize_t show_temperature(struct device *d, | 6015 | static ssize_t show_temperature(struct device *d, |
5997 | struct device_attribute *attr, char *buf) | 6016 | struct device_attribute *attr, char *buf) |
5998 | { | 6017 | { |
@@ -6438,6 +6457,7 @@ static struct attribute *iwl4965_sysfs_entries[] = { | |||
6438 | #ifdef CONFIG_IWLWIFI_DEBUG | 6457 | #ifdef CONFIG_IWLWIFI_DEBUG |
6439 | &dev_attr_debug_level.attr, | 6458 | &dev_attr_debug_level.attr, |
6440 | #endif | 6459 | #endif |
6460 | &dev_attr_version.attr, | ||
6441 | 6461 | ||
6442 | NULL | 6462 | NULL |
6443 | }; | 6463 | }; |