Commit graph

41120 commits

Author SHA1 Message Date
Jean-Paul Etienne
7cf3688740 serial: added support for the riscv-qemu UART driver
riscv-qemu UART:
1) comprises only one register that is used to send or
   receive characters in a polling fashion.
2) does not have a FIFO and is not interrupt-driven.

Change-Id: I9408f1776eba4cec4aa203a5da759ec04bcddf1f
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-01-13 19:56:24 +00:00
Jean-Paul Etienne
23cef9e655 timer: added support for the riscv-qemu timer driver
The riscv-qemu timer driver does not implement
TICKLESS_IDLE

Change-Id: I3eeb5abb05b3f16b55ab9343c2045295b3010cfd
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-01-13 19:56:09 +00:00
Jean-Paul Etienne
ec76a4bb63 timer: added timer driver for the pulpino SOC
The pulpino_timer driver does not implement TICKLESS_IDLE
for the time being.

Change-Id: I0cce8c8a7e203d551a924863462e6c86af4c98ff
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-01-13 19:55:50 +00:00
Jean-Paul Etienne
2a8cfca4cf riscv32: added support for the pulpino soc
pulpino soc has custom-extended riscv ISA that is accounted
for if CONFIG_RISCV_GENERIC_TOOLCHAIN is not set.
(ex: bit manipulation asm opcodes)

Change-Id: I4dafc4ebc2fedcc4eb6a3dedd0412816afea6004
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-01-13 19:55:05 +00:00
Jean-Paul Etienne
c76abeeae5 kernel: updated default IDLE_STACK_SIZE to 512 for RISCV32
Default 256 bytes stack size for idle task is not enough, as
stack grows/shrinks by a multiple of 16-bytes in the
RISC-V architecture.

Increase it to 512 bytes for RISCV32 architecture

Change-Id: I8321c48e4c1a877b252ba5561f3cbdd1fe475fc7
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-01-13 19:54:35 +00:00
Jean-Paul Etienne
4c6ab7cfcd unified: added _MOVE_INSTR for RISCV32 architecture
added _MOVE_INSTR for RISCV32 architecture

The store instruction has a different syntax in RISC-V,
compared to the other architectures. Hence, for each
architecture, specify the entire load instruction within
the _MOVE_INSTR variable.

Change-Id: Iedc421e73411876abd8b698f7d4b46081b473d79
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-01-13 19:53:57 +00:00
Jean-Paul Etienne
cd83e85edc arch: added support for the riscv32 architecture
RISC-V is an open-source instruction set architecture.
Added support for the 32bit version of RISC-V to Zephyr.

1) exceptions/interrupts/faults are handled at the architecture
   level via the __irq_wrapper handler. Context saving/restoring
   of registers can be handled at both architecture and SOC levels.
   If SOC-specific registers need to be saved, SOC level needs to
   provide __soc_save_context and __soc_restore_context functions
   that shall be accounted by the architecture level, when
   corresponding config variable RISCV_SOC_CONTEXT_SAVE is set.

2) As RISC-V architecture does not provide a clear ISA specification
   about interrupt handling, each RISC-V SOC handles it in its own
   way. Hence, at the architecture level, the __irq_wrapper handler
   expects the following functions to be provided by the SOC level:
   __soc_is_irq: to check if the exception is the result of an
                 interrupt or not.
   __soc_handle_irq: handle pending IRQ at SOC level (ex: clear
                     pending IRQ in SOC-specific IRQ register)

3) Thread/task scheduling, as well as IRQ offloading are handled via
   the RISC-V system call ("ecall"), which is also handled via the
   __irq_wrapper handler. The _Swap asm function just calls "ecall"
   to generate an exception.

4) As there is no conventional way of handling CPU power save in
   RISC-V, the default nano_cpu_idle and nano_cpu_atomic_idle
   functions just unlock interrupts and return to the caller, without
   issuing any CPU power saving instruction. Nonetheless, to allow
   SOC-level to implement proper CPU power save, nano_cpu_idle and
   nano_cpu_atomic_idle functions are defined as __weak
   at the architecture level.

Change-Id: I980a161d0009f3f404ad22b226a6229fbb492389
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-01-13 19:52:23 +00:00
Jean-Paul Etienne
ba776a1fd1 scripts: added Makefile to handle an external riscv32 toolchain
Compiling Zephyr with an external riscv32 toolchain would
require the following env variables to be exported:

