Commit graph

19237 commits

Author SHA1 Message Date
Kumar Gala
cd7ea0b56c samples: disable single threaded hello world for configs that fail
If we have Bluetooth or GPIO SCH we need multithreading right now
so disable any platforms that enable these features from running
this test.

Change-Id: I1ea35636e1382aac0f266fe73441619f9ac00d53
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-12-19 10:59:10 -06:00
Marcus Shawcroft
2c3a3ea84c dhcpv4: Adjust prj file selection.
Change-Id: I8e21285bfde33612fd9ded65257195612f880249
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-19 10:29:15 +00:00
Marcus Shawcroft
28aff9506f dhcpv4_client: Remove unnecessary ETH_KSDK configuration.
Change-Id: I18218501949a7a408c8ecd5501e0011204801e6d
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-19 10:29:15 +00:00
Marcus Shawcroft
6f74a4a3dc k64f: Default the ETH_KSDK on if NET_L2_ETHERNET enabled.
The K64F board has the ENET ethernet driver.  Behavior consistently
with other driver selection logic and default the KSDK ethernet driver
on if ETHERNET drivers are enabled.

Change-Id: I2fbed7fdef22d75cf163b61b3e0530ce00d988f0
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-19 10:25:57 +00:00
Benjamin Walsh
8053024752 doc: update architecture porting guide to unified kernel
Change-Id: I065cc6f92e13275d993ab6ebf9dabd855b9356c9
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-12-17 22:44:46 +00:00
Benjamin Walsh
cef368f578 kernel/arch: rename ARCH_HAS_NANO_FIBER_ABORT to ARCH_HAS_THREAD_ABORT
And also remove now obsolete ARCH_HAS_TASK_ABORT.

ARC does not need the options either.

Change-Id: Ie52d63178a367ce12b911dacfe2d389f4f75ed2d
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-12-17 22:44:40 +00:00
Benjamin Walsh
50f4883117 kernel/arch: remove obsolete instances of irq_connect
Change-Id: I6a90bee60639b84b4cc8ffd02eae85fe44b86ee0
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-12-17 22:44:35 +00:00
Anas Nashif
a99aa34cb5 samples: add configuration for single threaded hello world
Change-Id: Ib7419321a5aa664cfa78e0229cd5add3494a6747
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-17 16:54:45 +00:00
Benjamin Walsh
096d8e9af5 kernel: fix warnings when CONFIG_MULTITHREADING=n
Change-Id: I57c6a225c3eece9e2d4942bacdfcb097f2edaf42
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-12-17 16:54:45 +00:00
Benjamin Walsh
e0ca2109a6 kernel: initialize system work queue after kernel is up
The system work queue spawns a coop thread to hanlde the work items. If
it is spawned before the kernel is up and the initialization dummy
thread's priority is lower, there will be a context switch into the
system work queue's thread at that time, before the kernel is ready to
handle this.

Change-Id: I879659ab58231c5a5cfaa34f2f65c2eccab99142
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-12-17 16:24:34 +00:00
Anas Nashif
f11fe9eca5 kernel: set CONFIG_MDEF by default
Legacy applications still need that, otherwise kernel objects are not
configured correctly. Will be removed later.

Change-Id: I22df10e4adcc11f035f9813bea8c93dd1a560a1d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-17 10:25:20 -05:00
Baohong Liu
db20723da2 samples: bmi160: code clean up
Remove CONFIG_BMI160_TRIGGER_SOURCE_GPIO from prj config
file. It is not being used any more.

Also change CONFIG_STDOUT_CONSOLE to CONFIG_PRINTK. The
whole sample is using printk instead of printf.

Change-Id: I4ac7db37da1e45aed2457ace9e82385e37143c36
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-16 23:07:55 +00:00
Anas Nashif
bd90bb7105 boards: define onboard LED on quark se c1000 devboard
Change-Id: I215a4988b4ab8c99279202b6821f6685fa23e84f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-16 16:36:53 -05:00
Tomasz Bursztyka
877972fa26 Merge net branch into master
Main changes:

- Mostly bug fixes (ZEP-1361, ZEP-1427 + others)
- DNS client gets a better API through a dedicated context
- echo apps are working again for bluetooth and 802.15.4

----------------------------------------------------------------
Andrei Emeltchenko (1):
      samples: net: Fix compile error following frdm pinmux change

