Commit Graph

999 Commits

Author SHA1 Message Date
Sebastian Sumpf
c835993ac3 lx_emul: add wheel events to shadow evdev.c
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
6ac68494db lx_emul/arm: add 'pteval_t'
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
c4ec847680 lx_emul/shadow/uaccess_64: add 'clear_user'
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
3925c7ec60 virt/lx_emul: add usb_client.c
This registers C-API USB-client device handle (i.e., USB::Connection) as
Linux 'usb_device' and probes all the initialized drivers.

issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
5eff895f9d virt/lx_emul: shadow urb handling for USB clients
allocate, free, and submit urbs to an USB service using Genode's USB
client C-API.

issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
d27e0a8fe6 virt_lx_emul: add shadow 'vmalloc.c'
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
22231c0604 virt_lx_emul: adjust dummies for usb_hid/net
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
71c32f2923 virt_linux: add init calls for USB HID/NET
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
57d2b7235d virt_linux: add USB HID/NET/MBIM to kernel configuration
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
9f8ccc030b linux.port: add usb_net_cdc_ncm.patch
NCM tries to batch TX packets using timeouts (500us) and does not send packets
before 3 packets are in the submit queue. Timeouts take milliseconds on
dde_linux which leads to delayed ACKs and poor performance for the RX case.
Therefore, we send small packets (<100 Bytes) immediately without batching (it
might be an ACK or last packet of a larger transfer).

issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
5c1b9399b0 linux.port: add usb_net_pinephone.patch
The PinePhone Modems' CDC Ethernet Interface does not respond if RX/TX queue size
is greater 12 (experimentally determined), the default would be 60, meaning 60
RX Bulk URBs are sent at once to the device.

issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
9a6423b4ef dde_linux: move usb_net -> legacy_usb_net
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
8f34c27ca5 dde_linux: move usb_hid -> usb_hid_legacy
issue #4958
2023-09-29 12:15:05 +02:00
Christian Helmuth
134a785fe0 depot: update recipe hashes 2023-08-24 11:01:40 +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
Stefan Kalkowski
4277bdd3cd lx_emul usb: solve session close races
* During a session-close, the device-specific usb task and driver data
  gets freed. Part of it was the RPC data. To prevent use-after-free
  turn it into a pointer and leave it on the stack of the caller thread
* During a device release, URBs discards, and reset operation the Linux task
  might get blocked, and then a RPC caller task might return if the RPC
  operation was marked as finished already, although it hasn't succeeded yet
* USB devio RESET has to be done before a device release to be effective

Fix genodelabs/genode#4969
2023-08-21 08:12:01 +02:00
Stefan Kalkowski
8f4903ca86 lx_emul usb: make reset ep effective
* Within flush_transfer of the USB session a given entrypoint gets
  resetted, to be effective al related URBs need to be discarded first
* Discarding URBs shall be done in reverse order, like libusb is doing it,
  where it warns about potential races otherwise

Ref genodelabs/genode#4969
2023-08-21 08:12:00 +02:00
Norman Feske
7aa301361d depot: update recipe hashes 2023-07-14 12:06:32 +02:00
Stefan Kalkowski
ec60ad3a80 dde_linux: remove legacy_rpi_usb_host_drv
* Cleanup the dde_linux port

Fix genodelabs/genode#4965
2023-07-14 12:06:32 +02:00
Stefan Kalkowski
175ec07c06 lx_emul: allow non-SMP kernel configurations
Fix genodelabs/genode#4963
2023-07-14 12:06:32 +02:00
Stefan Kalkowski
2f6864a487 lx_emul: make ARM irqchip handler extendable
* Allow support for kernel configurations without CONFIG_IRQ_DOMAIN_HIERARCHY
* Export `irq_domain` instantiated for driver-specific extensions of the irqchip

Fix genodelabs/genode#4964
2023-07-14 12:06:32 +02:00
Josef Söntgen
e18c02991e lx_kit: use central signal handler for scheduling
This commit extends the Lx_kit initialization function by passing in
a signal handler that is used to perform the normally occurring
scheduler execution and is a follow-up change for the decoupling
scheduler execution commit.

