1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright (C) 2017 Intel Corporation.
3 * All rights reserved.
4 */
5
6 #include "spdk/stdinc.h"
7
8 #include "iscsi/iscsi.h"
9
10 #include "spdk_internal/init.h"
11
12 static void
iscsi_subsystem_init_complete(void * cb_arg,int rc)13 iscsi_subsystem_init_complete(void *cb_arg, int rc)
14 {
15 spdk_subsystem_init_next(rc);
16 }
17
18 static void
iscsi_subsystem_init(void)19 iscsi_subsystem_init(void)
20 {
21 spdk_iscsi_init(iscsi_subsystem_init_complete, NULL);
22 }
23
24 static void
iscsi_subsystem_fini_done(void * arg)25 iscsi_subsystem_fini_done(void *arg)
26 {
27 spdk_subsystem_fini_next();
28 }
29
30 static void
iscsi_subsystem_fini(void)31 iscsi_subsystem_fini(void)
32 {
33 spdk_iscsi_fini(iscsi_subsystem_fini_done, NULL);
34 }
35
36 static void
iscsi_subsystem_config_json(struct spdk_json_write_ctx * w)37 iscsi_subsystem_config_json(struct spdk_json_write_ctx *w)
38 {
39 spdk_iscsi_config_json(w);
40 }
41
42 static struct spdk_subsystem g_spdk_subsystem_iscsi = {
43 .name = "iscsi",
44 .init = iscsi_subsystem_init,
45 .fini = iscsi_subsystem_fini,
46 .write_config_json = iscsi_subsystem_config_json,
47 };
48
49 SPDK_SUBSYSTEM_REGISTER(g_spdk_subsystem_iscsi);
50 SPDK_SUBSYSTEM_DEPEND(iscsi, scsi)
51 SPDK_SUBSYSTEM_DEPEND(iscsi, sock)
52