diff options
Diffstat (limited to 'drivers/scsi/ibmvscsi/ibmvfc.h')
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvfc.h | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.h b/drivers/scsi/ibmvscsi/ibmvfc.h index ca1dcf7a7568..c2668d7d67f5 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.h +++ b/drivers/scsi/ibmvscsi/ibmvfc.h | |||
@@ -29,8 +29,8 @@ | |||
29 | #include "viosrp.h" | 29 | #include "viosrp.h" |
30 | 30 | ||
31 | #define IBMVFC_NAME "ibmvfc" | 31 | #define IBMVFC_NAME "ibmvfc" |
32 | #define IBMVFC_DRIVER_VERSION "1.0.5" | 32 | #define IBMVFC_DRIVER_VERSION "1.0.6" |
33 | #define IBMVFC_DRIVER_DATE "(March 19, 2009)" | 33 | #define IBMVFC_DRIVER_DATE "(May 28, 2009)" |
34 | 34 | ||
35 | #define IBMVFC_DEFAULT_TIMEOUT 60 | 35 | #define IBMVFC_DEFAULT_TIMEOUT 60 |
36 | #define IBMVFC_ADISC_CANCEL_TIMEOUT 45 | 36 | #define IBMVFC_ADISC_CANCEL_TIMEOUT 45 |
@@ -57,9 +57,10 @@ | |||
57 | * Ensure we have resources for ERP and initialization: | 57 | * Ensure we have resources for ERP and initialization: |
58 | * 1 for ERP | 58 | * 1 for ERP |
59 | * 1 for initialization | 59 | * 1 for initialization |
60 | * 1 for NPIV Logout | ||
60 | * 2 for each discovery thread | 61 | * 2 for each discovery thread |
61 | */ | 62 | */ |
62 | #define IBMVFC_NUM_INTERNAL_REQ (1 + 1 + (disc_threads * 2)) | 63 | #define IBMVFC_NUM_INTERNAL_REQ (1 + 1 + 1 + (disc_threads * 2)) |
63 | 64 | ||
64 | #define IBMVFC_MAD_SUCCESS 0x00 | 65 | #define IBMVFC_MAD_SUCCESS 0x00 |
65 | #define IBMVFC_MAD_NOT_SUPPORTED 0xF1 | 66 | #define IBMVFC_MAD_NOT_SUPPORTED 0xF1 |
@@ -127,6 +128,7 @@ enum ibmvfc_mad_types { | |||
127 | IBMVFC_IMPLICIT_LOGOUT = 0x0040, | 128 | IBMVFC_IMPLICIT_LOGOUT = 0x0040, |
128 | IBMVFC_PASSTHRU = 0x0200, | 129 | IBMVFC_PASSTHRU = 0x0200, |
129 | IBMVFC_TMF_MAD = 0x0100, | 130 | IBMVFC_TMF_MAD = 0x0100, |
131 | IBMVFC_NPIV_LOGOUT = 0x0800, | ||
130 | }; | 132 | }; |
131 | 133 | ||
132 | struct ibmvfc_mad_common { | 134 | struct ibmvfc_mad_common { |
@@ -143,6 +145,10 @@ struct ibmvfc_npiv_login_mad { | |||
143 | struct srp_direct_buf buffer; | 145 | struct srp_direct_buf buffer; |
144 | }__attribute__((packed, aligned (8))); | 146 | }__attribute__((packed, aligned (8))); |
145 | 147 | ||
148 | struct ibmvfc_npiv_logout_mad { | ||
149 | struct ibmvfc_mad_common common; | ||
150 | }__attribute__((packed, aligned (8))); | ||
151 | |||
146 | #define IBMVFC_MAX_NAME 256 | 152 | #define IBMVFC_MAX_NAME 256 |
147 | 153 | ||
148 | struct ibmvfc_npiv_login { | 154 | struct ibmvfc_npiv_login { |
@@ -201,7 +207,8 @@ struct ibmvfc_npiv_login_resp { | |||
201 | #define IBMVFC_NATIVE_FC 0x01 | 207 | #define IBMVFC_NATIVE_FC 0x01 |
202 | #define IBMVFC_CAN_FLUSH_ON_HALT 0x08 | 208 | #define IBMVFC_CAN_FLUSH_ON_HALT 0x08 |
203 | u32 reserved; | 209 | u32 reserved; |
204 | u64 capabilites; | 210 | u64 capabilities; |
211 | #define IBMVFC_CAN_FLUSH_ON_HALT 0x08 | ||
205 | u32 max_cmds; | 212 | u32 max_cmds; |
206 | u32 scsi_id_sz; | 213 | u32 scsi_id_sz; |
207 | u64 max_dma_len; | 214 | u64 max_dma_len; |
@@ -541,9 +548,17 @@ struct ibmvfc_crq_queue { | |||
541 | dma_addr_t msg_token; | 548 | dma_addr_t msg_token; |
542 | }; | 549 | }; |
543 | 550 | ||
551 | enum ibmvfc_ae_link_state { | ||
552 | IBMVFC_AE_LS_LINK_UP = 0x01, | ||
553 | IBMVFC_AE_LS_LINK_BOUNCED = 0x02, | ||
554 | IBMVFC_AE_LS_LINK_DOWN = 0x04, | ||
555 | IBMVFC_AE_LS_LINK_DEAD = 0x08, | ||
556 | }; | ||
557 | |||
544 | struct ibmvfc_async_crq { | 558 | struct ibmvfc_async_crq { |
545 | volatile u8 valid; | 559 | volatile u8 valid; |
546 | u8 pad[3]; | 560 | u8 link_state; |
561 | u8 pad[2]; | ||
547 | u32 pad2; | 562 | u32 pad2; |
548 | volatile u64 event; | 563 | volatile u64 event; |
549 | volatile u64 scsi_id; | 564 | volatile u64 scsi_id; |
@@ -561,6 +576,7 @@ struct ibmvfc_async_crq_queue { | |||
561 | union ibmvfc_iu { | 576 | union ibmvfc_iu { |
562 | struct ibmvfc_mad_common mad_common; | 577 | struct ibmvfc_mad_common mad_common; |
563 | struct ibmvfc_npiv_login_mad npiv_login; | 578 | struct ibmvfc_npiv_login_mad npiv_login; |
579 | struct ibmvfc_npiv_logout_mad npiv_logout; | ||
564 | struct ibmvfc_discover_targets discover_targets; | 580 | struct ibmvfc_discover_targets discover_targets; |
565 | struct ibmvfc_port_login plogi; | 581 | struct ibmvfc_port_login plogi; |
566 | struct ibmvfc_process_login prli; | 582 | struct ibmvfc_process_login prli; |
@@ -575,7 +591,6 @@ enum ibmvfc_target_action { | |||
575 | IBMVFC_TGT_ACTION_NONE = 0, | 591 | IBMVFC_TGT_ACTION_NONE = 0, |
576 | IBMVFC_TGT_ACTION_INIT, | 592 | IBMVFC_TGT_ACTION_INIT, |
577 | IBMVFC_TGT_ACTION_INIT_WAIT, | 593 | IBMVFC_TGT_ACTION_INIT_WAIT, |
578 | IBMVFC_TGT_ACTION_ADD_RPORT, | ||
579 | IBMVFC_TGT_ACTION_DEL_RPORT, | 594 | IBMVFC_TGT_ACTION_DEL_RPORT, |
580 | }; | 595 | }; |
581 | 596 | ||
@@ -588,6 +603,7 @@ struct ibmvfc_target { | |||
588 | int target_id; | 603 | int target_id; |
589 | enum ibmvfc_target_action action; | 604 | enum ibmvfc_target_action action; |
590 | int need_login; | 605 | int need_login; |
606 | int add_rport; | ||
591 | int init_retries; | 607 | int init_retries; |
592 | u32 cancel_key; | 608 | u32 cancel_key; |
593 | struct ibmvfc_service_parms service_parms; | 609 | struct ibmvfc_service_parms service_parms; |
@@ -627,6 +643,8 @@ struct ibmvfc_event_pool { | |||
627 | 643 | ||
628 | enum ibmvfc_host_action { | 644 | enum ibmvfc_host_action { |
629 | IBMVFC_HOST_ACTION_NONE = 0, | 645 | IBMVFC_HOST_ACTION_NONE = 0, |
646 | IBMVFC_HOST_ACTION_LOGO, | ||
647 | IBMVFC_HOST_ACTION_LOGO_WAIT, | ||
630 | IBMVFC_HOST_ACTION_INIT, | 648 | IBMVFC_HOST_ACTION_INIT, |
631 | IBMVFC_HOST_ACTION_INIT_WAIT, | 649 | IBMVFC_HOST_ACTION_INIT_WAIT, |
632 | IBMVFC_HOST_ACTION_QUERY, | 650 | IBMVFC_HOST_ACTION_QUERY, |
@@ -635,7 +653,6 @@ enum ibmvfc_host_action { | |||
635 | IBMVFC_HOST_ACTION_ALLOC_TGTS, | 653 | IBMVFC_HOST_ACTION_ALLOC_TGTS, |
636 | IBMVFC_HOST_ACTION_TGT_INIT, | 654 | IBMVFC_HOST_ACTION_TGT_INIT, |
637 | IBMVFC_HOST_ACTION_TGT_DEL_FAILED, | 655 | IBMVFC_HOST_ACTION_TGT_DEL_FAILED, |
638 | IBMVFC_HOST_ACTION_TGT_ADD, | ||
639 | }; | 656 | }; |
640 | 657 | ||
641 | enum ibmvfc_host_state { | 658 | enum ibmvfc_host_state { |
@@ -682,6 +699,8 @@ struct ibmvfc_host { | |||
682 | int client_migrated; | 699 | int client_migrated; |
683 | int reinit; | 700 | int reinit; |
684 | int delay_init; | 701 | int delay_init; |
702 | int scan_complete; | ||
703 | int logged_in; | ||
685 | int events_to_log; | 704 | int events_to_log; |
686 | #define IBMVFC_AE_LINKUP 0x0001 | 705 | #define IBMVFC_AE_LINKUP 0x0001 |
687 | #define IBMVFC_AE_LINKDOWN 0x0002 | 706 | #define IBMVFC_AE_LINKDOWN 0x0002 |
@@ -692,6 +711,7 @@ struct ibmvfc_host { | |||
692 | void (*job_step) (struct ibmvfc_host *); | 711 | void (*job_step) (struct ibmvfc_host *); |
693 | struct task_struct *work_thread; | 712 | struct task_struct *work_thread; |
694 | struct tasklet_struct tasklet; | 713 | struct tasklet_struct tasklet; |
714 | struct work_struct rport_add_work_q; | ||
695 | wait_queue_head_t init_wait_q; | 715 | wait_queue_head_t init_wait_q; |
696 | wait_queue_head_t work_wait_q; | 716 | wait_queue_head_t work_wait_q; |
697 | }; | 717 | }; |
@@ -707,6 +727,12 @@ struct ibmvfc_host { | |||
707 | #define tgt_err(t, fmt, ...) \ | 727 | #define tgt_err(t, fmt, ...) \ |
708 | dev_err((t)->vhost->dev, "%llX: " fmt, (t)->scsi_id, ##__VA_ARGS__) | 728 | dev_err((t)->vhost->dev, "%llX: " fmt, (t)->scsi_id, ##__VA_ARGS__) |
709 | 729 | ||
730 | #define tgt_log(t, level, fmt, ...) \ | ||
731 | do { \ | ||
732 | if ((t)->vhost->log_level >= level) \ | ||
733 | tgt_err(t, fmt, ##__VA_ARGS__); \ | ||
734 | } while (0) | ||
735 | |||
710 | #define ibmvfc_dbg(vhost, ...) \ | 736 | #define ibmvfc_dbg(vhost, ...) \ |
711 | DBG_CMD(dev_info((vhost)->dev, ##__VA_ARGS__)) | 737 | DBG_CMD(dev_info((vhost)->dev, ##__VA_ARGS__)) |
712 | 738 | ||