blob: f98867252ee269afac74dba19e04a5c0a629a07f [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * IBM PowerPC Virtual I/O Infrastructure Support.
3 *
Stephen Rothwell19dbd0f2005-07-12 17:50:26 +10004 * Copyright (c) 2003-2005 IBM Corp.
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 * Dave Engebretsen engebret@us.ibm.com
6 * Santiago Leon santil@us.ibm.com
7 * Hollis Blanchard <hollisb@us.ibm.com>
Stephen Rothwell19dbd0f2005-07-12 17:50:26 +10008 * Stephen Rothwell
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +100016#include <linux/types.h>
17#include <linux/device.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070018#include <linux/init.h>
19#include <linux/console.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070020#include <linux/module.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070021#include <linux/mm.h>
22#include <linux/dma-mapping.h>
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +100023#include <linux/kobject.h>
24
Linus Torvalds1da177e2005-04-16 15:20:36 -070025#include <asm/iommu.h>
26#include <asm/dma.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070027#include <asm/vio.h>
Olaf Hering143dcec2005-11-08 21:34:36 -080028#include <asm/prom.h>
Stephen Rothwelle10fa772006-04-27 17:18:21 +100029#include <asm/firmware.h>
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +100030#include <asm/tce.h>
31#include <asm/abs_addr.h>
32#include <asm/page.h>
33#include <asm/hvcall.h>
34#include <asm/iseries/vio.h>
35#include <asm/iseries/hv_types.h>
36#include <asm/iseries/hv_lp_config.h>
37#include <asm/iseries/hv_call_xm.h>
38#include <asm/iseries/iommu.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070039
Stephen Rothwell6fccab22007-09-21 14:32:05 +100040static struct bus_type vio_bus_type;
41
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +100042static struct vio_dev vio_bus_device = { /* fake "parent" device */
Stephen Rothwellac5b33c2005-06-21 17:15:54 -070043 .name = vio_bus_device.dev.bus_id,
44 .type = "",
Stephen Rothwellac5b33c2005-06-21 17:15:54 -070045 .dev.bus_id = "vio",
46 .dev.bus = &vio_bus_type,
47};
Linus Torvalds1da177e2005-04-16 15:20:36 -070048
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +100049static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
50{
Stephen Rothwelldd9b67a2007-10-11 14:55:02 +100051 const unsigned char *dma_window;
52 struct iommu_table *tbl;
53 unsigned long offset, size;
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +100054
Stephen Rothwelldd9b67a2007-10-11 14:55:02 +100055 if (firmware_has_feature(FW_FEATURE_ISERIES))
56 return vio_build_iommu_table_iseries(dev);
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +100057
Stephen Rothwelldd9b67a2007-10-11 14:55:02 +100058 dma_window = of_get_property(dev->dev.archdata.of_node,
59 "ibm,my-dma-window", NULL);
60 if (!dma_window)
61 return NULL;
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +100062
Stephen Rothwelldd9b67a2007-10-11 14:55:02 +100063 tbl = kmalloc(sizeof(*tbl), GFP_KERNEL);
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +100064
Stephen Rothwelldd9b67a2007-10-11 14:55:02 +100065 of_parse_dma_window(dev->dev.archdata.of_node, dma_window,
66 &tbl->it_index, &offset, &size);
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +100067
Stephen Rothwelldd9b67a2007-10-11 14:55:02 +100068 /* TCE table size - measured in tce entries */
69 tbl->it_size = size >> IOMMU_PAGE_SHIFT;
70 /* offset for VIO should always be 0 */
71 tbl->it_offset = offset >> IOMMU_PAGE_SHIFT;
72 tbl->it_busno = 0;
73 tbl->it_type = TCE_VB;
74
75 return iommu_init_table(tbl, -1);
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +100076}
Linus Torvalds1da177e2005-04-16 15:20:36 -070077
Stephen Rothwelle10fa772006-04-27 17:18:21 +100078/**
79 * vio_match_device: - Tell if a VIO device has a matching
80 * VIO device id structure.
81 * @ids: array of VIO device id structures to search in
82 * @dev: the VIO device structure to match against
83 *
84 * Used by a driver to check whether a VIO device present in the
85 * system is in its list of supported devices. Returns the matching
86 * vio_device_id structure or NULL if there is no match.
87 */
88static const struct vio_device_id *vio_match_device(
89 const struct vio_device_id *ids, const struct vio_dev *dev)
90{
91 while (ids->type[0] != '\0') {
Stephen Rothwelldd721ff2006-04-27 17:21:46 +100092 if ((strncmp(dev->type, ids->type, strlen(ids->type)) == 0) &&
Stephen Rothwell55b61fe2007-05-03 17:26:52 +100093 of_device_is_compatible(dev->dev.archdata.of_node,
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +110094 ids->compat))
Stephen Rothwelle10fa772006-04-27 17:18:21 +100095 return ids;
96 ids++;
97 }
98 return NULL;
99}
100
Stephen Rothwell5c0b4b82005-08-17 16:37:35 +1000101/*
102 * Convert from struct device to struct vio_dev and pass to driver.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103 * dev->driver has already been set by generic code because vio_bus_match
Stephen Rothwell5c0b4b82005-08-17 16:37:35 +1000104 * succeeded.
105 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106static int vio_bus_probe(struct device *dev)
107{
108 struct vio_dev *viodev = to_vio_dev(dev);
109 struct vio_driver *viodrv = to_vio_driver(dev->driver);
110 const struct vio_device_id *id;
111 int error = -ENODEV;
112
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113 if (!viodrv->probe)
114 return error;
115
116 id = vio_match_device(viodrv->id_table, viodev);
Stephen Rothwell5c0b4b82005-08-17 16:37:35 +1000117 if (id)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118 error = viodrv->probe(viodev, id);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119
120 return error;
121}
122
123/* convert from struct device to struct vio_dev and pass to driver. */
124static int vio_bus_remove(struct device *dev)
125{
126 struct vio_dev *viodev = to_vio_dev(dev);
127 struct vio_driver *viodrv = to_vio_driver(dev->driver);
128
Stephen Rothwell5c0b4b82005-08-17 16:37:35 +1000129 if (viodrv->remove)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700130 return viodrv->remove(viodev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700131
132 /* driver can't remove */
133 return 1;
134}
135
136/**
137 * vio_register_driver: - Register a new vio driver
138 * @drv: The vio_driver structure to be registered.
139 */
140int vio_register_driver(struct vio_driver *viodrv)
141{
142 printk(KERN_DEBUG "%s: driver %s registering\n", __FUNCTION__,
Stephen Rothwell6fdf5392005-10-24 14:53:21 +1000143 viodrv->driver.name);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700144
145 /* fill in 'struct driver' fields */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146 viodrv->driver.bus = &vio_bus_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700147
148 return driver_register(&viodrv->driver);
149}
150EXPORT_SYMBOL(vio_register_driver);
151
152/**
153 * vio_unregister_driver - Remove registration of vio driver.
154 * @driver: The vio_driver struct to be removed form registration
155 */
156void vio_unregister_driver(struct vio_driver *viodrv)
157{
158 driver_unregister(&viodrv->driver);
159}
160EXPORT_SYMBOL(vio_unregister_driver);
161
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +1000162/* vio_dev refcount hit 0 */
163static void __devinit vio_dev_release(struct device *dev)
164{
Mariusz Kozlowski6690fae2007-01-02 12:38:36 +0100165 /* XXX should free TCE table */
166 of_node_put(dev->archdata.of_node);
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +1000167 kfree(to_vio_dev(dev));
168}
169
Linus Torvalds1da177e2005-04-16 15:20:36 -0700170/**
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000171 * vio_register_device_node: - Register a new vio device.
172 * @of_node: The OF node for this device.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700173 *
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000174 * Creates and initializes a vio_dev structure from the data in
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +1100175 * of_node and adds it to the list of virtual devices.
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000176 * Returns a pointer to the created vio_dev or NULL if node has
177 * NULL device_type or compatible fields.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700178 */
Stephen Rothwellde7d8122008-02-05 14:15:12 +1100179struct vio_dev *vio_register_device_node(struct device_node *of_node)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700180{
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000181 struct vio_dev *viodev;
Jeremy Kerra7f67bd2006-07-12 15:35:54 +1000182 const unsigned int *unit_address;
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000183
184 /* we need the 'device_type' property, in order to match with drivers */
185 if (of_node->type == NULL) {
186 printk(KERN_WARNING "%s: node %s missing 'device_type'\n",
187 __FUNCTION__,
188 of_node->name ? of_node->name : "<unknown>");
189 return NULL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700190 }
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000191
Stephen Rothwelle2eb6392007-04-03 22:26:41 +1000192 unit_address = of_get_property(of_node, "reg", NULL);
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000193 if (unit_address == NULL) {
194 printk(KERN_WARNING "%s: node %s missing 'reg'\n",
195 __FUNCTION__,
196 of_node->name ? of_node->name : "<unknown>");
197 return NULL;
198 }
199
200 /* allocate a vio_dev for this node */
201 viodev = kzalloc(sizeof(struct vio_dev), GFP_KERNEL);
202 if (viodev == NULL)
203 return NULL;
204
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000205 viodev->irq = irq_of_parse_and_map(of_node, 0);
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000206
207 snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%x", *unit_address);
208 viodev->name = of_node->name;
209 viodev->type = of_node->type;
210 viodev->unit_address = *unit_address;
211 if (firmware_has_feature(FW_FEATURE_ISERIES)) {
Stephen Rothwelle2eb6392007-04-03 22:26:41 +1000212 unit_address = of_get_property(of_node,
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000213 "linux,unit_address", NULL);
214 if (unit_address != NULL)
215 viodev->unit_address = *unit_address;
216 }
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +1100217 viodev->dev.archdata.of_node = of_node_get(of_node);
218 viodev->dev.archdata.dma_ops = &dma_iommu_ops;
219 viodev->dev.archdata.dma_data = vio_build_iommu_table(viodev);
220 viodev->dev.archdata.numa_node = of_node_to_nid(of_node);
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +1000221
222 /* init generic 'struct device' fields: */
223 viodev->dev.parent = &vio_bus_device.dev;
224 viodev->dev.bus = &vio_bus_type;
225 viodev->dev.release = vio_dev_release;
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000226
227 /* register with generic device framework */
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +1000228 if (device_register(&viodev->dev)) {
229 printk(KERN_ERR "%s: failed to register device %s\n",
230 __FUNCTION__, viodev->dev.bus_id);
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000231 /* XXX free TCE table */
232 kfree(viodev);
233 return NULL;
234 }
235
236 return viodev;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700237}
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000238EXPORT_SYMBOL(vio_register_device_node);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700239
Linus Torvalds1da177e2005-04-16 15:20:36 -0700240/**
241 * vio_bus_init: - Initialize the virtual IO bus
242 */
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +1000243static int __init vio_bus_init(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700244{
245 int err;
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000246 struct device_node *node_vroot;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700247
248 err = bus_register(&vio_bus_type);
249 if (err) {
250 printk(KERN_ERR "failed to register VIO bus\n");
251 return err;
252 }
253
Stephen Rothwell5c0b4b82005-08-17 16:37:35 +1000254 /*
255 * The fake parent of all vio devices, just to give us
Stephen Rothwell3e494c82005-07-12 17:40:17 +1000256 * a nice directory
257 */
Stephen Rothwellac5b33c2005-06-21 17:15:54 -0700258 err = device_register(&vio_bus_device.dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700259 if (err) {
Stephen Rothwell3e494c82005-07-12 17:40:17 +1000260 printk(KERN_WARNING "%s: device_register returned %i\n",
261 __FUNCTION__, err);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700262 return err;
263 }
264
Stephen Rothwell30686ba2007-04-24 13:53:04 +1000265 node_vroot = of_find_node_by_name(NULL, "vdevice");
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000266 if (node_vroot) {
267 struct device_node *of_node;
268
269 /*
270 * Create struct vio_devices for each virtual device in
271 * the device tree. Drivers will associate with them later.
272 */
273 for (of_node = node_vroot->child; of_node != NULL;
Stephen Rothwellc5467262007-09-21 14:29:28 +1000274 of_node = of_node->sibling)
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000275 vio_register_device_node(of_node);
Stephen Rothwell30686ba2007-04-24 13:53:04 +1000276 of_node_put(node_vroot);
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000277 }
278
Linus Torvalds1da177e2005-04-16 15:20:36 -0700279 return 0;
280}
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +1000281__initcall(vio_bus_init);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700282
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000283static ssize_t name_show(struct device *dev,
Stephen Rothwell5c0b4b82005-08-17 16:37:35 +1000284 struct device_attribute *attr, char *buf)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700285{
286 return sprintf(buf, "%s\n", to_vio_dev(dev)->name);
287}
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000288
289static ssize_t devspec_show(struct device *dev,
290 struct device_attribute *attr, char *buf)
291{
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +1100292 struct device_node *of_node = dev->archdata.of_node;
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000293
294 return sprintf(buf, "%s\n", of_node ? of_node->full_name : "none");
295}
296
297static struct device_attribute vio_dev_attrs[] = {
298 __ATTR_RO(name),
299 __ATTR_RO(devspec),
300 __ATTR_NULL
301};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700302
Linus Torvalds1da177e2005-04-16 15:20:36 -0700303void __devinit vio_unregister_device(struct vio_dev *viodev)
304{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700305 device_unregister(&viodev->dev);
306}
307EXPORT_SYMBOL(vio_unregister_device);
308
Linus Torvalds1da177e2005-04-16 15:20:36 -0700309static int vio_bus_match(struct device *dev, struct device_driver *drv)
310{
311 const struct vio_dev *vio_dev = to_vio_dev(dev);
312 struct vio_driver *vio_drv = to_vio_driver(drv);
313 const struct vio_device_id *ids = vio_drv->id_table;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700314
Stephen Rothwell5c0b4b82005-08-17 16:37:35 +1000315 return (ids != NULL) && (vio_match_device(ids, vio_dev) != NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700316}
317
Kay Sievers7eff2e72007-08-14 15:15:12 +0200318static int vio_hotplug(struct device *dev, struct kobj_uevent_env *env)
Olaf Hering143dcec2005-11-08 21:34:36 -0800319{
320 const struct vio_dev *vio_dev = to_vio_dev(dev);
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +1100321 struct device_node *dn;
Jeremy Kerra7f67bd2006-07-12 15:35:54 +1000322 const char *cp;
Olaf Hering143dcec2005-11-08 21:34:36 -0800323
Benjamin Herrenschmidt12d04ee2006-11-11 17:25:02 +1100324 dn = dev->archdata.of_node;
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000325 if (!dn)
Olaf Hering143dcec2005-11-08 21:34:36 -0800326 return -ENODEV;
Kay Sievers7eff2e72007-08-14 15:15:12 +0200327 cp = of_get_property(dn, "compatible", NULL);
Olaf Hering143dcec2005-11-08 21:34:36 -0800328 if (!cp)
329 return -ENODEV;
330
Kay Sievers7eff2e72007-08-14 15:15:12 +0200331 add_uevent_var(env, "MODALIAS=vio:T%sS%s", vio_dev->type, cp);
Olaf Hering143dcec2005-11-08 21:34:36 -0800332 return 0;
333}
334
Stephen Rothwell6fccab22007-09-21 14:32:05 +1000335static struct bus_type vio_bus_type = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700336 .name = "vio",
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000337 .dev_attrs = vio_dev_attrs,
Kay Sievers312c0042005-11-16 09:00:00 +0100338 .uevent = vio_hotplug,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700339 .match = vio_bus_match,
Russell King2f53a802006-01-05 14:36:47 +0000340 .probe = vio_bus_probe,
341 .remove = vio_bus_remove,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700342};
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000343
344/**
345 * vio_get_attribute: - get attribute for virtual device
346 * @vdev: The vio device to get property.
347 * @which: The property/attribute to be extracted.
348 * @length: Pointer to length of returned data size (unused if NULL).
349 *
Stephen Rothwelle2eb6392007-04-03 22:26:41 +1000350 * Calls prom.c's of_get_property() to return the value of the
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000351 * attribute specified by @which
352*/
353const void *vio_get_attribute(struct vio_dev *vdev, char *which, int *length)
354{
Stephen Rothwelle2eb6392007-04-03 22:26:41 +1000355 return of_get_property(vdev->dev.archdata.of_node, which, length);
Stephen Rothwelle10fa772006-04-27 17:18:21 +1000356}
357EXPORT_SYMBOL(vio_get_attribute);
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +1000358
359#ifdef CONFIG_PPC_PSERIES
360/* vio_find_name() - internal because only vio.c knows how we formatted the
361 * kobject name
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +1000362 */
Paul Mackerrasc847c852008-01-27 11:45:30 +1100363static struct vio_dev *vio_find_name(const char *name)
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +1000364{
Paul Mackerrasc847c852008-01-27 11:45:30 +1100365 struct device *found;
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +1000366
Paul Mackerrasc847c852008-01-27 11:45:30 +1100367 found = bus_find_device_by_name(&vio_bus_type, NULL, name);
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +1000368 if (!found)
369 return NULL;
370
Paul Mackerrasc847c852008-01-27 11:45:30 +1100371 return to_vio_dev(found);
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +1000372}
373
374/**
375 * vio_find_node - find an already-registered vio_dev
376 * @vnode: device_node of the virtual device we're looking for
377 */
378struct vio_dev *vio_find_node(struct device_node *vnode)
379{
Jeremy Kerra7f67bd2006-07-12 15:35:54 +1000380 const uint32_t *unit_address;
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +1000381 char kobj_name[BUS_ID_SIZE];
382
383 /* construct the kobject name from the device node */
Stephen Rothwelle2eb6392007-04-03 22:26:41 +1000384 unit_address = of_get_property(vnode, "reg", NULL);
Stephen Rothwellc7f0e8c2006-04-27 17:23:32 +1000385 if (!unit_address)
386 return NULL;
387 snprintf(kobj_name, BUS_ID_SIZE, "%x", *unit_address);
388
389 return vio_find_name(kobj_name);
390}
391EXPORT_SYMBOL(vio_find_node);
392
393int vio_enable_interrupts(struct vio_dev *dev)
394{
395 int rc = h_vio_signal(dev->unit_address, VIO_IRQ_ENABLE);
396 if (rc != H_SUCCESS)
397 printk(KERN_ERR "vio: Error 0x%x enabling interrupts\n", rc);
398 return rc;
399}
400EXPORT_SYMBOL(vio_enable_interrupts);
401
402int vio_disable_interrupts(struct vio_dev *dev)
403{
404 int rc = h_vio_signal(dev->unit_address, VIO_IRQ_DISABLE);
405 if (rc != H_SUCCESS)
406 printk(KERN_ERR "vio: Error 0x%x disabling interrupts\n", rc);
407 return rc;
408}
409EXPORT_SYMBOL(vio_disable_interrupts);
410#endif /* CONFIG_PPC_PSERIES */