Commit graph

95513 commits

Author SHA1 Message Date
Tomasz Gorochowik b422d38650 net: gptp: Fix sync follow up packets content
The issue was that the length field of the tlv extension in the sync
follow up packets was wrong. It is supposed to skip the length of the
header of that extension. The easiest fix was separating the header and
the actual contents into separate structs and that's what this commit
does.

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2018-07-02 16:52:49 +03:00
Jukka Rissanen cf272e6667 net: gptp: Use the ptp clock instead of zephyr uptime
As the PTP clock should return the correct time, use that
instead of zephyr uptime for time as that has only ms accuracy.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-02 16:52:49 +03:00
Jukka Rissanen 70b60cca1d net: gptp: Set priority of the sent gPTP packets
Use priority 3 (critial app) for outgoing event messages (Sync,
Pdelay_Req and Pdelay_Resp). Use priority 6 (Internetwork Control)
for all other outgoing packets.
See IEEE 802.1Q chapter 8.4.4 for more details.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-02 16:52:49 +03:00
Gautier Seidel 4a8393dd66 esp32: add abitily to flash bootloader
'make flash' also flashes the bootloader

Signed-off-by: Gautier Seidel <gautier.seidel@tado.com>
2018-07-02 08:44:49 -04:00
Gautier Seidel 5ed26a5cc8 esp32: Re-order bootloader condition in Kconfig
Fix menu entries in Kconfig

Signed-off-by: Gautier Seidel <gautier.seidel@tado.com>
2018-07-02 08:44:49 -04:00
Gautier Seidel 52ed379912 esp32: add ESP-IDF bootloader option
add ESP-IDF bootloader support

Signed-off-by: Gautier Seidel <gautier.seidel@tado.com>
2018-07-02 08:44:49 -04:00
Dong Xiang 7ba7119f82 net: l2: Fixed wifi can not connect to open AP.
When connect to open AP, the security is always set to
WIFI_SECURITY_TYPE_PSK.

Signed-off-by: Dong Xiang <dong.xiang@unisoc.com>
2018-07-02 15:19:37 +03:00
Vikrant More e8ddd6def8 samples: mesh/onoff_level_lighting_vnd_app: edited message handlers
Removed TID implementations wherever it is not required as per
Bluetooth SIG Mesh Model Specification. Removed unnecessary
comments. Add status code value to get publish along with
Light Lightness range status message.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-02 13:47:44 +03:00
Vikrant More 34d475ff4e samples: mesh/onoff_level_lighting_vnd_app: fix bug in state binding
Fixed bug in binding of Light Lightness Actual state & Generic Level
state of Root Element.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-02 13:47:44 +03:00
Vikrant More 54df5b519a samples: mesh/onoff_level_lighting_vnd_app: update handlers mapping
Update message handlers & correct nubmber of bytes that every
handlers should fetch for their further processing as per
Bluetooth SIG Mesh Model Specification.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-02 13:47:44 +03:00
Vikrant More b3e7a8f67b samples: mesh/onoff_level_lighting_vnd_app: update publication context
Update models publication parameter lengths as per Mesh Model
Specification.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-02 13:47:44 +03:00
Joakim Andersson c6dea9e068 Bluetooth: Reorganize Kconfig options for BLE controller
Split meaning of BT_CTLR and BT_LL_SW, since they always are the same.
This way BT_CTLR means that there an controller implemented,
and BT_LL_SW refers to the specific implementation.
This allows alternative controller implementations.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2018-07-02 11:59:43 +02:00
Paul Sokolovsky c89a06dbc1 net: config: Introduce a dedicated header for the library
Split out definition of net_app_init() and its parameter flags from
net_app.h header to new net_config.h header. As we do this, rename
the function to net_config_init() and flags to NET_CONFIG_NEED_*.
This is a second step in splitting out network configuration API
out of net_app API, started in the c60df1311 commit.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-07-02 12:36:35 +03:00
Tomasz Bursztyka d309c870c7 net/ipv6: Properly separate what belongs to ipv6 from the rest
Context part should be in context. Then, rename ipv6 function for
clarity.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-07-02 12:34:12 +03:00
Tomasz Bursztyka 68f7e96916 net/ipv4: Properly separate what belongs to ipv4 from the rest
Context part should be in context. Then, rename ipv4 function for
clarity.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-07-02 12:34:12 +03:00
Jukka Rissanen 0738ab3e09 net: shell: Check link address when printing iface info
There is no link address for Dummy network technology, so check
that before trying to print link address.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-02 12:21:16 +03:00
Jakub Rzeszutko 197740bdfe drivers: uart: nrf: fixing interrupt driven API
1. API function: uart_nrfx_irq_tx_enable is expected to enable and
trigger TXDRDY interrupt. Due to HW limiation before first byte has
been sent TXDRDY interrupt will not be triggered so it must be forced
by the software.

2. Common function: uart_nrfx_irq_tx_ready_complete is used for two
API entries: irq_tx_ready, irq_tx_complete because Nordic hardware does
not distinguish between them. This function returns 1 when driver is
ready to accept data and 0 otherwise.

