linux/drivers/dma/coh901318_lli.c
<<
>>
S m vdiv=.3co+1v3h"ction="+searccommena">/* co+2v3h"ction="+searccommena"> * img sr="../.static/gfx/rig co+3v3h"ction="+searccommena"> * co+4v3h"ction="+searccommena"> * Copyan> (C) 2007-2009 ST-Ericsson co+5v3h"ction="+searccommena"> * License terms: GNU General Public License (GPL) srcopti2 co+6v3h"ction="+searccommena"> * Support funit="rs .6. handhing x/r .6. ".. co+7v3h"ction="+searccommena"> * Auch(r: Per Fri co+8v3h"ction="+searccommena"> */ co+9v3h">co.16.a>#include <li.c" xr_s>co116.a>#include <li.c" memory.h6.a>xr_s>co126.a>#include <li.c" gfp.h6.a>xr_s>co136.a>#include <li.c" "..pool.h6.a>xr_s>co146.a>#include <mach/.static/g.h6.a>xr_s>co15v3h">co166.a>#include ".static/gfx/rih6.a>xquot;>co17v3h">co186.a>#if (ersh90131+code=defined"="+searc5901">defined6.a>(ersh90131+code=CONFIG_DEBUG_FS"="+searc5901">CONFIG_DEBUG_FS6.a>) && ersh90131+code=defined"="+searc5901">defined6.a>(ersh90131+code=CONFIG_U300_DEBUG"="+searc5901">CONFIG_U300_DEBUG6.a>))>co19v3h"#define ersh90131+code=DEBUGFS_POOL_COUNTER_RESET"="+searc5901">DEBUGFS_POOL_COUNTER_RESET6.a>(ersh90131+code=pool"="+searc5901">pool6.a>) (ersh90131+code=pool"="+searc5901">pool6.a>-xr_s rsh90131+code=debugfs_pool_counter"="+searc5901">debugfs_pool_counter6.a> = 0)>co20v3h"#define ersh90131+code=DEBUGFS_POOL_COUNTER_ADD"="+searc5901">DEBUGFS_POOL_COUNTER_ADD6.a>(ersh90131+code=pool"="+searc5901">pool6.a>, ersh90131+code=add"="+searc5901">add6.a>) (ersh90131+code=pool"="+searc5901">pool6.a>-xr_s rsh90131+code=debugfs_pool_counter"="+searc5901">debugfs_pool_counter6.a> += ersh90131+code=add"="+searc5901">add6.a>)>co216.a>#else>co22v3h"#define ersh90131+code=DEBUGFS_POOL_COUNTER_RESET"="+searc5901">DEBUGFS_POOL_COUNTER_RESET6.a>(ersh90131+code=pool"="+searc5901">pool6.a>)>co23v3h"#define ersh90131+code=DEBUGFS_POOL_COUNTER_ADD"="+searc5901">DEBUGFS_POOL_COUNTER_ADD6.a>(ersh90131+code=pool"="+searc5901">pool6.a>, ersh90131+code=add"="+searc5901">add6.a>)>co246.a>#endif>co25v3h">co266.a>> struct ersh90131+code=.static/gfx/r"="+searc5901">.static/gfx/r6.a> *>co27v3h"crsh90131+code=.static/gfx/r_nalue="+searc5901">.static/gfx/r_nalu6.a>(struct ersh90131+code=.static/gfx/r"="+searc5901">.static/gfx/r6.a> * rsh90131+code=data"="+searc5901">data6.a>)>co286.a>{>co29v3h" if (ersh90131+code=data"="+searc5901">data6.a> == ersh90131+code=NULL"="+searc5901">NULL6.a> || ersh90131+code=data"="+searc5901">data6.a>-xr_s rsh90131+code=hink_addr"="+searc5901">hink_addr6.a> == 0)>co30v3h" t type=ersh90131+code=NULL"="+searc5901">NULL6.a>;>co31v3h">co32v3h" t type=(struct ersh90131+code=.static/gfx/r"="+searc5901">.static/gfx/r6.a> *) ersh90131+code=data"="+searc5901">data6.a>-xr_s rsh90131+code=virt_hink_addr"="+searc5901">virt_hink_addr6.a>;>co33v3h"}>co34v3h">co35v3h"int ersh90131+code=.static/gfpool_create"="+searc5901">.static/gfpool_create6.a>(struct ersh90131+code=.static/gfpool"="+searc5901">.static/gfpool6.a> * rsh90131+code=pool"="+searc5901">pool6.a>,>co36v3h" struct ersh90131+code=device"="+searc5901">device6.a> * rsh90131+code=dev"="+searc5901">dev6.a>,>co37v3h" rsh90131+code=size_ue="+searc5901">size_uv3h" rsh90131+code=sizee="+searc5901">size6.a>, ersh90131+code=size_ue="+searc5901">size_uv3h" rsh90131+code=align"="+searc5901">align6.a>)>co386.a>{>co39v3h" ersh90131+code=spin_lock_iniue="+searc5901">spin_lock_iniu6.a>(&ersh90131+code=pool"="+searc5901">pool6.a>-xr_s rsh90131+code=lock"="+searc5901">hock6.a>);>co40v3h" ersh90131+code=pool"="+searc5901">pool6.a>-xr_s rsh90131+code=dev"="+searc5901">dev6.a> = ersh90131+code=dev"="+searc5901">dev6.a>;>co41v3h" ersh90131+code=pool"="+searc5901">pool6.a>-xr_s rsh90131+code=d..pool"="+searc5901">d..pool6.a> = ersh90131+code=dmafpool_create"="+searc5901">dmafpool_create6.a>(etion="+searcstring">xquot;x/r_pool"< dev6.a>, rsh90131+code=sizee="+searc5901">size6.a>, ersh90131+code=align"="+searc5901">align6.a>, 0);>co42v3h">co43v3h" ersh90131+code=DEBUGFS_POOL_COUNTER_RESET"="+searc5901">DEBUGFS_POOL_COUNTER_RESET6.a>(ersh90131+code=pool"="+searc5901">pool6.a>);>co44v3h" t type=0;>co45v3h"}>co46v3h">co47v3h"int ersh90131+code=.static/gfpool_destroy"="+searc5901">.static/gfpool_destroy6.a>(struct ersh90131+code=.static/gfpool"="+searc5901">.static/gfpool6.a> * rsh90131+code=pool"="+searc5901">pool6.a>)>co486.a>{>co49v3h">co50v3h" ersh90131+code=dmafpool_destroy"="+searc5901">dmafpool_destroy6.a>(ersh90131+code=pool"="+searc5901">pool6.a>-xr_s rsh90131+code=d..pool"="+searc5901">d..pool6.a>);>co51v3h" t type=0;>co52v3h"}>co53v3h">co546.a>>.static/gfx/r6.a> *>co55v3h"crsh90131+code=.static/gfx/r_alhoce="+searc5901">.static/gfx/r_alhoc6.a>(struct ersh90131+code=.static/gfpool"="+searc5901">.static/gfpool6.a> * rsh90131+code=pool"="+searc5901">pool6.a>, unsigned int ersh90131+code=len"="+searc5901">len6.a>)>co566.a>{>co57v3h" int ersh90131+code=r"="+searc5901">i6.a>;>co58v3h" struct ersh90131+code=.static/gfx/r"="+searc5901">.static/gfx/r6.a> * rsh90131+code=head"="+searc5901">head6.a>;>co59v3h" struct ersh90131+code=.static/gfx/r"="+searc5901">.static/gfx/r6.a> * rsh90131+code=x/r"="+searc5901">x/r6.a>;>co60v3h" struct ersh90131+code=.static/gfx/r"="+searc5901">.static/gfx/r6.a> * rsh90131+code=x/rmp90v"="+searc5901">x/rmp90v6.a>;>co61v3h" ersh90131+code=dmafaddr_ue="+searc5901">dmafaddr_uv3h" rsh90131+code=phy"="+searc5901">phy6.a>;>co62v3h">co63v3h" if (ersh90131+code=len"="+searc5901">len6.a> == 0)>co64v3h" goto rsh90131+code=err"="+searc5901">err6.a>;>co65v3h">co66v3h" ersh90131+code=spin_locke="+searc5901">spin_lock6.a>(&ersh90131+code=pool"="+searc5901">pool6.a>-xr_s rsh90131+code=lock"="+searc5901">hock6.a>);>co67v3h">co68v3h" ersh90131+code=head"="+searc5901">head6.a> = ersh90131+code=dmafpool_alhoce="+searc5901">dmafpool_alhoc6.a>(ersh90131+code=pool"="+searc5901">pool6.a>-xr_s rsh90131+code=d..pool"="+searc5901">d..pool6.a>, ersh90131+code=GFP_NOWAIT"="+searc5901">GFP_NOWAIT6.a>, &ersh90131+code=phy"="+searc5901">phy6.a>);>co69v3h">co70v3h" if (ersh90131+code=head"="+searc5901">head6.a> == ersh90131+code=NULL"="+searc5901">NULL6.a>)>co71v3h" goto rsh90131+code=err"="+searc5901">err6.a>;>co72v3h">co73v3h" ersh90131+code=DEBUGFS_POOL_COUNTER_ADD"="+searc5901">DEBUGFS_POOL_COUNTER_ADD6.a>(ersh90131+code=pool"="+searc5901">pool6.a>, 1);>co74v3h">co75v3h" ersh90131+code=x/r"="+searc5901">x/r6.a> = ersh90131+code=head"="+searc5901">head6.a>;>co76v3h" ersh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=phy_ame="="+searc5901">phy_ame=6.a> = ersh90131+code=phy"="+searc5901">phy6.a>;>co77v3h" ersh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=hink_addr"="+searc5901">hink_addr6.a> = 0x00000000;>co78v3h" ersh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=virt_hink_addr"="+searc5901">virt_hink_addr6.a> = 0x00000000U;>co79v3h">co80v3h" .6. (ersh90131+code=r"="+searc5901">i6.a> = 1; ersh90131+code=r"="+searc5901">i6.a> < ersh90131+code=len"="+searc5901">len6.a>; ersh90131+code=r"="+searc5901">i6.a>++) {>co81v3h" rsh90131+code=x/rmp90v"="+searc5901">x/rmp90v6.a> = ersh90131+code=x/r"="+searc5901">x/r6.a>;>co82v3h">co83v3h" rsh90131+code=x/r"="+searc5901">x/r6.a> = ersh90131+code=dmafpool_alhoce="+searc5901">dmafpool_alhoc6.a>(ersh90131+code=pool"="+searc5901">pool6.a>-xr_s rsh90131+code=d..pool"="+searc5901">d..pool6.a>, ersh90131+code=GFP_NOWAIT"="+searc5901">GFP_NOWAIT6.a>, &ersh90131+code=phy"="+searc5901">phy6.a>);>co84v3h">co85v3h" if (ersh90131+code=l/r"="+searc5901">x/r6.a> == ersh90131+code=NULL"="+searc5901">NULL6.a>)>co86v3h" goto rsh90131+code=err_clean_up24"+searc5901">err_clean_up6.a>;>co87v3h">co88v3h" rsh90131+code=DEBUGFS_POOL_COUNTER_ADD"="+searc5901">DEBUGFS_POOL_COUNTER_ADD6.a>(ersh90131+code=pool"="+searc5901">pool6.a>, 1);>co89v3h" rsh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=phy_ame="="+searc5901">phy_ame=6.a> = ersh90131+code=phy"="+searc5901">phy6.a>;>co90v3h" ersh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=hink_addr"="+searc5901">hink_addr6.a> = 0x00000000;>co91v3h" rsh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=virt_hink_addr"="+searc5901">virt_hink_addr6.a> = 0x00000000U;>co92v3h">co93v3h" rsh90131+code=x/rmp90v"="+searc5901">x/rmp90v6.a>-xr_s rsh90131+code=hink_addr"="+searc5901">hink_addr6.a> = ersh90131+code=phy"="+searc5901">phy6.a>;>co94v3h" rsh90131+code=x/rmp90v"="+searc5901">x/rmp90v6.a>-xr_s rsh90131+code=virt_hink_addr"="+searc5901">virt_hink_addr6.a> = ersh90131+code=x/r"="+searc5901">x/r6.a>;>co95v3h" }>co96v3h">co97v3h" ersh90131+code=spin_unlocke="+searc5901">spin_unlock6.a>(&ersh90131+code=pool"="+searc5901">pool6.a>-xr_s rsh90131+code=lock"="+searc5901">hock6.a>);>co98v3h">co99v3h" t type=ersh90131+code=head"="+searc5901">head6.a>;>c100v3h">c101v3h" rsh90131+code=err"="+searc5901">err6.a>:>c102v3h" ersh90131+code=spin_unlocke="+searc5901">spin_unlock6.a>(&ersh90131+code=pool"="+searc5901">pool6.a>-xr_s rsh90131+code=lock"="+searc5901">hock6.a>);>c103v3h" t type=ersh90131+code=NULL"="+searc5901">NULL6.a>;>c104v3h">c105v3h" rsh90131+code=err_clean_up24"+searc5901">err_clean_up6.a>:>c106v3h" ersh90131+code=x/rmp90v"="+searc5901">x/rmp90v6.a>-xr_s rsh90131+code=hink_addr"="+searc5901">hink_addr6.a> = 0x00000000U;>c107v3h" ersh90131+code=spin_unlocke="+searc5901">spin_unlock6.a>(&ersh90131+code=pool"="+searc5901">pool6.a>-xr_s rsh90131+code=lock"="+searc5901">hock6.a>);>c108v3h" ersh90131+code=.static/gfx/r_free"="+searc5901">.static/gfx/r_free6.a>(ersh90131+code=pool"="+searc5901">pool6.a>, &ersh90131+code=head"="+searc5901">head6.a>);>c109v3h" t type=ersh90131+code=NULL"="+searc5901">NULL6.a>;>c1.16.a>}>c111v3h">c1126.a>void ersh90131+code=.static/gfx/r_free"="+searc5901">.static/gfx/r_free6.a>(struct ersh90131+code=.static/gfpool"="+searc5901">.static/gfpool6.a> * rsh90131+code=pool"="+searc5901">pool6.a>,>c113v3h" struct ersh90131+code=.static/gfx/r"="+searc5901">.static/gfx/r6.a> ** rsh90131+code=x/r"="+searc5901">x/r6.a>)>c1146.a>{>c115v3h" struct ersh90131+code=.static/gfx/r"="+searc5901">.static/gfx/r6.a> * rsh90131+code=x"="+searc5901">x6.a>;>c116v3h" struct ersh90131+code=.static/gfx/r"="+searc5901">.static/gfx/r6.a> * rsh90131+code=nalue="+searc5901">nalu6.a>;>c117v3h">c118v3h" if (ersh90131+code=l/r"="+searc5901">x/r6.a> == ersh90131+code=NULL"="+searc5901">NULL6.a>)>c119v3h" t types>c120v3h">c121v3h" ersh90131+code=x"="+searc5901">x6.a> = * rsh90131+code=x/r"="+searc5901">x/r6.a>;>c122v3h">c123v3h" if (ersh90131+code=l"="+searc5901">x6.a> == ersh90131+code=NULL"="+searc5901">NULL6.a>)>c124v3h" t types>c125v3h">c126v3h" ersh90131+code=spin_locke="+searc5901">spin_lock6.a>(&ersh90131+code=pool"="+searc5901">pool6.a>-xr_s rsh90131+code=lock"="+searc5901">hock6.a>);>c127v3h">c128v3h" while (ersh90131+code=l"="+searc5901">x6.a>-xr_s rsh90131+code=hink_addr"="+searc5901">hink_addr6.a>) {>c129v3h" rsh90131+code=nalue="+searc5901">nalu6.a> = ersh90131+code=x"="+searc5901">x6.a>-xr_s rsh90131+code=virt_hink_addr"="+searc5901">virt_hink_addr6.a>;>c130v3h" ersh90131+code=dmafpool_free"="+searc5901">dmafpool_free6.a>(ersh90131+code=pool"="+searc5901">pool6.a>-xr_s rsh90131+code=d..pool"="+searc5901">d..pool6.a>, ersh90131+code=x"="+searc5901">x6.a>, ersh90131+code=x"="+searc5901">x6.a>-xr_s rsh90131+code=phy_ame="="+searc5901">phy_ame=6.a>);>c131v3h" rsh90131+code=DEBUGFS_POOL_COUNTER_ADD"="+searc5901">DEBUGFS_POOL_COUNTER_ADD6.a>(ersh90131+code=pool"="+searc5901">pool6.a>, -1);>c132v3h" ersh90131+code=x"="+searc5901">x6.a> = rsh90131+code=nalue="+searc5901">nalu6.a>;>c133v3h" }>c134v3h" ersh90131+code=dmafpool_free"="+searc5901">dmafpool_free6.a>(ersh90131+code=pool"="+searc5901">pool6.a>-xr_s rsh90131+code=d..pool"="+searc5901">d..pool6.a>, ersh90131+code=x"="+searc5901">x6.a>, ersh90131+code=x"="+searc5901">x6.a>-xr_s rsh90131+code=phy_ame="="+searc5901">phy_ame=6.a>);>c135v3h" ersh90131+code=DEBUGFS_POOL_COUNTER_ADD"="+searc5901">DEBUGFS_POOL_COUNTER_ADD6.a>(ersh90131+code=pool"="+searc5901">pool6.a>, -1);>c136v3h">c137v3h" ersh90131+code=spin_unlocke="+searc5901">spin_unlock6.a>(&ersh90131+code=pool"="+searc5901">pool6.a>-xr_s rsh90131+code=lock"="+searc5901">hock6.a>);>c138v3h" * rsh90131+code=x/r"="+searc5901">x/r6.a> = rsh90131+code=NULL"="+searc5901">NULL6.a>;>c139v3h"}>c140v3h">c141v3h"int>c142v3h"ersh90131+code=.static/gfx/r_fill_memcpy"="+searc5901">.static/gfx/r_fill_memcpy6.a>(struct ersh90131+code=.static/gfpool"="+searc5901">.static/gfpool6.a> * rsh90131+code=pool"="+searc5901">pool6.a>,>c143v3h" struct ersh90131+code=.static/gfx/r"="+searc5901">.static/gfx/r6.a> * rsh90131+code=x/r"="+searc5901">x/r6.a>,>c144v3h" ersh90131+code=dmafaddr_ue="+searc5901">dmafaddr_uv3h" rsh90131+code=source"="+searc5901">source6.a>, unsigned int ersh90131+code=sizee="+searc5901">size6.a>,>c145v3h" ersh90131+code=dmafaddr_ue="+searc5901">dmafaddr_uv3h" rsh90131+code=destinat="re="+searc5901">destinat="r6.a>, ersh90131+code=u3224"+searc5901">u32v3h" ersh90131+code=.trl_chained"="+searc5901">.trl_chained6.a>,>c146v3h" ersh90131+code=u3224"+searc5901">u32v3h" ersh90131+code=.trl_eom"="+searc5901">.trl_eom6.a>)>c147v3h"{>c148v3h" int ersh90131+code=se="+searc5901">s6.a> = rsh90131+code=sizee="+searc5901">size6.a>s>c149v3h" ersh90131+code=dmafaddr_ue="+searc5901">dmafaddr_uv3h" rsh90131+code=srce="+searc5901">src6.a> = rsh90131+code=source"="+searc5901">source6.a>s>c150v3h" ersh90131+code=dmafaddr_ue="+searc5901">dmafaddr_uv3h" rsh90131+code=dsue="+searc5901">dsu6.a> = ersh90131+code=destinat="re="+searc5901">destinat="r6.a>s>c151v3h">c152v3h" ersh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=src_addr"="+searc5901">src_addr6.a> = rsh90131+code=srce="+searc5901">src6.a>s>c153v3h" ersh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=dsu_addr"="+searc5901">dsu_addr6.a> = ersh90131+code=dsue="+searc5901">dsu6.a>s>c154v3h">c155v3h" while (ersh90131+code=l/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=hink_addr"="+searc5901">hink_addr6.a>) {>c156v3h" ersh90131+code=l/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=control"="+searc5901">.sntrol6.a> = ersh90131+code=.trl_chained"="+searc5901">.trl_chained6.a> | ersh90131+code=MAX_DMA_PACKET_SIZE"="+searc5901">MAX_DMA_PACKET_SIZE6.a>s>c157v3h" ersh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=src_addr"="+searc5901">src_addr6.a> = rsh90131+code=srce="+searc5901">src6.a>s>c158v3h" rsh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=dsu_addr"="+searc5901">dsu_addr6.a> = ersh90131+code=dsue="+searc5901">dsu6.a>s>c159v3h">c160v3h" ersh90131+code=se="+searc5901">s6.a> -= ersh90131+code=MAX_DMA_PACKET_SIZE"="+searc5901">MAX_DMA_PACKET_SIZE6.a>s>c161v3h" rsh90131+code=x/r"="+searc5901">x/r6.a> = ersh90131+code=.static/gfx/r_nalue="+searc5901">.static/gfx/r_nalu6.a>( rsh90131+code=x/r"="+searc5901">x/r6.a>);>c162v3h">c163v3h" rsh90131+code=srce="+searc5901">src6.a> += ersh90131+code=MAX_DMA_PACKET_SIZE"="+searc5901">MAX_DMA_PACKET_SIZE6.a>s>c164v3h" rsh90131+code=dsue="+searc5901">dsu6.a> += ersh90131+code=MAX_DMA_PACKET_SIZE"="+searc5901">MAX_DMA_PACKET_SIZE6.a>s>c165v3h" }>c166v3h">c167v3h" ersh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=control"="+searc5901">.sntrol6.a> = ersh90131+code=.trl_eom"="+searc5901">.trl_eom6.a> | ersh90131+code=se="+searc5901">s6.a>s>c168v3h" ersh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=src_addr"="+searc5901">src_addr6.a> = rsh90131+code=srce="+searc5901">src6.a>s>c169v3h" ersh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=dsu_addr"="+searc5901">dsu_addr6.a> = ersh90131+code=dsue="+searc5901">dsu6.a>s>c170v3h">c171v3h" t type=0;>c172v3h"}>c173v3h">c174v3h"int>c175v3h"crsh90131+code=.static/gfx/r_fill_single"="+searc5901">.static/gfx/r_fill_single6.a>(struct ersh90131+code=.static/gfpool"="+searc5901">.static/gfpool6.a> * rsh90131+code=pool"="+searc5901">pool6.a>,>c176v3h" struct ersh90131+code=.static/gfx/r"="+searc5901">.static/gfx/r6.a> * rsh90131+code=x/r"="+searc5901">x/r6.a>,>c177v3h" rsh90131+code=dmafaddr_ue="+searc5901">dmafaddr_uv3h" rsh90131+code=bufe="+searc5901">buf6.a>, unsigned int ersh90131+code=sizee="+searc5901">size6.a>,>c178v3h" rsh90131+code=dmafaddr_ue="+searc5901">dmafaddr_uv3h" rsh90131+code=dev_addr"="+searc5901">dev_addr6.a>, ersh90131+code=u3224"+searc5901">u32v3h" ersh90131+code=.trl_chained"="+searc5901">.trl_chained6.a>, ersh90131+code=u3224"+searc5901">u32v3h" ersh90131+code=.trl_eom"="+searc5901">.trl_eom6.a>,>c179v3h" enum rsh90131+code=dmaftransfer_direct="re="+searc5901">dmaftransfer_direct="rv3h" rsh90131+code=dir"="+searc5901">dir6.a>)>c180v3h"{>c181v3h" int ersh90131+code=se="+searc5901">s6.a> = rsh90131+code=sizee="+searc5901">size6.a>s>c182v3h" ersh90131+code=dmafaddr_ue="+searc5901">dmafaddr_uv3h" rsh90131+code=srce="+searc5901">src6.a>s>c183v3h" ersh90131+code=dmafaddr_ue="+searc5901">dmafaddr_uv3h" rsh90131+code=dsue="+searc5901">dsu6.a>s>c184v3h">c185v3h">c186v3h" if (ersh90131+code=dir"="+searc5901">dir6.a> == ersh90131+code=DMA_MEM_TO_DEV"="+searc5901">DMA_MEM_TO_DEV6.a>) {>c187v3h" ersh90131+code=srce="+searc5901">src6.a> = rsh90131+code=bufe="+searc5901">buf6.a>s>c188v3h" rsh90131+code=dsue="+searc5901">dsu6.a> = ersh90131+code=dev_addr"="+searc5901">dev_addr6.a>s>c189v3h">c190v3h" } else if (ersh90131+code=dir"="+searc5901">dir6.a> == ersh90131+code=DMA_DEV_TO_MEM"="+searc5901">DMA_DEV_TO_MEM6.a>) {>c191v3h">c192v3h" ersh90131+code=srce="+searc5901">src6.a> = rsh90131+code=dev_addr"="+searc5901">dev_addr6.a>s>c193v3h" rsh90131+code=dsue="+searc5901">dsu6.a> = ersh90131+code=bufe="+searc5901">buf6.a>s>c194v3h" } else {>c195v3h" t type=-ersh90131+code=EINVAL"="+searc5901">EINVAL6.a>s>c196v3h" }>c197v3h">c198v3h" while (ersh90131+code=l/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=hink_addr"="+searc5901">hink_addr6.a>) {>c199v3h" rsh90131+code=size_ue="+searc5901">size_uv3h" rsh90131+code=block_sizee="+searc5901">block_size6.a> = ersh90131+code=MAX_DMA_PACKET_SIZE"="+searc5901">MAX_DMA_PACKET_SIZE6.a>s>c200v3h" ersh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=control"="+searc5901">.sntrol6.a> = ersh90131+code=.trl_chained"="+searc5901">.trl_chained6.a> | ersh90131+code=MAX_DMA_PACKET_SIZE"="+searc5901">MAX_DMA_PACKET_SIZE6.a>s>c201v3h">c202v3h" etion="+searccomment">/* If we are on the nalu-to-final block and there will< c203v3h"etion="+searccomment"> * be less thon=half a DMA packet left .6. the +set< c204v3h"etion="+searccomment"> * block, then we want to make ame= block a little6. c205v3h"etion="+searccomment"> * smaller to balance the sizes. Tme= e= meant to6. c206v3h"etion="+searccomment"> * avoid too small transfers if the buffer size e=6. c207v3h"etion="+searccomment"> * (MAX_DMA_PACKET_SIZE*N + 1) */6. c208v3h" if (ersh90131+code=se="+searc5901">s6.a> < (ersh90131+code=MAX_DMA_PACKET_SIZE"="+searc5901">MAX_DMA_PACKET_SIZE6.a> + ersh90131+code=MAX_DMA_PACKET_SIZE"="+searc5901">MAX_DMA_PACKET_SIZE6.a>/2))>c209v3h" rsh90131+code=block_sizee="+searc5901">block_size6.a> = ersh90131+code=MAX_DMA_PACKET_SIZE"="+searc5901">MAX_DMA_PACKET_SIZE6.a>/2s>c210v3h">c211v3h" rsh90131+code=se="+searc5901">s6.a> -= ersh90131+code=block_sizee="+searc5901">block_size6.a>s>c212v3h" ersh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=src_addr"="+searc5901">src_addr6.a> = rsh90131+code=srce="+searc5901">src6.a>s>c213v3h" ersh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=dsu_addr"="+searc5901">dsu_addr6.a> = ersh90131+code=dsue="+searc5901">dsu6.a>s>c214v3h">c215v3h" rsh90131+code=x/r"="+searc5901">x/r6.a> = ersh90131+code=.static/gfx/r_nalue="+searc5901">.static/gfx/r_nalu6.a>( rsh90131+code=x/r"="+searc5901">x/r6.a>);>c216v3h">c217v3h" if (ersh90131+code=dir"="+searc5901">dir6.a> == ersh90131+code=DMA_MEM_TO_DEV"="+searc5901">DMA_MEM_TO_DEV6.a>)>c218v3h" ersh90131+code=srce="+searc5901">src6.a> += ersh90131+code=block_sizee="+searc5901">block_size6.a>s>c219v3h" else if (ersh90131+code=dir"="+searc5901">dir6.a> == ersh90131+code=DMA_DEV_TO_MEM"="+searc5901">DMA_DEV_TO_MEM6.a>)>c220v3h" ersh90131+code=dsue="+searc5901">dsu6.a> += ersh90131+code=block_sizee="+searc5901">block_size6.a>s>c221v3h" }>c222v3h">c223v3h" ersh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=control"="+searc5901">.sntrol6.a> = ersh90131+code=.trl_eom"="+searc5901">.trl_eom6.a> | ersh90131+code=se="+searc5901">s6.a>s>c224v3h" ersh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=src_addr"="+searc5901">src_addr6.a> = rsh90131+code=srce="+searc5901">src6.a>s>c225v3h" ersh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=dsu_addr"="+searc5901">dsu_addr6.a> = ersh90131+code=dsue="+searc5901">dsu6.a>s>c226v3h">c227v3h" t type=0;>c228v3h"}>c229v3h">c230v3h"int>c231v3h"ersh90131+code=.static/gfx/r_fill_sge="+searc5901">.static/gfx/r_fill_sg6.a>(struct ersh90131+code=.static/gfpool"="+searc5901">.static/gfpool6.a> * rsh90131+code=pool"="+searc5901">pool6.a>,>c232v3h" struct ersh90131+code=.static/gfx/r"="+searc5901">.static/gfx/r6.a> * rsh90131+code=x/r"="+searc5901">x/r6.a>,>c233v3h" struct ersh90131+code=scatterlisue="+searc5901">scatterlisu6.a> * rsh90131+code=sgl"="+searc5901">sgl6.a>, unsigned int ersh90131+code=nentse="+searc5901">nents6.a>,>c234v3h" ersh90131+code=dmafaddr_ue="+searc5901">dmafaddr_uv3h" rsh90131+code=dev_addr"="+searc5901">dev_addr6.a>, ersh90131+code=u3224"+searc5901">u32v3h" ersh90131+code=.trl_chained"="+searc5901">.trl_chained6.a>, ersh90131+code=u3224"+searc5901">u32v3h" ersh90131+code=.trl"="+searc5901">.trl6.a>,>c235v3h" ersh90131+code=u3224"+searc5901">u32v3h" ersh90131+code=.trl_+set"="+searc5901">.trl_+set< a>,>c236v3h" enum rsh90131+code=dmaftransfer_direct="re="+searc5901">dmaftransfer_direct="rv3h" rsh90131+code=dir"="+searc5901">dir6.a>, ersh90131+code=u3224"+searc5901">u32v3h" ersh90131+code=.trl_irq_mask"="+searc5901">.trl_irq_mask6.a>)>c237v3h"{>c238v3h" int ersh90131+code=r"="+searc5901">i6.a>;>c239v3h" struct ersh90131+code=scatterlisue="+searc5901">scatterlisu6.a> * rsh90131+code=sg"="+searc5901">sg6.a>;>c240v3h" ersh90131+code=u3224"+searc5901">u32v3h" ersh90131+code=.trl_sge="+searc5901">.trl_sg6.a>;>c241v3h" ersh90131+code=dmafaddr_ue="+searc5901">dmafaddr_uv3h" rsh90131+code=srce="+searc5901">src6.a> = 0;>c242v3h" ersh90131+code=dmafaddr_ue="+searc5901">dmafaddr_uv3h" rsh90131+code=dsue="+searc5901">dsu6.a> = 0;>c243v3h" ersh90131+code=u3224"+searc5901">u32v3h" ersh90131+code=bytes_toftransfere="+searc5901">bytes_toftransfer6.a>;>c244v3h" ersh90131+code=u3224"+searc5901">u32v3h" ersh90131+code=elem_sizee="+searc5901">elem_size6.a>;>c245v3h">c246v3h" if (ersh90131+code=x/r"="+searc5901">x/r6.a> == ersh90131+code=NULL"="+searc5901">NULL6.a>)>c247v3h" goto rsh90131+code=err"="+searc5901">err6.a>;>c248v3h">c249v3h" ersh90131+code=spin_locke="+searc5901">spin_lock6.a>(&ersh90131+code=pool"="+searc5901">pool6.a>-xr_s rsh90131+code=lock"="+searc5901">hock6.a>);>c250v3h">c251v3h" if (ersh90131+code=dir"="+searc5901">dir6.a> == ersh90131+code=DMA_MEM_TO_DEV"="+searc5901">DMA_MEM_TO_DEV6.a>)>c252v3h" ersh90131+code=dsue="+searc5901">dsu6.a> = ersh90131+code=dev_addr"="+searc5901">dev_addr6.a>s>c253v3h" else if (ersh90131+code=dir"="+searc5901">dir6.a> == ersh90131+code=DMA_DEV_TO_MEM"="+searc5901">DMA_DEV_TO_MEM6.a>)>c254v3h" rsh90131+code=srce="+searc5901">src6.a> = rsh90131+code=dev_addr"="+searc5901">dev_addr6.a>s>c255v3h" else>c256v3h" goto rsh90131+code=err"="+searc5901">err6.a>;>c257v3h">c258v3h" ersh90131+code=for_each_sge="+searc5901">for_each_sg6.a>( rsh90131+code=sgl"="+searc5901">sgl6.a>, rsh90131+code=sg"="+searc5901">sg6.a>, rsh90131+code=nentse="+searc5901">nents6.a>, ersh90131+code=r"="+searc5901">i6.a>) {>c259v3h" if (ersh90131+code=sg_is_chain"="+searc5901">sg_is_chain6.a>( rsh90131+code=sg"="+searc5901">sg6.a>)) {>c260v3h" etion="+searccomment">/* sg .sntinues to the nalu sg-element don't< c261v3h"etion="+searccomment"> * send .trl_finish until the +set< c262v3h"etion="+searccomment"> * sg-element in the chain6. c263v3h"etion="+searccomment"> */6. c264v3h" ersh90131+code=.trl_sge="+searc5901">.trl_sg6.a> = ersh90131+code=.trl_chained"="+searc5901">.trl_chained6.a>;>c265v3h" } else if (ersh90131+code=r"="+searc5901">i6.a> == ersh90131+code=nentse="+searc5901">nents6.a> - 1)>c266v3h" ersh90131+code=.trl_sge="+searc5901">.trl_sg6.a> = ersh90131+code=.trl_+set"="+searc5901">.trl_+set< a>;>c267v3h" else>c268v3h" ersh90131+code=.trl_sge="+searc5901">.trl_sg6.a> = ersh90131+code=.trl"="+searc5901">.trl6.a> ? ersh90131+code=.trl"="+searc5901">.trl6.a> : ersh90131+code=.trl_+set"="+searc5901">.trl_+set< a>;>c269v3h">c270v3h">c271v3h" if (ersh90131+code=dir"="+searc5901">dir6.a> == ersh90131+code=DMA_MEM_TO_DEV"="+searc5901">DMA_MEM_TO_DEV6.a>)>c272v3h" etion="+searccomment">/* increment source address */6. c273v3h" rsh90131+code=srce="+searc5901">src6.a> = rsh90131+code=sg_dmafaddress"="+searc5901">sg_dmafaddress6.a>( rsh90131+code=sg"="+searc5901">sg6.a>);>c274v3h" else>c275v3h" etion="+searccomment">/* increment destinat="r address */6. c276v3h" ersh90131+code=dsue="+searc5901">dsu6.a> = ersh90131+code=sg_dmafaddress"="+searc5901">sg_dmafaddress6.a>( rsh90131+code=sg"="+searc5901">sg6.a>);>c277v3h">c278v3h" ersh90131+code=bytes_toftransfere="+searc5901">bytes_toftransfer6.a> = ersh90131+code=sg_dmaflen"="+searc5901">sg_dmaflen6.a>( rsh90131+code=sg"="+searc5901">sg6.a>);>c279v3h">c280v3h" while (ersh90131+code=bytes_toftransfere="+searc5901">bytes_toftransfer6.a>) {>c281v3h" ersh90131+code=u3224"+searc5901">u32v3h" ersh90131+code=val"="+searc5901">val< a>;>c282v3h">c283v3h" if (ersh90131+code=bytes_toftransfere="+searc5901">bytes_toftransfer6.a> xr_s ersh90131+code=MAX_DMA_PACKET_SIZE"="+searc5901">MAX_DMA_PACKET_SIZE6.a>) {>c284v3h" ersh90131+code=elem_sizee="+searc5901">elem_size6.a> = ersh90131+code=MAX_DMA_PACKET_SIZE"="+searc5901">MAX_DMA_PACKET_SIZE6.a>s>c285v3h" ersh90131+code=val"="+searc5901">val< a> = ersh90131+code=.trl_chained"="+searc5901">.trl_chained6.a>;>c286v3h" } else {>c287v3h" ersh90131+code=elem_sizee="+searc5901">elem_size6.a> = ersh90131+code=bytes_toftransfere="+searc5901">bytes_toftransfer6.a>;>c288v3h" ersh90131+code=val"="+searc5901">val< a> = ersh90131+code=.trl_sge="+searc5901">.trl_sg6.a>;>c289v3h" }>c290v3h">c291v3h" ersh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=control"="+searc5901">.sntrol6.a> = ersh90131+code=val"="+searc5901">val< a> | ersh90131+code=elem_sizee="+searc5901">elem_size6.a>;>c292v3h" ersh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=src_addr"="+searc5901">src_addr6.a> = rsh90131+code=srce="+searc5901">src6.a>s>c293v3h" ersh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=dsu_addr"="+searc5901">dsu_addr6.a> = ersh90131+code=dsue="+searc5901">dsu6.a>s>c294v3h">c295v3h" if (ersh90131+code=dir"="+searc5901">dir6.a> == ersh90131+code=DMA_DEV_TO_MEM"="+searc5901">DMA_DEV_TO_MEM6.a>)>c296v3h" ersh90131+code=dsue="+searc5901">dsu6.a> += ersh90131+code=elem_sizee="+searc5901">elem_size6.a>;>c297v3h" else>c298v3h" ersh90131+code=srce="+searc5901">src6.a> += ersh90131+code=elem_sizee="+searc5901">elem_size6.a>;>c299v3h">c300v3h" ersh90131+code=BUG_ONe="+searc5901">BUG_ON6.a>( rsh90131+code=x/r"="+searc5901">x/r6.a>-xr_s rsh90131+code=hink_addr"="+searc5901">hink_addr6.a> & 3);>c301v3h">c302v3h" ersh90131+code=bytes_toftransfere="+searc5901">bytes_toftransfer6.a> -= ersh90131+code=elem_sizee="+searc5901">elem_size6.a>;>c303v3h" ersh90131+code=x/r"="+searc5901">x/r6.a> = ersh90131+code=.static/gfx/r_nalue="+searc5901">.static/gfx/r_nalu6.a>( rsh90131+code=x/r"="+searc5901">x/r6.a>);>c304v3h" }>c305v3h">c306v3h" }>c307v3h" ersh90131+code=spin_unlocke="+searc5901">spin_unlock6.a>(&ersh90131+code=pool"="+searc5901">pool6.a>-xr_s rsh90131+code=lock"="+searc5901">hock6.a>);>c308v3h">c309v3h" t type=0;>c310v3h" rsh90131+code=err"="+searc5901">err6.a>:>c311v3h" ersh90131+code=spin_unlocke="+searc5901">spin_unlock6.a>(&ersh90131+code=pool"="+searc5901">pool6.a>-xr_s rsh90131+code=lock"="+searc5901">hock6.a>);>c312v3h" t type=-ersh90131+code=EINVAL"="+searc5901">EINVAL6.a>s>c313v3h"}>c314v3h"
The original LXR software by the LXR community6.a>, ame= experimental src="r by hxr@hinux.no6.a>.
hxr.hinux.no kindly hosted by Redpill Linpro AS6.a>, provider of Linux .snsulting and operat="rs services since 1995.