Commit Graph

11516 Commits

Author SHA1 Message Date
Carles Cufi b6109496ff arm: Cortex-M0: Adapt core register code to M0
The Cortex-M0(+) and in general processors that support only the ARMv6-M
instruction set have a reduced set of registers and fields compared to
the ARMv7-M compliant processors.
This change goes through all core registers and disables or removes
everything that is not part of the ARMv6-M architecture when compiling
for Cortex-M0.

Jira: ZEP-1497

Change-id: I13e2637bb730e69d02f2a5ee687038dc69ad28a8
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-03 22:44:35 +00:00
Carles Cufi 41bcac3f1c arm: nvic: Fix exception priority access on Cortex-M0(+)
The Cortex-M0(+) and in general processors that support only the ARMv6-M
instruction set can only access the NVIC_IPRn registers with word
accesses, and not with byte ones like the Cortex-M3 and onwards. This
patch addresses the issue by modifying the way that _NvicIrqPrioSet()
writes to the IPRn register, using a word access for Cortex-M0(+).
A similar issue is addressed for internal exceptions, this time for the
SHPR registers that are accessed differently on ARMv6-M.

Reference code taken from CMSIS.

Jira: ZEP-1497

Change-id: I08e1bf60b3b70579b42f4ab926ee835c18bb65bb
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-03 22:44:31 +00:00
Johan Hedberg ae0ce20699 arm: nvic: Use uint8_t for priority level
Since the value is treated as uint8_t internally anyway, just use
uint8_t for the input and output parameter types.

Jira: ZEP-1497

Change-Id: I61d68eb39cba5d82dad6ab7593b267c26e003d2b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-03 21:32:49 +00:00
Andrew Boie 0f08bd8cf8 gpio_basic_api: fix format codes
Change-Id: I006a0c3efe24a6d41a488a466cba97e9bbd1c164
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-01-03 20:37:40 +00:00
Inaky Perez-Gonzalez 57eb17a8ca tests/kernel/stackprot: 'fatal fault' is not a failure
By default, when a 'fatal fault' message is seen in the output of any
testcase, it is consider an inmediate fatal condition and the test
case is aborted.

However, this testcase is provoking the situation to verify the
condition is caught. This, it shall NOT be considered a fatal fault
and the default overriden to allow it to proceed.

This was done in the legacy testcases and now is moved to this
testcase, ported from legacy.

Change-Id: Icac6cf55cae2ffd9b071e9dd1f35918b7b30de5e
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-01-03 19:30:54 +00:00
Genaro Saucedo Tejada e3029f719f sanity: prevent stack corruption at test_sema
Stack for task tStartTask at tests/legacy/kernel/test_sema/microkernel
is not big enough since unfied kernel was enabled by default for all
test (since commit c2de216).

Change-Id: I3332cd5e14ca384428834697a1841fa680a68b00
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2017-01-03 19:30:31 +00:00
Juro Bystricky 5ec3a7d04a test_thread_init.c: fix build error
Fix build error (picked by GCC 6.x):

    error: ‘stack_size’ defined but not used [-Werror=unused-const-variable=]

Change-Id: I402324fedaea9d0a10ee6533ba957ce18fa0fb83
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2017-01-03 19:29:02 +00:00
Inaky Perez-Gonzalez 9a36cb6456 sanitycheck: add --log-file to log everything to a file too
Currently CI plays tricks with `tee` to capture the output and post
process it. This makes it more complex to handle and easier for it to
fail in ways it should not.

So add a simple log capture option sanity check that mirrors the
stdout output, removing color encoding for errors.

Change-Id: I6de0b6cfe4da9c289f537979545dddbcd49cf834
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-01-03 19:21:31 +00:00
Anas Nashif 66cfcc26bc tests: introduce Makefile.test
To customise test builds and support test related features such as time
stamps and a boot banner, introduce a Makefile variant that is dedicated
to testing.

Initially we introduce a new config overlay that is used for all tests, in
this case we enable BOOT_BANNER and BUILD_TIMESTAMP. This will print the
current version and the date, useful when reporting bugs and also an
indicator that the system has booted before the test has started.

For example:

[QEMU] CPU: qemu32
***** BOOTING ZEPHYR OS v1.6.99 - BUILD: Dec 21 2016 19:57:13 *****
tc_start() - Test Nanokernel CPU and thread routines
Initializing nanokernel objects
...
..

