diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2009-05-15 07:18:21 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-05-23 16:44:16 -0400 |
commit | 6fcf41d1d8796f41b893754324704e23971c2ea1 (patch) | |
tree | ba3ba8c6bb0d4620be81859653b08d9128d77f56 | |
parent | ea460a81919f2b3410e7fb30183c0256d068d87a (diff) |
[SCSI] zfcp: Keep ccw device and model id in zfcp_ccw.c
Keep the information about the device and model id in zfcp_ccw. This
requires an additional helper function to check for the privileged
cfdc subchannel, but it allows the removal of the redundant defines
from the zfcp_def header file.
Reviewed-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>
-rw-r--r-- | drivers/s390/scsi/zfcp_ccw.c | 26 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_def.h | 7 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_ext.h | 1 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 2 |
4 files changed, 20 insertions, 16 deletions
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c index 4f19b28e187f..b2fe5cdbcaee 100644 --- a/drivers/s390/scsi/zfcp_ccw.c +++ b/drivers/s390/scsi/zfcp_ccw.c | |||
@@ -11,6 +11,24 @@ | |||
11 | 11 | ||
12 | #include "zfcp_ext.h" | 12 | #include "zfcp_ext.h" |
13 | 13 | ||
14 | #define ZFCP_MODEL_PRIV 0x4 | ||
15 | |||
16 | static struct ccw_device_id zfcp_ccw_device_id[] = { | ||
17 | { CCW_DEVICE_DEVTYPE(0x1731, 0x3, 0x1732, 0x3) }, | ||
18 | { CCW_DEVICE_DEVTYPE(0x1731, 0x3, 0x1732, ZFCP_MODEL_PRIV) }, | ||
19 | {}, | ||
20 | }; | ||
21 | MODULE_DEVICE_TABLE(ccw, zfcp_ccw_device_id); | ||
22 | |||
23 | /** | ||
24 | * zfcp_ccw_priv_sch - check if subchannel is privileged | ||
25 | * @adapter: Adapter/Subchannel to check | ||
26 | */ | ||
27 | int zfcp_ccw_priv_sch(struct zfcp_adapter *adapter) | ||
28 | { | ||
29 | return adapter->ccw_device->id.dev_model == ZFCP_MODEL_PRIV; | ||
30 | } | ||
31 | |||
14 | /** | 32 | /** |
15 | * zfcp_ccw_probe - probe function of zfcp driver | 33 | * zfcp_ccw_probe - probe function of zfcp driver |
16 | * @ccw_device: pointer to belonging ccw device | 34 | * @ccw_device: pointer to belonging ccw device |
@@ -199,14 +217,6 @@ static void zfcp_ccw_shutdown(struct ccw_device *cdev) | |||
199 | up(&zfcp_data.config_sema); | 217 | up(&zfcp_data.config_sema); |
200 | } | 218 | } |
201 | 219 | ||
202 | static struct ccw_device_id zfcp_ccw_device_id[] = { | ||
203 | { CCW_DEVICE_DEVTYPE(0x1731, 0x3, 0x1732, 0x3) }, | ||
204 | { CCW_DEVICE_DEVTYPE(0x1731, 0x3, 0x1732, 0x4) }, /* priv. */ | ||
205 | {}, | ||
206 | }; | ||
207 | |||
208 | MODULE_DEVICE_TABLE(ccw, zfcp_ccw_device_id); | ||
209 | |||
210 | static struct ccw_driver zfcp_ccw_driver = { | 220 | static struct ccw_driver zfcp_ccw_driver = { |
211 | .owner = THIS_MODULE, | 221 | .owner = THIS_MODULE, |
212 | .name = "zfcp", | 222 | .name = "zfcp", |
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 4c362a9069f0..2074d45dbf6c 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h | |||
@@ -47,13 +47,6 @@ | |||
47 | 47 | ||
48 | /********************* CIO/QDIO SPECIFIC DEFINES *****************************/ | 48 | /********************* CIO/QDIO SPECIFIC DEFINES *****************************/ |
49 | 49 | ||
50 | /* Adapter Identification Parameters */ | ||
51 | #define ZFCP_CONTROL_UNIT_TYPE 0x1731 | ||
52 | #define ZFCP_CONTROL_UNIT_MODEL 0x03 | ||
53 | #define ZFCP_DEVICE_TYPE 0x1732 | ||
54 | #define ZFCP_DEVICE_MODEL 0x03 | ||
55 | #define ZFCP_DEVICE_MODEL_PRIV 0x04 | ||
56 | |||
57 | /* DMQ bug workaround: don't use last SBALE */ | 50 | /* DMQ bug workaround: don't use last SBALE */ |
58 | #define ZFCP_MAX_SBALES_PER_SBAL (QDIO_MAX_ELEMENTS_PER_BUFFER - 1) | 51 | #define ZFCP_MAX_SBALES_PER_SBAL (QDIO_MAX_ELEMENTS_PER_BUFFER - 1) |
59 | 52 | ||
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h index 2e31b536548c..120a9a1c81f7 100644 --- a/drivers/s390/scsi/zfcp_ext.h +++ b/drivers/s390/scsi/zfcp_ext.h | |||
@@ -27,6 +27,7 @@ extern int zfcp_sg_setup_table(struct scatterlist *, int); | |||
27 | 27 | ||
28 | /* zfcp_ccw.c */ | 28 | /* zfcp_ccw.c */ |
29 | extern int zfcp_ccw_register(void); | 29 | extern int zfcp_ccw_register(void); |
30 | extern int zfcp_ccw_priv_sch(struct zfcp_adapter *); | ||
30 | extern struct zfcp_adapter *zfcp_get_adapter_by_busid(char *); | 31 | extern struct zfcp_adapter *zfcp_get_adapter_by_busid(char *); |
31 | 32 | ||
32 | /* zfcp_cfdc.c */ | 33 | /* zfcp_cfdc.c */ |
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 6fae2688fede..e6dae3744e79 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -1887,7 +1887,7 @@ static void zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *req) | |||
1887 | 1887 | ||
1888 | if (!(adapter->connection_features & FSF_FEATURE_NPIV_MODE) && | 1888 | if (!(adapter->connection_features & FSF_FEATURE_NPIV_MODE) && |
1889 | (adapter->adapter_features & FSF_FEATURE_LUN_SHARING) && | 1889 | (adapter->adapter_features & FSF_FEATURE_LUN_SHARING) && |
1890 | (adapter->ccw_device->id.dev_model != ZFCP_DEVICE_MODEL_PRIV)) { | 1890 | !zfcp_ccw_priv_sch(adapter)) { |
1891 | exclusive = (bottom->lun_access_info & | 1891 | exclusive = (bottom->lun_access_info & |
1892 | FSF_UNIT_ACCESS_EXCLUSIVE); | 1892 | FSF_UNIT_ACCESS_EXCLUSIVE); |
1893 | readwrite = (bottom->lun_access_info & | 1893 | readwrite = (bottom->lun_access_info & |