Commit graph

18591 commits

Author SHA1 Message Date
Johan Hedberg
ce2d74a58a Bluetooth: Fix incorrect checks for command buffer user data
If the buffer given to hci_cmd_done() is not from the command buffer
then using the cmd(buf) macro is not valid. Simply bail out from
hci_cmd_done() if this is an event that didn't have a matching command
buffer.

Change-Id: Id8357a23a307f4ef3a9214a4e1f7d853a18cb907
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-02-08 11:59:50 +02:00
Jukka Rissanen
7498e22f6e Merge net branch into master
Main changes:

- Documentation enhancements and fixes
- HTTP client sample application
- TCP fixes
- net_buf access fixes in IP stack
- IEEE 802.15.4 fragmentation fixes

----------------------------------------------------------------
Anas Nashif (1):
      net: nbuf: Fix style of doxygen comment

Flavio Santes (1):
      samples/net/http: Add the HTTP client sample application

Johann Fischer (1):
      drivers: mcr20a: control access to SPI with semaphore

Juan Manuel Cruz (2):
      drivers: enc28j60: Enables reception of multicast packets
      mbedtls: add arduino 101 configuration to ssl client sample

Jukka Rissanen (10):
      samples: net: Fix invalid memory access for TCP
      drivers/eth/mcux: Free net_buf using net_nbuf_unref
      net: ipv6: Fix pending buf leak when NA is received
      net: ipv6: Free received NA net_buf
      net: todo: Add CAN support entry
      net: nbuf: Add timeout to net_buf getters
      net: nbuf: Add helper to print fragment chain
      net: nbuf: Remove dead code in net_nbuf_compact()
      net: nbuf: Fix double free in net_nbuf_compact()
      net: arp: Fix the ethernet header location

Michael Scott (6):
      net: context: keep randomly assigned port for TCP bind() calls
      net: ip: change some error messages to NET_ERR
      net: context: fix net context / net conn leak
      samples: net: irc_bot: fix build break
      samples: net: irc_bot: fix size_t related build warnings
      samples: net: irc_bot: add testcase.ini

Ravi kumar Veeramally (4):
      net: fragment: Fix the 802.15.4 fragmentation
      net: tests: 15.4: Increase max data size and fix config option
      net: nbuf: Remove unused net_nbuf_push() API
      net: nbuf: Fix net_nbuf_compact() API

Tomasz Bursztyka (1):
      doc/net: Add L2 and device driver document

