lladdr.addr doesn't point to any storage value when it's
handed off to the net_nbuf_read function. This results
in a write to an undefined area of memory.
Fix this by pointing lladdr.addr to a net_linkaddr_storage
structure's byte storage array which can handle the maximum
specified length.
Change-Id: I05e0a0420b262ba1e5ac95cebe1f0d91f54878ce
Signed-off-by: Michael Scott <michael.scott@linaro.org>
The net_linkaddr_storage structure contains an array of bytes used
to store the link address. This array can be different sizes
depending on the CONFIG options used when building. To facilitate
consistency and error checking let's introduce a new helper function
to copy the addr and len values to this structure.
Also move all uses of memcpy related to net_link_storage structures to
the new helper function.
Change-Id: Ic547d86b07e62e5ac3bc330d4eaeb4508a143200
Signed-off-by: Michael Scott <michael.scott@linaro.org>
- Introduce NET_LINK_ADDR_MAX_LENGTH which is either 6 or 8
depending on whether CONFIG_NET_L2_IEEE802154 is used
- Instead of being a placeholder single index array of uint8_t,
let's use NET_LINK_ADDR_MAX_LENGTH to assign the size of the
"addr" array field in the net_linkaddr_storage structure.
- Now that the "addr" field of net_linkaddr_storage contains the
true size of the link address, we can remove "storage" field
which was hard coded to 8 bytes (2 uint32_t's).
- Fix 2 references to the "storage" field of the net_linkaddr_storage
structure.
Change-Id: I2ea12058280b289f65085964eb7d503d4fd260c2
Signed-off-by: Michael Scott <michael.scott@linaro.org>
Add kernel pipe test cases which cover basic pipe apis usage
across thread and isr
Change-Id: I11899411b305535297f2e25056678d5b7df8fb95
Signed-off-by: jing wang <jing.j.wang@intel.com>
Add fifo/fifo test cases with unified kernel, which cover
basic apis across differnt contexts - thread and isr
Change-Id: Icb61d3dcd564167b0bd70419c652e0b000869959
Signed-off-by: jing wang <jing.j.wang@intel.com>
TestPurpose: verify memory pool concepts.
All TESTPOINTs extracted from kernel documentation.
https://www.zephyrproject.org/doc/kernel/memory/pools.html#concepts
ZEP-1210
Change-Id: I6250e4c26ddf361e74a76c23082cfdb376705560
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
TestPurpose: verify memory pool APIs.
All TESTPOINTs extracted from kernel-doc comments in <kernel.h>
ZEP-1210
Change-Id: I7dcc0638e7b9c4d6b5ffe282e4fe41ca520d003f
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
TestPurpose: verify API thread safe in multi-threads environment.
Thread safe test is explained with more details here:
https://gerrit.zephyrproject.org/r/#/c/9464/7/ test_mpool_threadsafe.c
Please comment if you think it necessary as an extensive kernel test.
Jira: ZEP-1209
Change-Id: I52a7ff393d72785622c047289e7d92286e131cc7
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
TestPurpose: verify memory pool concepts.
All TESTPOINTs extracted from kernel documentation.
https://www.zephyrproject.org/doc/kernel/memory/slabs.html#concepts
ZEP-1209
Change-Id: I95c6cd666212218b9928356f9439e67a2fcf9b73
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
TestPurpose: verify memory slab APIs.
All TESTPOINTs extracted from kernel-doc comments in <kernel.h>
ZEP-1209
Change-Id: I80bc85e96110e7106b3fc5883b982d71c6a7e50b
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
tests/kernel/mem_slab --> tests/kernel/mem_slab/test_mslab
For the purpose to hold other mslab test apps.
Jira: ZEP-1209
Change-Id: I4a72b02a0a5095bb7cfbf73396b6d003ea63f92e
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
This is one of the series of patches that simplifies the driver
code by using the IS_ENABLED macro. This removes the need of the
const variable and the three wrapper functions on semaphore APIs.
Jira: ZEP-1251
Change-Id: I5102e8674663ddbfc65220de72c8b778a9ec726c
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
This is one of the series of patches that simplifies the driver
code by using the IS_ENABLED macro. This removes the need of the
const variable and the three wrapper functions on semaphore APIs.
Jira: ZEP-1251
Change-Id: I2ea0b2d04252d6b28e7d5ca528480234545e6eed
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
These previously had only been invoked from ASM domain.
Change-Id: Ia20caf1b02a4ceee16d964211874c5f798445fe2
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Had only been called from ASM domain, but upcoming interrupt changes
invoke it from core arch C code as well.
Change-Id: Ifd831826068e130e2936cfa4da6c082c3433a5ae
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Documentation used to be confined to the doc/ folder but can now
be stored elsewhere in the code tree (/boards and /samples in particular)
Adding *.rst to the DOCUMENTATION section of MAINTAINERS
Change-Id: I0c63c6ad3f92f4b5454736ee3bd292d2f2b46f63
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
There was a recent change to the license boilerplate of the entire
source tree, however as this spi.c was just recently added it missed
the change.
Change-Id: Icc95084a4b051266beaf1796c31d9aec9da538d0
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.
Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.
Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file. Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.
Jira: ZEP-1457
Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Remove an unnecessary condition check in Kconfig.
All the config options already depend on I2C.
Change-Id: Ia8876442652df9f105e862d8c2db394699c81f63
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Values now spaced 4 apart since we commonly build thousands of
tests.
Percentage complete indicator added.
Change-Id: Ia7454dc1e8cc0701dc74dc8a4f6e7a37706524e8
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
These were causing some issues in the old kernel, but the unified
kernel no longer uses these.
Issue: ZEP-513
Change-Id: I87216565231cd244886fbffe4b4d420d1687b245
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
For combined builds with Controller+Host the Controller's HW RNG is
used instead of TinyCrypts PRNG.
Change-Id: I4dbe85e547c057cf57ae0934b10866f2bb9f610d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
In case the channel provides its own MTU and allocator it should be
able to store as much data as set in the MTU, based on that the code
can give enough credits to fill the entire channel MTU.
Change-Id: I291cf1bb643f200bde191914e814f681f4f65c3e
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This is very handy for debug purposes. It provides us with a reassurance
that at least something is happening, even if initialisation does not
complete (hangs forever).
Change-Id: I6ac1bfec84f8a6694f82d14fdc5d2a27aa1fc634
Signed-off-by: Lee Jones <lee.jones@linaro.org>
This driver acts as a pass-through, taking raw HCI data, converting
it to SPI comms and vice versa. It works in the same way as the
existing H:4 and H:5 drivers, only it uses SPI instead of UART.
In this first release, the only BLE board which has been tested is
the X-NUCLEO-IDB05A1:
http://www.st.com/en/ecosystems/x-nucleo-idb05a1.html
Although the current supported SPI format works like the one below,
it should be trivial to adapt it to support other chips with a
different format.
SANITY CHECK = 0x02
SPI WRITE = 0x0A
SPI READ = 0x0B
Tx Format:
[HOST] {SPI WRITE} 0x00 0x00 0x00 0x00 {HCI MESSAGE ...}
[CHIP] {SANITY CHECK} {FLASH SIZE} 0x00 0x00 0x00 {0xFF * MESSAGE LEN}
Rx Format:
{IRQ LINE GOES HIGH}
[HOST] {SPI READ} 0x00 0x00 0x00 0x00 {0xFF * BYTES TO READ}
[CHIP] 0x02 {FLASH SIZE} 0x00 {BYTES TO READ} 0x00 {HCI MESSAGE ...}
Change-Id: I4a00711c922d9ea02c5e2afb0d16715e413b1ed5
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Added pointer to store the callback function
from the application in the Request structure.
Added userdata param, to be used to fill AVDTP resp.
Change-Id: I8f3289545fdbbd91e4ed7f9983f4f4331d9b59a6
Signed-off-by: Arun Jagadish <arun.jagadish@intel.com>
This makes l2cap_chan_add updates the state to CONNECT so it doesn't
have to be done manually for both incoming and outgoing code paths.
Change-Id: I7331e49c675c83c6c1b184eeecc49c75c446a1ff
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Try to use IS_ENABLED instead of #ifdefs whenever possible.
Change-Id: I330769204914286bb98583dd89a3d849d4fcc128
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Try to use IS_ENABLED instead of #ifdefs whenever possible.
Change-Id: I77d2e53f7aa7f2832513f235a63ad2cf14e73cb1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Try to use IS_ENABLED instead of #ifdefs whenever possible.
Change-Id: I78a3ccc6fcb84b431198f1a6c46aa6d50e9e9cd1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Try to use IS_ENABLED instead of #ifdefs whenever possible.
Change-Id: I4da93076a27a33b15a9b9119cfe5a1ff68acba0b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This file doesn't even include <bluetooth/log.h> so any tricks on
BT_DBG are completely pointless (and wrong after the recent update to
the debug logging API).
Change-Id: I1b2b7942a11a4f7229dc35aa2701b3180dc35a28
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This helps catch any format string issues when using this API.
Change-Id: I9475eed4fa12e72182cc16b0fa4a358fa6faca8e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The new IS_ENABLED macro allows exposing conditionally enabled code
always to the compiler, even though it may not ultimately end up being
built. This is in particular useful for letting the compiler catch any
logging format string errors. Introduce a new BT_DBG_ENABLED macro
that c-files need to define before including <bluetooth/log.h> in
order to choose whether BT_DBG() logs are enabled or not.
When no Bluetooth logs are enabled the patch also modifies the log
macros to have the format strings checked with the help of the
__printf_like annotation and empty static inline functions.
Change-Id: Ie6bc8e10727b5b306f3ed0f94089a07a22583d9b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The k64f has a random driver the TEST_RANDOM_GENERATOR config is not
necessary.
Change-Id: I73bc4076cac459388d9dd9bf3eb89c8cb5ba7db7
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
With the use of the IS_ENABLED macro
(https://gerrit.zephyrproject.org/r/#/c/9882), the driver
reentrancy code is simplified:
The original const variable which used to serve the purpose of
making the build to compile out the reentrancy code when the
reentrancy configuration flag is not enabled is no longer
needed as the use of the IS_ENABLED macro achieves the same result.
Also the original 3 wrapper functions around semaphores API are
not necessary; instead, just use the semaphore API directly.
Jira: ZEP-1251
Change-Id: I23552b77d19044dc94de443018759cb3ec10a52b
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
Also remove dependency on STDOUT_CONSOLE, it is not being used.
Change-Id: Ib7488b1e2df3892c1daa2e12da05fcc1266ac9aa
Signed-off-by: Anas Nashif <anas.nashif@intel.com>