Commit graph

41120 commits

Author SHA1 Message Date
Andrei Emeltchenko
a207459cee net: Make NET_IPV6_DAD depends on NET_IPV6_ND
Making NET_IPV6_DAD depends on NET_IPV6_ND instead of default fixes
issue when deselecting NET_IPV6_ND, NET_IPV6_DAD is still selected in
this case.

Change-Id: I633b1a71fb5fdcd7ecc75be80a737d8bda142b2e
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-27 12:35:54 +02:00
Andrei Emeltchenko
86cd8eaf56 net: Make NET_IPV6_ND configurable option
NET_IPV6_ND is always selected by NET_ROUTE which is always selected
for NET_IPV6.

Change-Id: I316838033cccd205b24add6626521bbab5a68715
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-27 12:35:54 +02:00
Andrei Emeltchenko
7ab5d4f572 net: tests: Correct project file for route tests
Routing tests uses ND so do not disable it, otherwise tests might fail
if disabling ND supported.

Change-Id: Ie020de8dac4447931d1067f1ed781a72cf05e8af
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-27 12:35:54 +02:00
Ravi kumar Veeramally
0c39e6dc45 net: 6lo: Fix tiny style issues
Change-Id: I5cf65f4d428f17290642ce94d5e70d233f512213
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-27 12:35:54 +02:00
Ravi kumar Veeramally
313ee1d49b net: dhcpv4: Fix tiny style issues
Change-Id: I12e6763627d85912496e8c702cd97bf90ac4f741
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-27 12:35:54 +02:00
Tomasz Bursztyka
668d2abb07 net/6lo: Switch to NET_ERR/NET_WARN when relevant.
This permits to catch issues without the need to enable debug level.

Change-Id: Ic3c66a84be587e955d532cc321161a3ae7b5d69d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:54 +02:00
Tomasz Bursztyka
fa35ccf9cf net/ieee802154: Raise an error when data frame cannot be created
Change-Id: I7405c4b3de194c09f7d8d8e1bb54602b6dba304b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:54 +02:00
Tomasz Bursztyka
83ed3a29be net/ieee802154: Modify radio TX function signature
The cause for this change is TCP. Until now, the radio strategy driver
(ALOHA or CSMA) was providing the actual nbuf, and not the buffer
fragment, counting on the fact that the loop was using
net_buf_frag_del() which made so, iteration after iteration, buffer
framgent to be always buf->frags. The problem with this logic is loosing
the fragments that might be still referenced by TCP, in case the whole
buffer did not make it so TCP can retry later and so on.

Instead, TX now takes the nbuf and the actual frag to send. It could
have been working with just a pointer on the data, and the whole length
of the frame. But it has been avoided due to possible future devices,
that will be smarter and run CSMA directly in the hw, thus it will
require to access the whole buffer list through the nbuf.

Change-Id: I8d77b1e13b648c0ec3645cb2d55d1910d00381ea
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:53 +02:00
Andrei Emeltchenko
5794d80c10 net: Remove CONFIG_NET_IPV6_NO_ND config option
The option is no longer used so it can be removed.
Use CONFIG_NET_IPV6_ND option instead.

Change-Id: Ibaa3d3deb52b8b176e85f8b9e1d8c80c1026aea1
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-27 12:35:53 +02:00
Sergio Rodriguez
98d7ff0013 samples/coaps_client CoAP over DTLS client example app using mbedTLS
Jira: ZEP-941

Change-Id: Ia49087b75b33bcedb1b77b6a062368281c41e479
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-27 12:35:53 +02:00
Sergio Rodriguez
3818af4a7b samples/coaps_server CoAP over DTLS server example app using mbedTLS
Jira: ZEP-942

Change-Id: I810fccfed912d9de62073a9a4e943b7924aa6392
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-27 12:35:53 +02:00
Tomasz Bursztyka
c5644fba20 drivers/console/telnet: Add ground support for telnet commands
This is the skeleton for such support. Let's see if this will be needed
and thus extended in the future.

For now, it's disabled by default, not advised to be enabled.
It supports AYT, AO and DO/SUPR_GA. This is very limited and only there
to show how it could be handled.

