Commit Graph

340 Commits

Author SHA1 Message Date
Rémi Bernon 5b9c1e9163 winebus.sys: Fix lnxev button start byte vs bit index.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Rémi Bernon 5679e006ca winebus.sys: Use irp IoStatus.Status consistently.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Rémi Bernon 8f37267f92 winebus.sys: Use nameless unions.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Rémi Bernon a446e0e57d winebus.sys: Use a local variable to store buffer len.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Rémi Bernon 2d7fa05ce4 winebus.sys: Remove duplicate LeaveCriticalSection call.
Breaking out of the switch will leave it already.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Rémi Bernon 199f689ff1 winebus.sys: Return STATUS_SUCCESS from IRP_MN_SURPRISE_REMOVAL.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Rémi Bernon ab8f8258a5 winebus.sys: Add missing keyboard free_device callback.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-30 20:01:20 +02:00
Rémi Bernon 0f48202335 winebus.sys: Handle IRP_MN_SURPRISE_REMOVAL and set removed flag.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-30 20:01:20 +02:00
Rémi Bernon 25155186c6 winebus.sys: Introduce new remove_pending_irps helper.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-30 20:01:20 +02:00
Rémi Bernon 001b70774f winebus.sys: Add some buttons to HID keyboard input report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-04 20:00:30 +02:00
Rémi Bernon 318e5feda5 winebus.sys: Add some buttons to HID mouse input report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-04 20:00:30 +02:00
Rémi Bernon 0baabde716 winebus.sys: Use macros to define HID reports.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-02 20:28:03 +02:00
Rémi Bernon 709c801fb1 winebus.sys: Create stub Wine HID keyboard device.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-23 20:02:06 +02:00
Zebediah Figura 1fdcf1f183 winebus.sys: Return success from IRP_MN_START_DEVICE on the child PDO.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-20 21:07:09 +02:00
Zebediah Figura bbdc0cc924 winebus.sys: Do not print a FIXME for IRP_MN_QUERY_DEVICE_RELATIONS in pdo_pnp_dispatch().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-16 22:39:45 +02:00
Zebediah Figura 27f40156ba winebus.sys: Move device destruction to IRP_MN_REMOVE_DEVICE.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-15 10:34:01 +02:00
Zebediah Figura b0f25d7e1b winebus.sys: Reject ioctls on a removed device.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-15 10:33:57 +02:00
Zebediah Figura f8ec3fdcdb winebus.sys: Move platform-specific device cleanup to a callback function.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-15 10:33:53 +02:00
Zebediah Figura b6409950d9 winebus.sys: Rename "report_cs" to "cs".
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-15 10:33:49 +02:00
Arkadiusz Hiler ee4e33ed9a winebus.sys: Remove incorrect Report ID from the bus_sdl HID report descriptor.
According to "USB Device Class Definition for Human Interface Devices
Firmware Specification Version 1.11" Report ID 0 is reserved and should
not be used.

On top of that if Report ID is used anywhere in the descriptor the
reports are expected to be prepended with an ID and this is not the case
for bus_sdl devices.

It worked only because our current HID parser implementation treats the
Report ID 0 as there would be none.

Signed-off-by: Arkadiusz Hiler <ahiler@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-23 22:30:31 +01:00
Zebediah Figura 141fdcc0ef winebus.sys: Return STATUS_DELETE_PENDING rather than STATUS_CANCELLED when a device is removed.
Microsoft doesn't really clearly document this, but their driver samples return it here, and so do remove locks.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-12 14:41:49 +01:00
Zebediah Figura dece98fb59 winebus.sys: Return success from IRP_MN_QUERY_CAPABILITIES.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-12 14:41:28 +01:00
Zebediah Figura eaf2d6224c winebus.sys: Fix the definition of ABS_TO_HID_MAP.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-02 10:01:01 +01:00
Alex Henrie 3e8b27fef3 winebus: Remove redundant preprocessor check for libsdl2.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-29 21:18:53 +01:00
Dean M Greer e4fbae832c configure: Don't prepend folder name for SDL.h.
This fixes pkgconfig SDL2 detection when SDL2 is installed in a non-standard location.

