aboutsummaryrefslogtreecommitdiff
path: root/src/net/fc.c
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2010-11-27 14:37:53 +0000
committerMichael Brown <mcb30@ipxe.org>2010-11-27 14:37:53 +0000
commit1415ec9c9a51ff7cbbb9413b712f768514212980 (patch)
tree1647163c9c67a667149337c18bf71656b6a46507 /src/net/fc.c
parentd17e87da7dd0348ba13bdf69f3078ab0a3394e53 (diff)
downloadipxe-1415ec9c9a51ff7cbbb9413b712f768514212980.zip
ipxe-1415ec9c9a51ff7cbbb9413b712f768514212980.tar.gz
ipxe-1415ec9c9a51ff7cbbb9413b712f768514212980.tar.bz2
[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>
Diffstat (limited to 'src/net/fc.c')
-rw-r--r--src/net/fc.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/net/fc.c b/src/net/fc.c
index eecb1ad..1934fab 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 ) );