From c69f9589cc7543baba08dbabdb5c30104fadaa34 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 18 Oct 2024 13:13:28 +0100 Subject: [usb] Expose USB device descriptor and strings via settings Allow scripts to read basic information from USB device descriptors via the settings mechanism. For example: echo USB vendor ID: ${usb/${busloc}.8.2} echo USB device ID: ${usb/${busloc}.10.2} echo USB manufacturer name: ${usb/${busloc}.14.0} The general syntax is usb/.. where bus:dev is the USB bus:device address (as obtained via the "usbscan" command, or from e.g. ${net0/busloc} for a USB network device), and and select the required portion of the USB device descriptor. Following the usage of SMBIOS settings tags, a of zero may be used to indicate that the byte at contains a USB string descriptor index, and an of zero may be used to indicate that the contains a literal USB string descriptor index. Since the byte at offset zero can never contain a string index, and a literal string index can never be zero, the combination of both and being zero may be used to indicate that the entire device descriptor is to be read as a raw hex dump. Signed-off-by: Michael Brown --- src/include/ipxe/errfile.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/include') diff --git a/src/include/ipxe/errfile.h b/src/include/ipxe/errfile.h index 01a2be654..6183e5b7e 100644 --- a/src/include/ipxe/errfile.h +++ b/src/include/ipxe/errfile.h @@ -424,6 +424,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #define ERRFILE_widget_ui ( ERRFILE_OTHER | 0x00620000 ) #define ERRFILE_form_ui ( ERRFILE_OTHER | 0x00630000 ) #define ERRFILE_usb_cmd ( ERRFILE_OTHER | 0x00640000 ) +#define ERRFILE_usb_settings ( ERRFILE_OTHER | 0x00650000 ) /** @} */ -- cgit v1.2.3-55-g7522