Commit graph

19237 commits

Author SHA1 Message Date
Szymon Janc
017586707e Bluetooth: Set BR/EDR device name on init
This adds support for setting default BR/EDR name on init. For now
this is just static configuration but can be extended later on
to allow runtime configuration if requested.

< HCI Command: Write Local Name (0x03|0x0013) plen 248
        Name: Zephyr
> HCI Event: Command Complete (0x0e) plen 4
      Write Local Name (0x03|0x0013) ncmd 1
        Status: Success (0x00)

Change-Id: I59ecfc2be8e55c6f90cdb0f12c6fed7f7ce976f8
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-07 08:17:26 +03:00
Jaganath Kanakkassery
7859ffeab0 Bluetooth: RFCOMM: Implement Register Server channel API
Profiles can use this API to register the RFCOMM server channel.
DLC structure which represents individual connnection on a particular
server channel has to be defined in the profile and provide it in
accept callback.

Change-Id: I14e607ca65a29f29389deb2ac5d0658f5cd92883
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2016-09-07 08:17:26 +03:00
Jaganath Kanakkassery
b4aa810f0c Bluetooth: RFCOMM: Initialize and register to L2CAP
Initialize RFCOMM layer and register PSM to L2CAP. RFCOMM session
which represents the signalling context is also defined. Only one
signalling context will be there per ACL connection and hence l2cap
chan object is embedded into session.

Change-Id: I9b0931b51753571f5da40c76f4b8a7d5f93546fb
Origin: Original
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2016-09-07 08:17:26 +03:00
Johan Hedberg
71680a6053 Bluetooth: Fix race condition when initializing ECC FIFO
First access to the ecc_queue may happen either from an application
task (calling bt_enable()) or from the internal ECC task. Since we
don't have control of this we need to do conditional initialization of
the FIFO.

Change-Id: I5c96782ec7a6f829da0fe15e13817934319381df
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-09-07 08:17:26 +03:00
Jaganath Kanakkassery
2f13527766 Bluetooth: L2CAP: Implement bt_l2cap_br_chan_send()
Sends the packet to HCI using bt_l2cap_send()

Change-Id: Iaec86ddc53adc632b597237a248acbd2e61fe4f6
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2016-09-07 08:17:26 +03:00
Vinayak Chettimada
8704406a84 Bluetooth: Fix race condition between ecc_send and ecc_task
Move initialization of ecc_queue from ecc_task into bt_hci_ecc_init,
so that calling ecc_send before ecc_task has no race condition and is
safe.

Change-Id: I775a1de3c5b6f56ae4ae37baa948ef19da6cee55
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2016-09-07 08:17:26 +03:00
Szymon Janc
3be711b17a Bluetooth: L2CAP: Make bt_l2cap_br_fixed_chan_register global
This will be used to register additional (ie SMP) BR/EDR fixed
channels and must be available for other modules.

Change-Id: Ie5d8ff5ccb6805379d6773254f4107434edaa076
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-07 08:17:26 +03:00
Szymon Janc
52d5966ac7 Bluetooth: L2CAP: Use BIT macro for supported BR/EDR fixed channels
There is no need for using extra mask define as BIT macro results in
better readability.

Change-Id: I95ac03f43274bfa5c571a6bfbc49a93513465bdf
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-07 08:17:26 +03:00
Szymon Janc
cfb396955a Bluetooth: L2CAP: Remove mask from struct bt_l2cap_fixed_chan
There is no need to keep this info per channel. Information response
use fixed value so those were not used anyway.

Change-Id: I2e5d394f25075be12062394e4d9f2db4f133a796
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-07 08:17:26 +03:00
Szymon Janc
c10d6156d6 Bluetooth: Fail on init if BR/EDR is enabled but not supported
For now if BR/EDR support is enabled we require chip to support it.
This is due to rest of the BR/EDR code doesn't do runtime check but
just assumes BR/EDR is there.

Change-Id: I26124a7f1a06cd65800c0b1b17842eb4a4ffb6cb
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-07 08:17:26 +03:00
Szymon Janc
945fbfe52b Bluetooth: SMP: Add self test for H6 function
This adds self test for H6 key derivation function based on sample data
from Core Specification Vol 3. Part H. Appendix D. D6.

