aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/fcoe/fcoe.c33
-rw-r--r--drivers/scsi/libfc/fc_frame.c1
2 files changed, 34 insertions, 0 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 437eacf2732d..f1c126b798af 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -96,6 +96,7 @@ static struct scsi_transport_template *fcoe_vport_transport_template;
96static int fcoe_vport_destroy(struct fc_vport *vport); 96static int fcoe_vport_destroy(struct fc_vport *vport);
97static int fcoe_vport_create(struct fc_vport *vport, bool disabled); 97static int fcoe_vport_create(struct fc_vport *vport, bool disabled);
98static int fcoe_vport_disable(struct fc_vport *vport, bool disable); 98static int fcoe_vport_disable(struct fc_vport *vport, bool disable);
99static void fcoe_set_vport_symbolic_name(struct fc_vport *vport);
99 100
100struct fc_function_template fcoe_transport_function = { 101struct fc_function_template fcoe_transport_function = {
101 .show_host_node_name = 1, 102 .show_host_node_name = 1,
@@ -132,6 +133,7 @@ struct fc_function_template fcoe_transport_function = {
132 .vport_create = fcoe_vport_create, 133 .vport_create = fcoe_vport_create,
133 .vport_delete = fcoe_vport_destroy, 134 .vport_delete = fcoe_vport_destroy,
134 .vport_disable = fcoe_vport_disable, 135 .vport_disable = fcoe_vport_disable,
136 .set_vport_symbolic_name = fcoe_set_vport_symbolic_name,
135}; 137};
136 138
137struct fc_function_template fcoe_vport_transport_function = { 139struct fc_function_template fcoe_vport_transport_function = {
@@ -2326,3 +2328,34 @@ static int fcoe_vport_disable(struct fc_vport *vport, bool disable)
2326 return 0; 2328 return 0;
2327} 2329}
2328 2330
2331/**
2332 * fcoe_vport_set_symbolic_name() - append vport string to symbolic name
2333 * @vport: fc_vport with a new symbolic name string
2334 *
2335 * After generating a new symbolic name string, a new RSPN_ID request is
2336 * sent to the name server. There is no response handler, so if it fails
2337 * for some reason it will not be retried.
2338 */
2339static void fcoe_set_vport_symbolic_name(struct fc_vport *vport)
2340{
2341 struct fc_lport *lport = vport->dd_data;
2342 struct fc_frame *fp;
2343 size_t len;
2344
2345 snprintf(fc_host_symbolic_name(lport->host), FC_SYMBOLIC_NAME_SIZE,
2346 "%s v%s over %s : %s", FCOE_NAME, FCOE_VERSION,
2347 fcoe_netdev(lport)->name, vport->symbolic_name);
2348
2349 if (lport->state != LPORT_ST_READY)
2350 return;
2351
2352 len = strnlen(fc_host_symbolic_name(lport->host), 255);
2353 fp = fc_frame_alloc(lport,
2354 sizeof(struct fc_ct_hdr) +
2355 sizeof(struct fc_ns_rspn) + len);
2356 if (!fp)
2357 return;
2358 lport->tt.elsct_send(lport, FC_FID_DIR_SERV, fp, FC_NS_RSPN_ID,
2359 NULL, NULL, lport->e_d_tov);
2360}
2361
diff --git a/drivers/scsi/libfc/fc_frame.c b/drivers/scsi/libfc/fc_frame.c
index ac3681ae68d9..4fea369b58ee 100644
--- a/drivers/scsi/libfc/fc_frame.c
+++ b/drivers/scsi/libfc/fc_frame.c
@@ -86,3 +86,4 @@ struct fc_frame *fc_frame_alloc_fill(struct fc_lport *lp, size_t payload_len)
86 } 86 }
87 return fp; 87 return fp;
88} 88}
89EXPORT_SYMBOL(fc_frame_alloc_fill);