Commit graph

42249 commits

Author SHA1 Message Date
Andrew Boie
96cadd1a9a arc: move special-purpose irq priorities to flags
We have already done this on x86 and ARM. The policy is as follows:

* IRQ priority levels starting at 0 all have the same semantics and
do not have special properties. The priority level is either ignored
on arches which do not support programmable priority levels, or lower
priority levels take precedence over higher ones.
* Special-case priorty levels are specified via flags, in which case
the supplied priority level is ignored.

Issue: ZEP-60
Change-Id: Ic603f49299ee1426fb9350ca29d0b8ef96a1d53a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-26 15:06:28 +00:00
Luiz Augusto von Dentz
78881ebd3b Bluetooth: GATT: Fix not passing params in the write callback
Write callback shall receive the params given in the request so the
struct itself needs to be passed.

Change-Id: Ia039c25c99efb57e4c441561067d0398d9e6277c
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-07-26 15:26:15 +03:00
Allan Stephens
2275cae089 kernel: Remove unneeded ASSERT from memory pool subsystem
Eliminates assert check that complains about an attempt to allocate
a memory pool block larger than the largest possible block size.
In such cases the allocation code now just returns a NULL pointer
indicating that it was unable to allocate the requested block, just
as it does when a block smaller than the maximum size cannot be
allocated because none is currently available.

Note: One scenario in which it isn't unreasonable for an application
writer to request a block that is too big is the case where a receiving
task using a mailbox first receives an excessively large message without
its data and then tries to retrieve the data into a memory pool block
allocated by the mailbox. Rather than forcing the application writer
to check to see if the size of the received message is too big for the
memory pool, or adding code to the mailbox subsystem to do such a check,
it's easier to pass on the request to the memory pool and simply have it
return NULL, which causes the mailbox to report that data retrieval
failed. The application can then perform a single check that catches
both the case where the memory pool simply ran out of blocks and the case
where it didn't have any block big enough to handle the message.

Change-Id: Ifd2cdd8a5927b93d3e9c5df301544e522131d2c6
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-26 04:53:07 +00:00
Inaky Perez-Gonzalez
eb2d8b418c testcases: add automation markup to samples/
Code in samples does not follow an standarized format for reporting
success or operation failure -- thus we use markup (in file sample.tc)
to specify what shall be found in the console to consider execution a
success.

There is a few functional code modifications that add/extend console
messages so verification is possible or easier:

 - hello_world, synchronization: extend the success message to also
   print which core is running the testcase

- pci_enum: print message on success.

Change-Id: Idb6cea03adebe97d97854603f963f4e3d4cb856a
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-07-26 08:32:24 +08:00
Andrew Boie
11693c1bf9 build: use -Og instead of -O0 for CONFIG_DEBUG
From the GCC manual for -Og option, introduced in GCC
4.8:

Optimize debugging experience. -Og enables optimizations
that do not interfere with debugging. It should be the
optimization level of choice for the standard
edit-compile-debug cycle, offering a reasonable level of
optimization while maintaining fast compilation and a
good debugging experience

Change-Id: I65751cf3117bc2e6f70a7008b170126160cfa48c
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-25 18:09:14 +00:00
Jaakko Hannikainen
e6a34f8175 net: buf: Fix compiling with debug options
The small typo in the debug printed variable prevents compiling when
using debug printing in the netbuf code.

Change-Id: I6cafa82e7f5629e9021d7ad1a2130f2945b4f661
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
2016-07-25 14:24:39 +00:00
Arkadiusz Lichwa
ea5449dbcc Bluetooth: L2CAP: Add BR/EDR CoC channel disconnect
Implements CoC channel disconnect API initiated from local and handles
response to the disconnect request from remote.

Change-Id: I25f2495404cd405dc83ad56269e4897e53d602e6
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-07-25 14:24:04 +00:00
Arkadiusz Lichwa
a49b9fcf57 Bluetooth: L2CAP: Handle BR/EDR configuration deferred by GAP
Marks successfuly allocated channel during incoming connection
request to dedicated channel context flag. Introduced here ACCEPTOR
role on L2CAP layer helps then resolve channel CoC state context when
incoming connection setup is deferred by changed security on GAP caused
by local L2CAP channel requirement.