export ZEPHYR_GCC_VARIANT=riscv32
export RISCV32_TOOLCHAIN_PATH=/PATH/TO/TOOLCHAIN/BINARY

Change-Id: I2072ed9079a4cabd27837ab39b947bc0a0a1a8b4
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-01-13 19:52:22 +00:00
Tomasz Bursztyka
85a22063a8 Merge net branch into master
Main changes:

- Bluetooth L2 exposing net mgmt API and a dedicated shell module
- mbedtls DTLS client/server samples
- Bug fixes (mostly TCP, more to come soon)

----------------------------------------------------------------
Andy Ross (2):
      net: tcp: Signal EOF with a NULL buffer in the callback
      net: tcp: Don't leak net_conn_handles

Flavio Santes (6):
      samples/net: Remove legacy reference in Makefile
      samples/net: Update DNS logging info
      samples/net: Update zperf Makefile
      samples/net: Rename prj conf files to avoid breaking the build
      samples/net: Update the zperf/README.rst file
      samples/net: Update DNS client README file to RST format

Johann Fischer (4):
      ieee802154: conf: add common log level
      samples: ieee802154: rename cc2520 to hw
      net: ieee802154: fix validate_mac_command_cfi_to_mhr
      net: ieee802154: inform about unsupported frames

Kumar Gala (1):
      net: Remove NET_SLIP choice from Kconfig

Luiz Augusto von Dentz (13):
      net: mgmt: Make NET_MGMT_GET_* macros return meaningful values
      net: mgmt: Decode event fields
      net: echo_client: Fix using CONFIG_NETWORKING_WITH_BT
      net: echo_client: Don't start sending packets if interface is not UP
      net: bt: Fix not showing any logs
      net: bt: Add connect management command
      net: bt: Add shell support
      net: bt: Add scan management command
      net: bt: Add scan shell command
      net: bt: Add disconnect management command
      net: bt: Add disconnect shell command
      net: echo_client: Enable CONFIG_NET_L2_BLUETOOTH_SHELL in prj_bt.conf
      net: zoap_server: Enable connecting with bluetooth

Michael Scott (7):
      net: net_context: state setting is a value not individual bits
      net: tcp: replace seq/ack/wnd value shifts with system calls
      net: ip: on synack copy local/remote data prior to net_tcp_register
      net: ip: set local address family during TCP connect
      net: ip: set context state to NET_CONTEXT_CONNECTED on synack success
      net: ip: reword appdata debug message in packet_received
      net: ip: save TCP seq/ack values in tcp_synack_received

Sergio Rodriguez (5):
      samples/mbedtls_dtlsclient: Using printk instead of printf
      samples/mbedtls_dtlsclient: Change Readme files to rst format
      samples/mbedtls_dtlsclient: Remove hardcoded IP adresses
      samples/mbedtls_dtlsclient: IPv6 client version
      samples/mbedtls_dtlsserver DTLS server example app using mbedTLS

Tomasz Bursztyka (3):
      samples: net: Echo apps need different IP to be able to work
      net: mgmt: Silently ignore net_mgmt_event functions if not enabled
      samples: net: Fix dhcpv4 building with net mgmt event support

