xref: /freebsd/sys/dev/cardbus/cardbusvar.h (revision fbe9cff1126706cdcbba767a29814b2eb4083625)
1c6793aa8SWarner Losh /*
20db7e66cSJonathan Chen  * Copyright (c) 2000,2001 Jonathan Chen.
30db7e66cSJonathan Chen  * All rights reserved.
4c6793aa8SWarner Losh  *
5c6793aa8SWarner Losh  * Redistribution and use in source and binary forms, with or without
6c6793aa8SWarner Losh  * modification, are permitted provided that the following conditions
7c6793aa8SWarner Losh  * are met:
8c6793aa8SWarner Losh  * 1. Redistributions of source code must retain the above copyright
90db7e66cSJonathan Chen  *    notice, this list of conditions, and the following disclaimer,
100db7e66cSJonathan Chen  *    without modification, immediately at the beginning of the file.
11c6793aa8SWarner Losh  * 2. Redistributions in binary form must reproduce the above copyright
120db7e66cSJonathan Chen  *    notice, this list of conditions and the following disclaimer in
130db7e66cSJonathan Chen  *    the documentation and/or other materials provided with the
140db7e66cSJonathan Chen  *    distribution.
15c6793aa8SWarner Losh  *
160db7e66cSJonathan Chen  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
170db7e66cSJonathan Chen  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
180db7e66cSJonathan Chen  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
190db7e66cSJonathan Chen  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
200db7e66cSJonathan Chen  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
210db7e66cSJonathan Chen  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
220db7e66cSJonathan Chen  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
230db7e66cSJonathan Chen  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
240db7e66cSJonathan Chen  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
250db7e66cSJonathan Chen  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
260db7e66cSJonathan Chen  * SUCH DAMAGE.
27c6793aa8SWarner Losh  *
280db7e66cSJonathan Chen  * $FreeBSD$
29c6793aa8SWarner Losh  */
30c6793aa8SWarner Losh 
310db7e66cSJonathan Chen /*
320db7e66cSJonathan Chen  * Structure definitions for the Cardbus Bus driver
330db7e66cSJonathan Chen  */
340db7e66cSJonathan Chen struct cardbus_devinfo {
357ba175acSWarner Losh 	struct pci_devinfo pci;
3663fa9f4cSJonathan Chen 	u_int8_t        mprefetchable; /* bit mask of prefetchable BARs */
3763fa9f4cSJonathan Chen 	u_int8_t        mbelow1mb; /* bit mask of BARs which require below 1Mb */
3863fa9f4cSJonathan Chen 	u_int8_t        ibelow1mb; /* bit mask of BARs which require below 1Mb */
39c5d5c855SWarner Losh #define        BARBIT(RID) (1<<(((RID)-CARDBUS_BASE0_REG)/4))
40fbe9cff1SWarner Losh 	u_int16_t	mfrid;		/* manufacturer id */
41fbe9cff1SWarner Losh 	u_int16_t	prodid;		/* product id */
42fbe9cff1SWarner Losh 	u_int		funcid;		/* function id */
43fbe9cff1SWarner Losh 	union {
44fbe9cff1SWarner Losh 		struct {
45fbe9cff1SWarner Losh 			u_int		type;		/* UART type */
46fbe9cff1SWarner Losh 		} sio;
47fbe9cff1SWarner Losh 		struct {
48fbe9cff1SWarner Losh 			u_int8_t	nid[6];		/* MAC address */
49fbe9cff1SWarner Losh 			u_int8_t	tech;		/* technology */
50fbe9cff1SWarner Losh 			u_int8_t	contype;	/* connector type */
51fbe9cff1SWarner Losh 			u_int32_t	speed[3];	/* available speeds */
52fbe9cff1SWarner Losh 			u_int8_t	media[4];	/* media types */
53fbe9cff1SWarner Losh 		} lan;
54fbe9cff1SWarner Losh 	} funce;
55fbe9cff1SWarner Losh 	u_int32_t	fepresent;	/* bit mask of funce values present */
56c6793aa8SWarner Losh };
57