Add SoftAP support to the ST67W611M1 Wi-Fi driver.
Add a build test for the ST67W611M1_WIFI_STA_SAP_MODE config.
Also update doc and samples (zperf, wifi/apsta) for the X-NUCLEO-67W61M1
shield according to the SoftAP support.
Signed-off-by: Eliott Speyser <eliott.speyser@st.com>
The scan and status handlers had no case for the WPA/WPA2 and
WPA2/WPA3 transition authmodes, so mixed-mode access points were
reported as UNKNOWN. Feeding such a result back into a connect
request was then rejected. Map both to WPA_AUTO_PERSONAL, which
is how other Wi-Fi drivers group these modes, and map the DPP
authmode to its own security type.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
k_sleep() and k_usleep() resolve to an out of line implementation living in
another translation unit, a system call under CONFIG_USERSPACE and a plain
call otherwise. Either way the compiler sees neither whether the requested
duration is a constant nor whether the caller cares about the returned
value, so it always emits the tick to millisecond and microsecond
conversions. Those conversions are the only thing that drags the 64 bit
division helper into many small builds: CONFIG_SYS_CLOCK_TICKS_PER_SEC
defaults to 10000 on tickless platforms, which lands in the integer
division path and divides a 64 bit value by ten, something GCC will not
strength reduce on a 32 bit target.
Promote the former z_tick_sleep() helper to a k_sleep_ticks() system call
that reports the remaining time in ticks, and rebuild k_sleep() and
k_usleep() as inlines on top of it. The conversions now live at the call
site where the compiler can fold or discard them. Nearly every caller
discards them: of the 4036 sleep call sites in the tree, exactly six use
the returned value, and only three of those are outside of tests.
What this removes is best seen in the two out of line entry points that
disappear, which on a nucleo_f030r8 (Cortex-M0, 10000 ticks/s) were the
only two callers of the 64 bit division helper in the whole image:
08002594 <z_impl_k_sleep>:
bl 8001... <z_tick_sleep>
...
movs r0, #9 /* the ceil() bias, 10 - 1 */
adds r0, r0, r2
adcs r1, r3
movs r2, #10 /* ticks / 10 -> milliseconds */
bl 8000180 <__aeabi_uldivmod>
080025c0 <z_impl_k_usleep>:
movs r0, #99 /* the ceil() bias, 100 - 1 */
...
movs r2, #100 /* microseconds / 100 -> ticks */
bl 8000180 <__aeabi_uldivmod>
bl 8001... <z_tick_sleep>
Both are gone, and so are __aeabi_uldivmod and __udivmoddi4, which are no
longer referenced anywhere. A k_usleep(250) call site now passes the
literal 3 ticks the compiler worked out on its own, where it used to pass
250 microseconds to a helper that divided by 100 at runtime. For a loop
calling k_msleep(100), k_sleep(K_SECONDS(1)) and k_usleep(250) without
using the results, FLASH drops from 11028 to 10600 bytes.
No trace point is emitted here. The existing sleep hooks take a duration
in milliseconds or microseconds, which no longer describes what this
function is handed, and tracing cannot live in the inlines either: every
tracing backend header includes kernel.h, so a translation unit reaching a
backend header first would expand SYS_PORT_TRACING_* before those macros
exist. The following commit gives k_sleep_ticks() a hook of its own.
The duration goes through Z_TIMEOUT_US() rather than an open coded
conversion. That clamps a negative argument to zero, which k_usleep()
never did: it used to truncate the 64 bit conversion into an int32_t
first, which hid the worst of it, and passing it through whole would turn a
negative duration into a sleep of roughly 1.8e17 ticks rather than a bogus
absolute deadline. The macro also carries the cast to k_ticks_t that C++
needs, since Z_TIMEOUT_TICKS_INIT() is a braced initializer there and an
unsigned to signed conversion inside one is a narrowing error.
This also removes a potential link error. k_usleep() had no
implementation at all with CONFIG_MULTITHREADING=n, since nothread.c only
ever provided z_impl_k_sleep(), so any caller failed to link. Nothing in
the tree happens to call it in that configuration, which is presumably why
it went unnoticed; a single z_impl_k_sleep_ticks() now serves both.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
WIFI_RECOVERY was only available for RW610 and IW610,
extend the depends to also support IW61X
and IW416 which use SDIO interface and can leverage
the same command-timeout-based recovery mechanism.
Signed-off-by: Gaofeng Zhang <gaofeng.zhang@nxp.com>
Remove the val < 0 comparison in nrf_wifi_util_req_extended_sleep().
val is unsigned long, so that condition is always false.
Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
Add the Wi-Fi driver for an Espressif coprocessor running
esp-hosted-mcu firmware. The driver registers station and access point
interfaces with the network stack and carries their frames over the
esp-hosted-mcu transport core.
Management operations are driven over RPC against the coprocessor
esp_wifi API: scan, connect and disconnect, access point enable and
disable, mode and channel, power save, connected access point details
and station deauthentication. Connection results and station events
are reported asynchronously from the coprocessor event stream.
Assisted-by: Claude Code:opus-4-8
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Implemented get_iface_caps() in NXP wifi driver. It will check net
interface capability and return corresponding bitmask of
BIT(enum wifi_nm_iface_type).
Signed-off-by: Hui Bai <hui.bai@nxp.com>
k_sleep() and k_usleep() resolve to an out of line implementation living in
another translation unit, a system call under CONFIG_USERSPACE and a plain
call otherwise. Either way the compiler sees neither whether the requested
duration is a constant nor whether the caller cares about the returned
value, so it always emits the tick to millisecond and microsecond
conversions. Those conversions are the only thing that drags the 64 bit
division helper into many small builds: CONFIG_SYS_CLOCK_TICKS_PER_SEC
defaults to 10000 on tickless platforms, which lands in the integer
division path and divides a 64 bit value by ten, something GCC will not
strength reduce on a 32 bit target.
Promote the former z_tick_sleep() helper to a k_sleep_ticks() system call
that reports the remaining time in ticks, and rebuild k_sleep() and
k_usleep() as inlines on top of it. The conversions now live at the call
site where the compiler can fold or discard them. Nearly every caller
discards them: of the 4036 sleep call sites in the tree, exactly six use
the returned value, and only three of those are outside of tests.
What this removes is best seen in the two out of line entry points that
disappear, which on a nucleo_f030r8 (Cortex-M0, 10000 ticks/s) were the
only two callers of the 64 bit division helper in the whole image:
08002594 <z_impl_k_sleep>:
bl 8001... <z_tick_sleep>
...
movs r0, #9 /* the ceil() bias, 10 - 1 */
adds r0, r0, r2
adcs r1, r3
movs r2, #10 /* ticks / 10 -> milliseconds */
bl 8000180 <__aeabi_uldivmod>
080025c0 <z_impl_k_usleep>:
movs r0, #99 /* the ceil() bias, 100 - 1 */
...
movs r2, #100 /* microseconds / 100 -> ticks */
bl 8000180 <__aeabi_uldivmod>
bl 8001... <z_tick_sleep>
Both are gone, and so are __aeabi_uldivmod and __udivmoddi4, which are no
longer referenced anywhere. A k_usleep(250) call site now passes the
literal 3 ticks the compiler worked out on its own, where it used to pass
250 microseconds to a helper that divided by 100 at runtime. For a loop
calling k_msleep(100), k_sleep(K_SECONDS(1)) and k_usleep(250) without
using the results, FLASH drops from 11028 to 10600 bytes.
Tracing stays in the out of line implementation. It cannot move into the
inlines because every tracing backend header includes kernel.h, so a
translation unit that reaches a backend header first would expand
SYS_PORT_TRACING_* before those macros exist. A consequence is that the
sleep_exit hook now reports ticks rather than milliseconds and the usleep
hook is no longer emitted; both are covered in a following commit.
The microsecond duration is clamped to zero the way Z_TIMEOUT_US() already
does. k_usleep() never did that, but it used to truncate the 64 bit
conversion into an int32_t before handing it over, which hid the worst of
it.
Passing the conversion through whole would turn a negative duration into a
sleep of roughly 1.8e17 ticks rather than a bogus absolute deadline.
This also removes a potential link error. k_usleep() had no
implementation at all with CONFIG_MULTITHREADING=n, since nothread.c only
ever provided z_impl_k_sleep(), so any caller failed to link. Nothing in
the tree happens to call it in that configuration, which is presumably why
it went unnoticed; a single z_impl_k_sleep_ticks() now serves both.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
MISRA C:2012 Rule 8.2 requires every parameter in a function type to be
named, including the parameters of function pointer parameters.
The Wi-Fi NAN shell dispatcher, the esp_hosted and Bouffalo Lab drivers
and the hostap and nrf_wifi glue declared callbacks with bare types.
Name them after the arguments the documentation or the
definitions already use. No functional change.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
SSIDs have a maximum length of 32 bytes, and the buffer used
by the HAL has this size. Ensure the length field matches the
data stored in the buffer.
The HAL does not expect the buffer to be null terminated, so
it is safe to use strnlen to compute the length.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Wrap stored DNS addresses (resolver servers, dispatcher local
address, addrinfo results, mDNS server) in unions with a storage
sibling. Use storage-sized buffers for recv, server compare/copy,
and management event payloads.
Assisted-by: Cursor:composer-2.5
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
net_get_if_ip_addr() dereferences config.ip.ipv4 without NULL check.
When STA interface has never been brought up (dormant since init),
this pointer is NULL. On RT1060, the NULL dereference reads ITCM
code memory at address 0x4, returning a non-zero value that is
misinterpreted as a valid IP address, causing is_sta_ipv4_connected()
to incorrectly return true and breaking MEF host sleep wakeup.
The system does not crash because address 0x00000000 on RT1060 maps
to ITCM (Instruction Tightly Coupled Memory), which contains valid
relocated code (.itcm_text_reloc section). Reading from this region
is a legal memory access at the hardware level, so no HardFault or
MemManage fault is triggered.
Add NULL check for ipv4 pointer before accessing unicast address.
Signed-off-by: Qiankun Li <qiankun.li@nxp.com>
Extended sleep interval is the period during which STA will stop all
types of TX/RX. Through this command user can configure the quiet period.
Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
Add ext1-pwren-gpios binding to nxp,wifi.yaml for M.2 module VPCIe_3V3
power control. On imx91 (AArch64), GPC is not available so read
WL_WAKE_HOST GPIO directly via wakeup_gpios DT property instead.
Use CONFIG_PM_MCUX_GPC to guard fsl_gpc.h include, which is more
precise than excluding by SoC series.
Signed-off-by: Li Long <li.long@nxp.com>
This macro eliminates manual size/alignment management and prevents
namespace collisions by moving internal queues to file-private scope.
Signed-off-by: Cesar Vandevelde <cesar.vandevelde@gmail.com>
esp32_wifi_connect() sets data->state = ESP32_STA_CONNECTING before
validating the security parameters and before the synchronous calls
into the ESP Wi-Fi library. Every synchronous error return after that
point leaves the state at CONNECTING: the entry gate then rejects all
subsequent connect attempts with -EALREADY, and since no connection
was ever initiated, no Wi-Fi event will arrive to reset the state.
One failed connect (unsupported security mode, enterprise
configuration failure, esp_wifi_set_config() or esp_wifi_connect()
error) permanently wedges the interface until reboot.
Restore ESP32_STA_STARTED on all synchronous error paths so the
driver is ready for the next attempt.
Observed in the field on ESP32-C6: a provisioning request carrying an
SAE security mode on a build without CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE
returned -EINVAL once and the interface could never reconnect again
without a power cycle. Fix carried as a downstream patch on v4.3.1 and
v4.4.1 and validated on hardware there.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Linus Rüttimann <linus@noxblanc.com>
Add `CONFIG_ST67W611M1_WIFI_AUTO_CONNECT` to control persistent
auto-connect setting `AT+CWAUTOCONN`.
During init the driver reads `AT+CWAUTOCONN?` and only issues
`AT+CWAUTOCONN=<0|1>` when the module's current value differs,
so the module's flash is not rewritten on every boot.
Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
The init sequence never put the coprocessor into station mode, so on a
freshly flashed module the first AT+CWJAP is rejected with ERROR and
wifi connect always fails.
Issue AT+CWMODE=1,1 during initialization. This matches ST's ST67W6X
SDK, which sets station mode in W61_WiFi_Station_Start(), called early in
W6X_WiFi_Init() (before auto-connect, country code and DTIM setup). The
auto-connect field is left at the firmware default (1) so mode changes
rely on the saved flash configuration.
Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
Use #include <> instead of #include "" to include a header file which path
is not relative to the directory path of the file emitting the #include
directive.
This change was made running scripts/check_quoted_includes.py script
proposed in https://github.com/zephyrproject-rtos/zephyr/pull/112135
with Linux shell commands like the one below and manually selecting the
applicable changes: only those located in drivers/ since soc/, boards/,
samples/ and tests/ content related to Espressif is addressed in
pull request https://github.com/zephyrproject-rtos/zephyr/pull/112190.
$ ./scripts/check_quoted_includes.py -w \
`./scripts/get_maintainer.py list "Espressif Platforms"`
Also update drivers/clock_control/clock_control_esp32_priv.h that was
not listed by './scripts/get_maintainer.py list "Espressif Platforms"'.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Presently the Offloaded raw TX API names are tied to the nRF70 platform.
So make the API names platform agnostic.
Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
The configdefault for NET_BUF_ALIGNMENT references DCACHE_LINE_SIZE
unconditionally. On platforms where CACHE_MANAGEMENT is enabled but
CACHE_TYPE is not DCACHE (e.g., EXTERNAL_CACHE for instruction-only
caches), the DCACHE_LINE_SIZE symbol is hidden inside `if DCACHE`
and resolves to 0. Kconfig stores int 0 as an empty string, which
breaks GEN_ABSOLUTE_SYM_KCONFIG and produces an assembler error:
"missing expression".
Add an `if DCACHE` guard and use SDHC_BUFFER_ALIGNMENT for
platforms without DCACHE, which reflects the actual USDHC ADMA2
DMA transfer alignment requirement.
Signed-off-by: Qiankun Li <qiankun.li@nxp.com>
Add an Ethernet-over-mesh network interface, gated by
CONFIG_WIFI_ESP32_MESH_IP, so the Zephyr IP stack runs over the
mesh. The IP-level policy is left to the application.
The interface and the raw mesh send and receive API both drain
the single mesh receive queue, which has no demultiplexing, so
they are mutually exclusive at build time. Folding both into one
reader that switches on the frame protocol tag would let them
coexist.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add the Kconfig options and driver plumbing for the Espressif
Wi-Fi mesh stack. The mesh id, channel, credentials, tree limits
and node role are configurable.
The mesh stack owns both interfaces while it runs, so the
station and softAP management operations are rejected with
-EBUSY rather than left to fight it. Mesh is a boot-time mode
with no runtime teardown, which the API documents.
Bring-up waits for the stack to report that it started before
re-delivering the initial station-start event the mesh missed,
instead of assuming a fixed delay is enough.
A fixed root keeps the self-organized behavior when a router is
configured, since that is what drives its association to the
router and the reconnection that maintains the uplink. Only a
router-less fixed root stops the parent search, which would
otherwise scan for a parent that does not exist and disrupt its
softAP.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Run the Wi-Fi and mesh event handlers on a dedicated task rather
than on the Wi-Fi library task, so a handler cannot overrun or
stall it. This applies to the station and softAP paths as well,
not only to mesh: handler work is decoupled from the library
task everywhere. The task stack, priority and queue depth are
configurable.
Delivery is asynchronous, so a caller that must observe a state
change synchronizes on the event instead of reading the state
right after the call returns. A full queue drops the event and
logs at error level; the depth is sized for the bursts a mesh
re-parent or softAP client churn produces.
Each entry carries an inline copy of the payload, so the buffer
is sized at 64 bytes: enough for every event handled here, whose
largest payload is 48 bytes, with margin for a vendor struct
that grows. A build assertion checks the handled event sizes
against it, turning such a growth into a compile error instead
of a runtime drop. An event too large for the buffer is rejected
rather than delivered without its data, so a handler is never
invoked with a null payload it expects to dereference.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Adjust defaults on nRF70 Series for a lower RAM footprint.
A 130 kB heap is too large for many applications.
Signed-off-by: Simon Duquennoy <simon.duquennoy@nordicsemi.no>
Before this change, the host performed half-duplex SPI transactions,
which caused frames that happen to be queued by ESP at the same time
of a TX transfer to be dropped. This is especially noticeable with
the new firmware.
Rework the driver so every SPI transaction is full-duplex: outgoing
frames are queued and the event task drains TX while simultaneously
capturing RX, so nothing is lost.
Other major improvements of the driver:
* Remove SPI bus semaphore, since only the event task uses the bus now.
* Reduce stack usage of all threads by 50% by refactoring data structures.
* Simplify event task by moving fragment validation and reassembly into
a utility function.
* Fix undefined behavior in checksum validation.
* Fix the reassembly overflow guard (was off by twice the header).
* Split TX/RX queue sizes into separate Kconfig options.
* Fix and improve error codes usage (use -ENOBUFS, -EMSGSIZE, etc).
Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
Every send failure returned -EIO, hiding whether the packet
could be retried. Return -ENOBUFS when the TX buffers do not
free up in time and -EMSGSIZE when the frame does not fit.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Frames were dropped as soon as the low-level TX buffers ran
out, losing data from bursty senders. Wait for an in-flight
frame to complete and retry, bounded by a timeout.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
In the zero-copy TX path, nxp_wifi_internal_tx() copies the Ethernet
header into the outbuf structure but keeps the original ETH header
net_buf attached to the net_pkt. This wastes one tx_buf slot per
packet while it sits in the WMM queue waiting to be transmitted.
Under heavy TX backpressure (e.g. during roaming with continuous
traffic), this doubles the effective tx_buf consumption per queued
packet, leading to premature tx_buf pool exhaustion.
After copying the ETH header, use net_pkt_frag_del() to release the
first fragment when it contains exactly the ETH header. The payload
fragment remains attached and the cursor position is unaffected since
it already points past the ETH header.
Assisted-by: WChat:Claude
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Add NXP_WIFI_EXT_ANT_GAIN Kconfig option to enable runtime
configuration of net antenna gain per sub-band via host command
API.
This kconfig is only applicable to RW61x.
Signed-off-by: Gang Li <gang.li_1@nxp.com>
Wi-Fi driver for ST67W611M1 coprocessor.
It communicates with an SPI interface and depends on Zephyr's own
TCP/IP stack.
Communication with host is a mix of AT commands (scan, connect,...)
and raw L2 layer data frames.
Signed-off-by: Eliott Speyser <eliott.speyser@st.com>
Add an in-process virtual Wi-Fi simulator (wifi_hwsim) for testing the
Zephyr Wi-Fi stack (wpa_supplicant / hostapd -> driver) without
physical hardware, modeled after Linux's mac80211_hwsim.
The driver instantiates N virtual radios from devicetree, each backed
by a net_if with Ethernet L2 and Wi-Fi offload. An in-process
frame-relay "medium" connects radios tuned to the same frequency.
Management frames (802.11) are handed to wpa_supplicant; data frames
(802.3) are delivered by L2 destination MAC, so a unicast frame reaches
only the matching radio while broadcast/multicast frames reach all
peers on the channel.
Because all radios share a single IP stack, a peer's source address is
also a local address. Injected data frames are flagged as loopback so
they are not dropped by the IP input anti-spoof check; deployments must
also disable the "destination is my own address" short-circuit
(CONFIG_NET_IP_ADDR_CHECK) so inter-radio data frames traverse the
medium.
Open, WPA2-PSK and WPA3-SAE associations work end to end. Since both
radios live in one process, the driver relays the association between
the STA and AP contexts as an EVENT_ASSOC carrying the STA's RSN IE (the
way a FullMAC firmware reports it) rather than serializing
(Re)Association frames. For a secured network the STA port is left
unauthorized so wpa_supplicant runs the real 4-way handshake, whose
EAPOL frames cross the medium as ordinary data frames. The AP's beacon
IEs (including the RSN element) are surfaced in scan results so a STA
can match a secured network, and the AP-side station ops are accepted
so the authenticator can authorize the station.
For WPA3-SAE the driver advertises WPA_DRIVER_FLAGS_SAE and relays the
SAE Authentication commit/confirm frames over the medium (built from the
SME auth_data on the STA, parsed back into EVENT_AUTH), so the real SAE
exchange runs before the 4-way handshake.
MAC addresses follow the standard Ethernet MAC config mechanism
(local-mac-address / zephyr,random-mac-address / NVMEM via
net_eth_mac_load()), falling back to a random locally-administered
address.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Assisted-by: Claude:claude-opus-4.8
The TWT interval passed by the Wi-Fi management API is a uint64_t, but
nrf_wifi_twt_us_to_float() took a uint32_t, silently truncating any
interval above UINT32_MAX us (~71.6 min). On top of that, the encoder
worked in milliseconds and renormalised the mantissa via frexp(), which
pinned it near ~1000 and used only ~10 of the 16 mantissa bits, capping
the encodable interval at ~1000 * 2^31 us (~24 days).
Take the interval as uint64_t end to end and encode it directly in
micro-seconds using the full 16-bit mantissa and the 5-bit exponent
(max WIFI_MAX_TWT_EXPONENT). This removes the truncation and lets the
driver represent the complete range the API exposes, up to the IEEE
802.11 maximum of UINT16_MAX * 2^31 us, with exact micro-second
resolution. Intervals beyond the encodable maximum are saturated.
The over-the-air value is unchanged (mantissa * 2^exponent us), so the
firmware interface is untouched; only the host-side conversion changes.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Assisted-by: Claude:claude-opus-4.8
The management frame packet pointer error cause drop all the action
frame, so can't process neighbor report response frame, cause 11kv
roaming failure.
Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
Advanced scan ignored the configured dwell times because the
driver only updated local variables instead of the advanced scan
configuration structure. Set the active and passive channel times
on the advanced scan config directly.
Signed-off-by: Tejus Subramanya <ters@silabs.com>
The wifi_mgmt iface_status callback gained a struct net_if
pointer parameter, but esp_hosted_status was left with the old
signature, causing an incompatible pointer type error at driver
registration. Add the missing net_if parameter to match the
callback interface.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
In STA mode the interface was brought operational at association, before
the controlled port was authorized, so the IP stack transmitted data
during the 802.1X handshake window which the driver then dropped with
-EPERM.
Advertise WPA_DRIVER_FLAGS_CONTROL_PORT and implement the tx_control_port
op so EAPOL frames are handed to the driver directly instead of going
through the networking stack. With EAPOL off the data path, keep the
interface dormant from association until the controlled port is
authorized, withholding data TX during authorization while the handshake
still completes.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Assisted-by: Claude:claude-opus-4.8
add a Kconfig, that has to be selected by the
ethernet driver, when extra headroom on tx
is needed, that way we don't need to include that
code when only using NET_L2_ETHERNET_RESERVE_HEADER.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
The offload .get hook only populates offload_context when the
ESP-AT interface is the default one at net_context_get() time.
When ESP-AT is a secondary interface, a context can be routed or
bound to it afterwards and reach the offload send, recv, bind and
connect ops with a NULL offload_context, leading to a NULL
dereference.
Allocate the backing socket lazily on first use through a helper
so the driver works regardless of interface ordering, and guard
the put op against a context that never reached the offload layer.
The helper rejects non-IPv4 contexts before claiming a pool slot,
and only claims contexts whose interface is the ESP-AT one so a
context routed to another interface, such as DNS resolved over a
native Ethernet iface, is left for that interface to service.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add a native Zephyr WiFi driver for the BL616/BL618 SoC family.
The driver interfaces with the vendor macsw blob through wl80211 and
implements the Zephyr wifi_mgmt API for station connect/disconnect,
scanning, and AP mode. WPA supplicant integration is provided via
the hostap subsystem.
Signed-off-by: William Markezana <william.markezana@gmail.com>