2023-05-03 15:34:22 +00:00
|
|
|
#
|
|
|
|
# Set to true in case the driver needs to be debugged to
|
|
|
|
# pull in the locally build binaries rather than the ones
|
|
|
|
# from the depot.
|
|
|
|
#
|
|
|
|
set debug_driver false
|
|
|
|
|
2024-10-08 09:30:40 +00:00
|
|
|
source ${genode_dir}/repos/dde_linux/run/wifi_config.inc
|
2022-02-10 17:09:17 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Restrict platforms
|
|
|
|
#
|
|
|
|
assert_spec x86
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build
|
|
|
|
#
|
|
|
|
|
2023-04-12 11:56:12 +00:00
|
|
|
create_boot_directory
|
2023-11-28 12:50:10 +00:00
|
|
|
import_from_depot [depot_user]/pkg/pc_wifi \
|
|
|
|
[depot_user]/raw/pc_wifi_firmware
|
2023-04-12 11:56:12 +00:00
|
|
|
|
2022-02-10 17:09:17 +00:00
|
|
|
set build_components {
|
|
|
|
core init timer
|
2022-07-29 15:31:20 +00:00
|
|
|
app/pci_decode
|
2024-05-31 15:24:20 +00:00
|
|
|
driver/acpi
|
|
|
|
driver/platform
|
|
|
|
driver/rtc
|
2022-02-10 17:09:17 +00:00
|
|
|
server/report_rom
|
|
|
|
server/dynamic_rom
|
|
|
|
server/nic_router
|
|
|
|
test/lwip/http_srv
|
2022-09-01 11:12:13 +00:00
|
|
|
lib/vfs_lwip
|
2022-02-10 17:09:17 +00:00
|
|
|
}
|
|
|
|
|
2023-05-03 15:34:22 +00:00
|
|
|
append_if $debug_driver build_components {
|
2024-05-31 15:24:20 +00:00
|
|
|
driver/wifi
|
2023-05-03 15:34:22 +00:00
|
|
|
lib/pc_wifi
|
2023-11-28 12:50:10 +00:00
|
|
|
lib/vfs_jitterentropy
|
2023-05-03 15:34:22 +00:00
|
|
|
}
|
|
|
|
|
2022-02-10 17:09:17 +00:00
|
|
|
build $build_components
|
|
|
|
|
|
|
|
#
|
|
|
|
# Generate config
|
|
|
|
#
|
|
|
|
|
|
|
|
append config {
|
|
|
|
<config verbose="yes" prio_levels="2">
|
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="IO_MEM"/>
|
|
|
|
<service name="IO_PORT"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</default-route>
|
|
|
|
<default caps="100"/>
|
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides> <service name="Timer"/> </provides>
|
|
|
|
</start>
|
|
|
|
|
2022-07-29 15:31:20 +00:00
|
|
|
<start name="report_rom" caps="70">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="ROM" />
|
|
|
|
<service name="Report" />
|
|
|
|
</provides>
|
|
|
|
<config verbose="yes">
|
2024-05-30 13:46:57 +00:00
|
|
|
<policy label="pci_decode -> system" report="acpi -> acpi"/>
|
|
|
|
<policy label="platform -> devices" report="pci_decode -> devices"/>
|
2022-07-29 15:31:20 +00:00
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
2024-05-30 13:46:57 +00:00
|
|
|
<start name="acpi" caps="250">
|
2023-05-02 16:17:56 +00:00
|
|
|
<resource name="RAM" quantum="6M"/>
|
2022-07-29 15:31:20 +00:00
|
|
|
<route>
|
|
|
|
<service name="IO_MEM"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="RM"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
<service name="Report"> <child name="report_rom"/> </service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="pci_decode" caps="350">
|
2022-11-18 13:11:38 +00:00
|
|
|
<resource name="RAM" quantum="2M"/>
|
2022-07-29 15:31:20 +00:00
|
|
|
<route>
|
|
|
|
<service name="Report">
|
|
|
|
<child name="report_rom"/> </service>
|
|
|
|
<service name="ROM" label="system">
|
|
|
|
<child name="report_rom"/> </service>
|
|
|
|
<service name="IO_MEM"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="RM"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
2024-05-30 13:46:57 +00:00
|
|
|
<start name="platform" caps="100" managing_system="yes">
|
2024-08-09 06:35:53 +00:00
|
|
|
<resource name="RAM" quantum="2M"/>
|
2022-07-29 15:31:20 +00:00
|
|
|
<provides> <service name="Platform"/> </provides>
|
|
|
|
<route>
|
|
|
|
<service name="ROM" label="devices"> <child name="report_rom"/> </service>
|
2022-10-10 13:17:55 +00:00
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
2022-07-29 15:31:20 +00:00
|
|
|
<service name="IRQ"> <parent/> </service>
|
|
|
|
<service name="IO_MEM"> <parent/> </service>
|
|
|
|
<service name="IO_PORT"> <parent/> </service>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
</route>
|
|
|
|
<config>
|
2024-05-30 13:46:57 +00:00
|
|
|
<policy label_prefix="wifi" info="yes">
|
2022-07-29 15:31:20 +00:00
|
|
|
<pci class="WIFI"/>
|
|
|
|
</policy>
|
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
2024-05-30 13:46:57 +00:00
|
|
|
<start name="pc_rtc">
|
2022-02-10 17:09:17 +00:00
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides> <service name="Rtc"/> </provides>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="test-lwip_httpsrv">
|
|
|
|
<resource name="RAM" quantum="128M"/>
|
|
|
|
<config>
|
|
|
|
<libc stdout="/dev/null" stderr="/dev/log" socket="/socket"/>
|
|
|
|
<vfs>
|
|
|
|
<dir name="dev"> <log/> <null/> </dir>
|
|
|
|
<dir name="socket"> <lwip dhcp="yes"/> </dir>
|
|
|
|
</vfs>
|
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<service name="Nic"> <child name="nic_router"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="state_report_rom">
|
|
|
|
<binary name="report_rom"/>
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<provides> <service name="Report"/> <service name="ROM"/> </provides>
|
|
|
|
<config verbose="no"/>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="accesspoints_report_rom">
|
|
|
|
<binary name="report_rom"/>
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<provides> <service name="Report"/> <service name="ROM"/> </provides>
|
|
|
|
<config verbose="no"/>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="config_rom">
|
|
|
|
<binary name="dynamic_rom"/>
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides><service name="ROM"/></provides>
|
|
|
|
<config verbose="yes">
|
|
|
|
<rom name="wifi_config">
|
|
|
|
<inline description="disconnect">
|
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-09-03 14:06:02 +00:00
|
|
|
} [wifi_config 5 10 no {}] {
|
2022-02-10 17:09:17 +00:00
|
|
|
</inline>
|
|
|
|
<sleep milliseconds="15000"/>
|
|
|
|
<inline description="connect">
|
2024-10-07 15:35:14 +00:00
|
|
|
} [wifi_config 5 10 no [list "[wifi_ssid] [wifi_wpa] [wifi_psk] no"]] {
|
2022-02-10 17:09:17 +00:00
|
|
|
</inline>
|
2022-04-04 15:15:59 +00:00
|
|
|
<sleep milliseconds="60000"/>
|
2022-02-10 17:09:17 +00:00
|
|
|
<inline description="rfkill block">
|
2024-10-07 15:35:14 +00:00
|
|
|
} [wifi_config 5 10 yes [list "[wifi_ssid] [wifi_wpa] [wifi_psk] no"]] {
|
2022-02-10 17:09:17 +00:00
|
|
|
</inline>
|
|
|
|
<sleep milliseconds="30000"/>
|
|
|
|
<inline description="rfkill unblock">
|
2024-10-07 15:35:14 +00:00
|
|
|
} [wifi_config 5 10 no [list "[wifi_ssid] [wifi_wpa] [wifi_psk] no"]] {
|
2022-02-10 17:09:17 +00:00
|
|
|
</inline>
|
|
|
|
<sleep milliseconds="30000"/>
|
|
|
|
</rom>
|
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="nic_router" caps="150">
|
|
|
|
<resource name="RAM" quantum="8M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="Nic"/>
|
|
|
|
<service name="Uplink"/>
|
|
|
|
</provides>
|
|
|
|
<config verbose="no" verbose_domain_state="yes" dhcp_discover_timeout_sec="10" dhcp_request_timeout_sec="6">
|
|
|
|
|
|
|
|
<policy label_prefix="test-lwip_httpsrv" domain="downlink"/>
|
2024-05-30 13:46:57 +00:00
|
|
|
<policy label_prefix="wifi" domain="uplink"/>
|
2022-02-10 17:09:17 +00:00
|
|
|
|
|
|
|
<domain name="uplink" verbose_packets="no" verbose_packet_drop="no" icmp_echo_server="yes">
|
|
|
|
|
|
|
|
<nat domain="downlink" tcp-ports="16384"/>
|
|
|
|
<tcp-forward port="443" domain="downlink" to="10.0.3.2"/>
|
|
|
|
<tcp-forward port="80" domain="downlink" to="10.0.3.2"/>
|
|
|
|
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
<domain name="downlink" verbose_packets="no" verbose_packet_drop="no" interface="10.0.3.1/24">
|
|
|
|
|
|
|
|
<dhcp-server ip_first="10.0.3.2" ip_last="10.0.3.2"/>
|
|
|
|
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="devices_report_rom">
|
|
|
|
<binary name="report_rom"/>
|
|
|
|
<resource name="RAM" quantum="1200K"/>
|
|
|
|
<provides> <service name="Report"/> <service name="ROM"/> </provides>
|
|
|
|
<config verbose="yes"/>
|
|
|
|
</start>
|
|
|
|
|
2024-05-30 13:46:57 +00:00
|
|
|
<start name="wifi" caps="260" priority="-1">
|
2022-02-10 17:09:17 +00:00
|
|
|
<resource name="RAM" quantum="32M"/>
|
|
|
|
<config ld_verbose="yes">
|
|
|
|
<report mac_address="true"/>
|
2022-11-08 17:33:04 +00:00
|
|
|
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc" rng="/dev/urandom"/>
|
2022-02-10 17:09:17 +00:00
|
|
|
<vfs>
|
|
|
|
<dir name="dev"> <log/> <null/> <rtc/>
|
|
|
|
<jitterentropy name="random"/>
|
|
|
|
<jitterentropy name="urandom"/>
|
|
|
|
</dir>
|
2023-05-03 15:34:22 +00:00
|
|
|
<dir name="firmware">
|
|
|
|
<tar name="wifi_firmware.tar"/>
|
|
|
|
</dir>
|
2022-02-10 17:09:17 +00:00
|
|
|
</vfs>
|
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<service name="Uplink"> <child name="nic_router"/> </service>
|
|
|
|
<service name="Rtc"> <any-child/> </service>
|
|
|
|
<service name="Report" label="accesspoints"> <child name="accesspoints_report_rom"/> </service>
|
|
|
|
<service name="Report" label="state"> <child name="state_report_rom"/> </service>
|
|
|
|
<service name="Report" label="devices"> <child name="devices_report_rom"/> </service>
|
|
|
|
<service name="ROM" label="wifi_config"> <child name="config_rom"/> </service>
|
2023-05-02 16:17:56 +00:00
|
|
|
<service name="ROM" label="wifi.lib.so"> <parent label="pc_wifi.lib.so"/> </service>
|
2023-05-03 15:34:22 +00:00
|
|
|
<service name="ROM" label="wifi_firmware.tar"> <parent label="pc_wifi_firmware.tar"/> </service>
|
2022-02-10 17:09:17 +00:00
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
</config>
|
|
|
|
}
|
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
2023-05-03 15:34:22 +00:00
|
|
|
#
|
|
|
|
# Provide dummy 'wifi.lib.so' shared-object for
|
|
|
|
# boot-module assembly
|
|
|
|
#
|
|
|
|
if {$debug_driver} {
|
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-09-03 14:06:02 +00:00
|
|
|
catch {exec rm bin/wifi.lib.so}
|
2023-05-03 15:34:22 +00:00
|
|
|
exec echo dummy > bin/wifi.lib.so
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-02-10 17:09:17 +00:00
|
|
|
#
|
|
|
|
# Boot modules
|
|
|
|
#
|
|
|
|
|
2023-04-12 11:56:12 +00:00
|
|
|
build_boot_image [build_artifacts]
|
2022-02-10 17:09:17 +00:00
|
|
|
|
|
|
|
run_genode_until forever
|
|
|
|
|
|
|
|
# vi: set ft=tcl :
|