• Home
  • Raw
  • Download

Lines Matching refs:vdev

27 	struct vdpa_device *vdev = dev_to_vdpa(d);  in vdpa_dev_probe()  local
28 struct vdpa_driver *drv = drv_to_vdpa(vdev->dev.driver); in vdpa_dev_probe()
32 ret = drv->probe(vdev); in vdpa_dev_probe()
39 struct vdpa_device *vdev = dev_to_vdpa(d); in vdpa_dev_remove() local
40 struct vdpa_driver *drv = drv_to_vdpa(vdev->dev.driver); in vdpa_dev_remove()
43 drv->remove(vdev); in vdpa_dev_remove()
54 struct vdpa_device *vdev = dev_to_vdpa(d); in vdpa_release_dev() local
55 const struct vdpa_config_ops *ops = vdev->config; in vdpa_release_dev()
58 ops->free(vdev); in vdpa_release_dev()
60 ida_simple_remove(&vdpa_index_ida, vdev->index); in vdpa_release_dev()
61 kfree(vdev); in vdpa_release_dev()
85 struct vdpa_device *vdev; in __vdpa_alloc_device() local
99 vdev = kzalloc(size, GFP_KERNEL); in __vdpa_alloc_device()
100 if (!vdev) in __vdpa_alloc_device()
107 vdev->dev.bus = &vdpa_bus; in __vdpa_alloc_device()
108 vdev->dev.parent = parent; in __vdpa_alloc_device()
109 vdev->dev.release = vdpa_release_dev; in __vdpa_alloc_device()
110 vdev->index = err; in __vdpa_alloc_device()
111 vdev->config = config; in __vdpa_alloc_device()
112 vdev->features_valid = false; in __vdpa_alloc_device()
113 vdev->use_va = use_va; in __vdpa_alloc_device()
116 err = dev_set_name(&vdev->dev, "%s", name); in __vdpa_alloc_device()
118 err = dev_set_name(&vdev->dev, "vdpa%u", vdev->index); in __vdpa_alloc_device()
122 device_initialize(&vdev->dev); in __vdpa_alloc_device()
124 return vdev; in __vdpa_alloc_device()
127 ida_simple_remove(&vdpa_index_ida, vdev->index); in __vdpa_alloc_device()
129 kfree(vdev); in __vdpa_alloc_device()
137 struct vdpa_device *vdev = container_of(dev, struct vdpa_device, dev); in vdpa_name_match() local
139 return (strcmp(dev_name(&vdev->dev), data) == 0); in vdpa_name_match()
142 static int __vdpa_register_device(struct vdpa_device *vdev, int nvqs) in __vdpa_register_device() argument
146 vdev->nvqs = nvqs; in __vdpa_register_device()
149 dev = bus_find_device(&vdpa_bus, NULL, dev_name(&vdev->dev), vdpa_name_match); in __vdpa_register_device()
154 return device_add(&vdev->dev); in __vdpa_register_device()
167 int _vdpa_register_device(struct vdpa_device *vdev, int nvqs) in _vdpa_register_device() argument
169 if (!vdev->mdev) in _vdpa_register_device()
172 return __vdpa_register_device(vdev, nvqs); in _vdpa_register_device()
184 int vdpa_register_device(struct vdpa_device *vdev, int nvqs) in vdpa_register_device() argument
189 err = __vdpa_register_device(vdev, nvqs); in vdpa_register_device()
201 void _vdpa_unregister_device(struct vdpa_device *vdev) in _vdpa_unregister_device() argument
204 WARN_ON(!vdev->mdev); in _vdpa_unregister_device()
205 device_unregister(&vdev->dev); in _vdpa_unregister_device()
213 void vdpa_unregister_device(struct vdpa_device *vdev) in vdpa_unregister_device() argument
216 device_unregister(&vdev->dev); in vdpa_unregister_device()
271 struct vdpa_device *vdev = container_of(dev, struct vdpa_device, dev); in vdpa_match_remove() local
272 struct vdpa_mgmt_dev *mdev = vdev->mdev; in vdpa_match_remove()
275 mdev->ops->dev_del(mdev, vdev); in vdpa_match_remove()
460 struct vdpa_device *vdev; in vdpa_nl_cmd_dev_del_set_doit() local
476 vdev = container_of(dev, struct vdpa_device, dev); in vdpa_nl_cmd_dev_del_set_doit()
477 if (!vdev->mdev) { in vdpa_nl_cmd_dev_del_set_doit()
482 mdev = vdev->mdev; in vdpa_nl_cmd_dev_del_set_doit()
483 mdev->ops->dev_del(mdev, vdev); in vdpa_nl_cmd_dev_del_set_doit()
492 vdpa_dev_fill(struct vdpa_device *vdev, struct sk_buff *msg, u32 portid, u32 seq, in vdpa_dev_fill() argument
505 err = vdpa_nl_mgmtdev_handle_fill(msg, vdev->mdev); in vdpa_dev_fill()
509 device_id = vdev->config->get_device_id(vdev); in vdpa_dev_fill()
510 vendor_id = vdev->config->get_vendor_id(vdev); in vdpa_dev_fill()
511 max_vq_size = vdev->config->get_vq_num_max(vdev); in vdpa_dev_fill()
514 if (nla_put_string(msg, VDPA_ATTR_DEV_NAME, dev_name(&vdev->dev))) in vdpa_dev_fill()
520 if (nla_put_u32(msg, VDPA_ATTR_DEV_MAX_VQS, vdev->nvqs)) in vdpa_dev_fill()
535 struct vdpa_device *vdev; in vdpa_nl_cmd_dev_get_doit() local
555 vdev = container_of(dev, struct vdpa_device, dev); in vdpa_nl_cmd_dev_get_doit()
556 if (!vdev->mdev) { in vdpa_nl_cmd_dev_get_doit()
560 err = vdpa_dev_fill(vdev, msg, info->snd_portid, info->snd_seq, 0, info->extack); in vdpa_nl_cmd_dev_get_doit()
586 struct vdpa_device *vdev = container_of(dev, struct vdpa_device, dev); in vdpa_dev_dump() local
590 if (!vdev->mdev) in vdpa_dev_dump()
596 err = vdpa_dev_fill(vdev, info->msg, NETLINK_CB(info->cb->skb).portid, in vdpa_dev_dump()