2022-05-17 15:56:57 +00:00
|
|
|
WS_CONTRIB_DIR := $(call select_from_ports,wpa_supplicant)/src/app/wpa_supplicant
|
2014-11-22 14:13:43 +00:00
|
|
|
WS_DIR := $(REP_DIR)/src/lib/wpa_supplicant
|
|
|
|
|
2015-08-17 13:14:48 +00:00
|
|
|
LIBS += libc libcrypto libssl wpa_driver_nl80211
|
2014-11-22 14:13:43 +00:00
|
|
|
|
|
|
|
SHARED_LIB = yes
|
|
|
|
LD_OPT += --version-script=$(WS_DIR)/symbol.map
|
|
|
|
|
|
|
|
CC_OPT += -Wno-unused-function
|
|
|
|
|
|
|
|
CC_CXX_OPT += -fpermissive
|
|
|
|
|
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
|
|
|
SRC_C += main.c
|
|
|
|
SRC_CC += ctrl_iface_genode.cc
|
2018-07-04 15:13:16 +00:00
|
|
|
INC_DIR += $(REP_DIR)/include
|
|
|
|
|
2014-11-22 14:13:43 +00:00
|
|
|
|
|
|
|
# wpa_supplicant
|
2023-05-11 08:40:11 +00:00
|
|
|
SRC_C_wpa_supplicant = bssid_ignore.c \
|
2018-07-04 15:13:16 +00:00
|
|
|
bgscan.c \
|
|
|
|
bgscan_simple.c \
|
2014-11-22 14:13:43 +00:00
|
|
|
bss.c \
|
|
|
|
config.c \
|
|
|
|
config_file.c \
|
2018-04-23 13:45:47 +00:00
|
|
|
ctrl_iface.c \
|
2014-11-22 14:13:43 +00:00
|
|
|
eap_register.c \
|
|
|
|
events.c \
|
|
|
|
notify.c \
|
2018-04-23 13:45:47 +00:00
|
|
|
op_classes.c \
|
2023-05-11 08:40:11 +00:00
|
|
|
robust_av.c \
|
2018-04-23 13:45:47 +00:00
|
|
|
rrm.c \
|
2014-11-22 14:13:43 +00:00
|
|
|
scan.c \
|
|
|
|
sme.c \
|
2018-04-23 13:45:47 +00:00
|
|
|
wmm_ac.c \
|
2024-09-02 14:07:40 +00:00
|
|
|
wnm_sta.c \
|
2014-11-22 14:13:43 +00:00
|
|
|
wpa_supplicant.c \
|
|
|
|
wpas_glue.c
|
2023-05-11 08:40:11 +00:00
|
|
|
#
|
|
|
|
# Disable warning as the pointer in question is only used as
|
|
|
|
# token to check against a stored pointer.
|
|
|
|
#
|
|
|
|
CC_OPT_wpa_supplicant/bss += -Wno-use-after-free
|
|
|
|
|
2014-11-22 14:13:43 +00:00
|
|
|
SRC_C += $(addprefix wpa_supplicant/, $(SRC_C_wpa_supplicant))
|
|
|
|
INC_DIR += $(WS_CONTRIB_DIR)/wpa_supplicant
|
|
|
|
CC_OPT += -DCONFIG_BACKEND_FILE -DCONFIG_NO_CONFIG_WRITE \
|
2018-07-04 15:13:16 +00:00
|
|
|
-DCONFIG_SME -DCONFIG_CTRL_IFACE \
|
2023-05-11 08:40:11 +00:00
|
|
|
-DCONFIG_BGSCAN -DCONFIG_BGSCAN_SIMPLE \
|
2023-05-20 21:19:56 +00:00
|
|
|
-DCONFIG_OPENSSL_CMAC -DCONFIG_SHA256 \
|
2024-09-02 14:07:40 +00:00
|
|
|
-DCONFIG_SAE -DCONFIG_ECC -DCONFIG_WNM
|
2018-04-23 13:45:47 +00:00
|
|
|
|
|
|
|
CC_OPT += -DTLS_DEFAULT_CIPHERS=\"DEFAULT:!EXP:!LOW\"
|
2014-11-22 14:13:43 +00:00
|
|
|
|
|
|
|
INC_DIR += $(WS_CONTRIB_DIR)/src/
|
|
|
|
|
|
|
|
# common
|
2018-04-23 13:45:47 +00:00
|
|
|
SRC_C_common = ieee802_11_common.c wpa_common.c hw_features_common.c \
|
2024-09-02 14:07:40 +00:00
|
|
|
ctrl_iface_common.c sae.c dragonfly.c ptksa_cache.c
|
2014-11-22 14:13:43 +00:00
|
|
|
SRC_C += $(addprefix src/common/, $(SRC_C_common))
|
|
|
|
INC_DIR += $(WS_CONTRIB_DIR)/src/common
|
|
|
|
|
|
|
|
# crypto
|
2018-04-23 13:45:47 +00:00
|
|
|
SRC_C_crypto = crypto_openssl.c \
|
2023-05-20 21:19:56 +00:00
|
|
|
dh_groups.c \
|
2014-11-22 14:13:43 +00:00
|
|
|
ms_funcs.c \
|
|
|
|
random.c \
|
|
|
|
sha1-prf.c \
|
|
|
|
sha1-tlsprf.c \
|
2023-05-11 08:40:11 +00:00
|
|
|
sha256-prf.c \
|
2023-05-20 21:19:56 +00:00
|
|
|
sha256-kdf.c \
|
2014-11-22 14:13:43 +00:00
|
|
|
tls_openssl.c
|
|
|
|
SRC_C += $(addprefix src/crypto/, $(SRC_C_crypto))
|
|
|
|
INC_DIR += $(WS_CONTRIB_DIR)/src/crypto
|
|
|
|
|
|
|
|
SRC_C += src/drivers/driver_common.c
|
|
|
|
|
|
|
|
# eap_common
|
|
|
|
SRC_C_eap_common = chap.c \
|
|
|
|
eap_common.c \
|
|
|
|
eap_peap_common.c
|
|
|
|
SRC_C += $(addprefix src/eap_common/, $(SRC_C_eap_common))
|
|
|
|
INC_DIR += $(WS_CONTRIB_DIR)/src/eap_common
|
|
|
|
|
|
|
|
# eap_peer
|
|
|
|
SRC_C_eap_peer = eap.c \
|
|
|
|
eap_gtc.c \
|
|
|
|
eap_leap.c \
|
|
|
|
eap_md5.c \
|
|
|
|
eap_methods.c \
|
|
|
|
eap_mschapv2.c \
|
|
|
|
eap_otp.c \
|
|
|
|
eap_peap.c \
|
|
|
|
eap_tls.c \
|
|
|
|
eap_tls_common.c \
|
|
|
|
eap_ttls.c \
|
|
|
|
mschapv2.c
|
|
|
|
SRC_C += $(addprefix src/eap_peer/, $(SRC_C_eap_peer))
|
|
|
|
INC_DIR += $(WS_CONTRIB_DIR)/src/eap_peer
|
|
|
|
CC_OPT += -DEAP_TLS -DEAP_PEAP -DEAP_TTLS -DEAP_MD5 -DEAP_MSCHAPv2 \
|
|
|
|
-DEAP_OTP -DEAP_LEAP
|
|
|
|
|
|
|
|
# eapol_supp
|
|
|
|
SRC_C += src/eapol_supp/eapol_supp_sm.c
|
|
|
|
INC_DIR += $(WS_CONTRIB_DIR)/src/eapol_supp
|
|
|
|
CC_OPT += -DIEEE8021X_EAPOL
|
|
|
|
|
|
|
|
# rsn_supp
|
2018-04-23 13:45:47 +00:00
|
|
|
SRC_C_rsn_supp = pmksa_cache.c \
|
2014-11-22 14:13:43 +00:00
|
|
|
preauth.c \
|
|
|
|
wpa.c \
|
|
|
|
wpa_ie.c
|
|
|
|
SRC_C += $(addprefix src/rsn_supp/, $(SRC_C_rsn_supp))
|
|
|
|
INC_DIR += $(WS_CONTRIB_DIR)/src/rsn_supp
|
|
|
|
CC_OPT += -DCONFIG_PEERKEY
|
|
|
|
|
|
|
|
# utils
|
|
|
|
SRC_C_utils = base64.c \
|
2018-04-23 13:45:47 +00:00
|
|
|
bitfield.c \
|
2014-11-22 14:13:43 +00:00
|
|
|
common.c \
|
2023-05-11 08:40:11 +00:00
|
|
|
config.c \
|
2014-11-22 14:13:43 +00:00
|
|
|
eloop.c \
|
|
|
|
os_unix.c \
|
|
|
|
radiotap.c \
|
|
|
|
wpa_debug.c \
|
|
|
|
wpabuf.c
|
|
|
|
SRC_C += $(addprefix src/utils/, $(SRC_C_utils))
|
|
|
|
INC_DIR += $(WS_CONTRIB_DIR)/src/utils
|
|
|
|
CC_OPT += -DCONFIG_ELOOP_POLL
|
|
|
|
|
|
|
|
vpath %.c $(WS_CONTRIB_DIR)
|
2014-12-10 09:08:51 +00:00
|
|
|
vpath %.c $(WS_DIR)
|
|
|
|
vpath %.cc $(WS_DIR)
|
2018-01-03 17:40:54 +00:00
|
|
|
|
|
|
|
CC_CXX_WARN_STRICT =
|