Commit Graph

12305 Commits

Author SHA1 Message Date
jing wang 4e5fa0ede2 tests: add systhreads test case
this commit check the priority of 2 system threads - main and idle

Change-Id: Ie57e7fdab3d15c0b69d85ed6282bfa6aa04133b4
Signed-off-by: jing wang <jing.j.wang@intel.com>
2017-02-08 13:22:49 +00:00
David B. Kinder 4031da8c92 doc: add permalinks to document headings
Permalinks make it much easier to create html links to specific sections
in a document (you over over the section heading and an icon appears that
you can click on to get a reference link directly to that section).

Change-Id: I905449158f834783b9df6c04bf5fa3e5f245b3fd
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-02-08 13:16:40 +00:00
Daniel Thompson f9733e492d misc: Let the compiler choose whether to omit frame pointer
Currently CONFIG_OMIT_FRAME_POINTER is a boolean and defaults to N,
which increases code size. This is intended to improve debugability
but on many architectures the use of this option does not actually
compromise debugging. Further the compiler already knows whether or not
omitting the frame pointer is harmful to debugging and its defaults
are selected accordingly.

By making this choice optional we can have a sane default on *all*
architectures by letting the compiler decide for us.

This patch significantly improves the default code generation on
arm (thumb), nios2 and arc. The benefit looks to be about between 5%
and 10% code size reduction depending upon architecture). x86 is
unaffected.

Change-Id: I5790634a40e2462cc1089dce4087040833793ae7
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
2017-02-08 13:14:16 +00:00
Jukka Rissanen a7e8bd6845 checkpatch: Remove reference to legacy IP stack
Old uIP based legacy IP stack is no longer there so it can
be removed from checkpatch conf file.

Change-Id: I2a17391f9cc8c0f8f8b81d520be1db8e2e8608f7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-08 13:05:27 +00:00
Ramesh Thomas 444ecafeee kernel: Remove redundant TICKLESS_IDLE_SUPPORTED option
This flag is no longer necessary and TICKLESS_IDLE will be
enabled by default if SYS_POWER_MANAGEMENT is enabled.

Jira: ZEP-1325
Change-Id: Ic6cd4b8dc0a17c6a413cabf6509b215a4558318d
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2017-02-08 13:02:34 +00:00
Anas Nashif 1fdfc5dc2b doc: rename doxygen configuration file and build from doc/
Rename file to zephyr.doxyfile to allow integration in eclipse and make
it build locally in the doc/ directory without have to change to ../
first.

Change-Id: Ib2c4c26f385b050ea3d0e814ebfc3509f31e5e12
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-08 12:04:35 +00:00
Anas Nashif 31f01f8ed6 Merge "Merge net branch into master" 2017-02-08 12:03:09 +00:00
Jesus Sanchez-Palencia a19d4ad041 quark_d2000: Add shared GDT memory to linker
A new shared memory area has been added to the QMSI bootloader in
order to store the GDT in RAM reliably.

Add the new entry to the QUARK D2000 linker script and new
kconfig options:

 * CONFIG_BSP_SHARED_GDT_RAM_ADDR to set the address location
   of the GDT in RAM.

 * CONFIG_BSP_SHARED_GDT_RAM_SIZE to set the size used by the
   GDT in RAM.

This is only enabled when  CONFIG_SET_GDT is NOT set.

Change-Id: Ie084079475853dce153dd9f3e88ad4a9784bdedf
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
2017-02-08 11:59:15 +00:00
Jesus Sanchez-Palencia bcee91d70e quark_se: Add shared GDT in RAM memory to linker
A new shared memory has been added to the QMSI bootloader in order to
store the GDT in RAM reliably.

Add this new entry to the QUARK SE C1000 linker script and new kconfig
options:

 * CONFIG_BSP_SHARED_GDT_RAM_ADDR to set the address location
   of the GDT in RAM.

 * CONFIG_BSP_SHARED_GDT_RAM_SIZE to set the size used by the
   GDT in RAM.

Additionally, both BSP_SHARED_RAM_ADDR and BSP_SHARED_RAM_SIZE have been
renamed to BSP_SHARED_RESTORE_INFO_RAM_ADDR and
BSP_SHARED_RESTORE_INFO_SIZE respectively, in order to better resemble
what these options are for. All these configs are available
unconditionally.

