Commit graph

19237 commits

Author SHA1 Message Date
Luiz Augusto von Dentz
278bd910d5 Bluetooth: L2CAP: Only set state for dynamic channels
Fixed channels don't really use channels state as they don't need
connection setup.

Change-Id: Ie8b1327db0269a45e9ccb6049f8dda87aa445fb5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-28 08:43:41 +02:00
Piyush Itankar
42a175f300 Bluetooth: A2DP: Adds accept state callback handlers
Adds state callback handler to allocate memory to AVDTP on an incoming
connection. Also, abstracts searching of free session as a function call.

Change-Id: Idee6b7a0507b0b75c0007717e351ca12de0cb5be
Signed-off-by: Piyush Itankar <piyush.t.itankar@intel.com>
2017-01-28 08:43:41 +02:00
Jaganath Kanakkassery
91f9c9cf1c Bluetooth: RFCOMM: Implement MSC Flow Control
This is mainly for backward compatibility with 1.0b devices and for
spec compliance. CFC is mandatory post 1.0b spec where in MSC FC
shall not be used.

FC bit in MSC is used to manage the flow control. If FC is 1 then
the device is unable to accept frames.

Implementation is done by reusing "tx_credit" as a binary semaphore
wherein it will be blocked if MSC is recieved with FC bit 1 and
unblocked if FC bit is 0. Once tx thread is scheduled then semaphore
should be always available until all the buf in queue is sent.

Change-Id: I91181668ec0f46ff0b02905dd97e4503fc1fa7a7
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2017-01-28 08:43:41 +02:00
Jaganath Kanakkassery
17ea79e733 Bluetooth: RFCOMM: Fix v24_signal in MSC response
v24_signal in MSC response should be the copy of it received
in the command.

Change-Id: I9723ba182bf5911025c7a57220cd70687ca785f3
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2017-01-28 08:43:41 +02:00
Sathish Narasimman
d903b53e6b Bluetooth: AT: HFP HF: Handle unsolicited reponse
This implemnts the feature to handle the unsolicited response
received from the AG. In the hfp_hf.c file the unsolicited_cb function
process it.

Change-Id: I3ca6c8d4a1522d02f7160e2fe4ae1598cd93ce7e
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
2017-01-28 08:43:41 +02:00
Bogdan Davidoaia
a45dd12f0c sensor: use SENSOR_CHAN_*_XYZ instead of SENSOR_CHAN_*_ANY
SENSOR_CHAN_*_ANY will be deprecated, so use the new SENSOR_CHAN_*_XYZ
enum values.

Change-Id: I91cf25864613a934feab65588969d10c52fd4fe6
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-27 19:07:17 +00:00
Sergio Rodriguez
fdf9238382 tests: context: Verify for out of bounds array
The for loop could exit with a out of bounds (variable j) value for
the delayed_threads array, we verify for the variable value before
operating on the array

This issue was reported by Coverity

Coverity-CID: 160078

Change-Id: I6aa1cc325cc363be48cd72b2a58d0a55ec3854bc
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-27 18:57:27 +00:00
Bogdan Davidoaia
678d1ba986 sensor: add SENSOR_CHAN_*_XYZ enum values
Add SENSOR_CHAN_*_XYZ enum values to be used instead of
SENSOR_CHAN_*_ANY, because the new naming takes into account that
they are used to fetch all the 3 axes for a channel (X, Y and Z)
and not just any number of them.

Also deprecate old SENSOR_CHAN_*_ANY enum values.

Change-Id: I59e9901c1f8879d084bdb7c95583c2b28aa1e025
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-27 17:46:18 +00:00
Kumar Gala
0ceca659e3 ext: hal: nordic: cleanup Kbuild for now
Since nothing is currently using the nordic HAL lets just stick a dummy
build line.  Once something uses it, it can add what's needed and pull
in the code that is desired.

Change-Id: Id70bb6a88c6f1bbb7f33421cd0c14aafb83597b5
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-27 08:16:44 -06:00
Jukka Rissanen
7d37e7d519 Merge net branch into master
Main changes:

