diff -u --recursive old/Makefile Makefile
--- old/Makefile	Tue Nov 14 12:03:10 1995
+++ Makefile	Fri Nov 24 23:47:27 1995
@@ -1,5 +1,5 @@
 VERSION=0.7.0beta
-SUBDIRS=isdn icn teles doc tools
+SUBDIRS=isdn icn teles doc # tools
 # Where to install the mapages
 export MANDEST = /usr/local/man
 # Where to install the modules ($KERNELDIR/modules)
diff -u --recursive old/icn/icn.h icn/icn.h
--- old/icn/icn.h	Sun Oct 29 22:43:21 1995
+++ icn/icn.h	Fri Nov 24 23:53:08 1995
@@ -85,7 +85,9 @@
 #include <linux/wait.h>
 #include <isdnif.h>
 
+#ifdef DEF_VERSION
 char kernel_version[] = UTS_RELEASE;
+#endif
 
 /* some useful macros for debugging */
 #ifdef ICN_DEBUG_PORT
diff -u --recursive old/include/isdn.h include/isdn.h
--- old/include/isdn.h	Sun Nov 12 15:40:20 1995
+++ include/isdn.h	Fri Nov 24 23:52:39 1995
@@ -177,7 +177,9 @@
 
 #include <isdnif.h>
 
+#ifdef DEF_VERSION
 char kernel_version[] = UTS_RELEASE;
+#endif
 
 /* Until now unused */
 #define ISDN_SERVICE_VOICE 1
diff -u --recursive old/include/k_compat.h include/k_compat.h
--- old/include/k_compat.h	Mon Oct 30 01:27:37 1995
+++ include/k_compat.h	Sat Nov 25 00:17:53 1995
@@ -19,3 +19,7 @@
 #define INIT_SKB(s,l,z) {(s)->dev = (z); (s)->len=(l);}
 #define SKB_PROTO(s,d)
 #endif
+
+#if LINUX_VERSION_CODE<KC(1,3,38)
+#define DEF_VERSION
+#endif
diff -u --recursive old/teles/Makefile teles/Makefile
--- old/teles/Makefile	Wed Oct 25 01:11:47 1995
+++ teles/Makefile	Fri Nov 24 23:47:27 1995
@@ -1,4 +1,4 @@
-#MCFLAGS=-m486 -O6 -Wall -D__KERNEL__ -DLINUX -DMODULE
+#MCFLAGS=-I../include -m486 -O6 -Wall -D__KERNEL__ -DLINUX -DMODULE
 #MCFLAGS=-m486 -v -g --save-temps -O6 -Wall -D__KERNEL__ -DLINUX -DMODULE
 CFLAGS=$(MCFLAGS)
 
diff -u --recursive old/teles/callc.c teles/callc.c
--- old/teles/callc.c	Mon Nov 13 09:43:41 1995
+++ teles/callc.c	Fri Nov 24 23:47:27 1995
@@ -1,22 +1,11 @@
-#include <linux/config.h>
-#include <linux/module.h>
-
-#include <asm/segment.h>
-
-#define byte unsigned char
-
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/timer.h>
-#include <linux/sched.h>
-
-#include "isdnif.h"
 #include "teles.h"
 
 extern struct IsdnCard cards[];
 extern int nrcards;
 extern int drid;
 extern isdn_if iif;
+extern void teles_dec_use_count(void);
+extern void teles_inc_use_count(void);
 
 static int  init_ds(int chan,int incoming);
 static void release_ds(int chan); 
@@ -1085,10 +1074,10 @@
     FsmEvent(&chanp->fi,EV_HANGUP,NULL);
     break;
   case(ISDN_CMD_LOCK):
-    MOD_INC_USE_COUNT; 
+    teles_mod_inc_use_count();
     break;
   case(ISDN_CMD_UNLOCK):
