diff options
Diffstat (limited to 'include/linux/pci.h')
| -rw-r--r-- | include/linux/pci.h | 66 | 
1 files changed, 59 insertions, 7 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index ee2179546c6..2461033a798 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -286,6 +286,7 @@ struct pci_dev {  	unsigned int	irq;  	struct resource resource[DEVICE_COUNT_RESOURCE]; /* I/O and memory regions + expansion ROMs */ +	bool match_driver;		/* Skip attaching driver */  	/* These fields are used by common fixups */  	unsigned int	transparent:1;	/* Transparent PCI bridge */  	unsigned int	multifunction:1;/* Part of multi-function device */ @@ -333,6 +334,8 @@ struct pci_dev {  	};  	struct pci_ats	*ats;	/* Address Translation Service */  #endif +	phys_addr_t rom; /* Physical address of ROM if it's not from the BAR */ +	size_t romlen; /* Length of ROM if it's not from the BAR */  };  static inline struct pci_dev *pci_physfn(struct pci_dev *dev) @@ -376,6 +379,8 @@ void pci_set_host_bridge_release(struct pci_host_bridge *bridge,  		     void (*release_fn)(struct pci_host_bridge *),  		     void *release_data); +int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge); +  /*   * The first PCI_BRIDGE_RESOURCE_NUM PCI bus resources (those that correspond   * to P2P or CardBus bridge windows) go in a table.  Additional ones (for @@ -538,6 +543,9 @@ enum pci_ers_result {  	/* Device driver is fully recovered and operational */  	PCI_ERS_RESULT_RECOVERED = (__force pci_ers_result_t) 5, + +	/* No AER capabilities registered for the driver */ +	PCI_ERS_RESULT_NO_AER_DRIVER = (__force pci_ers_result_t) 6,  };  /* PCI bus error event callbacks */ @@ -573,6 +581,7 @@ struct pci_driver {  	int  (*resume_early) (struct pci_dev *dev);  	int  (*resume) (struct pci_dev *dev);	                /* Device woken up */  	void (*shutdown) (struct pci_dev *dev); +	int (*sriov_configure) (struct pci_dev *dev, int num_vfs); /* PF pdev */  	const struct pci_error_handlers *err_handler;  	struct device_driver	driver;  	struct pci_dynids dynids; @@ -588,7 +597,7 @@ struct pci_driver {   * in a generic manner.   */  #define DEFINE_PCI_DEVICE_TABLE(_table) \ -	const struct pci_device_id _table[] __devinitconst +	const struct pci_device_id _table[]  /**   * PCI_DEVICE - macro used to describe a specific pci device @@ -604,6 +613,20 @@ struct pci_driver {  	.subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID  /** + * PCI_DEVICE_SUB - macro used to describe a specific pci device with subsystem + * @vend: the 16 bit PCI Vendor ID + * @dev: the 16 bit PCI Device ID + * @subvend: the 16 bit PCI Subvendor ID + * @subdev: the 16 bit PCI Subdevice ID + * + * This macro is used to create a struct pci_device_id that matches a + * specific device with subsystem information. + */ +#define PCI_DEVICE_SUB(vend, dev, subvend, subdev) \ +	.vendor = (vend), .device = (dev), \ +	.subvendor = (subvend), .subdevice = (subdev) + +/**   * PCI_DEVICE_CLASS - macro used to describe a specific pci device class   * @dev_class: the class, subclass, prog-if triple for this device   * @dev_class_mask: the class mask for this device @@ -654,6 +677,7 @@ extern struct list_head pci_root_buses;	/* list of all known PCI buses */  /* Some device drivers need know if pci is initiated */  extern int no_pci_devices(void); +void pcibios_resource_survey_bus(struct pci_bus *bus);  void pcibios_fixup_bus(struct pci_bus *);  int __must_check pcibios_enable_device(struct pci_dev *, int mask);  /* Architecture specific versions may override this (weak) */ @@ -686,7 +710,7 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus,  int pci_bus_insert_busn_res(struct pci_bus *b, int bus, int busmax);  int pci_bus_update_busn_res_end(struct pci_bus *b, int busmax);  void pci_bus_release_busn_res(struct pci_bus *b); -struct pci_bus * __devinit pci_scan_root_bus(struct device *parent, int bus, +struct pci_bus *pci_scan_root_bus(struct device *parent, int bus,  					     struct pci_ops *ops, void *sysdata,  					     struct list_head *resources);  struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, @@ -712,6 +736,8 @@ extern struct pci_dev *pci_dev_get(struct pci_dev *dev);  extern void pci_dev_put(struct pci_dev *dev);  extern void pci_remove_bus(struct pci_bus *b);  extern void pci_stop_and_remove_bus_device(struct pci_dev *dev); +void pci_stop_root_bus(struct pci_bus *bus); +void pci_remove_root_bus(struct pci_bus *bus);  void pci_setup_cardbus(struct pci_bus *bus);  extern void pci_sort_breadthfirst(void);  #define dev_is_pci(d) ((d)->bus == &pci_bus_type) @@ -941,10 +967,8 @@ void set_pcie_hotplug_bridge(struct pci_dev *pdev);  /* Functions for PCI Hotplug drivers to use */  int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); -#ifdef CONFIG_HOTPLUG  unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge);  unsigned int pci_rescan_bus(struct pci_bus *bus); -#endif  /* Vital product data routines */  ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf); @@ -958,6 +982,7 @@ void pci_bus_size_bridges(struct pci_bus *bus);  int pci_claim_resource(struct pci_dev *, int);  void pci_assign_unassigned_resources(void);  void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge); +void pci_assign_unassigned_bus_resources(struct pci_bus *bus);  void pdev_enable_device(struct pci_dev *);  int pci_enable_resources(struct pci_dev *, int mask);  void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), @@ -1080,6 +1105,12 @@ static inline int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec)  	return -1;  } +static inline int +pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec) +{ +	return -1; +} +  static inline void pci_msi_shutdown(struct pci_dev *dev)  { }  static inline void pci_disable_msi(struct pci_dev *dev) @@ -1111,6 +1142,7 @@ static inline int pci_msi_enabled(void)  }  #else  extern int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec); +extern int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec);  extern void pci_msi_shutdown(struct pci_dev *dev);  extern void pci_disable_msi(struct pci_dev *dev);  extern int pci_msix_table_size(struct pci_dev *dev); @@ -1580,7 +1612,7 @@ extern int pci_pci_problems;  extern unsigned long pci_cardbus_io_size;  extern unsigned long pci_cardbus_mem_size; -extern u8 __devinitdata pci_dfl_cache_line_size; +extern u8 pci_dfl_cache_line_size;  extern u8 pci_cache_line_size;  extern unsigned long pci_hotplug_io_size; @@ -1592,6 +1624,7 @@ void pcibios_disable_device(struct pci_dev *dev);  void pcibios_set_master(struct pci_dev *dev);  int pcibios_set_pcie_reset_state(struct pci_dev *dev,  				 enum pcie_reset_state state); +int pcibios_add_device(struct pci_dev *dev);  #ifdef CONFIG_PCI_MMCONFIG  extern void __init pci_mmcfg_early_init(void); @@ -1601,7 +1634,7 @@ static inline void pci_mmcfg_early_init(void) { }  static inline void pci_mmcfg_late_init(void) { }  #endif -int pci_ext_cfg_avail(struct pci_dev *dev); +int pci_ext_cfg_avail(void);  void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); @@ -1610,6 +1643,8 @@ extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn);  extern void pci_disable_sriov(struct pci_dev *dev);  extern irqreturn_t pci_sriov_migration(struct pci_dev *dev);  extern int pci_num_vf(struct pci_dev *dev); +extern int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); +extern int pci_sriov_get_totalvfs(struct pci_dev *dev);  #else  static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)  { @@ -1626,6 +1661,14 @@ static inline int pci_num_vf(struct pci_dev *dev)  {  	return 0;  } +static inline int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs) +{ +	return 0; +} +static inline int pci_sriov_get_totalvfs(struct pci_dev *dev) +{ +	return 0; +}  #endif  #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) @@ -1661,12 +1704,21 @@ static inline bool pci_is_pcie(struct pci_dev *dev)  }  /** + * pcie_caps_reg - get the PCIe Capabilities Register + * @dev: PCI device + */ +static inline u16 pcie_caps_reg(const struct pci_dev *dev) +{ +	return dev->pcie_flags_reg; +} + +/**   * pci_pcie_type - get the PCIe device/port type   * @dev: PCI device   */  static inline int pci_pcie_type(const struct pci_dev *dev)  { -	return (dev->pcie_flags_reg & PCI_EXP_FLAGS_TYPE) >> 4; +	return (pcie_caps_reg(dev) & PCI_EXP_FLAGS_TYPE) >> 4;  }  void pci_request_acs(void);  |