aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_def.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi/zfcp_def.h')
-rw-r--r--drivers/s390/scsi/zfcp_def.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index 32933ed54b8a..22649639230b 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -637,6 +637,7 @@ do { \
637#define ZFCP_STATUS_UNIT_SHARED 0x00000004 637#define ZFCP_STATUS_UNIT_SHARED 0x00000004
638#define ZFCP_STATUS_UNIT_READONLY 0x00000008 638#define ZFCP_STATUS_UNIT_READONLY 0x00000008
639#define ZFCP_STATUS_UNIT_REGISTERED 0x00000010 639#define ZFCP_STATUS_UNIT_REGISTERED 0x00000010
640#define ZFCP_STATUS_UNIT_SCSI_WORK_PENDING 0x00000020
640 641
641/* FSF request status (this does not have a common part) */ 642/* FSF request status (this does not have a common part) */
642#define ZFCP_STATUS_FSFREQ_NOT_INIT 0x00000000 643#define ZFCP_STATUS_FSFREQ_NOT_INIT 0x00000000
@@ -980,6 +981,10 @@ struct zfcp_unit {
980 struct scsi_device *device; /* scsi device struct pointer */ 981 struct scsi_device *device; /* scsi device struct pointer */
981 struct zfcp_erp_action erp_action; /* pending error recovery */ 982 struct zfcp_erp_action erp_action; /* pending error recovery */
982 atomic_t erp_counter; 983 atomic_t erp_counter;
984 wait_queue_head_t scsi_scan_wq; /* can be used to wait until
985 all scsi_scan_target
986 requests have been
987 completed. */
983}; 988};
984 989
985/* FSF request */ 990/* FSF request */
@@ -1085,6 +1090,42 @@ extern void _zfcp_hex_dump(char *, int);
1085#define zfcp_get_busid_by_unit(unit) (zfcp_get_busid_by_port(unit->port)) 1090#define zfcp_get_busid_by_unit(unit) (zfcp_get_busid_by_port(unit->port))
1086 1091
1087/* 1092/*
1093 * Helper functions for request ID management.
1094 */
1095static inline int zfcp_reqlist_hash(unsigned long req_id)
1096{
1097 return req_id % REQUEST_LIST_SIZE;
1098}
1099
1100static inline void zfcp_reqlist_add(struct zfcp_adapter *adapter,
1101 struct zfcp_fsf_req *fsf_req)
1102{
1103 unsigned int idx;
1104
1105 idx = zfcp_reqlist_hash(fsf_req->req_id);
1106 list_add_tail(&fsf_req->list, &adapter->req_list[idx]);
1107}
1108
1109static inline void zfcp_reqlist_remove(struct zfcp_adapter *adapter,
1110 struct zfcp_fsf_req *fsf_req)
1111{
1112 list_del(&fsf_req->list);
1113}
1114
1115static inline struct zfcp_fsf_req *
1116zfcp_reqlist_find(struct zfcp_adapter *adapter, unsigned long req_id)
1117{
1118 struct zfcp_fsf_req *request;
1119 unsigned int idx;
1120
1121 idx = zfcp_reqlist_hash(req_id);
1122 list_for_each_entry(request, &adapter->req_list[idx], list)
1123 if (request->req_id == req_id)
1124 return request;
1125 return NULL;
1126}
1127
1128/*
1088 * functions needed for reference/usage counting 1129 * functions needed for reference/usage counting
1089 */ 1130 */
1090 1131