Commit Graph

318 Commits

Author SHA1 Message Date
Rémi Bernon bd780ba618 winebus.sys: Only keep a single read pending.
The design of hidclass.sys prevents any concurrent irps, there's no
need to queue more.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51824
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-08 15:27:25 +02:00
Rémi Bernon 1c4523a9d4 winebus.sys: Add a PID set ramp force output report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-08 15:27:25 +02:00
Rémi Bernon 4a2db9f29e winebus.sys: Add a PID set constant force output report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-08 15:27:25 +02:00
Rémi Bernon c263fea14f winebus.sys: Add a PID set condition output report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-08 15:27:25 +02:00
Rémi Bernon 4b653ae043 winebus.sys: Add a PID set envelope output report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-08 15:27:25 +02:00
Rémi Bernon 6f2e66963c winebus.sys: Add a PID set periodic output report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-08 15:27:25 +02:00
Rémi Bernon 57d99dcfb7 winebus.sys: Parse product string from uevent HID_NAME.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:35 +02:00
Rémi Bernon 2c0da82050 winebus.sys: Don't enter critical section in bus_find_unix_device.
Callers are already holding it.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:34 +02:00
Rémi Bernon cf464a4d0b winebus.sys: Remove "stub!" from lnxev_device_haptics_start trace.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:34 +02:00
Huw Davies 43cd5d8a2d winebus.sys: Convert the product strings to Unicode on the Unix-side.
This avoids keeping two copies of each string.

It also fixes a regression on macOS from commit 9d4b70473c
that incorrectly treated a CFStringRef as a char ptr.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 11:51:04 +02:00
Rémi Bernon 0fc31aaf21 winebus.sys: Add more Xbox controllers product ids.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 11:48:34 +02:00
Rémi Bernon 9132162266 winebus.sys: Implement PID effect update for UDEV lnxev devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 11:33:35 +02:00
Rémi Bernon 2dd369044d winebus.sys: Implement PID effect update for SDL devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 11:33:30 +02:00
Rémi Bernon 12d91995fd winebus.sys: Add a PID effect update output report.
Advertising support of the periodic effect types only for now.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 11:33:19 +02:00
Rémi Bernon 6bc71db09e winebus.sys: Use type and size of the current event, not the previous one.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51831
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-04 11:22:48 +02:00
Rémi Bernon a41c5e057c winebus.sys: Implement PID effect control for UDEV lnxev devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-04 11:02:02 +02:00
Rémi Bernon 8f0f2fab72 winebus.sys: Implement PID effect control for SDL devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-04 11:02:00 +02:00
Rémi Bernon 3b3228e9c7 winebus.sys: Add a PID effect control output report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-04 11:01:56 +02:00
Rémi Bernon 11fe73ed8f winebus.sys: Implement PID device control for UDEV lnxev devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 12:37:47 +02:00
Rémi Bernon eeb97fa605 winebus.sys: Implement PID device control for SDL devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 12:37:43 +02:00
Rémi Bernon 903c7ea75d winebus.sys: Add a PID device control output report.
And include it in the HID report descriptor when SDL device has support
for any haptic effect, or when UDEV lnxev device has any FF bit set.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 12:37:17 +02:00
Rémi Bernon 55e978168e winebus.sys: Move hidraw_device code around.
To keep lnxev_device functions and related helpers all together.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-27 17:40:14 +02:00
Gerald Pfeifer 0c81dc223d winebus.sys: Fix non-Linux builds.
commit 40a9f69a1d

   winebus.sys: Rename UDEV bus device variables to be consistent.

   Introducing a struct base_device, and hidraw_device / lnxev_device
   depending on the sub-type of the device.

moved an existing use of ABS_VOLUME that was guarded by

  #ifdef HAS_PROPER_INPUT_HEADER

outside that guard, breaking the build on non-Linux platforms.

Address this by putting appropriate guards in place.

