Commit graph

41120 commits

Author SHA1 Message Date
Arkadiusz Lichwa
b2647d84b3 Bluetooth: L2CAP: Refactor l2cap core types
Refactors L2CAP core data structures and modifies functions that uses them.
Now we can have separate L2CAP feature channel objects for LE and BR/EDR
transport. This's also a ground for make L2CAP CoC API to be common
for both transports.

Change-Id: Ic1197b0e3c4f505764b23fb9c7eb27123a44a675
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-06-13 11:49:07 +00:00
Arkadiusz Lichwa
9b0dc3c33f Bluetooth: L2CAP: Fix reject command params on BR/EDR
The reject command can contain optional data that depends on reject
reason.

Change-Id: I3c1967f39f52a798a720c700c9d12c2877c837dd
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-06-13 13:13:57 +02:00
Johan Hedberg
bd066867e4 Revert "Bluetooth: Remove LE Rand workaround for mynewt firmware"
The current documentation points to MyNewt 0.9 which doesn't have the
necessary fix, so revert the workaround until the next release of
MyNewt is out. A minor change to the original patch is that we also
have a delay in prng_init() which seems to be needed since this is now
called earlier during the HCI init sequence.

This reverts commit d75acb44c3.

Change-Id: Ic4919e01bddbfaca477825c3f7fdcb549c8d10ec
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-13 11:13:18 +03:00
Johan Hedberg
f7ae091ade Bluetooth: Allow NRPA usage when connections are not supported
Currently CONFIG_BLUETOOTH_PRIVACY is defined as the ability to
generate RPAs, and it depends on CONFIG_BLUETOOTH_SMP. NRPA usage
however may be desirable even without these features (e.g. a
broadcaster-only device). Furthermore, if we are using RPA based
privacy we should be using that instead of NRPA even when doing
non-connectable advertising.

This patch leaves out the option of advertising with the Identity
Address when non-connectable, however if we get a use case for that we
could consider adding a BT_LE_ADV_OPT_ID_ADDR to force using it.

Change-Id: I0502323aec15eefad1a729c393c707108d4cf758
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-13 07:42:34 +00:00
Javier B Perez
8ef056f6be MAINTAINER: add maintainer component and reviewers
Added maintainer component for MAINTAINER file.

Change-Id: I083f0ed966fb5ad2a52bdf03f459a3cab0c0cdde
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-06-10 19:32:20 +00:00
Javier B Perez
f995efb29f MAINTAINER: updated Nordic MDK and Tinycypt maintainers files
Nordic MDK and Tinycrypt maintainer are in charge of all the files
inside the directory not just the directory itself.

