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>
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>
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>
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>
When wifi debug mode is started trace-cmd start is executed with
the given buffer_size parameter.
Later when wifi debug mode is stopped, trace-cmd stop is executed
as well as trace-cmd extract to write the data to a file on disk.
In this way the steam client (or any dbus users...) can decide how
long to run trace-cmd for.
Change to create_dir_all so we don't get errors if it exists.
Signed-off-by: Jeremy Whiting <jeremy.whiting@collabora.com>
Adds set_wifi_debug_mode to enable or disable wifi debug mode.
Parameters are
mode (0 for off, 1 for on for now, expandable in the
future if more modes are needed).
buffer_size: a size in kilobytes per cpu (so 16 on the deck)
for the ring buffer that debug messages will get written into.
For now just adds or removes a iwd debug mode override and restarts
iwd.
next will add some trace-cmd commands to write the debug messages
to a file on disk.
Signed-off-by: Jeremy Whiting <jeremy.whiting@collabora.com>
And this attempt works now. I guess this is adequate to release
as a throw away implementation to replace later with something better.
Also add strip="symbols" for release builds to get it down to a lean
3.2M size.
Use an enum of values for level:
0 - auto
1 - low
2 - high
3 - manual
4 - peak_performance
If any out of range are given, return an false. If unable to write
or open for writing, return false. May change to give an err type
instead later if that helps client side.