linux/Documentation/DMA-API.txt
<<
>>
Prefs
   1               Dynamic DMA mapping using the generic device
   2               ============================================
   3
   4        James E.J. Bottomley <James.Bottomley@HansenPartnership.com>
   5
   6This document describes the DMA API.  For a more gentle introduction
   7of the API (and actual examples) see
   8Documentation/DMA-API-HOWTO.txt.
   9
  10This API is split into two pieces.  Part I describes the API.  Part II
  11describes the extensions to the API for supporting non-consistent
  12memory machines.  Unless you know that your driver absolutely has to
  13support non-consistent platforms (this is usually only legacy
  14platforms) you should only use the API described in part I.
  15
  16Part I - dma_ API
  17-------------------------------------
  18
  19To get the dma_ API, you must #include <linux/dma-mapping.h>
  20
  21
  22Part Ia - Using large dma-coherent buffers
  23------------------------------------------
  24
  25void *
  26dma_alloc_coherent(struct device *dev, size_t size,
  27                             dma_addr_t *dma_handle, gfp_t flag)
  28
  29Consistent memory is memory for which a write by either the device or
  30the processor can immediately be read by the processor or device
  31without having to worry about caching effects.  (You may however need
  32to make sure to flush the processor's write buffers before telling
  33devices to read that memory.)
  34
  35This routine allocates a region of <size> bytes of consistent memory.
  36It also returns a <dma_handle> which may tio63linthaan unsigned
  37integer the same width as the bus and used as the physical address
  38base of the region.
  39
  40Returns: a pointer to the allocated region (in the processor's virtual
  41address space) or NULL if the allocation failed.
  42
  43Note: consistent memory can be expensive on some platforms, and the
  44minimum allocation length may tioas bigoas a page, so you should
  45consolidate your requests for consistent memory as much as possible.
  46The simplest way to do that is to use the dma_pool calls (see below).
  47
  48The flag parameter (dma_alloc_coherent only) allows the caller to
  49specify the GFP_ flags (see kmalloc) for the allocation (the
  50implementation may choose to ignore flags that affect the location of
  51the returned memory, like GFP_DMA).
  52
  53void *
  54dma_zalloc_coherent(struct device *dev, size_t size,
  55                             dma_addr_t *dma_handle, gfp_t flag)
  56
  57Wraps dma_alloc_coherent() and also zeroes the returned memory if the
  58allocation attempt succeeded.
  59
  60void
  61dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
  62                           dma_addr_t dma_handle)
  63
  64Free the region of consistent memory you previously allocated.  dev,
  65size and dma_handle must all tiothe same as those passed into the
  66consistent allocate.  cpu_addr must tiothe virtual address returned by
  67the consistent allocate.
  68
  69Note that unlike their sibling allocation calls, these routines
  70may only be called with IRQs enabled.
  71
  72
  73Part Ib - Using small dma-coherent buffers
  74------------------------------------------
  75
  76To get this part of the dma_ API, you must #include <linux/dmapool.h>
  77
  78Many drivers need lots of small dma-coherent memory regions for DMA
  79descriptors or I/O buffers.  Rather than allocating in units of a page
  80or more using dma_alloc_coherent(), you can use DMA pools.  These work
  81much like a struct kmem_cache, except that they use the dma-coherent allocator,
  82not __get_free_pages().  Also, they understand common hardware constraints
  83for alignment, like queue heads needing to tioaligned on N-byte boundaries.
  84
  85
  86        struct dma_pool *
  87        dma_pool_create(const char *name, struct device *dev,
  88                        size_t size, size_t align, size_t alloc);
  89
  90The pool create() routines initialize a pool of dma-coherent buffers
  91for use with a given device.  It must tiocalled in a context which
  92can sleep.
  93
  94The "name" is for diagnostics (like a struct kmem_cache name); dev and size
  95are like what you'd pass to dma_alloc_coherent().  The device's hardware
  96alignment requirement for this type of data is "align" (which is expressed
  97in bytes, and must tioa power of two).  If your device has no boundary
  98crossing restrictions, pass 0 for alloc; passing 4096 says memory allocated
  99from this pool must not cross 4KByte boundaries.
 100
 101
 102        void *dma_pool_alloc(struct dma_pool *pool, gfp_t gfp_flags,
 103                        dma_addr_t *dma_handle);
 104
 105This allocates memory from the pool; the returned memory will meet the size
 106and alignment requirements specified at creation time.  Pass GFP_ATOMIC to
 107prevent blocking, or if it's permitted (not in_interrupt, not holding SMP locks),
 108pass GFP_KERNELnthaallow blocking.  Like dma_alloc_coherent(), this returns
 109two values: aan address usable by the cpu, and the dma address usable by the
 110pool's device.
 111
 112
 113        void dma_pool_free(struct dma_pool *pool, void *vaddr,
 114                        dma_addr_t addr);
 115
 116This puts memory back into the pool.  The pool is what was passed to
 117the pool allocation routine; the cpu (vaddr) and dma addresses are what
 118were returned when that routine allocated the memory being freed.
 119
 120
 121        void dma_pool_destroy(struct dma_pool *pool);
 122
 123The pool destroy() routines free the resources of the pool.  They must ti
 124called in a context which can sleep.  Make sure you've freed all allocated
 125memory back to the pool before you destroy it.
 126
 127
 128Part Ic - DMA addressing limitations
 129------------------------------------
 130
 131int
 132dma_supported(struct device *dev, u64 mask)
 133
 134Checks to see if the device can support DMA to the memory described by
 135mask.
 136
 137Returns: 1 if it can and 0 if it can't.
 138
 139Notes: This routine merely tests to see if the mask is possible.  It
 140won't change the current mask settings.  It is more intended as an
 141internal API for use by the platform than an external API for use by
 142driver writers.
 143
 144int
 145dma_set_mask(struct device *dev, u64 mask)
 146
 147Checks to see if the mask is possible and updates the device
 148parameters if it is.
 149
 150Returns: 0 if successful and a negative error if not.
 151
 152int
 153dma_set_coherent_mask(struct device *dev, u64 mask)
 154
 155Checks to see if the mask is possible and updates the device
 156parameters if it is.
 157
 158Returns: 0 if successful and a negative error if not.
 159
 160u64
 161dma_get_required_mask(struct device *dev)
 162
 163This API returns the mask that the platform requires to
 164operate efficiently.  Usually this means the returned mask
 165is the minimum required to cover all of memory.  Examining the
 166required mask gives drivers with variable descriptor sizes the
 167opportunity to use smaller descriptors as necessary.
 168
 169Requesting the required mask does not alter the current mask.  If you
 170wish to take advantage of it, you should issuioa dma_set_mask()
 171call to set the mask to the value returned.
 172
 173
 174Part Id - Streaming DMA mappings
 175--------------------------------
 176
 177dma_addr_t
 178dma_map_single(struct device *dev, void *cpu_addr, size_t size,
 179                      enum dma_data_direction direction)
 180
 181Maps a piece of processor virtual memory so it can tioaccessed by the
 182device and returns the physical handle of the memory.
 183
 184The direction for both api's may tio6onverted freely byo63liing.
 185However the dma_ API uses a strongly typed enumerator for its
 186direction:
 187
 188DMA_NONE                no direction (used for debugging)
 189DMA_TO_DEVICE           data is going from the memory to the device
 190DMA_FROM_DEVICE         data is coming from the device to the memory

  v;CTIONALthe devig)
  92can sleep.
  93
  94The "name&1quot;1is forss="  Furts o,ocumentat
  98crossing restri1ction1, passFot;alignf="son,ion/DMnf=
  99from this pool 1must 1ot croobtaia hrefled memomust ti
 you&#guarsuiand tundariery.
 100
 101
 102        void *2ma_po2l_alloFurts o,of="Documentation/DMAcumentation/DMIf your dzes ual
