Commit graph

330 commits

Author SHA1 Message Date
Vicki Pfau
9ec6fc8852 manager: Clean up Result<_, zbus::fdo::Error> into zbus::fdo::Result<_> 2024-04-04 18:08:21 -07:00
Vicki Pfau
86515aceaf Run cargo fmt 2024-04-04 18:08:21 -07:00
Vicki Pfau
b0628fc7b9 Add support to get/set WiFi back-end
This change implements the ability to get and set the WiFi back-end,
by leveraging a new script created for that purpose.

The idea is to be able to use 'wpa_supplicant' (which is the default
back-end in NetworkManager upstream) when 'iwd' (the default in
SteamOS) does not work for some reason.

This change interacts with another feature of steamos-manager, which
is to set debug mode for WiFi.  Handling debug mode complicates things
substantially because those methods write config for 'iwd' and restart
the daemons/systemd units, with many interdependencies.

Instead of trying to implement all at once and attempt feature-parity
between back-ends on this aspect from the start, as a first step the
operations are just declared incompatible.  As a result, if
WifiDebugMode=on the back-end cannot be changed, and conversely the
WifiDebugMode cannot be turned on when the back-end is
'wpa_supplicant'.

Co-authored-by: Manuel A. Fernandez Montecelo <mafm@igalia.com>
2024-04-04 18:08:21 -07:00
Vicki Pfau
452690adee Kill UnsupportedFeature 2024-04-04 18:08:21 -07:00
Vicki Pfau
ffebee0930 manager: Start writing tests 2024-04-04 18:08:21 -07:00
Vicki Pfau
aaaf8b8bc4 hardware: Fix style 2024-04-04 18:08:21 -07:00
Vicki Pfau
8ae6c98554 process: Make API less fiddly 2024-04-04 18:08:13 -07:00
Vicki Pfau
fd14514d6c manager: Implement format_device 2024-04-04 18:08:13 -07:00
Vicki Pfau
69e6477053 manager: Implement new API 2024-04-04 18:08:13 -07:00
Vicki Pfau
6a5e693e5b manager: Pass an empty slice instead of a slice with a single empty string 2024-04-04 18:01:38 -07:00
Vicki Pfau
a5dfde2b17 Clean up anyhow usage 2024-04-04 17:58:16 -07:00
Vicki Pfau
5f2cebc58b Merge branch 'endrift/cleanup' into 'master'
More cleanup, module separation

See merge request holo/steamos-manager!14
2024-04-04 01:50:15 +00:00
Vicki Pfau
27493c647d power: Redo hwmon handling 2024-04-02 18:20:09 -07:00
Vicki Pfau
6e3ac42e8e power: Split out from manager 2024-04-02 18:20:09 -07:00
Vicki Pfau
309f2acc1b wifi: Split out from manager 2024-04-02 18:20:09 -07:00
Vicki Pfau
0d90859841 process: Split out from manager 2024-04-02 18:20:09 -07:00
Vicki Pfau
128c5ee36a hardware: Split HardwareVariant name parsing out from file reading 2024-04-02 18:20:09 -07:00
Vicki Pfau
3565886d3f Turn galileo detection into generalized model detection 2024-03-29 14:59:48 -07:00
Vicki Pfau
ebd89f4f72 manager: Just don't call start-/stop_tracing if should_trace is false 2024-03-29 14:59:48 -07:00
Vicki Pfau
de55ef31ce ds_inhibit: Remove extraineous lets 2024-03-29 14:59:34 -07:00
Andres
1dd3ff8182 Merge branch 'andresr/dbus-update' into 'master'
dbus: Simplify the dbus interface

See merge request holo/steamos-manager!10
2024-03-26 17:02:04 +00:00
Andres Rodriguez
7a2f20032e dbus: Simplify the dbus interface
Change most of our get/set methods for properties, as these
encompass both operations and additionally provide a change signal.

Additionally expose whether each of the features is supported. This
allows steam to detect when certain options should be hidden in the UI
if the feature is unsupported.

Also surface supported ranges for operations that take int params,
e.g. TDPLimit min/max values.
2024-03-26 13:00:14 -04:00
Vicki Pfau
fab64e1ff7 Replace sysbase function with passing the path to a function 2024-03-25 15:43:26 -07:00
Vicki Pfau
194a3f2c01 Merge branch 'endrift/merge' into 'master'
Merge steamos-workerd in

See merge request holo/steamos-manager!12
2024-03-25 21:52:54 +00:00
Andres
081fbfa3f1 Merge branch 'endrift/repo-cleanup' into 'master'
Repo cleanup

