diff --git a/sys/dev/ic/nvme.c b/sys/dev/ic/nvme.c index b5679022012d..131d575e5e4c 100644 --- a/sys/dev/ic/nvme.c +++ b/sys/dev/ic/nvme.c @@ -1,4 +1,4 @@ -/* $NetBSD: nvme.c,v 1.41 2018/12/01 15:07:58 jdolecek Exp $ */ +/* $NetBSD: nvme.c,v 1.42 2019/04/24 23:39:23 mlelstv Exp $ */ /* $OpenBSD: nvme.c,v 1.49 2016/04/18 05:59:50 dlg Exp $ */ /* @@ -18,7 +18,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.41 2018/12/01 15:07:58 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.42 2019/04/24 23:39:23 mlelstv Exp $"); #include #include @@ -479,6 +479,7 @@ nvme_rescan(device_t self, const char *attr, const int *flags) naa.naa_nsid = i + 1; naa.naa_qentries = (ioq_entries - 1) * sc->sc_nq; naa.naa_maxphys = sc->sc_mdts; + naa.naa_typename = sc->sc_modelname; sc->sc_namespaces[i].dev = config_found(sc->sc_dev, &naa, nvme_print); } @@ -1449,6 +1450,8 @@ nvme_identify(struct nvme_softc *sc, u_int mps) aprint_normal_dev(sc->sc_dev, "%s, firmware %s, serial %s\n", mn, fr, sn); + strlcpy(sc->sc_modelname, mn, sizeof(sc->sc_modelname)); + if (sc->sc_identify.mdts > 0) { mdts = (1 << sc->sc_identify.mdts) * (1 << mps); if (mdts < sc->sc_mdts) diff --git a/sys/dev/ic/nvmevar.h b/sys/dev/ic/nvmevar.h index 35fac146c11c..f9966e7f3f84 100644 --- a/sys/dev/ic/nvmevar.h +++ b/sys/dev/ic/nvmevar.h @@ -1,4 +1,4 @@ -/* $NetBSD: nvmevar.h,v 1.18 2018/12/01 15:07:58 jdolecek Exp $ */ +/* $NetBSD: nvmevar.h,v 1.19 2019/04/24 23:39:23 mlelstv Exp $ */ /* $OpenBSD: nvmevar.h,v 1.8 2016/04/14 11:18:32 dlg Exp $ */ /* @@ -139,6 +139,8 @@ struct nvme_softc { uint32_t sc_quirks; #define NVME_QUIRK_DELAY_B4_CHK_RDY __BIT(0) + + char sc_modelname[81]; }; #define lemtoh16(p) le16toh(*((uint16_t *)(p))) @@ -152,6 +154,7 @@ struct nvme_attach_args { uint16_t naa_nsid; uint32_t naa_qentries; /* total number of queue slots */ uint32_t naa_maxphys; /* maximum device transfer size */ + const char *naa_typename; /* identifier */ }; int nvme_attach(struct nvme_softc *);