Flavio Santes (14):
      net: Remove legacy tinydtls.h header
      tests/iot/http: Initialize parser struct
      tcp: Validate net_context_put return code
      iot/dns: Introduce the dns_context structure
      iot/dns: Update DNS client private routines
      iot/dns: Use a k_sem for the DNS rx routine
      iot/dns: Update sample application
      samples/mbedtls_dtlsclient: Validate destination buffer size
      samples/mbedtls_dtlsclient: Add ARG_UNUSED
      tests/tcp: Initialize buffer to NULL
      samples/net/README: Add DNS client section
      iot/dns: Update Makefile
      iot/dns: Add support for the FRDM K64F board
      iot/dns: Fix IPv6 compilation issue

Luiz Augusto von Dentz (4):
      net: echo_server: Enable Bluetooth support
      net: echo_client: Enable Bluetooth support
      net: Remove unnecessary k_wakeup
      net: echo_client: Fix using CONFIG_NETWORKING_WITH_BT

Sergio Rodriguez (1):
      samples/mbedtls_dtlsclient: Using semaphore for rx

Tomasz Bursztyka (26):
      net: Update TODO list on L2 and 15.4 tasks
      samples: wpanusb: Removing legacy left-over
      samples: net: echo apps: Add cc2520 configuration for frdm_k64f
      samples: echo apps: Use Kconfig options to setup IPv6 on cc2520 config
      net: l2: ethernet: Handle Ethernet II minimal frame size relevantly
      drivers: enc28j60: Let's remove the CRC in the end of the frame
      drivers: ethernet: Push DW specific Kconfig options to its own file
      drivers: ethernet: Enable sys log levels depending on NET_ETHERNET_L2
      drivers: enc28j60: Fix a tiny style issue
      drivers: enc28j60: Fix a Kconfig comment
      drivers: enc28j60: Fix one tiny naming issue
      drivers: ennc28j60: There is a unique L2 driver
      drivers: enc28j60: Add logging
      drivers: enc28j60: Expose RX thread stack size and prio config
      drivers: enc28j60: Removing useless legacy driver
      drivers: eth_ksdk: Theres is no longer 'ETHERNET' Kconfig option
      drivers: eth_ksdk: There is a unique L2 driver
      drivers: eth_ksdk: Simplifying MAC address generation
      samples: net: Remove useless prj.mdef from dhcpv4_client
      samples: net: Add Arduino 101 dedicated config for dhcpv4_client
      samples: net: Add dedicated dhcpv4 prj.conf for frdm k64f board
      samples: net: mbedtls: Let's enable fastest enc28j60 speed on a101
      net: buf: Use buf->pool instead of now removed buf->free
      samples: net: Fix echo applications setting for 15.4
      sample: net: Updating qemu config for 802.15.4 testing
      net: nbuf: Initialize nbuf memory area after allocation

 boards/arm/frdm_k64f/Kconfig.defconfig              |   4 +-
 drivers/ethernet/Kconfig                            |  66 +------------------
 drivers/ethernet/Kconfig.dw                         |  78 ++++++++++++++++++++++
 drivers/ethernet/Kconfig.enc28j60                   |  18 ++++-
 drivers/ethernet/Kconfig.ksdk                       |  23 +------
 drivers/ethernet/eth_enc28j60.c                     |  79 ++++++++++++++--------
 drivers/ethernet/eth_enc28j60_legacy.c              | 644 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 drivers/ethernet/eth_enc28j60_priv.h                |   6 +-
 drivers/ethernet/eth_ksdk.c                         |  34 ++++------
 include/iot/dns_client.h                            | 221 +++++++++++++++++++++----------------------------------------
 include/net/ethernet.h                              |   9 ++-
 include/net/tinydtls.h                              |  33 ----------
 lib/iot/dns/dns_client.c                            | 167 ++++++++++++++++++++++------------------------
 lib/iot/dns/dns_pack.c                              |   4 +-
 lib/iot/dns/dns_pack.h                              |   2 +-
 samples/net/README                                  |  19 ++++++
 samples/net/common/cc2520_frdm_k64f.c               | 100 ++++++++++++++++++++++++++++
 samples/net/dhcpv4_client/Makefile                  |   3 +-
 samples/net/dhcpv4_client/prj.mdef                  |   5 --
 samples/net/dhcpv4_client/prj_arduino_101.conf      |  43 ++++++++++++
 samples/net/dhcpv4_client/prj_frdm_k64f.conf        |  31 +++++++++
 samples/net/dns_client/Makefile                     |   1 -
 samples/net/dns_client/README_IPv4                  | 128 ++++++++++++++++++++++++++----------
 samples/net/dns_client/README_arduino_101           |   6 +-
 samples/net/dns_client/prj_frdm_k64f.conf           |  36 ++++++++++
 samples/net/dns_client/src/config.h                 |   2 +-
 samples/net/dns_client/src/main.c                   |  53 ++++++++-------
 samples/net/echo_client/Makefile                    |   2 +-
 samples/net/echo_client/prj_arduino_101_cc2520.conf |   4 +-
 samples/net/echo_client/prj_bt.conf                 |  33 ++++++++--
 samples/net/echo_client/prj_cc2520.conf             |   8 ++-
 samples/net/echo_client/prj_frdm_k64f_cc2520.conf   |  52 +++++++++++++++
 samples/net/echo_client/prj_qemu_802154.conf        |  31 +++++----
 samples/net/echo_client/src/Makefile                |  13 ++--
 samples/net/echo_client/src/echo-client.c           |   2 +-
 samples/net/echo_server/Makefile                    |   2 +-
 samples/net/echo_server/prj_arduino_101_cc2520.conf |   4 +-
 samples/net/echo_server/prj_bt.conf                 |  31 +++++++--
 samples/net/echo_server/prj_cc2520.conf             |   6 +-
 samples/net/echo_server/prj_frdm_k64f_cc2520.conf   |  51 +++++++++++++++
 samples/net/echo_server/prj_qemu_802154.conf        |  28 ++++----
 samples/net/echo_server/src/Makefile                |  13 ++--
 samples/net/echo_server/src/echo-server.c           |   4 +-
 samples/net/mbedtls_dtlsclient/prj_arduino_101.conf |   4 ++
 samples/net/mbedtls_dtlsclient/src/udp.c            |  39 ++++++++---
 samples/net/mbedtls_dtlsclient/src/udp.h            |   1 +
 samples/net/wpanusb/prj-legacy.conf                 |  20 ------
 subsys/net/TODO                                     |  34 +---------
 subsys/net/buf.c                                    |   7 +-
 subsys/net/ip/l2/ethernet.c                         |  35 ++++++++++
 subsys/net/ip/nbuf.c                                |  15 ++---
 subsys/net/ip/net_core.c                            |   2 -
 subsys/net/ip/tcp.c                                 |   6 +-
 tests/iot/test_http_header/src/test_http_header.c   |  14 ++--
 tests/net/tcp/src/main.c                            |  22 +++----
 55 files changed, 1007 insertions(+), 1291 deletions(-)
 create mode 100644 drivers/ethernet/Kconfig.dw
 delete mode 100644 drivers/ethernet/eth_enc28j60_legacy.c
 delete mode 100644 include/net/tinydtls.h
 create mode 100644 samples/net/common/cc2520_frdm_k64f.c
 delete mode 100644 samples/net/dhcpv4_client/prj.mdef
 create mode 100644 samples/net/dhcpv4_client/prj_arduino_101.conf
 create mode 100644 samples/net/dhcpv4_client/prj_frdm_k64f.conf
 create mode 100644 samples/net/dns_client/prj_frdm_k64f.conf
 create mode 100644 samples/net/echo_client/prj_frdm_k64f_cc2520.conf
 create mode 100644 samples/net/echo_server/prj_frdm_k64f_cc2520.conf
 delete mode 100644 samples/net/wpanusb/prj-legacy.conf