> ACL Data RX: Handle 12 flags 0x02 dlen 12                   [hci1] 108.666944
      L2CAP: Connection Request (0x02) ident 3 len 4
        PSM: 3 (0x0003)
        Source CID: 64
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci1] 108.668572
        Num handles: 1
        Handle: 12
        Count: 2
< ACL Data TX: Handle 12 flags 0x00 dlen 16                   [hci1] 108.673002
      L2CAP: Connection Response (0x03) ident 3 len 8
        Destination CID: 64
        Source CID: 64
        Result: Connection successful (0x0000)
        Status: No further information available (0x0000)
< HCI Command: Host Number of Complet.. (0x03|0x0035) plen 5  [hci1] 108.673548
        Num handles: 1
        Handle: 12
        Count: 1
< ACL Data TX: Handle 12 flags 0x00 dlen 16                   [hci1] 108.674725
      L2CAP: Configure Request (0x04) ident 5 len 8
        Destination CID: 64
        Flags: 0x0000
        Option: Maximum Transmission Unit (0x01) [mandatory]
          MTU: 48
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci1] 108.707579
        Num handles: 1
        Handle: 12
        Count: 2
> ACL Data RX: Handle 12 flags 0x02 dlen 16                   [hci1] 108.714206
      L2CAP: Configure Request (0x04) ident 4 len 8
        Destination CID: 64
        Flags: 0x0000
        Option: Maximum Transmission Unit (0x01) [mandatory]
          MTU: 560
> ACL Data RX: Handle 12 flags 0x02 dlen 18                   [hci1] 108.715442
      L2CAP: Configure Response (0x05) ident 5 len 10
        Source CID: 64
        Flags: 0x0000
        Result: Success (0x0000)
        Option: Maximum Transmission Unit (0x01) [mandatory]
          MTU: 48
< HCI Command: Host Number of Complet.. (0x03|0x0035) plen 5  [hci1] 108.720451
        Num handles: 1
        Handle: 12
        Count: 1
< ACL Data TX: Handle 12 flags 0x00 dlen 14                   [hci1] 108.720472
      L2CAP: Configure Response (0x05) ident 4 len 6
        Source CID: 64
        Flags: 0x0000
        Result: Success (0x0000)
< HCI Command: Host Number of Complet.. (0x03|0x0035) plen 5  [hci1] 108.722324
        Num handles: 1
        Handle: 12
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci1] 108.976574
        Num handles: 1
        Handle: 12
        Count: 1
> ACL Data RX: Handle 12 flags 0x02 dlen 12                   [hci1] 116.297981
      L2CAP: Connection Request (0x02) ident 5 len 4
        PSM: 5 (0x0005)
        Source CID: 65
< HCI Command: Authentication Requested (0x01|0x0011) plen 2  [hci1] 116.302176
        Handle: 12
> HCI Event: Command Status (0x0f) plen 4                     [hci1] 116.303129
      Authentication Requested (0x01|0x0011) ncmd 1
        Status: Success (0x00)
> HCI Event: Link Key Request (0x17) plen 6                   [hci1] 116.304127
        Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
< HCI Command: Host Number of Complet.. (0x03|0x0035) plen 5  [hci1] 116.304327
        Num handles: 1
        Handle: 12
        Count: 1
< ACL Data TX: Handle 12 flags 0x00 dlen 16                   [hci1] 116.305841
      L2CAP: Connection Response (0x03) ident 5 len 8
        Destination CID: 65
        Source CID: 65
        Result: Connection pending (0x0001)
        Status: Authentication pending (0x0001)
< HCI Command: Link Key Request Negat.. (0x01|0x000c) plen 6  [hci1] 116.306913
        Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
> HCI Event: Command Complete (0x0e) plen 10                  [hci1] 116.308125
      Link Key Request Negative Reply (0x01|0x000c) ncmd 1
        Status: Success (0x00)
        Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
> HCI Event: IO Capability Request (0x31) plen 6              [hci1] 116.309126
        Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
< HCI Command: IO Capability Request... (0x01|0x002b) plen 9  [hci1] 116.310177
        Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
        IO capability: DisplayYesNo (0x01)
        OOB data: Authentication data not present (0x00)
        Authentication: Dedicated Bonding - MITM required (0x03)
> HCI Event: Command Complete (0x0e) plen 10                  [hci1] 116.311125
      IO Capability Request Reply (0x01|0x002b) ncmd 1
        Status: Success (0x00)
        Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
