summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPing Cheng <ping.cheng@wacom.com>2022-07-19 14:01:35 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2022-07-25 14:52:43 +1000
commit18ed7697e3049943e3bfef46af6c647b2d93ed8f (patch)
tree266dfe3d7560334abd868221e1a54f5f789fcae1
parentad11a9da15d4cbef62f4ec1c19a6279ef21710f3 (diff)
downloadxf86-input-wacom-18ed7697e3049943e3bfef46af6c647b2d93ed8f.tar.gz
Don't report error when waiting for serial number
For some devices, such as AES pens, serial number is 0 when tool comes into proximity. That means serial number was not ready. It is a known state. All we needed is to wait for the non-zero serial number. Don't report it through W_ERROR. Signed-off-by: Ping Cheng <ping.cheng@wacom.com>
-rw-r--r--src/wcmUSB.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 99c199b..b7b3d06 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -1020,11 +1020,18 @@ static void usbParseMscEvent(WacomDevicePtr priv,
}
else
{
- /* we don't report serial numbers for some tools but we never report
- * a serial number with a value of 0 - if that happens drop the
- * whole frame */
- wcmLogSafe(priv, W_ERROR, "%s: usbParse: Ignoring event from invalid serial 0\n",
- priv->name);
+ /* If this is the first time to set wcmLastToolSerial and serial
+ * number is 0, it means the value is not ready. Just wait for a
+ * non-zero one. However, if we are in the middle of an established
+ * established reporting process, serial number should never be 0.
+ * Report the error and show the serial number that we expect.
+ *
+ * In both cases, we drop the whole frame.
+ */
+ if (private->wcmLastToolSerial)
+ wcmLogSafe(priv, W_ERROR,
+ "%s: usbParse: Ignoring packet for serial=0. It should be %ud \n",
+ priv->name, private->wcmLastToolSerial);
usbResetEventCounter(private);
}
}