Commit graph

19237 commits

Author SHA1 Message Date
Andrew Boie
a6463a93c1 drivers: ieee802154_cc2520: fix unified build
In the unified kernel legacy layer, both these functions are
implemented as #defines which can't be put in a struct.

Eventually this driver should be updated to use new APIs, but
this will get it to at least build which is the priority.

Change-Id: Ic5dfb5b85ff3bd0d1646f542340642549a2b2e05
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-02 00:00:29 +00:00
Andrew Boie
25ce056279 tests: benchmark: enable for V2 kernel
Not completely ported to V2 APIs yet, but enough that we pull in
all the kernel.h APIs for the microkernel test, bypassing the legacy
layer.

We pull in a lot more than the legacy test did, so results are not
directly comparable.

Change-Id: I35e74bfd1aa15ee59951f68fb7dd8d811619c3f8
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-02 00:00:29 +00:00
Gil Pitney
304e5a69bf Makefile: Fix clobber of LIB_INCLUDE_DIR during second pass
The commit:
commit f25ac092b9
 "Makefile: Restructure for multilibs"

breaks external HAL library linking, by overriding, in the
the second Makefile pass, the LIB_INCLUDE_DIR variable
set in the first Makefile pass from ext/hal Makefiles.

This breaks use of the CONFIG_CC3200SDK_LIBRARY=y option in
the cc3200 SDK, and also likely the QMSI ext/hal/qmsi/Makefile,
when CONFIG_QMSI_LIBRARY=y is set.

This commit just changes the '=' to "+=".

Jira: ZEP-1163

Change-Id: I1aaaaee57378dcd01ab6f2ed4799281b2337eea2
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2016-11-01 23:51:02 +00:00
Dmitriy Korovkin
b4db06615d unified/tests: Remove nanokernel test part from latency_measure
Nanokernel part of the latency_measure test is a subset of the
microkekernel tests. For unified kernel there is no reason to
have nanokernel test - for unified kernel we have to run whole
the set of tests.

Change-Id: Ief176fd9d25e7355e3d3697c3bbc1e953b16655c
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-11-01 23:39:34 +00:00
Szymon Janc
a037316bb5 console: Add support for DEL key
This allows to delete character after cursor.

Change-Id: I9acc5e1edeb688ea4ec36e91aef69ecb5f5f6354
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-01 23:37:37 +00:00
Szymon Janc
6b0cf54c60 console: Add support for HOME and END keys
This allows to navigate to begining and end of the line easily.

Change-Id: I3a839a0499961d55574a310c65811dd2fe048703
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-01 23:37:36 +00:00
Anas Nashif
e7e5701aea Merge "Merge bluetooth branch to master" 2016-11-01 23:21:21 +00:00
Andrew Boie
389dc9f96e tests: app_kernel: exclude call_test() on unified
The unified kernel doesn't use the KERNEL_ENTRY() mechanism,
it doesn't do kernel calls in a special context. So there's
no reason to test this on the unified kernel and we can omit it.

Change-Id: I2b8aa2495385a39130e9b87c0d0324f2f205a2c8
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-01 21:47:22 +00:00
Allan Stephens
98625cb6ce unified/doc: Update Power Management Document
Removes reference to nanokernel/microkernel.

Change-Id: Ibac9c85570d7add45c1dbabc524cb5176c5a189d
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-01 21:45:39 +00:00
Allan Stephens
dec00ce0bd unified/doc: Update Kbuild Reference
Removes references to nanokernel/microkernel and related obsolete
text.

Change-Id: I2b52243db7c580e14d18d39effee7d86428855d8
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-01 21:45:39 +00:00
Allan Stephens
1f7623e2c8 unified/doc: Update Introducing Zephyr
Adapt text to reflect unified kernel changes, and also clean up
a few stylistics inconsistencies.

Change-Id: Ife6d97cae20c7feb974f17f54a47da583f1c1907
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-01 21:45:38 +00:00
Peter Mitsis
058fa4e493 unified: API changes to event handling
Allows event objects to pend signals in a cumulative way using
the semaphore in a non-binary way.

