Commit Graph

188 Commits

Author SHA1 Message Date
Josef Söntgen
e0874baa8f
driver/wifi: remove auto_connect attribute
This commit does away with controlling the join-intent via an attribute
but couples it to the existence of a '<network>' node. With this change
all '<network>' nodes within the configuration are always
unconditionally considered for joining.

Issue #5356.
2024-10-08 14:21:20 +02:00
Josef Söntgen
e4d2a4df42
driver/wifi: split hidden network scanning
This commit splits the intent to scan for a hidden network and the
actual configuration of a network itself by introducing
'<explicit_scan>' nodes. Like the '<network>' node these also feature
a 'ssid' attribute and each node is incorporated into the SCAN request
if its SSID is valid.

For more information please consult 'repos/src/driver/wifi/README'.

Issue #5356.
2024-10-08 14:20:56 +02:00
Josef Söntgen
40f2b58098
pc_wifi: use wifi_config.inc helper
Introduce helper that does away with the redundant config generation
snippets.

Issue #5356.
2024-10-08 14:20:22 +02:00
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
Stefan Kalkowski
e5c0d5247e simplify interactive USB HID test metric
To circumvent recurring false-positives whenever things
in the USB drivers or its environment changes, limit
the checks to the event listener itself.
2024-08-27 15:29:36 +02:00
Christian Helmuth
62061c5596 wg_fetchurl.run: create data file early (fix linux) 2024-08-27 15:24:20 +02:00
Christian Helmuth
65957e024d Transfer 2x16 MiB in wg_fetchurl test 2024-06-20 12:56:20 +02:00
Martin Stein
a450110b97 run/nic_router_uplinks: use test component
So far, this test used dynamic_rom for the re-configuration of the nic router
and tested for the expected ping results by inspecting the log with the run
tool. However, this approach had two issues:

* Timing differs significantly on different targets and so the dynamic_rom had
  the difficult task of compensating with heuristics without bloating the test
  duration too much.

* In case of a failing test, it was difficult to determine the cause as the
  test kept running and produced output for quite some time and there was also
  no specific error message but only a generic timeout.

These two issues are now fixed by introducing a test component that listens to
the ping-result report and manages the nic router configuration. The new
component exits early on failure and provides information on the error
circumstances. Furthermore, the component advances to the next test step only
after having seen the expected result of the active test step and thereby
removes the need for heuristics about target timing.

Fixes #5192
2024-06-20 12:56:19 +02:00
Norman Feske
8943a3e949 Remove '_drv' suffix
Issue #4420
2024-06-20 12:54:30 +02:00
Martin Stein
48a5c12526 nic_router_uplinks.run: raise timeouts
At least on x86_64/x86_64/pc/hw|nova, the test used to fail because the net
setup sometimes required more than the 3 seconds that the test was giving each
step. This commit raises the step timeout to 5 seconds and the test timeout
from 70 to 90 seconds in order to be on the safe side.

Ref #5192
2024-04-25 15:43:02 +02:00
Josef Söntgen
344831ec06 curl: update to version 8.7.1
This commits updates the contrib sources to version 8.7.1.

This version requires more random entropy as it queries OpenSSL
about the current random state and will bail if it is not sufficient.
Doubling the content of the '<inline>' VFS plugin as used in static
configurations seems satisfactory.

Furthermore DNS resolving needs a configured '<pipe>' plugin to work
properly.

Fixes #5184.
2024-04-19 08:54:21 +02:00
Stefan Kalkowski
4775dad26c usb_hid_raw.run: eliminate race in test metric
Rarely. it might happen that events got received shortly before the complete
set of relevant USB devices got recognized. Filter more output in test metric
to stay robust.
2024-04-12 15:08:00 +02:00
Stefan Kalkowski
7ec08af6d9 usb: session renewal & new client API
Replace the USB session API by one that provides a devices ROM only,
which contains information about all USB devices available for this client,
as well as methods to acquire and release a single device.