Signed-off-by: Gerald Pfeifer <gerald@pfeifer.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-27 17:40:14 +02:00
Rémi Bernon a27708dc9b winebus.sys: Add haptics rumble support for UDEV lnxev devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-24 21:55:19 +02:00
Rémi Bernon e42f11d7a2 winebus.sys: Remove old vendor rumble report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-24 21:55:19 +02:00
Rémi Bernon cb4d378fa9 winebus.sys: Add a new rumble report using HID haptics.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-24 21:55:19 +02:00
Rémi Bernon ef36885b1e winebus.sys: Remove unused SDL_memset function pointer.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-24 21:55:19 +02:00
Rémi Bernon c3ee32e846 winebus.sys: Check for SDL_JoystickRumble presence at runtime.
It's been introduced in SDL2 2.0.9, released on 2018/10/31.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-24 21:55:19 +02:00
Rémi Bernon 78f67d5c08 winebus.sys: Handle feature and output reports in hid_device.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:28:45 +02:00
Rémi Bernon 777a8fbda8 winebus.sys: Add support for joystick device rumble.
Some devices, such as the DualShock 4 only have support for haptics
through the SDL_JoystickRumble API. Let's use it as a fallback if none
of the more detailed API are supported.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:28:42 +02:00
Rémi Bernon 04b19a969b winebus.sys: Use report ids in crafted HID reports.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:28:39 +02:00
Rémi Bernon 9cf1e8353c winebus.sys: Factor out setting HID report values.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:28:33 +02:00
Rémi Bernon c6df23fed3 winebus.sys: Factor out HID report buffers allocation.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:28:21 +02:00
Rémi Bernon 9d5e9b5f42 winebus.sys: Use the computed element offsets to create reports.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 21:48:10 +02:00
Rémi Bernon de050c974b winebus.sys: Compute offsets while building the report descriptor.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 21:48:07 +02:00
Rémi Bernon fa3905bafa winebus.sys: Introduce a new raw_device / hid_device abstraction.
For any device which requires building HID reports.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 21:48:02 +02:00
Rémi Bernon 0e18098bd5 winebus.sys: Rename IOHID bus device variables to be consistent.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 21:47:57 +02:00
Rémi Bernon 40a9f69a1d winebus.sys: Rename UDEV bus device variables to be consistent.
Introducing a struct base_device, and hidraw_device / lnxev_device
depending on the sub-type of the device.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 21:47:53 +02:00
Rémi Bernon 12b5bc87db winebus.sys: Rename SDL bus device to struct sdl_device.
And use impl everywhere instead of inconsistent private / ext / device.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 21:47:48 +02:00
Alexandre Julliard ab5664a5e6 makefiles: Explicitly name the Unix library in the makefile instead of using --subsystem unixlib.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 17:49:48 +02:00
Rémi Bernon 8375753952 winebus.sys: Simplify SDL controller report descriptor creation.
Now that we have xinput.sys for translation there's no need to keep this
compatible.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:41:07 +02:00
Rémi Bernon 4a15cc9eb9 winebus.sys: Simplify SDL joystick report descriptor creation.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:41:02 +02:00
Rémi Bernon 8221229498 winebus.sys: Always add padding after button blocks.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:40:58 +02:00
Rémi Bernon 593c4d5149 winebus.sys: Move hats before buttons and use one byte each.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:40:54 +02:00
Rémi Bernon d7c4867257 winebus.sys: Enforce all axis values to be 32bit.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:40:43 +02:00
Rémi Bernon 059764e87e winebus.sys: Remove the bogus SDL "unknown" HID report constant.
It was used for XInput compatibility and is not needed anymore.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:40:40 +02:00
Rémi Bernon 65403bb067 winebus.sys: Move fastcall wrapper together with the functions.
The .text directive sometimes makes the global variables go in the
wrong section.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47751
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:49 +02:00
Rémi Bernon 7608538b40 winebus.sys: Remove unnecessary internal bus ids.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:49 +02:00
Rémi Bernon 9e3f9408b0 winebus.sys: Use WINEBUS\ as a common hardware ids prefix.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:49 +02:00
Rémi Bernon f37ae29b49 winebus.sys: Use WINEBUS\ as device id prefix for all buses.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:48 +02:00
Rémi Bernon 8fb10882c9 winebus.sys: Add a VID and PID to mouse and keyboard devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:48 +02:00
Alexandre Julliard 088a787a2c makefiles: Make -mno-cygwin the default.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:48 +02:00
Alexandre Julliard 80a57c617b winebus.sys: Remove the no longer used CFStringToWSTR function.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 12:57:24 +02:00
Alexandre Julliard aff08c7e14 winebus.sys: Fix a typo in find_device_from_iohid().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 12:51:36 +02:00
Rémi Bernon 334d89a253 winebus.sys: Use wide character strings literals.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 10:45:48 +02:00
Rémi Bernon 5bbf1d1095 winebus.sys: Use new unixlib subsystem.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 10:45:46 +02:00
Rémi Bernon cc2f669390 winebus.sys: Use a pthread_mutex_t instead of CRITICAL_SECTION.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 10:45:43 +02:00
Rémi Bernon 8f6932fd35 winebus.sys: Avoid process heap allocations on the unix side.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 10:45:41 +02:00
Rémi Bernon e54ff70e5d winebus.sys: Build with msvcrt.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 10:45:38 +02:00
Rémi Bernon 39ca4de665 winebus.sys: Use Rtl CS functions.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 10:50:39 +02:00
Rémi Bernon 35a6148acf winebus.sys: Use Rtl heap functions.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 10:50:37 +02:00
Rémi Bernon 0017b5eb63 winebus.sys: Load SDL bus mappings before calling bus_init.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 10:50:36 +02:00
Rémi Bernon 7032b41747 winebus.sys: Move is_xbox_gamepad to unixlib.c.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 10:50:34 +02:00
Rémi Bernon 2a2fc11d8c winebus.sys: Remove the now useless device_compare callback.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 10:50:32 +02:00
Rémi Bernon 421a6f53ad winebus.sys: Pass a unix_device pointer in every bus event.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 10:50:30 +02:00
Rémi Bernon cdaf1d9a7f winebus.sys: Remove the DEVICE_OBJECT arg on device_start.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 22:03:41 +02:00
Rémi Bernon 5f8ebe7a60 winebus.sys: Remove the now useless get_unix_device.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 22:03:32 +02:00
Rémi Bernon be503e97fb winebus.sys: Poll all UDEV fds together in the bus_wait thread.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 22:03:14 +02:00
Rémi Bernon bc0ad0e13b winebus.sys: Return an event from IOHID bus wait on input report.
Instead of calling process_hid_report.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 22:03:11 +02:00
Rémi Bernon e0ac56267f winebus.sys: Return an event from UDEV bus wait on input report.
Instead of calling process_hid_report.

