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.h34
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
32struct scsi_transport_template; 34struct 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 **/
442static inline int
443fc_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
430struct scsi_transport_template *fc_attach_transport( 462struct scsi_transport_template *fc_attach_transport(
431 struct fc_function_template *); 463 struct fc_function_template *);
432void fc_release_transport(struct scsi_transport_template *); 464void 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);
436void fc_remote_port_delete(struct fc_rport *rport); 468void fc_remote_port_delete(struct fc_rport *rport);
437void fc_remote_port_rolechg(struct fc_rport *rport, u32 roles); 469void fc_remote_port_rolechg(struct fc_rport *rport, u32 roles);
438int fc_remote_port_block(struct fc_rport *rport);
439void fc_remote_port_unblock(struct fc_rport *rport);
440int scsi_is_fc_rport(const struct device *); 470int scsi_is_fc_rport(const struct device *);
441 471
442static inline u64 wwn_to_u64(u8 *wwn) 472static inline u64 wwn_to_u64(u8 *wwn)