1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>pci_bus_alloc_resource</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The Linux Kernel API"><link rel="up" href="ch09s05.html" title="PCI Support Library"><link rel="prev" href="API-pci-enable-msix-range.html" title="pci_enable_msix_range"><link rel="next" href="API-pci-bus-add-device.html" title="pci_bus_add_device"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">pci_bus_alloc_resource</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-pci-enable-msix-range.html">Prev</a>&#160;</td><th width="60%" align="center">PCI Support Library</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-pci-bus-add-device.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-pci-bus-alloc-resource"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>pci_bus_alloc_resource &#8212; 
2  allocate a resource from a parent bus
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">pci_bus_alloc_resource </b>(</code></td><td>struct pci_bus * <var class="pdparam">bus</var>, </td></tr><tr><td>&#160;</td><td>struct resource * <var class="pdparam">res</var>, </td></tr><tr><td>&#160;</td><td>resource_size_t <var class="pdparam">size</var>, </td></tr><tr><td>&#160;</td><td>resource_size_t <var class="pdparam">align</var>, </td></tr><tr><td>&#160;</td><td>resource_size_t <var class="pdparam">min</var>, </td></tr><tr><td>&#160;</td><td>unsigned long <var class="pdparam">type_mask</var>, </td></tr><tr><td>&#160;</td><td>resource_size_t (*<var class="pdparam">alignf</var>)
4     <code>(</code>void *, 					  const struct resource *, 					  resource_size_t, 					  resource_size_t<code>)</code>, </td></tr><tr><td>&#160;</td><td>void * <var class="pdparam">alignf_data</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1126879580"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>bus</code></em></span></dt><dd><p>
5     PCI bus
6    </p></dd><dt><span class="term"><em class="parameter"><code>res</code></em></span></dt><dd><p>
7     resource to allocate
8    </p></dd><dt><span class="term"><em class="parameter"><code>size</code></em></span></dt><dd><p>
9     size of resource to allocate
10    </p></dd><dt><span class="term"><em class="parameter"><code>align</code></em></span></dt><dd><p>
11     alignment of resource to allocate
12    </p></dd><dt><span class="term"><em class="parameter"><code>min</code></em></span></dt><dd><p>
13     minimum /proc/iomem address to allocate
14    </p></dd><dt><span class="term"><em class="parameter"><code>type_mask</code></em></span></dt><dd><p>
15     IORESOURCE_* type flags
16    </p></dd><dt><span class="term"><em class="parameter"><code>alignf</code></em></span></dt><dd><p>
17     resource alignment function
18    </p></dd><dt><span class="term"><em class="parameter"><code>alignf_data</code></em></span></dt><dd><p>
19     data argument for resource alignment function
20    </p></dd></dl></div></div><div class="refsect1"><a name="idp1126888372"></a><h2>Description</h2><p>
21   Given the PCI bus a device resides on, the size, minimum address,
22   alignment and type, try to find an acceptable resource allocation
23   for a specific device resource.
24</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-pci-enable-msix-range.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch09s05.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-pci-bus-add-device.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">pci_enable_msix_range</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">pci_bus_add_device</span></td></tr></table></div></body></html>
25