We need to guard the event queue as the input reports are read from
dedicated threads.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 22:03:08 +02:00
Rémi Bernon 8b434bdc7f winebus.sys: Return an event from SDL bus wait on input report.
Instead of calling process_hid_report.

This adds a reference count on unix devices to make sure they are kept
alive until all their input report events have been processed.

This also uses a bus-specific device list, to be able to find devices
from joystick ids without having to call back to the win32 side.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 22:03:03 +02:00
Rémi Bernon 5380167ca0 winebus.sys: Move process_hid_report helper around.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 22:02:51 +02:00
Rémi Bernon 1f12b2160d winebus.sys: Free unix device in unix_device_remove.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 11:50:01 +02:00
Rémi Bernon bf1446523c winebus.sys: Allocate mouse and keyboard devices dynamically.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 11:49:59 +02:00
Rémi Bernon b86eade743 winebus.sys: Use helpers to create and destroy unix devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 11:49:57 +02:00
Rémi Bernon cd830398dd winebus.sys: Split destroy to a separate stop method.
So we can stop the device when it's removed from the ntoskrnl.exe device
list, and then destroy it only when it's not referenced anymore.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 11:49:55 +02:00
Rémi Bernon 56a4aaf419 winebus.sys: Remove the now useless get_string callback.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 21:12:39 +02:00
Rémi Bernon ff0d402efa winebus.sys: Query serialnumber string on device creation.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 21:12:36 +02:00
Rémi Bernon 093c13e333 winebus.sys: Query product string on device creation.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 21:12:34 +02:00
Rémi Bernon 9d4b70473c winebus.sys: Query manufacturer string on device creation.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 21:12:32 +02:00
Rémi Bernon e4f0b4ab8a winebus.sys: Remove the now useless native product strings.
This should now be handled by winexinput.sys.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 21:12:30 +02:00
Rémi Bernon 83f0de4487 winebus.sys: Return an event from IOHID bus wait on device creation.
Instead of calling bus_create_hid_device.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-08 20:40:56 +02:00
Rémi Bernon f7be0f5edf winebus.sys: Return an event from UDEV bus wait on device creation.
And queued events generated from initial device enumeration.

