From 7e691c813bdf26bf9c51f03ee926818c00cc6e39 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 31 Jan 2023 05:17:04 +0100 Subject: Merging upstream version 1.3. Signed-off-by: Daniel Baumann --- src/nvme/private.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/nvme/private.h') diff --git a/src/nvme/private.h b/src/nvme/private.h index cdd1bbf..a6ded21 100644 --- a/src/nvme/private.h +++ b/src/nvme/private.h @@ -85,6 +85,7 @@ struct nvme_ctrl { char *cntrltype; char *dctype; bool discovery_ctrl; + bool unique_discovery_ctrl; bool discovered; bool persistent; struct nvme_fabrics_config cfg; @@ -114,6 +115,9 @@ struct nvme_host { char *hostid; char *dhchap_key; char *hostsymname; + bool pdc_enabled; + bool pdc_enabled_valid; /* set if pdc_enabled doesn't have an undefined + * value */ }; struct nvme_root { @@ -125,6 +129,7 @@ struct nvme_root { bool log_pid; bool log_timestamp; bool modified; + bool mi_probe_enabled; }; int nvme_set_attr(const char *dir, const char *attr, const char *value); @@ -186,6 +191,14 @@ struct nvme_mi_transport { int (*check_timeout)(struct nvme_mi_ep *ep, unsigned int timeout); }; +/* quirks */ + +/* Set a minimum time between receiving a response from one command and + * sending the next request. Some devices may ignore new commands sent too soon + * after the previous request, so manually insert a delay + */ +#define NVME_QUIRK_MIN_INTER_COMMAND_TIME (1 << 0) + struct nvme_mi_ep { struct nvme_root *root; const struct nvme_mi_transport *transport; @@ -195,6 +208,12 @@ struct nvme_mi_ep { bool controllers_scanned; unsigned int timeout; unsigned int mprt_max; + unsigned long quirks; + + /* inter-command delay, for NVME_QUIRK_MIN_INTER_COMMAND_TIME */ + unsigned int inter_command_us; + struct timespec last_resp_time; + bool last_resp_time_valid; }; struct nvme_mi_ctrl { @@ -204,6 +223,7 @@ struct nvme_mi_ctrl { }; struct nvme_mi_ep *nvme_mi_init_ep(struct nvme_root *root); +void nvme_mi_ep_probe(struct nvme_mi_ep *ep); /* for tests, we need to calculate the correct MICs */ __u32 nvme_mi_crc32_update(__u32 crc, void *data, size_t len); -- cgit v1.2.3