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.h179
1 files changed, 48 insertions, 131 deletions
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index 67f45fc62f53..73eb41580f25 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -39,29 +39,6 @@
39 39
40/********************* GENERAL DEFINES *********************************/ 40/********************* GENERAL DEFINES *********************************/
41 41
42/**
43 * zfcp_sg_to_address - determine kernel address from struct scatterlist
44 * @list: struct scatterlist
45 * Return: kernel address
46 */
47static inline void *
48zfcp_sg_to_address(struct scatterlist *list)
49{
50 return sg_virt(list);
51}
52
53/**
54 * zfcp_address_to_sg - set up struct scatterlist from kernel address
55 * @address: kernel address
56 * @list: struct scatterlist
57 * @size: buffer size
58 */
59static inline void
60zfcp_address_to_sg(void *address, struct scatterlist *list, unsigned int size)
61{
62 sg_set_buf(list, address, size);
63}
64
65#define REQUEST_LIST_SIZE 128 42#define REQUEST_LIST_SIZE 128
66 43
67/********************* SCSI SPECIFIC DEFINES *********************************/ 44/********************* SCSI SPECIFIC DEFINES *********************************/
@@ -101,11 +78,6 @@ zfcp_address_to_sg(void *address, struct scatterlist *list, unsigned int size)
101 78
102/*************** FIBRE CHANNEL PROTOCOL SPECIFIC DEFINES ********************/ 79/*************** FIBRE CHANNEL PROTOCOL SPECIFIC DEFINES ********************/
103 80
104typedef unsigned long long wwn_t;
105typedef unsigned long long fcp_lun_t;
106/* data length field may be at variable position in FCP-2 FCP_CMND IU */
107typedef unsigned int fcp_dl_t;
108
109/* timeout for name-server lookup (in seconds) */ 81/* timeout for name-server lookup (in seconds) */
110#define ZFCP_NS_GID_PN_TIMEOUT 10 82#define ZFCP_NS_GID_PN_TIMEOUT 10
111 83
@@ -129,7 +101,7 @@ typedef unsigned int fcp_dl_t;
129 101
130/* FCP(-2) FCP_CMND IU */ 102/* FCP(-2) FCP_CMND IU */
131struct fcp_cmnd_iu { 103struct fcp_cmnd_iu {
132 fcp_lun_t fcp_lun; /* FCP logical unit number */ 104 u64 fcp_lun; /* FCP logical unit number */
133 u8 crn; /* command reference number */ 105 u8 crn; /* command reference number */
134 u8 reserved0:5; /* reserved */ 106 u8 reserved0:5; /* reserved */
135 u8 task_attribute:3; /* task attribute */ 107 u8 task_attribute:3; /* task attribute */
@@ -204,7 +176,7 @@ struct fcp_rscn_element {
204struct fcp_logo { 176struct fcp_logo {
205 u32 command; 177 u32 command;
206 u32 nport_did; 178 u32 nport_did;
207 wwn_t nport_wwpn; 179 u64 nport_wwpn;
208} __attribute__((packed)); 180} __attribute__((packed));
209 181
210/* 182/*
@@ -218,13 +190,6 @@ struct fcp_logo {
218#define ZFCP_LS_RSCN 0x61 190#define ZFCP_LS_RSCN 0x61
219#define ZFCP_LS_RNID 0x78 191#define ZFCP_LS_RNID 0x78
220 192
221struct zfcp_ls_rjt_par {
222 u8 action;
223 u8 reason_code;
224 u8 reason_expl;
225 u8 vendor_unique;
226} __attribute__ ((packed));
227
228struct zfcp_ls_adisc { 193struct zfcp_ls_adisc {
229 u8 code; 194 u8 code;
230 u8 field[3]; 195 u8 field[3];
@@ -234,20 +199,6 @@ struct zfcp_ls_adisc {
234 u32 nport_id; 199 u32 nport_id;
235} __attribute__ ((packed)); 200} __attribute__ ((packed));
236 201
237struct zfcp_ls_adisc_acc {
238 u8 code;
239 u8 field[3];
240 u32 hard_nport_id;
241 u64 wwpn;
242 u64 wwnn;
243 u32 nport_id;
244} __attribute__ ((packed));
245
246struct zfcp_rc_entry {
247 u8 code;
248 const char *description;
249};
250
251/* 202/*
252 * FC-GS-2 stuff 203 * FC-GS-2 stuff
253 */ 204 */
@@ -281,9 +232,7 @@ struct zfcp_rc_entry {
281#define ZFCP_STATUS_COMMON_RUNNING 0x40000000 232#define ZFCP_STATUS_COMMON_RUNNING 0x40000000
282#define ZFCP_STATUS_COMMON_ERP_FAILED 0x20000000 233#define ZFCP_STATUS_COMMON_ERP_FAILED 0x20000000
283#define ZFCP_STATUS_COMMON_UNBLOCKED 0x10000000 234#define ZFCP_STATUS_COMMON_UNBLOCKED 0x10000000
284#define ZFCP_STATUS_COMMON_OPENING 0x08000000
285#define ZFCP_STATUS_COMMON_OPEN 0x04000000 235#define ZFCP_STATUS_COMMON_OPEN 0x04000000
286#define ZFCP_STATUS_COMMON_CLOSING 0x02000000
287#define ZFCP_STATUS_COMMON_ERP_INUSE 0x01000000 236#define ZFCP_STATUS_COMMON_ERP_INUSE 0x01000000
288#define ZFCP_STATUS_COMMON_ACCESS_DENIED 0x00800000 237#define ZFCP_STATUS_COMMON_ACCESS_DENIED 0x00800000
289#define ZFCP_STATUS_COMMON_ACCESS_BOXED 0x00400000 238#define ZFCP_STATUS_COMMON_ACCESS_BOXED 0x00400000
@@ -291,16 +240,15 @@ struct zfcp_rc_entry {
291 240
292/* adapter status */ 241/* adapter status */
293#define ZFCP_STATUS_ADAPTER_QDIOUP 0x00000002 242#define ZFCP_STATUS_ADAPTER_QDIOUP 0x00000002
294#define ZFCP_STATUS_ADAPTER_REGISTERED 0x00000004
295#define ZFCP_STATUS_ADAPTER_XCONFIG_OK 0x00000008 243#define ZFCP_STATUS_ADAPTER_XCONFIG_OK 0x00000008
296#define ZFCP_STATUS_ADAPTER_HOST_CON_INIT 0x00000010 244#define ZFCP_STATUS_ADAPTER_HOST_CON_INIT 0x00000010
297#define ZFCP_STATUS_ADAPTER_ERP_THREAD_UP 0x00000020 245#define ZFCP_STATUS_ADAPTER_ERP_THREAD_UP 0x00000020
298#define ZFCP_STATUS_ADAPTER_ERP_THREAD_KILL 0x00000080 246#define ZFCP_STATUS_ADAPTER_ERP_THREAD_KILL 0x00000080
299#define ZFCP_STATUS_ADAPTER_ERP_PENDING 0x00000100 247#define ZFCP_STATUS_ADAPTER_ERP_PENDING 0x00000100
300#define ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED 0x00000200 248#define ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED 0x00000200
301#define ZFCP_STATUS_ADAPTER_XPORT_OK 0x00000800
302 249
303/* FC-PH/FC-GS well-known address identifiers for generic services */ 250/* FC-PH/FC-GS well-known address identifiers for generic services */
251#define ZFCP_DID_WKA 0xFFFFF0
304#define ZFCP_DID_MANAGEMENT_SERVICE 0xFFFFFA 252#define ZFCP_DID_MANAGEMENT_SERVICE 0xFFFFFA
305#define ZFCP_DID_TIME_SERVICE 0xFFFFFB 253#define ZFCP_DID_TIME_SERVICE 0xFFFFFB
306#define ZFCP_DID_DIRECTORY_SERVICE 0xFFFFFC 254#define ZFCP_DID_DIRECTORY_SERVICE 0xFFFFFC
@@ -312,29 +260,27 @@ struct zfcp_rc_entry {
312#define ZFCP_STATUS_PORT_DID_DID 0x00000002 260#define ZFCP_STATUS_PORT_DID_DID 0x00000002
313#define ZFCP_STATUS_PORT_PHYS_CLOSING 0x00000004 261#define ZFCP_STATUS_PORT_PHYS_CLOSING 0x00000004
314#define ZFCP_STATUS_PORT_NO_WWPN 0x00000008 262#define ZFCP_STATUS_PORT_NO_WWPN 0x00000008
315#define ZFCP_STATUS_PORT_NO_SCSI_ID 0x00000010
316#define ZFCP_STATUS_PORT_INVALID_WWPN 0x00000020 263#define ZFCP_STATUS_PORT_INVALID_WWPN 0x00000020
317 264
318/* for ports with well known addresses */ 265/* well known address (WKA) port status*/
319#define ZFCP_STATUS_PORT_WKA \ 266enum zfcp_wka_status {
320 (ZFCP_STATUS_PORT_NO_WWPN | \ 267 ZFCP_WKA_PORT_OFFLINE,
321 ZFCP_STATUS_PORT_NO_SCSI_ID) 268 ZFCP_WKA_PORT_CLOSING,
269 ZFCP_WKA_PORT_OPENING,
270 ZFCP_WKA_PORT_ONLINE,
271};
322 272
323/* logical unit status */ 273/* logical unit status */
324#define ZFCP_STATUS_UNIT_TEMPORARY 0x00000002
325#define ZFCP_STATUS_UNIT_SHARED 0x00000004 274#define ZFCP_STATUS_UNIT_SHARED 0x00000004
326#define ZFCP_STATUS_UNIT_READONLY 0x00000008 275#define ZFCP_STATUS_UNIT_READONLY 0x00000008
327#define ZFCP_STATUS_UNIT_REGISTERED 0x00000010 276#define ZFCP_STATUS_UNIT_REGISTERED 0x00000010
328#define ZFCP_STATUS_UNIT_SCSI_WORK_PENDING 0x00000020 277#define ZFCP_STATUS_UNIT_SCSI_WORK_PENDING 0x00000020
329 278
330/* FSF request status (this does not have a common part) */ 279/* FSF request status (this does not have a common part) */
331#define ZFCP_STATUS_FSFREQ_NOT_INIT 0x00000000
332#define ZFCP_STATUS_FSFREQ_POOL 0x00000001
333#define ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT 0x00000002 280#define ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT 0x00000002
334#define ZFCP_STATUS_FSFREQ_COMPLETED 0x00000004 281#define ZFCP_STATUS_FSFREQ_COMPLETED 0x00000004
335#define ZFCP_STATUS_FSFREQ_ERROR 0x00000008 282#define ZFCP_STATUS_FSFREQ_ERROR 0x00000008
336#define ZFCP_STATUS_FSFREQ_CLEANUP 0x00000010 283#define ZFCP_STATUS_FSFREQ_CLEANUP 0x00000010
337#define ZFCP_STATUS_FSFREQ_ABORTING 0x00000020
338#define ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED 0x00000040 284#define ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED 0x00000040
339#define ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED 0x00000080 285#define ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED 0x00000080
340#define ZFCP_STATUS_FSFREQ_ABORTED 0x00000100 286#define ZFCP_STATUS_FSFREQ_ABORTED 0x00000100
@@ -379,7 +325,7 @@ struct ct_hdr {
379 * a port name is required */ 325 * a port name is required */
380struct ct_iu_gid_pn_req { 326struct ct_iu_gid_pn_req {
381 struct ct_hdr header; 327 struct ct_hdr header;
382 wwn_t wwpn; 328 u64 wwpn;
383} __attribute__ ((packed)); 329} __attribute__ ((packed));
384 330
385/* FS_ACC IU and data unit for GID_PN nameserver request */ 331/* FS_ACC IU and data unit for GID_PN nameserver request */
@@ -388,11 +334,9 @@ struct ct_iu_gid_pn_resp {
388 u32 d_id; 334 u32 d_id;
389} __attribute__ ((packed)); 335} __attribute__ ((packed));
390 336
391typedef void (*zfcp_send_ct_handler_t)(unsigned long);
392
393/** 337/**
394 * struct zfcp_send_ct - used to pass parameters to function zfcp_fsf_send_ct 338 * struct zfcp_send_ct - used to pass parameters to function zfcp_fsf_send_ct
395 * @port: port where the request is sent to 339 * @wka_port: port where the request is sent to
396 * @req: scatter-gather list for request 340 * @req: scatter-gather list for request
397 * @resp: scatter-gather list for response 341 * @resp: scatter-gather list for response
398 * @req_count: number of elements in request scatter-gather list 342 * @req_count: number of elements in request scatter-gather list
@@ -404,12 +348,12 @@ typedef void (*zfcp_send_ct_handler_t)(unsigned long);
404 * @status: used to pass error status to calling function 348 * @status: used to pass error status to calling function
405 */ 349 */
406struct zfcp_send_ct { 350struct zfcp_send_ct {
407 struct zfcp_port *port; 351 struct zfcp_wka_port *wka_port;
408 struct scatterlist *req; 352 struct scatterlist *req;
409 struct scatterlist *resp; 353 struct scatterlist *resp;
410 unsigned int req_count; 354 unsigned int req_count;
411 unsigned int resp_count; 355 unsigned int resp_count;
412 zfcp_send_ct_handler_t handler; 356 void (*handler)(unsigned long);
413 unsigned long handler_data; 357 unsigned long handler_data;
414 int timeout; 358 int timeout;
415 struct completion *completion; 359 struct completion *completion;
@@ -426,8 +370,6 @@ struct zfcp_gid_pn_data {
426 struct zfcp_port *port; 370 struct zfcp_port *port;
427}; 371};
428 372
429typedef void (*zfcp_send_els_handler_t)(unsigned long);
430
431/** 373/**
432 * struct zfcp_send_els - used to pass parameters to function zfcp_fsf_send_els 374 * struct zfcp_send_els - used to pass parameters to function zfcp_fsf_send_els
433 * @adapter: adapter where request is sent from 375 * @adapter: adapter where request is sent from
@@ -451,22 +393,28 @@ struct zfcp_send_els {
451 struct scatterlist *resp; 393 struct scatterlist *resp;
452 unsigned int req_count; 394 unsigned int req_count;
453 unsigned int resp_count; 395 unsigned int resp_count;
454 zfcp_send_els_handler_t handler; 396 void (*handler)(unsigned long);
455 unsigned long handler_data; 397 unsigned long handler_data;
456 struct completion *completion; 398 struct completion *completion;
457 int ls_code; 399 int ls_code;
458 int status; 400 int status;
459}; 401};
460 402
403struct zfcp_wka_port {
404 struct zfcp_adapter *adapter;
405 wait_queue_head_t completion_wq;
406 enum zfcp_wka_status status;
407 atomic_t refcount;
408 u32 d_id;
409 u32 handle;
410 struct mutex mutex;
411 struct delayed_work work;
412};
413
461struct zfcp_qdio_queue { 414struct zfcp_qdio_queue {
462 struct qdio_buffer *sbal[QDIO_MAX_BUFFERS_PER_Q]; /* SBALs */ 415 struct qdio_buffer *sbal[QDIO_MAX_BUFFERS_PER_Q];
463 u8 first; /* index of next free bfr 416 u8 first; /* index of next free bfr in queue */
464 in queue (free_count>0) */ 417 atomic_t count; /* number of free buffers in queue */
465 atomic_t count; /* number of free buffers
466 in queue */
467 spinlock_t lock; /* lock for operations on queue */
468 int pci_batch; /* SBALs since PCI indication
469 was last set */
470}; 418};
471 419
472struct zfcp_erp_action { 420struct zfcp_erp_action {
@@ -475,7 +423,7 @@ struct zfcp_erp_action {
475 struct zfcp_adapter *adapter; /* device which should be recovered */ 423 struct zfcp_adapter *adapter; /* device which should be recovered */
476 struct zfcp_port *port; 424 struct zfcp_port *port;
477 struct zfcp_unit *unit; 425 struct zfcp_unit *unit;
478 volatile u32 status; /* recovery status */ 426 u32 status; /* recovery status */
479 u32 step; /* active step of this erp action */ 427 u32 step; /* active step of this erp action */
480 struct zfcp_fsf_req *fsf_req; /* fsf request currently pending 428 struct zfcp_fsf_req *fsf_req; /* fsf request currently pending
481 for this action */ 429 for this action */
@@ -506,8 +454,8 @@ struct zfcp_adapter {
506 atomic_t refcount; /* reference count */ 454 atomic_t refcount; /* reference count */
507 wait_queue_head_t remove_wq; /* can be used to wait for 455 wait_queue_head_t remove_wq; /* can be used to wait for
508 refcount drop to zero */ 456 refcount drop to zero */
509 wwn_t peer_wwnn; /* P2P peer WWNN */ 457 u64 peer_wwnn; /* P2P peer WWNN */
510 wwn_t peer_wwpn; /* P2P peer WWPN */ 458 u64 peer_wwpn; /* P2P peer WWPN */
511 u32 peer_d_id; /* P2P peer D_ID */ 459 u32 peer_d_id; /* P2P peer D_ID */
512 struct ccw_device *ccw_device; /* S/390 ccw device */ 460 struct ccw_device *ccw_device; /* S/390 ccw device */
513 u32 hydra_version; /* Hydra version */ 461 u32 hydra_version; /* Hydra version */
@@ -518,13 +466,13 @@ struct zfcp_adapter {
518 u16 timer_ticks; /* time int for a tick */ 466 u16 timer_ticks; /* time int for a tick */
519 struct Scsi_Host *scsi_host; /* Pointer to mid-layer */ 467 struct Scsi_Host *scsi_host; /* Pointer to mid-layer */
520 struct list_head port_list_head; /* remote port list */ 468 struct list_head port_list_head; /* remote port list */
521 struct list_head port_remove_lh; /* head of ports to be
522 removed */
523 u32 ports; /* number of remote ports */
524 unsigned long req_no; /* unique FSF req number */ 469 unsigned long req_no; /* unique FSF req number */
525 struct list_head *req_list; /* list of pending reqs */ 470 struct list_head *req_list; /* list of pending reqs */
526 spinlock_t req_list_lock; /* request list lock */ 471 spinlock_t req_list_lock; /* request list lock */
527 struct zfcp_qdio_queue req_q; /* request queue */ 472 struct zfcp_qdio_queue req_q; /* request queue */
473 spinlock_t req_q_lock; /* for operations on queue */
474 int req_q_pci_batch; /* SBALs since PCI indication
475 was last set */
528 u32 fsf_req_seq_no; /* FSF cmnd seq number */ 476 u32 fsf_req_seq_no; /* FSF cmnd seq number */
529 wait_queue_head_t request_wq; /* can be used to wait for 477 wait_queue_head_t request_wq; /* can be used to wait for
530 more avaliable SBALs */ 478 more avaliable SBALs */
@@ -548,7 +496,7 @@ struct zfcp_adapter {
548 actions */ 496 actions */
549 u32 erp_low_mem_count; /* nr of erp actions waiting 497 u32 erp_low_mem_count; /* nr of erp actions waiting
550 for memory */ 498 for memory */
551 struct zfcp_port *nameserver_port; /* adapter's nameserver */ 499 struct zfcp_wka_port nsp; /* adapter's nameserver */
552 debug_info_t *rec_dbf; 500 debug_info_t *rec_dbf;
553 debug_info_t *hba_dbf; 501 debug_info_t *hba_dbf;
554 debug_info_t *san_dbf; /* debug feature areas */ 502 debug_info_t *san_dbf; /* debug feature areas */
@@ -563,11 +511,11 @@ struct zfcp_adapter {
563 struct zfcp_scsi_dbf_record scsi_dbf_buf; 511 struct zfcp_scsi_dbf_record scsi_dbf_buf;
564 struct zfcp_adapter_mempool pool; /* Adapter memory pools */ 512 struct zfcp_adapter_mempool pool; /* Adapter memory pools */
565 struct qdio_initialize qdio_init_data; /* for qdio_establish */ 513 struct qdio_initialize qdio_init_data; /* for qdio_establish */
566 struct device generic_services; /* directory for WKA ports */
567 struct fc_host_statistics *fc_stats; 514 struct fc_host_statistics *fc_stats;
568 struct fsf_qtcb_bottom_port *stats_reset_data; 515 struct fsf_qtcb_bottom_port *stats_reset_data;
569 unsigned long stats_reset; 516 unsigned long stats_reset;
570 struct work_struct scan_work; 517 struct work_struct scan_work;
518 atomic_t qdio_outb_full; /* queue full incidents */
571}; 519};
572 520
573struct zfcp_port { 521struct zfcp_port {
@@ -579,18 +527,16 @@ struct zfcp_port {
579 refcount drop to zero */ 527 refcount drop to zero */
580 struct zfcp_adapter *adapter; /* adapter used to access port */ 528 struct zfcp_adapter *adapter; /* adapter used to access port */
581 struct list_head unit_list_head; /* head of logical unit list */ 529 struct list_head unit_list_head; /* head of logical unit list */
582 struct list_head unit_remove_lh; /* head of luns to be removed
583 list */
584 u32 units; /* # of logical units in list */
585 atomic_t status; /* status of this remote port */ 530 atomic_t status; /* status of this remote port */
586 wwn_t wwnn; /* WWNN if known */ 531 u64 wwnn; /* WWNN if known */
587 wwn_t wwpn; /* WWPN */ 532 u64 wwpn; /* WWPN */
588 u32 d_id; /* D_ID */ 533 u32 d_id; /* D_ID */
589 u32 handle; /* handle assigned by FSF */ 534 u32 handle; /* handle assigned by FSF */
590 struct zfcp_erp_action erp_action; /* pending error recovery */ 535 struct zfcp_erp_action erp_action; /* pending error recovery */
591 atomic_t erp_counter; 536 atomic_t erp_counter;
592 u32 maxframe_size; 537 u32 maxframe_size;
593 u32 supported_classes; 538 u32 supported_classes;
539 struct work_struct gid_pn_work;
594}; 540};
595 541
596struct zfcp_unit { 542struct zfcp_unit {
@@ -601,8 +547,7 @@ struct zfcp_unit {
601 refcount drop to zero */ 547 refcount drop to zero */
602 struct zfcp_port *port; /* remote port of unit */ 548 struct zfcp_port *port; /* remote port of unit */
603 atomic_t status; /* status of this logical unit */ 549 atomic_t status; /* status of this logical unit */
604 unsigned int scsi_lun; /* own SCSI LUN */ 550 u64 fcp_lun; /* own FCP_LUN */
605 fcp_lun_t fcp_lun; /* own FCP_LUN */
606 u32 handle; /* handle assigned by FSF */ 551 u32 handle; /* handle assigned by FSF */
607 struct scsi_device *device; /* scsi device struct pointer */ 552 struct scsi_device *device; /* scsi device struct pointer */
608 struct zfcp_erp_action erp_action; /* pending error recovery */ 553 struct zfcp_erp_action erp_action; /* pending error recovery */
@@ -625,7 +570,7 @@ struct zfcp_fsf_req {
625 u8 sbal_response; /* SBAL used in interrupt */ 570 u8 sbal_response; /* SBAL used in interrupt */
626 wait_queue_head_t completion_wq; /* can be used by a routine 571 wait_queue_head_t completion_wq; /* can be used by a routine
627 to wait for completion */ 572 to wait for completion */
628 volatile u32 status; /* status of this request */ 573 u32 status; /* status of this request */
629 u32 fsf_command; /* FSF Command copy */ 574 u32 fsf_command; /* FSF Command copy */
630 struct fsf_qtcb *qtcb; /* address of associated QTCB */ 575 struct fsf_qtcb *qtcb; /* address of associated QTCB */
631 u32 seq_no; /* Sequence number of request */ 576 u32 seq_no; /* Sequence number of request */
@@ -644,11 +589,7 @@ struct zfcp_fsf_req {
644struct zfcp_data { 589struct zfcp_data {
645 struct scsi_host_template scsi_host_template; 590 struct scsi_host_template scsi_host_template;
646 struct scsi_transport_template *scsi_transport_template; 591 struct scsi_transport_template *scsi_transport_template;
647 atomic_t status; /* Module status flags */
648 struct list_head adapter_list_head; /* head of adapter list */ 592 struct list_head adapter_list_head; /* head of adapter list */
649 struct list_head adapter_remove_lh; /* head of adapters to be
650 removed */
651 u32 adapters; /* # of adapters in list */
652 rwlock_t config_lock; /* serialises changes 593 rwlock_t config_lock; /* serialises changes
653 to adapter/port/unit 594 to adapter/port/unit
654 lists */ 595 lists */
@@ -656,11 +597,12 @@ struct zfcp_data {
656 changes */ 597 changes */
657 atomic_t loglevel; /* current loglevel */ 598 atomic_t loglevel; /* current loglevel */
658 char init_busid[BUS_ID_SIZE]; 599 char init_busid[BUS_ID_SIZE];
659 wwn_t init_wwpn; 600 u64 init_wwpn;
660 fcp_lun_t init_fcp_lun; 601 u64 init_fcp_lun;
661 struct kmem_cache *fsf_req_qtcb_cache; 602 struct kmem_cache *fsf_req_qtcb_cache;
662 struct kmem_cache *sr_buffer_cache; 603 struct kmem_cache *sr_buffer_cache;
663 struct kmem_cache *gid_pn_cache; 604 struct kmem_cache *gid_pn_cache;
605 struct workqueue_struct *work_queue;
664}; 606};
665 607
666/* struct used by memory pools for fsf_requests */ 608/* struct used by memory pools for fsf_requests */
@@ -677,14 +619,7 @@ struct zfcp_fsf_req_qtcb {
677#define ZFCP_SET 0x00000100 619#define ZFCP_SET 0x00000100
678#define ZFCP_CLEAR 0x00000200 620#define ZFCP_CLEAR 0x00000200
679 621
680#ifndef atomic_test_mask
681#define atomic_test_mask(mask, target) \
682 ((atomic_read(target) & mask) == mask)
683#endif
684
685#define zfcp_get_busid_by_adapter(adapter) (adapter->ccw_device->dev.bus_id) 622#define zfcp_get_busid_by_adapter(adapter) (adapter->ccw_device->dev.bus_id)
686#define zfcp_get_busid_by_port(port) (zfcp_get_busid_by_adapter(port->adapter))
687#define zfcp_get_busid_by_unit(unit) (zfcp_get_busid_by_port(unit->port))
688 623
689/* 624/*
690 * Helper functions for request ID management. 625 * Helper functions for request ID management.
@@ -745,12 +680,6 @@ zfcp_unit_put(struct zfcp_unit *unit)
745} 680}
746 681
747static inline void 682static inline void
748zfcp_unit_wait(struct zfcp_unit *unit)
749{
750 wait_event(unit->remove_wq, atomic_read(&unit->refcount) == 0);
751}
752
753static inline void
754zfcp_port_get(struct zfcp_port *port) 683zfcp_port_get(struct zfcp_port *port)
755{ 684{
756 atomic_inc(&port->refcount); 685 atomic_inc(&port->refcount);
@@ -764,12 +693,6 @@ zfcp_port_put(struct zfcp_port *port)
764} 693}
765 694
766static inline void 695static inline void
767zfcp_port_wait(struct zfcp_port *port)
768{
769 wait_event(port->remove_wq, atomic_read(&port->refcount) == 0);
770}
771
772static inline void
773zfcp_adapter_get(struct zfcp_adapter *adapter) 696zfcp_adapter_get(struct zfcp_adapter *adapter)
774{ 697{
775 atomic_inc(&adapter->refcount); 698 atomic_inc(&adapter->refcount);
@@ -782,10 +705,4 @@ zfcp_adapter_put(struct zfcp_adapter *adapter)
782 wake_up(&adapter->remove_wq); 705 wake_up(&adapter->remove_wq);
783} 706}
784 707
785static inline void
786zfcp_adapter_wait(struct zfcp_adapter *adapter)
787{
788 wait_event(adapter->remove_wq, atomic_read(&adapter->refcount) == 0);
789}
790
791#endif /* ZFCP_DEF_H */ 708#endif /* ZFCP_DEF_H */