Change-Id: I736bfa23145e9b727af08db682ab001f494f8c8d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:53 +02:00
Tomasz Bursztyka
f7b0e35c5f shell: If enabled, let's register telnet console as an input
Change-Id: I476ca0f7914b02d2523a341560023c7e334d8b1b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:53 +02:00
Tomasz Bursztyka
1d9402b3e3 drivers/console/telnet: Provide minimal input handling.
Telnet "Interpret As Command" (IAC) code is ignored.

Change-Id: I882397389d77b8adfcbce62fbd9654c0b0412ae3
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:53 +02:00
Tomasz Bursztyka
587335c6cf shell: Make the command queue size configurable via Kconfig
Change-Id: I80551c76903118bfe831776c87135e89d32552da
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:53 +02:00
Tomasz Bursztyka
2f1af492ee console/shell: Switch to generic console input
Let's use the generic console input type now. This will be useful for
other console input drivers such as telnet.

Change-Id: I787a1e9d86481d5f8c4803453726d9042a89dea4
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:53 +02:00
Tomasz Bursztyka
3e65158936 drivers/console: Making console input generic
Input line length can be modified via Kconfig.

Change-Id: I3423fce9814e04b11d11e5d391f85fe1efbe8d17
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:53 +02:00
Tomasz Bursztyka
fb9810978f drivers/uart_console: Fix tiny style issues
Basically missing {} on if statements.
Taking the opportunity to remove a useless switch.

Change-Id: Ic6b3951dfc257cb46d858ebcd12bdf1b4e7ff997
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:53 +02:00
Tomasz Bursztyka
1a52e6e91a shell: Fix tiny style issues
- identation alignment
- 80 chars length limit

Change-Id: Ieae83e0daa2c7ee7aff32a053db5692094488df7
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:53 +02:00
Tomasz Bursztyka
507fa88734 samples/net: Add telnet console support on echo_server with qemu
This is meant to test telnet console easily, as echo_server already
enables net shell module etc.

Change-Id: I045340ae5d6e179ea5ce1416cd7d67c6956bd973
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:53 +02:00
Tomasz Bursztyka
01e70f4189 drivers/console: Add a basic telnet console
Telnet is started as an application, as it requires the net stack to be
ready. It will listen to any IP address on both protocols (IPv4, IPv6),
depending of course on which one is enabled.

Current behavior is very basic, as it does not handle any telnet
command (IAC). These will be silently ignored.

Jira: ZEP-1601

Change-Id: Id50656f23e6347bbbc893416953f1ba7116ef87d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:52 +02:00
Tomasz Bursztyka
aa84d81f25 net: ip: Add a useful macro to staticaly initialize a struct in_addr
As for IN6ADDR_ANY_INIT, let's have an INADDR_ANY_INIT.

Change-Id: I07c9ec6d2bb20d3a228edaac2e3380942feac5fd
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:52 +02:00
Tomasz Bursztyka
a7e82666bc misc/printk: Add a function to get the current hook function.
This can be necessary at run-time if a switch of one console to
another has to be made, with the possibility to reinstall the former
hook at some point.

Change-Id: I60efc74b1c94953bdc2585b99cc4816c46715372
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:52 +02:00
Tomasz Bursztyka
4984ca742a drivers/console: Removing non existing Kconfig source
Change-Id: I89fdc6f702f3ea39822c6fbf6fce93e3eb77261c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:52 +02:00
Luiz Augusto von Dentz
2e9fd888bf net: bt: Fix not checking for valid ll addresses
ll addresses need to be set properly before sending as the stack is not
checking if they are NULL.

Change-Id: Ia4e96240f18b53b0e32e21649a8b571c94260731
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-27 12:35:52 +02:00
Ravi kumar Veeramally
02b104dae8 net: 6lo: Verify src and dst link layer addresses
If src and dst link layer addresses are not then 6lo fails
to compress the packet.

Change-Id: Ie2692def49f8a101194e3669dbaec00b557e14ce
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-27 12:35:52 +02:00
Ravi kumar Veeramally
c34cb8236e net: ip: Check error conditions and return false
Check if input parameters are valid or not. It might lead to crash
NULL address input.

Change-Id: Ib446ab0467268bca01f478cca3ece868c7c9e49b
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-27 12:35:52 +02:00
Andrei Emeltchenko
404a83a482 drivers: cc2520: Remove unused TI_CC2520 Kconfig option
Instead of TI_CC2520_CHANNEL option NET_L2_IEEE802154_ORFD_CHANNEL is
used.

