Commit graph

19237 commits

Author SHA1 Message Date
Kumar Gala
c6c858dbc5 em_starterkit: Remove nonexistant Kconfig sybmol from defconfig
CONFIG_UART_NS16550_ACCESS_MMIO doesn't exist anywhere so remove it from
the defconfig.

Change-Id: I221cbb4a9fe5c4ee567e994f2c617b50b1228d13
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-28 07:20:12 -05:00
Kumar Gala
68ddd164c2 galileo: Remove nonexistant Kconfig sybmol from defconfig
CONFIG_SPI_INTEL_LEVEL_LOW doesn't exist anywhere so remove it from the
defconfig.

Change-Id: I5241101a1b4b2f74aaac3a59721e65f71f88cdfd
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-28 12:19:30 +00:00
Kumar Gala
254836a716 gpio: nrf5: Fix Kconfig symbol issue
We don't currently have a SOC_NRF5 Kconfig symbol.  Utilize the
SOC_FAMILY_NRF5 Kconfig symbol instead.

Change-Id: I062ecab230e9e7814fad19517d28ddbbae66bccb
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-28 12:18:11 +00:00
Kumar Gala
3846811838 nrf52_pca10040: Remove empty board file
Use a kbuild trick to force built-in.o to get built even if there isn't
any code so we can link properly.  This is cleaner than keeping around
files that don't do anything.

We keep around board.h for now since drivers and other code might expect
it to exist.

Change-Id: Ia55a2614d3eea1920f1be7880be2bf82c6c3c7db
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-28 08:44:42 +00:00
Jesus Sanchez-Palencia
88c1b50703 arduino_101: Remove old quark_se_rom.bin
For Arduino 101, users must use the original ROM FW provided for this
board. For Quark SE development boards (!Arduino 101), users should use
the QMSI bootloader.

Here we remove the old ROM binary we were shipping with Zephyr as these
are now provided as part of QMSI releases on github.

The arduino_101_load.sh script was also updated to avoid trying this
step since the binary is no longer available.

Change-Id: I822a9d005355cb69177bb1a1d0ddef087ea07309
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
2016-07-28 08:43:48 +00:00
Baohong Liu
d215841808 samples: Add an app for MAX44009 light sensor
Add a sample app to read MAX44009 light sensor via i2c
of quark se sensor system.

Origin: Original

Change-Id: I7078b3383021cdc81ff7b59fd1958e6bf86fe988
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-07-27 18:03:34 -07:00
Andrew Boie
0529c931a0 sensors: fix incorrect use of __ASSERT
__ASSERT was being used when __ASSERT_NO_MSG was appropriate.
This problem was previously only visible if CONFIG_ASSERT=y,
but a recent change to the assert macros fixed them so they
can't be improperly used with assertions disabled either.

Change-Id: I1e13c796873d79826d177a01246d2ca0e8f0a107
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-27 16:56:08 -07:00
Sergio Rodriguez
950f45b532 samples/net : Adding mbedTLS self test routine
This contain the run of the self test for the ciphers, crypto
algorithms and utilities of mbedTLS.

Jira: ZEP-327
Jira: ZEP-340
Jira: ZEP-495

Origin: https://tls.mbed.org/download/start/mbedtls-2.3.0-apache.tgz

Change-Id: Ic1bb30b7ed691f17421510cd914ec5096e4e70ea
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2016-07-27 22:19:06 +00:00
Baohong Liu
0096a18d5e samples: Add DMA memory to memory transfer sample app
Add a sample app to show and test how the DMA memory
to memory transfer work.

Origin: Original

Change-Id: I0ff6790d9ba3e188cd2ad93d4c9a9c2405a84ac8
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-07-27 22:17:44 +00:00
Jithu Joseph
f271d7dd3e qmsi: rtc: Use locking to guard critical section
Guard critical section of the driver API, so that
multiple simultaneous calls from tasks/fibers wont
corrupt the driver state.

The locking mechanism is by default disabled in the
build. To enable it, the following flag needs to be defined:

CONFIG_RTC_QMSI_API_REENTRANCY

Jira: ZEP-412

Change-Id: I430ebc07bf3277e5a5961cb6278c5500cd1e139b
Signed-off-by: Jithu Joseph <jithu.joseph@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-27 22:17:20 +00:00
Jithu Joseph
3dd008e0c2 qmsi: wdt: improved reentrancy of the wdt driver
Uses locking in an API and removes a global variable
for improved safety/correctness in the face of concurrent
threads and fibers.

