Bug 233884 - Corsair CORSAIR K70 RGB MK.2 / K63 / K63 Wireless not working
Summary: Corsair CORSAIR K70 RGB MK.2 / K63 / K63 Wireless not working
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Hans Petter Selasky
URL:
Keywords: needs-patch
Depends on:
Blocks:
 
Reported: 2018-12-09 12:43 UTC by Tobias C. Berner
Modified: 2021-04-11 06:47 UTC (History)
4 users (show)

See Also:
koobs: mfc-stable12?
koobs: mfc-stable11?


Attachments
K63 corrected usbconfig dump (555 bytes, text/plain)
2019-03-25 13:21 UTC, David Harrison
no flags Details
Patch for USB keyboard driver (21.42 KB, patch)
2020-02-13 12:39 UTC, Hans Petter Selasky
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias C. Berner freebsd_committer freebsd_triage 2018-12-09 12:43:10 UTC
Hi there

I got two Corsair Keyboards with the same behaviour:

* Corsair CORSAIR K70 RGB MK.2 
* Corsair CORSAIR K64 Wireless

I get key events, that but they are completely "wrong" -- for example 'a' will put an 'm'.


> usbconfig -u 1 -a 4 dump_device_desc
ugen1.4: <Corsair CORSAIR K70 RGB MK.2 Mechanical Gaming Keyboard> at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (500mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x1b1c
  idProduct = 0x1b49
  bcdDevice = 0x0312
  iManufacturer = 0x0001  <Corsair>
  iProduct = 0x0002  <CORSAIR K70 RGB MK.2 Mechanical Gaming Keyboard>
  iSerialNumber = 0x0003  <1200D032AF15842759616ABFF5001BC2>
  bNumConfigurations = 0x0001

> usbconfig -u 0 -a 5 dump_device_desc
ugen0.5: <CORSAIR CORSAIR K63 Wireless Mechanical Gaming Keyboard> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (500mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x1b1c
  idProduct = 0x1b45
  bcdDevice = 0x0101
  iManufacturer = 0x0001  <CORSAIR>
  iProduct = 0x0002  <CORSAIR K63 Wireless Mechanical Gaming Keyboard>
  iSerialNumber = 0x0003  <12031026AF15842759616DB0F5001BC2>
  bNumConfigurations = 0x0001



Any hint on how to get them working?

mfg Tobias
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2019-03-25 13:08:34 UTC
IRC user reports "corsair k63 wired" not working, this issue came up in search.

Suggested user add their comment here, with usbconfig output, and look at enabling usb.*.debug sysctl's to potentially identify more relevant information.

@Tobias Could you do the same (enable usb debug) and include anything relevant as an attachment too please.
Comment 2 Hans Petter Selasky freebsd_committer freebsd_triage 2019-03-25 13:11:37 UTC
You might have luck attaching your keyboard through webcamd from ports.

--HPS
Comment 3 David Harrison 2019-03-25 13:14:42 UTC
Further to Kubilay's comment, here is my output from usbconfig for the K63 (wired):

ugen0.1: <Intel EHCI root HUB> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen1.1: <Intel EHCI root HUB> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.2: <vendor 0x8087 product 0x0024> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen1.2: <vendor 0x8087 product 0x0024> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.3: <Corsair Corsair Gaming K63 Keyboard> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (500mA)
ugen1.3: <Generic Mass Storage Device> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (100mA)
[david@thallo ~]$ sudo  usbconfig -u 0 -a 1 dump_device_desc
ugen0.1: <Intel EHCI root HUB> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
 
  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0009  <HUB>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0001
  bMaxPacketSize0 = 0x0040
  idVendor = 0x0000
  idProduct = 0x0000
  bcdDevice = 0x0100
  iManufacturer = 0x0001  <Intel>
  iProduct = 0x0002  <EHCI root HUB>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001
Comment 4 Hans Petter Selasky freebsd_committer freebsd_triage 2019-03-25 13:18:26 UTC
You need to type the following:
usbconfig -u 0 -a 3 dump_device_desc

--HPS
Comment 5 David Harrison 2019-03-25 13:21:06 UTC
Created attachment 203127 [details]
K63 corrected usbconfig dump

Sorry for not adding the previous (wrong) dump as an attachment. The corrected version is attached.
Comment 6 Hans Petter Selasky freebsd_committer freebsd_triage 2019-03-25 13:31:20 UTC
Try:

kldload usb_quirk

usbconfig -d 0.3 add_quirk UQ_KBD_BOOTPROTO

Then re-plug your device. 

Does it work?

If it works, make a patch like shown here:
https://svnweb.freebsd.org/base?view=revision&revision=329195

--HPS
Comment 7 David Harrison 2019-03-25 14:32:01 UTC
(In reply to Hans Petter Selasky from comment #6)

My /boot/loader.conf now contains:

cuse_load="YES"
hw.usb.quirk.0="0x1b1c 0x1b40 0 0xffff UQ_KBD_BOOTPROTO"

I also loaded the usb_quirk module before rebooting.

Now it works, except for the blinking scroll-lock LED as mentioned in 224592.
Comment 8 Kubilay Kocak freebsd_committer freebsd_triage 2019-03-25 14:34:47 UTC
(In reply to David Harrison from comment #7)

Adding detail: using usbconfig to apply the quirk didn't work (with device reattach) at run-time, but the addition to loader.conf and the subsequent reboot did
Comment 9 Hans Petter Selasky freebsd_committer freebsd_triage 2019-03-25 14:47:02 UTC
If you want this change permanent make a patch for sys/dev/usb 's quirk subsystem.

--HPS
Comment 10 Tobias C. Berner freebsd_committer freebsd_triage 2019-03-31 13:58:12 UTC
(In reply to Hans Petter Selasky from comment #6)
Adding the quirk did nothing for the K70 RGB Mk.2 

How can I attach webcamd to try?

mfg Tobias
Comment 11 Hans Petter Selasky freebsd_committer freebsd_triage 2019-03-31 15:02:02 UTC
As root, run "webcamd -l" .

Then run the line which corresponds to your device.

--HPS
Comment 12 ali@mashtizadeh.com 2019-08-10 20:00:09 UTC
With regards to the K70 RGB MK.2.  The keyboard works fine inside of the BIOS/EFI and FreeBSD bootloader.  Something during initialization seems wrong.  I have the boot proto quirk set.

Corsair K70 RGB MK.2

Aug 10 15:51:44 market kernel: ugen0.10: <Corsair CORSAIR K70 RGB MK.2 Mechanical Gaming Keyboard> at usbus0
Aug 10 15:51:44 market kernel: ukbd2 on uhub1
Aug 10 15:51:44 market kernel: ukbd2: <Corsair CORSAIR K70 RGB MK.2 Mechanical Gaming Keyboard, class 0/0, rev 2.00/3.24, addr 15> on usbus0
Aug 10 15:51:44 market kernel: ukbd_attach: Parsing HID descriptor of 192 bytes
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found left control
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found right control
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found left shift
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found right shift
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found left alt
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found right alt
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found left GUI
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found right GUI
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Ignoring keyboard event control
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found keyboard numlock
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found keyboard capslock
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found keyboard scrolllock
Aug 10 15:51:44 market kernel: ukbd_attach: Forcing boot protocol
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found left control
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found right control
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found left shift
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found right shift
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found left alt
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found right alt
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found left GUI
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found right GUI
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found keyboard event array
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found keyboard numlock
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found keyboard capslock
Aug 10 15:51:44 market kernel: ukbd_parse_hid: Found keyboard scrolllock
Aug 10 15:51:44 market kernel: ukbd_set_leds: leds=0x00
Aug 10 15:51:44 market syslogd: last message repeated 1 times
Aug 10 15:51:44 market kernel: kbd4 at ukbd2
Aug 10 15:51:44 market kernel: ukbd_set_leds_callback: len=1, id=0
Aug 10 15:51:44 market kernel: uhid3 on uhub1
Aug 10 15:51:44 market kernel: uhid3: <Corsair CORSAIR K70 RGB MK.2 Mechanical Gaming Keyboard, class 0/0, rev 2.00/3.24, addr 15> on usbus0

USBDUMP: Pressing 'a' on both

Corsair:

m15:42:05.751977 usbus0.10 SUBM-INTR-EP=00000081,SPD=FULL,NFR=1,SLEN=0,IVAL=1
 frame[0] READ 64 bytes
15:42:05.751979 usbus0.10 DONE-INTR-EP=00000081,SPD=FULL,NFR=1,SLEN=24,IVAL=1,ERR=0
 frame[0] READ 21 bytes
 0000  01 00 10 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 0010  00 00 00 00 00 -- -- --  -- -- -- -- -- -- -- --  |.....           |
15:42:05.818975 usbus0.10 SUBM-INTR-EP=00000081,SPD=FULL,NFR=1,SLEN=0,IVAL=1
 frame[0] READ 64 bytes
15:42:05.818976 usbus0.10 DONE-INTR-EP=00000081,SPD=FULL,NFR=1,SLEN=24,IVAL=1,ERR=0
 frame[0] READ 21 bytes
 0000  01 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 0010  00 00 00 00 00 -- -- --  -- -- -- -- -- -- -- --  |.....           |

Another Keyboard:

a15:42:28.670668 usbus0.5 SUBM-INTR-EP=00000081,SPD=LOW,NFR=1,SLEN=0,IVAL=10
 frame[0] READ 8 bytes
15:42:28.670669 usbus0.5 DONE-INTR-EP=00000081,SPD=LOW,NFR=1,SLEN=8,IVAL=10,ERR=0
 frame[0] READ 8 bytes
 0000  00 00 04 00 00 00 00 00  -- -- -- -- -- -- -- --  |........        |
15:42:28.766665 usbus0.5 SUBM-INTR-EP=00000081,SPD=LOW,NFR=1,SLEN=0,IVAL=10
 frame[0] READ 8 bytes
15:42:28.766666 usbus0.5 DONE-INTR-EP=00000081,SPD=LOW,NFR=1,SLEN=8,IVAL=10,ERR=0
 frame[0] READ 8 bytes
 0000  00 00 00 00 00 00 00 00  -- -- -- -- -- -- -- --  |........   

Reading the bug reports from the ckb-next it seems they have added quirks to linux, which add sleeps to some part of the keyboard initialization.
Comment 13 Hans Petter Selasky freebsd_committer freebsd_triage 2019-08-10 20:07:20 UTC
Does this keyboard have any firmware that you can upgrade?

Does the keyboard work with webcamd?

--HPS
Comment 14 ali@mashtizadeh.com 2019-08-11 00:02:05 UTC
(In reply to Hans Petter Selasky from comment #13)

Keyboard has the latest firmware

# webcamd -d ugen0.10
Attached to ugen0.10[0]
webcamd: Cannot find USB device

Linux handles this keyboard with the default USB keyboard driver, and not the corsair driver.
Comment 15 Hans Petter Selasky freebsd_committer freebsd_triage 2019-08-11 14:56:53 UTC
The BOOT protocol should only use 8-BYTE messages. The other format basically resembles a keyboard bitmap with all possible keys. Eventually we could add support for this format to the FreeBSD UKBD driver. Is this something which you are willing to do?

--HPS
Comment 16 ali@mashtizadeh.com 2019-08-11 19:34:09 UTC
I can look at this after this week.

Yes, it seems to only send in the bit vector format.  I think I understand the decoding.  The bit set is the usage ID in the keyboard page description in the specification.  The modifier key bits are the same then the subsequent bytes are the keys pressed.

The media keys and volume wheel are report id 2 which is a consumer control device and appears to follow spec.  The LED control keys are 3.

0x05, 0x01,        // Usage Page (Generic Desktop Ctrls)
0x09, 0x06,        // Usage (Keyboard)
0xA1, 0x01,        // Collection (Application)
0x85, 0x01,        //   Report ID (1)
0x05, 0x07,        //   Usage Page (Kbrd/Keypad)
0x19, 0xE0,        //   Usage Minimum (0xE0)
0x29, 0xE7,        //   Usage Maximum (0xE7)
0x15, 0x00,        //   Logical Minimum (0)
0x25, 0x01,        //   Logical Maximum (1)
0x75, 0x01,        //   Report Size (1)
0x95, 0x08,        //   Report Count (8)
0x81, 0x02,        //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x19, 0x00,        //   Usage Minimum (0x00)
0x29, 0x97,        //   Usage Maximum (0x97)
0x15, 0x00,        //   Logical Minimum (0)
0x25, 0x01,        //   Logical Maximum (1)
0x75, 0x01,        //   Report Size (1)
0x95, 0x98,        //   Report Count (-104)
0x81, 0x02,        //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x08,        //   Usage Page (LEDs)
0x19, 0x01,        //   Usage Minimum (Num Lock)
0x29, 0x03,        //   Usage Maximum (Scroll Lock)
0x25, 0x01,        //   Logical Maximum (1)
0x75, 0x01,        //   Report Size (1)
0x95, 0x03,        //   Report Count (3)
0x91, 0x02,        //   Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0x75, 0x05,        //   Report Size (5)
0x95, 0x01,        //   Report Count (1)
0x91, 0x01,        //   Output (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0xC0,              // End Collection
0x05, 0x0C,        // Usage Page (Consumer)
0x09, 0x01,        // Usage (Consumer Control)
0xA1, 0x01,        // Collection (Application)
0x85, 0x02,        //   Report ID (2)
0x05, 0x0C,        //   Usage Page (Consumer)
0x19, 0x00,        //   Usage Minimum (Unassigned)
0x2A, 0xFF, 0x0F,  //   Usage Maximum (0x0FFF)
0x15, 0x00,        //   Logical Minimum (0)
0x26, 0xFF, 0x0F,  //   Logical Maximum (4095)
0x75, 0x10,        //   Report Size (16)
0x95, 0x02,        //   Report Count (2)
0x81, 0x00,        //   Input (Data,Array,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0,              // End Collection
0x06, 0xC0, 0xFF,  // Usage Page (Vendor Defined 0xFFC0)
0x09, 0x02,        // Usage (0x02)
0xA1, 0x01,        // Collection (Application)
0x85, 0x03,        //   Report ID (3)
0x15, 0x00,        //   Logical Minimum (0)
0x26, 0xFF, 0x00,  //   Logical Maximum (255)
0x95, 0x3F,        //   Report Count (63)
0x75, 0x08,        //   Report Size (8)
0x09, 0x02,        //   Usage (0x02)
0x81, 0x02,        //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0,              // End Collection
0x06, 0xC2, 0xFF,  // Usage Page (Vendor Defined 0xFFC2)
0x09, 0x03,        // Usage (0x03)
0xA1, 0x01,        // Collection (Application)
0x85, 0x0E,        //   Report ID (14)
0x15, 0x00,        //   Logical Minimum (0)
0x26, 0xFF, 0x00,  //   Logical Maximum (255)
0x95, 0x3F,        //   Report Count (63)
0x75, 0x08,        //   Report Size (8)
0x09, 0x03,        //   Usage (0x03)
0x81, 0x02,        //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0,              // End Collection
0x05, 0x01,        // Usage Page (Generic Desktop Ctrls)
0x09, 0x02,        // Usage (Mouse)
0xA1, 0x01,        // Collection (Application)
0x85, 0x05,        //   Report ID (5)
0x09, 0x01,        //   Usage (Pointer)
0xA1, 0x00,        //   Collection (Physical)
0x05, 0x09,        //     Usage Page (Button)
0x19, 0x01,        //     Usage Minimum (0x01)
0x29, 0x20,        //     Usage Maximum (0x20)
0x15, 0x00,        //     Logical Minimum (0)
0x25, 0x01,        //     Logical Maximum (1)
0x95, 0x20,        //     Report Count (32)
0x75, 0x01,        //     Report Size (1)
0x81, 0x02,        //     Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x01,        //     Usage Page (Generic Desktop Ctrls)
0x09, 0x30,        //     Usage (X)
0x09, 0x31,        //     Usage (Y)
0x16, 0x01, 0x00,  //     Logical Minimum (1)
0x26, 0xFF, 0x7F,  //     Logical Maximum (32767)
0x75, 0x10,        //     Report Size (16)
0x95, 0x02,        //     Report Count (2)
0x81, 0x06,        //     Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)
0x09, 0x38,        //     Usage (Wheel)
0x15, 0x81,        //     Logical Minimum (-127)
0x25, 0x7F,        //     Logical Maximum (127)
0x75, 0x08,        //     Report Size (8)
0x95, 0x01,        //     Report Count (1)
0x81, 0x06,        //     Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)
0xC0,              //   End Collection
0xC0,              // End Collection

// 192 bytes
Comment 17 Hans Petter Selasky freebsd_committer freebsd_triage 2020-02-13 12:39:42 UTC
Created attachment 211610 [details]
Patch for USB keyboard driver

Can you try this patch?
Comment 18 commit-hook freebsd_committer freebsd_triage 2020-02-13 16:03:19 UTC
A commit references this bug:

Author: hselasky
Date: Thu Feb 13 16:03:12 UTC 2020
New revision: 357861
URL: https://svnweb.freebsd.org/changeset/base/357861

Log:
  Improve USB gaming keyboard support.

  Add support for decoding pressed keys as a bitmap. The keys in the
  bitmap are described in the interface specific HID descriptor. Some
  keyboards even have multiple input interfaces, only using the bitmap
  method when the event array is full. That typically means when more
  than seven keys are pressed simultaneously.

  The internals of the USB keyboard driver have been slightly reworked
  to keep track of all keys in a single bitmap having 256 bits. This
  bitmap is then divided into blocks of 64-bits as an optimisation.

  Simplify automatic key repeat logic, because only the last key pressed
  can be repeated.

  PR:	224592
  PR:	233884
  Tested by:	Alex V. Petrov <alexvpetrov@gmail.com>
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Changes:
  head/sys/dev/usb/input/ukbd.c
Comment 19 yp 2020-02-13 16:42:32 UTC
That's awesome, I noticed this bug some time ago, and K63 Wireless didn't work for me at all, even applying the hints that helped others, probably has to do with newest firmware (3.12).  Now with this commit it works out of the box.
Comment 20 Hans Petter Selasky freebsd_committer freebsd_triage 2020-02-13 16:46:49 UTC
Please re-open if this is still an issue.
Patches will be MFC'ed to 11-stable and 12-stable next week.
Comment 21 commit-hook freebsd_committer freebsd_triage 2020-02-21 08:31:17 UTC
A commit references this bug:

Author: hselasky
Date: Fri Feb 21 08:30:34 UTC 2020
New revision: 358211
URL: https://svnweb.freebsd.org/changeset/base/358211

Log:
  MFC r357861 and r357898:
  Improve USB gaming keyboard support.

  Add support for decoding pressed keys as a bitmap. The keys in the
  bitmap are described in the interface specific HID descriptor. Some
  keyboards even have multiple input interfaces, only using the bitmap
  method when the event array is full. That typically means when more
  than seven keys are pressed simultaneously.

  The internals of the USB keyboard driver have been slightly reworked
  to keep track of all keys in a single bitmap having 256 bits. This
  bitmap is then divided into blocks of 64-bits as an optimisation.

  Simplify automatic key repeat logic, because only the last key pressed
  can be repeated.

  PR:	224592
  PR:	233884
  Tested by:	Alex V. Petrov <alexvpetrov@gmail.com>
  Sponsored by:	Mellanox Technologies

Changes:
_U  stable/12/
  stable/12/sys/dev/usb/input/ukbd.c
Comment 22 commit-hook freebsd_committer freebsd_triage 2020-02-21 09:07:26 UTC
A commit references this bug:

Author: hselasky
Date: Fri Feb 21 09:07:01 UTC 2020
New revision: 358216
URL: https://svnweb.freebsd.org/changeset/base/358216

Log:
  MFC r357861 and r357898:
  Improve USB gaming keyboard support.

  Add support for decoding pressed keys as a bitmap. The keys in the
  bitmap are described in the interface specific HID descriptor. Some
  keyboards even have multiple input interfaces, only using the bitmap
  method when the event array is full. That typically means when more
  than seven keys are pressed simultaneously.

  The internals of the USB keyboard driver have been slightly reworked
  to keep track of all keys in a single bitmap having 256 bits. This
  bitmap is then divided into blocks of 64-bits as an optimisation.

  Simplify automatic key repeat logic, because only the last key pressed
  can be repeated.

  PR:	224592
  PR:	233884
  Tested by:	Alex V. Petrov <alexvpetrov@gmail.com>
  Sponsored by:	Mellanox Technologies

Changes:
_U  stable/11/
  stable/11/sys/dev/usb/input/ukbd.c
Comment 23 commit-hook freebsd_committer freebsd_triage 2020-02-25 12:57:07 UTC
A commit references this bug:

Author: hselasky
Date: Tue Feb 25 12:56:06 UTC 2020
New revision: 358310
URL: https://svnweb.freebsd.org/changeset/base/358310

Log:
  Use hid_get_data_unsigned() instead of hid_get_data() when reading the
  key-codes from the USB keyboard. Negative key-codes are currently skipped.

  While at it use the bit size value provided by the HID location structure
  instead of assuming a value of 8.

  This fixes a regression issue after r357861.

  Reported by:	Minoru TANABE <kotanabe3@gmail.com>
  PR:	224592
  PR:	233884
  MFC after:	3 days
  Sponsored by:	Mellanox Technologies

Changes:
  head/sys/dev/usb/input/ukbd.c
Comment 24 commit-hook freebsd_committer freebsd_triage 2020-02-28 22:00:56 UTC
A commit references this bug:

Author: hselasky
Date: Fri Feb 28 22:00:01 UTC 2020
New revision: 358452
URL: https://svnweb.freebsd.org/changeset/base/358452

Log:
  MFC r358310:
  Use hid_get_data_unsigned() instead of hid_get_data() when reading the
  key-codes from the USB keyboard. Negative key-codes are currently skipped.

  While at it use the bit size value provided by the HID location structure
  instead of assuming a value of 8.

  This fixes a regression issue after r357861.

  Reported by:	Minoru TANABE <kotanabe3@gmail.com>
  PR:	224592
  PR:	233884
  Sponsored by:	Mellanox Technologies

Changes:
_U  stable/12/
  stable/12/sys/dev/usb/input/ukbd.c
Comment 25 commit-hook freebsd_committer freebsd_triage 2020-02-28 22:00:59 UTC
A commit references this bug:

Author: hselasky
Date: Fri Feb 28 22:00:51 UTC 2020
New revision: 358453
URL: https://svnweb.freebsd.org/changeset/base/358453

Log:
  MFC r358310:
  Use hid_get_data_unsigned() instead of hid_get_data() when reading the
  key-codes from the USB keyboard. Negative key-codes are currently skipped.

  While at it use the bit size value provided by the HID location structure
  instead of assuming a value of 8.

  This fixes a regression issue after r357861.

  Reported by:	Minoru TANABE <kotanabe3@gmail.com>
  PR:	224592
  PR:	233884
  Sponsored by:	Mellanox Technologies

Changes:
_U  stable/11/
  stable/11/sys/dev/usb/input/ukbd.c
Comment 26 commit-hook freebsd_committer freebsd_triage 2020-03-04 09:47:09 UTC
A commit references this bug:

Author: hselasky
Date: Wed Mar  4 09:46:43 UTC 2020
New revision: 358609
URL: https://svnweb.freebsd.org/changeset/base/358609

Log:
  Restart the USB keyboard repeat timer at every valid key-press.

  This fixes a regression issue after r357861.

  Reported by:	James Wright <james.wright@jigsawdezign.com>
  PR:	224592
  PR:	233884
  MFC after:	3 days
  Sponsored by:	Mellanox Technologies

Changes:
  head/sys/dev/usb/input/ukbd.c
Comment 27 commit-hook freebsd_committer freebsd_triage 2020-03-06 12:02:59 UTC
A commit references this bug:

Author: hselasky
Date: Fri Mar  6 12:01:58 UTC 2020
New revision: 358696
URL: https://svnweb.freebsd.org/changeset/base/358696

Log:
  MFC r358609:
  Restart the USB keyboard repeat timer at every valid key-press.

  This fixes a regression issue after r357861.

  Reported by:	James Wright <james.wright@jigsawdezign.com>
  PR:	224592
  PR:	233884
  Sponsored by:	Mellanox Technologies

Changes:
_U  stable/12/
  stable/12/sys/dev/usb/input/ukbd.c
Comment 28 commit-hook freebsd_committer freebsd_triage 2020-03-06 12:03:03 UTC
A commit references this bug:

Author: hselasky
Date: Fri Mar  6 12:02:43 UTC 2020
New revision: 358697
URL: https://svnweb.freebsd.org/changeset/base/358697

Log:
  MFC r358609:
  Restart the USB keyboard repeat timer at every valid key-press.

  This fixes a regression issue after r357861.

  Reported by:	James Wright <james.wright@jigsawdezign.com>
  PR:	224592
  PR:	233884
  Sponsored by:	Mellanox Technologies

Changes:
_U  stable/11/
  stable/11/sys/dev/usb/input/ukbd.c
Comment 29 commit-hook freebsd_committer freebsd_triage 2020-03-30 15:30:44 UTC
A commit references this bug:

Author: hselasky
Date: Mon Mar 30 15:29:39 UTC 2020
New revision: 359439
URL: https://svnweb.freebsd.org/changeset/base/359439

Log:
  Evaluate modifier keys before the regular keys, so that if a modifier
  key is pressed at the same time as a regular key, that means key with
  modifier is output. Some automated USB keyboards like Yubikeys need this.

  This fixes a regression issue after r357861.

  Reported by:	Adam McDougall <mcdouga9@egr.msu.edu>
  PR:		224592
  PR:		233884
  MFC after:	3 days
  Sponsored by:	Mellanox Technologies

Changes:
  head/sys/dev/usb/input/ukbd.c
Comment 30 commit-hook freebsd_committer freebsd_triage 2020-04-02 07:41:50 UTC
A commit references this bug:

Author: hselasky
Date: Thu Apr  2 07:40:57 UTC 2020
New revision: 359558
URL: https://svnweb.freebsd.org/changeset/base/359558

Log:
  MFC r359439:
  Evaluate modifier keys before the regular keys, so that if a modifier
  key is pressed at the same time as a regular key, that means key with
  modifier is output. Some automated USB keyboards like Yubikeys need this.

  This fixes a regression issue after r357861.

  Reported by:	Adam McDougall <mcdouga9@egr.msu.edu>
  PR:		224592
  PR:		233884
  Sponsored by:	Mellanox Technologies

Changes:
_U  stable/12/
  stable/12/sys/dev/usb/input/ukbd.c
Comment 31 commit-hook freebsd_committer freebsd_triage 2020-04-02 07:43:52 UTC
A commit references this bug:

Author: hselasky
Date: Thu Apr  2 07:42:29 UTC 2020
New revision: 359559
URL: https://svnweb.freebsd.org/changeset/base/359559

Log:
  MFC r359439:
  Evaluate modifier keys before the regular keys, so that if a modifier
  key is pressed at the same time as a regular key, that means key with
  modifier is output. Some automated USB keyboards like Yubikeys need this.

  This fixes a regression issue after r357861.

  Reported by:	Adam McDougall <mcdouga9@egr.msu.edu>
  PR:		224592
  PR:		233884
  Sponsored by:	Mellanox Technologies

Changes:
_U  stable/11/
  stable/11/sys/dev/usb/input/ukbd.c