Page MenuHomeFreeBSD

Hyper-V HID driver
ClosedPublic

Authored by yuri_aetern.org on Jan 21 2023, 4:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 9 2024, 10:09 AM
Unknown Object (File)
Jan 8 2024, 4:10 AM
Unknown Object (File)
Jan 8 2024, 4:10 AM
Unknown Object (File)
Jan 8 2024, 4:10 AM
Unknown Object (File)
Jan 3 2024, 4:46 AM
Unknown Object (File)
Dec 31 2023, 10:04 AM
Unknown Object (File)
Dec 31 2023, 10:04 AM
Unknown Object (File)
Dec 31 2023, 10:01 AM

Details

Summary

Hyper-V HID driver using hidbus/hms.

As all hv_* driver are built-in to the kernel, I have updated the GENERIC for amd64 to include all required HID modules.

Test Plan

Running Hyper-V on Windows 11, startx in the guest system, check that mouse is working.

hvhid0: <Hyper-V HID device> on vmbus0
hidbus0: <HID bus> on hvhid0
...
hms0: < Tablet> on hidbus0
hms0: 5 buttons and [XYW] coordinates ID=0
[    28.774] (II) config/udev: Adding input device  Tablet (/dev/input/event3)
[    28.774] (**)  Tablet: Applying InputClass "libinput pointer catchall"
[    28.774] (II) Using input driver 'libinput' for ' Tablet'
[    28.774] (**)  Tablet: always reports core events
[    28.774] (**) Option "Device" "/dev/input/event3"
[    28.774] (**) Option "_source" "server/udev"
[    28.774] (II) event3  -  Tablet: is tagged by udev as: Mouse
[    28.774] (II) event3  -  Tablet: device is a pointer
[    28.774] (II) event3  -  Tablet: device removed
[    28.774] (**) Option "config_info" "udev:/dev/input/event3"
[    28.774] (II) XINPUT: Adding extended input device " Tablet" (type: MOUSE, id 9)
[    28.774] (**) Option "AccelerationScheme" "none"
[    28.774] (**)  Tablet: (accel) selected scheme none/0
[    28.774] (**)  Tablet: (accel) acceleration factor: 2.000
[    28.774] (**)  Tablet: (accel) acceleration threshold: 4
[    28.774] (II) event3  -  Tablet: is tagged by udev as: Mouse
[    28.774] (II) event3  -  Tablet: device is a pointer

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

yuri_aetern.org retitled this revision from stub hv_ms driver to Hyper-V HID driver.
yuri_aetern.org edited the summary of this revision. (Show Details)
yuri_aetern.org edited the test plan for this revision. (Show Details)

As it now works, update the summary/test plan, and rename the driver to hv_hid.

Great! Thank you! I will review your review soon. Just need some time to setup Win10 and FreeBSD HV VM on non Windows friendly hardware again.

make use of hid_intr_start/hid_intr_stop

(hopefully the last nit fix from me) set name for the device to make device description from hms look a bit more sane

sys/dev/hyperv/input/hv_hid.c
290

They are exported to user-world via evdev and hidraw

415

use mtx_sleep(9) and wakeup(9) pair instead of polling loop

455

Extraneous check. free() accepts NULL pointers

469

Initialize rdesc->rdsize for hidraw(4) to work

rdesc->rdsize = rdesc->isize;
493

Serialize sc->intr_on access and sc->intr execution with mutex. I hope it will not introduce LOR

{F55560085}
It resolves all my comments and converts hv_hid to kernel module auto-loaded by devmatch

In D38140#869500, @wulf wrote:

{F55560085}
It resolves all my comments and converts hv_hid to kernel module auto-loaded by devmatch

Feel free to go forward with this.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 5 2023, 3:33 PM
Closed by commit rGe4d3f1e40ab3: hv_hid: Hyper-V HID driver (authored by yuri_aetern.org, committed by wulf). · Explain Why
This revision was automatically updated to reflect the committed changes.