mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 09:14:19 +08:00
ac08b1c68d
-----BEGIN PGP SIGNATURE----- iQJIBAABCgAyFiEEgMe7l+5h9hnxdsnuWYigwDrT+vwFAmE3jjYUHGJoZWxnYWFz QGdvb2dsZS5jb20ACgkQWYigwDrT+vwrIA/8DYHYRQ6tR3lY0ZxVeBdnd/ryp/ag z35N8RFLPaFlifLWSldwDV/8dylXnRjS57WS9sppp5gKsLl6xYySvTeMpt5QHdXd gJw27sBqiBmecUGFHWVp9B3yF2LvgrtItjd9RadYaHhWEfWyB5AFK7qwxx02fzvo hoGA2XbpI/Hb1BvSOi1avmPYgly1BRu8RFvKMwB2cxQNv3TZOnekT/iFK5WVR1o2 Z5BA+0nj9PrDO/axS0Vh+TqXhU+hOGox7bkOMcNmbDV7Yo8hgot5SsxddbZqJX+O BNNrRv72pbHGIwT/vOP7OQ49sRXledHYeyEGIixjLylBcROk9t8M1z1sfgJ6obVy 1eM3TIx/+7OS5dxC+gTNMVgUiL1NQIdA1LVIBb0BrXm6yNqNxBlj3o/gQ+VGEiNI 0lATmpe4P/N0/cOSI7tK9O2zsX3qzbLnJxsseGrwtK1L+GRYMUPhP4ciblhB0CIf BmK9j0ROmCBGN0Pz/5wIaQgkTro74dqO1BPX8n84M8KWByNZwTrJo/rCBdD4DGaJ eJvyt3hoYxhSxRQ1rp3zqZ9ytm4dJBGcZBKeO1IvKvJHEzfZBIqqq3M/hlNIaSDP v+8I9HaS1kI4SDB1Ia0LFRqKqvpN+WVLB+EoGkeDQozPO42tYSb43lYe83sEnZ+T KY0a/5feu975eLs= =g1WT -----END PGP SIGNATURE----- Merge tag 'pci-v5.15-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull PCI updates from Bjorn Helgaas: "Enumeration: - Convert controller drivers to generic_handle_domain_irq() (Marc Zyngier) - Simplify VPD (Vital Product Data) access and search (Heiner Kallweit) - Update bnx2, bnx2x, bnxt, cxgb4, cxlflash, sfc, tg3 drivers to use simplified VPD interfaces (Heiner Kallweit) - Run Max Payload Size quirks before configuring MPS; work around ASMedia ASM1062 SATA MPS issue (Marek Behún) Resource management: - Refactor pci_ioremap_bar() and pci_ioremap_wc_bar() (Krzysztof Wilczyński) - Optimize pci_resource_len() to reduce kernel size (Zhen Lei) PCI device hotplug: - Fix a double unmap in ibmphp (Vishal Aslot) PCIe port driver: - Enable Bandwidth Notification only if port supports it (Stuart Hayes) Sysfs/proc/syscalls: - Add schedule point in proc_bus_pci_read() (Krzysztof Wilczyński) - Return ~0 data on pciconfig_read() CAP_SYS_ADMIN failure (Krzysztof Wilczyński) - Return "int" from pciconfig_read() syscall (Krzysztof Wilczyński) Virtualization: - Extend "pci=noats" to also turn on Translation Blocking to protect against some DMA attacks (Alex Williamson) - Add sysfs mechanism to control the type of reset used between device assignments to VMs (Amey Narkhede) - Add support for ACPI _RST reset method (Shanker Donthineni) - Add ACS quirks for Cavium multi-function devices (George Cherian) - Add ACS quirks for NXP LX2xx0 and LX2xx2 platforms (Wasim Khan) - Allow HiSilicon AMBA devices that appear as fake PCI devices to use PASID and SVA (Zhangfei Gao) Endpoint framework: - Add support for SR-IOV Endpoint devices (Kishon Vijay Abraham I) - Zero-initialize endpoint test tool parameters so we don't use random parameters (Shunyong Yang) APM X-Gene PCIe controller driver: - Remove redundant dev_err() call in xgene_msi_probe() (ErKun Yang) Broadcom iProc PCIe controller driver: - Don't fail devm_pci_alloc_host_bridge() on missing 'ranges' because it's optional on BCMA devices (Rob Herring) - Fix BCMA probe resource handling (Rob Herring) Cadence PCIe driver: - Work around J7200 Link training electrical issue by increasing delays in LTSSM (Nadeem Athani) Intel IXP4xx PCI controller driver: - Depend on ARCH_IXP4XX to avoid useless config questions (Geert Uytterhoeven) Intel Keembay PCIe controller driver: - Add Intel Keem Bay PCIe controller (Srikanth Thokala) Marvell Aardvark PCIe controller driver: - Work around config space completion handling issues (Evan Wang) - Increase timeout for config access completions (Pali Rohár) - Emulate CRS Software Visibility bit (Pali Rohár) - Configure resources from DT 'ranges' property to fix I/O space access (Pali Rohár) - Serialize INTx mask/unmask (Pali Rohár) MediaTek PCIe controller driver: - Add MT7629 support in DT (Chuanjia Liu) - Fix an MSI issue (Chuanjia Liu) - Get syscon regmap ("mediatek,generic-pciecfg"), IRQ number ("pci_irq"), PCI domain ("linux,pci-domain") from DT properties if present (Chuanjia Liu) Microsoft Hyper-V host bridge driver: - Add ARM64 support (Boqun Feng) - Support "Create Interrupt v3" message (Sunil Muthuswamy) NVIDIA Tegra PCIe controller driver: - Use seq_puts(), move err_msg from stack to static, fix OF node leak (Christophe JAILLET) NVIDIA Tegra194 PCIe driver: - Disable suspend when in Endpoint mode (Om Prakash Singh) - Fix MSI-X address programming error (Om Prakash Singh) - Disable interrupts during suspend to avoid spurious AER link down (Om Prakash Singh) Renesas R-Car PCIe controller driver: - Work around hardware issue that prevents Link L1->L0 transition (Marek Vasut) - Fix runtime PM refcount leak (Dinghao Liu) Rockchip DesignWare PCIe controller driver: - Add Rockchip RK356X host controller driver (Simon Xue) TI J721E PCIe driver: - Add support for J7200 and AM64 (Kishon Vijay Abraham I) Toshiba Visconti PCIe controller driver: - Add Toshiba Visconti PCIe host controller driver (Nobuhiro Iwamatsu) Xilinx NWL PCIe controller driver: - Enable PCIe reference clock via CCF (Hyun Kwon) Miscellaneous: - Convert sta2x11 from 'pci_' to 'dma_' API (Christophe JAILLET) - Fix pci_dev_str_match_path() alloc while atomic bug (used for kernel parameters that specify devices) (Dan Carpenter) - Remove pointless Precision Time Management warning when PTM is present but not enabled (Jakub Kicinski) - Remove surplus "break" statements (Krzysztof Wilczyński)" * tag 'pci-v5.15-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (132 commits) PCI: ibmphp: Fix double unmap of io_mem x86/PCI: sta2x11: switch from 'pci_' to 'dma_' API PCI/VPD: Use unaligned access helpers PCI/VPD: Clean up public VPD defines and inline functions cxgb4: Use pci_vpd_find_id_string() to find VPD ID string PCI/VPD: Add pci_vpd_find_id_string() PCI/VPD: Include post-processing in pci_vpd_find_tag() PCI/VPD: Stop exporting pci_vpd_find_info_keyword() PCI/VPD: Stop exporting pci_vpd_find_tag() PCI: Set dma-can-stall for HiSilicon chips PCI: rockchip-dwc: Add Rockchip RK356X host controller driver PCI: dwc: Remove surplus break statement after return PCI: artpec6: Remove local code block from switch statement PCI: artpec6: Remove surplus break statement after return MAINTAINERS: Add entries for Toshiba Visconti PCIe controller PCI: visconti: Add Toshiba Visconti PCIe host controller driver PCI/portdrv: Enable Bandwidth Notification only if port supports it PCI: Allow PASID on fake PCIe devices without TLP prefixes PCI: mediatek: Use PCI domain to handle ports detection PCI: mediatek: Add new method to get irq number ...
470 lines
9.7 KiB
C
470 lines
9.7 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* Procfs interface for the PCI bus
|
|
*
|
|
* Copyright (c) 1997--1999 Martin Mares <mj@ucw.cz>
|
|
*/
|
|
|
|
#include <linux/init.h>
|
|
#include <linux/pci.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/module.h>
|
|
#include <linux/proc_fs.h>
|
|
#include <linux/seq_file.h>
|
|
#include <linux/capability.h>
|
|
#include <linux/uaccess.h>
|
|
#include <linux/security.h>
|
|
#include <asm/byteorder.h>
|
|
#include "pci.h"
|
|
|
|
static int proc_initialized; /* = 0 */
|
|
|
|
static loff_t proc_bus_pci_lseek(struct file *file, loff_t off, int whence)
|
|
{
|
|
struct pci_dev *dev = PDE_DATA(file_inode(file));
|
|
return fixed_size_llseek(file, off, whence, dev->cfg_size);
|
|
}
|
|
|
|
static ssize_t proc_bus_pci_read(struct file *file, char __user *buf,
|
|
size_t nbytes, loff_t *ppos)
|
|
{
|
|
struct pci_dev *dev = PDE_DATA(file_inode(file));
|
|
unsigned int pos = *ppos;
|
|
unsigned int cnt, size;
|
|
|
|
/*
|
|
* Normal users can read only the standardized portion of the
|
|
* configuration space as several chips lock up when trying to read
|
|
* undefined locations (think of Intel PIIX4 as a typical example).
|
|
*/
|
|
|
|
if (capable(CAP_SYS_ADMIN))
|
|
size = dev->cfg_size;
|
|
else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
|
|
size = 128;
|
|
else
|
|
size = 64;
|
|
|
|
if (pos >= size)
|
|
return 0;
|
|
if (nbytes >= size)
|
|
nbytes = size;
|
|
if (pos + nbytes > size)
|
|
nbytes = size - pos;
|
|
cnt = nbytes;
|
|
|
|
if (!access_ok(buf, cnt))
|
|
return -EINVAL;
|
|
|
|
pci_config_pm_runtime_get(dev);
|
|
|
|
if ((pos & 1) && cnt) {
|
|
unsigned char val;
|
|
pci_user_read_config_byte(dev, pos, &val);
|
|
__put_user(val, buf);
|
|
buf++;
|
|
pos++;
|
|
cnt--;
|
|
}
|
|
|
|
if ((pos & 3) && cnt > 2) {
|
|
unsigned short val;
|
|
pci_user_read_config_word(dev, pos, &val);
|
|
__put_user(cpu_to_le16(val), (__le16 __user *) buf);
|
|
buf += 2;
|
|
pos += 2;
|
|
cnt -= 2;
|
|
}
|
|
|
|
while (cnt >= 4) {
|
|
unsigned int val;
|
|
pci_user_read_config_dword(dev, pos, &val);
|
|
__put_user(cpu_to_le32(val), (__le32 __user *) buf);
|
|
buf += 4;
|
|
pos += 4;
|
|
cnt -= 4;
|
|
cond_resched();
|
|
}
|
|
|
|
if (cnt >= 2) {
|
|
unsigned short val;
|
|
pci_user_read_config_word(dev, pos, &val);
|
|
__put_user(cpu_to_le16(val), (__le16 __user *) buf);
|
|
buf += 2;
|
|
pos += 2;
|
|
cnt -= 2;
|
|
}
|
|
|
|
if (cnt) {
|
|
unsigned char val;
|
|
pci_user_read_config_byte(dev, pos, &val);
|
|
__put_user(val, buf);
|
|
buf++;
|
|
pos++;
|
|
cnt--;
|
|
}
|
|
|
|
pci_config_pm_runtime_put(dev);
|
|
|
|
*ppos = pos;
|
|
return nbytes;
|
|
}
|
|
|
|
static ssize_t proc_bus_pci_write(struct file *file, const char __user *buf,
|
|
size_t nbytes, loff_t *ppos)
|
|
{
|
|
struct inode *ino = file_inode(file);
|
|
struct pci_dev *dev = PDE_DATA(ino);
|
|
int pos = *ppos;
|
|
int size = dev->cfg_size;
|
|
int cnt, ret;
|
|
|
|
ret = security_locked_down(LOCKDOWN_PCI_ACCESS);
|
|
if (ret)
|
|
return ret;
|
|
|
|
if (pos >= size)
|
|
return 0;
|
|
if (nbytes >= size)
|
|
nbytes = size;
|
|
if (pos + nbytes > size)
|
|
nbytes = size - pos;
|
|
cnt = nbytes;
|
|
|
|
if (!access_ok(buf, cnt))
|
|
return -EINVAL;
|
|
|
|
pci_config_pm_runtime_get(dev);
|
|
|
|
if ((pos & 1) && cnt) {
|
|
unsigned char val;
|
|
__get_user(val, buf);
|
|
pci_user_write_config_byte(dev, pos, val);
|
|
buf++;
|
|
pos++;
|
|
cnt--;
|
|
}
|
|
|
|
if ((pos & 3) && cnt > 2) {
|
|
__le16 val;
|
|
__get_user(val, (__le16 __user *) buf);
|
|
pci_user_write_config_word(dev, pos, le16_to_cpu(val));
|
|
buf += 2;
|
|
pos += 2;
|
|
cnt -= 2;
|
|
}
|
|
|
|
while (cnt >= 4) {
|
|
__le32 val;
|
|
__get_user(val, (__le32 __user *) buf);
|
|
pci_user_write_config_dword(dev, pos, le32_to_cpu(val));
|
|
buf += 4;
|
|
pos += 4;
|
|
cnt -= 4;
|
|
}
|
|
|
|
if (cnt >= 2) {
|
|
__le16 val;
|
|
__get_user(val, (__le16 __user *) buf);
|
|
pci_user_write_config_word(dev, pos, le16_to_cpu(val));
|
|
buf += 2;
|
|
pos += 2;
|
|
cnt -= 2;
|
|
}
|
|
|
|
if (cnt) {
|
|
unsigned char val;
|
|
__get_user(val, buf);
|
|
pci_user_write_config_byte(dev, pos, val);
|
|
buf++;
|
|
pos++;
|
|
cnt--;
|
|
}
|
|
|
|
pci_config_pm_runtime_put(dev);
|
|
|
|
*ppos = pos;
|
|
i_size_write(ino, dev->cfg_size);
|
|
return nbytes;
|
|
}
|
|
|
|
struct pci_filp_private {
|
|
enum pci_mmap_state mmap_state;
|
|
int write_combine;
|
|
};
|
|
|
|
static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd,
|
|
unsigned long arg)
|
|
{
|
|
struct pci_dev *dev = PDE_DATA(file_inode(file));
|
|
#ifdef HAVE_PCI_MMAP
|
|
struct pci_filp_private *fpriv = file->private_data;
|
|
#endif /* HAVE_PCI_MMAP */
|
|
int ret = 0;
|
|
|
|
ret = security_locked_down(LOCKDOWN_PCI_ACCESS);
|
|
if (ret)
|
|
return ret;
|
|
|
|
switch (cmd) {
|
|
case PCIIOC_CONTROLLER:
|
|
ret = pci_domain_nr(dev->bus);
|
|
break;
|
|
|
|
#ifdef HAVE_PCI_MMAP
|
|
case PCIIOC_MMAP_IS_IO:
|
|
if (!arch_can_pci_mmap_io())
|
|
return -EINVAL;
|
|
fpriv->mmap_state = pci_mmap_io;
|
|
break;
|
|
|
|
case PCIIOC_MMAP_IS_MEM:
|
|
fpriv->mmap_state = pci_mmap_mem;
|
|
break;
|
|
|
|
case PCIIOC_WRITE_COMBINE:
|
|
if (arch_can_pci_mmap_wc()) {
|
|
if (arg)
|
|
fpriv->write_combine = 1;
|
|
else
|
|
fpriv->write_combine = 0;
|
|
break;
|
|
}
|
|
/* If arch decided it can't, fall through... */
|
|
fallthrough;
|
|
#endif /* HAVE_PCI_MMAP */
|
|
default:
|
|
ret = -EINVAL;
|
|
break;
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
#ifdef HAVE_PCI_MMAP
|
|
static int proc_bus_pci_mmap(struct file *file, struct vm_area_struct *vma)
|
|
{
|
|
struct pci_dev *dev = PDE_DATA(file_inode(file));
|
|
struct pci_filp_private *fpriv = file->private_data;
|
|
int i, ret, write_combine = 0, res_bit = IORESOURCE_MEM;
|
|
|
|
if (!capable(CAP_SYS_RAWIO) ||
|
|
security_locked_down(LOCKDOWN_PCI_ACCESS))
|
|
return -EPERM;
|
|
|
|
if (fpriv->mmap_state == pci_mmap_io) {
|
|
if (!arch_can_pci_mmap_io())
|
|
return -EINVAL;
|
|
res_bit = IORESOURCE_IO;
|
|
}
|
|
|
|
/* Make sure the caller is mapping a real resource for this device */
|
|
for (i = 0; i < PCI_STD_NUM_BARS; i++) {
|
|
if (dev->resource[i].flags & res_bit &&
|
|
pci_mmap_fits(dev, i, vma, PCI_MMAP_PROCFS))
|
|
break;
|
|
}
|
|
|
|
if (i >= PCI_STD_NUM_BARS)
|
|
return -ENODEV;
|
|
|
|
if (fpriv->mmap_state == pci_mmap_mem &&
|
|
fpriv->write_combine) {
|
|
if (dev->resource[i].flags & IORESOURCE_PREFETCH)
|
|
write_combine = 1;
|
|
else
|
|
return -EINVAL;
|
|
}
|
|
|
|
if (dev->resource[i].flags & IORESOURCE_MEM &&
|
|
iomem_is_exclusive(dev->resource[i].start))
|
|
return -EINVAL;
|
|
|
|
ret = pci_mmap_page_range(dev, i, vma,
|
|
fpriv->mmap_state, write_combine);
|
|
if (ret < 0)
|
|
return ret;
|
|
|
|
return 0;
|
|
}
|
|
|
|
static int proc_bus_pci_open(struct inode *inode, struct file *file)
|
|
{
|
|
struct pci_filp_private *fpriv = kmalloc(sizeof(*fpriv), GFP_KERNEL);
|
|
|
|
if (!fpriv)
|
|
return -ENOMEM;
|
|
|
|
fpriv->mmap_state = pci_mmap_io;
|
|
fpriv->write_combine = 0;
|
|
|
|
file->private_data = fpriv;
|
|
file->f_mapping = iomem_get_mapping();
|
|
|
|
return 0;
|
|
}
|
|
|
|
static int proc_bus_pci_release(struct inode *inode, struct file *file)
|
|
{
|
|
kfree(file->private_data);
|
|
file->private_data = NULL;
|
|
|
|
return 0;
|
|
}
|
|
#endif /* HAVE_PCI_MMAP */
|
|
|
|
static const struct proc_ops proc_bus_pci_ops = {
|
|
.proc_lseek = proc_bus_pci_lseek,
|
|
.proc_read = proc_bus_pci_read,
|
|
.proc_write = proc_bus_pci_write,
|
|
.proc_ioctl = proc_bus_pci_ioctl,
|
|
#ifdef CONFIG_COMPAT
|
|
.proc_compat_ioctl = proc_bus_pci_ioctl,
|
|
#endif
|
|
#ifdef HAVE_PCI_MMAP
|
|
.proc_open = proc_bus_pci_open,
|
|
.proc_release = proc_bus_pci_release,
|
|
.proc_mmap = proc_bus_pci_mmap,
|
|
#ifdef HAVE_ARCH_PCI_GET_UNMAPPED_AREA
|
|
.proc_get_unmapped_area = get_pci_unmapped_area,
|
|
#endif /* HAVE_ARCH_PCI_GET_UNMAPPED_AREA */
|
|
#endif /* HAVE_PCI_MMAP */
|
|
};
|
|
|
|
/* iterator */
|
|
static void *pci_seq_start(struct seq_file *m, loff_t *pos)
|
|
{
|
|
struct pci_dev *dev = NULL;
|
|
loff_t n = *pos;
|
|
|
|
for_each_pci_dev(dev) {
|
|
if (!n--)
|
|
break;
|
|
}
|
|
return dev;
|
|
}
|
|
|
|
static void *pci_seq_next(struct seq_file *m, void *v, loff_t *pos)
|
|
{
|
|
struct pci_dev *dev = v;
|
|
|
|
(*pos)++;
|
|
dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);
|
|
return dev;
|
|
}
|
|
|
|
static void pci_seq_stop(struct seq_file *m, void *v)
|
|
{
|
|
if (v) {
|
|
struct pci_dev *dev = v;
|
|
pci_dev_put(dev);
|
|
}
|
|
}
|
|
|
|
static int show_device(struct seq_file *m, void *v)
|
|
{
|
|
const struct pci_dev *dev = v;
|
|
const struct pci_driver *drv;
|
|
int i;
|
|
|
|
if (dev == NULL)
|
|
return 0;
|
|
|
|
drv = pci_dev_driver(dev);
|
|
seq_printf(m, "%02x%02x\t%04x%04x\t%x",
|
|
dev->bus->number,
|
|
dev->devfn,
|
|
dev->vendor,
|
|
dev->device,
|
|
dev->irq);
|
|
|
|
/* only print standard and ROM resources to preserve compatibility */
|
|
for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
|
|
resource_size_t start, end;
|
|
pci_resource_to_user(dev, i, &dev->resource[i], &start, &end);
|
|
seq_printf(m, "\t%16llx",
|
|
(unsigned long long)(start |
|
|
(dev->resource[i].flags & PCI_REGION_FLAG_MASK)));
|
|
}
|
|
for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
|
|
resource_size_t start, end;
|
|
pci_resource_to_user(dev, i, &dev->resource[i], &start, &end);
|
|
seq_printf(m, "\t%16llx",
|
|
dev->resource[i].start < dev->resource[i].end ?
|
|
(unsigned long long)(end - start) + 1 : 0);
|
|
}
|
|
seq_putc(m, '\t');
|
|
if (drv)
|
|
seq_puts(m, drv->name);
|
|
seq_putc(m, '\n');
|
|
return 0;
|
|
}
|
|
|
|
static const struct seq_operations proc_bus_pci_devices_op = {
|
|
.start = pci_seq_start,
|
|
.next = pci_seq_next,
|
|
.stop = pci_seq_stop,
|
|
.show = show_device
|
|
};
|
|
|
|
static struct proc_dir_entry *proc_bus_pci_dir;
|
|
|
|
int pci_proc_attach_device(struct pci_dev *dev)
|
|
{
|
|
struct pci_bus *bus = dev->bus;
|
|
struct proc_dir_entry *e;
|
|
char name[16];
|
|
|
|
if (!proc_initialized)
|
|
return -EACCES;
|
|
|
|
if (!bus->procdir) {
|
|
if (pci_proc_domain(bus)) {
|
|
sprintf(name, "%04x:%02x", pci_domain_nr(bus),
|
|
bus->number);
|
|
} else {
|
|
sprintf(name, "%02x", bus->number);
|
|
}
|
|
bus->procdir = proc_mkdir(name, proc_bus_pci_dir);
|
|
if (!bus->procdir)
|
|
return -ENOMEM;
|
|
}
|
|
|
|
sprintf(name, "%02x.%x", PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
|
|
e = proc_create_data(name, S_IFREG | S_IRUGO | S_IWUSR, bus->procdir,
|
|
&proc_bus_pci_ops, dev);
|
|
if (!e)
|
|
return -ENOMEM;
|
|
proc_set_size(e, dev->cfg_size);
|
|
dev->procent = e;
|
|
|
|
return 0;
|
|
}
|
|
|
|
int pci_proc_detach_device(struct pci_dev *dev)
|
|
{
|
|
proc_remove(dev->procent);
|
|
dev->procent = NULL;
|
|
return 0;
|
|
}
|
|
|
|
int pci_proc_detach_bus(struct pci_bus *bus)
|
|
{
|
|
proc_remove(bus->procdir);
|
|
return 0;
|
|
}
|
|
|
|
static int __init pci_proc_init(void)
|
|
{
|
|
struct pci_dev *dev = NULL;
|
|
proc_bus_pci_dir = proc_mkdir("bus/pci", NULL);
|
|
proc_create_seq("devices", 0, proc_bus_pci_dir,
|
|
&proc_bus_pci_devices_op);
|
|
proc_initialized = 1;
|
|
for_each_pci_dev(dev)
|
|
pci_proc_attach_device(dev);
|
|
|
|
return 0;
|
|
}
|
|
device_initcall(pci_proc_init);
|