Commit graph

41120 commits

Author SHA1 Message Date
Ramesh Thomas
9237040302 fs: Fixes a bug that limits volume size to 1MB
The FS needs to be allowed to choose the correct allocation unit
size based on volume size. Current code passes a fixed value to
the function that creates the FS. Passing 0 allows the FS to configure
the required au size.

Jira: ZEP-898
Change-Id: Ic43bfba8b8f8498f4db49db744743afad4b118cd
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-09-16 02:21:00 +00:00
Anas Nashif
806ac751d4 sdk: zephyr: check for minimum required version of SDK
Error out when old SDK versions are being used.

Jira: ZEP-584
Change-Id: If3515f38cc75d8a378614ef77d8946ba2d9ab28d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-15 21:17:02 +00:00
Anas Nashif
2aa754497d tests: fp_sharing: removing dependency on ARCH
Change-Id: I389f93aad4b785f286bd83be6c5ed688115592f8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-15 21:16:40 +00:00
Anas Nashif
50492618e6 tests: remove dependency on architecture and use one prj.conf
No need for architecture based configuration, they are the same
for ARM and X86.

Change-Id: Iea7a62221a09bcc035bb8c81e4f49cd4c9b02229
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-15 21:16:39 +00:00
Luiz Augusto von Dentz
eeccdaca05 Bluetooth: HCI: Fix updating RPA too early
Checking work pending flag does not account the delay before the work is
submitted so this make use a flag to track when the RPA is valid.

Change-Id: I2d858e5163455ce90eb6273c6a8824c5c6d44ae1
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-09-15 14:36:09 +00:00
Benjamin Walsh
b32d0ff71e unified/x86: fix IAMCU build
Unified kernel does not provide the _thread_arg_t type, but instead uses
void * directly for its thread entry parameters. _thread_entry_t is
typedefed from void * anyway, and only obfuscates the type. So, define
_thread_entry_t to be a function pointer to a function with three void *
parameters, and when the unified kernel becomes the only kernel, all the
_thread_arg_t types will go away.

With this change, IAMCU runs all the tests sysV x86 is able to run as a
unified kernel.

Change-Id: I53c8754629a5a0a114a16a775ff1efc1884496ff
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-15 09:42:24 -04:00
Benjamin Walsh
27365bb5d1 linker: fix typos
Change-Id: Icba6cc66382a09b0c15329bbead1bd8a430f6bee
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-15 09:42:24 -04:00
Benjamin Walsh
0e6aebf2c9 tests/mem_safe: place test buffers at the edges of RAM
This test checks if it can write at the edges of RAM within the kernel
image. The problem is that this memory is not meant to be trampled on.

With the help of custom linker scripts, place 32-byte buffers at those
edges.

Only linker scripts for QEMU on x86 and Cortex-M3 are provided, to avoid
having to maintain too many of them, in case the reference linker
scripts in the kernel change.

JIRA: ZEP-707

Change-Id: Icd5d680ce2cf064cce083c3d244a196e292bd453
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-15 09:42:24 -04:00
Benjamin Walsh
ec89a10c7e build: allow specifying a custom linker script relative to project
Build system will first check if the linker script is found relative to
the project directory, and if not, it will consider it to be an absolute
path, as before.

Change-Id: Idfc7e55febbc8c197643ca514dc01c3e2262712a
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-15 09:42:24 -04:00
Flavio Santes
5306a00190 tinycrypt: Rename current tests to avoid confusions with new algorithms
Rename test_ctr to test_ctr_mode to avoid confusions with any CTR-based
algorithm. For example, currently TinyCrypt v0.2.0 supports the
CTR PRNG algorithm.

Rename test_prng to test_hmac_prng to avoid confusions with the test
case for the CTR PRNG algorithm or any test-case related to PRNGs.

Rename test_cbc to test_cbc_mode. TinyCrypt test case for CBC mode is
"test_cbc_mode.c", so it makes sense to keep the same name for the
directory.

Furthermore, README files are also updated to reflect the previous
described changes.

Change-Id: If0af4dcffe8917a7c29608231d3954b73dff5e10
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-09-15 10:34:05 +00:00
Flavio Santes
0baadc030a tinycrypt: Solve style issues
This commit solves some indentation issues detected in the following
test-cases/files:

