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()
805 struct mlxbf_tmfifo_vdev *tm_vdev; in mlxbf_tmfifo_work_rxtx() local
814 tm_vdev = fifo->vdev[i]; in mlxbf_tmfifo_work_rxtx()
815 if (tm_vdev) { in mlxbf_tmfifo_work_rxtx()
816 vring = &tm_vdev->vrings[queue_id]; in mlxbf_tmfifo_work_rxtx()
849 struct mlxbf_tmfifo_vdev *tm_vdev; in mlxbf_tmfifo_virtio_notify() local
868 tm_vdev = fifo->vdev[VIRTIO_ID_CONSOLE]; in mlxbf_tmfifo_virtio_notify()
869 mlxbf_tmfifo_console_output(tm_vdev, vring); in mlxbf_tmfifo_virtio_notify()
888 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_get_features() local
890 return tm_vdev->features; in mlxbf_tmfifo_virtio_get_features()
896 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_finalize_features() local
898 tm_vdev->features = vdev->features; in mlxbf_tmfifo_virtio_finalize_features()
906 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_del_vqs() local
911 for (i = 0; i < ARRAY_SIZE(tm_vdev->vrings); i++) { in mlxbf_tmfifo_virtio_del_vqs()
912 vring = &tm_vdev->vrings[i]; in mlxbf_tmfifo_virtio_del_vqs()
934 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_find_vqs() local
939 if (nvqs > ARRAY_SIZE(tm_vdev->vrings)) in mlxbf_tmfifo_virtio_find_vqs()
947 vring = &tm_vdev->vrings[i]; in mlxbf_tmfifo_virtio_find_vqs()
977 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_get_status() local
979 return tm_vdev->status; in mlxbf_tmfifo_virtio_get_status()
986 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_set_status() local
988 tm_vdev->status = status; in mlxbf_tmfifo_virtio_set_status()
994 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_reset() local
996 tm_vdev->status = 0; in mlxbf_tmfifo_virtio_reset()
1005 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_get() local
1007 if ((u64)offset + len > sizeof(tm_vdev->config)) in mlxbf_tmfifo_virtio_get()
1010 memcpy(buf, (u8 *)&tm_vdev->config + offset, len); in mlxbf_tmfifo_virtio_get()
1019 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_set() local
1021 if ((u64)offset + len > sizeof(tm_vdev->config)) in mlxbf_tmfifo_virtio_set()
1024 memcpy((u8 *)&tm_vdev->config + offset, buf, len); in mlxbf_tmfifo_virtio_set()
1031 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in tmfifo_virtio_dev_release() local
1033 kfree(tm_vdev); in tmfifo_virtio_dev_release()
1055 struct mlxbf_tmfifo_vdev *tm_vdev, *reg_dev = NULL; in mlxbf_tmfifo_create_vdev() local
1060 tm_vdev = fifo->vdev[vdev_id]; in mlxbf_tmfifo_create_vdev()
1061 if (tm_vdev) { in mlxbf_tmfifo_create_vdev()
1067 tm_vdev = kzalloc(sizeof(*tm_vdev), GFP_KERNEL); in mlxbf_tmfifo_create_vdev()
1068 if (!tm_vdev) { in mlxbf_tmfifo_create_vdev()
1073 tm_vdev->vdev.id.device = vdev_id; in mlxbf_tmfifo_create_vdev()
1074 tm_vdev->vdev.config = &mlxbf_tmfifo_virtio_config_ops; in mlxbf_tmfifo_create_vdev()
1075 tm_vdev->vdev.dev.parent = dev; in mlxbf_tmfifo_create_vdev()
1076 tm_vdev->vdev.dev.release = tmfifo_virtio_dev_release; in mlxbf_tmfifo_create_vdev()
1077 tm_vdev->features = features; in mlxbf_tmfifo_create_vdev()
1079 memcpy(&tm_vdev->config, config, size); in mlxbf_tmfifo_create_vdev()
1081 if (mlxbf_tmfifo_alloc_vrings(fifo, tm_vdev)) { in mlxbf_tmfifo_create_vdev()
1089 tm_vdev->tx_buf.buf = devm_kmalloc(dev, in mlxbf_tmfifo_create_vdev()
1092 fifo->vdev[vdev_id] = tm_vdev; in mlxbf_tmfifo_create_vdev()
1095 ret = register_virtio_device(&tm_vdev->vdev); in mlxbf_tmfifo_create_vdev()
1096 reg_dev = tm_vdev; in mlxbf_tmfifo_create_vdev()
1106 mlxbf_tmfifo_free_vrings(fifo, tm_vdev); in mlxbf_tmfifo_create_vdev()
1109 put_device(&tm_vdev->vdev.dev); in mlxbf_tmfifo_create_vdev()
1111 kfree(tm_vdev); in mlxbf_tmfifo_create_vdev()
1120 struct mlxbf_tmfifo_vdev *tm_vdev; in mlxbf_tmfifo_delete_vdev() local
1125 tm_vdev = fifo->vdev[vdev_id]; in mlxbf_tmfifo_delete_vdev()
1126 if (tm_vdev) { in mlxbf_tmfifo_delete_vdev()
1127 unregister_virtio_device(&tm_vdev->vdev); in mlxbf_tmfifo_delete_vdev()
1128 mlxbf_tmfifo_free_vrings(fifo, tm_vdev); in mlxbf_tmfifo_delete_vdev()