diff options
Diffstat (limited to 'drivers/isdn/hisax/arcofi.c')
-rw-r--r-- | drivers/isdn/hisax/arcofi.c | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/drivers/isdn/hisax/arcofi.c b/drivers/isdn/hisax/arcofi.c index 21cbbe1d556..29ec2dfbd15 100644 --- a/drivers/isdn/hisax/arcofi.c +++ b/drivers/isdn/hisax/arcofi.c @@ -9,7 +9,7 @@ * of the GNU General Public License, incorporated herein by reference. * */ - + #include <linux/sched.h> #include "hisax.h" #include "isdnl1.h" @@ -22,9 +22,9 @@ static void add_arcofi_timer(struct IsdnCardState *cs) { if (test_and_set_bit(FLG_ARCOFI_TIMER, &cs->HW_Flags)) { del_timer(&cs->dc.isac.arcofitimer); - } + } init_timer(&cs->dc.isac.arcofitimer); - cs->dc.isac.arcofitimer.expires = jiffies + ((ARCOFI_TIMER_VALUE * HZ)/1000); + cs->dc.isac.arcofitimer.expires = jiffies + ((ARCOFI_TIMER_VALUE * HZ) / 1000); add_timer(&cs->dc.isac.arcofitimer); } @@ -34,11 +34,11 @@ send_arcofi(struct IsdnCardState *cs) { cs->dc.isac.mon_txp = 0; cs->dc.isac.mon_txc = cs->dc.isac.arcofi_list->len; memcpy(cs->dc.isac.mon_tx, cs->dc.isac.arcofi_list->msg, cs->dc.isac.mon_txc); - switch(cs->dc.isac.arcofi_bc) { - case 0: break; - case 1: cs->dc.isac.mon_tx[1] |= 0x40; - break; - default: break; + switch (cs->dc.isac.arcofi_bc) { + case 0: break; + case 1: cs->dc.isac.mon_tx[1] |= 0x40; + break; + default: break; } cs->dc.isac.mocr &= 0x0f; cs->dc.isac.mocr |= 0xa0; @@ -58,42 +58,25 @@ arcofi_fsm(struct IsdnCardState *cs, int event, void *data) { cs->dc.isac.arcofi_state = ARCOFI_NOP; test_and_set_bit(FLG_ARCOFI_ERROR, &cs->HW_Flags); wake_up(&cs->dc.isac.arcofi_wait); - return(1); + return (1); } switch (cs->dc.isac.arcofi_state) { - case ARCOFI_NOP: - if (event == ARCOFI_START) { - cs->dc.isac.arcofi_list = data; - cs->dc.isac.arcofi_state = ARCOFI_TRANSMIT; - send_arcofi(cs); - } - break; - case ARCOFI_TRANSMIT: - if (event == ARCOFI_TX_END) { - if (cs->dc.isac.arcofi_list->receive) { - add_arcofi_timer(cs); - cs->dc.isac.arcofi_state = ARCOFI_RECEIVE; - } else { - if (cs->dc.isac.arcofi_list->next) { - cs->dc.isac.arcofi_list = - cs->dc.isac.arcofi_list->next; - send_arcofi(cs); - } else { - if (test_and_clear_bit(FLG_ARCOFI_TIMER, &cs->HW_Flags)) { - del_timer(&cs->dc.isac.arcofitimer); - } - cs->dc.isac.arcofi_state = ARCOFI_NOP; - wake_up(&cs->dc.isac.arcofi_wait); - } - } - } - break; - case ARCOFI_RECEIVE: - if (event == ARCOFI_RX_END) { + case ARCOFI_NOP: + if (event == ARCOFI_START) { + cs->dc.isac.arcofi_list = data; + cs->dc.isac.arcofi_state = ARCOFI_TRANSMIT; + send_arcofi(cs); + } + break; + case ARCOFI_TRANSMIT: + if (event == ARCOFI_TX_END) { + if (cs->dc.isac.arcofi_list->receive) { + add_arcofi_timer(cs); + cs->dc.isac.arcofi_state = ARCOFI_RECEIVE; + } else { if (cs->dc.isac.arcofi_list->next) { cs->dc.isac.arcofi_list = cs->dc.isac.arcofi_list->next; - cs->dc.isac.arcofi_state = ARCOFI_TRANSMIT; send_arcofi(cs); } else { if (test_and_clear_bit(FLG_ARCOFI_TIMER, &cs->HW_Flags)) { @@ -103,12 +86,29 @@ arcofi_fsm(struct IsdnCardState *cs, int event, void *data) { wake_up(&cs->dc.isac.arcofi_wait); } } - break; - default: - debugl1(cs, "Arcofi unknown state %x", cs->dc.isac.arcofi_state); - return(2); + } + break; + case ARCOFI_RECEIVE: + if (event == ARCOFI_RX_END) { + if (cs->dc.isac.arcofi_list->next) { + cs->dc.isac.arcofi_list = + cs->dc.isac.arcofi_list->next; + cs->dc.isac.arcofi_state = ARCOFI_TRANSMIT; + send_arcofi(cs); + } else { + if (test_and_clear_bit(FLG_ARCOFI_TIMER, &cs->HW_Flags)) { + del_timer(&cs->dc.isac.arcofitimer); + } + cs->dc.isac.arcofi_state = ARCOFI_NOP; + wake_up(&cs->dc.isac.arcofi_wait); + } + } + break; + default: + debugl1(cs, "Arcofi unknown state %x", cs->dc.isac.arcofi_state); + return (2); } - return(0); + return (0); } static void |