diff options
author | Stanislav Nijnikov <stanislav.nijnikov@wdc.com> | 2018-02-15 15:14:05 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-02-16 02:34:24 +0300 |
commit | c648c2d27f168ae4faeb43f8c3074226aae3862c (patch) | |
tree | 11f41b8d2d1f64c8fcc512950f47e55b20698374 /drivers/scsi/ufs/ufs-sysfs.c | |
parent | c720c091222e26d46c0fd9c70144a0f916bf3993 (diff) | |
download | linux-c648c2d27f168ae4faeb43f8c3074226aae3862c.tar.xz |
scsi: ufs: sysfs: health descriptor
This patch introduces a sysfs group entry for the UFS health descriptor
parameters. The group adds "health_descriptor" folder under the UFS driver
sysfs entry (/sys/bus/platform/drivers/ufshcd/*). The parameters are shown
as hexadecimal numbers. The full information about the parameters could be
found at UFS specifications 2.1.
Signed-off-by: Stanislav Nijnikov <stanislav.nijnikov@wdc.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ufs/ufs-sysfs.c')
-rw-r--r-- | drivers/scsi/ufs/ufs-sysfs.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufs-sysfs.c b/drivers/scsi/ufs/ufs-sysfs.c index ecd3dcb05f67..c4f18b0970db 100644 --- a/drivers/scsi/ufs/ufs-sysfs.c +++ b/drivers/scsi/ufs/ufs-sysfs.c @@ -349,11 +349,31 @@ static const struct attribute_group ufs_sysfs_geometry_descriptor_group = { .attrs = ufs_sysfs_geometry_descriptor, }; +#define UFS_HEALTH_DESC_PARAM(_name, _uname, _size) \ + UFS_DESC_PARAM(_name, _uname, HEALTH, _size) + +UFS_HEALTH_DESC_PARAM(eol_info, _EOL_INFO, 1); +UFS_HEALTH_DESC_PARAM(life_time_estimation_a, _LIFE_TIME_EST_A, 1); +UFS_HEALTH_DESC_PARAM(life_time_estimation_b, _LIFE_TIME_EST_B, 1); + +static struct attribute *ufs_sysfs_health_descriptor[] = { + &dev_attr_eol_info.attr, + &dev_attr_life_time_estimation_a.attr, + &dev_attr_life_time_estimation_b.attr, + NULL, +}; + +static const struct attribute_group ufs_sysfs_health_descriptor_group = { + .name = "health_descriptor", + .attrs = ufs_sysfs_health_descriptor, +}; + static const struct attribute_group *ufs_sysfs_groups[] = { &ufs_sysfs_default_group, &ufs_sysfs_device_descriptor_group, &ufs_sysfs_interconnect_descriptor_group, &ufs_sysfs_geometry_descriptor_group, + &ufs_sysfs_health_descriptor_group, NULL, }; |