Jira: ZEP-928
Change-Id: I3ce8a075ef89309118596ec5781c15d4f3289d34
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-11-01 16:27:41 -04:00
Johan Hedberg
03c71748f1 Merge bluetooth branch to master
A smaller than usual merge, but with a couple of important fixes:

 - Fix UART TX stall condition (easily reproducible on Arduino 101)
 - Add missing BT_SECURITY_NONE security level
 - Fix missing ATT responses due to missing buffers
 - Consolidate ATT buffers into a smaller set of pools (2 instead of 4)
 - Fix missing error response for LE Connection oriented Channels

----------------------------------------------------------------
Carles Cufi (1):
      Bluetooth: uart: Fix UART TX stall condition

Johan Hedberg (6):
      Bluetooth: samples/hci-uart: Remove unneeded hci_driver.h include
      Bluetooth: Move hci_driver.h to include/drivers/bluetooth
      Bluetooth: Add handling for security level 0
      Bluetooth: samples/hci-uart: Fix up configuration files
      Bluetooth: samples/hci-uart: Fix minor style issues
      Bluetooth: Rename BT_SECURITY_ZERO to BT_SECURITY_NONE

Luiz Augusto von Dentz (5):
      Bluetooth: ATT: Fix not responding when there is a request in parallel
      Bluetooth: ATT: Rework buffer pools to minimize extra data
      Bluetooth: GATT: Fix calling read handler twice
      Bluetooth: L2CAP: Add security check for LE CoC
      Bluetooth: shell: Add support for setting security level to l2cap_register

 drivers/bluetooth/hci/h4.c       |  3 +-
 drivers/bluetooth/hci/h5.c       |  3 +-
 include/bluetooth/att.h          | 11 +-
 include/bluetooth/conn.h         |  2 +
 include/bluetooth/l2cap.h        |  3 +
 .../bluetooth/hci_driver.h       |  0
 net/bluetooth/Kconfig            |  6 +-
 net/bluetooth/att.c              | 72 +++++-----
 net/bluetooth/gatt.c             |  9 ++
 net/bluetooth/l2cap.c            | 23 ++-
 net/bluetooth/l2cap_br.c         | 24 +++-
 .../bluetooth/hci-uart/Makefile  |  2 +-
 .../{prj.conf => generic.conf}   |  4 -
 .../hci-uart/src/main.c          | 18 +--
 tests/bluetooth/shell/src/main.c |  9 +-
 .../src/bluetooth.c              |  2 +-
 16 files changed, 119 insertions(+), 72 deletions(-)
 rename include/{ => drivers}/bluetooth/hci_driver.h (100%)
 rename samples/bluetooth/hci-uart/{prj.conf => generic.conf} (62%)

Change-Id: Idc225b46206d4d3f0a85918e5cf9e527fb407a1e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-01 21:41:59 +02:00
Luiz Augusto von Dentz
2538811fa9 Bluetooth: shell: Add support for setting security level to l2cap_register
This adds support for setting the minimun required security level to
l2cap_register command:

l2cap-register <psm> [sec_level]

Note that entering the security level is optional and the default is
BT_SECURITY_LOW(1).

Change-Id: Ib6dea92919357f41fe2f4de3050b9a10a7f553d6
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-11-01 21:40:39 +02:00
Luiz Augusto von Dentz
b1ad0c9c21 Bluetooth: L2CAP: Add security check for LE CoC
This implements the security check for incoming LE CoC and in case the
connection cannot attend the minimun security level set by the server
return a proper error:

> ACL Data RX: Handle 72 flags 0x02 dlen 18
      LE L2CAP: LE Connection Request (0x14) ident 1 len 10
        PSM: 128 (0x0080)
        Source CID: 64
        MTU: 672
        MPS: 230
        Credits: 10
< ACL Data TX: Handle 72 flags 0x00 dlen 18
      LE L2CAP: LE Connection Response (0x15) ident 1 len 10
        Destination CID: 0
        MTU: 0
        MPS: 0
        Credits: 0
        Result: Connection refused - insufficient authentication (0x0005)

