Commit d5a246fc authored by Patrick Mochel's avatar Patrick Mochel

Deprecate /proc/pci

As discussed on lkml, /proc/pci is past his functional usefulness, and has
been obviated by lspci(8). lspci can provide all the same information, plus
so much more. And, it doesn't rely on having an in-kernel database of PCI
names. 

This change does: 
- Create config parameter: PCI_LEGACY_PROC.
- Add deprecation notice to Kconfig text.
- Wrap code in #ifdef in drivers/pci/proc.c

This does nothing with the names database, though we would probably be 
better off removing that as well. The PCI name field is used now only so 
drivers can print a useful message on startup - hardly a justification for
60kB + increase in size..
 
parent 14f414f1
# #
# PCI configuration # PCI configuration
# #
config PCI_LEGACY_PROC
bool "Legacy /proc/pci interface"
---help---
This feature enables a procfs file -- /proc/pci -- that provides a
summary of PCI devices in the system.
This feature has been deprecated as of v2.5.53, in favor of using the
tool lspci(8). This feature may be removed at a future date.
lspci can provide the same data, as well as much more. lspci is a part of
the pci-utils package, which should be installed by your distribution.
See Documentation/Changes for information on where to get the latest
version.
When in doubt, say N.
config PCI_NAMES config PCI_NAMES
bool "PCI device name database" bool "PCI device name database"
depends on PCI depends on PCI
---help--- ---help---
By default, the kernel contains a database of all known PCI device By default, the kernel contains a database of all known PCI device
names to make the information in /proc/pci, /proc/ioports and names to make the information in /proc/pci, /proc/ioports and
similar files comprehensible to the user. This database increases similar files comprehensible to the user.
size of the kernel image by about 80KB, but it gets freed after the
system boots up, so it doesn't take up kernel memory. Anyway, if you This database increases size of the kernel image by about 80KB. This
are building an installation floppy or kernel for an embedded system memory is freed after the system boots up if CONFIG_HOTPLUG is not set.
where kernel image size really matters, you can disable this feature
and you'll get device ID numbers instead of names. Anyway, if you are building an installation floppy or kernel for an
embedded system where kernel image size really matters, you can disable
this feature and you'll get device ID numbers instead of names.
When in doubt, say Y. When in doubt, say Y.
...@@ -472,6 +472,7 @@ int pci_proc_detach_bus(struct pci_bus* bus) ...@@ -472,6 +472,7 @@ int pci_proc_detach_bus(struct pci_bus* bus)
return 0; return 0;
} }
#ifdef CONFIG_PCI_LEGACY_PROC
/* /*
* Backward compatible /proc/pci interface. * Backward compatible /proc/pci interface.
...@@ -573,22 +574,39 @@ static struct seq_operations proc_pci_op = { ...@@ -573,22 +574,39 @@ static struct seq_operations proc_pci_op = {
.show = show_dev_config .show = show_dev_config
}; };
static int proc_bus_pci_dev_open(struct inode *inode, struct file *file) static int proc_pci_open(struct inode *inode, struct file *file)
{ {
return seq_open(file, &proc_bus_pci_devices_op); return seq_open(file, &proc_pci_op);
} }
static struct file_operations proc_bus_pci_dev_operations = { static struct file_operations proc_pci_operations = {
.open = proc_bus_pci_dev_open, .open = proc_pci_open,
.read = seq_read, .read = seq_read,
.llseek = seq_lseek, .llseek = seq_lseek,
.release = seq_release, .release = seq_release,
}; };
static int proc_pci_open(struct inode *inode, struct file *file)
static void legacy_proc_init(void)
{ {
return seq_open(file, &proc_pci_op); struct proc_dir_entry * entry = create_proc_entry("pci", 0, NULL);
if (entry)
entry->proc_fops = &proc_pci_operations;
} }
static struct file_operations proc_pci_operations = {
.open = proc_pci_open, #else
static void legacy_proc_init(void)
{
}
#endif /* CONFIG_PCI_LEGACY_PROC */
static int proc_bus_pci_dev_open(struct inode *inode, struct file *file)
{
return seq_open(file, &proc_bus_pci_devices_op);
}
static struct file_operations proc_bus_pci_dev_operations = {
.open = proc_bus_pci_dev_open,
.read = seq_read, .read = seq_read,
.llseek = seq_lseek, .llseek = seq_lseek,
.release = seq_release, .release = seq_release,
...@@ -607,9 +625,7 @@ static int __init pci_proc_init(void) ...@@ -607,9 +625,7 @@ static int __init pci_proc_init(void)
pci_for_each_dev(dev) { pci_for_each_dev(dev) {
pci_proc_attach_device(dev); pci_proc_attach_device(dev);
} }
entry = create_proc_entry("pci", 0, NULL); legacy_proc_init();
if (entry)
entry->proc_fops = &proc_pci_operations;
} }
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment