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 $
37 struct tuple_list *next;
46 unsigned char length; /* 255 means variable length */
50 * Memory device descriptor.
62 * One I/O structure describing a possible I/O map
66 struct cis_ioblk *next;
72 * A structure storing a memory map for the card.
75 struct cis_memblk *next;
78 unsigned int host_address;
82 * One configuration entry for the card.
85 struct cis_config *next;
86 unsigned int pwr:1; /* Which values are defined. */
87 unsigned int timing:1;
88 unsigned int iospace:1;
90 unsigned int memspace:1;
91 unsigned int misc_valid:1;
93 unsigned char io_blks;
94 unsigned char io_addr;
97 unsigned char irqlevel;
98 unsigned char irq_flags;
100 unsigned char memwins;
101 struct cis_memblk *mem;
106 * Structure holding all data retrieved from the
107 * CIS block on the card.
108 * The default configuration contains interface defaults
109 * not listed in each separate configuration.
112 struct tuple_list *tlist;
117 unsigned char maj_v, min_v;
118 unsigned char last_config;
120 unsigned long reg_addr;
121 unsigned char func_id1, func_id2;
122 struct dev_mem attr_mem;
123 struct dev_mem common_mem;
124 struct cis_config *def_config;
125 struct cis_config *conf;
126 unsigned char *lan_nid;
129 #define tpl32(tp) ((*((tp) + 3) << 24) | \
130 (*((tp) + 2) << 16) | \
131 (*((tp) + 1) << 8) | *(tp))
132 #define tpl24(tp) ((*((tp) + 2) << 16) | \
133 (*((tp) + 1) << 8) | *(tp))
134 #define tpl16(tp) ((*((tp) + 1) << 8) | *(tp))
137 void dump(unsigned char *, int);
138 void dumpcis(struct cis *);
139 void freecis(struct cis *);
140 struct cis *readcis(int);
142 char *tuple_name(unsigned char);
143 u_int parse_num(int, u_char *, u_char **, int);