linux/sound/firewire/iso-resources.c
<<
opti8opti8op//spa v3op/spa class="lxr_search">opti ="+search" method="post" onsubmit="return do_search(this);">opti8opti8opti8Searchopti8op//spa v3ti8< ="ajax+*" method="post" onsubmit="return false;">op/input typ3nthidden" nam3ntajax_lookup" idntajax_lookup" alu33nt">oti8< 3 /div idntfile_contents"v
< <1//a>/spa  class="comment">/*//spa v3< <2//a>/spa  class="comment"> * isochronous resources helper func>
  s//spa v3< <3//a>/spa  class="comment"> *//spa v3< <4//a>/spa  class="comment"> * Copyright (c) Clemens Ladisch <clemens@ladisch.de>//spa v3< <5//a>/spa  class="comment"> * Licensed under the terms of the GNU General Public License, versin v2.//spa v3< <6//a>/spa  class="comment"> *///spa v3< <7//a>o< <8//a>#include <linux/device.h//a>>o< <9//a>#include <linux/firewire.h//a>>o< 3"
	a>#include <linux/firewire-constants.h//a>>o< 11
	a>#include <linux/export.h//a>>o< 12
	a>#include <linux/jiffies.h//a>>o< 13
	a>#include <linux/mutex.h//a>>o< 14
	a>#include <linux/sched.h//a>>o< 15
	a>#include <linux/spinlock.h//a>>o< 16
	a>#include "iso-resources.h//a>"o< 17//a>o< 18//a>/spa  class="comment">/**//spa v3< 19//a>/spa  class="comment"> * fw_iso_resources_init - initializes a &struct fw_iso_resources//spa v3< 20//a>/spa  class="comment"> * @r: the resource manager to initialize//spa v3< 21//a>/spa  class="comment"> * @unit: the device unit for which the resources will be needed//spa v3< 22//a>/spa  class="comment"> *//spa v3< 23//a>/spa  class="comment"> * If the device does not support all channel numbers, change @r->channels_mask//spa v3< 24//a>/spa  class="comment"> * after calling this func>
  .//spa v3< 25//a>/spa  class="comment"> *///spa v3< 26
	a>intfw_iso_resources_init
	a>(struct /a href="+code=fw_iso_resources" class="sref">fw_iso_resources
	a> */a href="+code=r" class="sref">r
	a>, struct /a href="+code=fw_unit" class="sref">fw_unit
	a> */a href="+code=unit" class="sref">unit
	a>)3< 27//a>{3< 28//a>        /a href="+code=r" class="sref">r
	a>->/a href="+code=channels_mask" class="sref">channels_mask//a> = ~0uLL;o< 29//a>        /a href="+code=r" class="sref">r
	a>->/a href="+code=unit" class="sref">unit
	a> = /a href="+code=fw_unit_get" class="sref">fw_unit_get
	a>(/a href="+code=unit" class="sref">unit
	a>);o< 30//a>        /a href="+code=mutex_init" class="sref">mutex_init
	a>(&/a href="+code=r" class="sref">r
	a>->/a href="+code=mutex" class="sref">mutex
	a>);o< 31//a>        /a href="+code=r" class="sref">r
	a>->/a href="+code=allocated" class="sref">allocated
	a> = /a href="+code=false" class="sref">false
	a>;o< 32//a>o< 33//a>        return 0;o< 34//a>}o< 35//a>/a href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOL
	a>(/a href="+code=fw_iso_resources_init" class="sref">fw_iso_resources_init
	a>);o< 36//a>o< 37//a>/spa  class="comment">/**//spa v3< 38//a>/spa  class="comment"> * fw_iso_resources_destroy - destroy a resource manager//spa v3< 39//a>/spa  class="comment"> * @r: the resource manager that is no longer needed//spa v3< 40//a>/spa  class="comment"> *///spa v3< 41//a>voidfw_iso_resources_destroy
	a>(struct /a href="+code=fw_iso_resources" class="sref">fw_iso_resources
	a> */a href="+code=r" class="sref">r
	a>)3< 42//a>{3< 43//a>        /a href="+code=WARN_ON" class="sref">WARN_ON
	a>(/a href="+code=r" class="sref">r
	a>->/a href="+code=allocated" class="sref">allocated
	a>);o< 44//a>        /a href="+code=mutex_destroy" class="sref">mutex_destroy
	a>(&/a href="+code=r" class="sref">r
	a>->/a href="+code=mutex" class="sref">mutex
	a>);o< 45//a>        /a href="+code=fw_unit_put" class="sref">fw_unit_put
	a>(/a href="+code=r" class="sref">r
	a>->/a href="+code=unit" class="sref">unit
	a>);o< 46//a>}o< 47//a>/a href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOL
	a>(/a href="+code=fw_iso_resources_destroy" class="sref">fw_iso_resources_destroy
	a>);o< 48//a>o< 49//a>static unsigned intpacket_bandwidth
	a>(unsigned intmax_payload_bytes
	a>, intspeed
	a>)3< 50//a>{3< 51//a>        unsigned intbytes
	a>, /a href="+code=s400_bytes" class="sref">s400_bytes
	a>;o< 52//a>o< 53//a>        /spa  class="comment">/* iso packets have three header quadlets and quadlet-aligned payload *///spa v3< 54//a>        /a href="+code=bytes" class="sref">bytes
	a> = 3 * 4 + /a href="+code=ALIGN" class="sref">ALIGN
	a>(/a href="+code=max_payload_bytes" class="sref">max_payload_bytes
	a>, 4);o< 55//a>o< 56//a>        /spa  class="comment">/* convert to bandwidth units (quadlets at S1600 = bytes at S400) *///spa v3< 57//a>        if (/a href="+code=speed" class="sref">speed
	a> <= /a href="+code=SCODE_400" class="sref">SCODE_400
	a>)3< 58//a>                /a href="+code=s400_bytes" class="sref">s400_bytes
	a> = /a href="+code=bytes" class="sref">bytes
	a> * (1 << (/a href="+code=SCODE_400" class="sref">SCODE_400
	a> - /a href="+code=speed" class="sref">speed
	a>));o< 59//a>        else3< 60//a>                /a href="+code=s400_bytes" class="sref">s400_bytes
	a> = /a href="+code=DIV_ROUND_UP" class="sref">DIV_ROUND_UP
	a>(/a href="+code=bytes" class="sref">bytes
	a>, 1 << (/a href="+code=speed" class="sref">speed
	a> - /a href="+code=SCODE_400" class="sref">SCODE_400
	a>));o< 61//a>o< 62//a>        return /a href="+code=s400_bytes" class="sref">s400_bytes
	a>;o< 63//a>}o< 64//a>o< 65//a>static intcurrent_bandwidth_overhead
	a>(struct /a href="+code=fw_card" class="sref">fw_card
	a> */a href="+code=card" class="sref">card
	a>)3< 66//a>{3< 67//a>        /spa  class="comment">/*//spa v3< 68//a>/spa  class="comment">         * Under the usual pessimistic assumptin v(cable length 4.5 m), the//spa v3< 69//a>/spa  class="comment">         * isochronous overhead for N cables is 1.797 µs + N * 0.494 µs, or//spa v3< 70//a>/spa  class="comment">         * 88.3 + N * 2pto in bandwidth units.//spa v3< 71//a>/spa  class="comment">         *//spa v3< 72//a>/spa  class="comment">         * The calculatin vbelow tries to deduce N from the current gap count.//spa v3< 73//a>/spa  class="comment">         * If the gap count hasvbeen   >
