- Test m_pkthdr.fw_flags against DUMMYNET_MBUF_TAGGED before trying to locate
[dragonfly/netmp.git] / sys / sys / firmware.h
blob6a83de0d9748add5065403ba17f5d12eaf96b758
1 /*
2 * Copyright (c) 2005 The DragonFly Project. All rights reserved.
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.
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.
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.
33 * $DragonFly: src/sys/sys/firmware.h,v 1.4 2008/01/10 12:45:10 sephe Exp $
36 #ifndef _SYS_FIRMWARE_H_
37 #define _SYS_FIRMWARE_H_
39 #ifndef _KERNEL
40 #error "No user-servicable parts inside"
41 #endif
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
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 };
67 struct fw_image *firmware_image_load(const char *, bus_dma_tag_t);
68 void firmware_image_unload(struct fw_image *);
70 #endif