diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2016-04-13 12:21:16 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2016-04-13 12:21:16 +0000 |
commit | 90856ae070da7f0cf0ca2a9098a0cb9dbcb68b04 (patch) | |
tree | 4a542694c81bdaeb2fc27a82f8625ae1699c2283 /sys/dev | |
parent | cf50217c0a6b442cb501dbd648f40978d9079133 (diff) |
allocate an array of things to hold info about namespaces
so far the only useful info is namespace identify info
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/nvme.c | 5 | ||||
-rw-r--r-- | sys/dev/ic/nvmevar.h | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/ic/nvme.c b/sys/dev/ic/nvme.c index 0c6a8d373aa..b5a6e96e739 100644 --- a/sys/dev/ic/nvme.c +++ b/sys/dev/ic/nvme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nvme.c,v 1.23 2016/04/13 12:14:12 dlg Exp $ */ +/* $OpenBSD: nvme.c,v 1.24 2016/04/13 12:21:15 dlg Exp $ */ /* * Copyright (c) 2014 David Gwynne <dlg@openbsd.org> @@ -326,6 +326,9 @@ nvme_attach(struct nvme_softc *sc) goto disable; } + sc->sc_namespaces = mallocarray(sc->sc_nn, sizeof(*sc->sc_namespaces), + M_DEVBUF, M_WAITOK|M_ZERO); + return (0); disable: diff --git a/sys/dev/ic/nvmevar.h b/sys/dev/ic/nvmevar.h index 42a829eab54..974687e37f5 100644 --- a/sys/dev/ic/nvmevar.h +++ b/sys/dev/ic/nvmevar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: nvmevar.h,v 1.4 2016/04/13 12:14:12 dlg Exp $ */ +/* $OpenBSD: nvmevar.h,v 1.5 2016/04/13 12:21:15 dlg Exp $ */ /* * Copyright (c) 2014 David Gwynne <dlg@openbsd.org> @@ -57,6 +57,10 @@ struct nvme_queue { u_int16_t q_cq_phase; }; +struct nvme_namespace { + struct nvm_identify_namespace *ident; +}; + struct nvme_softc { struct device sc_dev; @@ -76,6 +80,7 @@ struct nvme_softc { sc_identify; u_int sc_nn; + struct nvme_namespace *sc_namespaces; struct nvme_queue *sc_admin_q; struct nvme_queue *sc_q; |