Change-Id: I898bdfb4eda6d90c49434e6fc6e7d2fe9b4b8eab
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-06-10 19:17:54 +00:00
Chuck Jordan
2fb4155a18 doc: removing unicode trade mark chars
The unicode characters for trade mark and register trademark,
although understood by the Atom editor, apparently don't work
here. :-(

Change-Id: Ifbdb25a015630fc90afb18aec6f07a8724fc37f7
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-06-10 18:52:59 +00:00
Maureen Helm
2815687186 nxp_kinetis: Add Kconfig options to select the SoC part number
The KSDK device header files require a preprocessor macro that defines
the part number string (e.g., MK64FN1M0VMD12). Create a hidden Kconfig
option to hold the part number string, and hidden Kconfig options that
the board Kconfig will use to select the specific part number.

Change-Id: I612e785026261e425b47b5b7fae0c65b4f94b30b
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-06-10 12:17:57 -05:00
Andrew Boie
00365c188c nios2: Kconfig: remove some unused config options
We get these out of system.h instead. A clause in libc-hooks.c
for newlib added since we don't get RAM size from
CONFIG_SRAM_BASE_ADDRESS.

Change-Id: Ic35113395b951f625e8e29658afe19c525037964
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-10 15:22:42 +00:00
Andrew Boie
c6d560d198 sanitycheck: build for altera_max10 board
Change-Id: I28084082dcf0401fbafc54bb514aa3cacf7ab8e8
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-10 15:22:42 +00:00
Andrew Boie
3b9302158c nios2: set up common linker script for XIP and non-XIP
We will require 6 variables to be defined by SOC-specific
linker script; these values in turn can be pulled from
defines in layout.h.

To help position code correctly we define two new ELF sections
for this arch, 'reset' and 'exceptions'.

Change-Id: Idffbd53895945b7d0ec0aac281e5bf7c85b4b2c2
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-10 15:22:41 +00:00
Andrew Boie
dca76617f0 nios2: implement irq_enable() and irq_disable()
Change-Id: I98fee2df9cb8a7aa9769863238980d043903d436
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-10 15:22:41 +00:00
Andrew Boie
01724d319d nios2.h: cleanup API
This header was pulled in verbatim from Altera HAL and had
some style and naming issues. The inline functions or macros
which read registers can now be used in expressions.

Change-Id: I7a463717051efd2f9dd36e8a84d357852fbf9215
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-10 15:22:41 +00:00
Andrew Boie
45cff183a2 nios2: implement nano_cpu_idle and nano_cpu_atomic_idle
Nios II does not have a power saving instruction, so there is nothing
to really do here other than ensure that interrupts are in the correct
state when leaving nano_cpu_atomic_idle().

Change-Id: I664c7542dc2fc1795a453d35e183a737dcb20c38
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-10 15:22:41 +00:00
Andrew Boie
9280e71ea4 nios2: add flashing/debug scripts
For the moment, NIOS2_CPU_SOF must be set with the path to the
CPU configuration. We are checking with Altera on whether we
can directly check in the binary to the source tree.

These scripts depend on tools provided by the Altera Quartus
Prime Lite Edition. This is available for free but requires
registration on Altera's website to obtain.

Change-Id: Ia6cb6c9e43c3e141807a887cb25c47b370a7d8e9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-10 15:22:40 +00:00
Andrew Boie
fe6f178a3b nios2: generate kernel image in Intel HEX format
Altera tools for creating .pof files for flashing onto their
FPGAs require UFM data to be in this special format. Extend
the current 'all' and 'zephyr' targets to additionally create
this .hex file using objcopy, with the same exclusions as the
existing rule for .bin files.

Change-Id: I75293fba47536545359f817a1f2c1ae905b9d25c
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-10 15:22:40 +00:00
Andrew Boie
31e8030c05 nios2: set initial stack pointer to the interrupt stack
Change-Id: I5a71215dde9e7fdc7d5d9de5297f5f493de40ca8
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-10 15:22:39 +00:00
Andrew Boie
191f1df574 nios2: crt0: split into __start and __text_start
__start is the CPU's reset vector. In a typical Nios II configuration,
the exception vector is 0x20 bytes after the reset vector, severely
constraining the amount of code that can go in here.

Split this into __start and __text_start. The only thing that __start
really need to do is init the instruction cache and jump into
__text_start.

JIRA IDs placed in comments for missing items.

Change-Id: I3c6b8ed65e8fcf6b6a735b80cf007d0180599230
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-10 15:22:39 +00:00
Andrew Boie
e57f3446ac nios2: add arch/nios2/soc/<soc>/include to linker include path
Linker scripts for Nios II will also need these headers as it
specifies the device's physical layout and various important
vector addresses.

Change-Id: Ie9efaf19e53d2493eed7b9783052393d7ea9dd0f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-10 15:22:39 +00:00
Fabrice Olivero
275a853c16 samples/task_profiler: modifications to ease integration
- Few clarifications in README
- addition of prof_flush() in profiler.h
- renamed shell "commands" variable (too generic)

Change-Id: I1bcf1867c15774a84ba24c19546e5ddafb2233a2
Signed-off-by: Fabrice Olivero <fabrice.olivero@intel.com>
2016-06-10 15:16:16 +00:00
Johan Hedberg
ebd5011adf Bluetooth: Update Intel copyright for files modified in 2016
Change-Id: I10a7cab9a7f911b9f64e17bf24ddce82c2f08c40
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-10 12:10:53 +03:00
Kumar Gala
52c987e941 toolchain.gccarmemb: Add include path for newlib headers
We need to expose the path to the newlib headers that are part of the
ARM embedded gcc at ${GCCARMEMB_TOOLCHAIN_PATH}/arm-none-eabi/include
otherwise we get build errors like when trying to use newlib:

lib/libc/newlib/libc-hooks.c:17:19: fatal error: errno.h: No such file or directory

Change-Id: Iedce526d23e54e54b9cefdfa6ca176fe12ed8090
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-06-09 16:22:28 +00:00
Kumar Gala
7fdd4f758d newlib: Support both namespace protected & nonprotected stubs
Some variants of newlib build and expect namespace protected stubs
(typically having an underscore prefix).  To support such newlib variants
change all the stubs to the namespace protect version and use function
aliases to support the nonprotected namespace version.

Change-Id: I6a4162eca949afec96b152ffe6f60b87c4496c4d
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-06-09 16:22:28 +00:00
Kumar Gala
ab5614ed9e newlib: Drop _fstat implementation
We only need to implement fstat(), so drop the _fstat implementation and
have fstat() match the newlib docs for minimal implementation and only
set st_mode = S_IFCHR.

Change-Id: Iba9042707d1ee5975ab98293cfe20e2996b17c05
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-06-09 16:22:27 +00:00
Bogdan Davidoaia
44ef3c182b i2c: qmsi: remove duplicate I2C_QMSI_SS Kconfig option
Remove duplicate I2C_QMSI_SS option from Kconfig file, as there is no
reason to have it twice.

Change-Id: I602677676419c3f9581a606e8e3ebb889b439eb7
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-06-09 12:26:38 +03:00
Ravi kumar Veeramally
5d98ba37f6 net: apps: Fix ip buf application data length
ip_buf_appdatalen is not set while sending buffer.

Fixes: RTOS-1562

Change-Id: Id423ba5898b9b405d0ca027a74a06a19708841fe
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-06-09 08:53:16 +00:00
Johan Hedberg
c78a5a9aae net: tests: Clean up logging of net_buf tests
Change-Id: I8f82c586c730691c72f8996a25843ba786c73fe6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-09 10:26:38 +03:00
Johan Hedberg
bab34ea49c net: tests: Add task-fiber test for net_buf_get/put
Change-Id: I48c050254fca913c59bfbfd9a160c7d6ca79d53b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-09 10:26:38 +03:00
Chuck Jordan
f43d8ef444 doc: unicode trademark and regsiter trademark
Improve this doc to use register trademark and trademark unicode
symbols.

Further, the make rules can benefit from also being passed the argument
ARCH=arc. I see that some zephyr tests use ARCH to select a prj.conf file.

Change-Id: I0650e5d5aba10aa984ebd0be21d0b381dd96dd56
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-06-09 02:52:53 +00:00
Johan Hedberg
1c440f4008 MAINTAINERS: Add web pages for Networking and Bluetooth
Change-Id: I5177609303b658a74ce7b5cff3fd46f644b298f8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-09 00:51:31 +00:00
Johan Hedberg
a302340593 MAINTAINERS: Add NETWORKING and NETWORK BUFFERS sections
Change-Id: I1a31671fc8e9384504b64ad712064e38a646edcc
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-09 00:51:13 +00:00
Chuck Jordan
db6adc6d2e int: Set default ARC interrupts to lowest priority to start
The code was setting the interrupt priority to 1 for each
vector to start. But I think it might be more appropriate
to set it to the LOWEST priority. Some ARCs will have
upwards to 15 priorities.

Change-Id: I9330ec8df323fe04ba0751faaafa39694f012364
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-06-09 00:34:03 +00:00
Roger Lendenmann
a96e8bb615 Bluetooth: GATT: Fix ccc cfg clear logic on disconnect
The ccc config clear logic should only clear its own cfg value if it is not
bonded and not the other ones.

Change-Id: I1b053b714744bdfb61fdbb445c08dffd3c9e1a1f
Signed-off-by: Roger Lendenmann <roger.lendenmann@intel.com>
2016-06-08 15:19:37 +02:00
Szymon Janc
d75acb44c3 Bluetooth: Remove LE Rand workaround for mynewt firmware
Latest firmware seems to have this fixed and delay is no longer needed.

Change-Id: I3caa8d38fc856964b57049d6704c80ca732ccde5
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-06-08 10:23:22 +02:00
Szymon Janc
6d3ddef1d0 Bluetooth: Fix using uninitialized PRNG
PRNG needs to be initialized right at the begining so that it is safe
to use it from initialization sequence. This fix a race when ECC
emulation code was using uninitiliazed PRNG for public key generation.

Change-Id: Ia396f964b915368cee39ea6be998ef5774062591
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-06-08 10:23:22 +02:00
Szymon Janc
c6fdf09340 Bluetooth: Fix notifying about cancelled connection attempt
If LE Create Connection was cancelled LE Connection Complete event
status is set to Unknown Connection Identifier and doesn't contain
valid remote address. In such case we need to look for connection
object in CONNECT state without using address. There can be only one
object in that state anyway so this is OK also for other error codes.

Change-Id: Ie61d47b8bb7ade6b2ab4db14ee394a65bb4e642b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-06-08 10:23:21 +02:00
Szymon Janc
609843a527 Bluetooth: Fix comment for bt_conn_lookup_state_le
NULL peer means that first connection with specific state should be
returned.

Change-Id: Ia635584437f948d9dcd82a3619fcf1516d23e0d1
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-06-08 10:23:21 +02:00
Szymon Janc
c443888f3d Bluetooth: Simplify bt_hci_connect_le_cancel
There is no need for local variabel as error code can be returned
directly.

Change-Id: I0ad1bccb75bf1897d210c12d3ad0108f1f909dbe
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-06-08 10:23:21 +02:00
Roger Lendenmann
ee2dfbdcf0 Bluetooth: GATT: Handle ccc cfg values correctly on disconnect
* clear non-bonded ccc cfg values as per BT spec
 * address compare logic
 * check if cfg_changed is defined

Change-Id: Id002f22a6aac1b918d743ef1e73b7e5c4768a229
Signed-off-by: Roger Lendenmann <roger.lendenmann@intel.com>
2016-06-08 06:08:19 +00:00
Johan Hedberg
b76426de6f Bluetooth: Fix never yielding if rx_queue always contains data
It's common for the rx_queue to be written to in ISR context (by the
HCI driver). This means that if there's lots of data coming in from
the driver the rx_queue might get empty very rarely. With the current
code this means that the rx fiber might end up not yielding to other
higher priority runnable fibers for long durations (as long as there's
data in the rx_queue).

