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 );
/******************************************************************************
* @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 */
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 ) );
/* 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 */