Searched hist:"12 fc84e8c4288cc8ed5f14a35e077130c2cfece2" (Results 1 – 2 of 2) sorted by relevance
/linux/Documentation/ABI/testing/ |
H A D | sysfs-bus-usb | 12fc84e8c4288cc8ed5f14a35e077130c2cfece2 Tue Mar 05 00:23:01 UTC 2024 Elbert Mai <code@elbertmai.com> usb: Export BOS descriptor to sysfs
Motivation ----------
The binary device object store (BOS) of a USB device consists of the BOS descriptor followed by a set of device capability descriptors. One that is of interest to users is the platform descriptor. This contains a 128-bit UUID and arbitrary data, and it allows parties outside of USB-IF to add additional metadata about a USB device in a standards-compliant manner. Notable examples include the WebUSB and Microsoft OS 2.0 descriptors.
The kernel already retrieves and caches the BOS from USB devices if its bcdUSB is >= 0x0201. Because the BOS is flexible and extensible, we export the entire BOS to sysfs so users can retrieve whatever device capabilities they desire, without requiring USB I/O or elevated permissions.
Implementation --------------
Add bos_descriptors attribute to sysfs. This is a binary file and it works the same way as the existing descriptors attribute. The file exists only if the BOS is present in the USB device.
Also create a binary attribute group, so the driver core can handle the creation of both the descriptors and bos_descriptors attributes in sysfs.
Signed-off-by: Elbert Mai <code@elbertmai.com> Link: https://lore.kernel.org/r/20240305002301.95323-1-code@elbertmai.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 12fc84e8c4288cc8ed5f14a35e077130c2cfece2 Tue Mar 05 00:23:01 UTC 2024 Elbert Mai <code@elbertmai.com> usb: Export BOS descriptor to sysfs
Motivation ----------
The binary device object store (BOS) of a USB device consists of the BOS descriptor followed by a set of device capability descriptors. One that is of interest to users is the platform descriptor. This contains a 128-bit UUID and arbitrary data, and it allows parties outside of USB-IF to add additional metadata about a USB device in a standards-compliant manner. Notable examples include the WebUSB and Microsoft OS 2.0 descriptors.
The kernel already retrieves and caches the BOS from USB devices if its bcdUSB is >= 0x0201. Because the BOS is flexible and extensible, we export the entire BOS to sysfs so users can retrieve whatever device capabilities they desire, without requiring USB I/O or elevated permissions.
Implementation --------------
Add bos_descriptors attribute to sysfs. This is a binary file and it works the same way as the existing descriptors attribute. The file exists only if the BOS is present in the USB device.
Also create a binary attribute group, so the driver core can handle the creation of both the descriptors and bos_descriptors attributes in sysfs.
Signed-off-by: Elbert Mai <code@elbertmai.com> Link: https://lore.kernel.org/r/20240305002301.95323-1-code@elbertmai.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
/linux/drivers/usb/core/ |
H A D | sysfs.c | 12fc84e8c4288cc8ed5f14a35e077130c2cfece2 Tue Mar 05 00:23:01 UTC 2024 Elbert Mai <code@elbertmai.com> usb: Export BOS descriptor to sysfs
Motivation ----------
The binary device object store (BOS) of a USB device consists of the BOS descriptor followed by a set of device capability descriptors. One that is of interest to users is the platform descriptor. This contains a 128-bit UUID and arbitrary data, and it allows parties outside of USB-IF to add additional metadata about a USB device in a standards-compliant manner. Notable examples include the WebUSB and Microsoft OS 2.0 descriptors.
The kernel already retrieves and caches the BOS from USB devices if its bcdUSB is >= 0x0201. Because the BOS is flexible and extensible, we export the entire BOS to sysfs so users can retrieve whatever device capabilities they desire, without requiring USB I/O or elevated permissions.
Implementation --------------
Add bos_descriptors attribute to sysfs. This is a binary file and it works the same way as the existing descriptors attribute. The file exists only if the BOS is present in the USB device.
Also create a binary attribute group, so the driver core can handle the creation of both the descriptors and bos_descriptors attributes in sysfs.
Signed-off-by: Elbert Mai <code@elbertmai.com> Link: https://lore.kernel.org/r/20240305002301.95323-1-code@elbertmai.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 12fc84e8c4288cc8ed5f14a35e077130c2cfece2 Tue Mar 05 00:23:01 UTC 2024 Elbert Mai <code@elbertmai.com> usb: Export BOS descriptor to sysfs
Motivation ----------
The binary device object store (BOS) of a USB device consists of the BOS descriptor followed by a set of device capability descriptors. One that is of interest to users is the platform descriptor. This contains a 128-bit UUID and arbitrary data, and it allows parties outside of USB-IF to add additional metadata about a USB device in a standards-compliant manner. Notable examples include the WebUSB and Microsoft OS 2.0 descriptors.
The kernel already retrieves and caches the BOS from USB devices if its bcdUSB is >= 0x0201. Because the BOS is flexible and extensible, we export the entire BOS to sysfs so users can retrieve whatever device capabilities they desire, without requiring USB I/O or elevated permissions.
Implementation --------------
Add bos_descriptors attribute to sysfs. This is a binary file and it works the same way as the existing descriptors attribute. The file exists only if the BOS is present in the USB device.
Also create a binary attribute group, so the driver core can handle the creation of both the descriptors and bos_descriptors attributes in sysfs.
Signed-off-by: Elbert Mai <code@elbertmai.com> Link: https://lore.kernel.org/r/20240305002301.95323-1-code@elbertmai.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|