Commit graph

41120 commits

Author SHA1 Message Date
Jukka Rissanen
063f113f83 net: rpl: Fix compile error if ICMPv6 debugging is activated
Change-Id: Id97d1eaaa529b3c79cf2fdbff10148c693e467d5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-17 07:29:16 +00:00
Jukka Rissanen
d5cf9e4edb net: rpl: Enable debugging via Kconfig
User can activate generic RPL debugging by setting
CONFIG_NETWORK_IP_STACK_DEBUG_RPL config option.

Change-Id: I3b044c6308d6f20cb42d21edb59119321aa8bfbb
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-17 07:29:16 +00:00
Andre Guedes
4851ee78f1 drivers: Fix documentation from remaining APIs
This patch fixes the remaining APIs documentation which have reference
to DEV_* codes.

Change-Id: I26dd971a4b5e492ce026892f6262b84f7bde6296
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes
136d171588 drivers: Replace DEV_NOT_CONFIG by -EPERM
This patch replaces all occurences of the macro DEV_NOT_CONFIG by
-EPERM at the driver level. This patch is part of the effort to
transition from DEV_* codes to errno.h codes.

Change-Id: I3054c8aa76319a58a2eec089b8a72bf301c85391
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes
aca7cb1efd drivers: Replace DEV_NO_SUPPORT by -ENODEV
This patch replaces all occurences of the macro DEV_NO_SUPPORT by
-ENODEV at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/ when applicable.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: I03007527367b03e6fd72a85004b7d3b81046a6a6
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes
2a4c5fce00 drivers: Replace DEV_NO_ACCESS by -EACCES
This patch replaces all occurences of the macro DEV_NO_ACCESS by
-EACCES at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/ when applicable.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: Ic7fd162b45e9ceb73141a164649b96eea9886873
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes
afcc923172 drivers: Replace DEV_USED by -EBUSY
This patch replaces all occurences of the macro DEV_USED by -EBUSY
at the driver level. So this patch touch the files under drivers/,
include/ and samples/drivers/ when applicable.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: I21eb3ffe9bdfde98593dcf63c50a8bdcd376e49e
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes
b3cb3a1f68 drivers: Replace DEV_INVALID_CONF by -EINVAL
This patch replaces all occurences of the macro DEV_INVALID_CONF by
-EINVAL at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/ when applicable.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: Idae0d5af8dd780416977c9261a5fb6188c3aab64
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes
245e140da6 drivers: Replace DEV_INVALID_OP by -ENOTSUP
This patch replaces all occurences of the macro DEV_INVALID_OP by
-ENOTSUP at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/ when applicable.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: I46aec3c65963018c479b01602e4a3eec8650eaff
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes
7c956d2ece drivers: Replace DEV_FAIL by -EIO
This patch replaces all occurences of the macro DEV_FAIL by -EIO
at the driver level. So this patch touch the files under drivers/,
include/ and samples/drivers/ when applicable.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: I0594ab5dbe667e074c250129e7c13ce512ac940f
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes
024cfe754e drivers: Replace DEV_OK by 0
This patch replaces all occurences of the macro DEV_OK by the actual
value 0 at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: I69980ecb9755f2fb026de5668ae9c21a4ae62d1e
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes
69453a5d29 device: Redefine DEV_* error codes
This patch redefines DEV_* error codes in terms of errno.h codes.

Change-Id: Iab994c40265c294296491d427f65c38abd48b795
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Genaro Saucedo Tejada
3fee959d9d doc: Remove SDK specific version numbers.
Removes the specific version number of SDK installation example commands.

Specific version numbers becomes frequently outdated.

Change-Id: I6fc368b30a5fe7899f6a2fc979f469e2b3cd9f72
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2016-03-16 22:12:41 +00:00
Andre Guedes
5f1988f284 pinmux: Change returning type from pinmux.h APIs
All driver APIs (i2c, spi, gpio, etc.) return 'int' type, but pinmux
APIs. So this patch changes the returning type from 'uint32_t' to
'int' from include/pinmux.h and fixes all pinmux drivers according.

Besides keeping consistency between all drivers APIs, this patch is
also applicable for the errno.h code transition. Pinmux drivers will
return negative errno.h codes so returning 'int' is more suitable
than 'uint32_t'.

Change-Id: I2a6e92d567a0e21fec363226da6197df94657d4b
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:46:05 +00:00
Andre Guedes
9a8c79f08a samples: Add STTS751 sample application
This patch introduces the i2c_stts751 sample application which
illustrates how to use the I2C APIs from Zephyr. The slave device
is the STTS751 sensor which is present in Quark SE devboard. So
no wiring instructions are required in order to get this sample
working.

The application reads the temperature register from STTS751 sensor
and prints the temperature value. This sample is specific to Quark
SE Devboard, but it can be easily extended to support any other
board with the STTS751 sensor.

