1 /* 2 * Copyright (c) University of British Columbia, 1984 3 * Copyright (c) 1990 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * the Laboratory for Computation Vision and the Computer Science Department 8 * of the University of British Columbia. 9 * 10 * %sccs.include.redist.c% 11 * 12 * @(#)hd_var.h 7.2 (Berkeley) 05/11/90 13 */ 14 15 /* 16 * 17 * hdlc control block 18 * 19 */ 20 21 struct hdtxq { 22 struct mbuf *head; 23 struct mbuf *tail; 24 }; 25 26 struct hdcb { 27 struct hdcb *hd_next; /* pointer to next hdlc control block */ 28 char hd_state; /* link state */ 29 char hd_vs; /* send state variable */ 30 char hd_vr; /* receive state variable */ 31 char hd_lastrxnr; /* last received N(R) */ 32 char hd_lasttxnr; /* last transmitted N(R) */ 33 char hd_condition; 34 #define TIMER_RECOVERY_CONDITION 0x01 35 #define REJ_CONDITION 0x02 36 #define REMOTE_RNR_CONDITION 0X04 37 char hd_retxcnt; 38 char hd_xx; 39 struct hdtxq hd_txq; 40 struct mbuf *hd_retxq[MODULUS]; 41 char hd_retxqi; 42 char hd_rrtimer; 43 char hd_timer; 44 #define SET_TIMER(hdp) hdp->hd_timer = hd_t1 45 #define KILL_TIMER(hdp) hdp->hd_timer = 0 46 char hd_dontcopy; /* if-driver doesn't free I-frames */ 47 struct ifnet *hd_ifp; /* device's network visible interface */ 48 struct x25config *hd_xcp; /* copy of &hdp->hd_if->if_addr */ 49 50 /* link statistics */ 51 52 long hd_iframes_in; 53 long hd_iframes_out; 54 long hd_rrs_in; 55 long hd_rrs_out; 56 short hd_rejs_in; 57 short hd_rejs_out; 58 long hd_window_condition; 59 short hd_invalid_ns; 60 short hd_invalid_nr; 61 short hd_timeouts; 62 short hd_resets; 63 short hd_unknown; 64 short hd_frmrs_in; 65 short hd_frmrs_out; 66 short hd_rnrs_in; 67 short hd_rnrs_out; 68 }; 69 70 #ifdef KERNEL 71 struct hdcb *hdcbhead; /* head of linked list of hdcb's */ 72 struct Frmr_frame hd_frmr; /* rejected frame diagnostic info */ 73 struct ifqueue hdintrq; /* hdlc packet input queue */ 74 75 int hd_t1; /* timer T1 value */ 76 int hd_t3; /* RR send timer */ 77 int hd_n2; /* frame retransmission limit */ 78 #endif 79