The acquisition of an USB device returns the capability to a device session
that includes a packet stream buffer to communicate control transfers
in between the client and the USB host controller driver. Moreover,
additional methods to acquire and release an USB interface can be used.

The acquisition of an USB interface returns the capability to an interface
session that includes a packet stream buffer to communicate either
bulk, interrupt, or isochronous transfers in between the client and the
USB host controller driver.

This commit implements the API changes in behalf of the Genode C API's
USB server and client side. Addtionally, it provides Usb::Device,
Usb::Interface, and Usb::Endpoint utilities that can be used by native
C++ clients to use the new API and hide the sophisticated packet stream API.

The adaptations necessary target the following areas:

* lx_emul layer for USB host and client side
* Linux USB host controller driver port for PC
* Linux USB client ports: usb_hid_drv and usb_net_drv, additionally
  reduce the Linux tasks used inside these drivers
* Native usb_block_drv
* black_hole component
* Port of libusb, including smartcard and usb_webcam driver depending on it
* Port of Qemu XHCI model library, including vbox5 & vbox6 depending on it
* Adapt all run-scripts and drivers_interactive recipes to work
  with the new policy rules of the USB host controller driver

Fix genodelabs/genode#5021
2024-04-12 12:57:30 +02:00
Stefan Kalkowski
0d1e4bf8d5 Remove orphaned usb_terminal (fix #5130) 2024-02-28 16:32:23 +01:00
Stefan Kalkowski
88c347ee00 usb_hid_reconnect.run: use distinct device-ids
Newer Qemu variants quit with an error about already existing devices
if the same device-id is add and removed in a loop fast. To circumvent
this strange behaviour, simply use consecutive device id numbers.

Ref genodelabs/genode#5021
2024-02-28 16:32:23 +01:00
Christian Helmuth
1dcc6fda6b lx_emul: improve motion-device handling in evdev
The key element of the improvement is differentiated processing of
events of the following device types.

  Mouse:       relative motion
  Pointer:     absolute motion (Qemu usb-tablet and IP-KVM devices)
  Touchpad:    relative motion via absolute touchpad coordinates
  Touchtool:   absolute motion (e.g., stylus)
  Touchscreen: absolute motion and finger (multi-) touch

Processing is done in two stages for one "input packet". First, all
events of the packet are recorded into the current evdev state with
device-type specific operations. Then, appropriate Genode input events
are generated from the accumulated evdev state in the submission stage
(again by device-type specific functions).

A simple version of tap-to-click was added to the touchpad support.

Fixes #5105
2024-02-26 08:59:09 +01:00
Sebastian Sumpf
27b1017fe9 test/lxip_raw: test using Genode socket C-API directly
The lxip_raw.run script will spawn a client/server scenario that tests
Genode C-API calls. The scenario can be used standalone, meaning no
actual network card is required.

issue #5104
2024-02-26 08:59:08 +01:00
Christian Helmuth
092e4a001f usb_hid: mode led handling to shadow input-leds.c
The former implementation relied on input drvdata always pointing to
struct hid_device, which is not true for Wacom touch devices (at least).
Now, we implement the input handler for devices providing LEDs
(evbit[EV_LED] set) only and use input_inject_event() to set the LED
states.
2024-02-26 08:31:04 +01:00
Norman Feske
f66ce025d3 Adapt run scripts to trace-subject filtering
Issue #847
2023-12-13 12:28:52 +01:00
Norman Feske
ee8c76b42e dde_linux: use [build_artifacts] in run scripts
Issue #4860
2023-11-28 14:45:29 +01:00
Christian Prochaska
ad28da66b0 usb_hid_raw.run: filter out KVM switch messages
Fixes #5049
2023-11-28 14:24:25 +01:00
Pirmin Duss
b53a630592 Re-connect test for wireguard
Issue genodelabs/genode#4957
2023-11-28 14:24:23 +01:00
Christian Prochaska
9c32d53914 os: add a src recipe for test-terminal_echo
Fixes #5006
2023-10-04 13:22:06 +02:00
Christian Helmuth
3a566262fe lx_emul: multi-touch trackpad support in evdev.c
Also addresses remarks in issue #3019.
2023-10-04 13:22:05 +02:00
Christian Helmuth
b15fb2bbaf Adapt autopilot output checks in usb_hid_raw test
Issue #4958
2023-09-29 12:17:45 +02:00
Sebastian Sumpf
7e823f7c19 dde_linux: remove legacy_usb_net
issue #4958
2023-09-29 12:17:45 +02:00
Sebastian Sumpf
e1b463082a usb_net.run: enable Qemu device pass-through
issue #4958
2023-09-29 12:15:07 +02:00
Sebastian Sumpf
9a6423b4ef dde_linux: move usb_net -> legacy_usb_net
issue #4958
2023-09-29 12:15:06 +02:00
Martin Stein
c3c7a01df5 nic_router_uplinks.run: raise report-rom caps
Caused the test to fail on x86_64+pc+sel4.

Ref #4923
2023-08-21 08:12:01 +02:00
Martin Stein
b587134a8d net tests: raise nic_drv/drivers cap quota
Several nightly network-related tests fail currently on sel4/pc because the
new e1000 NIC driver requires more capabilities. The "drivers nic" package
was already adapted to the new requirement but some tests fail to provide
enough caps to the corresponding sub system. This commit tries to fix all
remaining tests.

Ref #4923
2023-08-21 08:12:01 +02:00
Josef Söntgen
dd1b8a106f drivers/wifi: perform multi-staged construction
Since the wireless LAN driver is actually a 'Libc::Component' due to
its incorporation of the 'wpa_spplicant' application, we have to
intercept its construction because we have to initialize the Lx_kit
environment before any static ctors are executed. Most Linux initcalls
are implemented as ctors that will be otherwise implicitly executed
before the controll is given to us in 'Libc::Component::construct'.

Issue #4927.
2023-07-14 12:06:32 +02:00
Christian Helmuth
ee564125df Replace ipxe_nic_drv by pc_nic_drv in run scripts
Issue #4921
2023-07-14 12:06:31 +02:00
Josef Söntgen
ea0a692879 wifi: get firmware from tar archive
This commit changes the firmware handling from requesting each
firmware file as a ROM module that is checked against a list of
known images (including their size) to requesting each file via
the local VFS of the 'wifi_drv'. This allows for using the original
probing mechanism that tries to select a matching firmware version.

The 'repos/dde_linux/src/drivers/wifi/README' file contains more
detailed information on how to configure the driver.

Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
d5710d9de3 Move 'wifi' driver to dde_linux repository
The bulk of the driver code now lives in the 'dde_linux' repository,
which is available on all platforms, from where it can be referenced by
other repositories.

The 'wifi_drv' binary was delegated to a generic harness that includes
all configuration and management functionality shared by all wireless
device driver components, e.g., the wpa_supplicant. The code of the
device driver emulation environment is located in 'src/lib/wifi'. It
is referenced by the platform-specific driver library that resides in
the corresponding platform repository. The runtime configuration needs
to point the driver to proper driver library.

The platform-specific library is in charge of orchestrating the contrib
source utilized by the driver as well as providing the 'source.list'
and 'dep.list' files. It must include the generic library snippet
'repos/dde_linux/lib/wifi.inc' that deals with managing the emulation
environment code.

The 'repos/dde_linux/src/drivers/wifi/README' file contains more
detailed information on how to deploy the driver.

Issue #4861.
2023-05-30 12:03:32 +02:00
Christian Helmuth
6a80b4bd17 dde_linux: move test/driver_time to virt_linux
Fixes #4775
2023-04-17 14:48:23 +02:00
Christian Helmuth
3a9ef48721 dde_linux: separate virt_linux from wireguard
Preparation to support further hardware-agnostic dde_linux components
(incl. lxip and tests).

Fixes #4774
2023-04-17 14:48:23 +02:00
Stefan Kalkowski
f6825eea5f pci_decode: increase default ram quota
To circumvent problems of the page-table entries getting short on sel4,
increase the RAM quota for this component in all run-scripts.

Fix #4686
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
71eefc3315 nic_router_uplinks.run: remove legacy platform_drv
Ref genodelabs/genode#4511
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Norman Feske
dd9e12601e Remove pseudo targets for building shared libs
Thanks to the change "build: support library builds via lib/<libname>",
shared libraries can now be built directly by the build system.

Issue #4599
2022-09-19 14:00:32 +02:00
Sebastian Sumpf
b5c780993c board: Rename virt_qemu to virt_qemu_<arch>
Instead of having a generic "virt_qemu" board use "virt_qemu_<arch>" in
order to have a clean distinction between boards. Current supported
boards are "virt_qemu_arm_v7a", "virt_qemu_arm_v8a", and
"virt_qemu_riscv".

issue #4034
2022-08-17 12:03:26 +02:00
Martin Stein
6f777f90a8 wireguard: test multiple peers at a time
Extends the wg_reconfig run script to test that the WireGuard component is able
to handle multiple peers at the same time if configured.

Ref #4520
2022-08-10 13:29:40 +02:00
Martin Stein
36d2374ff9 wireguard: exit on invalid configurations
With this commit, the WireGuard component exits with a descriptive uncaught
exception on invalid configurations or when the user attempts to re-configure
attributes that are not re-configurable (private_key, listen_port, interface).

This is particularly important when it comes to the not re-configurable private
key. If the component would just ignore the attempt to override the private
key, the user may come to believe that his old (potentially compromised)
private key is not in use anymore.

The fact that the component now exits instead shouldn't be a problem, as the
user would have to restart the component anyway in order to apply the new
attribute values.

The commit also extends the wg_reconfig run script to test that WireGuard
exits on the attempt to re-configure the private key.

Ref #4520
2022-08-10 13:29:40 +02:00
Martin Stein
86259b998e wireguard: support removing peers
Support removing peers by removing them from the component configuration.
This commit also introduces the wg_reconfig run script that tests adding and
removing single peers.

Ref #4520
2022-08-10 13:29:39 +02:00
Christian Helmuth
871ee04ed6 wireguard: enable wg_fetchurl.run on sel4 2022-08-10 13:29:39 +02:00
Stefan Kalkowski
f652657d9d Consolidate USB test run-scripts
Ref genodelabs/genode#4511
2022-05-25 12:23:03 +02:00
Martin Stein
a845dffa63 dde_linux: port of WireGuard kernel module
A userland component that ports the Linux WireGuard kernel module (originally
from kernel version 5.14.21) and integrates it via a NIC session (public
network side) and an Uplink session (private network side). The
WireGuard-specific device configuration is done through the component
configuration. The port is done using lx_emul, lx_kit and the virt_linux
targets. The commit adds also 4 corresponding run scripts of which 3 are fully
automated of which 1 is added to the autopilot.

:Warning:

Although in principal functioning, the WireGuard port has not been exposed to a
sufficient amount of real-world testing, so far. Therefore, we strongly
recommend not to use it in any security-critical scenarios! There is no
guarantee that the port meets any of the security goals pursued by the
WireGuard protocol or other WireGuard implementations!

Ref #4397
2022-05-25 12:23:03 +02:00
Alexander Boettcher
38e5972e45 Remove legacy intel display driver
The driver is superseded by the new driver located in the 'pc'
repository.

Issue #4508
2022-05-25 12:23:02 +02:00
Josef Söntgen
573cabaf24 Remove legacy wifi driver
The driver is superseded by the new driver located in the 'pc'
repository.

Fixes #4508.
2022-05-25 12:22:10 +02:00
Stefan Kalkowski
56831a247f usb_net_drv: remove deprecated server mode
Ref genodelabs/genode#3961
2022-05-25 12:19:31 +02:00
Josef Söntgen
2e47eb6fb9 dde_linux: use new wifi driver in uplinks test
Issue #4455.
2022-04-13 09:29:04 +02:00