The locking mechanism is by default disabled in the
build. To enable it, the following flag needs to be defined:

CONFIG_WDT_QMSI_API_REENTRANCY

Jira: ZEP-440
Change-Id: Ibcd1501a4af628017b20d7e7ce20b988c8e4e4e2
Signed-off-by: Jithu Joseph <jithu.joseph@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-27 22:17:09 +00:00
Flavio Santes
e0d46124df build/crypto: Update build system for tinycrypt 2.0
Modify tinycrypt/Kconfig and tinycrypt/Makefile to include new CTR_PRNG
algorithm.

Jira: ZEP-590

Change-Id: Ied0288126c326d229508c05df4a256dea29cf740
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-07-27 21:34:14 +00:00
Flavio Santes
e6ffc0ed28 crypto: Update tinycrypt source files
Update Zephyr's tinycrypt to version 2.0. This new version adds support
for ECC_DH, ECC_DSA, CMAC, & CTR_PRNG.

The following doxygen documentation typos were detected and fixed:

- ctr_prng.h:84 change plen by pLen,
- ctr_prng.h:109 change entropylen by entropyLen,
- sha256.h:110 change Sha256 by s.

ecc_dh.h is also modified to fix the discrepancy of ecc_make_key
definition and declaration.
See https://gerrit.zephyrproject.org/r/#/c/1982/

TC_FAIL and TC_SUCCESS defines are renamed in this new version of
tinycrypt, so net/bluetooth/hci_core.c, net/bluetooth/hci_ecc.c and
net/bluetooth/smp.c are also updated to reflect those changes.

Origin: https://github.com/01org/tinycrypt/archive/v0.2.0.tar.gz

Jira: ZEP-590

Change-Id: I85f4f0ab61d9b0be6a60897e2b96f245dd8c51a8
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-07-27 21:33:42 +00:00
Iván Briano
a52f8dcbee uart qmsi: Fix definition of device_pm_ops
The macro defining the device_pm_ops structs is located inside an
ifdef for CONFIG_UART_QMSI_0, so when the UART_0 is disabled at build
time, but UART_1 is still used, it references a struct not defined.

Fix it by placing the DEFINE_DEVICE_PM_OPS line outside the ifdef block.

Change-Id: I7dafda162741201ee47b5b480c07ec8c1f373d64
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-07-27 21:11:30 +00:00
Juro Bystricky
f25ac092b9 Makefile: Restructure for multilibs
Several Zephyr SDK toolchains support multilibs.
Instead of hard-coding locations of the libraries, the proper/cleanest way
is to query the GCC compiler for the locations of libgcc and libc.
However, in order to do this, we need to ensure a certain order of
initialization in the Makefile:

1. Determine CROSS_COMPILE.
   We cannot determine LIB_INCLUDE_DIR, TOOLCHAIN_CFLAGS yet, as we don't
   know the KBUILD_CFLAGS yet.

2. Calculate KBUILD_CFLAGS using CROSS_COMPILE
   KBUILD_CFLAGS often need the compiler to validate options, i.e:
   KBUILD_CFLAGS += $(call cc-option,-mabi=aapcs -mthumb -mcpu=cortex-m0)
   However,  LIB_INCLUDE_DIR, TOOLCHAIN_CFLAGS should not be needed for this

3. Finally, using CROSS_COMPILE and KBUILD_CFLAGS determine LIB_INCLUDE_DIR,
   TOOLCHAIN_CFLAGS by querying GCC using -print-libgcc-file-name and
   -print-multi-directory command line options.

This change should only affect Zephyr SDK toolchains, all other toolchains
are expected to function as before.

Change-Id: I27b460d46fe65d05fcb8bafb51cd6b3deba275ed
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-27 17:15:56 +00:00
Johan Hedberg
9915378e8c Bluetooth: Take advantage of ATOMIC_DEFINE atomic_t based flags
Using ATOMIC_DEFINE removes the risk of the number of flags growing
past 32 and thereby causing an overflow of the flags variable.