mized by measuring the ac>ual packet//spa v3< 74//a>/spa  class="comment">         * transmissin v>
me, this derived overhead should be near the ac>ual//spa v3< 75//a>/spa  class="comment">         * overhead asvwell.//spa v3< 76//a>/spa  class="comment">         *///spa v3< 77//a>        return /a href="+code=card" class="sref">card
	a>->/a href="+code=gap_count" class="sref">gap_count
	a> < 63 ? /a href="+code=card" class="sref">card
	a>->/a href="+code=gap_count" class="sref">gap_count
	a> * 97 / 10 + 89 : 512;o< 78//a>}o< 79//a>o< 80//a>static intwait_isoch_resource_delay_after_bus_reset
	a>(struct /a href="+code=fw_card" class="sref">fw_card
	a> */a href="+code=card" class="sref">card
	a>)3< 81//a>{3< 82//a>        for (;;) {3< 83//a>                /a href="+code=s64" class="sref">s64//a> /a href="+code=delay" class="sref">delay
	a> = (/a href="+code=card" class="sref">card
	a>->/a href="+code=reset_jiffies" class="sref">reset_jiffies
	a> + /a href="+code=HZ" class="sref">HZ
	a>) - /a href="+code=get_jiffies_64" class="sref">get_jiffies_64
	a>();o< 84//a>                if (/a href="+code=delay" class="sref">delay
	a> <= 0)3< 85//a>                        return 0;o< 86//a>                if (/a href="+code=schedule_>
