1*3bb6c0c9Ssklower /* 2*3bb6c0c9Ssklower * Copyright (c) University of British Columbia, 1984 3*3bb6c0c9Ssklower * Copyright (c) 1990 The Regents of the University of California. 4*3bb6c0c9Ssklower * All rights reserved. 5*3bb6c0c9Ssklower * 6*3bb6c0c9Ssklower * This code is derived from software contributed to Berkeley by 7*3bb6c0c9Ssklower * the Laboratory for Computation Vision and the Computer Science Department 8*3bb6c0c9Ssklower * of the University of British Columbia. 9*3bb6c0c9Ssklower * 10*3bb6c0c9Ssklower * %sccs.include.redist.c% 11*3bb6c0c9Ssklower * 12*3bb6c0c9Ssklower * @(#)hd_var.h 7.2 (Berkeley) 05/11/90 13*3bb6c0c9Ssklower */ 1455ef4af5Ssklower 1555ef4af5Ssklower /* 1655ef4af5Ssklower * 1755ef4af5Ssklower * hdlc control block 1855ef4af5Ssklower * 1955ef4af5Ssklower */ 2055ef4af5Ssklower 2155ef4af5Ssklower struct hdtxq { 2255ef4af5Ssklower struct mbuf *head; 2355ef4af5Ssklower struct mbuf *tail; 2455ef4af5Ssklower }; 2555ef4af5Ssklower 2655ef4af5Ssklower struct hdcb { 2755ef4af5Ssklower struct hdcb *hd_next; /* pointer to next hdlc control block */ 2855ef4af5Ssklower char hd_state; /* link state */ 2955ef4af5Ssklower char hd_vs; /* send state variable */ 3055ef4af5Ssklower char hd_vr; /* receive state variable */ 3155ef4af5Ssklower char hd_lastrxnr; /* last received N(R) */ 3255ef4af5Ssklower char hd_lasttxnr; /* last transmitted N(R) */ 3355ef4af5Ssklower char hd_condition; 3455ef4af5Ssklower #define TIMER_RECOVERY_CONDITION 0x01 3555ef4af5Ssklower #define REJ_CONDITION 0x02 3655ef4af5Ssklower #define REMOTE_RNR_CONDITION 0X04 3755ef4af5Ssklower char hd_retxcnt; 3855ef4af5Ssklower char hd_xx; 3955ef4af5Ssklower struct hdtxq hd_txq; 4055ef4af5Ssklower struct mbuf *hd_retxq[MODULUS]; 4155ef4af5Ssklower char hd_retxqi; 4255ef4af5Ssklower char hd_rrtimer; 4355ef4af5Ssklower char hd_timer; 4455ef4af5Ssklower #define SET_TIMER(hdp) hdp->hd_timer = hd_t1 4555ef4af5Ssklower #define KILL_TIMER(hdp) hdp->hd_timer = 0 4655ef4af5Ssklower char hd_dontcopy; /* if-driver doesn't free I-frames */ 4755ef4af5Ssklower struct ifnet *hd_ifp; /* device's network visible interface */ 4855ef4af5Ssklower struct x25config *hd_xcp; /* copy of &hdp->hd_if->if_addr */ 4955ef4af5Ssklower 5055ef4af5Ssklower /* link statistics */ 5155ef4af5Ssklower 5255ef4af5Ssklower long hd_iframes_in; 5355ef4af5Ssklower long hd_iframes_out; 5455ef4af5Ssklower long hd_rrs_in; 5555ef4af5Ssklower long hd_rrs_out; 5655ef4af5Ssklower short hd_rejs_in; 5755ef4af5Ssklower short hd_rejs_out; 5855ef4af5Ssklower long hd_window_condition; 5955ef4af5Ssklower short hd_invalid_ns; 6055ef4af5Ssklower short hd_invalid_nr; 6155ef4af5Ssklower short hd_timeouts; 6255ef4af5Ssklower short hd_resets; 6355ef4af5Ssklower short hd_unknown; 6455ef4af5Ssklower short hd_frmrs_in; 6555ef4af5Ssklower short hd_frmrs_out; 6655ef4af5Ssklower short hd_rnrs_in; 6755ef4af5Ssklower short hd_rnrs_out; 6855ef4af5Ssklower }; 6955ef4af5Ssklower 7055ef4af5Ssklower #ifdef KERNEL 7155ef4af5Ssklower struct hdcb *hdcbhead; /* head of linked list of hdcb's */ 7255ef4af5Ssklower struct Frmr_frame hd_frmr; /* rejected frame diagnostic info */ 7355ef4af5Ssklower struct ifqueue hdintrq; /* hdlc packet input queue */ 7455ef4af5Ssklower 7555ef4af5Ssklower int hd_t1; /* timer T1 value */ 7655ef4af5Ssklower int hd_t3; /* RR send timer */ 7755ef4af5Ssklower int hd_n2; /* frame retransmission limit */ 7855ef4af5Ssklower #endif 79