li zj (2):
      net: dhcpv4 : set ciaddr 0.0.0.0 when send DHCPV4_MSG_TYPE_REQUEST
      net: icmpv4 : calculate ipv4 header chksum

 drivers/ieee802154/Kconfig                                         |  57 ++--
 drivers/ieee802154/ieee802154_cc2520.c                             |   6 +-
 drivers/ieee802154/ieee802154_uart_pipe.c                          |   2 +-
 include/net/bt.h                                                   |  64 +++++
 include/net/net_context.h                                          |   9 +-
 include/net/net_mgmt.h                                             |   8 +-
 samples/net/README                                                 |  19 --
 samples/net/dhcpv4_client/prj_arduino_101.conf                     |   3 +
 samples/net/dhcpv4_client/prj_qemu_x86.conf                        |   1 -
 samples/net/dns_client/README.rst                                  | 231 ++++++++++++++++
 samples/net/dns_client/README_IPv4                                 | 187 -------------
 samples/net/dns_client/README_IPv6                                 |  74 ------
 samples/net/dns_client/README_arduino_101                          |  51 ----
 samples/net/dns_client/prj_qemu_x86.conf                           |   1 -
 samples/net/dns_client/sample_output_IPv4.txt                      |  46 ++++
 samples/net/dns_client/sample_output_IPv6.txt                      |  39 +++
 samples/net/dns_client/src/main.c                                  |   2 +-
 samples/net/echo_client/prj_arduino_101_cc2520.conf                |   2 +-
 samples/net/echo_client/prj_bt.conf                                |   3 +
 samples/net/echo_client/prj_cc2520.conf                            |   2 +-
 samples/net/echo_client/prj_frdm_k64f_cc2520.conf                  |   2 +-
 samples/net/echo_client/prj_qemu_802154.conf                       |   2 +-
 samples/net/echo_client/prj_qemu_x86.conf                          |   9 +-
 samples/net/echo_client/prj_slip.conf                              |   9 +-
 samples/net/echo_client/src/echo-client.c                          |  47 +++-
 samples/net/echo_server/prj_arduino_101_cc2520.conf                |   2 +-
 samples/net/echo_server/prj_cc2520.conf                            |   2 +-
 samples/net/echo_server/prj_frdm_k64f_cc2520.conf                  |   2 +-
 samples/net/echo_server/prj_qemu_802154.conf                       |   2 +-
 samples/net/echo_server/prj_qemu_x86.conf                          |   1 -
 samples/net/echo_server/prj_slip.conf                              |   1 -
 samples/net/echo_server/src/echo-server.c                          |   5 +
 samples/net/ieee802154/{cc2520 => hw}/Makefile                     |   0
 samples/net/ieee802154/{cc2520 => hw}/prj.conf                     |   2 +-
 samples/net/ieee802154/{cc2520 => hw}/src/Makefile                 |   0
 samples/net/ieee802154/{cc2520 => hw}/src/ieee802154_test.c        |   0
 samples/net/ieee802154/qemu/prj.conf                               |   2 +-
 samples/net/mbedtls_dtlsclient/README                              | 121 ---------
 samples/net/mbedtls_dtlsclient/README.rst                          | 136 ++++++++++
 .../{README_arduino_101 => README_arduino_101.rst}                 |  25 +-
 samples/net/mbedtls_dtlsclient/prj_qemu_x86.conf                   |   6 +-
 samples/net/mbedtls_dtlsclient/src/Makefile                        |   2 -
 samples/net/mbedtls_dtlsclient/src/dtls_client.c                   |  52 +++-
 samples/net/mbedtls_dtlsclient/src/udp.c                           | 125 ++++++++-
 samples/net/mbedtls_dtlsclient/src/udp_cfg.h                       |  30 +--
 samples/net/mbedtls_dtlsserver/Makefile                            |  24 ++
 samples/net/mbedtls_dtlsserver/README.rst                          | 144 ++++++++++
 samples/net/mbedtls_dtlsserver/prj_qemu_x86.conf                   |  22 ++
 samples/net/mbedtls_dtlsserver/src/Makefile                        |  17 ++
 samples/net/mbedtls_dtlsserver/src/dtls_server.c                   | 428 ++++++++++++++++++++++++++++++
 samples/net/mbedtls_dtlsserver/src/udp.c                           | 253 ++++++++++++++++++
 samples/net/mbedtls_dtlsserver/src/udp.h                           |  34 +++
 samples/net/mbedtls_dtlsserver/src/udp_cfg.h                       |  37 +++
 samples/net/mbedtls_dtlsserver/testcase.ini                        |   4 +
 samples/net/wpan_serial/prj.conf                                   |   2 +-
 samples/net/wpanusb/prj.conf                                       |   2 +-
 samples/net/zoap_client/prj.conf                                   |   1 -
 samples/net/zoap_server/Makefile                                   |   9 +-
 samples/net/zoap_server/prj.conf                                   |   1 -
 samples/net/zoap_server/prj_bt.conf                                |  18 ++
 samples/net/zoap_server/src/Makefile                               |   5 +
 samples/net/zoap_server/src/zoap-server.c                          |  22 +-
 samples/net/zoap_server/testcase.ini                               |   6 +
 samples/net/zperf/Makefile                                         |   1 -
 samples/net/zperf/README.rst                                       |  47 +++-
 samples/net/zperf/{prj_galileo_ethernet.conf => prj_galileo.conf}  |   0
 .../{prj_galileo_ethernet_prof.conf => prj_galileo_prof.conf}      |   0
 samples/net/zperf/prj_qemu_x86.conf                                |   1 -
 subsys/net/ip/Kconfig                                              |   2 +-
 subsys/net/ip/dhcpv4.c                                             |   7 +-
 subsys/net/ip/icmpv4.c                                             |   3 +
 subsys/net/ip/l2/Kconfig                                           |  21 +-
 subsys/net/ip/l2/Makefile                                          |   1 +
 subsys/net/ip/l2/bluetooth.c                                       | 247 ++++++++++++++++-
 subsys/net/ip/l2/bluetooth_shell.c                                 | 151 +++++++++++
 subsys/net/ip/l2/ieee802154/ieee802154_frame.c                     |   4 +-
 subsys/net/ip/l2/ieee802154/ieee802154_mgmt.c                      |   3 +
 subsys/net/ip/net_context.c                                        |  39 ++-
 subsys/net/ip/net_mgmt.c                                           |  10 +-
 subsys/net/ip/tcp.c                                                |  13 +-
 80 files changed, 2326 insertions(+), 645 deletions(-)
 create mode 100644 include/net/bt.h
 create mode 100644 samples/net/dns_client/README.rst
 delete mode 100644 samples/net/dns_client/README_IPv4
 delete mode 100644 samples/net/dns_client/README_IPv6
 delete mode 100644 samples/net/dns_client/README_arduino_101
 create mode 100644 samples/net/dns_client/sample_output_IPv4.txt
 create mode 100644 samples/net/dns_client/sample_output_IPv6.txt
 rename samples/net/ieee802154/{cc2520 => hw}/Makefile (100%)
 rename samples/net/ieee802154/{cc2520 => hw}/prj.conf (95%)
 rename samples/net/ieee802154/{cc2520 => hw}/src/Makefile (100%)
 rename samples/net/ieee802154/{cc2520 => hw}/src/ieee802154_test.c (100%)
 delete mode 100644 samples/net/mbedtls_dtlsclient/README
 create mode 100644 samples/net/mbedtls_dtlsclient/README.rst
 rename samples/net/mbedtls_dtlsclient/{README_arduino_101 => README_arduino_101.rst} (72%)
 create mode 100644 samples/net/mbedtls_dtlsserver/Makefile
 create mode 100644 samples/net/mbedtls_dtlsserver/README.rst
 create mode 100644 samples/net/mbedtls_dtlsserver/prj_qemu_x86.conf
 create mode 100644 samples/net/mbedtls_dtlsserver/src/Makefile
 create mode 100644 samples/net/mbedtls_dtlsserver/src/dtls_server.c
 create mode 100644 samples/net/mbedtls_dtlsserver/src/udp.c
 create mode 100644 samples/net/mbedtls_dtlsserver/src/udp.h
 create mode 100644 samples/net/mbedtls_dtlsserver/src/udp_cfg.h
 create mode 100644 samples/net/mbedtls_dtlsserver/testcase.ini
 create mode 100644 samples/net/zoap_server/prj_bt.conf
 rename samples/net/zperf/{prj_galileo_ethernet.conf => prj_galileo.conf} (100%)
 rename samples/net/zperf/{prj_galileo_ethernet_prof.conf => prj_galileo_prof.conf} (100%)
 create mode 100644 subsys/net/ip/l2/bluetooth_shell.c

