diff options
Diffstat (limited to 'include/scsi/scsi_transport_fc.h')
-rw-r--r-- | include/scsi/scsi_transport_fc.h | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index b0d445437372..fac547d32a98 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h | |||
@@ -28,6 +28,8 @@ | |||
28 | #define SCSI_TRANSPORT_FC_H | 28 | #define SCSI_TRANSPORT_FC_H |
29 | 29 | ||
30 | #include <linux/config.h> | 30 | #include <linux/config.h> |
31 | #include <linux/sched.h> | ||
32 | #include <scsi/scsi.h> | ||
31 | 33 | ||
32 | struct scsi_transport_template; | 34 | struct scsi_transport_template; |
33 | 35 | ||
@@ -384,6 +386,8 @@ struct fc_function_template { | |||
384 | struct fc_host_statistics * (*get_fc_host_stats)(struct Scsi_Host *); | 386 | struct fc_host_statistics * (*get_fc_host_stats)(struct Scsi_Host *); |
385 | void (*reset_fc_host_stats)(struct Scsi_Host *); | 387 | void (*reset_fc_host_stats)(struct Scsi_Host *); |
386 | 388 | ||
389 | int (*issue_fc_host_lip)(struct Scsi_Host *); | ||
390 | |||
387 | /* allocation lengths for host-specific data */ | 391 | /* allocation lengths for host-specific data */ |
388 | u32 dd_fcrport_size; | 392 | u32 dd_fcrport_size; |
389 | 393 | ||
@@ -427,6 +431,34 @@ struct fc_function_template { | |||
427 | }; | 431 | }; |
428 | 432 | ||
429 | 433 | ||
434 | /** | ||
435 | * fc_remote_port_chkready - called to validate the remote port state | ||
436 | * prior to initiating io to the port. | ||
437 | * | ||
438 | * Returns a scsi result code that can be returned by the LLDD. | ||
439 | * | ||
440 | * @rport: remote port to be checked | ||
441 | **/ | ||
442 | static inline int | ||
443 | fc_remote_port_chkready(struct fc_rport *rport) | ||
444 | { | ||
445 | int result; | ||
446 | |||
447 | switch (rport->port_state) { | ||
448 | case FC_PORTSTATE_ONLINE: | ||
449 | result = 0; | ||
450 | break; | ||
451 | case FC_PORTSTATE_BLOCKED: | ||
452 | result = DID_BUS_BUSY << 16; | ||
453 | break; | ||
454 | default: | ||
455 | result = DID_NO_CONNECT << 16; | ||
456 | break; | ||
457 | } | ||
458 | return result; | ||
459 | } | ||
460 | |||
461 | |||
430 | struct scsi_transport_template *fc_attach_transport( | 462 | struct scsi_transport_template *fc_attach_transport( |
431 | struct fc_function_template *); | 463 | struct fc_function_template *); |
432 | void fc_release_transport(struct scsi_transport_template *); | 464 | void fc_release_transport(struct scsi_transport_template *); |
@@ -435,8 +467,6 @@ struct fc_rport *fc_remote_port_add(struct Scsi_Host *shost, | |||
435 | int channel, struct fc_rport_identifiers *ids); | 467 | int channel, struct fc_rport_identifiers *ids); |
436 | void fc_remote_port_delete(struct fc_rport *rport); | 468 | void fc_remote_port_delete(struct fc_rport *rport); |
437 | void fc_remote_port_rolechg(struct fc_rport *rport, u32 roles); | 469 | void fc_remote_port_rolechg(struct fc_rport *rport, u32 roles); |
438 | int fc_remote_port_block(struct fc_rport *rport); | ||
439 | void fc_remote_port_unblock(struct fc_rport *rport); | ||
440 | int scsi_is_fc_rport(const struct device *); | 470 | int scsi_is_fc_rport(const struct device *); |
441 | 471 | ||
442 | static inline u64 wwn_to_u64(u8 *wwn) | 472 | static inline u64 wwn_to_u64(u8 *wwn) |