Change-Id: I73eed5bfc6604bee0d1e81a23895f54ca6904807
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-07 08:17:26 +03:00
Szymon Janc
d3bd10dda1 Bluetooth: SMP: Add support for Link Key derivation
This allows to derive BR/EDR Link Key from LE SC LTK so no further
BR/EDR pairing is needed to encrypt BR/EDR link with key as strong
as LTK.

Change-Id: Ie28e9ec7a250189b122f1bce291fa9468a758614
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-07 08:17:26 +03:00
Luiz Augusto von Dentz
e2b5be9087 Bluetooth: eddystone: Add timeout to deactivate configuration mode
This adds a timeout to switch from configuration mode to beacon mode
following the recommended behavior from the spec:

  The connectable timeout should be at the very least 30 seconds to let
  enough time to user to start a configuration application.

Change-Id: I8f262c447ed1622e377fd7a05dde78c7b6b0560d
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-09-07 08:17:26 +03:00
Szymon Janc
66f523bf2e Bluetooth: SMP: Refactor keys distribution bitfields
This is in preparation for adding Link Key distirbution bit which
depends on BR/EDR support.

Change-Id: I156dcae1c3488cc7fc5cc3514a048affa89f449b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-07 08:17:26 +03:00
Johan Hedberg
bf098dff6d Bluetooth: monitor: Fix condition for disabling UART interrupts
If interrupt-driven UARTs are not use it makes no sense to try to
disable interrupts (in fact the build will fail).

Change-Id: Ib1e020895ced08183719a4cedd703d87e922b067
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-09-07 08:17:26 +03:00
Vinayak Chettimada
ad0e041e3d soc: Use nrf.h instead of nrf52.h and nrf52_bitfields.h
Since nrf.h abstracts the differences between the nRF51 and nRF52
architectures and chooses the right headers to include, it is
safer to use that instead of directly including the soc-specific
headers.

Jira: ZEP-702

Change-Id: I0e1758ede48f3422a41d226b0eab008e4ba2c77c
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-09-07 08:17:26 +03:00
Szymon Janc
28e47f60a4 Bluetooth: SMP: Add helper for notifying pairing complete
This will allow to have a single place where actions on pairing
complete would be called.

Change-Id: I7d097111e9643e98a168b6acf8d88ebb92b484a0
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-07 08:17:26 +03:00
Arkadiusz Lichwa
5287f4c49a Bluetooth: L2CAP: Add RTX timer for 'disconnect' command
Gets armed disconnect channel command on BR/EDR transport with RTX timer.
There's no need to implcitly cancel the timer in the response
since it's always called by channel 'destroy' handler indirectly.

Change-Id: I6e0a777be670f49a517b1145b2e012831214c539
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-09-07 08:17:26 +03:00
Arkadiusz Lichwa
06972f42be Bluetooth: L2CAP: Add RTX timer for 'configuration' command
Starts RTX timer when local host initiates configuration request
contract. Releases the timer when gets the response.

Change-Id: Ieb63fbce39542a5e7fad7792d8b5f1bd7d4e96a3
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-09-07 08:17:26 +03:00
Arkadiusz Lichwa
5f15f50d29 Bluetooth: L2CAP: Add RTX timer for 'get info' command
Starts the timer when 'get info' command was issued followed by
connection is made and stops it when gets back the response with no
timeout in the middle. Such pending timer need to be cancelled in any
case when ACL connection is dropped during pending command in question.
In a case the timeout gets fired skip the channel cleanup since
'get info' command has BR/EDR signal channel context and the one needs
to be operational when transport connection is alive.

Change-Id: I319becf3330f9be5633c15e5b39d77a619495494
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-09-07 08:17:26 +03:00
Arkadiusz Lichwa
ad83797a6d Bluetooth: L2CAP: Initialize & cleanup RTX timer on BR/EDR
Adds generic RTX timer handler to BR/EDR L2CAP layer and adjusts its
initialization and cleanup resources using proper channel management
functions.