- TCP fixes
- BT IPSP fixes
- Changing networking code and samples to use printk()
- CoAP over DTLS server and client samples
- Telnet console support
- IEEE 802.15.4 driver for MCR20A

----------------------------------------------------------------
Andrei Emeltchenko (8):
      wpan_serial: Queue only full packet to RX queue
      drivers: cc2520: Remove unused TI_CC2520 Kconfig option
      net: Remove CONFIG_NET_IPV6_NO_ND config option
      net: tests: Correct project file for route tests
      net: Make NET_IPV6_ND configurable option
      net: Make NET_IPV6_DAD depends on NET_IPV6_ND
      net: Remove unused CONFIG_NET_IPV6_NO_DAD option
      net: Fix leaving NET_MAX_6LO_CONTEXTS set when 6lowpan deselected

Andy Ross (2):
      net: tcp: Make the connect callback on success, not transmission
      net: tcp: Issue connection callback on RST

Johann F (2):
      ext: mcux: add MCR20Overwrites.h
      samples: ieee802154: add MCR20A

Johann Fischer (3):
      drivers: ieee802154: add MCR20A driver
      boards: frdm_k64f: add pinmux settings for MCR20A
      samples: net: add configs for MCR20A

Jukka Rissanen (2):
      net: tcp: Only return -ETIMEDOUT if timeout>0 in connect
      net: echo-client: Add TCP support

Luiz Augusto von Dentz (3):
      net: bt: Fix not checking channel state
      net: bt: Fix warning when compiling without debug
      net: bt: Fix not checking for valid ll addresses

Malcolm Prinn (1):
      net: iface: Fix typo in net_if_down

Paul Sokolovsky (1):
      net: Set default NET_NBUF_RX_COUNT to 4.

Ravi kumar Veeramally (12):
      samples: net: Add DHCPv4 sample application README file
      net: tests: Fix invalid config option in 6lo tests
      net: Fix 80 line character limit
      net: Use lighter printk() instead of printf()
      net: samples: Use lighter printk() instead of printf()
      net: tests: Use lighter printk() instead of printf()
      net: samples: Fix config option
      doc: net: Fix networking documentation
      net: ip: Check error conditions and return false
      net: 6lo: Verify src and dst link layer addresses
      net: dhcpv4: Fix tiny style issues
      net: 6lo: Fix tiny style issues

Sergio Rodriguez (2):
      samples/coaps_server CoAP over DTLS server example app using mbedTLS
      samples/coaps_client CoAP over DTLS client example app using mbedTLS

Tomasz Bursztyka (18):
      drivers/console: Removing non existing Kconfig source
      misc/printk: Add a function to get the current hook function.
      net: ip: Add a useful macro to staticaly initialize a struct in_addr
      drivers/console: Add a basic telnet console
      samples/net: Add telnet console support on echo_server with qemu
      shell: Fix tiny style issues
      drivers/uart_console: Fix tiny style issues
      drivers/console: Making console input generic
      console/shell: Switch to generic console input
      shell: Make the command queue size configurable via Kconfig
      drivers/console/telnet: Provide minimal input handling.
      shell: If enabled, let's register telnet console as an input
      drivers/console/telnet: Add ground support for telnet commands
      net/ieee802154: Modify radio TX function signature
      net/ieee802154: Raise an error when data frame cannot be created
      net/6lo: Switch to NET_ERR/NET_WARN when relevant.
      net/shell: Fix format string
      drivers/console/telnet: Select TCP when telnet is selected

