PCI: Move config space size macros to pci_regs.h

Move PCI configuration space size macros (PCI_CFG_SPACE_SIZE and
PCI_CFG_SPACE_EXP_SIZE) from drivers/pci/pci.h to
include/uapi/linux/pci_regs.h so they can be used by more drivers and
eliminate duplicate definitions.

[bhelgaas: Expand comment to include PCI-X details]
Signed-off-by: Wang Sheng-Hui <shhuiw@foxmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This commit is contained in:
Wang Sheng-Hui 2016-09-22 09:05:46 +08:00 committed by Bjorn Helgaas
parent 1001354ca3
commit cc10385b6f
3 changed files with 8 additions and 5 deletions

View File

@ -1,9 +1,6 @@
#ifndef DRIVERS_PCI_H #ifndef DRIVERS_PCI_H
#define DRIVERS_PCI_H #define DRIVERS_PCI_H
#define PCI_CFG_SPACE_SIZE 256
#define PCI_CFG_SPACE_EXP_SIZE 4096
#define PCI_FIND_CAP_TTL 48 #define PCI_FIND_CAP_TTL 48
extern const unsigned char pcie_link_speed[]; extern const unsigned char pcie_link_speed[];

View File

@ -31,8 +31,6 @@
#include "vfio_pci_private.h" #include "vfio_pci_private.h"
#define PCI_CFG_SPACE_SIZE 256
/* Fake capability ID for standard config space */ /* Fake capability ID for standard config space */
#define PCI_CAP_ID_BASIC 0 #define PCI_CAP_ID_BASIC 0

View File

@ -22,6 +22,14 @@
#ifndef LINUX_PCI_REGS_H #ifndef LINUX_PCI_REGS_H
#define LINUX_PCI_REGS_H #define LINUX_PCI_REGS_H
/*
* Conventional PCI and PCI-X Mode 1 devices have 256 bytes of
* configuration space. PCI-X Mode 2 and PCIe devices have 4096 bytes of
* configuration space.
*/
#define PCI_CFG_SPACE_SIZE 256
#define PCI_CFG_SPACE_EXP_SIZE 4096
/* /*
* Under PCI, each device has 256 bytes of configuration address space, * Under PCI, each device has 256 bytes of configuration address space,
* of which the first 64 bytes are standardized as follows: * of which the first 64 bytes are standardized as follows: