#define _ASM_PNV_PCI_H
#include <linux/pci.h>
+#include <linux/pci_hotplug.h>
#include <misc/cxl-base.h>
#include <asm/opal-api.h>
#endif
+struct pnv_php_slot {
+ struct hotplug_slot slot;
+ struct hotplug_slot_info slot_info;
+ uint64_t id;
+ char *name;
+ int slot_no;
+ struct kref kref;
+#define PNV_PHP_STATE_INITIALIZED 0
+#define PNV_PHP_STATE_REGISTERED 1
+#define PNV_PHP_STATE_POPULATED 2
+#define PNV_PHP_STATE_OFFLINE 3
+ int state;
+ struct device_node *dn;
+ struct pci_dev *pdev;
+ struct pci_bus *bus;
+ bool power_state_check;
+ void *fdt;
+ void *dt;
+ struct of_changeset ocs;
+ struct pnv_php_slot *parent;
+ struct list_head children;
+ struct list_head link;
+};
+extern struct pnv_php_slot *pnv_php_find_slot(struct device_node *dn);
+extern int pnv_php_set_slot_power_state(struct hotplug_slot *slot,
+ uint8_t state);
+
#endif
#define DRIVER_AUTHOR "Gavin Shan, IBM Corporation"
#define DRIVER_DESC "PowerPC PowerNV PCI Hotplug Driver"
-struct pnv_php_slot {
- struct hotplug_slot slot;
- struct hotplug_slot_info slot_info;
- uint64_t id;
- char *name;
- int slot_no;
- struct kref kref;
-#define PNV_PHP_STATE_INITIALIZED 0
-#define PNV_PHP_STATE_REGISTERED 1
-#define PNV_PHP_STATE_POPULATED 2
-#define PNV_PHP_STATE_OFFLINE 3
- int state;
- struct device_node *dn;
- struct pci_dev *pdev;
- struct pci_bus *bus;
- bool power_state_check;
- void *fdt;
- void *dt;
- struct of_changeset ocs;
- struct pnv_php_slot *parent;
- struct list_head children;
- struct list_head link;
-};
-
static LIST_HEAD(pnv_php_slot_list);
static DEFINE_SPINLOCK(pnv_php_lock);
return NULL;
}
-static struct pnv_php_slot *pnv_php_find_slot(struct device_node *dn)
+struct pnv_php_slot *pnv_php_find_slot(struct device_node *dn)
{
struct pnv_php_slot *php_slot, *tmp;
unsigned long flags;
return NULL;
}
+EXPORT_SYMBOL_GPL(pnv_php_find_slot);
/*
* Remove pdn for all children of the indicated device node.
return ret;
}
-static int pnv_php_set_slot_power_state(struct hotplug_slot *slot,
- uint8_t state)
+int pnv_php_set_slot_power_state(struct hotplug_slot *slot,
+ uint8_t state)
{
struct pnv_php_slot *php_slot = slot->private;
struct opal_msg msg;
return ret;
}
+EXPORT_SYMBOL_GPL(pnv_php_set_slot_power_state);
static int pnv_php_get_power_state(struct hotplug_slot *slot, u8 *state)
{