OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [drivers/] [isdn/] [hisax/] [arcofi.c] - Blame information for rev 1777

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1626 jcastillo
/* $Id: arcofi.c,v 1.1 2005-12-20 10:17:01 jcastillo Exp $
2
 
3
 * arcofi.c   Ansteuerung ARCOFI 2165
4
 *
5
 * Author     Karsten Keil (keil@temic-ech.spacenet.de)
6
 *
7
 *
8
 *
9
 * $Log: not supported by cvs2svn $
10
 * Revision 1.1.1.1  2001/09/10 07:44:18  simons
11
 * Initial import
12
 *
13
 * Revision 1.1.1.1  2001/07/02 17:58:32  simons
14
 * Initial revision
15
 *
16
 * Revision 1.1.2.5  1998/09/30 22:20:03  keil
17
 * Cosmetics
18
 *
19
 * Revision 1.1.2.4  1998/09/27 13:05:29  keil
20
 * Apply most changes from 2.1.X (HiSax 3.1)
21
 *
22
 * Revision 1.1.2.3  1998/05/27 18:04:48  keil
23
 * HiSax 3.0
24
 *
25
 * Revision 1.1.2.2  1998/04/11 18:45:13  keil
26
 * New interface
27
 *
28
 * Revision 1.1.2.1  1997/11/15 18:57:37  keil
29
 * ARCOFI 2165 support
30
 *
31
 *
32
 */
33
 
34
#define __NO_VERSION__
35
#include "hisax.h"
36
#include "isdnl1.h"
37
#include "isac.h"
38
 
39
int
40
send_arcofi(struct IsdnCardState *cs, const u_char *msg, int bc, int receive) {
41
        u_char val;
42
        long flags;
43
        int cnt=30;
44
 
45
        cs->mon_txp = 0;
46
        cs->mon_txc = msg[0];
47
        memcpy(cs->mon_tx, &msg[1], cs->mon_txc);
48
        switch(bc) {
49
                case 0: break;
50
                case 1: cs->mon_tx[1] |= 0x40;
51
                        break;
52
                default: break;
53
        }
54
        cs->mocr &= 0x0f;
55
        cs->mocr |= 0xa0;
56
        test_and_clear_bit(HW_MON1_TX_END, &cs->HW_Flags);
57
        if (receive)
58
                test_and_clear_bit(HW_MON1_RX_END, &cs->HW_Flags);
59
        cs->writeisac(cs, ISAC_MOCR, cs->mocr);
60
        val = cs->readisac(cs, ISAC_MOSR);
61
        cs->writeisac(cs, ISAC_MOX1, cs->mon_tx[cs->mon_txp++]);
62
        cs->mocr |= 0x10;
63
        cs->writeisac(cs, ISAC_MOCR, cs->mocr);
64
        save_flags(flags);
65
        sti();
66
        while (cnt && !test_bit(HW_MON1_TX_END, &cs->HW_Flags)) {
67
                cnt--;
68
                udelay(500);
69
        }
70
        if (receive) {
71
                while (cnt && !test_bit(HW_MON1_RX_END, &cs->HW_Flags)) {
72
                        cnt--;
73
                        udelay(500);
74
                }
75
        }
76
        restore_flags(flags);
77
        if (cnt <= 0) {
78
                printk(KERN_WARNING"HiSax arcofi monitor timed out\n");
79
                debugl1(cs, "HiSax arcofi monitor timed out");
80
        }
81
        return(cnt);
82
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.