Commit graph

1715 commits

Author SHA1 Message Date
Anas Nashif 52e7cdae57 tests: mqtt_subscriber: unify prj.conf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-26 10:57:48 -04:00
Anas Nashif 80010b04cb tests: mqtt_publisher: unify prj.conf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-26 10:57:48 -04:00
Anas Nashif ca0ad13a61 net: enable SLIP only on QEMU targets
In many networking tests we had to configure SLIP in the prj.conf
leaving those configurations Qemu specific. This change enables SLIP for
QEMU targets automatically and allows reuse of prj.conf for multiple
boards.

Additionally, the TUN options is removed. This option was not used
anywhere.

To enable self-contained networking tests that do not depend on SLIP, we
introduce the new option NET_TEST which disables TAP and allows testing
in QEMU without the need for a host interface.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-26 10:57:48 -04:00
Jukka Rissanen cb7b96bcc7 tests: net: trickle: Fix the Trickle parameters
The Imax doublings value was too large which caused overflow
of Imax_abs value, which then could cause Trickle test to fail.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-26 07:56:51 -05:00
Andrew Boie 5bcf3e97df timing_info: fix how stacks are referenced
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-26 05:53:14 -04:00
Kumar Gala dd6d34e7dc tests: net: second pass at cleanup tests to build on all platforms
The majority of these fixes adjust the memory limit needed to build the
various tests on systems with and without BLE support.  We also fixup
one test case that was able to run on platforms with 16k of memory.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-26 11:47:14 +03:00
Anas Nashif 1f9d8a9fd8 tests: trickle: exclude qemu_cortex_m3
Fails in CI, exclude while we investigate the issue.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-25 17:39:37 -05:00
Kumar Gala ebc948d818 tests: net: limit tests to boards with enough memory to build them
A number of the network tests have minimal memory requirements that not
all boards are able to meet.  Add in those memory requirements so we
don't attempt to build these tests for those platforms.  Utilized the
frdm_kl25z (with 16K of memory) and cc2650_sensortag (with 20K) to test
the limits.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-25 15:51:18 -05:00
Andrew Boie 416eca5b13 tests: fatal: enable x86 MMU stack protection
Show that this mechanism can detect stack overflows with the
guard page. We only do it once since are are in an alternate
IA HW task after it happens.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 11:32:36 -04:00
Andrew Boie 861b269128 sys_kernel: fix stack declaration
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 11:32:36 -04:00
Andrew Boie c3fce81d13 tests: fatal: fix stack size to k_thread_create
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 11:32:36 -04:00
Jukka Rissanen 45eac217a2 net: tests: Enable net tests for all suitable platforms
Instead of only running net tests in qemu_x86, enable those
tests in all suitable platforms. The tests are disabled for
bbc_microbit as that platform does not have enough memory.

The tests/net/arp and tests/net/ieee802154/l2 are disabled
for qemu_xtensa as the qemu crashed when running the tests.
For tests/net/all there was a weird build error for qemu_xtensa
so that test is also disabled for that platform.

Increased the trickle timeout to 3 secs in tests/net/trickle as
occacionally there was timeout error in qemu_cortex_m3 when the
test was run.

Jira: ZEP-2398

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-25 10:46:44 -04:00
Jukka Rissanen c99bc8cf53 tests: net: LLVM build warning from tests/net/dhcpv4
Duplicate config option in prj.conf file.

Jira: ZEP-2374

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-20 10:16:44 -05:00
Jukka Rissanen 5871fda709 tests: net: LLVM build warning from tests/net/udp
Missing (u8_t *) cast.

Jira: ZEP-2375

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-20 10:16:44 -05:00
Johan Hedberg 0ec2630882 Bluetooth: Mesh: Add initial implementation
Add an initial implementation for the Bluetooth Mesh Profile
Specification. The main code resides in subsys/bluetooth/host/mesh and
the public API can be found in include/bluetooth/mesh.h. There are a
couple of samples provided as well under samples/bluetooth and
tests/bluetooth.

The implementation covers all layers of the Bluetooth Mesh stack and
most optional features as well. The following is a list of some of
these features and the c-files where the implementation can be found:

 - GATT & Advertising bearers (proxy.c & adv.c)
 - Network Layer (net.c)
 - Lower and Upper Transport Layers (transport.c)
 - Access Layer (access.c)
 - Foundation Models, Server role (health.c & cfg.c)
 - Both PB-ADV and PB-GATT based provisioning (prov.c)
 - Low Power Node support (lpn.c)
 - Relay support (net.c)
 - GATT Proxy (proxy.c)

Notable features that are *not* part of the implementation:

 - Friend support (initial bits are in place in friend.c)
 - Provisioner support (low-value for typical Zephyr devices)
 - GATT Client (low-value for typical Zephyr devices)

Jira: ZEP-2360

Change-Id: Ic773113dbfd84878ff8cee7fe2bb948f0ace19ed
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-07-20 09:30:44 +03:00
Maureen Helm 719f1dac07 tests: adc: Add support for freedom and hexiwear boards
Adds support for freedom and hexiwear boards to the adc_api test.

Jira: ZEP-1396

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-07-19 14:28:08 -05:00
Savinay Dharmappa cc48d40c5f tests: kernel: sprintf: Fix build warning.
As there is no suffix to represent a literal as unsigned short
it is typecasted. It is fix for Jira ZEP-2156

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2017-07-19 11:16:52 -04:00
Robert Chou 33c54ee6fd net: zoap: advance block context by checking M bit from block option
According to RFC7959 page 30, "The end of a block-wise transfer is
governed by the M bits in the Block options, _not_ by exhausting the
size estimates exchanges."

Therefore, we should check the M bit instead of total size (which
is not always available, too)

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-07-14 11:06:54 +03:00
David B. Kinder eeed8ce179 doc: fix wiki board references in non .rst files
Some README files referenced wiki articles that have been
moved to the doc area on the website.

Fixes #668

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-07-11 12:45:35 -05:00
Jukka Rissanen ee989be286 net: tcp: Fix sequence number validator
The sequence number validator was checking the seq numbers
incorrectly. This caused some valid RST packets to be dropped
and the TCP stream to hang.

Added also a TCP test case that tests the seq validator.

Jira: ZEP-2289

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-11 10:35:19 +03:00
Jukka Rissanen 0c5ef71c07 tests: net: 6lo: Remove CONFIG_MAIN_STACK_SIZE setting
No need to set the main stack size as the test runs just fine
without it.

Jira: ZEP-2341

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-11 10:31:11 +03:00
Andrew Boie e55fd562ec tests: protection: don't do exec tests on x86
The IA32 MMU has no concept of a "no execute" flag, this is
unfortunately only implemented in x86_64.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-10 11:44:56 -07:00
Andrew Boie ed1962a65c tests: net: remove overriden RAM size
The QEMU targets have plenty of RAM now and the current value
specified wasn't a multiple of a 4K page.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-10 11:44:56 -07:00
Andrew Boie 304f91c4cb tests: net: route: fix semaphore usage
A network stack thread was trying to use a semaphore before it was
initialized. Set it up at toplevel so it is ready to go.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-10 11:44:56 -07:00
Andrew Boie 65a9d2a94a kernel: make K_.*_INITIALIZER private to kernel
Upcoming memory protection features will be placing some additional
constraints on kernel objects:

- They need to reside in memory owned by the kernel and not the
application
- Certain kernel object validation schemes will require some run-time
initialization of all kernel objects before they can be used.

Per Ben these initializer macros were never intended to be public. It is
not forbidden to use them, but doing so requires care: the memory being
initialized must reside in kernel space, and extra runtime
initialization steps may need to be peformed before they are fully
usable as kernel objects. In particular, kernel subsystems or drivers
whose objects are already in kernel memory may still need to use these
macros if they define kernel objects as members of a larger data
structure.

It is intended that application developers instead use the
K_<object>_DEFINE macros, which will automatically put the object in the
right memory and add them to a section which can be iterated over at
boot to complete initiailization.

There was no K_WORK_DEFINE() macro for creating struct k_work objects,
this is now added.

k_poll_event and k_poll_signal are intended to be instatiated from
application memory and have not been changed.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-10 11:44:56 -07:00
Tomasz Bursztyka dc33d8f49e tests/ieee802154: Fix accessing unmapped memory area
commit-id b07f20c143 had wrong fix.

Jira: ZEP-2331

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-07-10 09:25:32 -07:00
Geoff Gustafson 1405627c37 net: context: Use K_NO_WAIT instead of 0 for timeout
Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
2017-07-10 10:59:28 +03:00
Kumar Gala 9eddc82be3 i2c: remove I2C Slave Read config
The I2C Slave Read support isn't well defined and not actually supported
by any i2c driver at this point.  We can add this back when slave mode
is more thought out.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-07 10:01:38 -05:00
Jukka Rissanen 9c907fca43 net: tcp: Remove NET_TCP_HDR() macro and direct access to net_buf
Remove NET_TCP_HDR() macro as we cannot safely access TCP header
via it if the network packet header spans over multiple net_buf
fragments.

Fixed also the TCP unit tests so that they pass correctly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-07 15:24:00 +03:00
Jukka Rissanen 3604c391e6 net: udp: Remove NET_UDP_HDR() macro and direct access to net_buf
Remove NET_UDP_HDR() macro as we cannot safely access UDP header
via it if the network packet header spans over multiple net_buf
fragments.

Fixed also the UDP unit tests so that they pass correctly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-07 15:24:00 +03:00
Jukka Rissanen 8476da9d9b net: icmp: Remove NET_ICMP_HDR() macro and direct access to net_buf
Remove NET_ICMP_HDR() macro as we cannot safely access ICMP header
via it if the network packet header spans over multiple net_buf
fragments.

Jira: ZEP-2306

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-07 15:24:00 +03:00
Tomasz Bursztyka b07f20c143 tests/ieee802154: Fix a null pointer deferencing
Jira: ZEP-2331

Reported-by Andrew Boie <andrew.p.boie@intel.com>

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-07-07 12:41:41 +03:00
Jukka Rissanen 90fc27e652 tests: net: ip-addr: Fix null pointer access in the test
IP-address test was accessing NULL pointer.

Jira: ZEP-2332

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-06 09:17:53 -07:00
Anas Nashif 5f63386c34 tests: crypto: fix coding style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-06 10:34:41 -05:00
Kumar Gala 8f77cddc77 tests: crypto: sha256: limit to systems with >48k of memory
We fail to build this test on stm32f3_disco which has 40k of SRAM.
Bump up the min_ram requirement to 48k.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-06 09:53:00 -05:00
Anas Nashif 8d108c9d59 tests: mbedtls: cleanup prj.conf
Remove platform specific option CONFIG_ARC_INIT and a copy/pasted
comment with "#nothing here".

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Anas Nashif 52a4916cab tests: crypto: do not build when DEBUG is enabled
The external mbedTLS library seems to have some issues when DEBUG is
enabled, so disable this here becauase we will not change external 3rd
party code.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Anas Nashif 882c19ddbc tests: remove build_only tag
build_only is set to false by default, so remove it.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Anas Nashif c364e06ccb tests: move spi test under tests/
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Anas Nashif d7e15aa415 benchmark: footprint: fixed testcase
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Anas Nashif 68d7a207ae ethernet: fix Kconfig option for ETHERNET
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Anas Nashif c01c074b5b net: fix wrong Kconfig
CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT should be used instead of
CONFIG_NET_IFACE_UNICAST_IPV6_ADDR_COUNT.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Johan Hedberg 30beef9419 Bluetooth: GATT Introduce BT_GATT_CCC_MAX helper define
The worst-case maximum number of CCC entries we need is actually
MAX_CONN + MAX_PAIRED. Provide a helper define for it and use it
whenever appropriate.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-07-04 17:30:40 +03:00
Tomasz Bursztyka 37af7b5096 tests/ieee802154: Fix how is initialized the driver lock in l2 test
The test starts the last one: after the driver and the net stack.
However, the net stack (due to DAD and else) will already try to send
some packet, resulting it giving a uninitialized semaphore. But once
properly initialized, this semaphore will end up with a non-zero count
when the test will start: thus reseting it to 0 before running the
tests.

Jira: ZEP-2319

Reported-by Andrew Boie <andrew.p.boie@intel.com>

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-07-03 20:58:57 -04:00
Johan Hedberg 7a79101fd5 Bluetooth: tests: Remove unused prj_nimble.conf files
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-07-03 08:22:58 -04:00
Jean-Paul Etienne b31b41604e tests: crypto: include back riscv32 arch for ecc_dh, ecc_dsa and mbedtls
Issue fixed by commit "riscv32: fixed context restore upon exiting ISR"

Jira: ZEP-2020

Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-06-30 06:31:51 -04:00
Kumar Gala 8953db8008 tests: tickless: fix building of test
Build issues caused by commit fe882f407d
which missed camel case conversion of _TimestampOpen, _TimestampRead,
and _TimestampClose.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-29 13:14:18 -05:00
Kumar Gala 534beb34c9 tests: boot_time: cleanup boot_time test to work on ARM
Enabled the boot_time test on ARM SoCs, set __start_time_stamp on ARM
since we don't have a free running counter similar to TSC on x86.
Also moved to printing the values out as %u to increase the range of
values.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-29 07:08:59 -04:00
Kumar Gala d3d9abadbe tests: shell: Filter on UART_CONSOLE support to enable more boards
The shell tests were limited to running on just qemu_x86 platform, we
can run them on any platform with UART_CONSOLE support so move to using
a filter.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-29 07:07:31 -04:00
Punit Vara fe882f407d tests: Remove camel case and fix coding style
Test whichever had Camel case defined for functions and variables have
been replaced.

Following warnings have been fixed in test cases as well.
- line over 80 characters
- Macros with flow control statements should be avoided
- Macros with complex values should be enclosed in parentheses
- break quoted strings at a space character
- do not add new typedefs
- Comparisons should place the constant on the right
  side of the test
- suspect code indent for conditional statements
- Missing a blank line after declarations
- macros should not use a trailing semicolon
- Macros with multiple statements should be
  enclosed in a do - while loop
- do not use C99 // comments

JIRA: ZEP-2249

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-06-29 07:00:50 -04:00
Anas Nashif b3ae274a62 tests: fix PCI test using 'supported' keyword
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-28 09:51:40 -05:00
Anas Nashif d1e562c924 tests: replace filters in testcase files
Where possible, replace the use of filter with newly added keywords.
This will speed things up and in some cases add more coverage due to bad
filters.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-28 09:51:40 -05:00
Anas Nashif 6c05ccb226 tests: convert testcase.ini to new format
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-28 09:20:36 -05:00
Paul Sokolovsky b650fa8a72 tests: net: Add test for Sockets API UDP socket/bind/connect/send/recv
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-06-28 16:07:55 +03:00
Andrzej Puzdrowski 8b7a8448ab Drivers: flash: NRF5x: synchronous mode for co-operation with BLE radio
In added mode flash operation are performed in timeslice
(in radio idle time).
Kconfig for mode enabling CONFIG_SOC_FLASH_NRF5_RADIO_SYNC.

Erase and write API implementations were rewritten and preserved against
concurrent execution.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-06-28 12:29:50 +02:00
Johan Hedberg e094560dbc Bluetooth: tests: Fix left-over issues from bt_gatt_service() removal
The new GATT service registration API is bt_gatt_service_register(),
which takes a bt_gatt_service object pointer.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-06-27 19:10:43 -04:00
Anas Nashif 6ff291a174 tests: do not exclude quark_d2000_crb
quark_d2000_crb does not build net/bluetooth tests by default now.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-27 17:44:23 -04:00
Anas Nashif 3c50f7aa12 tests: samples: remove duplicate filtering
We have many testcases doing filtering both on the architecture level
and the platform level, which is redundant. Also many testcases are
running the same test twice on the same SoC for no good reason, cleanup
the tests and cleanup the filtering.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-27 17:44:23 -04:00
Johann Fischer 6dbe738d0e tests: dma: fix chan_blen_transfer
Use sizeof instead of strlen to get the correct buffer
length and initialize rx buffer with zeros before the dma
transfer.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-06-23 15:56:08 -04:00
Stephen Smalley 0ed343070c tests: protection: add testcase.yaml
commit d859295be9 ("tests: protection: convert to testcase.yaml")
removed testcase.ini but did not add an equivalent testcase.yaml.
Add it.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2017-06-22 16:15:32 -04:00
Vinayak Kariappa Chettimada 46f9489704 Bluetooth: controller: Add radio fast ramp feature
Added implementation to use nRF radio's fast ramp up mode.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-06-22 18:48:15 +03:00
Anas Nashif d859295be9 tests: protection: convert to testcase.yaml
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 22:25:14 -04:00
Stephen Smalley c997577670 tests: Add a self-protection test suite
Add a self-protection test suite with a set of tests
to check whether one can overwrite read-only data
and text, and whether one can execute from data,
stack, or heap buffers.  These tests are modeled after
a subset of the lkdtm tests in the Linux kernel.

