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