Merge tag 'ntb-5.3' of git://github.com/jonmason/ntb
[sfrench/cifs-2.6.git] / include / linux / pci.h
index dd436da7eccc1f45d2572d44e7b3b47fb31855f7..9e700d9f9f287d0db0bf770cd5c4ee2a564db94c 100644 (file)
@@ -151,6 +151,8 @@ static inline const char *pci_power_name(pci_power_t state)
 #define PCI_PM_BUS_WAIT                50
 
 /**
+ * typedef pci_channel_state_t
+ *
  * The pci_channel state describes connectivity between the CPU and
  * the PCI device.  If some PCI bus between here and the PCI device
  * has crashed or locked up, this info is reflected here.
@@ -258,6 +260,7 @@ enum pci_bus_speed {
        PCIE_SPEED_5_0GT                = 0x15,
        PCIE_SPEED_8_0GT                = 0x16,
        PCIE_SPEED_16_0GT               = 0x17,
+       PCIE_SPEED_32_0GT               = 0x18,
        PCI_SPEED_UNKNOWN               = 0xff,
 };
 
@@ -383,7 +386,7 @@ struct pci_dev {
 
        unsigned int    is_busmaster:1;         /* Is busmaster */
        unsigned int    no_msi:1;               /* May not use MSI */
-       unsigned int    no_64bit_msi:1;         /* May only use 32-bit MSIs */
+       unsigned int    no_64bit_msi:1;         /* May only use 32-bit MSIs */
        unsigned int    block_cfg_access:1;     /* Config space access blocked */
        unsigned int    broken_parity_status:1; /* Generates false positive parity */
        unsigned int    irq_reroute_variant:2;  /* Needs IRQ rerouting variant */
@@ -506,6 +509,8 @@ struct pci_host_bridge {
        unsigned int    native_shpc_hotplug:1;  /* OS may use SHPC hotplug */
        unsigned int    native_pme:1;           /* OS may use PCIe PME */
        unsigned int    native_ltr:1;           /* OS may use PCIe LTR */
+       unsigned int    preserve_config:1;      /* Preserve FW resource setup */
+
        /* Resource alignment requirements */
        resource_size_t (*align_resource)(struct pci_dev *dev,
                        const struct resource *res,
@@ -776,6 +781,50 @@ struct pci_error_handlers {
 
 
 struct module;
+
+/**
+ * struct pci_driver - PCI driver structure
+ * @node:      List of driver structures.
+ * @name:      Driver name.
+ * @id_table:  Pointer to table of device IDs the driver is
+ *             interested in.  Most drivers should export this
+ *             table using MODULE_DEVICE_TABLE(pci,...).
+ * @probe:     This probing function gets called (during execution
+ *             of pci_register_driver() for already existing
+ *             devices or later if a new device gets inserted) for
+ *             all PCI devices which match the ID table and are not
+ *             "owned" by the other drivers yet. This function gets
+ *             passed a "struct pci_dev \*" for each device whose
+ *             entry in the ID table matches the device. The probe
+ *             function returns zero when the driver chooses to
+ *             take "ownership" of the device or an error code
+ *             (negative number) otherwise.
+ *             The probe function always gets called from process
+ *             context, so it can sleep.
+ * @remove:    The remove() function gets called whenever a device
+ *             being handled by this driver is removed (either during
+ *             deregistration of the driver or when it's manually
+ *             pulled out of a hot-pluggable slot).
+ *             The remove function always gets called from process
+ *             context, so it can sleep.
+ * @suspend:   Put device into low power state.
+ * @suspend_late: Put device into low power state.
+ * @resume_early: Wake device from low power state.
+ * @resume:    Wake device from low power state.
+ *             (Please see Documentation/power/pci.rst for descriptions
+ *             of PCI Power Management and the related functions.)
+ * @shutdown:  Hook into reboot_notifier_list (kernel/sys.c).
+ *             Intended to stop any idling DMA operations.
+ *             Useful for enabling wake-on-lan (NIC) or changing
+ *             the power state of a device before reboot.
+ *             e.g. drivers/net/e100.c.
+ * @sriov_configure: Optional driver callback to allow configuration of
+ *             number of VFs to enable via sysfs "sriov_numvfs" file.
+ * @err_handler: See Documentation/PCI/pci-error-recovery.rst
+ * @groups:    Sysfs attribute groups.
+ * @driver:    Driver model structure.
+ * @dynids:    List of dynamically added device IDs.
+ */
 struct pci_driver {
        struct list_head        node;
        const char              *name;
@@ -1363,6 +1412,15 @@ int pci_set_vga_state(struct pci_dev *pdev, bool decode,
 #define PCI_IRQ_MSI            (1 << 1) /* Allow MSI interrupts */
 #define PCI_IRQ_MSIX           (1 << 2) /* Allow MSI-X interrupts */
 #define PCI_IRQ_AFFINITY       (1 << 3) /* Auto-assign affinity */
+
+/*
+ * Virtual interrupts allow for more interrupts to be allocated
+ * than the device has interrupts for. These are not programmed
+ * into the device's MSI-X table and must be handled by some
+ * other driver means.
+ */
+#define PCI_IRQ_VIRTUAL                (1 << 4)
+
 #define PCI_IRQ_ALL_TYPES \
        (PCI_IRQ_LEGACY | PCI_IRQ_MSI | PCI_IRQ_MSIX)
 
@@ -2207,7 +2265,7 @@ static inline u8 pci_vpd_srdt_tag(const u8 *srdt)
 
 /**
  * pci_vpd_info_field_size - Extracts the information field length
- * @lrdt: Pointer to the beginning of an information field header
+ * @info_field: Pointer to the beginning of an information field header
  *
  * Returns the extracted information field length.
  */