4 * @brief Common part of libinst used in kernel and user space
6 * @author Copyright (C) 2009 CERN CO/HT Julian Lewis
8 * @date Created on 02/02/2009
10 * @section license_sec License
11 * Released under the GPL
13 #ifndef _CONFIG_DATA_H_INCLUDE_
14 #define _CONFIG_DATA_H_INCLUDE_
16 #define InsLibMAX_MODULES 16
17 #define InsLibNAME_SIZE 32
18 #define InsLibCOMMENT_SIZE 128
20 /** @brief Different bus types supported by skeleton and other drivers */
29 /** @brief Endianity */
37 /** @brief Descriptor for installing an ISR */
39 unsigned int IsrFlag
; /**< If 0 then no ISR is required */
42 char Comment
[InsLibCOMMENT_SIZE
];
46 /** @brief Start of a module description linked list
49 * @param ModuleNumber -- Logical Unit Number. aka [L U N]
50 * Must start at '1', zero is illegal.
51 * @param IgnoreErrors -- Tolerate install errors
53 * @param ModuleAddress -- Any module type [PCI/VME/CARR] hardware description.
54 * @param Extra -- user can use it to pass extra params
56 * @param Next -- next module description
57 * @param ModuleName -- DB module name
60 InsLibBusType BusType
;
61 unsigned int ModuleNumber
;
62 unsigned int IgnoreErrors
;
66 char Comment
[InsLibCOMMENT_SIZE
];
68 char ModuleName
[InsLibNAME_SIZE
];
71 /** @brief The bus types PCI/VME/CAR are dealtwith in the driver anonymously
73 * So with these structures a driver can work with any bus type.
78 unsigned int SpaceNumber
;
79 unsigned int WindowSize
;
80 unsigned int DataWidth
;
82 } InsLibAnyAddressSpace
;
87 InsLibAnyAddressSpace
*AnyAddressSpace
;
88 } InsLibAnyModuleAddress
;
91 /** @brief Each PCI address space is a BAR and is mapped to kernel memory
93 * @param Mapped -- Mapped kernel memory pointer or NULL
94 * @param Next -- Next BAR (if any)
95 * @param BaseAddressRegister -- which BAR [0 - 5]
96 * @param WindowSize --
104 unsigned int BaseAddressRegister
;
105 unsigned int WindowSize
;
106 unsigned int DataWidth
;
108 char Comment
[InsLibCOMMENT_SIZE
];
109 } InsLibPciAddressSpace
;
112 /** @brief A basic PCI module hardware address */
114 InsLibPciAddressSpace
*PciAddressSpace
; /**< Points to all the BAR
116 unsigned int BusNumber
;
117 unsigned int SlotNumber
;
118 unsigned int VendorId
;
119 unsigned int DeviceId
;
120 unsigned int SubVendorId
;
121 unsigned int SubDeviceId
;
122 char Comment
[InsLibCOMMENT_SIZE
];
123 } InsLibPciModuleAddress
;
125 /** @brief Each VME address space is a VME base address mapped to kernel
128 * @param Mapped -- Virtual Base Address
129 * @param Next -- next VME addr space (if any)
130 * @param AddressModifier -- SpaceNumber is the VME address modifier
131 * @param WindowSize --
132 * @param DataWidth --
134 * @param BaseAddress -- VME base address
135 * @param FreeModifierFlag --
141 unsigned int AddressModifier
;
142 unsigned int WindowSize
;
143 unsigned int DataWidth
;
145 unsigned int BaseAddress
;
146 unsigned int FreeModifierFlag
;
147 char Comment
[InsLibCOMMENT_SIZE
];
148 } InsLibVmeAddressSpace
;
151 /** @brief The VME module hardware address is just its address spaces */
153 InsLibVmeAddressSpace
*VmeAddressSpace
; /**< */
154 char Comment
[InsLibCOMMENT_SIZE
]; /**< */
155 } InsLibVmeModuleAddress
;
158 /** @brief Carrier boards provide a bus on which piggy back boards ride */
160 void *Mapped
; /**< Points to the piggy backs mapped kernel
162 void *Next
; /**< next carrier addr space (if any) */
163 unsigned int SpaceNumber
; /**< SpaceNumber for carrier boards its just
165 unsigned int DataWidth
;
166 unsigned int WindowSize
;
168 char Comment
[InsLibCOMMENT_SIZE
];
169 } InsLibCarAddressSpace
;
172 /** @brief The hardware address is the carrier board number and position
176 InsLibCarAddressSpace
*CarAddressSpace
;
177 char DriverName
[InsLibNAME_SIZE
];
178 unsigned int MotherboardNumber
;
179 unsigned int SlotNumber
;
180 char Comment
[InsLibCOMMENT_SIZE
];
181 } InsLibCarModuleAddress
;
184 /** @brief A driver resides on a host computer and has a name and a list
188 InsLibModlDesc
*Modules
; /**< all controlled modules of the driver */
189 void *Next
; /**< next driver description */
190 char DrvrName
[InsLibNAME_SIZE
]; /**< driver name */
191 unsigned int DebugFlags
;
192 unsigned int EmulationFlags
;
193 unsigned int ModuleCount
; /**< how many modules driver controls */
194 char Comment
[InsLibCOMMENT_SIZE
]; /**< comment string */
195 int isdg
; /**< if driver was generated by the DriverGen?
198 -1 -- not specified */
201 /** @brief The root node for the host */
203 InsLibDrvrDesc
*Drivers
; /**< drivers list */
204 char HostName
[InsLibNAME_SIZE
];
205 char Comment
[InsLibCOMMENT_SIZE
];
210 #endif /* _CONFIG_DATA_H_INCLUDE_ */