2 * Copyright (c) 1995 Andrew McRae. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * 3. The name of the author may not be used to endorse or promote products
13 * derived from this software without specific prior written permission.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 * $FreeBSD: src/usr.sbin/pccard/pccardd/readcis.h,v 1.11.2.2 2000/06/05 14:59:03 iwasaki Exp $
27 * $DragonFly: src/usr.sbin/pccard/pccardd/Attic/readcis.h,v 1.2 2003/06/17 04:29:59 dillon Exp $
38 struct tuple_list *next;
47 unsigned char length; /* 255 means variable length */
51 * Memory device descriptor.
63 * One I/O structure describing a possible I/O map
67 struct cis_ioblk *next;
73 * A structure storing a memory map for the card.
76 struct cis_memblk *next;
79 unsigned int host_address;
83 * One configuration entry for the card.
86 struct cis_config *next;
87 unsigned int pwr:1; /* Which values are defined. */
88 unsigned int timing:1;
89 unsigned int iospace:1;
91 unsigned int memspace:1;
92 unsigned int misc_valid:1;
94 unsigned char io_blks;
95 unsigned char io_addr;
98 unsigned char irqlevel;
99 unsigned char irq_flags;
101 unsigned char memwins;
102 struct cis_memblk *mem;
107 * Structure holding all data retrieved from the
108 * CIS block on the card.
109 * The default configuration contains interface defaults
110 * not listed in each separate configuration.
113 struct tuple_list *tlist;
118 unsigned char maj_v, min_v;
119 unsigned char last_config;
121 unsigned long reg_addr;
122 unsigned char func_id1, func_id2;
123 struct dev_mem attr_mem;
124 struct dev_mem common_mem;
125 struct cis_config *def_config;
126 struct cis_config *conf;
127 unsigned char *lan_nid;
130 #define tpl32(tp) ((*((tp) + 3) << 24) | \
131 (*((tp) + 2) << 16) | \
132 (*((tp) + 1) << 8) | *(tp))
133 #define tpl24(tp) ((*((tp) + 2) << 16) | \
134 (*((tp) + 1) << 8) | *(tp))
135 #define tpl16(tp) ((*((tp) + 1) << 8) | *(tp))
138 void dump(unsigned char *, int);
139 void dumpcis(struct cis *);
140 void freecis(struct cis *);
141 struct cis *readcis(int);
143 char *tuple_name(unsigned char);
144 u_int parse_num(int, u_char *, u_char **, int);