Change-Id: I07ee8b440d4a3f5e9bdeb62441ff6a7bd6d4c153
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: Bartlomiej Majka <bartlomiejx.majka@intel.com>
2017-02-08 11:59:14 +00:00
Jesus Sanchez-Palencia 78224e1a75 quark_se: Fix restore info address
For the next QMSI release, the shared restore info address has been
modified to 0xA8013FDC .

Change-Id: I72eaef4f15f7ef6fb8e7eb9acd7d96451623e103
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
2017-02-08 11:59:13 +00:00
Kuo-Lang Tseng 23b0074012 ext qmsi: Update to QMSI 1.4 RC2
Update the builtin QMSI code to 1.4 (RC2).
The below shim drivers were updated for API or interface changes:
- aio
- counter
- i2c_ss
- rtc
- wdt.

Also, arch soc specific power management code were updated.

Jira: ZEP-1572

Change-Id: Ibc8fae032a39ffb2c2c997f697835bc0208fd308
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-08 11:59:12 +00:00
Johan Hedberg 79883c9834 Merge bluetooth branch into master
- Use k_poll to consolidate all TX threads into a single one
 - Reuse HCI command buffers for storing their response
 - Improvements to SDP client support
 - New "volatile subscription" flag to GATT API
 - Various smaller fixes & cleanups here and there

----------------------------------------------------------------
Arkadiusz Lichwa (8):
      Bluetooth: SDP: Get ProtocolDescriptorList attribute internals
      Bluetooth: shell: Add SDP client support
      Bluetooth: uuid: Fix assigned UDP uuid value
      Bluetooth: SDP: Add API to get ProfileDescriptorList attribute
      Bluetooth: shell: Add getting ProfileDescriptorList attribute
      Bluetooth: SDP: Add API to get SupportedFeature attribute
      Bluetooth: shell: Use SupportedFeature attribute API
      Bluetooth: shell: Add support to retrieve A2SRC record

Arun Jagadish (2):
      Bluetooth: AVDTP: Remove buffer pool
      Bluetooth: AVDTP: Add AVDTP Discover Function Definition

Carles Cufi (1):
      Bluetooth: hci_core: Use nRF5x FICR address

Jaganath Kanakkassery (2):
      Bluetooth: RFCOMM: Fix session timer during acl disc
      Bluetooth: RFCOMM: Use common tx pool for control packets

Johan Hedberg (15):
      Bluetooth: Fix trivial coding style issue
      Bluetooth: Fix checking for invalid public address
      Bluetooth: Fix using correct variable type for interrupt mask
      Bluetooth: Fix buffer leak when HCI driver send() fails
      Bluetooth: drivers/h4: Add support for discarding certain events
      Bluetooth: Add convenience macros for common header sizes
      Bluetooth: Kconfig: Merge headroom reserve variables into a single one
      Bluetooth: Controller: Redesign response buffer allocation for commands
      Bluetooth: Reuse HCI command buffers for the command response
      Bluetooth: conn: Use delayed work for LE connection timeout
      Bluetooth: Merge bt_conn TX threads into a single one with k_poll
      Bluetooth: Merge HCI command and connection TX threads
      Bluetooth: samples: Add missing README.rst files
      Bluetooth: Controller: Use LL_ASSERT instead of BT_ASSERT
      Bluetooth: Fix incorrect checks for command buffer user data

Jonathan Gelie (3):
      Bluetooth: GATT: introduce volatile subscription flag
      Bluetooth: GATT: set subscribe value to zero for unsubscription
      Bluetooth: GATT: fixing unsubscription

Luiz Augusto von Dentz (1):
      Bluetooth: GATT: Fix not removing subscriptions safely

Sathish Narasimman (5):
      Bluetooth: HFP HF: Service level connection completed
      Bluetooth: HFP HF: Enable extended AG Error Result Code
      Bluetooth: HFP HF: Indicate disconnect to application
      Bluetooth: HFP HF: Disconnect rfcomm on SLC error
      Bluetooth: HFP HF: Remove unused variable 'buf'