- test_cbc/src/test_cbc_mode.c
- test_ctr/src/test_ctr_mode.c
- test_prng/src/test_hmac_prng.c

Change-Id: I0f184ae4b510e4552a061523ea3e1216ae1f6f2a
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-09-15 10:34:05 +00:00
Itankar, Piyush T
d17a803dc9 Bluetooth: Init: Updated filiter options for test_20
Added filter options to avoid building for the Arduino_101
and Quark_se ARC core as there is not enough RAM to run this
test.

Change-Id: I0c1172714c9827e632648fcedc67555251f25769
Signed-off-by: Itankar, Piyush T <piyush.t.itankar@intel.com>
2016-09-15 14:48:22 +05:30
Flavio Santes
73b086caa7 tinycrypt: Add test case for the CTR PRNG algorithm
This commit adds the test case for the CTR PRNG algorithm.

Origin: https://github.com/01org/tinycrypt/tree/v0.2.0

The code was refactored to eliminate malloc and free function
calls and checkpatch errors. However, many warnings are still
present. Refactoring history is available at:

Repo:	https://gitlab.com/santes/tinycrypt/commits/refactoring
Commit:	5d0482c26c4ad69e7854dde58d15bb57a3e5f18f

Jira: ZEP-614
Jira: ZEP-860

Change-Id: I0620868d092941931762718c81fe13fc01f251b2
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-09-15 03:36:14 +00:00
Javier B Perez
5879f1702c samples: zoap server: exclude quark d2000 not enough ram
Excluded Quark D2000 because there is not enough RAM to
build the sample.

Change-Id: Icc772e0aaca2be8731eae8f986eed17782beb445
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-09-14 21:23:25 +00:00
Javier B Perez
fd519dcbd7 known issues: update SKIP regex
Updated SKIP line to use whitespace and non-whitespace.

Change-Id: Ia1b2823836cf96f4065b39dca49c660601e1ea88
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-09-14 21:23:24 +00:00
Andrew Boie
a4a332346c ipm.h: fix erroneous edit of documentation
Patch 3010de9850 changed the
documentation for the ipm_send() 'wait' parameter to something
that is not what the parameter does, and removed some helpful
ancillary information.

Change-Id: Id79950207e9b3d8cfe8f664cbf45fbfa24069dea
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-14 18:10:48 +00:00
Anas Nashif
4589f2c468 samples: use printf/printk directly instead of macros
In many cases there is no need to define a macro for printing to
the console, just use the correct variant directly.

Jira: ZEP-240
Change-Id: I9952deda4bfc60424f01fca2443d037562d13d0d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-14 16:56:02 +00:00
Anas Nashif
01a3e442e8 tests: move test code from samples to tests
Jira: ZEP-760
Change-Id: I3afa847864f9a593696ee832f291f438fd291f8e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-14 15:34:17 +00:00
Carles Cufi
4c9f1017c8 Bluetooth: Controller: Make HCI endianness-independent
Use the sys_ macros from byteorder.h to access all HCI
structure members that are endianness-dependent.

Jira: ZEP-726

Change-Id: I950f8eaca7048bf7972c2c4c347cfd5bbba17eb6
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-09-14 17:28:43 +02:00
Tomasz Bursztyka
86d02e01b1 gpio: stm32: Fix bug introduced by removing API 1.0 support
Bug was introduced by a6cf6038e3

Change-Id: I91ceab2ca20c4d2f70a953b56d895152a471125a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-09-14 16:16:07 +02:00
Marcus Shawcroft
1bea527da6 ksdk: Add KSDK RNGA driver.
Provide a random driver wrapped around the KSDK RNGA driver.

Origin: Original

Change-Id: I43feeb37d8d5173c7b95af8e80434fb7dc77a83e
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-09-14 12:35:30 +00:00
Inaky Perez-Gonzalez
ca35c177fd known-issues: fix regex to catch summary messages to ignore
The regular expression we use to catch the summary messages was not
generic enough to catch it. This causes it to not be classified as a
known issue to ignore and shows up in the output of
filter-known-issues, when it should not.

