Page MenuHomeFreeBSD

Hyper-V HID driver
ClosedPublic

Authored by yuri_aetern.org on Jan 21 2023, 4:09 AM.
Tags
None
Referenced Files
F102642181: D38140.id.diff
Fri, Nov 15, 5:53 AM
Unknown Object (File)
Thu, Nov 14, 8:57 AM
Unknown Object (File)
Thu, Nov 14, 7:23 AM
Unknown Object (File)
Wed, Nov 13, 1:53 AM
Unknown Object (File)
Sun, Nov 10, 7:17 AM
Unknown Object (File)
Sun, Nov 3, 1:49 PM
Unknown Object (File)
Fri, Nov 1, 7:44 PM
Unknown Object (File)
Oct 8 2024, 2:05 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 Skipped
Unit
Tests Skipped

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
289 ↗(On Diff #115458)

They are exported to user-world via evdev and hidraw

414 ↗(On Diff #115458)

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

454 ↗(On Diff #115458)

Extraneous check. free() accepts NULL pointers

468 ↗(On Diff #115458)

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

rdesc->rdsize = rdesc->isize;
492 ↗(On Diff #115458)

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.