5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
23 */
24 /*
25 * Copyright 2012 Garrett D'Amore <garrett@damore.org>. All rights reserved.
26 */
27
28 #ifndef _SYS_DDIDMAREQ_H
29 #define _SYS_DDIDMAREQ_H
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 /*
36 * Memory Objects
37 *
38 * Definitions of structures that can describe
39 * an object that can be mapped for DMA.
40 */
41
42 /*
43 * Structure describing a virtual address
44 */
45 struct v_address {
713 * by drivers without having to include a specific SYSDDI implementation
714 * header file.
715 */
716
717 enum ddi_dma_ctlops {
718 DDI_DMA_FREE, /* obsolete - do not use */
719 DDI_DMA_SYNC, /* obsolete - do not use */
720 DDI_DMA_HTOC, /* obsolete - do not use */
721 DDI_DMA_KVADDR, /* obsolete - do not use */
722 DDI_DMA_MOVWIN, /* obsolete - do not use */
723 DDI_DMA_REPWIN, /* obsolete - do not use */
724 DDI_DMA_GETERR, /* obsolete - do not use */
725 DDI_DMA_COFF, /* obsolete - do not use */
726 DDI_DMA_NEXTWIN, /* obsolete - do not use */
727 DDI_DMA_NEXTSEG, /* obsolete - do not use */
728 DDI_DMA_SEGTOC, /* obsolete - do not use */
729 DDI_DMA_RESERVE, /* reserve some DVMA range */
730 DDI_DMA_RELEASE, /* free preallocated DVMA range */
731 DDI_DMA_RESETH, /* obsolete - do not use */
732 DDI_DMA_CKSYNC, /* obsolete - do not use */
733 DDI_DMA_IOPB_ALLOC, /* get contiguous DMA-able memory */
734 DDI_DMA_IOPB_FREE, /* return contiguous DMA-able memory */
735 DDI_DMA_SMEM_ALLOC, /* get contiguous DMA-able memory */
736 DDI_DMA_SMEM_FREE, /* return contiguous DMA-able memory */
737 DDI_DMA_SET_SBUS64, /* 64 bit SBus support */
738 DDI_DMA_REMAP, /* remap DMA buffers after relocation */
739
740 /*
741 * control ops for DMA engine on motherboard
742 */
743 DDI_DMA_E_ACQUIRE, /* get channel for exclusive use */
744 DDI_DMA_E_FREE, /* release channel */
745 DDI_DMA_E_1STPTY, /* setup channel for 1st party DMA */
746 DDI_DMA_E_GETCB, /* get control block for DMA engine */
747 DDI_DMA_E_FREECB, /* free control blk for DMA engine */
748 DDI_DMA_E_PROG, /* program channel of DMA engine */
749 DDI_DMA_E_SWSETUP, /* setup channel for software control */
750 DDI_DMA_E_SWSTART, /* software operation of DMA channel */
751 DDI_DMA_E_ENABLE, /* enable channel of DMA engine */
752 DDI_DMA_E_STOP, /* stop a channel of DMA engine */
753 DDI_DMA_E_DISABLE, /* disable channel of DMA engine */
754 DDI_DMA_E_GETCNT, /* get remaining xfer count */
755 DDI_DMA_E_GETLIM, /* get DMA engine limits */
756 DDI_DMA_E_GETATTR /* get DMA engine attributes */
757 };
758
759 /*
760 * Cache attribute flags:
761 *
762 * IOMEM_DATA_CACHED
763 * The CPU can cache the data it fetches and push it to memory at a later
764 * time. This is the default attribute and used if no cache attributes is
765 * specified.
766 *
767 * IOMEM_DATA_UC_WR_COMBINE
768 * The CPU never caches the data but writes may occur out of order or be
769 * combined. It implies re-ordering.
770 *
771 * IOMEM_DATA_UNCACHED
772 * The CPU never caches the data and has uncacheable access to memory.
773 * It also implies strict ordering.
774 *
775 * The cache attributes are mutually exclusive, and any combination of the
|
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
23 */
24 /*
25 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
26 */
27
28 #ifndef _SYS_DDIDMAREQ_H
29 #define _SYS_DDIDMAREQ_H
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 /*
36 * Memory Objects
37 *
38 * Definitions of structures that can describe
39 * an object that can be mapped for DMA.
40 */
41
42 /*
43 * Structure describing a virtual address
44 */
45 struct v_address {
713 * by drivers without having to include a specific SYSDDI implementation
714 * header file.
715 */
716
717 enum ddi_dma_ctlops {
718 DDI_DMA_FREE, /* obsolete - do not use */
719 DDI_DMA_SYNC, /* obsolete - do not use */
720 DDI_DMA_HTOC, /* obsolete - do not use */
721 DDI_DMA_KVADDR, /* obsolete - do not use */
722 DDI_DMA_MOVWIN, /* obsolete - do not use */
723 DDI_DMA_REPWIN, /* obsolete - do not use */
724 DDI_DMA_GETERR, /* obsolete - do not use */
725 DDI_DMA_COFF, /* obsolete - do not use */
726 DDI_DMA_NEXTWIN, /* obsolete - do not use */
727 DDI_DMA_NEXTSEG, /* obsolete - do not use */
728 DDI_DMA_SEGTOC, /* obsolete - do not use */
729 DDI_DMA_RESERVE, /* reserve some DVMA range */
730 DDI_DMA_RELEASE, /* free preallocated DVMA range */
731 DDI_DMA_RESETH, /* obsolete - do not use */
732 DDI_DMA_CKSYNC, /* obsolete - do not use */
733 DDI_DMA_IOPB_ALLOC, /* obsolete - do not use */
734 DDI_DMA_IOPB_FREE, /* obsolete - do not use */
735 DDI_DMA_SMEM_ALLOC, /* obsolete - do not use */
736 DDI_DMA_SMEM_FREE, /* obsolete - do not use */
737 DDI_DMA_SET_SBUS64, /* 64 bit SBus support */
738 DDI_DMA_REMAP, /* remap DVMA buffers after relocation */
739
740 /*
741 * control ops for DMA engine on motherboard
742 */
743 DDI_DMA_E_ACQUIRE, /* get channel for exclusive use */
744 DDI_DMA_E_FREE, /* release channel */
745 DDI_DMA_E_1STPTY, /* setup channel for 1st party DMA */
746 DDI_DMA_E_GETCB, /* get control block for DMA engine */
747 DDI_DMA_E_FREECB, /* free control blk for DMA engine */
748 DDI_DMA_E_PROG, /* program channel of DMA engine */
749 DDI_DMA_E_SWSETUP, /* setup channel for software control */
750 DDI_DMA_E_SWSTART, /* software operation of DMA channel */
751 DDI_DMA_E_ENABLE, /* enable channel of DMA engine */
752 DDI_DMA_E_STOP, /* stop a channel of DMA engine */
753 DDI_DMA_E_DISABLE, /* disable channel of DMA engine */
754 DDI_DMA_E_GETCNT, /* get remaining xfer count */
755 DDI_DMA_E_GETLIM, /* obsolete - do not use */
756 DDI_DMA_E_GETATTR /* get DMA engine attributes */
757 };
758
759 /*
760 * Cache attribute flags:
761 *
762 * IOMEM_DATA_CACHED
763 * The CPU can cache the data it fetches and push it to memory at a later
764 * time. This is the default attribute and used if no cache attributes is
765 * specified.
766 *
767 * IOMEM_DATA_UC_WR_COMBINE
768 * The CPU never caches the data but writes may occur out of order or be
769 * combined. It implies re-ordering.
770 *
771 * IOMEM_DATA_UNCACHED
772 * The CPU never caches the data and has uncacheable access to memory.
773 * It also implies strict ordering.
774 *
775 * The cache attributes are mutually exclusive, and any combination of the
|