diff options
author | 2014-04-16 01:28:02 +0000 | |
---|---|---|
committer | 2014-04-16 01:28:02 +0000 | |
commit | 88aa9192ecddf36b0a24cdf13dd9b5960246a4c6 (patch) | |
tree | 527086e164fa15ef26d0b55e700fb2e6f5ca4a6a | |
parent | print the board name and firmware revision like we do on mpii and (diff) | |
download | wireguard-openbsd-88aa9192ecddf36b0a24cdf13dd9b5960246a4c6.tar.xz wireguard-openbsd-88aa9192ecddf36b0a24cdf13dd9b5960246a4c6.zip |
set ourselves up to respect the max data transfer size.
-rw-r--r-- | sys/dev/ic/nvme.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/dev/ic/nvme.c b/sys/dev/ic/nvme.c index 740b41ca62a..59f7fb9f881 100644 --- a/sys/dev/ic/nvme.c +++ b/sys/dev/ic/nvme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nvme.c,v 1.3 2014/04/16 00:26:59 dlg Exp $ */ +/* $OpenBSD: nvme.c,v 1.4 2014/04/16 01:28:02 dlg Exp $ */ /* * Copyright (c) 2014 David Gwynne <dlg@openbsd.org> @@ -46,7 +46,7 @@ int nvme_disable(struct nvme_softc *); void nvme_version(struct nvme_softc *, u_int32_t); void nvme_dumpregs(struct nvme_softc *); -int nvme_identify(struct nvme_softc *); +int nvme_identify(struct nvme_softc *, u_int); void nvme_fill_identify(struct nvme_softc *, struct nvme_ccb *, void *); @@ -299,7 +299,7 @@ nvme_attach(struct nvme_softc *sc) goto free_ccbs; } - if (nvme_identify(sc) != 0) { + if (nvme_identify(sc, NVME_CAP_MPSMIN(cap)) != 0) { printf("%s: unable to identify controller\n", DEVNAME(sc)); goto disable; } @@ -445,12 +445,13 @@ nvme_q_complete(struct nvme_softc *sc, struct nvme_queue *q) } int -nvme_identify(struct nvme_softc *sc) +nvme_identify(struct nvme_softc *sc, u_int mps) { char sn[41], mn[81], fr[17]; struct nvm_identify_controller *identify; struct nvme_dmamem *mem; struct nvme_ccb *ccb; + u_int mdts; int rv = 1; ccb = nvme_ccb_get(sc); @@ -481,6 +482,12 @@ nvme_identify(struct nvme_softc *sc) printf("%s: %s, firmware %s, serial %s\n", DEVNAME(sc), mn, fr, sn); + if (identify->mdts > 0) { + mdts = (1 << identify->mdts) * (1 << mps); + if (mdts < sc->sc_mdts) + sc->sc_mdts = mdts; + } + done: nvme_dmamem_free(sc, mem); |