summaryrefslogtreecommitdiff
path: root/arch/sparc64/kernel/vio.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-07-17 21:37:35 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2007-07-18 01:19:51 -0700
commit920c3ed741340a88f2042ab0c44a25b8c743a379 (patch)
treefecca3490f84274a6a1cc36956937f3b7bba3394 /arch/sparc64/kernel/vio.c
parentcb32da0416b823b7f4b65e7e85d6cba16ca4d1e1 (diff)
[SPARC64]: Add basic infrastructure for MD add/remove notification.
And add dummy handlers for the VIO device layer. These will be filled in with real code after the vdc, vnet, and ds drivers are reworked to have simpler dependencies on the VIO device tree. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/vio.c')
-rw-r--r--arch/sparc64/kernel/vio.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/sparc64/kernel/vio.c b/arch/sparc64/kernel/vio.c
index 49569b44ea1f..d487be093b4a 100644
--- a/arch/sparc64/kernel/vio.c
+++ b/arch/sparc64/kernel/vio.c
@@ -172,6 +172,36 @@ struct device_node *cdev_node;
static struct vio_dev *root_vdev;
static u64 cdev_cfg_handle;
+static void vio_add(struct mdesc_handle *hp, u64 node)
+{
+ const char *name = mdesc_get_property(hp, node, "name", NULL);
+ const u64 *id = mdesc_get_property(hp, node, "id", NULL);
+
+ printk(KERN_ERR "VIO: Device add (%s) ID[%lx]\n",
+ name, *id);
+}
+
+static void vio_remove(struct mdesc_handle *hp, u64 node)
+{
+ const char *name = mdesc_get_property(hp, node, "name", NULL);
+ const u64 *id = mdesc_get_property(hp, node, "id", NULL);
+
+ printk(KERN_ERR "VIO: Device remove (%s) ID[%lx]\n",
+ name, *id);
+}
+
+static struct mdesc_notifier_client vio_device_notifier = {
+ .add = vio_add,
+ .remove = vio_remove,
+ .node_name = "virtual-device-port",
+};
+
+static struct mdesc_notifier_client vio_ds_notifier = {
+ .add = vio_add,
+ .remove = vio_remove,
+ .node_name = "domain-services-port",
+};
+
static void vio_fill_channel_info(struct mdesc_handle *hp, u64 mp,
struct vio_dev *vdev)
{
@@ -381,6 +411,9 @@ static int __init vio_init(void)
cdev_cfg_handle = *cfg_handle;
+ mdesc_register_notifier(&vio_device_notifier);
+ mdesc_register_notifier(&vio_ds_notifier);
+
create_devices(hp, root);
mdesc_release(hp);