aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_sysfs_adapter.c
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2008-06-10 12:21:00 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-07-12 09:22:26 -0400
commitcc8c282963bd258a5bf49d3aa52675a4ae6d31f6 (patch)
treed0f353c918158b203c71603d9afdf4b71c126f63 /drivers/s390/scsi/zfcp_sysfs_adapter.c
parent85a82392fe6fe7620d8fe0eb694f926cefe62e1f (diff)
[SCSI] zfcp: Automatically attach remote ports
Automatically attach the remote ports in zfcp when the adapter is set online. This is done by querying all available ports from the FC namesever. The scan for remote ports is also triggered by RSCNs and can be triggered manually with the sysfs attribute 'port_rescan'. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_sysfs_adapter.c')
-rw-r--r--drivers/s390/scsi/zfcp_sysfs_adapter.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/s390/scsi/zfcp_sysfs_adapter.c b/drivers/s390/scsi/zfcp_sysfs_adapter.c
index 1f2a8c21b731..a4cae60f69d4 100644
--- a/drivers/s390/scsi/zfcp_sysfs_adapter.c
+++ b/drivers/s390/scsi/zfcp_sysfs_adapter.c
@@ -85,6 +85,30 @@ zfcp_sysfs_port_add_store(struct device *dev, struct device_attribute *attr, con
85static DEVICE_ATTR(port_add, S_IWUSR, NULL, zfcp_sysfs_port_add_store); 85static DEVICE_ATTR(port_add, S_IWUSR, NULL, zfcp_sysfs_port_add_store);
86 86
87/** 87/**
88 * zfcp_sysfs_port_rescan - trigger manual port rescan
89 * @dev: pointer to belonging device
90 * @attr: pointer to struct device_attribute
91 * @buf: pointer to input buffer
92 * @count: number of bytes in buffer
93 */
94static ssize_t zfcp_sysfs_port_rescan_store(struct device *dev,
95 struct device_attribute *attr,
96 const char *buf, size_t count)
97{
98 struct zfcp_adapter *adapter;
99 int ret;
100
101 adapter = dev_get_drvdata(dev);
102 if (atomic_test_mask(ZFCP_STATUS_COMMON_REMOVE, &adapter->status))
103 return -EBUSY;
104
105 ret = zfcp_scan_ports(adapter);
106
107 return ret ? ret : (ssize_t) count;
108}
109static DEVICE_ATTR(port_rescan, S_IWUSR, NULL, zfcp_sysfs_port_rescan_store);
110
111/**
88 * zfcp_sysfs_port_remove_store - remove a port from sysfs tree 112 * zfcp_sysfs_port_remove_store - remove a port from sysfs tree
89 * @dev: pointer to belonging device 113 * @dev: pointer to belonging device
90 * @buf: pointer to input buffer 114 * @buf: pointer to input buffer
@@ -214,6 +238,7 @@ static struct attribute *zfcp_adapter_attrs[] = {
214 &dev_attr_in_recovery.attr, 238 &dev_attr_in_recovery.attr,
215 &dev_attr_port_remove.attr, 239 &dev_attr_port_remove.attr,
216 &dev_attr_port_add.attr, 240 &dev_attr_port_add.attr,
241 &dev_attr_port_rescan.attr,
217 &dev_attr_peer_wwnn.attr, 242 &dev_attr_peer_wwnn.attr,
218 &dev_attr_peer_wwpn.attr, 243 &dev_attr_peer_wwpn.attr,
219 &dev_attr_peer_d_id.attr, 244 &dev_attr_peer_d_id.attr,