Lines Matching refs:vdev
71 struct vio_dev *vdev = to_vio_dev(dev); in vio_device_probe() local
78 id = vio_match_device(drv->id_table, vdev); in vio_device_probe()
84 if (vdev->tx_irq == 0 && vdev->tx_ino != ~0UL) in vio_device_probe()
85 vdev->tx_irq = sun4v_build_virq(vdev->cdev_handle, in vio_device_probe()
86 vdev->tx_ino); in vio_device_probe()
88 if (vdev->rx_irq == 0 && vdev->rx_ino != ~0UL) in vio_device_probe()
89 vdev->rx_irq = sun4v_build_virq(vdev->cdev_handle, in vio_device_probe()
90 vdev->rx_ino); in vio_device_probe()
93 return drv->probe(vdev, id); in vio_device_probe()
98 struct vio_dev *vdev = to_vio_dev(dev); in vio_device_remove() local
108 return drv->remove(vdev); in vio_device_remove()
117 struct vio_dev *vdev = to_vio_dev(dev); in devspec_show() local
120 if (!strcmp(vdev->type, "vnet-port")) in devspec_show()
122 else if (!strcmp(vdev->type, "vdc-port")) in devspec_show()
132 struct vio_dev *vdev = to_vio_dev(dev); in type_show() local
133 return sprintf(buf, "%s\n", vdev->type); in type_show()
140 const struct vio_dev *vdev = to_vio_dev(dev); in modalias_show() local
142 return sprintf(buf, "vio:T%sS%s\n", vdev->type, vdev->compat); in modalias_show()
190 struct vio_dev *vdev; in show_pciobppath_attr() local
193 vdev = to_vio_dev(dev); in show_pciobppath_attr()
194 dp = vdev->dp; in show_pciobppath_attr()
238 u64 vio_vdev_node(struct mdesc_handle *hp, struct vio_dev *vdev) in vio_vdev_node() argument
242 if (vdev == NULL) in vio_vdev_node()
245 node = mdesc_get_node(hp, (const char *)vdev->node_name, in vio_vdev_node()
246 &vdev->md_node_info); in vio_vdev_node()
253 struct vio_dev *vdev) in vio_fill_channel_info() argument
257 vdev->tx_ino = ~0UL; in vio_fill_channel_info()
258 vdev->rx_ino = ~0UL; in vio_fill_channel_info()
259 vdev->channel_id = ~0UL; in vio_fill_channel_info()
269 vdev->tx_ino = *irq; in vio_fill_channel_info()
273 vdev->rx_ino = *irq; in vio_fill_channel_info()
277 vdev->channel_id = *chan_id; in vio_fill_channel_info()
280 vdev->cdev_handle = cdev_cfg_handle; in vio_fill_channel_info()
298 struct vio_dev *vdev; in vio_create_one() local
329 vdev = kzalloc(sizeof(*vdev), GFP_KERNEL); in vio_create_one()
330 if (!vdev) { in vio_create_one()
335 vdev->mp = mp; in vio_create_one()
336 memcpy(vdev->type, type, tlen); in vio_create_one()
338 memcpy(vdev->compat, compat, clen); in vio_create_one()
340 memset(vdev->compat, 0, sizeof(vdev->compat)); in vio_create_one()
341 vdev->compat_len = clen; in vio_create_one()
343 vdev->port_id = ~0UL; in vio_create_one()
344 vdev->tx_irq = 0; in vio_create_one()
345 vdev->rx_irq = 0; in vio_create_one()
347 vio_fill_channel_info(hp, mp, vdev); in vio_create_one()
350 dev_set_name(&vdev->dev, "%s", type); in vio_create_one()
351 vdev->dev_no = ~(u64)0; in vio_create_one()
353 dev_set_name(&vdev->dev, "%s-%llu", type, *id); in vio_create_one()
354 vdev->dev_no = *id; in vio_create_one()
356 dev_set_name(&vdev->dev, "%s-%llu-%llu", type, in vio_create_one()
358 vdev->dev_no = *cfg_handle; in vio_create_one()
359 vdev->port_id = *id; in vio_create_one()
362 vdev->dev.parent = parent; in vio_create_one()
363 vdev->dev.bus = &vio_bus_type; in vio_create_one()
364 vdev->dev.release = vio_dev_release; in vio_create_one()
376 vdev->dp = dp; in vio_create_one()
383 (void) snprintf(vdev->node_name, VIO_MAX_NAME_LEN, "%s", in vio_create_one()
387 &vdev->md_node_info); in vio_create_one()
390 dev_name(&vdev->dev), err); in vio_create_one()
391 kfree(vdev); in vio_create_one()
397 dev_name(&vdev->dev), vdev->tx_ino, vdev->rx_ino); in vio_create_one()
399 err = device_register(&vdev->dev); in vio_create_one()
402 dev_name(&vdev->dev), err); in vio_create_one()
403 put_device(&vdev->dev); in vio_create_one()
406 if (vdev->dp) in vio_create_one()
407 err = sysfs_create_file(&vdev->dev.kobj, in vio_create_one()
410 return vdev; in vio_create_one()
426 struct vio_dev *vdev = to_vio_dev(dev); in vio_md_node_match() local
432 node = vio_vdev_node(node_data->hp, vdev); in vio_md_node_match()