Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5eeca8e6 authored by Adrian Bunk's avatar Adrian Bunk Committed by Greg Kroah-Hartman
Browse files

[PATCH] PCI: the scheduled removal of PCI_LEGACY_PROC



This patch contains the scheduled removal of PCI_LEGACY_PROC.

Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 1305e918
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -158,13 +158,6 @@ Who: Adrian Bunk <bunk@stusta.de>

---------------------------

What:	Legacy /proc/pci interface (PCI_LEGACY_PROC)
When:	March 2006
Why:	deprecated since 2.5.53 in favor of lspci(8)
Who:	Adrian Bunk <bunk@stusta.de>

---------------------------

What:	pci_module_init(driver)
When:	January 2007
Why:	Is replaced by pci_register_driver(pci_driver).
+0 −17
Original line number Diff line number Diff line
@@ -13,23 +13,6 @@ config PCI_MSI

	   If you don't know what to do here, say N.

config PCI_LEGACY_PROC
	bool "Legacy /proc/pci interface"
	depends on PCI
	---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 <file:Documentation/Changes> for information on where to get the latest
	  version. 

	  When in doubt, say N.

config PCI_DEBUG
	bool "PCI Debugging"
	depends on PCI && DEBUG_KERNEL
+0 −126
Original line number Diff line number Diff line
@@ -458,131 +458,6 @@ int pci_proc_detach_bus(struct pci_bus* bus)
	return 0;
}

#ifdef CONFIG_PCI_LEGACY_PROC

/*
 *  Backward compatible /proc/pci interface.
 */

/*
 * Convert some of the configuration space registers of the device at
 * address (bus,devfn) into a string (possibly several lines each).
 * The configuration string is stored starting at buf[len].  If the
 * string would exceed the size of the buffer (SIZE), 0 is returned.
 */
static int show_dev_config(struct seq_file *m, void *v)
{
	struct pci_dev *dev = v;
	struct pci_dev *first_dev;
	struct pci_driver *drv;
	u32 class_rev;
	unsigned char latency, min_gnt, max_lat;
	int reg;

	first_dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL);
	if (dev == first_dev)
		seq_puts(m, "PCI devices found:\n");
	pci_dev_put(first_dev);

	drv = pci_dev_driver(dev);

	pci_user_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
	pci_user_read_config_byte (dev, PCI_LATENCY_TIMER, &latency);
	pci_user_read_config_byte (dev, PCI_MIN_GNT, &min_gnt);
	pci_user_read_config_byte (dev, PCI_MAX_LAT, &max_lat);
	seq_printf(m, "  Bus %2d, device %3d, function %2d:\n",
	       dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
	seq_printf(m, "    Class %04x", class_rev >> 16);
	seq_printf(m, ": PCI device %04x:%04x", dev->vendor, dev->device);
	seq_printf(m, " (rev %d).\n", class_rev & 0xff);

	if (dev->irq)
		seq_printf(m, "      IRQ %d.\n", dev->irq);

	if (latency || min_gnt || max_lat) {
		seq_printf(m, "      Master Capable.  ");
		if (latency)
			seq_printf(m, "Latency=%d.  ", latency);
		else
			seq_puts(m, "No bursts.  ");
		if (min_gnt)
			seq_printf(m, "Min Gnt=%d.", min_gnt);
		if (max_lat)
			seq_printf(m, "Max Lat=%d.", max_lat);
		seq_putc(m, '\n');
	}

	for (reg = 0; reg < 6; reg++) {
		struct resource *res = dev->resource + reg;
		unsigned long base, end, flags;

		base = res->start;
		end = res->end;
		flags = res->flags;
		if (!end)
			continue;

		if (flags & PCI_BASE_ADDRESS_SPACE_IO) {
			seq_printf(m, "      I/O at 0x%lx [0x%lx].\n",
				base, end);
		} else {
			const char *pref, *type = "unknown";

			if (flags & PCI_BASE_ADDRESS_MEM_PREFETCH)
				pref = "P";
			else
				pref = "Non-p";
			switch (flags & PCI_BASE_ADDRESS_MEM_TYPE_MASK) {
			      case PCI_BASE_ADDRESS_MEM_TYPE_32:
				type = "32 bit"; break;
			      case PCI_BASE_ADDRESS_MEM_TYPE_1M:
				type = "20 bit"; break;
			      case PCI_BASE_ADDRESS_MEM_TYPE_64:
				type = "64 bit"; break;
			}
			seq_printf(m, "      %srefetchable %s memory at "
				       "0x%lx [0x%lx].\n", pref, type,
				       base,
				       end);
		}
	}
	return 0;
}

static struct seq_operations proc_pci_op = {
	.start	= pci_seq_start,
	.next	= pci_seq_next,
	.stop	= pci_seq_stop,
	.show	= show_dev_config
};

static int proc_pci_open(struct inode *inode, struct file *file)
{
	return seq_open(file, &proc_pci_op);
}
static struct file_operations proc_pci_operations = {
	.open		= proc_pci_open,
	.read		= seq_read,
	.llseek		= seq_lseek,
	.release	= seq_release,
};

static void legacy_proc_init(void)
{
	struct proc_dir_entry * entry = create_proc_entry("pci", 0, NULL);
	if (entry)
		entry->proc_fops = &proc_pci_operations;
}

#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);
@@ -606,7 +481,6 @@ static int __init pci_proc_init(void)
	while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
		pci_proc_attach_device(dev);
	}
	legacy_proc_init();
	return 0;
}