Commit graph

19237 commits

Author SHA1 Message Date
Vinayak Chettimada
b37e285c03 Bluetooth: Controller: Kconfig LE Ping feature
Add Kconfig configuration to conditionally enable LE Ping
feature in the Controller.
This will save CPU time, flash and RAM, if this feature is
not desired.

Change-id: I5fbbdbe8f45ac01c9b0d7b11e002a0d1db4d272e
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-01-05 08:49:16 +02:00
Arkadiusz Lichwa
7fc2a8a4e2 Bluetooth: SDP: Implement ServiceSearchAttribute request PDU
Initial implementation one of basic UUID resolving request PDU based on
Service Search Attribute PDU specification [Core 4.2 Vol 3 Part B 4.7.1]
The request applies approach to query using single only UUID pattern
and getting all attributes for given UUID. The initial PDU transaction
is requested on PSM SDP L2CAP channel connected state.

> ACL Data RX: Handle 77 flags 0x02 dlen 18
      L2CAP: Configure Response (0x05) ident 12 len 10
        Source CID: 64
        Flags: 0x0000
        Result: Success (0x0000)
        Option: Maximum Transmission Unit (0x01) [mandatory]
          MTU: 64
> HCI Event: Number of Completed Packets (0x13) plen 5
        Num handles: 1
        Handle: 77
        Count: 1
< HCI Command: Host Number of Completed Packets (0x03|0x0035) plen 5
        Num handles: 1
        Handle: 77
        Count: 1
< ACL Data TX: Handle 77 flags 0x00 dlen 24
      Channel: 64 len 20 [PSM 1 mode 0] {chan 0}
      SDP: Service Search Attribute Request (0x06) tid 3 len 15
        Search pattern: [len 5]
          Sequence (6) with 3 bytes [8 extra bits] len 5
            UUID (3) with 2 bytes [0 extra bits] len 3
              OBEX Object Push (0x1105)
        Max record count: 65535
        Attribute list: [len 7]
          Sequence (6) with 5 bytes [8 extra bits] len 7
            Unsigned Integer (1) with 4 bytes [0 extra bits] len 5
              0x0000ffff
        Continuation state: 0
> HCI Event: Number of Completed Packets (0x13) plen 5
        Num handles: 1
        Handle: 77
        Count: 1
> ACL Data RX: Handle 77 flags 0x02 dlen 68
      Channel: 64 len 64 [PSM 1 mode 0] {chan 0}
      SDP: Service Search Attribute Response (0x07) tid 3 len 59
        Attribute bytes: 48
        Continuation state: 8
        8d 55 59 58 30 00 00 00                          .UYX0...

Jira: ZEP-1112

Change-Id: I0ed1d989a5abe030f1c70d4d1f104d488eafb2b3
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2017-01-05 08:49:16 +02:00
Louis Caron
9055f57850 Bluetooth: fix write cmd handling
The data pointer and length was not updated before invoking the
write_rsp function therefore providing pointer to the handle.

Change-Id: I5c27ab7a793979dffb8f1f2c68def027c45f2376
Signed-off-by: Louis Caron <louis.caron@intel.com>
2017-01-05 08:49:16 +02:00
Vinayak Chettimada
04794ba1c1 Bluetooth: Controller: add init test for BT 4.0 only controller
Add a test configuration to build a controller that
supports only Bluetooth v4.0 features.

This is copy of prj_controller.conf, but Kconfig defines
will be added in subsequent commits to conditionally
compile out feature not in Bluetooth v4.0 specification.

Also, added nrf52840_pca10056 and arduino_101_ble board
builds be tested.

Change-id: I36891bfc54cc36a8588c9b019de582e3193e8aa3
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-01-05 08:49:16 +02:00
Johan Hedberg
fce1938a24 Bluetooth: Fix another incorrect memcpy call
This should also have been net_buf_add_mem(). Otherwise the buffer
gets corrupted.

