Module Name:    src
Committed By:   thorpej
Date:           Sun Mar 28 20:33:47 UTC 2021

Modified Files:
        src/sys/dev/ic [thorpej-cfargs]: nvme.c

Log Message:
- In nvme_rescan(), pass the locators used for matching to config_found()
  and use config_stdsubmatch().
- No need to be explicit about interface attribute, because we carry
  only one.


To generate a diff of this commit:
cvs rdiff -u -r1.54.2.1 -r1.54.2.2 src/sys/dev/ic/nvme.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/nvme.c
diff -u src/sys/dev/ic/nvme.c:1.54.2.1 src/sys/dev/ic/nvme.c:1.54.2.2
--- src/sys/dev/ic/nvme.c:1.54.2.1	Sun Mar 21 21:09:12 2021
+++ src/sys/dev/ic/nvme.c	Sun Mar 28 20:33:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvme.c,v 1.54.2.1 2021/03/21 21:09:12 thorpej Exp $	*/
+/*	$NetBSD: nvme.c,v 1.54.2.2 2021/03/28 20:33:46 thorpej Exp $	*/
 /*	$OpenBSD: nvme.c,v 1.49 2016/04/18 05:59:50 dlg Exp $ */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.54.2.1 2021/03/21 21:09:12 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.54.2.2 2021/03/28 20:33:46 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -41,6 +41,7 @@ __KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.5
 #include <dev/ic/nvmeio.h>
 
 #include "ioconf.h"
+#include "locators.h"
 
 #define	B4_CHK_RDY_DELAY_MS	2300	/* workaround controller bug */
 
@@ -447,7 +448,7 @@ nvme_attach(struct nvme_softc *sc)
 	/* probe subdevices */
 	sc->sc_namespaces = kmem_zalloc(sizeof(*sc->sc_namespaces) * sc->sc_nn,
 	    KM_SLEEP);
-	nvme_rescan(sc->sc_dev, "nvme", &i);
+	nvme_rescan(sc->sc_dev, NULL, NULL);
 
 	return 0;
 
@@ -467,7 +468,7 @@ free_admin_q:
 }
 
 int
-nvme_rescan(device_t self, const char *attr, const int *flags)
+nvme_rescan(device_t self, const char *ifattr, const int *locs)
 {
 	struct nvme_softc *sc = device_private(self);
 	struct nvme_attach_args naa;
@@ -475,7 +476,7 @@ nvme_rescan(device_t self, const char *a
 	struct nvme_namespace *ns;
 	uint64_t cap;
 	int ioq_entries = nvme_ioq_size;
-	int i;
+	int i, mlocs[NVMECF_NLOCS];
 	int error;
 
 	cap = nvme_read8(sc, NVME_CAP);
@@ -511,13 +512,18 @@ nvme_rescan(device_t self, const char *a
 			continue;
 		}
 
+		mlocs[NVMECF_NSID] = i;
+
 		memset(&naa, 0, sizeof(naa));
 		naa.naa_nsid = i;
 		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 - 1].dev = config_found(sc->sc_dev, &naa,
-		    nvme_print, CFARG_EOL);
+		sc->sc_namespaces[i - 1].dev =
+		    config_found(sc->sc_dev, &naa, nvme_print,
+				 CFARG_SUBMATCH, config_stdsubmatch,
+				 CFARG_LOCATORS, mlocs,
+				 CFARG_EOL);
 	}
 	return 0;
 }

Reply via email to