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