aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/scsi_transport_fc.h
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2008-07-18 11:32:52 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-10-03 12:46:15 -0400
commita30c3f69e6336cb9b09a989595e417367e4e9b1b (patch)
tree219211924d44553b97579682cd8c27750b47b631 /include/scsi/scsi_transport_fc.h
parent7404ad3b6d04efbd918e9e2e776bf560fbedf47d (diff)
[SCSI] fc_transport: Add an API to allow an LLD to create vports
There's already a fc_vport_termintate() call exported by the transport. This patch adds a symmetric call to the API to allow an NPIV-capable LLD to instantiate vports sans user intervention. Additional comments/updates: Re: scsi_fc_transport.txt Add a function prototype for fc_vport_terminate similar to what's done for fc_vport_create Re: fc_vport_create I recommend we pass the channel number in fc_vport_create rather than fixing it at zero. Also, ids->vport_type should be set to FC_PORTTYPE_NPIV prior to calling fc_vport_create. The comment is also meaningless. Added-by and Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'include/scsi/scsi_transport_fc.h')
-rw-r--r--include/scsi/scsi_transport_fc.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index 878373c32ef7..21018a4df452 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -167,6 +167,26 @@ enum fc_tgtid_binding_type {
167struct device_attribute dev_attr_vport_##_name = \ 167struct 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
182struct 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
201struct fc_vport { 220struct fc_vport {
202 /* Fixed Attributes */ 221 /* Fixed Attributes */
203 222
@@ -732,6 +751,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 751 * be sure to read the Vendor Type and ID formatting requirements
733 * specified in scsi_netlink.h 752 * specified in scsi_netlink.h
734 */ 753 */
754struct fc_vport *fc_vport_create(struct Scsi_Host *shost, int channel,
755 struct fc_vport_identifiers *);
735int fc_vport_terminate(struct fc_vport *vport); 756int fc_vport_terminate(struct fc_vport *vport);
736 757
737#endif /* SCSI_TRANSPORT_FC_H */ 758#endif /* SCSI_TRANSPORT_FC_H */