-    MOD_DEC_USE_COUNT;
+    teles_mod_dec_use_count();
     break;
   case(ISDN_CMD_IOCTL):
     switch(ic->arg) {
diff -u --recursive old/teles/card.c teles/card.c
--- old/teles/card.c	Mon Nov 13 09:21:07 1995
+++ teles/card.c	Fri Nov 24 23:47:28 1995
@@ -11,45 +11,15 @@
   Beat Doebeli		log all D channel traffic
   
 */  
-  
-#include <linux/config.h>
-#include <linux/version.h>
-#include <linux/module.h>
-
-#include <linux/errno.h>
-#include <linux/fs.h>
-#include <linux/major.h>
-#include <asm/segment.h>
-#include <linux/kernel.h>
-#include <asm/io.h>
-#include <linux/signal.h>
-
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/string.h>
-#include <linux/ptrace.h>
-#include <linux/malloc.h>
-#include <linux/interrupt.h>
-#include <asm/bitops.h>
-#include <asm/segment.h>
 
-#include <linux/time.h>
-#include <linux/types.h>
-#include <linux/unistd.h>
-#include <linux/timer.h>
-#include <linux/ioport.h>
+#include "teles.h"
+
 #define INCLUDE_INLINE_FUNCS
 #include <linux/tqueue.h>
+#include <linux/interrupt.h>
 
 #undef DCHAN_VERBOSE
 
-#define byte unsigned char
-			
-extern int printk( const char* fmt, ...);
-
-#include "isdnif.h"
-#include "teles.h"
-
 extern void tei_handler(struct PStack *st,byte pr,
   struct BufHeader *ibh);
 extern struct IsdnCard cards[];
@@ -118,16 +88,24 @@
 
 static inline void waitforCEC(byte *base,byte hscx)
 {
-  long to=200;
-  while ((readhscx(base,hscx,HSCX_STAR)&0x04)&&(to--)) ; 
+  long to=10;
+
+  while ((readhscx(base,hscx,HSCX_STAR)&0x04)&&to) {
+    udelay(5);
+    to--;
+  }
   if (!to) printk("waitforCEC timeout\n");
 }
 
 static inline void waitforXFW(byte *base,byte hscx)
 {
-  long to=200;
+  long to=10;
   waitforCEC(base,hscx);
-  while ((!(readhscx(base,hscx,HSCX_STAR)&0x40))&&(to--)) ; 
+  
+  while ((!(readhscx(base,hscx,HSCX_STAR)&0x40))&&to) {
+    udelay(5);
+    to--;
+  }   
   if (!to) printk("waitforXFW timeout\n");
 }
 
@@ -165,13 +143,16 @@
   teles_hscxreport(sp,1);    
 }
 
+#if 0
 struct tq_struct *tq_isdn=&tq_last;
 struct tq_struct run_isdn_bh= {
   0,0,(void *)(void *)run_task_queue,&tq_isdn,
 };
+#endif
 
 /* HSCX stuff goes here */
 
+#if 0
 static void hscx_sched_event(struct HscxState *hsp,
   int event)
 {
@@ -180,6 +161,15 @@
   queue_task_irq_off(&run_isdn_bh,&tq_immediate);
   mark_bh(IMMEDIATE_BH);
 }
