diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-07-18 00:37:35 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-18 04:19:51 -0400 |
commit | 920c3ed741340a88f2042ab0c44a25b8c743a379 (patch) | |
tree | fecca3490f84274a6a1cc36956937f3b7bba3394 /arch/sparc64/kernel/vio.c | |
parent | cb32da0416b823b7f4b65e7e85d6cba16ca4d1e1 (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.c | 33 |
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; | |||
172 | static struct vio_dev *root_vdev; | 172 | static struct vio_dev *root_vdev; |
173 | static u64 cdev_cfg_handle; | 173 | static u64 cdev_cfg_handle; |
174 | 174 | ||
175 | static void vio_add(struct mdesc_handle *hp, u64 node) | ||
176 | { | ||
177 | const char *name = mdesc_get_property(hp, node, "name", NULL); | ||
178 | const u64 *id = mdesc_get_property(hp, node, "id", NULL); | ||
179 | |||
180 | printk(KERN_ERR "VIO: Device add (%s) ID[%lx]\n", | ||
181 | name, *id); | ||
182 | } | ||
183 | |||
184 | static void vio_remove(struct mdesc_handle *hp, u64 node) | ||
185 | { | ||
186 | const char *name = mdesc_get_property(hp, node, "name", NULL); | ||
187 | const u64 *id = mdesc_get_property(hp, node, "id", NULL); | ||
188 | |||
189 | printk(KERN_ERR "VIO: Device remove (%s) ID[%lx]\n", | ||
190 | name, *id); | ||
191 | } | ||
192 | |||
193 | static struct mdesc_notifier_client vio_device_notifier = { | ||
194 | .add = vio_add, | ||
195 | .remove = vio_remove, | ||
196 | .node_name = "virtual-device-port", | ||
197 | }; | ||
198 | |||
199 | static struct mdesc_notifier_client vio_ds_notifier = { | ||
200 | .add = vio_add, | ||
201 | .remove = vio_remove, | ||
202 | .node_name = "domain-services-port", | ||
203 | }; | ||
204 | |||
175 | static void vio_fill_channel_info(struct mdesc_handle *hp, u64 mp, | 205 | static void vio_fill_channel_info(struct mdesc_handle *hp, u64 mp, |
176 | struct vio_dev *vdev) | 206 | struct vio_dev *vdev) |
177 | { | 207 | { |
@@ -381,6 +411,9 @@ static int __init vio_init(void) | |||
381 | 411 | ||
382 | cdev_cfg_handle = *cfg_handle; | 412 | cdev_cfg_handle = *cfg_handle; |
383 | 413 | ||
414 | mdesc_register_notifier(&vio_device_notifier); | ||
415 | mdesc_register_notifier(&vio_ds_notifier); | ||
416 | |||
384 | create_devices(hp, root); | 417 | create_devices(hp, root); |
385 | 418 | ||
386 | mdesc_release(hp); | 419 | mdesc_release(hp); |