Commit graph

65 commits

Author SHA1 Message Date
Marc Herbert
debade9121 tests: make find_package(Zephyr...) REQUIRED
... because it is (required).

This makes a difference when building with CMake and forgetting
ZEPHYR_BASE or not registering Zephyr in the CMake package registry.

In this particular case, REQUIRED turns this harmless looking log
statement:

-- Could NOT find Zephyr (missing: Zephyr_DIR)
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- ...
-- ...
-- ...
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:8 (target_sources):
  Cannot specify sources for target "app" which is not built by
  this project.

... into this louder, clearer, faster and (last but not least) final
error:

CMake Error at CMakeLists.txt:5 (find_package):
  Could not find a package configuration file provided by "Zephyr" with
  any of the following names:

    ZephyrConfig.cmake
    zephyr-config.cmake

  Add the installation prefix of "Zephyr" to CMAKE_PREFIX_PATH or set
  "Zephyr_DIR" to a directory containing one of the above files.  If
  "Zephyr" provides a separate development package or SDK, be sure it
  has been installed.

-- Configuring incomplete, errors occurred!

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
Anas Nashif
ad82b38b8f tests: ztest: prefix tests with test_
Tests should always start with test_, otherwise detection of subtests
will not work through sanitycheck.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-13 18:16:07 +02:00
Kumar Gala
db725c0ec9 drivers: Replace GPIO_CS Kconfig with devicetree detection
Use DT_INST_SPI_DEV_HAS_CS_GPIOS() in drivers to determine if we should
utilize CS_GPIO base SPI chipselect handling.  This allows us to remove
Kconfig option for this feature.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-09 13:07:05 +02:00
Torsten Rasmussen
407b49b35c cmake: use find_package to locate Zephyr
Using find_package to locate Zephyr.

Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.

Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.

It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Tomasz Bursztyka
4ae72db135 net: Enable PM settings on network devices
By changing the various *NET_DEVICE* macros. It is up to the device
drivers to either set a proper PM function or, if not supported or PM
disabled, to use device_pm_control_nop relevantly.

All existing macro calls are updated. Since no PM support was added so
far, device_pm_control_nop is used as the default everywhere.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-03-27 14:48:30 +02:00
Robert Lubos
7e7f05546d modules: nordic: Allow separate nRF 802.15.4 radio driver build
So far, nRF 802.15.4 radio driver build was dependent on the 802.15.4
subsystem in Zephyr. While this was a reasonable approach for samples,
it prevented the radio driver from being built as a standalone entity,
which could be useful in some applications (e. g. running core nRF
802.15.4 radio driver tests with Zephyr).

Resolve this, by providing a separate set of Kconfigs for the radio
driver, therefore allowing to build it as a separate entity. The 802154
subsystem simply enables the radio driver module in this case.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-28 15:18:42 +01:00
Ulf Magnusson
ae900a94d0 tests: net: all: kconfig: Do not assign promptless NET_INIT_PRIO
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.

