Instead of printk(), use logging macros so that all the output
from IP stack and sample is nicely interleaved.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Network shell is useful to have in order to debug things so
enabling it for this sample application.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The MQTT transport API functions are already documented in
mqtt_transport.h so need to duplicate them in individual
transport .c file.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Set STACK_ALIGN and STACK_ALIGN_SIZE to 8 bytes instead of 4 bytes in
case a 64-bit posix board is used.
Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
Add soc and dts files to support for most of the common peripherals
in the STM32G4 series. Add specific support for the STM32G431RB.
Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
A loop in k_mem_pool_alloc() around z_sys_mem_pool_block_alloc() assumes
the later may return -EAGAIN with an elaborate comment about it. But
-EAGAIN is no longer returned by that function since commit 7845e1b01e
("lib/mempool: Fix spurious -ENOMEM due to agressive latency control").
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This patch is a preparatory step in enabling the MMU in
long mode; no steps are taken to implement long mode support.
We introduce struct x86_page_tables, which represents the
top-level data structure for page tables:
- For 32-bit, this will contain a four-entry page directory
pointer table (PDPT)
- For 64-bit, this will (eventually) contain a page map level 4
table (PML4)
In either case, this pointer value is what gets programmed into
CR3 to activate a set of page tables. There are extra bits in
CR3 to set for long mode, we'll get around to that later.
This abstraction will allow us to use the same APIs that work
with page tables in either mode, rather than hard-coding that
the top level data structure is a PDPT.
z_x86_mmu_validate() has been re-written to make it easier to
add another level of paging for long mode, to support 2MB
PDPT entries, and correctly validate regions which span PDPTE
entries.
Some MMU-related APIs moved out of 32-bit x86's arch.h into
mmustructs.h.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
SMP had API-level docs, but no architecture-level description.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Add support for the report and patch modes so this can be invoked by
coccicheck.
Use PCRE options to make the kernel timeout API identifier rule more
readable. Extend the pattern to new API.
Use rule extends and depends clauses, and pattern disjunction, to
avoid replicating metavariable content.
Hint that using --include-headers may be helpful (some patterns can be
found in static inline functions).
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Add KConfig board support to match board jumper settings
Failing to update bank selection will affect GPIOs tied to VTR3
Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
Fix ULL implementation that uses conditional compilation by
replacing back to use of #if defined(...) in code accessing
compiled out struct members.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix for possible Tx Buffer leak during disconnection when
the buffers are in ULL context and not yet enqueued towards
LLL context.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
When more than one simultaneous connections are active,
transmitting data packets to peer, a termination causes
host to use the flushed pending number of completed packets
count for other active connections. This is on reception
of HCI disconnection complete event. But the controller has
not yet released any of the pending enqueued Tx buffers
which was happening after the disconnection event was
dispatched to HCI layer.
The fix here is to dispatch the disconnection complete event
from the LLL context after pending Tx buffers have been
flushed and the buffers get returned to Tx pool in the ULL
context. This way buffers are in the Tx pool before host
get to process the disconnection complete event.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix for possible Tx Buffer leak during disconnection when
the buffers are in HCI thread context and not yet demux-ed
and enqueued towards LLL context.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix the mayfly scheduling of the Tx buffer flushing on
connection termination to be immediate (not to tailchain).
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Randomly generating ID the first time coap_next_id() is called is more
in accordance with CoAP recommendations (see
https://tools.ietf.org/html/draft-ietf-core-coap-18, section 4.4)
"It is strongly recommended that the initial value of the
variable (e.g., on startup) be randomized, in order to make successful
off-path attacks on the protocol less likely."
Doing this in a dedicated init function is the cleanest and most
idiomatic approach. This init function is not exposed publically which
means it will be called only once, by the network stack init procedure.
Signed-off-by: Benjamin Lindqvist <benjamin.lindqvist@endian.se>
Uses net_buf_simple_clone to access the sdu of an unsegmented app packet
for re-encryption.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Provides a way to clone a net_buf_simple without altering the state of
the original buffer. The primary usage scenario is for manipulating a
previously allocated PDU inside a buffer without altering the length and
offset of the buffer.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Local messages are already enqueued for the LPN in the tx path, and
don't have to be added again in the rx path.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Re-encrypts single-segment application messages when the network seqnum
has changed, to avoid encrypting messages with different seqnums in
network and transport. This operation is only required for unsegmented
messages, as segmented messages don't need to use the same seqnum in
network.
Reinstates the special adv data for friend messages to store the app key
index.
Fixes#19265.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Provides a utility function for getting an application key given a
subnet and an app ID. Primary use-case in friendship re-encryption.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>