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