NET_INIT_PRIO (defined in subsys/net/ip/Kconfig) is currently hardcoded
to 90 (it's not set via any Kconfig.defconfig files either). Maybe it
could be given a prompt or be removed, but just remove the assignment
for now.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-17 10:01:58 +02:00
Ulf Magnusson
8e4a9774f7 tests: net: all: kconfig: Do not assign promptless NET_ROUTING
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.

The prompt was removed in commit 2ec7e70509 ("net: routing: Hide routing
option temporarily").

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-17 10:01:43 +02:00
Ulf Magnusson
ba98e72db2 tests: net: all: kconfig: Do not assign promptless NET_RAW_MODE
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.

This symbol is selected by IEEE802154_RAW_MODE, defined in
drivers/ieee802154/Kconfig.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-16 14:34:41 -05:00
Ulf Magnusson
4d32d0ae02 tests: all: kconfig: Do not assign promptless NET_L2_IEEE802154_SUB_GHZ
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.

This symbol is enabled through being selected by IEEE802154_CC1200 and
IEEE802154_RF2XX.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-16 08:05:00 -06:00
Ulf Magnusson
95e5ac11ba tests: net: kconfig: Do not assign promptless NET_L2_IEEE802154_MGMT
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.

This symbol is already enabled indirectly through being selected by
NET_L2_IEEE802154_RFD, which is enabled in the configuration file.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-14 16:35:51 -05:00
Ulf Magnusson
e0848a8d61 tests: net: kconfig: Do not assign promptless NET_ROUTE symbol
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.

(There doesn't seem to be any way to enable this symbol, because it's
not being select'ed either.)

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-13 14:19:08 -05:00
Ulf Magnusson
04f966ed3e tests: all: Remove assignment to promptless NET_GPTP_CLOCK_ACCURACY
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.

Also remove the assignments to the other NET_GPTP_CLOCK_ACCURACY_*
symbols. They are all in the same choice (in
subsys/net/l2/ethernet/gptp/Kconfig), meaning only one of them can be
enabled, and the choice already defaults to
NET_GPTP_CLOCK_ACCURACY_UNKNOWN, which is the symbol assigned last.

The symbol assigned last becomes the choice selection when multiple
symbols in a choice are assigned to. The other choice symbols still
become n. Dependencies override assignments.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-13 13:51:16 +01:00
Ulf Magnusson
d748cb6118 tests: net: all: check_net_options.sh: Use lowercase for internal vars
This makes it possible to tell at a glance which variables are internal
to the script and which ones are parameters to it, which is very
helpful.

This convention is pretty common. See e.g. Google's shell style guide at
https://google.github.io/styleguide/shell.xml#Naming_Conventions, and
https://github.com/icy/bash-coding-style#naming-and-styles. It's older
than those though.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-10 14:34:46 -08:00
Ulf Magnusson
9d46779ca7 net: ieee802154: kconfig: Remove unused fragmentation debugging symbol
Unused after commit a76814bfb6 ("net: Convert core IP stack to use log
levels").

Found with a script.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-22 13:10:52 +03:00
Ulf Magnusson
2d8bd31b37 tests: net: Remove CONFIG_NET_HEADERS_ALWAYS_CONTIGUOUS assignment
This symbol is not user-configurable (has no prompt), so assignments in
prj.conf have no effect on it.

(It has no defaults either, and isn't selected/implied, so nothing in
vanilla Zephyr will ever enable it.)

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-18 09:13:49 +02:00
Alexander Wachter
35f01673ac net: l2: 6LoCAN implementation
This commit is an implementation of 6LoCAN, a 6Lo adaption layer for
Controller Area Networks. 6LoCAN is not yet standardised.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-08-08 13:25:01 +03:00
Alexander Wachter
c8c5f3bbf3 net: canbus: Rename canbus to canbus_raw
Rename the socket_can implementation from CANBUS to CANBUS_RAW.
This is a preperation for 6LoCAN which is a CANBUS L2 for IPv6.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-08-08 13:25:01 +03:00
Tomasz Bursztyka
b2b21412ae net/connection: Removing cache feature
There were various flaws in it that motivated its removal:

- No hash collision handling mechanism. In case that would happen, the
behavior of the network connection would be unknown. This is the main
drawback
- The lookup is not that much more efficient than the default one. The
only difference of gain is in connection comparison (a u32t comparison
vs a full connection compare). But the list handling is the same. It's
made worse by the presence of a negatives match array which can be
easily filled in and becomes then fully usless, appart from consuming
CPU. As well as adding a new connection: it requires the whole cache
to be cleared which is unefficient.
- Not memory efficient, even compared to a proper hash table.
Two arrays instead of one etc...

All of this could be fixed by using a proper hash table, though it
remains to be seen if such object could fit in Zephyr core.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-05-07 15:40:53 +03:00
Jukka Rissanen
fcf392c6c8 tests: net: all: Add more options to catch-all test
Add more Kconfig options to prj.conf file. In the future we need
to compile also in other hw than qemu_x86 in which case we need to
create separate test cases for those configurations.

Fixes #15282

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-04-23 10:29:38 +03:00
Anas Nashif
3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Thomas Stenersen
7516476386 kconfig: Use depend on instead of select to avoid kconfig loop
Remove use of select to "force" enabling other configs in subsys/fs
and subsys/net/l2. The forcing will cause infinite kconfig recursion.

Signed-off-by: Thomas Stenersen <thomas.stenersen@nordicsemi.no>
2019-03-12 19:42:40 +01:00
Jukka Rissanen
4043909d69 net: http: Remove HTTP client and server APIs
The old legacy APIs use net-app library and as that is being
removed, then the dependencies need to be removed also.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-01-25 11:21:20 -05:00
Jukka Rissanen
a7afdc3512 net: rpl: Remove the deprecated code
The RPL was deprecated earlier so remove it by this commit.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-01-13 09:40:36 -05:00
Anas Nashif
5060ca6a30 cmake: increase minimal required version to 3.13.1
Move to latest cmake version with many bug fixes and enhancements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-03 11:51:29 -05:00
Jukka Rissanen
86689030e8 net: Clarify logging in networking code
Remove network specific default and max log level setting
and start to use the zephyr logging values for those.

Remove LOG_MODULE_REGISTER() from net_core.h and place the
calls into .c files. This is done in order to avoid weird
compiler errors in some cases and to make the code look similar
as other subsystems.

Fixes #11343
Fixes #11659

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 12:00:04 +02:00
Tomasz Bursztyka
72e1c2b4c1 tests/net: Apply L2 change everywhere where relevant
Many tests use either Ethernet or Dummy L2 and as such require
modifications towards the driver API on their fake devices.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-30 11:12:13 -08:00
Robert Lubos
0f7698be8b tests: mqtt: Port tests to use new implementation
Port existing MQTT tests to new socket MQTT API.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-11-19 09:31:01 -05:00
Reto Schneider
7eabab2f5d samples, tests: Use semi-accurate project names
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming every project "NONE"
defeats this functionality.

This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names in the samples (and again, in
the tests folder) folder, small manual adjustments have been done.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
2018-10-27 21:31:25 -04:00
Jukka Rissanen
f3f04bf9eb tests: net: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
a81aad9756 tests: net: Run networking tests only for selected platforms
Run networking tests for native_posix, qemu_x86 and qemu_cortex_m3
platforms only as the tests are generic enough so no need to run
them in real physical device.

Fixes #9623 #9614 #9622 #9621 #9618

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-08-29 10:57:56 -04:00
Sebastian Bøe
55ee53ce91 cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts
Prepend the text 'cmake_minimum_required(VERSION 3.8.2)' into the
application and test build scripts.

Modern versions of CMake will spam users with a deprecation warning
when the toplevel CMakeLists.txt does not specify a CMake
version. This is documented in bug #8355.

To resolve this we include a cmake_minimum_required() line into the
toplevel build scripts. Additionally, cmake_minimum_required is
invoked from within boilerplate.cmake. The highest version will be
enforced.

This patch allows us to afterwards change CMake policy CMP000 from OLD
to NEW which in turn finally rids us of the verbose warning.

The extra boilerplate is considered more acceptable than the verbosity
of the CMP0000 policy.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-08-15 04:06:50 -07:00
Paul Sokolovsky
028aae1ec9 net: config: Rename Kconfig options to correspond to library name
This finishes refactor of splitting off net_config library name from
net_app library, started in c60df1311, c89a06dbc. This commit makes
sure that Kconfig options are prefixed with CONFIG_NET_CONFIG_
instead of CONFIG_NET_APP_, and propagates these changes thru the
app configs in the tree.

Also, minor dependency, etc. tweaks are made.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-08-13 18:42:31 -07:00
Jukka Rissanen
00e37cbb5b net: IPv4 link local support
Add basic IPv4 Link Local support as described in RFC 3927.

Signed-off-by: Matthias Boesl <matthias.boesl@gmail.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-31 16:34:28 +03:00
Jukka Rissanen
45b06a252f net: gptp: Initial core IEEE 802.1AS support
Core IEEE 802.1AS-2011 (gPTP) support and application interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Julien Chevrier <julien.chevrier@intel.com>
2018-06-28 16:50:50 +03:00
Ulf Magnusson
4317a181c9 tests: net: all: Increase NET_MAX_CONTEXTS from 4 to 5
DNS_RESOLVER_MAX_SERVERS has the range [1,NET_MAX_CONTEXTS], with
NET_MAX_CONTEXTS being set to 4, but is set to 5. Out-of-range .config
values are ignored, so the symbol reverts to its default value (1).

Increase NET_MAX_CONTEXTS to 5. DNS_SERVER{1-5} being set probably
implies that DNS_RESOLVER_MAX_SERVERS shouldn't be decreased to 4.

This fixes two Kconfig warnings (out-of-range + didn't get assigned
value).

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-28 12:20:10 -04:00
Ulf Magnusson
3c8e033e69 tests: net: all: Remove CONFIG_HTTP_HEADER_FIELD_ITEMS assignment
This symbol was removed by commit d1675bf3e6 ("net: http: Remove the
old legacy API").

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-25 11:21:01 -04:00
Ulf Magnusson
f6bdcb71ea tests: net: all: Fix assignments to old nbuf API Kconfig symbols
These symbols were renamed by commit bf964cdd4c ("net: Renaming net
nbuf API to net pkt API").

Update the assignments to use the new names.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-25 11:21:01 -04:00
Ulf Magnusson
7765813787 tests: net: all: Fix assignments to old TIME_WAIT Kconfig symbols
CONFIG_NET_TCP_{TIME_WAIT,2MSL_TIME} were replaced by
CONFIG_NET_TCP_TIME_WAIT_DELAY in commit 89f57c225a ("net:tcp: Define
single condig option for TIME_WAIT delay"), which also switched from
seconds to milliseconds for specifying the delay.

Remove the old assignments and set the new symbol to give the same
behavior as before.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-25 11:21:01 -04:00
Ulf Magnusson
637ad4cc49 tests: net: all: Remove redundant/misspelled NET_RPL assignments
CONFIG_NET_RPL_MC_ETX was misspelled as "..._EXT".

CONFIG_NET_RPL_MC_{NONE,EXT,ENERGY} are choice symbols. Setting a choice
symbol to 'y' implies that none of the other choice symbols are
selected, so remove the 'n' assignments and keep just the
CONFIG_NET_RPL_MC_ENERGY=y assignment.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-25 11:21:01 -04:00
Kumar Gala
ac13bedc84 tests: net: all: Fix COAP enablement in prj.conf
We had a left over from the old ZOAP lib in pjr.conf.  So enable the
COAP lib instead of ZOAP.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-23 09:06:05 -05:00
Anas Nashif
1f2627a638 tests: net: style, tag, and category fixes
Fix coding style, test tags and use categories.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-25 14:18:15 +05:30
Dario Pennisi
6d387ec98f net: Remove the need for an l2 on offloaded drivers
Drivers will be directly contacted via net_if's offload attribute. No
need for a an extra layer as an L2.

Signed-off-by: Dario Pennisi <dario@iptronix.com>
Signed-off-by: Massimiliano Agneni <massimiliano.agneni@iptronix.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-04-12 09:56:07 -04:00
Anas Nashif
d7e7b08cdc tests: cleanup meta-data of various tests
Use sensible test name and cleanup filtering.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-09 22:55:20 -04:00
Jukka Rissanen
de13e979fc net: if: vlan: Add virtual lan support
This allows creation of virtual lan (VLAN) networks. VLAN support is
only available for ethernet network technology.

Fixes #3234

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-04-05 08:54:19 -04:00
Anas Nashif
23f81eeb42 tests/samples: fixed yaml syntax
Use a map directory, avoid the list which makes parsing a bit
cumbersome.

Fixes #5109

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-11 14:47:08 -05:00
Tomasz Bursztyka
b52c0f24a6 net/ieee802154: Make RAW mode generic
- Renaming NET_L2_RAW_CHANNEL to NET_RAW_MODE
- Create a generic IEEE 802.15.4 raw mode for drivers
- Modify the IEEE 802.15.4 drivers so it passes the packet unmodified,
up to code using that mode to apply the necessary changes on the
received net_pkt according to their needs
- Modify wpanusb/wpan_serial relevantly

Fixes #5004

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-11-22 10:10:09 -05:00
Sebastian Bøe
0829ddfe9a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe
12f8f76165 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Leandro Pereira
da9b0ddf5b drivers: Rename random to entropy
This should clear up some of the confusion with random number
generators and drivers that obtain entropy from the hardware.  Also,
many hardware number generators have limited bandwidth, so it's natural
for their output to be only used for seeding a random number generator.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-11-01 08:26:29 -04:00