> HCI Event: IO Capability Response (0x32) plen 9             [hci1] 116.331128
        Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
        IO capability: DisplayYesNo (0x01)
        OOB data: Authentication data not present (0x00)
        Authentication: Dedicated Bonding - MITM required (0x03)
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci1] 116.483125
        Num handles: 1
        Handle: 12
        Count: 1
> HCI Event: User Confirmation Request (0x33) plen 10         [hci1] 116.516225
        Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
        Passkey: 798417
< HCI Command: User Confirmation Requ.. (0x01|0x002c) plen 6  [hci1] 123.541708
        Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
> HCI Event: Command Complete (0x0e) plen 10                  [hci1] 123.555708
      User Confirmation Request Reply (0x01|0x002c) ncmd 1
        Status: Success (0x00)
        Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
> HCI Event: Simple Pairing Complete (0x36) plen 7            [hci1] 131.484303
        Status: Success (0x00)
        Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
> HCI Event: Link Key Notification (0x18) plen 23             [hci1] 131.524232
        Address: 00:1A:7D:DA:71:13 (cyber-blue(HK)Ltd)
        Link key: 9355f679935c4e602ac1cc8a56ba121a
        Key type: Authenticated Combination key from P-192 (0x05)
> HCI Event: Auth Complete (0x06) plen 3                      [hci1] 131.525244
        Status: Success (0x00)
        Handle: 12
< HCI Command: Set Connection Encrypt.. (0x01|0x0013) plen 3  [hci1] 131.527348
        Handle: 12
        Encryption: Enabled (0x01)
> HCI Event: Command Status (0x0f) plen 4                     [hci1] 131.528234
      Set Connection Encryption (0x01|0x0013) ncmd 1
        Status: Success (0x00)
> HCI Event: Encryption Key Refresh Complete (0x30) plen 3    [hci1] 131.552238
        Status: Success (0x00)
        Handle: 12
> HCI Event: Encryption Change (0x08) plen 4                  [hci1] 131.553240
        Status: Success (0x00)
        Handle: 12
        Encryption: Enabled with E0 (0x01)
< ACL Data TX: Handle 12 flags 0x00 dlen 16                   [hci1] 131.556727
      L2CAP: Connection Response (0x03) ident 5 len 8
        Destination CID: 65
        Source CID: 65
        Result: Connection successful (0x0000)
        Status: No further information available (0x0000)
< ACL Data TX: Handle 12 flags 0x00 dlen 16                   [hci1] 131.562063
      L2CAP: Configure Request (0x04) ident 6 len 8
        Destination CID: 65
        Flags: 0x0000
        Option: Maximum Transmission Unit (0x01) [mandatory]
          MTU: 64
> ACL Data RX: Handle 12 flags 0x02 dlen 16                   [hci1] 131.562733
      L2CAP: Configure Request (0x04) ident 6 len 8
        Destination CID: 65
        Flags: 0x0000
        Option: Maximum Transmission Unit (0x01) [mandatory]
          MTU: 245
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci1] 131.567286
        Num handles: 1
        Handle: 12
        Count: 2
> ACL Data RX: Handle 12 flags 0x02 dlen 18                   [hci1] 131.568858
      L2CAP: Configure Response (0x05) ident 6 len 10
        Source CID: 65
        Flags: 0x0000
        Result: Success (0x0000)
        Option: Maximum Transmission Unit (0x01) [mandatory]
          MTU: 64

Change-Id: I04aab5a0511ba09693f96faeeb66eef53e66ce0e
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-07-25 14:23:12 +00:00
Arkadiusz Lichwa
f8f9de079a Bluetooth: L2CAP: Reset CoC channel state during cleanup
When user channel is disattached from connection object during channel
cleanup, resets its state to DISCONNECTED to be able reuse it from
well known init state.

Change-Id: I5733ade4be195821a1643383916c3a6fea5a88d3
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-07-25 14:22:57 +00:00
Arkadiusz Lichwa
37bb3e8049 Bluetooth: L2CAP: Split security changed handler for BR/EDR
Delegates own handler for changed security information happened on BR/EDR
link. Now L2CAP layer based on transport type can independently handle
updated security information.

Change-Id: I4838f1cc9d53cf6dfab19bb9f70ec6e307741e66
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-07-25 14:22:18 +00:00
Arkadiusz Lichwa
96e68fe654 Bluetooth: L2CAP: Introduce security requirements on CoC
Applies on L2CAP channel object security requirement member and
implements on BR/EDR transport basic security cases during incoming
CoC connection request. Since channel security requirements can involve
sending 2 separate connection responses with proper results depending on
context path, there's a need to store L2CAP signaling identifier set in
original connection request to be restored later to help match proper
response context.