Change-Id: I87d320b4f34d4d0f28b8e48d01ebfbcc5adeadf0
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-09-07 08:17:26 +03:00
Szymon Janc
b9610c392b Bluetooth: Mark AES encrypted BR/EDR link as FIPS security level
If enctyption changed event is recevied with value 0x02 it means
that AES-CCM is used for BR/EDR encryption. If link is also
authenticated then security level is FIPS.

Change-Id: I33cd1b87c6e4fb359018739e76ac4e72a777128e
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-07 08:17:26 +03:00
Szymon Janc
cfe74b33fc Bluetooth: SMP: Remove not needed stubs from NULL backend
Those are not needed as calls are always under proper ifdefs.

Change-Id: I460a77af0e0d693bbecb6120e39ed6190cf49b72
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-07 08:17:26 +03:00
Szymon Janc
60691c4650 Bluetooth: Split keys into LE and BR/EDR specific storage
This make LE and BR/EDR keys store in separate storages. This is
to simplify handling of dual mode device handling where identity
information are distributed after LTK. BR/EDR has only one key
(Link Key) so this transport specific code can be further simplified.

Change-Id: I8f45d4491ce613aaac11f1d60cf42c38fc3eceec
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-09-07 08:17:26 +03:00
Andrei Emeltchenko
709111b813 Bluetooth: Simplify configuration and fix warnings
Fixes the warnings:
...
net/bluetooth/Kconfig:48:warning: defaults for choice values not
supported
warning: (BLUETOOTH) selects BLUETOOTH_LE which has unmet direct
dependencies (BLUETOOTH && BLUETOOTH_STACK_HCI)
...

Change-Id: I039a9e0e90ce4cb1732c9c764e2db441ba59660a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-09-07 08:17:26 +03:00
Arkadiusz Lichwa
cfcb1d20c4 Bluetooth: L2CAP: Make common RTX commands timer
There's a need to add timeout support for control commands on BR/EDR
transport. So far RTX timer feature has application to control protocols
only on LE. Here 'rtx_work' member is moved to common L2CAP context to
safe memory footprint and prepare L2CAP layer to handle RTX timeout
in BR/EDR context.