Change-Id: Id3679a5a1b567b2681bc5bbd6384ed88478a32d6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-27 17:14:59 +00:00
Kumar Gala
453b177435 arc: Remove nonexistant Kconfig sybmol from defconfig
CONFIG_SOC_GENERIC_ARC doesn't exist so remove it.

Change-Id: Idecfd27684b5fd83b7b296daa46a1a21a0ae4d95
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-27 17:14:54 +00:00
Kumar Gala
4eef8a3f32 qemu_cortex_m3: Remove nonexistent UART_CONSOLE_BAUDRATE from defconfig
CONFIG_UART_CONSOLE_BAUDRATE doesn't exist and we will get the buad rate
setup from the UART_STELLARIS config defaulting to 115200

Change-Id: I268051055689134c54c92f696a9a560ca5336844
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-27 17:14:50 +00:00
Kumar Gala
d42b239c31 qemu_nios2: Fix defconfig Kconfig symbol
Use Kconfig symbol CONFIG_SOC_NIOS2_QEMU instead of CONFIG_SOC_NIOS2F_QEMU

Change-Id: Ia04666830dc9d6f64467fae103418920c202af27
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-27 17:14:46 +00:00
Johan Hedberg
ecd421590c misc/byteorder.h: Mark bswap_16 & bswap_32 as internal helpers
These shouldn't be exported in the official doxygen documentation
since they should only be used through the other conversion APIs.

Change-Id: I75880b42892cbfce769192ec2e8c296c954979bd
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-27 17:09:52 +00:00
David B. Kinder
36585d7811 doc: remove unused figures from board directory
Board documentation was moved to wiki.zephyrproject.org and documents with
links to the corresponding wiki article left in their place.  This fix
cleans up the figures (.png files) that were left behind and are no longer
needed here.

Change-Id: I9056046fd7c9307de750360e20d8f970ee7ae3b9
Jira: ZEP-564
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2016-07-27 16:27:06 +00:00
Ricardo Salveti
180a0ee948 drivers: reverting Kconfig/Makefile changes for slip
The slip driver revert (3e63a74) was incomplete, missing the Kconfig and
Makefile changes, causing 'make clean' to fail.

Change-Id: I9d944148e6be3756b62d2371a5ab5528365e1ec1
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2016-07-27 16:26:51 +00:00
Kumar Gala
62ca7ef1fc samples/net: Fix typo in comment
Fix comment that had CONFIG_MICROKERNE should be CONFIG_MICROKERNEL

Change-Id: Ic7ad63350abe92e9f1b84f4de0d6d3bb1b43dc77
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-27 16:20:55 +00:00
Andrew Boie
d9a84c5c77 Makefile: link arch/ last
The IRQ implementations of ARC, ARM, and Nios II use .gnu.linkonce
sections for declaring entires in the sw_isr_table array. It's
imperative that arch/built-in.o be linked after everything else
as we want custom interrupt handlers to take precedence over the
default spurious interrupt handlers.

Currently, any interrupt handlers defined in ext/ or usb/ will not
be installed properly on the above mentioned arches.

Change-Id: Ib3fb21ff1ef114678906f130c268c266535954f1
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-27 15:48:23 +00:00
Juro Bystricky
19d84d8e00 nano_init.c: STACK_CANARY_INIT fix for ARC
An updated version of ARC GCC reports this error:
nano_init.c:340: Error: inappropriate arguments for opcode 'mov'

The offending in-line assembly code tried to move register value into a
memory location.

Use store "st" instruction instead of "mov" istruction to store
a value in memory.

Change-Id: I91ebd20495612da4d5639a3ef848379705f6dedd
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2016-07-27 15:23:15 +00:00
Flavio Santes
a3c0b2c00f samples/net: Add netz_client sample code
This sample code demostrates how to use the netz API. A basic
IPv4/TCP/UDP client application is provided.

The README file describes the basic setup.

Origin: Original

Jira: ZEP-567
Change-Id: I1c7d2454336dc00747044c5fc330f9ab6457ecf1
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-07-27 14:45:32 +00:00
Baohong Liu
db17939c8a drivers: i2c: remove i2c master idle check
The idle status check before a i2c transfer is not a reliable
way to check whether i2c master is ready to transfer data. If
the data transfer for the previous API call is done, but, a
stop condition is not sent by the previous API, the i2c master
is not idle, but, it can start new data transfer.

