In current, the bondable flag cannot be configured for each specific
BR connection.
But for LE conn, there is a function `bt_conn_set_bondable` for this
purpose.
Improve `bt_conn_set_bondable` to support BR conn.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
If the return value of function bt_get_bondable is false, clear the
bonding flag when controller requiring `Authentication_Requirements`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Removes duplicate declaration of the bridging direction, keeping the
one in the public header file.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Adds the `bt_mesh_brg_cfg` prefix to the public Subnet Bridge API, and
aligns the function and callback naming with the rest of the Bluetooth
Mesh API.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Only the device operating at high speed has bMaxPacketSize0 set to 64
bytes, the device operating at other speeds may have a different value.
For full speed, use the value from the full speed descriptor.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Add an option that links in the underlying file system libraries as
usual, but doesn't compile in the Zephyr file system abstraction layer.
This can be useful to avoid linking in the entire filesystem
implementation through the `fs_file_system_t` API struct if only a
subset of the functions are used.
Signed-off-by: Jordan Yates <jordan@embeint.com>
The check for the device being configured or suspended in the fifo_fill
implementation can starve other threads, because the early return does
not change the state of the TX path, and fifo_fill is called again
from the callback loop. The ringbuffer that emulates the TX FIFO can be
filled and marked ready as long as the space is available.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Use delayable work to reduce CPU load when there is no transfer flow in
the host direction. This also improves the performance of poll out, as
introduced in commit commit fed6bde788
("usb: device: cdc_acm: send more than 1 byte in poll out")
for the legacy CDC ACM implementation.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
When the controller is connected to a full speed bus, regardless of
whether the controller supports high speed or not, the transfer size for
the bulk OUT endpoint should be equal to the MPS in the current
configuration.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
As it is still accepted practice, allow fifo_fill and poll_out to be
used simultaneously. The lock around fifo_fill was already in place.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Apply changes in commit c152e0980c
("usb: device: cdc_acm: block in uart_poll_out() routine")
to the new CDC ACM UART poll_out implementation.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Align CDC ACM UART with Interrupt-driven UART API behavior description.
Use the same flags in uart_irq_rx_ready(), uart_irq_tx_ready(), and
uart_irq_is_pending(), which are updated after each uart_irq_update()
call. Allow TX FIFO to be filled if there is space.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Add a function bt_l2cap_br_get_remote_fixed_chan to get the remote fixed
channels.
If the fixed channel CID 0x0007 is unsupported, skip the LTK derivation.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
When pbuf_rx_init() was added, this caller did not check for a possibly
returned error to not have more overhead than before using this
function.
Although unlikely let's check for a possible error (not configured Rx
pbuf cfg).
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Current, the callback `pairing_complete` is called
when the pairing is filed. But there is a callback
`pairing_failed` for pairing failed case.
Correct the callback calling if pairing failed.
Call `pairing_failed` instead of `pairing_complete`
if the pairing failed.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Due to the BT_CONN_BR_PAIRING is cleared when
receiving ssp pairing complete event. The LTK
key cannot be derived after the BR connection
encrypted.
Add a flag BT_CONN_BR_PAIRED that the pairing
has been done.
Use this flag to indicate whether the LTK
derivation needs to be applied if the BR ACL
connection is encrypted.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
When the ssp pairing event is notified, clear the pairing
flag.
It is used to support case that the authentication is
started by peer, the link will not be encrypted after
the pairing is completed without any err.
If the local device want to encrypt the link, it could
call `bt_conn_set_security` to start encrypt the link
after the pairing complete callback triggered.
In original implementation, the `bt_conn_set_security`
cannot be called if the authentication has been started.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Currently, the bonding type of Authentication
_Requirements parameter is always `Dedicated
Bonding` if the device is pairing initiator.
But if the bonding is performed during
connection setup or channel establishment as
a precursor to accessing a service, the
bonding type should be `General bonding`.
Add a flag BT_CONN_BR_GENERAL_BONDING.
Set the flag if the bonding is performed in
the L2CAP_BR/RFCOMM channel establishment.
Set bonding type depends on the flag when
receiving IO cap request.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The `resolving` is used to flag the status that the stack is requesting
remote device name.
It is better to use the type `bool` instead of the original type
`uint8_t`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Move `struct discovery_priv` to classic.h
Rename `struct discovery_priv` to `struct bt_br_discovery_priv`.
Modify the structure `struct bt_br_discovery_priv` with `@private`.
Change field `_priv` of `struct bt_br_discovery_result` from
`uint8_t _priv[4]` to `struct bt_br_discovery_priv _priv`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Due to the update of function bt_br_discovery_start,
register discovery callback by calling
bt_br_discovery_cb_register.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Remove BR discovery callback from bt_br_discovery_start.
All discovery results will be notified through callback
registered by bt_br_discovery_cb_register.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The results of inquiry and extended inquiry
are only reported from application level
after the inquiry complete event notified.
While the event of inquiry result is notified
by controller in real time.
It is not a good user experience.
Just like scanning of LE, add a listener
cb for discovery.
When the event of inquiry result, extended
inquiry result, or remote name request
complete notified, call listener `recv`
cb to notify the upper layer.
When the event of inquiry complete
notified or no pending of remote name
request , call listener `timeout`
cb to notify the upper layer.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Currently metal_init() is called as part of libmetal_setup() which is
called after libmetal has already started being used (metal_io_init
called before). Same for metal_finish() but in reverse (metal_io_finish
called after). To fix this inline the content of libmetal_{setup,teardown}
into their one call-sites and move the init/finish calls to the correct
spot before/after all uses of the lib.
Signed-off-by: Andrew Davis <afd@ti.com>
A libmetal "generic" device is created, then opened and used for its IO
regions. Since we are adding these IO regions in the first place there
is no reason for this layer of indirection.
Signed-off-by: Andrew Davis <afd@ti.com>
A virtual metal_device is created, next the needed IO regions are created
and added to this device. Immediately we extract these regions back out
and make use of them. There is no reason to create the metal_device and
add the IO regions to it, instead simply use the IO regions directly.
This is similar to what was already done to the openamp_rsc_table sample.
Signed-off-by: Andrew Davis <afd@ti.com>
Once panic mode is entered, the log write functions are called from an ISR,
so must not try to acquire locks.
Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
Update the interrupt driver UART drivers that use `struct ring_buf`
internally to report the number of bytes that can be pushed in
`uart_fifo_fill` without fragmentation.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Enable Cortex R8 support, similar to Cortex-R5.
Signed-off-by: Krzysztof Sychla <ksychla@antmicro.com>
Signed-off-by: Marek Slowinski <mslowinski@antmicro.com>
Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
Signed-off-by: Mateusz Hołenko <mholenko@antmicro.com>
The unicast_stop function is changed to primarily do a
BAP disable instead of a release, with optional
support for releasing the streams once they have been disabled.
This also adds unittests for the procedure which also
allow us to remove the invalid param testing from the BSIM tests.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The dispatcher table needs to be large enough to have support
for all file descriptor values.
Fixes#79042
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Some devices, e.g. SoC level devices like I2C peripheral, can never be
powerd off as they are always energized. Such devices can only go from an
active state or to a low power state (suspended). Allow them to simply
return -ENOTSUP when called with TURN_ON (or TURN_OFF).
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Reading superblock didn't work with DMAs that only support aligned reads
(e.g. STM32 DMA).
Co-authored-by: Maciej Sobkowski <msobkowski@antmicro.com>
Signed-off-by: Dominik Lau <dlau@internships.antmicro.com>
This allows downstream modules to overwrite the default log level choice
using Kconfig.defconfig files.
For example, this becomes possible:
```
choice LWM2M_LOG_LEVEL_CHOICE
default LWM2M_LOG_LEVEL_WRN
endchoice
```
In contrast to the configuration method, this then has an effect on all
applications stored in the downstream module.
Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
Since UDC buffers are allocated with `UDC_BUF_GRANULARITY` granularity,
the `net_buf_tailroom` may no longer be equal to the HID report size.
Use `setup->wLength` instead to ensure that proper HID report size is
passed to the application's callback.
Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
A null check for the TCP connection `conn` was added at the start of
the function, but the previous checks were not removed, leading to
a redundant null check, which is unnecessary.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Some LLEXT objects can include sections, that should not be merged
with other sections of the same type. E.g. when such sections should
be placed into locations, other than the default. Add support for
such sections.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>