]> www.infradead.org Git - users/sagi/libnvme.git/commit
mi: Introduce quirks and endpoint probing
authorJeremy Kerr <jk@codeconstruct.com.au>
Tue, 20 Sep 2022 12:44:09 +0000 (20:44 +0800)
committerJeremy Kerr <jk@codeconstruct.com.au>
Thu, 3 Nov 2022 05:53:50 +0000 (13:53 +0800)
commita6840b8f093f9af875a1e7f1989c7c1a37aa71dd
tree88714dd6641e6459fa08138d786ee8e75b90c0dc
parent643e51009e3f58736dd4c88580a9bb7892efde27
mi: Introduce quirks and endpoint probing

This change introduces a little framework for adding device-specific
quirk flags. This allows the MI core to perform any queries on the
device, and set any quirk flags on specific devices.

This gives us a new (mi-internal) function:

    bool nvme_mi_ep_has_quirk(struct nvme_mi_ep *tp, unsigned long quirk)

which returns true if `quirk` is enabled on this endpoint.

Callers can disable probing through a new external API:

    nvme_mi_set_probe_enabled(nvme_root_t root, bool enabled);

Which will prevent sending any probe commands, and leave the quirks
field unset.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
src/libnvme-mi.map
src/nvme/mi-mctp.c
src/nvme/mi.c
src/nvme/mi.h
src/nvme/private.h