]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - 6/sys/dev/sx/sxvar.h
Clone Kip's Xen on stable/6 tree so that I can work on improving FreeBSD/amd64
[FreeBSD/FreeBSD.git] / 6 / sys / dev / sx / sxvar.h
1 /*-
2  * Device driver for Specialix I/O8+ multiport serial card.
3  *
4  * Copyright 2003 Frank Mayhar <frank@exit.com>
5  *
6  * Derived from the "si" driver by Peter Wemm <peter@netplex.com.au>, using
7  * lots of information from the Linux "specialix" driver by Roger Wolff
8  * <R.E.Wolff@BitWizard.nl> and from the Intel CD1865 "Intelligent Eight-
9  * Channel Communications Controller" datasheet.  Roger was also nice
10  * enough to answer numerous questions about stuff specific to the I/O8+
11  * not covered by the CD1865 datasheet.
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions
15  * are met:
16  * 1. Redistributions of source code must retain the above copyright
17  *    notices, this list of conditions and the following disclaimer.
18  * 2. Redistributions in binary form must reproduce the above copyright
19  *    notices, this list of conditions and the following disclaimer in the
20  *    documentation and/or other materials provided with the distribution.
21  *
22  * THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY EXPRESS OR IMPLIED
23  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
25  * NO EVENT SHALL THE AUTHORS BE LIABLE.
26  *
27  * $FreeBSD$
28  */
29
30
31 int     sxattach(device_t dev);
32 void    sx_intr(void *);
33
34 extern devclass_t sx_devclass;
35
36 struct sx_softc {
37         struct sx_port  *sc_ports;      /* port structures for this card */
38         int             sc_irq;         /* copy of attach irq */
39         struct resource *sc_io_res;
40         struct resource *sc_irq_res;
41         bus_space_tag_t sc_st;
42         bus_space_handle_t sc_sh;
43         int             sc_io_rid;
44         int             sc_irq_rid;
45         int             sc_unit;
46 };
47
48 #ifdef SX_DEBUG
49 /*
50  * debugging stuff
51  */
52 void    sx_dprintf(struct sx_port *pp, int flags, const char *fmt, ...);
53
54 #define DPRINT(x)       sx_dprintf x
55
56 #define DBG_ENTRY       0x00000001
57 #define DBG_DRAIN       0x00000002
58 #define DBG_OPEN        0x00000004
59 #define DBG_CLOSE       0x00000008
60 #define DBG_READ        0x00000010
61 #define DBG_WRITE       0x00000020
62 #define DBG_PARAM       0x00000040
63 #define DBG_INTR        0x00000080
64 #define DBG_IOCTL       0x00000100
65 /*                      0x00000200 */
66 #define DBG_SELECT      0x00000400
67 #define DBG_OPTIM       0x00000800
68 #define DBG_START       0x00001000
69 #define DBG_EXIT        0x00002000
70 #define DBG_FAIL        0x00004000
71 #define DBG_STOP        0x00008000
72 #define DBG_AUTOBOOT    0x00010000
73 #define DBG_MODEM       0x00020000
74 #define DBG_DOWNLOAD    0x00040000
75 /*                      0x00080000*/
76 #define DBG_POLL        0x00100000
77 #define DBG_ALL         0xffffffff
78
79 #else
80
81 #define DPRINT(x)       /* void */
82
83 #endif