Lines Matching refs:tm_vdev

209 				     struct mlxbf_tmfifo_vdev *tm_vdev)  in mlxbf_tmfifo_free_vrings()  argument
214 for (i = 0; i < ARRAY_SIZE(tm_vdev->vrings); i++) { in mlxbf_tmfifo_free_vrings()
215 vring = &tm_vdev->vrings[i]; in mlxbf_tmfifo_free_vrings()
218 dma_free_coherent(tm_vdev->vdev.dev.parent, size, in mlxbf_tmfifo_free_vrings()
231 struct mlxbf_tmfifo_vdev *tm_vdev) in mlxbf_tmfifo_alloc_vrings() argument
239 for (i = 0; i < ARRAY_SIZE(tm_vdev->vrings); i++) { in mlxbf_tmfifo_alloc_vrings()
240 vring = &tm_vdev->vrings[i]; in mlxbf_tmfifo_alloc_vrings()
245 vring->vdev_id = tm_vdev->vdev.id.device; in mlxbf_tmfifo_alloc_vrings()
246 dev = &tm_vdev->vdev.dev; in mlxbf_tmfifo_alloc_vrings()
251 mlxbf_tmfifo_free_vrings(fifo, tm_vdev); in mlxbf_tmfifo_alloc_vrings()
796 struct mlxbf_tmfifo_vdev *tm_vdev; in mlxbf_tmfifo_work_rxtx() local
805 tm_vdev = fifo->vdev[i]; in mlxbf_tmfifo_work_rxtx()
806 if (tm_vdev) { in mlxbf_tmfifo_work_rxtx()
807 vring = &tm_vdev->vrings[queue_id]; in mlxbf_tmfifo_work_rxtx()
840 struct mlxbf_tmfifo_vdev *tm_vdev; in mlxbf_tmfifo_virtio_notify() local
859 tm_vdev = fifo->vdev[VIRTIO_ID_CONSOLE]; in mlxbf_tmfifo_virtio_notify()
860 mlxbf_tmfifo_console_output(tm_vdev, vring); in mlxbf_tmfifo_virtio_notify()
879 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_get_features() local
881 return tm_vdev->features; in mlxbf_tmfifo_virtio_get_features()
887 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_finalize_features() local
889 tm_vdev->features = vdev->features; in mlxbf_tmfifo_virtio_finalize_features()
897 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_del_vqs() local
902 for (i = 0; i < ARRAY_SIZE(tm_vdev->vrings); i++) { in mlxbf_tmfifo_virtio_del_vqs()
903 vring = &tm_vdev->vrings[i]; in mlxbf_tmfifo_virtio_del_vqs()
925 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_find_vqs() local
930 if (nvqs > ARRAY_SIZE(tm_vdev->vrings)) in mlxbf_tmfifo_virtio_find_vqs()
938 vring = &tm_vdev->vrings[i]; in mlxbf_tmfifo_virtio_find_vqs()
968 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_get_status() local
970 return tm_vdev->status; in mlxbf_tmfifo_virtio_get_status()
977 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_set_status() local
979 tm_vdev->status = status; in mlxbf_tmfifo_virtio_set_status()
985 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_reset() local
987 tm_vdev->status = 0; in mlxbf_tmfifo_virtio_reset()
996 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_get() local
998 if ((u64)offset + len > sizeof(tm_vdev->config)) in mlxbf_tmfifo_virtio_get()
1001 memcpy(buf, (u8 *)&tm_vdev->config + offset, len); in mlxbf_tmfifo_virtio_get()
1010 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_set() local
1012 if ((u64)offset + len > sizeof(tm_vdev->config)) in mlxbf_tmfifo_virtio_set()
1015 memcpy((u8 *)&tm_vdev->config + offset, buf, len); in mlxbf_tmfifo_virtio_set()
1022 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in tmfifo_virtio_dev_release() local
1024 kfree(tm_vdev); in tmfifo_virtio_dev_release()
1046 struct mlxbf_tmfifo_vdev *tm_vdev, *reg_dev = NULL; in mlxbf_tmfifo_create_vdev() local
1051 tm_vdev = fifo->vdev[vdev_id]; in mlxbf_tmfifo_create_vdev()
1052 if (tm_vdev) { in mlxbf_tmfifo_create_vdev()
1058 tm_vdev = kzalloc(sizeof(*tm_vdev), GFP_KERNEL); in mlxbf_tmfifo_create_vdev()
1059 if (!tm_vdev) { in mlxbf_tmfifo_create_vdev()
1064 tm_vdev->vdev.id.device = vdev_id; in mlxbf_tmfifo_create_vdev()
1065 tm_vdev->vdev.config = &mlxbf_tmfifo_virtio_config_ops; in mlxbf_tmfifo_create_vdev()
1066 tm_vdev->vdev.dev.parent = dev; in mlxbf_tmfifo_create_vdev()
1067 tm_vdev->vdev.dev.release = tmfifo_virtio_dev_release; in mlxbf_tmfifo_create_vdev()
1068 tm_vdev->features = features; in mlxbf_tmfifo_create_vdev()
1070 memcpy(&tm_vdev->config, config, size); in mlxbf_tmfifo_create_vdev()
1072 if (mlxbf_tmfifo_alloc_vrings(fifo, tm_vdev)) { in mlxbf_tmfifo_create_vdev()
1080 tm_vdev->tx_buf.buf = devm_kmalloc(dev, in mlxbf_tmfifo_create_vdev()
1083 fifo->vdev[vdev_id] = tm_vdev; in mlxbf_tmfifo_create_vdev()
1086 ret = register_virtio_device(&tm_vdev->vdev); in mlxbf_tmfifo_create_vdev()
1087 reg_dev = tm_vdev; in mlxbf_tmfifo_create_vdev()
1097 mlxbf_tmfifo_free_vrings(fifo, tm_vdev); in mlxbf_tmfifo_create_vdev()
1100 put_device(&tm_vdev->vdev.dev); in mlxbf_tmfifo_create_vdev()
1102 kfree(tm_vdev); in mlxbf_tmfifo_create_vdev()
1111 struct mlxbf_tmfifo_vdev *tm_vdev; in mlxbf_tmfifo_delete_vdev() local
1116 tm_vdev = fifo->vdev[vdev_id]; in mlxbf_tmfifo_delete_vdev()
1117 if (tm_vdev) { in mlxbf_tmfifo_delete_vdev()
1118 unregister_virtio_device(&tm_vdev->vdev); in mlxbf_tmfifo_delete_vdev()
1119 mlxbf_tmfifo_free_vrings(fifo, tm_vdev); in mlxbf_tmfifo_delete_vdev()