patch-2.3.4 linux/drivers/isdn/hisax/arcofi.c

Next file: linux/drivers/isdn/hisax/arcofi.h
Previous file: linux/drivers/isdn/hisax/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.3/linux/drivers/isdn/hisax/arcofi.c linux/drivers/isdn/hisax/arcofi.c
@@ -1,12 +1,28 @@
-/* $Id: arcofi.c,v 1.1 1997/10/29 18:51:20 keil Exp $
+/* $Id: arcofi.c,v 1.6 1998/09/30 22:21:56 keil Exp $
 
- * arcofi.h   Ansteuerung ARCOFI 2165
+ * arcofi.c   Ansteuerung ARCOFI 2165
  *
  * Author     Karsten Keil (keil@temic-ech.spacenet.de)
  *
  *
  *
  * $Log: arcofi.c,v $
+ * Revision 1.6  1998/09/30 22:21:56  keil
+ * cosmetics
+ *
+ * Revision 1.5  1998/09/27 12:52:57  keil
+ * cosmetics
+ *
+ * Revision 1.4  1998/08/20 13:50:24  keil
+ * More support for hybrid modem (not working yet)
+ *
+ * Revision 1.3  1998/05/25 12:57:38  keil
+ * HiSax golden code from certification, Don't use !!!
+ * No leased lines, no X75, but many changes.
+ *
+ * Revision 1.2  1998/04/15 16:47:16  keil
+ * new interface
+ *
  * Revision 1.1  1997/10/29 18:51:20  keil
  * New files
  *
@@ -18,18 +34,25 @@
 #include "isac.h"
 
 int
-send_arcofi(struct IsdnCardState *cs, const u_char *msg) {
+send_arcofi(struct IsdnCardState *cs, const u_char *msg, int bc, int receive) {
 	u_char val;
-	char tmp[32];
 	long flags;
-	int cnt=2;
+	int cnt=30;
 	
 	cs->mon_txp = 0;
 	cs->mon_txc = msg[0];
 	memcpy(cs->mon_tx, &msg[1], cs->mon_txc);
+	switch(bc) {
+		case 0: break;
+		case 1: cs->mon_tx[1] |= 0x40;
+			break;
+		default: break;
+	}
 	cs->mocr &= 0x0f;
 	cs->mocr |= 0xa0;
 	test_and_clear_bit(HW_MON1_TX_END, &cs->HW_Flags);
+	if (receive)
+		test_and_clear_bit(HW_MON1_RX_END, &cs->HW_Flags);
 	cs->writeisac(cs, ISAC_MOCR, cs->mocr);
 	val = cs->readisac(cs, ISAC_MOSR);
 	cs->writeisac(cs, ISAC_MOX1, cs->mon_tx[cs->mon_txp++]);
@@ -39,12 +62,18 @@
 	sti();
 	while (cnt && !test_bit(HW_MON1_TX_END, &cs->HW_Flags)) {
 		cnt--;
-		current->state = TASK_INTERRUPTIBLE;
-		schedule_timeout((10*HZ)/1000);	/* Timeout 10ms */
+		udelay(500);
+	}
+	if (receive) {
+		while (cnt && !test_bit(HW_MON1_RX_END, &cs->HW_Flags)) {
+			cnt--;
+			udelay(500);
+		}
 	}
 	restore_flags(flags);
-	sprintf(tmp, "arcofi tout %d", cnt);
-	debugl1(cs, tmp);
+	if (cnt <= 0) {
+		printk(KERN_WARNING"HiSax arcofi monitor timed out\n");
+		debugl1(cs, "HiSax arcofi monitor timed out");
+	}
 	return(cnt);	
 }
-

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