1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>pci_iomap</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Bus-Independent Device Accesses"><link rel="up" href="pubfunctions.html" title="Chapter&#160;5.&#160;Public Functions Provided"><link rel="prev" href="API-pci-iomap-range.html" title="pci_iomap_range"></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_iomap</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-pci-iomap-range.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;5.&#160;Public Functions Provided</th><td width="20%" align="right">&#160;</td></tr></table><hr></div><div class="refentry"><a name="API-pci-iomap"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>pci_iomap &#8212; 
2     create a virtual mapping cookie for a PCI BAR
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">void __iomem * <b class="fsfunc">pci_iomap </b>(</code></td><td>struct pci_dev * <var class="pdparam">dev</var>, </td></tr><tr><td>&#160;</td><td>int <var class="pdparam">bar</var>, </td></tr><tr><td>&#160;</td><td>unsigned long <var class="pdparam">maxlen</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1112385676"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>dev</code></em></span></dt><dd><p>
4     PCI device that owns the BAR
5    </p></dd><dt><span class="term"><em class="parameter"><code>bar</code></em></span></dt><dd><p>
6     BAR number
7    </p></dd><dt><span class="term"><em class="parameter"><code>maxlen</code></em></span></dt><dd><p>
8     length of the memory to map
9    </p></dd></dl></div></div><div class="refsect1"><a name="idp1112389204"></a><h2>Description</h2><p>
10   Using this function you will get a __iomem address to your device BAR.
11   You can access it using ioread*() and iowrite*(). These functions hide
12   the details if this is a MMIO or PIO address space and will just do what
13   you expect from them in the correct way.
14   </p><p>
15
16   <em class="parameter"><code>maxlen</code></em> specifies the maximum length to map. If you want to get access to
17   the complete BAR without checking for its length first, pass <code class="constant">0</code> here.
18</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-iomap-range.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="pubfunctions.html">Up</a></td><td width="40%" align="right">&#160;</td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">pci_iomap_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;</td></tr></table></div></body></html>
19