PCI: portdrv: remove redundant definitions
Remove unnecessary definitions from portdrv.h and use generic definitions instead. Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
This commit is contained in:
committed by
Jesse Barnes
parent
694f88ef7a
commit
f9f45604ed
@@ -11,24 +11,10 @@
|
|||||||
|
|
||||||
#include <linux/compiler.h>
|
#include <linux/compiler.h>
|
||||||
|
|
||||||
#if !defined(PCI_CAP_ID_PME)
|
#define PCIE_PORT_DEVICE_MAXSERVICES 4
|
||||||
#define PCI_CAP_ID_PME 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(PCI_CAP_ID_EXP)
|
|
||||||
#define PCI_CAP_ID_EXP 0x10
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define PORT_TYPE_MASK 0xf
|
|
||||||
#define PORT_TO_SLOT_MASK 0x100
|
|
||||||
#define SLOT_HP_CAPABLE_MASK 0x40
|
|
||||||
#define PCIE_CAPABILITIES_REG 0x2
|
|
||||||
#define PCIE_SLOT_CAPABILITIES_REG 0x14
|
|
||||||
#define PCIE_PORT_DEVICE_MAXSERVICES 4
|
|
||||||
#define PCIE_PORT_MSI_VECTOR_MASK 0x1f
|
|
||||||
/*
|
/*
|
||||||
* According to the PCI Express Base Specification 2.0, the indices of the MSI-X
|
* According to the PCI Express Base Specification 2.0, the indices of
|
||||||
* table entires used by port services must not exceed 31
|
* the MSI-X table entires used by port services must not exceed 31
|
||||||
*/
|
*/
|
||||||
#define PCIE_PORT_MAX_MSIX_ENTRIES 32
|
#define PCIE_PORT_MAX_MSIX_ENTRIES 32
|
||||||
|
|
||||||
|
@@ -109,8 +109,8 @@ static int pcie_port_enable_msix(struct pci_dev *dev, int *vectors, int mask)
|
|||||||
* used to generate the interrupt message."
|
* used to generate the interrupt message."
|
||||||
*/
|
*/
|
||||||
pos = pci_pcie_cap(dev);
|
pos = pci_pcie_cap(dev);
|
||||||
pci_read_config_word(dev, pos + PCIE_CAPABILITIES_REG, ®16);
|
pci_read_config_word(dev, pos + PCI_EXP_FLAGS, ®16);
|
||||||
entry = (reg16 >> 9) & PCIE_PORT_MSI_VECTOR_MASK;
|
entry = (reg16 & PCI_EXP_FLAGS_IRQ) >> 9;
|
||||||
if (entry >= nr_entries)
|
if (entry >= nr_entries)
|
||||||
goto Error;
|
goto Error;
|
||||||
|
|
||||||
@@ -230,12 +230,11 @@ static int get_port_device_capability(struct pci_dev *dev)
|
|||||||
u32 reg32;
|
u32 reg32;
|
||||||
|
|
||||||
pos = pci_pcie_cap(dev);
|
pos = pci_pcie_cap(dev);
|
||||||
pci_read_config_word(dev, pos + PCIE_CAPABILITIES_REG, ®16);
|
pci_read_config_word(dev, pos + PCI_EXP_FLAGS, ®16);
|
||||||
/* Hot-Plug Capable */
|
/* Hot-Plug Capable */
|
||||||
if (reg16 & PORT_TO_SLOT_MASK) {
|
if (reg16 & PCI_EXP_FLAGS_SLOT) {
|
||||||
pci_read_config_dword(dev,
|
pci_read_config_dword(dev, pos + PCI_EXP_SLTCAP, ®32);
|
||||||
pos + PCIE_SLOT_CAPABILITIES_REG, ®32);
|
if (reg32 & PCI_EXP_SLTCAP_HPC)
|
||||||
if (reg32 & SLOT_HP_CAPABLE_MASK)
|
|
||||||
services |= PCIE_PORT_SERVICE_HP;
|
services |= PCIE_PORT_SERVICE_HP;
|
||||||
}
|
}
|
||||||
/* AER capable */
|
/* AER capable */
|
||||||
|
Reference in New Issue
Block a user