To solve the issue, call fiber_yield() explicitly after each processed
buffer from the rx_queue. This way we give other fibers a chance to
run even if there's a heavy flow of data from the Bluetooth
controller.

Change-Id: Ib3dbe6536a62360ad5153ed12eee8489645e4109
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-07 21:38:20 +03:00
Johan Hedberg
9edc472c3e doc: boards/arduino_101: Update BLE firmare for latest MyNewt version
The dependencies for the HCI firmware are now part of the latest
stable MyNewt release, so special editing of project.yml is no longer
needed.

Change-Id: Ia3658ab1da03e208cd5230e0cda4c96a4628e8f0
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-07 05:39:16 +00:00
Szymon Janc
6248407c00 Bluetooth: shell: Fix data_pool declaration
Buffers pass to BT stack need to have minimum BT_BUF_USER_DATA_MIN
of reserved user space data.

Change-Id: Iaeb85faa20b1c5281bfd0331336295ad7cfdd68e
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-06-06 19:09:59 +02:00
Szymon Janc
0bae6e8354 Bluetooth: L2CAP: Include <bluetooth/buf.h>
This header defines BT_BUF_USER_DATA_MIN which is needed for declaring
buffers passed to BT stack and already includes <net/buf.h>.

Change-Id: I6b556be9fb3939a55af0b73d49fc59152d6d6a53
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-06-06 19:03:14 +02:00
Luiz Augusto von Dentz
f54c5b744d Bluetooth: GATT: Remove obsolete flush callback
It is no longer necessary to implement flush callback for long
descriptors since the stack can queue prepare writes this callback
will never be called which makes BT_GATT_LONG_DESCRIPTOR obsolete
as well.

