1 .\" Contributed by Niki A. Rahimi, LTC Security Development
2 .\" narahimi@us.ibm.com
3 .\" May be freely distributed.
5 .TH PCICONFIG_READ 2 2003-07-14 "Linux" "Linux Programmer's Manual"
7 pciconfig_read, pciconfig_write, pciconfig_iobase \- pci device information handling
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 );
21 Most of the interaction with PCI devices is already handled by the
23 and thus these calls should not normally need to be accessed from userspace.
37 .BR pciconfig_write ()
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.
56 On success zero is returned.
57 On error, \-1 is returned and errno is set appropriately.
59 .BR pciconfig_write ()
60 On success zero is returned.
61 On error, \-1 is returned and errno is set appropriately.
63 .BR pciconfig_iobase ()
64 Returns information on locations of various I/O
65 regions in physical memory according to the
70 are: IOBASE_BRIDGE_NUMBER, IOBASE_MEMORY,
71 IOBASE_IO, IOBASE_ISA_IO, IOBASE_ISA_MEM.
77 This does not apply to
78 .BR pciconfig_iobase ().
85 .BR pciconfig_iobase (),
87 For the other calls, could not find a slot.
90 The system has not implemented these calls (CONFIG_PCI not defined).
93 This return value is only valid for
94 .BR pciconfig_iobase ().
95 It is returned if the value for
101 User does not have the \fBCAP_SYS_ADMIN\fI capability.
102 This does not apply to
103 .BR pciconfig_iobase ().
105 These calls are Linux specific, available since Linux 2.0.26/2.1.11.