xref: /openbmc/linux/drivers/pci/pcie/portdrv.h (revision 7f4927c1)
11da177e4SLinus Torvalds /*
21da177e4SLinus Torvalds  * File:	portdrv.h
31da177e4SLinus Torvalds  * Purpose:	PCI Express Port Bus Driver's Internal Data Structures
41da177e4SLinus Torvalds  *
51da177e4SLinus Torvalds  * Copyright (C) 2004 Intel
61da177e4SLinus Torvalds  * Copyright (C) Tom Long Nguyen (tom.l.nguyen@intel.com)
71da177e4SLinus Torvalds  */
81da177e4SLinus Torvalds 
91da177e4SLinus Torvalds #ifndef _PORTDRV_H_
101da177e4SLinus Torvalds #define _PORTDRV_H_
111da177e4SLinus Torvalds 
121da177e4SLinus Torvalds #if !defined(PCI_CAP_ID_PME)
131da177e4SLinus Torvalds #define PCI_CAP_ID_PME			1
141da177e4SLinus Torvalds #endif
151da177e4SLinus Torvalds 
161da177e4SLinus Torvalds #if !defined(PCI_CAP_ID_EXP)
171da177e4SLinus Torvalds #define PCI_CAP_ID_EXP			0x10
181da177e4SLinus Torvalds #endif
191da177e4SLinus Torvalds 
201da177e4SLinus Torvalds #define PORT_TYPE_MASK			0xf
211da177e4SLinus Torvalds #define PORT_TO_SLOT_MASK		0x100
221da177e4SLinus Torvalds #define SLOT_HP_CAPABLE_MASK		0x40
231da177e4SLinus Torvalds #define PCIE_CAPABILITIES_REG		0x2
241da177e4SLinus Torvalds #define PCIE_SLOT_CAPABILITIES_REG	0x14
251da177e4SLinus Torvalds #define PCIE_PORT_DEVICE_MAXSERVICES	4
261da177e4SLinus Torvalds #define PCI_CFG_SPACE_SIZE		256
271da177e4SLinus Torvalds 
281da177e4SLinus Torvalds #define get_descriptor_id(type, service) (((type - 4) << 4) | service)
291da177e4SLinus Torvalds 
301da177e4SLinus Torvalds extern struct bus_type pcie_port_bus_type;
311da177e4SLinus Torvalds extern int pcie_port_device_probe(struct pci_dev *dev);
321da177e4SLinus Torvalds extern int pcie_port_device_register(struct pci_dev *dev);
331da177e4SLinus Torvalds #ifdef CONFIG_PM
347f4927c1SPavel Machek extern int pcie_port_device_suspend(struct pci_dev *dev, pm_message_t state);
351da177e4SLinus Torvalds extern int pcie_port_device_resume(struct pci_dev *dev);
361da177e4SLinus Torvalds #endif
371da177e4SLinus Torvalds extern void pcie_port_device_remove(struct pci_dev *dev);
381da177e4SLinus Torvalds extern void pcie_port_bus_register(void);
391da177e4SLinus Torvalds extern void pcie_port_bus_unregister(void);
401da177e4SLinus Torvalds 
411da177e4SLinus Torvalds #endif /* _PORTDRV_H_ */
42