[PATCH 1/2] winebus.sys: Drop the hid_report channel.

Rémi Bernon rbernon at codeweavers.com
Wed Oct 27 03:39:11 CDT 2021


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---

Maybe we could merge hid with plugplay too, but it may end up being
a bit too much verbose, I'm not completely sure yet.

 dlls/winebus.sys/bus_sdl.c  |  4 +---
 dlls/winebus.sys/bus_udev.c | 22 ++++++++++------------
 dlls/winebus.sys/main.c     |  7 +++----
 3 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c
index fe3a960649c..d172d5382fd 100644
--- a/dlls/winebus.sys/bus_sdl.c
+++ b/dlls/winebus.sys/bus_sdl.c
@@ -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);
 
diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c
index 4c00fe6ad39..780af549916 100644
--- a/dlls/winebus.sys/bus_udev.c
+++ b/dlls/winebus.sys/bus_udev.c
@@ -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);
 }
diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c
index 433963b44d4..1353df7d000 100644
--- a/dlls/winebus.sys/main.c
+++ b/dlls/winebus.sys/main.c
@@ -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;
         }
-- 
2.33.0




More information about the wine-devel mailing list