Wojciech Bober (2):
      drivers/ieee802154: Split drivers Kconfig
      drivers/net/ieee802154: Change configuration prefix

 boards/arm/frdm_k64f/pinmux.c                      |   2 +-
 .../x86/quark_se_c1000_devboard/Kconfig.defconfig  |  18 +-
 boards/x86/quark_se_c1000_devboard/board.c         |  14 +-
 boards/x86/quark_se_c1000_devboard/board.h         |  10 +-
 .../networking/connectivity-example-app.c          |   4 +-
 doc/subsystems/networking/l2-and-drivers.rst       | 154 +++++++++++
 doc/subsystems/networking/networking.rst           |   2 +-
 drivers/console/telnet_console.c                   |   6 +-
 drivers/ethernet/eth_enc28j60.c                    |   4 +-
 drivers/ethernet/eth_enc28j60_priv.h               |   3 +-
 drivers/ethernet/eth_mcux.c                        |  10 +-
 drivers/ethernet/eth_sam_gmac.c                    |   6 +-
 drivers/ieee802154/Kconfig                         | 190 +-------------
 drivers/ieee802154/Kconfig.cc2520                  |  67 +++++
 drivers/ieee802154/Kconfig.mcr20a                  | 120 +++++++++
 drivers/ieee802154/Makefile                        |  10 +-
 drivers/ieee802154/ieee802154_cc2520.c             |  37 +--
 drivers/ieee802154/ieee802154_cc2520.h             |   2 +-
 drivers/ieee802154/ieee802154_mcr20a.c             |  88 +++++--
 drivers/ieee802154/ieee802154_mcr20a.h             |   3 +-
 drivers/ieee802154/ieee802154_uart_pipe.c          |   6 +-
 drivers/slip/slip.c                                |   6 +-
 ext/hal/nxp/mcux/Makefile                          |   2 +-
 include/net/nbuf.h                                 | 200 +++++++++------
 samples/bluetooth/ipsp/src/main.c                  |   2 +-
 samples/net/coaps_client/src/udp.c                 |   4 +-
 samples/net/coaps_server/src/udp.c                 |   4 +-
 .../net/echo_client/prj_arduino_101_cc2520.conf    |  10 +-
 samples/net/echo_client/prj_cc2520.conf            |   4 +-
 samples/net/echo_client/prj_frdm_k64f_cc2520.conf  |  10 +-
 samples/net/echo_client/prj_frdm_k64f_mcr20a.conf  |   2 +-
 samples/net/echo_client/prj_qemu_802154.conf       |   2 +-
 samples/net/echo_client/src/Makefile               |   2 +-
 samples/net/echo_client/src/echo-client.c          |   5 +-
 .../net/echo_server/prj_arduino_101_cc2520.conf    |  10 +-
 samples/net/echo_server/prj_cc2520.conf            |   4 +-
 samples/net/echo_server/prj_frdm_k64f_cc2520.conf  |  10 +-
 samples/net/echo_server/prj_frdm_k64f_mcr20a.conf  |   2 +-
 samples/net/echo_server/prj_qemu_802154.conf       |   2 +-
 samples/net/echo_server/src/Makefile               |   2 +-
 samples/net/echo_server/src/echo-server.c          |   8 +-
 samples/net/http_client/Makefile                   |  10 +
 samples/net/http_client/README.rst                 | 229 +++++++++++++++++
 samples/net/http_client/prj_frdm_k64f.conf         |  34 +++
 samples/net/http_client/src/Makefile               |  11 +
 samples/net/http_client/src/config.h               |  74 ++++++
 samples/net/http_client/src/http_client.c          | 158 ++++++++++++
 samples/net/http_client/src/http_client.h          |  38 +++
 samples/net/http_client/src/http_client_cb.c       | 133 ++++++++++
 samples/net/http_client/src/http_client_cb.h       |  38 +++
 samples/net/http_client/src/http_client_rcv.c      | 101 ++++++++
 samples/net/http_client/src/http_client_rcv.h      |  15 ++
 samples/net/http_client/src/http_client_types.h    |  28 ++
 samples/net/http_client/src/main.c                 | 128 +++++++++
 samples/net/http_client/src/tcp_client.c           | 162 ++++++++++++
 samples/net/http_client/src/tcp_client.h           |  31 +++
 samples/net/http_client/testcase.ini               |   4 +
 samples/net/http_server/src/http_write_utils.c     |  10 +-
 samples/net/ieee802154/hw/prj.conf                 |   4 +-
 samples/net/ieee802154/hw/prj_mcr20a.conf          |   2 +-
 samples/net/ieee802154/hw/src/ieee802154_test.c    |   8 +-
 samples/net/ieee802154/qemu/prj.conf               |   2 +-
 .../net/ieee802154/qemu/src/ieee802154_qemu_test.c |   2 +-
 samples/net/irc_bot/src/irc-bot.c                  |   6 +-
 samples/net/irc_bot/testcase.ini                   |   4 +
 samples/net/leds_demo/prj_802154.conf              |   2 +-
 samples/net/leds_demo/src/leds-demo.c              |  16 +-
 samples/net/mbedtls_dtlsclient/src/udp.c           |   4 +-
 samples/net/mbedtls_dtlsserver/src/udp.c           |   4 +-
 samples/net/mbedtls_sslclient/Makefile             |   4 +-
 samples/net/mbedtls_sslclient/prj_arduino_101.conf |  34 +++
 samples/net/mbedtls_sslclient/src/tcp.c            |   4 +-
 samples/net/wpan_serial/prj.conf                   |   2 +-
 samples/net/wpan_serial/src/Makefile               |   2 +-
 samples/net/wpan_serial/src/main.c                 |  10 +-
 samples/net/wpanusb/prj.conf                       |   4 +-
 samples/net/wpanusb/src/Makefile                   |   8 +-
 samples/net/wpanusb/src/wpanusb.c                  |  15 +-
 samples/net/zoap_client/src/zoap-client.c          |   4 +-
 samples/net/zoap_server/prj_cc2520.conf            |   2 +-
 samples/net/zoap_server/src/zoap-server.c          |  40 +--
 samples/net/zperf/prj_quark_se_c1000_devboard.conf |   2 +-
 samples/net/zperf/src/zperf_tcp_uploader.c         |  11 +-
 samples/net/zperf/src/zperf_udp_receiver.c         |   4 +-
 samples/net/zperf/src/zperf_udp_uploader.c         |  18 +-
 subsys/net/TODO                                    |  16 ++
 subsys/net/ip/6lo.c                                |  21 +-
 subsys/net/ip/connection.c                         |   6 +-
 subsys/net/ip/dhcpv4.c                             |  38 ++-
 subsys/net/ip/icmpv4.c                             |   8 +-
 subsys/net/ip/icmpv6.c                             |  10 +-
 subsys/net/ip/ipv4.c                               |   2 +-
 subsys/net/ip/ipv6.c                               |  24 +-
 subsys/net/ip/l2/arp.c                             |  19 +-
 subsys/net/ip/l2/bluetooth.c                       |   4 +-
 subsys/net/ip/l2/ieee802154/ieee802154.c           |   4 +-
 subsys/net/ip/l2/ieee802154/ieee802154_fragment.c  | 137 ++++++----
 subsys/net/ip/l2/ieee802154/ieee802154_frame.c     |   4 +-
 subsys/net/ip/nbuf.c                               | 199 +++++++-------
 subsys/net/ip/net_context.c                        |  38 ++-
 subsys/net/ip/net_private.h                        |  29 +++
 subsys/net/ip/rpl.c                                |  21 +-
 subsys/net/ip/tcp.c                                |   6 +-
 subsys/net/lib/dns/dns_client.c                    |   4 +-
 subsys/net/lib/mqtt/mqtt.c                         |  20 +-
 subsys/net/lib/zoap/zoap_link_format.c             |   4 +-
 tests/net/6lo/src/main.c                           |   6 +-
 tests/net/arp/src/main.c                           |  24 +-
 tests/net/context/src/main.c                       |  24 +-
 tests/net/dhcpv4/src/main.c                        |   7 +-
 tests/net/ieee802154/fragment/prj.conf             |   2 +-
 tests/net/ieee802154/fragment/src/main.c           |  14 +-
 tests/net/ieee802154/l2/src/ieee802154_test.c      |   6 +-
 tests/net/iface/src/main.c                         |   4 +-
 tests/net/ipv6/src/main.c                          |  20 +-
 tests/net/nbuf/src/main.c                          | 285 +++++----------------
 tests/net/route/src/main.c                         |   4 +-
 tests/net/rpl/src/main.c                           |   4 +-
 tests/net/tcp/src/main.c                           |   8 +-
 tests/net/udp/src/main.c                           |   8 +-
 tests/net/utils/src/main.c                         |  34 +--
 121 files changed, 2503 insertions(+), 1030 deletions(-)
 create mode 100644 doc/subsystems/networking/l2-and-drivers.rst
 create mode 100644 drivers/ieee802154/Kconfig.cc2520
 create mode 100644 drivers/ieee802154/Kconfig.mcr20a
 create mode 100644 samples/net/http_client/Makefile
 create mode 100644 samples/net/http_client/README.rst
 create mode 100644 samples/net/http_client/prj_frdm_k64f.conf
 create mode 100644 samples/net/http_client/src/Makefile
 create mode 100644 samples/net/http_client/src/config.h
 create mode 100644 samples/net/http_client/src/http_client.c
 create mode 100644 samples/net/http_client/src/http_client.h
 create mode 100644 samples/net/http_client/src/http_client_cb.c
 create mode 100644 samples/net/http_client/src/http_client_cb.h
 create mode 100644 samples/net/http_client/src/http_client_rcv.c
 create mode 100644 samples/net/http_client/src/http_client_rcv.h
 create mode 100644 samples/net/http_client/src/http_client_types.h
 create mode 100644 samples/net/http_client/src/main.c
 create mode 100644 samples/net/http_client/src/tcp_client.c
 create mode 100644 samples/net/http_client/src/tcp_client.h
 create mode 100644 samples/net/http_client/testcase.ini
 create mode 100644 samples/net/irc_bot/testcase.ini
 create mode 100644 samples/net/mbedtls_sslclient/prj_arduino_101.conf