Change-Id: Ia8dd7ec706dd128ba6af61390323554d5b7dc183
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-13 18:12:22 +01:00
Luiz Augusto von Dentz
fb5ea68762 net: zoap_server: Enable connecting with bluetooth
Change-Id: Iae05264f8677afb49c5060c13ad3e89c86c89929
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-13 17:05:53 +00:00
Johann Fischer
6b79ed0428 net: ieee802154: inform about unsupported frames
Be nice and inform user about unsupported and dropped frames.

Change-Id: Iaf0e7ed660a926c45dac9fc36b788c4c786eac11
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-01-13 14:38:59 +00:00
Luiz Augusto von Dentz
5ea0612f69 net: echo_client: Enable CONFIG_NET_L2_BLUETOOTH_SHELL in prj_bt.conf
This makes it possible to setup a Bluetooth connection using net_bt shell
commands.

Change-Id: Ie4ae7e61345315ef987a00b6b5a28c0419f6b1c8
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-13 14:37:53 +00:00
Luiz Augusto von Dentz
8b185ecc50 net: bt: Add disconnect shell command
Change-Id: Ibb3a6e580751549ab5330296d6cd9f9cae4903ab
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-13 14:37:42 +00:00
Luiz Augusto von Dentz
e13a899280 net: bt: Add disconnect management command
This adds NET_REQUEST_BT_DISCONNECT which can be used to disconnect
IPSP in case it is connected.

