Commit graph

19237 commits

Author SHA1 Message Date
Michael Scott
fe99cfe630 drivers: gpio: stm32: fix CONFIG_SOC_SERIES_STM32F4X build break
The commit c90e4d063be0ff5f47df45ca8500eff8518c5d25 changed
line 216 in drivers/gpio/gpio_stm32.c:
-elif CONFIG_SOC_SERIES_STM32F4X
+#elif /* CONFIG_SOC_SERIES_STM32F4X */

This causes the following compiler error:
zephyr/drivers/gpio/gpio_stm32.c:218:39: error: #elif with no expression
 #elif /* CONFIG_SOC_SERIES_STM32F4X */
                                       ^

Change-Id: Ie8b124931e333aa7860e6db22f5c259670e29833
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-01-23 15:15:53 -06:00
Maureen Helm
294fdab7bd serial: k64: Remove the uart_k20 driver
Now that we have a more generic mcux serial driver, remove the uart_k20
driver.

Jira: ZEP-719
Change-Id: I51a3237454140feabbfe18ac2c8ee451e572c7be
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-23 15:15:53 -06:00
Maureen Helm
bb45fd526e frdm_k64f: hexiwear_k64: Remove defaults for the uart_k20 driver
Jira: ZEP-719
Change-Id: If1d3e1d450f582d6d3d500385e7fc15afe00b79f
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-23 15:15:53 -06:00
Maureen Helm
8c3d4f770a k64: Change the default serial driver to the mcux one
Stop using the specific uart_k20 driver by default and start using the
more generic mcux uart driver instead.

Jira: ZEP-719
Change-Id: I7b107ea7118887591362159283ebb5413b45595a
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-23 15:15:53 -06:00
Maureen Helm
2e205e69d1 frdm_k64f: hexiwear_k64: Add defaults for the mcux serial driver
Jira: ZEP-719
Change-Id: I4e325df0d91b93ec832a50a24a8f3c34778281e8
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-23 15:15:53 -06:00
Maureen Helm
38f812828e serial: Introduce new mcux shim driver
Adds a shim layer around the mcux uart driver to adapt it to the Zephyr
serial interface. Unlike the existing (and confusingly-named) uart_k20
driver, this driver can be used for k64 and other Kinetis SoCs.

Implements polling and interrupt-driven serial interface functions that
are logically equivalent to the uart_k20 driver. Adds an extra instance,
irq_tx_empty(), and err_check() that aren't implemented in the uart_k20
driver.

Jira: ZEP-719
Change-Id: Iab99542e7ec921ef4f361437768113fee01e5fe8
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-23 15:15:53 -06:00
Gil Pitney
efb978da1a cc3200: Added board documentation in RST format.
This follows the board.rst template in the RFC
for board documentation:
https://gerrit.zephyrproject.org/r/#/c/9703/

This RST file was validated visually by rendering
using the online tool: http://rst.ninjs.org/

JIRA: ZEP-1541

Change-Id: Ibe6e1c7f8eb3c7862b4087a78b469693927280a2
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2017-01-23 15:15:53 -06:00
Erwan Gouriou
8890b73b6e license: Replace Apache boilerplate with SPDX tag
Apply JIRA: ZEP-1457 to STM32F3X family porting patchset.

