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