2 * SPDX-License-Identifier: BSD-4-Clause
5 * Bill Paul <wpaul@windriver.com>. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by Bill Paul.
18 * 4. Neither the name of the author nor the names of any co-contributors
19 * may be used to endorse or promote products derived from this software
20 * without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
26 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
32 * THE POSSIBILITY OF SUCH DAMAGE.
37 #ifndef _RESOURCE_VAR_H_
38 #define _RESOURCE_VAR_H_
40 typedef int cm_resource_type;
50 typedef struct physaddr physaddr;
53 InterfaceTypeUndefined = -1,
73 typedef enum interface_type interface_type;
75 #define CmResourceTypeNull 0 /* ResType_All or ResType_None (0x0000) */
76 #define CmResourceTypePort 1 /* ResType_IO (0x0002) */
77 #define CmResourceTypeInterrupt 2 /* ResType_IRQ (0x0004) */
78 #define CmResourceTypeMemory 3 /* ResType_Mem (0x0001) */
79 #define CmResourceTypeDma 4 /* ResType_DMA (0x0003) */
80 #define CmResourceTypeDeviceSpecific 5 /* ResType_ClassSpecific (0xFFFF) */
81 #define CmResourceTypeBusNumber 6 /* ResType_BusNumber (0x0006) */
82 #define CmResourceTypeMaximum 7
83 #define CmResourceTypeNonArbitrated 128 /* Not arbitrated if 0x80 bit set */
84 #define CmResourceTypeConfigData 128 /* ResType_Reserved (0x8000) */
85 #define CmResourceTypeDevicePrivate 129 /* ResType_DevicePrivate (0x8001) */
86 #define CmResourceTypePcCardConfig 130 /* ResType_PcCardConfig (0x8002) */
88 enum cm_share_disposition {
89 CmResourceShareUndetermined = 0, /* Reserved */
90 CmResourceShareDeviceExclusive,
91 CmResourceShareDriverExclusive,
95 typedef enum cm_share_disposition cm_share_disposition;
97 /* Define the bit masks for Flags when type is CmResourceTypeInterrupt */
99 #define CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE 0
100 #define CM_RESOURCE_INTERRUPT_LATCHED 1
102 /* Define the bit masks for Flags when type is CmResourceTypeMemory */
104 #define CM_RESOURCE_MEMORY_READ_WRITE 0x0000
105 #define CM_RESOURCE_MEMORY_READ_ONLY 0x0001
106 #define CM_RESOURCE_MEMORY_WRITE_ONLY 0x0002
107 #define CM_RESOURCE_MEMORY_PREFETCHABLE 0x0004
109 #define CM_RESOURCE_MEMORY_COMBINEDWRITE 0x0008
110 #define CM_RESOURCE_MEMORY_24 0x0010
111 #define CM_RESOURCE_MEMORY_CACHEABLE 0x0020
113 /* Define the bit masks for Flags when type is CmResourceTypePort */
115 #define CM_RESOURCE_PORT_MEMORY 0x0000
116 #define CM_RESOURCE_PORT_IO 0x0001
117 #define CM_RESOURCE_PORT_10_BIT_DECODE 0x0004
118 #define CM_RESOURCE_PORT_12_BIT_DECODE 0x0008
119 #define CM_RESOURCE_PORT_16_BIT_DECODE 0x0010
120 #define CM_RESOURCE_PORT_POSITIVE_DECODE 0x0020
121 #define CM_RESOURCE_PORT_PASSIVE_DECODE 0x0040
122 #define CM_RESOURCE_PORT_WINDOW_DECODE 0x0080
124 /* Define the bit masks for Flags when type is CmResourceTypeDma */
126 #define CM_RESOURCE_DMA_8 0x0000
127 #define CM_RESOURCE_DMA_16 0x0001
128 #define CM_RESOURCE_DMA_32 0x0002
129 #define CM_RESOURCE_DMA_8_AND_16 0x0004
130 #define CM_RESOURCE_DMA_BUS_MASTER 0x0008
131 #define CM_RESOURCE_DMA_TYPE_A 0x0010
132 #define CM_RESOURCE_DMA_TYPE_B 0x0020
133 #define CM_RESOURCE_DMA_TYPE_F 0x0040
135 struct cm_partial_resource_desc {
137 uint8_t cprd_sharedisp;
150 uint32_t cprd_vector;
151 uint32_t cprd_affinity;
163 uint32_t cprd_data[3];
166 uint32_t cprd_datasize;
170 } u __attribute__((packed));
173 typedef struct cm_partial_resource_desc cm_partial_resource_desc;
175 struct cm_partial_resource_list {
176 uint16_t cprl_version;
177 uint16_t cprl_revision;
179 cm_partial_resource_desc cprl_partial_descs[1];
182 typedef struct cm_partial_resource_list cm_partial_resource_list;
184 struct cm_full_resource_list {
185 interface_type cfrl_type;
186 uint32_t cfrl_busnum;
187 cm_partial_resource_desc cfrl_partiallist;
190 typedef struct cm_full_resource_list cm_full_resource_list;
192 struct cm_resource_list {
194 cm_full_resource_list crl_rlist;
197 typedef struct cm_resource_list cm_resource_list;
199 typedef cm_partial_resource_list ndis_resource_list;
201 #endif /* _RESOURCE_VAR_H_ */