Commit graph

41120 commits

Author SHA1 Message Date
Jean-Paul Etienne
5d5265bca4 riscv32: timer: disable riscv_machine_timer driver by default for riscv32
Enabling the riscv_machine_timer driver by default for riscv32
causes compilation issues on riscv32 boards (like zedboard_pulpino)
not supporting it.

Boards supporting the driver enable it via their respective
config file.

Change-Id: Ieb0d25fa339834fd386ae2725f40b6b7b72dc52b
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-02-09 00:26:26 +01:00
Andrew Boie
d81e033044 build: Separate out prebuilt kernel logic from toplevel
Arch-specific stuff shouldn't be in the toplevel Makefile,
forthcoming patches will soon introduce special interrupt
handling logic for other arches.

Change-Id: Ib5a86cbdf5b32ecfce9e5e234f7cbea2bc3ce9c1
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-08 19:11:10 +00:00
Andrew Boie
d8027a29f3 toolchain: gcc.h: add indirection to _GENERIC_SECTION() macro
Change-Id: Ic30874cafb4a79213feb93666903816d297084f6
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-08 19:10:55 +00:00
Andrew Boie
3c6f572361 section_tags.h: cleanup
Some stuff that was platform-specific is made common, and some repeated
code was made a macro. __in_section() is used elsewhere in the codebase
and its 2nd and 3rd arguments are not necessarily filename/counter.

GCC-specific stuff moved to the toolchain header.

Change-Id: Ibfae919b6dd8a77210801c14e9a1128b43bd63f6
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-08 19:10:43 +00:00
Kuo-Lang Tseng
0e91e84122 drivers: QMSI PWM: simplify driver reentrancy code using IS_ENABLED macro
This is one the series patches that simplifies the driver code by
using the IS_ENABLED macro. This removes the need of the const
variable and the wrapper functions on semaphore APIs.

Jira: ZEP-1251

Change-Id: Ic2df5d04966d2a066478ca3e119f76d24fc4dfb3
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-08 19:08:31 +00:00
Kuo-Lang Tseng
8bf14d380b drivers: QMSI RTC: simplify driver reentrancy code using IS_ENABLED
This is one of the series of patches that simplifies the driver
code by using the IS_ENABLED macro. This removes the need of the
const variable and the wrapper functions on semaphore APIs.

Jira: ZEP-1251

Change-Id: I84a09a0aaa3a00452d8c2b4bca7be0f6b2015218
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-08 19:08:06 +00:00
Kuo-Lang Tseng
74f7da1bb4 drivers: QMSI SOC flash: simplify driver reentrancy code using IS_ENABLED
This is one the series patches that simplifies the driver code by
using the IS_ENABLED macro. This removes the need of the const
variable and the wrapper functions on semaphore APIs.

Jira: ZEP-1251

Change-Id: I59802cf9f482337656b0fdc4b272f3b1ddc6cbda
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-08 19:07:42 +00:00
Andrew Boie
164ba8c5cd sw_isr_table.h: clean up definition
This private data structure now no longer introduces a typedef or
uses CamelCase. It's not necessary to specify the size of extern
arrays, so we don't need a block of #ifdefs for every arch.

Change-Id: I71fe61822ecef29820280a43d5ac2822a61f7082
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-08 18:14:37 +00:00
Juan Solano
d490573933 quark_se_ss: Remove enter_arc_state and use QMSI functions
This commit removes the local implementation of enter_arc_state, where
the ARC is instructed to sleep, using instead the QMSI 1.4 functions.

Change-Id: Id489ad53851be50fc5e50add698891fcfaef3abe
Signed-off-by: Juan Solano <juanx.solano.menacho@intel.com>
2017-02-08 13:41:26 +00:00
Juan Solano
48b8dddd95 aonpt_qmsi: Call QMSI 1.4 context save/restore functions.
This commit removes the aonpt interrupt masking/unmasking needed after
wake up as that functionality is now available in QMSI 1.4. The QMSI
save/restore functions are called instead.

Change-Id: I61a4a6952e959d0834904bbc8e1eb98092ae4b1c
Signed-off-by: Juan Solano <juanx.solano.menacho@intel.com>
2017-02-08 13:40:51 +00:00
Juan Solano
e19000603b rtc_qmsi: Call QMSI 1.4 context save/restore functions.
This commit removes the RTC interrupt masking/unmasking needed after
wake up as that functionality is now available in QMSI 1.4. The QMSI
save/restore functions are called instead.

Change-Id: I15b5063fa64c71b125edd2c709410b5ae655032e
Signed-off-by: Juan Solano <juanx.solano.menacho@intel.com>
2017-02-08 13:39:54 +00:00
Marcus Shawcroft
fd604a3a9a gpio: Error unsupported access_op consistently.
Several GPIO device drivers support only one of the two possible
access_op modes and return an errno error code for the mode they do
not support.  Use the same errno code across all drivers.

Change-Id: Ic01ce9dee7fb2405d254c60cebee22053c803270
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-08 13:31:09 +00:00
Marcus Shawcroft
48831a9d4c gpio: Error pin out of range consistently.
Several GPIO drivers detect an out of range pin number and return an
errno error code.  Use the same errno code across all drivers.

Change-Id: I0e2949432d6845d12c37064c78f9c228b8e8e45a
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-08 13:31:08 +00:00
Marcus Shawcroft
c35b90890a gpio: Error GPIO_INT with GPIO_DIR_OUT consistently.
Several gpio drivers consider GPIO_INT with GPIO_DIR_OUT to be illegal
and return an errno code.  Use the same errno code across all drivers.

Change-Id: I1594df0cfdf96194685c83c34dff36261896f2de
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-08 13:31:08 +00:00
Qiu Peiyang
8a119a4319 tests: add filesystem api test
This commit verifies below FS APIs:
	fs_open()
	fs_close()
	fs_read()
	fs_write()
	fs_truncate()
	fs_seek()
	fs_tell()
	fs_sync()
	fs_unlink()
	fs_mkdir()
	fs_opendir()
	fs_closedir()
	fs_readdir()
	fs_stat()
	fs_statvfs()

Change-Id: I1a48b9e960b62a1c4986cc577f658199da7a28cd
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-02-08 13:25:35 +00:00
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