Szymon Janc (5):
      Bluetooth: Use assert when getting net buf with K_FOREVER
      Bluetooth: Remove some dead code
      Bluetooth: L2CAP: Remove dead code
      Bluetooth: SDP: Make bt_sdp_create_pdu static
      Bluetooth: L2CAP: Make l2cap_br_send_conn_rsp return void

 drivers/bluetooth/hci/Kconfig                   |  13 +-
 drivers/bluetooth/hci/h4.c                      |  93 +++-
 drivers/bluetooth/hci/h5.c                      |  47 +-
 drivers/bluetooth/hci/spi.c                     |  13 +-
 drivers/bluetooth/nble/gatt.c                   |  76 +--
 include/bluetooth/buf.h                         |  13 +-
 include/bluetooth/gatt.h                        |  18 +-
 include/bluetooth/hci.h                         |   9 +-
 include/bluetooth/l2cap.h                       |  20 +-
 include/bluetooth/sdp.h                         |  51 ++-
 include/bluetooth/uuid.h                        |   2 +-
 samples/bluetooth/handsfree/README.rst          |  23 +
 samples/bluetooth/hci_uart/src/main.c           |  11 +-
 samples/bluetooth/hci_usb/src/main.c            |  11 +-
 samples/bluetooth/peripheral_sc_only/README.rst |  26 ++
 subsys/bluetooth/controller/hci/hci.c           | 153 ++++---
 subsys/bluetooth/controller/hci/hci_driver.c    |  23 +-
 subsys/bluetooth/controller/hci/hci_internal.h  |   2 +-
 subsys/bluetooth/controller/ll/ctrl.c           |   2 +-
 subsys/bluetooth/host/Kconfig                   |  10 +-
 subsys/bluetooth/host/at.c                      |   2 +-
 subsys/bluetooth/host/at.h                      |   3 +-
 subsys/bluetooth/host/avdtp.c                   |  81 +++-
 subsys/bluetooth/host/avdtp_internal.h          |   7 -
 subsys/bluetooth/host/conn.c                    | 178 ++++----
 subsys/bluetooth/host/conn_internal.h           |  15 +-
 subsys/bluetooth/host/gatt.c                    | 142 +++---
 subsys/bluetooth/host/hci_core.c                | 285 ++++++++----
 subsys/bluetooth/host/hci_core.h                |   6 +
 subsys/bluetooth/host/hci_ecc.c                 |   6 +-
 subsys/bluetooth/host/hci_raw.c                 |  12 +
 subsys/bluetooth/host/hfp_hf.c                  |  50 +-
 subsys/bluetooth/host/l2cap.c                   |  35 --
 subsys/bluetooth/host/l2cap_br.c                |  49 +-
 subsys/bluetooth/host/l2cap_internal.h          |   7 +-
 subsys/bluetooth/host/rfcomm.c                  |  31 +-
 subsys/bluetooth/host/rfcomm_internal.h         |   5 +-
 subsys/bluetooth/host/sdp.c                     | 584 +++++++++++++++++++++++-
 tests/bluetooth/shell/src/main.c                | 172 +++++++
 39 files changed, 1700 insertions(+), 586 deletions(-)
 create mode 100644 samples/bluetooth/handsfree/README.rst
 create mode 100644 samples/bluetooth/peripheral_sc_only/README.rst

Change-Id: I7589dbad8b97477c72d1b856121593bcf6d11339
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-02-08 13:03:20 +02:00
Arun Jagadish 93e28c75fe Bluetooth: AVDTP: Add AVDTP Discover Function Definition
Implementation of Send AVDTP_DISCOVER functionality

< ACL Data TX: Handle 256 flags 0x00 dlen 6
      Channel: 64 len 2 [PSM 25 mode 0] {chan 0}
      AVDTP: Discover (0x01) Command (0x00) type 0x00 label 0 nosp 0

Change-Id: Ieb6d1e5379d8933d57f3b1399f091378ce3c0756
Signed-off-by: Arun Jagadish <arun.jagadish@intel.com>
2017-02-08 11:02:09 +00:00
Jonathan Gelie 048a15bcc8 Bluetooth: GATT: fixing unsubscription
If subcription was found within the subscription list,
we have check if remains identical subscription
from the next node.
Otherwise none unsubscription is realized.

Change-Id: I38132d7c80575801885b8057902f3d4666b08aea
Signed-off-by: Jonathan Gelie <jonathanx.gelie@intel.com>
2017-02-08 11:00:06 +00:00
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