Changeset View
Changeset View
Standalone View
Standalone View
share/man/man9/bus_dma.9
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||||
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||||
.\" POSSIBILITY OF SUCH DAMAGE. | .\" POSSIBILITY OF SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" $NetBSD: bus_dma.9,v 1.25 2002/10/14 13:43:16 wiz Exp $ | .\" $NetBSD: bus_dma.9,v 1.25 2002/10/14 13:43:16 wiz Exp $ | ||||
.\" | .\" | ||||
.Dd July 17, 2013 | .Dd July 12, 2018 | ||||
.Dt BUS_DMA 9 | .Dt BUS_DMA 9 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm bus_dma , | .Nm bus_dma , | ||||
.Nm bus_dma_tag_create , | .Nm bus_dma_tag_create , | ||||
.Nm bus_dma_tag_destroy , | .Nm bus_dma_tag_destroy , | ||||
.Nm bus_dmamap_create , | .Nm bus_dmamap_create , | ||||
.Nm bus_dmamap_destroy , | .Nm bus_dmamap_destroy , | ||||
▲ Show 20 Lines • Show All 354 Lines • ▼ Show 20 Lines | |||||
May be | May be | ||||
.Dv NULL . | .Dv NULL . | ||||
.It Fa maxsize | .It Fa maxsize | ||||
Maximum size, in bytes, of the sum of all segment lengths in a given | Maximum size, in bytes, of the sum of all segment lengths in a given | ||||
DMA mapping associated with this tag. | DMA mapping associated with this tag. | ||||
.It Fa nsegments | .It Fa nsegments | ||||
Number of discontinuities (scatter/gather segments) allowed | Number of discontinuities (scatter/gather segments) allowed | ||||
in a DMA mapped region. | in a DMA mapped region. | ||||
If there is no restriction, | Even if your device has no restriction on the number of segments, passing a | ||||
.Dv BUS_SPACE_UNRESTRICTED | maximal value is nonsensical. | ||||
jhb: I actually view it is an API bug and would kind of document it as such, something like… | |||||
may be specified. | .Nm | ||||
will allocate | |||||
.Fa nsegments | |||||
worth of segments, even if they will not all be used. | |||||
So users should compute a reasonable number of segments for their DMA region. | |||||
bcrUnsubmitted Not Done Inline ActionsI'd remove the "So" and just start the sentence with "Users should ..." bcr: I'd remove the "So" and just start the sentence with "Users should ..." | |||||
.It Fa maxsegsz | .It Fa maxsegsz | ||||
Maximum size, in bytes, of a segment in any DMA mapped region associated | Maximum size, in bytes, of a segment in any DMA mapped region associated | ||||
with | with | ||||
.Fa dmat . | .Fa dmat . | ||||
.It Fa flags | .It Fa flags | ||||
Are as follows: | Are as follows: | ||||
.Bl -tag -width ".Dv BUS_DMA_ALLOCNOW" | .Bl -tag -width ".Dv BUS_DMA_ALLOCNOW" | ||||
.It Dv BUS_DMA_ALLOCNOW | .It Dv BUS_DMA_ALLOCNOW | ||||
▲ Show 20 Lines • Show All 631 Lines • Show Last 20 Lines |
I actually view it is an API bug and would kind of document it as such, something like:
"BUS_SPACE_UNRESTRICTED cannot be used with nsegments as it is instead interpreted as a very large segment count.
For devices with no restriction on the number of segments should compute a
reasonable number of segments for their DMA region."
OTOH, I would actually like it if we had a non-terrible way to support BUS_SPACE_UNRESTRICTED such as clamping 'nsegments' at some value like 64, I just don't feel confident in picking that number.