History

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>

Wang Sheng-Hui committed 10 years ago

Commit cc103851 parent 10013543 files · +8 −5Browse files

Unified · Split

3 files
  1. drivers/pci/pci.h +0 −3
  2. drivers/vfio/pci/vfio_pci_config.c +0 −2
  3. include/uapi/linux/pci_regs.h +8 −0
drivers/pci/pci.h+0−3
@@ -1,9 +1,6 @@
11 #ifndef DRIVERS_PCI_H
22 #define DRIVERS_PCI_H
33
4−#define PCI_CFG_SPACE_SIZE 256
5−#define PCI_CFG_SPACE_EXP_SIZE 4096
6−
74 #define PCI_FIND_CAP_TTL 48
85
96 extern const unsigned char pcie_link_speed[];
drivers/vfio/pci/vfio_pci_config.c+0−2
@@ -31,8 +31,6 @@ · 30 unmodified lines
3131
3232 #include "vfio_pci_private.h"
3333
34−#define PCI_CFG_SPACE_SIZE 256
35−
3634 /* Fake capability ID for standard config space */
3735 #define PCI_CAP_ID_BASIC 0
3836
include/uapi/linux/pci_regs.h+8−0
@@ -22,6 +22,14 @@ · 21 unmodified lines
2222 #ifndef LINUX_PCI_REGS_H
2323 #define LINUX_PCI_REGS_H
2424
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+
2533 /*
2634 * Under PCI, each device has 256 bytes of configuration address space,
2735 * of which the first 64 bytes are standardized as follows: