Commit graph

19237 commits

Author SHA1 Message Date
Vinicius Costa Gomes
9d1bc961b2 net: ieee802154: Fix typo
'#defite' -> '#define'

Change-Id: I4c2de0eea37129b86355ee3fbc48e591172999d4
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:41:03 +02:00
Sergio Rodriguez
51c61dcd50 samples/mbedtls_dtlsclient: mbedTLS sample DTLS compile on unified kernel.
Makefile modifications to be able to be compiled with the unified kernel

Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Change-Id: I0fce5d3f6b28df0cff4b7c0b554a787996e8c966
2016-12-02 12:41:03 +02:00
Andrei Emeltchenko
f416f615bd wpan_serial: hexdump and interrupt debug to VERBOSE_DEBUG
Print packet hexdump and interrupt related debug only when
VERBOSE_DEBUG is enabled.

Change-Id: Ieb997e3537a9a2316d1435372948004dd93babab
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:03 +02:00
Andrei Emeltchenko
a239abeb5c wpan_serial: Update README
Update information related to simple web server info.

Change-Id: Ib0155c116a3d53b374a7401eb6e9d1599390dba3
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:03 +02:00
Andrei Emeltchenko
c275f0756e wpanusb: Decrease amount of debugs
Print packet hexdump only when VERBOSE_DEBUG is enabled and remove
debug print in empty functions.

Change-Id: Ifd3ae59001233f0237c4b7575bd92607c93e2ea0
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:03 +02:00
Jukka Rissanen
06a408e16c net: apps: Set the IPv6 source address preferred for echo-server
Forcefully set the IPv6 address in echo-server so that we
can use that address when sending data. Normally this should
not be done like this as the system should autoconfigure itself.

Change-Id: I99041539c50f994f5d3ddaabaf5cac8599d82078
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:03 +02:00
Jukka Rissanen
fd016b84d3 net: Add network utilities shell support
Add a shell module to provide utilities to send ping and
get statistics information from the running system.

Change-Id: I1129a57f35a6794a23d61f57bee972b6267b09fd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:03 +02:00
Jukka Rissanen
f8a8cac3fe net: Add util to send ICMPv6 Echo-Request packet
Add function to send IPv6 ping message to peer.

Change-Id: If7517beefe109f5f35cba82bc175da5a22cdb1d1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:02 +02:00
Jukka Rissanen
7e0b45759f net: Add helper to return network buffer information
This is needed by net-shell module.

Change-Id: Ic93f806a5882592ff1769b4a14b6ed524ba14912
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:02 +02:00
Jukka Rissanen
60ecd5ecd6 net: Network stack analyzer re-factored
Separate the calculation of stack utilization variables and
printing the values from each other so that it is possible
to use separate printing function to print the values.

Change-Id: I3a5827c08edea5017e2a4bc1c5be2fe419cdfcb8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:02 +02:00
Jaakko Hannikainen
f9f0d895ea net: Add net_addr_pton()
This function converts a string into an IP address.

Change-Id: If57983a345fe4c18df01e58dbce7d9a50a27b82a
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
2016-12-02 12:41:02 +02:00
Tomasz Bursztyka
b52f8f1fa1 tests: net: TCP Context needs to be listening before running accept
Change-Id: I433ddac41afcb055cd45e2e7fc4c26ed8c56e3c2
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:02 +02:00
Tomasz Bursztyka
54af319833 net: unified: Remove legacy selected Kconfig options
Those options do not exist anymore on unified kernel.

Change-Id: I8f7f95f8f3e1429cdf7ce82db8a6a14bcfe587ef
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:02 +02:00
Tomasz Bursztyka
64e7dc2caa tests: net: Unified kernel is now default and only one
Adapting all unit tests so:

- main task's prj.mdef is already provided by unified kernel with a
default stack of 2kb.
- unified is the only kernel to be used now, removing unecessary kernel
type make option.
- removing all NANOKERNEL/MICROKERNEL related #ifdefs and so on.

Change-Id: I9b853dbd2aef971d355188cbf7fe2ececaaa80c1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:02 +02:00
Tomasz Bursztyka
9313172f84 drivers: ieee802154: Let's timeout on cc2520 tx
Looks like getting an SFD interruption is not 100% reliable, so let's
just use a semaphore with a timeout on it instead of using
device_sync* routines.

Change-Id: I4e4115c7b939c95d7e75fbb33664d411e0a6e8cc
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:02 +02:00
Tomasz Bursztyka
d33c883eaf drivers: ieee802154: Rework RX buffer handling in cc2520
Flushing rxfifo is necessary only on complete failure. It's badly
documented, but cc2520 errata mention that srxflush instruction should
be avoided as much as possible because it generates garbage in rxfifo
and kills incoming rx packet.

