aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorJesse Barnes <jesse.barnes@intel.com>2005-12-09 14:55:03 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-09 15:13:19 -0500
commit5d135dff536f30022674d463ce3119bb28e045df (patch)
treebfc24047c4ed8c3af5b982d1d685ec6d4dcd5dbf /Documentation
parentac7dc65ac0b945270548414491efa9c4357417d9 (diff)
[PATCH] PCI: document sysfs rom file interface
idr gently pointed out today that not only is the sysfs rom file interface somewhat unintuitive (despite my efforts and initial implementation), but it's also undocumented! This patch to Documentation/filesystems/sysfs-pci.txt corrects the latter problem; the former is a userland ABI now though, so we're stuck with it for awhile at least. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/filesystems/sysfs-pci.txt21
1 files changed, 15 insertions, 6 deletions
diff --git a/Documentation/filesystems/sysfs-pci.txt b/Documentation/filesystems/sysfs-pci.txt
index 988a62fae11f..7ba2baa165ff 100644
--- a/Documentation/filesystems/sysfs-pci.txt
+++ b/Documentation/filesystems/sysfs-pci.txt
@@ -1,4 +1,5 @@
1Accessing PCI device resources through sysfs 1Accessing PCI device resources through sysfs
2--------------------------------------------
2 3
3sysfs, usually mounted at /sys, provides access to PCI resources on platforms 4sysfs, usually mounted at /sys, provides access to PCI resources on platforms
4that support it. For example, a given bus might look like this: 5that support it. For example, a given bus might look like this:
@@ -47,14 +48,21 @@ files, each with their own function.
47 binary - file contains binary data 48 binary - file contains binary data
48 cpumask - file contains a cpumask type 49 cpumask - file contains a cpumask type
49 50
50The read only files are informational, writes to them will be ignored. 51The read only files are informational, writes to them will be ignored, with
51Writable files can be used to perform actions on the device (e.g. changing 52the exception of the 'rom' file. Writable files can be used to perform
52config space, detaching a device). mmapable files are available via an 53actions on the device (e.g. changing config space, detaching a device).
53mmap of the file at offset 0 and can be used to do actual device programming 54mmapable files are available via an mmap of the file at offset 0 and can be
54from userspace. Note that some platforms don't support mmapping of certain 55used to do actual device programming from userspace. Note that some platforms
55resources, so be sure to check the return value from any attempted mmap. 56don't support mmapping of certain resources, so be sure to check the return
57value from any attempted mmap.
58
59The 'rom' file is special in that it provides read-only access to the device's
60ROM file, if available. It's disabled by default, however, so applications
61should write the string "1" to the file to enable it before attempting a read
62call, and disable it following the access by writing "0" to the file.
56 63
57Accessing legacy resources through sysfs 64Accessing legacy resources through sysfs
65----------------------------------------
58 66
59Legacy I/O port and ISA memory resources are also provided in sysfs if the 67Legacy I/O port and ISA memory resources are also provided in sysfs if the
60underlying platform supports them. They're located in the PCI class heirarchy, 68underlying platform supports them. They're located in the PCI class heirarchy,
@@ -75,6 +83,7 @@ simply dereference the returned pointer (after checking for errors of course)
75to access legacy memory space. 83to access legacy memory space.
76 84
77Supporting PCI access on new platforms 85Supporting PCI access on new platforms
86--------------------------------------
78 87
79In order to support PCI resource mapping as described above, Linux platform 88In order to support PCI resource mapping as described above, Linux platform
80code must define HAVE_PCI_MMAP and provide a pci_mmap_page_range function. 89code must define HAVE_PCI_MMAP and provide a pci_mmap_page_range function.