OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / original / 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 buf
28 from device
29 .I dev
30 at offset
31 .I off
32 value.
33 .TP
34 .BR pciconfig_write ()
35 Writes from
36 .I buf
37 to device
38 .I dev
39 at offset
40 .I off
41 value.
42 .TP
43 .BR pciconfig_iobase ()
44 You pass it a bus/devfn pair and get a physical address for either the
45 memory offset (for things like prep, this is 0xc0000000),
46 the IO base for PIO cycles, or the ISA holes if any.
47 .SH "RETURN VALUE"
48 .TP
49 .BR pciconfig_read ()
50 On success zero is returned.
51 On error, \-1 is returned and
52 .I errno
53 is set appropriately.
54 .TP
55 .BR pciconfig_write ()
56 On success zero is returned.
57 On error, \-1 is returned and
58 .I errno
59 is set appropriately.
60 .TP
61 .BR pciconfig_iobase ()
62 Returns information on locations of various I/O
63 regions in physical memory according to the
64 .I which
65 value.
66 Values for
67 .I which
68 are:
69 .BR IOBASE_BRIDGE_NUMBER ,
70 .BR IOBASE_MEMORY ,
71 .BR IOBASE_IO ,
72 .BR IOBASE_ISA_IO ,
73 .BR IOBASE_ISA_MEM .
74 .SH ERRORS
75 .TP
76 .B EINVAL
77 .I len
78 value is invalid.
79 This does not apply to
80 .BR pciconfig_iobase ().
81 .TP
82 .B EIO
83 I/O error.
84 .TP
85 .B ENODEV
86 For
87 .BR pciconfig_iobase (),
88 "hose" value is NULL.
89 For the other calls, could not find a slot.
90 .TP
91 .B ENOSYS
92 The system has not implemented these calls
93 .RB ( CONFIG_PCI
94 not defined).
95 .TP
96 .B EOPNOTSUPP
97 This return value is only valid for
98 .BR pciconfig_iobase ().
99 It is returned if the value for
100 .I which
101 is invalid.
102 .TP
103 .B EPERM
104 User does not have the \fBCAP_SYS_ADMIN\fP capability.
105 This does not apply to
106 .BR pciconfig_iobase ().
107 .SH "CONFORMING TO"
108 These calls are Linux-specific, available since Linux 2.0.26/2.1.11.
109 .SH "SEE ALSO"
110 .BR capabilities (7)