+#endif
+
+static void hscx_sched_event(struct HscxState *hsp,
+  int event)
+{
+  hsp->event|=1<<event;
+  queue_task_irq_off(&hsp->tqueue,&tq_immediate);
+  mark_bh(IMMEDIATE_BH);
+}
 
 static void hscx_empty_fifo(struct HscxState *hsp,int count)
 {
@@ -192,6 +182,7 @@
   if (hsp->rcvptr+count>BUFFER_SIZE(HSCX_RBUF_ORDER,
     HSCX_RBUF_BPPS)) {
     printk("hscx_empty_fifo: incoming packet too large\n");
+    writehscxCMDR(hsp->membase,hsp->hscx,0x80);
     return;
   }
 
@@ -327,12 +318,22 @@
 
 /* ISAC stuff goes here */
 
+#if 0
 static void isac_sched_event(struct IsdnCardState *sp,
   int event)
 {
   sp->event|=1<<event;
   queue_task_irq_off(&sp->tqueue,&tq_isdn);
   queue_task_irq_off(&run_isdn_bh,&tq_immediate);
+  mark_bh(IMMEDIATE_BH);
+}
+#endif
+
+static void isac_sched_event(struct IsdnCardState *sp,
+  int event)
+{
+  sp->event|=1<<event;
+  queue_task_irq_off(&sp->tqueue,&tq_immediate);
   mark_bh(IMMEDIATE_BH);
 }
 
diff -u --recursive old/teles/fsm.c teles/fsm.c
--- old/teles/fsm.c	Wed Oct 11 16:09:17 1995
+++ teles/fsm.c	Fri Nov 24 23:47:28 1995
@@ -1,15 +1,3 @@
-#include <linux/config.h>
-#include <linux/module.h>
-
-#include <asm/segment.h>
-
-#define byte unsigned char
-
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/timer.h>
-
-#include "isdnif.h"
 #include "teles.h"
 
 void FsmNew(struct Fsm *fsm,
diff -u --recursive old/teles/isdnl2.c teles/isdnl2.c
--- old/teles/isdnl2.c	Mon Nov 13 09:25:35 1995
+++ teles/isdnl2.c	Fri Nov 24 23:47:28 1995
@@ -1,15 +1,3 @@
-#include <linux/config.h>
-#include <linux/module.h>
-
-#include <asm/segment.h>
-
-#define byte unsigned char
-
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/timer.h>
-
-#include "isdnif.h"
 #include "teles.h"
 
 #define TIMER_1 2000
diff -u --recursive old/teles/isdnl3.c teles/isdnl3.c
--- old/teles/isdnl3.c	Mon Oct 30 01:33:09 1995
+++ teles/isdnl3.c	Fri Nov 24 23:47:28 1995
@@ -1,15 +1,3 @@
-#include <linux/config.h>
-#include <linux/module.h>
-
-#include <asm/segment.h>
-
-#define byte unsigned char
-
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/timer.h>
-
-#include "isdnif.h"
 #include "teles.h"
 
 static void i_down(struct PStack *st,
diff -u --recursive old/teles/mod.c teles/mod.c
--- old/teles/mod.c	Wed Oct 25 01:11:52 1995
+++ teles/mod.c	Fri Nov 24 23:54:30 1995
@@ -1,18 +1,10 @@
-#include <linux/mm.h>
-#include <linux/timer.h>
-
-#define byte unsigned char
-#include "isdnif.h"
 #include "teles.h"
-
-#include <linux/config.h>
 #include <linux/module.h>
-#include <linux/version.h>
-#include <linux/fs.h>
 
-static char kernel_version[] = UTS_RELEASE; 
+#ifdef DEF_VERSION
+char kernel_version[]=UTS_RELEASE;
+#endif
 
-extern int printk( const char* fmt, ...);
 extern struct IsdnCard cards[];
 
 int nrcards;
@@ -42,10 +34,19 @@
 {0,0,0},
 };
 
+void teles_mod_dec_use_count(void)
+{
+  MOD_DEC_USE_COUNT;
+}
+
+void teles_mod_inc_use_count(void)
+{
+  MOD_INC_USE_COUNT;
+}
+
 int init_module(void) 
 {
   int i;
-  kernel_version[0] = kernel_version[0];
 
   nrcards = 0;
   for (i=0;i<16;i++) {
diff -u --recursive old/teles/q931.c teles/q931.c
--- old/teles/q931.c	Mon Nov 13 09:33:17 1995
+++ teles/q931.c	Fri Nov 24 23:47:28 1995
@@ -13,18 +13,6 @@
 */
 
 
-#include <linux/config.h>
-#include <linux/module.h>
-
-#include <asm/segment.h>
-
-typedef unsigned char byte;
-
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/timer.h>
-
-#include "isdnif.h"
 #include "teles.h"
 
 byte * findie(byte *p,int size, byte ie, int wanted_set)
diff -u --recursive old/teles/tei.c teles/tei.c
--- old/teles/tei.c	Wed Oct 25 01:14:03 1995
+++ teles/tei.c	Fri Nov 24 23:47:28 1995
@@ -1,16 +1,3 @@
-#include <linux/config.h>
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/timer.h>
-#include <linux/fs.h>
-#include <asm/segment.h>
-
-#define byte unsigned char
-
-#include <linux/kernel.h>
-#include <linux/mm.h>
-
-#include "isdnif.h"
 #include "teles.h"
 
 extern struct IsdnCard cards[];
diff -u --recursive old/teles/teles.h teles/teles.h
--- old/teles/teles.h	Wed Oct 25 01:11:51 1995
+++ teles/teles.h	Fri Nov 24 23:47:28 1995
@@ -1,11 +1,11 @@
 #include <linux/config.h>
-#include <linux/module.h>
 #include <linux/version.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/major.h>
 #include <asm/segment.h>
 #include <asm/io.h>
+#include <linux/delay.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
 #include <linux/malloc.h>
