mirror of https://github.com/ipxe/ipxe.git
[fc] Allow Fibre Channel ports to be explicitly named
Use the network interface name as the Fibre Channel port name. Signed-off-by: Michael Brown <mcb30@ipxe.org>pull/1/head
parent
d17e87da7d
commit
1415ec9c9a
|
@ -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 void fc_port_logout ( struct fc_port *port, int rc );
|
||||||
extern int fc_port_open ( struct interface *transport,
|
extern int fc_port_open ( struct interface *transport,
|
||||||
const struct fc_name *node_wwn,
|
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 );
|
extern struct fc_port * fc_port_find ( const char *name );
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
|
|
|
@ -1178,11 +1178,11 @@ static struct interface_descriptor fc_port_ns_plogi_desc =
|
||||||
* @v transport Transport interface
|
* @v transport Transport interface
|
||||||
* @v node Fibre Channel node name
|
* @v node Fibre Channel node name
|
||||||
* @v port Fibre Channel port name
|
* @v port Fibre Channel port name
|
||||||
|
* @v name Symbolic port name
|
||||||
* @ret rc Return status code
|
* @ret rc Return status code
|
||||||
*/
|
*/
|
||||||
int fc_port_open ( struct interface *transport, const struct fc_name *node_wwn,
|
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 ) {
|
||||||
static unsigned int portindex = 0;
|
|
||||||
struct fc_port *port;
|
struct fc_port *port;
|
||||||
|
|
||||||
/* Allocate and initialise structure */
|
/* 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 );
|
INIT_LIST_HEAD ( &port->xchgs );
|
||||||
memcpy ( &port->node_wwn, node_wwn, sizeof ( port->node_wwn ) );
|
memcpy ( &port->node_wwn, node_wwn, sizeof ( port->node_wwn ) );
|
||||||
memcpy ( &port->port_wwn, port_wwn, sizeof ( port->port_wwn ) );
|
memcpy ( &port->port_wwn, port_wwn, sizeof ( port->port_wwn ) );
|
||||||
|
snprintf ( port->name, sizeof ( port->name ), "%s", name );
|
||||||
/* Create device name */
|
|
||||||
snprintf ( port->name, sizeof ( port->name ), "fc%d", portindex++ );
|
|
||||||
|
|
||||||
DBGC ( port, "FCPORT %s opened as %s",
|
DBGC ( port, "FCPORT %s opened as %s",
|
||||||
port->name, fc_ntoa ( &port->node_wwn ) );
|
port->name, fc_ntoa ( &port->node_wwn ) );
|
||||||
|
|
|
@ -1056,7 +1056,8 @@ static void fcoe_expired ( struct retry_timer *timer, int over __unused ) {
|
||||||
|
|
||||||
/* Attach Fibre Channel port */
|
/* Attach Fibre Channel port */
|
||||||
if ( ( rc = fc_port_open ( &fcoe->transport, &fcoe->node_wwn.fc,
|
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",
|
DBGC ( fcoe, "FCoE %s could not create FC port: %s\n",
|
||||||
fcoe->netdev->name, strerror ( rc ) );
|
fcoe->netdev->name, strerror ( rc ) );
|
||||||
/* We will try again on the next timer expiry */
|
/* We will try again on the next timer expiry */
|
||||||
|
|
Loading…
Reference in New Issue