Change-Id: I224318cdeb55a301964ea366dbc577e2e3a09175
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-03 17:48:44 +00:00
Anas Nashif 6e1fbd98d0 doc: move c library section to subsystems
Also reorder subsystems alphabetically.

Change-Id: Ie76588d0b662c634f770530462f7ad77ffcbba62
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-03 17:31:58 +00:00
Anas Nashif 8c43544e1b doc: move ztest to subsystems
Change-Id: Ia8078625d504c17ef63044c2f71067a7c080adf6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-03 17:31:57 +00:00
Flavio Santes b3ded5e25b MAINTAINERS: Update network applications section
Update network applications section: dns, http, mqtt and zoap.

Add subsys/net/lib/ and tests/net/lib/ to the Networking section

Change-Id: I7373677a9f31ebe546c60834302d900affbc285b
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-03 15:27:50 +00:00
Anas Nashif 98f9b104cd Merge "Merge net branch into master" 2017-01-03 14:22:15 +00:00
Marcus Shawcroft 52e3eac4d5 Fixup indentation.
Change-Id: I5de6adb995d60e28d3765ef8cfd7de4ca4197d8a
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-03 09:33:14 +00:00
Marcus Shawcroft 66d66848cb gpio: Fix spelling mistake.
Change-Id: I983a097b0fc14da0f622541c667950c7759b9e78
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-03 09:30:55 +00:00
Tomasz Bursztyka 7028b433a1 Merge net branch into master
Main changes:

- Former iot libraries are now part of network stack as net protocols.
  (lib/iot/ is now susbys/net/lib/)
- Network stack logging is more flexible with its own sys log level
- Network statistics are now handled privately into the stack, and
  exposed via net_mgmt API to the user. This prepares the future
  statistics per-interface, per-l2 etc...

----------------------------------------------------------------
Andrei Emeltchenko (1):
      samples: net: Add echo_client build test for frdm CC2520 configuration

Flavio Santes (2):
      samples/net: Fix logging format error
      net: Restructure network protocols

Marcus Shawcroft (9):
      dhcpv4: Report address acquisition.
      samples/dhcpv4: Add missing NET_MGMT configury.
      net/dhcpv4: Correct spellings in comments.
      net/dns: Drop unnecessary ETH_KSDK configuration.
      net/dhcpv4: Re-instate init_app()
      ethernet/arp: Use gateway for non local ipv4 routing.
      dhcpv4: Add option parsing diagnostics.
      net/dhcpv4: Use router option to set IPv4 GW.
      net/dhcpv4: Use net_if_ipv4_set_netmask()

Tomasz Bursztyka (18):
      tests: net: Fix format issues
      net: buf: Fix a debug message missing a parameter
      net: log: Do not select STDOUT_CONSOLE
      samples: net: STDOUT_CONSOLE is not necessary
      net: buf: Change NET_BUF_DEBUG to NET_BUF_LOG and add a level option
      net: buf: Let's make use of func/line parameters when available
      net: statistics: Fix comment length issue
      net: statistics: Move current statistics code to its own file
      net: statistics: Make statistics calculation fully private
      net: statistics: Provide specific Kconfig options
      net: statistics: Have a dedicated struct for rpl data
      net: statistics: Expose relevant information through net mgmt API
      net: ethernet: IPv6 packet length should be relevantly handled
      net: rpl: Fix a build issue
      net: nbuf: Let's remove inner type
      net: tests: Add platforms whitelist to http header unit test
      net: ip: Improve logging by adding a dedicated sys_log level
      net: shell: NET_SHELL is not NET_LOG dependent

