1 /*
2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
5 * 1.0 of the CDDL.
6 *
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
10 */
11
12 /*
13 * Copyright 2025 Oxide Computer Company
14 */
15
16 /*
17 * Common definitions and values for NVMe version use.
18 */
19
20 #include "nvme_common.h"
21
22 const nvme_version_t nvme_vers_1v0 = { .v_major = 1, .v_minor = 0 };
23 const nvme_version_t nvme_vers_1v1 = { .v_major = 1, .v_minor = 1 };
24 const nvme_version_t nvme_vers_1v2 = { .v_major = 1, .v_minor = 2 };
25 const nvme_version_t nvme_vers_1v3 = { .v_major = 1, .v_minor = 3 };
26 const nvme_version_t nvme_vers_1v4 = { .v_major = 1, .v_minor = 4 };
27 const nvme_version_t nvme_vers_2v0 = { .v_major = 2, .v_minor = 0 };
28 const nvme_version_t nvme_vers_2v1 = { .v_major = 2, .v_minor = 1 };
29
30 bool
nvme_vers_atleast(const nvme_version_t * dev,const nvme_version_t * targ)31 nvme_vers_atleast(const nvme_version_t *dev, const nvme_version_t *targ)
32 {
33 return (dev->v_major > targ->v_major ||
34 (dev->v_major == targ->v_major && dev->v_minor >= targ->v_minor));
35 }
36