Vinicius Costa Gomes (2):
      samples/zoap: Update zoap samples documentation
      samples/zoap_server: Also listen on the unicast address

 boards/arm/frdm_k64f/pinmux.c                      |    7 +
 .../networking/ip-stack-architecture.rst           |   12 +-
 doc/subsystems/networking/networking.rst           |    3 +-
 drivers/console/Kconfig                            |   10 +-
 drivers/console/Kconfig.telnet                     |  124 ++
 drivers/console/Makefile                           |    1 +
 drivers/console/telnet_console.c                   |  558 ++++++++
 drivers/console/telnet_protocol.h                  |  125 ++
 drivers/console/uart_console.c                     |   17 +-
 drivers/ieee802154/Kconfig                         |  125 +-
 drivers/ieee802154/Makefile                        |    2 +
 drivers/ieee802154/ieee802154_cc2520.c             |   32 +-
 drivers/ieee802154/ieee802154_mcr20a.c             | 1462 ++++++++++++++++++++
 drivers/ieee802154/ieee802154_mcr20a.h             |  184 +++
 drivers/ieee802154/ieee802154_mcr20a_regs.h        |  590 ++++++++
 drivers/ieee802154/ieee802154_uart_pipe.c          |   10 +-
 ext/hal/nxp/mcux/Makefile                          |    4 +
 ext/hal/nxp/mcux/README                            |    8 +
 .../nxp/mcux/components/mcr20a/MCR20Overwrites.h   |  309 +++++
 ext/lib/crypto/mbedtls/configs/config-coap.h       |  102 ++
 include/drivers/console/console.h                  |   49 +
 include/drivers/console/telnet_console.h           |   37 +
 include/drivers/console/uart_console.h             |    6 -
 include/net/ieee802154_radio.h                     |    6 +-
 include/net/net_context.h                          |   37 +-
 include/net/net_ip.h                               |    5 +
 misc/printk.c                                      |   13 +
 samples/net/coaps_client/Makefile                  |   14 +
 samples/net/coaps_client/README.rst                |   53 +
 samples/net/coaps_client/prj_qemu_x86.conf         |   27 +
 samples/net/coaps_client/src/Makefile              |    7 +
 samples/net/coaps_client/src/coaps_client.c        |  447 ++++++
 samples/net/coaps_client/src/udp.c                 |  202 +++
 samples/net/coaps_client/src/udp.h                 |   23 +
 samples/net/coaps_client/src/udp_cfg.h             |   21 +
 samples/net/coaps_client/testcase.ini              |    4 +
 samples/net/coaps_server/Makefile                  |   14 +
 samples/net/coaps_server/README.rst                |   76 +
 samples/net/coaps_server/prj_qemu_x86.conf         |   30 +
 samples/net/coaps_server/src/Makefile              |    7 +
 samples/net/coaps_server/src/coaps_server.c        |  685 +++++++++
 samples/net/coaps_server/src/udp.c                 |  186 +++
 samples/net/coaps_server/src/udp.h                 |   24 +
 samples/net/coaps_server/src/udp_cfg.h             |   20 +
 samples/net/coaps_server/testcase.ini              |    4 +
 samples/net/dhcpv4_client/README.rst               |  161 +++
 samples/net/dns_client/prj_qemu_x86.conf           |    2 +-
 samples/net/echo_client/prj_frdm_k64f_mcr20a.conf  |   48 +
 samples/net/echo_client/src/Makefile               |    4 +
 samples/net/echo_client/src/echo-client.c          |  516 +++++--
 samples/net/echo_server/prj_cc2520.conf            |    2 -
 samples/net/echo_server/prj_frdm_k64f_mcr20a.conf  |   46 +
 samples/net/echo_server/prj_slip.conf              |   12 +-
 samples/net/echo_server/src/echo-server.c          |    5 +-
 samples/net/ieee802154/hw/prj.conf                 |    2 -
 samples/net/ieee802154/hw/prj_mcr20a.conf          |   45 +
 samples/net/ieee802154/hw/src/ieee802154_test.c    |   13 +-
 samples/net/ieee802154/qemu/prj.conf               |    2 -
 samples/net/leds_demo/src/leds-demo.c              |    5 +-
 samples/net/mbedtls_dtlsclient/prj_qemu_x86.conf   |    2 +-
 samples/net/mbedtls_dtlsserver/prj_qemu_x86.conf   |    2 +-
 samples/net/wpan_serial/src/main.c                 |   36 +-
 samples/net/wpanusb/src/wpanusb.c                  |   18 +-
 samples/net/zoap_client/README.rst                 |   46 +
 samples/net/zoap_client/README.txt                 |   54 -
 samples/net/zoap_client/src/zoap-client.c          |   34 +-
 samples/net/zoap_server/README.rst                 |   40 +
 samples/net/zoap_server/README.txt                 |   51 -
 samples/net/zoap_server/src/zoap-server.c          |   33 +-
 subsys/net/ip/6lo.c                                |   77 +-
 subsys/net/ip/Kconfig                              |    3 +-
 subsys/net/ip/Kconfig.ipv6                         |    7 +-
 subsys/net/ip/connection.c                         |   20 +-
 subsys/net/ip/dhcpv4.c                             |   41 +-
 subsys/net/ip/icmpv4.c                             |    8 +-
 subsys/net/ip/icmpv6.c                             |    8 +-
 subsys/net/ip/ipv6.c                               |   13 +-
 subsys/net/ip/l2/arp.c                             |    2 +-
 subsys/net/ip/l2/bluetooth.c                       |   27 +-
 subsys/net/ip/l2/ethernet.c                        |    2 +-
 subsys/net/ip/l2/ieee802154/ieee802154.c           |   18 +-
 subsys/net/ip/l2/ieee802154/ieee802154_frame.c     |    1 +
 .../net/ip/l2/ieee802154/ieee802154_radio_aloha.c  |    7 +-
 .../ip/l2/ieee802154/ieee802154_radio_csma_ca.c    |    7 +-
 .../net/ip/l2/ieee802154/ieee802154_radio_utils.h  |    7 +-
 subsys/net/ip/net_context.c                        |   23 +-
 subsys/net/ip/net_core.c                           |    6 +-
 subsys/net/ip/net_if.c                             |    2 +-
 subsys/net/ip/net_private.h                        |   15 +-
 subsys/net/ip/net_shell.c                          |    4 +-
 subsys/net/ip/route.c                              |    4 +-
 subsys/net/ip/rpl-of0.c                            |    2 +-
 subsys/net/ip/rpl.c                                |   13 +-
 subsys/shell/Kconfig                               |   11 +-
 subsys/shell/shell.c                               |   41 +-
 tests/net/6lo/prj.conf                             |    2 +-
 tests/net/arp/src/main.c                           |   12 +-
 tests/net/ieee802154/l2/prj.conf                   |    2 -
 .../net/ieee802154/l2/src/ieee802154_fake_driver.c |    4 +-
 tests/net/ip-addr/src/main.c                       |   11 +-
 tests/net/nbuf/src/main.c                          |   11 +-
 tests/net/route/prj.conf                           |   11 -
 tests/net/tcp/prj.conf                             |    1 -
 tests/net/udp/prj.conf                             |    1 -
 104 files changed, 6726 insertions(+), 559 deletions(-)
 create mode 100644 drivers/console/Kconfig.telnet
 create mode 100644 drivers/console/telnet_console.c
 create mode 100644 drivers/console/telnet_protocol.h
 create mode 100644 drivers/ieee802154/ieee802154_mcr20a.c
 create mode 100644 drivers/ieee802154/ieee802154_mcr20a.h
 create mode 100644 drivers/ieee802154/ieee802154_mcr20a_regs.h
 create mode 100644 ext/hal/nxp/mcux/components/mcr20a/MCR20Overwrites.h
 create mode 100644 ext/lib/crypto/mbedtls/configs/config-coap.h
 create mode 100644 include/drivers/console/console.h
 create mode 100644 include/drivers/console/telnet_console.h
 create mode 100644 samples/net/coaps_client/Makefile
 create mode 100644 samples/net/coaps_client/README.rst
 create mode 100644 samples/net/coaps_client/prj_qemu_x86.conf
 create mode 100644 samples/net/coaps_client/src/Makefile
 create mode 100644 samples/net/coaps_client/src/coaps_client.c
 create mode 100644 samples/net/coaps_client/src/udp.c
 create mode 100644 samples/net/coaps_client/src/udp.h
 create mode 100644 samples/net/coaps_client/src/udp_cfg.h
 create mode 100644 samples/net/coaps_client/testcase.ini
 create mode 100644 samples/net/coaps_server/Makefile
 create mode 100644 samples/net/coaps_server/README.rst
 create mode 100644 samples/net/coaps_server/prj_qemu_x86.conf
 create mode 100644 samples/net/coaps_server/src/Makefile
 create mode 100644 samples/net/coaps_server/src/coaps_server.c
 create mode 100644 samples/net/coaps_server/src/udp.c
 create mode 100644 samples/net/coaps_server/src/udp.h
 create mode 100644 samples/net/coaps_server/src/udp_cfg.h
 create mode 100644 samples/net/coaps_server/testcase.ini
 create mode 100644 samples/net/dhcpv4_client/README.rst
 create mode 100644 samples/net/echo_client/prj_frdm_k64f_mcr20a.conf
 create mode 100644 samples/net/echo_server/prj_frdm_k64f_mcr20a.conf
 create mode 100644 samples/net/ieee802154/hw/prj_mcr20a.conf
 create mode 100644 samples/net/zoap_client/README.rst
 delete mode 100644 samples/net/zoap_client/README.txt
 create mode 100644 samples/net/zoap_server/README.rst
 delete mode 100644 samples/net/zoap_server/README.txt