Change-Id: I2d92e41991f322c6d440f0545feee8f4d9a60edc
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-08 10:18:45 +02:00
Tomasz Bursztyka
85103e15de doc/net: Add L2 and device driver document
This one will quickly describe how the L2 concept fits into the network
stack, what is its role and how device drivers are then made.

Jira: ZEP-824

Change-Id: Ib5d49a5194fe4f67ad1196266ad09f40d732d5ee
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-02-08 10:12:36 +02:00
Juan Manuel Cruz
5225daad94 mbedtls: add arduino 101 configuration to ssl client sample
Jira: ZEP-748

Change-Id: Ied8c521f80b8f1d4b22497a059ee5c948449613f
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2017-02-08 10:12:36 +02:00
Michael Scott
76551f469e samples: net: irc_bot: add testcase.ini
Change-Id: I61b6373572254cbb63a8170eb2dfd8381a0973a2
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-08 10:12:36 +02:00
Michael Scott
92042b25c2 samples: net: irc_bot: fix size_t related build warnings
size_t has different types depending on the arch selected for
building.  Correct format identifier is %zu in this case.

Change-Id: I4388fcd8c5eb8bcd5997bb921bd80b4c2175b24c
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-08 10:12:36 +02:00
Michael Scott
6a3b3f0e46 samples: net: irc_bot: fix build break
Fix build break introduced in commit 6b013c4721c5
("net: nbuf: Add timeout to net_buf getters")