Vinicius Costa Gomes (4):
      samples/zoap_client: Use the correct option for TAP
      samples/zoap_server: Use the correct option for TAP
      lib/zoap: Fix incorrect values for payload size
      tests/zoap: Add test for payload size

 doc/doxygen.config                                 |   3 +-
 include/net/buf.h                                  |   6 +-
 include/{iot => net}/dns_client.h                  |   0
 include/{iot => net}/http_parser.h                 |   0
 include/{iot => net}/mqtt.h                        |   2 +-
 include/{iot => net}/mqtt_types.h                  |   0
 include/net/nbuf.h                                 |  20 --
 include/net/net_context.h                          |  21 --
 include/net/net_core.h                             |  14 +-
 include/net/net_ip.h                               |   6 +-
 include/net/net_stats.h                            | 180 +++++++++-----
 {lib/iot/zoap => include/net}/zoap.h               |   0
 .../net/zoap_link_format.h                         |   0
 lib/Kbuild                                         |   1 -
 lib/Kconfig                                        |   2 -
 lib/Makefile                                       |   2 -
 lib/iot/Makefile                                   |  15 --
 lib/iot/dns/Makefile                               |   5 -
 lib/iot/mqtt/Makefile                              |   2 -
 lib/iot/zoap/Kbuild                                |   4 -
 lib/iot/zoap/Makefile                              |   1 -
 samples/net/README                                 |   4 +-
 samples/net/dhcpv4_client/prj_frdm_k64f.conf       |   3 +
 samples/net/dhcpv4_client/prj_qemu_x86.conf        |   2 +
 samples/net/dhcpv4_client/src/main.c               |  21 +-
 samples/net/dns_client/README_IPv4                 |   2 +-
 samples/net/dns_client/prj_frdm_k64f.conf          |   8 -
 samples/net/dns_client/src/main.c                  |   2 +-
 .../net/echo_client/prj_arduino_101_cc2520.conf    |   1 +
 samples/net/echo_client/prj_cc2520.conf            |   1 +
 samples/net/echo_client/prj_frdm_k64f_cc2520.conf  |   1 +
 samples/net/echo_client/prj_qemu_802154.conf       |   1 +
 samples/net/echo_client/src/echo-client.c          |   6 +-
 samples/net/echo_client/testcase.ini               |   6 +
 .../net/echo_server/prj_arduino_101_cc2520.conf    |   1 +
 samples/net/echo_server/prj_cc2520.conf            |   1 +
 samples/net/echo_server/prj_frdm_k64f_cc2520.conf  |   1 +
 samples/net/echo_server/prj_qemu_802154.conf       |   1 +
 samples/net/echo_server/src/echo-server.c          |   4 +-
 samples/net/ieee802154/cc2520/prj.conf             |   2 -
 samples/net/ieee802154/qemu/prj.conf               |   1 -
 samples/net/leds_demo/src/Makefile                 |   1 -
 samples/net/leds_demo/src/leds-demo.c              |   8 +-
 samples/net/leds_demo/testcase.ini                 |   2 +-
 .../net/mbedtls_dtlsclient/prj_arduino_101.conf    |   2 -
 samples/net/mbedtls_dtlsclient/prj_qemu_x86.conf   |   2 -
 samples/net/mbedtls_sslclient/prj_galileo.conf     |   2 -
 samples/net/wpan_serial/prj.conf                   |   1 -
 samples/net/wpanusb/prj.conf                       |   1 -
 samples/net/zoap_client/prj.conf                   |   2 +-
 samples/net/zoap_client/src/zoap-client.c          |   2 +-
 samples/net/zoap_server/prj.conf                   |   2 +-
 samples/net/zoap_server/src/Makefile               |   2 -
 samples/net/zoap_server/src/zoap-server.c          |   2 +-
 samples/net/zperf/prj_galileo_ethernet.conf        |   1 -
 samples/net/zperf/prj_galileo_ethernet_prof.conf   |   1 -
 samples/net/zperf/src/zperf_shell.c                |   4 +-
 samples/net/zperf/src/zperf_udp_receiver.c         |   2 +-
 subsys/net/Kconfig                                 |  27 ++-
 subsys/net/Makefile                                |   4 +
 subsys/net/buf.c                                   |  28 +--
 subsys/net/ip/6lo.c                                |   2 +-
 subsys/net/ip/Kconfig                              |  10 +
 subsys/net/ip/Kconfig.debug                        |  54 ++++-
 subsys/net/ip/Kconfig.rpl                          |   8 -
 subsys/net/ip/Kconfig.stats                        |  93 +++++++
 subsys/net/ip/Makefile                             |   1 +
 subsys/net/ip/connection.c                         |  20 +-
 subsys/net/ip/dhcpv4.c                             |  61 ++++-
 subsys/net/ip/icmpv4.c                             |  34 +--
 subsys/net/ip/icmpv6.c                             |  36 +--
 subsys/net/ip/ipv4.c                               |   4 +-
 subsys/net/ip/ipv6.c                               |  46 ++--
 subsys/net/ip/l2/arp.c                             |  36 +--
 subsys/net/ip/l2/bluetooth.c                       |   7 +-
 subsys/net/ip/l2/ethernet.c                        |   9 +-
 subsys/net/ip/l2/ieee802154/ieee802154.c           |   4 +-
 subsys/net/ip/l2/ieee802154/ieee802154_fragment.c  |   2 +-
 subsys/net/ip/l2/ieee802154/ieee802154_frame.c     |   4 +-
 .../net/ip/l2/ieee802154/ieee802154_radio_aloha.c  |   4 +-
 .../ip/l2/ieee802154/ieee802154_radio_csma_ca.c    |   4 +-
 subsys/net/ip/nbr.c                                |   6 +-
 subsys/net/ip/nbuf.c                               | 252 +++++++++----------
 subsys/net/ip/net_context.c                        |  11 +-
 subsys/net/ip/net_core.c                           | 157 ++----------
 subsys/net/ip/net_if.c                             |  20 +-
 subsys/net/ip/net_mgmt.c                           |   2 +-
 subsys/net/ip/net_private.h                        |   6 +-
 subsys/net/ip/net_shell.c                          |  11 +-
 subsys/net/ip/net_stats.c                          | 262 ++++++++++++++++++++
 subsys/net/ip/net_stats.h                          | 270 +++++++++++++++++++++
 subsys/net/ip/route.c                              |  18 +-
 subsys/net/ip/rpl-mrhof.c                          |   6 +-
 subsys/net/ip/rpl-of0.c                            |   6 +-
 subsys/net/ip/rpl.c                                |  94 ++++---
 subsys/net/ip/tcp.c                                |  20 +-
 subsys/net/ip/trickle.c                            |   4 +-
 subsys/net/ip/utils.c                              |   2 +-
 {lib/iot => subsys/net/lib}/Kbuild                 |   0
 {lib/iot => subsys/net/lib}/Kconfig                |  10 +-
 subsys/net/lib/Makefile                            |  15 ++
 {lib/iot => subsys/net/lib}/dns/Kconfig            |   0
 subsys/net/lib/dns/Makefile                        |   7 +
 {lib/iot => subsys/net/lib}/dns/README             |   4 -
 {lib/iot => subsys/net/lib}/dns/dns_client.c       |   2 +-
 {lib/iot => subsys/net/lib}/dns/dns_pack.c         |   0
 {lib/iot => subsys/net/lib}/dns/dns_pack.h         |   0
 {lib/iot => subsys/net/lib}/http/Kconfig           |   0
 {lib/iot => subsys/net/lib}/http/Makefile          |   0
 .../iot => subsys/net/lib}/http/README_http_parser |   0
 {lib/iot => subsys/net/lib}/http/http_parser.c     |   2 +-
 {lib/iot => subsys/net/lib}/mqtt/Kconfig           |   0
 subsys/net/lib/mqtt/Makefile                       |   4 +
 {lib/iot => subsys/net/lib}/mqtt/mqtt.c            |   2 +-
 {lib/iot => subsys/net/lib}/mqtt/mqtt_pkt.c        |   0
 {lib/iot => subsys/net/lib}/mqtt/mqtt_pkt.h        |   2 +-
 subsys/net/lib/zoap/Kbuild                         |   4 +
 {lib/iot => subsys/net/lib}/zoap/Kconfig           |   0
 subsys/net/lib/zoap/Makefile                       |   1 +
 {lib/iot => subsys/net/lib}/zoap/zoap.c            |   4 +-
 .../net/lib/zoap/zoap_link_format.c                |   4 +-
 tests/iot/test_http_header/testcase.ini            |   3 -
 tests/iot/test_mqtt_packet/src/Makefile            |   4 -
 tests/net/6lo/prj.conf                             |   1 -
 tests/net/6lo/src/main.c                           |  26 +-
 tests/net/arp/src/main.c                           |   2 +-
 tests/net/buf/prj.conf                             |   3 +-
 tests/net/dhcpv4/src/main.c                        |   2 +-
 tests/net/ieee802154/fragment/src/main.c           |   2 +-
 .../net/ieee802154/l2/src/ieee802154_fake_driver.c |   2 +-
 tests/net/ip-addr/src/main.c                       |   2 +-
 tests/net/ipv6/src/main.c                          |   2 +-
 .../lib/http_header_fields}/Makefile               |   0
 .../lib/http_header_fields}/README                 |   0
 .../lib/http_header_fields}/prj.conf               |   5 +-
 .../lib/http_header_fields}/src/Makefile           |   2 +-
 .../http_header_fields/src/http_header_fields.c}   |   2 +-
 .../lib/http_header_fields}/testcase.ini           |   2 +-
 .../lib/mqtt_packet}/Makefile                      |   0
 .../lib/mqtt_packet}/README                        |   0
 .../lib/mqtt_packet}/prj.conf                      |   0
 tests/net/lib/mqtt_packet/src/Makefile             |   4 +
 .../lib/mqtt_packet/src/mqtt_packet.c}             |   0
 tests/net/lib/mqtt_packet/testcase.ini             |   4 +
 tests/net/{ => lib}/zoap/Makefile                  |   0
 tests/net/{ => lib}/zoap/prj.conf                  |   0
 tests/net/{ => lib}/zoap/src/Makefile              |   0
 tests/net/{ => lib}/zoap/src/main.c                |  14 +-
 tests/net/{ => lib}/zoap/testcase.ini              |   0
 tests/net/nbuf/prj.conf                            |   3 +-
 tests/net/nbuf/src/main.c                          |   2 +-
 tests/net/neighbor/src/main.c                      |   2 +-
 tests/net/route/src/main.c                         |   2 +-
 tests/net/rpl/src/main.c                           |   2 +-
 tests/net/tcp/prj.conf                             |   1 +
 tests/net/tcp/src/main.c                           |   2 +-
 tests/net/utils/src/main.c                         |   2 +-
 157 files changed, 1429 insertions(+), 765 deletions(-)
 rename include/{iot => net}/dns_client.h (100%)
 rename include/{iot => net}/http_parser.h (100%)
 rename include/{iot => net}/mqtt.h (99%)
 rename include/{iot => net}/mqtt_types.h (100%)
 rename {lib/iot/zoap => include/net}/zoap.h (100%)
 rename lib/iot/zoap/link-format.h => include/net/zoap_link_format.h (100%)
 delete mode 100644 lib/iot/Makefile
 delete mode 100644 lib/iot/dns/Makefile
 delete mode 100644 lib/iot/mqtt/Makefile
 delete mode 100644 lib/iot/zoap/Kbuild
 delete mode 100644 lib/iot/zoap/Makefile
 create mode 100644 subsys/net/ip/Kconfig.stats
 create mode 100644 subsys/net/ip/net_stats.c
 create mode 100644 subsys/net/ip/net_stats.h
 rename {lib/iot => subsys/net/lib}/Kbuild (100%)
 rename {lib/iot => subsys/net/lib}/Kconfig (77%)
 create mode 100644 subsys/net/lib/Makefile
 rename {lib/iot => subsys/net/lib}/dns/Kconfig (100%)
 create mode 100644 subsys/net/lib/dns/Makefile
 rename {lib/iot => subsys/net/lib}/dns/README (68%)
 rename {lib/iot => subsys/net/lib}/dns/dns_client.c (99%)
 rename {lib/iot => subsys/net/lib}/dns/dns_pack.c (100%)
 rename {lib/iot => subsys/net/lib}/dns/dns_pack.h (100%)
 rename {lib/iot => subsys/net/lib}/http/Kconfig (100%)
 rename {lib/iot => subsys/net/lib}/http/Makefile (100%)
 rename {lib/iot => subsys/net/lib}/http/README_http_parser (100%)
 rename {lib/iot => subsys/net/lib}/http/http_parser.c (99%)
 rename {lib/iot => subsys/net/lib}/mqtt/Kconfig (100%)
 create mode 100644 subsys/net/lib/mqtt/Makefile
 rename {lib/iot => subsys/net/lib}/mqtt/mqtt.c (99%)
 rename {lib/iot => subsys/net/lib}/mqtt/mqtt_pkt.c (100%)
 rename {lib/iot => subsys/net/lib}/mqtt/mqtt_pkt.h (99%)
 create mode 100644 subsys/net/lib/zoap/Kbuild
 rename {lib/iot => subsys/net/lib}/zoap/Kconfig (100%)
 create mode 100644 subsys/net/lib/zoap/Makefile
 rename {lib/iot => subsys/net/lib}/zoap/zoap.c (99%)
 rename lib/iot/zoap/link-format.c => subsys/net/lib/zoap/zoap_link_format.c (99%)
 delete mode 100644 tests/iot/test_http_header/testcase.ini
 delete mode 100644 tests/iot/test_mqtt_packet/src/Makefile
 rename tests/{iot/test_http_header => net/lib/http_header_fields}/Makefile (100%)
 rename tests/{iot/test_http_header => net/lib/http_header_fields}/README (100%)
 rename tests/{iot/test_http_header => net/lib/http_header_fields}/prj.conf (58%)
 rename tests/{iot/test_http_header => net/lib/http_header_fields}/src/Makefile (95%)
 rename tests/{iot/test_http_header/src/test_http_header.c => net/lib/http_header_fields/src/http_header_fields.c} (99%)
 rename tests/{iot/test_mqtt_packet => net/lib/http_header_fields}/testcase.ini (86%)
 rename tests/{iot/test_mqtt_packet => net/lib/mqtt_packet}/Makefile (100%)
 rename tests/{iot/test_mqtt_packet => net/lib/mqtt_packet}/README (100%)
 rename tests/{iot/test_mqtt_packet => net/lib/mqtt_packet}/prj.conf (100%)
 create mode 100644 tests/net/lib/mqtt_packet/src/Makefile
 rename tests/{iot/test_mqtt_packet/src/test_mqtt_packet.c => net/lib/mqtt_packet/src/mqtt_packet.c} (100%)
 create mode 100644 tests/net/lib/mqtt_packet/testcase.ini
 rename tests/net/{ => lib}/zoap/Makefile (100%)
 rename tests/net/{ => lib}/zoap/prj.conf (100%)
 rename tests/net/{ => lib}/zoap/src/Makefile (100%)
 rename tests/net/{ => lib}/zoap/src/main.c (98%)
 rename tests/net/{ => lib}/zoap/testcase.ini (100%)

