aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Peschke <mpeschke@linux.vnet.ibm.com>2013-04-26 10:13:54 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-05-31 19:32:38 -0400
commit663e0890e31cb85f0cca5ac1faaee0d2d52880b5 (patch)
tree455fd8bcdec8cc9cff21caad338e983bad074974
parentbf3ea3aec568a9f10a9fea3f3f0a290a94d5cc12 (diff)
[SCSI] zfcp: remove access control tables interface
This patch removes an interface that was used to manage access control tables within the HBA. The patch consequently removes the handling for conditions related to those access control tables, too. That initiator-based access control feature was only needed until the introduction of NPIV and was withdrawn with z10 years ago. It's time to cleanup the corresponding device driver code. Signed-off-by: Martin Peschke <mpeschke@linux.vnet.ibm.com> Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/s390/scsi/Makefile2
-rw-r--r--drivers/s390/scsi/zfcp_aux.c10
-rw-r--r--drivers/s390/scsi/zfcp_ccw.c9
-rw-r--r--drivers/s390/scsi/zfcp_cfdc.c448
-rw-r--r--drivers/s390/scsi/zfcp_def.h4
-rw-r--r--drivers/s390/scsi/zfcp_erp.c3
-rw-r--r--drivers/s390/scsi/zfcp_ext.h14
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c127
-rw-r--r--drivers/s390/scsi/zfcp_fsf.h26
-rw-r--r--drivers/s390/scsi/zfcp_sysfs.c8
10 files changed, 15 insertions, 636 deletions
diff --git a/drivers/s390/scsi/Makefile b/drivers/s390/scsi/Makefile
index c454ffebb63e..9259039e886d 100644
--- a/drivers/s390/scsi/Makefile
+++ b/drivers/s390/scsi/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the S/390 specific device drivers 2# Makefile for the S/390 specific device drivers
3# 3#
4 4
5zfcp-objs := zfcp_aux.o zfcp_ccw.o zfcp_cfdc.o zfcp_dbf.o zfcp_erp.o \ 5zfcp-objs := zfcp_aux.o zfcp_ccw.o zfcp_dbf.o zfcp_erp.o \
6 zfcp_fc.o zfcp_fsf.o zfcp_qdio.o zfcp_scsi.o zfcp_sysfs.o \ 6 zfcp_fc.o zfcp_fsf.o zfcp_qdio.o zfcp_scsi.o zfcp_sysfs.o \
7 zfcp_unit.o 7 zfcp_unit.o
8 8
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index 3a8c1b7d151a..19fe0df1a61f 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -140,13 +140,6 @@ static int __init zfcp_module_init(void)
140 scsi_transport_reserve_device(zfcp_scsi_transport_template, 140 scsi_transport_reserve_device(zfcp_scsi_transport_template,
141 sizeof(struct zfcp_scsi_dev)); 141 sizeof(struct zfcp_scsi_dev));
142 142
143
144 retval = misc_register(&zfcp_cfdc_misc);
145 if (retval) {
146 pr_err("Registering the misc device zfcp_cfdc failed\n");
147 goto out_misc;
148 }
149
150 retval = ccw_driver_register(&zfcp_ccw_driver); 143 retval = ccw_driver_register(&zfcp_ccw_driver);
151 if (retval) { 144 if (retval) {
152 pr_err("The zfcp device driver could not register with " 145 pr_err("The zfcp device driver could not register with "
@@ -159,8 +152,6 @@ static int __init zfcp_module_init(void)
159 return 0; 152 return 0;
160 153
161out_ccw_register: 154out_ccw_register:
162 misc_deregister(&zfcp_cfdc_misc);
163out_misc:
164 fc_release_transport(zfcp_scsi_transport_template); 155 fc_release_transport(zfcp_scsi_transport_template);
165out_transport: 156out_transport:
166 kmem_cache_destroy(zfcp_fc_req_cache); 157 kmem_cache_destroy(zfcp_fc_req_cache);
@@ -175,7 +166,6 @@ module_init(zfcp_module_init);
175static void __exit zfcp_module_exit(void) 166static void __exit zfcp_module_exit(void)
176{ 167{
177 ccw_driver_unregister(&zfcp_ccw_driver); 168 ccw_driver_unregister(&zfcp_ccw_driver);
178 misc_deregister(&zfcp_cfdc_misc);
179 fc_release_transport(zfcp_scsi_transport_template); 169 fc_release_transport(zfcp_scsi_transport_template);
180 kmem_cache_destroy(zfcp_fc_req_cache); 170 kmem_cache_destroy(zfcp_fc_req_cache);
181 kmem_cache_destroy(zfcp_fsf_qtcb_cache); 171 kmem_cache_destroy(zfcp_fsf_qtcb_cache);
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c
index 8e71d35a64cc..f9879d400d0e 100644
--- a/drivers/s390/scsi/zfcp_ccw.c
+++ b/drivers/s390/scsi/zfcp_ccw.c
@@ -72,15 +72,6 @@ static struct ccw_device_id zfcp_ccw_device_id[] = {
72MODULE_DEVICE_TABLE(ccw, zfcp_ccw_device_id); 72MODULE_DEVICE_TABLE(ccw, zfcp_ccw_device_id);
73 73
74/** 74/**
75 * zfcp_ccw_priv_sch - check if subchannel is privileged
76 * @adapter: Adapter/Subchannel to check
77 */
78int zfcp_ccw_priv_sch(struct zfcp_adapter *adapter)
79{
80 return adapter->ccw_device->id.dev_model == ZFCP_MODEL_PRIV;
81}
82
83/**
84 * zfcp_ccw_probe - probe function of zfcp driver 75 * zfcp_ccw_probe - probe function of zfcp driver
85 * @cdev: pointer to belonging ccw device 76 * @cdev: pointer to belonging ccw device
86 * 77 *
diff --git a/drivers/s390/scsi/zfcp_cfdc.c b/drivers/s390/scsi/zfcp_cfdc.c
deleted file mode 100644
index b46f54eeb9d0..000000000000
--- a/drivers/s390/scsi/zfcp_cfdc.c
+++ /dev/null
@@ -1,448 +0,0 @@
1/*
2 * zfcp device driver
3 *
4 * Userspace interface for accessing the
5 * Access Control Lists / Control File Data Channel;
6 * handling of response code and states for ports and LUNs.
7 *
8 * Copyright IBM Corp. 2008, 2010
9 */
10
11#define KMSG_COMPONENT "zfcp"
12#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
13
14#include <linux/compat.h>
15#include <linux/slab.h>
16#include <linux/types.h>
17#include <linux/module.h>
18#include <linux/miscdevice.h>
19#include <asm/compat.h>
20#include <asm/ccwdev.h>
21#include "zfcp_def.h"
22#include "zfcp_ext.h"
23#include "zfcp_fsf.h"
24
25#define ZFCP_CFDC_CMND_DOWNLOAD_NORMAL 0x00010001
26#define ZFCP_CFDC_CMND_DOWNLOAD_FORCE 0x00010101
27#define ZFCP_CFDC_CMND_FULL_ACCESS 0x00000201
28#define ZFCP_CFDC_CMND_RESTRICTED_ACCESS 0x00000401
29#define ZFCP_CFDC_CMND_UPLOAD 0x00010002
30
31#define ZFCP_CFDC_DOWNLOAD 0x00000001
32#define ZFCP_CFDC_UPLOAD 0x00000002
33#define ZFCP_CFDC_WITH_CONTROL_FILE 0x00010000
34
35#define ZFCP_CFDC_IOC_MAGIC 0xDD
36#define ZFCP_CFDC_IOC \
37 _IOWR(ZFCP_CFDC_IOC_MAGIC, 0, struct zfcp_cfdc_data)
38
39/**
40 * struct zfcp_cfdc_data - data for ioctl cfdc interface
41 * @signature: request signature
42 * @devno: FCP adapter device number
43 * @command: command code
44 * @fsf_status: returns status of FSF command to userspace
45 * @fsf_status_qual: returned to userspace
46 * @payloads: access conflicts list
47 * @control_file: access control table
48 */
49struct zfcp_cfdc_data {
50 u32 signature;
51 u32 devno;
52 u32 command;
53 u32 fsf_status;
54 u8 fsf_status_qual[FSF_STATUS_QUALIFIER_SIZE];
55 u8 payloads[256];
56 u8 control_file[0];
57};
58
59static int zfcp_cfdc_copy_from_user(struct scatterlist *sg,
60 void __user *user_buffer)
61{
62 unsigned int length;
63 unsigned int size = ZFCP_CFDC_MAX_SIZE;
64
65 while (size) {
66 length = min((unsigned int)size, sg->length);
67 if (copy_from_user(sg_virt(sg++), user_buffer, length))
68 return -EFAULT;
69 user_buffer += length;
70 size -= length;
71 }
72 return 0;
73}
74
75static int zfcp_cfdc_copy_to_user(void __user *user_buffer,
76 struct scatterlist *sg)
77{
78 unsigned int length;
79 unsigned int size = ZFCP_CFDC_MAX_SIZE;
80
81 while (size) {
82 length = min((unsigned int) size, sg->length);
83 if (copy_to_user(user_buffer, sg_virt(sg++), length))
84 return -EFAULT;
85 user_buffer += length;
86 size -= length;
87 }
88 return 0;
89}
90
91static struct zfcp_adapter *zfcp_cfdc_get_adapter(u32 devno)
92{
93 char busid[9];
94 struct ccw_device *cdev;
95 struct zfcp_adapter *adapter;
96
97 snprintf(busid, sizeof(busid), "0.0.%04x", devno);
98 cdev = get_ccwdev_by_busid(&zfcp_ccw_driver, busid);
99 if (!cdev)
100 return NULL;
101
102 adapter = zfcp_ccw_adapter_by_cdev(cdev);
103
104 put_device(&cdev->dev);
105 return adapter;
106}
107
108static int zfcp_cfdc_set_fsf(struct zfcp_fsf_cfdc *fsf_cfdc, int command)
109{
110 switch (command) {
111 case ZFCP_CFDC_CMND_DOWNLOAD_NORMAL:
112 fsf_cfdc->command = FSF_QTCB_DOWNLOAD_CONTROL_FILE;
113 fsf_cfdc->option = FSF_CFDC_OPTION_NORMAL_MODE;
114 break;
115 case ZFCP_CFDC_CMND_DOWNLOAD_FORCE:
116 fsf_cfdc->command = FSF_QTCB_DOWNLOAD_CONTROL_FILE;
117 fsf_cfdc->option = FSF_CFDC_OPTION_FORCE;
118 break;
119 case ZFCP_CFDC_CMND_FULL_ACCESS:
120 fsf_cfdc->command = FSF_QTCB_DOWNLOAD_CONTROL_FILE;
121 fsf_cfdc->option = FSF_CFDC_OPTION_FULL_ACCESS;
122 break;
123 case ZFCP_CFDC_CMND_RESTRICTED_ACCESS:
124 fsf_cfdc->command = FSF_QTCB_DOWNLOAD_CONTROL_FILE;
125 fsf_cfdc->option = FSF_CFDC_OPTION_RESTRICTED_ACCESS;
126 break;
127 case ZFCP_CFDC_CMND_UPLOAD:
128 fsf_cfdc->command = FSF_QTCB_UPLOAD_CONTROL_FILE;
129 fsf_cfdc->option = 0;
130 break;
131 default:
132 return -EINVAL;
133 }
134
135 return 0;
136}
137
138static int zfcp_cfdc_sg_setup(int command, struct scatterlist *sg,
139 u8 __user *control_file)
140{
141 int retval;
142 retval = zfcp_sg_setup_table(sg, ZFCP_CFDC_PAGES);
143 if (retval)
144 return retval;
145
146 sg[ZFCP_CFDC_PAGES - 1].length = ZFCP_CFDC_MAX_SIZE % PAGE_SIZE;
147
148 if (command & ZFCP_CFDC_WITH_CONTROL_FILE &&
149 command & ZFCP_CFDC_DOWNLOAD) {
150 retval = zfcp_cfdc_copy_from_user(sg, control_file);
151 if (retval) {
152 zfcp_sg_free_table(sg, ZFCP_CFDC_PAGES);
153 return -EFAULT;
154 }
155 }
156
157 return 0;
158}
159
160static void zfcp_cfdc_req_to_sense(struct zfcp_cfdc_data *data,
161 struct zfcp_fsf_req *req)
162{
163 data->fsf_status = req->qtcb->header.fsf_status;
164 memcpy(&data->fsf_status_qual, &req->qtcb->header.fsf_status_qual,
165 sizeof(union fsf_status_qual));
166 memcpy(&data->payloads, &req->qtcb->bottom.support.els,
167 sizeof(req->qtcb->bottom.support.els));
168}
169
170static long zfcp_cfdc_dev_ioctl(struct file *file, unsigned int command,
171 unsigned long arg)
172{
173 struct zfcp_cfdc_data *data;
174 struct zfcp_cfdc_data __user *data_user;
175 struct zfcp_adapter *adapter;
176 struct zfcp_fsf_req *req;
177 struct zfcp_fsf_cfdc *fsf_cfdc;
178 int retval;
179
180 if (command != ZFCP_CFDC_IOC)
181 return -ENOTTY;
182
183 if (is_compat_task())
184 data_user = compat_ptr(arg);
185 else
186 data_user = (void __user *)arg;
187
188 if (!data_user)
189 return -EINVAL;
190
191 fsf_cfdc = kmalloc(sizeof(struct zfcp_fsf_cfdc), GFP_KERNEL);
192 if (!fsf_cfdc)
193 return -ENOMEM;
194
195 data = memdup_user(data_user, sizeof(*data_user));
196 if (IS_ERR(data)) {
197 retval = PTR_ERR(data);
198 goto no_mem_sense;
199 }
200
201 if (data->signature != 0xCFDCACDF) {
202 retval = -EINVAL;
203 goto free_buffer;
204 }
205
206 retval = zfcp_cfdc_set_fsf(fsf_cfdc, data->command);
207
208 adapter = zfcp_cfdc_get_adapter(data->devno);
209 if (!adapter) {
210 retval = -ENXIO;
211 goto free_buffer;
212 }
213
214 retval = zfcp_cfdc_sg_setup(data->command, fsf_cfdc->sg,
215 data_user->control_file);
216 if (retval)
217 goto adapter_put;
218 req = zfcp_fsf_control_file(adapter, fsf_cfdc);
219 if (IS_ERR(req)) {
220 retval = PTR_ERR(req);
221 goto free_sg;
222 }
223
224 if (req->status & ZFCP_STATUS_FSFREQ_ERROR) {
225 retval = -ENXIO;
226 goto free_fsf;
227 }
228
229 zfcp_cfdc_req_to_sense(data, req);
230 retval = copy_to_user(data_user, data, sizeof(*data_user));
231 if (retval) {
232 retval = -EFAULT;
233 goto free_fsf;
234 }
235
236 if (data->command & ZFCP_CFDC_UPLOAD)
237 retval = zfcp_cfdc_copy_to_user(&data_user->control_file,
238 fsf_cfdc->sg);
239
240 free_fsf:
241 zfcp_fsf_req_free(req);
242 free_sg:
243 zfcp_sg_free_table(fsf_cfdc->sg, ZFCP_CFDC_PAGES);
244 adapter_put:
245 zfcp_ccw_adapter_put(adapter);
246 free_buffer:
247 kfree(data);
248 no_mem_sense:
249 kfree(fsf_cfdc);
250 return retval;
251}
252
253static const struct file_operations zfcp_cfdc_fops = {
254 .owner = THIS_MODULE,
255 .open = nonseekable_open,
256 .unlocked_ioctl = zfcp_cfdc_dev_ioctl,
257#ifdef CONFIG_COMPAT
258 .compat_ioctl = zfcp_cfdc_dev_ioctl,
259#endif
260 .llseek = no_llseek,
261};
262
263struct miscdevice zfcp_cfdc_misc = {
264 .minor = MISC_DYNAMIC_MINOR,
265 .name = "zfcp_cfdc",
266 .fops = &zfcp_cfdc_fops,
267};
268
269/**
270 * zfcp_cfdc_adapter_access_changed - Process change in adapter ACT
271 * @adapter: Adapter where the Access Control Table (ACT) changed
272 *
273 * After a change in the adapter ACT, check if access to any
274 * previously denied resources is now possible.
275 */
276void zfcp_cfdc_adapter_access_changed(struct zfcp_adapter *adapter)
277{
278 unsigned long flags;
279 struct zfcp_port *port;
280 struct scsi_device *sdev;
281 struct zfcp_scsi_dev *zfcp_sdev;
282 int status;
283
284 if (adapter->connection_features & FSF_FEATURE_NPIV_MODE)
285 return;
286
287 read_lock_irqsave(&adapter->port_list_lock, flags);
288 list_for_each_entry(port, &adapter->port_list, list) {
289 status = atomic_read(&port->status);
290 if ((status & ZFCP_STATUS_COMMON_ACCESS_DENIED) ||
291 (status & ZFCP_STATUS_COMMON_ACCESS_BOXED))
292 zfcp_erp_port_reopen(port,
293 ZFCP_STATUS_COMMON_ERP_FAILED,
294 "cfaac_1");
295 }
296 read_unlock_irqrestore(&adapter->port_list_lock, flags);
297
298 shost_for_each_device(sdev, adapter->scsi_host) {
299 zfcp_sdev = sdev_to_zfcp(sdev);
300 status = atomic_read(&zfcp_sdev->status);
301 if ((status & ZFCP_STATUS_COMMON_ACCESS_DENIED) ||
302 (status & ZFCP_STATUS_COMMON_ACCESS_BOXED))
303 zfcp_erp_lun_reopen(sdev,
304 ZFCP_STATUS_COMMON_ERP_FAILED,
305 "cfaac_2");
306 }
307}
308
309static void zfcp_act_eval_err(struct zfcp_adapter *adapter, u32 table)
310{
311 u16 subtable = table >> 16;
312 u16 rule = table & 0xffff;
313 const char *act_type[] = { "unknown", "OS", "WWPN", "DID", "LUN" };
314
315 if (subtable && subtable < ARRAY_SIZE(act_type))
316 dev_warn(&adapter->ccw_device->dev,
317 "Access denied according to ACT rule type %s, "
318 "rule %d\n", act_type[subtable], rule);
319}
320
321/**
322 * zfcp_cfdc_port_denied - Process "access denied" for port
323 * @port: The port where the access has been denied
324 * @qual: The FSF status qualifier for the access denied FSF status
325 */
326void zfcp_cfdc_port_denied(struct zfcp_port *port,
327 union fsf_status_qual *qual)
328{
329 dev_warn(&port->adapter->ccw_device->dev,
330 "Access denied to port 0x%016Lx\n",
331 (unsigned long long)port->wwpn);
332
333 zfcp_act_eval_err(port->adapter, qual->halfword[0]);
334 zfcp_act_eval_err(port->adapter, qual->halfword[1]);
335 zfcp_erp_set_port_status(port,
336 ZFCP_STATUS_COMMON_ERP_FAILED |
337 ZFCP_STATUS_COMMON_ACCESS_DENIED);
338}
339
340/**
341 * zfcp_cfdc_lun_denied - Process "access denied" for LUN
342 * @sdev: The SCSI device / LUN where the access has been denied
343 * @qual: The FSF status qualifier for the access denied FSF status
344 */
345void zfcp_cfdc_lun_denied(struct scsi_device *sdev,
346 union fsf_status_qual *qual)
347{
348 struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(sdev);
349
350 dev_warn(&zfcp_sdev->port->adapter->ccw_device->dev,
351 "Access denied to LUN 0x%016Lx on port 0x%016Lx\n",
352 zfcp_scsi_dev_lun(sdev),
353 (unsigned long long)zfcp_sdev->port->wwpn);
354 zfcp_act_eval_err(zfcp_sdev->port->adapter, qual->halfword[0]);
355 zfcp_act_eval_err(zfcp_sdev->port->adapter, qual->halfword[1]);
356 zfcp_erp_set_lun_status(sdev,
357 ZFCP_STATUS_COMMON_ERP_FAILED |
358 ZFCP_STATUS_COMMON_ACCESS_DENIED);
359
360 atomic_clear_mask(ZFCP_STATUS_LUN_SHARED, &zfcp_sdev->status);
361 atomic_clear_mask(ZFCP_STATUS_LUN_READONLY, &zfcp_sdev->status);
362}
363
364/**
365 * zfcp_cfdc_lun_shrng_vltn - Evaluate LUN sharing violation status
366 * @sdev: The LUN / SCSI device where sharing violation occurred
367 * @qual: The FSF status qualifier from the LUN sharing violation
368 */
369void zfcp_cfdc_lun_shrng_vltn(struct scsi_device *sdev,
370 union fsf_status_qual *qual)
371{
372 struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(sdev);
373
374 if (qual->word[0])
375 dev_warn(&zfcp_sdev->port->adapter->ccw_device->dev,
376 "LUN 0x%Lx on port 0x%Lx is already in "
377 "use by CSS%d, MIF Image ID %x\n",
378 zfcp_scsi_dev_lun(sdev),
379 (unsigned long long)zfcp_sdev->port->wwpn,
380 qual->fsf_queue_designator.cssid,
381 qual->fsf_queue_designator.hla);
382 else
383 zfcp_act_eval_err(zfcp_sdev->port->adapter, qual->word[2]);
384
385 zfcp_erp_set_lun_status(sdev,
386 ZFCP_STATUS_COMMON_ERP_FAILED |
387 ZFCP_STATUS_COMMON_ACCESS_DENIED);
388 atomic_clear_mask(ZFCP_STATUS_LUN_SHARED, &zfcp_sdev->status);
389 atomic_clear_mask(ZFCP_STATUS_LUN_READONLY, &zfcp_sdev->status);
390}
391
392/**
393 * zfcp_cfdc_open_lun_eval - Eval access ctrl. status for successful "open lun"
394 * @sdev: The SCSI device / LUN where to evaluate the status
395 * @bottom: The qtcb bottom with the status from the "open lun"
396 *
397 * Returns: 0 if LUN is usable, -EACCES if the access control table
398 * reports an unsupported configuration.
399 */
400int zfcp_cfdc_open_lun_eval(struct scsi_device *sdev,
401 struct fsf_qtcb_bottom_support *bottom)
402{
403 int shared, rw;
404 struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(sdev);
405 struct zfcp_adapter *adapter = zfcp_sdev->port->adapter;
406
407 if ((adapter->connection_features & FSF_FEATURE_NPIV_MODE) ||
408 !(adapter->adapter_features & FSF_FEATURE_LUN_SHARING) ||
409 zfcp_ccw_priv_sch(adapter))
410 return 0;
411
412 shared = !(bottom->lun_access_info & FSF_UNIT_ACCESS_EXCLUSIVE);
413 rw = (bottom->lun_access_info & FSF_UNIT_ACCESS_OUTBOUND_TRANSFER);
414
415 if (shared)
416 atomic_set_mask(ZFCP_STATUS_LUN_SHARED, &zfcp_sdev->status);
417
418 if (!rw) {
419 atomic_set_mask(ZFCP_STATUS_LUN_READONLY, &zfcp_sdev->status);
420 dev_info(&adapter->ccw_device->dev, "SCSI device at LUN "
421 "0x%016Lx on port 0x%016Lx opened read-only\n",
422 zfcp_scsi_dev_lun(sdev),
423 (unsigned long long)zfcp_sdev->port->wwpn);
424 }
425
426 if (!shared && !rw) {
427 dev_err(&adapter->ccw_device->dev, "Exclusive read-only access "
428 "not supported (LUN 0x%016Lx, port 0x%016Lx)\n",
429 zfcp_scsi_dev_lun(sdev),
430 (unsigned long long)zfcp_sdev->port->wwpn);
431 zfcp_erp_set_lun_status(sdev, ZFCP_STATUS_COMMON_ERP_FAILED);
432 zfcp_erp_lun_shutdown(sdev, 0, "fsouh_6");
433 return -EACCES;
434 }
435
436 if (shared && rw) {
437 dev_err(&adapter->ccw_device->dev,
438 "Shared read-write access not supported "
439 "(LUN 0x%016Lx, port 0x%016Lx)\n",
440 zfcp_scsi_dev_lun(sdev),
441 (unsigned long long)zfcp_sdev->port->wwpn);
442 zfcp_erp_set_lun_status(sdev, ZFCP_STATUS_COMMON_ERP_FAILED);
443 zfcp_erp_lun_shutdown(sdev, 0, "fsosh_8");
444 return -EACCES;
445 }
446
447 return 0;
448}
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index 1305955cbf59..d91173f326c5 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -86,10 +86,6 @@ struct zfcp_reqlist;
86#define ZFCP_STATUS_PORT_PHYS_OPEN 0x00000001 86#define ZFCP_STATUS_PORT_PHYS_OPEN 0x00000001
87#define ZFCP_STATUS_PORT_LINK_TEST 0x00000002 87#define ZFCP_STATUS_PORT_LINK_TEST 0x00000002
88 88
89/* logical unit status */
90#define ZFCP_STATUS_LUN_SHARED 0x00000004
91#define ZFCP_STATUS_LUN_READONLY 0x00000008
92
93/* FSF request status (this does not have a common part) */ 89/* FSF request status (this does not have a common part) */
94#define ZFCP_STATUS_FSFREQ_ERROR 0x00000008 90#define ZFCP_STATUS_FSFREQ_ERROR 0x00000008
95#define ZFCP_STATUS_FSFREQ_CLEANUP 0x00000010 91#define ZFCP_STATUS_FSFREQ_CLEANUP 0x00000010
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index 4133ab6e20f1..1d4c8fe72752 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -950,8 +950,7 @@ static void zfcp_erp_lun_strategy_clearstati(struct scsi_device *sdev)
950{ 950{
951 struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(sdev); 951 struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(sdev);
952 952
953 atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED | 953 atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED,
954 ZFCP_STATUS_LUN_SHARED | ZFCP_STATUS_LUN_READONLY,
955 &zfcp_sdev->status); 954 &zfcp_sdev->status);
956} 955}
957 956
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h
index 248578db30bb..83e3f1408c38 100644
--- a/drivers/s390/scsi/zfcp_ext.h
+++ b/drivers/s390/scsi/zfcp_ext.h
@@ -25,22 +25,10 @@ extern void zfcp_adapter_release(struct kref *);
25extern void zfcp_adapter_unregister(struct zfcp_adapter *); 25extern void zfcp_adapter_unregister(struct zfcp_adapter *);
26 26
27/* zfcp_ccw.c */ 27/* zfcp_ccw.c */
28extern int zfcp_ccw_priv_sch(struct zfcp_adapter *);
29extern struct ccw_driver zfcp_ccw_driver; 28extern struct ccw_driver zfcp_ccw_driver;
30extern struct zfcp_adapter *zfcp_ccw_adapter_by_cdev(struct ccw_device *); 29extern struct zfcp_adapter *zfcp_ccw_adapter_by_cdev(struct ccw_device *);
31extern void zfcp_ccw_adapter_put(struct zfcp_adapter *); 30extern void zfcp_ccw_adapter_put(struct zfcp_adapter *);
32 31
33/* zfcp_cfdc.c */
34extern struct miscdevice zfcp_cfdc_misc;
35extern void zfcp_cfdc_port_denied(struct zfcp_port *, union fsf_status_qual *);
36extern void zfcp_cfdc_lun_denied(struct scsi_device *, union fsf_status_qual *);
37extern void zfcp_cfdc_lun_shrng_vltn(struct scsi_device *,
38 union fsf_status_qual *);
39extern int zfcp_cfdc_open_lun_eval(struct scsi_device *,
40 struct fsf_qtcb_bottom_support *);
41extern void zfcp_cfdc_adapter_access_changed(struct zfcp_adapter *);
42
43
44/* zfcp_dbf.c */ 32/* zfcp_dbf.c */
45extern int zfcp_dbf_adapter_register(struct zfcp_adapter *); 33extern int zfcp_dbf_adapter_register(struct zfcp_adapter *);
46extern void zfcp_dbf_adapter_unregister(struct zfcp_adapter *); 34extern void zfcp_dbf_adapter_unregister(struct zfcp_adapter *);
@@ -115,8 +103,6 @@ extern int zfcp_fsf_exchange_config_data_sync(struct zfcp_qdio *,
115extern int zfcp_fsf_exchange_port_data(struct zfcp_erp_action *); 103extern int zfcp_fsf_exchange_port_data(struct zfcp_erp_action *);
116extern int zfcp_fsf_exchange_port_data_sync(struct zfcp_qdio *, 104extern int zfcp_fsf_exchange_port_data_sync(struct zfcp_qdio *,
117 struct fsf_qtcb_bottom_port *); 105 struct fsf_qtcb_bottom_port *);
118extern struct zfcp_fsf_req *zfcp_fsf_control_file(struct zfcp_adapter *,
119 struct zfcp_fsf_cfdc *);
120extern void zfcp_fsf_req_dismiss_all(struct zfcp_adapter *); 106extern void zfcp_fsf_req_dismiss_all(struct zfcp_adapter *);
121extern int zfcp_fsf_status_read(struct zfcp_qdio *); 107extern int zfcp_fsf_status_read(struct zfcp_qdio *);
122extern int zfcp_status_read_refill(struct zfcp_adapter *adapter); 108extern int zfcp_status_read_refill(struct zfcp_adapter *adapter);
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 06760e435259..0bb40c9dbd0c 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -254,14 +254,9 @@ static void zfcp_fsf_status_read_handler(struct zfcp_fsf_req *req)
254 254
255 break; 255 break;
256 case FSF_STATUS_READ_NOTIFICATION_LOST: 256 case FSF_STATUS_READ_NOTIFICATION_LOST:
257 if (sr_buf->status_subtype & FSF_STATUS_READ_SUB_ACT_UPDATED)
258 zfcp_cfdc_adapter_access_changed(adapter);
259 if (sr_buf->status_subtype & FSF_STATUS_READ_SUB_INCOMING_ELS) 257 if (sr_buf->status_subtype & FSF_STATUS_READ_SUB_INCOMING_ELS)
260 zfcp_fc_conditional_port_scan(adapter); 258 zfcp_fc_conditional_port_scan(adapter);
261 break; 259 break;
262 case FSF_STATUS_READ_CFDC_UPDATED:
263 zfcp_cfdc_adapter_access_changed(adapter);
264 break;
265 case FSF_STATUS_READ_FEATURE_UPDATE_ALERT: 260 case FSF_STATUS_READ_FEATURE_UPDATE_ALERT:
266 adapter->adapter_features = sr_buf->payload.word[0]; 261 adapter->adapter_features = sr_buf->payload.word[0];
267 break; 262 break;
@@ -935,8 +930,6 @@ static void zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *req)
935 break; 930 break;
936 } 931 }
937 break; 932 break;
938 case FSF_ACCESS_DENIED:
939 break;
940 case FSF_PORT_BOXED: 933 case FSF_PORT_BOXED:
941 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 934 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
942 break; 935 break;
@@ -1090,7 +1083,6 @@ out:
1090static void zfcp_fsf_send_els_handler(struct zfcp_fsf_req *req) 1083static void zfcp_fsf_send_els_handler(struct zfcp_fsf_req *req)
1091{ 1084{
1092 struct zfcp_fsf_ct_els *send_els = req->data; 1085 struct zfcp_fsf_ct_els *send_els = req->data;
1093 struct zfcp_port *port = send_els->port;
1094 struct fsf_qtcb_header *header = &req->qtcb->header; 1086 struct fsf_qtcb_header *header = &req->qtcb->header;
1095 1087
1096 send_els->status = -EINVAL; 1088 send_els->status = -EINVAL;
@@ -1120,12 +1112,6 @@ static void zfcp_fsf_send_els_handler(struct zfcp_fsf_req *req)
1120 case FSF_REQUEST_SIZE_TOO_LARGE: 1112 case FSF_REQUEST_SIZE_TOO_LARGE:
1121 case FSF_RESPONSE_SIZE_TOO_LARGE: 1113 case FSF_RESPONSE_SIZE_TOO_LARGE:
1122 break; 1114 break;
1123 case FSF_ACCESS_DENIED:
1124 if (port) {
1125 zfcp_cfdc_port_denied(port, &header->fsf_status_qual);
1126 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1127 }
1128 break;
1129 case FSF_SBAL_MISMATCH: 1115 case FSF_SBAL_MISMATCH:
1130 /* should never occur, avoided in zfcp_fsf_send_els */ 1116 /* should never occur, avoided in zfcp_fsf_send_els */
1131 /* fall through */ 1117 /* fall through */
@@ -1213,8 +1199,6 @@ int zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action)
1213 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); 1199 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req);
1214 1200
1215 req->qtcb->bottom.config.feature_selection = 1201 req->qtcb->bottom.config.feature_selection =
1216 FSF_FEATURE_CFDC |
1217 FSF_FEATURE_LUN_SHARING |
1218 FSF_FEATURE_NOTIFICATION_LOST | 1202 FSF_FEATURE_NOTIFICATION_LOST |
1219 FSF_FEATURE_UPDATE_ALERT; 1203 FSF_FEATURE_UPDATE_ALERT;
1220 req->erp_action = erp_action; 1204 req->erp_action = erp_action;
@@ -1254,8 +1238,6 @@ int zfcp_fsf_exchange_config_data_sync(struct zfcp_qdio *qdio,
1254 req->handler = zfcp_fsf_exchange_config_data_handler; 1238 req->handler = zfcp_fsf_exchange_config_data_handler;
1255 1239
1256 req->qtcb->bottom.config.feature_selection = 1240 req->qtcb->bottom.config.feature_selection =
1257 FSF_FEATURE_CFDC |
1258 FSF_FEATURE_LUN_SHARING |
1259 FSF_FEATURE_NOTIFICATION_LOST | 1241 FSF_FEATURE_NOTIFICATION_LOST |
1260 FSF_FEATURE_UPDATE_ALERT; 1242 FSF_FEATURE_UPDATE_ALERT;
1261 1243
@@ -1382,10 +1364,6 @@ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req)
1382 switch (header->fsf_status) { 1364 switch (header->fsf_status) {
1383 case FSF_PORT_ALREADY_OPEN: 1365 case FSF_PORT_ALREADY_OPEN:
1384 break; 1366 break;
1385 case FSF_ACCESS_DENIED:
1386 zfcp_cfdc_port_denied(port, &header->fsf_status_qual);
1387 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1388 break;
1389 case FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED: 1367 case FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED:
1390 dev_warn(&req->adapter->ccw_device->dev, 1368 dev_warn(&req->adapter->ccw_device->dev,
1391 "Not enough FCP adapter resources to open " 1369 "Not enough FCP adapter resources to open "
@@ -1568,8 +1546,6 @@ static void zfcp_fsf_open_wka_port_handler(struct zfcp_fsf_req *req)
1568 /* fall through */ 1546 /* fall through */
1569 case FSF_ADAPTER_STATUS_AVAILABLE: 1547 case FSF_ADAPTER_STATUS_AVAILABLE:
1570 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1548 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1571 /* fall through */
1572 case FSF_ACCESS_DENIED:
1573 wka_port->status = ZFCP_FC_WKA_PORT_OFFLINE; 1549 wka_port->status = ZFCP_FC_WKA_PORT_OFFLINE;
1574 break; 1550 break;
1575 case FSF_GOOD: 1551 case FSF_GOOD:
@@ -1689,9 +1665,6 @@ static void zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *req)
1689 zfcp_erp_adapter_reopen(port->adapter, 0, "fscpph1"); 1665 zfcp_erp_adapter_reopen(port->adapter, 0, "fscpph1");
1690 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1666 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1691 break; 1667 break;
1692 case FSF_ACCESS_DENIED:
1693 zfcp_cfdc_port_denied(port, &header->fsf_status_qual);
1694 break;
1695 case FSF_PORT_BOXED: 1668 case FSF_PORT_BOXED:
1696 /* can't use generic zfcp_erp_modify_port_status because 1669 /* can't use generic zfcp_erp_modify_port_status because
1697 * ZFCP_STATUS_COMMON_OPEN must not be reset for the port */ 1670 * ZFCP_STATUS_COMMON_OPEN must not be reset for the port */
@@ -1777,7 +1750,7 @@ static void zfcp_fsf_open_lun_handler(struct zfcp_fsf_req *req)
1777 struct scsi_device *sdev = req->data; 1750 struct scsi_device *sdev = req->data;
1778 struct zfcp_scsi_dev *zfcp_sdev; 1751 struct zfcp_scsi_dev *zfcp_sdev;
1779 struct fsf_qtcb_header *header = &req->qtcb->header; 1752 struct fsf_qtcb_header *header = &req->qtcb->header;
1780 struct fsf_qtcb_bottom_support *bottom = &req->qtcb->bottom.support; 1753 union fsf_status_qual *qual = &header->fsf_status_qual;
1781 1754
1782 if (req->status & ZFCP_STATUS_FSFREQ_ERROR) 1755 if (req->status & ZFCP_STATUS_FSFREQ_ERROR)
1783 return; 1756 return;
@@ -1785,9 +1758,7 @@ static void zfcp_fsf_open_lun_handler(struct zfcp_fsf_req *req)
1785 zfcp_sdev = sdev_to_zfcp(sdev); 1758 zfcp_sdev = sdev_to_zfcp(sdev);
1786 1759
1787 atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED | 1760 atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED |
1788 ZFCP_STATUS_COMMON_ACCESS_BOXED | 1761 ZFCP_STATUS_COMMON_ACCESS_BOXED,
1789 ZFCP_STATUS_LUN_SHARED |
1790 ZFCP_STATUS_LUN_READONLY,
1791 &zfcp_sdev->status); 1762 &zfcp_sdev->status);
1792 1763
1793 switch (header->fsf_status) { 1764 switch (header->fsf_status) {
@@ -1797,10 +1768,6 @@ static void zfcp_fsf_open_lun_handler(struct zfcp_fsf_req *req)
1797 /* fall through */ 1768 /* fall through */
1798 case FSF_LUN_ALREADY_OPEN: 1769 case FSF_LUN_ALREADY_OPEN:
1799 break; 1770 break;
1800 case FSF_ACCESS_DENIED:
1801 zfcp_cfdc_lun_denied(sdev, &header->fsf_status_qual);
1802 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1803 break;
1804 case FSF_PORT_BOXED: 1771 case FSF_PORT_BOXED:
1805 zfcp_erp_set_port_status(zfcp_sdev->port, 1772 zfcp_erp_set_port_status(zfcp_sdev->port,
1806 ZFCP_STATUS_COMMON_ACCESS_BOXED); 1773 ZFCP_STATUS_COMMON_ACCESS_BOXED);
@@ -1809,7 +1776,17 @@ static void zfcp_fsf_open_lun_handler(struct zfcp_fsf_req *req)
1809 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1776 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1810 break; 1777 break;
1811 case FSF_LUN_SHARING_VIOLATION: 1778 case FSF_LUN_SHARING_VIOLATION:
1812 zfcp_cfdc_lun_shrng_vltn(sdev, &header->fsf_status_qual); 1779 if (qual->word[0])
1780 dev_warn(&zfcp_sdev->port->adapter->ccw_device->dev,
1781 "LUN 0x%Lx on port 0x%Lx is already in "
1782 "use by CSS%d, MIF Image ID %x\n",
1783 zfcp_scsi_dev_lun(sdev),
1784 (unsigned long long)zfcp_sdev->port->wwpn,
1785 qual->fsf_queue_designator.cssid,
1786 qual->fsf_queue_designator.hla);
1787 zfcp_erp_set_lun_status(sdev,
1788 ZFCP_STATUS_COMMON_ERP_FAILED |
1789 ZFCP_STATUS_COMMON_ACCESS_DENIED);
1813 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1790 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1814 break; 1791 break;
1815 case FSF_MAXIMUM_NUMBER_OF_LUNS_EXCEEDED: 1792 case FSF_MAXIMUM_NUMBER_OF_LUNS_EXCEEDED:
@@ -1837,7 +1814,6 @@ static void zfcp_fsf_open_lun_handler(struct zfcp_fsf_req *req)
1837 case FSF_GOOD: 1814 case FSF_GOOD:
1838 zfcp_sdev->lun_handle = header->lun_handle; 1815 zfcp_sdev->lun_handle = header->lun_handle;
1839 atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &zfcp_sdev->status); 1816 atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &zfcp_sdev->status);
1840 zfcp_cfdc_open_lun_eval(sdev, bottom);
1841 break; 1817 break;
1842 } 1818 }
1843} 1819}
@@ -2065,10 +2041,6 @@ static void zfcp_fsf_fcp_handler_common(struct zfcp_fsf_req *req)
2065 case FSF_SERVICE_CLASS_NOT_SUPPORTED: 2041 case FSF_SERVICE_CLASS_NOT_SUPPORTED:
2066 zfcp_fsf_class_not_supp(req); 2042 zfcp_fsf_class_not_supp(req);
2067 break; 2043 break;
2068 case FSF_ACCESS_DENIED:
2069 zfcp_cfdc_lun_denied(sdev, &header->fsf_status_qual);
2070 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
2071 break;
2072 case FSF_DIRECTION_INDICATOR_NOT_VALID: 2044 case FSF_DIRECTION_INDICATOR_NOT_VALID:
2073 dev_err(&req->adapter->ccw_device->dev, 2045 dev_err(&req->adapter->ccw_device->dev,
2074 "Incorrect direction %d, LUN 0x%016Lx on port " 2046 "Incorrect direction %d, LUN 0x%016Lx on port "
@@ -2369,79 +2341,6 @@ out:
2369 return req; 2341 return req;
2370} 2342}
2371 2343
2372static void zfcp_fsf_control_file_handler(struct zfcp_fsf_req *req)
2373{
2374}
2375
2376/**
2377 * zfcp_fsf_control_file - control file upload/download
2378 * @adapter: pointer to struct zfcp_adapter
2379 * @fsf_cfdc: pointer to struct zfcp_fsf_cfdc
2380 * Returns: on success pointer to struct zfcp_fsf_req, NULL otherwise
2381 */
2382struct zfcp_fsf_req *zfcp_fsf_control_file(struct zfcp_adapter *adapter,
2383 struct zfcp_fsf_cfdc *fsf_cfdc)
2384{
2385 struct zfcp_qdio *qdio = adapter->qdio;
2386 struct zfcp_fsf_req *req = NULL;
2387 struct fsf_qtcb_bottom_support *bottom;
2388 int retval = -EIO;
2389 u8 direction;
2390
2391 if (!(adapter->adapter_features & FSF_FEATURE_CFDC))
2392 return ERR_PTR(-EOPNOTSUPP);
2393
2394 switch (fsf_cfdc->command) {
2395 case FSF_QTCB_DOWNLOAD_CONTROL_FILE:
2396 direction = SBAL_SFLAGS0_TYPE_WRITE;
2397 break;
2398 case FSF_QTCB_UPLOAD_CONTROL_FILE:
2399 direction = SBAL_SFLAGS0_TYPE_READ;
2400 break;
2401 default:
2402 return ERR_PTR(-EINVAL);
2403 }
2404
2405 spin_lock_irq(&qdio->req_q_lock);
2406 if (zfcp_qdio_sbal_get(qdio))
2407 goto out;
2408
2409 req = zfcp_fsf_req_create(qdio, fsf_cfdc->command, direction, NULL);
2410 if (IS_ERR(req)) {
2411 retval = -EPERM;
2412 goto out;
2413 }
2414
2415 req->handler = zfcp_fsf_control_file_handler;
2416
2417 bottom = &req->qtcb->bottom.support;
2418 bottom->operation_subtype = FSF_CFDC_OPERATION_SUBTYPE;
2419 bottom->option = fsf_cfdc->option;
2420
2421 retval = zfcp_qdio_sbals_from_sg(qdio, &req->qdio_req, fsf_cfdc->sg);
2422
2423 if (retval ||
2424 (zfcp_qdio_real_bytes(fsf_cfdc->sg) != ZFCP_CFDC_MAX_SIZE)) {
2425 zfcp_fsf_req_free(req);
2426 retval = -EIO;
2427 goto out;
2428 }
2429 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req);
2430 if (zfcp_adapter_multi_buffer_active(adapter))
2431 zfcp_qdio_set_scount(qdio, &req->qdio_req);
2432
2433 zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT);
2434 retval = zfcp_fsf_req_send(req);
2435out:
2436 spin_unlock_irq(&qdio->req_q_lock);
2437
2438 if (!retval) {
2439 wait_for_completion(&req->completion);
2440 return req;
2441 }
2442 return ERR_PTR(retval);
2443}
2444
2445/** 2344/**
2446 * zfcp_fsf_reqid_check - validate req_id contained in SBAL returned by QDIO 2345 * zfcp_fsf_reqid_check - validate req_id contained in SBAL returned by QDIO
2447 * @adapter: pointer to struct zfcp_adapter 2346 * @adapter: pointer to struct zfcp_adapter
diff --git a/drivers/s390/scsi/zfcp_fsf.h b/drivers/s390/scsi/zfcp_fsf.h
index 5e795b86931b..57ae3ae1046d 100644
--- a/drivers/s390/scsi/zfcp_fsf.h
+++ b/drivers/s390/scsi/zfcp_fsf.h
@@ -36,13 +36,6 @@
36#define FSF_CONFIG_COMMAND 0x00000003 36#define FSF_CONFIG_COMMAND 0x00000003
37#define FSF_PORT_COMMAND 0x00000004 37#define FSF_PORT_COMMAND 0x00000004
38 38
39/* FSF control file upload/download operations' subtype and options */
40#define FSF_CFDC_OPERATION_SUBTYPE 0x00020001
41#define FSF_CFDC_OPTION_NORMAL_MODE 0x00000000
42#define FSF_CFDC_OPTION_FORCE 0x00000001
43#define FSF_CFDC_OPTION_FULL_ACCESS 0x00000002
44#define FSF_CFDC_OPTION_RESTRICTED_ACCESS 0x00000004
45
46/* FSF protocol states */ 39/* FSF protocol states */
47#define FSF_PROT_GOOD 0x00000001 40#define FSF_PROT_GOOD 0x00000001
48#define FSF_PROT_QTCB_VERSION_ERROR 0x00000010 41#define FSF_PROT_QTCB_VERSION_ERROR 0x00000010
@@ -64,7 +57,6 @@
64#define FSF_HANDLE_MISMATCH 0x00000005 57#define FSF_HANDLE_MISMATCH 0x00000005
65#define FSF_SERVICE_CLASS_NOT_SUPPORTED 0x00000006 58#define FSF_SERVICE_CLASS_NOT_SUPPORTED 0x00000006
66#define FSF_FCPLUN_NOT_VALID 0x00000009 59#define FSF_FCPLUN_NOT_VALID 0x00000009
67#define FSF_ACCESS_DENIED 0x00000010
68#define FSF_LUN_SHARING_VIOLATION 0x00000012 60#define FSF_LUN_SHARING_VIOLATION 0x00000012
69#define FSF_FCP_COMMAND_DOES_NOT_EXIST 0x00000022 61#define FSF_FCP_COMMAND_DOES_NOT_EXIST 0x00000022
70#define FSF_DIRECTION_INDICATOR_NOT_VALID 0x00000030 62#define FSF_DIRECTION_INDICATOR_NOT_VALID 0x00000030
@@ -130,7 +122,6 @@
130#define FSF_STATUS_READ_LINK_DOWN 0x00000005 122#define FSF_STATUS_READ_LINK_DOWN 0x00000005
131#define FSF_STATUS_READ_LINK_UP 0x00000006 123#define FSF_STATUS_READ_LINK_UP 0x00000006
132#define FSF_STATUS_READ_NOTIFICATION_LOST 0x00000009 124#define FSF_STATUS_READ_NOTIFICATION_LOST 0x00000009
133#define FSF_STATUS_READ_CFDC_UPDATED 0x0000000A
134#define FSF_STATUS_READ_FEATURE_UPDATE_ALERT 0x0000000C 125#define FSF_STATUS_READ_FEATURE_UPDATE_ALERT 0x0000000C
135 126
136/* status subtypes for link down */ 127/* status subtypes for link down */
@@ -140,7 +131,6 @@
140 131
141/* status subtypes for unsolicited status notification lost */ 132/* status subtypes for unsolicited status notification lost */
142#define FSF_STATUS_READ_SUB_INCOMING_ELS 0x00000001 133#define FSF_STATUS_READ_SUB_INCOMING_ELS 0x00000001
143#define FSF_STATUS_READ_SUB_ACT_UPDATED 0x00000020
144 134
145/* topologie that is detected by the adapter */ 135/* topologie that is detected by the adapter */
146#define FSF_TOPO_P2P 0x00000001 136#define FSF_TOPO_P2P 0x00000001
@@ -166,8 +156,6 @@
166#define FSF_QTCB_LOG_SIZE 1024 156#define FSF_QTCB_LOG_SIZE 1024
167 157
168/* channel features */ 158/* channel features */
169#define FSF_FEATURE_CFDC 0x00000002
170#define FSF_FEATURE_LUN_SHARING 0x00000004
171#define FSF_FEATURE_NOTIFICATION_LOST 0x00000008 159#define FSF_FEATURE_NOTIFICATION_LOST 0x00000008
172#define FSF_FEATURE_HBAAPI_MANAGEMENT 0x00000010 160#define FSF_FEATURE_HBAAPI_MANAGEMENT 0x00000010
173#define FSF_FEATURE_ELS_CT_CHAINED_SBALS 0x00000020 161#define FSF_FEATURE_ELS_CT_CHAINED_SBALS 0x00000020
@@ -182,20 +170,6 @@
182/* option */ 170/* option */
183#define FSF_OPEN_LUN_SUPPRESS_BOXING 0x00000001 171#define FSF_OPEN_LUN_SUPPRESS_BOXING 0x00000001
184 172
185/* open LUN access flags*/
186#define FSF_UNIT_ACCESS_EXCLUSIVE 0x02000000
187#define FSF_UNIT_ACCESS_OUTBOUND_TRANSFER 0x10000000
188
189/* FSF interface for CFDC */
190#define ZFCP_CFDC_MAX_SIZE 127 * 1024
191#define ZFCP_CFDC_PAGES PFN_UP(ZFCP_CFDC_MAX_SIZE)
192
193struct zfcp_fsf_cfdc {
194 struct scatterlist sg[ZFCP_CFDC_PAGES];
195 u32 command;
196 u32 option;
197};
198
199struct fsf_queue_designator { 173struct fsf_queue_designator {
200 u8 cssid; 174 u8 cssid;
201 u8 chpid; 175 u8 chpid;
diff --git a/drivers/s390/scsi/zfcp_sysfs.c b/drivers/s390/scsi/zfcp_sysfs.c
index 05423ace6bf3..3f01bbf0609f 100644
--- a/drivers/s390/scsi/zfcp_sysfs.c
+++ b/drivers/s390/scsi/zfcp_sysfs.c
@@ -75,12 +75,6 @@ ZFCP_DEFINE_ATTR(zfcp_unit, unit, in_recovery, "%d\n",
75ZFCP_DEFINE_ATTR(zfcp_unit, unit, access_denied, "%d\n", 75ZFCP_DEFINE_ATTR(zfcp_unit, unit, access_denied, "%d\n",
76 (zfcp_unit_sdev_status(unit) & 76 (zfcp_unit_sdev_status(unit) &
77 ZFCP_STATUS_COMMON_ACCESS_DENIED) != 0); 77 ZFCP_STATUS_COMMON_ACCESS_DENIED) != 0);
78ZFCP_DEFINE_ATTR(zfcp_unit, unit, access_shared, "%d\n",
79 (zfcp_unit_sdev_status(unit) &
80 ZFCP_STATUS_LUN_SHARED) != 0);
81ZFCP_DEFINE_ATTR(zfcp_unit, unit, access_readonly, "%d\n",
82 (zfcp_unit_sdev_status(unit) &
83 ZFCP_STATUS_LUN_READONLY) != 0);
84 78
85static ssize_t zfcp_sysfs_port_failed_show(struct device *dev, 79static ssize_t zfcp_sysfs_port_failed_show(struct device *dev,
86 struct device_attribute *attr, 80 struct device_attribute *attr,
@@ -353,8 +347,6 @@ static struct attribute *zfcp_unit_attrs[] = {
353 &dev_attr_unit_in_recovery.attr, 347 &dev_attr_unit_in_recovery.attr,
354 &dev_attr_unit_status.attr, 348 &dev_attr_unit_status.attr,
355 &dev_attr_unit_access_denied.attr, 349 &dev_attr_unit_access_denied.attr,
356 &dev_attr_unit_access_shared.attr,
357 &dev_attr_unit_access_readonly.attr,
358 NULL 350 NULL
359}; 351};
360static struct attribute_group zfcp_unit_attr_group = { 352static struct attribute_group zfcp_unit_attr_group = {