share/mk/: build-html: Don't build mbind.2 and set_mempolicy.2
[man-pages.git] / man2 / pciconfig_read.2
blob06da7a6a1224001e65a19ed448d9bbc680a9912f
1 .\" Contributed by Niki A. Rahimi, LTC Security Development
2 .\" narahimi@us.ibm.com
3 .\"
4 .\" %%%LICENSE_START(FREELY_REDISTRIBUTABLE)
5 .\" May be freely distributed and modified.
6 .\" %%%LICENSE_END
7 .\"
8 .TH pciconfig_read 2 (date) "Linux man-pages (unreleased)"
9 .SH NAME
10 pciconfig_read, pciconfig_write, pciconfig_iobase \-
11 pci device information handling
12 .SH LIBRARY
13 Standard C library
14 .RI ( libc ", " \-lc )
15 .SH SYNOPSIS
16 .nf
17 .B #include <pci.h>
19 .BI "int pciconfig_read(unsigned long " bus ", unsigned long " dfn ,
20 .BI "                   unsigned long " off ", unsigned long " len ,
21 .BI "                   unsigned char *" buf );
22 .BI "int pciconfig_write(unsigned long " bus ", unsigned long " dfn ,
23 .BI "                   unsigned long " off ", unsigned long " len ,
24 .BI "                   unsigned char *" buf );
25 .BI "int pciconfig_iobase(int " which ", unsigned long " bus ,
26 .BI "                   unsigned long " devfn );
27 .fi
28 .SH DESCRIPTION
29 Most of the interaction with PCI devices is already handled by the
30 kernel PCI layer,
31 and thus these calls should not normally need to be accessed from user space.
32 .TP
33 .BR pciconfig_read ()
34 Reads to
35 .I buf
36 from device
37 .I dev
38 at offset
39 .I off
40 value.
41 .TP
42 .BR pciconfig_write ()
43 Writes from
44 .I buf
45 to device
46 .I dev
47 at offset
48 .I off
49 value.
50 .TP
51 .BR pciconfig_iobase ()
52 You pass it a bus/devfn pair and get a physical address for either the
53 memory offset (for things like prep, this is 0xc0000000),
54 the IO base for PIO cycles, or the ISA holes if any.
55 .SH RETURN VALUE
56 .TP
57 .BR pciconfig_read ()
58 On success, zero is returned.
59 On error, \-1 is returned and
60 .I errno
61 is set to indicate the error.
62 .TP
63 .BR pciconfig_write ()
64 On success, zero is returned.
65 On error, \-1 is returned and
66 .I errno
67 is set to indicate the error.
68 .TP
69 .BR pciconfig_iobase ()
70 Returns information on locations of various I/O
71 regions in physical memory according to the
72 .I which
73 value.
74 Values for
75 .I which
76 are:
77 .BR IOBASE_BRIDGE_NUMBER ,
78 .BR IOBASE_MEMORY ,
79 .BR IOBASE_IO ,
80 .BR IOBASE_ISA_IO ,
81 .BR IOBASE_ISA_MEM .
82 .SH ERRORS
83 .TP
84 .B EINVAL
85 .I len
86 value is invalid.
87 This does not apply to
88 .BR pciconfig_iobase ().
89 .TP
90 .B EIO
91 I/O error.
92 .TP
93 .B ENODEV
94 For
95 .BR pciconfig_iobase (),
96 "hose" value is NULL.
97 For the other calls, could not find a slot.
98 .TP
99 .B ENOSYS
100 The system has not implemented these calls
101 .RB ( CONFIG_PCI
102 not defined).
104 .B EOPNOTSUPP
105 This return value is valid only for
106 .BR pciconfig_iobase ().
107 It is returned if the value for
108 .I which
109 is invalid.
111 .B EPERM
112 User does not have the
113 .B CAP_SYS_ADMIN
114 capability.
115 This does not apply to
116 .BR pciconfig_iobase ().
117 .SH STANDARDS
118 Linux.
119 .SH HISTORY
120 Linux 2.0.26/2.1.11.
121 .SH SEE ALSO
122 .BR capabilities (7)