+LIBNVME_MI_1_3 {
+ global:
+ nvme_mi_set_probe_enabled;
+};
+
LIBNVME_MI_1_2 {
global:
nvme_mi_admin_get_features;
*/
ep->timeout = 5000;
+ nvme_mi_ep_probe(ep);
+
return ep;
err_free_ep:
}
r->log_level = log_level;
r->fp = stderr;
+ r->mi_probe_enabled = true;
if (fp)
r->fp = fp;
list_head_init(&r->hosts);
free(root);
}
+void nvme_mi_set_probe_enabled(nvme_root_t root, bool enabled)
+{
+ root->mi_probe_enabled = enabled;
+}
+
+void nvme_mi_ep_probe(struct nvme_mi_ep *ep)
+{
+ if (!ep->root->mi_probe_enabled)
+ return;
+
+ /* no quirks defined yet, nothing to probe! */
+ ep->quirks = 0;
+}
+
struct nvme_mi_ep *nvme_mi_init_ep(nvme_root_t root)
{
struct nvme_mi_ep *ep;
return ep->timeout;
}
+static bool nvme_mi_ep_has_quirk(nvme_mi_ep_t ep, unsigned long quirk)
+{
+ return ep->quirks & quirk;
+}
+
struct nvme_mi_ctrl *nvme_mi_init_ctrl(nvme_mi_ep_t ep, __u16 ctrl_id)
{
struct nvme_mi_ctrl *ctrl;
*/
void nvme_mi_free_root(nvme_root_t root);
+/**
+ * nvme_mi_set_probe_enabled() - enable/disable the probe for new endpoints
+ * @root: &nvme_root_t object
+ * @enabled: whether to probe new endpoints
+ *
+ * Controls whether newly-created endpoints are probed for quirks on creation.
+ * Defaults to enabled, which results in some initial messaging with the
+ * endpoint to determine model-specific details.
+ */
+void nvme_mi_set_probe_enabled(nvme_root_t root, bool enabled);
+
/* Top level management object: NVMe-MI Management Endpoint */
struct nvme_mi_ep;
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);
bool controllers_scanned;
unsigned int timeout;
unsigned int mprt_max;
+ unsigned long quirks;
};
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);