Change-Id: I87bb9a677c4dc3dc288a1b5050599410c399abd4
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:29:25 +01:00
Tomasz Bursztyka
675277e28d net: nbuf: Initialize nbuf memory area after allocation
After commit 71c7c01819 about buf pool, we
started to get spurious behaviors on various places of the code on
different boards (a101, frdm...) BUT on qemu. Basically, outgoing ip/udp
packets were full of garbage. Or sometimes it was the abilitty to parse
incoming packet that was happening.

The difference between qemu and actualy boards is - afaik, at least, let
me know if I am wrong - that qemu provide initialized memory (full of
0s). Following this asssumption, this patch just reset the nbuf right
after it got allocated. And all started to work again as thought.

It's in fact a good thing to reset nbuf memory. Even before the above
commit: after being used more than once, a buffer would have ended up
with old content, and this could have been generating a bug. So let's be
on the safe side and always intialize nbuf content.

Change-Id: I50647d9e9b82a4ed340a5ceb0d69409b0194dddd
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:56 +01:00
Tomasz Bursztyka
7a19370f84 sample: net: Updating qemu config for 802.15.4 testing
Removing useless options, refining the logging and of course setting the
right IP to make it work.

Change-Id: I0c0c1979d590bc4c4fcb3a1d1a252b87b0153511
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:56 +01:00
Tomasz Bursztyka
e7af4b8947 samples: net: Fix echo applications setting for 15.4
When zephyr receives a 15.4 frames it allocates 1 RX buf (nbuf) and 1
DATA (buf), and it gets queued on net stack for post processing.

