From 9f44a120a76172c2caa8cce8158c4c53345c1bcd Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Thu, 6 Jan 2022 02:32:10 +0300 Subject: [PATCH] bump bcdDevice only for rndis --- kvmd/apps/otg/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kvmd/apps/otg/__init__.py b/kvmd/apps/otg/__init__.py index f47f4ea8..55076ff9 100644 --- a/kvmd/apps/otg/__init__.py +++ b/kvmd/apps/otg/__init__.py @@ -188,7 +188,10 @@ def _cmd_start(config: Section) -> None: # pylint: disable=too-many-statements # bcdDevaev should be incremented any time there are breaking changes # to this script so that the host OS sees it as a new device # and re-enumerates everything rather than relying on cached values. - _write(join(gadget_path, "bcdDevice"), "0x0101") + if config.otg.devices.ethernet.enabled and config.otg.devices.ethernet.driver == "rndis": + _write(join(gadget_path, "bcdDevice"), "0x0101") + else: + _write(join(gadget_path, "bcdDevice"), "0x0100") _write(join(gadget_path, "bcdUSB"), f"0x{config.otg.usb_version:04X}") lang_path = join(gadget_path, "strings/0x409")