Add bus_dmamap_load_mbuf_sg() to powerpc.
This commit is contained in:
parent
7c9c98e639
commit
5c70871d36
@ -890,6 +890,9 @@ int bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map,
|
||||
struct mbuf *mbuf,
|
||||
bus_dmamap_callback2_t *callback, void *callback_arg,
|
||||
int flags);
|
||||
int bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map,
|
||||
struct mbuf *mbuf, bus_dma_segment_t *segs,
|
||||
int *nsegs, int flags);
|
||||
/*
|
||||
* Like bus_dmamap_load but for uios. Note the use of the
|
||||
* bus_dmamap_callback2_t interface.
|
||||
|
@ -500,6 +500,35 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map, struct mbuf *m0,
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map, struct mbuf *m0,
|
||||
bus_dma_segment_t *segs, int *nsegs, int flags)
|
||||
{
|
||||
int error = 0;
|
||||
|
||||
M_ASSERTPKTHDR(m0);
|
||||
|
||||
if (m0->m_pkthdr.len <= dmat->maxsize) {
|
||||
int first = 1;
|
||||
vm_offset_t lastaddr = 0;
|
||||
struct mbuf *m;
|
||||
|
||||
for (m = m0; m != NULL && error == 0; m = m->m_next) {
|
||||
if (m->m_len > 0) {
|
||||
error = bus_dmamap_load_buffer(dmat,
|
||||
segs, m->m_data, m->m_len, NULL,
|
||||
flags, &lastaddr, nsegs, first);
|
||||
first = 0;
|
||||
}
|
||||
}
|
||||
++*nsegs;
|
||||
} else {
|
||||
error = EINVAL;
|
||||
}
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* Like bus_dmamap_load(), but for uios.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user