Change-Id: Iaa521c6a49ae740eaee5276936442ab8aa4c47ba
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-08 10:12:36 +02:00
Michael Scott
a2e9dd1361 net: context: fix net context / net conn leak
If a net context is not connected or listening, we can go ahead and
call net_context_unref() to free it up instead of waiting for
FIN_ACK which will never happen.

Change-Id: Ice06f572df64f2edb5918c10c92087ce0b7b254a
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-08 10:12:36 +02:00
Michael Scott
7acb7aceb3 net: ip: change some error messages to NET_ERR
Several error messages are currently being logged as NET_DBG which
requires the user to have CONFIG_SYS_LOG_NET_LEVEL=4.

Let's show these as errors so they are more visible.

Change-Id: I28c9a1aedb78787ef098a9bf565472a437373933
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-08 10:12:36 +02:00
Ravi kumar Veeramally
58ba1d834e net: nbuf: Fix net_nbuf_compact() API
Current API description of net_nbuf_compact() is not very clear.
The first parameter needs to be the first net_buf in the chain.

The changes to this API are needed in order to clarify following
use cases:
1) User provides fragment that is not first of the chain and compact is
successfully done. In this case there is no free space in fragment list
after the input fragment. But there might be empty space in previous
fragments. So fragment chain is not completely compacted.

2) What if input fragment has been deleted and api returns the same
buf?

So this commit simplifies the API behavior. Now net_nbuf_compact()
expects the first parameter to be either TX or RX net_buf and then it
compacts it. It fails only if the input fragment is a data fragment.

Change-Id: I9e02dfcb6f3f2e2998826522a25ec207850a8056
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-08 10:12:36 +02:00
Ravi kumar Veeramally
999338ea94 net: nbuf: Remove unused net_nbuf_push() API
The net_nbuf_push() API is not used by anyone. Semantics are not
clear and following patch requires changes to push api, so removing
this API for now. If needed this can be re-introduced later.

Change-Id: I1d669c861590aa9bc80cc1ccb08144bd6020dac5
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-08 10:12:36 +02:00
Jukka Rissanen
32415396d8 net: arp: Fix the ethernet header location
The ethernet header location was incorrectly calculated
and the result pointer had some random value.

Change-Id: I6b2deee787a78444f3ee3be805d4b82ebb6c3664
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-08 10:12:36 +02:00
Ravi kumar Veeramally
70f7922cee net: tests: 15.4: Increase max data size and fix config option
Test with max data in order to test the fragmentation code better.

Change-Id: I301a96eae1dd637f0291354120389c2bd7575695
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-08 10:12:35 +02:00
Ravi kumar Veeramally
d7e0531149 net: fragment: Fix the 802.15.4 fragmentation
Currently fragmentation introduces empty fragment in the
beginning of the list, and adds fragmentation header, and moves frags
data to previous fragments. This is done based on condition that max
data should be multiples of 8 bytes and offset is based on before
compression.

It will fail at scenario when current fragment has not enough space
to move from next fragment and next fragment has more than allowable
max bytes. This will cause memory overflow which is typically seen
as double-free error to the user.

This is solved more simple way by this commit. First detach frags list,
prepare new fragment and attach that to buffer. Then move data from
detached frag list and free the fragments in the old one.