These tests have twice caught bugs in the Zephyr NXP MPU
driver, once during initial testing/review of the code
(in its earliest forms on gerrit, reported to the original
author there) and most recently the regression introduced
by commit bacbea6e21 ("arm: nxp: mpu: Rework handling
of region descriptor 0"), which was fixed by
commit a8aa9d4f3dbbe8 ("arm: nxp: mpu: Fix region descriptor
0 attributes") after being reported.

This is intended to be a testsuite of self-protection features
rather than just a test of MPU functionality.  It is envisioned
that these tests will be expanded to cover a wider range of
protection features beyond just memory protection, and the
current tests are independent of any particular enforcement
mechanism (e.g. MPU, MMU, or other).

The tests are intended to be cross-platform, and have been
built and run on both x86- and ARM-based boards.  The tests
currently fail on x86-based boards, but this is an accurate
reflection of current protections and should change as MMU
support arrives.

The tests leverage the ztest framework, making them suitable
for incorporation into automated regression testing for Zephyr.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2017-06-21 21:52:50 -04:00
Stephen Smalley 083fdf352b tests/ztest: Add ztest_test_pass()
ztest provides a ztest_test_fail() interface to fail the currently
running test, but does not provide an equivalent ztest_test_pass().
Normally a test passes just by returning without an assertion failure
or other call to ztest_test_fail().  However, if the correct behavior
for a test is to trigger a fatal fault (as with tests/kernel/fatal or
protection or MPU tests), then we need a way for the test to pass the
currently running test before aborting the current thread.
Otherwise, ztest hangs forever in run_test() on the
k_sem_take(&test_end_signal, K_FOREVER) call.  Add
a ztest_test_pass() interface and implement it for kernel and
userspace variants of ztest.  This interface will be used in the
protection tests.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2017-06-21 21:52:50 -04:00
Anas Nashif 60e752a9f9 tests: dns: do not set as slow test
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 21:38:12 -04:00
Jukka Rissanen cc3cee0017 tests: net: context: Do not print error for passed test
It is confusing if we print timeout error when expecting
a timeout to happen. So for timeout test, do not print
an error message as the timeout is suppose to happen.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-21 21:38:12 -04:00
Jukka Rissanen 269e53609b tests: net: tcp: Fix tests and run them automatically
The TCP tests had several failures because of unnecessary
Kconfig options. These are now fixed and the TCP tests are
also run automatically by CI.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-21 21:38:12 -04:00
Jukka Rissanen dcbe20dcb0 tests: net: mld: Fix tests and run them automatically
The MLD (Multicast Listener Discovery) tests had a failure.
This is now fixed and the MLD tests are also run automatically by CI.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-21 21:38:12 -04:00
Jukka Rissanen e5337672e1 tests: net: ipv6: Fix tests and run them automatically
The IPv6 tests had failures and the tests did not pass
properly. These are now fixed and the tests are also
run automatically by CI.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-21 21:38:12 -04:00
Jukka Rissanen e9368af1b4 tests: net: buf: Run the net_buf tests automatically
The test app works so it can be run automatically.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-21 21:38:12 -04:00
Anas Nashif 470c5f3189 tests: remove testcase.ini files
We now use yaml files.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
Anas Nashif cc24f4b03c tests: samples: convert testcase files to yaml
This will prepare test cases and samples with metadata and information
that will be consumed by the sanitycheck script which will be changed to
parse YAML files instead of ini.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
Carles Cufi 4053470f62 Bluetooth: controller: Add inital support for Controller-based privacy
This initial commit adds the following:

* Handling of privacy HCI commands
* New Link Layer filter module for both whitelist and resolving list
* Advertising RPA generation with timeouts

Follow-up commits will expand the functionality.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-06-20 15:20:09 +03:00
Andrew Boie 0f669132a0 kernel: remove gdb_server
This is unmaintained and currently has no known users. It was
added to support a Wind River project. If in the future we need it
again, we should re-introduce it with an exception-based mechanism
for catching out-of-bounds memory queries from the debugger.

The mem_safe subsystem is also removed, it is only used by the
GDB server. If its functionality is needed in the future, it
shoudl be replaced with an exception-based mechanism.

The _image_{ram, rom, text}_{start, end} linker variables have
been left in place, they will be re-purposed and expanded to
support memory protection.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-19 14:29:40 -04:00
Anas Nashif af416a98b0 tests: pipe: fix style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif dc57fa61bf tests: pipe: rename test directory
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif f6775bc67b tests: timer_monotonic: fix style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 1a1ae2f929 tests: timer_api: fix style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 00b55663f1 tests: schedule_api: fix style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif b593d35762 tests: thread_init: fix style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 115ce02a3d tests: rename cdata -> custom_data
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif c49dbe4e22 tests: threads_scheduling -> threads/scheduling
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 204e782c15 tests: threads_lifecycle/ -> threads/lifecycle
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 47e115a4b1 tests: threads_customdata/ -> threads/customdata
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif cff71db53b tests: queue: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 85cc533247 tests: profiling_api: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 183f045755 tests: poll: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 3521e2e5e7 tests: pending: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 93bcc957da tests: obj_tracing: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 3ad53365d6 tests: mutex_api: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif fbe4f16bc7 tests: mutex: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 0f4329780a tests: mbox: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 31ff9f2ad5 tests: move ipm test to drivers
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 73195eb196 tests: ipm: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif b778ec3604 tests: fp_sharing: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 1a93489935 tests: fifo: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 52a38ffd8d tests: critical: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 072c3d110a tests: common: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 99b39a6ff3 tests: bitfield: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif adc4889afe tests: arm_runtime_nmi: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif e4a963c5d1 tests: arm_irq_vector_table: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 1a0875111c tests: alert_api: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif c7cd5d260a tests: sleep: rename test directory
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 5a0842d5d2 tests: put tickless tests together
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif ffa850d86f tests: workq_api: rename test directory
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif c31a11c591 tests: work_queue: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 520d3c0fbf tests: workq_api: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif f268b6acf2 tests: mem_heap: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 27f32b9d56 tests: mem_pool_threadsafe: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif b787eff65b tests: mem_pool_api: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 16cfaac754 tests: mem_pool: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 26c7ac1f4f tests: mslab_threadsafe: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif a9da45a200 tests: mslab_concept: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif d744a2709e tests: mslab_api: fix style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 9541ebc7a3 tests: rename test directory for mem_pool
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif c51e80e3b7 tests: rename test directory for mem_slab
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 1803009eb5 tests: rename test directory for fifo
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif a9fe253422 tests: rename test directory for lifo
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif a6292a1615 tests: rename test directory for alert
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 09:01:14 -04:00
Anas Nashif 397d29db42 linker: move all linker headers to include/linker
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-18 09:24:04 -05:00
David B. Kinder ddbf1255a9 test: fix misspellings
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-06-17 22:34:45 -04:00
Anas Nashif 2d970a2cbd tests: rename test directory test_bluetooth -> bluetooth
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif ea1addbb3c tests: rename test directory test_loop_transfer -> loop_transfer
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif fcb1d175e6 tests: rename test directory test_chan_blen_transfer
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif 2d1ac45f01 tests: rename test directory test_sha256 -> sha256
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif 0772abff24 tests: rename test directory test_mbedtls -> mbedtls
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif 38fca5cb5d tests: rename test directory test_hmac_prng -> hmac_prng
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif abaa5cb42f tests: rename test directory test_hmac -> hmac
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif 4ce66b728f tests: rename test directory test_ecc_dh -> ecc_dh
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif dfe3195db8 tests: rename test directory test_ecc_dsa -> ecc_dsa
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif d8dfdceb65 tests: rename test directory test_ctr_prng -> ctr_prng
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif 3c3aac9e44 tests: rename test directory test_ctr_mode -> ctr_mode
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif e10e013082 tests: rename test directory test_cmac_mode -> cmac_mode
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif 99b8dc0534 tests: rename test directory test_ccm_mode -> ccm_mode
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif 2d1a4a1284 tests: rename test directory test_cbc_mode -> cbc_mode
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif f18ef22824 tests: rename test directory test_aes -> aes
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Johan Hedberg 9703927f84 net: buf: Move net_buf_pool objects to dedicated linker area
Moving the net_buf_pool objects to a dedicated area lets us access
them by array offset into this area instead of directly by pointer.
This helps reduce the size of net_buf objects by 4 bytes.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-06-16 17:05:06 +03:00
Jukka Rissanen 72567677e7 net: pkt: Fix net_pkt_split()
The net_pkt_split() was incorrectly checking fragA pointer
even before it was allocated.

The unit test is fixed and converted to ztest.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-16 17:05:06 +03:00
Jukka Rissanen 096a9984b2 tests: net: ipv6_fragment: Fix llvm compiler warning
llvm complains about char* -> u8_t* type conversion.

tests/net/ipv6_fragment/src/main.c:645:52: warning:
  passing 'char [11]' to parameter of type 'const u8_t *' (aka
  'const unsigned char *') converts between pointers to integer
  types with different sign [-Wpointer-sign]
        bool written = net_pkt_append_all(pkt, data_len, data,

Jira: ZEP-2274

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-16 16:07:08 +03:00
Adithya Baglody be1cb961ad tests: benchmark: boot_time: Reading time stamps made arch agnostic
1. Changed _tsc_read() to k_cycles_get_32(). Thus reading the
time stamp will be agnostic of the architecutre used.
2. Changed the variable names from *_tsc to *_time_stamp.

JIRA: ZEP-1426

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2017-06-16 07:37:37 -05:00
Kumar Gala 276794b0d7 tests: benchmarks: footprint: really enable floating point on arm
Update the arm.conf to enable CONFIG_FLOAT for the float test and use a
filter on that so we only run/build the test on SoCs/boards that support
floating point hardware.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-15 17:28:35 -04:00
Kumar Gala 2970ffff53 tests: benchmarks: footprint: build on ARM
Enable all footprint tests to build on ARM.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-15 17:28:35 -04:00
Kumar Gala 2f9478614a tests: benchmarks: footprint: fix tag typo
testcase.ini had a typo for footprint-float test.  tag was 'ootprint'
should have been 'footprint'.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-15 17:28:35 -04:00
Luiz Augusto von Dentz 79af35991b Bluetooth: GATT: Add bt_gatt_register_service
This adds bt_gatt_register_service using bt_gatt_service which contains
the attribute array that is then added to the database saving a pointer
in each and every attribute declared.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-06-15 21:53:00 +03:00
Luiz Augusto von Dentz d837a6ec4b Bluetooth: GATT: Add GAP service by default
GAP is mandatory service and now that the db can only be build
dynamically there is no reason to keep the applications registering it.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-06-15 21:53:00 +03:00
Luiz Augusto von Dentz b3cfabab63 Bluetooth: Remove CONFIG_BLUETOOTH_GATT_DYNAMIC_DB
Removes CONFIG_BLUETOOTH_GATT_DYNAMIC_DB in preparation to the
introduction of bt_gatt_unregister.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-06-15 21:53:00 +03:00
Vinayak Kariappa Chettimada 51d6bdb2ff Bluetooth: controller: LE Advertising Extensions PDU structs
Add Bluetooth v5.0 LE Advertising Extensions air interface
packet structures.

Jira: ZEP-2073

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-06-14 18:40:40 +03:00
Luiz Augusto von Dentz aac4f488be tests: Add shell tests
This adds the following tests:

help tests:
shell_exec(help): 0
shell_exec(help dummy): 0
shell_exec(help invalid): -22

select tests:
shell_exec(select): 0
shell_exec(select dummy): 0
shell_exec(select invalid): -22

module tests:
shell_exec(dummy cmd1): 0
shell_exec(dummy cmd1 arg1): -22
shell_exec(dummy cmd2 arg1): 0
shell_exec(dummy cmd2 arg1 arg2): -22
shell_exec(dummy cmd3 arg1 arg2): 0
shell_exec(dummy cmd3 arg1 arg2 arg3): -22
shell_exec(dummy cmd4 arg1 arg2 arg3): -22
shell_exec(cmd1): 0
shell_exec(cmd1 arg1): -22
shell_exec(cmd2 arg1): 0
shell_exec(cmd2 arg1 arg2): -22
shell_exec(cmd3 arg1 arg2): 0
shell_exec(cmd3 arg1 arg2 arg3): -22
shell_exec(cmd4 arg1 arg2 arg3): -22

app handler tests:
shell_exec(cmd4 arg1 arg2 arg3): 0

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-06-09 18:54:27 -04:00
Andrew Boie 15ed8ec7ea tests: use K_THREAD_STACK_DEFINE macros
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-09 18:53:28 -04:00
Andrew Boie bcb4cfe9e4 tests: net: use main thread for test
The main thread was doing nothing but spawning another thread to perform
the test. Delete the alternate thread, and just do the test on the main
thread, adjusting stack size and priority as necessary.

Issue: ZEP-2236
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-09 18:53:28 -04:00
Andrew Boie 0b9f9f3023 tests: context: move idle test to the end
On some devices, when k_cpu_idle() was called we were getting
interrupts that were not the timer interrupt. On bbc_micro
a power clock control driver interrupt was happening instead
and k_cpu_idle() was returning without the system tick advancing,
failing the test.

The clock control interrupts seem to only happen early in device
boot; moving the idle test much later lets the test pass on this
board (and likely all other NRF5 based boards).

Issue: ZEP-2257
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-08 15:12:03 -04:00
Marti Bolivar 2a29bed8bb tests: json: add tests for arrays of objects
Add tests for the newly-added JSON_OBJ_DESCR_OBJ_ARRAY. These pass.

Note that this also adds test coverage for decoding an array of
maximum length, to avoid regressing the recently-introduced fix for
this edge case.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-06-08 15:11:23 -04:00
Anas Nashif 6e78701392 tests: remove obsolete usage of defrag
Also increase ISR stack to make it run on Quark D2000 CRB.

Jira: ZEP-2224
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-08 14:53:49 -04:00
Andrew Boie 000429c069 tests: fatal: increase coverage
- _SysFatalErrorHandler is supposed to be user-overridable.
The test case now installs its own handler to show that this
has happened properly.

- Use TC_PRINT() TC_ERROR() macros

- Since we have out own _SysFatalErrorHandler, show that
k_panic() works

- Show that _SysFatalErrorHandler gets invoked with the expected
reason code for some of the scenarios.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-08 13:49:36 -05:00
Anas Nashif 3405607d9e license: add missing licenses and copyright
We were missing license boilerplate in many files, add them

Jira: ZEP-1464

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-08 10:41:56 -04:00
Andrew Boie 68e8813896 tests: context: allow 2 ticks of slop
The hard-coded value of 10ms doesn't take the system configured
amount of ticks per second, nor does it account for an unlucky
tick advance which causes the test to fail very intermittently
in QEMU.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-08 08:02:32 -04:00
Andrew Boie 7a5150cd9f tests: context: make some failures less ambiguous
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-08 08:02:32 -04:00
Ravi kumar Veeramally 7a01988c64 net: 6lo: Fix source address uncompression
When src and dst addresses are compressed based on context
information, uncompression method should verify CID bit,
SAC and DAC bits and context ID's. But it has missed some
cases which resulted in invalid uncompressed IPv6 header.

e.g. CID is set, SAC is 0 and DAC is 1 and context id's provided.
Uncompression method assumed that src address is compressed based
on context information but it is not.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-06-06 09:06:01 -04:00
Andrew Boie 7b7504e2b9 schedule_api: don't exclude Nios II
Nothing about this test requires tickless idle and it's not even
turned on in prj.conf.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-02 14:47:01 -04:00
Anas Nashif 70b2a57d7a quark_d2000_crb: increase default stack size
Increase to 1024 to get more tests and sample running on this device
with only 8K of SRAM.

Change thread stack size in the mslab test to make it fit into this
board.

Jira: ZEP-2079
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-01 10:27:34 -04:00
Marti Bolivar 7a7bc707d1 tests: json: test JSON_OBJ_DESCR_*_NAMED
Add tests for new macro helpers that allow JSON field names to differ
from their corresponding C struct field names. These pass.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-05-31 14:53:26 -04:00
Marti Bolivar a8e08ecdad tests: json: fix sense of test result string
The other test strings are worded in the positive sense; keep things
consistent.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-05-31 14:53:26 -04:00
Adithya Baglody bee2b8499b tests: benchmark: Fixed build error from icx toolchain.
The error was generated by a piece of code that is
not currently being used. This piece of code was kept to measure
the overhead caused by the benchmarking code on x86.

JIRA:ZEP-2160

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2017-05-31 12:51:42 -04:00
Andrew Boie 5963904e4c printk: fix printing of long long types
64-bit types were not being handled properly and depending on the
calling convention could result in garbage values being printed.

We still truncate these to 32-bit values, the predominant use-case
is printing timestamp delta values which generally fit in a 32-bit
value. However we are no longer printing random stuff.

Test case for printk() updated appripriately to catch this regression.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-05-30 19:42:22 -04:00
Jukka Rissanen 3f46248bb5 tests: net: ipv6: Test IPv6 fragmentation sending
These tests make sure that the IPv6 fragments are build correctly
when a large IPv6 packet is being sent.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-30 11:21:51 +03:00
Luiz Augusto von Dentz e1a062e28b Bluetooth: shell: Use CONFIG_BLUETOOTH_SHELL
Remove existing commands supported by CONFIG_BLUETOOTH_SHELL and make
sure all .conf select it.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-05-29 10:42:21 +03:00
Sharron LIU 189aa475e1 tests: kernel: added tests for k_mem_pool_alloc from isr
Added tests to invoke k_mem_pool_alloc() from isr context

Jira: ZEP-1631

Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-05-27 10:22:14 -04:00
Sharron LIU ab6d4c1a42 tests: kernel: added tests for timeslice reset
Added test cases to verify timeslice reset among thread context
switching.

Jira: ZEP-948

Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-05-27 10:22:14 -04:00
Adithya Baglody c0549aae75 tests: benchmark: app_kernel: Return values from kernel APIs are read.
Static code analysis reported some kernel APIs were used without
reading the return value. Since the benchmark doesn't need error
conditions, a simple read of the values followed by a ARG_UNUSED
is used to handle static code analysis errors.

JIRA: ZEP-2134

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2017-05-27 10:20:14 -04:00
Leandro Pereira 90a2d2fcba tests: clock: Initialize d64 value
CID: 167149
Jira: ZEP-2130
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-05-27 09:54:31 -04:00
Johan Hedberg 9516d63836 Bluetooth: Remove support for NBLE
NBLE has been deprecated for a few releases now and can be removed.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-25 09:03:16 -07:00
Paul Sokolovsky cc47918166 tests: net: ipv6: Fix possible NULL pointer dereference behind a macro
As this is a test, it's minor issue, but let's keep Coverity report
clean.

Coverity-CID: 169303

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-05-25 18:54:22 +03:00
Jukka Rissanen 3677caa37e tests: net: zoap: Add path uri matching tests
Test the match_path_uri() function that was fixed by previous
commit.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-25 18:49:56 +03:00
Inaky Perez-Gonzalez 13617b943d tc: remove */defaults.tc
These files are no longer used and can be removed.

Change-Id: I781256ab93b5364346d99cd4aac488762c437151
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-05-22 20:17:02 -04:00
Justin Watson 44f09663f9 tests: kernel: Fixed tickless test for Arduino Due.
Arduino Due now uses ASF. The timestamps.c file was still
using old register definitions.

Signed-off-by: Justin Watson <jwatson5@gmail.com>
2017-05-20 13:25:32 -04:00
Andrew Boie b1b58dc5ce bluetooth: at: enable CONFIG_SERIAL
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-05-19 16:33:16 -04:00
Michael Scott 5ace805097 tests/zoap: fix net_pkt leak in test_observer_client()
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-05-19 09:59:07 +03:00
Anas Nashif e9a7fa7fd7 tests: net: increase RAM for test
This tests enables all networking features and requires lots of RAM, so
increase the available RAM to avoid failures due to not enough RAM when
building.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-18 22:23:31 -04:00
Youvedeep Singh ff5b3249f4 tests: aio: Change reference voltage for AIO
Change reference voltage for Analog comparator to Internal reference
voltage.

Currently AIO is using External reference voltage (Reference A) and
external reference is set at 3.3V. In this usecase both reference
Voltage and AIO IP are set at 3.3V. So rising edge interrupt behaviour
will be unpredictable.

So by changing internal reference voltage to Internal (set at 1.09V)
interrupt will be generated as soon as Voltage on I/P will exceed it.

Jira: ZEP-1927

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-18 20:26:56 -04:00
Qiu Peiyang b0962e3bac tests: aio: port AIO cases to run on more platforms
AIO should be supported on more platforms. Adapt
this case to make it run on more platforms.
Also keep reference voltage for comprator as internal.

Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-05-18 20:26:56 -04:00
Maciek Borzecki fed96bf1bc misc: _char_out can be a static symbol
Fixes sparse warning:
<snip>/zephyr/zephyr/misc/printk.c:50:5: warning: symbol '_char_out' was not declared. Should it be static?

Change-Id: I5af0860e9f8f827002ae9a142b5924d3de8d51b6
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
2017-05-18 12:41:56 -05:00
Jukka Rissanen 69b25c0788 net: conn: Check UDP and TCP checksum before accepting packet
We did not check UDP or TCP checksum to be valid after receiving
the packet. Fix this so that the checksum is validated when
packet is received in connection handler. As the checksum validation
can be resource intensive, do it after we have verified that
there is a connection handler for this connection.

The checksum calculation can be turned OFF if needed, but it is
ON by default.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-18 10:53:39 +03:00
Andrew Boie 2596daa4ae tests: fifo: extend cancel timeout limit
A non-tickless system with 10ms granularity was occasionally
taking up to 70ms for the cancellation to be propagated back.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-05-17 12:04:10 -04:00
Anas Nashif 876334c699 tests: net: reduce timeout of testcase
Use a reasonable timeout for the testcase.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-17 16:35:26 +03:00
Vinayak Kariappa Chettimada a7afc75c8a Bluetooth: shell: Add GATT write cmd throughput measurement
Add shell command to test GATT write cmd throughput between
two test shell peers.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-05-16 15:30:51 +03:00
Luiz Augusto von Dentz 4f019eab26 Bluetooth: shell: Remove forward declaration
It is possible to remove the forward declaration of l2cap_alloc_buf as
the recv pointer can be compared directly with chan pointer avoiding
using l2cap_ops directly.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-05-14 17:54:46 +03:00
Vinayak Kariappa Chettimada 9fd04ea272 Bluetooth: shell: Add L2CAP throughput measurement
Added l2cap-metrics command to shell application which will
collect the rx-ed L2CAP CoC throughput.

Usage (local shell):
> l2cap-register <chan>
> l2cap-metrics on

  From peer shell:
  > l2cap-connect <chan>
  > l2cap-send 10

> l2cap-metrics
l2cap rate: 119225 bps.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-05-14 11:19:27 +03:00
Andrew Boie 636f609d66 tests: kernel: fatal: check stack overflow
For all arches except ARC, enable stack sentinel and test that
some common stack violations trigger exceptions.

For ARC, use the hardware stack checking feature.

Additional testcase.ini blocks may be added to do stack bounds checking
for MMU/MPU-based stack protection schemes.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-05-13 15:14:41 -04:00
Andy Ross 73cb9586ce k_mem_pool: Complete rework
This patch amounts to a mostly complete rewrite of the k_mem_pool
allocator, which had been the source of historical complaints vs. the
one easily available in newlib.  The basic design of the allocator is
unchanged (it's still a 4-way buddy allocator), but the implementation
has made different choices throughout.  Major changes:

Space efficiency: The old implementation required ~2.66 bytes per
"smallest block" in overhead, plus 16 bytes per log4 "level" of the
allocation tree, plus a global tracking struct of 32 bytes and a very
surprising 12 byte overhead (in struct k_mem_block) per active
allocation on top of the returned data pointer.  This new allocator
uses a simple bit array as the only per-block storage and places the
free list into the freed blocks themselves, requiring only ~1.33 bits
per smallest block, 12 bytes per level, 32 byte globally and only 4
bytes of per-allocation bookeeping.  And it puts more of the generated
tree into BSS, slightly reducing binary sizes for non-trivial pool
sizes (even as the code size itself has increased a tiny bit).

IRQ safe: atomic operations on the store have been cut down to be at
most "4 bit sets and dlist operations" (i.e. a few dozen
instructions), reducing latency significantly and allowing us to lock
against interrupts cleanly from all APIs.  Allocations and frees can
be done from ISRs now without limitation (well, obviously you can't
sleep, so "timeout" must be K_NO_WAIT).

Deterministic performance: there is no more "defragmentation" step
that must be manually managed.  Block coalescing is done synchronously
at free time and takes constant time (strictly log4(num_levels)), as
the detection of four free "partner bits" is just a simple shift and
mask operation.

Cleaner behavior with odd sizes.  The old code assumed that the
specified maximum size would be a power of four multiple of the
minimum size, making use of non-standard buffer sizes problematic.
This implementation re-aligns the sub-blocks at each level and can
handle situations wehre alignment restrictions mean fewer than 4x will
be available.  If you want precise layout control, you can still
specify the sizes rigorously.  It just doesn't break if you don't.

More portable: the original implementation made use of GNU assembler
macros embedded inline within C __asm__ statements.  Not all
toolchains are actually backed by a GNU assembler even when the
support the GNU assembly syntax.  This is pure C, albeit with some
hairy macros to expand the compile-time-computed values.

Related changes that had to be rolled into this patch for bisectability:

* The new allocator has a firm minimum block size of 8 bytes (to store
  the dlist_node_t).  It will "work" with smaller requested min_size
  values, but obviously makes no firm promises about layout or how
  many will be available.  Unfortunately many of the tests were
  written with very small 4-byte minimum sizes and to assume exactly
  how many they could allocate.  Bump the sizes to match the allocator
  minimum.

* The mbox and pipes API made use of the internals of k_mem_block and
  had to be ported to the new scheme.  Blocks no longer store a
  backpointer to the pool that allocated them (it's an integer ID in a
  bitfield) , so if you want to "nullify" them you have to use the
  data pointer.

* test_mbox_api had a bug were it was prematurely freeing k_mem_blocks
  that it sent through the mailbox.  This worked in the old allocator
  because the memory wouldn't be touched when freed, but now we stuff
  list pointers in there and the bug was exposed.

* Remove test_mpool_options: the options (related to defragmentation
  behavior) tested no longer exist.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2017-05-13 14:39:41 -04:00
Vinayak Kariappa Chettimada 5effd68a9d Bluetooth: controller: Fix tests conf file to cover new features
Updated tests conf file with coverage for new feature Kconfig
options in the Controller. This is required to catch compile/
build regression.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-05-12 13:55:39 +03:00
Andrew Boie 68d3678abb tests: use k_thread_create()
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-05-11 20:24:22 -04:00
Andrew Boie 86468fc9a5 tests: kernel: common: adjust stack size
Use Kconfig for extra test case stack size, needed for Xtensa.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-05-11 12:47:23 -04:00
Paul Sokolovsky 2ddd620617 tests: kernel: errno: Add Newlib test config.
Added because previously, Zephyr used API incompatible with Newlib
for errno handling. Even with Newlib compatibility changes, we
override the function which is defined in Zephyr SDK libc.a, so
makes sense to ensure thsi works as expected.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-05-10 20:54:56 -04:00
Andrew Boie b1dd5ea50d tests: kernel: fatal: fix on ARC
Issue: ZEP-2114
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-05-10 20:13:07 -04:00
Paul Sokolovsky 3f50707672 kernel: queue, fifo: Add cancel_wait operation.
Currently, a queue/fifo getter chooses how long to wait for an
element. But there are scenarios when putter would know better,
there should be a way to expire getter's timeout to make it run
again. k_queue_cancel_wait() and k_fifo_cancel_wait() functions
do just that. They cause corresponding *_get() functions to return
with NULL value, as if timeout expired on getter's side (even
K_FOREVER).

This can be used to signal out of band conditions from putter to
getter, e.g. end of processing, error, configuration change, etc.
A specific event would be communicated to getter by other means
(e.g. using existing shared context structures).

Without this call, achieving the same effect would require e.g.
calling k_fifo_put() with a pointer to a special sentinal memory
structure - such structure would need to be allocated somewhere
and somehow, and getter would need to recognize it from a normal
data item. Having cancel_wait() functions offers an elegant
alternative. From this perspective, these calls can be seen as
an equivalent to e.g. k_fifo_put(fifo, NULL), except that such
call won't work in practice.

Change-Id: I47b7f690dc325a80943082bcf5345c41649e7024
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-05-10 09:40:33 -04:00
Sharron LIU 6c6182dba5 tests:kernel: added tests for printk left justifier
Added test case for printk the '-' indicator in format string
(left justifier).

Jira: ZEP-1599

Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-05-08 09:43:37 -04:00
Marti Bolivar 88f33dcc1b tests: json: add json_escape() tests
These all pass.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-05-08 08:52:52 -04:00
Vinayak Chettimada fc6d8d1bc4 Bluetooth: controller: Scan Request Notifications
Implement the framework for LE Scan Request Received Event.
The feature is available under the Controller's advanced
features and will be selected implcitly when Bluetooth v5.0
LE Advertising Extensions feature is implemented.

Jira: ZEP-2073

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-05-05 15:56:04 +03:00
Carles Cufi a1ff1a0933 Bluetooth: Consolidate flow control Kconfig
Since Controller to Host flow control is a feature that affects both
sides equally, move it to the top-level Kconfig file and consolidate its
use in both Controller and Host.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-05-04 18:09:31 +03:00
Luiz Augusto von Dentz ad4bb37b17 Bluetooth: shell: Fix deadlock when receiving L2CAP packet
The TX and RX pool needs to be split otherwise the TX code path may
consume all buffers causing the RX thread to deadlock which will
possible deadlock the TX thread as well in case it needs more credits.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-05-04 08:36:12 +03:00
Carles Cufi 7ebe7da736 Bluetooth: controller: Controller to Host flow control
The Bluetooth Specification allows for optional Controller to Host flow
control based on the same credit-based mechanism as the Host to
Controller one. This is particularly useful in 2-chip solutions where
the Host and the Controller are connected via a physical link (UART, SPI
or similar) where the Host is sometimes required to ask the Controller
to throttle its data traffic while still making sure that relevant
events get through the line.

This implementation is based on a simple queue of pending events and
data that is populated whenever the Controller detects that the Host is
out of buffers and then emptied whenever the Host notifies the
Controller that is ready to receive data again. Events relevant to the
connections are also queued to preserve the order of arrival.

At this point the Controller ignores the connection handle sent by the
Host and treats all connections equally, and it also queues events even
for connections that have no data pending in the queue. Both this items
can be improved if necessity arises.

Note that Number of Completed Packets will still flow freely from the
Controller to the Host regardless of the pending ACL data packets, which
might lead to inconsistencies in the sequential order of certain
operations that include bi-directional data transfer.

Jira: ZEP-1735

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-05-03 22:23:42 +03:00
Marti Bolivar 7e7a045fa9 tests: json: use JSON_OBJ_DESCR_PRIM
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-05-03 13:52:57 -04:00
Justin Watson 558281b096 arch: sam3x: update Kconfig options after move to SAM SoC family tree
The files for the Arduino Due needed to be updated to use the new
configuration when the SoC moved from the atmel_sam3 directory to
the atmel_sam/sam3x directory.

Jira: ZEP-2067

Signed-off-by: Justin Watson <jwatson5@gmail.com>
2017-05-03 13:51:37 -04:00
Adithya Baglody d03b2496cd test: benchmarking: Timing metrics for the kernel
JIRA: ZEP-1822, ZEP-1823, ZEP-1825

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2017-05-03 08:46:30 -04:00
Rishi Khare f6f8fb0f47 kernel tests: fatal: added "ignore_faults" tag
This test generates a fault as part of the test,hence make the
 test-suite aware of that by tagging it.

Signed-off-by: Rishi Khare <rishi.khare@intel.com>
2017-05-03 08:16:38 -04:00
Paul Sokolovsky b7f6aaaa72 tests: uart_basic_api: Don't assume we can drink from IRQ firehose.
There're (at least) 2 UART TX interrupt causes: "tx fifo has more
room" and "transmission of tx fifo complete". Zephyr API has only
one function to enable TX interrupts, uart_irq_tx_enable(), so it's
fair to assume it enables interrupt for both conditions. But then
immediately after enabling TX IRQ, it will be fired with "tx fifo
has more room" cause. If ISR doesn't do anything to fill FIFO, on
some architectures, immediately after return from ISR, it will be
fired again (with no instruction progress in the main application
thread). That's exactly the situation with this test, and on ARM,
it leads to inifnite IRQ loop.

So, instead move call to uart_fifo_fill() inside ISR, and be sure
to disable TX IRQ after we transmitted enough characters.

Change-Id: Ibbd05acf96b01fdb128f08054819fd104d6dfae8
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-05-02 09:31:36 -04:00
Anas Nashif 1084bd5ed3 tests: crypto: reduce high timeout value
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-01 09:37:34 -04:00
Anas Nashif e40bd685f6 tests: net: set reasonable timeout on dns test
This test has been slowing daily tests for no good reason, timeout of
10800 is way too high.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-01 09:37:34 -04:00
Luiz Augusto von Dentz a03e068b03 Bluetooth: shell: Don't attempt to reuse channel
If the channel is already in use don't attempt to connect it a second
time.

Change-Id: I87bdaeadbe866b59c1a7975002699d9ef7a90c61
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-04-29 11:39:13 -04:00
Gil Pitney 70040f0e11 boards: Add support for the CC3220SF_LAUNCHXL board
CC3220SF_LAUNCHXL effectively replaces the CC3200_LAUNCHXL,
with support for the CC3220SF SoC, which is an update for
the CC3200 SoC.

This is supported by the Texas Instruments CC3220 SDK.

Jira: ZEP-1958

Change-Id: I2484d3ee87b7f909c783597d95128f2b45db36f2
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2017-04-28 15:06:41 -05:00
Paul Sokolovsky 25307d5331 net: net_pkt_append: Refactor to return length of data actually added
For stream-based protocols (TCP), adding less data than requested
("short write") is generally not a problem - the rest of data can
be sent in the next packet. So, make net_pkt_append() return length
of written data instead of just bool flag, which makes it closer
to the behavior of POSIX send()/write() calls.

There're many users of older net_pkt_append() in the codebase
however, so net_pkt_append_all() convenience function is added which
keeps returning a boolean flag. All current users were converted to
this function, except for two:

samples/net/http_server/src/ssl_utils.c
samples/net/mbedtls_sslclient/src/tcp.c

Both are related to TLS and implement mbedTLS "tx callback", which
follows POSIX short-write semantics. Both cases also had a code to
workaround previous boolean-only behavior of net_pkt_append() - after
calling it, they measured length of the actual data added (but only
in case of successful return of net_pkt_append(), so that didn't
really help). So, these 2 cases are already improved.

Jira: ZEP-1984

Change-Id: Ibaf7c029b15e91b516d73dab3612eed190ee982b
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-04-28 15:01:09 +03:00
Ramesh Thomas c759ed1f94 samples: power: Time is passed as milliseconds in tickless kernel
In tickless kernel mode, time parameter of _sys_soc_suspend is in
milliseconds. Based on the kernel mode use the correct
mulitplier to convert to seconds.

Jira:1821
Change-Id: Idf156f56ece79a82729ebb124d1552a5eeb69e25
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2017-04-27 13:46:35 +00:00
Ramesh Thomas 700712f869 samples: tickless: Enables tickless kernel option in some apps
Adds changes to enable existing kernel and timer tests and samples to
be used to test the tickless kernel feature.

Updated samples/philosophers and tests/kernel/timer/timer_api apps

Run the tests using following commands
make pristine && make BOARD=<board> CONF_FILE=prj_tickless.conf qemu
Board could be any of the following
qemu_x86
quark_se_c1000_devboard

Jira: ZEP-339 ZEP-1812
Change-Id: I1530b19b79ddeb0e2181594caf15f3ac28ff51f4
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2017-04-27 13:46:33 +00:00
Andrew Boie 73abd32a7d kernel: expose struct k_thread implementation
Historically, space for struct k_thread was always carved out of the
thread's stack region. However, we want more control on where this data
will reside; in memory protection scenarios the stack may only be used
for actual stack data and nothing else.

On some platforms (particularly ARM), including kernel_arch_data.h from
the toplevel kernel.h exposes intractable circular dependency issues.
We create a new per-arch header "kernel_arch_thread.h" with very limited
scope; it only defines the three data structures necessary to instantiate
the arch-specific bits of a struct k_thread.

Change-Id: I3a55b4ed4270512e58cf671f327bb033ad7f4a4f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-26 16:29:06 +00:00
Andrew Boie ca441162a7 tests: add fatal test case
We want to show that if a non-essential thread gets a fatal exception,
that thread gets aborted but the rest of the system works properly.

We also test that k_oops() does the same.

Issue: ZEP-2052
Change-Id: I0f88bcae865bf12bb91bb55e50e8ac9721672434
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-22 10:31:49 -04:00
Andrew Boie 7827b7bf4a x86: exception-assisted panic/oops support
We reserve a specific vector in the IDT to trigger when we want to
enter a fatal exception state from software.

Disabled for drivers/build_all tests as we were up to the ROM limit
on Quark D2000.

Issue: ZEP-843
Change-Id: I4de7f025fba0691d07bcc3b3f0925973834496a0
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-22 10:31:49 -04:00
Kumar Gala eaaa175b92 tests: convert to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.

Jira: ZEP-2051

Change-Id: I6c676bc6c5e850a8725785554cd535e32067f33e
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 09:53:49 -05:00
Kumar Gala a509441210 net: convert to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.

Jira: ZEP-2051

Change-Id: I4ec03eb2183d59ef86ea2c20d956e5d272656837
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 09:30:38 -05:00
Jukka Rissanen f498a90b77 net: pkt: Make the debug print eye friendly
Print "pkt" instead of "Pkt" when printing network packet
pointer value.

Change-Id: Id4225be9c55807def3d892d372cdfc5c79c871fc
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-21 14:19:51 +03:00
Tomasz Bursztyka f3ff4f7bd3 net_pkt: Let's make all IPv6 related attributes prefixed with ipv6_
Only 2 attributes lacked this prefix, which makes sense to have, so
applying it accordingly and changing the helpers as well.

Change-Id: I095b2729f977f8fb1624eff8801a4a4e21416693
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-21 14:19:51 +03:00
Tomasz Bursztyka e5896906f6 net: Rename all *_BUF() macros to *_HDR()
Most of these macros are not exactly exposing a buffer, but a specific
header pointer (ipv6, ivp4, ethernet and so on), so it relevant to
rename them accordingly.

Change-Id: I66e32f7c3f2bc75994befb28d823e24299a53f5c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-21 14:19:51 +03:00
Tomasz Bursztyka db11fcd174 net/net_pkt: Fully separate struct net_pkt from struct net_buf
- net_pkt becomes a stand-alone structure with network packet meta
  information.
- network packet data is still managed through net_buf, mostly named
  'frag'.
- net_pkt memory management is done through k_mem_slab
- function got introduced or relevantly renamed to target eithe net_pkt
  or net_buf fragments.
- net_buf's sent_list ends up in net_pkt now, and thus helps to save
  memory when TCP is enabled.

Change-Id: Ibd5c17df4f75891dec79db723a4c9fc704eb843d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-21 14:19:50 +03:00
Tomasz Bursztyka bf964cdd4c net: Renaming net nbuf API to net pkt API
There have been long lasting confusion between net_buf and net_nbuf.
While the first is actually a buffer, the second one is not. It's a
network buffer descriptor. More precisely it provides meta data about a
network packet, and holds the chain of buffer fragments made of net_buf.

Thus renaming net_nbuf to net_pkt and all names around it as well
(function, Kconfig option, ..).

Though net_pkt if the new name, it still inherit its logic from net_buf.
'
This patch is the first of a serie that will separate completely net_pkt
from net_buf.

Change-Id: Iecb32d2a0d8f4647692e5328e54b5c35454194cd
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-21 14:19:50 +03:00
Kumar Gala 3c454017b4 Merge "Merge bluetooth branch into master" 2017-04-20 16:55:36 +00:00
Kumar Gala 789081673f Introduce new sized integer typedefs
This is a start to move away from the C99 {u}int{8,16,32,64}_t types to
Zephyr defined u{8,16,32,64}_t and s{8,16,32,64}_t.  This allows Zephyr
to define the sized types in a consistent manor across all the
architectures we support and not conflict with what various compilers
and libc might do with regards to the C99 types.

We introduce <zephyr/types.h> as part of this and have it include
<stdint.h> for now until we transition all the code away from the C99
types.

We go with u{8,16,32,64}_t and s{8,16,32,64}_t as there are some
existing variables defined u8 & u16 as well as to be consistent with
Zephyr naming conventions.

Jira: ZEP-2051

Change-Id: I451fed0623b029d65866622e478225dfab2c0ca8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-20 16:07:08 +00:00
Johan Hedberg c52fa3c424 Merge bluetooth branch into master
- newlib related fixes for the AT parser
 - Channel Selection Algorithm #2 support (Bluetooth 5.0 feature)
 - Better tracking of outgoing data (with callback support)
 - Various smaller cleanups & fixes

----------------------------------------------------------------
Carles Cufi (3):
      Bluetooth: HCI: Add Bluetooth 5.0 LE commands and events
      Bluetooth: HCI: Naming consistency tweaks
      Bluetooth: Use event masks instead of bits in controller and host

Johan Hedberg (8):
      Bluetooth: hci_raw: Fix ECC support
      Bluetooth: Add support for tracking transmitted packets
      Bluetooth: ATT: Enforce flow for incoming requests & indications
      Bluetooth: SMP: Track when last key distribution PDU has been sent
      Bluetooth: Introduce a timeout for synchronous HCI command sending
      Bluetooth: ATT: Fix bogus CONTAINER_OF() usage
      Bluetooth: Introduce flow control for outgoing ATT packets
      Bluetooth: ATT: Start response timer only after actual transmission

Kumar Gala (3):
      Bluetooth: AT: use explicit unsigned char to avoid array subscript error
      Bluetooth: AT: Fix building with newlib
      Bluetooth: AT: Unit: Fixup include search path

Luiz Augusto von Dentz (4):
      Bluetooth: ipsp: Add TX pools for TCP
      Bluetooth: L2CAP: Try to allocate segment from the original pool
      net: buf: Add net_buf_reset
      Bluetooth: L2CAP: Reuse request buffer to respond

Vinayak Chettimada (5):
      Bluetooth: controller: Rename channel/chnl to chan
      Bluetooth: HCI: Add Bluetooth 5.0 FeatureSet field's bit mapping
      Bluetooth: Fix missing LE conn param req bit in set LE evt mask
      Bluetooth: controller: Support BT 5.0 feature set bit fields
      Bluetooth: controller: Channel Selection Algorithm #2

 include/bluetooth/hci.h                           | 495 +++++++++++++++--
 include/bluetooth/l2cap.h                         |   2 +-
 include/net/buf.h                                 |   9 +
 samples/bluetooth/ipsp/src/main.c                 |  15 +
 subsys/bluetooth/controller/Kconfig               |   7 +
 subsys/bluetooth/controller/hal/nrf5/radio.c      |   4 +-
 subsys/bluetooth/controller/hal/radio.h           |   2 +-
 subsys/bluetooth/controller/hci/hci.c             |  95 ++--
 subsys/bluetooth/controller/ll_sw/ctrl.c          | 622 ++++++++++++++++------
 subsys/bluetooth/controller/ll_sw/ctrl.h          |  71 ++-
 subsys/bluetooth/controller/ll_sw/ctrl_internal.h |  25 +-
 subsys/bluetooth/controller/ll_sw/ll.c            |  24 +-
 subsys/bluetooth/controller/ll_sw/pdu.h           |  12 +-
 subsys/bluetooth/host/Kconfig                     |  31 ++
 subsys/bluetooth/host/at.c                        |   2 +-
 subsys/bluetooth/host/at.h                        |   2 +-
 subsys/bluetooth/host/att.c                       | 230 ++++++--
 subsys/bluetooth/host/conn.c                      | 111 +++-
 subsys/bluetooth/host/conn_internal.h             |  23 +-
 subsys/bluetooth/host/hci_core.c                  | 163 +++---
 subsys/bluetooth/host/hci_core.h                  |   3 +-
 subsys/bluetooth/host/hci_ecc.c                   |   2 +-
 subsys/bluetooth/host/hci_raw.c                   |   4 +
 subsys/bluetooth/host/hfp_hf.c                    |   2 +
 subsys/bluetooth/host/l2cap.c                     |  79 ++-
 subsys/bluetooth/host/l2cap_internal.h            |  12 +-
 subsys/bluetooth/host/sdp.c                       |   2 +
 subsys/bluetooth/host/smp.c                       | 117 +++-
 subsys/net/buf.c                                  |  12 +-
 tests/bluetooth/init/prj_controller_4_0.conf      |   1 +
 tests/unit/bluetooth/at/src/Makefile              |   2 +-
 tests/unit/bluetooth/at/src/main.c                |   2 +-
 32 files changed, 1695 insertions(+), 488 deletions(-)

Change-Id: I17f9e49e1347a38bc78be3bdcaa596e41d83da56
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-20 18:45:15 +03:00
Anas Nashif 0b1d41d31d kernel: remove mentions of obsolete CONFIG_NANO_TIMERS
Change-Id: I0a2d6caae6d37b45968e61be8eaf7c4ebb6fdc46
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-20 12:27:36 +00:00
Vinayak Chettimada 392b5deacb Bluetooth: controller: Channel Selection Algorithm #2
Add Bluetooth 5.0 LE Channel Selection Algorithm #2 feature

Jira: ZEP-2033

Change-id: Ic1155b4399882b89cab33cac78b08b7b39ff6f9d
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-04-20 08:58:09 +03:00
Kumar Gala a87e6e1cce Bluetooth: AT: Unit: Fixup include search path
Because of the way we build we can't expect relative paths back into the
Zephyr code base to work properlly.  This just happens to work on some
systems because of the various -I that exist and one hits the right
number of subdirs between it and where the "at.h" lives.  Lets instead
add the Zephyr root as a include path and explicit do a relative path
from the root to get the header.

We end up with a build failure with newlib enabled on galileo because it
ends up not having an include path that gets us to the proper spot with
the various ../../.. ...

Change-Id: I48b4dc2dffb76314f380efbcbbe25957ff5e9e07
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-20 08:58:09 +03:00
Anas Nashif 45a7e5d076 kernel: remove legacy.h and MDEF support
Change-Id: I953797f6965354c5b599f4ad91d63901401d2632
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-19 10:59:35 -05:00
Anas Nashif 306e15e0a1 kernel: remove legacy kernel support
Change-Id: Iac1e21677d74f81a93cd29d64cce261676ae78a6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-19 15:48:37 +00:00
Andrew Boie 2d9a559df8 tests: crypto: enable on other arches
Some tests have large RAM requirements, appropriate filters added.
Redundant 'build_only = false' removed.

Issue: ZEP-1721
Change-Id: Id8b06b2ea8a63cf19cf155a75f1513810c383521
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-18 20:51:39 +00:00
Youvedeep Singh 76fc2f92df test_tickless: Change test_tickless location to tests/kernel/test_tickless/
Tickless test dependency on legacy API is resolved, Changing
test directory from tests/legacy/kernel/test_tickless to
tests/kernel/test_tickless/.

Jira: ZEP-2008

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
Change-Id: I0b53ae6eff3a915d988d3234592eb5f8b425b371
2017-04-18 22:25:01 +05:30
Youvedeep Singh 576cfd9e74 test_tickless: replacing depreciated APIs with new one.
As part of Zephyr release 1.9 some APIs will be depreciated. This patch
replaces two of such APIs (task_sleep(ticks), sys_tick_get_32()) with
new ones (k_sleep(ms), k_uptime_get_32()).

Jira: ZEP-2008

Change-Id: Ic0e05906dadfb2ddaea9d0a8b738294dc81430f9
Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
2017-04-18 22:08:19 +05:30
Youvedeep Singh 9031c55566 test_sleep: move test_sleep from tests/legacy/kernel to tests/kernel
As test_sleep does not have dependency over legacy APIs.
So moving files from tests/legacy/kernel to tests/kernel.

Jira: ZEP-2009

Change-Id: I2439391ba6d0a194d07a0d1b48911d37b2f493b0
Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
2017-04-18 09:39:15 +05:30
Youvedeep Singh d353800879 test_sleep: replacing depreciated APIs with new one.
As part of Zephyr Release 1.9 some APIs will be depreciated.
This patch replaces APIs related to semophore init, kernel sleep,
task spawn etc.

Jira: ZEP-2009

Change-Id: I1fe09e9592f503c3413d51857fd740703173c042
Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
2017-04-18 09:26:58 +05:30
Sharron LIU eea12f6f14 tests: kernel: add tickless test
Added test cases to verify tickless idle concepts defined in
https://www.zephyrproject.org/doc/subsystems/power_management.html#tickless-idle

Test points:
verify system clock recovery after exiting tickless idle;
verify slicing scheduler behaves as expected

Jira: ZEP-339

Change-Id: Ic0a86d725e9692aa217375cedc7396372a026a88
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-04-18 01:50:47 +00:00
Kumar Gala 7fb0e36060 tests: sprintf: cleanup to work with newlib
newlib doesn't implement the internal buffer the same way that minimal
libc does, so only run that check with min libc (ie !CONFIG_NEWLIB_LIBC).
Also, reported the length we did get if the buffer is to big.  Finally
include <stdarg.h> since we are dealing with va_lists and such.

Change-Id: I6b23e448e5785df978ac8c2757099e2b8aaace54
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-18 00:27:33 +00:00
Kumar Gala ab8a3b2c0d tests: app_kernel: limit to systems with >32K of memory
We need a bit over 32k of memory to build/run the app_kernel benchmarks.

Change-Id: Iddfeb073f8ea87dc6323775a288b83efa88fdaea
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-14 16:12:57 -05:00
Anas Nashif 4c80a2fb71 tests: crypto: disable 2 tests that are ridiculously slow
Change-Id: I54194c06a1f3dfe1412dbfff50e9866134cf881a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-14 10:42:29 -04:00
Anas Nashif e8abb973e1 tests: app_kernel: enable ARM for this benchmark
Change-Id: I7d45bd5e84f174a951170c7b4ab464110976a00f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-14 10:42:29 -04:00
Anas Nashif e521d6e888 tests: remove legacy tag from ported tests
Change-Id: I77484a704062013577417e7d05ad65cf268d74b2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-14 10:42:29 -04:00
Kumar Gala 4ada031fb5 unit: Fixup crc unit test for zassert change
We renamed ztest's assert to zassert and the crc test case wasn't
updated to match so it doesn't build.

Change-Id: I67cd5bb6eef0875f31b8825d5c3aa5e1fa46af04
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-14 06:08:27 -05:00
Anas Nashif 0ac3a231f1 tests: rename ztests' assert > zassert
Change-Id: Ibccc5da75ad42bc035052e5946f977a49f6a7d2f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-14 00:07:06 -04:00
Anas Nashif d3af7f75c9 Merge "Merge net branch into master" 2017-04-14 01:43:34 +00:00
Kumar Gala c7bc909914 tests/ztest: rename assert macros to be zephyr specific
ztest has a number of assert style macros and used a baseline assert()
that varies from the system definition of assert() so lets rename
everything as zassert to be clear.

Change-Id: I7f176b3bae94d1045054d665be8b5bda947e5bb0
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-13 21:17:33 +00:00
Andrew Boie b53145c6bc ztest: apply extra stack size to ztest stack
The directive exists for platforms that require more stack space than
usual. However, it wasn't being applied to the ztest thread stack
which ztest-enabled cases are run on.

Fixes numerous failures on xtensa simulator targets.

Change-Id: Iafa84de002421f03729c0f0cdeefdea51842ae32
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-13 12:45:36 -07:00
Andrew Boie a883722fb6 tests: test_pipe_api: increase stack size
A recent patch added some new tests here. Unfortunately,
the current stack size value of 512 was too small for Xtensa.
Increase it to 1024.

Change-Id: I16c52b74412cbd7665e774ce3baed260885ddb9b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-13 18:58:51 +00:00
Andrew Boie d75fa6bc13 tests: sprintf: increase stack size
A recent patch pinned the stack size for this test at 1024
instead of the platform default. This value wasn't sufficient
on Xtensa. Set to 2048, which was the default on most platforms.

Change-Id: I9a9d5fd448d2377aaf782c2c093a16147f31886a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-13 18:58:24 +00:00
Jukka Rissanen bed1117423 net: tests: Enables all net kconfig options in one test case
This creates a test case that enables all the currently known
network related Kconfig options. This is useful so that we can
compile test various Kconfig options. Note that the result binary
is not meant to be run anywhere and it will probably not run as
some of the enabled options do not make sense in real life.

Change-Id: Iede36131b43d95acb78b4094004626e1b86e0f95
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:44 +03:00
Tomasz Bursztyka 000539ecd2 tests/net: arp_input() unref the buffer on success
Since commit-id 1ab40390c9 arp_input()
unrefs the buffer on success (NET_OK) so no need to do it afterward.

Change-Id: I84ab7e8eb07f50d52b329e4c025d88753a5de4db
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-13 15:21:43 +03:00
Tomasz Bursztyka 19a321090c tests/net: MQTT tests should be under lib
moving tests/net/mqtt_* tests under tests/net/lib/

Change-Id: I966a6b303ad4d0fb467f277a4a7379b29fe40e98
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-13 15:21:43 +03:00
Jukka Rissanen 31d3406efa net: rpl: Fix the statistics collection
The Kconfig.rpl file was missing option to actually collect
RPL statistics. Unified the config option name to be
CONFIG_NET_STATISTICS_RPL as there was two conflicting settings
in the code and both of them were missing from Kconfig file.

Change-Id: I4ce4fcbaa317b36cac315ea3b3f710fa7a344b25
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:42 +03:00
Wu Jiequan 0e3d582623 tests: net: Add mqtt testcases
Add two testcases for mqtt_publisher and mqtt_subscriber.
The combination of the two, covering most of the MQTT APIs.

Change-Id: Ib663ee1f550362ca493501046ddf8508a25ac956
Signed-off-by: Wu Jiequan <jiequanx.wu@intel.com>
2017-04-13 15:21:42 +03:00
Patrik Flykt 3f8f1ed3b0 unit: Create ztest unit test for CRC16 functionality
Ensure that the CRC16 functions compute a few test values properly.

Change-Id: Ie98049aefac8a330b9b81d3bf333deb09bc35c39
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2017-04-13 15:21:42 +03:00
Jukka Rissanen 1b2c16a498 net: nbuf: Add function to split a data fragment
Add net_nbuf_split() function that can be used to split
an existing net_buf fragment into two arbitrary length pieces,
and return the two new fragments to the caller. The data from
the original fragment is copied into these two new fragments.

Existing fragment is not modified.

Change-Id: I463e675232c6e19c2a42929f480893a6d1265873
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:41 +03:00
Jukka Rissanen f8c3467bde tests: net: tcp: Fix NULL pointer dereference
Incorrectly use variable even if it is null.

Coverity-CID: 157593

Change-Id: I883421a16870e5fe3c1d81e461f55f912ea168c0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:41 +03:00
Milosz Wasilewski deea71b3c6 tests: added TC_START to tests
TC_START was missing from some tests. For this reason automated testing
parsing wasn't unified for all tests. This patch fixes the issue and adds
TC_START to tests where it was missing.

Change-Id: I7e27a3fd8eaef9c3d0b0e0aeba9bca5b97eb0c58
Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
2017-04-13 12:08:14 +00:00
Anas Nashif 6c77313a28 tests: benchmarks: increase timeout for app_kernel tests
This test takes a bit longe than specified and fails on a daily basis
due to the low timeout specified.

Change-Id: Id774c35cb1b0d0dcc5455e4121a8e9e1612baafd
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-12 22:43:26 +00:00
Andrew Boie a313353344 xtensa: re-enable tinycrypt test cases
Tinycrypt 0.2.6 fixed the issue with the definition of 'bool'.

Issue: ZEP-1722
Change-Id: Ie470e25dfe02a58d9c3f2324cab85bc02f574b51
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-12 16:32:29 +00:00
ethan gao 8e22350651 tests: add AES cmac test to mbedtls test
it covers the story "Port AES-CMAC-PRF-128 [RFC 4615]
encryption library for Thread support"

ZEP-734

Change-Id: I6213309b51da435060c3e3cfadde67e21a927b2b
Signed-off-by: ethan gao <ethan.gao@intel.com>
2017-04-12 05:49:11 +00:00
Adithya Baglody abfbcc9318 tests: benchmarks: move app_kernel to unified kernel.
Deleted the instance of app_kernel in tests/legacy/benchmark.

JIRA: ZEP-1980
Change-Id: I5a6e073d9b0c870be0cc7d8ae5bb352b11d7f97e
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2017-04-11 21:07:01 -04:00
Anas Nashif bf382a59e0 tests: sprintf: increased main stack
This was failing when run on Quark D2000 CRB

Change-Id: I2d85fca15d1a89ad83fcb61a14a70ad94b5df373
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-10 16:41:06 -04:00
Anas Nashif b84dc2e124 kernel: remove all remaining references to nanokernel
Change-Id: I43067508898bc092879f7fe9d656ccca6fd92ab2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-10 20:21:10 +00:00
Anas Nashif d7bc60f096 kernel: remove remaining microkernel references
Change-Id: Ie648dbaaf714316c21395bd43e555618013dbd19
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-10 20:21:05 +00:00
Johan Hedberg 2ed8d83d4d Merge bluetooth branch into master
Controller:
	- Added duplicate filtering support
	- Added event mask support
	- Kconfig enhancements
	- Various cleanups

 Host:
	- IRQ locking fix to monitor protocol
	- Fixed potential deadlock in ECDH support
	- Fix to connection error reporting
	- Fix to GATT signing
	- Fix to LE CoC
	- AT command & HFP improvements

----------------------------------------------------------------
Carles Cufi (4):
      Bluetooth: controller: Implement scan duplicate filter
      Bluetooth: controller: Implement event masks
      Bluetooth: controller: Fix warning with no dup filter
      Bluetooth: test: Add "tiny" controller configuration

Johan Hedberg (11):
      Bluetooth: monitor: Drop data instead of holding IRQ lock for long
      Bluetooth: monitor: Add support for logging packet drops
      Bluetooth: HCI: Add define for success status
      Bluetooth: ECC: Fix command status emission from wrong thread
      Bluetooth: Controller: Introduce rate-limiting on stack analysis
      Bluetooth: Remove unnecessary controller-side buffers tracking
      Bluetooth: SMP: Remove redundant ';'
      Bluetooth: hci_ecc: Fix ECDH API usage
      Bluetooth: tests/shell: Limit BR/EDR configuration to Qemu for now
      Bluetooth: conn: Pass disconnect error properly to the conn struct
      Bluetooth: conn: Set initial responder address when connecting

Luiz Augusto von Dentz (4):
      Bluetooth: GATT: Fix using write command when signing was requested
      Bluetooth: GATT: Be consistent with error in case SMP is disabled
      Bluetooth: L2CAP: Fix accounting SDU header len as data
      Bluetooth: GATT: Use sys_slist_t to represent the database

Sathish Narasimman (5):
      Bluetooth: AT: Unit test application init
      Bluetooth: HFP HF: Lookup table for unsolicited commands
      Bluetooth: HFP HF: Add support for RING indication cb
      Bluetooth: HFP HF: Support to send hf AT command
      Bluetooth: AT: Fix - chance of missing UNSOLICITED state

Vinayak Chettimada (17):
      Bluetooth: controller: Kconfig for advanced event preparation
      Bluetooth: controller: Kconfig option for advanced scheduling
      Bluetooth: controller: Hide advance features in Kconfig
      Bluetooth: controller: Move comp id and subver to configuration
      Bluetooth: Kconfig: Move BLUETOOTH_CONTROLLER to Controller file
      Bluetooth: Kconfig: Group stack size related options
      Bluetooth: Kconfig: Group HCI_RAW related options
      Bluetooth: Kconfig: Move BLUETOOTH_MAX_SCO_CONN to BR/EDR
      Bluetooth: Compile BR/EDR independent of BLUETOOTH_CONN check
      Bluetooth: Permit connectionless host-controller combined build
      Bluetooth: controller: Cleanup redundant ticker busy loop
      Bluetooth: controller: Move nRF5 specific debug pins to hal/nrf5
      Bluetooth: controller: Remove util/config.h
      Bluetooth: controller: Make worker and job priority configurable
      Bluetooth: controller: Add BT 5.0 PDU structs
      Bluetooth: controller: Group dup filter Kconfig with buf options
      Bluetooth: controller: Use defined keyword in #if cond compiles

 include/bluetooth/gatt.h                      |   2 +-
 include/bluetooth/hci.h                       |  41 ++++++
 include/bluetooth/hfp_hf.h                    |  50 +++++++
 samples/bluetooth/handsfree/src/main.c        |   6 +
 subsys/bluetooth/Kconfig                      |  12 +-
 subsys/bluetooth/controller/Kconfig           | 120 ++++++++++++++-
 subsys/bluetooth/controller/hal/debug.h       | 199 +------------------------
 subsys/bluetooth/controller/hal/nrf5/debug.h  | 204 ++++++++++++++++++++++++++
 subsys/bluetooth/controller/hci/hci.c         | 132 ++++++++++++++++-
 subsys/bluetooth/controller/hci/hci_driver.c  |  24 ++-
 subsys/bluetooth/controller/ll_sw/ctrl.c      | 152 ++++++++-----------
 subsys/bluetooth/controller/ll_sw/ctrl.h      |  21 ++-
 subsys/bluetooth/controller/ll_sw/ll.c        |  14 +-
 subsys/bluetooth/controller/ll_sw/pdu.h       |  20 +++
 subsys/bluetooth/controller/ticker/ticker.c   | 127 +++++++---------
 subsys/bluetooth/controller/util/config.h     |  30 ----
 subsys/bluetooth/controller/util/mayfly.c     |   2 -
 subsys/bluetooth/controller/util/mayfly.h     |   7 +
 subsys/bluetooth/host/Kconfig                 | 120 +++++++--------
 subsys/bluetooth/host/Makefile                |  32 ++--
 subsys/bluetooth/host/at.c                    |  28 +++-
 subsys/bluetooth/host/at.h                    |   3 +-
 subsys/bluetooth/host/conn.c                  |  15 ++
 subsys/bluetooth/host/conn_internal.h         |  11 +-
 subsys/bluetooth/host/gatt.c                  |  66 ++++-----
 subsys/bluetooth/host/hci_core.c              |  11 +-
 subsys/bluetooth/host/hci_core.h              |   2 +
 subsys/bluetooth/host/hci_ecc.c               | 169 +++++++++++++--------
 subsys/bluetooth/host/hfp_hf.c                | 138 ++++++++++++++++-
 subsys/bluetooth/host/l2cap.c                 |   7 +-
 subsys/bluetooth/host/monitor.c               | 108 +++++++++++---
 subsys/bluetooth/host/monitor.h               |  13 +-
 subsys/bluetooth/host/smp.c                   |   2 +-
 tests/bluetooth/init/prj_controller.conf      |   4 +
 tests/bluetooth/init/prj_controller_4_0.conf  |   4 +
 tests/bluetooth/init/prj_controller_dbg.conf  |   4 +
 tests/bluetooth/init/prj_controller_tiny.conf |  21 +++
 tests/bluetooth/shell/src/main.c              |  39 ++++-
 tests/bluetooth/shell/testcase.ini            |   2 +-
 tests/unit/bluetooth/at/Makefile              |   4 +
 tests/unit/bluetooth/at/prj.conf              |   5 +
 tests/unit/bluetooth/at/src/Makefile          |   4 +
 tests/unit/bluetooth/at/src/main.c            |  76 ++++++++++
 tests/unit/bluetooth/at/testcase.ini          |   4 +
 44 files changed, 1408 insertions(+), 647 deletions(-)
 create mode 100644 subsys/bluetooth/controller/hal/nrf5/debug.h
 delete mode 100644 subsys/bluetooth/controller/util/config.h
 create mode 100644 tests/bluetooth/init/prj_controller_tiny.conf
 create mode 100644 tests/unit/bluetooth/at/Makefile
 create mode 100644 tests/unit/bluetooth/at/prj.conf
 create mode 100644 tests/unit/bluetooth/at/src/Makefile
 create mode 100644 tests/unit/bluetooth/at/src/main.c
 create mode 100644 tests/unit/bluetooth/at/testcase.ini

Change-Id: I3b0f10cdbc59bcaeaea0a1bd8f613e42c829b13f
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-10 12:10:41 +03:00
Johan Hedberg ba7b6b1ced Bluetooth: tests/shell: Limit BR/EDR configuration to Qemu for now
The BR/EDR configuration doesn't fit e.g. the Arduino 101 anymore.
Limit it to Qemu for the time being, which is anyway the primary
target where the functionality is being tested.

Change-Id: I9a34c82157d56079e43acabe29eeadd6d99e03fe
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-09 19:05:34 +03:00
Anas Nashif 24183ffe3e tests: tickless: remove unused code
Change-Id: I6bf2d0a5205c72c6a0cd2193fe97e60c45c83471
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-09 15:45:19 +00:00
Anas Nashif 2fceb7260d tests: move fs test to tests/subsys/
Change-Id: Ic9a02cb9dc2376b2818740d31eb8e8a71526cbb8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-09 15:45:18 +00:00
Sharron LIU 9de266d40c tests: kernel: add test point k_cpu_atomic_idle
tests/kernel/context:
added test point to cover k_cpu_atomic_idle.

Jira: ZEP-1242

Change-Id: Id09c89fd367d527ea1087e6eb2bdba29a338ceaf
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-04-09 15:45:02 +00:00
Qiu Peiyang 9f98bb44ae tests: driver: uart: fix unchecked return value
Coverity points out that uart_irq_update() return value
should be checked.

Coverity-CID: 166776

Change-Id: I3a754dae9e8f1563f4879e2fadfd89621785de8f
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-04-09 15:07:44 +00:00
Sharron LIU 34dc39d435 tests: kernel: added clock_test
tests/kernel/common:
added test case to cover kernel clocks service.
https://www.zephyrproject.org/doc/kernel/timing/clocks.html

Jira: ZEP-1242

Change-Id: I40a06dd9d4dcb1ed24d488088eb2e456740c3bad
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-04-09 15:06:59 +00:00
Carles Cufi b37f743a13 Bluetooth: test: Add "tiny" controller configuration
Add a configuration that strips the BLE controller down to its simplest
form to catch any issues when commonly used options are not enabled.

Change-Id: Ifbec01d62b7d45fe9139dadaba734eff3b7a72b6
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-04-08 20:11:55 +03:00
Carles Cufi 27e83660ff Bluetooth: controller: Implement scan duplicate filter
Implement the controller's ability to drop duplicate advertising reports
when instructed by the Host.

Jira: ZEP-1246

Change-Id: I2d1b7abf1ed950dde705e5df30a858c595f3834c
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-04-08 20:11:54 +03:00
Vinayak Chettimada 7c22073195 Bluetooth: controller: Make worker and job priority configurable
Add Controller advanced Kconfig options to select IRQ
priorities of the Radio, Ticker's Worker and JOB IRQs.

This will provide an opportunity to have peripheral IRQ's
of higher level than Bluetooth Controller.

Change-id: Iaa128c1cd64a309a77d42d485fdefe68f31e4895
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-04-08 20:11:54 +03:00
Vinayak Chettimada f38d57cba3 Bluetooth: controller: Kconfig option for advanced scheduling
Add Kconfig option to enable advanced scheduling in the
controller.

Enable non-overlapping placement of observer, initiator and
master roles in timespace. Uses window offset in connection
updates and uses connection parameter request in slave role
to negotiate non-overlapping placement with active master
roles to avoid slave roles drifting into active master
roles in the local controller.

This feature maximizes the average data transmission amongst
active concurrent master and slave connections while other
observer, initiator, master or slave roles are active in the
local controller.

Disabling this feature will lead to overlapping role in
timespace leading to skipped events amongst active roles.

Change-id: I16e4e6c3ca99f93987ab86924af0cb9d76bdbc7e
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-04-08 20:11:54 +03:00
Vinayak Chettimada 646726518f Bluetooth: controller: Kconfig for advanced event preparation
Added Kconfig option to enable advanced event preparation
feature.

Enables advanced event preparation offset ahead of radio
tx/rx, taking into account predictive processing time
requirements in preparation to the event, like control
procedure handling and CPU execution speeds. Crystal
oscillator is retained between closely spaced consecutive
radio events to reduce the overall number of crystal
settling current consumptions.

This feature maximizes radio utilization in an average role
event timeslice when they are closely spaced by using a
reduced offset between preparation and radio event.

By disabling this feature, the controller will use a
constant offset between the preparation and radio event. The
controller will toggle crystal oscillator between two
closely spaced radio events leading to higher average
current due to increased number of crystal settling current
consumptions.

Change-id: I19e640f7395ac7938873ef4bfac38acf8d6f7e0e
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-04-08 20:11:54 +03:00
Sathish Narasimman 95c4d0c1f3 Bluetooth: AT: Unit test application init
AT Module unit testing application to verify at_parse_input,
at_parse_cmd_input, at_get_number.

Change-Id: I256c0f9b62c13bc6f22eac4b94118b5fc7643462
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
2017-04-08 20:11:54 +03:00
Jukka Rissanen 5d7a7c253a ztest: Give error if user has not defined CONFIG_ZTEST
If user is trying to use ztest by including ztest.h but has
not defined CONFIG_ZTEST, then fail the compilation as the
result binary will not do anything.

There is no check for CONFIG_ZTEST for unit tests that are run
without qemu.

Change-Id: Ief9bba3a3a0f6acc6a264f17cde828b6d7e543a5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-08 12:13:50 +00:00
Jon Medhurst a89ed6d7d5 tests: dma: Initialise callback enable flags
The test failed to initilise these to known states, so fix this by
asking for end of transfer and error callbacks.

Change-Id: I523168381329062ec0c17aa41cb4033b78d8ed99
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2017-04-05 17:18:23 +00:00
Anas Nashif e5f150f0d9 tests: rename TICKS_UNLIMITED -> K_FOREVER
Change-Id: I1d65c7a0302b2dda0bc23e38f94f7be51de0f917
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-04 19:52:50 +00:00
Anas Nashif 7a90ab448b tests: port static_idt test to unified kernel
Change-Id: Ida4333b91ad322ff676cfbaa2ccaab0bdd38cd48
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-04 12:34:38 -04:00
Anas Nashif 7d5be2af73 Merge "Merge net branch into master" 2017-04-01 20:46:11 +00:00
Qiu Peiyang fe415dbf62 tests: drivers: spi: fix variable type mismatches
These were flagged by icx build.

Jira: ZEP-1887

Change-Id: Iaeedb13be23e86ebfb29a6441574b7384ae836e1
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-04-01 20:36:03 +00:00
Tomasz Bursztyka 8108a608ff net/mgmt: Mask vs event should be verified part by part
It needs to check if current event matches:

- cb's layer
- cb's layer code
- cb's command

If none match, it will not raise the event.

Fixing the unit test as layer must be always != 0.

Jira: ZEP-1940

Change-Id: Iadd63e751fa6e534a10e7da9cae0f5bb5a384461
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 12:15:29 +00:00
Tomasz Bursztyka dc7be7c54f net/ieee802154: Disable ACK reply handling by default
Most (if not all) 802.15.4 devices can handle ACK replies by
themselves.

Change-Id: I0319d59de767b20eb67c1592bacaa4a7b7015cad
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:28 +02:00
Tomasz Bursztyka 5e3354dad5 net/ieee802154: We don't get the MFR from device drivers
commit id 7a11439020 changed this.
Hopefully that changed did not affect anything.

Reducing minimal frame length and applying the change everywhere where
relevant.

Change-Id: I5ae203751bfcf70cef833620106d2c2d0e33b7a5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:28 +02:00
Tomasz Bursztyka 82709802a9 tests/net/ieee802154: Add a unit test for secured data frame validation
Change-Id: I3e35d13d1fdfacb6625dfe1b7b30cc2354a7ee93
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:28 +02:00
Tomasz Bursztyka cca117d8b9 tests/net/ieee802154: Switch l2 to ztest framework
Change-Id: Ibce93d4652e3991a06e870fc81e952788f0c6465
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:27 +02:00
Tomasz Bursztyka 7f50b56c0e tests/net/ieee802154: Add a simple CC2520 crypto dev test
It will first run the datasheet example.

Change-Id: Ic4da5ba9170a253cfdff4b17010d72dc86376555
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 10:39:33 +02:00
Jukka Rissanen a8dc0e60aa net: tests: Fix nbr lookup in route tests
The neighbor was added very fragile way into neighbor cache which
caused following queries to fail. This is now fixed by manually
adding neighbor to the cache.

Change-Id: I1831557fd5f9df5afd0a6c6833b0af769f5167eb
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-31 10:58:17 +03:00
Jukka Rissanen 625870a2f6 net: rpl: Temporarily disable some of the RPL tests
Couple of tests started to fail without any apparent reason.
Disabling them temporarily until the root cause is found.

Change-Id: Id82e0eab60dc744c8ce6f02a5834e731be153883
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-31 10:58:17 +03:00
Anas Nashif e698c9c5aa tests: do not build with legacy API enabled
Change-Id: Ie1b6a808797774e5e04e1a1219861443e72cfeca
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-29 16:02:45 -04:00
Flavio Santes c3f79e1d46 test/crypto: Update ECC DSA test case
The ECC DSA test case was updated in TinyCrypt 0.2.6.

Fix the length of the random vector.

Change-Id: I7545a51c6855959afdefe00a1e0b53e5c3001a7c
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-25 15:42:13 +00:00
Flavio Santes 3692aed6a8 test/crypto: Update ECC DH test case
The ECC DH test case was updated in TinyCrypt 0.2.6.

This patch adds two helper arrays for the Monte Carlo routine.

Change-Id: If28292512b351feffc3fe470942cd97b18851a57
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-25 15:42:13 +00:00
Leandro Pereira a50c1d0620 test: Add test for JSON library
This adds a test suite for the JSON library, testing both encoding and
decoding of all supported data types, including arrays, nested objects,
and basic types such as booleans, numbers, and strings.

Jira: ZEP-1607
Change-Id: I4f6ad7e2859a142e06d405e0760e91751e01a31f
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-03-25 13:11:55 +00:00
Anas Nashif 0505c9c881 benchmarks: convert latency_measure to unified kernel
Change-Id: If92833d699b95f5a7e813d0577f5467b06d3a1b6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-25 12:38:50 +00:00
Anas Nashif 25aa9e8e36 tests: enable syslog for sensors
Change-Id: If866083d5707a83b1df0a3411f3a848fdf40dbcb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-25 12:00:30 +00:00
Anas Nashif 2c04055970 Merge "Merge bluetooth branch into master" 2017-03-25 11:25:43 +00:00
Anas Nashif 8ec959a041 Merge "Merge net branch into master" 2017-03-25 11:25:33 +00:00
Johan Hedberg 93fbca0d16 Merge bluetooth branch into master
- Controller cleanups
 - Refactor controller for a cleaner Link Layer abstraction
 - SDP enhancements
 - Use sys_slist_t API wherever possible
 - Fix race condition in controller
 - Update controller to report Bluetooth 5.0 version

----------------------------------------------------------------
Carles Cufi (6):
      Bluetooth: controller: Remove unused H:4 tag macros
      Bluetooth: controller: Rename downstream API calls
      Bluetooth: controller: Introduce BLUETOOTH_LL_SW
      Bluetooth: controller: Move ll.h to an include folder
      Bluetooth: controller: Remove public address config option
      Bluetooth: controller: Move LL code from driver to ll_sw

Johan Hedberg (11):
      Bluetooth: Make bt_hci_driver instances link-time constants
      Bluetooth: shell: Fix missing initialization of param.own_addr
      Bluetooth: shell: Add command to start continuous passive scanning
      Bluetooth: Move crypto APIs to dedicated header file
      Bluetooth: Controller: Factor out ECB core code from ecb_encrypt()
      Bluetooth: Controller: Introduce big-endian variant for ECB
      Bluetooth: Introduce public big-endian AES API
      Bluetooth: Controller: Increase default TX buffer count
      Bluetooth: Use specific pointer type for conn->channels
      Bluetooth: ATT: Reorder handler struct for compactness
      Bluetooth: ATT: Refactor PDU handling

Kaustav Dey Biswas (5):
      Bluetooth: SDP: Server: Send service search response
      Bluetooth: SDP: Server: Handle ServiceAttributeRequest
      Bluetooth: SDP: Server: Find the attributes in the record
      Bluetooth: SDP: Server: Send ServiceAttributeResponse
      Bluetooth: SDP: Server: Support ServiceSearchAttributeRequest

Luiz Augusto von Dentz (4):
      Bluetooth: ipsp: Fix checking for NULL pointer
      Bluetooth: L2CAP: Use sys_slist_t for connection channels
      Bluetooth: L2CAP: Use sys_slist_t for server channels
      Bluetooth: L2CAP: Use sys_slist_t for fixed channels

Mariusz Skamra (2):
      Bluetooth: L2CAP: Fix TX queueing for LE CoC
      Bluetooth: tester: Fix UART issue on qemu

Matthias Ringwald (1):
      Bluetooth: Controller: Kconfig company id and subversion number

Sathish Narasimman (5):
      Bluetooth: HFP HF: SCO: Handle synchronous_conn_complete
      Bluetooth: SCO: Rename 'conn' to 'acl'
      Bluetooth: HFP HF: SCO: Handle SCO Disconnect
      Bluetooth: HFP HF: SCO Initiate Audio connection
      Bluetooth: AT: Fix reset the state during error

Vinayak Chettimada (16):
      Bluetooth: Controller: Fix RSSI feature conditional compilation
      Bluetooth: Controller: Add advertisement event indication feature
      Bluetooth: Controller: Add Kconfig range check for public address
      Bluetooth: Controller: Version 5.0 and PDU type rename
      Bluetooth: controller: Use explicit paths to internal headers
      Bluetooth: controller: Move bt_rand into separate file
      Bluetooth: Make LE Encrypt helpers public
      Bluetooth: controller: Replace 0 for pointers with NULL keyword
      Bluetooth: Fix checks for changes in connection parameters
      Bluetooth: Support connection parameter update as central
      Bluetooth: shell: Reorder commands in logical order of use
      Bluetooth: shell: Add connection update command
      Bluetooth: controller: Move PDU macros from radio.h to pdu.h
      Bluetooth: controller: Cleanup makefiles
      Bluetooth: controller: Fix mayfly caller id for thread call path
      Bluetooth: controller: Fix race waiting for ticker job to complt

 drivers/bluetooth/hci/h4.c                         |   2 +-
 drivers/bluetooth/hci/h5.c                         |   2 +-
 drivers/bluetooth/hci/spi.c                        |   2 +-
 include/bluetooth/bluetooth.h                      |  15 +-
 include/bluetooth/conn.h                           |  11 +
 include/bluetooth/crypto.h                         |  77 ++
 include/bluetooth/hci.h                            |  24 +
 include/bluetooth/l2cap.h                          |   4 +-
 include/drivers/bluetooth/hci_driver.h             |   2 +-
 samples/bluetooth/ipsp/src/main.c                  |   6 +-
 subsys/bluetooth/Kconfig                           |   2 +-
 subsys/bluetooth/controller/Kconfig                |  39 +-
 subsys/bluetooth/controller/Makefile               |  23 +-
 subsys/bluetooth/controller/hal/Makefile           |   1 +
 subsys/bluetooth/controller/hal/ecb.h              |   3 +
 subsys/bluetooth/controller/hal/nrf5/Makefile      |   3 +
 subsys/bluetooth/controller/hal/nrf5/cntr.c        |   4 +-
 subsys/bluetooth/controller/hal/nrf5/ecb.c         |  64 +-
 subsys/bluetooth/controller/hal/nrf5/radio.c       |  17 +-
 subsys/bluetooth/controller/hal/nrf5/rand.c        |   4 +-
 subsys/bluetooth/controller/hal/radio.h            |   5 -
 subsys/bluetooth/controller/hci/Makefile           |   4 +
 subsys/bluetooth/controller/hci/hci.c              |  76 +-
 subsys/bluetooth/controller/hci/hci_driver.c       | 217 +-----
 subsys/bluetooth/controller/include/ll.h           |  58 ++
 subsys/bluetooth/controller/ll/ll.h                |  29 -
 subsys/bluetooth/controller/ll_sw/Makefile         |   4 +
 subsys/bluetooth/controller/ll_sw/crypto.c         |  54 ++
 subsys/bluetooth/controller/{ll => ll_sw}/ctrl.c   | 660 +++++++++--------
 subsys/bluetooth/controller/{ll => ll_sw}/ctrl.h   |  54 +-
 .../controller/{ll => ll_sw}/ctrl_internal.h       |   6 +-
 subsys/bluetooth/controller/{ll => ll_sw}/ll.c     | 237 ++++++-
 subsys/bluetooth/controller/{ll => ll_sw}/pdu.h    |  64 +-
 subsys/bluetooth/controller/ticker/Makefile        |   3 +
 subsys/bluetooth/controller/ticker/ticker.c        |  12 +-
 subsys/bluetooth/controller/util/Makefile          |   1 +
 subsys/bluetooth/controller/util/memq.c            |   5 +-
 subsys/bluetooth/host/Kconfig                      |  16 +-
 subsys/bluetooth/host/Makefile                     |   2 +
 subsys/bluetooth/host/at.c                         |   7 +-
 subsys/bluetooth/host/att.c                        | 204 ++++--
 subsys/bluetooth/host/conn.c                       | 148 +++-
 subsys/bluetooth/host/conn_internal.h              |  12 +-
 subsys/bluetooth/host/crypto.c                     | 155 ++++
 subsys/bluetooth/host/crypto.h                     |   8 +
 subsys/bluetooth/host/hci_core.c                   | 150 ++--
 subsys/bluetooth/host/hci_core.h                   |   2 +-
 subsys/bluetooth/host/hci_ecc.c                    |   9 +-
 subsys/bluetooth/host/hci_ecc.h                    |   5 +-
 subsys/bluetooth/host/hci_raw.c                    |   8 +-
 subsys/bluetooth/host/hci_raw_internal.h           |   2 +-
 subsys/bluetooth/host/l2cap.c                      | 202 ++----
 subsys/bluetooth/host/l2cap_br.c                   |  97 +--
 subsys/bluetooth/host/l2cap_internal.h             |   5 +-
 subsys/bluetooth/host/sdp.c                        | 781 +++++++++++++++++++++
 subsys/bluetooth/host/sdp_internal.h               |  14 +
 subsys/bluetooth/host/smp.c                        |  36 +-
 tests/bluetooth/init/prj_controller_4_0.conf       |   1 +
 tests/bluetooth/init/prj_controller_dbg.conf       |   1 +
 tests/bluetooth/shell/src/main.c                   | 137 +++-
 tests/bluetooth/test_bluetooth/src/bluetooth.c     |   2 +-
 tests/bluetooth/tester/qemu.conf                   |   1 +
 62 files changed, 2583 insertions(+), 1216 deletions(-)
 create mode 100644 include/bluetooth/crypto.h
 create mode 100644 subsys/bluetooth/controller/hal/Makefile
 create mode 100644 subsys/bluetooth/controller/hal/nrf5/Makefile
 create mode 100644 subsys/bluetooth/controller/hci/Makefile
 create mode 100644 subsys/bluetooth/controller/include/ll.h
 delete mode 100644 subsys/bluetooth/controller/ll/ll.h
 create mode 100644 subsys/bluetooth/controller/ll_sw/Makefile
 create mode 100644 subsys/bluetooth/controller/ll_sw/crypto.c
 rename subsys/bluetooth/controller/{ll => ll_sw}/ctrl.c (93%)
 rename subsys/bluetooth/controller/{ll => ll_sw}/ctrl.h (84%)
 rename subsys/bluetooth/controller/{ll => ll_sw}/ctrl_internal.h (98%)
 rename subsys/bluetooth/controller/{ll => ll_sw}/ll.c (58%)
 rename subsys/bluetooth/controller/{ll => ll_sw}/pdu.h (77%)
 create mode 100644 subsys/bluetooth/controller/ticker/Makefile
 create mode 100644 subsys/bluetooth/controller/util/Makefile
 create mode 100644 subsys/bluetooth/host/crypto.c
 create mode 100644 subsys/bluetooth/host/crypto.h

Change-Id: Ic8bee0eb4f15c00ce5ca7b3b80133b1bbd0bdbf5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-03-24 23:21:09 -07:00
Anas Nashif 898c8b639b tests: object_footprint: add missing file
Change-Id: I2d26f0770ac81482d70a8101c22745b2baef64ae
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-24 18:17:32 -04:00
Anas Nashif e994b0ab19 benchmarks: remove legacy tests already ported to unified
Change-Id: I002a462e06333b8540e96d4e4e166830b231d536
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-24 18:17:04 -04:00
Anas Nashif 7942eaee39 benchmarks: port object_footprint to unified kernel
Change-Id: Iaa39f60b9ef498059f0320631823a9d7d47a99de
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-24 21:51:17 +00:00
Anas Nashif 477a928134 benchmarks: move footprint benchmark out of legacy
Those can be used with unified kernel.

Change-Id: I4bd024f7e645b99ac1b8df6dfbbdd94f2fda99c4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-24 21:51:17 +00:00
Inaky Perez-Gonzalez 6db4a991b2 tests: tag with 'ignore_faults' testcases that provoke faults
This way we can monitor testcases for faults that should not be there;
however, in the case of these, a fault message is expected and shall
be ignored.

Change-Id: I63736723026c381c9fee7f24a751ceafc12f2a40
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-03-24 21:51:16 +00:00
Anas Nashif aa70533244 tests: remove legacy tests already ported to unified
Legacy APIs are to be deprecated, so getting rid of tests that have been
moved to unified kernel already.

Change-Id: I752e42bc498dfdd0ea29b0b5b7b9da1dac7b1136
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-24 21:51:15 +00:00
Jukka Rissanen c3b1070d10 tests: dns: Resolve API test cases
Change-Id: I090515c0e720c5779e3b5a9f2eb19e398ea0e987
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-24 17:31:42 +02:00
Tomasz Bursztyka 1e3dc0cbb4 net/ipv6: Renaming IPv6 neighbor state related macros and function
Refining the names around IPv6's neighbor states to differentiate them
easily from any net_nbr related names (which are not tighten to IPv6).

Change-Id: Ibc24df2a9485477a53fe5fe1c8f993f0fcd91635
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-24 17:31:41 +02:00
Mariusz Skamra ea8ca7d400 Bluetooth: tester: Fix UART issue on qemu
This fixes an issue introduced by bab3aafa2d,
which changed the default value of UART_PIPE_ON_DEV_NAME to the same
used by BLUETOOTH_UART_ON_DEV_NAME. Due to this, the BTP and HCI were using
the same UART.

Change-Id: Ib59819e49610f28f4c89c0304d024bb1b6aa506a
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2017-03-24 10:16:08 +01:00
Jithu Joseph 2ddb968cbf tests: kernel: port work_queue test to unified kernel
Jira: ZEP-932

Change-Id: I79eb4cb20cd0e0df60f71cb73969a76e2c929b8e
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-03-23 12:02:35 +00:00
Sergio Rodriguez 9df2afc058 tests: kernel: test_pend: Porting legacy tests to unified kernel
This is the port of the legacy/kernel/test_pend test case to
the unified kernel

Jira: ZEP-932

Change-Id: I81762b45ff7000ff9f6079c674b46d233b2645de
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-03-23 11:50:36 +00:00
Vinayak Chettimada 2037ec803d Bluetooth: shell: Add connection update command
Added conn-update command to btshell module to test
bt_conn_le_param_update Bluetooth API.

Change-id: I205df9ffc12a0ab062de5a779ab96bc91cbd9259
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-03-21 17:05:43 -07:00
Vinayak Chettimada 30a46529b2 Bluetooth: shell: Reorder commands in logical order of use
Reordered the commands in btshell to represent the logical
order of use. Moved advertise and scan before connect
command.

Change-id: Id64509e39848109a6df7ddb1306b6bd221b65c40
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-03-21 17:05:42 -07:00
Johan Hedberg e085ff49b9 Bluetooth: shell: Add command to start continuous passive scanning
Change-Id: I0d9c2f47014464a27ff24ac79a16ee956bbcf62c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-03-21 17:05:42 -07:00
Johan Hedberg 1ce1c3484e Bluetooth: shell: Fix missing initialization of param.own_addr
Add proper logging for errors in the same go.

Change-Id: I8bd4fa8d5b143e51024496bfba0056525ad35964
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-03-21 17:05:42 -07:00
Johan Hedberg 5517893543 Bluetooth: Make bt_hci_driver instances link-time constants
Declaring these as const lets the linker generate more optimal code.
Some extra care is needed with hci_ecc.c since it was overwriting the
send callback. Now the choice of send() call is done directly in the
bt_send() function

Change-Id: Iac74f5ee9bee097bbb34c11bd13d1d886700f5cc
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-03-21 17:05:42 -07:00
Vinayak Chettimada 0d75faf02d Bluetooth: Controller: Add advertisement event indication feature
Add a Controller event that indicates everytime
advertisement event has been transmitted on air.

Change-id: I4722488bbfeca987e66983faf5b26467407a89c9
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-03-21 17:05:42 -07:00
Michael Scott 081246737c net/http: let HTTP_SERVER, HTTP_CLIENT and HTTP_PARSER select HTTP
Due to commit 8308b9bd2d ("net/http: Add the HTTP/1.1 API")
every user of CONFIG_HTTP_PARSER would need to add CONFIG_HTTP to
their .conf files.  Which is fine for intree samples/tests as they
have been adjusted, but the rest of world working on Zephyr apps
will need to make this changes as well.

Instead, we should have each of the following select HTTP instead of
depend on it, which will make future use of these configs and their
dependencies more intuitive:
HTTP_SERVER
HTTP_CLIENT
HTTP_PARSER

NOTE: As cleanup, this commit also removes the CONFIG_HTTP added to
samples and test .conf files.

Change-Id: I81cfaa19e37333b1bf98778f8147814780e7f77c
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-03-17 10:34:45 +02:00
Jukka Rissanen 157c383260 net: ipv6: Make config options more fine grained
Add CONFIG_NET_IPV6_NBR_CACHE option that is the base for both
neighbor discovery (ND) and duplicate address detection (DAD).

Both ND and DAD can be disabled if needed. If NBR cache is
disabled, then ND and DAD are disabled too.

Note that it makes not much sense to disable DAD or NBR cache
as IPv6 will not work properly without them. It is possible
to disable ND but then the neighbor information needs to come
via other sources like RPL.

Change-Id: I57c8668ad828b3a153dfc58eea78bf5f7ac3938a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-17 10:34:43 +02:00
Jukka Rissanen fc2542b88b net: tests: Fix the default MAC address
Use the proper MAC address space (00-00-5E-00-53-xx) dedicated
for documentation and specified in RFC 7042 ch 2.1.2.

Change-Id: If8ef9e4ee4e041ad005060664ebafe60df0a6bf9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-17 10:34:43 +02:00
Tomasz Bursztyka 87b80191b6 tests/net/mgmt: Add 2 unit tests around synchronous event listeners.
Test net_mgmt_event_wait() and net_mgmt_event_wait_on_iface()

Change-Id: I82ba70a697f0d13aa2e1eef2110e139b3621c119
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-17 10:34:42 +02:00
Tomasz Bursztyka 35e5aa8865 net/mgmt: Add a function to wait on a event synchronously
Instead of creating a handler and a related callback structure on an
event_mask: net_mgmt_event_wait() can be used to wait synchronously on
such event_mask. The core mgmt part will seamlessly reuse the struct
net_mgmt_event_callback so the whole internal notification mechanism is
using the same code.

Change-Id: I426d782c770e75e5222aa3c5b703172b1f1f2e5e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-17 10:34:42 +02:00
Ravi kumar Veeramally 8cb97ae47d net: Modify IPv4/6 packet finalize API's
Current finalize api's takes buf as input parameter and returns
the finalized buf. But if there are any issue while finalizing,
it failed to throw an error.

Change-Id: I6db54b7453eec41a8051fab50d5c0dc937debd54
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-03-17 10:34:42 +02:00
Ravi kumar Veeramally ad855fc31d net: ipv6: Fix handling of RA 6CO options
As per RFC 6775 4.2, context length holds number of leading bits
in the Context Prefix field that are valid. Rest are not valid
for compression.

Change-Id: Id21cc2d7a5d42980cf9295f85e75c4869ff6cb99
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-03-17 10:34:41 +02:00
Flavio Santes f1ec62ed75 tests/net/dns: Add routines to evaluate DNS responses
This patch adds some routines to evaluate DNS responses as specified
by RFC 1035.

Jira: ZEP-1876

Change-Id: Ia78a1175229962128a0bcee985e507d72ed26aea
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-17 10:34:41 +02:00
Jukka Rissanen 1274a229cc net: tests: nbuf: Fix compiler warnings
LLVM/icx compiler gives warnings for uint16_t vs. size_t
values.

Jira: ZEP-1886

Change-Id: I63c5deea672568946d91421a873c470af3cec6df
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-17 10:34:41 +02:00
Flavio Santes 8308b9bd2d net/http: Add the HTTP/1.1 API
This patch adds the HTTP/1.1 API for Zephyr. This API consists of client
and server context structures enabled via Kconfig variables.
HTTP parser support is enabled via the CONFIG_HTTP_PARSER configuration
variable.

Currently, this API only includes support for writing HTTP requests
(client mode) and HTTP responses (server mode). TLS support is not
considered in this iteration.

Supported HTTP methods:
	GET, HEAD, OPTIONS and POST.

Supported HTTP responses:
	400, 403 404. The http_response routine may be used to write
	any HTTP status code, for example 200 OK.

Jira: ZEP-1701

Change-Id: Ic9ccd4d4578d6d0f3a439976ea332b031644ca7d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:49 +02:00
Flavio Santes bed2f43120 tests/net/dns: Add the test case for the DNS low-level routines
This patch adds the test case for the DNS API low-level routines.

The following routines are evaluated by this test case:

- dns_msg_pack_qname
- dns_msg_pack_query
- dns_unpack_header_id
- dns_header_qr
- dns_header_opcode
- dns_header_aa
- dns_header_tc
- dns_header_rd
- dns_header_ra
- dns_header_z
- dns_header_rcode
- dns_header_qdcount
- dns_header_ancount
- dns_header_nscount
- dns_header_arcount
- dns_unpack_query_qclass
- dns_unpack_query_qtype

Next iterations will consider IPv6 and DNS RR coverage.

Jira: ZEP-1499

Change-Id: I4ef46203e6fec57c6fe5a5db8132ed140b412fc2
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:49 +02:00
Jukka Rissanen e82f7a6a31 tests: net: Check allnodes and solicit node addresses.
Make sure that the network interface has proper allnodes and
solicit node multicast addresses set.

Change-Id: I2318d63df0b5d09dfaa8347b69c843b84ed63f4b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:48 +02:00
Jukka Rissanen 253e9a377f tests: net: Add MLD query tests
Add tests for verifying that we can receive Multicast Listener
Discovery query and act on it.

Change-Id: I926cf5e9f77cd250d2d7094f2379e320ef163540
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:48 +02:00
Jukka Rissanen 8d8e3772e6 net: ipv6: Respond to MLD query
If we receive MLDv2 (Multicast Listener Discover) query,
we send out information about the multicast groups that
we have joined.

Change-Id: If4ea9fa685319b2ad900e1949a5cbe12e7696b43
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:48 +02:00
Jukka Rissanen d0fc787c21 tests: net: Add unit tests for mld
MLD (Multicast Listerer Discovery) unit tests when joining
or leaving an IPv6 multicast group.

Change-Id: I7cd0f4c5f31c693d816fb5d27d3d23bb27679c35
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:48 +02:00
Jukka Rissanen ba5bb5a9df net: if: Join/leave pre-defined IPv6 multicast groups
When we setup the network interface, add predefined IPv6 multicast
groups into the network interface. When interface is taken down,
then leave all the multicast groups that joined.
See RFC 4291 ch 2.8 for details.

Change-Id: If17d3e8c75157a02aa93c92e2fb499619c1484cf
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:47 +02:00
Jukka Rissanen 74e747a27f net: ipv6: Add support to join/leave multicast group
This and subsequent commits adds API to join or leave
an IPv6 multicast group.

Jira: ZEP-1673

Change-Id: I26dcfe16a4527dbf7886a30827a5d4ebfdeaac01
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:47 +02:00
Ravi kumar Veeramally 476f46f61b net: icmpv6: Remove unused variable 'len' from input calls
Variable len is not used in net_icmpv6_input() and if required
it can be obtained from 'buf'.

Change-Id: I4b0710e1cf16cff9837173ad9d6908ec54ebafae
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-03-09 20:33:45 +02:00
Jukka Rissanen 5032bdc46d net: nbuf: Pass ll_reserve when creating TX buffer
Instead of always calling net_nbuf_get_reserve_tx() with zero
ll_reserve (first parameter) and then setting the link layer
reserve separately, pass the reserve to that function which can
then set the ll_reserve in buf itself.

Change-Id: I21c14cb7e2e6c36d170c09998bca0207ecf65c75
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:43 +02:00
Jukka Rissanen 189ec2b6ad net: Remove link layer reserve param from IP packet creator
The ll_reserve parameter is useless in net_ipv{4|6}_create_raw()
function as the reserve information is already stored in buf.

Change-Id: I7815a78c001e3da532478c04b3dac9b37bbc723c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:43 +02:00
Jukka Rissanen 5197266768 net: nbuf: Use net_nbuf_get_frag() to allocate a fragment
The code used net_nbuf_get_reserve_{rx|tx}_data() function to
allocate a fragment. Instead of that low level function, use
net_nbuf_get_frag() instead. There are few places this is not
possible or is too big change like in few test programs.

Change-Id: Ied7e2b7db352de998b200ffa6ff82471bfa5ebe3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:43 +02:00
Jukka Rissanen d32503f57e net: nbuf: Split one global DATA pool to RX and TX DATA pools
If we receive lot of packets, it might happen that we exhaust
all the DATA buffers in the system. This would prevent from
us sending anything to the network.
Change this by splitting the DATA buffer pool into RX and TX
parts. This way RX flooding cannot consume all DATA buffers
that needs to be sent.

Change-Id: I8e8934c6d5fdd47b579ffa6268721b5eb3d64b6d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:43 +02:00
Jukka Rissanen 4bcc2a47d0 net: nbuf: Fix net_nbuf_copy() so that original nbuf is not modified
It makes no sense to modify the original net_buf so change the
copy function not to touch the original buffer.

Change-Id: I5d22445ce50cee62994c36567f0e995a500cb89d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:42 +02:00
Jukka Rissanen 6a4372b0df net: nbuf: Fix the net_nbuf_copy() buf parameter
The first parameter of net_nbuf_copy() must be the head
of the buffer chain i.e., it must contain the user_data
part. If a fragment is given, then we do not know enough
information to allocate the data fragments.

Change-Id: I052b183d8c63d7326b320254f36f00b2fc48b0a0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:42 +02:00
Johan Hedberg 69d9985429 Merge bluetooth branch into master
- Assert fixes to controller state transitions
 - AVDTP fixes & improvements
 - SDP fixes & improvements
 - HFP improvements
 - GATT fixes
 - New GATT API for getting current MTU

----------------------------------------------------------------
Arun Jagadish (3):
      Bluetooth: AVDTP: Add AVDTP Receive Function
      Bluetooth: AVDTP: Fix discover param struct
      Bluetooth: AVDTP: Rename of variables

Carles Cufi (4):
      Bluetooth: controller: Use direct ISRs
      Bluetooth: controller: Set debug pins with macros
      Bluetooth: controller: Introduce debug pins Kconfig option
      Bluetooth: controller: Report 5.0 compliant controller

Jaganath Kanakkassery (1):
      Bluetooth: SDP: Server: Introduce private define for max services

Johan Hedberg (3):
      Bluetooth: Add support for Bluetooth 5.0 version specifier
      Bluetooth: Relax minimum advertising interval for 5.0 controllers
      Bluetooth: samples: Add combined observer & broadcaster app

Kaustav Dey Biswas (5):
      Bluetooth: SDP: Server: Fix MTU setting after l2cap connection
      Bluetooth: SDP: Server: Set security level to NONE
      Bluetooth: SDP: Server: Refactor data element structure header
      Bluetooth: SDP: Server: Handle Service Search request
      Bluetooth: SDP: Server: Filter records based on requested uuids

Luiz Augusto von Dentz (4):
      Bluetooth: GATT: Use __ASSERT for invalid parameters
      Bluetooth: GATT: Add bt_gatt_get_mtu API
      Bluetooth: L2CAP: Move functions in preparation for queuing
      Bluetooth: L2CAP: Add TX queueing for LE CoC

Maureen Helm (1):
      Bluetooth: samples: Add hexiwear_k64 and frdm_k64f to tests

Piyush Itankar (2):
      Bluetooth: A2DP: Stream End Point Registration
      Bluetooth: A2DP: Added Preset Structure

Sathish Narasimman (4):
      Bluetooth: AT: Fix 'signed' warning
      Bluetooth: HFP HF: Handling AG Network error
      Bluetooth: HFP HF: SCO: Add esco supported pkt type
      Bluetooth: HFP HF: SCO: Accept eSCO conn request

Szymon Janc (9):
      Bluetooth: shell: Fix accessing invalid memory
      Bluetooth: shell: Fix typo
      Bluetooth: SMP: Fix passkey entry for legacy pairing
      Bluetooth: shell: Don't echo LE CoC data
      Bluetooth: Fix connection object leak
      Bluetooth: shell: Simplify indication in gatt-subscribe
      Bluetooth: shell: Fix GATT long write support
      Bluetooth: GATT: Remove not needed variable
      Bluetooth: GATT: Fix subscriptions removal

Vinayak Chettimada (6):
      Bluetooth: Controller: Use direct ISR for Radio IRQ only
      Bluetooth: Controller: Fix LE Ping PDU dispatch
      Bluetooth: Controller: Run all enqueued mayfly before disable
      Bluetooth: Controller: Kconfig option to set public address
      Bluetooth: Controller: Fix assert on role stop/abort
      Bluetooth: Controller: mayfly enable to supercede over disable

 include/bluetooth/a2dp-codec.h               |  73 +++++
 include/bluetooth/a2dp.h                     |  61 +++++
 include/bluetooth/conn.h                     |   2 +
 include/bluetooth/gatt.h                     |  11 +
 include/bluetooth/hci.h                      |  50 ++++
 include/bluetooth/l2cap.h                    |   4 +
 include/bluetooth/sdp.h                      | 103 ++++---
 samples/bluetooth/peripheral_hr/testcase.ini |   2 +-
 samples/bluetooth/scan_adv/Makefile          |   5 +
 samples/bluetooth/scan_adv/README.rst        |  25 ++
 samples/bluetooth/scan_adv/prj.conf          |   2 +
 samples/bluetooth/scan_adv/src/Makefile      |   1 +
 samples/bluetooth/scan_adv/src/main.c        |  75 +++++
 samples/bluetooth/scan_adv/testcase.ini      |   4 +
 subsys/bluetooth/controller/Kconfig          |  15 +
 subsys/bluetooth/controller/hal/debug.h      | 124 ++++-----
 subsys/bluetooth/controller/hal/nrf5/radio.c |   4 +-
 subsys/bluetooth/controller/hal/radio.h      |   2 +-
 subsys/bluetooth/controller/hci/hci.c        |   2 +-
 subsys/bluetooth/controller/hci/hci_driver.c |  22 +-
 subsys/bluetooth/controller/ll/ctrl.c        | 229 ++++++++++++----
 subsys/bluetooth/controller/util/mayfly.c    |  58 +++-
 subsys/bluetooth/controller/util/mayfly.h    |   4 +-
 subsys/bluetooth/host/Kconfig                |   9 +
 subsys/bluetooth/host/a2dp.c                 |  19 ++
 subsys/bluetooth/host/at.c                   |  53 +++-
 subsys/bluetooth/host/at.h                   |  38 ++-
 subsys/bluetooth/host/avdtp.c                |  63 ++++-
 subsys/bluetooth/host/avdtp_internal.h       |  14 +-
 subsys/bluetooth/host/conn.c                 |  60 +++-
 subsys/bluetooth/host/conn_internal.h        |  10 +
 subsys/bluetooth/host/gatt.c                 |  86 +++---
 subsys/bluetooth/host/hci_core.c             |  92 ++++++-
 subsys/bluetooth/host/hci_core.h             |   8 +
 subsys/bluetooth/host/hfp_hf.c               |  15 +-
 subsys/bluetooth/host/l2cap.c                | 319 +++++++++++++---------
 subsys/bluetooth/host/sdp.c                  | 391 +++++++++++++++++++++++++--
 subsys/bluetooth/host/sdp_internal.h         |   2 +
 subsys/bluetooth/host/smp.c                  |   1 -
 tests/bluetooth/shell/src/main.c             |  98 ++++---
 40 files changed, 1728 insertions(+), 428 deletions(-)
 create mode 100644 include/bluetooth/a2dp-codec.h
 create mode 100644 samples/bluetooth/scan_adv/Makefile
 create mode 100644 samples/bluetooth/scan_adv/README.rst
 create mode 100644 samples/bluetooth/scan_adv/prj.conf
 create mode 100644 samples/bluetooth/scan_adv/src/Makefile
 create mode 100644 samples/bluetooth/scan_adv/src/main.c
 create mode 100644 samples/bluetooth/scan_adv/testcase.ini

Change-Id: I94f2f9f4431e21da9aae00c9e32581acb383ad49
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-03-08 22:21:41 +01:00
Qiu Peiyang 8d4f1bcb78 tests/gpio: enable gpio cases to run on more platforms
Add pin definitions to enable GPIO cases to run on
Quark D2000.
Add pin definitions to enable GPIO cases to run on
arduino_101_sss.

Change-Id: I97eadb8316b1f80b899b167a01effab815626dae
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-03-07 23:03:01 +00:00
Qiu Peiyang 935663f05e tests: fix disabling of GPIO interrupt issue
According to ZEP-1717, removing the callback from
the gpio is not enough to disable interruptions.
You also need to call gpio_pin_configure() on
the input pin without the GPIO_INT flag to totally
disable the interrupt for the pin.

This commit will stop level interrupt from being
fired constantly.

Change-Id: I019d7cea0bc0d5e5ff4b74165472ed11de1733bb
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-03-07 23:01:52 +00:00
Qiu Peiyang 2d033483de tests: add zephyr pinmux driver api test case
This commit verifies the following pinmux driver apis:
	pinmux_pin_set()
	pinmux_pin_get()

Change-Id: Iedf1b4e918b518b2205e9059b3b08f41cd243d37
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-03-07 23:01:28 +00:00
Qiu Peiyang 1124da16de tests: add zephyr SPI driver api test case
This commit verifies the below SPI driver apis:
	spi_configure()
	spi_slave_select()
	spi_write()
	spi_transceive()

Verify SPI work in SPI_MODE_CPOL, SPI_MODE_CPHA,
and SPI_MODE_CPOL | SPI_MODE_CPHA.

Jira: ZEP-1626

Change-Id: I1985ac6ff8269ac908817644a844720f2d7a125c
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-03-07 23:00:54 +00:00
Jithu Joseph fbde97d44a tests: drivers: uart: fix variable type mismatches
These were flagged by icx build.

Jira: ZEP-1864

Change-Id: I5b8fce64d9e20d768fabf02e2a799e9390e3679a
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-03-07 12:00:33 -08:00
Kaustav Dey Biswas c25df73c5a Bluetooth: SDP: Server: Refactor data element structure header
Separate out data element structure header into type and size fields

Change-Id: I869ee1ea82db1f6d669bb905055135b7d63f3fa2
Signed-off-by: Kaustav Dey Biswas <kaustav.d.biswas@intel.com>
2017-03-07 12:21:29 +01:00
Szymon Janc dc2ce98088 Bluetooth: shell: Fix GATT long write support
Parameters and data must be permament for time of the operation.

Change-Id: Idd4eee948e62c2c80648116a339558042059f801
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2017-03-07 12:21:29 +01:00
Szymon Janc 10ce50dc30 Bluetooth: shell: Simplify indication in gatt-subscribe
Instead of passing exact value allow to use 'ind' for enabling
indications instead of notifications.

Change-Id: I24306a321ed90b4bcb6300846218ff7214b39bc4
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2017-03-07 12:21:29 +01:00
Szymon Janc 667e3af3dd Bluetooth: shell: Don't echo LE CoC data
Don't echo data from received callback as this can cause
deadlock. Just dump incoming data instead.

Change-Id: Iedbbafd0406ad46ba2c9d26fd8a70fff59de8143
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2017-03-07 12:21:29 +01:00
Szymon Janc 691397023b Bluetooth: shell: Fix typo
Change-Id: I2c1a6e7cb61f65ce2292f128e73dc2d80372f773
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2017-03-07 12:21:29 +01:00
Szymon Janc af7d0c64a8 Bluetooth: shell: Fix accessing invalid memory
argc needs to be check before accessing argv.

Change-Id: I9cb70906a388b96df4e192dd4f31eafdab25127f
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2017-03-07 12:21:29 +01:00
Anas Nashif 4172b260c7 tests: sprintf: fixed sprintf usage
Change-Id: I2b55282a96d9df8f03be115a7e5c38f43fd5eca3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-03 18:38:06 +00:00
Anas Nashif 27e4fa0d7f tests: profiling: disable em_starterkit
Change-Id: Id31773e7355933476bad9f69669fa92dd2a32dad
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-02 19:39:46 -05:00
Kumar Gala 91e9f87499 libc: attribute minimal libc printf style functions with __printf_like
Add __printf_like attribute to printf style functions in minimal libc to
enable the compiler checking this provides.  We fixup the associated
issues that are now found by utilizing these checks.

Change-Id: I74ac0d0345782463d9fb454f7161d6b4af211ba5
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-03-02 08:46:30 -06:00
Benjamin Walsh 65ab86cf87 ztest: shorten line longer than 80 characters
Change-Id: I8156299180f027e95fe2858903de37abff09ba76
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-03-01 13:18:33 +00:00
Benjamin Walsh 67b816d74c ztest: rename end-of-test semaphore
It was named 'mutex', which is not representative of what it is used for
since it is not used for mutual exclusion, but rather for signaling.

Change-Id: Icfef0011f890b2546af1686ba6b57e3fc13c6576
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-03-01 13:18:33 +00:00
Benjamin Walsh 75e643d532 ztest: add comment about expected thread priorities
There is an implicit expectation that the priority of threads spawned by
a ztest suite is still higher than the main suite thread own priority
when a test signals the main suite thread that it has completed.

Change-Id: Id7caec3e9e553712c828a93c212b8e82bd16eabd
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-03-01 13:18:32 +00:00
Benjamin Walsh e307d9efa8 tests/common/timeout_order: reset test case thread to original prio
That was an oversight that should not have caused any problem. However,
the test harness expects the test's thread to be higher prio than the
test suite's thread that spawns it, because the test suite reuses the
stack space for the next test, if there is one.

Change-Id: Iad951118278abf0d9c23012d78ed56b75bc2958a
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-03-01 13:18:31 +00:00
Anas Nashif cd35c575ef Revert "sys_bitfield*(): use 'void *' instead of memaddr_t"
This reverts commit 1f2ee5c6bc.

Change-Id: I6d6662952450e54aea2ffbc43973a5ecc40767bb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-28 16:06:22 -05:00
Inaky Perez-Gonzalez 1f2ee5c6bc sys_bitfield*(): use 'void *' instead of memaddr_t
Current users of sys_bitfield*() are bending over backwards to cast
what is most of the times a pointer into an integer.

Bitfields can be better described with an void *, so
uint{8,16,32,64}_t or any other container can be used. Most
sys_bitfield*() operations, by extension, can do the same. Note void *
has byte arithmetic, like char *.

This change will also make it implicit, for any future split of the
address space between virtual (what the SW is seeing) and physical
(what the HW is seeing) way clearer, as the functions dealing with
physical, non directly referentiable/mappeable addreses to use an
integer type, like mem_addr_t.

- include/arch/ARCH/*asm_inline*:

  - sys_bitfield*() all modified to take 'void *'

    Note 'void *' arihtmethic is byte based, which makes some things
    easier.

- include/sys_io.h:

  - introduces DEFINE_BITFIELD
  - update docs

- tests/kernel/bitfield: remove all the cast contortions, use DEFINE_BITFIELD
  PENDING: update other TCs

- include/arch/nios/nios2.h, drivers/interrupt_controller/ioapic_intr.c:
  remove cast contortions

Change-Id: I901e62c76af46f26ff0d29cdc37099597f884511
Jira: ZEP-1347
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-02-28 14:37:54 +00:00
Sharron LIU 9896f32445 tests: kernel: added test cases k_pipe_block_put
tests/kernel/pipe/test_pipe_api:
added test cases to cover k_pipe_block_put.
Also added test case to verify [get, put] API sequence.

Jira: ZEP-1242

Change-Id: I755def474592ea2bf36d8644c8f4a07a7a80bad0
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-02-28 13:35:31 +00:00
Sharron LIU 3abc1c5f23 tests: kernel: added testapp profiling_api
tests/kernel/profiling/profiling_api:
added testapp to cover k_call_stack_analyze.

Jira: ZEP-1242

Change-Id: I65de70b2c4e5a294763d625b2a45c990f99f9f90
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-02-28 13:33:39 +00:00
Anas Nashif c78a3485e2 Merge "Merge net branch into master" 2017-02-27 22:32:01 +00:00
Sharron LIU 83c7e2d862 tests: kernel: add test point k_delayed_work_remaining_get
tests/kernel/workq/workq_api:
added test point to cover k_delayed_work_remaining_get

Jira: ZEP-1242

Change-Id: I15055e9b11dfd28f3e33ac04151df8ccbed97027
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-02-27 21:22:16 +00:00
Sharron LIU 1087f0c29b tests: kernel: added test case k_fifo_is_empty
tests/kernel/fifo/test_fifo_api:
added test case to cover k_fifo_is_empty.

Jira: ZEP-1242

Change-Id: I9559df8661dbcd7d4885fa2db928120e945b3ae1
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-02-27 21:22:06 +00:00
Sharron LIU d15d264da9 tests: kernel: added test case k_is_preempt_thread
tests/kernel/threads_scheduling/schedule_api:
added test case to cover k_is_preempt_thread.

Jira: ZEP-1242

Change-Id: I4327438dffaa59abcfe1e41813b45abee88506b2
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-02-27 21:21:54 +00:00
Luiz Augusto von Dentz 0dc4dd46d4 lifo: Make use of k_queue as implementation
Once all users of k_lifo migrate to k_queue this should no longer be
needed.

Change-Id: Ib8af40c57bf8feba7b06d6d891cfa57b44faad42
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-02-27 21:20:53 +00:00
Luiz Augusto von Dentz e5ed88f328 fifo: Make use of k_queue as implementation
This makes k_fifo functions rely on k_queue and port k_poll to use
k_queue directly.

Once all users of k_fifo migrate to k_queue this should no longer be
needed.

Change-Id: Icf16d580f88d11b2cb89e1abd23ae314f43dbd20
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-02-27 21:20:52 +00:00
Luiz Augusto von Dentz d07a328a95 tests: Add queue tests
Change-Id: If4ffa10c8c63788e1c9f074b8761902b4bdf6f66
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-02-27 21:20:51 +00:00
Adithya Baglody 979f75053c Disabled BOOT_BANNER for boot time benchmarks.
Change-Id: Ife23cd784e684d667bf78b616c478c891860e6e2
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2017-02-27 14:54:17 +05:30
Vinicius Costa Gomes 8e304ef2e6 iot/zoap: Fix requiring that the buffer is unchanged for retransmit
It is possible that the buffer waiting for retransmission is modified
after it is sent, for example, it can be compacted by 6lo, and our
assumption of where is the message ID is located in the buffer is no
longer valid.

As the message ID is the only information that is necessary for
keeping track of retransmissions, we keep a copy of it in the pending
struct, as well as the destination address of the retransmission.

Change-Id: Id33d54353404628673541225a1a05e27ee08765f
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:54 +02:00
Vinicius Costa Gomes 45fe87a425 tests/zoap: Adds test for the length of payload on the RX side
This unit test verifies that zoap_packet_get_payload() returns the
expected size for received packets.

Jira: ZEP-1662

Change-Id: Ibe011959f4d6593f4f20f0f5901c9033c76c9518
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:54 +02:00
Anas Nashif 33746d4b7c Revert "tests/crypto: Update testcase.ini to build on more platforms"
This reverts commit 7b652b1f84.

Breaks on many boards.

Change-Id: Ie74e7a656094a54b999b99de9a462093525202c3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-23 07:13:42 -08:00
Erwan Gouriou e895d576db tests: update uart driver api test case
Depending on test environment, termination character could
be '/r' instead of '/n'.
Enabling both possibilities.

Change-Id: I18b47e9055667e0a4f868416ee8d01226a879712
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-02-23 13:30:47 +00:00
Sergio Rodriguez b6cf56e5cc tests: watchdog: Interrupt reset mode modifications
In order for interrupt reset mode to work (reset the processor
after and interrupt) the interrupt does not has to be cleared,
and the qmsi hal layer clears the interrupt after the callback
has been invoked, the callback does not return and the processor
should reset.

Jira: ZEP-1566

Change-Id: Ic951a0f15fe95fb0ef5d752b831c62e6fa3ceea0
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-02-23 13:29:13 +00:00
Kuo-Lang Tseng 4533734dc6 aon_counter test: fix misspelling in the header include guard
The include guard has a misspelling.

Jira: ZEP-1746

Change-Id: I4d8000ef5c8e037f80acbf2491d0b9466670816a
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-23 13:23:35 +00:00
Flavio Santes 7b652b1f84 tests/crypto: Update testcase.ini to build on more platforms
This patch excludes qemu riscv32 due to the following msg:

qemu-system-riscv32: cannot set up guest memory
'riscv_sifive_board.ram': Cannot allocate memory

Jira: ZEP-1721

Change-Id: Ib1784fa57ad1e3d69871d4e216af1ad5dbe55a76
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-23 13:19:21 +00:00
Andre Guedes c7f01dc90d tests/power/multicorei/lmt: Fix RTC configuration
After QMSI 1.4 update, the alarm callback is not saved when
'alarm_en' is set to zero during RTC configuration. So this
patch fixes tests/power/multicore/lmt application according.

ZEP-1778

Change-Id: Ie1468458bc23a6394484aef2aeee97745d5d23b8
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2017-02-23 13:17:47 +00:00
Jukka Rissanen 4eb2020055 net: Set the network link address type when setting link address
The interface L2 address type is set at the same time as the
L2 address is set to the network interface. This is most
convinient place to set the address type.

Change-Id: I712d7357d075959eb79df3463141cfbc6d163a74
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-22 17:28:25 +02:00
Flavio Santes 216ccb7198 tests/mqtt: Fix compiler warnings in MQTT Packet test case
Cast to uint8_t * some char * values to avoid compiler warnings.

Jira: ZEP-1179

Change-Id: I9973eecbed357a2fc44958cad22f812d166f6756
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-22 17:28:24 +02:00
Jean-Paul Etienne 9acda0f695 tests: gen_isr_table: account for riscv32 architecture
Account for riscv32 SOCs supporting the riscv privileged architecture.

Change-Id: I8c26a2bcc2baded5db252896abe6e1b5ab052113
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-02-22 14:59:01 +00:00
Andrew Boie 9c48b54d65 tests: add timer monotonic test
k_cycle_get_32() needs to return a monotonically increasing value,
except in cases of 32-bit integer overflow. Enforce this with a
test case.

We also check that the number of cycles elapsed after sleeping for 1
second is at the expected value. This can help catch errors on platforms
that use different timer sources for the system clock and timestamps.

This test case adapted from some code provided by Sergey Arkhipov
when troubleshooting ZEP-1546.

Issue: ZEP-1546
Change-Id: If27fff026ea6de659f7b41b60ff26f4962b734d4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-21 22:31:07 +00:00
Anas Nashif fe118c4e95 license: replace APL2.0 license with SPDX
Some files made it through review process with full license header.

Change-Id: I2722b127c40b4b19500042c12e4fde85a165bae9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-20 16:59:46 +00:00
Kumar Gala d3d2fab1ba boards: Add panther & panther_ss to sanity
Change-Id: I08345fb1063a4ba38095fca6512c5b7eb3e96da8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-02-20 15:41:31 +00:00
Qiu Peiyang 34b53f181f tests: add zephyr uart driver api test case
This commit verifies the following uart driver apis:
	uart_irq_callback_set()
	uart_irq_rx_enable()
	uart_irq_rx_disable()
	uart_irq_rx_ready()
	uart_irq_tx_enable()
	uart_irq_tx_disable()
	uart_irq_tx_ready()
	uart_fifo_fill()
	uart_fifo_read()
	uart_irq_update()
	uart_poll_in()
	uart_poll_out()

Change-Id: I9be9341aee4357f86a2bc49f19733fb84273e89c
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-02-20 13:42:47 +00:00
Andrew Boie e08d07c97d kernel: add flexibility to k_cycle_get_32() definition
Some arches may want to define this as an inline function, or
define in core arch code instead of timer driver code.
Unfortunately, this means we need to remove from the footprint
tests, but this is not typically a large function.

Issue: ZEP-1546
Change-Id: Ic0d7a33507da855995838f4703d872cd613a2ca2
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-16 19:27:59 +00:00
Chuck Jordan 674db4df9a test: repair test_tickless for ARC because _tsc_read is now present
A _tsc_read has been added for ARC targets.
This test can use that when ARC.

See ZEP-1413

Change-Id: Ib63aecbe9f3eb2b97ad1086fc79b57e8f0774fca
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2017-02-16 04:56:50 +00:00
Benjamin Walsh d2654d3143 tests/kernel/common: add test to verify same tick timeout expiry order
Timeouts, when expiring on the same tick, should be handled in the same
order they were queued.

Change-Id: I23a8e971a47ca056b32b8b48fe179d481bae27c0
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-02-16 04:56:26 +00:00
Benjamin Walsh 4e0d690f24 tests: add tests for SYS_DLIST/SLIST_ITERATE_FROM()
Change-Id: I52dc6fa081be588f627670543ca9e2022d74bc37
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-02-16 04:56:23 +00:00
Flavio Santes 057f31e7e9 net/mqtt: Remove length computations for some msg fields
Currently, for the following MQTT msg fields:

- client_id
- will_topic
- user_name
- topic

their length is computed inside the routine that receives the MQTT msg.

Although this simplifies development, also imposes one restriction:
data must be null-terminated. Sometimes, data is received from other
sources and not generated by the application, so the null-terminated
constraint may be considered problematic for the user.

This patch removes the assumption that string fields are null-terminated.
Current data structures are already prepared to handle this case, so no
API change is required.

Change-Id: I5a147a5b21e0da49541cbe62baac363c8737cd3e
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-15 12:20:08 +02:00
Anas Nashif b62fbccce1 tests: gen_isr_table: disable for cortex-m0
Change-Id: Ic4c3ee2d319e60af166786b856384ee421526b81
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-15 00:05:14 -08:00
Anas Nashif 7ac0fd7aed tests: filter out tinytile, it is the same as arduino 101
Change-Id: Ifef85247e6bdb4e6a1de8f5d0fc8cf3c935bd280
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-14 23:22:58 -08:00
Andrew Boie 5c335ce55f tests: gen_isr_table: actually run the IRQ
So far, only implemented on ARM.
It's not possible to do this on Nios II and RISC-V.

Change-Id: I84c8d99cd163dff46de4bc4a7ae40768daf8e4ce
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-15 04:49:18 +00:00
Anas Nashif 15a6598691 Merge "Merge remote-tracking branch 'origin/core'" 2017-02-15 04:33:25 +00:00
Jithu Joseph b0f2e3ef14 tests: kernel: import obj_tracing test to unified kernel
obj_tracing test from legacy modified to use unified APIs
directly.

Jira: ZEP-932

Change-Id: Ib5d300334e527b842668be076c94c40b65d7cbe4
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-02-15 01:08:34 +00:00
Sharron LIU bceabf6a4f tests: kernel: remove unsupported tests
Remove tests that assert due to invocation from ISR which is not supported.

Change-Id: Ib2313b8f75db0140aa475281bd76ba0414d6a481
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-02-14 06:45:40 +00:00
Jithu Joseph 4462509ea7 spi_test: fix variable type mismatches
This was reported by ISSM compiler.

Jira: ZEP-1179

Change-Id: Ib97ed8da830126c9fbfa2269c8b2327d2f1be2f4
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-02-14 02:13:53 +00:00
Jithu Joseph ecba9dee51 test_mpool_api: fix variable type mismatches
This was reported by ISSM compiler.

Jira: ZEP-1179

Change-Id: I5700ff6b374815325fa858cfd11f8938c82d8337
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-02-14 02:13:52 +00:00
Andrew Boie da7864e727 REVERTME: tests: crypto: disable on Xtensa
Tinycrypt's definition of 'bool' does not work properly with
Xtensa's XCC compiler.

Issue: ZEP-1722
Change-Id: Id71b5f1bcf738c83e672b64a592a68751758dbc9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 11:53:24 -08:00
Mazen NEIFER 4713575cb1 tests: Introduced new config option to add extra stack size for tests.
This option is added in order to support Xtensa, which needs more stack than
other architecture. This allows having a centralized way to change stack
requirements for all tests.
This extra stack size is eaqual to 0 for most architectures, except Xtensa
which requires additional 768 bytes for each stack.

Change-Id: Ie5dcae1dfd29018d36ef35dae22dc4c1a2ecdc14
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 11:39:03 -08:00
Andrew Boie 555c60631a REVERTME: tests: stackprot: disable on xtensa
Issue: ZEP-1702
Change-Id: Id8606e2c72bf21e236a13f48839516626929c171
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 11:39:03 -08:00
Andrew Boie 46c7275831 REVERTME: disable xip test on xtensa
https://jira.zephyrproject.org/browse/ZEP-1676

Change-Id: I5570031479de5b1d1859876c9155bd1fd70664a1
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 11:39:01 -08:00
Mazen NEIFER 8e3b86fe0a Xtensa port: Connect Xtensa timer to tick IRQ in legacy test_context.
The test will also need to increase the stack to run correctly for Xtensa cores.

Change-Id: If94f12a941dc8eccf879558bdebdc7ccb2d047f1
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER daf28fa339 Xtensa port: Fixed tests/kernel/context to compile with Xtensa internal timer.
Change-Id: I4293adf23b7d46851747e3bcdd41b4a09e8fff05
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Qiu Peiyang 0c87784c84 tests/gpio: fix test GPIO_INT_EDGE bug
When test GPIO_INT_EDGE, there is no code to skip GPIO_INT_LEVEL
and jump to the end of the function. So GPIO_INT_LEVEL will
always be checked (Besides, it't always true), even if it's
testing GPIO_INT_EDGE, which will cause GPIO_INT_EDGE cases fail.

Add a goto statement for GPIO_INT_EDGE to skip GPIO_INT_LEVEL.

Jira: ZEP-1685

Change-Id: I10ce21c04c49f34aafdc2cd2f60f3e5377d6f1f5
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-02-12 01:04:09 +00:00
Qiu Peiyang bc2faf3737 tests/pwm: enable PWM case to work on D2000 board
This test case uses PWM0 port to test PWM on Quark Se.
However PWM0 port on Quark D2000 is initialized as tdo,
not PWM0 and disabling tdo will kill JTAG on D2000. So
use PWM1 and add PINMUX setting code to configure PIN_24
as PWM1 port, then the case will work on D2000 board.

Change-Id: Ib28d4750dac7396529388b781fb64bde048139d6
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-02-12 01:04:08 +00:00
jing wang 484f07cec7 tests: add zephyr adc driver api test case
the commit test below adc driver api with different resolutions
and modes
    adc_enable()
    adc_read()
    adc_disable()

move original adc test to adc_simple folder

Change-Id: I016b5e67a5d89fc8d5ae76f33799e5d3eb3e1cf8
Signed-off-by: jing wang <jing.j.wang@intel.com>
2017-02-12 00:33:59 +00:00
Qiu Peiyang 45c579a271 tests: add zephyr counter and timer api test
The commit verifies below aon counter and timer apis:
	counter_start()
	counter_read()
	counter_set_alarm()
	counter_get_pending_int()

Change-Id: Iaac9a224372ee1c1dd12a223ca222f4485957575
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-02-12 00:26:43 +00:00
Anas Nashif f16f6ec2df tests: pipe: remove unsupported tests
Remove tests that assert due to invocation from ISR which is not supported.

Change-Id: Idd2360847a467af6afdd9fbed8f87a620d9ed2f7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-10 23:03:58 -08:00
Anas Nashif bab5534ff6 tests: memory pool: remove unsupported tests
Change-Id: I467e9feb995db22b137038422aea9e1976166fc4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-10 23:03:55 -08:00
Anas Nashif 6e6e94bc77 tests: disable qemu_riscv32 on test_ecc_dh test [REVERT ME]
Change-Id: Iafba43007ab8daf1652b038bfbec184fe92b5ffc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-11 07:00:42 +00:00
Anas Nashif c5e000b2c8 tests: xip: pulpino does not support XIP
Change-Id: I806c3b4cc218d501285174249f173e59e748bea7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-11 07:00:41 +00:00
Anas Nashif 73a6da0763 tests: benchmarks: add new boards
Change-Id: I54eba3e63091b3bae15cda226735f412490ad77a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-11 07:00:40 +00:00
Baohong Liu 59b8af5395 tests: dma: update dma loop transfer app
Update the dma loop transfer sample app to use the new
dma api interfaces. This change is based on the api change
and the updated dma driver.

A RFC was posted recently on this.

Jira: ZEP-873

Change-Id: I289e2e08d4c775a833bf3d585d2706a903edd0bc
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2017-02-11 05:18:22 +00:00
Andrew Boie 122467e9ee tests: add test for gen_isr_table
This test is intended to verify that the SW ISR and vector tables
have been populated correctly.

Change-Id: Ic7f50c02dc0807d7ddefa710da67f818ff707ad6
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-11 01:28:00 +00:00
Andrew Boie e7acd3224c arm: use gen_isr_tables mechanism for interrupts
This replaces the hard-coded vector table, as well as the
software ISR table created by the linker. Now both are generated
in build via script.

Issue: ZEP-1038, ZEP-1165
Change-Id: Ie6faaf8f7ea3a7a25ecb542f6cf7740836ad7da3
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-11 01:27:58 +00:00
Jithu Joseph 720400372b misc: fix more variable type mismatches
These were reported by ISSM compiler.

Jira: ZEP-1179

Change-Id: Ic625749309773611c0c6ba2905e9420e98947dae
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-02-11 00:14:15 +00:00
Luiz Augusto von Dentz f7100f8092 tests/common: Add tests for sys_dlist_*
Change-Id: I95fbaf902968b71ce42fd6d04a10c41a0be4ff03
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-02-10 16:16:14 +00:00
Luiz Augusto von Dentz 2970771bbe tests/slist: Exercise CONTAINER macros
Change-Id: I8439febd605c50ee829f16bc68c53c7d5aebd5d2
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-02-10 16:16:13 +00:00
Baohong Liu 00210386c6 tests: dma: update dma block transfer app
Update the dma block transfer sample app to use the new
dma api interfaces. This change is based on the api change
and the updated dma driver.

A RFC was posted recently on this.

Jira: ZEP-873

Change-Id: Icf3bec7260c2e499485b07a4a579956448a1a3fd
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2017-02-10 02:18:17 +00:00
Benjamin Walsh acece24eac tests/kernel/poll: verify .signaled is set correctly
Change-Id: I19b39d09c198ef7fee7d92d2d5847bd064057b61
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-02-09 23:54:27 +00:00
Benjamin Walsh 5bbd683b9b test/kernel/poll: fix putting wrong .signaled to 0
Change-Id: I7d7255fe85857ad3edb10070b585a6694d1d4b0b
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-02-09 23:54:26 +00:00
Ravi kumar Veeramally 3bb2f3b29a net: tests: Unref net_buf using net_nbuf_unref
Using net_buf_unref() technically works but debugging the network buffer
allocations is more difficult if done like that.

Change-Id: Ieaa0978aa69e2f0baa924fe842ca1f116c348ef1
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-09 12:29:29 +02:00
Qiu Peiyang 8a119a4319 tests: add filesystem api test
This commit verifies below FS APIs:
	fs_open()
	fs_close()
	fs_read()
	fs_write()
	fs_truncate()
	fs_seek()
	fs_tell()
	fs_sync()
	fs_unlink()
	fs_mkdir()
	fs_opendir()
	fs_closedir()
	fs_readdir()
	fs_stat()
	fs_statvfs()

Change-Id: I1a48b9e960b62a1c4986cc577f658199da7a28cd
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-02-08 13:25:35 +00:00
jing wang 4e5fa0ede2 tests: add systhreads test case
this commit check the priority of 2 system threads - main and idle

Change-Id: Ie57e7fdab3d15c0b69d85ed6282bfa6aa04133b4
Signed-off-by: jing wang <jing.j.wang@intel.com>
2017-02-08 13:22:49 +00:00
Anas Nashif 31f01f8ed6 Merge "Merge net branch into master" 2017-02-08 12:03:09 +00:00
Johan Hedberg 79883c9834 Merge bluetooth branch into master
- Use k_poll to consolidate all TX threads into a single one
 - Reuse HCI command buffers for storing their response
 - Improvements to SDP client support
 - New "volatile subscription" flag to GATT API
 - Various smaller fixes & cleanups here and there

----------------------------------------------------------------
Arkadiusz Lichwa (8):
      Bluetooth: SDP: Get ProtocolDescriptorList attribute internals
      Bluetooth: shell: Add SDP client support
      Bluetooth: uuid: Fix assigned UDP uuid value
      Bluetooth: SDP: Add API to get ProfileDescriptorList attribute
      Bluetooth: shell: Add getting ProfileDescriptorList attribute
      Bluetooth: SDP: Add API to get SupportedFeature attribute
      Bluetooth: shell: Use SupportedFeature attribute API
      Bluetooth: shell: Add support to retrieve A2SRC record

Arun Jagadish (2):
      Bluetooth: AVDTP: Remove buffer pool
      Bluetooth: AVDTP: Add AVDTP Discover Function Definition

Carles Cufi (1):
      Bluetooth: hci_core: Use nRF5x FICR address

Jaganath Kanakkassery (2):
      Bluetooth: RFCOMM: Fix session timer during acl disc
      Bluetooth: RFCOMM: Use common tx pool for control packets

Johan Hedberg (15):
      Bluetooth: Fix trivial coding style issue
      Bluetooth: Fix checking for invalid public address
      Bluetooth: Fix using correct variable type for interrupt mask
      Bluetooth: Fix buffer leak when HCI driver send() fails
      Bluetooth: drivers/h4: Add support for discarding certain events
      Bluetooth: Add convenience macros for common header sizes
      Bluetooth: Kconfig: Merge headroom reserve variables into a single one
      Bluetooth: Controller: Redesign response buffer allocation for commands
      Bluetooth: Reuse HCI command buffers for the command response
      Bluetooth: conn: Use delayed work for LE connection timeout
      Bluetooth: Merge bt_conn TX threads into a single one with k_poll
      Bluetooth: Merge HCI command and connection TX threads
      Bluetooth: samples: Add missing README.rst files
      Bluetooth: Controller: Use LL_ASSERT instead of BT_ASSERT
      Bluetooth: Fix incorrect checks for command buffer user data

Jonathan Gelie (3):
      Bluetooth: GATT: introduce volatile subscription flag
      Bluetooth: GATT: set subscribe value to zero for unsubscription
      Bluetooth: GATT: fixing unsubscription

Luiz Augusto von Dentz (1):
      Bluetooth: GATT: Fix not removing subscriptions safely

Sathish Narasimman (5):
      Bluetooth: HFP HF: Service level connection completed
      Bluetooth: HFP HF: Enable extended AG Error Result Code
      Bluetooth: HFP HF: Indicate disconnect to application
      Bluetooth: HFP HF: Disconnect rfcomm on SLC error
      Bluetooth: HFP HF: Remove unused variable 'buf'

Szymon Janc (5):
      Bluetooth: Use assert when getting net buf with K_FOREVER
      Bluetooth: Remove some dead code
      Bluetooth: L2CAP: Remove dead code
      Bluetooth: SDP: Make bt_sdp_create_pdu static
      Bluetooth: L2CAP: Make l2cap_br_send_conn_rsp return void

 drivers/bluetooth/hci/Kconfig                   |  13 +-
 drivers/bluetooth/hci/h4.c                      |  93 +++-
 drivers/bluetooth/hci/h5.c                      |  47 +-
 drivers/bluetooth/hci/spi.c                     |  13 +-
 drivers/bluetooth/nble/gatt.c                   |  76 +--
 include/bluetooth/buf.h                         |  13 +-
 include/bluetooth/gatt.h                        |  18 +-
 include/bluetooth/hci.h                         |   9 +-
 include/bluetooth/l2cap.h                       |  20 +-
 include/bluetooth/sdp.h                         |  51 ++-
 include/bluetooth/uuid.h                        |   2 +-
 samples/bluetooth/handsfree/README.rst          |  23 +
 samples/bluetooth/hci_uart/src/main.c           |  11 +-
 samples/bluetooth/hci_usb/src/main.c            |  11 +-
 samples/bluetooth/peripheral_sc_only/README.rst |  26 ++
 subsys/bluetooth/controller/hci/hci.c           | 153 ++++---
 subsys/bluetooth/controller/hci/hci_driver.c    |  23 +-
 subsys/bluetooth/controller/hci/hci_internal.h  |   2 +-
 subsys/bluetooth/controller/ll/ctrl.c           |   2 +-
 subsys/bluetooth/host/Kconfig                   |  10 +-
 subsys/bluetooth/host/at.c                      |   2 +-
 subsys/bluetooth/host/at.h                      |   3 +-
 subsys/bluetooth/host/avdtp.c                   |  81 +++-
 subsys/bluetooth/host/avdtp_internal.h          |   7 -
 subsys/bluetooth/host/conn.c                    | 178 ++++----
 subsys/bluetooth/host/conn_internal.h           |  15 +-
 subsys/bluetooth/host/gatt.c                    | 142 +++---
 subsys/bluetooth/host/hci_core.c                | 285 ++++++++----
 subsys/bluetooth/host/hci_core.h                |   6 +
 subsys/bluetooth/host/hci_ecc.c                 |   6 +-
 subsys/bluetooth/host/hci_raw.c                 |  12 +
 subsys/bluetooth/host/hfp_hf.c                  |  50 +-
 subsys/bluetooth/host/l2cap.c                   |  35 --
 subsys/bluetooth/host/l2cap_br.c                |  49 +-
 subsys/bluetooth/host/l2cap_internal.h          |   7 +-
 subsys/bluetooth/host/rfcomm.c                  |  31 +-
 subsys/bluetooth/host/rfcomm_internal.h         |   5 +-
 subsys/bluetooth/host/sdp.c                     | 584 +++++++++++++++++++++++-
 tests/bluetooth/shell/src/main.c                | 172 +++++++
 39 files changed, 1700 insertions(+), 586 deletions(-)
 create mode 100644 samples/bluetooth/handsfree/README.rst
 create mode 100644 samples/bluetooth/peripheral_sc_only/README.rst

Change-Id: I7589dbad8b97477c72d1b856121593bcf6d11339
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-02-08 13:03:20 +02:00
Ravi kumar Veeramally 58ba1d834e net: nbuf: Fix net_nbuf_compact() API
Current API description of net_nbuf_compact() is not very clear.
The first parameter needs to be the first net_buf in the chain.

The changes to this API are needed in order to clarify following
use cases:
1) User provides fragment that is not first of the chain and compact is
successfully done. In this case there is no free space in fragment list
after the input fragment. But there might be empty space in previous
fragments. So fragment chain is not completely compacted.

2) What if input fragment has been deleted and api returns the same
buf?

So this commit simplifies the API behavior. Now net_nbuf_compact()
expects the first parameter to be either TX or RX net_buf and then it
compacts it. It fails only if the input fragment is a data fragment.

Change-Id: I9e02dfcb6f3f2e2998826522a25ec207850a8056
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-08 10:12:36 +02:00
Ravi kumar Veeramally 999338ea94 net: nbuf: Remove unused net_nbuf_push() API
The net_nbuf_push() API is not used by anyone. Semantics are not
clear and following patch requires changes to push api, so removing
this API for now. If needed this can be re-introduced later.

Change-Id: I1d669c861590aa9bc80cc1ccb08144bd6020dac5
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-08 10:12:36 +02:00
Ravi kumar Veeramally 70f7922cee net: tests: 15.4: Increase max data size and fix config option
Test with max data in order to test the fragmentation code better.

Change-Id: I301a96eae1dd637f0291354120389c2bd7575695
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-08 10:12:35 +02:00
Jukka Rissanen bd3908b2a9 net: nbuf: Add timeout to net_buf getters
This commit changes the net_buf getter functions in nbuf.h
by adding a timeout parameter. These function prototypes
are changed to accept a timeout parameter.
	net_nbuf_get_rx()
	net_nbuf_get_tx()
	net_nbuf_get_data()
	net_nbuf_get_reserve_rx()
	net_nbuf_get_reserve_tx()
	net_nbuf_get_reserve_data()
	net_nbuf_copy()
	net_nbuf_copy_all()
	net_nbuf_push()
	net_nbuf_append()
	net_nbuf_write()
	net_nbuf_insert()

Following convinience functions have not been changed
	net_nbuf_append_u8
	net_nbuf_append_be16
	net_nbuf_append_be32
	net_nbuf_insert_u8
	net_nbuf_insert_be16
	net_nbuf_insert_be32
	net_nbuf_write_u8
	net_nbuf_write_be16
	net_nbuf_write_be32
so they call the base function using K_FOREVER. Use the
base function if you want to have a timeout when net_buf
is allocated.

Change-Id: I20bb602ffb73069e5a02668fce60575141586c0f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-08 10:12:35 +02:00
Andrew Boie e67828ba20 tests: remove old ARM vector table test
This was ported to the new kernel, no need to keep the old one around.

Change-Id: I02d39c8e39843cee1862448296e9c1d0dfde75b9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-07 19:52:09 +00:00
Arkadiusz Lichwa 9fff70dbe5 Bluetooth: shell: Add support to retrieve A2SRC record
Adds to BT shell app functionality to trigger to be found on remote
A2SRC UUID. Implements user callback to read resolved response data
and uses existing SDP client API to read attributes values.

> HCI Event: Number of Completed Packets (0x13) plen 5
        Num handles: 1
        Handle: 77
        Count: 1
> ACL Data RX: Handle 77 flags 0x02 dlen 48
      Channel: 64 len 44 [PSM 1 mode 0] {chan 0}
      SDP: Service Search Attribute Response (0x07) tid 2 len 39
        Attribute bytes: 36
        Continuation state: 0
        Combined attribute bytes: 89
          Attribute list: [len 84] {position 0}
            Attribute: Service Record Handle (0x0000) [len 2]
              0x00010005
            Attribute: Service Class ID List (0x0001) [len 2]
              UUID (3) with 2 bytes [0 extra bits] len 3
                Audio Source (0x110a)
            Attribute: Protocol Descriptor List (0x0004) [len 2]
              Sequence (6) with 6 bytes [8 extra bits] len 8
                UUID (3) with 2 bytes [0 extra bits] len 3
                  L2CAP (0x0100)
                Unsigned Integer (1) with 2 bytes [0 extra bits] len 3
                  0x0019
              Sequence (6) with 6 bytes [8 extra bits] len 8
                UUID (3) with 2 bytes [0 extra bits] len 3
                  AVDTP (0x0019)
                Unsigned Integer (1) with 2 bytes [0 extra bits] len 3
                  0x0102
            Attribute: Browse Group List (0x0005) [len 2]
              UUID (3) with 2 bytes [0 extra bits] len 3
                Public Browse Root (0x1002)
            Attribute: Bluetooth Profile Descriptor List (0x0009) [len 2]
              Sequence (6) with 6 bytes [8 extra bits] len 8
                UUID (3) with 2 bytes [0 extra bits] len 3
                  Advanced Audio Distribution (0x110d)
                Unsigned Integer (1) with 2 bytes [0 extra bits] len 3
                  0x0102
            Attribute: Unknown (0x0100) [len 2]
              Advanced Audio [len 15]
            Attribute: Unknown (0x0311) [len 2]
              0x0001
< ACL Data TX: Handle 77 flags 0x00 dlen 12
      L2CAP: Disconnection Request (0x06) ident 10 len 4
        Destination CID: 65

Change-Id: I8938d9eebda31f3d252ff49adc1a96abfcbc5751
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2017-02-05 22:39:25 +02:00
Arkadiusz Lichwa 658ea8cc4b Bluetooth: shell: Use SupportedFeature attribute API
BT shell app tries to retrieve supported features exposed by remote
HFPAG enabled SDP record.

Jira: ZEP-1112

Change-Id: Ic8e5e8bd7cdea822fcaea317e884233e3bf0b4f9
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2017-02-05 22:39:25 +02:00
Arkadiusz Lichwa 4f8641990c Bluetooth: shell: Add getting ProfileDescriptorList attribute
Makes use ProfileDescriptorList atribute API to get remote Hands-Free
profile version.

Jira: ZEP-1112

Change-Id: I3752691057e15c3a9a681dd3277ac160096792e9
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2017-02-05 22:39:25 +02:00
Arkadiusz Lichwa 7577a4ff7c Bluetooth: shell: Add SDP client support
Adds pool memory for storing SDP client query results and introduces
command allowing add HFPAG UUID to be resolved when connection to peer
is already set. When resolved data arrives, UUID callback handler
tries to identify RFCOMM protocol specific information, in this case
remote HFPAG Server Channel Number, stored in Protocol's Descriptor List
attribute data.

> HCI Event: Number of Completed Packets (0x13) plen
        Num handles: 1
        Handle: 77
        Count: 1
> ACL Data RX: Handle 77 flags 0x02 dlen 55
      Channel: 64 len 51 [PSM 1 mode 0] {chan 0}
      SDP: Service Search Attribute Response (0x07) tid 2 len 46
        Attribute bytes: 43
        Continuation state: 0
        Combined attribute bytes: 96
          Attribute list: [len 91] {position 0}
            Attribute: Service Record Handle (0x0000) [len 2]
              0x00010003
            Attribute: Service Class ID List (0x0001) [len 2]
              UUID (3) with 2 bytes [0 extra bits] len 3
                Handsfree Audio Gateway (0x111f)
              UUID (3) with 2 bytes [0 extra bits] len 3
                Generic Audio (0x1203)
            Attribute: Protocol Descriptor List (0x0004) [len 2]
              Sequence (6) with 3 bytes [8 extra bits] len 5
                UUID (3) with 2 bytes [0 extra bits] len 3
                  L2CAP (0x0100)
              Sequence (6) with 5 bytes [8 extra bits] len 7
                UUID (3) with 2 bytes [0 extra bits] len 3
                  RFCOMM (0x0003)
                Unsigned Integer (1) with 1 byte [0 extra bits] len 2
                  0x03
            Attribute: Browse Group List (0x0005) [len 2]
              UUID (3) with 2 bytes [0 extra bits] len 3
                Public Browse Root (0x1002)
            Attribute: Bluetooth Profile Descriptor List (0x0009) [len 2]
              Sequence (6) with 6 bytes [8 extra bits] len 8
                UUID (3) with 2 bytes [0 extra bits] len 3
                  Handsfree (0x111e)
                Unsigned Integer (1) with 2 bytes [0 extra bits] len 3
                  0x0106
            Attribute: Unknown (0x0100) [len 2]
              Handsfree Gateway [len 18]
            Attribute: Unknown (0x0301) [len 2]
              0x01
            Attribute: Unknown (0x0311) [len 2]
              0x0027
< ACL Data TX: Handle 77 flags 0x00 dlen 12
      L2CAP: Disconnection Request (0x06) ident 5 len 4
        Destination CID: 64
        Source CID: 64
> HCI Event: Number of Completed Packets (0x13) plen 5
        Num handles: 1
        Handle: 77
        Count: 1
> ACL Data RX: Handle 77 flags 0x02 dlen 12
      L2CAP: Disconnection Response (0x07) ident 5 len 4
        Destination CID: 64
        Source CID: 64

Jira: ZEP-1112

Change-Id: Ibda606fabe367ca3d0353f77c7093da8c4f175c8
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2017-02-05 22:39:25 +02:00
Sharron LIU de7435a73f tests: kernel: mem_heap: added api and concept tests
<kernel.h> APIs covered:
    k_malloc
    k_free
Concept TESTPOINTs extracted from
https://www.zephyrproject.org/doc/kernel/memory/heap.html#concepts

ZEP-1242

Change-Id: I39edc809119984585d78d6abbe33f5be707c5818
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-02-04 19:36:50 +00:00
jing wang 61e5438c51 tests: add zephyr i2c driver api test
the commit verify below i2c apis by sensor
GY271 or HMC58831
    i2c_configure()
    i2c_write()
    i2c_read()
    i2c_burst_write()
    i2c_burst_read()

Change-Id: I072a9897a45636613e811baa7ff79b57206e4130
Signed-off-by: jing wang <jing.j.wang@intel.com>
2017-02-04 19:31:31 +00:00
Jean-Paul Etienne c989f0b408 riscv32: timer: replace riscv_qemu_driver by the generic riscv_machine_driver
riscv defines the machine-mode timer registers that are implemented
by the all riscv SOCs that follow the riscv privileged architecture
specification.

The timer registers implemented in riscv-qemu follow this specification.
To account for future riscv SOCs, reimplement the riscv_qemu_driver by
the riscv_machine_driver.

Change-Id: I645b03c91b4e07d0f2609908decc27ba9b8240d4
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-02-03 19:20:52 +01:00
Jukka Rissanen cc8eb4144b tests: net: Add tests for network interface
Change-Id: I35f0b3f1794c65b08d32ca561b6189ee59a7a76c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-03 15:59:18 +02:00
Jukka Rissanen 3c95a56c2a tests: net: rpl: Fix unicast NS sending
If we send unicast NS, then the destination IPv6 address needs
to be in the neighbor cache, otherwise we have a NS sending loop.

Change-Id: I11e8f5d5740248024a0becc77055786cd2e32199
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-03 15:59:17 +02:00
Jukka Rissanen 6b069f1589 net: tests: Add unit tests for net_nbuf_compact()
The compact function was never really properly tested
but it is used by other routines that have unit tests.
This commit makes sure there is a special testing for
the buffer compact function.

Change-Id: I35c108fd8459a9482ccae68a51ffa28fb2e0ae99
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-03 15:59:17 +02:00
Ravi kumar Veeramally 2de8bd928a net: tests: Add unit tests for net_addr_ntop() utils function
Change-Id: I72ee5f6444d2e45de0ee7a3aa96884282d41b72d
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-03 15:59:14 +02:00
Ravi kumar Veeramally 10e5162fc2 net: tests: Add unit tests for net_addr_pton() utils function
Change-Id: Ib1e89ce3bb7eff5afe14394062ee6f53a28cc4e6
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-03 15:59:14 +02:00
Benjamin Walsh e440759dbb tests/kernel/poll: test object runtime init functions
Change-Id: I04eac2e5cf5e49ea92fd6195c94a25e783aab253
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-02-03 13:54:01 +00:00
Benjamin Walsh 31189d9ec8 tests/kernel/poll: verify tag is untouched by API
Change-Id: I56f0f0db64c20db40c26b197bba8f1e6bb80a499
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-02-03 13:53:59 +00:00
Jithu Joseph 1eba370efd tests: kernel: import pool/heap tests to unified kernel
Jira: ZEP-932

Change-Id: I4adf43f63db8dca7c252e40433f6ff0095dc1f26
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-03 05:19:46 +00:00