Change-Id: Ibac9a5d2443f2975637e1bd15f61afcad53f843b
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-07-25 13:56:08 +00:00
Luiz Augusto von Dentz
c6071e46da Bluetooth: GATT: Fix bt_gatt_exchange_mtu documentation
bt_gatt_exchange_mtu does actually return an int, also change the align
the description properly so it is consistent with other functions.

Change-Id: I6a0780830e13ded15e6262a46094441a2ef662c8
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-07-25 16:08:52 +03:00
Inaky Perez-Gonzalez
68e0c50211 testcases: introduce defaults to build/deploy/evaluate
This introduces the default language to use for building, deploying
and evaluating testcases on real hardware in the automation framework.

To be able to filter testcases out based on .config values, we split
the build process into generating the configuration file, filtering
and then the actual building.

The configuration step is done first, to be able to skip as soon
as possible.

This file is in the top level as the test runner will look for
defaults in parent directories.

Note that the default's entry in tests/.tcdefaults takes advantage of
the fact that all:

- the test cases under tests/ print standarized strings for success
  or failure.

- the tc_util.h kernel header will print the passed runid if specified
  when finalizing the testcase. We will make sure it is found to deem
  the TC succesful, ensuring that the right image is flashed and
  verified.

Change-Id: If40b226aef9583f7ce4064405d9334de379f2b00
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-07-23 18:31:18 +00:00
Mariusz Skamra
602724a91a Bluetooth: tester: Expose device address
This adds device address to the controller_info data. This address
may be used then by PTS for establishing connection etc.

Change-Id: Ic2319c452d94ac79376659ba37b4c9d812ccf9ae
Signed-off-by: Mariusz Skamra <mariusz.skamra@gmail.com>
2016-07-23 06:16:14 +00:00
Mariusz Skamra
c06a13a93d Bluetooth: tester: Set privacy flag in current_settings
If CONFIG_BLUETOOTH_PRIVACY is set in Kconfig, current settings
shall indicate it's usage.

Change-Id: I0645aedf1b774617c9d97cec0070908aef919ca7
Signed-off-by: Mariusz Skamra <mariusz.skamra@gmail.com>
2016-07-23 06:16:09 +00:00
Mariusz Skamra
7fe81b92a6 Bluetooth: tester: Add missing GAP_SETTINGS_* defines
Based on BTP specification following GAP_SETTINGS_* flags were added:
GAP_SETTINGS_CONTROLLER_CONFIG,
GAP_SETTINGS_STATIC_ADDRESS