Fix the regex to be more generic.

Change-Id: I3e53d061325c90c861799dabc1f548177c650bc3
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-09-14 12:20:52 +00:00
Inaky Perez-Gonzalez
1b9d13c408 samples/task_profile: fix testcase.ini's long lines
.ini format supports long lines by prefixing the continuation with an
empty line. Adding a backslash makes the backslash part of the value.

Change-Id: I0a1ade3a6bdf12281e61d06e21d7233d4b624b48
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-09-14 12:20:13 +00:00
Tomasz Bursztyka
a6cf6038e3 gpio: Remove obsolete API 1.0 callback mechanism
In 1.0 you could set only one callback on the whole gpio controller. It
was impossible for another sub-system to add another callback, without
overwritting an existing one.

Such API has been obsolete for a long time and no one is using it
anymore. Thus removing it entirely.

Change-Id: I6a17fd99373dc6cef1fa2ebb421e992412d5015e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-09-14 10:51:09 +00:00
Szymon Janc
c320abc72c Bluetooth: SMP: Factor out BR/EDR encryption check to helper
This make it easier to follow code flow in #ifdefs blocks.

Change-Id: I06941b9db2a76ea587bae02a3bfbc40abf7f2779
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-14 11:26:05 +02:00
Szymon Janc
e45d08ef2d Bluetooth: SMP: Add helper for reporting BR/EDR pairing complete
Put code for completing pairing (success or failure) into common
helper.

Jira: ZEP-605

Change-Id: If24328cf421f970f87a0dc6729a6fea83fb83489
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-14 06:02:39 +00:00
Szymon Janc
fd8d725283 Bluetooth: SMP: Add support for Signing Information over BR/EDR
This allows to handle CSRK distributed by remote device.

> ACL Data RX: Handle 11 flags 0x02 dlen 21
      BR/EDR SMP: Signing Information (0x0a) len 16
        Signature key: 32b6247f80dc172be6198649a6322532

Jira: ZEP-605

Change-Id: I01ca67e134d7d8068d0336567a3fa9b9fdafc001
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-14 06:02:34 +00:00
Szymon Janc
f711962344 Bluetooth: SMP: Add support for Identity Information over BR/EDR
Allow to handle IRK distributed by remote device.

> ACL Data RX: Handle 11 flags 0x02 dlen 21
      BR/EDR SMP: Identity Information (0x08) len 16
        Identity resolving key: 286f917356baf6aa27f169fe30030c88
> ACL Data RX: Handle 11 flags 0x02 dlen 12
      BR/EDR SMP: Identity Address Information (0x09) len 7
        Address type: Public (0x00)
        Address: 20:68:9D:60:A1:E4

Jira: ZEP-605

Change-Id: I3c7d32cc6e4cf4d8690edb92089bd433e06f1b4d
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-14 06:02:29 +00:00
Szymon Janc
777d2f5f30 Bluetooth: SMP: Add support for sending Pairing Request over BR/EDR
This allows to send Pairing Request.

Jira: ZEP-605

Change-Id: I0ec2989e4dedb25a51e73b27689f0fd1893ceab8
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-14 06:02:22 +00:00
Szymon Janc
68592f06f6 Bluetooth: SMP: Add support for LTK derivation from LinkKey
This allows to derive LTK from Link Key using H6 function.

Jira: ZEP-625

Change-Id: Ife1e0d770f196174b6d7fc5e8074d76af49934cb
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-14 06:02:15 +00:00
Szymon Janc
790a28ccf4 Bluetooth: SMP: Allow to force BR/EDR without SC support
This option allows to register BR/EDR SMP channel without required
Secure Connections support in controller. This is solely for testing
and should never be enabled in production.

Jira: ZEP-605

Change-Id: I1909c900e323f61acef9fa2b46f22e853beeda75
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-14 06:02:10 +00:00
Szymon Janc
756ac5f63c Bluetooth: SMP: Support Pairing Response over BR/EDR
Handle Pairing Response and distribute keys if required.

Jira: ZEP-605