Change-Id: I8da00b02ee08611bef5f4c0708936b2d31fd2a93
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-13 14:37:30 +00:00
Luiz Augusto von Dentz
1112c2d382 net: bt: Add scan shell command
Change-Id: Ieecf4e3ed91641582fe6a8e5512eb13fe3b8e76e
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-13 14:37:13 +00:00
Luiz Augusto von Dentz
4eae48ee64 net: bt: Add scan management command
This adds NET_REQUEST_BT_SCAN which can be used to scan peripherals
advertising IPSS UUID.

Change-Id: I2463079d182b4da080e6ef94d883c7c1e24a454c
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-13 14:37:04 +00:00
Luiz Augusto von Dentz
1bcd12d0d3 net: bt: Add shell support
This adds a shell module called "net_bt" that exposes Bluetooth L2
management commands.

Change-Id: Ia6da1d38cfd51502119758a8f6abbb6d1cd31743
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-13 14:36:42 +00:00
Luiz Augusto von Dentz
b434d0f50b net: bt: Add connect management command
Connect command can be used to initiate a connection, which in IPSP
terminology refer to a router role.

Change-Id: I12b9428924c88a9c68d3adbfe9016a0dd690aade
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-13 14:36:26 +00:00
Luiz Augusto von Dentz
348f46bf6e net: bt: Fix not showing any logs
Including logging/sys_log.h before net_core.h prevents SYS_LOG_LEVEL,
etc, to be set properly.

Change-Id: Iaa7aa98110aa455162836be1d9560fbfc03569df
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-13 14:36:06 +00:00
Luiz Augusto von Dentz
a70c65d6ff net: echo_client: Don't start sending packets if interface is not UP
If the interface is not UP wait for MGMT event if that is enabled.

Change-Id: I4866c23d1e6f5b1a7cf212434d794673d7e756ce
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-13 14:35:55 +00:00
Luiz Augusto von Dentz
04aaab61ca net: echo_client: Fix using CONFIG_NETWORKING_WITH_BT
CONFIG_NETWORKING_WITH_BT no longer exist, instead
CONFIG_NET_L2_BLUETOOTH shall be used.

Change-Id: Ide353b7620228e431c535768b37749994caf8e8b
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-13 14:35:42 +00:00
Luiz Augusto von Dentz
331c29f96c net: mgmt: Decode event fields
This decodes the event layer, code and type when debugging is enabled.

Change-Id: I23c6fb200f3287a138e46df9f472c9982898675d
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-13 14:34:51 +00:00
Luiz Augusto von Dentz
56261b21cc net: mgmt: Make NET_MGMT_GET_* macros return meaningful values
They should return the same value as in NET_MGMT_LAYER and
NET_MGMT_LAYER_CODE.

Change-Id: Ia95adcd3b6b6aaf0ed29f3260bc54784ca532d8f
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-13 14:34:35 +00:00
Tomasz Bursztyka
4695e895c8 samples: net: Fix dhcpv4 building with net mgmt event support
It was missing for arduino_101.

Jira: ZEP-1574

Change-Id: I08fc0961b94f5f7b1b787ebf52e7d9922e38006c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-13 11:38:17 +01:00
Tomasz Bursztyka
55d653f52f net: mgmt: Silently ignore net_mgmt_event functions if not enabled
When CONFIG_NET_MGMT_EVENT is not set, it will still be able to compile
code using net_mgmt_event related functions.

Change-Id: I6824c57093636867ea4228338aa6c02913975510
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-13 11:35:41 +01:00
Johann Fischer
133f2c07d2 net: ieee802154: fix validate_mac_command_cfi_to_mhr
Change-Id: I4baa9e8e079531f1759584c22869c97b72ab2588
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-01-13 10:29:04 +01:00
Andy Ross
fc35e649ff net: tcp: Don't leak net_conn_handles
net_context_put() forgot to release the conn_handler field causing
subsequent failures in net_conn_register() when they ran out.

