aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/scsi_transport_fc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/scsi/scsi_transport_fc.h')
-rw-r--r--include/scsi/scsi_transport_fc.h31
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
32struct scsi_transport_template; 33struct 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 **/
441static inline int
442fc_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
432struct scsi_transport_template *fc_attach_transport( 461struct scsi_transport_template *fc_attach_transport(
433 struct fc_function_template *); 462 struct fc_function_template *);
434void fc_release_transport(struct scsi_transport_template *); 463void 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);
438void fc_remote_port_delete(struct fc_rport *rport); 467void fc_remote_port_delete(struct fc_rport *rport);
439void fc_remote_port_rolechg(struct fc_rport *rport, u32 roles); 468void fc_remote_port_rolechg(struct fc_rport *rport, u32 roles);
440int fc_remote_port_block(struct fc_rport *rport);
441void fc_remote_port_unblock(struct fc_rport *rport);
442int scsi_is_fc_rport(const struct device *); 469int scsi_is_fc_rport(const struct device *);
443 470
444static inline u64 wwn_to_u64(u8 *wwn) 471static inline u64 wwn_to_u64(u8 *wwn)