Change-Id: I93dbf46cef6272f3da69a0d67fb737c9b480791f
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-07-27 14:44:54 +00:00
Johan Hedberg
a95b6eeafb nano_work: Fix never yielding from fiber
If the delayed work FIFO never goes empty (e.g. because the work
callback keeps resubmitting or there's a very active ISR feeding items
there) then the fiber would never yield, causing all sorts of problems
for the system. Adding an explicit fiber_yield() call at the end of
the while-loop solves the issue.

Change-Id: I233b9fc18fc9db9172daf8689bd22d09952089cb
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-27 14:44:13 +00:00
Andrew Boie
213a2dcac9 atomic.h: change to ATOMIC_DEFINE
Based on review comments for previous patch at
https://gerrit.zephyrproject.org/r/3392.

The macro changed to ATOMIC_DEFINE since it reserves storage
and doesn't just announce its existence.

Change-Id: Ib6c2b76a219040694926823b94daf6fe779a05d0
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-27 14:42:44 +00:00
Andrew Boie
0d03e32036 gen_idt: add -d switch for extra debug info
Previously, gen_idt's code had to be modified to get this information.
We now print it by default when building with V=1

Change-Id: I31bd6c5b851d6280ebcedaab97bd02b8331a2f24
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-27 14:42:27 +00:00
Luiz Augusto von Dentz
5194d2fb06 Bluetooth: GATT: Remove unused struct
prepare_write_data is no longer need since the ATT layer is now
responsible to queue the prepare writes using regular writes to commit
the data instead.

Change-Id: I8e35307a0489505b1475cdf31773c65a51165539
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-07-27 15:28:38 +03:00
Kuo-Lang Tseng
7e71e5eecc MAINTAINERS: add mbedTLS section
Change-Id: If6ec848d7771e25927ea9a01161e375289bdf49e
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2016-07-27 00:22:18 +00:00
Sergio Rodriguez
312def2c78 ext/lib : Integrating mbedTLS to build process
Integrating the mbedTLS to the the build proccess with the minimal
Thread configuration.

Change-Id: I0ae191434d26890537a29a247c409228180410f3
Jira: ZEP-327
Jira: ZEP-340
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-07-26 16:00:04 -07:00
Sergio Rodriguez
96c69cc29f ext/lib : mbedTLS Configuration modifications
Adding the mbedTLS configuration neede for Thread Network Protocol
support, this shows the modifications needed to be able to compile
on Zephyr

Jira: ZEP-327
Jira: ZEP-340

Change-Id: I80a8f44bc302905b7aa4568a40a6ca66dcaf42f8
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-07-26 22:48:18 +00:00
Sergio Rodriguez
aca6e99106 ext/lib : mbedTLS library modifications
Porting the mbedTLS library with the minimal Thread supported
configuration, this is a TLS/SSL library highly customizable.
This show the modifications needed to be able to compile on
Zephyr build enviroment which does not have a time.h header file,
so we avoid compilation errors.

Jira: ZEP-327
Jira: ZEP-340

Change-Id: I197ea96d33748c986c71fe5a0608225aee69c8b3
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-07-26 22:47:59 +00:00
Sergio Rodriguez
8485f601cb ext/lib : Adding mbedTLS library
Adding the pristine version of mbed TLS to the zephyr source tree
as the initial step of porting the mbed TLS library to Zephyr

Jira: ZEP-327
Jira: ZEP-340

Origin: https://tls.mbed.org/download/start/mbedtls-2.3.0-apache.tgz

Change-Id: Iae814560310ebd00af52c7b1fb9d03195388fa0c
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2016-07-26 11:17:58 -07:00
Kuo-Lang Tseng
416f0759aa samples: aon counter: Remove outdated information in readme file
QMSI builtin source is already in zephyr build so update the
readme file.

Jira: ZEP-554

Change-Id: Ief525d94ad71fb94e01eec1eb43c10ca91825c35
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2016-07-26 17:50:35 +00:00
Johan Hedberg
a6d42751a3 atomic: Add helper to declare atomic_t arrays for bit fields
The atomic_t API supports arbitrary sized bit fields which are not
limited to a single atomic_t variable. This patch introduces a macro
to help declare right-sized atomic_t arrays given the number of bits
needed.

Change-Id: I226f6312b642551fc492df29d24764222f45ac83
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-26 15:31:09 +00:00
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