Change-Id: Ic87d13772c0ef9c9bc8bba331c8bc9f3ffc93f87
Signed-off-by: Mariusz Skamra <mariusz.skamra@gmail.com>
2016-07-23 06:15:48 +00:00
Andrew Boie
3a73378741 MAINTAINERS: add INTERRUPTS section
Interrupt handling considerations are pervasive in core
arch code so just add the entire arch/*/core/ dirs for
each arch.

Change-Id: Id2b166541faf620f1c45d9d330fa03e5a387a88a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-22 23:40:38 +00:00
Sonia Leon Bautista
616e96242b scripts: Check all CONFIG_* in the code are defined into a Kconfig file
checkConfig script scans all '*.c', '*.h' and '*.S' looking for all
kconfig items used into the Zephyr Code and validates if they are
defined into any '*.kconfig' file.

to execute script use:
*to run with default values:
	$ checkconfig.py
*to run and get complete log of all symbols used:
	$ checkconfig.py -c
*to run from a diferent subdirectory, not zephyr base, like
 drivers/grove
	$ checkconfig.py -s drivers/grove
*to run and exclude some directories for verification:
	$checkconfig.py -e drivers

*to get more help about how to run script:
	$checkconfig.py --help

Change-Id: Ia8ddda8b560305eb73224c55645729a40fcb5863
Signed-off-by: Sonia Leon Bautista <sonia.leon.bautista@intel.com>
2016-07-22 23:27:08 +00:00
Sergio Rodriguez
b4d87a575a qmsi: gpio: Use locking mechanism to guard critical regions.
This will guard the driver API to be safe for concurrent
invocation from fibers or tasks.

The machanism is by default disabled. To enable it, the
following flag needs to be defined:

CONFIG_GPIO_QMSI_API_REENTRANCY

Jira: ZEP-441

Change-Id: Ia3ee738aff2f8e70e4f9a7ec76346138ff6f5031
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2016-07-22 23:26:34 +00:00
Sergio Rodriguez
3c5af9ab5b qmsi: gpio: quark_se_ss: Use locking mechanism to guard critical regions.
This will allow the driver API to be safe for concurrent invocation
from fibers and task.

The machanism is by default disabled. To enable it, the following
flag needs to be defined:

CONFIG_GPIO_QMSI_SS_API_REENTRANCY

Jira: ZEP-411

Change-Id: I5b738532f2eefec6d5d78ab6a668790dfe9faaff
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-07-22 23:25:31 +00:00
Inaky Perez-Gonzalez
8518d9cf81 testcases: stub for x86 core on Quark SE
When running independent testcases that can run on any core, in
certain platforms using the Quark SE SOC, a stub is needed in the x86
to bring up the ARC core and pass along serial port messages. This
allows the indepent testcase to be ran in the ARC core without
modifications (the same way it runs on any other core).

There is a solution planned for the future that will allow this
workaround to be removed (without need to support backwards
compatibility).

Change-Id: I2a9b7e8797d03a5a2469d7b18a3025b79226f389
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-07-22 23:05:52 +00:00
Inaky Perez-Gonzalez
c6a8462c6e doc: fix backslash paths in windows and python default location
Backslashes need to be doubled up, otherwise they are interpreted like
a escape sequence and basically, dissapear. As part of this, suggest
the location of the default python installation *before* using it, for
simplicity.

Change-Id: I26ed80a7dd8c08277614dc49a3986848892ff844
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-07-22 22:37:49 +00:00
Mariusz Skamra
a028e43a97 Bluetooth: tester: Send IUT ready event on tester_init
When tester application has been initialized, send this event
to indicate that Upper Tester can send first BTP command.

Change-Id: Id3f4dd246c4e67982057f9518b4b0036e79a6a01
Signed-off-by: Mariusz Skamra <mariusz.skamra@gmail.com>
2016-07-22 20:03:28 +00:00
Mariusz Skamra
3c15027799 Bluetooth: btp: Add IUT ready event
Before sending any command, the tester shall wait for this event
indicating that IUT is ready to accept first BTP command.
This is needed, because some devices need more time to initialize
their stacks, so that the first BTP command can be lost.

Change-Id: I92d1c6ea8be905734037eb29f7f270a70ab1583e
Signed-off-by: Mariusz Skamra <mariusz.skamra@gmail.com>
2016-07-22 19:19:28 +00:00
Andrei Emeltchenko
712689c9a3 drivers/nble: Use semaphore to control notification rate
At the moment firmware reads everything we send to it over UART and
when an application tries to send too much notifications we are stuck.
The proper approach would be forcing firmware to read from UART only
when there is available memory. In this case we would block on UART
FIFO and everything handles gracefully.
This workaround mimics solution used by firmware project by allowing
to send next notification only after previous was sent correctly.

Change-Id: I56dd5abc4d13735d285415da04db75e7bb8bc459
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-07-22 19:03:43 +00:00
Maureen Helm
bfb451e5eb ksdk: Fix ARRAY_SIZE conflict
Wrap the ksdk's ARRAY_SIZE macro definition with an ifndef to avoid
conflicting with the same macro in include/misc/util.h.

Change-Id: I102170519857ba6c593c3d3ee96e3394711c625d
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-07-22 15:47:58 +00:00
Szymon Janc
d2549115ca Bluetooth: Rename connectable_addr member in struct bt_le_oob
Depending on advertising options this can be non-connectable address.
NFC pairing application document also allows broadcaster/observer
roles.

Change-Id: I9b104ac8fb9752a083a7a31fc20598c66f23f608
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-07-22 13:09:30 +02:00
Arkadiusz Lichwa
d5a07edde0 Bluetooth: L2CAP: Refactor channel context by ident
Moves 'ident' member so far included in bt_l2cap_le_chan context only
to common bt_l2cap_chan context. The change is driven by sharing ability
to store/restore 'ident' on both transports and makes use of it only if
CoC is configured. For default configuration there's channel addition
helper to be used internally by dedicated macros managing channel
objects enlisted in connection tracker list.
The common member is used in matching outstanding connection responses
on LE and to prepare a ground for BR/EDR transport context when
there'll be a need to match response to original incoming connection
request after in-between security changes that can happen.

Change-Id: I1a4cad7cd53c74774604a0e9794607081a8b6e80
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-07-22 09:20:20 +00:00
Luiz Augusto von Dentz
c9a3809ab5 Bluetooth: Remove nano_work include from internal header
This include is no longer necessary since all .c files that include it
already have nano_work included as well.

Change-Id: I523d6c756e2e49d53fcb00459d8ed547113d9078
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-07-22 09:18:13 +00:00
Johan Hedberg
1668624a2f Bluetooth: tests/shell: Remove unnecessary redefinition of AD types
Change-Id: I411618b1cc8ecdf67f84d6debb43bde314eaed10
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-22 09:18:02 +00:00
Johan Hedberg
cbf325a58d Bluetooth: Add warning for bt_pub_key_gen() when missing support
This makes it easier to track issues resulting from missing ECDH
support.

Change-Id: Iab104beed8cc622ea7bec2275ed69ca4ffe4cc87
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-22 09:17:51 +00:00
Johan Hedberg
d43f4c27d0 Bluetooth: Remove conn & SMP dependency from BLUETOOTH_TINYCRYPT_ECC
Ever since we expose ECDH as a more generic API that's not bound to
SMP we shouldn't be requiring selcting SMP in the configuration for it
to be available. Move it outside of the BLUETOOTH_SMP and
BLUETOOTH_CONN dependencies.

Change-Id: I4ac15ff92b1d4fcf3061a487718d364aa7d43bc8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-22 09:17:42 +00:00
Arkadiusz Lichwa
65ab753fe7 Bluetooth: L2CAP: Fix debug message in l2cap_chan_destroy
Removes redundant parameter value to be printed.

Change-Id: Ib719135b4f99265312b3a08f051d35d10adb0bcf
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-07-22 09:00:09 +02:00
Inaky Perez-Gonzalez
3e63a74514 net/yaip: revert merge
Follow up to TSC decission for further discussion in the networking
WIG.

Change-Id: I148b484dfe308661573e47ed3e60cceed673bddf
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-07-22 04:43:09 +00:00
Kumar Gala
5249b8a52d Bluetooth: use sys_put_le16 macro instead of bswap
Use sys_put_le16 rather than having to explicitly have an ifdef
check in the code and use bswap_16.

Change-Id: Ia7b2b956c69993e29b1186da3d08e5eb449f096b
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-22 04:26:15 +00:00
Ramesh Thomas
1af3a40b9e power_mgmt: Add Deep Sleep support in sample PM app
Added changes to enhance device suspend/resume involving
core devices used by OS and app. Updated with Deep Sleep
power policy usage example. Moved the arch/soc dependent
code to soc/arch dependent areas in Zephyr in a separate
patch.  This app now uses api that abstracts the soc/arch
details in handling power states.

Jira: ZEP-511
Change-Id: I3b4eb0be973027dbf9bd046e16836f7863eee46e
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-07-21 11:25:31 -07:00
Ramesh Thomas
2ce3a59555 power_mgmt: Create arch/soc specific helper functions
Created set of functions that was designed in the original RFC to
contain arch and soc specific code.  This makes the interface to
the OS PM infrastructure cleaner and makes it easier to understand
the flow in the sample app. Also it makes code reuse easier across
soc/arch implementations.  These are open to change in future if
other means to achieve the same goals are in place.

Jira: ZEP-227 ZEP-225
Change-Id: Ief57871c370341c55009ad4f456b7f71f2c2a3c6
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-07-21 11:25:31 -07:00
Ramesh Thomas
53bc73a438 uart: qmsi: Adds device suspend/resume to uart_qmsi device
This adds some basic suspend/resume support in the uart_qmsi
driver. This is part of a change to enable device suspend/resume
and deep sleep support in sample PM application.

Jira: ZEP-512
Change-Id: I38cfbfb352d0027b7beaadebedbc10002dade50a
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-07-21 11:25:31 -07:00
Ramesh Thomas
1171348038 rtc: qmsi: Adds device suspend/resume to rtc_qmsi device
This adds some basic suspend/resume support in the rtc qmsi
driver. This is part of a change to enable device suspend/resume
and Deep Sleep support in sample application.

Jira: ZEP-512
Change-Id: I79ccfb56de5b3cbfb5bc91e9cacca68554aa46ee
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-07-21 11:25:31 -07:00
Ramesh Thomas
8f0fdb668a timer: Adds device suspend/resume to loapic timer
This is part of a change to enable device suspend/resume and
Deep Sleep support in applications. Adds suspend/resume handling
in loapic timer.

Jira: ZEP-512
Change-Id: I9da2c8419bd9109fb71ef5a6caf736de7c7de9e1
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-07-21 11:25:31 -07:00
Ramesh Thomas
02db5262b8 power_mgmt: Enhances the DEVICE_INIT_PM macros
Enhances the DEVICE_INIT_PM and SYS_INIT_PM macros so the drivers
can avoid #ifdef checks in C code.  This also prepares for future
merging of the different versions of these macros.

Change-Id: I2cc50686a2e2c6bdf675bff8b208f741231c2537
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-07-21 11:25:31 -07:00
Andrew Boie
56dded4435 qemu_nios2: run sanity checks with the emulator
Requires SDK 0.8.1

Change-Id: I2384508897bcd9f7a3d19962853f642c4ba815f4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-21 16:32:19 +00:00
Andrew Boie
eb63710960 REVERTME exclude test_sha256 on Nios2
Daily build failing due to this test case timing out
execution after 3 hours. Locally this test takes about
a minute, the issues with CI are being looked into.

Change-Id: I27e40846dde25fc65281b4aea61d10b403c6512d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-21 16:31:31 +00:00
Maureen Helm
1942a413fc net: tinydtls: Use assert.h from minimal libc
Now that minimal libc has assert.h, we can remove the workaround from
tinydtls.

Change-Id: I3bb001d1891f0b110b43133d30c262ba320450f7
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-07-21 16:22:20 +00:00
Murtaza Alexandru
0c83039a67 sensor: add driver for LPS25HB
Add driver for LPS25HB pressure and temperature sensor.

Datasheet:
http://www.st.com/content/ccc/resource/technical/document/datasheet/9a/4c/aa/72/1f/45/4e/24/DM00141379.pdf/files/DM00141379.pdf/jcr:content/translations/en.DM00141379.pdf

Change-Id: I6b616e879777b52f16f4e867c330e8beacf59fd3
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-07-21 16:22:03 +00:00
Johan Hedberg
cac17e858f misc/byteorder.h: Add helpers to get & put unaligned integers
These helpers provide a way to read and write data buffers containing
multi-byte integers with a specific endianness. They are particularly
convenient for network protocol encoding and decoding.

Change-Id: I09ad125a1bbc4510b97a1d75c83cb70d893e22e8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-21 16:19:27 +00:00
Johan Hedberg
55209323a1 misc/byteorder.h: Add documentation for existing APIs
Add doxygen documentation for existing documentation in byteorder.h.

Change-Id: I0de668e140eeb011807c31d47212f452ccd81627
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-21 16:19:26 +00:00
Jon Medhurst
93f49c20e9 samples: uart: Check return value from uart_fifo_fill
If the UART FIFO is already full at the start of the irq tests (e.g.
because the data from the previous polled mode test is still being
transmitted), then uart_fifo_fill() may not not be able to add the
requested character to the FIFO and so return zero.

Fix this issue by repeating retrying uart_fifo_fill() until success.

Change-Id: I055ca1d4c91d81488b89f2a9b00031b9f2b8b222
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2016-07-21 16:16:24 +00:00
Andre Guedes
02dc270d5e samples: Add Quark SE power management application
This patch adds a reference Power Management Application (PMA) for
Quark SE based platforms.

This application demostrates how to interact with the PM subsystem
and how to put the SoC in different power states. The application
"modus operandi" is very simple. The application keeps transiting
between all power states supported by Quark SE SoC. For now, C1,
C2 and C2LP CPU states are implemented. Upcoming patches will
add support for the remaining states (LPS and Sleep states).

Change-Id: Id81aadb8bf170fbb2ecfd9483ae250c786619e43
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-07-21 15:32:38 +00:00
Andrew Boie
eb53ebb885 x86: fix CONFIG_INIT_STACKS
The interrupt stack wasn't being initialized at boot.

Change-Id: Iec3e770d385643415641e15906c3a53f7c74a2e9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-21 15:04:55 +00:00