Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Wang Sheng-Hui and committed by
Bjorn Helgaas
cc10385b 1001354c

+8 -5
-3
drivers/pci/pci.h
··· 1 1 #ifndef DRIVERS_PCI_H 2 2 #define DRIVERS_PCI_H 3 3 4 - #define PCI_CFG_SPACE_SIZE 256 5 - #define PCI_CFG_SPACE_EXP_SIZE 4096 6 - 7 4 #define PCI_FIND_CAP_TTL 48 8 5 9 6 extern const unsigned char pcie_link_speed[];
-2
drivers/vfio/pci/vfio_pci_config.c
··· 31 31 32 32 #include "vfio_pci_private.h" 33 33 34 - #define PCI_CFG_SPACE_SIZE 256 35 - 36 34 /* Fake capability ID for standard config space */ 37 35 #define PCI_CAP_ID_BASIC 0 38 36
+8
include/uapi/linux/pci_regs.h
··· 23 23 #define LINUX_PCI_REGS_H 24 24 25 25 /* 26 + * Conventional PCI and PCI-X Mode 1 devices have 256 bytes of 27 + * configuration space. PCI-X Mode 2 and PCIe devices have 4096 bytes of 28 + * configuration space. 29 + */ 30 + #define PCI_CFG_SPACE_SIZE 256 31 + #define PCI_CFG_SPACE_EXP_SIZE 4096 32 + 33 + /* 26 34 * Under PCI, each device has 256 bytes of configuration address space, 27 35 * of which the first 64 bytes are standardized as follows: 28 36 */