Change-Id: Idca31ba8e4404d2acba760c420394d5adee0a508
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-06-06 12:29:02 +00:00
Luiz Augusto von Dentz
56419a135b drivers/nble: Add buffer pool for prepare writes
This is similar to previous patch which makes the API much more simple
when handling long writes.

Change-Id: Ibd3856863a43927195e23936872a160d5ff94648
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-06-06 12:28:35 +00:00
Luiz Augusto von Dentz
d7e0294227 Bluetooth: ATT: Add incoming buffer pool
This adds a buffer for incoming prepare writes which can be
tunned using BLUETOOTH_ATT_PREPARE_COUNT, these buffers are then used in
execute write to commit the data thus making flush callback obsolete:

[bt] [DBG] bt_att_recv: (0x001159c0)Received ATT code 0x16 len 50
[bt] [DBG] att_prepare_write_req: (0x001159c0)handle 0x0022 offset 0
[bt] [DBG] prep_write_cb: (0x001159c0)handle 0x0022 offset 0
[bt] [DBG] bt_att_recv: (0x001159c0)Received ATT code 0x16 len 34
[bt] [DBG] att_prepare_write_req: (0x001159c0)handle 0x0022 offset 45
[bt] [DBG] prep_write_cb: (0x001159c0)handle 0x0022 offset 45
[bt] [DBG] bt_att_recv: (0x001159c0)Received ATT code 0x18 len 2
[bt] [DBG] att_exec_write_req: (0x001159c0)flags 0x01
[bt] [DBG] write_cb: (0x001159c0)handle 0x0022 offset 0
[bt] [DBG] write_cb: (0x001159c0)handle 0x0022 offset 45

Change-Id: Iae071d7b4b5b042285952da57e3f7a853cf58afb
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-06-06 12:28:11 +00:00
Johan Hedberg
3f4631aeb9 Bluetooth: Kconfig: Reorder Bluetooth options behind single switch
This way we split all Bluetooth options behind a single switch.

Change-Id: Ia7a4b22842be4c0bf94bb73a6b39fd9f606db406
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-06 13:20:37 +03:00
Johan Hedberg
6d93cbb627 net: tests: Refactor net_buf tests for easier extensibility
Change-Id: I23380b1c78b5a9c8814c037a2d48b3505c99f6ea
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-06 11:22:23 +03:00
Johan Hedberg
7029d6ed62 net: tests: Remove unnecessary microkernel ifdef for mainloop
Change-Id: Ifbf41aeece7f889eb8f4e836c59df5e830882942
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-06 11:22:23 +03:00
Szymon Janc
8fc854029a Bluetooth: L2CAP: Fix reject command
Command reject may contain optional data depending on reject reason.

Change-Id: I0665f44e2adfbf03daa1625519530cabe247631e
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-06-06 08:21:06 +00:00