diff --git a/src/include/ipxe/fc.h b/src/include/ipxe/fc.h index 3a80d56c..ab6b5bae 100644 --- a/src/include/ipxe/fc.h +++ b/src/include/ipxe/fc.h @@ -325,7 +325,8 @@ extern int fc_port_login ( struct fc_port *port, struct fc_port_id *port_id, extern void fc_port_logout ( struct fc_port *port, int rc ); extern int fc_port_open ( struct interface *transport, const struct fc_name *node_wwn, - const struct fc_name *port_wwn ); + const struct fc_name *port_wwn, + const char *name ); extern struct fc_port * fc_port_find ( const char *name ); /****************************************************************************** diff --git a/src/net/fc.c b/src/net/fc.c index eecb1adb..1934fab3 100644 --- a/src/net/fc.c +++ b/src/net/fc.c @@ -1178,11 +1178,11 @@ static struct interface_descriptor fc_port_ns_plogi_desc = * @v transport Transport interface * @v node Fibre Channel node name * @v port Fibre Channel port name + * @v name Symbolic port name * @ret rc Return status code */ int fc_port_open ( struct interface *transport, const struct fc_name *node_wwn, - const struct fc_name *port_wwn ) { - static unsigned int portindex = 0; + const struct fc_name *port_wwn, const char *name ) { struct fc_port *port; /* Allocate and initialise structure */ @@ -1198,9 +1198,7 @@ int fc_port_open ( struct interface *transport, const struct fc_name *node_wwn, INIT_LIST_HEAD ( &port->xchgs ); memcpy ( &port->node_wwn, node_wwn, sizeof ( port->node_wwn ) ); memcpy ( &port->port_wwn, port_wwn, sizeof ( port->port_wwn ) ); - - /* Create device name */ - snprintf ( port->name, sizeof ( port->name ), "fc%d", portindex++ ); + snprintf ( port->name, sizeof ( port->name ), "%s", name ); DBGC ( port, "FCPORT %s opened as %s", port->name, fc_ntoa ( &port->node_wwn ) ); diff --git a/src/net/fcoe.c b/src/net/fcoe.c index e155ff3a..24479ec0 100644 --- a/src/net/fcoe.c +++ b/src/net/fcoe.c @@ -1056,7 +1056,8 @@ static void fcoe_expired ( struct retry_timer *timer, int over __unused ) { /* Attach Fibre Channel port */ if ( ( rc = fc_port_open ( &fcoe->transport, &fcoe->node_wwn.fc, - &fcoe->port_wwn.fc ) ) != 0 ) { + &fcoe->port_wwn.fc, + fcoe->netdev->name ) ) != 0 ) { DBGC ( fcoe, "FCoE %s could not create FC port: %s\n", fcoe->netdev->name, strerror ( rc ) ); /* We will try again on the next timer expiry */