summaryrefslogtreecommitdiff
path: root/drivers/scsi/mpt3sas/mpt3sas_ctl.c
diff options
context:
space:
mode:
authorSuganath Prabu <suganath-prabu.subramani@broadcom.com>2019-08-03 16:59:53 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2019-08-08 05:46:51 +0300
commit3ac8e47bbf2dfada890396b2994fe2765afd8cef (patch)
treed5262348f7b57d75ef4f3c3e915f3dcd4ca8829b /drivers/scsi/mpt3sas/mpt3sas_ctl.c
parentba630ea068d7cb593ae3bb7085846c5a137d10a6 (diff)
downloadlinux-3ac8e47bbf2dfada890396b2994fe2765afd8cef.tar.xz
scsi: mpt3sas: Add sysfs to know supported features
Currently with sysfs parameter "drv_support_bitmap" driver exposes whether driver supports toolbox memory move command or not. And application should issue the toolbox memory move command only if driver tell that memory move tool box command is supported through this sysfs parameter. In future we can utilize this sysfs parameter if any new feature is added and need to notify the same to applications. Signed-off-by: Suganath Prabu <suganath-prabu.subramani@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/mpt3sas/mpt3sas_ctl.c')
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_ctl.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
index d766ae71a61d..da29005d72bd 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
@@ -3382,6 +3382,24 @@ static DEVICE_ATTR_RW(diag_trigger_mpi);
/*****************************************/
+/**
+ * drv_support_bitmap_show - driver supported feature bitmap
+ * @cdev - pointer to embedded class device
+ * @buf - the buffer returned
+ *
+ * A sysfs 'read-only' shost attribute.
+ */
+static ssize_t
+drv_support_bitmap_show(struct device *cdev,
+ struct device_attribute *attr, char *buf)
+{
+ struct Scsi_Host *shost = class_to_shost(cdev);
+ struct MPT3SAS_ADAPTER *ioc = shost_priv(shost);
+
+ return snprintf(buf, PAGE_SIZE, "0x%08x\n", ioc->drv_support_bitmap);
+}
+static DEVICE_ATTR_RO(drv_support_bitmap);
+
struct device_attribute *mpt3sas_host_attrs[] = {
&dev_attr_version_fw,
&dev_attr_version_bios,
@@ -3407,6 +3425,7 @@ struct device_attribute *mpt3sas_host_attrs[] = {
&dev_attr_diag_trigger_event,
&dev_attr_diag_trigger_scsi,
&dev_attr_diag_trigger_mpi,
+ &dev_attr_drv_support_bitmap,
&dev_attr_BRM_status,
NULL,
};