Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
[safe/jmp/linux-2.6] / include / linux / pci_hotplug.h
index 11936fd..5d09cba 100644 (file)
 #ifndef _PCI_HOTPLUG_H
 #define _PCI_HOTPLUG_H
 
-
-/* These values come from the PCI Hotplug Spec */
-enum pci_bus_speed {
-       PCI_SPEED_33MHz                 = 0x00,
-       PCI_SPEED_66MHz                 = 0x01,
-       PCI_SPEED_66MHz_PCIX            = 0x02,
-       PCI_SPEED_100MHz_PCIX           = 0x03,
-       PCI_SPEED_133MHz_PCIX           = 0x04,
-       PCI_SPEED_66MHz_PCIX_ECC        = 0x05,
-       PCI_SPEED_100MHz_PCIX_ECC       = 0x06,
-       PCI_SPEED_133MHz_PCIX_ECC       = 0x07,
-       PCI_SPEED_66MHz_PCIX_266        = 0x09,
-       PCI_SPEED_100MHz_PCIX_266       = 0x0a,
-       PCI_SPEED_133MHz_PCIX_266       = 0x0b,
-       PCI_SPEED_66MHz_PCIX_533        = 0x11,
-       PCI_SPEED_100MHz_PCIX_533       = 0x12,
-       PCI_SPEED_133MHz_PCIX_533       = 0x13,
-       PCI_SPEED_UNKNOWN               = 0xff,
-};
-
 /* These values come from the PCI Express Spec */
 enum pcie_link_width {
        PCIE_LNK_WIDTH_RESRV    = 0x00,
@@ -61,14 +41,10 @@ enum pcie_link_width {
        PCIE_LNK_WIDTH_UNKNOWN  = 0xFF,
 };
 
-enum pcie_link_speed {
-       PCIE_2PT5GB             = 0x14,
-       PCIE_LNK_SPEED_UNKNOWN  = 0xFF,
-};
-
 /**
  * struct hotplug_slot_ops -the callbacks that the hotplug pci core can use
  * @owner: The module owner of this structure
+ * @mod_name: The module name (KBUILD_MODNAME) of this structure
  * @enable_slot: Called when the user wants to enable a specific pci slot
  * @disable_slot: Called when the user wants to disable a specific pci slot
  * @set_attention_status: Called to set the specific slot's attention LED to
@@ -87,12 +63,6 @@ enum pcie_link_speed {
  * @get_adapter_status: Called to get see if an adapter is present in the slot or not.
  *     If this field is NULL, the value passed in the struct hotplug_slot_info
  *     will be used when this value is requested by a user.
- * @get_max_bus_speed: Called to get the max bus speed for a slot.
- *     If this field is NULL, the value passed in the struct hotplug_slot_info
- *     will be used when this value is requested by a user.
- * @get_cur_bus_speed: Called to get the current bus speed for a slot.
- *     If this field is NULL, the value passed in the struct hotplug_slot_info
- *     will be used when this value is requested by a user.
  *
  * The table of function pointers that is passed to the hotplug pci core by a
  * hotplug pci driver.  These functions are called by the hotplug pci core when
@@ -101,6 +71,7 @@ enum pcie_link_speed {
  */
 struct hotplug_slot_ops {
        struct module *owner;
+       const char *mod_name;
        int (*enable_slot)              (struct hotplug_slot *slot);
        int (*disable_slot)             (struct hotplug_slot *slot);
        int (*set_attention_status)     (struct hotplug_slot *slot, u8 value);
@@ -109,17 +80,14 @@ struct hotplug_slot_ops {
        int (*get_attention_status)     (struct hotplug_slot *slot, u8 *value);
        int (*get_latch_status)         (struct hotplug_slot *slot, u8 *value);
        int (*get_adapter_status)       (struct hotplug_slot *slot, u8 *value);
-       int (*get_max_bus_speed)        (struct hotplug_slot *slot, enum pci_bus_speed *value);
-       int (*get_cur_bus_speed)        (struct hotplug_slot *slot, enum pci_bus_speed *value);
 };
 
 /**
  * struct hotplug_slot_info - used to notify the hotplug pci core of the state of the slot
- * @power: if power is enabled or not (1/0)
+ * @power_status: if power is enabled or not (1/0)
  * @attention_status: if the attention light is enabled or not (1/0)
  * @latch_status: if the latch (if any) is open or closed (1/0)
- * @adapter_present: if there is a pci board present in the slot or not (1/0)
- * @address: (domain << 16 | bus << 8 | dev)
+ * @adapter_status: if there is a pci board present in the slot or not (1/0)
  *
  * Used to notify the hotplug pci core of the status of a specific slot.
  */
@@ -128,8 +96,6 @@ struct hotplug_slot_info {
        u8      attention_status;
        u8      latch_status;
        u8      adapter_status;
-       enum pci_bus_speed      max_bus_speed;
-       enum pci_bus_speed      cur_bus_speed;
 };
 
 /**
@@ -159,12 +125,21 @@ static inline const char *hotplug_slot_name(const struct hotplug_slot *slot)
        return pci_slot_name(slot->pci_slot);
 }
 
-extern int pci_hp_register(struct hotplug_slot *, struct pci_bus *, int nr,
-                          const char *name);
+extern int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *pbus,
+                            int nr, const char *name,
+                            struct module *owner, const char *mod_name);
 extern int pci_hp_deregister(struct hotplug_slot *slot);
 extern int __must_check pci_hp_change_slot_info        (struct hotplug_slot *slot,
                                                 struct hotplug_slot_info *info);
 
+static inline int pci_hp_register(struct hotplug_slot *slot,
+                                 struct pci_bus *pbus,
+                                 int devnr, const char *name)
+{
+       return __pci_hp_register(slot, pbus, devnr, name,
+                                THIS_MODULE, KBUILD_MODNAME);
+}
+
 /* PCI Setting Record (Type 0) */
 struct hpp_type0 {
        u32 revision;
@@ -215,12 +190,18 @@ struct hotplug_params {
 #ifdef CONFIG_ACPI
 #include <acpi/acpi.h>
 #include <acpi/acpi_bus.h>
-extern acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus,
-                               struct hotplug_params *hpp);
+int pci_get_hp_params(struct pci_dev *dev, struct hotplug_params *hpp);
 int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags);
-int acpi_root_bridge(acpi_handle handle);
 int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle);
-int acpi_pci_detect_ejectable(struct pci_bus *pbus);
+int acpi_pci_detect_ejectable(acpi_handle handle);
+#else
+static inline int pci_get_hp_params(struct pci_dev *dev,
+                                   struct hotplug_params *hpp)
+{
+       return -ENODEV;
+}
 #endif
+
+void pci_configure_slot(struct pci_dev *dev);
 #endif