Change-Id: I0d306b5035199422fa8788338ac9da8d1900d5f9
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2017-01-13 10:29:03 +01:00
Andy Ross
96294b79a7 net: tcp: Signal EOF with a NULL buffer in the callback
TCP didn't actually have a way to signal synchronous receipt of a FIN
packet.  Extend the recv_cb API to allow a NULL buf argument with
status==0 (by analogy to Unix's zero-length read) to signal EOF.

Update docs too, and also echo_server which wasn't prepared to handle
this situation.

Change-Id: I7dc08f9e262a81dcad9c670c6471898889f0b05d
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2017-01-13 10:29:03 +01:00
li zj
9a87e403ac net: icmpv4 : calculate ipv4 header chksum
In icmpv4, after calling setup_ipv4_header() function,
only calculate ICMP chksum, not calculate ipv4 header chksum,
ipv4 header chksum still 0, the other side will drop this pack.

Change-Id: I1550a4c8c7ab63132d70ba6ce19a7caf78ad84e6
Signed-off-by: li zj <279939902@qq.com>
2017-01-13 10:29:03 +01:00
li zj
0fc1d808a3 net: dhcpv4 : set ciaddr 0.0.0.0 when send DHCPV4_MSG_TYPE_REQUEST
When router receive dhcpv4 request with ciaddr not 0.0.0.0,
some router reply NAK, dhcpv4 never successful.

Change-Id: I4b66b18f7d30ad5a1b638fdca0bb204ed078d551
Signed-off-by: li zj <279939902@qq.com>
2017-01-13 10:29:03 +01:00
Michael Scott
a972d03ce7 net: ip: save TCP seq/ack values in tcp_synack_received
The tcp_synack_received() function ends with a call to send_ack().
However, if we don't update the sequence and ACK values, we'll send back
headers with 0 values and the destination will try resending over and
over.

Fix this by saving the seq and ack values when a TCP_SYN is flagged
in the header (which should be the case almost any time this function
is used as a callback).

Change-Id: I57f07ce719f2b6e2fb34c96c867d2e1c37f342ba
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-01-13 10:29:03 +01:00
Michael Scott
f23ca0e5e1 net: ip: reword appdata debug message in packet_received
Trivial text tweak for clarity.

Change-Id: I470d54d86de7ddc4e83e3ad871448c244134c117
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-01-13 10:29:03 +01:00
Michael Scott
742b5e22ea net: ip: set context state to NET_CONTEXT_CONNECTED on synack success
Once SYNACK has been received for a TCP connection, we need to set the
net context state to NET_CONTEXT_CONNECTED or else calls to sendto()
will fail with -ENOTCONN.

Change-Id: Idd78e1dcdd5ac0bca5d3fba40b59ab8fde6b8729
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-01-13 10:29:02 +01:00
Michael Scott
c306844583 net: ip: set local address family during TCP connect
When calling net_context_connect, the local address family
is never set prior to calling net_tcp_register.  This generates
an error:
"Local address family not set." (-EINVAL)

Let's set the local address family prior to this call.

Change-Id: Ic5f2edf684d14f9bb77019c49c95e5524a406417
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-01-13 10:29:02 +01:00
Michael Scott
a2464d049f net: ip: on synack copy local/remote data prior to net_tcp_register
When TCP SYNACK is received we register the connection via the
net_tcp_register function.  During this call several errors are
generated concerning local and remote address information not
being set.

Let's copy the local and remote address data prior to this call.

Change-Id: I17cd83f7b4b7e65e45fec1810fb38f745653bdc7
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-01-13 10:29:02 +01:00
Michael Scott
ff1345dbaf net: tcp: replace seq/ack/wnd value shifts with system calls
In other portions of the code we use the sys_put_be* function
to shift the values from the current system endian to big
endian array of bytes.  Let's be consistent and do that in
the prepare_segment function as well.

Change-Id: I5a1a4c30ddf313c9e978be98fd969899f5de6190
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-01-13 10:29:02 +01:00
Michael Scott
22bd26cba7 net: net_context: state setting is a value not individual bits
The state of a net context is checked as a whole value (not individual
bits).  Currently, the net_context_set_state function is adding the
passed in flags to the existing value.  This is incorrect.

Change-Id: Ieba6b9dfc35537745b14c50a2ccb115c6976c001
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-01-13 10:29:02 +01:00
Kumar Gala
0f2ce02abe net: Remove NET_SLIP choice from Kconfig
The NET_SLIP Kconfig choice option doesn't really do anything for us,
plus we get warnings related to setting CONFIG_NET_SLIP=y in prj.conf
files.

Warnings like:

warning: override: reassigning to symbol NET_SLIP
warning: override: NET_SLIP_TAP changes choice state

So remove NET_SLIP choice and remove CONFIG_NET_SLIP=y in the prj.conf
files.

Change-Id: Ibccf9cf167f4c8a4df480ca0396bf83fcf60df1e
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-13 10:29:02 +01:00
Sergio Rodriguez
61ac519e1b samples/mbedtls_dtlsserver DTLS server example app using mbedTLS
Jira: ZEP-1534

Change-Id: Ia4b8bf00182c6281144a44a55b0b45354c1b234d
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-13 10:29:01 +01:00
Sergio Rodriguez
1452eba464 samples/mbedtls_dtlsclient: IPv6 client version
Change-Id: Ifff5afc78ca9a84f62890b7c0d5f57ca30b432b9
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-13 10:29:01 +01:00
Sergio Rodriguez
79aee2e002 samples/mbedtls_dtlsclient: Remove hardcoded IP adresses
Change-Id: I0269809b12881fa32fdd231056c5515ee6c30bc7
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-13 10:29:01 +01:00
Sergio Rodriguez
3940d9d645 samples/mbedtls_dtlsclient: Change Readme files to rst format
Change-Id: Ibf38dc7166687e248cd2ef37d63a67a67f338f28
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-13 10:29:01 +01:00
Sergio Rodriguez
5d82bc7599 samples/mbedtls_dtlsclient: Using printk instead of printf
Change-Id: Ie6026d261229f16814d9fa0c3477e01c5b8b8de2
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-13 10:29:01 +01:00
Tomasz Bursztyka
c9a250db11 samples: net: Echo apps need different IP to be able to work
Change-Id: I8d630a568e6520e259b35a4048774355488084c1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-13 10:29:00 +01:00
Johann Fischer
1f6e8cab32 samples: ieee802154: rename cc2520 to hw
Rename cc2520 directory to hw and use it as generic
test application for the 802154 hardware driver.

Change-Id: I1c21505b7eb295279190f011a99c80e762178730
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-01-13 10:29:00 +01:00
Johann Fischer
ce189f84a9 ieee802154: conf: add common log level
Add common log level for all IEEE802154 drivers.

Change-Id: If92c96b14e630d4482aadf9cacb25662d6663399
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-01-13 10:29:00 +01:00
Flavio Santes
cfe4c2cebb samples/net: Update DNS client README file to RST format
Reformat and consolidate the samples/net/README and dns_client/READMExxx
files according to the RST spec.

Change-Id: I735190245204854ac5527e18971cc4c6478423e5
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-13 10:29:00 +01:00
Flavio Santes
38594021d6 samples/net: Update the zperf/README.rst file
Update the zperf/README.rst file with the following information:

- Homogenize the usage of "zperf", "iPerf" and "Zephyr"
- Update the Supported Boards section
- Clarify some instructions
- Add the Requirements section

Change-Id: Idfb29e2a5db9a78c19a6a27923f134583ebe5822
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-13 10:29:00 +01:00
Flavio Santes
447796f4f2 samples/net: Rename prj conf files to avoid breaking the build
Rename the project configuration files to pass the build.

The Makefile specifies the following format for the conf file:
prj_BOARD_PROF.conf. However, there are two files with the
following format: prj_BOARD_IFACE_PROF.conf. So, rename them
to avoid build errors.

Change-Id: I75e0d4169db881583b5f9a2b67deee46f66b6c97
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-13 10:29:00 +01:00
Flavio Santes
24c80faa9c samples/net: Update zperf Makefile
Remove commented line in the zperf/Makefile file.

Change-Id: Id869f21e923d3bb39fc31c5216ce29d78a0e1805
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-13 10:29:00 +01:00