diff options
author | 2016-06-06 17:17:54 +0000 | |
---|---|---|
committer | 2016-06-06 17:17:54 +0000 | |
commit | efa6aa13f30fe3fdc6415eecbf810fe68773cf42 (patch) | |
tree | 8691a7d2b7e08f3c5e20c52dc357cf3a30dd1344 | |
parent | restore my ability to do full bulks. (diff) | |
download | wireguard-openbsd-efa6aa13f30fe3fdc6415eecbf810fe68773cf42.tar.xz wireguard-openbsd-efa6aa13f30fe3fdc6415eecbf810fe68773cf42.zip |
Provide a bus_dma tag as part of the pvbus attach arguments
ok reyk (a while ago)
-rw-r--r-- | sys/dev/pv/pvbus.c | 22 | ||||
-rw-r--r-- | sys/dev/pv/pvvar.h | 5 |
2 files changed, 25 insertions, 2 deletions
diff --git a/sys/dev/pv/pvbus.c b/sys/dev/pv/pvbus.c index 49bbcb33d92..412f1a87675 100644 --- a/sys/dev/pv/pvbus.c +++ b/sys/dev/pv/pvbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pvbus.c,v 1.11 2016/01/27 09:04:19 reyk Exp $ */ +/* $OpenBSD: pvbus.c,v 1.12 2016/06/06 17:17:54 mikeb Exp $ */ /* * Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org> @@ -35,6 +35,7 @@ #include <machine/specialreg.h> #include <machine/cpu.h> #include <machine/conf.h> +#include <machine/bus.h> #ifdef __amd64__ #include <machine/vmmvar.h> #endif @@ -95,6 +96,24 @@ struct pvbus_type { #endif }; +struct bus_dma_tag pvbus_dma_tag = { + NULL, + _bus_dmamap_create, + _bus_dmamap_destroy, + _bus_dmamap_load, + _bus_dmamap_load_mbuf, + _bus_dmamap_load_uio, + _bus_dmamap_load_raw, + _bus_dmamap_unload, + _bus_dmamap_sync, + _bus_dmamem_alloc, + _bus_dmamem_alloc_range, + _bus_dmamem_free, + _bus_dmamem_map, + _bus_dmamem_unmap, + _bus_dmamem_mmap, +}; + struct pvbus_hv pvbus_hv[PVBUS_MAX]; struct pvbus_softc *pvbus_softc; @@ -212,6 +231,7 @@ pvbus_search(struct device *parent, void *arg, void *aux) pva.pva_busname = cf->cf_driver->cd_name; pva.pva_hv = sc->pvbus_hv; + pva.pva_dmat = &pvbus_dma_tag; if (cf->cf_attach->ca_match(parent, cf, &pva) > 0) config_attach(parent, cf, &pva, pvbus_print); diff --git a/sys/dev/pv/pvvar.h b/sys/dev/pv/pvvar.h index 4091c196130..4bb30318c28 100644 --- a/sys/dev/pv/pvvar.h +++ b/sys/dev/pv/pvvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pvvar.h,v 1.7 2016/01/27 09:04:19 reyk Exp $ */ +/* $OpenBSD: pvvar.h,v 1.8 2016/06/06 17:17:54 mikeb Exp $ */ /* * Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org> @@ -67,9 +67,12 @@ struct pvbus_attach_args { const char *pvba_busname; }; +struct bus_dma_tag; + struct pv_attach_args { const char *pva_busname; struct pvbus_hv *pva_hv; + struct bus_dma_tag *pva_dmat; }; void pvbus_identify(void); |