[components][USB][Device][Core]fix the device_qualifier error respond on fullspeed

This commit is contained in:
zyh 2018-12-27 16:48:29 +08:00
parent 8bcfcd8339
commit b18534e1af
1 changed files with 12 additions and 1 deletions

View File

@ -194,7 +194,18 @@ static rt_err_t _get_descriptor(struct udevice* device, ureq_t setup)
_get_string_descriptor(device, setup); _get_string_descriptor(device, setup);
break; break;
case USB_DESC_TYPE_DEVICEQUALIFIER: case USB_DESC_TYPE_DEVICEQUALIFIER:
_get_qualifier_descriptor(device, setup); /* If a full-speed only device (with a device descriptor version number equal to 0200H) receives a
GetDescriptor() request for a device_qualifier, it must respond with a request error. The host must not make
a request for an other_speed_configuration descriptor unless it first successfully retrieves the
device_qualifier descriptor. */
if(device->dcd->device_is_hs)
{
_get_qualifier_descriptor(device, setup);
}
else
{
rt_usbd_ep0_set_stall(device);
}
break; break;
case USB_DESC_TYPE_OTHERSPEED: case USB_DESC_TYPE_OTHERSPEED:
_get_config_descriptor(device, setup); _get_config_descriptor(device, setup);