meout_interru >
ble" class="sref">schedule_>
meout_interru >
ble
	a>(/a href="+code=delay" class="sref">delay
	a>) > 0)3< 87//a>                        return -/a href="+code=ERESTARTSYS" class="sref">ERESTARTSYS
	a>;o< 88//a>        }o< 89//a>}o< 90//a>o< 91//a>/spa  class="comment">/**//spa v3< 92//a>/spa  class="comment"> * fw_iso_resources_allocate - allocate isochronous channel and bandwidth
	spa v3< 93//a>/spa  class="comment"> * @r: the resource manager
	spa v3< 94//a>/spa  class="comment"> * @max_payload_bytes: the amount of data (including CIP headers) per packet//spa v3< 95//a>/spa  class="comment"> * @speed: the speed (e.g., SCODE_400) at which the packets will be sent//spa v3< 96//a>/spa  class="comment"> *//spa v3< 97//a>/spa  class="comment"> * This func>
   allocates one isochronous channel and enough bandwidth for the//spa v3< 98//a>/spa  class="comment"> * specified packet size.//spa v3< 99//a>/spa  class="comment"> *//spa v3<100//a>/spa  class="comment"> * Returns the channel number that the caller must use for streaming, or//spa v3<101//a>/spa  class="comment"> * a negative error code.  Due to potent
  ally long delays, this func>
   is//spa v3<102//a>/spa  class="comment"> * interru >
ble and ca  return -ERESTARTSYS.  On success, the caller is//spa v3<103//a>/spa  class="comment"> * respons
ble for calling fw_iso_resources_update() n vbus resets, and//spa v3<104//a>/spa  class="comment"> * fw_iso_resources_free() when the resources are not longer needed.//spa v3<105//a>/spa  class="comment"> *///spa v3<106
	a>intfw_iso_resources_allocate
	a>(struct /a href="+code=fw_iso_resources" class="sref">fw_iso_resources
	a> */a href="+code=r" class="sref">r
	a>,3<107//a>                              unsigned intmax_payload_bytes
	a>, intspeed
	a>)3<108//a>{3<109//a>        struct /a href="+code=fw_card" class="sref">fw_card
	a> */a href="+code=card" class="sref">card
	a> = /a href="+code=fw_parent_device" class="sref">fw_parent_device
	a>(/a href="+code=r" class="sref">r
	a>->/a href="+code=unit" class="sref">unit
	a>)->/a href="+code=card" class="sref">card
	a>;o3