Change-Id: I486f7f4179103cf0c86c206821a0a61fec06178a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:02 +02:00
Leandro Pereira
ad1a9d088d net: tcp: Add better type safety for connection handlers
This creates a `struct net_conn_handle` that's only used as an opaque
pointer.  The purpose is to avoid assigning a void* to a void** in
connection registering/unregistering functions, avoiding a
previously-caught bug by issuing an incompatible pointer types warning:

	warning: passing argument 7 of 'net_tcp_register' from
		incompatible pointer type [-Wincompatible-pointer-types]

Suggested by Andy Ross in 5beec6.  This particular commit didn't catch
any bugs, but the one caught in 5beec6 wouldn't exist if this were in
place at the time.

Change-Id: I5c13fb4c5826adce6397feb7b400d36e426c4a87
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2016-12-02 12:41:02 +02:00
Vinicius Costa Gomes
2d4e7b6c6e net: ipv6: Fix sending packets with invalid addresses
When the context being used is bound to a multicast address, the source
address of the IPv6 packet was the multicast address, this is wrong. See
RFC4291, Section 2.7:

"Multicast addresses must not be used as source addresses in IPv6
packets or appear in any Routing header."

If the context was bound to an address that would be invalid as an IPv6
source, we find a better alternative.

Change-Id: Ibefb4f2104e39658babfaaacf02f241c48f010cf
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:41:02 +02:00
Jukka Rissanen
6b621831cf net: Try to send IPv6 packet even if default route is missing
We were dropping the packet too early as the neighbor cache might
have the peer address stored so the cache needs to be checked too.

Change-Id: I307162cbc0da02e802ac8bb321b7b964c7388ace
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:02 +02:00
Jukka Rissanen
3cd07ca300 net: Create a separate buffer when sending IPv6 NA
When we receive IPv6 neighbor solicitation message,
we must not re-use the RX buffer when sending the IPv6
neighbor advertisement. This was an issue for IEEE 802.15.4
technology which has a variable size link layer header.
If we use the RX buffer for sending, the size of the link
layer header can be wrong and the packet might be dropped
by the L2 layer.

Change-Id: I77aed386847b6ccb7ec0ddca873fe00b840c35fd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:02 +02:00
Tomasz Bursztyka
f8ec175aa7 drivers: ieee802154: Fix length handling in uart-pipe
15.4 drivers are supposed to append LQI byte in the end of the buffer,
but of course there is no such thing in uart-pipe. Thus the bug, so
let's announce the proper length even if such LQI is missing.
Also align the debug output to proper length (FCS included)

Change-Id: Ib9ad86a8c22e1cf6437bc82e7fce11a489d0e761
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:02 +02:00
Tomasz Bursztyka
37ea53e023 net: 6lo: Make editor happy
Looks like auto-indentation is not working properly if editor sees 2
times a '}' as it will not interpret the #ifdef, so fixing this.

Change-Id: I848f705fa5a5e488cb43e1090ac7551140639f6d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:01 +02:00
Tomasz Bursztyka
3cb1212ebe net: ieee802154: Let ORFD setting ACK flag through net_mgmt
Useful for testing purposes. On RFD level, net mgmt will be selected by
default and such feature will thus be available.

Change-Id: Ic4f1c75557abae6edae5344f4263a106d218ed73
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:01 +02:00
Tomasz Bursztyka
ab32634b51 net: ieee802154: Add debug output to radio strategy drivers
Change-Id: Iffd628c0ae8b472f93f2f24a187b3fc6e563c6e8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:01 +02:00
Tomasz Bursztyka
d4b429d176 net: ieee802154: Limit MAC command frame generation to RFD
ORFD level does not need it.

Change-Id: Ie70d0df56b9c7365e265cce7cbe53807132ea4cc
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:01 +02:00
Tomasz Bursztyka
8e3750a07d net: ieee802154: MAC command frames needs a buffer from tx pool
Such frame is going to be sent.

Change-Id: Ia5dd8b1427ebb609633522e7c94933c1a0be5b61
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:01 +02:00
Tomasz Bursztyka
476d1d33dc net: ieee802154: Fix a small indentation issue
Change-Id: Ief85662c4355f0cd03b08f23bfcea535a70a101d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:01 +02:00
Tomasz Bursztyka
3e23b2b824 samples: ieee802154: L2 debug Kconfig option has changed
Change-Id: I81e23038947e9423b38391943298b67c83a7a221
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:01 +02:00
Paul Sokolovsky
ad064e1434 eth: ksdk: Protect Ethernet frame buffer operations with IRQ lock.
As there's a single intermediate frame buffer used by both RX and TX
routines, protect operations on it with irq_lock() to avoid possibility
that it will be concurrently modified.

Change-Id: Ibbaf882a15fbb193054dbb13ae848becf9deef3f
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2016-12-02 12:41:01 +02:00
Sergio Rodriguez
0b56b4066f samples/mbedtls_dtlsclient: mbedTLS sample DTLS client app on Arduino 101.
This is a sample app using ECJPAKE crypto algorithm on DTLS, using mbedTLS,
native IP stack and the enc28j60 SPI Ethernet Driver

