Fix warning.
[dragonfly.git] / sys / sys / firmware.h
1 /*
2  * Copyright (c) 2005 The DragonFly Project.  All rights reserved.
3  *
4  * This code is derived from software contributed to The DragonFly Project
5  * by Johannes Hofmann <Hoannes.Hofmann.gmx.de> and
6  * Joerg Sonnenberger <joerg@bec.de.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer. 
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  * 3. Neither the name of The DragonFly Project nor the names of its
17  *    contributors may be used to endorse or promote products derived
18  *    from this software without specific, prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
24  * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25  * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
26  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31  * SUCH DAMAGE.
32  *
33  * $DragonFly: src/sys/sys/firmware.h,v 1.3 2006/10/25 20:56:03 dillon Exp $
34  */
35
36 #ifndef _SYS_FIRMWARE_H_
37 #define _SYS_FIRMWARE_H_
38
39 #ifndef _KERNEL
40 #error "No user-servicable parts inside"
41 #endif
42
43 #ifndef _SYS_TYPES_H_
44 #include <sys/types.h>
45 #endif
46 #ifndef _SYS_QUEUE_H_
47 #include <sys/queue.h>
48 #endif
49 #ifndef _SYS_BUS_H_
50 #include <sys/bus.h>
51 #endif
52 #ifndef _SYS_BUS_DMA_H_
53 #include <sys/bus_dma.h>
54 #endif
55
56 struct fw_image {
57         TAILQ_ENTRY(fw_image) fw_link;
58         int              fw_refcnt;
59         const char      *fw_name;
60         size_t           fw_imglen;
61         c_caddr_t       *fw_image;
62         bus_dma_tag_t    fw_dma_tag;
63         bus_dmamap_t     fw_dma_map;
64         bus_addr_t       fw_dma_addr;
65 }; 
66
67 struct fw_image *firmware_image_load(const char *);
68 void            firmware_image_unload(struct fw_image *);
69
70 #endif