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 @@
1#ifndef DRIVERS_PCI_H1#ifndef DRIVERS_PCI_H
2#define DRIVERS_PCI_H2#define DRIVERS_PCI_H
3 3
4#define PCI_CFG_SPACE_SIZE 256
5#define PCI_CFG_SPACE_EXP_SIZE 4096
6
7#define PCI_FIND_CAP_TTL 484#define PCI_FIND_CAP_TTL 48
8 5
9extern const unsigned char pcie_link_speed[];6extern const unsigned char pcie_link_speed[];
drivers/vfio/pci/vfio_pci_config.c+0−2
@@ -31,8 +31,6 @@ · 30 unmodified lines
31 31
32#include "vfio_pci_private.h"32#include "vfio_pci_private.h"
33 33
34#define PCI_CFG_SPACE_SIZE 256
35
36/* Fake capability ID for standard config space */34/* Fake capability ID for standard config space */
37#define PCI_CAP_ID_BASIC 035#define PCI_CAP_ID_BASIC 0
38 36
include/uapi/linux/pci_regs.h+8−0
@@ -22,6 +22,14 @@ · 21 unmodified lines
22#ifndef LINUX_PCI_REGS_H22#ifndef LINUX_PCI_REGS_H
23#define LINUX_PCI_REGS_H23#define LINUX_PCI_REGS_H
24 24
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
25/*33/*
26 * Under PCI, each device has 256 bytes of configuration address space,34 * Under PCI, each device has 256 bytes of configuration address space,
27 * of which the first 64 bytes are standardized as follows:35 * of which the first 64 bytes are standardized as follows: