Support zero-length SDU sending if the L2CAP channel connection is not
in basic mode.
Flag the zero-length SDU buffer and clear it if it has been processed.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The help message for the wifi mode -s command indicates it sets
the Wi-Fi mode to station. However, the Zephyr Wi-Fi shell subsystem
was incorrectly using a get operation instead of set.
This commit corrects the behavior to properly set the Wi-Fi mode,
aligning the implementation with the help message.
Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Soft ap supports WIFI_BTWT_AGREEMENT_MAX BTWT sessions.
The BTWT parameters for each session can be different.
The current usage can only set one set of parameters.
All sessions follow this set of parameters.
Add enhance code to support setting different
BTWT parameters for every sessions.
Usage:
wifi twt btwt_setup <sta_wait> <offset>
<twtli> <session_num>
<id0> <mantissa0> <exponent0> <nominal_wake0>
<id1> <mantissa1> <exponent1> <nominal_wake1>
<idx> <mantissax> <exponentx> <nominal_wakex>
The total number of '0, 1, ..., x' is session_num
For example:
wifi twt btwt_setup 0 0 0 2 0 112 10 128 1 32 10 64
Signed-off-by: Qiankun Li <qiankun.li@nxp.com>
The usbd_class_remove_all removes all registered classes from a
configuration. However, it previously left the uds_ctx back-pointer to the
usdb_context set, meaning that if the class is re-registered with the
usbd_register_class function, this fails with the error message "Class
registered to other context at different speed" due to uds_ctx being set to
another context.
This patch corrects the issue by clearing udc_ctx after usbd_class_shutdown
has been called.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
Commit changes BT_MESH_DFU_FWID_MAXLEN option to be
compliant with BLE Mesh specification.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Fix logging `Could not disable card power via SDHC` when the attempted
operation is turning power on. Update several other logging strings to
minimise the number of unique strings required.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Some applications require loading extensions into the memory which does
not exist during the boot time and cannot be allocated statically. Make
the application responsible for LLEXT heap allocation. Do not allocate
LLEXT heap statically.
Signed-off-by: Alex Ivanov <alexivanov@google.com>
htonl() and htons() take uint32_t/uint16_t as argument. Add the 'u' suffix
to constants to ensure the correct unsigned type is used and to avoid
undefined behavior if these functions are implemented as macros using
bit shifts.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
If the controller resolving list is cleared by HCI_LE_Clear_Resolving_List,
don't need to enable the controller address resolution.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
Disable the high-speed USB device descriptor if it is not in use.
Add checks to the code where the high-speed descriptor may be used.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The required buffer is 128 bytes per instance on a full-speed device.
Use common (UDC) buffer, as this results in a smaller footprint.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Disable high-speed descriptors when they are not in use saves 64 bytes
in flash/RAM. It is unlikely that it will scale well enough to be used
in all class implementations or to support a different speed.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Add Kconfig option to use dedicated workqueue in CDC ACM but use the
system work queue in CDC ACM by default.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Allowing message callback execution from the USBD thread saves about 800
bytes. For small devices, the option can be useful to reduce flash/RAM
usage, those with enough resources should not bother about it.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Also allow `gethostname` to be compiled in, even when the socket offloading
option is selected.
Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
Add support for skipping UDP upload server report, useful in test TX
only with loopback (packets are dropped, so, no report).
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
The send_queue was used as SYN/FIN packet retransmission. Before
the SYN/FIN being ACKed and dequeue-ed, the following packets in
the send_queue cannot be sent out. That's why Zephyr had to send
a FIN+ACK instead of a duplicated ACK-only in FINWAIT1, CLOSING.
In fact, we can take SYN/FIN as kind of data and use the same
send_data_timer for retransmission, like other OSes do. This way,
the send_queue is simply used for local traffics.
Benefits (in theory):
1. The code is easier,
2. TxPkt performance is better after skipping enq/deq send_queue,
3. The struct tcp{} node is a few bytes smaller, saving memory.
Signed-off-by: Shrek Wang <inet_eman@outlook.com>
During testing and code inspection, there were various anti-patterns
on this (and U-Blox driver) codebase(s), including obfuscation, and
lack of data validation. This made it increasingly difficult to
introduce further variants of u-blox GNSS modems.
With this patch, both the UBX modem and the M8 driver have been
refactored to ease the reliability and maintainability of these
codebases. Here are some highlights:
WRT UBX modem:
- Helper macros to easily create UBX frames, (including checksum
calculation), at compile time; thus, making it easier to extend UBX
commands.
- Logic validation by the inclusion of the modem_ubx testsuite, used to
refactor the code through TDD.
- Ability to receive unsolicited messages, in order to enable U-Blox
drivers to rely on modem_ubx to transceive all commands, and avoid
hopping between modem_ubx and modem_chat.
WRT M8 driver:
- Remove GNSS specific protocol header files. Instead, unify them under
modem/ubx/protocol.h. Background: After a survey and looking at ubxlib
SDK I conclude the UBX protocol is by definition a GNSS protocol (there
are non-GNSS u-blox modems, but they're not interfaced through UBX
protocol).
- Establish pattern to create and send/receive commands using new
foundations on modem ubx.
- Remove dependency of Modem chat, and instead use UBX unsolicited
messages to get Navigation and Satellites data.
- Switch from the auto-baudrate detection pattern to a pattern of
transitioning between an initial known baudrate to a desired baudrate,
in order to improve initialization time.
- Add dts property to configure default fix-rate.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Refactor this code so it has less nesting and is able to share some code
between functions, by making a function to find the device constraints
object which can be called before doing operations using it.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
If we're parsing a CoAP request with an observe option of '1', but there is
no matching observer, return an error instead of returning a zero.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Handle the ECHO request/response of classic L2CAP signaling packets.
Add the functions `bt_l2cap_br_echo_cb_register()` and
`bt_l2cap_br_echo_cb_unregister()` to register/unregister the ECHO
callbacks to monitor the ECHO REQ and RSP.
Add the function `bt_l2cap_br_echo_req()` to send the ECHO REQ through
classic L2CAP signaling channel.
Add the function `bt_l2cap_br_echo_rsp()` to reply the ECHO REQ
through the classic L2CAP signaling channel.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
When both PRINTK and ASSERT are disabled, the firmware image will still
contain a symbol for assert_print function which increases the memory
footprint by 14 bytes. In this case the function doesn't do anything and
so these 14 bytes are not useful.
This change also reduces the memory footprint elsewhere such as in the
bluetooth subsystem which implements BT_ASSERT_VERBOSE. Now it will be
nop. On nRF52832 this is on the order of 300 - 400 bytes when configured
for peripheral only (just as an example).
Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
TCP implementation provided the parent net_context pointer to the
accept callback instead of the user_data pointer registered with
net_tcp_accept(). This worked fine with the socket integration, as
sockets explicitly registered parent context as user_data, however it
shouldn't be hardcoded like this at the TCP level.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Do not override the last known value in backend_ctx.error with the result
of flushing.
Any previous error would be cleared and the coredump would appear to have
succeeded.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Disconnect the L2CAP channel connection if the proposed MTU is less
than min MTU or more than local supported MTU.
The main scenes are as follows.
If the proposed MTU is less than MIN MTU.
1. The channel connection of client and server is established,
2. Client/server sends channel config REQ (MTU=50),
3. Peer replies channel config RQP (Unaccepted/success with MTU=30),
4. The client/server will repeat step 3~4 if the RSP is unacceptable.
With the change applied, the local will disconnect the L2CAP channel
connection in step 3.
If the proposed MTU is more than local supported MTU.
1. The channel connection of client and server is established,
2. Client/server sends channel config REQ (MTU=50),
3. Peer replies channel config RQP (Unaccepted/success with MTU=80),
4. The client/server will repeat step 3~4 if the RSP is unacceptable.
With the change applied, the local will disconnect the L2CAP channel
connection in step 3.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Based on TCP Spec., the outgoing TCP packets shoud use SND.NXT as
the seqnum. In Zephyr, the conn->seq works as the SND.UNA and the
conn->seq + conn->unacked_len works as the SND.NXT. Currently, it
uses SND.UNA in tcp_out() as the seqnum, which might get dropped
as old packets and could not deliver the message to the peer.
A few exceptions use SND.NXT - 1 as the seqnum are: keepalive,
zero-window-probe, FIN/SYN retransmissions. And, for closing a
connection, Zephyr won't send out FIN until all the data has been
ACKed, so the conn->unacked_len is 0 and it is ok to use conn->seq
as the SND.NXT.
Signed-off-by: Shrek Wang <inet_eman@outlook.com>
Change the callback `get_ongoing_call()` of the AG from synchronous to
asynchronous mode. It will help to avoid the Bluetooth host stack be
blocked in the context of callback `get_ongoing_call()`.
Add a function `bt_hfp_ag_ongoing_calls()` to set the ongoing calls and
reply the AT command `AT+CIND?` after the callback `get_ongoing_call()`
has been notified.
Add a delayable worker to avoid the AT command `AT+CIND?` never being
replied. After the time exceeds
@kconfig{CONFIG_BT_HFP_AG_GET_ONGOING_CALL_TIMEOUT}, the response of
the AT command `AT+CIND?` will be replied.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
If the any value of Call, Call Setup, and Held Call indicators is not
zero in the response of `AT+CIND?`, get all calls via `AT+CLCC`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
For read-only access to fields, `lock/unlock` is unnecessary.
Remove unnecessary `lock/unlock` protection for read-only access
fields of AG.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Support the case that there are some calls existed before SLC
established.
Add a callback to get the ongoing calls one by one from upper layer
when the response of the AT command `AT+CIND=?` from HF has been sent.
And set the Call, Call Setup, and Held Call indicators and report the
values int the response of AT command `AT+CIND?`. Then report all
ongoing calls in the `+CLCC` response.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add support for the simcom a76xx modem which is similar to the simcom 7080
but has a few key differences. Tested with a simcom A7672SA module but as
there is a single simcom A76XX AT commands manual, the driver should work
with other modems of the series.
Signed-off-by: Olivier Lalonde <o@syskall.com>
Verify if CONFIG_NET_SOCKETS_PACKET_DGRAM is enabled when creating a
datagram packet socket. Otherwise, it's possible to create
non-functional AF_PACKET/SOCK_DGRAM socket w/o an error.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The LTK cannot be derived by LK when LK is not weaker than the old LTK.
Improve the function `smp_br_pairing_allowed()` to avoid the LTK be
overwrote when old LTK has MITM protection but new LK has not MITM
protection.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
LE and BR connection have already been established, after that, LE
disconnection occurs, BR connection will not be selected as the next
default connection.
Fix this issue by searching for both BR and LE after disconnection
occurs.
Signed-off-by: Can Wang <can.wang@nxp.com>
Host stack supports to set BR security level to 4 but the security level
cannot be set to 4 by the shell command.
Update the code to support BR security level 4.
Signed-off-by: Can Wang <can.wang@nxp.com>