Change-Id: I6caced9d0ae41d2019fb30434141260471e2538e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-01-27 16:05:40 +02:00
Carles Cufi
17f7b4ed95 ext: Integrate Nordic SDK HAL files into Zephyr
Nordic Semiconductor's Software Development Kit's HAL layer
provides a set of low-level header and sourcefiles that give access
to the different hardware peripherals of Nordic ICs.

This patch includes the new files in the build and refactors the Kconfig
and Kbuild files in ext/hal/nordic to acommodate for the presence of the
new HAL layer.

Change-Id: Ie8e1a4c9fcc7e9058a9d16a2692ef1789603aa53
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-01-27 14:44:19 +01:00
Carles Cufi
ed9ffc3a99 ext: Import Nordic SDK HAL files
Nordic Semiconductor's Software Development Kit's HAL layer
provides a set of low-level header and sourcefiles that give access to
the different hardware peripherals of Nordic ICs.

Origin: Nordic SDK 12.2.0 (components/drivers_nrf/hal)
URL: http://developer.nordicsemi.com/nRF5_SDK/
License: 3-clause BSD
Maintained-by: External

Change-Id: Iafb5816af89461c8e88ba3b47e790cb6141d10fe
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-01-27 14:42:51 +01:00
Jukka Rissanen
7ad52b94cf net: echo-client: Add TCP support
This commit enables echo-client application to start to
send data over TCP connection.