Change-Id: I6b32349768694ae3cca9cda68e88e6c5cc97ae61
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 11:59:59 +01:00
Tomasz Bursztyka d43af0b4c8 net: shell: NET_SHELL is not NET_LOG dependent
And it's not really a debugging option either, one might want to use it
for the features it brings. Thus moving it out of Kconfig.debug.

Change-Id: Ie1e2d2bcba94ad4b8354d3cc56087227184039b6
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:20 +01:00
Tomasz Bursztyka a1aa08c288 net: ip: Improve logging by adding a dedicated sys_log level
Let's make net stack having its own level of debugging through sys_log.
It replaces NET_DEBUG by NET_LOG_ENABLED, which is then semantically
better: someone wanting to log the errors might want that not only for
debugging.

Along with it, CONFIG_NET_LOG_GLOBAL option is added, in order to enable
all available logging in network stack. It is disabled by default but
might be found useful when warning/errors need to be logged, so it is
then unnecessary to selectively enable by hand all CONFIG_NET_DEBUG_*
options.

It is possible, locally, to override CONFIG_SYS_LOG_NET_LEVEL by setting
the level one want to NET_SYS_LOG_LEVEL. This can be useful on samples
or tests.

Change-Id: I56a8f052340bc3a932229963cc69b39912093b88
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:20 +01:00
Tomasz Bursztyka 4869dc9786 net: tests: Add platforms whitelist to http header unit test
quark_d2000_crb does not build as ROM and RAM space are way too little
for it.