Change-Id: I352267a47847143e557a4016de12bb9a14a20067
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-23 15:15:53 -06:00
Adam Podogrocki
a0dcfcce97 pinmux/stm32: default pin assignment for STM32373C-EVAL board
Change-Id: Id4b04749e1d707d12aa78cabd8d103701b6d55b6
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-01-23 15:15:53 -06:00
Adam Podogrocki
7d6c139082 pinmux/stm32: default pin assignment for NUCLEO-F334R8 board
Change-Id: Ib70471ceb2e4444d5826a5a17cbfc42161df78d2
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-01-23 15:15:53 -06:00
Adam Podogrocki
2ce996695a pinmux/stm32: default pin assignment for STM3210C-EVAL board
Change-Id: I87c3806b2fad649c67e8d66981ff6a99168fda72
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-01-23 15:15:53 -06:00
Adam Podogrocki
d8992f576e boards: add initial support for STM32373C-EVAL with SoC STM32F373VC
Change-Id: Iec92b0c7e2c244bd82ee9c318f6f2cb3ed2d7397
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-01-23 15:15:53 -06:00
Adam Podogrocki
5f2fa051a6 boards: add initial support for Nucleo-64 with Soc STM32F334
Change-Id: I0b9992e26353cea3b0415aa57ab3b983d84cef05
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-01-23 15:15:53 -06:00
Kumar Gala
05f717e71b uart/stm32: add STM32F3X support for uart
Change-Id: I9796c6a2841c972eeab15894a6d7f38ae93606d1
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-23 15:15:53 -06:00
Adam Podogrocki
726d11a5a2 pinmux/stm32: extend pinmux driver functionality to support STM32F3X series MCUs
Change-Id: Ifc4c93e03b6593f1b6c7e664fdf719f9344fe1ee
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-01-23 15:15:52 -06:00
Adam Podogrocki
f23492a059 gpio/stm32: provide GPIO driver implementation for STM32F3X family
Implementation includes adding some defines in the pinmux,
adjusting gpio driver to specific defines for STM32F3X family,
adding specific functionality in the F3X SoC definition.

Change-Id: I465c66eb93e7afb43166c4585c852e284b0d6e67
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-01-23 15:15:52 -06:00
Adam Podogrocki
61cc74c425 flash/stm32: flash driver for STM32F3x series microcontrollers
Change-Id: I0b41a50507a09a513a67d13374323d831a0ec86a
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-01-23 15:15:52 -06:00
Adam Podogrocki
c80023fca3 exti/stm32: add support for F334 & F373 MCUs
Change-Id: Ide3a3842077e6138ec9e6ce87bacf744632413bc
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-01-23 15:15:52 -06:00
Adam Podogrocki
c514f671c7 clock/stm32: add STM32F3X reset and clock control
Change-Id: Ie5f3ffec0b3aaf15f9d9f8063d2bab6be5aebb6e
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-01-23 15:15:52 -06:00
Adam Podogrocki
42a4615973 soc/stm32: add initial support for STM32F3X series
Supported SoCs:
- STM32F303XC
- STM32F334X8
- STM32F373XC

Change-Id: I74b9561272d54e270ae1a1f602fd389d4c86539a
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-01-23 15:15:52 -06:00
Erwan Gouriou
9ff75b2a1b board: add nucleo_401re board documentation
This patch adds documentation for nucleo_f401re board

Change-Id: I605b990885130fb8bbe23581713b03656fbca061
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-01-23 15:15:52 -06:00
Kumar Gala
2e0c2aff97 arm: nvic: kill _NvicSwInterruptTrigger
_NvicSwInterruptTrigger is only utilized by a testcase for irq handling
on ARM-V7M.  Just put the code into the testcase so we dont need to
support an additional interface.

Change-Id: I763c63c32a7a52918250458351d08b8fa54069dd
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-23 15:15:52 -06:00
Ricardo Salveti
6e14642c1e arm/nordic_nrf5: enable SOC_FLASH_NRF5 by default if FLASH is enabled
SOC_FLASH_NRF5 is compatible with any nrf5 device, so enable the driver
by default if CONFIG_FLASH is also enabled.

Change-Id: I6ddf7cc41bb28071f682e78661b184a8e2ee7aa9
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-01-23 15:15:52 -06:00
Ricardo Salveti
58460a52c9 arm: set default vector table address in prep_c when XIP
It is called before early SoC initialization, so remove the duplicated
code from other boards and just set it by default when using XIP.

This can later be used when adding bootloader support, as an
additional option could be created to move the VTOR offset to a
different address.

Change-Id: Ia1f5d9a066de61858ee287215cefdd58596b6b1c
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-01-23 15:15:52 -06:00
Kumar Gala
90f38f395e arm: kinetis: Remove duplicate & unused defines
The k20_sim.h used by the PWM driver has some defines that also exist in
the MCUX HAL.  Lets pickup the values from the HAL and drop the one's
that are in k20_sim.h.  Also, they aren't used by anything at this
point.