Change-Id: I658c3d9a54cfdd164a4147903125400f223c6e0a
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-02 12:41:01 +02:00
Paul Sokolovsky
8b1769a923 eth: ksdk: Update driver for native IP stack.
This updates driver for Kinetis SDK Ethernet device (used for example
by BOARD=frdm_k64f) to work with native Zephyr IP stack driver model.
The conversion is done based on the template of eth_enc28j60.c.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Change-Id: Ifb0c7d3f921d663d00a2ded89ecdf2336b6e3783
2016-12-02 12:41:01 +02:00
Jukka Rissanen
750a93df40 net: Fix IPv6 address debug print
The allocated space for IPv6 string was too short by 10 chars
which meant that full IPv6 address was not printed correctly.

Change-Id: I9c7f3f118f486f88e769aaadf09d100a1d4fd6bc
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:01 +02:00
Jukka Rissanen
d6540e8517 net: rpl: Add IPv6 RPL option handling
If the RPL is not compiled in, then skip all the RPL IPv6
options that are unknown. This way it is possible to have
non-RPL device in the network even if the IPv6 packets contain
RPL options.

Change-Id: Iff24078f48cd9fe5803355974fac0beb0a7a9e15
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:01 +02:00
Jukka Rissanen
c15b467d42 net: tests: Send IPv6 hop-by-hop option to IP stack
Added a test to send HBH option to IP stack. Currently
the test will always pass, activate some more debugging
to see what the IP stack is doing with the option.

Change-Id: Id0ab1590eb8216f5f67c4d43ce2e882186334198
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:01 +02:00
Jukka Rissanen
bc5bcdd843 net: Add HBHO IPv6 extension handling support
Add IPv6 Hop-by-hop option handling.

Change-Id: Iaf28666df18f733e8f475b90e002b86cd3b4e7e4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
010b7c8eda net: Add extra parameter to ICMPv6 error API
Some errors need extra data to be sent to peer.

Change-Id: I142e86d0b21141498148b59f285152fbb51a84ed
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
057331971c net: Add IPv6 extension option defines
Change-Id: I74c2e60e73a20c283434e94a39e2676045a23275
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
5c79f01181 net: nbuf: Add function to add stuff to IPv6 extension map
Utility function that can add option bits to IPv6 option bitmap.

Change-Id: Ia10d27c201556fb960a736590788b791a7e3c018
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
b9765cc43e net: Add more ICMPv6 option definitions
Change-Id: Iae4abd6b9ddcf6a862d772c9b58554bb5b7b2cd3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
cd4365de9a net: Add IPv6 routing support
Route IPv6 packets properly.

Change-Id: I349d4fcbae5624baa912a77da59d6814eb2ab6b3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
dffafbd290 net: tests: Unit tests for RPL
Change-Id: I5c2c4dd4eb8a8af77bd0d8db06b09a25871893b3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
de43aaca54 net: rpl: Objective Function Zero support
Support for Objective Function Zero,
see RFC 6552 for details.

Change-Id: I5e976fdc7e087b3b65005884e05a28fb3e35c257
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
47b535c2ee net: rpl: MRH Objective Function support
Support for Minimum Rank with Hysteresis,
see RFC 6719 for details.

Change-Id: Ie3019e8516bba516d3bc55f6325288d738e26588
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
98404b175c net: rpl: Initial commit
RPL implementation taken from net/ip/contiki/rpl and
ported to use the new stack.

Origin: Contiki

Change-Id: I479d9dd143b763f90cb7915806fd7e9faea0300c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
13dd72a593 net: Add helpers to get network interface IPv6 addresses
Add utilities to return network interface link local and
global IPv6 addresses.

Change-Id: I54d0ec28410b9ad4ad7068a887bfa6706453159c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
d4c910ec9f net: Add IPv6 extension header type values to net_ip.h
Change-Id: I1925d4a894675b503b033b78e7b717a8993ec331
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
fa801d5b19 net: Add helper to find default IPv6 router
Go through the router list and return the default router
where to send the network packet.

Change-Id: I87e5118b03352b7d11e1fde800d1530e5929ebab
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
865d82dfe1 net: Add helper to check if the IPv6 address is part out subnet
Helper checks if the IPv6 address belongs to one of the subnets
defined for network interfaces.

Change-Id: I0e88ebe5014a514404b589e32cc71590950a39c7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
29e9621c50 net: Add utility to go through all network interfaces
Change-Id: I0a9dabf3585fb3813b806238f6e5049c2646890d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:59 +02:00
Jukka Rissanen
a679403888 net: Get IPv6 neighbor by using index
Add utility function to return IPv6 neighbor from
link layer index.

Change-Id: Icb3c6400c0bc115a10fec278878957d398676cb3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:59 +02:00