static void init_modem(struct IsdnCardState *cs) { cs->bcs[0].BC_SetStack = setstack_elsa; cs->bcs[1].BC_SetStack = setstack_elsa; cs->bcs[0].BC_Close = close_elsastate; cs->bcs[1].BC_Close = close_elsastate; if (!(cs->hw.elsa.rcvbuf = kmalloc(MAX_MODEM_BUF, GFP_ATOMIC))) { // printk(KERN_WARNING ; return; } if (!(cs->hw.elsa.transbuf = kmalloc(MAX_MODEM_BUF, GFP_ATOMIC))) { // printk(KERN_WARNING ; kfree(cs->hw.elsa.rcvbuf); cs->hw.elsa.rcvbuf = NULL; return; } if (mstartup(cs)) { ; } modem_set_init(cs); }
static void modem_l2l1(struct PStack *st, int pr, void *arg) { struct BCState *bcs = st->l1.bcs; struct sk_buff *skb = arg; u_long flags; if (pr == (PH_DATA | REQUEST)) { spin_lock_irqsave(&bcs->cs->lock, flags); if (bcs->tx_skb) { skb_queue_tail(&bcs->squeue, skb); } else { bcs->tx_skb = skb; test_and_set_bit(BC_FLG_BUSY, &bcs->Flag); bcs->hw.hscx.count = 0; write_modem(bcs); } spin_unlock_irqrestore(&bcs->cs->lock, flags); } else if (pr == (PH_ACTIVATE | REQUEST)) { test_and_set_bit(BC_FLG_ACTIV, &bcs->Flag); st->l1.l1l2(st, PH_ACTIVATE | CONFIRM, NULL); set_arcofi(bcs->cs, st->l1.bc); mstartup(bcs->cs); modem_set_dial(bcs->cs, test_bit(FLG_ORIG, &st->l2.flag)); bcs->cs->hw.elsa.MFlag=2; } else if (pr == (PH_DEACTIVATE | REQUEST)) { test_and_clear_bit(BC_FLG_ACTIV, &bcs->Flag); bcs->cs->dc.isac.arcofi_bc = st->l1.bc; arcofi_fsm(bcs->cs, ARCOFI_START, &ARCOFI_XOP_0); interruptible_sleep_on(&bcs->cs->dc.isac.arcofi_wait); bcs->cs->hw.elsa.MFlag=1; } else { ; } }
void modem_l2l1(struct PStack *st, int pr, void *arg) { struct sk_buff *skb = arg; unsigned long flags; if (pr == (PH_DATA | REQUEST)) { spin_lock_irqsave(&elsa_ser_lock, flags); if (st->l1.bcs->tx_skb) { skb_queue_tail(&st->l1.bcs->squeue, skb); spin_unlock_irqrestore(&elsa_ser_lock, flags); } else { st->l1.bcs->tx_skb = skb; test_and_set_bit(BC_FLG_BUSY, &st->l1.bcs->Flag); st->l1.bcs->count = 0; spin_unlock_irqrestore(&elsa_ser_lock, flags); write_modem(st->l1.bcs); } } else if (pr == (PH_ACTIVATE | REQUEST)) { test_and_set_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag); L1L2(st, PH_ACTIVATE | CONFIRM, NULL); set_arcofi(st->l1.bcs->cs, st->l1.bc); mstartup(st->l1.bcs->cs); modem_set_dial(st->l1.bcs->cs, test_bit(FLG_ORIG, &st->l2.flag)); st->l1.bcs->cs->hw.elsa.MFlag=2; } else if (pr == (PH_DEACTIVATE | REQUEST)) { test_and_clear_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag); st->l1.bcs->cs->dc.isac.arcofi_bc = st->l1.bc; arcofi_fsm(st->l1.bcs->cs, ARCOFI_START, &ARCOFI_XOP_0); interruptible_sleep_on(&st->l1.bcs->cs->dc.isac.arcofi_wait); st->l1.bcs->cs->hw.elsa.MFlag=1; } else { printk(KERN_WARNING"ElsaSer: unknown pr %x\n", pr); } }
void init_modem(struct IsdnCardState *cs) { cs->bc_l1_ops = &modem_l1_ops; if (!(cs->hw.elsa.rcvbuf = kmalloc(MAX_MODEM_BUF, GFP_ATOMIC))) { printk(KERN_WARNING "Elsa: No modem mem hw.elsa.rcvbuf\n"); return; } if (!(cs->hw.elsa.transbuf = kmalloc(MAX_MODEM_BUF, GFP_ATOMIC))) { printk(KERN_WARNING "Elsa: No modem mem hw.elsa.transbuf\n"); kfree(cs->hw.elsa.rcvbuf); cs->hw.elsa.rcvbuf = NULL; return; } if (mstartup(cs)) { printk(KERN_WARNING "Elsa: problem startup modem\n"); } modem_set_init(cs); }