sys/netccitt/llc_subr.c
/*
 * In case of a link reset we need to shuffle the frames queued inside the
 * LLC2 window.
 */
In case of a link reset we need to shuffle the frames queued inside the
LLC2 window.
In case of a link reset we need to shuffle the frames queued inside the LLC2 window .
void
llc_resetwindow(struct llc_linkcb *linkp)
{
	register struct mbuf *mptr = (struct mbuf *) 0;
	register struct mbuf *anchor = (struct mbuf *)0;
	register short i;
	if (linkp->llcl_slotsfree != linkp->llcl_window) {
		i = llc_seq2slot(linkp, linkp->llcl_nr_received);
		anchor = mptr = linkp->llcl_output_buffers[i]; 
		for (; i != linkp->llcl_freeslot; 
		     i = llc_seq2slot(linkp, i+1)) {
			if (linkp->llcl_output_buffers[i]) {
				mptr->m_nextpkt = linkp->llcl_output_buffers[i];
				mptr = mptr->m_nextpkt;
			} else panic("LLC2 window broken");
		}
	}
	if (mptr)
		mptr->m_nextpkt = (struct mbuf *) 0;
	if (anchor != (struct mbuf *)0) {
		for (i = 0, mptr = anchor; mptr != (struct mbuf *) 0; i++) {
			linkp->llcl_output_buffers[i] = mptr;
			mptr = mptr->m_nextpkt;
			linkp->llcl_output_buffers[i]->m_nextpkt = (struct mbuf *)0;
		}
		linkp->llcl_freeslot = i;
	} else linkp->llcl_freeslot = 0;
	linkp->llcl_nr_received = 0;
	linkp->llcl_projvs = linkp->llcl_freeslot;
	return;
}
void llc_resetwindow ( struct llc_linkcb * linkp ) { register struct mbuf * mptr = ( struct mbuf * ) 0 ; register struct mbuf * anchor = ( struct mbuf * ) 0 ; register short i ; if ( linkp -> llcl_slotsfree != linkp -> llcl_window ) { i = llc_seq2slot ( linkp , linkp -> llcl_nr_received ) ; anchor = mptr = linkp -> llcl_output_buffers [ i ] ; for ( ; i != linkp -> llcl_freeslot ; i = llc_seq2slot ( linkp , i + 1 ) ) { if ( linkp -> llcl_output_buffers [ i ] ) { mptr -> m_nextpkt = linkp -> llcl_output_buffers [ i ] ; mptr = mptr -> m_nextpkt ; } else panic ( " " ) ; } } if ( mptr ) mptr -> m_nextpkt = ( struct mbuf * ) 0 ; if ( anchor != ( struct mbuf * ) 0 ) { for ( i = 0 , mptr = anchor ; mptr != ( struct mbuf * ) 0 ; i ++ ) { linkp -> llcl_output_buffers [ i ] = mptr ; mptr = mptr -> m_nextpkt ; linkp -> llcl_output_buffers [ i ] -> m_nextpkt = ( struct mbuf * ) 0 ; } linkp -> llcl_freeslot = i ; } else linkp -> llcl_freeslot = 0 ; linkp -> llcl_nr_received = 0 ; linkp -> llcl_projvs = linkp -> llcl_freeslot ; return ; }
In case of a link reset we need to shuffle the frames queued inside the
 LLC2 window.
In case of a link reset we need to shuffle the frames queued inside the LLC2 window .
/* Pick up all queued frames and collect them in a linked mbuf list */ /* clean closure */ /* Now --- plug 'em in again */ /* We're resetting the link, the next frame to be acknowledged is 0 */ /* set distance between LLC2 sequence number and the top of window to 0 */