summaryrefslogtreecommitdiff
path: root/kvmd/apps
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
parent902841e8df6b7a9d56c7703e8c800bbafc0a83ad (diff)
option to enable remote wakeup
Diffstat (limited to 'kvmd/apps')
-rw-r--r--kvmd/apps/__init__.py1
-rw-r--r--kvmd/apps/otg/__init__.py7
2 files changed, 5 insertions, 3 deletions
diff --git a/kvmd/apps/__init__.py b/kvmd/apps/__init__.py
index 9da4c403..01f524fb 100644
--- a/kvmd/apps/__init__.py
+++ b/kvmd/apps/__init__.py
@@ -478,6 +478,7 @@ def _get_config_scheme() -> Dict:
"manufacturer": Option("Pi-KVM"),
"product": Option("Composite KVM Device"),
"serial": Option("CAFEBABE"),
+ "remote_wakeup": Option(False, type=valid_bool),
"gadget": Option("kvmd", type=valid_otg_gadget),
"config": Option("Pi-KVM device", type=valid_stripped_string_not_empty),
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 =====")