Change-Id: I9b56aa73645d4741942fc793f1450c6a1c7beb29
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:35:19 +00:00
Maciek Borzecki
3f5af00529 clock_control/stm32f10x: introduce driver for STM32F10x RCC
The patch adds a driver for STM32F10x series RCC (Reset and Clock
Control) subsystem.

The module is primarily responsible for setting up of MCU's clock
tree. In particular the driver sets up SYSCLK, PLL (with source
configuration), AHB prescaler, and APB1/APB2 prescalers. As part of this
functionality, the subsystem can enable/disable clock signal for
particular peripherals, thus reducing the power consumption of the MCU.

The driver implements clock control driver API. However, subsystem IDs
being HW specific are exposed in driver public header that must be
included by callers. The driver registers a single device using a common
name STM32_CLOCK_CONTROL_NAME. The device is initialized at
the PRIMARY level with priority 1. This allows the initialization to
take place right after SoC initialization routine.

The driver depends on selection of SOC_STM32F1X config option and is MCU
specific.

Change-Id: I8bea5db20726a24bce7b7ffe0b95de543240429a
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-16 18:11:18 +00:00
Maciek Borzecki
14482f0940 clock_control: extend API with clock rate query operation
Extend the public API of clock_control driver with a function for
querying of clock rate driving given peripheral. This is useful when the
driver must calculate or configurae values that depend on the rate of
clock driving this subsystem.

A baud rate setting of UART port is an example of such operation. To
configure a particular baud rate the driver may need to set the internal
counters of UART port, where the actual value will depend on the clock
rate for this peripheral.

The implementation returns DEV_NO_SUPPORT for clock_control drivers that
do not implement such functionality.

Change-Id: I4e7ec96cd3678a4bb1ff289b0247488289310f2d
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-16 18:09:32 +00:00
Maciek Borzecki
5cff3cc561 clock_control/Kconfig: move quark_se entries to separate file
Move quark_se clock control entries to separate file. This will help to
keep things organized once we add more clock control drivers.

Change-Id: Id8f4a94189ab5bbba9b6552777549cf426d79273
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-16 18:08:11 +00:00
Maciek Borzecki
1c78f3d39b st_stm32/stm32f1: introduce STM32F1x SoC family
The patch introduces a new family of SoCs based on STMicroelectronics'
STM32 MCU line. The patch introduces a basic arch/arm/soc layout along
with configuration of 2 MCUs from STM32F1 series: STM32F103VE and
STM32F103RB.

The patch assumes that other MCUs from STM32 family will be included
under arch/arm/soc/st_stm32 tree, to achieve the following layout:

arch/
  arm/
    soc/
      st_stm32/
        stm32f0/
        stm32f1/
        stm32f2/
        ...
        stm32l0/

Most of the configuration within a single MCU family (ex. STM32F1) is
shared, however individual MCUs differ with respect to SRAM size, flash
size or the number of available peripherals. The patch assumes that per
MCU line Kconfig.soc.family file should introduce basic setup for given
series. This can be further tuned by per MCU files, with
Kconfig.soc.stm32f103rb and Kconfig.soc.stm32f103ve as examples.

Each family defines a configuration option, ex. CONFIG_STM32F10X, while
individual MCUs define a corresponding per MCU config options,
ex. CONFIG_STM32F103VE.

From the menuconfig perspective, the user is presented with a family
selection under General Platform Configuration/SoC Selection.  A
specific MCU model can be selected by accessing General Platform
Configuration/STM32F1x MCU Selection, with the default entry being
selected by the board configuration.

Change-Id: I22e4defd4a08ed1b2e2cad0e214b34f565e08831
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-16 18:03:13 +00:00
Jukka Rissanen
5cef4d13eb net: 802.15.4: User can select desired RDC plugin
User is able to use either sicslowmac or nullrdc plugin for
RDC (Radio Duty Cycle) layer. Default is sicslowmac.

Change-Id: I51f72f0d5de67a271178b51f29644bea39ffa19f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-16 15:25:35 +00:00
Jukka Rissanen
a0d9613033 net: contiki: Fix debug prints in MAC layer files
Make debug messages fit in one line which is much more readable.

Change-Id: Ia0087bdea03d2eb34fca104850cf3acd3f61ebe6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-16 15:25:27 +00:00
Jukka Rissanen
2ec63ec481 net: Add debug configuration for 802.15.4 network driver
User can toggle 802.15.4 network driver debugging from Kconfig.

Change-Id: I63f8e319172bce0561123416d18397468da671bf
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-16 15:25:16 +00:00
Jukka Rissanen
978b880e48 net: Allow user to activate 802.15.4 packet framing debug
User can set CONFIG_NETWORK_IP_STACK_DEBUG_15_4_FRAMING
to get debugs from 802.15.4 packet framing code.