Change-Id: I9b0c0ff6b2c42070d05c5cf3e4dc33c364be9a5c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-27 12:35:52 +02:00
Ravi kumar Veeramally
7820a8e452 doc: net: Fix networking documentation
Current version of IP stack supports both IPv4 and IPv6 at the same time.
Use 'threads' instead of 'fibers' in documentation.

Jira: ZEP-1623

Change-Id: Ib8210f32775ac55fe2c346cd81ed263ffe472b28
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-27 12:35:52 +02:00
Malcolm Prinn
755c4a6f7a net: iface: Fix typo in net_if_down
Change-Id: I36a7292a3a176f32239332a7e91308e280da9cae
Signed-off-by: Malcolm Prinn <malcolm.prinn@intel.com>
2017-01-27 12:35:52 +02:00
Jukka Rissanen
6e6281af96 net: tcp: Only return -ETIMEDOUT if timeout>0 in connect
No need to set the status to -ETIMEDOUT in connect callback
if user did not want to have a timeout when doing a TCP connect.

Change-Id: I6d6e565a8d12bcefbcd9de751e789b5e43aad244
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-01-27 12:35:52 +02:00
Andy Ross
47d94648ed net: tcp: Issue connection callback on RST
A connection refused needs to be exposed to the user, otherwise the
connection will be stuck as a zombie forever.

This patch also adds a ENOTCONN check in net_context_recv() to match
the one that was already there in net_context_send().

Change-Id: I4f9ae46dd849f68ed97976add7da5daf1932cf55
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2017-01-27 12:35:52 +02:00
Andy Ross
7b27d4be0a net: tcp: Make the connect callback on success, not transmission
The net_context_connect() callback was being invoked synchronously
with the transmission of the SYN packet.  That's not very useful, as
it doesn't tell the user anything they can't already figure out from
the return code.  Move it to the receipt of the SYNACK instead, so the
app can know that it's time to start transmitting.  This matches the
Unix semantics more closely, where connect(2) is a blocking call that
wakes up only when the connection is live.

Change-Id: I11e3cca8572d51bee215274e82667e0917587a0f
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2017-01-27 12:35:52 +02:00
Luiz Augusto von Dentz
1fd9f4b846 net: bt: Fix warning when compiling without debug
With CONFIG_NET_DEBUG_L2_BLUETOOTH is disabled the code generate the
following warning:

subsys/net/ip/l2/bluetooth.c: In function 'eir_found':
subsys/net/ip/l2/bluetooth.c:301:16: warning: unused variable 'addr' [-Wunused-variable]
  bt_addr_le_t *addr = user_data;
                ^

Change-Id: I1a1ca20c4f2e4fa8aa2a551d2fffa1f86874760e
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-27 12:35:51 +02:00
Luiz Augusto von Dentz
1c94ddd906 net: bt: Fix not checking channel state
When checking if the L2CAP channel is connected it is not enough to check
if the conn member is set since the connection may still be pending.

Change-Id: I93a2328943b0ca0e42cdb5c525b30c7cdddd1c18
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-27 12:35:51 +02:00
Johann Fischer
ed6712fa23 samples: net: add configs for MCR20A
Add configs for MCR20A device to echo_server and echo_client.

Change-Id: Ic0e310c0eb2eefe6ce5752a20b0c079b7ea8757c
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-01-27 12:35:51 +02:00
Johann F
12306df1ad samples: ieee802154: add MCR20A
Add MCR20A to 802154 driver test application.

Change-Id: I18d4178668542c1da197d5a2b3b0b502c9b128c1
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-01-27 12:35:51 +02:00
Johann Fischer
fcf27119a7 boards: frdm_k64f: add pinmux settings for MCR20A
Change-Id: Ifc4689983340e43bbd94c6b0cee8ef300c65fb30
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-01-27 12:35:51 +02:00
Johann Fischer
fa8d9c9d10 drivers: ieee802154: add MCR20A driver
Add driver and configuration for the MCR20A 802.15.4
transceiver.

Jira: ZEP-1429

Change-Id: I0b17b688220a47c2f0e5cde269064bbd0dec824a
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-01-27 12:35:51 +02:00
Johann F
d4e5113461 ext: mcux: add MCR20Overwrites.h
Add overwrites header file for MCR20 Register values.

Overwrite values are non-default register values that
configure the transceiver device to a more optimally
performing posture.
(Excerpt from the documentation part of MCR20Overwrites.h)

