[PATCH] open-iscsi: add transport cxgb4i

From: Karen Xie <[email protected]>

This patch added the new transport cxgb4i.

Signed-off-by: Karen Xie <[email protected]>
---

 usr/Makefile         |    2 +-
 usr/cxgb3i.c         |   24 ------------------------
 usr/cxgb3i.h         |    8 --------
 usr/cxgbi.c          |   24 ++++++++++++++++++++++++
 usr/cxgbi.h          |    8 ++++++++
 usr/iscsi_net_util.c |    1 +
 usr/iscsi_sysfs.c    |    2 +-
 usr/iscsid.c         |    2 +-
 usr/transport.c      |   14 ++++++++++++--
 9 files changed, 48 insertions(+), 37 deletions(-)
 delete mode 100644 usr/cxgb3i.c
 delete mode 100644 usr/cxgb3i.h
 create mode 100644 usr/cxgbi.c
 create mode 100644 usr/cxgbi.h


diff --git a/usr/Makefile b/usr/Makefile
index e9d6bd1..b02a706 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -42,7 +42,7 @@ ISCSI_LIB_SRCS = iscsi_util.o io.o auth.o login.o log.o md5.o 
sha1.o iface.o \
        iscsid_req.o $(SYSDEPS_SRCS)
 # core initiator files
 INITIATOR_SRCS = initiator.o scsi.o actor.o event_poll.o mgmt_ipc.o \
-               transport.o cxgb3i.o be2iscsi.o
+               transport.o cxgbi.o be2iscsi.o
 # fw boot files
 FW_BOOT_SRCS = $(wildcard ../utils/fwparam_ibft/*.o)
 
diff --git a/usr/cxgb3i.c b/usr/cxgb3i.c
deleted file mode 100644
index 39776a3..0000000
--- a/usr/cxgb3i.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * cxgb3i helpers
- *
- * Copyright (C) 2006 Mike Christie
- * Copyright (C) 2006 Red Hat, Inc. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- */
-#include "initiator.h"
-
-void cxgb3i_create_conn(struct iscsi_conn *conn)
-{
-       /* card can handle up to 15360 bytes */
-       if (conn->max_recv_dlength > 8192)
-               conn->max_recv_dlength = 8192;
-}
diff --git a/usr/cxgb3i.h b/usr/cxgb3i.h
deleted file mode 100644
index bff4aae..0000000
--- a/usr/cxgb3i.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef CXGB3I_TRANSPORT
-#define CXGB3I_TRANSPORT
-
-struct iscsi_conn;
-
-extern void cxgb3i_create_conn(struct iscsi_conn *conn);
-
-#endif
diff --git a/usr/cxgbi.c b/usr/cxgbi.c
new file mode 100644
index 0000000..4f3d1db
--- /dev/null
+++ b/usr/cxgbi.c
@@ -0,0 +1,24 @@
+/*
+ * cxgb3i/cxgb4i helpers
+ *
+ * Copyright (C) 2006 Mike Christie
+ * Copyright (C) 2006 Red Hat, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+#include "initiator.h"
+
+void cxgbi_create_conn(struct iscsi_conn *conn)
+{
+       /* card can handle up to 15360 bytes */
+       if (conn->max_recv_dlength > 8192)
+               conn->max_recv_dlength = 8192;
+}
diff --git a/usr/cxgbi.h b/usr/cxgbi.h
new file mode 100644
index 0000000..bd46603
--- /dev/null
+++ b/usr/cxgbi.h
@@ -0,0 +1,8 @@
+#ifndef CXGBI_TRANSPORT
+#define CXGBI_TRANSPORT
+
+struct iscsi_conn;
+
+extern void cxgbi_create_conn(struct iscsi_conn *conn);
+
+#endif
diff --git a/usr/iscsi_net_util.c b/usr/iscsi_net_util.c
index cbe6f56..e801b48 100644
--- a/usr/iscsi_net_util.c
+++ b/usr/iscsi_net_util.c
@@ -41,6 +41,7 @@ struct iscsi_net_driver {
 static struct iscsi_net_driver net_drivers[] = {
 #ifdef OFFLOAD_BOOT_SUPPORTED
        {"cxgb3", "cxgb3i" },
+       {"cxgb4", "cxgb4i" },
        {"bnx2", "bnx2i" },
        {"bnx2x", "bnx2i"},
 #endif
diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
index 31a8c88..6eca3c8 100644
--- a/usr/iscsi_sysfs.c
+++ b/usr/iscsi_sysfs.c
@@ -459,7 +459,7 @@ static int iscsi_sysfs_read_iface(struct iface_rec *iface, 
int host_no,
         * host level because we cannot create different initiator ports
         * (cannot set isid either). The LLD also exports the iname at the
         * hba level so apps can see it, but we no longer set the iname for
-        * each iscsid controlled host since bnx2i cxgb3i can support multiple
+        * each iscsid controlled host since bnx2i cxgbi can support multiple
         * initiator names and of course software iscsi can support anything.
         */
        ret = 1;
diff --git a/usr/iscsid.c b/usr/iscsid.c
index 402e4f3..a659176 100644
--- a/usr/iscsid.c
+++ b/usr/iscsid.c
@@ -318,7 +318,7 @@ static void missing_iname_warn(char *initiatorname_file)
        log_error("Warning: InitiatorName file %s does not exist or does not "
                  "contain a properly formated InitiatorName. If using "
                  "software iscsi (iscsi_tcp or ib_iser) or partial offload "
-                 "(bnx2i or cxgb3i iscsi), you may not be able to log "
+                 "(bnx2i or cxgbi iscsi), you may not be able to log "
                  "into or discover targets. Please create a file %s that "
                  "contains a sting with the format: InitiatorName="
                  "iqn.yyyy-mm.<reversed domain name>[:identifier].\n\n"
diff --git a/usr/transport.c b/usr/transport.c
index c0789bb..2c5224f 100644
--- a/usr/transport.c
+++ b/usr/transport.c
@@ -25,7 +25,7 @@
 #include "log.h"
 #include "iscsi_util.h"
 #include "iscsi_sysfs.h"
-#include "cxgb3i.h"
+#include "cxgbi.h"
 #include "be2iscsi.h"
 
 struct iscsi_transport_template iscsi_tcp = {
@@ -49,7 +49,16 @@ struct iscsi_transport_template cxgb3i = {
        .ep_connect     = ktransport_ep_connect,
        .ep_poll        = ktransport_ep_poll,
        .ep_disconnect  = ktransport_ep_disconnect,
-       .create_conn    = cxgb3i_create_conn,
+       .create_conn    = cxgbi_create_conn,
+};
+
+struct iscsi_transport_template cxgb4i = {
+       .name           = "cxgb4i",
+       .set_host_ip    = 1,
+       .ep_connect     = ktransport_ep_connect,
+       .ep_poll        = ktransport_ep_poll,
+       .ep_disconnect  = ktransport_ep_disconnect,
+       .create_conn    = cxgbi_create_conn,
 };
 
 struct iscsi_transport_template bnx2i = {
@@ -76,6 +85,7 @@ static struct iscsi_transport_template 
*iscsi_transport_templates[] = {
        &iscsi_tcp,
        &iscsi_iser,
        &cxgb3i,
+       &cxgb4i,
        &bnx2i,
        &qla4xxx,
        &be2iscsi,

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.

Reply via email to