See merge request holo/steamos-manager!11
2024-03-23 23:12:02 +00:00
Vicki Pfau
83e9de9bcb Merge steamos-workerd in 2024-03-22 19:31:38 -07:00
Vicki Pfau
277e82b189 Use more standard filenames 2024-03-22 19:26:26 -07:00
Vicki Pfau
3c3505c311 Move license text to LICENSE file 2024-03-22 19:24:18 -07:00
Vicki Pfau
c9acd7a397 Merge branch 'endrift/refactor' into 'master'
Cleanup in preparation of steamos-workerd merge

See merge request holo/steamos-manager!9
2024-03-21 21:19:56 +00:00
Vicki Pfau
6f1f1c032c manager: Use anyhow::ensure 2024-03-20 18:25:48 -07:00
Vicki Pfau
87ef532ce4 manager: Move std::fs operations back into tokio::fs 2024-03-20 18:19:33 -07:00
Vicki Pfau
f8d390d6ff Update copyrights 2024-03-20 18:13:58 -07:00
Vicki Pfau
cdf4297f9f main: Wait on ctrl-c 2024-03-20 18:13:58 -07:00
Vicki Pfau
7e262a1d96 manager: Move paths to constants 2024-03-20 18:13:58 -07:00
Vicki Pfau
96efd91228 Clean up logging 2024-03-19 18:02:17 -07:00
Vicki Pfau
4a4b021ea5 manager: Fix typo, remove redundant comments 2024-03-19 18:02:17 -07:00
Vicki Pfau
2599d6fb20 manager: Move work functions outside of DBus interface
This enables using more idiomatic Result and ? return instead of having to
match and return false
2024-03-19 17:46:41 -07:00
Vicki Pfau
dce3ad8437 manager: Make match indent towers more idiomatic 2024-03-19 17:46:41 -07:00
Vicki Pfau
2e55bc2330 manager: Clean up non-idiomatic code 2024-03-19 17:46:41 -07:00
Vicki Pfau
cf416c8a56 manager: Unify error handling on anyhow 2024-03-19 17:41:00 -07:00
Vicki Pfau
7217b0c2b1 Run cargo fmt 2024-03-19 17:41:00 -07:00
Vicki Pfau
5afe7222ca Upgrade to zbus 4 2024-03-19 17:41:00 -07:00
Vicki Pfau
4679a071a1 Cargo.toml: Use more recommended practices 2024-03-19 16:02:03 -07:00
Jeremy Whiting
4a50b941dd wifidebug: Add some helper scripts to use for testing.
While the steam client will drive wifi debug mode for now
add some scripts that directly talk to it over dbus to enable
disable, and check the current debug modes.

Signed-off-by: Jeremy Whiting <jeremy.whiting@collabora.com>
2024-02-08 18:18:22 -07:00
Jeremy Whiting
29eb97128b Merge branch 'work/whiting/wifidebug' into 'master'
wifidebug: Add some iwd override and a way to enable/disable.

See merge request holo/steamos-manager!7
2024-02-07 23:06:37 +00:00
Jeremy Whiting
ce95a53ee8 wifidebug: Add GetWifiDebugMode to get the current wifi debug mode.
This may be useful in cases where SetWifiDebugMode has failed to
check what the current state/setting is.
Though if SetWifiDebugMode has failed we may be in weird state
so logs of steamos-manager should be checked to see what failed.

Signed-off-by: Jeremy Whiting <jpwhiting@kde.org>
2024-02-07 14:23:31 -07:00
Jeremy Whiting
ec819e6d00 wifidebug: Only run trace-cmd commands on Galileo devices.
Differentiate Galileo devices from others by checking the
contents of /sys/class/drm/id/board_name.

Signed-off-by: Jeremy Whiting <jeremy.whiting@collabora.com>
2024-02-06 10:16:03 -07:00
Jeremy Whiting
97a79c6713 general: Use SMManager::default() instead of ::new() in main.
Signed-off-by: Jeremy Whiting <jeremy.whiting@collabora.com>
2024-02-06 10:15:09 -07:00
Jeremy Whiting
c1d1951773 wifidebug: Add error checking with println! statements on all failures.
Signed-off-by: Jeremy Whiting <jeremy.whiting@collabora.com>
2024-02-05 11:00:01 -07:00
Jeremy Whiting
40d25971c9 wifidebug: Make WifiDebugMode a real enum with parsing from u32 for dbus.
Changed mode parameter from i32 to u32 as well.
Change from Result<bool, Box<dyn std::error::Error>> to
std::io::Result<bool>
Adjust the xml to add the new method.
Make all private api use Result<()> types so we can do error checking.

Signed-off-by: Jeremy Whiting <jeremy.whiting@collabora.com>
2024-02-05 10:59:46 -07:00