2 * @file IxNpeDlImageMgr_p.h
4 * @author Intel Corporation
5 * @date 14 December 2001
7 * @brief This file contains the private API for the ImageMgr module
11 * IXP400 SW Release version 2.0
13 * -- Copyright Notice --
16 * Copyright 2001-2005, Intel Corporation.
17 * All rights reserved.
20 * Redistribution and use in source and binary forms, with or without
21 * modification, are permitted provided that the following conditions
23 * 1. Redistributions of source code must retain the above copyright
24 * notice, this list of conditions and the following disclaimer.
25 * 2. Redistributions in binary form must reproduce the above copyright
26 * notice, this list of conditions and the following disclaimer in the
27 * documentation and/or other materials provided with the distribution.
28 * 3. Neither the name of the Intel Corporation nor the names of its contributors
29 * may be used to endorse or promote products derived from this software
30 * without specific prior written permission.
33 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
34 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
35 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
36 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
37 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
38 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
39 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
40 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
41 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
42 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46 * -- End of Copyright Notice --
50 * @defgroup IxNpeDlImageMgr_p IxNpeDlImageMgr_p
52 * @brief The private API for the IxNpeDl ImageMgr module
57 #ifndef IXNPEDLIMAGEMGR_P_H
58 #define IXNPEDLIMAGEMGR_P_H
62 * Put the user defined include files required.
65 #include "IxOsalTypes.h"
73 * @def IX_NPEDL_IMAGEMGR_SIGNATURE
75 * @brief Signature found as 1st word in a microcode image library
77 #define IX_NPEDL_IMAGEMGR_SIGNATURE 0xDEADBEEF
80 * @def IX_NPEDL_IMAGEMGR_END_OF_HEADER
82 * @brief Marks end of header in a microcode image library
84 #define IX_NPEDL_IMAGEMGR_END_OF_HEADER 0xFFFFFFFF
87 * @def IX_NPEDL_IMAGEID_NPEID_OFFSET
89 * @brief Offset from LSB of NPE ID field in Image ID
91 #define IX_NPEDL_IMAGEID_NPEID_OFFSET 24
94 * @def IX_NPEDL_IMAGEID_DEVICEID_OFFSET
96 * @brief Offset from LSB of Device ID field in Image ID
98 #define IX_NPEDL_IMAGEID_DEVICEID_OFFSET 28
101 * @def IX_NPEDL_IMAGEID_FUNCTIONID_OFFSET
103 * @brief Offset from LSB of Functionality ID field in Image ID
105 #define IX_NPEDL_IMAGEID_FUNCTIONID_OFFSET 16
108 * @def IX_NPEDL_IMAGEID_MAJOR_OFFSET
110 * @brief Offset from LSB of Major revision field in Image ID
112 #define IX_NPEDL_IMAGEID_MAJOR_OFFSET 8
115 * @def IX_NPEDL_IMAGEID_MINOR_OFFSET
117 * @brief Offset from LSB of Minor revision field in Image ID
119 #define IX_NPEDL_IMAGEID_MINOR_OFFSET 0
123 * @def IX_NPEDL_NPEID_FROM_IMAGEID_GET
125 * @brief Macro to extract NPE ID field from Image ID
127 #define IX_NPEDL_NPEID_FROM_IMAGEID_GET(imageId) \
128 (((imageId) >> IX_NPEDL_IMAGEID_NPEID_OFFSET) & \
129 IX_NPEDL_NPEIMAGE_NPEID_MASK)
132 * @def IX_NPEDL_DEVICEID_FROM_IMAGEID_GET
134 * @brief Macro to extract NPE ID field from Image ID
136 #define IX_NPEDL_DEVICEID_FROM_IMAGEID_GET(imageId) \
137 (((imageId) >> IX_NPEDL_IMAGEID_DEVICEID_OFFSET) & \
138 IX_NPEDL_NPEIMAGE_DEVICEID_MASK)
141 * @def IX_NPEDL_FUNCTIONID_FROM_IMAGEID_GET
143 * @brief Macro to extract Functionality ID field from Image ID
145 #define IX_NPEDL_FUNCTIONID_FROM_IMAGEID_GET(imageId) \
146 (((imageId) >> IX_NPEDL_IMAGEID_FUNCTIONID_OFFSET) & \
147 IX_NPEDL_NPEIMAGE_FIELD_MASK)
150 * @def IX_NPEDL_MAJOR_FROM_IMAGEID_GET
152 * @brief Macro to extract Major revision field from Image ID
154 #define IX_NPEDL_MAJOR_FROM_IMAGEID_GET(imageId) \
155 (((imageId) >> IX_NPEDL_IMAGEID_MAJOR_OFFSET) & \
156 IX_NPEDL_NPEIMAGE_FIELD_MASK)
159 * @def IX_NPEDL_MINOR_FROM_IMAGEID_GET
161 * @brief Macro to extract Minor revision field from Image ID
163 #define IX_NPEDL_MINOR_FROM_IMAGEID_GET(imageId) \
164 (((imageId) >> IX_NPEDL_IMAGEID_MINOR_OFFSET) & \
165 IX_NPEDL_NPEIMAGE_FIELD_MASK)
169 * Prototypes for interface functions
173 * @fn IX_STATUS ixNpeDlImageMgrMicrocodeImageLibraryOverride (UINT32 *clientImageLibrary)
175 * @brief This instructs NPE Downloader to use client-supplied microcode image library.
177 * This function sets NPE Downloader to use a client-supplied microcode image library
178 * instead of the standard image library which is included by the NPE Downloader.
180 * @note THIS FUNCTION HAS BEEN DEPRECATED AND SHOULD NOT BE USED.
181 * It will be removed in a future release.
182 * See API header file IxNpeDl.h for more information.
185 * - <i>clientImageLibrary</i> should point to a microcode image library valid for use
186 * by the NPE Downloader component.
189 * - the client-supplied image uibrary will be used for all subsequent operations
190 * performed by the NPE Downloader
193 * - IX_SUCCESS if the operation was successful
194 * - IX_FAIL if the client-supplied image library did not contain a valid signature
197 ixNpeDlImageMgrMicrocodeImageLibraryOverride (UINT32 *clientImageLibrary);
201 * @fn IX_STATUS ixNpeDlImageMgrImageListExtract (IxNpeDlImageId *imageListPtr,
204 * @brief Extracts a list of images available in the NPE microcode image library.
206 * @param IxNpeDlImageId* [out] imageListPtr - pointer to array to contain
207 * a list of images. If NULL,
208 * only the number of images
211 * @param UINT32* [inout] numImages - As input, it points to a variable
212 * containing the number of images which
213 * can be stored in the
214 * <i>imageListPtr</i> array. Its value
215 * is ignored as input if
216 * <i>imageListPtr</i> is NULL. As an
217 * output, it will contain number of
218 * images in the image library.
220 * This function reads the header of the microcode image library and extracts a list of the
221 * images available in the image library. It can also be used to find the number of
222 * images in the image library.
224 * @note THIS FUNCTION HAS BEEN DEPRECATED AND SHOULD NOT BE USED.
225 * It will be removed in a future release.
226 * See API header file IxNpeDl.h for more information.
229 * - if <i>imageListPtr</i> != NULL, <i>numImages</i> should reflect the
230 * number of image Id elements the <i>imageListPtr</i> can contain.
233 * - <i>numImages</i> will reflect the number of image Id's found in the
234 * microcode image library.
237 * - IX_SUCCESS if the operation was successful
238 * - IX_FAIL otherwise
241 ixNpeDlImageMgrImageListExtract (IxNpeDlImageId *imageListPtr,
246 * @fn IX_STATUS ixNpeDlImageMgrImageLocate (IxNpeDlImageId *imageId,
250 * @brief Finds a image block in the NPE microcode image library.
252 * @param IxNpeDlImageId* [in] imageId - the id of the image to locate
253 * @param UINT32** [out] imagePtr - pointer to the image in memory
254 * @param UINT32* [out] imageSize - size (in 32-bit words) of image
256 * This function examines the header of the microcode image library for the location
257 * and size of the specified image.
259 * @note THIS FUNCTION HAS BEEN DEPRECATED AND SHOULD NOT BE USED.
260 * It will be removed in a future release.
261 * See API header file IxNpeDl.h for more information.
268 * - IX_SUCCESS if the operation was successful
269 * - IX_FAIL otherwise
272 ixNpeDlImageMgrImageLocate (IxNpeDlImageId *imageId,
277 * @fn IX_STATUS ixNpeDlImageMgrLatestImageExtract (IxNpeDlImageId *imageId)
279 * @brief Finds the most recent version of an image in the NPE image library.
281 * @param IxNpeDlImageId* [inout] imageId - the id of the image
283 * This function determines the most recent version of a specified image by its
284 * higest major release and minor revision numbers
286 * @note THIS FUNCTION HAS BEEN DEPRECATED AND SHOULD NOT BE USED.
287 * It will be removed in a future release.
288 * See API header file IxNpeDl.h for more information.
295 * - IX_SUCCESS if the operation was successful
296 * - IX_FAIL otherwise
299 ixNpeDlImageMgrLatestImageExtract (IxNpeDlImageId *imageId);
302 * @fn void ixNpeDlImageMgrStatsShow (void)
304 * @brief This function will display the statistics of the IxNpeDl ImageMgr
310 ixNpeDlImageMgrStatsShow (void);
314 * @fn void ixNpeDlImageMgrStatsReset (void)
316 * @brief This function will reset the statistics of the IxNpeDl ImageMgr
322 ixNpeDlImageMgrStatsReset (void);
326 * @fn IX_STATUS ixNpeDlImageMgrImageGet (UINT32 *imageLibrary,
331 * @brief Finds a image block in the NPE microcode image library.
333 * @param UINT32* [in] imageLibrary - the image library to use
334 * @param UINT32 [in] imageId - the id of the image to locate
335 * @param UINT32** [out] imagePtr - pointer to the image in memory
336 * @param UINT32* [out] imageSize - size (in 32-bit words) of image
338 * This function examines the header of the specified microcode image library
339 * for the location and size of the specified image. It returns a pointer to
340 * the image in the <i>imagePtr</i> parameter.
341 * If no image library is specified (imageLibrary == NULL), then the default
342 * built-in image library will be used.
349 * - IX_SUCCESS if the operation was successful
350 * - IX_FAIL otherwise
353 ixNpeDlImageMgrImageFind (UINT32 *imageLibrary,
359 #endif /* IXNPEDLIMAGEMGR_P_H */
362 * @} defgroup IxNpeDlImageMgr_p