13771bd96SKirti WankhedeWhat: /sys/.../<device>/mdev_supported_types/ 23771bd96SKirti WankhedeDate: October 2016 33771bd96SKirti WankhedeContact: Kirti Wankhede <kwankhede@nvidia.com> 43771bd96SKirti WankhedeDescription: 53771bd96SKirti Wankhede This directory contains list of directories of currently 63771bd96SKirti Wankhede supported mediated device types and their details for 73771bd96SKirti Wankhede <device>. Supported type attributes are defined by the 83771bd96SKirti Wankhede vendor driver who registers with Mediated device framework. 93771bd96SKirti Wankhede Each supported type is a directory whose name is created 103771bd96SKirti Wankhede by adding the device driver string as a prefix to the 113771bd96SKirti Wankhede string provided by the vendor driver. 123771bd96SKirti Wankhede 133771bd96SKirti WankhedeWhat: /sys/.../<device>/mdev_supported_types/<type-id>/ 143771bd96SKirti WankhedeDate: October 2016 153771bd96SKirti WankhedeContact: Kirti Wankhede <kwankhede@nvidia.com> 163771bd96SKirti WankhedeDescription: 173771bd96SKirti Wankhede This directory gives details of supported type, like name, 183771bd96SKirti Wankhede description, available_instances, device_api etc. 193771bd96SKirti Wankhede 'device_api' and 'available_instances' are mandatory 203771bd96SKirti Wankhede attributes to be provided by vendor driver. 'name', 213771bd96SKirti Wankhede 'description' and other vendor driver specific attributes 223771bd96SKirti Wankhede are optional. 233771bd96SKirti Wankhede 243771bd96SKirti WankhedeWhat: /sys/.../mdev_supported_types/<type-id>/create 253771bd96SKirti WankhedeDate: October 2016 263771bd96SKirti WankhedeContact: Kirti Wankhede <kwankhede@nvidia.com> 273771bd96SKirti WankhedeDescription: 283771bd96SKirti Wankhede Writing UUID to this file will create mediated device of 293771bd96SKirti Wankhede type <type-id> for parent device <device>. This is a 303771bd96SKirti Wankhede write-only file. 3134433332SMauro Carvalho Chehab For example:: 3234433332SMauro Carvalho Chehab 333771bd96SKirti Wankhede # echo "83b8f4f2-509f-382f-3c1e-e6bfe0fa1001" > \ 343771bd96SKirti Wankhede /sys/devices/foo/mdev_supported_types/foo-1/create 353771bd96SKirti Wankhede 363771bd96SKirti WankhedeWhat: /sys/.../mdev_supported_types/<type-id>/devices/ 373771bd96SKirti WankhedeDate: October 2016 383771bd96SKirti WankhedeContact: Kirti Wankhede <kwankhede@nvidia.com> 393771bd96SKirti WankhedeDescription: 403771bd96SKirti Wankhede This directory contains symbolic links pointing to mdev 413771bd96SKirti Wankhede devices sysfs entries which are created of this <type-id>. 423771bd96SKirti Wankhede 433771bd96SKirti WankhedeWhat: /sys/.../mdev_supported_types/<type-id>/available_instances 443771bd96SKirti WankhedeDate: October 2016 453771bd96SKirti WankhedeContact: Kirti Wankhede <kwankhede@nvidia.com> 463771bd96SKirti WankhedeDescription: 473771bd96SKirti Wankhede Reading this attribute will show the number of mediated 483771bd96SKirti Wankhede devices of type <type-id> that can be created. This is a 493771bd96SKirti Wankhede readonly file. 503771bd96SKirti WankhedeUsers: 513771bd96SKirti Wankhede Userspace applications interested in creating mediated 523771bd96SKirti Wankhede device of that type. Userspace application should check 533771bd96SKirti Wankhede the number of available instances could be created before 543771bd96SKirti Wankhede creating mediated device of this type. 553771bd96SKirti Wankhede 563771bd96SKirti WankhedeWhat: /sys/.../mdev_supported_types/<type-id>/device_api 573771bd96SKirti WankhedeDate: October 2016 583771bd96SKirti WankhedeContact: Kirti Wankhede <kwankhede@nvidia.com> 593771bd96SKirti WankhedeDescription: 603771bd96SKirti Wankhede Reading this attribute will show VFIO device API supported 613771bd96SKirti Wankhede by this type. For example, "vfio-pci" for a PCI device, 623771bd96SKirti Wankhede "vfio-platform" for platform device. 633771bd96SKirti Wankhede 643771bd96SKirti WankhedeWhat: /sys/.../mdev_supported_types/<type-id>/name 653771bd96SKirti WankhedeDate: October 2016 663771bd96SKirti WankhedeContact: Kirti Wankhede <kwankhede@nvidia.com> 673771bd96SKirti WankhedeDescription: 683771bd96SKirti Wankhede Reading this attribute will show human readable name of the 693771bd96SKirti Wankhede mediated device that will get created of type <type-id>. 703771bd96SKirti Wankhede This is optional attribute. For example: "Grid M60-0Q" 713771bd96SKirti WankhedeUsers: 723771bd96SKirti Wankhede Userspace applications interested in knowing the name of 733771bd96SKirti Wankhede a particular <type-id> that can help in understanding the 743771bd96SKirti Wankhede type of mediated device. 753771bd96SKirti Wankhede 763771bd96SKirti WankhedeWhat: /sys/.../mdev_supported_types/<type-id>/description 773771bd96SKirti WankhedeDate: October 2016 783771bd96SKirti WankhedeContact: Kirti Wankhede <kwankhede@nvidia.com> 793771bd96SKirti WankhedeDescription: 803771bd96SKirti Wankhede Reading this attribute will show description of the type of 813771bd96SKirti Wankhede mediated device that will get created of type <type-id>. 823771bd96SKirti Wankhede This is optional attribute. For example: 833771bd96SKirti Wankhede "2 heads, 512M FB, 2560x1600 maximum resolution" 843771bd96SKirti WankhedeUsers: 853771bd96SKirti Wankhede Userspace applications interested in knowing the details of 863771bd96SKirti Wankhede a particular <type-id> that can help in understanding the 873771bd96SKirti Wankhede features provided by that type of mediated device. 883771bd96SKirti Wankhede 893771bd96SKirti WankhedeWhat: /sys/.../<device>/<UUID>/ 903771bd96SKirti WankhedeDate: October 2016 913771bd96SKirti WankhedeContact: Kirti Wankhede <kwankhede@nvidia.com> 923771bd96SKirti WankhedeDescription: 933771bd96SKirti Wankhede This directory represents device directory of mediated 943771bd96SKirti Wankhede device. It contains all the attributes related to mediated 953771bd96SKirti Wankhede device. 963771bd96SKirti Wankhede 973771bd96SKirti WankhedeWhat: /sys/.../<device>/<UUID>/mdev_type 983771bd96SKirti WankhedeDate: October 2016 993771bd96SKirti WankhedeContact: Kirti Wankhede <kwankhede@nvidia.com> 1003771bd96SKirti WankhedeDescription: 1013771bd96SKirti Wankhede This is symbolic link pointing to supported type, <type-id> 1023771bd96SKirti Wankhede directory of which this mediated device is created. 1033771bd96SKirti Wankhede 1043771bd96SKirti WankhedeWhat: /sys/.../<device>/<UUID>/remove 1053771bd96SKirti WankhedeDate: October 2016 1063771bd96SKirti WankhedeContact: Kirti Wankhede <kwankhede@nvidia.com> 1073771bd96SKirti WankhedeDescription: 1083771bd96SKirti Wankhede Writing '1' to this file destroys the mediated device. The 1093771bd96SKirti Wankhede vendor driver can fail the remove() callback if that device 1103771bd96SKirti Wankhede is active and the vendor driver doesn't support hot unplug. 11134433332SMauro Carvalho Chehab Example:: 11234433332SMauro Carvalho Chehab 1133771bd96SKirti Wankhede # echo 1 > /sys/bus/mdev/devices/<UUID>/remove 114