]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[fc] Allow Fibre Channel ports to be explicitly named
authorMichael Brown <mcb30@ipxe.org>
Sat, 27 Nov 2010 14:37:53 +0000 (14:37 +0000)
committerMichael Brown <mcb30@ipxe.org>
Sat, 27 Nov 2010 14:37:53 +0000 (14:37 +0000)
Use the network interface name as the Fibre Channel port name.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/ipxe/fc.h
src/net/fc.c
src/net/fcoe.c

index 3a80d56c94262630eed7b4860c63996b0fd33244..ab6b5bae77cf5bc2516f822a08f869063c92d324 100644 (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 );
 
 /******************************************************************************
index eecb1adb5d00684666cc398d175c61ad04510c91..1934fab3d4c32d0dce868d4f5031efa07917b522 100644 (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 ) );
index e155ff3ae791cc01896118349463dc217f06abee..24479ec0b31c475f527fc012f4eb38dd24419357 100644 (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 */