Exemplo n.º 1
0
inline void
lapb_dl_release_l2l3(struct layer2 *l2, int f)
{
	if (test_bit(FLG_LAPB, &l2->flag))
		l2down_create(l2, PH_DEACTIVATE_REQ, l2_newid(l2), 0, NULL);
	l2up_create(l2, f, 0, NULL);
}
Exemplo n.º 2
0
static void
l2_restart_multi(struct FsmInst *fi, int event, void *arg)
{
	struct layer2	*l2 = fi->userdata;
	struct sk_buff	*skb = arg;
	int		est = 0;

	send_uframe(l2, skb, UA | get_PollFlag(l2, skb), RSP);

	l2mgr(l2, MDL_ERROR_IND, (void *) 'F');

	if (l2->vs != l2->va) {
		skb_queue_purge(&l2->i_queue);
		est = 1;
	}

	clear_exception(l2);
	l2->vs = 0;
	l2->va = 0;
	l2->vr = 0;
	l2->sow = 0;
	mISDN_FsmChangeState(fi, ST_L2_7);
	stop_t200(l2, 3);
	mISDN_FsmRestartTimer(&l2->t203, l2->T203, EV_L2_T203, NULL, 3);

	if (est)
		l2up_create(l2, DL_ESTABLISH_IND, 0, NULL);
/*		mISDN_queue_data(&l2->inst, l2->inst.id | MSG_BROADCAST,
 *		    MGR_SHORTSTATUS | INDICATION, SSTATUS_L2_ESTABLISHED,
 *		    0, NULL, 0);
 */
	if (skb_queue_len(&l2->i_queue) && cansend(l2))
		mISDN_FsmEvent(fi, EV_L2_ACK_PULL, NULL);
}
Exemplo n.º 3
0
static void
l2_connected(struct FsmInst *fi, int event, void *arg)
{
	layer2_t *l2 = fi->userdata;
	msg_t *msg = arg;
	int pr=-1;

	if (!get_PollFlag(l2, msg)) {
		l2_mdl_error_ua(fi, event, arg);
		return;
	}
	free_msg(msg);
	if (test_and_clear_bit(FLG_PEND_REL, &l2->flag))
		l2_disconnect(fi, event, NULL);
	if (test_and_clear_bit(FLG_L3_INIT, &l2->flag)) {
		pr = DL_ESTABLISH | CONFIRM;
	} else if (l2->vs != l2->va) {
		msg_queue_purge(&l2->i_queue);
		pr = DL_ESTABLISH | INDICATION;
	}
	stop_t200(l2, 5);

	l2->vr = 0;
	l2->vs = 0;
	l2->va = 0;
	l2->sow = 0;
	FsmChangeState(fi, ST_L2_7);
	FsmAddTimer(&l2->t203, l2->T203, EV_L2_T203, NULL, 4);
	if (pr != -1)
		l2up_create(l2, pr, CES(l2), 0, NULL);

	if (msg_queue_len(&l2->i_queue) && cansend(l2))
		FsmEvent(fi, EV_L2_ACK_PULL, NULL);
}
Exemplo n.º 4
0
static void
l2_restart_multi(struct FsmInst *fi, int event, void *arg)
{
	layer2_t *l2 = fi->userdata;
	msg_t *msg = arg;
	int est = 0;

	send_uframe(l2, msg, UA | get_PollFlag(l2, msg), RSP);

	l2mgr(l2, MDL_ERROR | INDICATION, (void *) 'F');

	if (l2->vs != l2->va) {
		msg_queue_purge(&l2->i_queue);
		est = 1;
	}

	clear_exception(l2);
	l2->vs = 0;
	l2->va = 0;
	l2->vr = 0;
	l2->sow = 0;
	FsmChangeState(fi, ST_L2_7);
	stop_t200(l2, 3);
	FsmRestartTimer(&l2->t203, l2->T203, EV_L2_T203, NULL, 3);

	if (est)
		l2up_create(l2, DL_ESTABLISH | INDICATION, CES(l2), 0, NULL);

	if (msg_queue_len(&l2->i_queue) && cansend(l2))
		FsmEvent(fi, EV_L2_ACK_PULL, NULL);
}
Exemplo n.º 5
0
inline void
lapb_dl_release_l2l3(layer2_t *l2, int f)
{
	if (test_bit(FLG_LAPB, &l2->flag))
		l2down_create(l2, PH_DEACTIVATE | REQUEST, 0, 0, NULL);
	l2up_create(l2, DL_RELEASE | f, CES(l2), 0, NULL);
}
Exemplo n.º 6
0
inline void
st5_dl_release_l2l3(struct layer2 *l2)
{
	int pr;

	if (test_and_clear_bit(FLG_PEND_REL, &l2->flag))
		pr = DL_RELEASE_CNF;
	else
		pr = DL_RELEASE_IND;
	l2up_create(l2, pr, 0, NULL);
}
Exemplo n.º 7
0
inline void
st5_dl_release_l2l3(layer2_t *l2)
{
	int pr;

	if (test_and_clear_bit(FLG_PEND_REL, &l2->flag)) {
		pr = DL_RELEASE | CONFIRM;
	} else {
		pr = DL_RELEASE | INDICATION;
	}
	l2up_create(l2, pr, CES(l2), 0, NULL);
}
Exemplo n.º 8
0
static void
l2_connected(struct FsmInst *fi, int event, void *arg)
{
	struct layer2	*l2 = fi->userdata;
	struct sk_buff	*skb = arg;
	int pr = -1;

	if (!get_PollFlag(l2, skb)) {
		l2_mdl_error_ua(fi, event, arg);
		return;
	}
	dev_kfree_skb(skb);
	if (test_and_clear_bit(FLG_PEND_REL, &l2->flag))
		l2_disconnect(fi, event, NULL);
	if (test_and_clear_bit(FLG_L3_INIT, &l2->flag)) {
		pr = DL_ESTABLISH_CNF;
	} else if (l2->vs != l2->va) {
		skb_queue_purge(&l2->i_queue);
		pr = DL_ESTABLISH_IND;
	}
	stop_t200(l2, 5);
	l2->vr = 0;
	l2->vs = 0;
	l2->va = 0;
	l2->sow = 0;
	mISDN_FsmChangeState(fi, ST_L2_7);
	mISDN_FsmAddTimer(&l2->t203, l2->T203, EV_L2_T203, NULL, 4);
	if (pr != -1)
		l2up_create(l2, pr, 0, NULL);

	if (skb_queue_len(&l2->i_queue) && cansend(l2))
		mISDN_FsmEvent(fi, EV_L2_ACK_PULL, NULL);

	if (l2->tm)
		l2_tei(l2, MDL_STATUS_UP_IND, 0);
}