Change-Id: Ia8b2873c5d1b154eb9a7c1a49c94578c4ec22f6d
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-11-01 21:40:39 +02:00
Johan Hedberg
3eb04280ed Bluetooth: Rename BT_SECURITY_ZERO to BT_SECURITY_NONE
Even though this is level 0, NONE as a symbolic description is more in
line with the other level names.

Change-Id: Ic9d7c38b928d8744d47e759fae804bbbc08c89bf
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-01 21:40:39 +02:00
Johan Hedberg
142b75fddb Bluetooth: samples/hci-uart: Fix minor style issues
Fix minor style issues with excessive whitespace for alignment and
lack of 'static' for the tx_fiber_stack.

Change-Id: I0c761e94e6a6789a3772b08b0774cd1a5e73c2ef
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-01 21:40:39 +02:00
Johan Hedberg
1b804f9d74 Bluetooth: samples/hci-uart: Fix up configuration files
Right now the hci-uart samples doesn't really work anywhere else than
nRF5x, so make that the default configuration. Also rename the old
prj.conf to generic.conf to give a generic starting point for creating
configurations for other targets.

Change-Id: I1c940339b457d0e77c8ddad4b2474fc7e5b12a51
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-01 21:40:39 +02:00
Johan Hedberg
9dc033cb84 Bluetooth: Add handling for security level 0
So far bt_security_t has completely missed out on security level 0,
i.e. its actual values have been one lower than in the core
specification.

To properly introduce for the new level (which is only applicable for
BR/EDR) add proper tracking for each channel and server, and make the
channels inherit their required level from the respective server.

Change-Id: I9a2384d883017125c2c117880aa6e0ade30520e4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-01 21:40:39 +02:00
Luiz Augusto von Dentz
237455f77f Bluetooth: GATT: Fix calling read handler twice
If length is already 0 there is no point in calling the handler again
as that already mark the end of the operation.

Change-Id: I212a6d8bdd9aa3d9886099bb7ed3f9d3831bcf1a
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-11-01 21:40:39 +02:00
Luiz Augusto von Dentz
07c8be1791 Bluetooth: ATT: Rework buffer pools to minimize extra data
This uses net_buf_simple_{save/restore} so the same buffer can be reused
if the buffer needs to be resent, also since the responses don't need to
be saved a pool with 1 element is enough while it keeps the code safe
from deadlocking when both request and responses use the same pool.

Change-Id: Ibaa8e7ef39f4b466d5cd4d55874bd609f0a1d67c
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-11-01 21:40:39 +02:00
Carles Cufi
20952b75e3 Bluetooth: uart: Fix UART TX stall condition
In 3 of our UART driver implementations the ISR is exclusively
used and enabled for the RX path. The existing logic was
susceptible to a stall situation where a polled out transmission
would be interrupted by a reception and then the ISR code
would loop forever due to the TX event being signalled (although
the interrupt itself was disabled) causing the ISR to keep
looping for an RX interrupt.

Change-Id: Ic379e58b1c974aca3cee37d2d81f12c3726fb160
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-11-01 21:40:39 +02:00
Johan Hedberg
079030718f Bluetooth: Move hci_driver.h to include/drivers/bluetooth
This header file is not intended for applications, rather than for
drivers, so move it to the appropriate place.

Change-Id: I7ff8158418e7e839b538c6cccbb32f3af43c12c6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-01 21:40:39 +02:00
Johan Hedberg
a3a74de6ba Bluetooth: samples/hci-uart: Remove unneeded hci_driver.h include
There's no need for this app to use the HCI driver API directly.

Change-Id: Ie5acfbfb09fc3f86c3f29f22fbf7da7db1ff2127
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-01 21:40:39 +02:00
Luiz Augusto von Dentz
bbe538fde2 Bluetooth: ATT: Fix not responding when there is a request in parallel
If there is a request ongoing it may block responses to be generated
since they were using the same buffer pool, so this introduces a
dedicated pool for responses making the code able to act as both
server and client at same time.