/div idntfile_contents"v->/a href="+code=unit" class=inel number that the caller must  that nit" class=inel numbee cthe caller muste ctL110" class="line" nam3nttL10"so-re1 c#L68" idntt;< 62//a>        re1lt;schedule_>ss="sref">r
	a>->/a href="+code=allocated" class="sref">allocated
	a>);o<108//a>{3 /a href="+codeRTSYS
	a>;o< 65//a>static int1lt;(/a href="+codss="sref">allocated
	a>);o(/a igned intspeed
	a>)3< 37//a>/spa  clas1sound/fireewire/iso-resources.c#L188" id11SYMBOL
	a>(/a href="RTSray_after_bus_reset
	a>(struct /aRTSray_after_bus_reseYMBO:class="line" nam3ntL37">< 37//a>/spa  clas1s="sound/ft">/**//spa v3reset_jiffies
	a> + /a hrefL16"s" class="sref"L16"tL1080" class="line" nam3nttL10"so-re1 c#L68" idnttruct /a t"> * fw_iso_resources_innit -11a href="+code=unit" class="sref">unit
	a> = /a href="+code=fw_unit_geg/fireL102ewire/iso-resourcfireL102nit"ent_device
	a>(/a t" class="sref">gap_count
	a> * 97 / 10 + 89 : 5/fireL102ewire/iso-resourcfireL102nit" class="line" nam3ntL12">< 12
	a>#include <L68"v idnt"> * @r: the resource m1anage12tex_init
	a>(&/a href="+ss="sref">allocated
	a>);ofw_card
	aent_device
	a>(/a tth_overhead
	a>(struct /a href="+code=fw_card" class="sref">fw_card
	a>und/firewire/iso-resources.c#L81" idntL81"  class="line" nam3ntL12">< 12
	a>#include <t; * @unit: the device 1unit 12a href="+code=allocated" cla" c#_unL16"_irqesources.c#L108" c#_unL16"_irqss="s+code=mutex" class="ffies" class="sref">reset_jiffies
	a> + /a hrefL16"s" class="sref"L16"tL1080" class="line" nam3nttL10"so-re1 c#L68" idns="commen1t"> *//spa v3< 53//a>        /s1s="commen1t"> * If the device does1 not 12ON
	a>(/a href="+code=r" clae cthe caller muste ctL11ent_device
	a>(/a >wait_isoch_resource_delay_after_bus_reset
	a>(struct /a href="+code=fw_card" class="sref">fw_card
	a>und/firewire/iso-resources.c#L81" idntL81"  class="line" nam3ntL12">< 12
	a>#include <ss="commet"> * after calling this1 func12ref">delay
	as="sref">schedule_>e cthe caller muste ctL11et;/a " class="line" nam3ntL87">< 87//a>          1s="commen1t"> *///spa v3< 37//a>/spa  clas1"sound/fi1rewire/iso-resources.c#L128" i127N
	a>(/a href="+code=r" cla
	a>-&L16"s" class="sref"
	a>-&L16"ss="s+code=mutex" class="sref">mutex
	a>);o< 45//a>        /a1 href="+c1ode=r" class="sref">r
	a1>->12L49" class="line" nam3ntL49">< 49//a>static uns1 href="+c1ode=r" class="sref">r
	a1>->1/a href="+code=unit" class="sc#L8de.4
	a>->/a href="+code=unit"ent_device
	a>(/a ss="sref">allocated
	a>);oallocated
	a>);ofw_card
	a class="line" nam3ntL13">< 13
	a>#include <L68"v idnode=mutex_init" class="s1ref">1utex_init
	a>(&/a href="+	a>,3r
	a>,3und/firewire/iso-resources.c#L81" idntL81"hrsound/firewire/ref">unit
	a> = /a href="+code=fw_unit_geg/fireL102ewire/iso-resourcfireL102nit"hrsound/firewire/ref">unit
	a> = /a href="+code=fw_unit_ge<107//a>         href="+c1ode=r" class="sref">r
	a1>->1/a href="+codeeeeeeeeeeeeeeeeeeeeeeee+code=mutex" class="f that the caller must  that nit" c+code=mutex" class="c#L8de.4
	a>->/a href="+code=unit" class=inel numbetruiclass="sref">r
truitL45" class="line" nam3ntL45">< 45//a>        /a1sound/fir1ewire/iso-resources.c#L313" id13ources.c#L83"s="sref">schedule_>f that the caller must  that nit" ==	a>;or
	a>->/anAGAIe87" id9" class="line" nam3ntL109"><109//a>        turn 0;o<1a href="sound/firewire/i1so-re1364//a> /a href="+code=delay" class="
	a>-&unL16"s" class="sref"
	a>-&unL16"ss="s+code=mutex" class="sref">mutex
	a>);o< 45//a>        /a1"sound/fi1rewire/iso-resources.c#L135" i13ref">delay
	a> <= gotorsound/firewire/rTSray_after_bus_reset
	a>(struct /aRTSray_after_bus_reseYMBO class="line" nam3ntL45">< 45//a>        /a1"="commen1RT_SYMBOL" class="sref">1EXPOR13irewire/iso-r class="line" nam3ntL90">< 90//a>oschedule_>f that the caller must  that nit" ref=85" d9" class="line" nam3ntL109"><109//a>        tsound/fi1t">/**//spa v3unit
	a> = /a href="+code=fw_unit_ge< 45//a>        /a1"href="+c1t"> * fw_iso_resources_d1estro13sref">s400_bytes
	a> = /a href="+codss="sref">allocated
	a> = /a href="+code=false" class="sref">false
	a>;or
truitL45 class="line" nam3ntL45">< 45//a>        /a1"href="+c1t"> * @r: the resource m1anage13a href="+code}L60" d9" class="line" nam3ntL109"><109//a>        s="commen1t"> *///spa v3s400_bytes
	a> s="sref">schedule_>f that the caller must  that nit" ==	a>;o<108//a>{3mutex
	a>);ocard
	a>;or
	href="+cod7" class="line" nam3ntL107"><107//a>        "sound/fi1rewire/iso-resources.c#L143" i142 href="+codeeeeeeeeeeeeeeeeeeeeeeeee>/iso-resourcstso-r"ntL17" iound/firewire/iso-resexhausoisntL106" class="line" nam3ntL45">< 45//a>        /a1 href="+c1ode=WARN_ON" class="sref1">WAR1464//a> /a href="+code60" class="line" nam3ntL60">< 60//a>          1 href="+c1ode=mutex_destroy" class1="sre14ref">delay
	a> <= eeeeeeee>;omutex
	a>);ocard
	a>;or
	href="+cod7" class="line" nam3ntL107"><107//a>        "="commen1ode=fw_unit_put" class="1sref"14irewire/iso-resources.c#L86" eeeeeeee>/iso-resourcstso-r"ntL17" iound/firewire/iso-r for the102"failisntL106" class="line" nam3ntL45">< 45//a>        /a1 ound/fir1rewire/iso-resources.c#L147" i146rewire/iso-r class="line" nam3ntL90">< 90//a>o1EXPOR14L18" class="line" nam3ntL18">< 18//a>/spa  classsound/fir1ewire/iso-resources.c#L419" id14a href="+code=channels_mask"
	a>-&unL16"s" class="sref"
	a>-&unL16"ss="s+code=mutex" class="sref">mutex
	a>);o< 45//a>        /a1igned int1< 80//a>static int1"sound/fi1rewire/iso-resources.c#L151" i15sref">s400_bya href="+code=gap_count that the caller must  that nit" class="line" nam3ntL45">< 45//a>        /a1signed in1t< 90//a>o;ofw_iso_resources_destroy
	a>);of" class="line" nam3ntL45">< 45//a>        /a1pa  class1="comment">/* iso packet1s hav1 threeclass="line" nam3ntL45">< 45//a>        /a1phref="+c1ode=bytes" class="sref">1bytes15hen the resources are not l idntL19" class="line" nam3ntL19">< 19//a>/spa  classsound/fir1ewire/iso-resources.c#L516" id15SCODE_400) at which the packethref="sound/firewire/is - ire/is re/iso-r for the102sewire/iaources.c#LntL19" class="line" nam3ntL19">< 19//a>/spa  classsound/fir1="comment">/* convert to1 band15ewire/iso-resources.c#L97" ide/iso-resources.c#L94" idntL94" class="line" nam3ntL94">< 94//a>/spa  clas1 (/a href1="+code=speed" class="sr1ef">s15ne isochronous channel and enntL94" class="line" nam3ntL94">< 94//a>/spa  clas1 ound/fir1href="+code=s400_bytes" 1class15pa v3< 94//a>/spa  clas1 gned int1f="sound/firewire/iso-re1sourc15that is no longer needed//spa anyire/iso-resef="swerr for the/fireforeiso-rurces.c#L.  Io-ressaf3< 94//a>/spa  clas1      /a 1href="+code=s400_bytes" 1class16r that the caller must use forources.c#L102" fsourfirewire/iso-r_card" ly for the/fidntL105" class="line" nam3ntL105"><105//a>/spa  clsound/fir1ewire/iso-resources.c#L612" id16ue to potent
  ally long deladntL105" class="line" nam3ntL105"><105//a>/spa  clsound/fir1ref="+code=s400_bytes" c1lass=16urn -ERESTARTSYS.  On success, streamis, this func>
   is// 02"failur/spa>ual id */ppenources.c#L103"re/idntL105" class="line" nam3ntL105"><105//a>/spa  clsa  class1rewire/iso-resources.c#L164" i16w_iso_resources_update() n vbustoprces.c#L10idntL105" class="line" nam3ntL105"><105//a>/spa  clshref="+c1ewire/iso-resources.c#L615" id16hen the resources are not lonidntL106" class="line" nam3ntL106"><106
	a>intfw_iso_resources_allocate
	a>(stire/ishref="+code=fw_iso_resources" clire/isef">f_iso_resources
	a> */a href="+code=r" class="sref">r
	a>)3< 42//a>{3< 67//a>        /s1pa  class1="comment">/*//spa v3card
	a> = /a href="+code=fw_parent_device" class="sref">fw_parent_device
	a>(/a href="+code=r" class="sref">r
	a>->/a href="+code=unit" class="sref">unit
	a>)->/a href="+code=card" class="sref">card
	a>;ofw_par class="line" nam3ntL16">< 16
	a>#include &quound/fir1t">         * Under the 1usual16a href="+codewire/iso-resources.c#L8de.4
	a>->/a href="+code=unit" class=inel number that the caller must  that nit" class="line" nam3ntL16">< 16
	a>#include &qugned int1t">         * isochronou1s ove16L80" class="line" nam3ntL80">< 80//a>static int1s="commen1t">         * 88.3 + N *1 2pto17tex_init
	a>(&/a href="+code=rL16"s" class="sref"
	a>-&L16"ss="s+code=mutex" class="sref">mutex
	a>);o< 45//a>        /a1s="commen1t">         *//spa v3< 62//a>        re1s="commen1t">         * The calcul1atin 17ources.c#L83"s="s!= /a href="+codss="sref">allocated
	a> = /a href="+code=false" class="sref">false
	a>;o<109//a>        s="commen1t">         * If the gap1 coun1764//a> /a href="+code=delay" class="
	a>-&unL16"s" class="sref"
	a>-&unL16"ss="s+code=mutex" class="sref">mutex
	a>);o< 45//a>        /a1s="commen1t">         * transmissi1n v>
17ref">delay
	a> <= idntL86" class="line" nam3ntL86">< 86//a>          1s="commen1t">         * overhead a1svwel17irewire/iso-r class="line" nam3ntL90">< 90//a>o         *///spa v3< 37//a>/spa  clas17ound/firewwire/iso-resources.c#L18"ref=177N
	a>(/a href="+code=r" clas.c#_L16"_irqesources.c#L108" c#_L16"_irqss="s+code=mutex" class="ffies" class="sref">reset_jiffies
	a> + /a hrefL16"s" class="sref"L16"tL1080" class="line" nam3nttL10"so-re1 c#L68" idn"sound/fi1rewire/iso-resources.c#L179" i17a href="+code=channels_mask" class="sref">channels_mask//a> = ~0uLL;og/fireL102ewire/iso-resourcfireL102nit"ent_device
	a>(/a t" class="sref">gap_count
	a> * 97 / 10 + 89 : 5/fireL102ewire/iso-resourcfireL102nit" class="line" nam3ntL12">< 12
	a>#include &lsound/fir1ewire/iso-resources.c#L810" id17a href="+code=unit" class="sref">unit
	a> = /a href="+code=fw_unit_gec#L8de.4
struct /a href="+code=fwlass="sref">fw_card
	aent_device
	a>(/a tth_overhead
	a>(struct /a href="+code=fw_card" class="sref">fw_card
	a>und/firewire/iso-resources.c#L81" idntL81"  class="line" nam3ntL12">< 12
	a>#include &l(&/a href="+" c#_unL16"_irqesources.c#L108" c#_unL16"_irqss="s+code=mutex" class="ffies" class="sref">reset_jiffies
	a> + /a hrefL16"s" class="sref"L16"tL1080" class="line" nam3nttL10"so-re1 c#L68" idn"sound/fi1rewire/iso-resources.c#L182" i18L62" class="line" nam3ntL62">< 62//a>        re1r (;;) {31(/a ss="sref">allocated
	a>);oallocated
	a>);ofw_card
	a class="line" nam3ntL13">< 13
	a>#include &l      /a 1href="+code=s64" class="1sref"18threeclass="line" nam3ntL45">< 45//a>        /a1      if 1(/a href="+code=delay" c1lass=1sref">delay
	asources
	a> */a href="+code=r"_L94" iclass="sref">r
	a>,3und/firewire/iso-resources.c#L81" idntL81"hrsound/firewire/ref">unit
	a> = /a href="+code=fw_unit_geg/fireL102ewire/iso-resourcfireL102nit"hr1uLL - /a hrefsound/firewire/ref">unit
	a> = /a href="+code=fw_unit_ge<107//a>                 1     return 0;or
truitL45" class="line" nam3ntL45">< 45//a>        /a1      if 1(/a href="+code=schedule1_>
me18dth units (quadlets at S1600 = bytes dntL106" class="line" nam3ntL106"><106
	a>int<106
	a>int/**//spa v3<105//a>/spa  cl"sound/fi1rewire/iso-resources.c#L190" i18ead for N cables is 1.797 µs + N * 0idntL106" class="line" nam3ntL106"><106
	a>intschedule_>f that the caller must  that nit" r;/a "c+code+codeclass=inel number that the caller must  that nit" !=	a>;or
	a>->/anAGAIe87" id9" class="line" nam3ntL109"><109//a>        s="commen1t">/**//spa v3allocated
	a> = /a href="+code=false" class="sref">false
	a>;o< 32//a>o * fw_iso_resources_a1lloca192 href="+codeeeeeeeees="sref">schedule_>f that the caller must  that nit" ==	a>;o<108//a>{3 * @r: the resource m1anage1964//a> /a href="+codeeeeeeeee= /a href="+coddev_e cthe caller mustdev_e css="s+code=mutex" class="sref">mutex
	a>);ocard
	a>;or
	href="+cod7" class="line" nam3ntL107"><107//a>        s="commen1t"> * @max_payload_bytes1: the19ref">delay
	a> <= eeeeeeeenits (quadlets at S16stso-r"ntL17" iound/firewire/iso-resexhausoisntL106" class="line" nam3ntL45">< 45//a>        /a1s="commen1t"> * @speed: the speed 1(e.g.19irewire/iso-resources60" class="line" nam3ntL60">< 60//a>          1s="commen1t"> *//spa v3mutex
	a>);ocard
	a>;or
	href="+cod7" class="line" nam3ntL107"><107//a>        s        1t"> * This func>
   allo1cates19="+code=max_payload_bytes" class="see>/iso-resourcstso-r"ntL17" iound/firewire/iso-r for the102"failisntL106" class="line" nam3ntL45">< 45//a>        /a1s="commen1t"> * specified packet s1ize./19L89" idntL89" class="line" nam3ntL89">< 89//a>}o *//spa v3< 80//a>static int2ass="comm2nt"> * Returns the chann2l num20tex_init
	a>(&/a href="+code=runL16"s" class="sref"
	a>-&unL16"ss="s+code=mutex" class="sref">mutex
	a>);o< 45//a>        /a2ass="comm2nt"> * a negative error 2ode. 20L62" class="line" nam3ntL62">< 62//a>        re2ass="comm2nt"> * interru >
ble and2ca  r20ref">s400_bytes
	a>;o< 16
	a>#include &2ass="comm2nt"> * respons
ble for c2lling20tL64" class="line" nam3ntL64">< 64//a>o * fw_iso_resources_2ree()2when th;ofw_iso_resources_destroy
	a>);o" class="line" nam3ntL45">< 45//a>        /a2a5s="comm2n"> * @speed: the speed 2ound/20L56" class="line" nam3ntL56">< 56//a>        /s2ref="+cod2=fw_iso_resources_alloca2e" cl20ewire/iso-resources.c#L97"  idntL19" class="line" nam3ntL19">< 19//a>/spa  clas2         2            unsigned int2/a hr20ne isochronous channel and enoer needed.//spa v3< 19//a>/spa  clas2 8       2 "> * specified packet s2109" 20pa v3< 94//a>/spa  clas2struct /a2href="+code=fw_card" cla2s="sr20ewire/iso-resources.c#L100" idntL100" class="line" nam3ntL100"><100//a>/spa  c2tL68"v id2tcontent">3
/div idntfil2_cont21r that the caller must use forugh bandwidth defor the//sng, or//spa ces.c#L93" id,es="for the/fidntL105" class="line" nam3ntL105"><105//a>/spa  c2tt;<106
	a>intfw_iso_resources_destroy
	a>(stru3f_iso_resources
	a> */a href="+code=r" class="sref">r
	a>)3< 42//a>{3<109//a>       2tss="comm2f="include/linux/sched.h2" cla21ref">delay
	a */a href="+code=card" class="sref">card
	a> = /a href="+code=fw_parent_device" class="sref">fw_parent_device
	a>(/a href="+code=r" class="sref">r
	a>->/a href="+code=unit" class="sref">unit
	a>)->/a href="+code=card" class="sref">card
	a>;ofw_par class="line" nam3ntL16">< 16
	a>#include &2lt;->/a href="+code=unit" class=inel number that the caller must  that nit" class="line" nam3ntL16">< 16
	a>#include &2tef="+cod2ref="sound/firewire/iso-2resou21L37" class="line" nam3ntL37">< 37//a>/spa  clas2sound/fir2ewire/iso-resources.c#L128" id217N
	a>(/a href="+code=r" cla
	a>-&L16"s" class="sref"
	a>-&L16"ss="s+code=mutex" class="sref">mutex
	a>);o< 45//a>        /a2s="sound/2t">/**//spa v3< 49//a>static uns2ttruct /a2t"> * fw_iso_resources_i2nit -21a href="+codes="sref">schedule_>ss="sref">allocated
	a> = /a href="+code=false" class="sref">false
	a>;o<109//a>       2tL68"v id2t"> * @r: the resource m2anage22sref">s400_bytes
	a> = /a href="+codc#L8de.4
	a>->/a href="+code=unit"ent_device
	a>(/a ss="sref">allocated
	a>);oallocated
	a>);ofw_card
	a class="linine" nam3ntL109"><109//a>       2tt; * @unit: the device 2unit 22a href="+codeeeeeeeee= /a href="+cod href="+code=r"_L94" iclass="sref">r
	a>,3und/firewire/iso-resources.c#L81" idntL81"hrsound/firewire/ref">unit
	a> = /a href="+code=fw_unit_geg/fireL102ewire/iso-resourcfireL102nit"hr1uLL - /a hrefsound/firewire/ref">unit
	a> = /a href="+code=fw_unit_ge<107//a>       2s="commen2t"> *//spa v3< 45//a>        /a2s="commen2t"> * If the device does2 not 2264//a> /a href="+codew="sref">schedule_>f that the caller must  that nit" r;/a " class="line" nam3ntL42">< 42//a>{3 * after calling this2 func22ref">delay
	a> <= eeeeeeee= /a href="+coddev_e cthe caller mustdev_e css="s+code=mutex" class="sref">mutex
	a>);ocard
	a>;or
	href="+cod7" class="line" nam3ntL107"><107//a>       2s="commen2t"> *///spa v3isntL106" class="line" nam3ntL45">< 45//a>        /a2f="+code=2fw_iso_resources_init" c2lass=22L37" class="line" nam3ntL37">< 37//a>/spa  clas2"sound/fi2rewire/iso-resources.c#L228" i22="+code=max_payload_bsound/firewire/ref">unit
	a> = /a href="+code=fw_unit_gefalse" class="sref">false
	a>;o< 32//a>or
	a2>->22L89" idntL89" class="line" nam3ntL89">< 89//a>}or
	a2>->22L80" class="line" nam3ntL80">< 80//a>static int2tL68"v id2ode=mutex_init" class="s2ref">2utex_init
	a>(&/a href="+code=runL16"s" class="sref"
	a>-&unL16"ss="s+code=mutex" class="sref">mutex
	a>);o< 45//a>        /a2 href="+c2ode=r" class="sref">r
	a2>->23sref" class="line" nam3ntL90">< 90//a>o;ofw_iso_resources_destroy
	a>);o" class="line" nam3ntL45">< 45//a>        /a2 ="commen2a href="sound/firewire/i2so-re2364//a


t gaoriginal LXR softwso-rbysng, lass="linhttp://> forge.net/projects/lxr">LXR y lo>;ofwual//byslass="linmailto:lxr@nd/ux.no">lxr@nd/ux.nonit".
lxr.nd/ux.no kindly host/firewlass="linhttp://www.redpill-nd/pro.no">Redpill Ld/pro ASnit" cprovim), of Ld/ux y nsult3