Origin: Kinetis MKW2xD and MCR20A Connectivity Software
URL: https://www.nxp.com/
(The complete URL can be found in the ext/hal/nxp/mcux/README)
Revision: (REV 1.0.0)
Maintained-by: External

Change-Id: Id96db2ad70279c0b11d749d65e9148244d8fdc2f
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-01-27 12:35:51 +02:00
Ravi kumar Veeramally
5e5b187371 net: samples: Fix config option
Only CONFIG_NET_SLIP_TAP will select SLIP, UART_PIPE,
UART_INTERRUPT_DRIVEN and SLIP_TAP. Otherwise apps will crash on
qemu.

Jira: ZEP-1617

Change-Id: Ibefbe708deb05e28b43ed4225211a5af655cec8d
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-27 12:35:51 +02:00
Ravi kumar Veeramally
538d8d4032 net: tests: Use lighter printk() instead of printf()
Use printk(), snprintk() instead of printf() and snprintf().
CONFIG_STDOUT_CONSOLE is anyway disabled by default so printf()
will not output anything without it.

Change-Id: I5899741df2e187dae7b4602d074e9b4cbb9952aa
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-27 12:35:51 +02:00
Ravi kumar Veeramally
5cf134f45a net: samples: Use lighter printk() instead of printf()
Use printk(), snprintk() instead of printf() and snprintf().
CONFIG_STDOUT_CONSOLE is anyway disabled by default so printf()
will not output anything without it.

Change-Id: Ide24e4d669e9821289189ed28e30a596120d9611
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-27 12:35:51 +02:00
Ravi kumar Veeramally
4540a73b59 net: Use lighter printk() instead of printf()
Use printk(), snprintk() instead of printf() and snprintf().
CONFIG_STDOUT_CONSOLE is anyway disabled by default so printf()
will not output anything without it.

Change-Id: I9ad778e318fe999e79ec34182f2de8574e45b7d4
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-27 12:35:51 +02:00
Ravi kumar Veeramally
a28e2059e8 net: Fix 80 line character limit
Change-Id: Ic83a631db4ae76b1b2bb1bbd888d1329f065c18c
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-27 12:35:51 +02:00
Ravi kumar Veeramally
b80878496d net: tests: Fix invalid config option in 6lo tests
The debug config was incorrect.

Change-Id: Id32cbcfb809acc9e4ab202b401d25e41a7531c42
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-27 12:35:50 +02:00
Ravi kumar Veeramally
395ad208b1 samples: net: Add DHCPv4 sample application README file
Instructions to verify DHCPv4 client functionality in QEMU and
FRDM_K64F.

Change-Id: I623128186387c0c3237c8e759b949a3d0fde0993
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-27 12:35:50 +02:00
Andrei Emeltchenko
9e092b02e2 wpan_serial: Queue only full packet to RX queue
After queueing full packet to RX queue we set pkt_curr to NULL, if we
get right after that SLIP_END we shall check for pkt_curr to avoid
NULL pointer assignment.

Coverity-CID: 157574

Change-Id: I2be40a652867e73b4a1994f529dc21980ecb35b4
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-27 12:35:50 +02:00
Paul Sokolovsky
fe72df5292 net: Set default NET_NBUF_RX_COUNT to 4.
Older default value of 2 is too small for even simple uses, for
example enabling just CONFIG_NETWORKING, CONFIG_NET_IPV4,
CONFIG_NET_SLIP_TAP makes a Zephyr application hang on start up
(apparently, waiting to allocate more buffers). While value of 3
is enough to cover the above options, set new default to 4 to
accommodate configurations with IPv4/IPv6/UDP/TCP enabled.

While the new default slightly increases RAM footprint, it's
apparently better for users who are short of it to optimize it
explicitly, rather than potentially make every Zephyr beginner
wonder why enabling networking breaks applications in non-obvious
way.

Change-Id: I76e83517f0d914ce616a930c3c48ee5c52567b88
Jira: ZEP-1619
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-01-27 12:35:50 +02:00
Vinicius Costa Gomes
3a666c54ce samples/zoap_server: Also listen on the unicast address
Some applications are not prepared for using multicast address and
specifying the interface, so it may be convenient for the user to be
able to use a unicast address when communicating with the
samples. This aligns this sample with most of the networking samples.

Change-Id: Ic97ea5a346a650751b6e2cbfefad25a3e700278c
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-27 12:35:50 +02:00