Blob Blame History Raw
diff --git a/plugins/unifying/lu-device-runtime.c b/plugins/unifying/lu-device-runtime.c
index 32d0c56..0e1a562 100644
--- a/plugins/unifying/lu-device-runtime.c
+++ b/plugins/unifying/lu-device-runtime.c
@@ -111,6 +111,12 @@ lu_device_runtime_open (LuDevice *device, GError **error)
 	memset (config, 0x00, sizeof (config));
 	for (guint i = 0x01; i < 0x05; i++) {
 		g_autoptr(LuDeviceHidppMsg) msg = lu_device_hidpp_new ();
+
+		/* workaround a bug in the 12.01 firmware, which fails with
+		 * INVALID_VALUE when reading MCU1_HW_VERSION */
+		if (version_bl_major == 0x01 && i == 0x03)
+			continue;
+
 		msg->report_id = HIDPP_REPORT_ID_SHORT;
 		msg->device_id = lu_device_get_hidpp_id (device);
 		msg->sub_id = HIDPP_SUBID_GET_REGISTER;
@@ -156,7 +162,7 @@ lu_device_runtime_open (LuDevice *device, GError **error)
 	lu_device_add_flag (device, LU_DEVICE_FLAG_CAN_FLASH);
 
 	/* only the bootloader can do the update */
-	lu_device_set_product (device, "Unifying Reciever");
+	lu_device_set_product (device, "Unifying Receiver");
 
 	return TRUE;
 }
diff --git a/plugins/unifying/lu-device.c b/plugins/unifying/lu-device.c
index 4fd67a4..4e53633 100644
--- a/plugins/unifying/lu-device.c
+++ b/plugins/unifying/lu-device.c
@@ -288,13 +288,13 @@ lu_device_hidpp_receive (LuDevice *device,
 		}
 	}
 
-	/* check length */
+	/* check long enough, but allow returning oversize packets */
 	lu_device_hidpp_dump (device, "device->host", (guint8 *) msg, read_size);
-	if (lu_device_hidpp_msg_length (msg) != read_size) {
+	if (read_size < lu_device_hidpp_msg_length (msg)) {
 		g_set_error (error,
 			     G_IO_ERROR,
 			     G_IO_ERROR_FAILED,
-			     "not expected message length, "
+			     "message length too small, "
 			     "got %" G_GSIZE_FORMAT " expected %" G_GSIZE_FORMAT,
 			     read_size, lu_device_hidpp_msg_length (msg));
 		return FALSE;
@@ -746,7 +746,7 @@ lu_device_open (LuDevice *device, GError **error)
 	/* subclassed */
 	if (klass->open != NULL) {
 		if (!klass->open (device, error)) {
-			g_usb_device_close (priv->usb_device, NULL);
+			lu_device_close (device, NULL);
 			return FALSE;
 		}
 	}
@@ -754,7 +754,7 @@ lu_device_open (LuDevice *device, GError **error)
 
 	/* subclassed */
 	if (!lu_device_probe (device, error)) {
-		g_usb_device_close (priv->usb_device, NULL);
+		lu_device_close (device, NULL);
 		return FALSE;
 	}
 
@@ -788,7 +788,7 @@ lu_device_poll (LuDevice *device, GError **error)
 		return FALSE;
 	}
 
-	/* unifying reciever notification */
+	/* unifying receiver notification */
 	if (msg->report_id == HIDPP_REPORT_ID_SHORT) {
 		switch (msg->sub_id) {
 		case HIDPP_SUBID_DEVICE_CONNECTION: