diff options
Diffstat (limited to 'include/scsi/scsi_transport_fc.h')
-rw-r--r-- | include/scsi/scsi_transport_fc.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index 4496b32972e5..319ff7a60dfe 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h | |||
@@ -28,6 +28,7 @@ | |||
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 <scsi/scsi.h> | ||
31 | 32 | ||
32 | struct scsi_transport_template; | 33 | struct scsi_transport_template; |
33 | 34 | ||
@@ -429,6 +430,34 @@ struct fc_function_template { | |||
429 | }; | 430 | }; |
430 | 431 | ||
431 | 432 | ||
433 | /** | ||
434 | * fc_remote_port_chkready - called to validate the remote port state | ||
435 | * prior to initiating io to the port. | ||
436 | * | ||
437 | * Returns a scsi result code that can be returned by the LLDD. | ||
438 | * | ||
439 | * @rport: remote port to be checked | ||
440 | **/ | ||
441 | static inline int | ||
442 | fc_remote_port_chkready(struct fc_rport *rport) | ||
443 | { | ||
444 | int result; | ||
445 | |||
446 | switch (rport->port_state) { | ||
447 | case FC_PORTSTATE_ONLINE: | ||
448 | result = 0; | ||
449 | break; | ||
450 | case FC_PORTSTATE_BLOCKED: | ||
451 | result = DID_BUS_BUSY << 16; | ||
452 | break; | ||
453 | default: | ||
454 | result = DID_NO_CONNECT << 16; | ||
455 | break; | ||
456 | } | ||
457 | return result; | ||
458 | } | ||
459 | |||
460 | |||
432 | struct scsi_transport_template *fc_attach_transport( | 461 | struct scsi_transport_template *fc_attach_transport( |
433 | struct fc_function_template *); | 462 | struct fc_function_template *); |
434 | void fc_release_transport(struct scsi_transport_template *); | 463 | void fc_release_transport(struct scsi_transport_template *); |
@@ -437,8 +466,6 @@ struct fc_rport *fc_remote_port_add(struct Scsi_Host *shost, | |||
437 | int channel, struct fc_rport_identifiers *ids); | 466 | int channel, struct fc_rport_identifiers *ids); |
438 | void fc_remote_port_delete(struct fc_rport *rport); | 467 | void fc_remote_port_delete(struct fc_rport *rport); |
439 | void fc_remote_port_rolechg(struct fc_rport *rport, u32 roles); | 468 | void fc_remote_port_rolechg(struct fc_rport *rport, u32 roles); |
440 | int fc_remote_port_block(struct fc_rport *rport); | ||
441 | void fc_remote_port_unblock(struct fc_rport *rport); | ||
442 | int scsi_is_fc_rport(const struct device *); | 469 | int scsi_is_fc_rport(const struct device *); |
443 | 470 | ||
444 | static inline u64 wwn_to_u64(u8 *wwn) | 471 | static inline u64 wwn_to_u64(u8 *wwn) |