Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 1 | /* |
| 2 | * zfcp device driver |
| 3 | * |
| 4 | * sysfs attributes. |
| 5 | * |
Heiko Carstens | a53c8fa | 2012-07-20 11:15:04 +0200 | [diff] [blame] | 6 | * Copyright IBM Corp. 2008, 2010 |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 7 | */ |
| 8 | |
Christof Schmitt | ecf39d4 | 2008-12-25 13:39:53 +0100 | [diff] [blame] | 9 | #define KMSG_COMPONENT "zfcp" |
| 10 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
| 11 | |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 12 | #include <linux/slab.h> |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 13 | #include "zfcp_ext.h" |
| 14 | |
| 15 | #define ZFCP_DEV_ATTR(_feat, _name, _mode, _show, _store) \ |
| 16 | struct device_attribute dev_attr_##_feat##_##_name = __ATTR(_name, _mode,\ |
| 17 | _show, _store) |
| 18 | #define ZFCP_DEFINE_ATTR(_feat_def, _feat, _name, _format, _value) \ |
| 19 | static ssize_t zfcp_sysfs_##_feat##_##_name##_show(struct device *dev, \ |
| 20 | struct device_attribute *at,\ |
| 21 | char *buf) \ |
| 22 | { \ |
Christof Schmitt | 615f59e | 2010-02-17 11:18:56 +0100 | [diff] [blame] | 23 | struct _feat_def *_feat = container_of(dev, struct _feat_def, dev); \ |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 24 | \ |
| 25 | return sprintf(buf, _format, _value); \ |
| 26 | } \ |
| 27 | static ZFCP_DEV_ATTR(_feat, _name, S_IRUGO, \ |
| 28 | zfcp_sysfs_##_feat##_##_name##_show, NULL); |
| 29 | |
Martin Peschke | b5dc3c4 | 2013-08-22 17:45:38 +0200 | [diff] [blame] | 30 | #define ZFCP_DEFINE_ATTR_CONST(_feat, _name, _format, _value) \ |
| 31 | static ssize_t zfcp_sysfs_##_feat##_##_name##_show(struct device *dev, \ |
| 32 | struct device_attribute *at,\ |
| 33 | char *buf) \ |
| 34 | { \ |
| 35 | return sprintf(buf, _format, _value); \ |
| 36 | } \ |
| 37 | static ZFCP_DEV_ATTR(_feat, _name, S_IRUGO, \ |
| 38 | zfcp_sysfs_##_feat##_##_name##_show, NULL); |
| 39 | |
Swen Schillig | de3dc57 | 2009-11-24 16:54:00 +0100 | [diff] [blame] | 40 | #define ZFCP_DEFINE_A_ATTR(_name, _format, _value) \ |
| 41 | static ssize_t zfcp_sysfs_adapter_##_name##_show(struct device *dev, \ |
| 42 | struct device_attribute *at,\ |
| 43 | char *buf) \ |
| 44 | { \ |
| 45 | struct ccw_device *cdev = to_ccwdev(dev); \ |
| 46 | struct zfcp_adapter *adapter = zfcp_ccw_adapter_by_cdev(cdev); \ |
| 47 | int i; \ |
| 48 | \ |
| 49 | if (!adapter) \ |
| 50 | return -ENODEV; \ |
| 51 | \ |
| 52 | i = sprintf(buf, _format, _value); \ |
| 53 | zfcp_ccw_adapter_put(adapter); \ |
| 54 | return i; \ |
| 55 | } \ |
| 56 | static ZFCP_DEV_ATTR(adapter, _name, S_IRUGO, \ |
| 57 | zfcp_sysfs_adapter_##_name##_show, NULL); |
| 58 | |
| 59 | ZFCP_DEFINE_A_ATTR(status, "0x%08x\n", atomic_read(&adapter->status)); |
| 60 | ZFCP_DEFINE_A_ATTR(peer_wwnn, "0x%016llx\n", |
| 61 | (unsigned long long) adapter->peer_wwnn); |
| 62 | ZFCP_DEFINE_A_ATTR(peer_wwpn, "0x%016llx\n", |
| 63 | (unsigned long long) adapter->peer_wwpn); |
| 64 | ZFCP_DEFINE_A_ATTR(peer_d_id, "0x%06x\n", adapter->peer_d_id); |
| 65 | ZFCP_DEFINE_A_ATTR(card_version, "0x%04x\n", adapter->hydra_version); |
| 66 | ZFCP_DEFINE_A_ATTR(lic_version, "0x%08x\n", adapter->fsf_lic_version); |
| 67 | ZFCP_DEFINE_A_ATTR(hardware_version, "0x%08x\n", adapter->hardware_version); |
| 68 | ZFCP_DEFINE_A_ATTR(in_recovery, "%d\n", (atomic_read(&adapter->status) & |
| 69 | ZFCP_STATUS_COMMON_ERP_INUSE) != 0); |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 70 | |
| 71 | ZFCP_DEFINE_ATTR(zfcp_port, port, status, "0x%08x\n", |
| 72 | atomic_read(&port->status)); |
| 73 | ZFCP_DEFINE_ATTR(zfcp_port, port, in_recovery, "%d\n", |
| 74 | (atomic_read(&port->status) & |
| 75 | ZFCP_STATUS_COMMON_ERP_INUSE) != 0); |
Martin Peschke | 1b33ef2 | 2014-11-13 14:59:46 +0100 | [diff] [blame] | 76 | ZFCP_DEFINE_ATTR_CONST(port, access_denied, "%d\n", 0); |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 77 | |
| 78 | ZFCP_DEFINE_ATTR(zfcp_unit, unit, status, "0x%08x\n", |
Christof Schmitt | b62a8d9 | 2010-09-08 14:39:55 +0200 | [diff] [blame] | 79 | zfcp_unit_sdev_status(unit)); |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 80 | ZFCP_DEFINE_ATTR(zfcp_unit, unit, in_recovery, "%d\n", |
Christof Schmitt | b62a8d9 | 2010-09-08 14:39:55 +0200 | [diff] [blame] | 81 | (zfcp_unit_sdev_status(unit) & |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 82 | ZFCP_STATUS_COMMON_ERP_INUSE) != 0); |
| 83 | ZFCP_DEFINE_ATTR(zfcp_unit, unit, access_denied, "%d\n", |
Christof Schmitt | b62a8d9 | 2010-09-08 14:39:55 +0200 | [diff] [blame] | 84 | (zfcp_unit_sdev_status(unit) & |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 85 | ZFCP_STATUS_COMMON_ACCESS_DENIED) != 0); |
Martin Peschke | b5dc3c4 | 2013-08-22 17:45:38 +0200 | [diff] [blame] | 86 | ZFCP_DEFINE_ATTR_CONST(unit, access_shared, "%d\n", 0); |
| 87 | ZFCP_DEFINE_ATTR_CONST(unit, access_readonly, "%d\n", 0); |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 88 | |
Christof Schmitt | e4b9857 | 2010-09-08 14:39:53 +0200 | [diff] [blame] | 89 | static ssize_t zfcp_sysfs_port_failed_show(struct device *dev, |
| 90 | struct device_attribute *attr, |
| 91 | char *buf) |
| 92 | { |
| 93 | struct zfcp_port *port = container_of(dev, struct zfcp_port, dev); |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 94 | |
Christof Schmitt | e4b9857 | 2010-09-08 14:39:53 +0200 | [diff] [blame] | 95 | if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_ERP_FAILED) |
| 96 | return sprintf(buf, "1\n"); |
| 97 | |
| 98 | return sprintf(buf, "0\n"); |
| 99 | } |
| 100 | |
| 101 | static ssize_t zfcp_sysfs_port_failed_store(struct device *dev, |
| 102 | struct device_attribute *attr, |
| 103 | const char *buf, size_t count) |
| 104 | { |
| 105 | struct zfcp_port *port = container_of(dev, struct zfcp_port, dev); |
| 106 | unsigned long val; |
| 107 | |
Martin Peschke | ee732ea | 2013-08-22 17:49:32 +0200 | [diff] [blame] | 108 | if (kstrtoul(buf, 0, &val) || val != 0) |
Christof Schmitt | e4b9857 | 2010-09-08 14:39:53 +0200 | [diff] [blame] | 109 | return -EINVAL; |
| 110 | |
Swen Schillig | edaed85 | 2010-09-08 14:40:01 +0200 | [diff] [blame] | 111 | zfcp_erp_set_port_status(port, ZFCP_STATUS_COMMON_RUNNING); |
Swen Schillig | ea4a3a6 | 2010-12-02 15:16:16 +0100 | [diff] [blame] | 112 | zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED, "sypfai2"); |
Christof Schmitt | e4b9857 | 2010-09-08 14:39:53 +0200 | [diff] [blame] | 113 | zfcp_erp_wait(port->adapter); |
| 114 | |
| 115 | return count; |
| 116 | } |
| 117 | static ZFCP_DEV_ATTR(port, failed, S_IWUSR | S_IRUGO, |
| 118 | zfcp_sysfs_port_failed_show, |
| 119 | zfcp_sysfs_port_failed_store); |
| 120 | |
| 121 | static ssize_t zfcp_sysfs_unit_failed_show(struct device *dev, |
| 122 | struct device_attribute *attr, |
| 123 | char *buf) |
| 124 | { |
| 125 | struct zfcp_unit *unit = container_of(dev, struct zfcp_unit, dev); |
Christof Schmitt | b62a8d9 | 2010-09-08 14:39:55 +0200 | [diff] [blame] | 126 | struct scsi_device *sdev; |
| 127 | unsigned int status, failed = 1; |
Christof Schmitt | e4b9857 | 2010-09-08 14:39:53 +0200 | [diff] [blame] | 128 | |
Christof Schmitt | b62a8d9 | 2010-09-08 14:39:55 +0200 | [diff] [blame] | 129 | sdev = zfcp_unit_sdev(unit); |
| 130 | if (sdev) { |
| 131 | status = atomic_read(&sdev_to_zfcp(sdev)->status); |
| 132 | failed = status & ZFCP_STATUS_COMMON_ERP_FAILED ? 1 : 0; |
| 133 | scsi_device_put(sdev); |
| 134 | } |
Christof Schmitt | e4b9857 | 2010-09-08 14:39:53 +0200 | [diff] [blame] | 135 | |
Christof Schmitt | b62a8d9 | 2010-09-08 14:39:55 +0200 | [diff] [blame] | 136 | return sprintf(buf, "%d\n", failed); |
Christof Schmitt | e4b9857 | 2010-09-08 14:39:53 +0200 | [diff] [blame] | 137 | } |
| 138 | |
| 139 | static ssize_t zfcp_sysfs_unit_failed_store(struct device *dev, |
| 140 | struct device_attribute *attr, |
| 141 | const char *buf, size_t count) |
| 142 | { |
| 143 | struct zfcp_unit *unit = container_of(dev, struct zfcp_unit, dev); |
| 144 | unsigned long val; |
Christof Schmitt | b62a8d9 | 2010-09-08 14:39:55 +0200 | [diff] [blame] | 145 | struct scsi_device *sdev; |
Christof Schmitt | e4b9857 | 2010-09-08 14:39:53 +0200 | [diff] [blame] | 146 | |
Martin Peschke | ee732ea | 2013-08-22 17:49:32 +0200 | [diff] [blame] | 147 | if (kstrtoul(buf, 0, &val) || val != 0) |
Christof Schmitt | e4b9857 | 2010-09-08 14:39:53 +0200 | [diff] [blame] | 148 | return -EINVAL; |
| 149 | |
Christof Schmitt | b62a8d9 | 2010-09-08 14:39:55 +0200 | [diff] [blame] | 150 | sdev = zfcp_unit_sdev(unit); |
| 151 | if (sdev) { |
Swen Schillig | edaed85 | 2010-09-08 14:40:01 +0200 | [diff] [blame] | 152 | zfcp_erp_set_lun_status(sdev, ZFCP_STATUS_COMMON_RUNNING); |
Christof Schmitt | b62a8d9 | 2010-09-08 14:39:55 +0200 | [diff] [blame] | 153 | zfcp_erp_lun_reopen(sdev, ZFCP_STATUS_COMMON_ERP_FAILED, |
Swen Schillig | ea4a3a6 | 2010-12-02 15:16:16 +0100 | [diff] [blame] | 154 | "syufai2"); |
Christof Schmitt | b62a8d9 | 2010-09-08 14:39:55 +0200 | [diff] [blame] | 155 | zfcp_erp_wait(unit->port->adapter); |
| 156 | } else |
| 157 | zfcp_unit_scsi_scan(unit); |
Christof Schmitt | e4b9857 | 2010-09-08 14:39:53 +0200 | [diff] [blame] | 158 | |
| 159 | return count; |
| 160 | } |
| 161 | static ZFCP_DEV_ATTR(unit, failed, S_IWUSR | S_IRUGO, |
| 162 | zfcp_sysfs_unit_failed_show, |
| 163 | zfcp_sysfs_unit_failed_store); |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 164 | |
Swen Schillig | de3dc57 | 2009-11-24 16:54:00 +0100 | [diff] [blame] | 165 | static ssize_t zfcp_sysfs_adapter_failed_show(struct device *dev, |
| 166 | struct device_attribute *attr, |
| 167 | char *buf) |
| 168 | { |
| 169 | struct ccw_device *cdev = to_ccwdev(dev); |
| 170 | struct zfcp_adapter *adapter = zfcp_ccw_adapter_by_cdev(cdev); |
| 171 | int i; |
| 172 | |
| 173 | if (!adapter) |
| 174 | return -ENODEV; |
| 175 | |
| 176 | if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_ERP_FAILED) |
| 177 | i = sprintf(buf, "1\n"); |
| 178 | else |
| 179 | i = sprintf(buf, "0\n"); |
| 180 | |
| 181 | zfcp_ccw_adapter_put(adapter); |
| 182 | return i; |
| 183 | } |
| 184 | |
| 185 | static ssize_t zfcp_sysfs_adapter_failed_store(struct device *dev, |
| 186 | struct device_attribute *attr, |
| 187 | const char *buf, size_t count) |
| 188 | { |
| 189 | struct ccw_device *cdev = to_ccwdev(dev); |
| 190 | struct zfcp_adapter *adapter = zfcp_ccw_adapter_by_cdev(cdev); |
| 191 | unsigned long val; |
| 192 | int retval = 0; |
| 193 | |
| 194 | if (!adapter) |
| 195 | return -ENODEV; |
| 196 | |
Martin Peschke | ee732ea | 2013-08-22 17:49:32 +0200 | [diff] [blame] | 197 | if (kstrtoul(buf, 0, &val) || val != 0) { |
Swen Schillig | de3dc57 | 2009-11-24 16:54:00 +0100 | [diff] [blame] | 198 | retval = -EINVAL; |
| 199 | goto out; |
| 200 | } |
| 201 | |
Swen Schillig | edaed85 | 2010-09-08 14:40:01 +0200 | [diff] [blame] | 202 | zfcp_erp_set_adapter_status(adapter, ZFCP_STATUS_COMMON_RUNNING); |
Swen Schillig | de3dc57 | 2009-11-24 16:54:00 +0100 | [diff] [blame] | 203 | zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, |
Swen Schillig | ea4a3a6 | 2010-12-02 15:16:16 +0100 | [diff] [blame] | 204 | "syafai2"); |
Swen Schillig | de3dc57 | 2009-11-24 16:54:00 +0100 | [diff] [blame] | 205 | zfcp_erp_wait(adapter); |
| 206 | out: |
| 207 | zfcp_ccw_adapter_put(adapter); |
| 208 | return retval ? retval : (ssize_t) count; |
| 209 | } |
| 210 | static ZFCP_DEV_ATTR(adapter, failed, S_IWUSR | S_IRUGO, |
| 211 | zfcp_sysfs_adapter_failed_show, |
| 212 | zfcp_sysfs_adapter_failed_store); |
| 213 | |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 214 | static ssize_t zfcp_sysfs_port_rescan_store(struct device *dev, |
| 215 | struct device_attribute *attr, |
| 216 | const char *buf, size_t count) |
| 217 | { |
Swen Schillig | de3dc57 | 2009-11-24 16:54:00 +0100 | [diff] [blame] | 218 | struct ccw_device *cdev = to_ccwdev(dev); |
| 219 | struct zfcp_adapter *adapter = zfcp_ccw_adapter_by_cdev(cdev); |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 220 | |
Swen Schillig | de3dc57 | 2009-11-24 16:54:00 +0100 | [diff] [blame] | 221 | if (!adapter) |
| 222 | return -ENODEV; |
| 223 | |
Martin Peschke | 18f87a6 | 2014-11-13 14:59:48 +0100 | [diff] [blame] | 224 | /* |
| 225 | * Users wish is our command: immediately schedule and flush a |
| 226 | * worker to conduct a synchronous port scan, that is, neither |
| 227 | * a random delay nor a rate limit is applied here. |
| 228 | */ |
| 229 | queue_delayed_work(adapter->work_queue, &adapter->scan_work, 0); |
| 230 | flush_delayed_work(&adapter->scan_work); |
Swen Schillig | de3dc57 | 2009-11-24 16:54:00 +0100 | [diff] [blame] | 231 | zfcp_ccw_adapter_put(adapter); |
Swen Schillig | 6b183334 | 2009-11-24 16:54:05 +0100 | [diff] [blame] | 232 | |
Swen Schillig | 9eae07e | 2009-11-24 16:54:06 +0100 | [diff] [blame] | 233 | return (ssize_t) count; |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 234 | } |
| 235 | static ZFCP_DEV_ATTR(adapter, port_rescan, S_IWUSR, NULL, |
| 236 | zfcp_sysfs_port_rescan_store); |
| 237 | |
Steffen Maier | d99b601 | 2012-09-04 15:23:34 +0200 | [diff] [blame] | 238 | DEFINE_MUTEX(zfcp_sysfs_port_units_mutex); |
| 239 | |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 240 | static ssize_t zfcp_sysfs_port_remove_store(struct device *dev, |
| 241 | struct device_attribute *attr, |
| 242 | const char *buf, size_t count) |
| 243 | { |
Swen Schillig | de3dc57 | 2009-11-24 16:54:00 +0100 | [diff] [blame] | 244 | struct ccw_device *cdev = to_ccwdev(dev); |
| 245 | struct zfcp_adapter *adapter = zfcp_ccw_adapter_by_cdev(cdev); |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 246 | struct zfcp_port *port; |
Swen Schillig | 7ba58c9 | 2008-10-01 12:42:18 +0200 | [diff] [blame] | 247 | u64 wwpn; |
Swen Schillig | 6b183334 | 2009-11-24 16:54:05 +0100 | [diff] [blame] | 248 | int retval = -EINVAL; |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 249 | |
Swen Schillig | de3dc57 | 2009-11-24 16:54:00 +0100 | [diff] [blame] | 250 | if (!adapter) |
| 251 | return -ENODEV; |
| 252 | |
Martin Peschke | ee732ea | 2013-08-22 17:49:32 +0200 | [diff] [blame] | 253 | if (kstrtoull(buf, 0, (unsigned long long *) &wwpn)) |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 254 | goto out; |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 255 | |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 256 | port = zfcp_get_port_by_wwpn(adapter, wwpn); |
Swen Schillig | 6b183334 | 2009-11-24 16:54:05 +0100 | [diff] [blame] | 257 | if (!port) |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 258 | goto out; |
Swen Schillig | 6b183334 | 2009-11-24 16:54:05 +0100 | [diff] [blame] | 259 | else |
| 260 | retval = 0; |
Swen Schillig | f3450c7 | 2009-11-24 16:53:59 +0100 | [diff] [blame] | 261 | |
Steffen Maier | d99b601 | 2012-09-04 15:23:34 +0200 | [diff] [blame] | 262 | mutex_lock(&zfcp_sysfs_port_units_mutex); |
| 263 | if (atomic_read(&port->units) > 0) { |
| 264 | retval = -EBUSY; |
| 265 | mutex_unlock(&zfcp_sysfs_port_units_mutex); |
| 266 | goto out; |
| 267 | } |
| 268 | /* port is about to be removed, so no more unit_add */ |
| 269 | atomic_set(&port->units, -1); |
| 270 | mutex_unlock(&zfcp_sysfs_port_units_mutex); |
| 271 | |
Swen Schillig | f3450c7 | 2009-11-24 16:53:59 +0100 | [diff] [blame] | 272 | write_lock_irq(&adapter->port_list_lock); |
| 273 | list_del(&port->list); |
| 274 | write_unlock_irq(&adapter->port_list_lock); |
| 275 | |
Christof Schmitt | 615f59e | 2010-02-17 11:18:56 +0100 | [diff] [blame] | 276 | put_device(&port->dev); |
Swen Schillig | f3450c7 | 2009-11-24 16:53:59 +0100 | [diff] [blame] | 277 | |
Swen Schillig | ea4a3a6 | 2010-12-02 15:16:16 +0100 | [diff] [blame] | 278 | zfcp_erp_port_shutdown(port, 0, "syprs_1"); |
Sebastian Ott | 83d4e1c | 2013-04-26 16:13:48 +0200 | [diff] [blame] | 279 | device_unregister(&port->dev); |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 280 | out: |
Swen Schillig | de3dc57 | 2009-11-24 16:54:00 +0100 | [diff] [blame] | 281 | zfcp_ccw_adapter_put(adapter); |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 282 | return retval ? retval : (ssize_t) count; |
| 283 | } |
| 284 | static ZFCP_DEV_ATTR(adapter, port_remove, S_IWUSR, NULL, |
| 285 | zfcp_sysfs_port_remove_store); |
| 286 | |
| 287 | static struct attribute *zfcp_adapter_attrs[] = { |
| 288 | &dev_attr_adapter_failed.attr, |
| 289 | &dev_attr_adapter_in_recovery.attr, |
| 290 | &dev_attr_adapter_port_remove.attr, |
| 291 | &dev_attr_adapter_port_rescan.attr, |
| 292 | &dev_attr_adapter_peer_wwnn.attr, |
| 293 | &dev_attr_adapter_peer_wwpn.attr, |
| 294 | &dev_attr_adapter_peer_d_id.attr, |
| 295 | &dev_attr_adapter_card_version.attr, |
| 296 | &dev_attr_adapter_lic_version.attr, |
| 297 | &dev_attr_adapter_status.attr, |
| 298 | &dev_attr_adapter_hardware_version.attr, |
| 299 | NULL |
| 300 | }; |
| 301 | |
| 302 | struct attribute_group zfcp_sysfs_adapter_attrs = { |
| 303 | .attrs = zfcp_adapter_attrs, |
| 304 | }; |
| 305 | |
| 306 | static ssize_t zfcp_sysfs_unit_add_store(struct device *dev, |
| 307 | struct device_attribute *attr, |
| 308 | const char *buf, size_t count) |
| 309 | { |
Christof Schmitt | 615f59e | 2010-02-17 11:18:56 +0100 | [diff] [blame] | 310 | struct zfcp_port *port = container_of(dev, struct zfcp_port, dev); |
Swen Schillig | 7ba58c9 | 2008-10-01 12:42:18 +0200 | [diff] [blame] | 311 | u64 fcp_lun; |
Steffen Maier | d99b601 | 2012-09-04 15:23:34 +0200 | [diff] [blame] | 312 | int retval; |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 313 | |
Martin Peschke | ee732ea | 2013-08-22 17:49:32 +0200 | [diff] [blame] | 314 | if (kstrtoull(buf, 0, (unsigned long long *) &fcp_lun)) |
Christof Schmitt | 1daa4eb | 2010-09-08 14:39:52 +0200 | [diff] [blame] | 315 | return -EINVAL; |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 316 | |
Steffen Maier | d99b601 | 2012-09-04 15:23:34 +0200 | [diff] [blame] | 317 | retval = zfcp_unit_add(port, fcp_lun); |
| 318 | if (retval) |
| 319 | return retval; |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 320 | |
Christof Schmitt | 1daa4eb | 2010-09-08 14:39:52 +0200 | [diff] [blame] | 321 | return count; |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 322 | } |
| 323 | static DEVICE_ATTR(unit_add, S_IWUSR, NULL, zfcp_sysfs_unit_add_store); |
| 324 | |
| 325 | static ssize_t zfcp_sysfs_unit_remove_store(struct device *dev, |
| 326 | struct device_attribute *attr, |
| 327 | const char *buf, size_t count) |
| 328 | { |
Christof Schmitt | 615f59e | 2010-02-17 11:18:56 +0100 | [diff] [blame] | 329 | struct zfcp_port *port = container_of(dev, struct zfcp_port, dev); |
Swen Schillig | 7ba58c9 | 2008-10-01 12:42:18 +0200 | [diff] [blame] | 330 | u64 fcp_lun; |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 331 | |
Martin Peschke | ee732ea | 2013-08-22 17:49:32 +0200 | [diff] [blame] | 332 | if (kstrtoull(buf, 0, (unsigned long long *) &fcp_lun)) |
Christof Schmitt | 1daa4eb | 2010-09-08 14:39:52 +0200 | [diff] [blame] | 333 | return -EINVAL; |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 334 | |
Christof Schmitt | 1daa4eb | 2010-09-08 14:39:52 +0200 | [diff] [blame] | 335 | if (zfcp_unit_remove(port, fcp_lun)) |
| 336 | return -EINVAL; |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 337 | |
Christof Schmitt | 1daa4eb | 2010-09-08 14:39:52 +0200 | [diff] [blame] | 338 | return count; |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 339 | } |
| 340 | static DEVICE_ATTR(unit_remove, S_IWUSR, NULL, zfcp_sysfs_unit_remove_store); |
| 341 | |
Swen Schillig | 5ab944f | 2008-10-01 12:42:17 +0200 | [diff] [blame] | 342 | static struct attribute *zfcp_port_attrs[] = { |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 343 | &dev_attr_unit_add.attr, |
| 344 | &dev_attr_unit_remove.attr, |
| 345 | &dev_attr_port_failed.attr, |
| 346 | &dev_attr_port_in_recovery.attr, |
| 347 | &dev_attr_port_status.attr, |
| 348 | &dev_attr_port_access_denied.attr, |
| 349 | NULL |
| 350 | }; |
Sebastian Ott | 83d4e1c | 2013-04-26 16:13:48 +0200 | [diff] [blame] | 351 | static struct attribute_group zfcp_port_attr_group = { |
Swen Schillig | 5ab944f | 2008-10-01 12:42:17 +0200 | [diff] [blame] | 352 | .attrs = zfcp_port_attrs, |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 353 | }; |
Sebastian Ott | 83d4e1c | 2013-04-26 16:13:48 +0200 | [diff] [blame] | 354 | const struct attribute_group *zfcp_port_attr_groups[] = { |
| 355 | &zfcp_port_attr_group, |
| 356 | NULL, |
| 357 | }; |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 358 | |
| 359 | static struct attribute *zfcp_unit_attrs[] = { |
| 360 | &dev_attr_unit_failed.attr, |
| 361 | &dev_attr_unit_in_recovery.attr, |
| 362 | &dev_attr_unit_status.attr, |
| 363 | &dev_attr_unit_access_denied.attr, |
Martin Peschke | b5dc3c4 | 2013-08-22 17:45:38 +0200 | [diff] [blame] | 364 | &dev_attr_unit_access_shared.attr, |
| 365 | &dev_attr_unit_access_readonly.attr, |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 366 | NULL |
| 367 | }; |
Sebastian Ott | 86bdf21 | 2013-04-26 16:13:49 +0200 | [diff] [blame] | 368 | static struct attribute_group zfcp_unit_attr_group = { |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 369 | .attrs = zfcp_unit_attrs, |
| 370 | }; |
Sebastian Ott | 86bdf21 | 2013-04-26 16:13:49 +0200 | [diff] [blame] | 371 | const struct attribute_group *zfcp_unit_attr_groups[] = { |
| 372 | &zfcp_unit_attr_group, |
| 373 | NULL, |
| 374 | }; |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 375 | |
| 376 | #define ZFCP_DEFINE_LATENCY_ATTR(_name) \ |
| 377 | static ssize_t \ |
| 378 | zfcp_sysfs_unit_##_name##_latency_show(struct device *dev, \ |
| 379 | struct device_attribute *attr, \ |
| 380 | char *buf) { \ |
| 381 | struct scsi_device *sdev = to_scsi_device(dev); \ |
Christof Schmitt | b62a8d9 | 2010-09-08 14:39:55 +0200 | [diff] [blame] | 382 | struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(sdev); \ |
| 383 | struct zfcp_latencies *lat = &zfcp_sdev->latencies; \ |
| 384 | struct zfcp_adapter *adapter = zfcp_sdev->port->adapter; \ |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 385 | unsigned long long fsum, fmin, fmax, csum, cmin, cmax, cc; \ |
| 386 | \ |
Christof Schmitt | 49f0f01 | 2009-03-02 13:08:57 +0100 | [diff] [blame] | 387 | spin_lock_bh(&lat->lock); \ |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 388 | fsum = lat->_name.fabric.sum * adapter->timer_ticks; \ |
| 389 | fmin = lat->_name.fabric.min * adapter->timer_ticks; \ |
| 390 | fmax = lat->_name.fabric.max * adapter->timer_ticks; \ |
| 391 | csum = lat->_name.channel.sum * adapter->timer_ticks; \ |
| 392 | cmin = lat->_name.channel.min * adapter->timer_ticks; \ |
| 393 | cmax = lat->_name.channel.max * adapter->timer_ticks; \ |
| 394 | cc = lat->_name.counter; \ |
Christof Schmitt | 49f0f01 | 2009-03-02 13:08:57 +0100 | [diff] [blame] | 395 | spin_unlock_bh(&lat->lock); \ |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 396 | \ |
| 397 | do_div(fsum, 1000); \ |
| 398 | do_div(fmin, 1000); \ |
| 399 | do_div(fmax, 1000); \ |
| 400 | do_div(csum, 1000); \ |
| 401 | do_div(cmin, 1000); \ |
| 402 | do_div(cmax, 1000); \ |
| 403 | \ |
| 404 | return sprintf(buf, "%llu %llu %llu %llu %llu %llu %llu\n", \ |
| 405 | fmin, fmax, fsum, cmin, cmax, csum, cc); \ |
| 406 | } \ |
| 407 | static ssize_t \ |
| 408 | zfcp_sysfs_unit_##_name##_latency_store(struct device *dev, \ |
| 409 | struct device_attribute *attr, \ |
| 410 | const char *buf, size_t count) \ |
| 411 | { \ |
| 412 | struct scsi_device *sdev = to_scsi_device(dev); \ |
Christof Schmitt | b62a8d9 | 2010-09-08 14:39:55 +0200 | [diff] [blame] | 413 | struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(sdev); \ |
| 414 | struct zfcp_latencies *lat = &zfcp_sdev->latencies; \ |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 415 | unsigned long flags; \ |
| 416 | \ |
| 417 | spin_lock_irqsave(&lat->lock, flags); \ |
| 418 | lat->_name.fabric.sum = 0; \ |
| 419 | lat->_name.fabric.min = 0xFFFFFFFF; \ |
| 420 | lat->_name.fabric.max = 0; \ |
| 421 | lat->_name.channel.sum = 0; \ |
| 422 | lat->_name.channel.min = 0xFFFFFFFF; \ |
| 423 | lat->_name.channel.max = 0; \ |
| 424 | lat->_name.counter = 0; \ |
| 425 | spin_unlock_irqrestore(&lat->lock, flags); \ |
| 426 | \ |
| 427 | return (ssize_t) count; \ |
| 428 | } \ |
| 429 | static DEVICE_ATTR(_name##_latency, S_IWUSR | S_IRUGO, \ |
| 430 | zfcp_sysfs_unit_##_name##_latency_show, \ |
| 431 | zfcp_sysfs_unit_##_name##_latency_store); |
| 432 | |
| 433 | ZFCP_DEFINE_LATENCY_ATTR(read); |
| 434 | ZFCP_DEFINE_LATENCY_ATTR(write); |
| 435 | ZFCP_DEFINE_LATENCY_ATTR(cmd); |
| 436 | |
| 437 | #define ZFCP_DEFINE_SCSI_ATTR(_name, _format, _value) \ |
| 438 | static ssize_t zfcp_sysfs_scsi_##_name##_show(struct device *dev, \ |
| 439 | struct device_attribute *attr,\ |
| 440 | char *buf) \ |
| 441 | { \ |
Christof Schmitt | b62a8d9 | 2010-09-08 14:39:55 +0200 | [diff] [blame] | 442 | struct scsi_device *sdev = to_scsi_device(dev); \ |
| 443 | struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(sdev); \ |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 444 | \ |
| 445 | return sprintf(buf, _format, _value); \ |
| 446 | } \ |
| 447 | static DEVICE_ATTR(_name, S_IRUGO, zfcp_sysfs_scsi_##_name##_show, NULL); |
| 448 | |
| 449 | ZFCP_DEFINE_SCSI_ATTR(hba_id, "%s\n", |
Steffen Maier | c8bba14 | 2014-11-13 14:59:47 +0100 | [diff] [blame] | 450 | dev_name(&zfcp_sdev->port->adapter->ccw_device->dev)); |
Swen Schillig | 7ba58c9 | 2008-10-01 12:42:18 +0200 | [diff] [blame] | 451 | ZFCP_DEFINE_SCSI_ATTR(wwpn, "0x%016llx\n", |
Steffen Maier | c8bba14 | 2014-11-13 14:59:47 +0100 | [diff] [blame] | 452 | (unsigned long long) zfcp_sdev->port->wwpn); |
Christof Schmitt | e4b9857 | 2010-09-08 14:39:53 +0200 | [diff] [blame] | 453 | |
| 454 | static ssize_t zfcp_sysfs_scsi_fcp_lun_show(struct device *dev, |
| 455 | struct device_attribute *attr, |
| 456 | char *buf) |
| 457 | { |
| 458 | struct scsi_device *sdev = to_scsi_device(dev); |
Christof Schmitt | e4b9857 | 2010-09-08 14:39:53 +0200 | [diff] [blame] | 459 | |
Christof Schmitt | b62a8d9 | 2010-09-08 14:39:55 +0200 | [diff] [blame] | 460 | return sprintf(buf, "0x%016llx\n", zfcp_scsi_dev_lun(sdev)); |
Christof Schmitt | e4b9857 | 2010-09-08 14:39:53 +0200 | [diff] [blame] | 461 | } |
| 462 | static DEVICE_ATTR(fcp_lun, S_IRUGO, zfcp_sysfs_scsi_fcp_lun_show, NULL); |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 463 | |
Steffen Maier | c8bba14 | 2014-11-13 14:59:47 +0100 | [diff] [blame] | 464 | ZFCP_DEFINE_SCSI_ATTR(zfcp_access_denied, "%d\n", |
| 465 | (atomic_read(&zfcp_sdev->status) & |
| 466 | ZFCP_STATUS_COMMON_ACCESS_DENIED) != 0); |
| 467 | |
| 468 | static ssize_t zfcp_sysfs_scsi_zfcp_failed_show(struct device *dev, |
| 469 | struct device_attribute *attr, |
| 470 | char *buf) |
| 471 | { |
| 472 | struct scsi_device *sdev = to_scsi_device(dev); |
| 473 | unsigned int status = atomic_read(&sdev_to_zfcp(sdev)->status); |
| 474 | unsigned int failed = status & ZFCP_STATUS_COMMON_ERP_FAILED ? 1 : 0; |
| 475 | |
| 476 | return sprintf(buf, "%d\n", failed); |
| 477 | } |
| 478 | |
| 479 | static ssize_t zfcp_sysfs_scsi_zfcp_failed_store(struct device *dev, |
| 480 | struct device_attribute *attr, |
| 481 | const char *buf, size_t count) |
| 482 | { |
| 483 | struct scsi_device *sdev = to_scsi_device(dev); |
| 484 | unsigned long val; |
| 485 | |
| 486 | if (kstrtoul(buf, 0, &val) || val != 0) |
| 487 | return -EINVAL; |
| 488 | |
| 489 | zfcp_erp_set_lun_status(sdev, ZFCP_STATUS_COMMON_RUNNING); |
| 490 | zfcp_erp_lun_reopen(sdev, ZFCP_STATUS_COMMON_ERP_FAILED, |
| 491 | "syufai3"); |
| 492 | zfcp_erp_wait(sdev_to_zfcp(sdev)->port->adapter); |
| 493 | |
| 494 | return count; |
| 495 | } |
| 496 | static DEVICE_ATTR(zfcp_failed, S_IWUSR | S_IRUGO, |
| 497 | zfcp_sysfs_scsi_zfcp_failed_show, |
| 498 | zfcp_sysfs_scsi_zfcp_failed_store); |
| 499 | |
| 500 | ZFCP_DEFINE_SCSI_ATTR(zfcp_in_recovery, "%d\n", |
| 501 | (atomic_read(&zfcp_sdev->status) & |
| 502 | ZFCP_STATUS_COMMON_ERP_INUSE) != 0); |
| 503 | |
| 504 | ZFCP_DEFINE_SCSI_ATTR(zfcp_status, "0x%08x\n", |
| 505 | atomic_read(&zfcp_sdev->status)); |
| 506 | |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 507 | struct device_attribute *zfcp_sysfs_sdev_attrs[] = { |
| 508 | &dev_attr_fcp_lun, |
| 509 | &dev_attr_wwpn, |
| 510 | &dev_attr_hba_id, |
| 511 | &dev_attr_read_latency, |
| 512 | &dev_attr_write_latency, |
| 513 | &dev_attr_cmd_latency, |
Steffen Maier | c8bba14 | 2014-11-13 14:59:47 +0100 | [diff] [blame] | 514 | &dev_attr_zfcp_access_denied, |
| 515 | &dev_attr_zfcp_failed, |
| 516 | &dev_attr_zfcp_in_recovery, |
| 517 | &dev_attr_zfcp_status, |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 518 | NULL |
| 519 | }; |
| 520 | |
| 521 | static ssize_t zfcp_sysfs_adapter_util_show(struct device *dev, |
| 522 | struct device_attribute *attr, |
| 523 | char *buf) |
| 524 | { |
| 525 | struct Scsi_Host *scsi_host = dev_to_shost(dev); |
| 526 | struct fsf_qtcb_bottom_port *qtcb_port; |
| 527 | struct zfcp_adapter *adapter; |
| 528 | int retval; |
| 529 | |
| 530 | adapter = (struct zfcp_adapter *) scsi_host->hostdata[0]; |
| 531 | if (!(adapter->adapter_features & FSF_FEATURE_MEASUREMENT_DATA)) |
| 532 | return -EOPNOTSUPP; |
| 533 | |
| 534 | qtcb_port = kzalloc(sizeof(struct fsf_qtcb_bottom_port), GFP_KERNEL); |
| 535 | if (!qtcb_port) |
| 536 | return -ENOMEM; |
| 537 | |
Swen Schillig | 564e1c8 | 2009-08-18 15:43:19 +0200 | [diff] [blame] | 538 | retval = zfcp_fsf_exchange_port_data_sync(adapter->qdio, qtcb_port); |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 539 | if (!retval) |
| 540 | retval = sprintf(buf, "%u %u %u\n", qtcb_port->cp_util, |
| 541 | qtcb_port->cb_util, qtcb_port->a_util); |
| 542 | kfree(qtcb_port); |
| 543 | return retval; |
| 544 | } |
| 545 | static DEVICE_ATTR(utilization, S_IRUGO, zfcp_sysfs_adapter_util_show, NULL); |
| 546 | |
| 547 | static int zfcp_sysfs_adapter_ex_config(struct device *dev, |
| 548 | struct fsf_statistics_info *stat_inf) |
| 549 | { |
| 550 | struct Scsi_Host *scsi_host = dev_to_shost(dev); |
| 551 | struct fsf_qtcb_bottom_config *qtcb_config; |
| 552 | struct zfcp_adapter *adapter; |
| 553 | int retval; |
| 554 | |
| 555 | adapter = (struct zfcp_adapter *) scsi_host->hostdata[0]; |
| 556 | if (!(adapter->adapter_features & FSF_FEATURE_MEASUREMENT_DATA)) |
| 557 | return -EOPNOTSUPP; |
| 558 | |
| 559 | qtcb_config = kzalloc(sizeof(struct fsf_qtcb_bottom_config), |
| 560 | GFP_KERNEL); |
| 561 | if (!qtcb_config) |
| 562 | return -ENOMEM; |
| 563 | |
Swen Schillig | 564e1c8 | 2009-08-18 15:43:19 +0200 | [diff] [blame] | 564 | retval = zfcp_fsf_exchange_config_data_sync(adapter->qdio, qtcb_config); |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 565 | if (!retval) |
| 566 | *stat_inf = qtcb_config->stat_info; |
| 567 | |
| 568 | kfree(qtcb_config); |
| 569 | return retval; |
| 570 | } |
| 571 | |
| 572 | #define ZFCP_SHOST_ATTR(_name, _format, _arg...) \ |
| 573 | static ssize_t zfcp_sysfs_adapter_##_name##_show(struct device *dev, \ |
| 574 | struct device_attribute *attr,\ |
| 575 | char *buf) \ |
| 576 | { \ |
| 577 | struct fsf_statistics_info stat_info; \ |
| 578 | int retval; \ |
| 579 | \ |
| 580 | retval = zfcp_sysfs_adapter_ex_config(dev, &stat_info); \ |
| 581 | if (retval) \ |
| 582 | return retval; \ |
| 583 | \ |
| 584 | return sprintf(buf, _format, ## _arg); \ |
| 585 | } \ |
| 586 | static DEVICE_ATTR(_name, S_IRUGO, zfcp_sysfs_adapter_##_name##_show, NULL); |
| 587 | |
| 588 | ZFCP_SHOST_ATTR(requests, "%llu %llu %llu\n", |
| 589 | (unsigned long long) stat_info.input_req, |
| 590 | (unsigned long long) stat_info.output_req, |
| 591 | (unsigned long long) stat_info.control_req); |
| 592 | |
| 593 | ZFCP_SHOST_ATTR(megabytes, "%llu %llu\n", |
| 594 | (unsigned long long) stat_info.input_mb, |
| 595 | (unsigned long long) stat_info.output_mb); |
| 596 | |
| 597 | ZFCP_SHOST_ATTR(seconds_active, "%llu\n", |
| 598 | (unsigned long long) stat_info.seconds_act); |
| 599 | |
Stefan Raspl | 2450d3e | 2008-10-01 12:42:14 +0200 | [diff] [blame] | 600 | static ssize_t zfcp_sysfs_adapter_q_full_show(struct device *dev, |
| 601 | struct device_attribute *attr, |
| 602 | char *buf) |
| 603 | { |
| 604 | struct Scsi_Host *scsi_host = class_to_shost(dev); |
Swen Schillig | 564e1c8 | 2009-08-18 15:43:19 +0200 | [diff] [blame] | 605 | struct zfcp_qdio *qdio = |
| 606 | ((struct zfcp_adapter *) scsi_host->hostdata[0])->qdio; |
Christof Schmitt | acf7b86 | 2009-07-13 15:06:03 +0200 | [diff] [blame] | 607 | u64 util; |
| 608 | |
Swen Schillig | 564e1c8 | 2009-08-18 15:43:19 +0200 | [diff] [blame] | 609 | spin_lock_bh(&qdio->stat_lock); |
| 610 | util = qdio->req_q_util; |
| 611 | spin_unlock_bh(&qdio->stat_lock); |
Stefan Raspl | 2450d3e | 2008-10-01 12:42:14 +0200 | [diff] [blame] | 612 | |
Swen Schillig | 564e1c8 | 2009-08-18 15:43:19 +0200 | [diff] [blame] | 613 | return sprintf(buf, "%d %llu\n", atomic_read(&qdio->req_q_full), |
Christof Schmitt | acf7b86 | 2009-07-13 15:06:03 +0200 | [diff] [blame] | 614 | (unsigned long long)util); |
Stefan Raspl | 2450d3e | 2008-10-01 12:42:14 +0200 | [diff] [blame] | 615 | } |
| 616 | static DEVICE_ATTR(queue_full, S_IRUGO, zfcp_sysfs_adapter_q_full_show, NULL); |
| 617 | |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 618 | struct device_attribute *zfcp_sysfs_shost_attrs[] = { |
| 619 | &dev_attr_utilization, |
| 620 | &dev_attr_requests, |
| 621 | &dev_attr_megabytes, |
| 622 | &dev_attr_seconds_active, |
Stefan Raspl | 2450d3e | 2008-10-01 12:42:14 +0200 | [diff] [blame] | 623 | &dev_attr_queue_full, |
Swen Schillig | 6022192 | 2008-07-02 10:56:38 +0200 | [diff] [blame] | 624 | NULL |
| 625 | }; |