Instead of burying the signal handler in the 'Lx_kit::Scheduler'
object it is provided by the main object where the driver is free
to perform any additional step before or after executing the scheduler.

Issue #4927
Fixes #4952
2023-07-14 12:06:32 +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
Josef Söntgen
fc24ffcdb8 wifi: use mac address reporter
Remove the handcrafted MAC address reporter in favour the Genode
C API utility (cf. #4918).

Issue #4927
Issue #4918
2023-07-14 12:06:32 +02:00
Stefan Kalkowski
cccb763737 lx_emul usb: handle RPC calls after async-URBS
Prevent missing new RPC calls handed over to a Linux task
of a corresponding usb-device, while that task blocked
during enqueuing of asynchronous URBs.

Fixed genodelabs/genode#4955
2023-07-14 12:06:32 +02:00
Josef Söntgen
1cac134030 lx_kit: support multiple pending IRQs
Decoupling the scheduler execution can lead to missed interrupts
because the current implementation only handles one pending
interrupt and requires immediate processing.

This commit introduces a helper object that is used to capture
any occuring interrupts that are then handled consecutively.

Issue #4927.
2023-07-14 12:06:32 +02:00
Josef Söntgen
caac994da8 lx_kit: decouple schedule execution
Prior to this commit, whenever an external event occurred, for example
timer or interrupt, the corresponding I/O signal handler was triggered.
This handler unblocked the task waiting for the event and initiated the
immediate execution of all unblocked tasks. Since these tasks may hit
serialization points, e.g. synchronously waiting for packet stream
operations, that require handling of other I/O signals this leads to
nested execution. This, however, is not supported and mixes application
and I/O level signal handling.

The flagging of the scheduling intent is now decoupled from its
execution by using an application level signal handler that is run in
the context of the components main entrypoint. The I/O signal handler
now triggers the scheduling execution by sending a local signal to
the EP.

Since it might be necessary to execute a pending schedule from the EP
directly the scheduler is extended with the 'execute' member function
that performs the check that the scheduler is called from within the
EP and triggers the execution afterwards.

Issue #4927.
2023-07-14 12:06:32 +02:00
Stefan Kalkowski
3d5ec9ea3f dde_linux: remove legacy imx6 usb host driver
Ref genodelabs/genode#4942
2023-07-14 12:06:31 +02:00
Stefan Kalkowski
edcd44d9a7 lx_emul: shadow ARM-specific asm/uaccess.h file
Fix genodelabs/genode#4939
2023-07-14 12:06:31 +02:00
Stefan Kalkowski
b15fd68b60 lx_emul: shadow the ARM-specific asm/domain.h file
Fix genodelabs/genode#4938
2023-07-14 12:06:31 +02:00
Stefan Kalkowski
720d2847b6 lx_emul: correct the return value of clk_get
Fix genodelabs/genode#4937
2023-07-14 12:06:31 +02:00
Christian Helmuth
1a7ff195d9 pc_linux: enable EFI and EFI_STUB
With these options enabled comparative testing between pc_linux drivers
and bzImages becomes much easier on EFI-only machines. The impact on the
actual Genode drivers is minimal.
2023-07-14 12:06:31 +02:00
Christian Helmuth
e2ddcee440 lx_emul: prevent warning about unsused static func 2023-07-14 12:06:31 +02:00
Christian Helmuth
ea294fff0c lx_emul: fix unplug of unclaimed USB devices
USB devices that are never associated to client sessions lack
usb_per_dev_data (and a kernel thread). Therefore, the devices should be
discontinued directly on unplug as no URBs can be pending.

Issue genodelabs/genode#4795
2023-07-14 12:06:31 +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
adf0b893e8 lx_kit: add random dummy back end
This back end can be used in place of the existing jitterentropy based
on in case random is not strictly needed by the component but one
wants to use the available 'shadow/drivers/char/random.c'
implementation.

Issue genodelabs/genode-allwinner#21.
2023-07-14 12:01:19 +02:00
Josef Söntgen
c888fcbdd9 lx_emul: implement __get_random_u32_below
The implementation was already part of the Zynq's sd_card driver and
since other ARM drivers need it as well, promote it to the common
shadow library.

Issue genodelabs/genode-allwinner#21.
2023-07-14 12:01:19 +02:00
Josef Söntgen
7109b80bbd dde_linux: enable -gnu11
The option is default since 5.18 and several compilation units
require it.

Issue genodelabs/genode-allwinner#21.
2023-07-14 12:01:19 +02:00
Christian Helmuth
0a28df8805 lx_emul: skb_init() in lx_emul_init_task_function()
Issue #4921
2023-07-14 12:01:19 +02:00
Norman Feske
79e262921e depot: update recipe hashes 2023-06-16 11:24:26 +02:00
Christian Helmuth
54a549d808 lx_emul: move arch_atomic64_add_return to dde_linux 2023-06-16 11:24:26 +02:00
Stefan Kalkowski
97bf616b5b lx_emul: fix rcu_needs_cpu() for older kernels
Resolves observed regression for the older usb host drivers (< linux
version 5.18).

Ref genodelabs/genode#4798
2023-06-16 11:24:25 +02:00
Christian Helmuth
583f2d6a36 depot: update recipe hashes 2023-05-30 12:13:34 +02:00
Christian Helmuth
22bee79534 port/metadata: improve info for multi-source ports
Now, ./tool/ports/metadata dde_linux produces the following output.

  PORT:     dde_linux
  LICENSE:  GPLv2
  VERSION:  individual (see sources)
  SOURCE:   https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.4.3.tar.xz VERSION 4.4.3 (lxip)
  SOURCE:   https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.16.3.tar.xz VERSION 4.16.3 (fec)
  SOURCE:   https://github.com/cproc/dwc_otg.git git r5 (dwc_otg_host)
  SOURCE:   https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.16.3.tar.xz VERSION 4.16.3 (usb_host)
  SOURCE:   https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.16.3.tar.xz VERSION 4.16.3 (usb_hid)
  SOURCE:   https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.16.3.tar.xz VERSION 4.16.3 (usb_modem)
  SOURCE:   https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.16.3.tar.xz VERSION 4.16.3 (usb_net)

Issue #4685
2023-05-30 12:03:34 +02:00
Stefan Kalkowski
1c790b2776 lx_emul: use alternative initcall for pci on ARM
On platforms different than x86 the subsys initcall `pci_subsys_init`
is not available. Therefore, we choose an alternative one here.

Fix genodelabs/genode#4907
2023-05-30 12:03:33 +02:00
Josef Söntgen
497c8b0922 wifi: provide WPA3-personal support
This commit introduces preliminary support for joining networks secured
via WPA3-personal. So far it was only tested with the one OpenWRT AP
configured for WPA3 (see excerpt below) where it WPA3-only as well as
WPA2/WPA3 mixed worked fine.

Scan results excerpt:

00:11:22:33:44:55    5180    -45     [WPA2-SAE-CCMP][SAE-H2E][ESS][UTF-8]    PewPew
00:11:22:33:44:55    2412    -67     [WPA2-PSK+SAE+PSK-SHA256-CCMP][SAE-H2E][ESS][UTF-8]     PewPew2

Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
cfd3be675f pc_wifi: enable RTL8192CE support in rtlwifi
Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
dc178e0ab2 dde_linux: enhance KBUILD_MODNAME generation
It turns out solely relying on the name of the compilation-unit
is not enough. In at least one multi-device driver, e.g. rtlwifi,
an equally called compilation-unit is found in several different
directories. There KBUILD_MODNAME is used to name the driver,
which fails later on as the driver framework refuses to register
an equally named driver twice.

Instead of only considering the name of the compilation-unit also
include the last element of the path to generate differentiating
KBUILD_MODNAME value.

Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
22c9157231 wifi: add RFKILL notification interface
Add somewhat cosmetic changes to the RFKILL interface used between
the management layer and the driver library to make the intent clear.

Issue #4861.
2023-05-30 12:03:33 +02:00