Change-Id: I2014d38896f9f67095228cb09dab017040570448
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-14 06:02:05 +00:00
Szymon Janc
1d06d941da Bluetooth: SMP: Fix encryption key size check in BR/EDR pairing req
Encryption key size for derived LTK should match one used for BR/EDR
encryption.

Change-Id: Ibcb1c3320cd191ce0d2fda8f5cacaf1ee295fcc4
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-14 06:02:00 +00:00
Szymon Janc
85195d2d2e Bluetooth: Add support for reading encryption key size for BR/EDR
Make use of "Read Encryption Key Size" HCI command to read real
encryption key size for BR/EDR connection instead of assuming 16
bytes key size.

< HCI Command: Read Encryption Key Size (0x05|0x0008) plen 2
        Handle: 11
> HCI Event: Command Complete (0x0e) plen 7
      Read Encryption Key Size (0x05|0x0008) ncmd 1
        Status: Success (0x00)
        Handle: 11
        Key size: 16

Change-Id: I372028ce73115d34aedbb6b5ce420144844cfce0
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-14 06:01:55 +00:00
Carles Cufi
90871a5e98 Bluetooth: Controller: Implement LE_RAND command
The LE_RAND HCI command was not filling in the rand array
with 8 random numbers as required by the spec.
Please note that the while() loop inside the command's
implementation can take up to hundreds of ms to execute.

Jira: ZEP-726

Change-Id: If27ff861ee5fa7842cd469e99d5bfa8ac47ac2fa
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-09-14 08:45:45 +03:00
Carles Cufi
ef10baa235 Bluetooth: Controller: Clean up HCI macros
Clean up, document and remove the macros used in hci.c
to access the different parameters and calculate lengths
of events and data structures.

Jira: ZEP-726

Change-Id: I476aa9e061dfe429b5181265167bffa203ed151b
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-09-14 08:45:45 +03:00
Carles Cufi
ec44eae44d Bluetooth: Controller: Use hci.h for ACL data
Switch to using the definitions in include/bluetooth/hci.h
for ACL data handling, both in RX and TX.

Jira: ZEP-726

Change-Id: I6b5f6de4ff568c4e73432df3edfa7d0a57f22fff
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-09-14 08:45:45 +03:00
Johan Hedberg
37d204e03d Bluetooth: Fix giving back pkts semaphore when disconnecting
The TX fiber might be blocked waiting for the num_pkts semaphore when
a disconnection occurs. If we only give back the semaphore once
exiting the while-loop we may end up in a deadlock. Giving back the
semaphore in the connection disconnect handler solves this.

An additional fix this patch does is to ensure that we don't perform
integer underflow because of the last iteration.

Change-Id: Ia67dc506885d0c2bad25c598ea349f1fd251218b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-09-14 08:45:45 +03:00
Szymon Janc
c31fcf4e5a Bluetooth: SMP: Distribute local keys over BR/EDR
< ACL Data TX: Handle 11 flags 0x00 dlen 21
      BR/EDR SMP: Identity Information (0x08) len 16
        Identity resolving key: 732bf430116b328587de5fda0a4b8c80
< ACL Data TX: Handle 11 flags 0x00 dlen 12
      BR/EDR SMP: Identity Address Information (0x09) len 7
        Address type: Public (0x00)
        Address: 00:02:72:33:45:88

Jira: ZEP-605

Change-Id: I6ba203ea4bbd64c0f05150d3865e6c3bb630b41d
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-14 08:45:45 +03:00
Carles Cufi
92b4458690 Bluetooth: Controller: Remove HCI event definitions from hci.c
Delete all event definitions from hci.c since the code now
uses the ones in include/bluetooth/hci.h exclusively.
This is the fourth and last commit in a series that transitions
from the event structures in hci.c to the ones in hci.h.

Jira: ZEP-726

Change-Id: I625c2aecf759823a1cc73a3ea096564284fe8c52
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-09-14 08:45:45 +03:00
Carles Cufi
0ed85e24be Bluetooth: Controller: Use hci.h for num complete
Use Zephyr's include/bluetooth/hci.h for the HCI event
Number of Completed Packets.
This is the third commit in a series that transitions from
the event structures in hci.c to the ones in hci.h.

Jira: ZEP-726