Change-Id: I1a5992dcd49f90fa6604cd8ab76db7e170be7cd4
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:20 +01:00
Tomasz Bursztyka 2e95186eff net: nbuf: Let's remove inner type
It's possible to know from which pool the nbuf comes from so
let's reduce nbuf size by removing its internal type attribute which
becomes then useless.

When a data buffer is not coming from nbuf data buffer pool, let's call
it "EXTERNAL", just to make debugging handling a little simple in the
code.

Change-Id: I6931394c8c4f594137f6380be0a0ba5cea371040
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:19 +01:00
Flavio Santes ac7300611c net: Restructure network protocols
This commit restructures the network protocols. Changes applied are:

- Move lib/iot/ to subsys/net/lib
- Move network protocol headers to include/net
- Move lib/iot/zoap/link-format.h to include/net/zoap_link_format.h
  and link-format.c to zoap_link_format.c
- Move tests/iot/ to tests/net/lib/
- Adapt sample code
- Adapt build system
- Modify doxygen paths

Change-Id: I37085fa4cc76a8a8e19a499ecb4e87b451120349
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-02 10:03:19 +01:00
Marcus Shawcroft dc862ec104 net/dhcpv4: Use net_if_ipv4_set_netmask()
Use the interface function rather than writing directly to the iface
structure.  Check for errors in nbuf read.

