svn commit: r235102 - in projects/altix2/sys: conf dev/mpt
Marcel Moolenaar
marcel at FreeBSD.org
Sun May 6 19:34:56 UTC 2012
Author: marcel
Date: Sun May 6 19:34:55 2012
New Revision: 235102
URL: http://svn.freebsd.org/changeset/base/235102
Log:
Add global option "MPT_USE_BUSDMA" to have mpt(4) use busdma/mi instead
of bus_dma. mpt(4) is the SCSI controller driver under VMWare Fusion,
which makes for a convenient prototyping environment.
Hook up to busdma_tag_create(). Everything else fails.
Modified:
projects/altix2/sys/conf/options
projects/altix2/sys/dev/mpt/mpt.h
Modified: projects/altix2/sys/conf/options
==============================================================================
--- projects/altix2/sys/conf/options Sun May 6 19:03:36 2012 (r235101)
+++ projects/altix2/sys/conf/options Sun May 6 19:34:55 2012 (r235102)
@@ -911,3 +911,6 @@ AR71XX_REALMEM opt_ar71xx.h
AR71XX_ENV_UBOOT opt_ar71xx.h
AR71XX_ENV_REDBOOT opt_ar71xx.h
AR71XX_ATH_EEPROM opt_ar71xx.h
+
+# busdma/mi
+MPT_USE_BUSDMA opt_global.h
Modified: projects/altix2/sys/dev/mpt/mpt.h
==============================================================================
--- projects/altix2/sys/dev/mpt/mpt.h Sun May 6 19:03:36 2012 (r235101)
+++ projects/altix2/sys/dev/mpt/mpt.h Sun May 6 19:34:55 2012 (r235102)
@@ -238,6 +238,23 @@ int mpt_modevent(module_t, int, void *);
#define bus_dmamap_sync_range(dma_tag, dmamap, offset, len, op) \
bus_dmamap_sync(dma_tag, dmamap, op)
+#ifdef MPT_USE_BUSDMA
+#include <sys/busdma.h>
+
+#define mpt_dma_tag_create(mpt, parent_tag, alignment, boundary, \
+ lowaddr, highaddr, filter, filterarg, \
+ maxsize, nsegments, maxsegsz, flags, \
+ dma_tagp) \
+ busdma_tag_create((mpt)->dev, lowaddr, alignment, boundary, \
+ maxsize, nsegments, maxsegsz, flags, (busdma_tag_t *)dma_tagp)
+
+#define mpt_dma_tag_derive(mpt, parent_tag, alignment, boundary, \
+ lowaddr, highaddr, filter, filterarg, \
+ maxsize, nsegments, maxsegsz, flags, \
+ dma_tagp) \
+ busdma_tag_derive(parent_tag, lowaddr, alignment, boundary, \
+ maxsize, nsegments, maxsegsz, flags, (busdma_tag_t *)dma_tagp)
+#else
#if __FreeBSD_version < 600000
#define bus_get_dma_tag(x) NULL
#endif
@@ -261,6 +278,7 @@ int mpt_modevent(module_t, int, void *);
maxsize, nsegments, maxsegsz, flags, \
dma_tagp)
#endif
+#endif /* MPT_USE_BUSDMA */
struct mpt_map_info {
struct mpt_softc *mpt;
More information about the svn-src-projects
mailing list