diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2009-05-15 13:18:21 +0200 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-05-23 15:44:16 -0500 |
commit | 6fcf41d1d8796f41b893754324704e23971c2ea1 (patch) | |
tree | ba3ba8c6bb0d4620be81859653b08d9128d77f56 /drivers/s390/scsi/zfcp_ccw.c | |
parent | ea460a81919f2b3410e7fb30183c0256d068d87a (diff) | |
download | blackbird-op-linux-6fcf41d1d8796f41b893754324704e23971c2ea1.tar.gz blackbird-op-linux-6fcf41d1d8796f41b893754324704e23971c2ea1.zip |
[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>
Diffstat (limited to 'drivers/s390/scsi/zfcp_ccw.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_ccw.c | 26 |
1 files changed, 18 insertions, 8 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 @@ #include "zfcp_ext.h" +#define ZFCP_MODEL_PRIV 0x4 + +static struct ccw_device_id zfcp_ccw_device_id[] = { + { CCW_DEVICE_DEVTYPE(0x1731, 0x3, 0x1732, 0x3) }, + { CCW_DEVICE_DEVTYPE(0x1731, 0x3, 0x1732, ZFCP_MODEL_PRIV) }, + {}, +}; +MODULE_DEVICE_TABLE(ccw, zfcp_ccw_device_id); + +/** + * zfcp_ccw_priv_sch - check if subchannel is privileged + * @adapter: Adapter/Subchannel to check + */ +int zfcp_ccw_priv_sch(struct zfcp_adapter *adapter) +{ + return adapter->ccw_device->id.dev_model == ZFCP_MODEL_PRIV; +} + /** * zfcp_ccw_probe - probe function of zfcp driver * @ccw_device: pointer to belonging ccw device @@ -199,14 +217,6 @@ static void zfcp_ccw_shutdown(struct ccw_device *cdev) up(&zfcp_data.config_sema); } -static struct ccw_device_id zfcp_ccw_device_id[] = { - { CCW_DEVICE_DEVTYPE(0x1731, 0x3, 0x1732, 0x3) }, - { CCW_DEVICE_DEVTYPE(0x1731, 0x3, 0x1732, 0x4) }, /* priv. */ - {}, -}; - -MODULE_DEVICE_TABLE(ccw, zfcp_ccw_device_id); - static struct ccw_driver zfcp_ccw_driver = { .owner = THIS_MODULE, .name = "zfcp", |