Change-Id: I58155df19b6d63686a96ea410801d45632eb566b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-16 15:25:06 +00:00
Jukka Rissanen
ffcfe9c44f net: Allow user to activate 802.15.4 MAC layer debugging
User can set CONFIG_NETWORK_IP_STACK_DEBUG_15_4_MAC
to get debugs from 802.15.4 MAC layer code.

Change-Id: Ie385c586caad1602869260146a1ea92d961b73c3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-16 15:24:53 +00:00
Jukka Rissanen
54c1bd92f9 net: Allow user to activate 6lowpan compression debug
User can set CONFIG_NETWORK_IP_STACK_DEBUG_6LOWPAN_COMPRESSION
to get debugs from generic 6lowpan fragmentation code.
The generic code is shared between 802.15.4 and Bluetooth
bearers.

Change-Id: Iae6dcebe8fb4269e15bac5dcec2b63e79b4abcd3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-16 15:24:44 +00:00
Jukka Rissanen
b7c6c2198f net: Allow user to activate 802.15.4 6lowpan frag debug
User can set CONFIG_NETWORK_IP_STACK_DEBUG_15_4_6LOWPAN_FRAG
to get debugs from 802.15.4 6lowpan fragmentation code.

Change-Id: I3a199cf9e5696a1017a290d182a0d7176b1c259e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-16 15:24:44 +00:00
Jukka Rissanen
7d805482c3 net: Kconfig debug option for debugging received and sent data
User can activate debugging in network stack when packets are
received and sent by setting CONFIG_NETWORK_IP_STACK_DEBUG_RECV_SEND
option in config file.

Change-Id: I7b45b6f9053664a03aa7dde79e7000b6063ac822
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-16 15:24:44 +00:00
Vlad Lungu
244d5f8d07 net: contiki: Fix net_buf lifecycle
siscslowpan_fragmentation would only free net_buf on failure.
nullmac does not touch the net_buf, this results in all net_buf
being exhausted eventually.
csma always frees the net_buf, so in case of failure there is a double
free with the one from siscslowpan_fragmentation.

Fix:
ref net_buf before every send, unref on every callback and once at the end,
regardless of result. Don't free or ref the net_buf in csma.

Also, replaced some code in fragment() with a call to send_packet()

Change-Id: I4f329810ace07c09cde8f7522a83a1d6681f0906
Signed-off-by: Vlad Lungu <vlad.lungu@windriver.com>
2016-03-16 14:20:56 +00:00
Vlad Lungu
0667c0fe0e net: contiki: move neighbor_list to struct l2_buf
When using the CSMA MAC driver, a new packet can be queued before
all the fragments of the previous one were sent. The transmit_packet_list()
function will start sending the old fragments with the new net_buf context.

Keep a per-context neighbor_list to avoid that

Change-Id: I9d41a923c48f597cc95a8f8c9f67884c5caac02c
Signed-off-by: Vlad Lungu <vlad.lungu@windriver.com>
2016-03-16 14:20:56 +00:00
Vlad Lungu
9be0ad915c net: contiki: Initialize uip_last_tx_status(mbuf) before use
When using the CSMA MAC driver, all send() calls but the last one
return without uip_last_tx_status(mbuf) being updated. If a mbuf
has uip_last_tx_status(mbuf) != MAC_TX_OK and is freed, the next time
it is allocated the first send() call will appear to fail and the packet
will be dropped.

Change-Id: I0fb388714f8071947fa0641fbe03e063550328db
Signed-off-by: Vlad Lungu <vlad.lungu@windriver.com>
2016-03-16 14:20:56 +00:00
Luiz Augusto von Dentz
19387677da Bluetooth: peripheral_esp: Add support for using NBLE driver
This adds support for building and testing peripheral_esp using NBLE
driver.

Change-Id: I962238d526101f8f423491d3023079684ec7d59f
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-03-16 13:27:29 +00:00
Andrei Emeltchenko
69805d0e9a drivers/nble: Implement passkey entry event
Implement on_nble_gap_sm_passkey_display_evt() calling passkey_entry
callback.

Change-Id: Iccad494480bd12b5f5ba51f2f64c3793cdf7ba09
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-16 13:26:58 +00:00
Andrei Emeltchenko
5fbcdf711d drivers/nble: Implement LE stop advertising
Implement bt_le_adv_stop() and handle response.

Change-Id: Id90c98188979dbb8cd54d773149e28cb81013510
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-16 13:26:48 +00:00
Andrei Emeltchenko
19013cf9ab drivers/nble: Implement on_nble_gap_sm_passkey_display_evt()
Implement passkey display event by calling appropriate callback from
bt_auth.