Problem: receiving a lot of frames is just completely nominal and very
fast (timing is critical in radio, and the rx thread of the radio driver
has a high priority, much higher than net stack's rx post processing).
So guess what happens when CONFIG_NET_NBUF_RX_COUNT=10 though let's say
12 packets are coming in?

The RX buffer pools gets empty and soon the system hangs on getting a
newly allocated one.

This proper CONFIG_NET_NBUF_RX_COUNT tweak fixes the issue, however some
future work will reduce the need of so many RX meta buf:
- l2's recv could be called right away at net_recv_data, before queuing
  the buffer for post-processing, but this could affects reception
  timing on radio side, which is critical.
- An l2 pre-processing (in the middle of what current l2 recv does)
  could be implemented, it would be technology depenedent (aka: not
  mandatory on all l2) and could quickly decide what to do and at best
  drop the whole, or at least drop the RX meta buf (frag would still be
  kept). Let's see.

Jira: ZEP-1427

Change-Id: Ic75b02efa36e35b450c02b3e6439a8d73f03f839
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:56 +01:00
Tomasz Bursztyka
f991b82209 net: buf: Use buf->pool instead of now removed buf->free
Tiny debug message fix.

Change-Id: I464ff28d55b946a2e9ba4a0f9d88fbedd7ccef57
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:56 +01:00
Flavio Santes
afab2530c9 iot/dns: Fix IPv6 compilation issue
Update network context variable to 'net_ctx' and 'type' to 'query_type'

Change-Id: I956b8b5c79af7300ea9edc04c6ffd2a2b654d1ba
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:56 +01:00
Flavio Santes
66a323faf2 iot/dns: Add support for the FRDM K64F board
This patch adds the project file for the FRDM K64F board, it also
updates the README_IPv4 file to include instructions for using the
DNS resolver with the FRDM board.

Change-Id: Ic9b92c2fed2636b56044309dc3be7c829d828d35
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:56 +01:00
Flavio Santes
56ba584ef1 iot/dns: Update Makefile
Remove legacy KERNEL_TYPE conf variable.

Change-Id: Ibc064d1e222dd9e085f6782f1a3f8e61661b0691
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:56 +01:00
Tomasz Bursztyka
d3f587e326 samples: net: mbedtls: Let's enable fastest enc28j60 speed on a101
enc28j60 can work up to 25Mhz, let's set a divider of 2 on the 32Mhz
host clock then. This require to mimic CS with a gpio in the SPI driver.

Change-Id: I98f84fa793a614cdbb566be39a262ff825101255
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:56 +01:00
Tomasz Bursztyka
90dc300f1e samples: net: Add dedicated dhcpv4 prj.conf for frdm k64f board
This will help testing dhcpv4 through frdm k64f ethernet port.

Change-Id: I7cf47d77b79041fe7ab408355d1a9f9332fc1f54
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:55 +01:00
Tomasz Bursztyka
cc946bf328 samples: net: Add Arduino 101 dedicated config for dhcpv4_client
This helps to test enc28j60 along with dhcpv4

Change-Id: I884f0aba0a04c3cc0d015d327cb9c100759d45ea
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:55 +01:00
Tomasz Bursztyka
a2bb2119de samples: net: Remove useless prj.mdef from dhcpv4_client
Change-Id: I2d4b5a78b0a38828318634b48bb8e7c59cf62390
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:55 +01:00
Tomasz Bursztyka
4687648a26 drivers: eth_ksdk: Simplifying MAC address generation
The ethernet controller being a freescale one, let's use its OUI. Then
only 3 bytes are needed for generating the rest of the MAC address.

Also, generating the MAC address in the right order.

Change-Id: Id3346ef44f8c24edc2e23dee6ac0581ac58cf4ff
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:55 +01:00
Tomasz Bursztyka
943d55d116 drivers: eth_ksdk: There is a unique L2 driver
Removing useless defines for L2 layer driver.

Change-Id: I53ba6268d8716f293eada29a192fc63324f02523
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:55 +01:00
Tomasz Bursztyka
6480594f0a drivers: eth_ksdk: Theres is no longer 'ETHERNET' Kconfig option
Only NET_L2_ETHERNET now.

Change-Id: Ic9bb3c57e0f91c7eeb53cbbfddab085c723a4a5a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:55 +01:00
Tomasz Bursztyka
c1e52674d7 drivers: enc28j60: Removing useless legacy driver
Left over from old IP stack it seems.

Change-Id: Ic7ce731b8661294125fa0e0e058570aeff7b97cf
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:55 +01:00
Tomasz Bursztyka
b94042d93b drivers: enc28j60: Expose RX thread stack size and prio config
Such stack size might vary if debug is enabled or not and depending also
on other factors. Let's do the same for priority as well, putting it to
high prio as default (15 is way too low level).

Change-Id: I16afab33895085bacdef087fe70adeb1ae3ca2ab
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:55 +01:00
Tomasz Bursztyka
214970a3a5 drivers: enc28j60: Add logging
Adding relevant error, debug and informational messages.

Change-Id: I0457395a3ac10164f08b3bab0416b769762c6c5a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:55 +01:00
Tomasz Bursztyka
3e62dfbc22 drivers: ennc28j60: There is a unique L2 driver
Removing unrelevant defines for L2 layer driver.

Change-Id: Iae0f11291f4c19134228ccd976127e7f0f0b635f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:54 +01:00
Tomasz Bursztyka
c38f1e78eb drivers: enc28j60: Fix one tiny naming issue
ll_len means link layer length, but it's misleading here as ll_len is
the whole net buffer length: reserved ll length + payload length.

Change-Id: If7ec0fc950245d370fa0f82ae1050b05c11c7b90
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:54 +01:00
Tomasz Bursztyka
28255fa014 drivers: enc28j60: Fix a Kconfig comment
s/I2C/SPI obviously

Change-Id: Ia589869694137f5e5302869349a39d090a8fee1d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:54 +01:00
Tomasz Bursztyka
7d6c50d1d0 drivers: enc28j60: Fix a tiny style issue
Change-Id: I39e9caae812903823ed2cdd7ee6510d5bd633820
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:54 +01:00
Tomasz Bursztyka
d882e24002 drivers: ethernet: Enable sys log levels depending on NET_ETHERNET_L2
ETHERNET is a left-over from old and now unavailable IP stack.

Change-Id: I488d9ffcfb1fe3589b522dc2d620873daeb892c8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:54 +01:00
Tomasz Bursztyka
58c34af329 drivers: ethernet: Push DW specific Kconfig options to its own file
Note: This driver need to be ported to new native IP stack in order to
be available again.

Change-Id: I7825c8679e66f8a1d44d75c9d53e9da207b743af
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:54 +01:00
Tomasz Bursztyka
aa2c4ec452 drivers: enc28j60: Let's remove the CRC in the end of the frame
At this point, if the frame was accepted by the controller, it means
that CRC was valid. Thus, there is no reason to get it in the buffer.
Let's just pop it out from controller's memory.

Jira: ZEP-1361

Change-Id: Ic8681c77b0afa30583c7fae281db1a89ff97ed2b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:54 +01:00
Tomasz Bursztyka
cff19c17c4 net: l2: ethernet: Handle Ethernet II minimal frame size relevantly
Minimal frame size is 60 bytes, but IP frame might be smaller than this
size minus the ethernet header. In that case, Ethernet frames are padded
so it does reach this minimal size. In this case, ethernet L2 should
update the buffer list so it remove the padding length from the whole.

Change-Id: Id370cad09ad82bb54febeb60b05f7e430cc8f963
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:54 +01:00
Luiz Augusto von Dentz
cb8f775813 net: echo_client: Fix using CONFIG_NETWORKING_WITH_BT
Removes left over CONFIG_NETWORKING_WITH_BT which has been deprecated.

Change-Id: Ida3a2c2dba6e44f112711170f883c0582c3ee7ed
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-12-16 19:14:54 +01:00
Luiz Augusto von Dentz
73e76c2ce2 net: Remove unnecessary k_wakeup
net_buf_put already awakes the RX thread so k_wakeup is not necessary.

Change-Id: I18b5aef5d6e85a9461bc01c17f56c3d4d9a13824
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-12-16 19:14:53 +01:00
Andrei Emeltchenko
e27e1e73e1 samples: net: Fix compile error following frdm pinmux change
Fixes echo_client and echo_server samples.

Fixes compile error:
...
src/built-in.o: In function `fdrm_k64f_cc2520_pinmux_setup':
samples/net/echo_client/src/../../common/cc2520_frdm_k64f.c:93:
undefined reference to `_fsl_k64_set_pin'
samples/net/echo_client/src/../../common/cc2520_frdm_k64f.c:93:
undefined reference to `_fsl_k64_set_pin'
samples/net/echo_client/src/../../common/cc2520_frdm_k64f.c:93:
undefined reference to `_fsl_k64_set_pin'
...

Change-Id: I590f88f6bd083a30deea77fa860f001a3a55b278
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-16 19:14:53 +01:00
Flavio Santes
7d5c9de92b samples/net/README: Add DNS client section
This commit adds the DNS client section to the samples/net/README file.

Added text includes a quick description of the application and
references to documentation already available in the tree.

Change-Id: Ia7ef3aea19069df5be2d8f14344b1afa750b22bd
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:53 +01:00
Flavio Santes
a73a5bc41e tests/tcp: Initialize buffer to NULL
This commit initializes some net_buf variables to NULL to solve the
issue reported by Coverity: "Memory illegal accesses (UNINIT)".

Coverity-CID: 157610
Coverity-CID: 157611
Coverity-CID: 157612
Coverity-CID: 157617
Coverity-CID: 157619
Coverity-CID: 157620
Coverity-CID: 157622
Coverity-CID: 157624
Coverity-CID: 157626
Coverity-CID: 157627
Coverity-CID: 157628

Change-Id: I98a1ea5db4c169f69e3fa3d5de4c0ed7fdf1820a
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:53 +01:00
Flavio Santes
fc24fc293a samples/mbedtls_dtlsclient: Add ARG_UNUSED
This commit adds the ARG_UNUSED macro for the status variable in
the udp_received callback.

Change-Id: I8c592cab72ccf5ba314742ef705e96d4a4d067e9
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:53 +01:00
Flavio Santes
3b64d87cac samples/mbedtls_dtlsclient: Validate destination buffer size
This commit validates the size of the buffer used to store the
incomming datagram in the udp_rx routine.

Furthermore, two expressions related to the rx net_buf are now
executed before returning on error, avoiding a possible memory leak.

Change-Id: I30dc0a2d57dc207590387f1a9ab79945a1157ef5
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:53 +01:00
Sergio Rodriguez
a6dd26a99e samples/mbedtls_dtlsclient: Using semaphore for rx
The DTLS client will use and asynchronous signaling method to
receive, this makes the sample work on QEMU

Jira: ZEP-1233

Change-Id: I28f074c4736f84c10e6be8119a5ba50b138fcc0d
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-16 19:14:53 +01:00
Flavio Santes
c7afecf179 iot/dns: Update sample application
Previously, the domain names used in this application were
not very useful to proof that the DNS client was able to handle
multiple IP addresses.

In this patch, the number of domain names is increased. Some of them
may return multiple IP addresses as shown in the README_IPv4 file.
However, results may vary depending on the network setup.

Change-Id: Ic713ce48b4afa592c1480311f4394de6e57bf3fb
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:53 +01:00
Flavio Santes
44b2f212a1 iot/dns: Use a k_sem for the DNS rx routine
This patch introduces a k_sem that will block until:
- data is received, or
- the user-provided timeout expires

This change allows us to simplify our previous DNS client
implementation.

This change is related to ZEP-1357 because we are refactoring the
DNS client API removing the continuous update of the net_context_recv
routine that seems to be causing issues after the kernel's update.

Jira: ZEP-1357

Change-Id: If01c9274ac8f096f0095a2872f86be2e007212ee
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:53 +01:00
Flavio Santes
5d0900ea93 iot/dns: Update DNS client private routines
This commit updates some DNS client private routines to simplify
function signatures and reduce stack usage. Updated routines now
use the dns_context structure.

Change-Id: Ic0d347ea9d610e85eed4179aee08955cf2302436
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:52 +01:00