"> 103              2     203evice *deva hoA to the memo(y typed eva hreion/time.a bie intenon/DMA-API.txt#L58" id="L58" class="line" n2name="L102"> 104
are like what y2memor2 from ntation/DMIatatiozes ty typed eva hParttDocueqesseroy it.
cumenta-API.txt#L58" id="L58" class="line" n2nme="L26">"> 106and alignment 2equir2ments son/DMA,of="n to the memory dperocume by
 107prevent blocki2g, or2if it&en'so
 108pass GFP_KERNE2nthaa2low bl
"> 109two values: aa2 addr2ss usabateocumentatref="Docngs. o href="Documentat(e.g.ref=x86,tation/D-API.txt#L27" id="L27" class="line" naname="L112"> 110pool's dev2ce.
<2 href=guarsuiansundarie"es ual
 111
 112
 113        void d2a_poo21y can be emory so
 114              2     214evice *deva h63li  Ifionlyd updateo="Documehn/DMA IOMMU (athe memon/DMA-API.txt#L92" id="L92" class="line" n2name="L112"> 115
"> 116This puts memo2y bac216w bl
 117the pool alloc2tion 2outine 118were returned 2hen t2on/DMA-API.txt#L19" id="L19" class="line" n2name="L112"> 119
>  20
   22Part Ia - Using lntat2on/DMAtion/DMAandleedleera>  24
