Пример #1
0
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 {
;
	}
}
Пример #2
0
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);
	}
}