Change-Id: Iaed4e8e5cec7d57a5ce9e89480cecfb7dc90a5e6
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-23 15:15:52 -06:00
David B. Kinder
38ca5843cd doc: update MAINTAINERS for .rst files
Previous MAINTAINERS patch using F: *.rst didn't work
so trying adding */*.rst */*/*.rst , etc. to see if
that works.

Change-Id: I0555b3ad2a2bf24cf0b9351860d7a85f6cc7627a
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-01-23 18:36:28 +00:00
Anas Nashif
78adda30c9 boards: arduino 101: set user LED values correctly
Change-Id: Ie6b2c4c4c0ac6af5bc5a7d628599313ab971f56b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-23 17:32:53 +00:00
Bogdan Davidoaia
bc5039cfba docs: sensor: update included example code
Update line numbers for included example code to reflect changes in the
source files.

Change-Id: Iceeed0a8b6df91746cf58d23fe09a03713a07d98
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-23 15:32:54 +02:00
Anas Nashif
594992f7b2 license: use SPDX identifier for files in ext/
Change-Id: I32cb4211056046ca28a81aa97aca5d3c0b9b8303
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-20 20:22:57 -05:00
David B. Kinder
516e155bb5 tests: update to Apache 2.0 SPDX tags on new tests
Some new tests were added that had the Apache 2.0 boilerplate licensing
instead of the SPDX licensing tag.

Change-Id: I4bde8c9c6e7a6d44bceeffb6bbcff9f62d417648
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-01-21 01:21:21 +00:00
David B. Kinder
2cb045420c doc: fix .rst files canonical heading order
The headings on some .rst files were not following the expected
heading order of using # for h1, * for h2, = for h3, and - for h4
This patch fixes that, and the doc/templates/*.tmpl files created
for folks to use as templates for creating board and sample docs.

Change-Id: I0263b005648558d5ea41a681ceaa4798c9594dd9
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-01-20 16:06:36 -08:00
Anas Nashif
aaf7f7fb91 Merge "Merge net branch into master" 2017-01-20 15:23:09 +00:00
Bogdan Davidoaia
4fadbbeebd sensor: fxos8700: fix missing dependency in Kconfig
FXOS8700_THREAD_PRIORITY and FXOS8700_THREAD_STACK_SIZE need to also
depend on FXOS8700_TRIGGER, else they will not show in the fxos8700
menu entry when running "make menuconfig".

Change-Id: I8f59125157f046592f3c92dcf2a92bd0e407cd6a
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-20 14:40:40 +00:00
Bogdan Davidoaia
6460e7655d samples: sensor: fxos8700: use floating point for printing sensor values
Printing values as <integer_part>.<fractional_part> gives undesired
results for negative numbers, so print the values converted to floating
point to avoid this.

Change-Id: I871b8461f2d643a2adce67df064e9f5e6d506319
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-20 14:40:39 +00:00
Jukka Rissanen
90c37e21ea Merge net branch into master
Main changes:

- TCP fixes
- ZoAP server sample application
- Fixes to issues reported by Coverity

----------------------------------------------------------------
Anas Nashif (1):
      net: in newlib, ESHUTDOWN is considered an extension

Andrei Emeltchenko (1):
      wpan_serial: Fix possible NULL pointer dereference

Andy Ross (2):
      net: tcp: Pass correct user_data pointers
      net: tcp: Destroy net_tcp struct at the same time as the context

Flavio Santes (3):
      samples/net: Remove redundant configuration variable
      drivers/ethernet: Update default GPIO pin for the ENC28J60 module
      samples/net: Remove legacy configuation variables

Jukka Rissanen (11):
      net: Fix possible null pointer dereference in nbuf
      net: icmpv6: Removing dead code
      net: tcp: Allocate space for TCP header
      net: ipv6: Check neighbor pointer in NS reply timeout
      net: ipv6: Fix IPv6 prefix comparision
      net: nbuf: Check possible null pointer access
      net: buf: Use TCP sent_list variable only if needed
      net: nbuf: Fix debug prints in memory pool init and unref
      net: context: Add status to connect callback
      net: echo-server: Use net_buf_frag_del() return parameter
      net: echo-server: Discard 0 byte received packets

Leandro Pereira (7):
      net: slip: Do not remove fragments when sending data
      net: tcp: Ensure all timers are disposed of when releasing context
      net: tcp: Use an uint8_t for retry timeout instead of an uin32_t
      net: tcp: Remove unused `recv_ack` field from TCP context
      net: tcp: Get rid of `recv_mss` field from TCP struct
      net: tcp: Reduce size of `state` member from 32 to 4 bits
      net: tcp: When retransmitting, hold an extra, temporary reference

Luiz Augusto von Dentz (2):
      net: zoap-client: Add bluetooth support
      net: zperf: Add bluetooth support

Michael Scott (13):
      net: linkaddr: calculate linkaddr storage addr size via config
      net: linkaddr: introduce net_linkaddr_set function
      net: ipv6: fix NULL reference in handle_ra_neighbor
      net: route: remove extra variable use in net_route_add()
      net: tcp: remove unused semaphore tcp_lock
      net: tcp: in tcp_establish save TCP flags for post-processing use
      net: tcp: handle TCP_FIN after processing any data in the buffer
      net: tcp: don't assume TCP_FIN buffers are NET_DROP
      net: tcp: if buffer is TCP_FIN increment send_ack by 1
      net: tcp: fix buffer leak in tcp_synack_received
      net: net_context: correct description of recv_data_wait in net_context
      net: tcp: move accept_cb from net_context to net_tcp
      net: tcp: add timeout wait in net_context_connect

Ravi kumar Veeramally (6):
      samples: net: Fix DHCPv4 config options and run on its own thread
      net: 6lo: Handle destination address uncompression properly
      net: 6lo: Fix dereferencing null pointer
      net: dhcpv4: Remove dead code
      net: samples: Add ENC28J60 pin numbers to documentation
      net: samples: Print assigned address from DHCPv4 server

Tomasz Bursztyka (4):
      net: shell: Use lighter printk() instead of printf()
      samples: net: Fix a format issues in echo_client
      samples: net: Enable buffer warning and errors in echo apps on qemu
      net: tcp: Fix TCP states swap when accepted an incoming connection

Vinicius Costa Gomes (14):
      samples/zoap_server: Add support for the '/separate' resource
      samples/zoap_server: Add support for blockwise GET tests
      iot/zoap: Add response code for Continue status
      samples/zoap_server: Add resouce for TD_COAP_BLOCK_03
      iot/zoap: Ignore non-request packets in zoap_handle_request
      iot/zoap: Fix wrong byte-order when retrieving integer options
      iot/zoap: Clarify the return value of zoap_register_observer()
      iot/zoap: Add a helper to find an observer by address
      samples/zoap_server: Fix responding messages with the wrong type
      samples/zoap_server: Add support for messages with token
      samples/zoap_server: Add Content-Format options to GET responses
      samples/zoap_server: Include a path for the "created" resource
      samples/zoap-server: Add support for the "location-query" resource
      samples/zoap_server: Do not error if there's no payload or queries

 drivers/ethernet/Kconfig.enc28j60                  |   2 +-
 drivers/slip/slip.c                                |   5 +-
 include/net/buf.h                                  |   2 +
 include/net/net_context.h                          |  24 +-
 include/net/net_ip.h                               |  21 +-
 include/net/net_linkaddr.h                         |  55 ++-
 include/net/zoap.h                                 |   9 +
 samples/net/dhcpv4_client/prj_arduino_101.conf     |   2 -
 samples/net/dhcpv4_client/prj_frdm_k64f.conf       |  12 +-
 samples/net/dhcpv4_client/prj_qemu_x86.conf        |  29 +-
 samples/net/dhcpv4_client/src/Makefile             |   1 +
 samples/net/dhcpv4_client/src/main.c               |  52 ++-
 samples/net/dns_client/README.rst                  |  22 +-
 samples/net/dns_client/prj_arduino_101.conf        |   5 -
 samples/net/echo_client/prj_arduino_101.conf       |   4 +-
 samples/net/echo_client/prj_qemu_x86.conf          |   3 +
 samples/net/echo_client/src/echo-client.c          |   2 +-
 samples/net/echo_server/prj_arduino_101.conf       |   4 +-
 samples/net/echo_server/prj_qemu_x86.conf          |   3 +
 samples/net/echo_server/src/echo-server.c          |  16 +-
 .../net/mbedtls_dtlsclient/prj_arduino_101.conf    |   2 -
 samples/net/wpan_serial/src/main.c                 |   6 +-
 samples/net/zoap_client/Makefile                   |   7 +-
 samples/net/zoap_client/prj_bt.conf                |  21 +
 samples/net/zoap_client/src/Makefile               |   5 +
 samples/net/zoap_client/src/zoap-client.c          |  38 +-
 samples/net/zoap_client/testcase.ini               |   5 +
 samples/net/zoap_server/src/zoap-server.c          | 476 ++++++++++++++++++++-
 samples/net/zperf/Makefile                         |   7 +-
 samples/net/zperf/prj_bt.conf                      |  32 ++
 samples/net/zperf/src/Makefile                     |   5 +
 samples/net/zperf/src/zperf_shell.c                |  12 +
 subsys/net/ip/6lo.c                                |  16 +-
 subsys/net/ip/Makefile                             |   1 +
 subsys/net/ip/dhcpv4.c                             |   9 +-
 subsys/net/ip/icmpv6.c                             |   4 -
 subsys/net/ip/ipv6.c                               |  26 +-
 subsys/net/ip/nbr.c                                |   6 +-
 subsys/net/ip/nbuf.c                               |  40 +-
 subsys/net/ip/net_context.c                        | 126 +++---
 subsys/net/ip/net_shell.c                          | 217 +++++-----
 subsys/net/ip/route.c                              |   6 +-
 subsys/net/ip/tcp.c                                | 140 +++---
 subsys/net/ip/tcp.h                                |  67 ++-
 subsys/net/lib/zoap/zoap.c                         |  86 +++-
 tests/net/context/src/main.c                       |   3 +-
 tests/net/ipv6/src/main.c                          |  66 +++
 tests/net/rpl/src/main.c                           |   8 +-
 48 files changed, 1278 insertions(+), 432 deletions(-)
 create mode 100644 samples/net/zoap_client/prj_bt.conf
 create mode 100644 samples/net/zperf/prj_bt.conf

Change-Id: Id27ce34fccfaf2b7d5f3112b9a8b47c60f695f3e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-01-20 16:27:01 +02:00
Jukka Rissanen
007e231ff5 net: echo-server: Discard 0 byte received packets
If we receive 0 byte packets from the network, we need to
ignore those as otherwise it is possible to leak network
buffers.

Change-Id: Id4b5b0d03c0b6d1e16634ff2d1960ea4728c8aa1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-01-20 16:23:21 +02:00
Jukka Rissanen
011b22d64e net: echo-server: Use net_buf_frag_del() return parameter
Because net_buf_frag_del() returns the next fragment in the list,
we can use the return value which makes the code nicer looking.

Change-Id: Ic3d0155417b52a34bfbaa918570ff9af95aee468
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-01-20 16:23:21 +02:00
Andrei Emeltchenko
4a24192529 wpan_serial: Fix possible NULL pointer dereference
Return and clean buffer when fragment can not be allocated.

Coverity-CID: 157590

Change-Id: Ic8844609da4049623a6cf0c2ae037b2b777542e9
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-20 16:23:21 +02:00
Tomasz Bursztyka
467c69d524 net: tcp: Fix TCP states swap when accepted an incoming connection
TCP states are swaped between "server" context and the new connection
context. But in any case the "server" context should loose the
information that makes it able to accept other new connections.

The swap was badly made, as the "server" context was loosing the
accept_cb (!) and the user data pointer. Instead the new connection
context was unrelevantly inheriting those.

Change-Id: Icc877449e1d4c4e59553dcbfd41718c5006edca0
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-20 16:23:21 +02:00
Jukka Rissanen
088289ec28 net: context: Add status to connect callback
It is useful that the user API can know whether the connection
was established properly or not. So this commit adds status
parameter to connect callback in net_context API.

The call to connect callback needs to be set properly in TCP
code. This commit does not fix the connect callback call which
is not properly done right now in net_context.c.

Change-Id: I284a60ddd658ceef9e65022e96591f467a936a09
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-01-20 16:23:21 +02:00
Ravi kumar Veeramally
724aa3ffbd net: samples: Print assigned address from DHCPv4 server
Print assigned address and other information if client receives
anything from server. E.g. subnet, lease time and router.

Change-Id: I759d59522930401766452eb1fb3d57d1a8295a67
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-20 16:23:21 +02:00
Ravi kumar Veeramally
9b68f18ffb net: samples: Add ENC28J60 pin numbers to documentation
ENC28J60 has numbers on the board. Documentation has information about
signals only. Wiring will be easy with pin numbers.

Change-Id: I0afd6058a9417b679ef6358304737bf256aa3522
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-20 16:23:20 +02:00
Jukka Rissanen
9a7ccf81f9 net: nbuf: Fix debug prints in memory pool init and unref
Wrong pool pointer was used when printing pool information during
the unref in nbuf.c. During nbuf init, wrong pool pointer was used
when printing memory pool sizes.

Change-Id: I9ed08cf7afa3c841c97ea981b97fff37aa40a984
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-01-20 16:23:20 +02:00
Luiz Augusto von Dentz
0918a903b1 net: zperf: Add bluetooth support
Change-Id: I56f2000cef929d5d0ddae0d67bc222d20db06480
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-20 16:23:20 +02:00
Luiz Augusto von Dentz
862b8dcfc6 net: zoap-client: Add bluetooth support
Change-Id: I9bef7f176deca6476e20d97d547b8d91ffc62c83
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-20 16:23:20 +02:00
Michael Scott
72e013a7ba net: tcp: add timeout wait in net_context_connect
If the parameter "timeout" is set in net_context_connect(), the
assumption by the user is that the function would wait for SYNACK
to be received before returning to the caller.

Currently this is not the case.  The timeout parameter is handed
off to net_l2_offload_ip_connect() if CONFIG_NET_L2_OFFLOAD_IP is
defined but never handled in a normal call.

To implement the timeout, let's use a semaphore to wait for
tcp_synack_received() to get a SYNACK before returning from
net_context_connect().

Change-Id: I7565550ed5545e6410b2d99c429367c1fb539970
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-01-20 16:23:20 +02:00
Michael Scott
eb9055c019 net: tcp: move accept_cb from net_context to net_tcp
net_context is used for more than just TCP contexts.  However,
the accept_cb field is only used for TCP.  Let's move it from
the generic net_context structure to the TCP specific net_tcp
structure.

Change-Id: If923c7aba1355cf5f91c07a7e7e469d385c7c365
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-01-20 16:23:20 +02:00
Michael Scott
34b67374de net: net_context: correct description of recv_data_wait in net_context
The recv_data_wait field in struct net_context is described as a "Mutex"
when in fact it's a semaphore signal.

Change-Id: I3bef8d1a07ceb3da5894ae4cdc8f1fe3c61c5dbe
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-01-20 16:23:20 +02:00
Michael Scott
2c3faa0de2 net: tcp: fix buffer leak in tcp_synack_received
When SYNACK is received we dont hand off the netbuf to anything
which will call net_nbuf_unref, so let's not mark it NET_OK.
Instead let the code path fall through to mark it NET_DROP.

Change-Id: I1f883e1a13c53c930bf50c07ff701e3db6f02d8a
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-01-20 16:23:20 +02:00
Michael Scott
87914610b0 net: tcp: if buffer is TCP_FIN increment send_ack by 1
Now that the TCP_FIN block is after a potential packet_received()
tcp->send_ack should be appropriately set to the last sequence
processed.

In the case of a TCP_FIN buffer, we should advance it by 1 or else
the destination will continue to retry to send the last block.

Change-Id: I9c97d35a87ad6cc1a50f928b237780bff4cd2877
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-01-20 16:23:20 +02:00