volatile struct mx_desc	*f = NULL;
struct mx_desc		*f = NULL;
static int mx_encap(sc, c, m_head)	struct mx_softc		*sc;	struct mx_chain		*c;	struct mbuf		*m_head;{	int			frag = 0;	volatile struct mx_desc	*f = NULL;	int			total_len;	struct mbuf		*m;	/* 	 * Start packing the mbufs in this chain into	 * the fragment pointers. Stop when we run out 	 * of fragments or hit the end of the mbuf chain.	 */	m = m_head;	total_len = 0;	for (m = m_head, frag = 0; m != NULL; m = m->m_next) {		if (m->m_len != 0) {			if (frag == MX_MAXFRAGS)				break;			total_len += m->m_len;			f = &c->mx_ptr->mx_frag[frag];			f->mx_ctl = MX_TXCTL_TLINK | m->m_len;			if (frag == 0) {				f->mx_status = 0;				f->mx_ctl |= MX_TXCTL_FIRSTFRAG;			} else				f->mx_status = MX_TXSTAT_OWN;			f->mx_next = vtophys(&c->mx_ptr->mx_frag[frag + 1]);			f->mx_data = vtophys(mtod(m, vm_offset_t));			frag++;		}	}	/*	 * Handle special case: we ran out of fragments,	 * but we have more mbufs left in the chain. Copy the	 * data into an mbuf cluster. Note that we don't	 * bother clearing the values in the other fragment	 * pointers/counters; it wouldn't gain us anything,	 * and would waste cycles.	 */	if (m != NULL) {		struct mbuf		*m_new = NULL;		MGETHDR(m_new, M_DONTWAIT, MT_DATA);		if (m_new == NULL) {			return(1);		}		if (m_head->m_pkthdr.len > MHLEN) {			MCLGET(m_new, M_DONTWAIT);			if (!(m_new->m_flags & M_EXT)) {				m_freem(m_new);				return(1);			}		}		m_copydata(m_head, 0, m_head->m_pkthdr.len,						mtod(m_new, caddr_t));		m_new->m_pkthdr.len = m_new->m_len = m_head->m_pkthdr.len;		m_freem(m_head);		m_head = m_new;		f = &c->mx_ptr->mx_frag[0];		f->mx_status = 0;		f->mx_data = vtophys(mtod(m_new, caddr_t));		f->mx_ctl = total_len = m_new->m_len;		f->mx_ctl |= MX_TXCTL_TLINK|MX_TXCTL_FIRSTFRAG;		frag = 1;	}	if (total_len < MX_MIN_FRAMELEN) {		f = &c->mx_ptr->mx_frag[frag];		f->mx_ctl = MX_MIN_FRAMELEN - total_len;		f->mx_data = vtophys(&sc->mx_cdata.mx_pad);		f->mx_ctl |= MX_TXCTL_TLINK;		f->mx_status = MX_TXSTAT_OWN;		frag++;	}	c->mx_mbuf = m_head;	c->mx_lastdesc = frag - 1;	MX_TXCTL(c) |= MX_TXCTL_LASTFRAG;	MX_TXNEXT(c) = vtophys(&c->mx_nextdesc->mx_ptr->mx_frag[0]);	return(0);}