Change-Id: I4687584777f446d398182c3e8c2cde5946987da4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-05 08:49:16 +02:00
Vinayak Chettimada
1921b53484 Bluetooth: Controller: refactor ISR to reduce critical path code
Move code that can be executed after radio tx/rx packet ptr
has been assigned in the radio h/w.

Change-id: I9c5a34ee6bb74c1265d7871bcdf93894e3e7b190
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-01-05 08:49:16 +02:00
Vinayak Chettimada
a591205045 Bluetooth: Controller: Kconfig radio ISR profiling
Add Kconfig configuration and conditional compilation of
radio ISR profiling.

Change-id: Ia80d6bc54810156be99b2e6a25327c30d0714697
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-01-05 08:49:16 +02:00
Vinayak Chettimada
73236dbaa5 Bluetooth: Controller: BT_INFO the ISR profiling event
Change-id: Ic2e01f698c13d76fc462349fe67f1694639888cb
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-01-05 08:49:16 +02:00
Vinayak Chettimada
ecb649c2a1 Bluetooth: Controller: add radio ISR profiling event
Added code to profile radio ISR execution time and generate
an event, which can be used to populate a vendor HCI event.

This event and associated code is disabled, subsequent
patch will add kconfig to enable it.

Change-id: Ic3fa3e0f4e36829a22a25ffee039949eaae561a7
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-01-05 08:49:16 +02:00
Vinayak Chettimada
6996619399 Bluetooth: Controller: use BT_WARN to display unknown rsp
Use BT_WARN instead of BT_ASSERT to display unknown rsp in
HCI layer.

Change-id: I63c792468d9c4768f69df73395ee026a03521704
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-01-05 08:49:16 +02:00
Vinayak Chettimada
ced33653fa Bluetooth: Controller: internally handle unknown rsp for LE Ping
Peer controllers not supporting LE Ping feature will
respond with unknown response PDU, handle it internally in
the controller rather than exposing it to HCI layer.

Discovered that controller was passing the unknown rsp PDU
to HCI layer when LE Ping was send to Nexus 5.

Unknown response for slave feature request was forwarded to
HCI layer, during that implementation unknown rsp for LE
ping too was getting forwarded to HCI layer.

Change-id: I4396c482e5546d78239cf41d88728de996e48d7d
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-01-05 08:49:16 +02:00
Jaganath Kanakkassery
41984c7577 Bluetooth: RFCOMM: Handle non supported message types
If peer sends any non supported message then it has to be
responded with NSC (Non Supported Command) response.

> ACL Data RX: Handle 256 flags 0x02 dlen 18
      Channel: 64 len 14 [PSM 3 mode 0] {chan 0}
      RFCOMM: Unnumbered Info with Header Check (UIH) (0xef)
         Address: 0x03 cr 1 dlci 0x00
         Control: 0xef poll/final 0
         Length: 10
         FCS: 0x70
         MCC Message type: Unknown CMD (0x33)
           Length: 8
        01 22 34 55 67 88 9a bb 70

< ACL Data TX: Handle 256 flags 0x00 dlen 11
      Channel: 64 len 7 [PSM 3 mode 0] {chan 0}
      RFCOMM: Unnumbered Info with Header Check (UIH) (0xef)
         Address: 0x01 cr 0 dlci 0x00
         Control: 0xef poll/final 0
         Length: 3
         FCS: 0xaa
         MCC Message type: Non Supported Command RSP (0x04)
           Length: 1
           cr 1, mcc_cmd_type 33

Change-Id: I7be3b64a9cf437276c10868d52e0b9c555018df0
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2017-01-05 08:49:16 +02:00
Jaganath Kanakkassery
fb07eb9022 Bluetooth: RFCOMM: Respond to Test command
Test command is to test the connection between two stations.
The pattern recieved should be sent back in the response.

