patch-2.2.17 linux/drivers/char/rio/rio_linux.h

Next file: linux/drivers/char/rio/rioboot.c
Previous file: linux/drivers/char/rio/rio_linux.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.16/drivers/char/rio/rio_linux.h linux/drivers/char/rio/rio_linux.h
@@ -23,11 +23,14 @@
  *  Version 1.0 -- July, 1999. 
  * 
  */
+#include <linux/config.h>
 
 #define RIO_NBOARDS        4
 #define RIO_PORTSPERBOARD 128
 #define RIO_NPORTS        (RIO_NBOARDS * RIO_PORTSPERBOARD)
 
+#define MODEM_SUPPORT
+
 #ifdef __KERNEL__
 
 #define RIO_MAGIC 0x12345678
@@ -84,31 +87,34 @@
 #endif
 
 
+void rio_dec_mod_count (void);
+void rio_inc_mod_count (void);
+
 /* Allow us to debug "in the field" without requiring clients to
    recompile.... */
 #if 1
 #define rio_spin_lock_irqsave(sem, flags) do { \
-	rio_dprint(RIO_DEBUG_SPINLOCK, ("spinlockirqsave: %p %s:%d\n", \
-					sem, __FILE__, __LINE__));\
+	rio_dprintk (RIO_DEBUG_SPINLOCK, "spinlockirqsave: %p %s:%d\n", \
+					sem, __FILE__, __LINE__);\
         spin_lock_irqsave(sem, flags);\
         } while (0)
 
 #define rio_spin_unlock_irqrestore(sem, flags) do { \
-	rio_dprint(RIO_DEBUG_SPINLOCK, ("spinunlockirqrestore: %p %s:%d\n",\
-					sem, __FILE__, __LINE__));\
+	rio_dprintk (RIO_DEBUG_SPINLOCK, "spinunlockirqrestore: %p %s:%d\n",\
+					sem, __FILE__, __LINE__);\
         spin_unlock_irqrestore(sem, flags);\
         } while (0)
 
 
 #define rio_spin_lock(sem) do { \
-	rio_dprint(RIO_DEBUG_SPINLOCK, ("spinlock: %p %s:%d\n",\
-					sem, __FILE__, __LINE__));\
+	rio_dprintk (RIO_DEBUG_SPINLOCK, "spinlock: %p %s:%d\n",\
+					sem, __FILE__, __LINE__);\
         spin_lock(sem);\
         } while (0)
 
 #define rio_spin_unlock(sem) do { \
-	rio_dprint(RIO_DEBUG_SPINLOCK, ("spinunlock: %p %s:%d\n",\
-					sem, __FILE__, __LINE__));\
+	rio_dprintk (RIO_DEBUG_SPINLOCK, "spinunlock: %p %s:%d\n",\
+					sem, __FILE__, __LINE__);\
         spin_unlock(sem);\
         } while (0)
 #else
@@ -157,5 +163,30 @@
 #else
 #define rio_memcpy_toio(dummy,dest,source,n)   memcpy_toio(dest, source, n)
 #define rio_memcpy_fromio                      memcpy_fromio
+#endif
+
+#define DEBUG
+
+
+/* 
+   This driver can spew a whole lot of debugging output at you. If you
+   need maximum performance, you should disable the DEBUG define. To
+   aid in debugging in the field, I'm leaving the compile-time debug
+   features enabled, and disable them "runtime". That allows me to
+   instruct people with problems to enable debugging without requiring
+   them to recompile... 
+*/
+
+#ifdef DEBUG
+#define rio_dprintk(f, str...) do { if (rio_debug & f) printk (str);} while (0)
+#define func_enter() rio_dprintk (RIO_DEBUG_FLOW, "rio: enter " __FUNCTION__ "\n")
+#define func_exit()  rio_dprintk (RIO_DEBUG_FLOW, "rio: exit  " __FUNCTION__ "\n")
+#define func_enter2() rio_dprintk (RIO_DEBUG_FLOW, "rio: enter " __FUNCTION__ \
+                                   "(port %d)\n", port->line)
+#else
+#define rio_dprintk(f, str...) /* nothing */
+#define func_enter()
+#define func_exit()
+#define func_enter2()
 #endif
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)