3. Removed Hungarian prefixes.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-07-02 10:56:57 +02:00
Anas Nashif 80e6a978a6 kernel/drivers: fix compile warnings
Uncovered by clang we have some functions being only used conditionally,
so gaurd them to make them only available when those conditions are met.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-01 22:58:23 +02:00
Anas Nashif 964979f539 usb: mark unused arguments correctly
use ARG_UNUSED instead of making variable equal itself.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-01 22:58:23 +02:00
Anas Nashif 305ec6751b tests: fix struct initialization
uncovcerd by clangm we are initialising too late and after first use.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-01 22:58:23 +02:00
Anas Nashif a8d4b32412 net: fix header guard
Add missing _ to match guard name.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-01 22:58:23 +02:00
Anas Nashif bebda565b5 clang: fix for x86 iamcu
Clang, build IAMCU with -miamcu.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-01 22:58:09 +02:00
Anas Nashif 72edc4e15f clang/llvm: add initial configuration file for clang
Add an LLVM backend and a clang toolchain variant to support building
with llvm coming with popular Linux distributions.

This has been tested with X86 boards:
- quark_d2000_crb
- quark_se_c1000_devboard/Arduino 101

Use:

export ZEPHYR_TOOLCHAIN_VARIANT=clang

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-01 22:58:09 +02:00
Ioannis Glaropoulos 7c9a1f0f76 arch: arm: soc: add explanatory comment for kernel headers' inclusion
This commit adds an explanatory comment in all soc.h headers,
where kernel_includes.h header has been included, to stress out
that this header must be included after SOC-specific headers are
brought in. The reason is the fact that kernel_includes.h needs
the ARM CMSIS definitions, which are brought in by the
SOC-specific header inclusions.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-06-29 17:53:15 -05:00
Anas Nashif 0b68560463 sanitycheck: whitelist logging sections
Whitelist recently add sections in the logging subsystem.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-06-29 17:48:26 -05:00
Kumar Gala 9127c4b3b1 tests: Cleanup converting int result to string
Introduce TC_RESULT_TO_STR to convert from an integer test result to a
string like "PASS", "FAIL", "SKIP".  Do this to remove the defines of
PASS/FAIL/SKIP since those names might get used by other code and to
have a single consistent way of doing the conversion.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-06-29 11:53:59 -05:00
Aurelien Jarno fa83a4d131 arch: arm: stm32f7: remove core zephyr header inclusions from soc.h
The stm32f7 version of soc.h misses the changes done in commit
aee97be710 ("arch: arm: soc: remove core zephyr header inclusions
from soc.h") as it was not merged at that time. Fix that.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-06-29 11:52:51 -05:00
Kumar Gala 8fe9f432d2 samples: sysview: limit to systems with enough ram
When we enabled SEGGER support on the ST SoCs we now how some systems
with really small amounts of memory that the sample can't be built for.
Set a min_ram to exclude such systems.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-06-29 10:39:07 -05:00
Tomasz Bursztyka 1a12571482 tests/net: Fix L2 directory lookup for header inclusion
L2 directory is now located in subsys/net/l2

Fixes #8642

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-06-29 10:32:27 -05:00
Jukka Rissanen f8c6894f15 samples: net: dns: Cross reference mDNS config option
Set CONFIG_MDNS_RESOLVER to get a cross reference to the config
option documentation

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-06-29 13:11:18 +03:00
Jukka Rissanen b833d010eb net: llmnr: Add LLMNR responder support
This allows zephyr to listen LLMNR DNS queries sent by Windows
and respond to them. See RFC 4795 for details.

The feature requires that hostname is set properly to the
zephyr device and LLMNR is configured properly.

Typically following config options are enough for this support:

CONFIG_NET_HOSTNAME_ENABLE=y
CONFIG_NET_HOSTNAME="zephyr-device"
CONFIG_DNS_RESOLVER=y
CONFIG_LLMNR_RESPONDER=y

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-06-29 13:11:18 +03:00
Jukka Rissanen f47151513c samples: net: dns: Add LLMNR client support to DNS resolver
By default the LLMNR is disabled in this sample. You can enable
it by setting CONFIG_LLMNR_RESOLVER=y

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-06-29 13:11:18 +03:00
Jukka Rissanen 837ed14a0d net: llmnr: Add link-local mcast name resolution client support
This implements LLMNR client from RFC 4795. This means that caller
is able to resolve DNS resource records using multicast DNS.
The LLMNR is used in Windows networks.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-06-29 13:11:18 +03:00
Tomasz Bursztyka 922d63cee5 net/arp: Normalize all function names
Let's follow the same prefix for all function.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-06-29 12:57:45 +03:00
Tomasz Bursztyka 2df23f567b net/arp: Let's reduce the size of each ARP entry
An ARP entry, if not free, will be either in pending list or in the ARP
table. What differentiate both is the type of data they hold: either a
pending packet or an actual ethernet address.

It is then possible to unite these 2 attributes to save 4 bytes
per-entry.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-06-29 12:57:45 +03:00
Tomasz Bursztyka 35a7804cdf net/arp: Centralize ARP request timeout through one k_delayed_work
Until now, each ARP entry had a k_delayed_work to be used as a timer
when the ARP entry is a pending one, waiting for the ARP request to
succeed in order to get to the ARP table.

But k_delayed_work is not a small object (40 bytes). Thus reworking the
ARP request timer by having one central k_delayed_work and a timestamp
in every ARP entry properly handled at every timeout (1+ entry might
have reached the timeout then).

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-06-29 12:57:45 +03:00
Tomasz Bursztyka 0025a3fce2 net/arp: Optimize ARP table by switching to various single list
Instead of looping over the entries array, which will keep the same
order, let's use slist: one for free entries, one for pending ones and
finally one as the actual ARP table.

This permits some optimizations in how to look up and making small
heuristics by changing entries order when it seems relevant.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-06-29 12:57:45 +03:00
Tomasz Bursztyka 89eeba4250 net/arp: No need to expose publicly arp header
ARP is something internal to ethernet L2, let's just hide its header
file.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-06-29 12:57:45 +03:00
Christophe Priouzeau a603e7071e boards: disco_l475_iot1: update BT configuration
- update BT configuration
- adapt configuration of SPI3 for BT usage

Signed-off-by: Christophe Priouzeau <christophe.priouzeau@st.com>
2018-06-29 10:40:25 +02:00
Christophe Priouzeau b0c294ce48 bt: hci driver over spi: Configure BlueNRG-MS in controller mode
Configure BlueNRG in controller w/o host.
By disabling 'HCI_reset' via the quirk, we can request to
BluesNRG hardware to be on controller mode just after it is ready.
By the way it's no necessary to manage a 'HCI_reset' when BluesNRG are
initialised (and on controler mode).

Signed-off-by: Christophe Priouzeau <christophe.priouzeau@st.com>
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-06-29 10:40:25 +02:00
Christophe Priouzeau cd0a8216e9 drivers/clock_control: stm32: fix HCLK calculation when using MSI
MSI clock signal can be selected in several ranges.
These ranges should be taken into account for calculating its
frequency and hence global system frequency.
Provide a Kconfig option to set MSI range.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Signed-off-by: Christophe Priouzeau <christophe.priouzeau@st.com>
2018-06-29 10:40:25 +02:00
Christophe Priouzeau 7b02e6dc55 bt: hci driver over spi: BlueNRG-MS read until IRQ pin goes low
According to BlueNRG-MS ref manual, SPI master shoul read  from
controller as long as IRQ pin is high.
Introduce a new loop within spi_rx_thread to do so. Since
it is now possible to enter read loop with nothing to read, set
a max attempts limit to be sure to exit the loop.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Signed-off-by: Christophe Priouzeau <christophe.priouzeau@st.com>
2018-06-29 10:40:25 +02:00
Olivier Martin 0ba41f5b46 drivers: serial: Fix syntax error
`uart_handler.c` does not build when `CONFIG_UART_LINE_CTRL`
is defined.

Signed-off-by: Olivier Martin <olivier.martin@proglove.de>
2018-06-29 10:18:48 +02:00
Krzysztof Chruściński 3a7d4ef4cb samples: subsys: logging: Add logger example
Simple example demonstrating various logger capabilities.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2018-06-29 10:16:45 +02:00
Krzysztof Chruściński 17ae882b43 tests: subsys: logging: Add tests for log_msg and log_list
Tests for intrnal logging subsystem modules.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2018-06-29 10:16:45 +02:00
Krzysztof Chruściński bbeef4155c logging: subsystem major redesign
Adding new implementation of logging subsystem. New features
includes: support for multiple backends, improving performance
by deferring log processing to the known context, adding
timestamps and logs filtering options (compile time, runtime,
module level, instance level). Console backend added as the
example backend.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2018-06-29 10:16:45 +02:00
Niranjhana N 0b00493d86 tests: drivers: adc: fix failing test for frdm_k64f
This test is failing for the frdm platform because
the ADC_DEVICE_NAME is different. Add #if statements
to correct for respective platform names.

Signed-off-by: Niranjhana N <niranjhana.n@intel.com>
2018-06-28 16:02:21 -05:00
Mariusz Skamra 8f6ebc5322 Bluetooth: controller: Fix LE Extended Scanner Filter Policy dependency
This adds dependency upon Observer role.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-06-28 22:16:31 +02:00
Alberto Escolar Piedras 2889f5f02c native: Do not ignore format-truncation warnings
Reverting 5124711d87
as issue #5732 is no more.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-06-28 19:58:55 +02:00
Alberto Escolar Piedras 2b02f8d316 tests: sprintf: suppress Wformat-truncation warning
GCC 7 and newer are smart enough to realize that in test_snprintf()
the output will not fit in 0 or 4 bytes, but that it requires 9.
So it throws a warning in compile time. But in this case we are
actually testing that snprintf's return value is what it should be
while truncating the output. So let's suppress this warning here.

Fixes: #5732

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-06-28 19:58:55 +02:00