diff options
Diffstat (limited to 'include/scsi/scsi_transport_fc.h')
-rw-r--r-- | include/scsi/scsi_transport_fc.h | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index 878373c32ef7..49d8913c4f86 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h | |||
@@ -167,6 +167,26 @@ enum fc_tgtid_binding_type { | |||
167 | struct device_attribute dev_attr_vport_##_name = \ | 167 | struct device_attribute dev_attr_vport_##_name = \ |
168 | __ATTR(_name,_mode,_show,_store) | 168 | __ATTR(_name,_mode,_show,_store) |
169 | 169 | ||
170 | /* | ||
171 | * fc_vport_identifiers: This set of data contains all elements | ||
172 | * to uniquely identify and instantiate a FC virtual port. | ||
173 | * | ||
174 | * Notes: | ||
175 | * symbolic_name: The driver is to append the symbolic_name string data | ||
176 | * to the symbolic_node_name data that it generates by default. | ||
177 | * the resulting combination should then be registered with the switch. | ||
178 | * It is expected that things like Xen may stuff a VM title into | ||
179 | * this field. | ||
180 | */ | ||
181 | #define FC_VPORT_SYMBOLIC_NAMELEN 64 | ||
182 | struct fc_vport_identifiers { | ||
183 | u64 node_name; | ||
184 | u64 port_name; | ||
185 | u32 roles; | ||
186 | bool disable; | ||
187 | enum fc_port_type vport_type; /* only FC_PORTTYPE_NPIV allowed */ | ||
188 | char symbolic_name[FC_VPORT_SYMBOLIC_NAMELEN]; | ||
189 | }; | ||
170 | 190 | ||
171 | /* | 191 | /* |
172 | * FC Virtual Port Attributes | 192 | * FC Virtual Port Attributes |
@@ -197,7 +217,6 @@ struct device_attribute dev_attr_vport_##_name = \ | |||
197 | * managed by the transport w/o driver interaction. | 217 | * managed by the transport w/o driver interaction. |
198 | */ | 218 | */ |
199 | 219 | ||
200 | #define FC_VPORT_SYMBOLIC_NAMELEN 64 | ||
201 | struct fc_vport { | 220 | struct fc_vport { |
202 | /* Fixed Attributes */ | 221 | /* Fixed Attributes */ |
203 | 222 | ||
@@ -338,6 +357,7 @@ struct fc_rport { /* aka fc_starget_attrs */ | |||
338 | /* bit field values for struct fc_rport "flags" field: */ | 357 | /* bit field values for struct fc_rport "flags" field: */ |
339 | #define FC_RPORT_DEVLOSS_PENDING 0x01 | 358 | #define FC_RPORT_DEVLOSS_PENDING 0x01 |
340 | #define FC_RPORT_SCAN_PENDING 0x02 | 359 | #define FC_RPORT_SCAN_PENDING 0x02 |
360 | #define FC_RPORT_FAST_FAIL_TIMEDOUT 0x03 | ||
341 | 361 | ||
342 | #define dev_to_rport(d) \ | 362 | #define dev_to_rport(d) \ |
343 | container_of(d, struct fc_rport, dev) | 363 | container_of(d, struct fc_rport, dev) |
@@ -659,12 +679,15 @@ fc_remote_port_chkready(struct fc_rport *rport) | |||
659 | if (rport->roles & FC_PORT_ROLE_FCP_TARGET) | 679 | if (rport->roles & FC_PORT_ROLE_FCP_TARGET) |
660 | result = 0; | 680 | result = 0; |
661 | else if (rport->flags & FC_RPORT_DEVLOSS_PENDING) | 681 | else if (rport->flags & FC_RPORT_DEVLOSS_PENDING) |
662 | result = DID_IMM_RETRY << 16; | 682 | result = DID_TRANSPORT_DISRUPTED << 16; |
663 | else | 683 | else |
664 | result = DID_NO_CONNECT << 16; | 684 | result = DID_NO_CONNECT << 16; |
665 | break; | 685 | break; |
666 | case FC_PORTSTATE_BLOCKED: | 686 | case FC_PORTSTATE_BLOCKED: |
667 | result = DID_IMM_RETRY << 16; | 687 | if (rport->flags & FC_RPORT_FAST_FAIL_TIMEDOUT) |
688 | result = DID_TRANSPORT_FAILFAST << 16; | ||
689 | else | ||
690 | result = DID_TRANSPORT_DISRUPTED << 16; | ||
668 | break; | 691 | break; |
669 | default: | 692 | default: |
670 | result = DID_NO_CONNECT << 16; | 693 | result = DID_NO_CONNECT << 16; |
@@ -732,6 +755,8 @@ void fc_host_post_vendor_event(struct Scsi_Host *shost, u32 event_number, | |||
732 | * be sure to read the Vendor Type and ID formatting requirements | 755 | * be sure to read the Vendor Type and ID formatting requirements |
733 | * specified in scsi_netlink.h | 756 | * specified in scsi_netlink.h |
734 | */ | 757 | */ |
758 | struct fc_vport *fc_vport_create(struct Scsi_Host *shost, int channel, | ||
759 | struct fc_vport_identifiers *); | ||
735 | int fc_vport_terminate(struct fc_vport *vport); | 760 | int fc_vport_terminate(struct fc_vport *vport); |
736 | 761 | ||
737 | #endif /* SCSI_TRANSPORT_FC_H */ | 762 | #endif /* SCSI_TRANSPORT_FC_H */ |