2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-11-22 17:41:55 +00:00

[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>
This commit is contained in:
Michael Brown 2010-11-27 14:37:53 +00:00
parent d17e87da7d
commit 1415ec9c9a
3 changed files with 7 additions and 7 deletions

View File

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

View File

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

View File

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