-/* $OpenBSD: if_xnf.c,v 1.61 2017/11/08 00:37:18 mikeb Exp $ */
+/* $OpenBSD: if_xnf.c,v 1.62 2017/12/09 14:00:21 mikeb Exp $ */
/*
* Copyright (c) 2015, 2016 Mike Belopuhov
} __packed;
struct xnf_tx_buf {
- uint16_t txb_used;
- uint16_t txb_ndesc;
+ uint32_t txb_ndesc;
bus_dmamap_t txb_dmap;
struct mbuf *txb_mbuf;
};
do {
id = sc->sc_tx_next++ & (XNF_TX_DESC - 1);
txb = &sc->sc_tx_buf[id];
- } while (txb->txb_used);
+ } while (txb->txb_mbuf);
if (bus_dmamap_load(sc->sc_dmat, txb->txb_dmap, m->m_data,
m->m_len, NULL, flags)) {
}
txb->txb_mbuf = m;
- txb->txb_used = 1;
used++;
}
txb->txb_mbuf = NULL;
txb->txb_ndesc = 0;
- txb->txb_used = 0;
}
}
return (ENOBUFS);
m_free(txb->txb_mbuf);
txb->txb_mbuf = NULL;
- txb->txb_used = 0;
done++;
}
continue;
m_free(sc->sc_tx_buf[i].txb_mbuf);
sc->sc_tx_buf[i].txb_mbuf = NULL;
- sc->sc_tx_buf[i].txb_used = 0;
sc->sc_tx_buf[i].txb_ndesc = 0;
}
if (sc->sc_tx_rmap) {