/dev/random was almost always returning 0 bytes. This was due to several
[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.1 2005/03/19 14:54:50 joerg 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 #include <sys/types.h>
44 #include <sys/queue.h>
45 #include <machine/bus.h>
46 #include <machine/bus_dma.h>
47
48 struct fw_image {
49         TAILQ_ENTRY(fw_image) fw_link;
50         int              fw_refcnt;
51         const char      *fw_name;
52         size_t           fw_imglen;
53         c_caddr_t       *fw_image;
54         bus_dma_tag_t    fw_dma_tag;
55         bus_dmamap_t     fw_dma_map;
56         bus_addr_t       fw_dma_addr;
57 }; 
58
59 struct fw_image *firmware_image_load(const char *);
60 void            firmware_image_unload(struct fw_image *);
61
62 #endif