Change-Id: I5fe3e19f9c5c0c2e0dfadedf77b7684f0960572c
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-11-01 21:40:39 +02:00
Johan Hedberg
900fbc20ba boards: x86: Don't default to 'y' with NRF51_PM and WAIT_NOP
These options were only needed for a MyNewt-based nRF51 firmware on
these boards (the MyNewt BLE stack is called Nimble, hence the
prj_nimble.conf sample config files). With a Zephyr-based nRF51
firmware these options are no-longer needed, so it's not appropriate
to have them default to enabled. Instead, if they are needed, require
the app-specific configuration to enable them.

Change-Id: Iefbee4d97590af4e11bcedea05fe61f32a147b83
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-01 19:37:26 +00:00
Andrew Boie
cc5be1eb96 tests: move benchmark tests to legacy/
These are using old kernel APIs and need to be converted.

Change-Id: I7457270fb5e93e290023756316e82a384712e82b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-01 19:23:48 +00:00
Inaky Perez-Gonzalez
43f788a6eb tests/kernel/test_{fifo,lifo,stack}: filter unified kernel for small memory
As we transition to the unified kernel, we need to check on there
being enough memory in said case (nano kernel always had it based on
higher granularity filtering with 'kernel = nano').

Change-Id: Ic36c352f06be09407cd3aac74a1dfe73bb2fc61d
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-01 11:07:41 -07:00
Anas Nashif
f7bb11a54b tests: stub: we should not be testing this
This code is part of the infrastructure, it does not test any features really.

We are wasting cycles on a stub that does basically nothing.

Change-Id: I130f320d1b365abdac118e5c44b80fd866e5f502
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Anas Nashif
0ad8e7c21a samples: convert to unified applications
Change-Id: Ic65886b9144e4c8b738f94ab228541ef4a34dea3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Anas Nashif
f431084619 tests: common: add rand32 test
Change-Id: I499586a3be1f9794b68b5cf2e5047a762ea11104
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Anas Nashif
5058bb75bc tests: move individual common tests into one test
We have many tests that are being built as stand-alone binaries for no good
reason. Those can be put in one single test to speed up testing and CI
verification.

Currently we do support the following in test_common:

- byteorder
- printk
- intmath
- slist
- atomic
- ring_buf

In addition, the test now uses the ztest framework.

Change-Id: I656ac7f4acf48b7de4ec81c9f5dafc9dea3da911
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Anas Nashif
ea607625a3 samples: synchronization no need to set unified_capable tag
We are building for unified kernel by default. This avoids running the test
twice.

Change-Id: I2951464f448b3019c236ce5943df55c052b427d9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Anas Nashif
90937df6e9 tests: make generic kernel tests unified
Tests that do not use any of the legacy kernel APIs can be moved to unified
kernel to avoid double testing.

Change-Id: Ic2353feb23ee20d9d93f5459432d3b3739df8e03
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Anas Nashif
be4fe7f4e5 tests: move kernel tests to tests/legacy
Move all kernel tests using legacy APIs into tests/legacy to continue testing
old APIs and compatibility. We keep in tests/kernel those tests that do not use
any kernel APIs and generic in nature, those should not be affected by the
unified kernel API change.

In tests/kernel we will start adding tests that are unified kernel only. Later
and when deprecation period is over the legacy tests would be dropped.

Change-Id: Icc7d8c7e5f2af65af350b75da3117f72396925f4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Anas Nashif
649ba4f619 benchmark: sys_kernel: do not build on systems with little RAM
Change-Id: Ic566e247441426918fafb63eea8d2f75f9b8a3b1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Benjamin Walsh
1952ac1611 unified/test Adapt sys_kernel test to unified kernel
As unified kernel starts main() application function, remove test
thread.

Remove nanokernel part of the test since their code base is
identical.

