summaryrefslogtreecommitdiff
path: root/kvmd/apps/otg
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2021-08-20 21:12:44 +0300
committerMaxim Devaev <[email protected]>2021-08-20 21:12:44 +0300
commit1e7aac27b21521b33af123e5a85139f1ff55d289 (patch)
tree1d4334a291e76a664028b4a9a925d46c074f27ed /kvmd/apps/otg
parent902841e8df6b7a9d56c7703e8c800bbafc0a83ad (diff)
option to enable remote wakeup
Diffstat (limited to 'kvmd/apps/otg')
-rw-r--r--kvmd/apps/otg/__init__.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/kvmd/apps/otg/__init__.py b/kvmd/apps/otg/__init__.py
index 43426d51..f10543c1 100644
--- a/kvmd/apps/otg/__init__.py
+++ b/kvmd/apps/otg/__init__.py
@@ -166,7 +166,7 @@ def _create_msd(
_symlink(func_path, join(config_path, f"mass_storage.usb{instance}"))
-def _cmd_start(config: Section) -> None:
+def _cmd_start(config: Section) -> None: # pylint: disable=too-many-statements
# https://www.kernel.org/doc/Documentation/usb/gadget_configfs.txt
# https://www.isticktoit.net/?p=1383
@@ -196,8 +196,9 @@ def _cmd_start(config: Section) -> None:
_mkdir(join(config_path, "strings/0x409"))
_write(join(config_path, "strings/0x409/configuration"), f"Config 1: {config.otg.config}")
_write(join(config_path, "MaxPower"), "250")
- # TODO: Add this and MaxPower=100 to enable Remote Wakeup on Bus Powered
- # _write(join(config_path, "bmAttributes"), "0xA0")
+ if config.otg.remote_wakeup:
+ # XXX: Should we use MaxPower=100 with Remote Wakeup?
+ _write(join(config_path, "bmAttributes"), "0xA0")
if config.otg.devices.serial.enabled:
logger.info("===== Required Serial =====")