diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2015-09-10 10:18:00 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-09-20 19:30:10 -0700 |
commit | 40b7320ee413d0d1cc89c32c2a757fda56d27708 (patch) | |
tree | 28532e912f62603e3ee2744a4c6773ea0c53961b /drivers/misc/mei/bus.c | |
parent | 59796edcf21c7c19d58a223001f9ed13746c51c2 (diff) | |
download | blackbird-obmc-linux-40b7320ee413d0d1cc89c32c2a757fda56d27708.tar.gz blackbird-obmc-linux-40b7320ee413d0d1cc89c32c2a757fda56d27708.zip |
mei: bus: export client protocol version
export me client protocol version to sysfs and uevent
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/bus.c')
-rw-r--r-- | drivers/misc/mei/bus.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index e294f70741a0..d92017fa1630 100644 --- a/drivers/misc/mei/bus.c +++ b/drivers/misc/mei/bus.c @@ -590,6 +590,19 @@ static ssize_t uuid_show(struct device *dev, struct device_attribute *a, } static DEVICE_ATTR_RO(uuid); +static ssize_t version_show(struct device *dev, struct device_attribute *a, + char *buf) +{ + struct mei_cl_device *cldev = to_mei_cl_device(dev); + u8 version = mei_me_cl_ver(cldev->me_cl); + size_t len; + + len = snprintf(buf, PAGE_SIZE, "%02X", version); + + return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len; +} +static DEVICE_ATTR_RO(version); + static ssize_t modalias_show(struct device *dev, struct device_attribute *a, char *buf) { @@ -605,6 +618,7 @@ static DEVICE_ATTR_RO(modalias); static struct attribute *mei_cl_dev_attrs[] = { &dev_attr_name.attr, &dev_attr_uuid.attr, + &dev_attr_version.attr, &dev_attr_modalias.attr, NULL, }; @@ -622,6 +636,10 @@ static int mei_cl_device_uevent(struct device *dev, struct kobj_uevent_env *env) { struct mei_cl_device *cldev = to_mei_cl_device(dev); const uuid_le *uuid = mei_me_cl_uuid(cldev->me_cl); + u8 version = mei_me_cl_ver(cldev->me_cl); + + if (add_uevent_var(env, "MEI_CL_VERSION=%d", version)) + return -ENOMEM; if (add_uevent_var(env, "MEI_CL_UUID=%pUl", uuid)) return -ENOMEM; |