From owner-svn-src-projects@FreeBSD.ORG Sun May 6 20:40:19 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 79B0E106564A; Sun, 6 May 2012 20:40:19 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A3968FC0A; Sun, 6 May 2012 20:40:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q46KeJwm030932; Sun, 6 May 2012 20:40:19 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q46KeJbQ030926; Sun, 6 May 2012 20:40:19 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205062040.q46KeJbQ030926@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 6 May 2012 20:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235106 - projects/altix2/sys/dev/mpt X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 May 2012 20:40:19 -0000 Author: marcel Date: Sun May 6 20:40:18 2012 New Revision: 235106 URL: http://svn.freebsd.org/changeset/base/235106 Log: Add the mpt_dma_tag_derive macro and use it when deriving from the parent tag. This will use busdma_tag_derive for busdma/mi and is identical to mpt_dma_tag_create for bus_dma. Modified: projects/altix2/sys/dev/mpt/mpt.c projects/altix2/sys/dev/mpt/mpt.h projects/altix2/sys/dev/mpt/mpt_pci.c projects/altix2/sys/dev/mpt/mpt_user.c Modified: projects/altix2/sys/dev/mpt/mpt.c ============================================================================== --- projects/altix2/sys/dev/mpt/mpt.c Sun May 6 20:37:02 2012 (r235105) +++ projects/altix2/sys/dev/mpt/mpt.c Sun May 6 20:40:18 2012 (r235106) @@ -2534,7 +2534,7 @@ mpt_dma_buf_alloc(struct mpt_softc *mpt) int i, error; /* Create a child tag for data buffers */ - if (mpt_dma_tag_create(mpt, mpt->parent_dmat, 1, + if (mpt_dma_tag_derive(mpt, mpt->parent_dmat, 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, (mpt->max_cam_seg_cnt - 1) * PAGE_SIZE, mpt->max_cam_seg_cnt, BUS_SPACE_MAXSIZE_32BIT, 0, @@ -2544,7 +2544,7 @@ mpt_dma_buf_alloc(struct mpt_softc *mpt) } /* Create a child tag for request buffers */ - if (mpt_dma_tag_create(mpt, mpt->parent_dmat, PAGE_SIZE, 0, + if (mpt_dma_tag_derive(mpt, mpt->parent_dmat, PAGE_SIZE, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MPT_REQ_MEM_SIZE(mpt), 1, BUS_SPACE_MAXSIZE_32BIT, 0, &mpt->request_dmat) != 0) { @@ -2758,7 +2758,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, * the firmware after any hard-reset. */ mpt->fw_image_size = mpt->ioc_facts.FWImageSize; - error = mpt_dma_tag_create(mpt, mpt->parent_dmat, 1, 0, + error = mpt_dma_tag_derive(mpt, mpt->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, mpt->fw_image_size, 1, mpt->fw_image_size, 0, &mpt->fw_dmat); Modified: projects/altix2/sys/dev/mpt/mpt.h ============================================================================== --- projects/altix2/sys/dev/mpt/mpt.h Sun May 6 20:37:02 2012 (r235105) +++ projects/altix2/sys/dev/mpt/mpt.h Sun May 6 20:40:18 2012 (r235106) @@ -241,19 +241,19 @@ int mpt_modevent(module_t, int, void *); #ifdef MPT_USE_BUSDMA #include -#define mpt_dma_tag_create(mpt, parent_tag, alignment, boundary, \ - lowaddr, highaddr, filter, filterarg, \ - maxsize, nsegments, maxsegsz, flags, \ - dma_tagp) \ +#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) + 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) +#define mpt_dma_tag_derive(mpt, parent_tag, alignment, boundary, \ + lowaddr, highaddr, filter, filterarg, maxsize, \ + nsegments, maxsegsz, flags, dma_tagp) \ + busdma_tag_derive((busdma_tag_t)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 @@ -278,6 +278,7 @@ int mpt_modevent(module_t, int, void *); maxsize, nsegments, maxsegsz, flags, \ dma_tagp) #endif +#define mpt_dma_tag_derive mpt_dma_tag_create #endif /* MPT_USE_BUSDMA */ struct mpt_map_info { Modified: projects/altix2/sys/dev/mpt/mpt_pci.c ============================================================================== --- projects/altix2/sys/dev/mpt/mpt_pci.c Sun May 6 20:37:02 2012 (r235105) +++ projects/altix2/sys/dev/mpt/mpt_pci.c Sun May 6 20:40:18 2012 (r235106) @@ -775,7 +775,7 @@ mpt_dma_mem_alloc(struct mpt_softc *mpt) } /* Create a child tag for reply buffers */ - if (mpt_dma_tag_create(mpt, mpt->parent_dmat, PAGE_SIZE, 0, + if (mpt_dma_tag_derive(mpt, mpt->parent_dmat, PAGE_SIZE, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, 2 * PAGE_SIZE, 1, BUS_SPACE_MAXSIZE_32BIT, 0, &mpt->reply_dmat) != 0) { Modified: projects/altix2/sys/dev/mpt/mpt_user.c ============================================================================== --- projects/altix2/sys/dev/mpt/mpt_user.c Sun May 6 20:37:02 2012 (r235105) +++ projects/altix2/sys/dev/mpt/mpt_user.c Sun May 6 20:40:18 2012 (r235106) @@ -200,7 +200,7 @@ mpt_alloc_buffer(struct mpt_softc *mpt, /* Limit requests to 16M. */ if (len > 16 * 1024 * 1024) return (ENOSPC); - error = mpt_dma_tag_create(mpt, mpt->parent_dmat, 1, 0, + error = mpt_dma_tag_derive(mpt, mpt->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, len, 1, len, 0, &page_mem->tag); if (error)