The websocket implementation did not comply with the RFC 6455 when it
comes to connection close. The websocket should send in such case Close
control frame. This commit fixes this behaviour.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The websocket "socket" layer did not handle ZFD_IOCTL_SET_LOCK command,
and just forwarded it to the underlying socket. This overwritten the
mutex pointer used by the underlying socket, resulting in erroneous
behaviour in certain cases.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Fix sn and nesn values of ISO data when starting a new burst.
When central retransmitted but did not get an ack, it did
not update the sn correctly causing the peripheral to drop
the next ISO data PDU.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The address type in the periodic adveritising sync
established event is incorrectly set to 0x01
(BT_ADDR_LE_RANDOM) when the address is a resolved one,
where it should have been BT_ADDR_LE_RANDOM_ID.
The address type has been fixed by offsetting by 2 to get
BT_ADDR_LE_PUBLIC_ID or BT_ADDR_LE_RANDOM_ID when the
address has been resolved.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This mirrors the behaviour of MLD packets, the only other ICMPv6 subtype
that is tracked separately.
Inbound ND packets are already counted as received ICMP packets by way of
going through the ICMP receive path.
Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
This caused outgoing MAC address lookups to count as one received and two
sent Neighbour Discovery packets, when it's really one sent Neighbour
Solicitation and one received Neighbour Advertisement.
Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
The net_pkt pointer provided to net pkt commands was not validated in
any way. Therefore it was fairly easy to crash an application by
providing invalid address.
This commit adds the pointer validation. It's checked whether the
pointer provided belongs to any net_pkt pools known to the net stack,
and if the pointer offset within the slab actually points to the
beginning of the net_pkt structure.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
When using extended advertising commands, the advertising set is not
considered to be over until we receive `BT_HCI_EVT_LE_ADV_SET_TERMINATED`
from the controller. Only then do we clear the `BT_ADV_ENABLED` flag.
The problem is that `bt_le_adv_resume` is called on connection established,
which can happen before adv set terminated, and in that case it will
early-return because `BT_ADV_ENABLED` is still set.
This change triggers `bt_le_adv_resume` when we get
`BT_HCI_EVT_LE_ADV_SET_TERMINATED`.
Fixes#53048
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Adds event tracing to sysview. This will allow the event related
tracing symbols to be found when CONFIG_SEGGER_SYSTEMVIEW is
enabled.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Fixes various unresolved symbols when kernel event object tracking
is enabled via CONFIG_TRACING=y.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Native POSIX target still needs to use the <fcntl.h> header
instead of <zephyr/posix/fcntl.h>
Also removed the include from various files that did not use it.
Also changed fcntl() calls to zsock_fcntl() because we directly
use zsock_* calls elsewhere.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Fix missing DF related Radio register reset on radio_reset().
Regression in commit 465a96181d ("Bluetooth: Controller:
Explicitly set all bits of used radio registers") due to the
removal of NRF_RADIO->POWER register use that was used to
reset all Radio registers on every new Radio Event.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
`ad_len` was never initiatialized before we started
incremetenting and using it.
We would also override any user data in ad_init, which
is fixed by using the length of the user data as an
offset into the array.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fixes issue where a build warning would be emmited for sockets_tls.c due
to usage of the deprecated fcntl.h header file.
Signed-off-by: Jared Baumann <jared.baumann8@t-mobile.com>
Fixes dead code warning. At this point we have already checked for
broadcast and it is set to false.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Workaround sequence number misalignment to ISO event count
when ISO data is supplied in bursts, example through USB.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Remove BT_HCI_DATAPATH_ID_DISABLED define as 0xFF, which is
reserved for future value for Data_Path_Id parameter.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
- Include ISO stream count in ISO streams definitions in
controller.
- Create ISOAL source on controller when ISO data path is
setup.
- Send broadcast data buffers transferred from host over
HCI to ISOAL as ISO SDU fragments.
- Allow bot conn and ISO data to use data_buf_overflow.
- Store ISO interval during BIG create.
- Remove ISO data path for each BIS during BIG terminate
procedure.
- Set value (temporarily) for ISOAL target_event enabling
it to Tx data.
- Check status of data fragment sent to ISOAL for memory
allocation and other errors.
- Destroy ISOAL source when ISO stream released.
- Use ISO Advertising handle, not stream handle to destroy
ISO data path.
- Remove extra ISOAL sink destroy call when removing ISO
data path.
- Add FIXME comment as reminder to address LL_ASSERT on
isoal_status error.
Signed-off-by: Carl Stehle <droid@appception.com>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix calculation of ISO interval such that multiple bursts
can be transmitted per ISO interval. This means we can now
have SDU_Interval < ISO_Interval and more than one SDU will
be transmitted in each ISO_Interval.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix missing jump to Rx ISR done that caused the Control PDU
to be enqueued as ISO data PDU, causing the ISOAL to assert
on receiving invalid LLID.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix ISO timestamp wrap around which caused ISOAL to assert
checking for valid timestamp.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Define a internal BT_CTLR_ISO_TX_BUFFERS to allocate ISO Tx
buffers used for Broadcast and Connected ISO.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix race between isoal_source_deallocate() and
isoal_tx_pdu_emit(). Initiating a local initiated terminate
triggers NULL pointer dereference.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor ll_setup_iso_path to support Synchronous Receiver
and Connected ISO to be built together.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix uninitialized CIG ULL reference count when creating a
CIG after a previous disconnection.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix CIS and CIG teardown in Central and Peripheral Role.
cig->lll.num_cis value is used in peripheral role to count
active CISes, and cig->cis_count is used in central role.
Both central and peripheral will stop ticker for CIG when
num_cis and/or cis_count is zero, respectively, but only
peripheral role will release a CIG context. The Central
will keep the CIG context allocated and only mark it as
not started. Remove CIG command will be used for central
role to release a CIG context.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix CIS ISO Tx buffer leak on terminate when the datapath
has been deallocated.
Add a FIXME comment regarding ll_tx_ack_put() being called
from LLL execution context, while it is a ULL callable used
by ACL connections to dispatch ack.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Do not call util_aa_le32() from ISR context as random number
generation in entropy driver on nRF5x series invokes
k_sem_take.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix assertion check on link_tx_free when CIS is created a
second time. The Tx mem queue has to be initialized on every
new CIS create as CIS disconnect does the deinitialization.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Reorder the functions in ull_central_iso file to match the
order of HCI commands in the BT Spec.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Workaround the access that check if datapath is NULL when
the stream has already been released. Memory Pool overwrites
first 8 bytes to maintain the free list and free count. This
causes the datapath fields if placed in the first 8 bytes to
not be NULL after the memory is freed.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add code to generate ISO data buffer overflow event if more
than allocated ISO data PDU buffers are tried to be
requested by host or for SDU fragmentation.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Use instant_latency at the CIG start event count to detect
skipped connection event around the instant. In the future
add implementation to compensate for skipped ACL connection
event and adjust the CIS event count at CIG start.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Reuse ull_conn_event_counter() function in LLCP
implementation to get the current radio event counter value.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix CIG offset such that it follows after the ACL connection
time reservation to avoid overlapping.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add LLL interfaces implemented by ULL to get group by stream
and to get stream by group iterator functions.
Rename function to set CIS established to reflect that it is
LLL accessible.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix channel indices calculation implementations conditional
compile so that it can be reused for Connection ISO events
and subevents.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>