usb: host: use uint16_t for Language ID

usbh_req_desc() truncates the descriptor id. This problem is most
visible with string descriptor requests, as only then can wIndex be
greater than 0xFF. In particular, this affects commonly used language
IDs such as English (United States), which is 0x0409.

Signed-off-by: Alexander Kaiser <akaiser@urbansky.com>
This commit is contained in:
Alexander Kaiser 2023-11-15 10:05:24 -07:00 committed by Fabio Baltieri
parent fcb8fa7b02
commit 476a224dfa
2 changed files with 2 additions and 2 deletions

View File

@ -85,7 +85,7 @@ buf_alloc_err:
int usbh_req_desc(struct usb_device *const udev,
const uint8_t type, const uint8_t index,
const uint8_t id,
const uint16_t id,
const uint16_t len,
struct net_buf *const buf)
{

View File

@ -22,7 +22,7 @@ int usbh_req_setup(struct usb_device *const udev,
int usbh_req_desc(struct usb_device *const udev,
const uint8_t type, const uint8_t index,
const uint8_t id,
const uint16_t id,
const uint16_t len,
struct net_buf *const data);