Change-Id: I179bceb2f9dc07d7a1a524c3a80f0886f712ec2b
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-09-14 08:45:45 +03:00
Szymon Janc
8f9eccac25 Bluetooth: SMP: Support Pairing Failed over BR/EDR
Invalidate received keys on Pairing Failed.

Jira: ZEP-605

Change-Id: I4eec85233ed27312b9f61d89d71329cc665b382b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-14 08:45:45 +03:00
Szymon Janc
2cac219a36 Bluetooth: SMP: Support Pairing Request over BR/EDR
This allows to handle Pairing Request and reply with Pairing Response.

> ACL Data RX: Handle 11 flags 0x02 dlen 11
      BR/EDR SMP: Pairing Request (0x01) len 6
        IO capability: DisplayOnly (0x00)
        OOB data: Authentication data not present (0x00)
        Authentication requirement: No bonding, No MITM, Legacy,
                                    No Keypresses (0x00)
        Max encryption key size: 16
        Initiator key distribution: IdKey (0x02)
        Responder key distribution: IdKey (0x02)
< ACL Data TX: Handle 11 flags 0x00 dlen 11
      BR/EDR SMP: Pairing Response (0x02) len 6
        IO capability: DisplayOnly (0x00)
        OOB data: Authentication data not present (0x00)
        Authentication requirement: No bonding, No MITM, Legacy,
                                    No Keypresses (0x00)
        Max encryption key size: 16
        Initiator key distribution: IdKey (0x02)
        Responder key distribution: IdKey (0x02)

Jira: ZEP-605

Change-Id: I886c8d345b87dafae93d692ab39b7f1214bff733
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-14 08:45:45 +03:00
Szymon Janc
355ef5a5a0 Bluetooth: SMP: Clear keys on timeout when running over BR/EDR
If SMP Timeout occured pairing failed and any keys distributed should
be invalidated.

Jira: ZEP-605

Change-Id: Ibdb9d61c720f9da10232c9bc6148d9ff73ccfa6c
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-14 08:45:45 +03:00
Johan Hedberg
3a3238d1b0 Bluetooth: GATT: Fix potential bt_conn reference leak
There was a missing bt_conn_unref() when bt_conn_lookup_addr_le()
returns a connection that's not in BT_CONN_CONNECTED state.

Change-Id: I4c6271d5bf596ea4d9b899e99ce1c7b7c8693f5e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-09-14 08:45:45 +03:00
Szymon Janc
d27447c674 Bluetooth: SMP: Add initial code for BR/EDR support
This allows to register SMP over BR/EDR fixed channel is Secure
Connections are supported by controller.

Change-Id: I681bc1cc789ae30a115594c1143485e8a7a8acb3
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-14 08:45:45 +03:00
Szymon Janc
fa726a8d99 Bluetooth: SMP: Move smp_create_pdu function up in a file
This is in prepartion for BR/EDR support.

Change-Id: Ie9e8f6368b74e6e9768e775d6ccf718fb6927e3a
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-14 08:45:45 +03:00
Carles Cufi
a587f2692c Bluetooth: Controller: Use hci.h for data-control evt handling
Use Zephyr's include/bluetooth/hci.h for HCI event
handling in data-related events.
This is the second commit in a series that transitions from
the event structures in hci.c to the ones in hci.h.

Jira: ZEP-726

Change-Id: I0e9e6f709091859af47d90b26f5e7baa830a2838
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-09-14 08:45:45 +03:00
Carles Cufi
77c389aa1c Bluetooth: HCI: Add read remote version info event
This adds the Read Remote Version Info Complete event,
used in both BR/EDR and LE and required by the LE Controller.

Change-Id: I650411ef2c582c20a90eb73bc4475b5e2d4aa2d9
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-09-14 08:45:45 +03:00
Carles Cufi
a955f583eb Bluetooth: Controller: Use hci.h for control event handling
Use Zephyr's include/bluetooth/hci.h for HCI event
handling in control events.
This is the first commit in a series that transitions from
the event structures in hci.c to the ones in hci.h.

Jira: ZEP-726

Change-Id: I6f131675add18e2ae061f0fb2cf220ea7057f852
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-09-14 08:45:45 +03:00