aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-06-30 05:23:02 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-30 17:37:38 -0400
commitf236a2657794b6f10b582bf6ccfbca7bf0d5ec82 (patch)
tree75673ee21071436164a84d699345bf66d2a7bdd7 /drivers/net
parent853554accce19d16b03476676bdcb1ccdd44caae (diff)
iwlwifi: Add eeprom version to the version file in sysfs
This patch adds eeprom version display into device/version sysfs file /sys/class/net/wlanX/devices/version Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@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')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index f5911687671b..6eee28dbdde8 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -3728,16 +3728,28 @@ static ssize_t show_version(struct device *d,
3728{ 3728{
3729 struct iwl_priv *priv = d->driver_data; 3729 struct iwl_priv *priv = d->driver_data;
3730 struct iwl_alive_resp *palive = &priv->card_alive; 3730 struct iwl_alive_resp *palive = &priv->card_alive;
3731 ssize_t pos = 0;
3732 u16 eeprom_ver;
3731 3733
3732 if (palive->is_valid) 3734 if (palive->is_valid)
3733 return sprintf(buf, "fw version: 0x%01X.0x%01X.0x%01X.0x%01X\n" 3735 pos += sprintf(buf + pos,
3734 "fw type: 0x%01X 0x%01X\n", 3736 "fw version: 0x%01X.0x%01X.0x%01X.0x%01X\n"
3737 "fw type: 0x%01X 0x%01X\n",
3735 palive->ucode_major, palive->ucode_minor, 3738 palive->ucode_major, palive->ucode_minor,
3736 palive->sw_rev[0], palive->sw_rev[1], 3739 palive->sw_rev[0], palive->sw_rev[1],
3737 palive->ver_type, palive->ver_subtype); 3740 palive->ver_type, palive->ver_subtype);
3738
3739 else 3741 else
3740 return sprintf(buf, "fw not loaded\n"); 3742 pos += sprintf(buf + pos, "fw not loaded\n");
3743
3744 if (priv->eeprom) {
3745 eeprom_ver = iwl_eeprom_query16(priv, EEPROM_VERSION);
3746 pos += sprintf(buf + pos, "EEPROM version: 0x%x\n",
3747 eeprom_ver);
3748 } else {
3749 pos += sprintf(buf + pos, "EEPROM not initialzed\n");
3750 }
3751
3752 return pos;
3741} 3753}
3742 3754
3743static DEVICE_ATTR(version, S_IWUSR | S_IRUGO, show_version, NULL); 3755static DEVICE_ATTR(version, S_IWUSR | S_IRUGO, show_version, NULL);