5 * Copyright (C) 1998,1999,2000 R.E.Wolff@BitWizard.nl
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 * Version 1.0 -- July, 1999.
26 #include <linux/config.h>
29 #define RIO_PORTSPERBOARD 128
30 #define RIO_NPORTS (RIO_NBOARDS * RIO_PORTSPERBOARD)
36 #define RIO_MAGIC 0x12345678
52 #define RIO_DEBUG_ALL 0xffffffff
54 #define O_OTHER(tty) \
70 #define I_OTHER(tty) \
78 #endif /* __KERNEL__ */
81 #define RIO_BOARD_INTR_LOCK 1
84 #ifndef RIOCTL_MISC_MINOR
85 /* Allow others to gather this into "major.h" or something like that */
86 #define RIOCTL_MISC_MINOR 169
90 /* Allow us to debug "in the field" without requiring clients to
93 #define rio_spin_lock_irqsave(sem, flags) do { \
94 rio_dprintk (RIO_DEBUG_SPINLOCK, "spinlockirqsave: %p %s:%d\n", \
95 sem, __FILE__, __LINE__);\
96 spin_lock_irqsave(sem, flags);\
99 #define rio_spin_unlock_irqrestore(sem, flags) do { \
100 rio_dprintk (RIO_DEBUG_SPINLOCK, "spinunlockirqrestore: %p %s:%d\n",\
101 sem, __FILE__, __LINE__);\
102 spin_unlock_irqrestore(sem, flags);\
105 #define rio_spin_lock(sem) do { \
106 rio_dprintk (RIO_DEBUG_SPINLOCK, "spinlock: %p %s:%d\n",\
107 sem, __FILE__, __LINE__);\
111 #define rio_spin_unlock(sem) do { \
112 rio_dprintk (RIO_DEBUG_SPINLOCK, "spinunlock: %p %s:%d\n",\
113 sem, __FILE__, __LINE__);\
117 #define rio_spin_lock_irqsave(sem, flags) \
118 spin_lock_irqsave(sem, flags)
120 #define rio_spin_unlock_irqrestore(sem, flags) \
121 spin_unlock_irqrestore(sem, flags)
123 #define rio_spin_lock(sem) \
126 #define rio_spin_unlock(sem) \
133 #ifdef CONFIG_RIO_OLDPCI
134 static inline void *rio_memcpy_toio(void *dummy
, void *dest
, void *source
, int n
)
140 writeb(*src
++, dst
++);
148 static inline void *rio_memcpy_fromio(void *dest
, void *source
, int n
)
154 *dst
++ = readb(src
++);
160 #define rio_memcpy_toio(dummy,dest,source,n) memcpy_toio(dest, source, n)
161 #define rio_memcpy_fromio memcpy_fromio
168 This driver can spew a whole lot of debugging output at you. If you
169 need maximum performance, you should disable the DEBUG define. To
170 aid in debugging in the field, I'm leaving the compile-time debug
171 features enabled, and disable them "runtime". That allows me to
172 instruct people with problems to enable debugging without requiring
177 #define rio_dprintk(f, str...) do { if (rio_debug & f) printk (str);} while (0)
178 #define func_enter() rio_dprintk (RIO_DEBUG_FLOW, "rio: enter %s\n", __FUNCTION__)
179 #define func_exit() rio_dprintk (RIO_DEBUG_FLOW, "rio: exit %s\n", __FUNCTION__)
180 #define func_enter2() rio_dprintk (RIO_DEBUG_FLOW, "rio: enter %s (port %d)\n",__FUNCTION__, port->line)
182 #define rio_dprintk(f, str...) /* nothing */
185 #define func_enter2()