Update to FreeBSD head 2018-09-17

Git mirror commit 6c2192b1ef8c50788c751f878552526800b1e319.

Update #3472.
This commit is contained in:
Sebastian Huber
2018-08-22 14:59:50 +02:00
parent 3becda1fef
commit 3489e3b639
579 changed files with 26749 additions and 11388 deletions

View File

@@ -992,7 +992,7 @@ usbd_req_get_desc(struct usb_device *udev,
uint8_t retries)
{
struct usb_device_request req;
uint8_t *buf;
uint8_t *buf = desc;
usb_error_t err;
DPRINTFN(4, "id=%d, type=%d, index=%d, max_len=%d\n",
@@ -1014,6 +1014,32 @@ usbd_req_get_desc(struct usb_device *udev,
err = usbd_do_request_flags(udev, mtx, &req,
desc, 0, NULL, 500 /* ms */);
if (err != 0 && err != USB_ERR_TIMEOUT &&
min_len != max_len) {
/* clear descriptor data */
memset(desc, 0, max_len);
/* try to read full descriptor length */
USETW(req.wLength, max_len);
err = usbd_do_request_flags(udev, mtx, &req,
desc, USB_SHORT_XFER_OK, NULL, 500 /* ms */);
if (err == 0) {
/* verify length */
if (buf[0] > max_len)
buf[0] = max_len;
else if (buf[0] < 2)
err = USB_ERR_INVAL;
min_len = buf[0];
/* enforce descriptor type */
buf[1] = type;
goto done;
}
}
if (err) {
if (!retries) {
goto done;
@@ -1024,7 +1050,6 @@ usbd_req_get_desc(struct usb_device *udev,
continue;
}
buf = desc;
if (min_len == max_len) {