207 lines
4.3 KiB
HTML
207 lines
4.3 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of PCICONFIG_READ</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>PCICONFIG_READ</H1>
|
|
Section: Linux Programmer's Manual (2)<BR>Updated: 2016-07-17<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
pciconfig_read, pciconfig_write, pciconfig_iobase - pci device information handling
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<PRE>
|
|
<B>#include <<A HREF="file:///usr/include/pci.h">pci.h</A>></B>
|
|
|
|
<B>int pciconfig_read(unsigned long </B><I>bus</I><B>, unsigned long </B><I>dfn</I><B>,</B>
|
|
<B> unsigned long </B><I>off</I><B>, unsigned long </B><I>len</I><B>, void *</B><I>buf</I><B>);</B>
|
|
<B>int pciconfig_write(unsigned long </B><I>bus</I><B>, unsigned long </B><I>dfn</I><B>,</B>
|
|
<B> unsigned long </B><I>off</I><B>, unsigned long </B><I>len</I><B>, void *</B><I>buf</I><B>);</B>
|
|
<B>int pciconfig_iobase(long </B><I>which</I><B>, unsigned long </B><I>bus</I><B>,</B>
|
|
<B> unsigned long </B><I>devfn</I><B>);</B>
|
|
</PRE>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
|
|
Most of the interaction with PCI devices is already handled by the
|
|
kernel PCI layer,
|
|
and thus these calls should not normally need to be accessed from user space.
|
|
<DL COMPACT>
|
|
<DT id="1"><B>pciconfig_read</B>()
|
|
|
|
<DD>
|
|
Reads to
|
|
<I>buf</I>
|
|
|
|
from device
|
|
<I>dev</I>
|
|
|
|
at offset
|
|
<I>off</I>
|
|
|
|
value.
|
|
<DT id="2"><B>pciconfig_write</B>()
|
|
|
|
<DD>
|
|
Writes from
|
|
<I>buf</I>
|
|
|
|
to device
|
|
<I>dev</I>
|
|
|
|
at offset
|
|
<I>off</I>
|
|
|
|
value.
|
|
<DT id="3"><B>pciconfig_iobase</B>()
|
|
|
|
<DD>
|
|
You pass it a bus/devfn pair and get a physical address for either the
|
|
memory offset (for things like prep, this is 0xc0000000),
|
|
the IO base for PIO cycles, or the ISA holes if any.
|
|
</DL>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>RETURN VALUE</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="4"><B>pciconfig_read</B>()
|
|
|
|
<DD>
|
|
On success, zero is returned.
|
|
On error, -1 is returned and
|
|
<I>errno</I>
|
|
|
|
is set appropriately.
|
|
<DT id="5"><B>pciconfig_write</B>()
|
|
|
|
<DD>
|
|
On success, zero is returned.
|
|
On error, -1 is returned and
|
|
<I>errno</I>
|
|
|
|
is set appropriately.
|
|
<DT id="6"><B>pciconfig_iobase</B>()
|
|
|
|
<DD>
|
|
Returns information on locations of various I/O
|
|
regions in physical memory according to the
|
|
<I>which</I>
|
|
|
|
value.
|
|
Values for
|
|
<I>which</I>
|
|
|
|
are:
|
|
<B>IOBASE_BRIDGE_NUMBER</B>,
|
|
|
|
<B>IOBASE_MEMORY</B>,
|
|
|
|
<B>IOBASE_IO</B>,
|
|
|
|
<B>IOBASE_ISA_IO</B>,
|
|
|
|
<B>IOBASE_ISA_MEM</B>.
|
|
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>ERRORS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="7"><B>EINVAL</B>
|
|
|
|
<DD>
|
|
<I>len</I>
|
|
|
|
value is invalid.
|
|
This does not apply to
|
|
<B>pciconfig_iobase</B>().
|
|
|
|
<DT id="8"><B>EIO</B>
|
|
|
|
<DD>
|
|
I/O error.
|
|
<DT id="9"><B>ENODEV</B>
|
|
|
|
<DD>
|
|
For
|
|
<B>pciconfig_iobase</B>(),
|
|
|
|
"hose" value is NULL.
|
|
For the other calls, could not find a slot.
|
|
<DT id="10"><B>ENOSYS</B>
|
|
|
|
<DD>
|
|
The system has not implemented these calls
|
|
(<B>CONFIG_PCI</B>
|
|
|
|
not defined).
|
|
<DT id="11"><B>EOPNOTSUPP</B>
|
|
|
|
<DD>
|
|
This return value is valid only for
|
|
<B>pciconfig_iobase</B>().
|
|
|
|
It is returned if the value for
|
|
<I>which</I>
|
|
|
|
is invalid.
|
|
<DT id="12"><B>EPERM</B>
|
|
|
|
<DD>
|
|
User does not have the
|
|
<B>CAP_SYS_ADMIN</B>
|
|
|
|
capability.
|
|
This does not apply to
|
|
<B>pciconfig_iobase</B>().
|
|
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>CONFORMING TO</H2>
|
|
|
|
These calls are Linux-specific, available since Linux 2.0.26/2.1.11.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?7+capabilities">capabilities</A></B>(7)
|
|
|
|
<A NAME="lbAI"> </A>
|
|
<H2>COLOPHON</H2>
|
|
|
|
This page is part of release 5.05 of the Linux
|
|
<I>man-pages</I>
|
|
|
|
project.
|
|
A description of the project,
|
|
information about reporting bugs,
|
|
and the latest version of this page,
|
|
can be found at
|
|
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="13"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="14"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="15"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="16"><A HREF="#lbAE">RETURN VALUE</A><DD>
|
|
<DT id="17"><A HREF="#lbAF">ERRORS</A><DD>
|
|
<DT id="18"><A HREF="#lbAG">CONFORMING TO</A><DD>
|
|
<DT id="19"><A HREF="#lbAH">SEE ALSO</A><DD>
|
|
<DT id="20"><A HREF="#lbAI">COLOPHON</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:33 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|