aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/vio.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64/kernel/vio.c')
-rw-r--r--arch/sparc64/kernel/vio.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/arch/sparc64/kernel/vio.c b/arch/sparc64/kernel/vio.c
index 8d3cc4fdb557..491223a6628f 100644
--- a/arch/sparc64/kernel/vio.c
+++ b/arch/sparc64/kernel/vio.c
@@ -103,9 +103,9 @@ static ssize_t devspec_show(struct device *dev,
103 struct vio_dev *vdev = to_vio_dev(dev); 103 struct vio_dev *vdev = to_vio_dev(dev);
104 const char *str = "none"; 104 const char *str = "none";
105 105
106 if (!strcmp(vdev->type, "network")) 106 if (!strcmp(vdev->type, "vnet-port"))
107 str = "vnet"; 107 str = "vnet";
108 else if (!strcmp(vdev->type, "block")) 108 else if (!strcmp(vdev->type, "vdc-port"))
109 str = "vdisk"; 109 str = "vdisk";
110 110
111 return sprintf(buf, "%s\n", str); 111 return sprintf(buf, "%s\n", str);
@@ -221,6 +221,27 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
221 return NULL; 221 return NULL;
222 } 222 }
223 223
224 if (!strcmp(type, "vdc-port")) {
225 u64 a;
226
227 id = NULL;
228 mdesc_for_each_arc(a, hp, mp, MDESC_ARC_TYPE_BACK) {
229 u64 target;
230
231 target = mdesc_arc_target(hp, a);
232 id = mdesc_get_property(hp, target,
233 "cfg-handle", NULL);
234 if (id)
235 break;
236 }
237 if (!id) {
238 printk(KERN_ERR "VIO: vdc-port lacks parent "
239 "cfg-handle.\n");
240 return NULL;
241 }
242 } else
243 id = mdesc_get_property(hp, mp, "id", NULL);
244
224 bus_id_name = type; 245 bus_id_name = type;
225 if (!strcmp(type, "domain-services-port")) 246 if (!strcmp(type, "domain-services-port"))
226 bus_id_name = "ds"; 247 bus_id_name = "ds";
@@ -260,13 +281,15 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
260 281
261 vio_fill_channel_info(hp, mp, vdev); 282 vio_fill_channel_info(hp, mp, vdev);
262 283
263 id = mdesc_get_property(hp, mp, "id", NULL); 284 if (!id) {
264 if (!id)
265 snprintf(vdev->dev.bus_id, BUS_ID_SIZE, "%s", 285 snprintf(vdev->dev.bus_id, BUS_ID_SIZE, "%s",
266 bus_id_name); 286 bus_id_name);
267 else 287 vdev->dev_no = ~(u64)0;
288 } else {
268 snprintf(vdev->dev.bus_id, BUS_ID_SIZE, "%s-%lu", 289 snprintf(vdev->dev.bus_id, BUS_ID_SIZE, "%s-%lu",
269 bus_id_name, *id); 290 bus_id_name, *id);
291 vdev->dev_no = *id;
292 }
270 293
271 vdev->dev.parent = parent; 294 vdev->dev.parent = parent;
272 vdev->dev.bus = &vio_bus_type; 295 vdev->dev.bus = &vio_bus_type;