genode/repos/gems/sculpt
Josef Söntgen d4e4b8bf60 driver/wifi: rework CTRL interface manager
This commit streamlines the interaction between the Wifi::Manager
and the wpa_supplicant's CTRL interface.

As user-facing changes it alters some default settings and introduces
new features:

* Every configured network now needs to explicitly have its
  'auto_connect' (to be considered an option for joining) attribute
  set to 'true' whereas this was previously the default value if the
  attribute was not set at all.

* The 'log_level' attribute is added and configures the supplicant's
  verbosity. Valid values correspond to levels used by the supplicant
  and are as follows 'excessive', 'msgdump', 'debug', 'info', 'warning'
  and 'error'. The default value is 'error' and configures the least
  amount of verbosity.

* The 'bgscan' attribute may be used to configure the way the
  supplicant performs background-scanning to steer or rather optimize
  roaming decision within the same network. The default value is set
  to 'simple:30:-70:600'. It can be disabled by specifying an empty
  value, e.g. 'bgscan=""'.

* The 'verbose_state' attribute was removed alltogether and similar
  functionality is now coverted by 'verbose' attribute.

Implementation-wise the internals changed significantly and are
outlined in the following paragraphs.

Formerly the interaction between the manager and the supplicant
was handled in an apparent way where the internal state of each
interaction was in plain sight. This made the flow cumbersome to
follow and therefor each interaction is now confined to its own
'Action' object that encapsulates the ping-pong of commands and
responses between the manager and the supplicant. All actions are
processed in an sequential way and thus there is no longer any
need to defer pending actions depending on the interal state of
the current interaction. Configuration changes as well as events
issued by the supplicant where new actions can be created are
handled in this fashion. Of note are both signal-handlers,
'_handle_cmds' and '_handle_events' respectively.

The state report, which provides the information about the current
state of connectivity to a given wireless network, was dealt with
in the same vein and its handling was spread across the manager
implementation. Again, to make it easier to follow, the generation
of the state report is now purely driven by the 'Join_state' object.
This object encapsulates the state of connectivity and is normally
updated by events issued from the supplicant (see '_handle_events').
It is also incorporated when handling command responses (see
'_handle_cmds').

Handling of timed-actions, like scan and signal quality
update requests, was done by setting a timeout at the Timer session
directly and thus only one timed-action could be pending at any time.
This excluded dealing with timed-actions like connected-scanning
and signal quality polling concurrently. This was changed and now
a One_shot_timeout is used to programm each concurrent timed-action.

For implementing the communication channel for the CTRL interface the
manager and supplicant use a shared memory buffer, the Msg_buffer.
Since the CTRL interface for Genode was implemented using C, some
shenanigans were performed to access the memory buffer. Now the
CTRL interface implementation uses C++ and only exports the functions
required by the supplicant as C. This simplifies the usage of the
Msg_buffer and allows for removing the global functions needed for
synchronizing the Msg_buffer access as those are now part of the
object itself via the 'Notify_interface'.

Fixes #5341.
2024-10-08 09:09:22 +02:00
..
clipboard Modularize Sculpt OS image creation 2022-01-19 12:38:11 +01:00
deploy sculpt: move goa_testbed preset into pc repo 2024-08-27 15:33:31 +02:00
depot gems/sculpt: update mstein pubkey 2023-10-25 08:59:15 +02:00
drivers Remove '_drv' suffix 2024-06-20 12:54:30 +02:00
event_filter sculpt: remap KEY_SYSRQ to KEY_PRINT 2024-04-29 15:31:20 +02:00
fb Remove '_drv' suffix 2024-06-20 12:54:30 +02:00
fonts Mobile version of Sculpt OS 2024-02-28 16:31:46 +01:00
global_keys Modularize Sculpt OS image creation 2022-01-19 12:38:11 +01:00
gpu Remove '_drv' suffix 2024-06-20 12:54:30 +02:00
launcher Remove '_drv' suffix 2024-06-20 12:54:30 +02:00
leitzentrale wm: account session resources 2024-10-07 15:54:59 +02:00
manager sculpt: make storage target configurable 2024-04-12 15:05:46 +02:00
nitpicker sculpt/nitpicker: assign KEY_PRINT -> screenshot 2024-04-19 08:54:22 +02:00
numlock_remap Modularize Sculpt OS image creation 2022-01-19 12:38:11 +01:00
ram_fs sculpt: allow new depot users in ram_fs/depot 2023-04-17 14:48:29 +02:00
runtime Modularize Sculpt OS image creation 2022-01-19 12:38:11 +01:00
system Modularize Sculpt OS image creation 2022-01-19 12:38:11 +01:00
usb sculpt/usb/default: add device-assignment example 2024-04-19 08:54:21 +02:00
wifi driver/wifi: rework CTRL interface manager 2024-10-08 09:09:22 +02:00
default-linux.sculpt sculpt: make storage target configurable 2024-04-12 15:05:46 +02:00
default-pc.sculpt Remove '_drv' suffix 2024-06-20 12:54:30 +02:00
net_test-pc.sculpt gems: remove driver_manager 2024-04-12 15:02:45 +02:00
phone-linux.sculpt sculpt: introduce config/manager 2024-04-12 15:05:14 +02:00