Merge from vendor branch FILE:
[dragonfly.git] / sys / dev / serial / si / sivar.h
1 /*
2  * Device driver for Specialix range (SI/XIO) of serial line multiplexors.
3  *
4  * Copyright (C) 2000, Peter Wemm <peter@netplex.com.au>
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notices, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notices, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY EXPRESS OR IMPLIED
16  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
18  * NO EVENT SHALL THE AUTHORS BE LIABLE.
19  *
20  * $FreeBSD: src/sys/dev/si/sivar.h,v 1.1 2000/01/24 07:24:02 peter Exp $
21  * $DragonFly: src/sys/dev/serial/si/sivar.h,v 1.2 2003/06/17 04:28:29 dillon Exp $
22  */
23
24 int     siattach(device_t dev);
25 void    si_intr(void *);
26
27 extern devclass_t si_devclass;
28
29 /* where the firmware lives; defined in si2_z280.c and si3_t225.c */
30 /* old: si2_z280.c */
31 extern unsigned char si2_z280_download[];
32 extern unsigned short si2_z280_downloadaddr;
33 extern int si2_z280_dsize;
34 /* new: si3_t225.c */
35 extern unsigned char si3_t225_download[];
36 extern unsigned short si3_t225_downloadaddr;
37 extern int si3_t225_dsize;
38 extern unsigned char si3_t225_bootstrap[];
39 extern unsigned short si3_t225_bootloadaddr;
40 extern int si3_t225_bsize;
41
42 struct si_softc {
43         int             sc_type;        /* adapter type */
44         char            *sc_typename;   /* adapter type string */
45
46         struct si_port  *sc_ports;      /* port structures for this card */
47
48         caddr_t         sc_paddr;       /* physical addr of iomem */
49         caddr_t         sc_maddr;       /* kvaddr of iomem */
50         int             sc_nport;       /* # ports on this card */
51         int             sc_irq;         /* copy of attach irq */
52         int             sc_iobase;      /* EISA io port address */
53         struct resource *sc_port_res;
54         struct resource *sc_irq_res;
55         struct resource *sc_mem_res;
56         int             sc_port_rid;
57         int             sc_irq_rid;
58         int             sc_mem_rid;
59         int             sc_memsize;
60 };
61
62 #ifdef SI_DEBUG
63 /*
64  * debugging stuff - manipulated using siconfig(8)
65  */
66
67 void    si_dprintf(struct si_port *pp, int flags, const char *fmt, ...);
68
69 #define DPRINT(x)       si_dprintf x
70
71 #define DBG_ENTRY               0x00000001
72 #define DBG_DRAIN               0x00000002
73 #define DBG_OPEN                0x00000004
74 #define DBG_CLOSE               0x00000008
75 #define DBG_READ                0x00000010
76 #define DBG_WRITE               0x00000020
77 #define DBG_PARAM               0x00000040
78 #define DBG_INTR                0x00000080
79 #define DBG_IOCTL               0x00000100
80 /*                              0x00000200 */
81 #define DBG_SELECT              0x00000400
82 #define DBG_OPTIM               0x00000800
83 #define DBG_START               0x00001000
84 #define DBG_EXIT                0x00002000
85 #define DBG_FAIL                0x00004000
86 #define DBG_STOP                0x00008000
87 #define DBG_AUTOBOOT            0x00010000
88 #define DBG_MODEM               0x00020000
89 #define DBG_DOWNLOAD            0x00040000
90 #define DBG_LSTART              0x00080000
91 #define DBG_POLL                0x00100000
92 #define DBG_ALL                 0xffffffff
93
94 #else
95 #define DPRINT(x)       /* void */
96 #endif
97
98 /* Adapter types */
99 #define SIEMPTY         0
100 #define SIHOST          1
101 #define SIMCA           2
102 #define SIHOST2         3
103 #define SIEISA          4
104 #define SIPCI           5
105 #define SIJETPCI        6
106 #define SIJETISA        7
107
108 #define SI_ISJET(x)     (((x) == SIJETPCI) || ((x) == SIJETISA))