Lines Matching refs:tm_vdev
240 struct mlxbf_tmfifo_vdev *tm_vdev) in mlxbf_tmfifo_free_vrings() argument
245 for (i = 0; i < ARRAY_SIZE(tm_vdev->vrings); i++) { in mlxbf_tmfifo_free_vrings()
246 vring = &tm_vdev->vrings[i]; in mlxbf_tmfifo_free_vrings()
249 dma_free_coherent(tm_vdev->vdev.dev.parent, size, in mlxbf_tmfifo_free_vrings()
262 struct mlxbf_tmfifo_vdev *tm_vdev) in mlxbf_tmfifo_alloc_vrings() argument
270 for (i = 0; i < ARRAY_SIZE(tm_vdev->vrings); i++) { in mlxbf_tmfifo_alloc_vrings()
271 vring = &tm_vdev->vrings[i]; in mlxbf_tmfifo_alloc_vrings()
276 vring->vdev_id = tm_vdev->vdev.id.device; in mlxbf_tmfifo_alloc_vrings()
278 dev = &tm_vdev->vdev.dev; in mlxbf_tmfifo_alloc_vrings()
283 mlxbf_tmfifo_free_vrings(fifo, tm_vdev); in mlxbf_tmfifo_alloc_vrings()
869 struct mlxbf_tmfifo_vdev *tm_vdev; in mlxbf_tmfifo_work_rxtx() local
878 tm_vdev = fifo->vdev[i]; in mlxbf_tmfifo_work_rxtx()
879 if (tm_vdev) { in mlxbf_tmfifo_work_rxtx()
880 vring = &tm_vdev->vrings[queue_id]; in mlxbf_tmfifo_work_rxtx()
913 struct mlxbf_tmfifo_vdev *tm_vdev; in mlxbf_tmfifo_virtio_notify() local
932 tm_vdev = fifo->vdev[VIRTIO_ID_CONSOLE]; in mlxbf_tmfifo_virtio_notify()
933 mlxbf_tmfifo_console_output(tm_vdev, vring); in mlxbf_tmfifo_virtio_notify()
953 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_get_features() local
955 return tm_vdev->features; in mlxbf_tmfifo_virtio_get_features()
961 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_finalize_features() local
963 tm_vdev->features = vdev->features; in mlxbf_tmfifo_virtio_finalize_features()
971 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_del_vqs() local
976 for (i = 0; i < ARRAY_SIZE(tm_vdev->vrings); i++) { in mlxbf_tmfifo_virtio_del_vqs()
977 vring = &tm_vdev->vrings[i]; in mlxbf_tmfifo_virtio_del_vqs()
999 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_find_vqs() local
1004 if (nvqs > ARRAY_SIZE(tm_vdev->vrings)) in mlxbf_tmfifo_virtio_find_vqs()
1012 vring = &tm_vdev->vrings[i]; in mlxbf_tmfifo_virtio_find_vqs()
1048 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_get_status() local
1050 return tm_vdev->status; in mlxbf_tmfifo_virtio_get_status()
1057 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_set_status() local
1059 tm_vdev->status = status; in mlxbf_tmfifo_virtio_set_status()
1065 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_reset() local
1067 tm_vdev->status = 0; in mlxbf_tmfifo_virtio_reset()
1076 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_get() local
1078 if ((u64)offset + len > sizeof(tm_vdev->config)) in mlxbf_tmfifo_virtio_get()
1081 memcpy(buf, (u8 *)&tm_vdev->config + offset, len); in mlxbf_tmfifo_virtio_get()
1090 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in mlxbf_tmfifo_virtio_set() local
1092 if ((u64)offset + len > sizeof(tm_vdev->config)) in mlxbf_tmfifo_virtio_set()
1095 memcpy((u8 *)&tm_vdev->config + offset, buf, len); in mlxbf_tmfifo_virtio_set()
1102 struct mlxbf_tmfifo_vdev *tm_vdev = mlxbf_vdev_to_tmfifo(vdev); in tmfifo_virtio_dev_release() local
1104 kfree(tm_vdev); in tmfifo_virtio_dev_release()
1126 struct mlxbf_tmfifo_vdev *tm_vdev, *reg_dev = NULL; in mlxbf_tmfifo_create_vdev() local
1131 tm_vdev = fifo->vdev[vdev_id]; in mlxbf_tmfifo_create_vdev()
1132 if (tm_vdev) { in mlxbf_tmfifo_create_vdev()
1138 tm_vdev = kzalloc(sizeof(*tm_vdev), GFP_KERNEL); in mlxbf_tmfifo_create_vdev()
1139 if (!tm_vdev) { in mlxbf_tmfifo_create_vdev()
1144 tm_vdev->vdev.id.device = vdev_id; in mlxbf_tmfifo_create_vdev()
1145 tm_vdev->vdev.config = &mlxbf_tmfifo_virtio_config_ops; in mlxbf_tmfifo_create_vdev()
1146 tm_vdev->vdev.dev.parent = dev; in mlxbf_tmfifo_create_vdev()
1147 tm_vdev->vdev.dev.release = tmfifo_virtio_dev_release; in mlxbf_tmfifo_create_vdev()
1148 tm_vdev->features = features; in mlxbf_tmfifo_create_vdev()
1150 memcpy(&tm_vdev->config, config, size); in mlxbf_tmfifo_create_vdev()
1152 if (mlxbf_tmfifo_alloc_vrings(fifo, tm_vdev)) { in mlxbf_tmfifo_create_vdev()
1160 tm_vdev->tx_buf.buf = devm_kmalloc(dev, in mlxbf_tmfifo_create_vdev()
1163 fifo->vdev[vdev_id] = tm_vdev; in mlxbf_tmfifo_create_vdev()
1166 ret = register_virtio_device(&tm_vdev->vdev); in mlxbf_tmfifo_create_vdev()
1167 reg_dev = tm_vdev; in mlxbf_tmfifo_create_vdev()
1177 mlxbf_tmfifo_free_vrings(fifo, tm_vdev); in mlxbf_tmfifo_create_vdev()
1180 put_device(&tm_vdev->vdev.dev); in mlxbf_tmfifo_create_vdev()
1182 kfree(tm_vdev); in mlxbf_tmfifo_create_vdev()
1191 struct mlxbf_tmfifo_vdev *tm_vdev; in mlxbf_tmfifo_delete_vdev() local
1196 tm_vdev = fifo->vdev[vdev_id]; in mlxbf_tmfifo_delete_vdev()
1197 if (tm_vdev) { in mlxbf_tmfifo_delete_vdev()
1198 unregister_virtio_device(&tm_vdev->vdev); in mlxbf_tmfifo_delete_vdev()
1199 mlxbf_tmfifo_free_vrings(fifo, tm_vdev); in mlxbf_tmfifo_delete_vdev()