|
23 | 23 | /* default to 600 seconds of reconnect attempts before giving up */ |
24 | 24 | #define NVMF_DEF_CTRL_LOSS_TMO 600 |
25 | 25 |
|
26 | | -struct nvmf_context; |
27 | | - |
28 | | -int nvmf_context_create(struct nvme_global_ctx *ctx, |
29 | | - bool (*decide_retry)(struct nvmf_context *fctx, int err, |
30 | | - void *user_data), |
31 | | - void (*connected)(struct nvmf_context *fctx, |
32 | | - struct nvme_ctrl *c, void *user_data), |
33 | | - void (*already_connected)(struct nvmf_context *fctx, |
34 | | - struct nvme_host *host, const char *subsysnqn, |
35 | | - const char *transport, const char *traddr, |
36 | | - const char *trsvcid, void *user_data), |
37 | | - void *user_data, struct nvmf_context **fctxp); |
38 | | -int nvmf_context_set_discovery_cbs(struct nvmf_context *fctx, |
39 | | - void (*discovery_log)(struct nvmf_context *fctx, |
40 | | - bool connect, |
41 | | - struct nvmf_discovery_log *log, |
42 | | - uint64_t numrec, void *user_data), |
43 | | - int (*parser_init)(struct nvmf_context *fctx, |
44 | | - void *user_data), |
45 | | - void (*parser_cleanup)(struct nvmf_context *fctx, |
46 | | - void *user_data), |
47 | | - int (*parser_next_line)(struct nvmf_context *fctx, |
48 | | - void *user_data)); |
49 | | -int nvmf_context_set_discovery_defaults(struct nvmf_context *fctx, |
50 | | - int max_discovery_retries, int keep_alive_timeout); |
51 | | -int nvmf_context_set_fabrics_config(struct nvmf_context *fctx, |
52 | | - struct nvme_fabrics_config *cfg); |
53 | | -int nvmf_context_set_connection(struct nvmf_context *fctx, |
54 | | - const char *subsysnqn, const char *transport, |
55 | | - const char *traddr, const char *trsvcid, |
56 | | - const char *host_traddr, const char *host_iface); |
57 | | -int nvmf_context_set_hostnqn(struct nvmf_context *fctx, |
58 | | - const char *hostnqn, const char *hostid); |
59 | | -int nvmf_context_set_crypto(struct nvmf_context *fctx, |
60 | | - const char *hostkey, const char *ctrlkey, |
61 | | - const char *keyring, const char *tls_key, |
62 | | - const char *tls_key_identity); |
63 | | -int nvmf_context_set_persistent(struct nvmf_context *fctx, bool persistent); |
64 | | -int nvmf_context_set_device(struct nvmf_context *fctx, const char *device); |
65 | | - |
66 | 26 | /** |
67 | 27 | * struct nvme_fabrics_config - Defines all linux nvme fabrics initiator options |
68 | 28 | * @queue_size: Number of IO queue entries |
@@ -429,6 +389,46 @@ void nvme_free_uri(struct nvme_fabrics_uri *uri); |
429 | 389 |
|
430 | 390 | char *nvmf_get_default_trsvcid(const char *transport, bool discovery_ctrl); |
431 | 391 |
|
| 392 | +struct nvmf_context; |
| 393 | + |
| 394 | +int nvmf_context_create(struct nvme_global_ctx *ctx, |
| 395 | + bool (*decide_retry)(struct nvmf_context *fctx, int err, |
| 396 | + void *user_data), |
| 397 | + void (*connected)(struct nvmf_context *fctx, |
| 398 | + struct nvme_ctrl *c, void *user_data), |
| 399 | + void (*already_connected)(struct nvmf_context *fctx, |
| 400 | + struct nvme_host *host, const char *subsysnqn, |
| 401 | + const char *transport, const char *traddr, |
| 402 | + const char *trsvcid, void *user_data), |
| 403 | + void *user_data, struct nvmf_context **fctxp); |
| 404 | +int nvmf_context_set_discovery_cbs(struct nvmf_context *fctx, |
| 405 | + void (*discovery_log)(struct nvmf_context *fctx, |
| 406 | + bool connect, |
| 407 | + struct nvmf_discovery_log *log, |
| 408 | + uint64_t numrec, void *user_data), |
| 409 | + int (*parser_init)(struct nvmf_context *fctx, |
| 410 | + void *user_data), |
| 411 | + void (*parser_cleanup)(struct nvmf_context *fctx, |
| 412 | + void *user_data), |
| 413 | + int (*parser_next_line)(struct nvmf_context *fctx, |
| 414 | + void *user_data)); |
| 415 | +int nvmf_context_set_discovery_defaults(struct nvmf_context *fctx, |
| 416 | + int max_discovery_retries, int keep_alive_timeout); |
| 417 | +int nvmf_context_set_fabrics_config(struct nvmf_context *fctx, |
| 418 | + struct nvme_fabrics_config *cfg); |
| 419 | +int nvmf_context_set_connection(struct nvmf_context *fctx, |
| 420 | + const char *subsysnqn, const char *transport, |
| 421 | + const char *traddr, const char *trsvcid, |
| 422 | + const char *host_traddr, const char *host_iface); |
| 423 | +int nvmf_context_set_hostnqn(struct nvmf_context *fctx, |
| 424 | + const char *hostnqn, const char *hostid); |
| 425 | +int nvmf_context_set_crypto(struct nvmf_context *fctx, |
| 426 | + const char *hostkey, const char *ctrlkey, |
| 427 | + const char *keyring, const char *tls_key, |
| 428 | + const char *tls_key_identity); |
| 429 | +int nvmf_context_set_persistent(struct nvmf_context *fctx, bool persistent); |
| 430 | +int nvmf_context_set_device(struct nvmf_context *fctx, const char *device); |
| 431 | + |
432 | 432 | int nvmf_discovery(struct nvme_global_ctx *ctx, |
433 | 433 | struct nvmf_context *fctx, bool connect, bool force); |
434 | 434 | int nvmf_discovery_config_json(struct nvme_global_ctx *ctx, |
|
0 commit comments