mdpy.c (da44c340c4fe9d9653ae84fa6a60f406bafcffce) | mdpy.c (290aac5df88a83e264b3a73ec146e5e5b3c45793) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Mediated virtual PCI display host device driver 4 * 5 * See mdpy-defs.h for device specs 6 * 7 * (c) Gerd Hoffmann <kraxel@redhat.com> 8 * --- 675 unchanged lines hidden (view full) --- 684static ssize_t available_instances_show(struct mdev_type *mtype, 685 struct mdev_type_attribute *attr, 686 char *buf) 687{ 688 return sprintf(buf, "%d\n", max_devices - mdpy_count); 689} 690static MDEV_TYPE_ATTR_RO(available_instances); 691 | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Mediated virtual PCI display host device driver 4 * 5 * See mdpy-defs.h for device specs 6 * 7 * (c) Gerd Hoffmann <kraxel@redhat.com> 8 * --- 675 unchanged lines hidden (view full) --- 684static ssize_t available_instances_show(struct mdev_type *mtype, 685 struct mdev_type_attribute *attr, 686 char *buf) 687{ 688 return sprintf(buf, "%d\n", max_devices - mdpy_count); 689} 690static MDEV_TYPE_ATTR_RO(available_instances); 691 |
692static ssize_t device_api_show(struct mdev_type *mtype, 693 struct mdev_type_attribute *attr, char *buf) 694{ 695 return sprintf(buf, "%s\n", VFIO_DEVICE_API_PCI_STRING); 696} 697static MDEV_TYPE_ATTR_RO(device_api); 698 | |
699static const struct attribute *mdev_types_attrs[] = { 700 &mdev_type_attr_name.attr, 701 &mdev_type_attr_description.attr, | 692static const struct attribute *mdev_types_attrs[] = { 693 &mdev_type_attr_name.attr, 694 &mdev_type_attr_description.attr, |
702 &mdev_type_attr_device_api.attr, | |
703 &mdev_type_attr_available_instances.attr, 704 NULL, 705}; 706 707static const struct vfio_device_ops mdpy_dev_ops = { 708 .init = mdpy_init_dev, 709 .release = mdpy_release_dev, 710 .read = mdpy_read, 711 .write = mdpy_write, 712 .ioctl = mdpy_ioctl, 713 .mmap = mdpy_mmap, 714}; 715 716static struct mdev_driver mdpy_driver = { | 695 &mdev_type_attr_available_instances.attr, 696 NULL, 697}; 698 699static const struct vfio_device_ops mdpy_dev_ops = { 700 .init = mdpy_init_dev, 701 .release = mdpy_release_dev, 702 .read = mdpy_read, 703 .write = mdpy_write, 704 .ioctl = mdpy_ioctl, 705 .mmap = mdpy_mmap, 706}; 707 708static struct mdev_driver mdpy_driver = { |
709 .device_api = VFIO_DEVICE_API_PCI_STRING, |
|
717 .driver = { 718 .name = "mdpy", 719 .owner = THIS_MODULE, 720 .mod_name = KBUILD_MODNAME, 721 .dev_groups = mdev_dev_groups, 722 }, 723 .probe = mdpy_probe, 724 .remove = mdpy_remove, --- 78 unchanged lines hidden --- | 710 .driver = { 711 .name = "mdpy", 712 .owner = THIS_MODULE, 713 .mod_name = KBUILD_MODNAME, 714 .dev_groups = mdev_dev_groups, 715 }, 716 .probe = mdpy_probe, 717 .remove = mdpy_remove, --- 78 unchanged lines hidden --- |