Change-Id: I9acdaae7f1e8411952c30caeedc9c1fb07cdd448
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-01-27 15:06:06 +02:00
Tomasz Bursztyka
028896063f drivers/console/telnet: Select TCP when telnet is selected
Thus users won't have to first enable network stack and then telnet.

Change-Id: I30cb2b9debee3feaf804f9a70f9d3f90758f5f17
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 13:02:11 +00:00
Andrei Emeltchenko
6580644449 net: Fix leaving NET_MAX_6LO_CONTEXTS set when 6lowpan deselected
Make NET_MAX_6LO_CONTEXTS depends on NET_6LO_CONTEXT, otherwise at the
moment even deselecting 6lowpan leaves NET_MAX_6LO_CONTEXTS set.

Change-Id: Iaa34d324005817be05190e203f6899ab89f89e5d
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-27 11:59:31 +00:00
Tomasz Bursztyka
1e0fdd37ab net/shell: Fix format string
Change-Id: Id335466e68add23a5786257681dc1b4d5bf6846d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 11:49:42 +01:00
Andrei Emeltchenko
6043dddd4a net: Remove unused CONFIG_NET_IPV6_NO_DAD option
Option CONFIG_NET_IPV6_NO_DAD is not used anymore, clean project
configuration files.

Change-Id: I368e076d2f79f1d4bc86edee11ff5befe37362c8
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-27 12:35:54 +02:00
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