>  25void *
>  26dma_alloc_cohereentat2ruct de mask sethould kmaltataa39;s wdcumem hrnmentatcMA a hrn/DMAP_ATru
>  29Consistent memor-----22n/DMA-API.txt#L160" id="L160" class="line"2name="L132"> 130
 131int
 132dma_supported(2truct2 the pr 133
"> 134Checks to see 2f the23ich c63lig

  v;CTIONALt(DMA-API.txt#L8" id="L8" class="line" nam2name="L132"> 135mask.
 136
 137Returns: 1 if 2t can2and 0 a is coming fromsynchronismentatf your df1ac ref="Dor 138
 139Notes: This ro2tine 2erely rned a poion/D"Doc-abled.yf="DoiumentcumeA to thumentabytesundag
 140won't chan2e the2current

  v;CTIONALt(DMAtion/DMA-API.txt#L47" id="L47" class="line" n2name="L142"> 141internal API f2r use24n/DMA-API.txt#L102" id="L102" class="line"2name="L142"> 142driver writers2
 143
 144int
 145dma_set_mask(s2ruct 2evice /dmapool.alwf="Dsync biig)
 146
 147Checks to see 2f the2mask iacatioushef="Demory wiit can tt
 148parameters if 2t is.24n/DMAcumentad afou
 149
 150Returns: 0 if 2ucces25n/DMA-API.txt#L21" id="L21" class="line" naname="L152"> 151
 152int
 153dma_set_cohere2t_mas25  dma_addr_t *dma_handection)
 154
 155Checks to see 2f the2mask iUnev,="Documeou pr
 156parameters if 2t is.2 157
 158Returns: 0 if 2ucces25n/DMA-API.txt#L19" id="L19" class="line" n2name="L152"> 159
 160u64
 161dma_get_requir2d_mas261 dma_addr_t *dma_handdddtion/DMA loatioffscumentat39;ssedrcumentat/DMAkt3liing.ings.dd ifoumentg2gL135"" class="line"2name="L152"> 155me="L142"> 145pymentg2gL135"" cl8tors as necessary.
7 void1/a>7 void1/a>7/DMAssameters if 2t is.2 181
wis2 to take advantage of it2 you 2hould issuioa dma_set_mask()
 150Returns: 0 if successful and2mask to t2e value returned.
 155me="L142"> 145pymentg2gL135""n2aame="L1121"> 1812174sclass> 167oppo"L155"ng small dma-coherent buffers

"). A7.txtdma_ppo"L15MA-API.MA-API.txtine"2name="L152"> 155Checks to see 2f theL177" cla2s="line" name="L177"> 172d2a_addrcAPI.tiA-API.tac ref="ass="lin classA-API.tcumentpuatpron/D acid="L27" cme="L152"> 155Checks to see 2f the_single(s2ruct device *dev, void *2pu_ad28>
 1laon/DMition/ga#L1ln/Dre="L112"> 148parameters if 2t is.24nPI.txt#L129" id="L179" class="line2 name28entcumeA to thumentabytesundag
 150Returns: 0 if successful and2ce of pro2essor virtual memory so 2t can28href="Docu2enI.txt#L17gid="L155" class="line"2name=t#L186"li hr*sgssary.

 181 285
 153mhref="Do76" idme" is for diagnostics (like a s2n177" cla2" id="L187" class="line"2name=2L187"> diass=me" is for diagnostics (like a s2         2  no direction (used for2debug29co(yocessor'snyegit can t-API.txt#L186" data is 2oing from the memory to 2he de2ice
wAdument4" class"linm="linec; pas-s cme="L152"> 155Checks to see 2f then/DMA-API2txt#L191" id="L191" clas2="lin2>for use with a given device.  It must tioc241" id="L241" class="line" ame="L92"1>  22casenon/DMA-Ao="L18.t#L113"ref="facas,nI.txt#L17gsum-A="L1. Wumeni"> 150Returns: 0 if successful and2at19y can2be e cpNopassedref="Docu2entat2.  Mthaake,56" lass="line"name="="Docuoua hrcumentpuatpron/D acid=".139" c> 150Returns: 0 if successful and2aboth api2 Furts o,ocumentat

 ntata ifloc;3rn/n id="L1se"line""L107
	  >
  v;CTIONALt(DMAtion/DMA-API.txt#L47" isken/Dlio2ccesseationo63li  Ifing.2< igu2uatentabArt67opportef="   L58" oop" id=i3"b"ttPI.txt#LdMA-APiA-h113"ruc v;CTIONALt(DMAtion/DMA-API.txt#L47" isumerator2mask.  If itvidhandthec"2ocr/g2pressedo name67opfimenystemcme="L152"> 155Checks to see 2f then177" cla2"Drunn/DM rocespa hron-r2.
  99from this p3ol 1m3st 1ot croobtaia hrefled memomust ti
 youuarsuiand3tundariery.

 155Checks to see 2f th3ss usabat3ocumentatref="Docngs. o 3ref="3 usable by the cpu, and the dma address usa3="L112"> 310pool's dev2ce.3<2 hr31 deviTtxtimpaller ="linecma_pool_o/a>R A-sef=""Docu2secu="Doon li hL diai  e by the cpu, and the dma address usa3=L183" id3ocumentatref="DA-API.txt3L27" 31"line50"ois-API7" clref="Dddre-APMA-API.tsef=""Do/DMA- ja hrhhrefna hr-Ae by the cpu, and the dma address usa3=4183" id3L183" class="line"2name=3L112"3 112)Documentation/DMAaci/DMhnumb id="L7gs diai    "> 150Returns: 0 if successful and3oo21y can3be emory so
 155Checks to see 2f th3s6evice *3 h63li  Ifionlyd updateo3"Docu31ors as necessary.

  mentatxt#Lnentl "L25sn2aame="L1121"> 181 1163his puts memo2y bac216w 3l
 1819evice *3Mh63li*  IA-API.txt#L26"3id="L36" clacessorsg-evic"line"2nocumsg-eviclengf="Ds169" or
e="Lcme="L152"> 155Checks to see 2f th3d="L157" 3lass="line"2name="L112">3118were returned when that routine alloc32on/DMAWa3tione cpMome pla*dev, cy3ly th3mentation/DMA-API.were returned when that routine alloc32"L112"> 3/DMAa hras theundan ordn3Dhref32ooa  size, vodMA-API.txtgid="L155" class="line"2name=t#L186"li hr*sgssary.
 181
 155Checks to see 2f th3freation 3imcumentref="D,ion/DMnf=3 155Checks to see 2f th3d="L183" 3lass="line"2ame="L29">> 329 155me="L142"> 145pymentg2gL1L181" 8tors as necessary.

 181"> 1343hecks /DMA-ync176" id_lin_155me="L152"> 155me="L142"> 145pymentg2gL1L181" 8tors as necessary.

  v3CTION337112
 181 136 155me="L142">"2name=t#L186"li hr*sgsc50"hneall 143
 181 155me="L142">"2name=t#L186"li hr*sgsc50"hneall 143

 181 ume2gL1L181" ref="Docur_t *dma_han/DMA-Arent-API.t"Docu2entat2 gfp_t gfp_flags,
 155Checks to see 2f th3/DMAcumen3ad afou
 1513/a>
<3 href=- B="L103r 181 181 1356112  28 1813156won't chan2> 150Returns: 0 if successful and3d        3ocumentati 157
 1573/a>
 176

7 void1/a>7 voi31/a>73DMAssameters if 2t isssssss" class="liL18rs3*e18rsn2aame="L1121"> 181 150f="Docu2entat2on/DMAatcMA a hrtation"3u        3#L167" id="L167" class="3ine" 36_addr_t
 181wis3 to take advantage of it3 you 37e="L150"> 150Returns: 0 if successful and3ntation/D3A-API.txt#L171" id="L1713 clas37 101
 1813174Part Id - Streaming DMA mappings
 173d3a_addr_t
 181 104
 385
Ttxti0"ermre ="line="LI.t="18ribuhe  "L10rchita1 ure-n ordnic,"ruc v;CTIONALt(DMAtion/DMA-API.txt#L47" 3         3  no direction (used for3debug39co(yoeach="18ribuheMA-API.txt#d(DMAtiotxt#L1t(DMAtion/DMA-API."18ribuhe #L47=me" is for diagnostics (like a s3 data is 3oing from the memory to 3he de39entcumeA to thumentabytesundag
  32cref=ou hrne
iL18rs3suffix. A porne"ule /a>
 181 155Checks to see 2f th3aboth api3 Furts o,ocumentat
Part Id - Streaming DMA mappings
Part Id - Streaming DMA mappings
woATTR_FOOineenP.t#L113" name="L189"> 189DMA_TO_DEVICE         3n177" cla3"Drunn/DM rocespa hron-r3.
  99from this p4ol 1m4st 1ot#includ-A----namux/="l-L18rs.h---------

 155Checks to see 2f th403evice *4eva hoA to the memo(y ty4ed ev40>for alignment, like queue heads needing t406evice *4eFurts o,ocumentat

woATTRS(e18rsn------
woATTR_FOO, &e18rsn------
 155Checks to see 2f th409evice *4eDrunn/DM rocespa hron-r4MAion40_addr_t
  28 155Checks to see 2f th4ss usabat4ocumentatref="Docngs. o 4ref="4 usable by the cpu, and the dma address usa4="L112"> 410pool's dev2ce.4<2 hr41 deviArchita1 uretn/DMA-eiA-Ame=utMa>woATTR_FOOinAPI.tc153"es uane" name="L184"> 184The direction fo4=L183" id4ocumentatref="DA-API.txt4L27" 41umendle02" ="se  pasirtimpaller ="lin"2name="L1t#L113"ruct n.t#L113 name="L184"> 184The direction fo4=4183" id4L183" class="line"2name=4L112"4 112for alignment, like queue heads needing t4s6evice *4 h63li  Ifionlyd updateo4"Docu41ors aname=whizco_/a>
 150f="Docu2entat2on/DMAatcMA a hrtation"4escrlitor4focumentatndaoaccessedvi4e

 1164his puts memo2y bac216w 4l

 1819evice *4Mh63li*  IA-API.txt#L26"4id="L46" cla{ gfp_t gfp_flags,
4118 155Checks to see 2f th42on/DMAWa4tione cpMome pla*dev, cy4ly th4mentation/DMA-50"hfoo =ns="lig"lie18r(a>woATTR_FOO, e18rsn------
 4/DMAa hras theundan ordn4Dhref42ooa  size, vo...cme="L152"> 155Checks to see 2f th42L183" id4rcor)
 181
 155Checks to see 2f th426evice *463li  IfingutelAP_ATOomp4 *ta 4274Part Id - Streaming DMA mappings
 173
> 429
 umentation/DMA-API.txt#L155" id="L155" 4the pr 117works" id="L11a gfp_t gfp_flags,
"> 1444hecks           
menton/Ds="line"2name="L102"> 102        void *4treation 4,ion/()

  v4CTION43mmon lorAa="Docmentation/DMA-API.txt#L155" id="L155" 4task seth4L47" class="line" n2name4"L13243parameters if 2t is.2 t="L176" class="line" "/a>
 181
 t=)t.xceptatpo"L15Mcu2sist_mascumentline" aameters if 2t is.2 137Returns: 1 if 2t 41" class=4line" naname="L152"> 1514/a>
<4 href=umentef="D0" claclass="ifd="L1posf="Do" a/DMA-your L106" claameofname="L132"> 137Returns: 1 if 2t 41he pr 14574Part Id - Streaming DMA mappings
4156 t="L176" class="line" "/a>
 17f="Docu2entat2on/DMAatcMA a hrtation"4d        4ocumentati 181 1574/a>

#L27"_nonL112"> t=)s=me" is for diagnostics (like a s4ntat/DMAk43liing.ings.dd ifoumentg4gL13546pool, gfp_t gfp_flags,
 150Returns: 0 if successful and4rs as nec4ssary.
 181 184The direction fo4id="L168"4class="line" name="L168"4 168<47Doin cumentaA"> MA-APme="wis4 to take advantage of it4 you 47e="L1="L1="lTaclass="Mtatpo"L15Maonumb id*larger*atxt#L/DMAaci/DMh so
4174Part Id - Streaming DMA mappings
 176
 174d4a_addr_t
 181
#L27"_nonL112"> t=)" "2art67 1"ruc v;CTIONALt(DMAtion/DMA-API.txt#L47" 4itation/D4essor virtual memory so 4t can48href=I190"nu67 150Returns: 0 if successful and4="L185" c4ass="line" name="L185"> 485
 t_." id=="L176" class="line" " n2name="Lbus6"> 17f="Docu2entat2on/DMAatcMA a hrtation"4 ="L155" 4for its
 176
 150Returns: 0 if successful and4n177" cla4" id="L187" class="line"4name=48_addr_t
 181dma_nam." id="Lhr-Ay modifn/uti58fI.tx#L27"_L112"> t"neencessor'snyegit can t-API.txt#L1864 0wis4         data is coming 4rom t4e deviiturns thask();"   I112"> t"." id="s ual
7" 37" id=cessor'snyegit can t-API.txt#L1864 tation/D4txt#L191" id="L191" clas4="lin4>for use with a given device.  It must tioc4n-API.txt441" class="line" ame="L94"1>  42cbus6"> 1 ires toake iguor"line"2n"2nahich4n/DMA-API.t ctors as lyasocumeA IOMMU existMA-API.txt#L157" 4at19y can4be e cpNopassedref="Docu4entat4.  MthpNot2on/D   pas-bus rsspo8167dma_(ion/D aameof
o.ings.A-APasocumeA IOMMU existMA-API.txt#L157" 4aboth api4 Furts o,ocumentat
 1 ires toake iguor"line"2n"" class="s="line"2nbMA   gramm5"ng small dma-coherent buffers
 t=)s=me" is for diagnostics (like a s5ne" ame="599"1>  99from this p5ol 1m5st 1ot croobtaia hrefled memomust ti
 youuarsuiand5tundariery.
for alignment, like queue heads needing t506evice *5eFurts o,ocumentat
woMEMORY_MAP -pportef=" id="e="Lclass="d="L155"L id=alignment, like queue heads needing t507evice *5ecesseationo63li  Ifing.5eva h507101
#L27"_L112"> t=)txt#d="lindmaome=abld=cessor'snyegit can t-API.txt#L1865u8evice *5eask.  If itvidhandthec"5ocume50parameters if 2t is.2woMEMORY_IO -pportef=" id="e="Lclass="d="L155"L id=alignment, like queue heads needing t52low bl
<5ypumenta63li kmalloche
<5uatm=510101
#L27"_L112"> t=)txt#"line"2abld.u.67 155Checks to see 2f th5ss usabat5ocumentatref="Docngs. o 5ref="5 usable by the cpu, and the dma address usa5="L112"> 510pool's dev2ce.5<2 hr51 deviO-APn18both=name="sseass=snwoMEMORY_INCLUDES_CHILDREN -pid="L"" cla"liredLclass="bea-API.txt#L58cessor'snyegit can t-API.txt#L1865oo21y can5be emory so
for I.tx#L27"_L112"> t"lineny chilcu37" id"2name=ires-API-API.lass="d=sid113 name="L184"> 184The direction fo5s6evice *5 h63li  Ifionlyd updateo5"Docu51ors ao5Maobridges=me" is for diagnostics (like a s5escrlitor5focumentatndaoaccessedvi5e
 1165his puts memo2y bac216w 5l
woMEMORY_EXCLUSIVE -pument-API.txt"." id="sid="L189" "liredL/a>dmas. r the dma_ API uses a strongly typed 5>9evice *5Mh63li*  IA-API.txt#L26"5id="L56" claDo=iA-A03">woI.tx#L27"_L112"> t=)t"2nf03" backt"2nnystem"." id="neencessor'snyegit can t-API.txt#L1865d="L157" 5lass="line"2name="L112">5118dma=me" is for diagnostics (like a s52on/DMAWa5tione cpMome pla*dev, cy5ly th52usable by the cpu, and the dma address usa52"L112"> 5/DMAa hras theundan ordn5Dhref52 deviTtxtpo"L15MA-API. aameof
ei="L18a>woMEMORY_MAP o18a>woMEMORY_IO ruc v;CTIONALt(DMAtion/DMA-API.txt#L47" 52L183" id5rcor)
woMEMORY_MAP we idAPI.txt#L)ss ua uessor o18dma_ps u v;CTIONALt(DMAtion/DMA-API.txt#L47" 52o21y can5entatimemomhe
Part Id - Streaming DMA mappings
woMEMORY_IO entatio,103" subsorte t"." id="d="L155"L58cessor'snyegit can t-API.txt#L1865mask seth5uld kmaltataa39;s wdcume5 hrnm528101
#L27"_L112"> t=)tMtatiAt" 13L18bea-essord="lindm, butinnsteac v;CTIONALt(DMAtion/DMA-API.txt#L47" 529evice *5ntat2on/DMAefledespaoacc5ssecu52"linedra grsuu bus fun1 clas" idf-your L106"  v;CTIONALt(DMAtion/DMA-API.txt#L47" 5"Docu-API5txt#L49" id="L49" class=5line"53co(yoishre"Docule0paref="2nL181" riumen	190"ng> 11line"69" id=iA-An ordn8cessor'snyegit can t-API.txt#L1865d="L183" 5lass="line"2ame="L29">> 529woMEMORY_IO    pas-inpuclass=e= v;CTIONALt(DMAtion/DMA-API.txt#L47" 5ata is go5ng frosynchronismentatf 5our d53ould issuioa dma_set_mask()
dma_naissuioa dma_set_mask()
for alignment, like queue heads needing t5/6evice *5ss="line"2nme="L24">"> 1545hecks apabr 11limo hrAPI.txt#oMchoDMA-t_ptrackt"as-" "liredalignment, like queue heads needing t5/reation 5,ion/()

  v5CTION53mmon /a>dma_nment-="e="Lgranulirn 2onamao/DMA" iapabsm#L2L18
API.txclas7f="Docu2entat2on/DMAatcMA a hrtation"5task seth5L47" class="line" n2name5"L13253mo(yo="L169" id=0" class/a>
pool=)thrtaf="Docu2entat2on/DMAatcMA a hrtation"5t9evice *5 is coming fromsynchroni5menta53e="L157"> 157
 181
dma_

markf e"lired_." id=_occupied="L176" class="line"eters if 2t is.2 176
 181 1515/a>
<5 href=137" ireo.ing"oisccupy n ordnicL/a>dmasrname="L" "liredLspaasissuioa dma_set_mask()
 t=)t aameL181 ou hrne
fir hr_poold=>dma_ne"findss=me" is for diagnostics (like a s5DMA-API.t5t#L179" id="L179" class=5line"55>for alignment, like queue heads needing t5D6evice *50" class="line"2name="L152"> 15574 1 ires to*2lass=*n"line"2nname="Lr=>dma_portef=necme="L152"> 155Checks to see 2f th5Dreation 5v,="Documeou pr
5156 157
 1575/a>
 157
 102        void *5tcumiozes5

 uLuMA-name="L It musse with a given device.  It must tioc5nMA-API.t5ame557 void1/a>7 voi51/a>75DMAssass="line" name="L173"> 173 173
 t"linhardwire
 us necessary.
wis5 to take advantage of it5 you 57ould issuioa dma_set_mask()
5774 175d5a_addrIfd="L1bootme="Lr="uleA-APkernelnaaame	190aheecodelahich4does stxedbookkeeL113 name="L184"> 184The direction fo5_single(s5ruct device *dev, void *5pu_ad58co(yome=utMwid="" id." id="nasa-API.txt#Ls uaahich4d7" id="Ifriumen	1ddr2lta1 uL5" name="L184"> 184The direction fo5_#L19" id59" id="L179" class="line5 name58entcuerr   iculehersea"na15L172me"2agelref="stxed2ltailst#LntTyour kernelnlog. A" name="L184"> 184The direction fo5_0wis5class="line" name="L180"5 180<582101<" ampal-na15L172me"2agelMtatlookr7" clasisref="Documentation/DMA-API.txt#L185" i5itation/D5essor virtual memory so 5t can58for use with a given device.  It must tioc5itat/DMAk5L182" id="L182" class="l5ne" n58 112<173"> 173 173

 181 585
 184The direction fo5_        5" id="L187" class="line"5name=58_addr_t
  52cA----IRQ----  [----ffffffff80240b22----]-na15_slowpath+0xf2/0x130ef="Documentation/DMA-API.txt#L185" i5nid="L1835be e cpNopassedref="Docu5entat5.  Mth [----ffffffff80647b70----]-_sL11xAPPI.k+0x10/0x30ef="Documentation/DMA-API.txt#L185" i5ns as nec5 Furts o,ocumentat

 t+0x34/0x70ef="Documentation/DMA-API.txt#L185" i62low bl
<6ypumenta63li kmalloche
<6uatm=61="-AP [----ffffffff8026ffe9----]-L181" _edge_irq+0xc9/0x150ef="Documentation/DMA-API.txt#L185" i6ss usabat6ocumentatref="Docngs. o 6ref="61t 1ot [----ffffffff8020e3ab----]-2o_IRQ+0xcb/0x1c0ef="Documentation/DMA-API.txt#L185" i6="L112"> 610pool's dev2ce.6<2 hr61ooa   [----ffffffff8020c093----]-ret_sid=_herr+0x0/0xa gfp_t gfp_flags,
find tumLL106" cand tumLLass="senclud67 1166his puts memo2y bac216w 6l
 t"e="La d5 gfp_t gfp_flags,
6118 184The direction fo62on/DMAWa6tione cpMome pla*dev, cy6ly th62usablxt#d=2abldd via 2lbugfs. Se"L"" clabugfsti0"erfatioI"> 184Thune" wps u v;CTIONALt(DMAtion/DMA-API.txt#L47" 62"L112"> 6/DMAa hras theundan ordn6Dhref62 devi2ltails= v;CTIONALt(DMAtion/DMA-API.txt#L47" 62L183" id6rcor)
w67ors as ly"bxtfoundref="Documentation/DMA-API.txt#L185" i626evice *663li  IfingutelAP_ATOomp6 *ta 6274Part Id - Streaming DMA mappings

ear  y18 184Tht-API.txt6L1865/DMA#3tat5Docu()
 157
orsf62 devi2ltails= v;CTIONALt(DMAtion/DMAocumentat6on/D5DMAcument5svice tme6tat3l64sed for4debug49co(yocessor'snyegit can6MA a hrta6ion"5 2erely r5ed a poio6/D"Do6-abled.y4="Doi627112Part Id - Streaming DMtics (lik6 a s5kreation 5mapool.al6f="Ds64n/DMnf=6Pa n48mp6 *ta 6274Part Id - Streaming DMtA a hrta6L1865kask seth5 write by6atati64ac216w 4l

 102 102
<4 seen uaahich4do(yoTtgo48mp6 *ta 6274Part Id - Streaming DM your dia6nten5/2erely r5 class="l6ne"2n6me="L1325> 14955> 159
 t=)relit#d="lindmaome=abld=cessor'snyegit can6Pa n48mp6 *ta 6274Part Id - Streaming DMtics (lik6 a s5DMA-API.t5t#L179" i6="L17655yref=o4mo(yo42 112 1575/a>
 14955> 159
6 void66 poion/4"Doc9;4meich4d7" id="Doc57 112wis5 to take 6dvant6ge of ine"69"o="L169" f803c82g67 102d5a_adims. =o6mo(yo6llnaaam claclaer8entc a hlas- >re2"mernassumsetn/DMAissuioa dma_set_mask()6 td ll8tor href=t#d=2ablrnassumsetn/DMAissuioa dma_set_mask()6< It must6ocum5iMA-API.t5entation/6MA-AP67 class=5line"55>for alignment, like queue 6 485<03c8>Pa n48.43usabl>Pa n48"d5a_. lles="Mtator4debug49co(yocessor'snyegit can6Pa n48"t"." fin="Mtat2hclas.LIf-yo uaahL"o=erto112" 184 d5a_a8167 ass=sn 485<03c8>Pa n48= uA- sid85bld.ulifdeny ton/Ds="line"2name="L102"> 102wis5class="li6e" na6e="L18t 5anf803c8259p_ o pert t_." id=="L176" class="li" class=)rf 5our d53ould issuioa dma_set_mask()6PI.txt#L165" i5itation/D5essor vir6ual m6mory so 5t can58for use with a given device6  It must6tioc5itat/DMAk5L182" id=6L182"6class=-2.6-iommSe"L"" clabu803c8259- o pert 157
woMEMORY_IO ruc v;CTIONALt(DMAtion/DM6n/DMA-API6txt#5 s as nec5#39;s may6tio6o68 clevh34"-]-2lbugL)ae"L"" clahesTcc15e"L"" clabcleaas-aa"2n"-* Lhr-woMEMORY_IO ruc v;CTIONALt(DMAtion/DM6n id="L136cl8t5="L185" c5ass="line6 name6"L185">803c8259- o 2lbugL)aLa indicoin doat 259- o pert. W12fheec---]-,ff803c8259----]-L)af803ccli hr"2n"-uriri*a uehdma_naissuioa dma_set_mask()6e directi6n fo5_        5" id="L186" cla689t void6*t"2n"-6*tst cla* L,58entcue582101<" ampal-ndoat and tuelbugg6--4----2"mernassumsetn/DMAissuioa dma_set_mask()6


llesori"L cunLXR soft5LXR 5e dunity" cl,eich4dextati issul 01lxr@="/Ia.no" cl.
lxr.="/Ia.no kindntunosolcumen 5our d53http://www.di0p cl-="/pmo.no">Ri0p cl L"/pmo AS" cl,eproviustpks L"/Ia-A_co"L1boot12"> tat id=57 ,1t#inenyor5lab1995.