Signed-off-by: Dean M Greer <gcenx83@gmail.com>
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-02 21:47:41 +01:00
Hans Leidekker 3a007a95e8 winebus.sys: Support setting SDL controller mapping through environment variable.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50154
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-24 20:20:27 +01:00
Hans Leidekker 6ce03d9313 winebus.sys: Fix registry access rights for SDL controller mapping.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48545
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-24 20:20:24 +01:00
Brendan Shanks 9c0c0e2b57 winebus.sys: Open IOHID devices individually to fix macOS Catalina and Big Sur.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50153
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-24 16:53:52 +01:00
Alexandre Julliard 4650dff5c4 winebus.sys: Move winebus.inf into the module resources.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-11 11:04:06 +01:00
Francois Gouget 335656e433 winebus.sys: Fix the spelling of HID_USAGE_SIMULATION_ACCELERATOR.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-18 12:16:36 +02:00
Alexandre Julliard 3760b7a9f8 winebus.sys: Use standard dlopen() instead of the libwine wrappers.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-07 14:26:20 +02:00
Zebediah Figura 602f20826d winebus.sys: Use public HID_USAGE_* constants.
Fix a typo in the process (HID_USAGE_DIGITIZER_Y_TILT is 0x3E, not 0x3F).

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-17 10:51:44 +01:00
Zebediah Figura da7d60bf97 winebus.sys: Fix reporting axis values for joysticks.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-09 22:16:30 +01:00
Michael Cronenworth 388348ddbf winebus: Global variable compatibility update for gcc 10.
Signed-off-by: Michael Cronenworth <mike@cchtml.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-24 18:19:06 +01:00
Andrew Eikum 6cb3d0fb37 winebus.sys: Don't return too early if SDL initialization succeeds.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-21 20:56:05 +01:00
Piotr Caban c3bfc1b726 winebus: Fix DEVICE_RELATIONS content on device removal.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-12 22:05:58 +01:00
Piotr Caban cc395391ed winebus: Reference PDOs added to DEVICE_RELATIONS structure.
Fixes crash caused by 81cda52d15.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-12 22:05:58 +01:00
Zebediah Figura c074966b9d winebus.sys: Stop creating a setupapi device.
ntoskrnl.exe handles this now.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-07 14:12:55 +01:00
Zebediah Figura 81cda52d15 ntoskrnl.exe: BusRelations is also used when devices are removed.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-07 14:12:53 +01:00
Zebediah Figura ca683dcaad ntoskrnl.exe: IoInvalidateDeviceRelations() receives the parent PDO.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-07 14:12:51 +01:00
Zebediah Figura a60a014dc4 winebus.sys: Initialize and teardown the HID backends while the bus FDO is still extant.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-07 14:12:46 +01:00
Zebediah Figura cba5674d60 winebus.sys: Implement AddDevice().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-07 14:12:39 +01:00
Piotr Caban 5e8eb5f4c5 winebus.sys: Make device_id string more similar to native.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-03 00:46:29 +02:00
Piotr Caban 9d5c801d35 winebus.sys: Stop SDL deviceloop_thread to avoid crash on driver unload.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-27 14:50:41 +02:00
Piotr Caban 485aed9f1c winebus.sys: Don't do anything in iohid_driver_unload if iohid was not initialized.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-27 14:50:35 +02:00
Piotr Caban ef59d2d11f winebus.sys: Don't do anything in udev_driver_unload if udev was not initialized.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-27 14:50:31 +02:00
Rémi Bernon f36e9e3a2c winebus.sys: Report the native product string for some Xbox gamepads.
Some games are checking the hid product string of connected gamepads in
order to decide whether or not to activate rumble.

