13 #include <linux/sched.h>
19 #define ARCOFI_TIMER_VALUE 20
22 add_arcofi_timer(
struct IsdnCardState *
cs) {
32 send_arcofi(
struct IsdnCardState *
cs) {
34 cs->dc.isac.mon_txp = 0;
35 cs->dc.isac.mon_txc = cs->dc.isac.arcofi_list->len;
36 memcpy(cs->dc.isac.mon_tx, cs->dc.isac.arcofi_list->msg, cs->dc.isac.mon_txc);
37 switch (cs->dc.isac.arcofi_bc) {
39 case 1: cs->dc.isac.mon_tx[1] |= 0x40;
43 cs->dc.isac.mocr &= 0x0f;
44 cs->dc.isac.mocr |= 0xa0;
45 cs->writeisac(cs,
ISAC_MOCR, cs->dc.isac.mocr);
47 cs->writeisac(cs,
ISAC_MOX1, cs->dc.isac.mon_tx[cs->dc.isac.mon_txp++]);
48 cs->dc.isac.mocr |= 0x10;
49 cs->writeisac(cs,
ISAC_MOCR, cs->dc.isac.mocr);
54 if (cs->debug & L1_DEB_MONITOR) {
55 debugl1(cs,
"arcofi state %d event %d", cs->dc.isac.arcofi_state, event);
60 wake_up(&cs->dc.isac.arcofi_wait);
63 switch (cs->dc.isac.arcofi_state) {
66 cs->dc.isac.arcofi_list =
data;
73 if (cs->dc.isac.arcofi_list->receive) {
77 if (cs->dc.isac.arcofi_list->next) {
78 cs->dc.isac.arcofi_list =
79 cs->dc.isac.arcofi_list->next;
86 wake_up(&cs->dc.isac.arcofi_wait);
93 if (cs->dc.isac.arcofi_list->next) {
94 cs->dc.isac.arcofi_list =
95 cs->dc.isac.arcofi_list->next;
103 wake_up(&cs->dc.isac.arcofi_wait);
108 debugl1(cs,
"Arcofi unknown state %x", cs->dc.isac.arcofi_state);
115 arcofi_timer(
struct IsdnCardState *cs) {
128 cs->dc.isac.arcofitimer.function = (
void *) arcofi_timer;
129 cs->dc.isac.arcofitimer.data = (
long) cs;