PCICONFIG_READ
NAME
pciconfig_read, pciconfig_write, pciconfig_iobase - pci device information handling
SYNOPSIS
#include <pci.h>
I int pciconfig_read(unsigned long bus , unsigned long dfn ,
I unsigned long off , unsigned long len , void * buf );
I int pciconfig_write(unsigned long bus , unsigned long dfn ,
I unsigned long off , unsigned long len , void * buf );
I int pciconfig_iobase(long which , unsigned long bus ,
I unsigned long devfn );
DESCRIPTION
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 userspace.
R pciconfig_read ()
Reads to
buf
from device
dev
at offset
off
value.
R pciconfig_write ()
Writes from
buf
to device
dev
at offset
off
value.
R pciconfig_iobase ()
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.
RETURN VALUE
R pciconfig_read ()
On success zero is returned.
On error, -1 is returned and
,I errno
is set appropriately.
R pciconfig_write ()
On success zero is returned.
On error, -1 is returned and
errno
is set appropriately.
R pciconfig_iobase ()
Returns information on locations of various I/O
regions in physical memory according to the
which
value.
Values for
which
are:
R IOBASE_BRIDGE_NUMBER ,
R IOBASE_MEMORY ,
R IOBASE_IO ,
R IOBASE_ISA_IO ,
R IOBASE_ISA_MEM .
ERRORS
EINVAL
len
value is invalid.
This does not apply to
R pciconfig_iobase ().
ENODEV
For
R pciconfig_iobase (),
"hose" value is NULL?
For the other calls, could not find a slot.
ENOSYS
The system has not implemented these calls
(CONFIG_PCI
not defined).
EOPNOTSUPP
This return value is only valid for
R pciconfig_iobase ().
It is returned if the value for
which
is invalid.
EPERM
User does not have the CAP_SYS_ADMIN capability.
This does not apply to
R pciconfig_iobase ().
CONFORMING TO
These calls are Linux specific, available since Linux 2.0.26/2.1.11.
SEE ALSO