Change-Id: I75311755c2060b640325962ada28adea597cb914
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-02 10:03:19 +01:00
Marcus Shawcroft defbc89358 net/dhcpv4: Use router option to set IPv4 GW.
Change-Id: I58f47c02665990dcb656f7e6f7802e1958b420a8
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-02 10:03:19 +01:00
Marcus Shawcroft 065c84d5a6 dhcpv4: Add option parsing diagnostics.
Change-Id: I81a4fa5df561217bfae0d48eb458bf45cfe55d16
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-02 10:03:19 +01:00
Marcus Shawcroft 739278e09d ethernet/arp: Use gateway for non local ipv4 routing.
Detect non local IPv4 destination addresses earlier and route them via
the gw address. Ensure that the ARP table is populated with the GW
address rather than the final destination address.

Jira: ZEP-1473

Change-Id: I3b628584148b760340ef0fea4da4e8893702c832
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-02 10:03:19 +01:00
Marcus Shawcroft 2fc5eb2f4c net/dhcpv4: Re-instate init_app()
Re-instate the init_app()call which was accidentally removed by commit
commit 34f9391c9cf5 ("dhcpv4: Report address acquisition.")

Change-Id: Ic5ef70fd855a5bcb3ea1171de652994db493f4bb
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-02 10:03:19 +01:00
Vinicius Costa Gomes c538bb6602 tests/zoap: Add test for payload size
Add a test for the available space for the payload, so the problem with
the payload length doesn't regresses.