Wine usually delegates these queries to the backend driver, but they
don't always report the same product strings as on Windows. This will
allow to override backend strings with the actual strings as reported
by native drivers.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-20 12:50:10 +02:00
Rémi Bernon 3d2f43a1da winebus.sys: Use the SDL joystick index as device id instead of instance id.
Some games are using the HID device id as the gamepad index for xinput
API. When hotplugging devices, SDL increases its instance id and it
doesn't match anymore with xinput gamepad numbers.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-20 12:50:07 +02:00
Andrew Eikum e83f427a65 winebus.sys: Fix build without Linux event support.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-18 23:04:26 +02:00
Piotr Caban 4b3437907b winebus.sys: Stop device report threads to avoid crash on driver unload.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-17 16:50:44 +02:00
Piotr Caban 90fa9967bc winebus.sys: Stop deviceloop_thread to avoid crash on driver unload.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-17 16:50:44 +02:00
Andrew Eikum 439b80e4c4 winebus.sys: Don't WARN about backends we didn't build.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-11 17:03:04 +02:00
Andrew Eikum d5fb7383d0 winebus.sys: Report device revision number for hidraw, too.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-12 16:15:56 +02:00
Zebediah Figura 9c6ea01935 winebus.sys: Create a stub mouse device.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-04 21:14:53 +02:00
Alistair Leslie-Hughes 90a1e5d943 winebus.sys: Increase buffer size to match max length available.
The current buffer is 1024, however the ioctl call can handle
a max length of 8191.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47013
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-28 10:57:55 +02:00
Andrew Eikum f8a04c7f2e winebus.sys: Close SDL handles when a device is removed.
This fixes opening SDL haptic handles after a device is removed and
re-added.

Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-11 18:28:55 +02:00
Zebediah Figura 6c6aeea8a8 ntoskrnl.exe: Correctly handle instance IDs.
The instance ID is only the third part of the "A\B\C" form, and must be
combined with the device ID to form the whole name for setupapi (the "device
instance ID").

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-05 16:46:20 +02:00
Zebediah Figura eebb1d9931 winebus.sys: Allocate IRP return buffers from paged pool.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-05 16:44:49 +02:00
Zebediah Figura e83fd91d5f winebus.sys: Just report the bus ID when enumerating compatible IDs.
It's the only one we actually match against.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-04 23:05:46 +02:00
Zebediah Figura f39adfe914 winebus.sys: Make the device and instance IDs consistent.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-04 23:05:40 +02:00
Zebediah Figura 9af088243c winebus.sys: Avoid IoCreateDriver().
This is not a documented function, and anyway we don't need separate driver
objects.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-30 21:53:26 +02:00
Zebediah Figura d525c736b9 winebus.sys: Move udev configuration values to the winebus service key.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-30 21:53:26 +02:00
Zebediah Figura 50b9456e87 winebus.sys: Use the winebus driver to create all devices.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-30 21:53:26 +02:00
Andrew Eikum f8ebb3ac37 winebus.sys: Add missing padding between hatswitch and constant.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-20 18:31:45 +02:00
Piotr Caban 40ae0e8455 winebus.sys: Restore IG_ substring in gamepads endpoint path.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47209
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-16 20:54:23 +02:00
Andrew Eikum 042e062569 winebus.sys: Fix report length calculation.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47188
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-15 23:04:49 +02:00
Piotr Caban 8cd6d61639 winebus.sys: Correctly set HID device input number in device endpoint path.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-15 19:24:43 +02:00
Piotr Caban 6a0005747c winebus.sys: Fix typo in endpoint name.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-15 19:24:40 +02:00
Alexandre Julliard c0604a9341 winebus.sys: Avoid ssize_t.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-14 20:39:22 +02:00
Andrew Eikum 5ff326f801 winebus.sys: Pack hatswitch values into button bytes.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-07 15:20:18 -05:00
Andrew Eikum ba79a14369 winebus.sys: Report SDL controller buttons in the right order.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-07 15:20:11 -05:00
Andrew Eikum 564e7b4db9 winebus.sys: Report SDL controller dpad as hatswitch.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-07 15:20:02 -05:00
Andrew Eikum 2239aae97f winebus.sys: Report hatswitch values correctly.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-07 15:19:50 -05:00
Andrew Eikum d0c5a5e89f winebus.sys: Order axes before buttons.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-07 15:19:40 -05:00
Andrew Eikum ec7bdf6154 winebus.sys: Fix ball value reporting.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-06 13:19:33 -05:00
Andrew Eikum e529387f67 winebus.sys: Remove some magic numbers.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-06 13:19:33 -05:00
Andrew Eikum 277822b384 winebus.sys: Fix udev report descriptor length.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-06 13:19:33 -05:00
Andrew Eikum 3039eeb72e winebus.sys: Fix some report descriptors.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-06 13:19:33 -05:00
Piotr Caban 9267973835 winebus.sys: Add more traces on hidraw communication errors.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-03 16:31:44 +02:00
Aric Stewart 1528d1685a winebus.sys: Allow mapping of SDL controllers.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-09 15:46:03 +02:00
Zebediah Figura cc3820ca99 winebus.sys: Retrieve hidraw device strings from the parent USB device.
This partially reverts 164517fe57. The
manufacturer, product, and serial string attributes are not exposed by the
HID device on Linux, but by its parent USB device.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46711
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-01 21:54:31 +02:00
Zhiyi Zhang f4d5b357d3 winebus.sys: Handle create existent device failure.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-21 19:32:38 +01:00
Aric Stewart 9491a5e58a winebus.sys: Add UID to IOHID devices.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-21 08:23:39 +01:00
Alexandre Julliard 3d7471570e makefiles: Pass --subsystem to the linker also.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-19 15:28:48 +01:00
Michael Stefaniuc d64de0e2c1 winebus.sys: Remove useless casts to self.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-04 12:27:02 +01:00
Zebediah Figura bd9e130ee5 winebus.sys: Translate SDL controller axes to unsigned 32-bit values.
INSIDE parses the HID report directly and assumes that the logical
minimum value is 0.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-06 19:57:27 +01:00
Kai Krakow 383c3128bb winebus.sys: Re-add missing Xbox controller PIDs.
These were introduced in commit 1333206 and have gone missing in one of
the previous cleanup commits.

Signed-off-by: Kai Krakow <kai@kaishome.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-14 11:15:38 +01:00
Andrew Eikum ccb06c6b6f winebus: Don't override real VID/PID for controllers.
It's unclear what this was useful for, possibly native xinput requires
it. Our built-in xinput is good enough now, though, so let's keep the
real VID/PID.

Signed-off-by: Brendan McGrath <brendan@redmandi.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-23 20:17:44 +01:00
Brendan McGrath 9736a36fe6 winebus.sys: Use JoystickNumButtons for button_count.
Signed-off-by: Brendan McGrath <brendan@redmandi.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-20 18:08:08 +01:00
Francois Gouget a0536cab03 winebus.sys: Avoid an unneeded strlen() call.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-23 16:34:52 +02:00
Francois Gouget 90de9129cc winebus.sys: Add a trailing '\n' to a TRACE().
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-27 10:09:25 +02:00
Aric Stewart 5815c7b520 winebus.sys: Implement IRP_MN_QUERY_DEVICE_RELATIONS.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-13 10:39:02 +02:00
Aric Stewart db6c5b59b6 winebus.sys: Improve unloading the winebus driver.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-13 10:39:00 +02:00
Francois Gouget a53591ad3c winebus.sys: Avoid calling strdup().
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-23 20:01:56 +02:00
Kai Krakow d744f367d2 winebus.sys: Do not print HID report read errors.
Device reports may come in faster than our consumers could possibly read
them, this is especially true for multi-axis events: When you move a
stick across its range, it will always generate at least two events, one
for the x axis, and one for the y axis. This is not really an error
situation, so let's just discard the error message.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=43125
Signed-off-by: Kai Krakow <kai@kaishome.de>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-15 21:08:21 +02:00
Michael Stefaniuc d3e86f6652 winebus.sys: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-14 10:16:02 +02:00
Józef Kucia 142169960a winebus: Print SDL error message when SDL cannot be initialized.
SDL_Init(SDL_INIT_HAPTIC) fails if SDL is built without haptic support.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-11 17:20:41 +02:00
Aric Stewart 5631402651 winebus: Properly identify SDL joysticks index when hot-plugged.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-08 20:29:54 +02:00
Francois Gouget 76d6151b73 winebus.sys: Fix a typo in a comment.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-18 10:13:12 +02:00
Kai Krakow 1333206e08 winebus.sys: Map more SDL Xbox controllers.
These device ids are usually returned by newer firmware versions.
Especially, the Android mode of the controller (when paired by
bluetooth to a Linux system) changes the input mapping of the
controller. The current kernel drivers do not correct this, xpadneo[1]
is needed as the driver to get correct mapping.

[1]: https://github.com/atar-axis/xpadneo

Signed-off-by: Kai Krakow <kai@kaishome.de>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-13 13:24:16 +01:00
Alexandre Julliard f1c344bc62 winebus.sys: Define SYN_DROPPED if missing.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-26 16:40:23 +01:00
Aric Stewart 164517fe57 winebus.sys: Do not depend on USB devices.
Allows for bluetooth devices to work as well
Based on work and testing by Michael Menegakis <arxeio@gmail.com>.

Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-21 20:07:42 +01:00
Aric Stewart 249db7e49e winebus.sys: Implement SDL Haptic for controller vibration.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-21 20:07:41 +01:00
Aric Stewart 2505d67cbc winebus.sys: Map SDL game controllers if requested.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-21 20:07:41 +01:00
Aric Stewart 67ce6235e8 winebus.sys: Process SDL device reports.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-21 20:07:41 +01:00
Aric Stewart eda33b4b61 winebus.sys: Build SDL device report.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-21 20:07:41 +01:00
Aric Stewart 752de1b566 winebus.sys: Support adding and removing SDL devices.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-21 20:07:41 +01:00
Aric Stewart f8c0228dc2 winebus.sys: Add SDL gamepad and joystick driver.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-21 18:51:58 +01:00
Aric Stewart e48296c2f0 winebus.sys: Be more specific as to what we offer as IG_ enumerated devices.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-15 08:03:00 +01:00
Aric Stewart 52cafe8713 winebus.sys: Process device reports for linux event devices.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-07 19:38:29 +01:00
Aric Stewart f6cb73856d winebus.sys: Implement get_string for linux event devices.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-07 19:38:29 +01:00
Aric Stewart 890107e313 winebus.sys: Build device reports for linux event devices.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-07 19:38:29 +01:00
Aric Stewart 41d46f7461 winebus.sys: Handle linux input event device via udev.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-07 19:38:29 +01:00
André Hentschel 1afcfc77d3 winebus.sys: Fix compilation on systems that don't support nameless structs.
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-26 10:38:02 +01:00
Samuele Guerrini b510dccecb winebus.sys: Buffer length check fix.
Signed-off-by: Samuele Guerrini <sguerrini97@gmail.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-17 21:48:26 +01:00
Aric Stewart ea9df98c69 winebus.sys: Handle older kernel headers lacking feature ioctls.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-12-07 14:45:17 +01:00
Aric Stewart d0039106de hidclass: All reports read or written to user space lead with a reportId.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-12-01 15:28:23 +01:00
Aric Stewart 11a5964d3a winebus.sys: IOCTL_HID_GET_FEATURE for iohid.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-11-08 17:50:34 +01:00
Aric Stewart 45a7f9f047 winebus.sys: IOCTL_HID_SET_OUTPUTREPORT for iohid.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-11-08 17:50:31 +01:00
Aric Stewart 2b568a1148 winebus.sys: Reports for iohid.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-11-08 17:50:28 +01:00
Aric Stewart 0d96ffbca9 winebus.sys: IOCTL_HID_GET_STRING for iohid.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-11-08 17:50:25 +01:00
Aric Stewart 7221693538 winebus.sys: IOCTL_HID_GET_DEVICE_DESCRIPTOR for iohid.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-11-08 17:50:20 +01:00
Aric Stewart 3b132cb9ec winebus.sys: Implement removing IOHID devices.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-11-08 17:50:16 +01:00
Aric Stewart 8284be37fc winebus.sys: Add OS/X IOHID bus.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-11-08 17:50:10 +01:00
Aric Stewart 72dd8bafcc winebus.sys: Implement IOCTL_HID_GET(SET)_FEATURE for hidraw.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-11-02 15:23:45 +01:00
Aric Stewart 253204570e winebus.sys: Implement IOCTL_HID_SET_OUTPUT_REPORT for hidraw.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-27 18:05:16 +02:00
Aric Stewart 1a81022f4e winebus.sys: Handle device reports for hidraw devices.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-26 18:39:27 +02:00
Aric Stewart f45cec07ff winebus.sys: Implement IOCTL_HID_GET_STRING for hidraw.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-14 14:28:23 +02:00
Sebastian Lackner 66d70e38f5 winebus.sys: Add a strdupAtoW implementation.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-14 14:28:23 +02:00
Aric Stewart da819ebe02 winebus.sys: Implement IOCTL_HID_GET_REPORT_DESCRIPTOR for hidraw.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-11 17:04:12 +02:00
Aric Stewart eac738b95f winebus.sys: Implement IOCTL_HID_GET_DEVICE_DESCRIPTOR for hidraw.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-11 17:04:12 +02:00
Aric Stewart ea95a47bb5 winebus.sys: Implement IOCTL_HID_GET_DEVICE_ATTRIBUTES for hid devices.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-06 21:27:45 +02:00
Aric Stewart 9f8758b19d winebus.sys: Add implementation for device removal.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-03 20:42:59 +02:00
Aric Stewart c29c3d1fad winebus.sys: Watch for hid raw device addition and removal.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-03 20:42:59 +02:00
Sebastian Lackner 35d9d5f40a winebus.sys: Spawn a device loop thread and add synchronization.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-03 20:42:51 +02:00
Aric Stewart 903e0032ff winebus.sys: Implement IRP_MN_QUERY_ID.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-14 22:31:10 +09:00
Aric Stewart 159c2eb16e winebus.sys: Create bus devices.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-14 22:29:28 +09:00
Aric Stewart 637738f472 winebus.sys: Implement udev device enumeration.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-14 00:02:05 +09:00
Aric Stewart 6d3e5f8441 winebus.sys: Add initial udev stub driver.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-08 23:15:02 +09:00
Aric Stewart f839f1f8aa winebus.sys: Add stub driver.
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-06 11:34:47 +09:00