Erm, don't forget to store the mbuf in the dmamap in bus_dmamap_load_mbuf_sg(),

so that bus_dmamap_sync() knows what to invalidate. This makes em(4) work again.
While I'm there, remove the unused "first" variable.
This commit is contained in:
Olivier Houchard 2005-01-16 13:15:16 +00:00
parent 81cfeee7bf
commit fde8140fde

View File

@ -99,7 +99,7 @@ struct bus_dmamap {
*/
static __inline int
bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dma_segment_t segs[],
bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dma_segment_t *segs,
bus_dmamap_t map, void *buf, bus_size_t buflen, struct pmap *pmap,
int flags, vm_offset_t *lastaddrp, int *segp);
@ -424,7 +424,7 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
* first indicates if this is the first invocation of this function.
*/
static int __inline
bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dma_segment_t segs[],
bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dma_segment_t *segs,
bus_dmamap_t map, void *buf, bus_size_t buflen, struct pmap *pmap,
int flags, vm_offset_t *lastaddrp, int *segp)
{
@ -611,8 +611,10 @@ bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map,
flags |= BUS_DMA_NOWAIT;
*nsegs = -1;
map->flags &= ~DMAMAP_TYPE_MASK;
map->flags |= DMAMAP_MBUF | DMAMAP_COHERENT;
map->buffer = m0;
if (m0->m_pkthdr.len <= dmat->maxsize) {
int first = 1;
vm_offset_t lastaddr = 0;
struct mbuf *m;
@ -622,7 +624,6 @@ bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map,
m->m_data, m->m_len,
pmap_kernel(), flags, &lastaddr,
nsegs);
first = 0;
}
}
} else {