]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/pciconfig_read.2
grfix
[thirdparty/man-pages.git] / man2 / pciconfig_read.2
CommitLineData
fea681da
MK
1.\" Contributed by Niki A. Rahimi, LTC Security Development
2.\" narahimi@us.ibm.com
3.\" May be freely distributed.
4.\"
d9343c5c 5.TH PCICONFIG_READ 2 2003-07-14 "Linux" "Linux Programmer's Manual"
fea681da
MK
6.SH NAME
7pciconfig_read, pciconfig_write, pciconfig_iobase \- pci device information handling
8.SH SYNOPSIS
9.nf
10.B #include <pci.h>
11.sp
c13182ef 12.BI "int pciconfig_read(unsigned long " bus ", unsigned long " dfn ,
62218dc0 13.BI " unsigned long " off ", unsigned long " len ", void *" buf );
c13182ef 14.BI "int pciconfig_write(unsigned long " bus ", unsigned long " dfn ,
62218dc0 15.BI " unsigned long " off ", unsigned long " len ", void *" buf );
fea681da 16.BI "int pciconfig_iobase(long " which ", unsigned long " bus ,
62218dc0 17.BI " unsigned long " devfn );
fea681da
MK
18.fi
19.SH DESCRIPTION
88210f5f 20.PP
c13182ef
MK
21Most of the interaction with PCI devices is already handled by the
22kernel PCI layer,
23and thus these calls should not normally need to be accessed from userspace.
fea681da 24.TP
e511ffb6 25.BR pciconfig_read ()
fea681da
MK
26Reads to
27.I
28buf
29from device
30.I
31dev
c13182ef 32at offset
fea681da
MK
33.I
34off
35value.
36.TP
e511ffb6 37.BR pciconfig_write ()
fea681da
MK
38Writes from
39.I
40buf
41to device
42.I
43dev
c13182ef 44at offset
fea681da
MK
45.I
46off
47value.
48.TP
e511ffb6 49.BR pciconfig_iobase ()
c13182ef
MK
50You pass it a bus/devfn pair and get a physical address for either the
51memory offset (for things like prep, this is 0xc0000000),
52the IO base for PIO cycles, or the ISA holes if any.
fea681da
MK
53.SH "RETURN VALUE"
54.TP
e511ffb6 55.BR pciconfig_read ()
c13182ef 56On success zero is returned.
09b235db 57On error, \-1 is returned and
6beb1671 58.I errno
09b235db 59is set appropriately.
fea681da 60.TP
e511ffb6 61.BR pciconfig_write ()
c13182ef 62On success zero is returned.
09b235db
MK
63On error, \-1 is returned and
64.I errno
65is set appropriately.
fea681da 66.TP
e511ffb6 67.BR pciconfig_iobase ()
988db661 68Returns information on locations of various I/O
099c2a59 69regions in physical memory according to the
c13182ef
MK
70.I which
71value.
72Values for
fea681da 73.I which
682edefb
MK
74are:
75.BR IOBASE_BRIDGE_NUMBER ,
76.BR IOBASE_MEMORY ,
77.BR IOBASE_IO ,
78.BR IOBASE_ISA_IO ,
79.BR IOBASE_ISA_MEM .
fea681da
MK
80.SH ERRORS
81.TP
82.B EINVAL
83.I len
c13182ef 84value is invalid.
5d693709
MK
85This does not apply to
86.BR pciconfig_iobase ().
fea681da
MK
87.TP
88.B EIO
89I/O error.
90.TP
91.B ENODEV
5d693709
MK
92For
93.BR pciconfig_iobase (),
c13182ef 94"hose" value is NULL?
5d693709 95For the other calls, could not find a slot.
fea681da
MK
96.TP
97.B ENOSYS
682edefb
MK
98The system has not implemented these calls
99.RB ( CONFIG_PCI
100not defined).
fea681da
MK
101.TP
102.B EOPNOTSUPP
c13182ef 103This return value is only valid for
5d693709 104.BR pciconfig_iobase ().
5d693709 105It is returned if the value for
fea681da
MK
106.I
107which
108is invalid.
109.TP
110.B EPERM
9d943010 111User does not have the \fBCAP_SYS_ADMIN\fP capability.
c13182ef 112This does not apply to
5d693709 113.BR pciconfig_iobase ().
fea681da 114.SH "CONFORMING TO"
8382f16d 115These calls are Linux-specific, available since Linux 2.0.26/2.1.11.
fea681da
MK
116.SH "SEE ALSO"
117.BR capabilities (7)