summaryrefslogtreecommitdiff
path: root/kvmd/usb.py
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-03-31 16:17:52 +0300
committerMaxim Devaev <[email protected]>2022-03-31 16:17:52 +0300
commitb775239d7265a1bcbb6e32f06546e53d389802d6 (patch)
tree98c7112425e79e0075c5e3859567b085bf9bab17 /kvmd/usb.py
parentab09f88d80ac67c76f012b2fcb853f2d69ab6b7d (diff)
refactoring
Diffstat (limited to 'kvmd/usb.py')
-rw-r--r--kvmd/usb.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/kvmd/usb.py b/kvmd/usb.py
index 4242b1cb..4a5a130d 100644
--- a/kvmd/usb.py
+++ b/kvmd/usb.py
@@ -36,3 +36,13 @@ def find_udc(udc: str) -> str:
elif udc not in candidates:
raise RuntimeError(f"Can't find selected UDC: {udc}")
return udc # fe980000.usb
+
+
+G_UDC = "UDC"
+G_FUNCTIONS = "functions"
+G_PROFILE_NAME = "c.1"
+G_PROFILE = f"configs/{G_PROFILE_NAME}"
+
+
+def get_gadget_path(gadget: str, *parts: str) -> str:
+ return os.path.join(f"{env.SYSFS_PREFIX}/sys/kernel/config/usb_gadget", gadget, *parts)