cardbus_exrom.h revision 1.3 1 1.3 enami /* $NetBSD: cardbus_exrom.h,v 1.3 2004/10/10 21:58:46 enami Exp $ */
2 1.1 joda
3 1.1 joda /*
4 1.1 joda * Copyright (c) 1999 The NetBSD Foundation, Inc.
5 1.1 joda * All rights reserved.
6 1.1 joda *
7 1.1 joda * This code is derived from software contributed to
8 1.1 joda * The NetBSD Foundation by Johan Danielsson.
9 1.1 joda *
10 1.1 joda * Redistribution and use in source and binary forms, with or without
11 1.1 joda * modification, are permitted provided that the following conditions
12 1.1 joda * are met:
13 1.1 joda *
14 1.1 joda * 1. Redistributions of source code must retain the above copyright
15 1.1 joda * notice, this list of conditions and the following disclaimer.
16 1.1 joda *
17 1.1 joda * 2. Redistributions in binary form must reproduce the above copyright
18 1.1 joda * notice, this list of conditions and the following disclaimer in the
19 1.1 joda * documentation and/or other materials provided with the distribution.
20 1.1 joda *
21 1.1 joda * 3. Neither the name of The NetBSD Foundation nor the names of its
22 1.1 joda * contributors may be used to endorse or promote products derived
23 1.1 joda * from this software without specific prior written permission.
24 1.1 joda *
25 1.1 joda * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26 1.1 joda * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27 1.1 joda * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 1.1 joda * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29 1.1 joda * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 1.1 joda * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 1.1 joda * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 1.1 joda * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 1.1 joda * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 1.1 joda * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 1.1 joda * POSSIBILITY OF SUCH DAMAGE.
36 1.1 joda */
37 1.1 joda
38 1.2 kleink #ifndef _DEV_CARDBUS_CARDBUS_EXROM_H_
39 1.2 kleink #define _DEV_CARDBUS_CARDBUS_EXROM_H_
40 1.1 joda
41 1.1 joda /* PCI ROM header fields */
42 1.1 joda #define CARDBUS_EXROM_SIGNATURE 0x00
43 1.1 joda #define CARDBUS_EXROM_DATA_PTR 0x18
44 1.1 joda
45 1.1 joda /* PCI ROM data structure fields */
46 1.1 joda #define CARDBUS_EXROM_DATA_SIGNATURE 0x00 /* Signature ("PCIR") */
47 1.1 joda #define CARDBUS_EXROM_DATA_VENDOR_ID 0x04 /* Vendor Identification */
48 1.1 joda #define CARDBUS_EXROM_DATA_DEVICE_ID 0x06 /* Device Identification */
49 1.1 joda #define CARDBUS_EXROM_DATA_LENGTH 0x0a /* PCI Data Structure Length */
50 1.1 joda #define CARDBUS_EXROM_DATA_REV 0x0c /* PCI Data Structure Revision */
51 1.1 joda #define CARDBUS_EXROM_DATA_CLASS_CODE 0x0d /* Class Code */
52 1.1 joda #define CARDBUS_EXROM_DATA_IMAGE_LENGTH 0x10 /* Image Length */
53 1.1 joda #define CARDBUS_EXROM_DATA_DATA_REV 0x12 /* Revision Level of Code/Data */
54 1.1 joda #define CARDBUS_EXROM_DATA_CODE_TYPE 0x14 /* Code Type */
55 1.1 joda #define CARDBUS_EXROM_DATA_INDICATOR 0x15 /* Indicator */
56 1.1 joda
57 1.1 joda
58 1.1 joda struct cardbus_rom_image {
59 1.3 enami unsigned int rom_image; /* image number */
60 1.3 enami size_t image_size;
61 1.3 enami bus_space_tag_t romt;
62 1.3 enami bus_space_handle_t romh; /* subregion */
63 1.3 enami SIMPLEQ_ENTRY(cardbus_rom_image) next;
64 1.1 joda };
65 1.1 joda
66 1.1 joda SIMPLEQ_HEAD(cardbus_rom_image_head, cardbus_rom_image);
67 1.1 joda
68 1.1 joda int
69 1.3 enami cardbus_read_exrom(bus_space_tag_t, bus_space_handle_t,
70 1.3 enami struct cardbus_rom_image_head *);
71 1.1 joda
72 1.2 kleink #endif /* !_DEV_CARDBUS_CARDBUS_EXROM_H_ */
73