]> err.no Git - linux-2.6/blobdiff - include/linux/pci.h
[PATCH] Initial generic hypertransport interrupt support
[linux-2.6] / include / linux / pci.h
index 3ec72551ac31ccb0398667fe0310d61a68d68126..9b34bc8f34e4a95482efff8604827f2b209c4bd2 100644 (file)
@@ -356,6 +356,8 @@ struct pci_driver {
        struct pci_error_handlers *err_handler;
        struct device_driver    driver;
        struct pci_dynids dynids;
+
+       int multithread_probe;
 };
 
 #define        to_pci_driver(drv) container_of(drv,struct pci_driver, driver)
@@ -431,7 +433,7 @@ int pci_scan_slot(struct pci_bus *bus, int devfn);
 struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn);
 void pci_device_add(struct pci_dev *dev, struct pci_bus *bus);
 unsigned int pci_scan_child_bus(struct pci_bus *bus);
-void pci_bus_add_device(struct pci_dev *dev);
+int __must_check pci_bus_add_device(struct pci_dev *dev);
 void pci_read_bridge_bases(struct pci_bus *child);
 struct resource *pci_find_parent_resource(const struct pci_dev *dev, struct resource *res);
 int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge);
@@ -439,6 +441,7 @@ 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_remove_bus_device(struct pci_dev *dev);
+extern void pci_stop_bus_device(struct pci_dev *dev);
 void pci_setup_cardbus(struct pci_bus *bus);
 
 /* Generic PCI functions exported to card drivers */
@@ -592,6 +595,12 @@ struct msix_entry {
        u16     entry;  /* driver uses to specify entry, OS writes */
 };
 
+struct msi_msg {
+       u32     address_lo;     /* low 32 bits of msi message address */
+       u32     address_hi;     /* high 32 bits of msi message address */
+       u32     data;           /* 16 bits of msi message data */
+};
+
 #ifndef CONFIG_PCI_MSI
 static inline void pci_scan_msi_device(struct pci_dev *dev) {}
 static inline int pci_enable_msi(struct pci_dev *dev) {return -1;}
@@ -608,8 +617,87 @@ extern int pci_enable_msix(struct pci_dev* dev,
        struct msix_entry *entries, int nvec);
 extern void pci_disable_msix(struct pci_dev *dev);
 extern void msi_remove_pci_irq_vectors(struct pci_dev *dev);
+
+/*
+ * MSI operation vector.  Used by the msi core code (drivers/pci/msi.c)
+ * to abstract platform-specific tasks relating to MSI address generation
+ * and resource management.
+ */
+struct msi_ops {
+       int needs_64bit_address;
+       /**
+        * setup - generate an MSI bus address and data for a given vector
+        * @pdev: PCI device context (in)
+        * @irq: irq allocated by the msi core (in)
+        * @msg: PCI bus address and data for msi message (out)
+        *
+        * Description: The setup op is used to generate a PCI bus addres and
+        * data which the msi core will program into the card MSI capability
+        * registers.  The setup routine is responsible for picking an initial
+        * cpu to target the MSI at.  The setup routine is responsible for
+        * examining pdev to determine the MSI capabilities of the card and
+        * generating a suitable address/data.  The setup routine is
+        * responsible for allocating and tracking any system resources it
+        * needs to route the MSI to the cpu it picks, and for associating
+        * those resources with the passed in vector.
+        *
+        * Returns 0 if the MSI address/data was successfully setup.
+        **/
+
+       int     (*setup)    (struct pci_dev *pdev, unsigned int irq,
+                            struct msi_msg *msg);
+
+       /**
+        * teardown - release resources allocated by setup
+        * @vector: vector context for resources (in)
+        *
+        * Description:  The teardown op is used to release any resources
+        * that were allocated in the setup routine associated with the passed
+        * in vector.
+        **/
+
+       void    (*teardown) (unsigned int irq);
+
+       /**
+        * target - retarget an MSI at a different cpu
+        * @vector: vector context for resources (in)
+        * @cpu:  new cpu to direct vector at (in)
+        * @addr_hi: new value of PCI bus upper 32 bits (in/out)
+        * @addr_lo: new value of PCI bus lower 32 bits (in/out)
+        *
+        * Description:  The target op is used to redirect an MSI vector
+        * at a different cpu.  addr_hi/addr_lo coming in are the existing
+        * values that the MSI core has programmed into the card.  The
+        * target code is responsible for freeing any resources (if any)
+        * associated with the old address, and generating a new PCI bus
+        * addr_hi/addr_lo that will redirect the vector at the indicated cpu.
+        **/
+
+       void    (*target)   (unsigned int irq, cpumask_t cpumask,
+                            struct msi_msg *msg);
+};
+
+extern int msi_register(struct msi_ops *ops);
+
 #endif
 
+#ifdef CONFIG_HT_IRQ
+/* Helper functions.. */
+void write_ht_irq_low(unsigned int irq, u32 data);
+void write_ht_irq_high(unsigned int irq, u32 data);
+u32  read_ht_irq_low(unsigned int irq);
+u32  read_ht_irq_high(unsigned int irq);
+void mask_ht_irq(unsigned int irq);
+void unmask_ht_irq(unsigned int irq);
+
+/* The functions a driver should call */
+int  ht_create_irq(struct pci_dev *dev, int idx);
+void ht_destroy_irq(unsigned int irq);
+
+/* The arch hook for getting things started */
+int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev);
+#endif /* CONFIG_HT_IRQ */
+
 extern void pci_block_user_cfg_access(struct pci_dev *dev);
 extern void pci_unblock_user_cfg_access(struct pci_dev *dev);
 
@@ -784,12 +872,13 @@ enum pci_fixup_pass {
 void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev);
 
 extern int pci_pci_problems;
-#define PCIPCI_FAIL            1
+#define PCIPCI_FAIL            1       /* No PCI PCI DMA */
 #define PCIPCI_TRITON          2
 #define PCIPCI_NATOMA          4
 #define PCIPCI_VIAETBF         8
 #define PCIPCI_VSFX            16
-#define PCIPCI_ALIMAGIK                32
+#define PCIPCI_ALIMAGIK                32      /* Need low latency setting */
+#define PCIAGP_FAIL            64      /* No PCI to AGP DMA */
 
 #endif /* __KERNEL__ */
 #endif /* LINUX_PCI_H */