Change-Id: Ifef541d8428947eb482729aa773a7e9ddd2b6f81
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-02 10:03:19 +01:00
Vinicius Costa Gomes 909ad359bf lib/zoap: Fix incorrect values for payload size
When retrieving the payload length of the payload, there was a mistake,
what was already in the buffer (buf->len) was being considered twice,
net_buf_tailroom() already takes buf->len into account, resulting in
incorrect values.

Change-Id: I3b78d55abca4a448cab5e035b9d66352a3c59110
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-02 10:03:18 +01:00
Tomasz Bursztyka 8ab2a90231 net: rpl: Fix a build issue
s/energy_est/estimation when using net_rpl_node_energy_object.

Change-Id: I4b326a0dbbca11d48de0c595dfe843495fe10e04
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:18 +01:00
Tomasz Bursztyka ff5954890a net: ethernet: IPv6 packet length should be relevantly handled
It's much different than IPv4 where it's possible to find the whole
packet length. Here it has to count also the ipv6 header size by itself.

Jira: ZEP-1422

Change-Id: I84b1602ac75ef81b9ceda7898ca9dedf2e54d633
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:18 +01:00
Tomasz Bursztyka a79f9bcbc4 net: statistics: Expose relevant information through net mgmt API
User application can request the information it wants via the generic
net_mgmt() call, following the NET_REQUEST_STATS_* codes.

Change-Id: Ia9e7d318cf11b7bf8bfaf1ad63c8c985be846cc1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:18 +01:00
Tomasz Bursztyka 88b99fa782 net: statistics: Have a dedicated struct for rpl data
This will be useful for net mgmt based API to grab statistics.

Change-Id: Id3904c48cfdd6c6fb01b6919948eb13af826ca1e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:18 +01:00
Tomasz Bursztyka cbd1609bf6 net: statistics: Provide specific Kconfig options
This will help to track only what's wanted (ipv6, tpc, udp, else...) if
needed to.

Change-Id: I5c2e5e582db629b5d0e1cd98004f693c50f532a4
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:18 +01:00
Tomasz Bursztyka 06e2b421af net: statistics: Make statistics calculation fully private
Let's change from macros to inlined function to make things nicer.

Change-Id: Ie98e0667613961b03c84ca60bc551d0f473765f6
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:18 +01:00
Tomasz Bursztyka a533eb9b4f net: statistics: Move current statistics code to its own file
This file will own more statistics handling in a near future.

Change-Id: Ifaf86852f5c7166e6878b5dc8f4cd4c166dbee90
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:18 +01:00
Tomasz Bursztyka 2f9efd1a8e net: statistics: Fix comment length issue
Some were > 80 chars.

