aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/osd/osd_uld.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/scsi/osd/osd_uld.c b/drivers/scsi/osd/osd_uld.c
index d4ed9eb52657..43754176a7b7 100644
--- a/drivers/scsi/osd/osd_uld.c
+++ b/drivers/scsi/osd/osd_uld.c
@@ -97,9 +97,37 @@ struct osd_dev_handle {
97 97
98static DEFINE_IDA(osd_minor_ida); 98static DEFINE_IDA(osd_minor_ida);
99 99
100/*
101 * scsi sysfs attribute operations
102 */
103static ssize_t osdname_show(struct device *dev, struct device_attribute *attr,
104 char *buf)
105{
106 struct osd_uld_device *ould = container_of(dev, struct osd_uld_device,
107 class_dev);
108 return sprintf(buf, "%s\n", ould->odi.osdname);
109}
110
111static ssize_t systemid_show(struct device *dev, struct device_attribute *attr,
112 char *buf)
113{
114 struct osd_uld_device *ould = container_of(dev, struct osd_uld_device,
115 class_dev);
116
117 memcpy(buf, ould->odi.systemid, ould->odi.systemid_len);
118 return ould->odi.systemid_len;
119}
120
121static struct device_attribute osd_uld_attrs[] = {
122 __ATTR(osdname, S_IRUGO, osdname_show, NULL),
123 __ATTR(systemid, S_IRUGO, systemid_show, NULL),
124 __ATTR_NULL,
125};
126
100static struct class osd_uld_class = { 127static struct class osd_uld_class = {
101 .owner = THIS_MODULE, 128 .owner = THIS_MODULE,
102 .name = "scsi_osd", 129 .name = "scsi_osd",
130 .dev_attrs = osd_uld_attrs,
103}; 131};
104 132
105/* 133/*