Change-Id: I95dadea454d15e139f3c840addb7a31875fa3171
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-16 13:26:38 +00:00
Andrei Emeltchenko
ad0e8b9195 drivers/nble: Refactor DM configuration
Take into account btauth callbacks for finding out IO capabilities.

Change-Id: Ifc35a1919c7e4d1b5ebaace7f13744f9b977d7e8
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-16 13:26:28 +00:00
Andrei Emeltchenko
8a18406f77 drivers/nble: Implement bt_conn_auth_cb_register()
Implement registering auth callbacks

Change-Id: I09d4f20c25075461fd53fdc08351d5940be22683
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-16 13:26:19 +00:00
Andrei Emeltchenko
998143b29c drivers/nble: Add skeleton for handling SM events
Add skeleton to handle events generated when trying to set security.

Change-Id: If9635690d50dce22a35dd0d05d8cc5046edaafee
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-16 13:26:06 +00:00
Andrei Emeltchenko
5ce49a844a drivers/nble: Implement bt_conn_security()
Implement bt_conn_security() for NBLE. We call
nble_gap_sm_security_req() which shall do all needed job.

Change-Id: I5fdccc2ea3e88266db8f940dc453547d5ea51f59
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-16 13:09:39 +00:00
Andrei Emeltchenko
04293a243e drivers/nble: Fix using UUID for GATT discover
Refactor code to be aligned with upstream Nordic BLE RPC. There UUID
is used only for primary service and characteristics.

Change-Id: I8fa840570c2535a73aaa68793a45013faacc59da
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-16 11:41:09 +00:00
Ravi kumar Veeramally
61372c4ece net: apps: Move Makefile.ipstack to common folder
Makefile.ipstack is more generic to net applications which
communicate through slip or between two qemus. So net apps
common folder is right place for it.

Change-Id: I57ca1eeaff28b853609daf92772361406131aa7e
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-03-16 11:40:17 +00:00
Ravi kumar Veeramally
b19f7fe5f4 net: apps: Add prj_qemu.conf files for dtls apps
Add prj_qemu.conf files for dtls_server and dtls_client. Now
it can be tested between two qemus running 802.15.4 dummy driver.

Change-Id: Id94492f90539025854063662c2f0750a0b9ca845
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-03-16 11:39:06 +00:00
Andrei Emeltchenko
93eabdf4c0 drivers/nble: Return -ENOTCONN when LE connection not exist
Correct error message sent to application using GATT API.

Change-Id: Ibf7f9f8943f7e11fd2cf6eaff7c2fabbcdcadba9
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-16 09:19:44 +00:00
Andrei Emeltchenko
e510913cc4 drivers/nble: Implement bt_gatt_indicate()
Implement bt_gatt_indicate() and response to it
on_nble_gatts_send_ind_rsp().

Change-Id: Ibf427135c6385cb84f9fab4edeb3a21760a8702e
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-16 09:19:30 +00:00
Andrei Emeltchenko
0c294021eb drivers/nble: Implement on_nble_gap_start_advertise_rsp()
Avoid "Not implemented" error messages printing "status 0" instead.

Change-Id: I763bf760c8c088f74778d43e6283cb15a11bb443
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-16 09:19:18 +00:00
Andrei Emeltchenko
398e9267cf drivers/nble: Use hexadecimal format specifier
For printing two octets handle use 0x%04x print format specifier.

Change-Id: Ia654d9f2a639cfb9d63647497b302205efab0869
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-16 09:19:04 +00:00
Andrei Emeltchenko
f506195150 drivers/nble: Correct debug print statement
Change-Id: I1321504345d43282dc2607cc98fa38ed4bd1ce76
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-16 09:18:52 +00:00
Andrei Emeltchenko
0b309f3f73 drivers/nble: Update RPC to Nordic BLE
Update RPC to make it compatible with firmware 0309. Among other
changes mostly related to cleanup there is extra flag octet in
struct nble_discover_params.

Change-Id: Ib4dbe15a6919c251f14888090e2f1d91c150c5f2
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-16 09:18:23 +00:00
Andrei Emeltchenko
f8102960c2 drivers/nble: Implement GATT subscribe
Implement bt_gatt_subscribe() function and handle subscriptions.

Change-Id: Ib6ea63a237413ffc65d8572b14d7912d4c7d2699
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-16 09:17:21 +00:00
Johan Hedberg
8563efc773 Bluetooth: Add definition for vendor event code
Change-Id: I764ba3f85a1aee1b57b882f77b1709004bf466e7
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-03-16 10:08:35 +02:00
Luiz Augusto von Dentz
b50a582ea1 Bluetooth: ATT: Notify if a disconnect happen while a request is pending
If the client is waiting for a response but the link is disconnected it
should be notified as the request may never be complete otherwise.

Change-Id: I1fb83b63d8effb4ef2a8f838566c1e68deae9f2c
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-03-16 07:26:01 +00:00