2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
* File: portdrv.h
|
|
|
|
* Purpose: PCI Express Port Bus Driver's Internal Data Structures
|
|
|
|
*
|
|
|
|
* Copyright (C) 2004 Intel
|
|
|
|
* Copyright (C) Tom Long Nguyen (tom.l.nguyen@intel.com)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PORTDRV_H_
|
|
|
|
#define _PORTDRV_H_
|
|
|
|
|
2006-09-25 23:52:20 +00:00
|
|
|
#include <linux/compiler.h>
|
|
|
|
|
2009-11-25 12:06:51 +00:00
|
|
|
#define PCIE_PORT_DEVICE_MAXSERVICES 4
|
2009-01-23 23:23:22 +00:00
|
|
|
/*
|
2009-11-25 12:06:51 +00:00
|
|
|
* According to the PCI Express Base Specification 2.0, the indices of
|
|
|
|
* the MSI-X table entires used by port services must not exceed 31
|
2009-01-23 23:23:22 +00:00
|
|
|
*/
|
|
|
|
#define PCIE_PORT_MAX_MSIX_ENTRIES 32
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
#define get_descriptor_id(type, service) (((type - 4) << 4) | service)
|
|
|
|
|
2010-08-20 23:51:44 +00:00
|
|
|
extern bool pcie_ports_disabled;
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
extern struct bus_type pcie_port_bus_type;
|
|
|
|
extern int pcie_port_device_register(struct pci_dev *dev);
|
|
|
|
#ifdef CONFIG_PM
|
2009-02-15 21:32:48 +00:00
|
|
|
extern int pcie_port_device_suspend(struct device *dev);
|
|
|
|
extern int pcie_port_device_resume(struct device *dev);
|
2005-04-16 22:20:36 +00:00
|
|
|
#endif
|
|
|
|
extern void pcie_port_device_remove(struct pci_dev *dev);
|
2006-09-25 23:52:20 +00:00
|
|
|
extern int __must_check pcie_port_bus_register(void);
|
2005-04-16 22:20:36 +00:00
|
|
|
extern void pcie_port_bus_unregister(void);
|
|
|
|
|
2010-02-17 22:40:07 +00:00
|
|
|
#ifdef CONFIG_PCIE_PME
|
|
|
|
extern bool pcie_pme_msi_disabled;
|
|
|
|
|
|
|
|
static inline void pcie_pme_disable_msi(void)
|
|
|
|
{
|
|
|
|
pcie_pme_msi_disabled = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline bool pcie_pme_no_msi(void)
|
|
|
|
{
|
|
|
|
return pcie_pme_msi_disabled;
|
|
|
|
}
|
|
|
|
#else /* !CONFIG_PCIE_PME */
|
|
|
|
static inline void pcie_pme_disable_msi(void) {}
|
|
|
|
static inline bool pcie_pme_no_msi(void) { return false; }
|
|
|
|
#endif /* !CONFIG_PCIE_PME */
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
#endif /* _PORTDRV_H_ */
|