diff options
author | Ting Shen <phoenixshen@google.com> | 2021-08-02 17:36:18 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-08-04 06:01:40 +0000 |
commit | 0c642d91a9e4d2a61fb6e140eda87fe844043249 (patch) | |
tree | 09748d2515669df2285455abcfdee1afd9de6e8d /chip | |
parent | b170e5cea5d5163952d65ab26f9cae9dc309e6bc (diff) | |
download | chrome-ec-0c642d91a9e4d2a61fb6e140eda87fe844043249.tar.gz |
stm32/usb_hid_keyboard: fix feature report data size
The usb hid driver always send 60 bytes feature report to the host,
this causes host side unhappy because the received data is larger
than expected.
Fix this bug by sending what we actually declared.
BUG=b:195264416
TEST=# cat /sys/class/input/*/device/function_row_physmap
C0224 C0227 C0232 C029F 70046 C0070 C006F C00E2 C00EA C00E9
BRANCH=trogdor
Signed-off-by: Ting Shen <phoenixshen@google.com>
Change-Id: I536e4518a76606a05c006d459d6ffbb61858c2d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3066973
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Tested-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/stm32/usb_hid_keyboard.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/chip/stm32/usb_hid_keyboard.c b/chip/stm32/usb_hid_keyboard.c index c637cf4363..ab529b27b3 100644 --- a/chip/stm32/usb_hid_keyboard.c +++ b/chip/stm32/usb_hid_keyboard.c @@ -541,7 +541,8 @@ static int hid_keyboard_get_report(uint8_t report_id, uint8_t report_type, #ifdef CONFIG_USB_HID_KEYBOARD_VIVALDI if (report_type == REPORT_TYPE_FEATURE) { *buffer_ptr = (uint8_t *)feature_report; - *buffer_size = sizeof(feature_report); + *buffer_size = (sizeof(uint32_t) * + CONFIG_USB_HID_KB_NUM_TOP_ROW_KEYS); return 0; } #endif |