brintos

brintos / linux-shallow public Read only

0
0
Text · 2.4 KiB · c466fd9 Raw
132 lines · c
1/* SPDX-License-Identifier: GPL-2.0-only */2/*3 * Layer 2 defines4 *5 * Copyright 2008  by Karsten Keil <kkeil@novell.com>6 */7 8#include <linux/mISDNif.h>9#include <linux/skbuff.h>10#include "fsm.h"11 12#define MAX_WINDOW	813 14struct manager {15	struct mISDNchannel	ch;16	struct mISDNchannel	bcast;17	u_long			options;18	struct list_head	layer2;19	rwlock_t		lock;20	struct FsmInst		deact;21	struct FsmTimer		datimer;22	struct sk_buff_head	sendq;23	struct mISDNchannel	*up;24	u_int			nextid;25	u_int			lastid;26};27 28struct teimgr {29	int			ri;30	int			rcnt;31	struct FsmInst		tei_m;32	struct FsmTimer		timer;33	int			tval, nval;34	struct layer2		*l2;35	struct manager		*mgr;36};37 38struct laddr {39	u_char	A;40	u_char	B;41};42 43struct layer2 {44	struct list_head	list;45	struct mISDNchannel	ch;46	u_long			flag;47	int			id;48	struct mISDNchannel	*up;49	signed char		sapi;50	signed char		tei;51	struct laddr		addr;52	u_int			maxlen;53	struct teimgr		*tm;54	u_int			vs, va, vr;55	int			rc;56	u_int			window;57	u_int			sow;58	struct FsmInst		l2m;59	struct FsmTimer		t200, t203;60	int			T200, N200, T203;61	u_int			next_id;62	u_int			down_id;63	struct sk_buff		*windowar[MAX_WINDOW];64	struct sk_buff_head	i_queue;65	struct sk_buff_head	ui_queue;66	struct sk_buff_head	down_queue;67	struct sk_buff_head	tmp_queue;68};69 70enum {71	ST_L2_1,72	ST_L2_2,73	ST_L2_3,74	ST_L2_4,75	ST_L2_5,76	ST_L2_6,77	ST_L2_7,78	ST_L2_8,79};80 81#define L2_STATE_COUNT (ST_L2_8 + 1)82 83extern struct layer2	*create_l2(struct mISDNchannel *, u_int,84				   u_long, int, int);85extern int		tei_l2(struct layer2 *, u_int, u_long arg);86 87 88/* from tei.c */89extern int		l2_tei(struct layer2 *, u_int, u_long arg);90extern void		TEIrelease(struct layer2 *);91extern int		TEIInit(u_int *);92extern void		TEIFree(void);93 94#define MAX_L2HEADER_LEN 495 96#define RR	0x0197#define RNR	0x0598#define REJ	0x0999#define SABME	0x6f100#define SABM	0x2f101#define DM	0x0f102#define UI	0x03103#define DISC	0x43104#define UA	0x63105#define FRMR	0x87106#define XID	0xaf107 108#define CMD	0109#define RSP	1110 111#define LC_FLUSH_WAIT 1112 113#define FLG_LAPB	0114#define FLG_LAPD	1115#define FLG_ORIG	2116#define FLG_MOD128	3117#define FLG_PEND_REL	4118#define FLG_L3_INIT	5119#define FLG_T200_RUN	6120#define FLG_ACK_PEND	7121#define FLG_REJEXC	8122#define FLG_OWN_BUSY	9123#define FLG_PEER_BUSY	10124#define FLG_DCHAN_BUSY	11125#define FLG_L1_ACTIV	12126#define FLG_ESTAB_PEND	13127#define FLG_PTP		14128#define FLG_FIXED_TEI	15129#define FLG_L2BLOCK	16130#define FLG_L1_NOTREADY	17131#define FLG_LAPD_NET	18132