diff --git a/src/scenes/mtp/usb.h b/src/scenes/mtp/usb.h index 7ab8add..b59c7fd 100644 --- a/src/scenes/mtp/usb.h +++ b/src/scenes/mtp/usb.h @@ -12,6 +12,8 @@ enum UsbDevDescStr { UsbDevManuf = 1, UsbDevProduct = 2, UsbDevSerial = 3, + UsbDevHighSpeed = 4, + UsbDevLowSpeed = 5, }; /* === END furi_hal_usb_i.h === */ diff --git a/src/scenes/mtp/usb_desc.c b/src/scenes/mtp/usb_desc.c index bae750f..840ad4f 100644 --- a/src/scenes/mtp/usb_desc.c +++ b/src/scenes/mtp/usb_desc.c @@ -12,9 +12,9 @@ const struct usb_device_descriptor usb_mtp_dev_descr = { .bDescriptorType = USB_DTYPE_DEVICE, .bcdUSB = VERSION_BCD(2, 0, 0), .bDeviceClass = USB_CLASS_STILL_IMAGE, // MTP falls under Still Image class - .bDeviceSubClass = 1, // Subclass for MTP - .bDeviceProtocol = 1, // Protocol for MTP - .bMaxPacketSize0 = USB_EP0_SIZE, + .bDeviceSubClass = USB_SUBCLASS_MTP, // Subclass for MTP + .bDeviceProtocol = USB_PROTO_MTP, // Protocol for MTP + .bMaxPacketSize0 = MTP_MAX_PACKET_SIZE, .idVendor = 0x0483, // STMicroelectronics .idProduct = 0x5741, // Custom Product ID .bcdDevice = VERSION_BCD(1, 0, 0), @@ -31,8 +31,8 @@ const struct MtpDescriptor usb_mtp_cfg_descr = { .bDescriptorType = USB_DTYPE_CONFIGURATION, .wTotalLength = sizeof(struct MtpDescriptor), .bNumInterfaces = 1, - .bConfigurationValue = 1, - .iConfiguration = NO_DESCRIPTOR, + .bConfigurationValue = USB_CONF_VAL_MTP, + .iConfiguration = UsbDevHighSpeed, .bmAttributes = USB_CFG_ATTR_RESERVED | USB_CFG_ATTR_SELFPOWERED, .bMaxPower = USB_CFG_POWER_MA(100), }, diff --git a/src/scenes/mtp/usb_desc.h b/src/scenes/mtp/usb_desc.h index 5d5e2b4..2736da5 100644 --- a/src/scenes/mtp/usb_desc.h +++ b/src/scenes/mtp/usb_desc.h @@ -3,6 +3,12 @@ #include #include +#define USB_SUBCLASS_MTP 0x01 +#define USB_PROTO_MTP 0x01 +#define USB_CONF_VAL_MTP 1 + +#define MTP_MAX_PACKET_SIZE 512 + struct MtpDescriptor { struct usb_config_descriptor config; struct usb_interface_descriptor intf;