• Home
  • Raw
  • Download

Lines Matching refs:vdev

33 	struct virtio_device *vdev;  member
137 struct virtio_blk *vblk = vq->vdev->priv; in virtblk_done()
270 if (!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_SCSI)) in virtblk_ioctl()
283 if (virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_GEOMETRY)) { in virtblk_getgeo()
284 virtio_cread(vblk->vdev, struct virtio_blk_config, in virtblk_getgeo()
286 virtio_cread(vblk->vdev, struct virtio_blk_config, in virtblk_getgeo()
288 virtio_cread(vblk->vdev, struct virtio_blk_config, in virtblk_getgeo()
340 struct virtio_device *vdev = vblk->vdev; in virtblk_config_changed_work() local
347 virtio_cread(vdev, struct virtio_blk_config, capacity, &capacity); in virtblk_config_changed_work()
351 dev_warn(&vdev->dev, "Capacity %llu too large: truncating\n", in virtblk_config_changed_work()
360 dev_notice(&vdev->dev, in virtblk_config_changed_work()
371 static void virtblk_config_changed(struct virtio_device *vdev) in virtblk_config_changed() argument
373 struct virtio_blk *vblk = vdev->priv; in virtblk_config_changed()
386 struct virtio_device *vdev = vblk->vdev; in init_vq() local
388 err = virtio_cread_feature(vdev, VIRTIO_BLK_F_MQ, in init_vq()
419 err = vdev->config->find_vqs(vdev, num_vqs, vqs, callbacks, names); in init_vq()
470 static int virtblk_get_cache_mode(struct virtio_device *vdev) in virtblk_get_cache_mode() argument
475 err = virtio_cread_feature(vdev, VIRTIO_BLK_F_CONFIG_WCE, in virtblk_get_cache_mode()
479 writeback = virtio_has_feature(vdev, VIRTIO_BLK_F_WCE); in virtblk_get_cache_mode()
484 static void virtblk_update_cache_mode(struct virtio_device *vdev) in virtblk_update_cache_mode() argument
486 u8 writeback = virtblk_get_cache_mode(vdev); in virtblk_update_cache_mode()
487 struct virtio_blk *vblk = vdev->priv; in virtblk_update_cache_mode()
507 struct virtio_device *vdev = vblk->vdev; in virtblk_cache_type_store() local
510 BUG_ON(!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_CONFIG_WCE)); in virtblk_cache_type_store()
518 virtio_cwrite8(vdev, offsetof(struct virtio_blk_config, wce), i); in virtblk_cache_type_store()
519 virtblk_update_cache_mode(vdev); in virtblk_cache_type_store()
529 u8 writeback = virtblk_get_cache_mode(vblk->vdev); in virtblk_cache_type_show()
563 static int virtblk_probe(struct virtio_device *vdev) in virtblk_probe() argument
581 err = virtio_cread_feature(vdev, VIRTIO_BLK_F_SEG_MAX, in virtblk_probe()
591 vdev->priv = vblk = kmalloc(sizeof(*vblk), GFP_KERNEL); in virtblk_probe()
597 vblk->vdev = vdev; in virtblk_probe()
617 if (!virtio_has_feature(vdev, VIRTIO_RING_F_INDIRECT_DESC)) in virtblk_probe()
650 vblk->disk->driverfs_dev = &vdev->dev; in virtblk_probe()
654 virtblk_update_cache_mode(vdev); in virtblk_probe()
657 if (virtio_has_feature(vdev, VIRTIO_BLK_F_RO)) in virtblk_probe()
661 virtio_cread(vdev, struct virtio_blk_config, capacity, &cap); in virtblk_probe()
665 dev_warn(&vdev->dev, "Capacity %llu too large: truncating\n", in virtblk_probe()
682 err = virtio_cread_feature(vdev, VIRTIO_BLK_F_SIZE_MAX, in virtblk_probe()
690 err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE, in virtblk_probe()
699 err = virtio_cread_feature(vdev, VIRTIO_BLK_F_TOPOLOGY, in virtblk_probe()
706 err = virtio_cread_feature(vdev, VIRTIO_BLK_F_TOPOLOGY, in virtblk_probe()
712 err = virtio_cread_feature(vdev, VIRTIO_BLK_F_TOPOLOGY, in virtblk_probe()
718 err = virtio_cread_feature(vdev, VIRTIO_BLK_F_TOPOLOGY, in virtblk_probe()
724 virtio_device_ready(vdev); in virtblk_probe()
731 if (virtio_has_feature(vdev, VIRTIO_BLK_F_CONFIG_WCE)) in virtblk_probe()
749 vdev->config->del_vqs(vdev); in virtblk_probe()
758 static void virtblk_remove(struct virtio_device *vdev) in virtblk_remove() argument
760 struct virtio_blk *vblk = vdev->priv; in virtblk_remove()
773 vdev->config->reset(vdev); in virtblk_remove()
777 vdev->config->del_vqs(vdev); in virtblk_remove()
787 static int virtblk_freeze(struct virtio_device *vdev) in virtblk_freeze() argument
789 struct virtio_blk *vblk = vdev->priv; in virtblk_freeze()
792 vdev->config->reset(vdev); in virtblk_freeze()
799 vdev->config->del_vqs(vdev); in virtblk_freeze()
803 static int virtblk_restore(struct virtio_device *vdev) in virtblk_restore() argument
805 struct virtio_blk *vblk = vdev->priv; in virtblk_restore()
808 ret = init_vq(vdev->priv); in virtblk_restore()
812 virtio_device_ready(vdev); in virtblk_restore()