winebus.sys: Drop the hid_report channel.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-10-27 10:39:11 +02:00 committed by Alexandre Julliard
parent b7e2388491
commit 3ad0c002da
3 changed files with 14 additions and 19 deletions

View File

@ -59,8 +59,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(plugplay);
#ifdef SONAME_LIBSDL2
WINE_DECLARE_DEBUG_CHANNEL(hid_report);
static pthread_mutex_t sdl_cs = PTHREAD_MUTEX_INITIALIZER;
static struct sdl_bus_options options;
@ -847,7 +845,7 @@ static void process_device_event(SDL_Event *event)
struct sdl_device *impl;
SDL_JoystickID id;
TRACE_(hid_report)("Received action %x\n", event->type);
TRACE("Received action %x\n", event->type);
pthread_mutex_lock(&sdl_cs);

View File

@ -101,8 +101,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(plugplay);
#ifdef HAVE_UDEV
WINE_DECLARE_DEBUG_CHANNEL(hid_report);
static pthread_mutex_t udev_cs = PTHREAD_MUTEX_INITIALIZER;
static struct udev *udev_context = NULL;
@ -344,9 +342,9 @@ static void hidraw_device_read_report(struct unix_device *iface)
int size = read(impl->base.device_fd, report_buffer, sizeof(report_buffer));
if (size == -1)
TRACE_(hid_report)("Read failed. Likely an unplugged device %d %s\n", errno, strerror(errno));
TRACE("Read failed. Likely an unplugged device %d %s\n", errno, strerror(errno));
else if (size == 0)
TRACE_(hid_report)("Failed to read report\n");
TRACE("Failed to read report\n");
else
{
/* As described in the Linux kernel driver, when connected over bluetooth, DS4 controllers
@ -380,7 +378,7 @@ static void hidraw_device_set_output_report(struct unix_device *iface, HID_XFER_
if ((buffer[0] = packet->reportId))
count = write(impl->base.device_fd, packet->reportBuffer, length);
else if (length > sizeof(buffer) - 1)
ERR_(hid_report)("id %d length %u >= 8192, cannot write\n", packet->reportId, length);
ERR("id %d length %u >= 8192, cannot write\n", packet->reportId, length);
else
{
memcpy(buffer + 1, packet->reportBuffer, length);
@ -394,7 +392,7 @@ static void hidraw_device_set_output_report(struct unix_device *iface, HID_XFER_
}
else
{
ERR_(hid_report)("id %d write failed error: %d %s\n", packet->reportId, errno, strerror(errno));
ERR("id %d write failed error: %d %s\n", packet->reportId, errno, strerror(errno));
io->Information = 0;
io->Status = STATUS_UNSUCCESSFUL;
}
@ -412,7 +410,7 @@ static void hidraw_device_get_feature_report(struct unix_device *iface, HID_XFER
if ((buffer[0] = packet->reportId) && length <= 0x1fff)
count = ioctl(impl->base.device_fd, HIDIOCGFEATURE(length), packet->reportBuffer);
else if (length > sizeof(buffer) - 1)
ERR_(hid_report)("id %d length %u >= 8192, cannot read\n", packet->reportId, length);
ERR("id %d length %u >= 8192, cannot read\n", packet->reportId, length);
else
{
count = ioctl(impl->base.device_fd, HIDIOCGFEATURE(length + 1), buffer);
@ -426,7 +424,7 @@ static void hidraw_device_get_feature_report(struct unix_device *iface, HID_XFER
}
else
{
ERR_(hid_report)("id %d read failed, error: %d %s\n", packet->reportId, errno, strerror(errno));
ERR("id %d read failed, error: %d %s\n", packet->reportId, errno, strerror(errno));
io->Information = 0;
io->Status = STATUS_UNSUCCESSFUL;
}
@ -448,7 +446,7 @@ static void hidraw_device_set_feature_report(struct unix_device *iface, HID_XFER
if ((buffer[0] = packet->reportId) && length <= 0x1fff)
count = ioctl(impl->base.device_fd, HIDIOCSFEATURE(length), packet->reportBuffer);
else if (length > sizeof(buffer) - 1)
ERR_(hid_report)("id %d length %u >= 8192, cannot write\n", packet->reportId, length);
ERR("id %d length %u >= 8192, cannot write\n", packet->reportId, length);
else
{
memcpy(buffer + 1, packet->reportBuffer, length);
@ -462,7 +460,7 @@ static void hidraw_device_set_feature_report(struct unix_device *iface, HID_XFER
}
else
{
ERR_(hid_report)("id %d write failed, error: %d %s\n", packet->reportId, errno, strerror(errno));
ERR("id %d write failed, error: %d %s\n", packet->reportId, errno, strerror(errno));
io->Information = 0;
io->Status = STATUS_UNSUCCESSFUL;
}
@ -802,9 +800,9 @@ static void lnxev_device_read_report(struct unix_device *iface)
size = read(impl->base.device_fd, &ie, sizeof(ie));
if (size == -1)
TRACE_(hid_report)("Read failed. Likely an unplugged device\n");
TRACE("Read failed. Likely an unplugged device\n");
else if (size == 0)
TRACE_(hid_report)("Failed to read report\n");
TRACE("Failed to read report\n");
else if (set_report_from_event(iface, &ie))
bus_event_queue_input_report(&event_queue, iface, state->report_buf, state->report_len);
}

View File

@ -41,7 +41,6 @@
#include "unixlib.h"
WINE_DEFAULT_DEBUG_CHANNEL(plugplay);
WINE_DECLARE_DEBUG_CHANNEL(hid_report);
static DRIVER_OBJECT *driver_obj;
@ -1045,21 +1044,21 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
case IOCTL_HID_WRITE_REPORT:
{
HID_XFER_PACKET *packet = (HID_XFER_PACKET*)(irp->UserBuffer);
TRACE_(hid_report)("IOCTL_HID_WRITE_REPORT / IOCTL_HID_SET_OUTPUT_REPORT\n");
TRACE("IOCTL_HID_WRITE_REPORT / IOCTL_HID_SET_OUTPUT_REPORT\n");
unix_device_set_output_report(device, packet, &irp->IoStatus);
break;
}
case IOCTL_HID_GET_FEATURE:
{
HID_XFER_PACKET *packet = (HID_XFER_PACKET*)(irp->UserBuffer);
TRACE_(hid_report)("IOCTL_HID_GET_FEATURE\n");
TRACE("IOCTL_HID_GET_FEATURE\n");
unix_device_get_feature_report(device, packet, &irp->IoStatus);
break;
}
case IOCTL_HID_SET_FEATURE:
{
HID_XFER_PACKET *packet = (HID_XFER_PACKET*)(irp->UserBuffer);
TRACE_(hid_report)("IOCTL_HID_SET_FEATURE\n");
TRACE("IOCTL_HID_SET_FEATURE\n");
unix_device_set_feature_report(device, packet, &irp->IoStatus);
break;
}