Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc6f59bc authored by Tomas Winkler's avatar Tomas Winkler Committed by John W. Linville
Browse files

iwlwifi: add device sysfs version entry



This patch adds sysfs version file that displays ucode version
and type.

Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent f3d67999
Loading
Loading
Loading
Loading
+20 −0
Original line number Original line Diff line number Diff line
@@ -5993,6 +5993,25 @@ static DEVICE_ATTR(debug_level, S_IWUSR | S_IRUGO,
#endif /* CONFIG_IWLWIFI_DEBUG */
#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,
static ssize_t show_temperature(struct device *d,
				struct device_attribute *attr, char *buf)
				struct device_attribute *attr, char *buf)
{
{
@@ -6438,6 +6457,7 @@ static struct attribute *iwl4965_sysfs_entries[] = {
#ifdef CONFIG_IWLWIFI_DEBUG
#ifdef CONFIG_IWLWIFI_DEBUG
	&dev_attr_debug_level.attr,
	&dev_attr_debug_level.attr,
#endif
#endif
	&dev_attr_version.attr,


	NULL
	NULL
};
};