4 * Copyright (C) 2006 Mike Christie
5 * Copyright (C) 2006 Red Hat, Inc. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published
9 * by the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
23 #include "initiator.h"
24 #include "transport.h"
26 #include "iscsi_util.h"
27 #include "iscsi_sysfs.h"
31 struct iscsi_transport_template iscsi_tcp
= {
33 .ep_connect
= iscsi_io_tcp_connect
,
34 .ep_poll
= iscsi_io_tcp_poll
,
35 .ep_disconnect
= iscsi_io_tcp_disconnect
,
38 struct iscsi_transport_template iscsi_iser
= {
41 .ep_connect
= ktransport_ep_connect
,
42 .ep_poll
= ktransport_ep_poll
,
43 .ep_disconnect
= ktransport_ep_disconnect
,
46 struct iscsi_transport_template cxgb3i
= {
49 .ep_connect
= ktransport_ep_connect
,
50 .ep_poll
= ktransport_ep_poll
,
51 .ep_disconnect
= ktransport_ep_disconnect
,
52 .create_conn
= cxgbi_create_conn
,
55 struct iscsi_transport_template cxgb4i
= {
58 .ep_connect
= ktransport_ep_connect
,
59 .ep_poll
= ktransport_ep_poll
,
60 .ep_disconnect
= ktransport_ep_disconnect
,
61 .create_conn
= cxgbi_create_conn
,
64 struct iscsi_transport_template bnx2i
= {
67 .ep_connect
= ktransport_ep_connect
,
68 .ep_poll
= ktransport_ep_poll
,
69 .ep_disconnect
= ktransport_ep_disconnect
,
72 struct iscsi_transport_template be2iscsi
= {
74 .create_conn
= be2iscsi_create_conn
,
75 .ep_connect
= ktransport_ep_connect
,
76 .ep_poll
= ktransport_ep_poll
,
77 .ep_disconnect
= ktransport_ep_disconnect
,
80 struct iscsi_transport_template qla4xxx
= {
84 static struct iscsi_transport_template
*iscsi_transport_templates
[] = {
95 int set_transport_template(struct iscsi_transport
*t
)
97 struct iscsi_transport_template
*tmpl
;
100 for (j
= 0; iscsi_transport_templates
[j
] != NULL
; j
++) {
101 tmpl
= iscsi_transport_templates
[j
];
103 if (!strcmp(tmpl
->name
, t
->name
)) {
105 log_debug(3, "Matched transport %s\n", t
->name
);
110 log_error("Could not find template for %s. An updated iscsiadm "
111 "is probably needed.\n", t
->name
);