> ACL Data RX: Handle 256 flags 0x02 dlen 14
      Channel: 64 len 10 [PSM 3 mode 0] {chan 0}
      RFCOMM: Unnumbered Info with Header Check (UIH) (0xef)
         Address: 0x03 cr 1 dlci 0x00
         Control: 0xef poll/final 0
         Length: 6
         FCS: 0x70
         MCC Message type: Test Command CMD (0x08)
           Length: 4
           Test Data: 0x 5f 54 65 73

< ACL Data TX: Handle 256 flags 0x00 dlen 14
      Channel: 64 len 10 [PSM 3 mode 0] {chan 0}
      RFCOMM: Unnumbered Info with Header Check (UIH) (0xef)
         Address: 0x01 cr 0 dlci 0x00
         Control: 0xef poll/final 0
         Length: 6
         FCS: 0xaa
         MCC Message type: Test Command RSP (0x08)
           Length: 4
           Test Data: 0x 5f 54 65 73

Change-Id: I16beb4cf857cc8bbc049514dbf840d84e13c8fb5
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2017-01-05 08:49:16 +02:00
Johan Hedberg
14472d757d Bluetooth: Fix incorrect call to memcpy()
This call was supposed to be net_buf_add_mem().

Change-Id: I5e4a718474905c433533fd1c1d7e8e0b7ff35739
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-05 08:49:16 +02:00
Johan Hedberg
63f71adc5f Bluetooth: Take advantage of new net_buf_add_mem() API
This helps simplify code that was previously combining net_buf_add()
with memcpy().

Change-Id: If44cf9cd651aba5e544e36567869f147468663eb
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-05 08:49:16 +02:00
Anas Nashif
6d4ff2303e sanitycheck: reduce number of unnecessary configuration builds
When running a reduced set of tests with --platform-limit or using the
default of 1 we build the configuration (make initconfig) for all
platforms, although we are only interested in a limited set. On my
machine this is 100s of build time for configurations we are never going
to use.
This reduces the number of builds to what we really need and speeds up
sanitycheck runtime overall.

Might need a few more optimisations.

Change-Id: I813fabf1453f19ce7a83b28e4792b5c80616d936
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-05 02:05:58 +00:00
Genaro Saucedo Tejada
2382cb8fa3 sanity: prevent stack corruption at test_static_idt
Stack for fiber idtSpurFiber at tests/legacy/kernel/test_static_idt
for nanokernel is not big enough since printk parse context refactor
(commit 3ab6046), causing sanity check to fail with CONFIG_DEBUG=y.

Change-Id: Iddc74a2800163a22be985067ce828ac859ae4a24
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2017-01-05 02:03:27 +00:00
Genaro Saucedo Tejada
f8ddacff48 maintainers: update KNOWN ISSUES and MAINTAINERS section
Change-Id: Ia9c950ec43f2dc34f1f91098471bd66cb528dee1
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2017-01-04 23:49:29 +00:00
Juro Bystricky
30093f13ca Makefile.toolchain.zephyr: Modifications for SDK 0.9
Various changes required by new SDK 0.9:

1. Renamed toolchain vendor name ("poky" -> "zephyr")
2. Toolchains now 64 bit, previously 32 bit
3. New toolchain for Xtensa
4. New toolchain for RISC-V

0.8.2 is still supported.

Change-Id: Icfd4cc44ef643da0f3840b33d6dfc4b3c99dfa9a
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-01-04 14:16:12 -08:00
Andrew Boie
fb2e5a4479 arc: add -fno-delete-null-pointer-checks
This option has side effects. It also tells the compiler not to generate
these checks in the first place. The checks call abort() which doesn't
exist in our environment.

This patch gets rid of linker errors due to missing abort() in the 0.9 SDK.

Change-Id: Ibc5aeb5458d0bded714c9c074cdf08112733428b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-01-04 19:06:41 +00:00
Anas Nashif
453432539e doc: samples: fix rst layout and use code-blocks
Change-Id: Ic55d66bbfa1df67824b47afe478dcdfbb886fc4b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-04 12:24:11 -05:00
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