Change-Id: I5e3693d47828ff3b92db4ba5f6c00c0b751daadc
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-08 10:12:35 +02:00
Jukka Rissanen
dace99611a net: nbuf: Fix double free in net_nbuf_compact()
If we are in the end of the fragment chain, then we can just
bail out as there is nothing more to do. There will be a
double free if we continue as the last entry is already
removed at this point.

Change-Id: I0f9782b408244d283dc7e3e087359dd00bada7a9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-08 10:12:35 +02:00
Jukka Rissanen
d15c836f6c net: nbuf: Remove dead code in net_nbuf_compact()
Change-Id: I8898ca20dd9d1764f52cd039baaa144faa7326f7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-08 10:12:35 +02:00
Jukka Rissanen
5294497dd5 net: nbuf: Add helper to print fragment chain
Change-Id: I33eb2cf88e1cdeb79034334331dd346fa31cec49
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-08 10:12:35 +02:00
Jukka Rissanen
bd3908b2a9 net: nbuf: Add timeout to net_buf getters
This commit changes the net_buf getter functions in nbuf.h
by adding a timeout parameter. These function prototypes
are changed to accept a timeout parameter.
	net_nbuf_get_rx()
	net_nbuf_get_tx()
	net_nbuf_get_data()
	net_nbuf_get_reserve_rx()
	net_nbuf_get_reserve_tx()
	net_nbuf_get_reserve_data()
	net_nbuf_copy()
	net_nbuf_copy_all()
	net_nbuf_push()
	net_nbuf_append()
	net_nbuf_write()
	net_nbuf_insert()

Following convinience functions have not been changed
	net_nbuf_append_u8
	net_nbuf_append_be16
	net_nbuf_append_be32
	net_nbuf_insert_u8
	net_nbuf_insert_be16
	net_nbuf_insert_be32
	net_nbuf_write_u8
	net_nbuf_write_be16
	net_nbuf_write_be32
so they call the base function using K_FOREVER. Use the
base function if you want to have a timeout when net_buf
is allocated.

Change-Id: I20bb602ffb73069e5a02668fce60575141586c0f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-08 10:12:35 +02:00
Jukka Rissanen
8c6e76fb37 net: todo: Add CAN support entry
Added a placeholder for CAN (Controller Area Network) support.