Change-Id: I2afb4c0da2d139b159c89186166afdb5d9813d61
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-11-01 16:52:44 +00:00
Kumar Gala
bfcf575cbb tests: exclude quark_d2000_crb from net/buf test
Currently the net/buf test fails on quark_d2000_crb due to RAM
overflow:
	region `RAM' overflowed by 2256 bytes

Change-Id: I854960a3c22c7318f5f5e9341ca7aaaf8743d30d
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-11-01 15:03:04 +00:00
Anas Nashif
b4dc970a7c tests: convert loopback test to unified kernel
Make it run on Qemu only, this test is not intended for HW.

Change-Id: I842d7456f9238221ef5b661749136f4418d5ab16
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 10:24:55 -04:00
Andrew Boie
4208976bfc build: consolidate some common parts of linker scripts
There are a number of data sections that are repeated across
all the linker scripts for various architecture. In practice these
don't always get updated and we have had problems with bit-rot.
Consolidate these to make maintenance easier.

x86 linker scripts now follow the same naming convention and we
get rid of a linker-epilog.h that wasn't necessary and whose purpose
has been lost to the mists of time. If applications want to define their
own sections they should be allowed to. Linker scripts for x86 do not
end with .h any more, they are not C header files even though we use
C's preprocessor.

Issue: ZEP-688
Change-Id: I893eb4619969695c1f980efd7c2ec9fa5dad136d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-10-31 18:00:58 -07:00
Chuck Jordan
8b1958a36a arc: Don't need CONFIG_NUM_REGULAR_IRQ_PRIO_LEVELS
We can derive NUM_REGULAR_IRQ_PRIO_LEVELS by subtracting 1
from CONFIG_IRQ_PRIO_LEVELS if FIRQ is present (which is currently
always the case). If FIRQ is not present, the value will be equal
to CONFIG_IRQ_PRIO_LEVELS since all interrupts will be regular.

Change-Id: Ibefc939e3771bf0adf712127db0d36cb49bf732b
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-10-31 23:56:56 +00:00
Allan Stephens
075ee6b9fd unified/doc: Update system threads section of Kernel Primer
Note that a new section will be created to discuss workqueues,
including the system workqueue.

Change-Id: I921511f117acb07768619418539bef5b6a2a0a72
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-31 23:56:30 +00:00
Allan Stephens
24320aca9b unified/doc: Update list of changes from version 1 kernel
Change-Id: I57ad834bdc54e495d53986a74b9b5793a37a7732
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-31 23:56:30 +00:00
Peter Mitsis
3f95bfccf5 unified: Add doxygen function headers to legacy.h
Jira: ZEP-981
Change-Id: I08435da22a3776b60ac3f3c5ca77578bff969f19
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-31 23:56:05 +00:00
Peter Mitsis
348eb4c4fb unified: Update kernel.h doxygen comments
Jira: ZEP-981
Change-Id: I3797f5e8824b4a01153f3c1fe0e070d3b107f596
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-31 23:56:04 +00:00
Johan Hedberg
ee0412a7d1 net: tests: Fix net_buf_unref() tests for fragment chains
The net_buf_unref() API will unref all associated fragments, so it's
wrong to assume that no fragment destroy callbacks would be called
when the head buf is unreffed. Instead the right expectation is that
all fragments get unrefed as well.

Change-Id: I00530e4c1cfa5dddbfcbeab9609347873010ff4d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-31 23:53:40 +00:00
Anas Nashif
fcb54aa96b tests: crypto: convert all tests to unified kernel
Change-Id: Id7c1c6bbb0b04eb190cc44c1fbb557722871fc0f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-31 21:38:49 +00:00
Anas Nashif
a32579749b ztest: move ztest to unified kernel
ztest was not working with unified kernel and v1 APIs and not many tests are
using ztest right now, so instead of making it work with old APIs, convert it
to unified kernel completely so that new tests written using ztest would be
unified kenrel based.

Change-Id: Ibfcc7783dcb266abbd388662ba61c4b55d32b10c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-31 21:38:04 +00:00
Flavio Santes
70ff94c42a scripts: Update fixdep from kernel.org
This commit updates fixdep.c from the Linux Kernel, stable v4.8.5.

Origin: https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/plain/scripts/basic/fixdep.c?id=refs/tags/v4.8.5

Jira: ZEP-737

Change-Id: If75d0abb22f98bae74a801aea53218039107dd65
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-10-31 20:58:57 +00:00
Jesus Sanchez-Palencia
fd4dc0f11f wdt: Remove unneeded include from wdt_qmsi.c
qm_interrupt.h is not needed.

Change-Id: Ia9e62db9fc39ee7a8a36e087eb447cbc4a419817
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
2016-10-31 20:58:33 +00:00