Example #1
0
static void
l2_release(struct FsmInst *fi, int event, void *arg)
{
	struct layer2 *l2 = fi->userdata;
	struct sk_buff *skb = arg;

	skb_trim(skb, 0);
	l2up(l2, DL_RELEASE_CNF, skb);
}
Example #2
0
static void
l2_release(struct FsmInst *fi, int event, void *arg)
{
	layer2_t *l2 = fi->userdata;
	msg_t *msg = arg;

	msg_trim(msg, mISDNUSER_HEAD_SIZE);
	if (l2up(l2, DL_RELEASE | CONFIRM, CES(l2), msg))
		free_msg(msg);
}
Example #3
0
static void
l2_got_ui(struct FsmInst *fi, int event, void *arg)
{
	layer2_t *l2 = fi->userdata;
	msg_t *msg = arg;

	msg_pull(msg, l2headersize(l2, 1));
/*
 *		in states 1-3 for broadcast
 */
	msg_push(msg, mISDNUSER_HEAD_SIZE);
	if (l2up(l2, DL_UNITDATA | INDICATION, CES(l2), msg))
		free_msg(msg);
}
Example #4
0
static void
l2_got_ui(struct FsmInst *fi, int event, void *arg)
{
	struct layer2 *l2 = fi->userdata;
	struct sk_buff *skb = arg;

	skb_pull(skb, l2headersize(l2, 1));
/*
 *		in states 1-3 for broadcast
 */

	if (l2->tm)
		l2_tei(l2, MDL_STATUS_UI_IND, 0);
	l2up(l2, DL_UNITDATA_IND, skb);
}
Example #5
0
static void
setva(layer2_t *l2, unsigned int nr)
{
	while (l2->va != nr) {
		(l2->va)++;
		if(test_bit(FLG_MOD128, &l2->flag))
			l2->va %= 128;
		else
			l2->va %= 8;
		l2up(l2, DL_DATA | CONFIRM, (int)l2->windowar[l2->sow], NULL);
		free_msg(l2->windowar[l2->sow]);
		l2->windowar[l2->sow] = NULL;
		l2->sow = (l2->sow + 1) % l2->window;
	}
}
Example #6
0
static void
l2_start_multi(struct FsmInst *fi, int event, void *arg)
{
	struct layer2	*l2 = fi->userdata;
	struct sk_buff	*skb = arg;

	l2->vs = 0;
	l2->va = 0;
	l2->vr = 0;
	l2->sow = 0;
	clear_exception(l2);
	send_uframe(l2, NULL, UA | get_PollFlag(l2, skb), RSP);
	mISDN_FsmChangeState(fi, ST_L2_7);
	mISDN_FsmAddTimer(&l2->t203, l2->T203, EV_L2_T203, NULL, 3);
	skb_trim(skb, 0);
	l2up(l2, DL_ESTABLISH_IND, skb);
	if (l2->tm)
		l2_tei(l2, MDL_STATUS_UP_IND, 0);
}
Example #7
0
static void
l2_start_multi(struct FsmInst *fi, int event, void *arg)
{
	layer2_t *l2 = fi->userdata;
	msg_t *msg = arg;

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

	clear_exception(l2);
	l2->vs = 0;
	l2->va = 0;
	l2->vr = 0;
	l2->sow = 0;
	FsmChangeState(fi, ST_L2_7);
	FsmAddTimer(&l2->t203, l2->T203, EV_L2_T203, NULL, 3);
	msg_trim(msg, 0);
	msg_push(msg, mISDNUSER_HEAD_SIZE);
	if (l2up(l2, DL_ESTABLISH | INDICATION, CES(l2), msg))
		free_msg(msg);
}