Change-Id: Ia6587df71a87f7439691768a04ba7ca07142e72f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-08 10:12:35 +02:00
Michael Scott
567cc4531f net: context: keep randomly assigned port for TCP bind() calls
Prior to commit df201a0e4b ("net: context: Assign a random port
number when context is created"), TCP clients were assigned a random
port number when the incoming sockaddr parameter's port value was 0.

After the above commit, this is now broken as it will bind to port 0.

If left this way, every TCP client would need to add a line of code
copying the context->local sockaddr_ptr's port value into the
src_sockaddr port prior to calling net_context_bin().

Instead, we can reinstate this behavior in net_context_bind(), by
making sure we only overwrite the randomly assigned port in the
context->local sockaddr if the incoming sockaddr parameter has a
port which is != 0.

Change-Id: I0f27f031f743d50c351ecf9ab55b5282a20ff292
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-08 10:12:35 +02:00
Wojciech Bober
573774a9bf drivers/net/ieee802154: Change configuration prefix
This commit changes Kconfig prefix for ieee802154 drivers to
IEEE802154_*. This is done for consistency with config prefixes
used in other subsystems.

Change-Id: Ibbb4d96d2b748f4f13135bde85304ec34c5a90a6
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
2017-02-08 10:12:35 +02:00
Jukka Rissanen
8db13f905b net: ipv6: Free received NA net_buf
If we receive a neighbor advertisement, we need to free its
net_buf because we are returning NET_OK to the caller. This
return code means that we consumed the net_buf but we did
not call net_nbuf_unref() in this case.

Change-Id: Ia6d8f1b440be87eff5d2b14a23336a37be6d6a04
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-08 10:12:35 +02:00
Jukka Rissanen
f25d4768b2 net: ipv6: Fix pending buf leak when NA is received
The pending buf needs to be freed after it has been sent
to the network. We took the ref when pending buf was saved,
now we need to unref it when it is about to be sent.

Change-Id: I1e429969895700000a8aa124bd645db2d52d036c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-08 10:12:34 +02:00
Jukka Rissanen
b4ca6e8300 drivers/eth/mcux: Free net_buf using net_nbuf_unref
The driver was using net_buf_unref(). This technically works
ok but debugging the network buffer allocations is more
difficult if done like this.

Change-Id: If3453a49337c7a359c8af22cfdf331fccc697af5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-08 10:12:34 +02:00
Jukka Rissanen
b9ac440d02 samples: net: Fix invalid memory access for TCP
Set protocol family value only after the buf is verified
to be non-null.

Change-Id: I0ce7bab3539087d0f522b4bb3024f46a7eb3c15f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-08 10:12:34 +02:00
Johann Fischer
baa4939b94 drivers: mcr20a: control access to SPI with semaphore
Change-Id: I5498452d11c435ca3e4d3889ef8e9b19b031782a
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-02-08 10:12:34 +02:00
Wojciech Bober
c84b765fdd drivers/ieee802154: Split drivers Kconfig
This commit splits 802.15.4 drivers configuration into separate files.

Change-Id: Ie1bed862e8f4248240fef18bc211d0ee8ca1493c
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
2017-02-08 10:12:34 +02:00
Flavio Santes
c2c32d24e3 samples/net/http: Add the HTTP client sample application
This patch adds a basic HTTP client sample application.
The following HTTP 1.1 methods are supported: GET, HEAD,
OPTIONS and POST.

This sample application does not define an API for HTTP,
for more information see ZEP-346.

Jira: ZEP-827

Change-Id: Iee63a53f2ef424964f040eba20326d648249fc24
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-08 10:12:34 +02:00
Juan Manuel Cruz
35011815f3 drivers: enc28j60: Enables reception of multicast packets
Jira: ZEP-1544

Change-Id: I96a7f9cd40612c1eaebac79845f4a3157a8f7457
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2017-02-08 10:12:34 +02:00
Anas Nashif
6fa71b8302 net: nbuf: Fix style of doxygen comment
Change-Id: I791a2b585cc008bd9101957f1ca0540be1220833
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-08 10:12:34 +02:00
Ramesh Thomas
632964e010 samples: power: Remove mention of specific versions in README
The README was referring to a specific version of the boot loader.
Since the boot loader version is expected to change in future
and Zephyr code would also correspond to that version, it is better
to not mention any specific version. Instead, the requirement
is to use the latest version of the boot loader.

Change-Id: I04082eec4af16426f6456702c521e8f61bd4e0df
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2017-02-08 06:28:25 +00:00
Flavio Santes
362a12200a net/dns: Fix inline documentation
Fix inline documentation for the dns client API.

Jira: ZEP-1669

Change-Id: I9e6ae4e1301f1e4a125b75add1a8bc7331a818b0
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-07 22:33:47 +00:00
Mazen NEIFER
e2bbad9600 kernel: init: use C implementation for STACK_CANARY_INIT
Due to a limitation on XCC, the inline assembly does not
produce the expected instructions. This results in a wrong
code sequence. On the other hand, plain C code works well.
The note about compilers seems to not be an issue on any of
our currently supported compilers.

Change-Id: I9d2ab0fbf8a48d9dad51da3fd54453f205516d74
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-07 22:18:21 +00:00
Andrew Boie
e67828ba20 tests: remove old ARM vector table test
This was ported to the new kernel, no need to keep the old one around.

Change-Id: I02d39c8e39843cee1862448296e9c1d0dfde75b9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-07 19:52:09 +00:00
Marcus Shawcroft
cf990c1e71 i2c: Elaborate API return values
Elaborate the i2c API documentation with each of the errno codes that
can be returned on failure.

Change-Id: I28a690c06b94f724053238b5eba3142fcace23f6
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-07 18:32:39 +00:00
Marcus Shawcroft
5e77af801a i2c: Name parameters consistently.
Change-Id: Ifcd6e69a42d11bf1269d82500601ff91960dd371
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-07 18:32:38 +00:00
Marcus Shawcroft
ec86145adf i2c/dw: Switch from EPERM to EIO
The DW i2c driver chooses to return -EPERM following a PCI error in
driver configuration.  This seems an odd choice.  All of the other I2C
drivers return -EIO for general failures detected during driver
configuration.

Switch the DW driver from EPERM to EIO.

Change-Id: Ia4f96386620319736ae4c09212b0a05ea38169b1
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-07 18:32:37 +00:00
Marcus Shawcroft
ccf16c705d i2c/stm32lx: Fix layout.
Change-Id: Ifc474ff703f96e5edd9dfd280533f4d8fe6a6853
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-07 18:32:36 +00:00
Marcus Shawcroft
32167dd644 i2c: Remove unused definition.
Remove stride[] definition from public API, this definition is not
used by any driver and appears to serve no purpose.

Change-Id: Ib7c9ad4a8e7e17884d150ee811b66db0279d0b33
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-07 18:32:36 +00:00
Marcus Shawcroft
ddb6b94bd7 i2c: Implement consistent i2c no msgs behaviour
The I2C drivers handle an empty list of I2C messages inconsistenty.
There are two different behaviours, one set of drivers dectects a
requests to transfer zero messages and return -EINVAL while the other
group simple transfer no data and return success.

Adopt the latter behaviour consistently across all drivers.  Update
the i2c.h API documentation to reflect this behaviour.

Change-Id: I427fc1b0e18ddc04b7b59c294e0240b3d6ca4073
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-07 18:32:35 +00:00
Johan Hedberg
5b80603dbd Bluetooth: Controller: Use LL_ASSERT instead of BT_ASSERT
The controller code should not use BT_ASSERT directly.

Change-Id: If0b7d8e21d2ab4569a564bd03e36e4eb9204c595
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-02-07 12:29:58 +00:00
Szymon Janc
afab7e1c01 Bluetooth: L2CAP: Make l2cap_br_send_conn_rsp return void
This function cannot fail.

Change-Id: I6b3393e0cfe1c334536e26c2715d5aff44c6dfd8
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2017-02-07 12:29:46 +00:00
Szymon Janc
7ee83b6c62 Bluetooth: SDP: Make bt_sdp_create_pdu static
It is not used outside of sdp.c and has no declaration.

Change-Id: I420a6b98d1b46fedffa29d042267b9c606d04c46
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2017-02-07 12:29:35 +00:00
Szymon Janc
22ada7b063 Bluetooth: L2CAP: Remove dead code
l2cap_create_le_sig_pdu always returns valid pointer.

Change-Id: I1510dc9ae387b426d7280f213e9d22b9a6a8418a
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2017-02-07 12:29:24 +00:00
Szymon Janc
69a52d82c9 Bluetooth: Remove some dead code
bt_l2cap_create_pdu always returns valid pointer.

Change-Id: Id525d19c096407150a7370396ed557290fbc35c5
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2017-02-07 12:29:13 +00:00
Szymon Janc
295e8e575c Bluetooth: Use assert when getting net buf with K_FOREVER
net_buf_alloc called with K_FOREVER should always return valid pointer.
Returning NULL indicated kernel bug.

Change-Id: I6c317de2d98723d0c1a0618e91490a2128f69f06
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2017-02-07 12:29:01 +00:00
Johan Hedberg
46ed7974b3 Bluetooth: samples: Add missing README.rst files
Add missing README.rst files to the last two samples.

Jira: ZEP-1540

Change-Id: I8dfa6489c6c65872594d4416870e2a41e701595d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-02-07 10:52:08 +02:00
Paul Sokolovsky
08e0ade38a doc: frdm_k64f: Document Eth PHY known issue
Working Ethernet, and actually even successfully booting with Ethernet
enabled (and Ethernet is enabled by default on enabling networking)
so far requires a network cable attached.

Change-Id: I9c17e417f867942ddf085db9e8342e945aa07370
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-02-06 22:53:30 +03:00
Sathish Narasimman
54eedffd58 Bluetooth: HFP HF: Remove unused variable 'buf'
'buf' variable of type struct net_buf was one of the arguments for
finish callback in response to each AT command sent. 'buf' variable
not used in that function. So removed 'buf' variables from the argument
list.

Change-Id: I7d6aa6082f524012ae13a04426915076130ddf69
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
2017-02-06 18:19:31 +00:00
Jonathan Gelie
a42e4f694f Bluetooth: GATT: set subscribe value to zero for unsubscription
Subscribe value is set to zero before calling notify callback,
to distinguish a subscription failure from an unsubscription
on disconnection (when flag BT_GATT_SUBSCRIBE_FLAG_VOLATILE is set).

Change-Id: Ia91220492d82041b2c385bf88a15180387e7a483
Signed-off-by: Jonathan Gelie <jonathanx.gelie@intel.com>
2017-02-06 17:44:01 +00:00