Change-Id: Ie7175c973b4e1ee4039380b0a233d88a60e6df4a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:17 +01:00
Tomasz Bursztyka e3cca46a1b net: buf: Let's make use of func/line parameters when available
It clutters a bit the code with ifdefs but it's quite useful when
debugging.

Change-Id: I4f6899d052921b8ef8a7ec2f6e7df927a1bca2f1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:17 +01:00
Tomasz Bursztyka 0a1617365f net: buf: Change NET_BUF_DEBUG to NET_BUF_LOG and add a level option
It will be thus possible to enable only the error logging, or the other
sys_log levels.

Change-Id: I0c0ed789f7cfbb4811320e8f8249151288274873
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:17 +01:00
Tomasz Bursztyka 6158dfdda6 samples: net: STDOUT_CONSOLE is not necessary
printk can do the job properly.

Change-Id: Ib743328e046bdb29be26adfe5cd007aaa758cd64
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:17 +01:00
Tomasz Bursztyka 4308da9288 net: log: Do not select STDOUT_CONSOLE
printk is anyway the routine being selected for sys_log.

Change-Id: Id6b516aa6ab8d4d420b9afe22b5e6b832dd3e216
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:17 +01:00
Tomasz Bursztyka 90ac0b5c20 net: buf: Fix a debug message missing a parameter
Change-Id: I25a199ba074fa9affaf0a249b6af842a3a477ed7
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:17 +01:00
Tomasz Bursztyka 56f25b49a9 tests: net: Fix format issues
Fixes:
error: format '%u' expects argument of type 'unsigned int'

Change-Id: I02aaaea79150967d7831d89d0c05427bf2685708
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:17 +01:00
Marcus Shawcroft eb2d16b2e4 net/dns: Drop unnecessary ETH_KSDK configuration.
Change-Id: I99712e04bfc455156751b70778aee24517eb6d6a
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-02 10:03:17 +01:00
Marcus Shawcroft 39d5f26988 net/dhcpv4: Correct spellings in comments.
Change-Id: I2c08c35eb81233b14fdfc8ccdcbc84340bdfd6a2
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-02 10:03:16 +01:00
Marcus Shawcroft 0be2c3f57c samples/dhcpv4: Add missing NET_MGMT configury.
Add missing NET_MGMT configury for frdm_k64f, accidentally omitted
from: 5267ad94ed10c76b51c7fbba01143616d03e9178

Change-Id: I9a6da75f7a036182f44abe8207c7732030ab187e
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-02 10:03:16 +01:00
Flavio Santes 225dc3f660 samples/net: Fix logging format error
When building the echo_client sample app, the following warning
is found:

echo-client.c:37:
echo_client/src/echo-client.c: In function 'send_ipv4_data':
include/logging/sys_log.h:108:20: warning: format '%d' expects argument
                                  of type 'int', but argument 7 has
                                  type 'size_t' ...

So, this patch changes %d by %zu to remove that warning.

Change-Id: I8a3822bca6d5988e531684d647de93bd77aabf9b
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-02 10:03:16 +01:00
Vinicius Costa Gomes 65cf8c769a samples/zoap_server: Use the correct option for TAP
When using SLIP for TAP networking between guest and host, the correct
option is CONFIG_NET_SLIP_TAP. CONFIG_SLIP_TAP only enables it on the
SLIP side, it should be enabled on the networking stack, as well.

Change-Id: Ie1dacd07eb5a0891a572b08268a865f05a373690
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-02 10:03:16 +01:00
Vinicius Costa Gomes 6a0190befb samples/zoap_client: Use the correct option for TAP
When using SLIP for TAP networking between guest and host, the correct
option is CONFIG_NET_SLIP_TAP. CONFIG_SLIP_TAP only enables it on the
SLIP side, it should be enabled on the networking stack, as well.

Change-Id: I76226db9c587f1b5e9613244adab8f916ad94013
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-02 10:03:16 +01:00
Marcus Shawcroft 0637511e68 dhcpv4: Report address acquisition.
Use the network management interface to catch and report IPv4 address
acquisition in the application.

Change-Id: Idd1bcaac90fffbd617600a7713206599e547826f
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-02 10:03:16 +01:00
Andrei Emeltchenko cdb8133cf5 samples: net: Add echo_client build test for frdm CC2520 configuration
Add build test to sanity_check to get a complex net app being built
for frdm-k64f.

Change-Id: Ib136f7964b65ad2167a3ed4484bff3bfe2a7ebad
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-02 10:03:16 +01:00