diff options
| author | zyh <[email protected]> | 2018-12-27 16:48:29 +0800 |
|---|---|---|
| committer | zyh <[email protected]> | 2018-12-27 16:48:29 +0800 |
| commit | b18534e1af89f9a638a06e698ee6db7f5cf68c95 (patch) | |
| tree | 3bdec5179b8b9e36c4d3e9a98c266b630de76c72 /components/drivers | |
| parent | 8bcfcd83391d418f2d85fc6caeaa00c73e087734 (diff) | |
[components][USB][Device][Core]fix the device_qualifier error respond on fullspeed
Diffstat (limited to 'components/drivers')
| -rw-r--r-- | components/drivers/usb/usbdevice/core/core.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/components/drivers/usb/usbdevice/core/core.c b/components/drivers/usb/usbdevice/core/core.c index fb850d6d2b..4e3a3e9280 100644 --- a/components/drivers/usb/usbdevice/core/core.c +++ b/components/drivers/usb/usbdevice/core/core.c @@ -194,7 +194,18 @@ static rt_err_t _get_descriptor(struct udevice* device, ureq_t setup) _get_string_descriptor(device, setup); break; 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; case USB_DESC_TYPE_OTHERSPEED: _get_config_descriptor(device, setup); |