Change-Id: I9938268a5c4e5dd1f980bb3ec8697d0209c24065
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-09-07 08:17:26 +03:00
Kuo-Lang Tseng
d30fd7ce82 driver: spi_flash_w25qxxdv: remove an incorrect erase size definition
The W25QXXDV_PAGE_SIZE is not a valid erase size supported by
the flash component (section 7.2.23 - 7.2.26 of datasheet
https://www.winbond.com/resource-files/w25q16dv_revi_nov1714_web.pdf)
and it is not used by any code so remove it.

Jira: ZEP-615

Change-Id: I4315fa082d5cbceda65ae8567e0a77e2d4066ef1
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2016-09-07 02:50:31 +00:00
Javier B Perez
7971f7619d known issues: ignore testcases failures
Added new config file to filter the known issues for arduino 101
and quark_se_c1000.
Added filter for known TCF issues like SKIP and BLCK lines

Change-Id: Ie77b0cee2c395b8ea4f6d832023c7207d922c108
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-09-07 01:02:10 +00:00
Andrew Boie
844e21269c arm: remove dynamic IRQs and exceptions
Change-Id: I8fea235aff6b7cb7da07b491ba39ea383709b57f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-06 23:47:21 +00:00
Andrew Boie
1cda7554ca arm: exc_manage: fix printk format code usage
Change-Id: I1e3f313f9c653dc2eec2ea02f16437f6c60ef304
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-06 23:47:14 +00:00
Andrew Boie
ba61200a8f sanitycheck: allow extra arguments to be passed to the build
In some cases, particularly when developing experimental features, it is
useful to be able to pass parameters to 'make' globally for all
sanity checks.

Change-Id: I19eddf222a74064cf6f22ec641fa6b4ff72992e7
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-06 22:44:20 +00:00
Andrew Boie
3a1cf9af2c arc: remove deprecated dynamic interrupt implementation
Change-Id: I7a81123f72458f43d3e8e1ca04a921ae6c5f1f6e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-06 22:26:11 +00:00
Tyler Baker
53dffd61aa add ARM GCC embedded toolchain to the list of supported toolchains
The Zephyr documentation states that the ARM GCC embedded toolchain is
supported for ARM platforms so lets add a reference to allow sanitycheck
to build with this configuration. This patch fixes 4b554baa87
("sanitycheck: support for multiple toolchain").

Change-Id: I5578a3c78432219e2ba4d7393899d54c818c5c17
Signed-off-by: Tyler Baker <tyler.baker@linaro.org>
2016-09-06 21:38:38 +00:00
Andrew Boie
e98ac235e6 x86: declare internal API for interrupt controllers
Originally, x86 just supported APIC. Then later support
for the Mint Valley Interrupt Controller was added. This
controller is mostly similar to the APIC with some differences,
but was integrated in a somewhat hacked-up fashion.

Now we define irq_controller.h, which is a layer of abstraction
between the core arch code and the interrupt controller
implementation.

Contents of the API:

- Controllers with a fixed irq-to-vector mapping define
_IRQ_CONTROLLER_VECTOR_MAPPING(irq) to obtain a compile-time
map between the two.

- _irq_controller_program() notifies the interrupt controller
what vector will be used for a particular IRQ along with triggering
flags

- _irq_controller_isr_vector_get() reports the vector number of
the IRQ currently being serviced

- In assembly language domain, _irq_controller_eoi implements
EOI handling.

- Since triggering options can vary, some common defines for
triggering IRQ_TRIGGER_EDGE, IRQ_TRIGGER_LEVEL, IRQ_POLARITY_HIGH,
IRQ_POLARITY_LOW introduced.

Specific changes made:

- New Kconfig X86_FIXED_IRQ_MAPPING for those interrupt controllers
that have a fixed relationship between IRQ lines and IDT vectors.

- MVIC driver rewritten per the HAS instead of the tortuous methods
used to get it to behave like LOAPIC. We are no longer writing values
to reserved registers. Additional assertions added.

- Some cleanup in the loapic_timer driver to make the MVIC differences
clearer.

- Unused APIs removed, or folded into calling code when used just once.

- MVIC doesn't bother to write a -1 to the intList priority field since
it gets ignored anyway

Issue: ZEP-48
Change-Id: I071a477ea68c36e00c3d0653ce74b3583454154d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-06 18:35:47 +00:00
Andrew Boie
c545e19a00 x86: remove dynamic interrupts and exceptions
Change-Id: I7e9756e9a0735a7d8257ee2142d5759e883e12cc
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-06 18:35:24 +00:00
Andrew Boie
05e3d7f893 sanitycheck: complain loudly about missing platforms
If defconfig files exist under boards/ that don't correspond to
the set of platforms defined in the .ini files under
scripts/sanity_chk/arches, complain about this. We should be at
least compiling all our supported platforms in CI runs.

At the moment it flags 5 boards. Future patches should either add
these boards to the appropriate arch .ini files or remove them
from the kernel.

Change-Id: Id825d6c6bd32089d9f1bead11bc0765685e3771a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-06 16:32:03 +00:00
Andrew Boie
4909bf3c22 zephyr: remove deprecated dynamic interrupt API
Change-Id: I65b1248988ac384f542a3a685b51b1145cee30b3
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-06 16:16:00 +00:00
Andrew Boie
7d432bbd0a microkernel: remove deprecated task IRQs
Change-Id: I02264a587b77ae597133b9c52b342b8e5520a131
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-06 16:15:59 +00:00
Andrew Boie
0279d9b2cb test_context: don't test dynamic exceptions
This API has been deprecated and scheduled for removal.
It was only implemented on X86, and ARM systems that
aren't XIP.

Static exceptions (only implemented on x86) will
continue to be tested by test_static_idt.

Change-Id: I6d63347ead8200002ee1edd8dd4572b418800400
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-06 16:15:59 +00:00
Carles Cufi
8081fd3cf8 kconfig: Use HOST_OS environment variable in Makefile
Since the root Makefile already provides a HOST_OS
environment variable that is exported by using uname,
make use of it in the Kconfig Makefile.

Change-Id: I13655a5295bbcd9f2fdfa8b6309634c1ab143f70
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-09-06 15:15:02 +00:00
Rohit Grover
769e2541d1 net: revert tcpip_poll_tcp() to not require a data_buf
tcpip_poll_tcp() was changed with commit 61edc68c to take on a
data_buf parameter, which was then processed as the primary
buffer. That change led to incorrect behaviour where the handling
of the first data buffer on a connection got mixed with the SYN buf.
It is no longer clear why tcpip_poll_tcp() was modified with the
change 61edc68c originally. Reverting the modification to
tcpip_poll_tcp() leads to much better handling of TCP data; and
also obviates another pull-request submitted recently:
https://gerrit.zephyrproject.org/r/#/c/4226.

Change-Id: I947c0991495c538c41e6581c8d360526b1bb89ad
Signed-off-by: Rohit Grover <rohit.grover@arm.com>
2016-09-06 15:11:03 +00:00
Marcus Shawcroft
01f59b6d9e net: uip: Fix udp_socket_process receive data callback buffer handling.
Adjust the data pointer passed to a udp_socket_register() registered
callback to point to the udp data contents rather than the header
information.

Change-Id: Ib90eee91e0ec4d0290517fee7b929d39ce3e07c6
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-09-06 15:10:33 +00:00
Marcus Shawcroft
624cf83772 net: Fix code formatting
Re-instate correct code formatting.  No functional change.

Change-Id: If7c61214c07c6573ec25022ad47f83cc1b29e24c
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-09-06 15:10:12 +00:00
Marcus Shawcroft
b92d10d879 net: uip: Fix compile fail with stats enabled, tcp disabled.
Add missing preprocessor conditional around statistics update.

Change-Id: I3e55b1512e913b2e9a60d0ab56264439ca417a23
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-09-06 15:09:58 +00:00
Tomasz Bursztyka
8a574fdd67 net: contiki: simplerdc: Fix an uninitialized variable warning
If retries are 0 (which should never be), ret will not be initialized.

Change-Id: I8ef9a2ccbf89191e48d407fdb1292554fa8f15d9
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-09-06 09:05:37 +00:00
Juan Manuel Cruz
77e09abdda ethernet: Enables multicast reception for dw driver
Jira: ZEP-471

Change-Id: Id6a3ecbe31c055ab006abe475650c9871460f671
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-09-01 11:04:14 +00:00
Inaky Perez-Gonzalez
c8fbb40fd7 TCF: especify ARCH when building
Some test cases and samples require ARCH being specified. In TCF, that
information is carried by the BSP variable.

This is a workaround hack to a historical carry over that should be
removed once the extra work to do so is completed (ZEP-754). Tagged as
such.

Change-Id: I640efce3e65f46473443c5413807cdc7cdfd8be8
Jira: ZEP-760
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-08-31 20:54:28 +00:00
Qiu Peiyang
c29087642b drivers/pinmux: delete unused file and Makefile item
According to commit 2055b06e ("quark: move pinmux files to board"),
drivers/pinmux/quark_mcu/ was deleted, so remove it from the Makefile.

According to commit 0ae2e895 ("remove custom pinmux for quark and use qmsi"),
pinmux_dev_quark_mcu.c is no longer compiled into image, so delete
this unused file.

Change-Id: Ied63cd3b06e8225205c5f1b3e5a675c387acb5ad
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2016-08-31 20:19:21 +00:00
Anas Nashif
62289e6de7 quark_se: disable IPM and enable UART0 on the sensor subsystem
Treat the sensor subsystem as an independent board that can send
messages to UART and disable IPM and the messaging interface. IPM
can be enabled by applications that require such interface.

Fix all samples that are affected by this change to make sanitycheck
pass.

Jira: ZEP-451
Change-Id: I3df6af16adefaefec02b97778d6c68ffc920ac35
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-08-31 16:31:04 +00:00
Amit Kucheria
8fd658c06b drivers: spi: Fix typos in SPI port numbers
Also, SPI 0 isn't specific to Intel, make it a generic message. This patch
only fixes the cosmetics w/o changing undering Kconfig option names.

Change-Id: Ia58f9537c594004a1b5fb8b4af21d7e8b729efb7
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
2016-08-31 14:41:36 +00:00