diff options
Diffstat (limited to 'Documentation/filesystems')
-rw-r--r-- | Documentation/filesystems/sysfs-pci.txt | 21 |
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 @@ | |||
1 | Accessing PCI device resources through sysfs | 1 | Accessing PCI device resources through sysfs |
2 | -------------------------------------------- | ||
2 | 3 | ||
3 | sysfs, usually mounted at /sys, provides access to PCI resources on platforms | 4 | sysfs, usually mounted at /sys, provides access to PCI resources on platforms |
4 | that support it. For example, a given bus might look like this: | 5 | that 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 | ||
50 | The read only files are informational, writes to them will be ignored. | 51 | The read only files are informational, writes to them will be ignored, with |
51 | Writable files can be used to perform actions on the device (e.g. changing | 52 | the exception of the 'rom' file. Writable files can be used to perform |
52 | config space, detaching a device). mmapable files are available via an | 53 | actions on the device (e.g. changing config space, detaching a device). |
53 | mmap of the file at offset 0 and can be used to do actual device programming | 54 | mmapable files are available via an mmap of the file at offset 0 and can be |
54 | from userspace. Note that some platforms don't support mmapping of certain | 55 | used to do actual device programming from userspace. Note that some platforms |
55 | resources, so be sure to check the return value from any attempted mmap. | 56 | don't support mmapping of certain resources, so be sure to check the return |
57 | value from any attempted mmap. | ||
58 | |||
59 | The 'rom' file is special in that it provides read-only access to the device's | ||
60 | ROM file, if available. It's disabled by default, however, so applications | ||
61 | should write the string "1" to the file to enable it before attempting a read | ||
62 | call, and disable it following the access by writing "0" to the file. | ||
56 | 63 | ||
57 | Accessing legacy resources through sysfs | 64 | Accessing legacy resources through sysfs |
65 | ---------------------------------------- | ||
58 | 66 | ||
59 | Legacy I/O port and ISA memory resources are also provided in sysfs if the | 67 | Legacy I/O port and ISA memory resources are also provided in sysfs if the |
60 | underlying platform supports them. They're located in the PCI class heirarchy, | 68 | underlying 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) | |||
75 | to access legacy memory space. | 83 | to access legacy memory space. |
76 | 84 | ||
77 | Supporting PCI access on new platforms | 85 | Supporting PCI access on new platforms |
86 | -------------------------------------- | ||
78 | 87 | ||
79 | In order to support PCI resource mapping as described above, Linux platform | 88 | In order to support PCI resource mapping as described above, Linux platform |
80 | code must define HAVE_PCI_MMAP and provide a pci_mmap_page_range function. | 89 | code must define HAVE_PCI_MMAP and provide a pci_mmap_page_range function. |