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.h93
1 files changed, 60 insertions, 33 deletions
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index e1c6b6e05a75..527ba48eea57 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -85,11 +85,10 @@ struct zfcp_reqlist;
85#define ZFCP_STATUS_PORT_LINK_TEST 0x00000002 85#define ZFCP_STATUS_PORT_LINK_TEST 0x00000002
86 86
87/* logical unit status */ 87/* logical unit status */
88#define ZFCP_STATUS_UNIT_SHARED 0x00000004 88#define ZFCP_STATUS_LUN_SHARED 0x00000004
89#define ZFCP_STATUS_UNIT_READONLY 0x00000008 89#define ZFCP_STATUS_LUN_READONLY 0x00000008
90 90
91/* FSF request status (this does not have a common part) */ 91/* FSF request status (this does not have a common part) */
92#define ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT 0x00000002
93#define ZFCP_STATUS_FSFREQ_ERROR 0x00000008 92#define ZFCP_STATUS_FSFREQ_ERROR 0x00000008
94#define ZFCP_STATUS_FSFREQ_CLEANUP 0x00000010 93#define ZFCP_STATUS_FSFREQ_CLEANUP 0x00000010
95#define ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED 0x00000040 94#define ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED 0x00000040
@@ -108,7 +107,7 @@ struct zfcp_adapter_mempool {
108 mempool_t *scsi_req; 107 mempool_t *scsi_req;
109 mempool_t *scsi_abort; 108 mempool_t *scsi_abort;
110 mempool_t *status_read_req; 109 mempool_t *status_read_req;
111 mempool_t *status_read_data; 110 mempool_t *sr_data;
112 mempool_t *gid_pn; 111 mempool_t *gid_pn;
113 mempool_t *qtcb_pool; 112 mempool_t *qtcb_pool;
114}; 113};
@@ -118,7 +117,7 @@ struct zfcp_erp_action {
118 int action; /* requested action code */ 117 int action; /* requested action code */
119 struct zfcp_adapter *adapter; /* device which should be recovered */ 118 struct zfcp_adapter *adapter; /* device which should be recovered */
120 struct zfcp_port *port; 119 struct zfcp_port *port;
121 struct zfcp_unit *unit; 120 struct scsi_device *sdev;
122 u32 status; /* recovery status */ 121 u32 status; /* recovery status */
123 u32 step; /* active step of this erp action */ 122 u32 step; /* active step of this erp action */
124 unsigned long fsf_req_id; 123 unsigned long fsf_req_id;
@@ -190,6 +189,7 @@ struct zfcp_adapter {
190 struct fsf_qtcb_bottom_port *stats_reset_data; 189 struct fsf_qtcb_bottom_port *stats_reset_data;
191 unsigned long stats_reset; 190 unsigned long stats_reset;
192 struct work_struct scan_work; 191 struct work_struct scan_work;
192 struct work_struct ns_up_work;
193 struct service_level service_level; 193 struct service_level service_level;
194 struct workqueue_struct *work_queue; 194 struct workqueue_struct *work_queue;
195 struct device_dma_parameters dma_parms; 195 struct device_dma_parameters dma_parms;
@@ -219,21 +219,66 @@ struct zfcp_port {
219 unsigned int starget_id; 219 unsigned int starget_id;
220}; 220};
221 221
222/**
223 * struct zfcp_unit - LUN configured via zfcp sysfs
224 * @dev: struct device for sysfs representation and reference counting
225 * @list: entry in LUN/unit list per zfcp_port
226 * @port: reference to zfcp_port where this LUN is configured
227 * @fcp_lun: 64 bit LUN value
228 * @scsi_work: for running scsi_scan_target
229 *
230 * This is the representation of a LUN that has been configured for
231 * usage. The main data here is the 64 bit LUN value, data for
232 * running I/O and recovery is in struct zfcp_scsi_dev.
233 */
222struct zfcp_unit { 234struct zfcp_unit {
223 struct device dev; 235 struct device dev;
224 struct list_head list; /* list of logical units */ 236 struct list_head list;
225 struct zfcp_port *port; /* remote port of unit */ 237 struct zfcp_port *port;
226 atomic_t status; /* status of this logical unit */ 238 u64 fcp_lun;
227 u64 fcp_lun; /* own FCP_LUN */
228 u32 handle; /* handle assigned by FSF */
229 struct scsi_device *device; /* scsi device struct pointer */
230 struct zfcp_erp_action erp_action; /* pending error recovery */
231 atomic_t erp_counter;
232 struct zfcp_latencies latencies;
233 struct work_struct scsi_work; 239 struct work_struct scsi_work;
234}; 240};
235 241
236/** 242/**
243 * struct zfcp_scsi_dev - zfcp data per SCSI device
244 * @status: zfcp internal status flags
245 * @lun_handle: handle from "open lun" for issuing FSF requests
246 * @erp_action: zfcp erp data for opening and recovering this LUN
247 * @erp_counter: zfcp erp counter for this LUN
248 * @latencies: FSF channel and fabric latencies
249 * @port: zfcp_port where this LUN belongs to
250 */
251struct zfcp_scsi_dev {
252 atomic_t status;
253 u32 lun_handle;
254 struct zfcp_erp_action erp_action;
255 atomic_t erp_counter;
256 struct zfcp_latencies latencies;
257 struct zfcp_port *port;
258};
259
260/**
261 * sdev_to_zfcp - Access zfcp LUN data for SCSI device
262 * @sdev: scsi_device where to get the zfcp_scsi_dev pointer
263 */
264static inline struct zfcp_scsi_dev *sdev_to_zfcp(struct scsi_device *sdev)
265{
266 return scsi_transport_device_data(sdev);
267}
268
269/**
270 * zfcp_scsi_dev_lun - Return SCSI device LUN as 64 bit FCP LUN
271 * @sdev: SCSI device where to get the LUN from
272 */
273static inline u64 zfcp_scsi_dev_lun(struct scsi_device *sdev)
274{
275 u64 fcp_lun;
276
277 int_to_scsilun(sdev->lun, (struct scsi_lun *)&fcp_lun);
278 return fcp_lun;
279}
280
281/**
237 * struct zfcp_fsf_req - basic FSF request structure 282 * struct zfcp_fsf_req - basic FSF request structure
238 * @list: list of FSF requests 283 * @list: list of FSF requests
239 * @req_id: unique request ID 284 * @req_id: unique request ID
@@ -249,7 +294,6 @@ struct zfcp_unit {
249 * @erp_action: reference to erp action if request issued on behalf of ERP 294 * @erp_action: reference to erp action if request issued on behalf of ERP
250 * @pool: reference to memory pool if used for this request 295 * @pool: reference to memory pool if used for this request
251 * @issued: time when request was send (STCK) 296 * @issued: time when request was send (STCK)
252 * @unit: reference to unit if this request is a SCSI request
253 * @handler: handler which should be called to process response 297 * @handler: handler which should be called to process response
254 */ 298 */
255struct zfcp_fsf_req { 299struct zfcp_fsf_req {
@@ -267,24 +311,7 @@ struct zfcp_fsf_req {
267 struct zfcp_erp_action *erp_action; 311 struct zfcp_erp_action *erp_action;
268 mempool_t *pool; 312 mempool_t *pool;
269 unsigned long long issued; 313 unsigned long long issued;
270 struct zfcp_unit *unit;
271 void (*handler)(struct zfcp_fsf_req *); 314 void (*handler)(struct zfcp_fsf_req *);
272}; 315};
273 316
274/* driver data */
275struct zfcp_data {
276 struct scsi_host_template scsi_host_template;
277 struct scsi_transport_template *scsi_transport_template;
278 struct kmem_cache *gpn_ft_cache;
279 struct kmem_cache *qtcb_cache;
280 struct kmem_cache *sr_buffer_cache;
281 struct kmem_cache *gid_pn_cache;
282 struct kmem_cache *adisc_cache;
283};
284
285/********************** ZFCP SPECIFIC DEFINES ********************************/
286
287#define ZFCP_SET 0x00000100
288#define ZFCP_CLEAR 0x00000200
289
290#endif /* ZFCP_DEF_H */ 317#endif /* ZFCP_DEF_H */