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