Instead of calling bus_create_hid_device.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-08 20:40:52 +02:00
Rémi Bernon 507a3076de winebus.sys: Return an event from SDL bus wait on device creation.
Instead of calling bus_create_hid_device.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-08 20:40:48 +02:00
Rémi Bernon 60740e8745 winebus.sys: Remove the now useless bus_enumerate_hid_devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-03 21:43:04 +02:00
Rémi Bernon 6ce5ba8f2f winebus.sys: Look for duplicate UDEV devices on the unix side.
Devices are only added from a single thread but they may be destroyed
concurrently so we need to guard the list against race conditions.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-03 21:43:03 +02:00
Rémi Bernon 4366cba6e6 winebus.sys: Move device vtable to the struct unix_device side.
And name the callbacks a bit more consistently.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-03 21:43:03 +02:00
Rémi Bernon 08f943b595 winebus.sys: Create devices using a struct device_desc descriptor.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-03 21:43:03 +02:00
Rémi Bernon 5e0c1ce443 winebus.sys: Move mouse and keyboard devices to unixlib.c.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 21:57:38 +02:00
Rémi Bernon 2457113970 winebus.sys: Return an event from IOHID bus wait on device removal.
Instead of calling bus_unlink_hid_device or IoInvalidateDeviceRelations.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 21:57:38 +02:00
Rémi Bernon 9f09e2a3cb winebus.sys: Return an event from UDEV bus wait on device removal.
Instead of calling bus_unlink_hid_device or IoInvalidateDeviceRelations.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 21:57:38 +02:00
Rémi Bernon 6006758ca8 winebus.sys: Return an event from SDL bus wait on device removal.
Instead of calling bus_unlink_hid_device or IoInvalidateDeviceRelations.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 21:57:38 +02:00
Rémi Bernon f6d567d3e3 winebus.sys: Pass a struct bus_event pointer to bus_wait.
Allocated on the caller side.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 21:57:38 +02:00
Rémi Bernon d22ece4c58 winebus.sys: Stop enforcing input and IG suffix on gamepads.
The &IG_00 suffix is now automatically added by winexinput.sys.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 21:57:38 +02:00
Rémi Bernon 7b4b48a774 winebus.sys: Report WINEBUS\WINE_COMP_XINPUT compatible id for gamepads.
In addition, and before WINEBUS\WINE_COMP_HID, so that winexinput.sys
will match first as soon as it is introduced.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 10:30:24 +02:00
Rémi Bernon 06ab0d5405 winebus.sys: Report WINEBUS\WINE_COMP_HID compatible id.
And match it in winehid.sys instead of individual bus ids.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-02 10:30:20 +02:00
Michael Stefaniuc 079c47a38e winebus.sys: Print the debug string and not the pointer to it.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-26 10:40:09 +02:00
Rémi Bernon 11c6b376c0 winebus.sys: Use the private data pointer as device unique id.
Instead of a separately allocated device list entry pointer. And link
the device object into the device list directly.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-25 11:18:18 +02:00
Rémi Bernon 09c14c6321 winebus.sys: Allocate private device data separately.
And use an opaque struct unix_device as private data.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-25 11:18:16 +02:00
Rémi Bernon 7e1d1fac70 winebus.sys: Load bus options in main.c.
And pass them to bus_init function.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-25 11:18:14 +02:00